--- linux-2.6.24.orig/Makefile +++ linux-2.6.24/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 24 -EXTRAVERSION = .2 +EXTRAVERSION = .6 NAME = Err Metey! A Heury Beelge-a Ret! # *DOCUMENTATION* @@ -189,7 +189,7 @@ # Alternatively CROSS_COMPILE can be set in the environment. # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile - +export KBUILD_BUILDHOST := $(SUBARCH) ARCH ?= $(SUBARCH) CROSS_COMPILE ?= @@ -297,9 +297,17 @@ # Make variables (CC, etc...) +CC = $(CROSS_COMPILE)gcc + +# +# gcc-4.2 won't build powerpc64-smp or ia64. +# +ifneq (,$(findstring $(ARCH), powerpc ia64)) +CC = gcc-4.1 +endif + AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld -CC = $(CROSS_COMPILE)gcc CPP = $(CC) -E AR = $(CROSS_COMPILE)ar NM = $(CROSS_COMPILE)nm @@ -313,6 +321,7 @@ PERL = perl CHECK = sparse + CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF) MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) @@ -321,10 +330,17 @@ CFLAGS_KERNEL = AFLAGS_KERNEL = +# Prefer linux-ubuntu-modules and linux-backports-modules +ifneq ($(KBUILD_SRC),) +ifneq ($(shell if test -e $(KBUILD_OUTPUT)/ubuntu-build; then echo yes; fi),yes) +UBUNTUINCLUDE := -I/usr/src/linux-headers-lum-$(KERNELRELEASE) \ + -I/usr/src/linux-headers-lbm-$(KERNELRELEASE) +endif +endif # Use LINUXINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option -LINUXINCLUDE := -Iinclude \ +LINUXINCLUDE := $(UBUNTUINCLUDE) -Iinclude \ $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ -include include/linux/autoconf.h @@ -332,7 +348,8 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common \ - -Werror-implicit-function-declaration + -Werror-implicit-function-declaration \ + -fno-delete-null-pointer-checks KBUILD_AFLAGS := -D__ASSEMBLY__ # Read KERNELRELEASE from include/config/kernel.release (if it exists) --- linux-2.6.24.orig/sound/pci/rme9652/hdsp.c +++ linux-2.6.24/sound/pci/rme9652/hdsp.c @@ -4548,6 +4548,7 @@ snd_printk(KERN_ERR "Hammerfall-DSP: Firmware needs to be uploaded to the card.\n"); return -EINVAL; } + memset(&info, 0, sizeof(info)); spin_lock_irqsave(&hdsp->lock, flags); info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp); --- linux-2.6.24.orig/sound/pci/rme9652/hdspm.c +++ linux-2.6.24/sound/pci/rme9652/hdspm.c @@ -4133,6 +4133,7 @@ case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO: + memset(&info, 0, sizeof(info)); spin_lock_irq(&hdspm->lock); info.pref_sync_ref = hdspm_pref_sync_ref(hdspm); info.wordclock_sync_check = hdspm_wc_sync_check(hdspm); --- linux-2.6.24.orig/sound/pci/hda/patch_sigmatel.c +++ linux-2.6.24/sound/pci/hda/patch_sigmatel.c @@ -76,6 +76,7 @@ STAC_INTEL_MAC_V1, STAC_INTEL_MAC_V2, STAC_INTEL_MAC_V3, + STAC_INTEL_MAC_V3_S, STAC_INTEL_MAC_V4, STAC_INTEL_MAC_V5, /* for backward compatibility */ @@ -858,6 +859,12 @@ 0x400000fc, 0x400000fb, }; +static unsigned int intel_mac_v3_s_pin_configs[10] = { + 0x012b4050, 0x90a00110, 0x90100140, 0x400000f0, + 0x400000f0, 0x010b3020, 0x014be060, 0x01cbe030, + 0x400000f0, 0x400000f0, +}; + static unsigned int intel_mac_v4_pin_configs[10] = { 0x0321e21f, 0x03a1e02e, 0x9017e110, 0x9017e11f, 0x400000fe, 0x0381e020, 0x1345e230, 0x13c5e240, @@ -878,6 +885,7 @@ [STAC_INTEL_MAC_V1] = intel_mac_v1_pin_configs, [STAC_INTEL_MAC_V2] = intel_mac_v2_pin_configs, [STAC_INTEL_MAC_V3] = intel_mac_v3_pin_configs, + [STAC_INTEL_MAC_V3_S] = intel_mac_v3_s_pin_configs, [STAC_INTEL_MAC_V4] = intel_mac_v4_pin_configs, [STAC_INTEL_MAC_V5] = intel_mac_v5_pin_configs, /* for backward compatibility */ @@ -2587,7 +2595,10 @@ case 0x106b1700: case 0x106b0200: case 0x106b1e00: - spec->board_config = STAC_INTEL_MAC_V3; + if (codec->revision_id == 0x103401)/*LP: #87253*/ + spec->board_config = STAC_INTEL_MAC_V3_S; + else + spec->board_config = STAC_INTEL_MAC_V3; break; case 0x106b1a00: case 0x00000100: --- linux-2.6.24.orig/sound/pci/hda/hda_intel.c +++ linux-2.6.24/sound/pci/hda/hda_intel.c @@ -555,7 +555,8 @@ } if (!chip->rirb.cmds) return chip->rirb.res; /* the last value */ - schedule_timeout_uninterruptible(1); + udelay(10); + cond_resched(); } while (time_after_eq(timeout, jiffies)); if (chip->msi) { --- linux-2.6.24.orig/sound/core/control.c +++ linux-2.6.24/sound/core/control.c @@ -32,6 +32,7 @@ /* max number of user-defined controls */ #define MAX_USER_CONTROLS 32 +#define MAX_CONTROL_COUNT 1028 struct snd_kctl_ioctl { struct list_head list; /* list of all ioctls */ @@ -191,6 +192,10 @@ snd_assert(control != NULL, return NULL); snd_assert(control->count > 0, return NULL); + + if (control->count > MAX_CONTROL_COUNT) + return NULL; + kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); if (kctl == NULL) { snd_printk(KERN_ERR "Cannot allocate control instance\n"); --- linux-2.6.24.orig/sound/core/seq/oss/seq_oss_init.c +++ linux-2.6.24/sound/core/seq/oss/seq_oss_init.c @@ -280,13 +280,10 @@ return 0; _error: - snd_seq_oss_writeq_delete(dp->writeq); - snd_seq_oss_readq_delete(dp->readq); snd_seq_oss_synth_cleanup(dp); snd_seq_oss_midi_cleanup(dp); - delete_port(dp); delete_seq_queue(dp->queue); - kfree(dp); + delete_port(dp); return rc; } @@ -349,8 +346,10 @@ static int delete_port(struct seq_oss_devinfo *dp) { - if (dp->port < 0) + if (dp->port < 0) { + kfree(dp); return 0; + } debug_printk(("delete_port %i\n", dp->port)); return snd_seq_event_port_detach(dp->cseq, dp->port); --- linux-2.6.24.orig/sound/core/seq/oss/seq_oss_synth.c +++ linux-2.6.24/sound/core/seq/oss/seq_oss_synth.c @@ -599,6 +599,9 @@ { struct seq_oss_synth *rec; + if (dev < 0 || dev >= dp->max_synthdev) + return -ENXIO; + if (dp->synths[dev].is_midi) { struct midi_info minf; snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf); --- linux-2.6.24.orig/sound/oss/sequencer.c +++ linux-2.6.24/sound/oss/sequencer.c @@ -242,7 +242,7 @@ return -ENXIO; fmt = (*(short *) &event_rec[0]) & 0xffff; - err = synth_devs[dev]->load_patch(dev, fmt, buf, p + 4, c, 0); + err = synth_devs[dev]->load_patch(dev, fmt, buf + p, c, 0); if (err < 0) return err; --- linux-2.6.24.orig/sound/oss/midi_synth.h +++ linux-2.6.24/sound/oss/midi_synth.h @@ -8,7 +8,7 @@ void midi_synth_close (int dev); void midi_synth_hw_control (int dev, unsigned char *event); int midi_synth_load_patch (int dev, int format, const char __user * addr, - int offs, int count, int pmgr_flag); + int count, int pmgr_flag); void midi_synth_panning (int dev, int channel, int pressure); void midi_synth_aftertouch (int dev, int channel, int pressure); void midi_synth_controller (int dev, int channel, int ctrl_num, int value); --- linux-2.6.24.orig/sound/oss/dev_table.h +++ linux-2.6.24/sound/oss/dev_table.h @@ -271,7 +271,7 @@ void (*reset) (int dev); void (*hw_control) (int dev, unsigned char *event); int (*load_patch) (int dev, int format, const char __user *addr, - int offs, int count, int pmgr_flag); + int count, int pmgr_flag); void (*aftertouch) (int dev, int voice, int pressure); void (*controller) (int dev, int voice, int ctrl_num, int value); void (*panning) (int dev, int voice, int value); --- linux-2.6.24.orig/sound/oss/soundcard.c +++ linux-2.6.24/sound/oss/soundcard.c @@ -87,7 +87,7 @@ int i, n; for (i = 0; i < num_mixer_volumes; i++) { - if (strcmp(name, mixer_vols[i].name) == 0) { + if (strncmp(name, mixer_vols[i].name, 32) == 0) { if (present) mixer_vols[i].num = i; return mixer_vols[i].levels; @@ -99,7 +99,7 @@ } n = num_mixer_volumes++; - strcpy(mixer_vols[n].name, name); + strncpy(mixer_vols[n].name, name, 32); if (present) mixer_vols[n].num = n; --- linux-2.6.24.orig/sound/oss/opl3.c +++ linux-2.6.24/sound/oss/opl3.c @@ -819,7 +819,7 @@ } static int opl3_load_patch(int dev, int format, const char __user *addr, - int offs, int count, int pmgr_flag) + int count, int pmgr_flag) { struct sbi_instrument ins; @@ -829,11 +829,7 @@ return -EINVAL; } - /* - * What the fuck is going on here? We leave junk in the beginning - * of ins and then check the field pretty close to that beginning? - */ - if(copy_from_user(&((char *) &ins)[offs], addr + offs, sizeof(ins) - offs)) + if (copy_from_user(&ins, addr, sizeof(ins))) return -EFAULT; if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) @@ -848,6 +844,10 @@ static void opl3_panning(int dev, int voice, int value) { + + if (voice < 0 || voice >= devc->nr_voice) + return; + devc->voc[voice].panning = value; } @@ -1065,8 +1065,15 @@ static void opl3_setup_voice(int dev, int voice, int chn) { - struct channel_info *info = - &synth_devs[dev]->chn_info[chn]; + struct channel_info *info; + + if (voice < 0 || voice >= devc->nr_voice) + return; + + if (chn < 0 || chn > 15) + return; + + info = &synth_devs[dev]->chn_info[chn]; opl3_set_instr(dev, voice, info->pgm_num); --- linux-2.6.24.orig/sound/oss/midi_synth.c +++ linux-2.6.24/sound/oss/midi_synth.c @@ -476,7 +476,7 @@ int midi_synth_load_patch(int dev, int format, const char __user *addr, - int offs, int count, int pmgr_flag) + int count, int pmgr_flag) { int orig_dev = synth_devs[dev]->midi_dev; @@ -491,33 +491,29 @@ if (!prefix_cmd(orig_dev, 0xf0)) return 0; + /* Invalid patch format */ if (format != SYSEX_PATCH) - { -/* printk("MIDI Error: Invalid patch format (key) 0x%x\n", format);*/ return -EINVAL; - } + + /* Patch header too short */ if (count < hdr_size) - { -/* printk("MIDI Error: Patch header too short\n");*/ return -EINVAL; - } + count -= hdr_size; /* - * Copy the header from user space but ignore the first bytes which have - * been transferred already. + * Copy the header from user space */ - if(copy_from_user(&((char *) &sysex)[offs], &(addr)[offs], hdr_size - offs)) + if (copy_from_user(&sysex, addr, hdr_size)) return -EFAULT; - - if (count < sysex.len) - { -/* printk(KERN_WARNING "MIDI Warning: Sysex record too short (%d<%d)\n", count, (int) sysex.len);*/ + + /* Sysex record too short */ + if ((unsigned)count < (unsigned)sysex.len) sysex.len = count; - } - left = sysex.len; - src_offs = 0; + + left = sysex.len; + src_offs = 0; for (i = 0; i < left && !signal_pending(current); i++) { --- linux-2.6.24.orig/sound/usb/caiaq/caiaq-device.c +++ linux-2.6.24/sound/usb/caiaq/caiaq-device.c @@ -361,8 +361,8 @@ if (c) *c = '\0'; - strcpy(card->driver, MODNAME); - strcpy(card->shortname, dev->product_name); + strlcpy(card->driver, MODNAME, sizeof(card->driver)); + strlcpy(card->shortname, dev->product_name, sizeof(card->shortname)); len = snprintf(card->longname, sizeof(card->longname), "%s %s (serial %s, ", --- linux-2.6.24.orig/sound/usb/caiaq/caiaq-midi.c +++ linux-2.6.24/sound/usb/caiaq/caiaq-midi.c @@ -137,7 +137,7 @@ if (ret < 0) return ret; - strcpy(rmidi->name, device->product_name); + strlcpy(rmidi->name, device->product_name, sizeof(rmidi->name)); rmidi->info_flags = SNDRV_RAWMIDI_INFO_DUPLEX; rmidi->private_data = device; --- linux-2.6.24.orig/sound/usb/caiaq/caiaq-audio.c +++ linux-2.6.24/sound/usb/caiaq/caiaq-audio.c @@ -636,7 +636,7 @@ } dev->pcm->private_data = dev; - strcpy(dev->pcm->name, dev->product_name); + strlcpy(dev->pcm->name, dev->product_name, sizeof(dev->pcm->name)); memset(dev->sub_playback, 0, sizeof(dev->sub_playback)); memset(dev->sub_capture, 0, sizeof(dev->sub_capture)); --- linux-2.6.24.orig/include/asm-x86/pgtable_64.h +++ linux-2.6.24/include/asm-x86/pgtable_64.h @@ -410,6 +410,7 @@ remap_pfn_range(vma, vaddr, pfn, size, prot) #define HAVE_ARCH_UNMAPPED_AREA +#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN #define pgtable_cache_init() do { } while (0) #define check_pgt_cache() do { } while (0) --- linux-2.6.24.orig/include/asm-x86/div64.h +++ linux-2.6.24/include/asm-x86/div64.h @@ -31,24 +31,25 @@ __mod; \ }) -/* - * (long)X = ((long long)divs) / (long)div - * (long)rem = ((long long)divs) % (long)div - * - * Warning, this will do an exception if X overflows. - */ -#define div_long_long_rem(a,b,c) div_ll_X_l_rem(a,b,c) - -static inline long -div_ll_X_l_rem(long long divs, long div, long *rem) +static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) { - long dum2; - __asm__("divl %2":"=a"(dum2), "=d"(*rem) - : "rm"(div), "A"(divs)); - - return dum2; - + union { + u64 v64; + u32 v32[2]; + } d = { dividend }; + u32 upper; + + upper = d.v32[1]; + d.v32[1] = 0; + if (upper >= divisor) { + d.v32[1] = upper / divisor; + upper %= divisor; + } + asm ("divl %2" : "=a" (d.v32[0]), "=d" (*remainder) : + "rm" (divisor), "0" (d.v32[0]), "1" (upper)); + return d.v64; } +#define div_u64_rem div_u64_rem extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); --- linux-2.6.24.orig/include/asm-x86/gart.h +++ linux-2.6.24/include/asm-x86/gart.h @@ -10,6 +10,7 @@ extern void gart_iommu_shutdown(void); extern void __init gart_parse_options(char *); extern void gart_iommu_hole_init(void); +extern void set_up_gart_resume(u32, u32); extern int fallback_aper_order; extern int fallback_aper_force; extern int gart_iommu_aperture; --- linux-2.6.24.orig/include/asm-x86/vmware.h +++ linux-2.6.24/include/asm-x86/vmware.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008, VMware, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or + * NON INFRINGEMENT. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +#ifndef ASM_X86__VMWARE_H +#define ASM_X86__VMWARE_H + +extern unsigned long vmware_get_tsc_khz(void); +extern int vmware_platform(void); +extern void vmware_set_feature_bits(struct cpuinfo_x86 *c); + +#endif --- linux-2.6.24.orig/include/asm-x86/kvm_para.h +++ linux-2.6.24/include/asm-x86/kvm_para.h @@ -0,0 +1,130 @@ +#ifndef __X86_KVM_PARA_H +#define __X86_KVM_PARA_H + +/* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It + * should be used to determine that a VM is running under KVM. + */ +#define KVM_CPUID_SIGNATURE 0x40000000 + +/* This CPUID returns a feature bitmap in eax. Before enabling a particular + * paravirtualization, the appropriate feature bit should be checked. + */ +#define KVM_CPUID_FEATURES 0x40000001 +#define KVM_FEATURE_CLOCKSOURCE 0 + +#define MSR_KVM_WALL_CLOCK 0x11 +#define MSR_KVM_SYSTEM_TIME 0x12 + +#ifdef __KERNEL__ +#include + +/* xen binary-compatible interface. See xen headers for details */ +struct kvm_vcpu_time_info { + uint32_t version; + uint32_t pad0; + uint64_t tsc_timestamp; + uint64_t system_time; + uint32_t tsc_to_system_mul; + int8_t tsc_shift; + int8_t pad[3]; +} __attribute__((__packed__)); /* 32 bytes */ + +struct kvm_wall_clock { + uint32_t wc_version; + uint32_t wc_sec; + uint32_t wc_nsec; +} __attribute__((__packed__)); + + +extern void kvmclock_init(void); + + +/* This instruction is vmcall. On non-VT architectures, it will generate a + * trap that we will then rewrite to the appropriate instruction. + */ +#define KVM_HYPERCALL ".byte 0x0f,0x01,0xc1" + +/* For KVM hypercalls, a three-byte sequence of either the vmrun or the vmmrun + * instruction. The hypervisor may replace it with something else but only the + * instructions are guaranteed to be supported. + * + * Up to four arguments may be passed in rbx, rcx, rdx, and rsi respectively. + * The hypercall number should be placed in rax and the return value will be + * placed in rax. No other registers will be clobbered unless explicited + * noted by the particular hypercall. + */ + +static inline long kvm_hypercall0(unsigned int nr) +{ + long ret; + asm volatile(KVM_HYPERCALL + : "=a"(ret) + : "a"(nr)); + return ret; +} + +static inline long kvm_hypercall1(unsigned int nr, unsigned long p1) +{ + long ret; + asm volatile(KVM_HYPERCALL + : "=a"(ret) + : "a"(nr), "b"(p1)); + return ret; +} + +static inline long kvm_hypercall2(unsigned int nr, unsigned long p1, + unsigned long p2) +{ + long ret; + asm volatile(KVM_HYPERCALL + : "=a"(ret) + : "a"(nr), "b"(p1), "c"(p2)); + return ret; +} + +static inline long kvm_hypercall3(unsigned int nr, unsigned long p1, + unsigned long p2, unsigned long p3) +{ + long ret; + asm volatile(KVM_HYPERCALL + : "=a"(ret) + : "a"(nr), "b"(p1), "c"(p2), "d"(p3)); + return ret; +} + +static inline long kvm_hypercall4(unsigned int nr, unsigned long p1, + unsigned long p2, unsigned long p3, + unsigned long p4) +{ + long ret; + asm volatile(KVM_HYPERCALL + : "=a"(ret) + : "a"(nr), "b"(p1), "c"(p2), "d"(p3), "S"(p4)); + return ret; +} + +static inline int kvm_para_available(void) +{ + unsigned int eax, ebx, ecx, edx; + char signature[13]; + + cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx); + memcpy(signature + 0, &ebx, 4); + memcpy(signature + 4, &ecx, 4); + memcpy(signature + 8, &edx, 4); + signature[12] = 0; + + if (strcmp(signature, "KVMKVMKVM") == 0) + return 1; + + return 0; +} + +static inline unsigned int kvm_arch_para_features(void) +{ + return cpuid_eax(KVM_CPUID_FEATURES); +} + +#endif + +#endif --- linux-2.6.24.orig/include/asm-x86/futex_32.h +++ linux-2.6.24/include/asm-x86/futex_32.h @@ -28,7 +28,7 @@ "1: movl %2, %0\n\ movl %0, %3\n" \ insn "\n" \ -"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\ +"2: lock ; cmpxchgl %3, %2\n\ jnz 1b\n\ 3: .section .fixup,\"ax\"\n\ 4: mov %5, %1\n\ @@ -68,7 +68,7 @@ #endif switch (op) { case FUTEX_OP_ADD: - __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, + __futex_atomic_op1("lock ; xaddl %0, %2", ret, oldval, uaddr, oparg); break; case FUTEX_OP_OR: @@ -111,7 +111,7 @@ return -EFAULT; __asm__ __volatile__( - "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n" + "1: lock ; cmpxchgl %3, %1 \n" "2: .section .fixup, \"ax\" \n" "3: mov %2, %0 \n" --- linux-2.6.24.orig/include/asm-x86/elf.h +++ linux-2.6.24/include/asm-x86/elf.h @@ -245,6 +245,8 @@ dump_task_extended_fpu(tsk, elf_xfpregs) #define ELF_CORE_XFPREG_TYPE NT_PRXFPREG +#define STACK_RND_MASK (0x7ff) + #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) #define VDSO_PRELINK 0 --- linux-2.6.24.orig/include/asm-x86/kvm.h +++ linux-2.6.24/include/asm-x86/kvm.h @@ -0,0 +1,191 @@ +#ifndef __LINUX_KVM_X86_H +#define __LINUX_KVM_X86_H + +/* + * KVM x86 specific structures and definitions + * + */ + +#include +#include + +/* Architectural interrupt line count. */ +#define KVM_NR_INTERRUPTS 256 + +struct kvm_memory_alias { + __u32 slot; /* this has a different namespace than memory slots */ + __u32 flags; + __u64 guest_phys_addr; + __u64 memory_size; + __u64 target_phys_addr; +}; + +/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */ +struct kvm_pic_state { + __u8 last_irr; /* edge detection */ + __u8 irr; /* interrupt request register */ + __u8 imr; /* interrupt mask register */ + __u8 isr; /* interrupt service register */ + __u8 priority_add; /* highest irq priority */ + __u8 irq_base; + __u8 read_reg_select; + __u8 poll; + __u8 special_mask; + __u8 init_state; + __u8 auto_eoi; + __u8 rotate_on_auto_eoi; + __u8 special_fully_nested_mode; + __u8 init4; /* true if 4 byte init */ + __u8 elcr; /* PIIX edge/trigger selection */ + __u8 elcr_mask; +}; + +#define KVM_IOAPIC_NUM_PINS 24 +struct kvm_ioapic_state { + __u64 base_address; + __u32 ioregsel; + __u32 id; + __u32 irr; + __u32 pad; + union { + __u64 bits; + struct { + __u8 vector; + __u8 delivery_mode:3; + __u8 dest_mode:1; + __u8 delivery_status:1; + __u8 polarity:1; + __u8 remote_irr:1; + __u8 trig_mode:1; + __u8 mask:1; + __u8 reserve:7; + __u8 reserved[4]; + __u8 dest_id; + } fields; + } redirtbl[KVM_IOAPIC_NUM_PINS]; +}; + +#define KVM_IRQCHIP_PIC_MASTER 0 +#define KVM_IRQCHIP_PIC_SLAVE 1 +#define KVM_IRQCHIP_IOAPIC 2 + +/* for KVM_GET_REGS and KVM_SET_REGS */ +struct kvm_regs { + /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */ + __u64 rax, rbx, rcx, rdx; + __u64 rsi, rdi, rsp, rbp; + __u64 r8, r9, r10, r11; + __u64 r12, r13, r14, r15; + __u64 rip, rflags; +}; + +/* for KVM_GET_LAPIC and KVM_SET_LAPIC */ +#define KVM_APIC_REG_SIZE 0x400 +struct kvm_lapic_state { + char regs[KVM_APIC_REG_SIZE]; +}; + +struct kvm_segment { + __u64 base; + __u32 limit; + __u16 selector; + __u8 type; + __u8 present, dpl, db, s, l, g, avl; + __u8 unusable; + __u8 padding; +}; + +struct kvm_dtable { + __u64 base; + __u16 limit; + __u16 padding[3]; +}; + + +/* for KVM_GET_SREGS and KVM_SET_SREGS */ +struct kvm_sregs { + /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */ + struct kvm_segment cs, ds, es, fs, gs, ss; + struct kvm_segment tr, ldt; + struct kvm_dtable gdt, idt; + __u64 cr0, cr2, cr3, cr4, cr8; + __u64 efer; + __u64 apic_base; + __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64]; +}; + +/* for KVM_GET_FPU and KVM_SET_FPU */ +struct kvm_fpu { + __u8 fpr[8][16]; + __u16 fcw; + __u16 fsw; + __u8 ftwx; /* in fxsave format */ + __u8 pad1; + __u16 last_opcode; + __u64 last_ip; + __u64 last_dp; + __u8 xmm[16][16]; + __u32 mxcsr; + __u32 pad2; +}; + +struct kvm_msr_entry { + __u32 index; + __u32 reserved; + __u64 data; +}; + +/* for KVM_GET_MSRS and KVM_SET_MSRS */ +struct kvm_msrs { + __u32 nmsrs; /* number of msrs in entries */ + __u32 pad; + + struct kvm_msr_entry entries[0]; +}; + +/* for KVM_GET_MSR_INDEX_LIST */ +struct kvm_msr_list { + __u32 nmsrs; /* number of msrs in entries */ + __u32 indices[0]; +}; + + +struct kvm_cpuid_entry { + __u32 function; + __u32 eax; + __u32 ebx; + __u32 ecx; + __u32 edx; + __u32 padding; +}; + +/* for KVM_SET_CPUID */ +struct kvm_cpuid { + __u32 nent; + __u32 padding; + struct kvm_cpuid_entry entries[0]; +}; + +struct kvm_cpuid_entry2 { + __u32 function; + __u32 index; + __u32 flags; + __u32 eax; + __u32 ebx; + __u32 ecx; + __u32 edx; + __u32 padding[3]; +}; + +#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX 1 +#define KVM_CPUID_FLAG_STATEFUL_FUNC 2 +#define KVM_CPUID_FLAG_STATE_READ_NEXT 4 + +/* for KVM_SET_CPUID2 */ +struct kvm_cpuid2 { + __u32 nent; + __u32 padding; + struct kvm_cpuid_entry2 entries[0]; +}; + +#endif --- linux-2.6.24.orig/include/asm-x86/nops_32.h +++ linux-2.6.24/include/asm-x86/nops_32.h @@ -0,0 +1,91 @@ +#ifndef _ASM_NOPS_H +#define _ASM_NOPS_H + +/* Define nops for use with alternative() */ + +/* generic versions from gas */ +#define GENERIC_NOP1 ".byte 0x90\n" +#define GENERIC_NOP2 ".byte 0x89,0xf6\n" +#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n" +#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n" +#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4 +#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n" +#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n" +#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7 + +/* Opteron nops */ +#define K8_NOP1 GENERIC_NOP1 +#define K8_NOP2 ".byte 0x66,0x90\n" +#define K8_NOP3 ".byte 0x66,0x66,0x90\n" +#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n" +#define K8_NOP5 K8_NOP3 K8_NOP2 +#define K8_NOP6 K8_NOP3 K8_NOP3 +#define K8_NOP7 K8_NOP4 K8_NOP3 +#define K8_NOP8 K8_NOP4 K8_NOP4 + +/* K7 nops */ +/* uses eax dependencies (arbitary choice) */ +#define K7_NOP1 GENERIC_NOP1 +#define K7_NOP2 ".byte 0x8b,0xc0\n" +#define K7_NOP3 ".byte 0x8d,0x04,0x20\n" +#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n" +#define K7_NOP5 K7_NOP4 ASM_NOP1 +#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n" +#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n" +#define K7_NOP8 K7_NOP7 ASM_NOP1 + +/* P6 nops */ +/* uses eax dependencies (Intel-recommended choice) */ +#define P6_NOP1 GENERIC_NOP1 +#define P6_NOP2 ".byte 0x66,0x90\n" +#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n" +#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n" +#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n" +#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n" +#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" +#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" + +#ifdef CONFIG_MK8 +#define ASM_NOP1 K8_NOP1 +#define ASM_NOP2 K8_NOP2 +#define ASM_NOP3 K8_NOP3 +#define ASM_NOP4 K8_NOP4 +#define ASM_NOP5 K8_NOP5 +#define ASM_NOP6 K8_NOP6 +#define ASM_NOP7 K8_NOP7 +#define ASM_NOP8 K8_NOP8 +#elif defined(CONFIG_MK7) +#define ASM_NOP1 K7_NOP1 +#define ASM_NOP2 K7_NOP2 +#define ASM_NOP3 K7_NOP3 +#define ASM_NOP4 K7_NOP4 +#define ASM_NOP5 K7_NOP5 +#define ASM_NOP6 K7_NOP6 +#define ASM_NOP7 K7_NOP7 +#define ASM_NOP8 K7_NOP8 +#elif (defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \ + defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \ + defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)) && \ + !defined(CONFIG_X86_GENERIC) +#define ASM_NOP1 P6_NOP1 +#define ASM_NOP2 P6_NOP2 +#define ASM_NOP3 P6_NOP3 +#define ASM_NOP4 P6_NOP4 +#define ASM_NOP5 P6_NOP5 +#define ASM_NOP6 P6_NOP6 +#define ASM_NOP7 P6_NOP7 +#define ASM_NOP8 P6_NOP8 +#else +#define ASM_NOP1 GENERIC_NOP1 +#define ASM_NOP2 GENERIC_NOP2 +#define ASM_NOP3 GENERIC_NOP3 +#define ASM_NOP4 GENERIC_NOP4 +#define ASM_NOP5 GENERIC_NOP5 +#define ASM_NOP6 GENERIC_NOP6 +#define ASM_NOP7 GENERIC_NOP7 +#define ASM_NOP8 GENERIC_NOP8 +#endif + +#define ASM_NOP_MAX 8 + +#endif --- linux-2.6.24.orig/include/asm-x86/hypervisor.h +++ linux-2.6.24/include/asm-x86/hypervisor.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008, VMware, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or + * NON INFRINGEMENT. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +#ifndef ASM_X86__HYPERVISOR_H +#define ASM_X86__HYPERVISOR_H + +extern unsigned long get_hypervisor_tsc_freq(void); +extern void init_hypervisor(struct cpuinfo_x86 *c); + +#endif --- linux-2.6.24.orig/include/asm-x86/cpufeature_32.h +++ linux-2.6.24/include/asm-x86/cpufeature_32.h @@ -82,6 +82,9 @@ /* 14 free */ #define X86_FEATURE_SYNC_RDTSC (3*32+15) /* RDTSC synchronizes the CPU */ #define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ +#define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */ +#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */ +#define X86_FEATURE_TSC_RELIABLE (3*32+23) /* TSC is known to be reliable */ /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ @@ -93,6 +96,7 @@ #define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */ #define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */ #define X86_FEATURE_DCA (4*32+18) /* Direct Cache Access */ +#define X86_FEATURE_HYPERVISOR (4*32+31) /* Running on a hypervisor */ /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ #define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */ @@ -165,6 +169,7 @@ #define cpu_has_pebs boot_cpu_has(X86_FEATURE_PEBS) #define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLSH) #define cpu_has_bts boot_cpu_has(X86_FEATURE_BTS) +#define cpu_has_hypervisor boot_cpu_has(X86_FEATURE_HYPERVISOR) #endif /* __ASM_I386_CPUFEATURE_H */ --- linux-2.6.24.orig/include/asm-x86/page_64.h +++ linux-2.6.24/include/asm-x86/page_64.h @@ -45,6 +45,9 @@ void clear_page(void *); void copy_page(void *, void *); +extern int page_is_ram(unsigned long pagenr); +extern int devmem_is_allowed(unsigned long pagenr); + #define clear_user_page(page, vaddr, pg) clear_page(page) #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) --- linux-2.6.24.orig/include/asm-x86/io_64.h +++ linux-2.6.24/include/asm-x86/io_64.h @@ -35,13 +35,20 @@ * - Arnaldo Carvalho de Melo */ -#define __SLOW_DOWN_IO "\noutb %%al,$0x80" +extern void native_io_delay(void); +extern int io_delay_type; +extern void io_delay_init(void); + +static inline void slow_down_io(void) +{ + native_io_delay(); #ifdef REALLY_SLOW_IO -#define __FULL_SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO -#else -#define __FULL_SLOW_DOWN_IO __SLOW_DOWN_IO + native_io_delay(); + native_io_delay(); + native_io_delay(); #endif +} /* * Talk about misusing macros.. @@ -50,21 +57,21 @@ static inline void out##s(unsigned x value, unsigned short port) { #define __OUT2(s,s1,s2) \ -__asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1" +__asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1" : : "a" (value), "Nd" (port)) #define __OUT(s,s1,x) \ -__OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port)); } \ -__OUT1(s##_p,x) __OUT2(s,s1,"w") __FULL_SLOW_DOWN_IO : : "a" (value), "Nd" (port));} \ +__OUT1(s,x) __OUT2(s,s1,"w"); } \ +__OUT1(s##_p,x) __OUT2(s,s1,"w"); slow_down_io(); } #define __IN1(s) \ static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v; #define __IN2(s,s1,s2) \ -__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0" +__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0" : "=a" (_v) : "Nd" (port)) -#define __IN(s,s1,i...) \ -__IN1(s) __IN2(s,s1,"w") : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \ -__IN1(s##_p) __IN2(s,s1,"w") __FULL_SLOW_DOWN_IO : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \ +#define __IN(s,s1) \ +__IN1(s) __IN2(s,s1,"w"); return _v; } \ +__IN1(s##_p) __IN2(s,s1,"w"); slow_down_io(); return _v; } #define __INS(s) \ static inline void ins##s(unsigned short port, void * addr, unsigned long count) \ --- linux-2.6.24.orig/include/asm-x86/msr.h +++ linux-2.6.24/include/asm-x86/msr.h @@ -13,6 +13,7 @@ #ifndef __ASSEMBLY__ #include +#include static inline unsigned long long native_read_msr(unsigned int msr) { @@ -69,7 +70,11 @@ static inline unsigned long long native_read_tsc(void) { unsigned long long val; + + rdtsc_barrier(); asm volatile("rdtsc" : "=A" (val)); + rdtsc_barrier(); + return val; } @@ -169,6 +174,7 @@ #ifndef __ASSEMBLY__ #include +#include /* * Access to machine-specific registers (available on 586 and better only) * Note: the rd* operations modify the parameters directly (without using @@ -220,6 +226,17 @@ #define write_rdtscp_aux(val) wrmsr(0xc0000103, val, 0) +static inline unsigned long long native_read_tsc(void) +{ + unsigned long long val; + + rdtsc_barrier(); + rdtscll(val); + rdtsc_barrier(); + + return val; +} + #define rdpmc(counter,low,high) \ __asm__ __volatile__("rdpmc" \ : "=a" (low), "=d" (high) \ --- linux-2.6.24.orig/include/asm-x86/seccomp_32.h +++ linux-2.6.24/include/asm-x86/seccomp_32.h @@ -1,11 +1,5 @@ #ifndef _ASM_SECCOMP_H -#include - -#ifdef TIF_32BIT -#error "unexpected TIF_32BIT on i386" -#endif - #include #define __NR_seccomp_read __NR_read --- linux-2.6.24.orig/include/asm-x86/futex_64.h +++ linux-2.6.24/include/asm-x86/futex_64.h @@ -27,7 +27,7 @@ "1: movl %2, %0\n\ movl %0, %3\n" \ insn "\n" \ -"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\ +"2: lock ; cmpxchgl %3, %2\n\ jnz 1b\n\ 3: .section .fixup,\"ax\"\n\ 4: mov %5, %1\n\ @@ -62,7 +62,7 @@ __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg); break; case FUTEX_OP_ADD: - __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval, + __futex_atomic_op1("lock ; xaddl %0, %2", ret, oldval, uaddr, oparg); break; case FUTEX_OP_OR: @@ -101,7 +101,7 @@ return -EFAULT; __asm__ __volatile__( - "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n" + "1: lock ; cmpxchgl %3, %1 \n" "2: .section .fixup, \"ax\" \n" "3: mov %2, %0 \n" --- linux-2.6.24.orig/include/asm-x86/nops.h +++ linux-2.6.24/include/asm-x86/nops.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "nops_32.h" +#else +# include "nops_64.h" +#endif --- linux-2.6.24.orig/include/asm-x86/io_apic_64.h +++ linux-2.6.24/include/asm-x86/io_apic_64.h @@ -129,7 +129,7 @@ extern int sis_apic_bug; /* dummy */ -void enable_NMI_through_LVT0 (void * dummy); +void enable_NMI_through_LVT0(void); extern spinlock_t i8259A_lock; --- linux-2.6.24.orig/include/asm-x86/page_32.h +++ linux-2.6.24/include/asm-x86/page_32.h @@ -166,6 +166,7 @@ extern int sysctl_legacy_va_layout; extern int page_is_ram(unsigned long pagenr); +extern int devmem_is_allowed(unsigned long pagenr); #endif /* __ASSEMBLY__ */ --- linux-2.6.24.orig/include/asm-x86/processor_64.h +++ linux-2.6.24/include/asm-x86/processor_64.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -76,6 +77,7 @@ __u8 cpu_core_id; /* Core id. */ __u8 cpu_index; /* index into per_cpu list */ #endif + unsigned int x86_hyper_vendor; } ____cacheline_aligned; #define X86_VENDOR_INTEL 0 @@ -88,6 +90,9 @@ #define X86_VENDOR_NUM 8 #define X86_VENDOR_UNKNOWN 0xff +#define X86_HYPER_VENDOR_NONE 0 +#define X86_HYPER_VENDOR_VMWARE 1 + #ifdef CONFIG_SMP DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info); #define cpu_data(cpu) per_cpu(cpu_info, cpu) @@ -335,50 +340,6 @@ struct extended_signature sigs[0]; }; - -#if defined(CONFIG_MPSC) || defined(CONFIG_MCORE2) -#define ASM_NOP1 P6_NOP1 -#define ASM_NOP2 P6_NOP2 -#define ASM_NOP3 P6_NOP3 -#define ASM_NOP4 P6_NOP4 -#define ASM_NOP5 P6_NOP5 -#define ASM_NOP6 P6_NOP6 -#define ASM_NOP7 P6_NOP7 -#define ASM_NOP8 P6_NOP8 -#else -#define ASM_NOP1 K8_NOP1 -#define ASM_NOP2 K8_NOP2 -#define ASM_NOP3 K8_NOP3 -#define ASM_NOP4 K8_NOP4 -#define ASM_NOP5 K8_NOP5 -#define ASM_NOP6 K8_NOP6 -#define ASM_NOP7 K8_NOP7 -#define ASM_NOP8 K8_NOP8 -#endif - -/* Opteron nops */ -#define K8_NOP1 ".byte 0x90\n" -#define K8_NOP2 ".byte 0x66,0x90\n" -#define K8_NOP3 ".byte 0x66,0x66,0x90\n" -#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n" -#define K8_NOP5 K8_NOP3 K8_NOP2 -#define K8_NOP6 K8_NOP3 K8_NOP3 -#define K8_NOP7 K8_NOP4 K8_NOP3 -#define K8_NOP8 K8_NOP4 K8_NOP4 - -/* P6 nops */ -/* uses eax dependencies (Intel-recommended choice) */ -#define P6_NOP1 ".byte 0x90\n" -#define P6_NOP2 ".byte 0x66,0x90\n" -#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n" -#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n" -#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n" -#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n" -#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" -#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" - -#define ASM_NOP_MAX 8 - /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ static inline void rep_nop(void) { --- linux-2.6.24.orig/include/asm-x86/tsc.h +++ linux-2.6.24/include/asm-x86/tsc.h @@ -32,32 +32,17 @@ return ret; } -/* Like get_cycles, but make sure the CPU is synchronized. */ -static __always_inline cycles_t get_cycles_sync(void) +static inline cycles_t vget_cycles(void) { - unsigned long long ret; - unsigned eax, edx; - - /* - * Use RDTSCP if possible; it is guaranteed to be synchronous - * and doesn't cause a VMEXIT on Hypervisors - */ - alternative_io(ASM_NOP3, ".byte 0x0f,0x01,0xf9", X86_FEATURE_RDTSCP, - ASM_OUTPUT2("=a" (eax), "=d" (edx)), - "a" (0U), "d" (0U) : "ecx", "memory"); - ret = (((unsigned long long)edx) << 32) | ((unsigned long long)eax); - if (ret) - return ret; - /* - * Don't do an additional sync on CPUs where we know - * RDTSC is already synchronous: + * We only do VDSOs on TSC capable CPUs, so this shouldnt + * access boot_cpu_data (which is not VDSO-safe): */ - alternative_io("cpuid", ASM_NOP2, X86_FEATURE_SYNC_RDTSC, - "=a" (eax), "0" (1) : "ebx","ecx","edx","memory"); - rdtscll(ret); - - return ret; +#ifndef CONFIG_X86_TSC + if (!cpu_has_tsc) + return 0; +#endif + return (cycles_t) native_read_tsc(); } extern void tsc_init(void); --- linux-2.6.24.orig/include/asm-x86/thread_info_64.h +++ linux-2.6.24/include/asm-x86/thread_info_64.h @@ -118,7 +118,6 @@ /* 16 free */ #define TIF_IA32 17 /* 32bit process */ #define TIF_FORK 18 /* ret_from_fork */ -#define TIF_ABI_PENDING 19 #define TIF_MEMDIE 20 #define TIF_DEBUG 21 /* uses debug registers */ #define TIF_IO_BITMAP 22 /* uses I/O bitmap */ @@ -135,7 +134,6 @@ #define _TIF_MCE_NOTIFY (1< +#include + +#include +#include +#include + +#include + +#define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1) +#define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD)) +#define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL) + +#define KVM_GUEST_CR0_MASK \ + (X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE \ + | X86_CR0_NW | X86_CR0_CD) +#define KVM_VM_CR0_ALWAYS_ON \ + (X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE | X86_CR0_TS \ + | X86_CR0_MP) +#define KVM_GUEST_CR4_MASK \ + (X86_CR4_VME | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_PGE | X86_CR4_VMXE) +#define KVM_PMODE_VM_CR4_ALWAYS_ON (X86_CR4_PAE | X86_CR4_VMXE) +#define KVM_RMODE_VM_CR4_ALWAYS_ON (X86_CR4_VME | X86_CR4_PAE | X86_CR4_VMXE) + +#define INVALID_PAGE (~(hpa_t)0) +#define UNMAPPED_GVA (~(gpa_t)0) + +/* shadow tables are PAE even on non-PAE hosts */ +#define KVM_HPAGE_SHIFT 21 +#define KVM_HPAGE_SIZE (1UL << KVM_HPAGE_SHIFT) +#define KVM_HPAGE_MASK (~(KVM_HPAGE_SIZE - 1)) + +#define KVM_PAGES_PER_HPAGE (KVM_HPAGE_SIZE / PAGE_SIZE) + +#define DE_VECTOR 0 +#define UD_VECTOR 6 +#define NM_VECTOR 7 +#define DF_VECTOR 8 +#define TS_VECTOR 10 +#define NP_VECTOR 11 +#define SS_VECTOR 12 +#define GP_VECTOR 13 +#define PF_VECTOR 14 + +#define SELECTOR_TI_MASK (1 << 2) +#define SELECTOR_RPL_MASK 0x03 + +#define IOPL_SHIFT 12 + +#define KVM_ALIAS_SLOTS 4 + +#define KVM_PERMILLE_MMU_PAGES 20 +#define KVM_MIN_ALLOC_MMU_PAGES 64 +#define KVM_MMU_HASH_SHIFT 10 +#define KVM_NUM_MMU_PAGES (1 << KVM_MMU_HASH_SHIFT) +#define KVM_MIN_FREE_MMU_PAGES 5 +#define KVM_REFILL_PAGES 25 +#define KVM_MAX_CPUID_ENTRIES 40 + +extern spinlock_t kvm_lock; +extern struct list_head vm_list; + +struct kvm_vcpu; +struct kvm; + +enum { + VCPU_REGS_RAX = 0, + VCPU_REGS_RCX = 1, + VCPU_REGS_RDX = 2, + VCPU_REGS_RBX = 3, + VCPU_REGS_RSP = 4, + VCPU_REGS_RBP = 5, + VCPU_REGS_RSI = 6, + VCPU_REGS_RDI = 7, +#ifdef CONFIG_X86_64 + VCPU_REGS_R8 = 8, + VCPU_REGS_R9 = 9, + VCPU_REGS_R10 = 10, + VCPU_REGS_R11 = 11, + VCPU_REGS_R12 = 12, + VCPU_REGS_R13 = 13, + VCPU_REGS_R14 = 14, + VCPU_REGS_R15 = 15, +#endif + NR_VCPU_REGS +}; + +enum { + VCPU_SREG_CS, + VCPU_SREG_DS, + VCPU_SREG_ES, + VCPU_SREG_FS, + VCPU_SREG_GS, + VCPU_SREG_SS, + VCPU_SREG_TR, + VCPU_SREG_LDTR, +}; + +#include + +#define KVM_NR_MEM_OBJS 40 + +/* + * We don't want allocation failures within the mmu code, so we preallocate + * enough memory for a single page fault in a cache. + */ +struct kvm_mmu_memory_cache { + int nobjs; + void *objects[KVM_NR_MEM_OBJS]; +}; + +#define NR_PTE_CHAIN_ENTRIES 5 + +struct kvm_pte_chain { + u64 *parent_ptes[NR_PTE_CHAIN_ENTRIES]; + struct hlist_node link; +}; + +/* + * kvm_mmu_page_role, below, is defined as: + * + * bits 0:3 - total guest paging levels (2-4, or zero for real mode) + * bits 4:7 - page table level for this shadow (1-4) + * bits 8:9 - page table quadrant for 2-level guests + * bit 16 - "metaphysical" - gfn is not a real page (huge page/real mode) + * bits 17:19 - common access permissions for all ptes in this shadow page + */ +union kvm_mmu_page_role { + unsigned word; + struct { + unsigned glevels : 4; + unsigned level : 4; + unsigned quadrant : 2; + unsigned pad_for_nice_hex_output : 6; + unsigned metaphysical : 1; + unsigned access : 3; + unsigned invalid : 1; + }; +}; + +struct kvm_mmu_page { + struct list_head link; + struct hlist_node hash_link; + + /* + * The following two entries are used to key the shadow page in the + * hash table. + */ + gfn_t gfn; + union kvm_mmu_page_role role; + + u64 *spt; + /* hold the gfn of each spte inside spt */ + gfn_t *gfns; + unsigned long slot_bitmap; /* One bit set per slot which has memory + * in this shadow page. + */ + int multimapped; /* More than one parent_pte? */ + int root_count; /* Currently serving as active root */ + union { + u64 *parent_pte; /* !multimapped */ + struct hlist_head parent_ptes; /* multimapped, kvm_pte_chain */ + }; +}; + +/* + * x86 supports 3 paging modes (4-level 64-bit, 3-level 64-bit, and 2-level + * 32-bit). The kvm_mmu structure abstracts the details of the current mmu + * mode. + */ +struct kvm_mmu { + void (*new_cr3)(struct kvm_vcpu *vcpu); + int (*page_fault)(struct kvm_vcpu *vcpu, gva_t gva, u32 err); + void (*free)(struct kvm_vcpu *vcpu); + gpa_t (*gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t gva, u32 access, + u32 *error); + void (*prefetch_page)(struct kvm_vcpu *vcpu, + struct kvm_mmu_page *page); + hpa_t root_hpa; + int root_level; + int shadow_root_level; + + u64 *pae_root; +}; + +struct kvm_vcpu_arch { + u64 host_tsc; + int interrupt_window_open; + unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */ + DECLARE_BITMAP(irq_pending, KVM_NR_INTERRUPTS); + unsigned long regs[NR_VCPU_REGS]; /* for rsp: vcpu_load_rsp_rip() */ + unsigned long rip; /* needs vcpu_load_rsp_rip() */ + + unsigned long cr0; + unsigned long cr2; + unsigned long cr3; + unsigned long cr4; + unsigned long cr8; + u64 pdptrs[4]; /* pae */ + u64 shadow_efer; + u64 apic_base; + struct kvm_lapic *apic; /* kernel irqchip context */ +#define VCPU_MP_STATE_RUNNABLE 0 +#define VCPU_MP_STATE_UNINITIALIZED 1 +#define VCPU_MP_STATE_INIT_RECEIVED 2 +#define VCPU_MP_STATE_SIPI_RECEIVED 3 +#define VCPU_MP_STATE_HALTED 4 + int mp_state; + int sipi_vector; + u64 ia32_misc_enable_msr; + bool tpr_access_reporting; + + struct kvm_mmu mmu; + + struct kvm_mmu_memory_cache mmu_pte_chain_cache; + struct kvm_mmu_memory_cache mmu_rmap_desc_cache; + struct kvm_mmu_memory_cache mmu_page_cache; + struct kvm_mmu_memory_cache mmu_page_header_cache; + + gfn_t last_pt_write_gfn; + int last_pt_write_count; + u64 *last_pte_updated; + + struct { + gfn_t gfn; /* presumed gfn during guest pte update */ + struct page *page; /* page corresponding to that gfn */ + int largepage; + } update_pte; + + struct i387_fxsave_struct host_fx_image; + struct i387_fxsave_struct guest_fx_image; + + gva_t mmio_fault_cr2; + struct kvm_pio_request pio; + void *pio_data; + + struct kvm_queued_exception { + bool pending; + bool has_error_code; + u8 nr; + u32 error_code; + } exception; + + struct { + int active; + u8 save_iopl; + struct kvm_save_segment { + u16 selector; + unsigned long base; + u32 limit; + u32 ar; + } tr, es, ds, fs, gs; + } rmode; + int halt_request; /* real mode on Intel only */ + + int cpuid_nent; + struct kvm_cpuid_entry2 cpuid_entries[KVM_MAX_CPUID_ENTRIES]; + /* emulate context */ + + struct x86_emulate_ctxt emulate_ctxt; + + gpa_t time; + struct kvm_vcpu_time_info hv_clock; + unsigned int time_offset; + struct page *time_page; +}; + +struct kvm_mem_alias { + gfn_t base_gfn; + unsigned long npages; + gfn_t target_gfn; +}; + +struct kvm_arch{ + int naliases; + struct kvm_mem_alias aliases[KVM_ALIAS_SLOTS]; + + unsigned int n_free_mmu_pages; + unsigned int n_requested_mmu_pages; + unsigned int n_alloc_mmu_pages; + struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES]; + /* + * Hash table of struct kvm_mmu_page. + */ + struct list_head active_mmu_pages; + struct kvm_pic *vpic; + struct kvm_ioapic *vioapic; + + int round_robin_prev_vcpu; + unsigned int tss_addr; + struct page *apic_access_page; + + gpa_t wall_clock; +}; + +struct kvm_vm_stat { + u32 mmu_shadow_zapped; + u32 mmu_pte_write; + u32 mmu_pte_updated; + u32 mmu_pde_zapped; + u32 mmu_flooded; + u32 mmu_recycled; + u32 mmu_cache_miss; + u32 remote_tlb_flush; + u32 lpages; +}; + +struct kvm_vcpu_stat { + u32 pf_fixed; + u32 pf_guest; + u32 tlb_flush; + u32 invlpg; + + u32 exits; + u32 io_exits; + u32 mmio_exits; + u32 signal_exits; + u32 irq_window_exits; + u32 halt_exits; + u32 halt_wakeup; + u32 request_irq_exits; + u32 irq_exits; + u32 host_state_reload; + u32 efer_reload; + u32 fpu_reload; + u32 insn_emulation; + u32 insn_emulation_fail; + u32 hypercalls; +}; + +struct descriptor_table { + u16 limit; + unsigned long base; +} __attribute__((packed)); + +struct kvm_x86_ops { + int (*cpu_has_kvm_support)(void); /* __init */ + int (*disabled_by_bios)(void); /* __init */ + void (*hardware_enable)(void *dummy); /* __init */ + void (*hardware_disable)(void *dummy); + void (*check_processor_compatibility)(void *rtn); + int (*hardware_setup)(void); /* __init */ + void (*hardware_unsetup)(void); /* __exit */ + bool (*cpu_has_accelerated_tpr)(void); + + /* Create, but do not attach this VCPU */ + struct kvm_vcpu *(*vcpu_create)(struct kvm *kvm, unsigned id); + void (*vcpu_free)(struct kvm_vcpu *vcpu); + int (*vcpu_reset)(struct kvm_vcpu *vcpu); + + void (*prepare_guest_switch)(struct kvm_vcpu *vcpu); + void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu); + void (*vcpu_put)(struct kvm_vcpu *vcpu); + void (*vcpu_decache)(struct kvm_vcpu *vcpu); + + int (*set_guest_debug)(struct kvm_vcpu *vcpu, + struct kvm_debug_guest *dbg); + void (*guest_debug_pre)(struct kvm_vcpu *vcpu); + int (*get_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata); + int (*set_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 data); + u64 (*get_segment_base)(struct kvm_vcpu *vcpu, int seg); + void (*get_segment)(struct kvm_vcpu *vcpu, + struct kvm_segment *var, int seg); + int (*get_cpl)(struct kvm_vcpu *vcpu); + void (*set_segment)(struct kvm_vcpu *vcpu, + struct kvm_segment *var, int seg); + void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l); + void (*decache_cr4_guest_bits)(struct kvm_vcpu *vcpu); + void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); + void (*set_cr3)(struct kvm_vcpu *vcpu, unsigned long cr3); + void (*set_cr4)(struct kvm_vcpu *vcpu, unsigned long cr4); + void (*set_efer)(struct kvm_vcpu *vcpu, u64 efer); + void (*get_idt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); + void (*set_idt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); + void (*get_gdt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); + void (*set_gdt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); + unsigned long (*get_dr)(struct kvm_vcpu *vcpu, int dr); + void (*set_dr)(struct kvm_vcpu *vcpu, int dr, unsigned long value, + int *exception); + void (*cache_regs)(struct kvm_vcpu *vcpu); + void (*decache_regs)(struct kvm_vcpu *vcpu); + unsigned long (*get_rflags)(struct kvm_vcpu *vcpu); + void (*set_rflags)(struct kvm_vcpu *vcpu, unsigned long rflags); + + void (*tlb_flush)(struct kvm_vcpu *vcpu); + + void (*run)(struct kvm_vcpu *vcpu, struct kvm_run *run); + int (*handle_exit)(struct kvm_run *run, struct kvm_vcpu *vcpu); + void (*skip_emulated_instruction)(struct kvm_vcpu *vcpu); + void (*patch_hypercall)(struct kvm_vcpu *vcpu, + unsigned char *hypercall_addr); + int (*get_irq)(struct kvm_vcpu *vcpu); + void (*set_irq)(struct kvm_vcpu *vcpu, int vec); + void (*queue_exception)(struct kvm_vcpu *vcpu, unsigned nr, + bool has_error_code, u32 error_code); + bool (*exception_injected)(struct kvm_vcpu *vcpu); + void (*inject_pending_irq)(struct kvm_vcpu *vcpu); + void (*inject_pending_vectors)(struct kvm_vcpu *vcpu, + struct kvm_run *run); + + int (*set_tss_addr)(struct kvm *kvm, unsigned int addr); +}; + +extern struct kvm_x86_ops *kvm_x86_ops; + +int kvm_mmu_module_init(void); +void kvm_mmu_module_exit(void); + +void kvm_mmu_destroy(struct kvm_vcpu *vcpu); +int kvm_mmu_create(struct kvm_vcpu *vcpu); +int kvm_mmu_setup(struct kvm_vcpu *vcpu); +void kvm_mmu_set_nonpresent_ptes(u64 trap_pte, u64 notrap_pte); + +int kvm_mmu_reset_context(struct kvm_vcpu *vcpu); +void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot); +void kvm_mmu_zap_all(struct kvm *kvm); +unsigned int kvm_mmu_calculate_mmu_pages(struct kvm *kvm); +void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages); + +int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); + +enum emulation_result { + EMULATE_DONE, /* no further processing */ + EMULATE_DO_MMIO, /* kvm_run filled with mmio request */ + EMULATE_FAIL, /* can't emulate this instruction */ +}; + +#define EMULTYPE_NO_DECODE (1 << 0) +#define EMULTYPE_TRAP_UD (1 << 1) +int emulate_instruction(struct kvm_vcpu *vcpu, struct kvm_run *run, + unsigned long cr2, u16 error_code, int emulation_type); +void kvm_report_emulation_failure(struct kvm_vcpu *cvpu, const char *context); +void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); +void realmode_lidt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); +void realmode_lmsw(struct kvm_vcpu *vcpu, unsigned long msw, + unsigned long *rflags); + +unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr); +void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long value, + unsigned long *rflags); +void kvm_enable_efer_bits(u64); +int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data); +int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data); + +struct x86_emulate_ctxt; + +int kvm_emulate_pio(struct kvm_vcpu *vcpu, struct kvm_run *run, int in, + int size, unsigned port); +int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in, + int size, unsigned long count, int down, + gva_t address, int rep, unsigned port); +void kvm_emulate_cpuid(struct kvm_vcpu *vcpu); +int kvm_emulate_halt(struct kvm_vcpu *vcpu); +int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address); +int emulate_clts(struct kvm_vcpu *vcpu); +int emulator_get_dr(struct x86_emulate_ctxt *ctxt, int dr, + unsigned long *dest); +int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr, + unsigned long value); + +void get_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg); + +void kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0); +void kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr0); +void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr0); +void kvm_set_cr8(struct kvm_vcpu *vcpu, unsigned long cr0); +unsigned long kvm_get_cr8(struct kvm_vcpu *vcpu); +void kvm_lmsw(struct kvm_vcpu *vcpu, unsigned long msw); +void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l); + +int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); +int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data); + +void kvm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr); +void kvm_queue_exception_e(struct kvm_vcpu *vcpu, unsigned nr, u32 error_code); +void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long cr2, + u32 error_code); +bool kvm_require_cpl(struct kvm_vcpu *vcpu, int required_cpl); + +void fx_init(struct kvm_vcpu *vcpu); + +int emulator_write_emulated(unsigned long addr, + const void *val, + unsigned int bytes, + struct kvm_vcpu *vcpu); + +unsigned long segment_base(u16 selector); + +void kvm_mmu_flush_tlb(struct kvm_vcpu *vcpu); +void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, + const u8 *new, int bytes); +int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva); +void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu); +int kvm_mmu_load(struct kvm_vcpu *vcpu); +void kvm_mmu_unload(struct kvm_vcpu *vcpu); +gpa_t kvm_mmu_gva_to_gpa_read(struct kvm_vcpu *vcpu, gva_t gva, u32 *error); +gpa_t kvm_mmu_gva_to_gpa_fetch(struct kvm_vcpu *vcpu, gva_t gva, u32 *error); +gpa_t kvm_mmu_gva_to_gpa_write(struct kvm_vcpu *vcpu, gva_t gva, u32 *error); +gpa_t kvm_mmu_gva_to_gpa_system(struct kvm_vcpu *vcpu, gva_t gva, u32 *error); + +int kvm_emulate_hypercall(struct kvm_vcpu *vcpu); + +int kvm_fix_hypercall(struct kvm_vcpu *vcpu); + +int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code); + +void kvm_enable_tdp(void); + +int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); +int complete_pio(struct kvm_vcpu *vcpu); +bool kvm_check_iopl(struct kvm_vcpu *vcpu); + +static inline struct kvm_mmu_page *page_header(hpa_t shadow_page) +{ + struct page *page = pfn_to_page(shadow_page >> PAGE_SHIFT); + + return (struct kvm_mmu_page *)page_private(page); +} + +static inline u16 read_ldt(void) +{ + u16 ldt; + asm("sldt %0" : "=g"(ldt)); + return ldt; +} + +/* + * Save a segment register away + */ +#ifndef savesegment +#define savesegment(seg, value) \ + asm("mov %%" #seg ",%0":"=r" (value) : : "memory") +#endif + +#ifndef load_ldt +static inline void load_ldt(u16 sel) +{ + asm("lldt %0" : : "rm"(sel)); +} +#endif + +static inline void get_idt(struct descriptor_table *table) +{ + asm("sidt %0" : "=m"(*table)); +} + +static inline void get_gdt(struct descriptor_table *table) +{ + asm("sgdt %0" : "=m"(*table)); +} + +static inline unsigned long read_tr_base(void) +{ + u16 tr; + asm("str %0" : "=g"(tr)); + return segment_base(tr); +} + +#ifdef CONFIG_X86_64 +static inline unsigned long read_msr(unsigned long msr) +{ + u64 value; + + rdmsrl(msr, value); + return value; +} +#endif + +static inline void fx_save(struct i387_fxsave_struct *image) +{ + asm("fxsave (%0)":: "r" (image)); +} + +static inline void fx_restore(struct i387_fxsave_struct *image) +{ + asm("fxrstor (%0)":: "r" (image)); +} + +static inline void fpu_init(void) +{ + asm("finit"); +} + +static inline u32 get_rdx_init_val(void) +{ + return 0x600; /* P6 family */ +} + +static inline void kvm_inject_gp(struct kvm_vcpu *vcpu, u32 error_code) +{ + kvm_queue_exception_e(vcpu, GP_VECTOR, error_code); +} + +#define ASM_VMX_VMCLEAR_RAX ".byte 0x66, 0x0f, 0xc7, 0x30" +#define ASM_VMX_VMLAUNCH ".byte 0x0f, 0x01, 0xc2" +#define ASM_VMX_VMRESUME ".byte 0x0f, 0x01, 0xc3" +#define ASM_VMX_VMPTRLD_RAX ".byte 0x0f, 0xc7, 0x30" +#define ASM_VMX_VMREAD_RDX_RAX ".byte 0x0f, 0x78, 0xd0" +#define ASM_VMX_VMWRITE_RAX_RDX ".byte 0x0f, 0x79, 0xd0" +#define ASM_VMX_VMWRITE_RSP_RDX ".byte 0x0f, 0x79, 0xd4" +#define ASM_VMX_VMXOFF ".byte 0x0f, 0x01, 0xc4" +#define ASM_VMX_VMXON_RAX ".byte 0xf3, 0x0f, 0xc7, 0x30" +#define ASM_VMX_INVVPID ".byte 0x66, 0x0f, 0x38, 0x81, 0x08" + +#define MSR_IA32_TIME_STAMP_COUNTER 0x010 + +#define TSS_IOPB_BASE_OFFSET 0x66 +#define TSS_BASE_SIZE 0x68 +#define TSS_IOPB_SIZE (65536 / 8) +#define TSS_REDIRECTION_SIZE (256 / 8) +#define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1) + +#endif --- linux-2.6.24.orig/include/asm-x86/processor_32.h +++ linux-2.6.24/include/asm-x86/processor_32.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,7 @@ __u8 cpu_core_id; /* Core id */ __u8 cpu_index; /* index into per_cpu list */ #endif + unsigned int x86_hyper_vendor; } __attribute__((__aligned__(SMP_CACHE_BYTES))); #define X86_VENDOR_INTEL 0 @@ -94,6 +96,9 @@ #define X86_VENDOR_NUM 9 #define X86_VENDOR_UNKNOWN 0xff +#define X86_HYPER_VENDOR_NONE 0 +#define X86_HYPER_VENDOR_VMWARE 1 + /* * capabilities of CPUs */ @@ -652,90 +657,6 @@ return edx; } -/* generic versions from gas */ -#define GENERIC_NOP1 ".byte 0x90\n" -#define GENERIC_NOP2 ".byte 0x89,0xf6\n" -#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n" -#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n" -#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4 -#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n" -#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n" -#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7 - -/* Opteron nops */ -#define K8_NOP1 GENERIC_NOP1 -#define K8_NOP2 ".byte 0x66,0x90\n" -#define K8_NOP3 ".byte 0x66,0x66,0x90\n" -#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n" -#define K8_NOP5 K8_NOP3 K8_NOP2 -#define K8_NOP6 K8_NOP3 K8_NOP3 -#define K8_NOP7 K8_NOP4 K8_NOP3 -#define K8_NOP8 K8_NOP4 K8_NOP4 - -/* K7 nops */ -/* uses eax dependencies (arbitary choice) */ -#define K7_NOP1 GENERIC_NOP1 -#define K7_NOP2 ".byte 0x8b,0xc0\n" -#define K7_NOP3 ".byte 0x8d,0x04,0x20\n" -#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n" -#define K7_NOP5 K7_NOP4 ASM_NOP1 -#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n" -#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n" -#define K7_NOP8 K7_NOP7 ASM_NOP1 - -/* P6 nops */ -/* uses eax dependencies (Intel-recommended choice) */ -#define P6_NOP1 GENERIC_NOP1 -#define P6_NOP2 ".byte 0x66,0x90\n" -#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n" -#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n" -#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n" -#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n" -#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" -#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" - -#ifdef CONFIG_MK8 -#define ASM_NOP1 K8_NOP1 -#define ASM_NOP2 K8_NOP2 -#define ASM_NOP3 K8_NOP3 -#define ASM_NOP4 K8_NOP4 -#define ASM_NOP5 K8_NOP5 -#define ASM_NOP6 K8_NOP6 -#define ASM_NOP7 K8_NOP7 -#define ASM_NOP8 K8_NOP8 -#elif defined(CONFIG_MK7) -#define ASM_NOP1 K7_NOP1 -#define ASM_NOP2 K7_NOP2 -#define ASM_NOP3 K7_NOP3 -#define ASM_NOP4 K7_NOP4 -#define ASM_NOP5 K7_NOP5 -#define ASM_NOP6 K7_NOP6 -#define ASM_NOP7 K7_NOP7 -#define ASM_NOP8 K7_NOP8 -#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \ - defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \ - defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4) -#define ASM_NOP1 P6_NOP1 -#define ASM_NOP2 P6_NOP2 -#define ASM_NOP3 P6_NOP3 -#define ASM_NOP4 P6_NOP4 -#define ASM_NOP5 P6_NOP5 -#define ASM_NOP6 P6_NOP6 -#define ASM_NOP7 P6_NOP7 -#define ASM_NOP8 P6_NOP8 -#else -#define ASM_NOP1 GENERIC_NOP1 -#define ASM_NOP2 GENERIC_NOP2 -#define ASM_NOP3 GENERIC_NOP3 -#define ASM_NOP4 GENERIC_NOP4 -#define ASM_NOP5 GENERIC_NOP5 -#define ASM_NOP6 GENERIC_NOP6 -#define ASM_NOP7 GENERIC_NOP7 -#define ASM_NOP8 GENERIC_NOP8 -#endif - -#define ASM_NOP_MAX 8 - /* Prefetch instructions for Pentium III and AMD Athlon */ /* It's not worth to care about 3dnow! prefetches for the K6 because they are microcoded there and very slow. --- linux-2.6.24.orig/include/asm-x86/lguest.h +++ linux-2.6.24/include/asm-x86/lguest.h @@ -56,7 +56,7 @@ struct desc_struct guest_gdt[GDT_ENTRIES]; }; -struct lguest_arch +struct lg_cpu_arch { /* The GDT entries copied into lguest_ro_state when running. */ struct desc_struct gdt[GDT_ENTRIES]; --- linux-2.6.24.orig/include/asm-x86/system_64.h +++ linux-2.6.24/include/asm-x86/system_64.h @@ -4,6 +4,7 @@ #include #include #include +#include #ifdef __KERNEL__ @@ -173,6 +174,19 @@ #define read_barrier_depends() do {} while(0) #define set_mb(var, value) do { (void) xchg(&var, value); } while (0) +/* + * Stop RDTSC speculation. This is needed when you need to use RDTSC + * (or get_cycles or vread that possibly accesses the TSC) in a defined + * code region. + * + * (Could use an alternative three way for this if there was one.) + */ +static inline void rdtsc_barrier(void) +{ + alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC); + alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC); +} + #define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) #include --- linux-2.6.24.orig/include/asm-x86/compat.h +++ linux-2.6.24/include/asm-x86/compat.h @@ -204,7 +204,7 @@ return (u32)(unsigned long)uptr; } -static __inline__ void __user *compat_alloc_user_space(long len) +static __inline__ void __user *arch_compat_alloc_user_space(long len) { struct pt_regs *regs = task_pt_regs(current); return (void __user *)regs->rsp - len; --- linux-2.6.24.orig/include/asm-x86/e820.h +++ linux-2.6.24/include/asm-x86/e820.h @@ -22,6 +22,9 @@ }; #endif /* __ASSEMBLY__ */ +#define BIOS_BEGIN 0x000a0000 +#define BIOS_END 0x00100000 + #ifdef __KERNEL__ #ifdef CONFIG_X86_32 # include "e820_32.h" --- linux-2.6.24.orig/include/asm-x86/io_32.h +++ linux-2.6.24/include/asm-x86/io_32.h @@ -250,10 +250,10 @@ #endif /* __KERNEL__ */ -static inline void native_io_delay(void) -{ - asm volatile("outb %%al,$0x80" : : : "memory"); -} +extern void native_io_delay(void); + +extern int io_delay_type; +extern void io_delay_init(void); #if defined(CONFIG_PARAVIRT) #include --- linux-2.6.24.orig/include/asm-x86/Kbuild +++ linux-2.6.24/include/asm-x86/Kbuild @@ -3,6 +3,7 @@ header-y += boot.h header-y += bootparam.h header-y += debugreg.h +header-y += kvm.h header-y += ldt.h header-y += msr-index.h header-y += prctl.h --- linux-2.6.24.orig/include/asm-x86/nops_64.h +++ linux-2.6.24/include/asm-x86/nops_64.h @@ -0,0 +1,49 @@ +#ifndef _ASM_NOPS_H +#define _ASM_NOPS_H + +/* Define nops for use with alternative() */ + +#if defined(CONFIG_MPSC) || defined(CONFIG_MCORE2) +#define ASM_NOP1 P6_NOP1 +#define ASM_NOP2 P6_NOP2 +#define ASM_NOP3 P6_NOP3 +#define ASM_NOP4 P6_NOP4 +#define ASM_NOP5 P6_NOP5 +#define ASM_NOP6 P6_NOP6 +#define ASM_NOP7 P6_NOP7 +#define ASM_NOP8 P6_NOP8 +#else +#define ASM_NOP1 K8_NOP1 +#define ASM_NOP2 K8_NOP2 +#define ASM_NOP3 K8_NOP3 +#define ASM_NOP4 K8_NOP4 +#define ASM_NOP5 K8_NOP5 +#define ASM_NOP6 K8_NOP6 +#define ASM_NOP7 K8_NOP7 +#define ASM_NOP8 K8_NOP8 +#endif + +/* Opteron nops */ +#define K8_NOP1 ".byte 0x90\n" +#define K8_NOP2 ".byte 0x66,0x90\n" +#define K8_NOP3 ".byte 0x66,0x66,0x90\n" +#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n" +#define K8_NOP5 K8_NOP3 K8_NOP2 +#define K8_NOP6 K8_NOP3 K8_NOP3 +#define K8_NOP7 K8_NOP4 K8_NOP3 +#define K8_NOP8 K8_NOP4 K8_NOP4 + +/* P6 nops */ +/* uses eax dependencies (Intel-recommended choice) */ +#define P6_NOP1 ".byte 0x90\n" +#define P6_NOP2 ".byte 0x66,0x90\n" +#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n" +#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n" +#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n" +#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n" +#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" +#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" + +#define ASM_NOP_MAX 8 + +#endif --- linux-2.6.24.orig/include/asm-x86/apic_32.h +++ linux-2.6.24/include/asm-x86/apic_32.h @@ -109,7 +109,7 @@ extern void setup_secondary_APIC_clock (void); extern int APIC_init_uniprocessor (void); -extern void enable_NMI_through_LVT0 (void * dummy); +extern void enable_NMI_through_LVT0(void); #define ARCH_APICTIMER_STOPS_ON_C3 1 --- linux-2.6.24.orig/include/asm-x86/system_32.h +++ linux-2.6.24/include/asm-x86/system_32.h @@ -5,6 +5,7 @@ #include #include #include +#include #ifdef __KERNEL__ #define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ @@ -299,6 +300,19 @@ #define set_mb(var, value) do { var = value; barrier(); } while (0) #endif +/* + * Stop RDTSC speculation. This is needed when you need to use RDTSC + * (or get_cycles or vread that possibly accesses the TSC) in a defined + * code region. + * + * (Could use an alternative three way for this if there was one.) + */ +static inline void rdtsc_barrier(void) +{ + alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC); + alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC); +} + #include /* --- linux-2.6.24.orig/include/asm-x86/lguest_hcall.h +++ linux-2.6.24/include/asm-x86/lguest_hcall.h @@ -4,7 +4,7 @@ #define LHCALL_FLUSH_ASYNC 0 #define LHCALL_LGUEST_INIT 1 -#define LHCALL_CRASH 2 +#define LHCALL_SHUTDOWN 2 #define LHCALL_LOAD_GDT 3 #define LHCALL_NEW_PGTABLE 4 #define LHCALL_FLUSH_TLB 5 @@ -20,6 +20,10 @@ #define LGUEST_TRAP_ENTRY 0x1F +/* Argument number 3 to LHCALL_LGUEST_SHUTDOWN */ +#define LGUEST_SHUTDOWN_POWEROFF 1 +#define LGUEST_SHUTDOWN_RESTART 2 + #ifndef __ASSEMBLY__ #include --- linux-2.6.24.orig/include/asm-x86/signal.h +++ linux-2.6.24/include/asm-x86/signal.h @@ -181,14 +181,14 @@ #ifdef __KERNEL__ #include -#ifdef __386__ +#ifdef __i386__ #define __HAVE_ARCH_SIG_BITOPS -#define sigaddset(set,sig) \ - (__builtin_constantp(sig) ? \ - __const_sigaddset((set),(sig)) : \ - __gen_sigaddset((set),(sig))) +#define sigaddset(set,sig) \ + (__builtin_constant_p(sig) \ + ? __const_sigaddset((set), (sig)) \ + : __gen_sigaddset((set), (sig))) static __inline__ void __gen_sigaddset(sigset_t *set, int _sig) { --- linux-2.6.24.orig/include/asm-x86/kvm_x86_emulate.h +++ linux-2.6.24/include/asm-x86/kvm_x86_emulate.h @@ -0,0 +1,197 @@ +/****************************************************************************** + * x86_emulate.h + * + * Generic x86 (32-bit and 64-bit) instruction decoder and emulator. + * + * Copyright (c) 2005 Keir Fraser + * + * From: xen-unstable 10676:af9809f51f81a3c43f276f00c81a52ef558afda4 + */ + +#ifndef __X86_EMULATE_H__ +#define __X86_EMULATE_H__ + +struct x86_emulate_ctxt; + +/* + * x86_emulate_ops: + * + * These operations represent the instruction emulator's interface to memory. + * There are two categories of operation: those that act on ordinary memory + * regions (*_std), and those that act on memory regions known to require + * special treatment or emulation (*_emulated). + * + * The emulator assumes that an instruction accesses only one 'emulated memory' + * location, that this location is the given linear faulting address (cr2), and + * that this is one of the instruction's data operands. Instruction fetches and + * stack operations are assumed never to access emulated memory. The emulator + * automatically deduces which operand of a string-move operation is accessing + * emulated memory, and assumes that the other operand accesses normal memory. + * + * NOTES: + * 1. The emulator isn't very smart about emulated vs. standard memory. + * 'Emulated memory' access addresses should be checked for sanity. + * 'Normal memory' accesses may fault, and the caller must arrange to + * detect and handle reentrancy into the emulator via recursive faults. + * Accesses may be unaligned and may cross page boundaries. + * 2. If the access fails (cannot emulate, or a standard access faults) then + * it is up to the memop to propagate the fault to the guest VM via + * some out-of-band mechanism, unknown to the emulator. The memop signals + * failure by returning X86EMUL_PROPAGATE_FAULT to the emulator, which will + * then immediately bail. + * 3. Valid access sizes are 1, 2, 4 and 8 bytes. On x86/32 systems only + * cmpxchg8b_emulated need support 8-byte accesses. + * 4. The emulator cannot handle 64-bit mode emulation on an x86/32 system. + */ +/* Access completed successfully: continue emulation as normal. */ +#define X86EMUL_CONTINUE 0 +/* Access is unhandleable: bail from emulation and return error to caller. */ +#define X86EMUL_UNHANDLEABLE 1 +/* Terminate emulation but return success to the caller. */ +#define X86EMUL_PROPAGATE_FAULT 2 /* propagate a generated fault to guest */ +#define X86EMUL_RETRY_INSTR 2 /* retry the instruction for some reason */ +#define X86EMUL_CMPXCHG_FAILED 2 /* cmpxchg did not see expected value */ +struct x86_emulate_ops { + /* + * read_std: Read bytes of standard (non-emulated/special) memory. + * Used for descriptor reading. + * @addr: [IN ] Linear address from which to read. + * @val: [OUT] Value read from memory, zero-extended to 'u_long'. + * @bytes: [IN ] Number of bytes to read from memory. + */ + int (*read_std)(unsigned long addr, void *val, + unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); + + /* + * fetch: Read bytes of standard (non-emulated/special) memory. + * Used for instruction fetch. + * @addr: [IN ] Linear address from which to read. + * @val: [OUT] Value read from memory, zero-extended to 'u_long'. + * @bytes: [IN ] Number of bytes to read from memory. + */ + int (*fetch)(unsigned long addr, void *val, + unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); + + /* + * read_emulated: Read bytes from emulated/special memory area. + * @addr: [IN ] Linear address from which to read. + * @val: [OUT] Value read from memory, zero-extended to 'u_long'. + * @bytes: [IN ] Number of bytes to read from memory. + */ + int (*read_emulated) (unsigned long addr, + void *val, + unsigned int bytes, + struct kvm_vcpu *vcpu); + + /* + * write_emulated: Read bytes from emulated/special memory area. + * @addr: [IN ] Linear address to which to write. + * @val: [IN ] Value to write to memory (low-order bytes used as + * required). + * @bytes: [IN ] Number of bytes to write to memory. + */ + int (*write_emulated) (unsigned long addr, + const void *val, + unsigned int bytes, + struct kvm_vcpu *vcpu); + + /* + * cmpxchg_emulated: Emulate an atomic (LOCKed) CMPXCHG operation on an + * emulated/special memory area. + * @addr: [IN ] Linear address to access. + * @old: [IN ] Value expected to be current at @addr. + * @new: [IN ] Value to write to @addr. + * @bytes: [IN ] Number of bytes to access using CMPXCHG. + */ + int (*cmpxchg_emulated) (unsigned long addr, + const void *old, + const void *new, + unsigned int bytes, + struct kvm_vcpu *vcpu); + +}; + +/* Type, address-of, and value of an instruction's operand. */ +struct operand { + enum { OP_REG, OP_MEM, OP_IMM, OP_NONE } type; + unsigned int bytes; + unsigned long val, orig_val, *ptr; +}; + +struct fetch_cache { + u8 data[15]; + unsigned long start; + unsigned long end; +}; + +struct decode_cache { + u8 twobyte; + u8 b; + u8 lock_prefix; + u8 rep_prefix; + u8 op_bytes; + u8 ad_bytes; + u8 rex_prefix; + struct operand src; + struct operand dst; + unsigned long *override_base; + unsigned int d; + unsigned long regs[NR_VCPU_REGS]; + unsigned long eip, eip_orig; + /* modrm */ + u8 modrm; + u8 modrm_mod; + u8 modrm_reg; + u8 modrm_rm; + u8 use_modrm_ea; + unsigned long modrm_ea; + unsigned long modrm_val; + struct fetch_cache fetch; +}; + +struct x86_emulate_ctxt { + /* Register state before/after emulation. */ + struct kvm_vcpu *vcpu; + + /* Linear faulting address (if emulating a page-faulting instruction). */ + unsigned long eflags; + + /* Emulated execution mode, represented by an X86EMUL_MODE value. */ + int mode; + + unsigned long cs_base; + unsigned long ds_base; + unsigned long es_base; + unsigned long ss_base; + unsigned long gs_base; + unsigned long fs_base; + + /* decode cache */ + + struct decode_cache decode; +}; + +/* Repeat String Operation Prefix */ +#define REPE_PREFIX 1 +#define REPNE_PREFIX 2 + +/* Execution mode, passed to the emulator. */ +#define X86EMUL_MODE_REAL 0 /* Real mode. */ +#define X86EMUL_MODE_VM86 1 /* Virtual 8086 mode. */ +#define X86EMUL_MODE_PROT16 2 /* 16-bit protected mode. */ +#define X86EMUL_MODE_PROT32 4 /* 32-bit protected mode. */ +#define X86EMUL_MODE_PROT64 8 /* 64-bit (long) mode. */ + +/* Host execution mode. */ +#if defined(__i386__) +#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT32 +#elif defined(CONFIG_X86_64) +#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT64 +#endif + +int x86_decode_insn(struct x86_emulate_ctxt *ctxt, + struct x86_emulate_ops *ops); +int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, + struct x86_emulate_ops *ops); + +#endif /* __X86_EMULATE_H__ */ --- linux-2.6.24.orig/include/asm-x86/seccomp_64.h +++ linux-2.6.24/include/asm-x86/seccomp_64.h @@ -1,13 +1,5 @@ #ifndef _ASM_SECCOMP_H -#include - -#ifdef TIF_32BIT -#error "unexpected TIF_32BIT on x86_64" -#else -#define TIF_32BIT TIF_IA32 -#endif - #include #include --- linux-2.6.24.orig/include/asm-powerpc/pmac_feature.h +++ linux-2.6.24/include/asm-powerpc/pmac_feature.h @@ -392,6 +392,14 @@ #define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v))) #define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) +/* Uninorth variant: + * + * 0 = not uninorth + * 1 = U1.x or U2.x + * 3 = U3 + * 4 = U4 + */ +extern int pmac_get_uninorth_variant(void); #endif /* __ASM_POWERPC_PMAC_FEATURE_H */ #endif /* __KERNEL__ */ --- linux-2.6.24.orig/include/asm-powerpc/elf.h +++ linux-2.6.24/include/asm-powerpc/elf.h @@ -246,14 +246,10 @@ #ifdef __powerpc64__ # define SET_PERSONALITY(ex, ibcs2) \ do { \ - unsigned long new_flags = 0; \ if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ - new_flags = _TIF_32BIT; \ - if ((current_thread_info()->flags & _TIF_32BIT) \ - != new_flags) \ - set_thread_flag(TIF_ABI_PENDING); \ + set_thread_flag(TIF_32BIT); \ else \ - clear_thread_flag(TIF_ABI_PENDING); \ + clear_thread_flag(TIF_32BIT); \ if (personality(current->personality) != PER_LINUX32) \ set_personality(PER_LINUX); \ } while (0) --- linux-2.6.24.orig/include/asm-powerpc/seccomp.h +++ linux-2.6.24/include/asm-powerpc/seccomp.h @@ -1,10 +1,6 @@ #ifndef _ASM_POWERPC_SECCOMP_H #define _ASM_POWERPC_SECCOMP_H -#ifdef __KERNEL__ -#include -#endif - #include #define __NR_seccomp_read __NR_read --- linux-2.6.24.orig/include/asm-powerpc/thread_info.h +++ linux-2.6.24/include/asm-powerpc/thread_info.h @@ -123,7 +123,6 @@ #define TIF_RESTORE_SIGMASK 13 /* Restore signal mask in do_signal */ #define TIF_FREEZE 14 /* Freezing for suspend */ #define TIF_RUNLATCH 15 /* Is the runlatch enabled? */ -#define TIF_ABI_PENDING 16 /* 32/64 bit switch needed */ /* as above, but as bit values */ #define _TIF_SYSCALL_TRACE (1<thread.regs; unsigned long usp = regs->gpr[1]; @@ -210,5 +210,10 @@ compat_ulong_t __unused6; }; +static inline int is_compat_task(void) +{ + return test_thread_flag(TIF_32BIT); +} + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_COMPAT_H */ --- linux-2.6.24.orig/include/asm-mips/seccomp.h +++ linux-2.6.24/include/asm-mips/seccomp.h @@ -1,6 +1,5 @@ #ifndef __ASM_SECCOMP_H -#include #include #define __NR_seccomp_read __NR_read --- linux-2.6.24.orig/include/asm-mips/compat.h +++ linux-2.6.24/include/asm-mips/compat.h @@ -143,7 +143,7 @@ return (u32)(unsigned long)uptr; } -static inline void __user *compat_alloc_user_space(long len) +static inline void __user *arch_compat_alloc_user_space(long len) { struct pt_regs *regs = (struct pt_regs *) ((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1; --- linux-2.6.24.orig/include/asm-sparc/mman.h +++ linux-2.6.24/include/asm-sparc/mman.h @@ -37,9 +37,8 @@ #ifdef __KERNEL__ #ifndef __ASSEMBLY__ -#define arch_mmap_check sparc_mmap_check -int sparc_mmap_check(unsigned long addr, unsigned long len, - unsigned long flags); +#define arch_mmap_check(addr,len,flags) sparc_mmap_check(addr,len) +int sparc_mmap_check(unsigned long addr, unsigned long len); #endif #endif --- linux-2.6.24.orig/include/asm-s390/compat.h +++ linux-2.6.24/include/asm-s390/compat.h @@ -163,7 +163,7 @@ return (u32)(unsigned long)uptr; } -static inline void __user *compat_alloc_user_space(long len) +static inline void __user *arch_compat_alloc_user_space(long len) { unsigned long stack; --- linux-2.6.24.orig/include/acpi/acpi_drivers.h +++ linux-2.6.24/include/acpi/acpi_drivers.h @@ -91,6 +91,7 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev); int acpi_power_get_inferred_state(struct acpi_device *device); int acpi_power_transition(struct acpi_device *device, int state); +extern int acpi_power_nocheck; #endif /* -------------------------------------------------------------------------- --- linux-2.6.24.orig/include/acpi/reboot.h +++ linux-2.6.24/include/acpi/reboot.h @@ -0,0 +1,10 @@ +#ifndef __ACPI_REBOOT_H +#define __ACPI_REBOOT_H + +#ifdef CONFIG_ACPI +extern void acpi_reboot(void); +#else +static inline void acpi_reboot(void) { } +#endif + +#endif --- linux-2.6.24.orig/include/acpi/acresrc.h +++ linux-2.6.24/include/acpi/acresrc.h @@ -94,6 +94,7 @@ #define ACPI_RSC_BITMASK16 18 #define ACPI_RSC_EXIT_NE 19 #define ACPI_RSC_EXIT_LE 20 +#define ACPI_RSC_EXIT_EQ 21 /* Resource Conversion sub-opcodes */ --- linux-2.6.24.orig/include/acpi/actypes.h +++ linux-2.6.24/include/acpi/actypes.h @@ -990,6 +990,7 @@ * Structures used to describe device resources */ struct acpi_resource_irq { + u8 descriptor_length; u8 triggering; u8 polarity; u8 sharable; @@ -1006,6 +1007,7 @@ }; struct acpi_resource_start_dependent { + u8 descriptor_length; u8 compatibility_priority; u8 performance_robustness; }; --- linux-2.6.24.orig/include/asm-ia64/compat.h +++ linux-2.6.24/include/asm-ia64/compat.h @@ -198,7 +198,7 @@ } static __inline__ void __user * -compat_alloc_user_space (long len) +arch_compat_alloc_user_space (long len) { struct pt_regs *regs = task_pt_regs(current); return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len); --- linux-2.6.24.orig/include/asm-sparc64/elf.h +++ linux-2.6.24/include/asm-sparc64/elf.h @@ -177,17 +177,10 @@ #ifdef __KERNEL__ #define SET_PERSONALITY(ex, ibcs2) \ -do { unsigned long new_flags = current_thread_info()->flags; \ - new_flags &= _TIF_32BIT; \ - if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ - new_flags |= _TIF_32BIT; \ + do { if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ + set_thread_flag(TIF_32BIT); \ else \ - new_flags &= ~_TIF_32BIT; \ - if ((current_thread_info()->flags & _TIF_32BIT) \ - != new_flags) \ - set_thread_flag(TIF_ABI_PENDING); \ - else \ - clear_thread_flag(TIF_ABI_PENDING); \ + clear_thread_flag(TIF_32BIT); \ /* flush_thread will update pgd cache */ \ if (ibcs2) \ set_personality(PER_SVR4); \ --- linux-2.6.24.orig/include/asm-sparc64/seccomp.h +++ linux-2.6.24/include/asm-sparc64/seccomp.h @@ -1,11 +1,5 @@ #ifndef _ASM_SECCOMP_H -#include /* already defines TIF_32BIT */ - -#ifndef TIF_32BIT -#error "unexpected TIF_32BIT on sparc64" -#endif - #include #define __NR_seccomp_read __NR_read --- linux-2.6.24.orig/include/asm-sparc64/backoff.h +++ linux-2.6.24/include/asm-sparc64/backoff.h @@ -12,7 +12,8 @@ mov reg, tmp; \ 88: brnz,pt tmp, 88b; \ sub tmp, 1, tmp; \ - cmp reg, BACKOFF_LIMIT; \ + set BACKOFF_LIMIT, tmp; \ + cmp reg, tmp; \ bg,pn %xcc, label; \ nop; \ ba,pt %xcc, label; \ --- linux-2.6.24.orig/include/asm-sparc64/thread_info.h +++ linux-2.6.24/include/asm-sparc64/thread_info.h @@ -233,7 +233,6 @@ * in using in assembly, else we can't use the mask as * an immediate value in instructions such as andcc. */ -#define TIF_ABI_PENDING 12 #define TIF_MEMDIE 13 #define TIF_POLLING_NRFLAG 14 @@ -247,7 +246,6 @@ #define _TIF_SECCOMP (1<kregs; unsigned long usp = regs->u_regs[UREG_I6]; @@ -240,4 +240,9 @@ unsigned int __unused2; }; +static inline int is_compat_task(void) +{ + return test_thread_flag(TIF_32BIT); +} + #endif /* _ASM_SPARC64_COMPAT_H */ --- linux-2.6.24.orig/include/linux/splice.h +++ linux-2.6.24/include/linux/splice.h @@ -70,4 +70,10 @@ extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, splice_direct_actor *); +extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out, + loff_t *ppos, size_t len, unsigned int flags); +extern long do_splice_to(struct file *in, loff_t *ppos, + struct pipe_inode_info *pipe, size_t len, + unsigned int flags); + #endif --- linux-2.6.24.orig/include/linux/virtio_net.h +++ linux-2.6.24/include/linux/virtio_net.h @@ -5,32 +5,41 @@ /* The ID for virtio_net */ #define VIRTIO_ID_NET 1 -/* The bitmap of config for virtio net */ -#define VIRTIO_CONFIG_NET_F 0x40 -#define VIRTIO_NET_F_NO_CSUM 0 -#define VIRTIO_NET_F_TSO4 1 -#define VIRTIO_NET_F_UFO 2 -#define VIRTIO_NET_F_TSO4_ECN 3 -#define VIRTIO_NET_F_TSO6 4 +/* The feature bitmap for virtio net */ +#define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ +#define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ +#define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */ +#define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ +#define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */ +#define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */ +#define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */ +#define VIRTIO_NET_F_GUEST_UFO 10 /* Guest can handle UFO in. */ +#define VIRTIO_NET_F_HOST_TSO4 11 /* Host can handle TSOv4 in. */ +#define VIRTIO_NET_F_HOST_TSO6 12 /* Host can handle TSOv6 in. */ +#define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */ +#define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */ -/* The config defining mac address. */ -#define VIRTIO_CONFIG_NET_MAC_F 0x41 +struct virtio_net_config +{ + /* The config defining mac address (if VIRTIO_NET_F_MAC) */ + __u8 mac[6]; +} __attribute__((packed)); /* This is the first element of the scatter-gather list. If you don't * specify GSO or CSUM features, you can simply ignore the header. */ struct virtio_net_hdr { #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset - __u8 flags; + __u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame #define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) -/* FIXME: Do we need this? If they said they can handle ECN, do they care? */ -#define VIRTIO_NET_HDR_GSO_TCPV4_ECN 2 // GSO frame, IPv4 TCP w/ ECN #define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO) #define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP - __u8 gso_type; - __u16 gso_size; - __u16 csum_start; - __u16 csum_offset; +#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set + __u8 gso_type; + __u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ + __u16 gso_size; /* Bytes to append to gso_hdr_len per frame */ + __u16 csum_start; /* Position to start checksumming from */ + __u16 csum_offset; /* Offset after that to place checksum */ }; #endif /* _LINUX_VIRTIO_NET_H */ --- linux-2.6.24.orig/include/linux/percpu.h +++ linux-2.6.24/include/linux/percpu.h @@ -34,7 +34,7 @@ #ifdef CONFIG_SMP struct percpu_data { - void *ptrs[NR_CPUS]; + void *ptrs[1]; }; #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) --- linux-2.6.24.orig/include/linux/if_arp.h +++ linux-2.6.24/include/linux/if_arp.h @@ -52,6 +52,8 @@ #define ARPHRD_ROSE 270 #define ARPHRD_X25 271 /* CCITT X.25 */ #define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */ +#define ARPHRD_WIMAX 273 /* WiMAX pseudo-header */ + #define ARPHRD_PPP 512 #define ARPHRD_CISCO 513 /* Cisco HDLC */ #define ARPHRD_HDLC ARPHRD_CISCO --- linux-2.6.24.orig/include/linux/moduleparam.h +++ linux-2.6.24/include/linux/moduleparam.h @@ -62,6 +62,16 @@ void *elem; }; +/* On alpha, ia64 and ppc64 relocations to global data cannot go into + read-only sections (which is part of respective UNIX ABI on these + platforms). So 'const' makes no sense and even causes compile failures + with some compilers. */ +#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64) +#define __moduleparam_const +#else +#define __moduleparam_const const +#endif + /* This is the fundamental function for registering boot/module parameters. perm sets the visibility in sysfs: 000 means it's not there, read bits mean it's readable, write bits mean it's @@ -71,7 +81,7 @@ static int __param_perm_check_##name __attribute__((unused)) = \ BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \ static const char __param_str_##name[] = prefix #name; \ - static struct kernel_param const __param_##name \ + static struct kernel_param __moduleparam_const __param_##name \ __attribute_used__ \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ = { __param_str_##name, perm, set, get, { arg } } --- linux-2.6.24.orig/include/linux/virtio_balloon.h +++ linux-2.6.24/include/linux/virtio_balloon.h @@ -0,0 +1,18 @@ +#ifndef _LINUX_VIRTIO_BALLOON_H +#define _LINUX_VIRTIO_BALLOON_H +#include + +/* The ID for virtio_balloon */ +#define VIRTIO_ID_BALLOON 5 + +/* The feature bitmap for virtio balloon */ +#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ + +struct virtio_balloon_config +{ + /* Number of pages host wants Guest to give up. */ + __le32 num_pages; + /* Number of pages we've actually got in balloon. */ + __le32 actual; +}; +#endif /* _LINUX_VIRTIO_BALLOON_H */ --- linux-2.6.24.orig/include/linux/namei.h +++ linux-2.6.24/include/linux/namei.h @@ -81,6 +81,7 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); extern void release_open_intent(struct nameidata *); +struct dentry * __lookup_hash(struct qstr *name, struct dentry * base, struct nameidata *nd); extern struct dentry *lookup_one_len(const char *, struct dentry *, int); extern struct dentry *lookup_one_noperm(const char *, struct dentry *); --- linux-2.6.24.orig/include/linux/kvm_para.h +++ linux-2.6.24/include/linux/kvm_para.h @@ -2,72 +2,31 @@ #define __LINUX_KVM_PARA_H /* - * Guest OS interface for KVM paravirtualization - * - * Note: this interface is totally experimental, and is certain to change - * as we make progress. + * This header file provides a method for making a hypercall to the host + * Architectures should define: + * - kvm_hypercall0, kvm_hypercall1... + * - kvm_arch_para_features + * - kvm_para_available */ -/* - * Per-VCPU descriptor area shared between guest and host. Writable to - * both guest and host. Registered with the host by the guest when - * a guest acknowledges paravirtual mode. - * - * NOTE: all addresses are guest-physical addresses (gpa), to make it - * easier for the hypervisor to map between the various addresses. - */ -struct kvm_vcpu_para_state { - /* - * API version information for compatibility. If there's any support - * mismatch (too old host trying to execute too new guest) then - * the host will deny entry into paravirtual mode. Any other - * combination (new host + old guest and new host + new guest) - * is supposed to work - new host versions will support all old - * guest API versions. - */ - u32 guest_version; - u32 host_version; - u32 size; - u32 ret; - - /* - * The address of the vm exit instruction (VMCALL or VMMCALL), - * which the host will patch according to the CPU model the - * VM runs on: - */ - u64 hypercall_gpa; - -} __attribute__ ((aligned(PAGE_SIZE))); +/* Return values for hypercalls */ +#define KVM_ENOSYS 1000 +#define KVM_EPERM EPERM -#define KVM_PARA_API_VERSION 1 +#define KVM_HC_VAPIC_POLL_IRQ 1 /* - * This is used for an RDMSR's ECX parameter to probe for a KVM host. - * Hopefully no CPU vendor will use up this number. This is placed well - * out of way of the typical space occupied by CPU vendors' MSR indices, - * and we think (or at least hope) it wont be occupied in the future - * either. + * hypercalls use architecture specific */ -#define MSR_KVM_API_MAGIC 0x87655678 +#include -#define KVM_EINVAL 1 - -/* - * Hypercall calling convention: - * - * Each hypercall may have 0-6 parameters. - * - * 64-bit hypercall index is in RAX, goes from 0 to __NR_hypercalls-1 - * - * 64-bit parameters 1-6 are in the standard gcc x86_64 calling convention - * order: RDI, RSI, RDX, RCX, R8, R9. - * - * 32-bit index is EBX, parameters are: EAX, ECX, EDX, ESI, EDI, EBP. - * (the first 3 are according to the gcc regparm calling convention) - * - * No registers are clobbered by the hypercall, except that the - * return value is in RAX. - */ -#define __NR_hypercalls 0 +#ifdef __KERNEL__ +static inline int kvm_para_has_feature(unsigned int feature) +{ + if (kvm_arch_para_features() & (1UL << feature)) + return 1; + return 0; +} +#endif /* __KERNEL__ */ +#endif /* __LINUX_KVM_PARA_H */ -#endif --- linux-2.6.24.orig/include/linux/hrtimer.h +++ linux-2.6.24/include/linux/hrtimer.h @@ -300,7 +300,7 @@ /* Precise sleep: */ extern long hrtimer_nanosleep(struct timespec *rqtp, - struct timespec *rmtp, + struct timespec __user *rmtp, const enum hrtimer_mode mode, const clockid_t clockid); extern long hrtimer_nanosleep_restart(struct restart_block *restart_block); --- linux-2.6.24.orig/include/linux/usb_usual.h +++ linux-2.6.24/include/linux/usb_usual.h @@ -50,7 +50,9 @@ US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \ /* sometimes sizes is too big */ \ US_FLAG(MAX_SECTORS_MIN,0x00002000) \ - /* Sets max_sectors to arch min */ + /* Sets max_sectors to arch min */ \ + US_FLAG(BULK_IGNORE_TAG,0x00004000) \ + /* Ignore tag mismatch in bulk operations */ #define US_FLAG(name, value) US_FL_##name = value , --- linux-2.6.24.orig/include/linux/cpuidle.h +++ linux-2.6.24/include/linux/cpuidle.h @@ -79,6 +79,7 @@ }; struct cpuidle_device { + unsigned int registered:1; int enabled:1; unsigned int cpu; --- linux-2.6.24.orig/include/linux/input.h +++ linux-2.6.24/include/linux/input.h @@ -371,6 +371,8 @@ #define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ #define KEY_DISPLAY_OFF 245 /* display device to off state */ +#define KEY_WIMAX 246 + #define BTN_MISC 0x100 #define BTN_0 0x100 #define BTN_1 0x101 --- linux-2.6.24.orig/include/linux/capability.h +++ linux-2.6.24/include/linux/capability.h @@ -121,7 +121,12 @@ /* Used to decide between falling back on the old suser() or fsuser(). */ -#define CAP_FS_MASK 0x1f +#define CAP_FS_MASK (CAP_TO_MASK(CAP_CHOWN) \ + | CAP_TO_MASK(CAP_MKNOD) \ + | CAP_TO_MASK(CAP_DAC_OVERRIDE) \ + | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \ + | CAP_TO_MASK(CAP_FOWNER) \ + | CAP_TO_MASK(CAP_FSETID)) /* Overrides the restriction that the real or effective user ID of a process sending a signal must match the real or effective user ID --- linux-2.6.24.orig/include/linux/kvm.h +++ linux-2.6.24/include/linux/kvm.h @@ -9,12 +9,10 @@ #include #include +#include #define KVM_API_VERSION 12 -/* Architectural interrupt line count. */ -#define KVM_NR_INTERRUPTS 256 - /* for KVM_CREATE_MEMORY_REGION */ struct kvm_memory_region { __u32 slot; @@ -23,17 +21,19 @@ __u64 memory_size; /* bytes */ }; -/* for kvm_memory_region::flags */ -#define KVM_MEM_LOG_DIRTY_PAGES 1UL - -struct kvm_memory_alias { - __u32 slot; /* this has a different namespace than memory slots */ +/* for KVM_SET_USER_MEMORY_REGION */ +struct kvm_userspace_memory_region { + __u32 slot; __u32 flags; __u64 guest_phys_addr; - __u64 memory_size; - __u64 target_phys_addr; + __u64 memory_size; /* bytes */ + __u64 userspace_addr; /* start of the userspace allocated memory */ }; +/* for kvm_memory_region::flags */ +#define KVM_MEM_LOG_DIRTY_PAGES 1UL + + /* for KVM_IRQ_LINE */ struct kvm_irq_level { /* @@ -45,62 +45,18 @@ __u32 level; }; -/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */ -struct kvm_pic_state { - __u8 last_irr; /* edge detection */ - __u8 irr; /* interrupt request register */ - __u8 imr; /* interrupt mask register */ - __u8 isr; /* interrupt service register */ - __u8 priority_add; /* highest irq priority */ - __u8 irq_base; - __u8 read_reg_select; - __u8 poll; - __u8 special_mask; - __u8 init_state; - __u8 auto_eoi; - __u8 rotate_on_auto_eoi; - __u8 special_fully_nested_mode; - __u8 init4; /* true if 4 byte init */ - __u8 elcr; /* PIIX edge/trigger selection */ - __u8 elcr_mask; -}; - -#define KVM_IOAPIC_NUM_PINS 24 -struct kvm_ioapic_state { - __u64 base_address; - __u32 ioregsel; - __u32 id; - __u32 irr; - __u32 pad; - union { - __u64 bits; - struct { - __u8 vector; - __u8 delivery_mode:3; - __u8 dest_mode:1; - __u8 delivery_status:1; - __u8 polarity:1; - __u8 remote_irr:1; - __u8 trig_mode:1; - __u8 mask:1; - __u8 reserve:7; - __u8 reserved[4]; - __u8 dest_id; - } fields; - } redirtbl[KVM_IOAPIC_NUM_PINS]; -}; - -#define KVM_IRQCHIP_PIC_MASTER 0 -#define KVM_IRQCHIP_PIC_SLAVE 1 -#define KVM_IRQCHIP_IOAPIC 2 struct kvm_irqchip { __u32 chip_id; __u32 pad; union { char dummy[512]; /* reserving space */ +#ifdef CONFIG_X86 struct kvm_pic_state pic; +#endif +#if defined(CONFIG_X86) || defined(CONFIG_IA64) struct kvm_ioapic_state ioapic; +#endif } chip; }; @@ -116,6 +72,7 @@ #define KVM_EXIT_FAIL_ENTRY 9 #define KVM_EXIT_INTR 10 #define KVM_EXIT_SET_TPR 11 +#define KVM_EXIT_TPR_ACCESS 12 /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ struct kvm_run { @@ -174,90 +131,17 @@ __u32 longmode; __u32 pad; } hypercall; + /* KVM_EXIT_TPR_ACCESS */ + struct { + __u64 rip; + __u32 is_write; + __u32 pad; + } tpr_access; /* Fix the size of the union. */ char padding[256]; }; }; -/* for KVM_GET_REGS and KVM_SET_REGS */ -struct kvm_regs { - /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */ - __u64 rax, rbx, rcx, rdx; - __u64 rsi, rdi, rsp, rbp; - __u64 r8, r9, r10, r11; - __u64 r12, r13, r14, r15; - __u64 rip, rflags; -}; - -/* for KVM_GET_FPU and KVM_SET_FPU */ -struct kvm_fpu { - __u8 fpr[8][16]; - __u16 fcw; - __u16 fsw; - __u8 ftwx; /* in fxsave format */ - __u8 pad1; - __u16 last_opcode; - __u64 last_ip; - __u64 last_dp; - __u8 xmm[16][16]; - __u32 mxcsr; - __u32 pad2; -}; - -/* for KVM_GET_LAPIC and KVM_SET_LAPIC */ -#define KVM_APIC_REG_SIZE 0x400 -struct kvm_lapic_state { - char regs[KVM_APIC_REG_SIZE]; -}; - -struct kvm_segment { - __u64 base; - __u32 limit; - __u16 selector; - __u8 type; - __u8 present, dpl, db, s, l, g, avl; - __u8 unusable; - __u8 padding; -}; - -struct kvm_dtable { - __u64 base; - __u16 limit; - __u16 padding[3]; -}; - -/* for KVM_GET_SREGS and KVM_SET_SREGS */ -struct kvm_sregs { - /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */ - struct kvm_segment cs, ds, es, fs, gs, ss; - struct kvm_segment tr, ldt; - struct kvm_dtable gdt, idt; - __u64 cr0, cr2, cr3, cr4, cr8; - __u64 efer; - __u64 apic_base; - __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64]; -}; - -struct kvm_msr_entry { - __u32 index; - __u32 reserved; - __u64 data; -}; - -/* for KVM_GET_MSRS and KVM_SET_MSRS */ -struct kvm_msrs { - __u32 nmsrs; /* number of msrs in entries */ - __u32 pad; - - struct kvm_msr_entry entries[0]; -}; - -/* for KVM_GET_MSR_INDEX_LIST */ -struct kvm_msr_list { - __u32 nmsrs; /* number of msrs in entries */ - __u32 indices[0]; -}; - /* for KVM_TRANSLATE */ struct kvm_translation { /* in */ @@ -302,28 +186,24 @@ }; }; -struct kvm_cpuid_entry { - __u32 function; - __u32 eax; - __u32 ebx; - __u32 ecx; - __u32 edx; - __u32 padding; -}; - -/* for KVM_SET_CPUID */ -struct kvm_cpuid { - __u32 nent; - __u32 padding; - struct kvm_cpuid_entry entries[0]; -}; - /* for KVM_SET_SIGNAL_MASK */ struct kvm_signal_mask { __u32 len; __u8 sigset[0]; }; +/* for KVM_TPR_ACCESS_REPORTING */ +struct kvm_tpr_access_ctl { + __u32 enabled; + __u32 flags; + __u32 reserved[8]; +}; + +/* for KVM_SET_VAPIC_ADDR */ +struct kvm_vapic_addr { + __u64 vapic_addr; +}; + #define KVMIO 0xAE /* @@ -341,17 +221,31 @@ * Get size for mmap(vcpu_fd) */ #define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */ +#define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2) /* * Extension capability list. */ #define KVM_CAP_IRQCHIP 0 #define KVM_CAP_HLT 1 +#define KVM_CAP_MMU_SHADOW_CACHE_CONTROL 2 +#define KVM_CAP_USER_MEMORY 3 +#define KVM_CAP_SET_TSS_ADDR 4 +#define KVM_CAP_VAPIC 6 +#define KVM_CAP_EXT_CPUID 7 +#define KVM_CAP_CLOCKSOURCE 8 +#define KVM_CAP_NR_VCPUS 9 /* returns max vcpus per vm */ +#define KVM_CAP_NR_MEMSLOTS 10 /* returns max memory slots per vm */ /* * ioctls for VM fds */ #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) +#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) +#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) +#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\ + struct kvm_userspace_memory_region) +#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) /* * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns * a vcpu fd. @@ -384,5 +278,11 @@ #define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu) #define KVM_GET_LAPIC _IOR(KVMIO, 0x8e, struct kvm_lapic_state) #define KVM_SET_LAPIC _IOW(KVMIO, 0x8f, struct kvm_lapic_state) +#define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2) +#define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2) +/* Available with KVM_CAP_VAPIC */ +#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl) +/* Available with KVM_CAP_VAPIC */ +#define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr) #endif --- linux-2.6.24.orig/include/linux/cryptohash.h +++ linux-2.6.24/include/linux/cryptohash.h @@ -7,6 +7,11 @@ void sha_init(__u32 *buf); void sha_transform(__u32 *digest, const char *data, __u32 *W); +#define MD5_DIGEST_WORDS 4 +#define MD5_MESSAGE_BYTES 64 + +void md5_transform(__u32 *hash, __u32 const *in); + __u32 half_md4_transform(__u32 buf[4], __u32 const in[8]); #endif --- linux-2.6.24.orig/include/linux/audit.h +++ linux-2.6.24/include/linux/audit.h @@ -33,7 +33,7 @@ * 1200 - 1299 messages internal to the audit daemon * 1300 - 1399 audit event messages * 1400 - 1499 SE Linux use - * 1500 - 1599 kernel LSPP events + * 1500 - 1599 AppArmor use * 1600 - 1699 kernel crypto events * 1700 - 1799 kernel anomaly records * 1800 - 1999 future kernel use (maybe integrity labels and related events) @@ -116,11 +116,20 @@ #define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */ #define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */ +#define AUDIT_APPARMOR_AUDIT 1501 /* AppArmor audited grants */ +#define AUDIT_APPARMOR_ALLOWED 1502 /* Allowed Access for learning */ +#define AUDIT_APPARMOR_DENIED 1503 +#define AUDIT_APPARMOR_HINT 1504 /* Process Tracking information */ +#define AUDIT_APPARMOR_STATUS 1505 /* Changes in config */ +#define AUDIT_APPARMOR_ERROR 1506 /* Internal AppArmor Errors */ + #define AUDIT_FIRST_KERN_ANOM_MSG 1700 #define AUDIT_LAST_KERN_ANOM_MSG 1799 #define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */ #define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */ +#define AUDIT_SD 1500 /* AppArmor (SubDomain) audit */ + #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ /* Rule flags */ @@ -513,6 +522,9 @@ __attribute__((format(printf,4,5))); extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type); +extern void audit_log_vformat(struct audit_buffer *ab, + const char *fmt, va_list args) + __attribute__((format(printf,2,0))); extern void audit_log_format(struct audit_buffer *ab, const char *fmt, ...) __attribute__((format(printf,2,3))); --- linux-2.6.24.orig/include/linux/blkdev.h +++ linux-2.6.24/include/linux/blkdev.h @@ -607,6 +607,7 @@ * default timeout for SG_IO if none specified */ #define BLK_DEFAULT_SG_TIMEOUT (60 * HZ) +#define BLK_MIN_SG_TIMEOUT (7 * HZ) #ifdef CONFIG_BOUNCE extern int init_emergency_isa_pool(void); --- linux-2.6.24.orig/include/linux/syscalls.h +++ linux-2.6.24/include/linux/syscalls.h @@ -66,6 +66,22 @@ #include #include +#define __SC_DECL1(t1, a1) t1 a1 +#define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) +#define __SC_DECL3(t3, a3, ...) t3 a3, __SC_DECL2(__VA_ARGS__) +#define __SC_DECL4(t4, a4, ...) t4 a4, __SC_DECL3(__VA_ARGS__) +#define __SC_DECL5(t5, a5, ...) t5 a5, __SC_DECL4(__VA_ARGS__) +#define __SC_DECL6(t6, a6, ...) t6 a6, __SC_DECL5(__VA_ARGS__) + +#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) + +#define SYSCALL_DEFINEx(x, sname, ...) \ + __SYSCALL_DEFINEx(x, sname, __VA_ARGS__) + +#define SYSCALL_DEFINE(name) asmlinkage long sys_##name +#define __SYSCALL_DEFINEx(x, name, ...) \ + asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__)) + asmlinkage long sys_time(time_t __user *tloc); asmlinkage long sys_stime(time_t __user *tptr); asmlinkage long sys_gettimeofday(struct timeval __user *tv, @@ -614,4 +630,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]); +asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long pgoff); #endif --- linux-2.6.24.orig/include/linux/hid.h +++ linux-2.6.24/include/linux/hid.h @@ -267,10 +267,10 @@ #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 #define HID_QUIRK_MIGHTYMOUSE 0x00000400 -#define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800 -#define HID_QUIRK_POWERBOOK_FN_ON 0x00001000 +#define HID_QUIRK_APPLE_HAS_FN 0x00000800 +#define HID_QUIRK_APPLE_FN_ON 0x00001000 #define HID_QUIRK_INVERT_HWHEEL 0x00002000 -#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00004000 +#define HID_QUIRK_APPLE_ISO_KEYBOARD 0x00004000 #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000 #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 #define HID_QUIRK_IGNORE_MOUSE 0x00020000 @@ -281,6 +281,8 @@ #define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000 #define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 #define HID_QUIRK_IGNORE_HIDINPUT 0x01000000 +#define HID_QUIRK_2WHEEL_MOUSE_HACK_B8 0x02000000 +#define HID_QUIRK_APPLE_NUMLOCK_EMULATION 0x20000000 /* * Separate quirks for runtime report descriptor fixup @@ -456,6 +458,8 @@ void *driver_data; + __s32 delayed_value; /* For A4 Tech mice hwheel quirk */ + /* device-specific function pointers */ int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); int (*hid_open) (struct hid_device *); @@ -469,7 +473,7 @@ /* handler for raw output data, used by hidraw */ int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); #ifdef CONFIG_USB_HIDINPUT_POWERBOOK - unsigned long pb_pressed_fn[BITS_TO_LONGS(KEY_CNT)]; + unsigned long apple_pressed_fn[BITS_TO_LONGS(KEY_CNT)]; unsigned long pb_pressed_numlock[BITS_TO_LONGS(KEY_CNT)]; #endif }; --- linux-2.6.24.orig/include/linux/virtio_ring.h +++ linux-2.6.24/include/linux/virtio_ring.h @@ -15,9 +15,13 @@ /* This marks a buffer as write-only (otherwise read-only). */ #define VRING_DESC_F_WRITE 2 -/* This means don't notify other side when buffer added. */ +/* The Host uses this in used->flags to advise the Guest: don't kick me when + * you add a buffer. It's unreliable, so it's simply an optimization. Guest + * will still kick if it's out of buffers. */ #define VRING_USED_F_NO_NOTIFY 1 -/* This means don't interrupt guest when buffer consumed. */ +/* The Guest uses this in avail->flags to advise the Host: don't interrupt me + * when you consume a buffer. It's unreliable, so it's simply an + * optimization. */ #define VRING_AVAIL_F_NO_INTERRUPT 1 /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ @@ -89,7 +93,7 @@ * }; */ static inline void vring_init(struct vring *vr, unsigned int num, void *p, - unsigned int pagesize) + unsigned long pagesize) { vr->num = num; vr->desc = p; @@ -98,7 +102,7 @@ & ~(pagesize - 1)); } -static inline unsigned vring_size(unsigned int num, unsigned int pagesize) +static inline unsigned vring_size(unsigned int num, unsigned long pagesize) { return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) + pagesize - 1) & ~(pagesize - 1)) @@ -114,7 +118,7 @@ struct virtio_device *vdev, void *pages, void (*notify)(struct virtqueue *vq), - bool (*callback)(struct virtqueue *vq)); + void (*callback)(struct virtqueue *vq)); void vring_del_virtqueue(struct virtqueue *vq); irqreturn_t vring_interrupt(int irq, void *_vq); --- linux-2.6.24.orig/include/linux/mm.h +++ linux-2.6.24/include/linux/mm.h @@ -514,21 +514,6 @@ } /* - * If a hint addr is less than mmap_min_addr change hint to be as - * low as possible but still greater than mmap_min_addr - */ -static inline unsigned long round_hint_to_min(unsigned long hint) -{ -#ifdef CONFIG_SECURITY - hint &= PAGE_MASK; - if (((void *)hint != NULL) && - (hint < mmap_min_addr)) - return PAGE_ALIGN(mmap_min_addr); -#endif - return hint; -} - -/* * Some inline functions in vmstat.h depend on page_zone() */ #include @@ -1086,6 +1071,28 @@ return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; } +static inline int stack_guard_page(struct vm_area_struct *vma, + unsigned long addr) +{ + struct vm_area_struct *prev; + + /* No need to look further if addr is not the start of a stack vma */ + if (!(vma->vm_flags & VM_GROWSDOWN) || vma->vm_start != addr) + return 0; + + prev = find_vma(vma->vm_mm, addr - PAGE_SIZE); + + /* + * Only if there is no previous vma that is a continuation of this + * vma, the current vma includes the guard page. + */ + if (!prev || !(prev->vm_flags & VM_GROWSDOWN) || + prev->vm_end != vma->vm_start) + return 1; + + return 0; +} + pgprot_t vm_get_page_prot(unsigned long vm_flags); struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); struct page *vmalloc_to_page(void *addr); --- linux-2.6.24.orig/include/linux/fs.h +++ linux-2.6.24/include/linux/fs.h @@ -351,13 +351,6 @@ struct timespec ia_atime; struct timespec ia_mtime; struct timespec ia_ctime; - - /* - * Not an attribute, but an auxilary info for filesystems wanting to - * implement an ftruncate() like method. NOTE: filesystem should - * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL). - */ - struct file *ia_file; }; /* @@ -1068,13 +1061,13 @@ */ extern int vfs_permission(struct nameidata *, int); extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); -extern int vfs_mkdir(struct inode *, struct dentry *, int); -extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); -extern int vfs_symlink(struct inode *, struct dentry *, const char *, int); -extern int vfs_link(struct dentry *, struct inode *, struct dentry *); -extern int vfs_rmdir(struct inode *, struct dentry *); -extern int vfs_unlink(struct inode *, struct dentry *); -extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); +extern int vfs_mkdir(struct inode *, struct dentry *, struct vfsmount *, int); +extern int vfs_mknod(struct inode *, struct dentry *, struct vfsmount *, int, dev_t); +extern int vfs_symlink(struct inode *, struct dentry *, struct vfsmount *, const char *, int); +extern int vfs_link(struct dentry *, struct vfsmount *, struct inode *, struct dentry *, struct vfsmount *); +extern int vfs_rmdir(struct inode *, struct dentry *, struct vfsmount *); +extern int vfs_unlink(struct inode *, struct dentry *, struct vfsmount *); +extern int vfs_rename(struct inode *, struct dentry *, struct vfsmount *, struct inode *, struct dentry *, struct vfsmount *); /* * VFS dentry helper functions. @@ -1188,6 +1181,8 @@ ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); int (*setlease)(struct file *, long, struct file_lock **); + int (*fgetattr)(struct file *, struct kstat *); + int (*fsetattr)(struct file *, struct iattr *); }; struct inode_operations { @@ -1536,8 +1531,8 @@ /* fs/open.c */ -extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, - struct file *filp); +extern int do_truncate(struct dentry *, struct vfsmount *, loff_t start, + unsigned int time_attrs, struct file *filp); extern long do_sys_open(int dfd, const char __user *filename, int flags, int mode); extern struct file *filp_open(const char *, int, int); @@ -1693,7 +1688,8 @@ #ifdef CONFIG_BLOCK extern sector_t bmap(struct inode *, sector_t); #endif -extern int notify_change(struct dentry *, struct iattr *); +extern int notify_change(struct dentry *, struct vfsmount *, struct iattr *); +extern int fnotify_change(struct dentry *, struct vfsmount *, struct iattr *, struct file *); extern int permission(struct inode *, int, struct nameidata *); extern int generic_permission(struct inode *, int, int (*check_acl)(struct inode *, int)); @@ -1766,9 +1762,9 @@ extern void clear_inode(struct inode *); extern void destroy_inode(struct inode *); extern struct inode *new_inode(struct super_block *); -extern int __remove_suid(struct dentry *, int); +extern int __remove_suid(struct path *, int); extern int should_remove_suid(struct dentry *); -extern int remove_suid(struct dentry *); +extern int remove_suid(struct path *); extern void __insert_inode_hash(struct inode *, unsigned long hashval); extern void remove_inode_hash(struct inode *); --- linux-2.6.24.orig/include/linux/personality.h +++ linux-2.6.24/include/linux/personality.h @@ -40,7 +40,10 @@ * Security-relevant compatibility flags that must be * cleared upon setuid or setgid exec: */ -#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE) +#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \ + ADDR_NO_RANDOMIZE | \ + ADDR_COMPAT_LAYOUT | \ + MMAP_PAGE_ZERO) /* * Personality types. --- linux-2.6.24.orig/include/linux/latencytop.h +++ linux-2.6.24/include/linux/latencytop.h @@ -0,0 +1,44 @@ +/* + * latencytop.h: Infrastructure for displaying latency + * + * (C) Copyright 2008 Intel Corporation + * Author: Arjan van de Ven + * + */ + +#ifndef _INCLUDE_GUARD_LATENCYTOP_H_ +#define _INCLUDE_GUARD_LATENCYTOP_H_ + +#ifdef CONFIG_LATENCYTOP + +#define LT_SAVECOUNT 32 +#define LT_BACKTRACEDEPTH 12 + +struct latency_record { + unsigned long backtrace[LT_BACKTRACEDEPTH]; + unsigned int count; + unsigned long time; + unsigned long max; +}; + + +struct task_struct; + +void account_scheduler_latency(struct task_struct *task, int usecs, int inter); + +void clear_all_latency_tracing(struct task_struct *p); + +#else + +static inline void +account_scheduler_latency(struct task_struct *task, int usecs, int inter) +{ +} + +static inline void clear_all_latency_tracing(struct task_struct *p) +{ +} + +#endif + +#endif --- linux-2.6.24.orig/include/linux/dmi.h +++ linux-2.6.24/include/linux/dmi.h @@ -78,6 +78,7 @@ extern void dmi_scan_machine(void); extern int dmi_get_year(int field); extern int dmi_name_in_vendors(const char *str); +extern int dmi_name_in_serial(const char *str); extern int dmi_available; #else @@ -88,6 +89,7 @@ const struct dmi_device *from) { return NULL; } static inline int dmi_get_year(int year) { return 0; } static inline int dmi_name_in_vendors(const char *s) { return 0; } +static inline int dmi_name_in_serial(const char *s) { return 0; } #define dmi_available 0 #endif --- linux-2.6.24.orig/include/linux/pm.h +++ linux-2.6.24/include/linux/pm.h @@ -143,6 +143,9 @@ * the upcoming system state (such as PCI_D3hot), and enable * wakeup events as appropriate. * + * HIBERNATE Enter a low power device state appropriate for the hibernation + * state (eg. ACPI S4) and enable wakeup events as appropriate. + * * FREEZE Quiesce operations so that a consistent image can be saved; * but do NOT otherwise enter a low power device state, and do * NOT emit system wakeup events. @@ -166,11 +169,15 @@ #define PM_EVENT_ON 0 #define PM_EVENT_FREEZE 1 #define PM_EVENT_SUSPEND 2 -#define PM_EVENT_PRETHAW 3 +#define PM_EVENT_HIBERNATE 4 +#define PM_EVENT_PRETHAW 8 + +#define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) #define PMSG_PRETHAW ((struct pm_message){ .event = PM_EVENT_PRETHAW, }) #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) +#define PMSG_HIBERNATE ((struct pm_message){ .event = PM_EVENT_HIBERNATE, }) #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) struct dev_pm_info { --- linux-2.6.24.orig/include/linux/skbuff.h +++ linux-2.6.24/include/linux/skbuff.h @@ -1804,5 +1804,6 @@ skb->ip_summed = CHECKSUM_NONE; } +bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */ --- linux-2.6.24.orig/include/linux/connector.h +++ linux-2.6.24/include/linux/connector.h @@ -24,9 +24,6 @@ #include -#define CN_IDX_CONNECTOR 0xffffffff -#define CN_VAL_CONNECTOR 0xffffffff - /* * Process Events connector unique ids -- used for message routing */ @@ -68,30 +65,6 @@ __u8 data[0]; }; -/* - * Notify structure - requests notification about - * registering/unregistering idx/val in range [first, first+range]. - */ -struct cn_notify_req { - __u32 first; - __u32 range; -}; - -/* - * Main notification control message - * *_notify_num - number of appropriate cn_notify_req structures after - * this struct. - * group - notification receiver's idx. - * len - total length of the attached data. - */ -struct cn_ctl_msg { - __u32 idx_notify_num; - __u32 val_notify_num; - __u32 group; - __u32 len; - __u8 data[0]; -}; - #ifdef __KERNEL__ #include @@ -124,9 +97,9 @@ struct cn_callback_data { void (*destruct_data) (void *); void *ddata; - - void *callback_priv; - void (*callback) (void *); + + struct sk_buff *skb; + void (*callback) (struct cn_msg *, struct netlink_skb_parms *); void *free; }; @@ -144,11 +117,6 @@ struct sock *nls; }; -struct cn_ctl_entry { - struct list_head notify_entry; - struct cn_ctl_msg *msg; -}; - struct cn_dev { struct cb_id id; @@ -159,11 +127,11 @@ struct cn_queue_dev *cbdev; }; -int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); +int cn_add_callback(struct cb_id *, char *, void (*callback) (struct cn_msg *, struct netlink_skb_parms *)); void cn_del_callback(struct cb_id *); int cn_netlink_send(struct cn_msg *, u32, gfp_t); -int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); +int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); --- linux-2.6.24.orig/include/linux/math64.h +++ linux-2.6.24/include/linux/math64.h @@ -0,0 +1,72 @@ +#ifndef _LINUX_MATH64_H +#define _LINUX_MATH64_H + +#include +#include + +#if BITS_PER_LONG == 64 + +/** + * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder + * + * This is commonly provided by 32bit archs to provide an optimized 64bit + * divide. + */ +static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) +{ + *remainder = dividend % divisor; + return dividend / divisor; +} + +/** + * div_s64_rem - signed 64bit divide with 32bit divisor with remainder + */ +static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) +{ + *remainder = dividend % divisor; + return dividend / divisor; +} + +#elif BITS_PER_LONG == 32 + +#ifndef div_u64_rem +static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) +{ + *remainder = do_div(dividend, divisor); + return dividend; +} +#endif + +#ifndef div_s64_rem +extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); +#endif + +#endif /* BITS_PER_LONG */ + +/** + * div_u64 - unsigned 64bit divide with 32bit divisor + * + * This is the most common 64bit divide and should be used if possible, + * as many 32bit archs can optimize this variant better than a full 64bit + * divide. + */ +#ifndef div_u64 +static inline u64 div_u64(u64 dividend, u32 divisor) +{ + u32 remainder; + return div_u64_rem(dividend, divisor, &remainder); +} +#endif + +/** + * div_s64 - signed 64bit divide with 32bit divisor + */ +#ifndef div_s64 +static inline s64 div_s64(s64 dividend, s32 divisor) +{ + s32 remainder; + return div_s64_rem(dividend, divisor, &remainder); +} +#endif + +#endif /* _LINUX_MATH64_H */ --- linux-2.6.24.orig/include/linux/xattr.h +++ linux-2.6.24/include/linux/xattr.h @@ -46,10 +46,13 @@ size_t size, int flags); }; -ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); -ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); -int vfs_setxattr(struct dentry *, char *, void *, size_t, int); -int vfs_removexattr(struct dentry *, char *); +ssize_t vfs_getxattr(struct dentry *, struct vfsmount *, char *, void *, + size_t, struct file *); +ssize_t vfs_listxattr(struct dentry *d, struct vfsmount *, char *list, + size_t size, struct file *); +int vfs_setxattr(struct dentry *, struct vfsmount *, char *, void *, size_t, + int, struct file *); +int vfs_removexattr(struct dentry *, struct vfsmount *, char *, struct file *); ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size); ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size); --- linux-2.6.24.orig/include/linux/tty_driver.h +++ linux-2.6.24/include/linux/tty_driver.h @@ -118,11 +118,18 @@ * * This routine is used to send a high-priority XON/XOFF * character to the device. + * + * int (*get_icount)(struct tty_struct *tty, struct serial_icounter *icount); + * + * Called when the device receives a TIOCGICOUNT ioctl. Passed a kernel + * structure to complete. This method is optional and will only be called + * if provided (otherwise EINVAL will be returned). */ #include #include #include +#include /* for serial_state and serial_icounter_struct */ struct tty_struct; @@ -157,6 +164,8 @@ int (*tiocmget)(struct tty_struct *tty, struct file *file); int (*tiocmset)(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear); + int (*get_icount)(struct tty_struct *tty, + struct serial_icounter_struct *icount); }; struct tty_driver { @@ -220,6 +229,8 @@ int (*tiocmget)(struct tty_struct *tty, struct file *file); int (*tiocmset)(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear); + int (*get_icount)(struct tty_struct *tty, + struct serial_icounter_struct *icount); struct list_head tty_drivers; }; --- linux-2.6.24.orig/include/linux/inotify.h +++ linux-2.6.24/include/linux/inotify.h @@ -128,6 +128,8 @@ struct inotify_watch *); extern void get_inotify_watch(struct inotify_watch *); extern void put_inotify_watch(struct inotify_watch *); +extern int pin_inotify_watch(struct inotify_watch *); +extern void unpin_inotify_watch(struct inotify_watch *); #else @@ -222,6 +224,15 @@ { } +extern inline int pin_inotify_watch(struct inotify_watch *watch) +{ + return 0; +} + +extern inline void unpin_inotify_watch(struct inotify_watch *watch) +{ +} + #endif /* CONFIG_INOTIFY */ #endif /* __KERNEL __ */ --- linux-2.6.24.orig/include/linux/virtio_blk.h +++ linux-2.6.24/include/linux/virtio_blk.h @@ -6,15 +6,19 @@ #define VIRTIO_ID_BLOCK 2 /* Feature bits */ -#define VIRTIO_CONFIG_BLK_F 0x40 -#define VIRTIO_BLK_F_BARRIER 1 /* Does host support barriers? */ +#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ +#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ +#define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ -/* The capacity (in 512-byte sectors). */ -#define VIRTIO_CONFIG_BLK_F_CAPACITY 0x41 -/* The maximum segment size. */ -#define VIRTIO_CONFIG_BLK_F_SIZE_MAX 0x42 -/* The maximum number of segments. */ -#define VIRTIO_CONFIG_BLK_F_SEG_MAX 0x43 +struct virtio_blk_config +{ + /* The capacity (in 512-byte sectors). */ + __le64 capacity; + /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ + __le32 size_max; + /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */ + __le32 seg_max; +} __attribute__((packed)); /* These two define direction. */ #define VIRTIO_BLK_T_IN 0 @@ -35,8 +39,6 @@ __u32 ioprio; /* Sector (ie. 512 byte offset) */ __u64 sector; - /* Where to put reply. */ - __u64 id; }; #define VIRTIO_BLK_S_OK 0 --- linux-2.6.24.orig/include/linux/jiffies.h +++ linux-2.6.24/include/linux/jiffies.h @@ -1,7 +1,7 @@ #ifndef _LINUX_JIFFIES_H #define _LINUX_JIFFIES_H -#include +#include #include #include #include --- linux-2.6.24.orig/include/linux/virtio_config.h +++ linux-2.6.24/include/linux/virtio_config.h @@ -5,7 +5,7 @@ * store and access that space differently. */ #include -/* Status byte for guest to report progress, and synchronize config. */ +/* Status byte for guest to report progress, and synchronize features. */ /* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */ #define VIRTIO_CONFIG_S_ACKNOWLEDGE 1 /* We have found a driver for the device. */ @@ -15,34 +15,22 @@ /* We've given up on this device. */ #define VIRTIO_CONFIG_S_FAILED 0x80 -/* Feature byte (actually 7 bits availabe): */ -/* Requirements/features of the virtio implementation. */ -#define VIRTIO_CONFIG_F_VIRTIO 1 -/* Requirements/features of the virtqueue (may have more than one). */ -#define VIRTIO_CONFIG_F_VIRTQUEUE 2 - #ifdef __KERNEL__ struct virtio_device; /** * virtio_config_ops - operations for configuring a virtio device - * @find: search for the next configuration field of the given type. - * vdev: the virtio_device - * type: the feature type - * len: the (returned) length of the field if found. - * Returns a token if found, or NULL. Never returnes the same field twice - * (ie. it's used up). - * @get: read the value of a configuration field after find(). + * @get: read the value of a configuration field * vdev: the virtio_device - * token: the token returned from find(). + * offset: the offset of the configuration field * buf: the buffer to write the field value into. - * len: the length of the buffer (given by find()). + * len: the length of the buffer * Note that contents are conventionally little-endian. - * @set: write the value of a configuration field after find(). + * @set: write the value of a configuration field * vdev: the virtio_device - * token: the token returned from find(). + * offset: the offset of the configuration field * buf: the buffer to read the field value from. - * len: the length of the buffer (given by find()). + * len: the length of the buffer * Note that contents are conventionally little-endian. * @get_status: read the status byte * vdev: the virtio_device @@ -50,62 +38,94 @@ * @set_status: write the status byte * vdev: the virtio_device * status: the new status byte - * @find_vq: find the first VIRTIO_CONFIG_F_VIRTQUEUE and create a virtqueue. + * @reset: reset the device + * vdev: the virtio device + * After this, status and feature negotiation must be done again + * @find_vq: find a virtqueue and instantiate it. * vdev: the virtio_device + * index: the 0-based virtqueue number in case there's more than one. * callback: the virqtueue callback - * Returns the new virtqueue or ERR_PTR(). + * Returns the new virtqueue or ERR_PTR() (eg. -ENOENT). * @del_vq: free a virtqueue found by find_vq(). + * @get_features: get the array of feature bits for this device. + * vdev: the virtio_device + * Returns the first 32 feature bits (all we currently need). + * @set_features: confirm what device features we'll be using. + * vdev: the virtio_device + * feature: the first 32 feature bits */ struct virtio_config_ops { - void *(*find)(struct virtio_device *vdev, u8 type, unsigned *len); - void (*get)(struct virtio_device *vdev, void *token, + void (*get)(struct virtio_device *vdev, unsigned offset, void *buf, unsigned len); - void (*set)(struct virtio_device *vdev, void *token, + void (*set)(struct virtio_device *vdev, unsigned offset, const void *buf, unsigned len); u8 (*get_status)(struct virtio_device *vdev); void (*set_status)(struct virtio_device *vdev, u8 status); + void (*reset)(struct virtio_device *vdev); struct virtqueue *(*find_vq)(struct virtio_device *vdev, - bool (*callback)(struct virtqueue *)); + unsigned index, + void (*callback)(struct virtqueue *)); void (*del_vq)(struct virtqueue *vq); + u32 (*get_features)(struct virtio_device *vdev); + void (*set_features)(struct virtio_device *vdev, u32 features); }; +/* If driver didn't advertise the feature, it will never appear. */ +void virtio_check_driver_offered_feature(const struct virtio_device *vdev, + unsigned int fbit); + +/** + * virtio_has_feature - helper to determine if this device has this feature. + * @vdev: the device + * @fbit: the feature bit + */ +static inline bool virtio_has_feature(const struct virtio_device *vdev, + unsigned int fbit) +{ + /* Did you forget to fix assumptions on max features? */ + if (__builtin_constant_p(fbit)) + BUILD_BUG_ON(fbit >= 32); + + virtio_check_driver_offered_feature(vdev, fbit); + return test_bit(fbit, vdev->features); +} + /** - * virtio_config_val - get a single virtio config and mark it used. - * @config: the virtio config space - * @type: the type to search for. + * virtio_config_val - look for a feature and get a single virtio config. + * @vdev: the virtio device + * @fbit: the feature bit + * @offset: the type to search for. * @val: a pointer to the value to fill in. * - * Once used, the config type is marked with VIRTIO_CONFIG_F_USED so it can't - * be found again. This version does endian conversion. */ -#define virtio_config_val(vdev, type, v) ({ \ - int _err = __virtio_config_val((vdev),(type),(v),sizeof(*(v))); \ - \ - BUILD_BUG_ON(sizeof(*(v)) != 1 && sizeof(*(v)) != 2 \ - && sizeof(*(v)) != 4 && sizeof(*(v)) != 8); \ - if (!_err) { \ - switch (sizeof(*(v))) { \ - case 2: le16_to_cpus((__u16 *) v); break; \ - case 4: le32_to_cpus((__u32 *) v); break; \ - case 8: le64_to_cpus((__u64 *) v); break; \ - } \ - } \ + * The return value is -ENOENT if the feature doesn't exist. Otherwise + * the value is endian-corrected and returned in v. */ +#define virtio_config_val(vdev, fbit, offset, v) ({ \ + int _err; \ + if (virtio_has_feature((vdev), (fbit))) { \ + __virtio_config_val((vdev), (offset), (v)); \ + _err = 0; \ + } else \ + _err = -ENOENT; \ _err; \ }) -int __virtio_config_val(struct virtio_device *dev, - u8 type, void *val, size_t size); - /** - * virtio_use_bit - helper to use a feature bit in a bitfield value. - * @dev: the virtio device - * @token: the token as returned from vdev->config->find(). - * @len: the length of the field. - * @bitnum: the bit to test. + * __virtio_config_val - get a single virtio config without feature check. + * @vdev: the virtio device + * @offset: the type to search for. + * @val: a pointer to the value to fill in. * - * If handed a NULL token, it returns false, otherwise returns bit status. - * If it's one, it sets the mirroring acknowledgement bit. */ -int virtio_use_bit(struct virtio_device *vdev, - void *token, unsigned int len, unsigned int bitnum); + * The value is endian-corrected and returned in v. */ +#define __virtio_config_val(vdev, offset, v) do { \ + BUILD_BUG_ON(sizeof(*(v)) != 1 && sizeof(*(v)) != 2 \ + && sizeof(*(v)) != 4 && sizeof(*(v)) != 8); \ + (vdev)->config->get((vdev), (offset), (v), sizeof(*(v))); \ + switch (sizeof(*(v))) { \ + case 2: le16_to_cpus((__u16 *) v); break; \ + case 4: le32_to_cpus((__u32 *) v); break; \ + case 8: le64_to_cpus((__u64 *) v); break; \ + } \ +} while(0) #endif /* __KERNEL__ */ #endif /* _LINUX_VIRTIO_CONFIG_H */ --- linux-2.6.24.orig/include/linux/virtio_pci.h +++ linux-2.6.24/include/linux/virtio_pci.h @@ -0,0 +1,57 @@ +/* + * Virtio PCI driver + * + * This module allows virtio devices to be used over a virtual PCI device. + * This can be used with QEMU based VMMs like KVM or Xen. + * + * Copyright IBM Corp. 2007 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#ifndef _LINUX_VIRTIO_PCI_H +#define _LINUX_VIRTIO_PCI_H + +#include + +/* A 32-bit r/o bitmask of the features supported by the host */ +#define VIRTIO_PCI_HOST_FEATURES 0 + +/* A 32-bit r/w bitmask of features activated by the guest */ +#define VIRTIO_PCI_GUEST_FEATURES 4 + +/* A 32-bit r/w PFN for the currently selected queue */ +#define VIRTIO_PCI_QUEUE_PFN 8 + +/* A 16-bit r/o queue size for the currently selected queue */ +#define VIRTIO_PCI_QUEUE_NUM 12 + +/* A 16-bit r/w queue selector */ +#define VIRTIO_PCI_QUEUE_SEL 14 + +/* A 16-bit r/w queue notifier */ +#define VIRTIO_PCI_QUEUE_NOTIFY 16 + +/* An 8-bit device status register. */ +#define VIRTIO_PCI_STATUS 18 + +/* An 8-bit r/o interrupt status register. Reading the value will return the + * current contents of the ISR and will also clear it. This is effectively + * a read-and-acknowledge. */ +#define VIRTIO_PCI_ISR 19 + +/* The bit of the ISR which indicates a device configuration change. */ +#define VIRTIO_PCI_ISR_CONFIG 0x2 + +/* The remaining space is defined by each driver as the per-driver + * configuration space */ +#define VIRTIO_PCI_CONFIG 20 + +/* Virtio ABI version, this must match exactly */ +#define VIRTIO_PCI_ABI_VERSION 0 +#endif --- linux-2.6.24.orig/include/linux/virtio.h +++ linux-2.6.24/include/linux/virtio.h @@ -11,15 +11,13 @@ /** * virtqueue - a queue to register buffers for sending or receiving. * @callback: the function to call when buffers are consumed (can be NULL). - * If this returns false, callbacks are suppressed until vq_ops->restart - * is called. * @vdev: the virtio device this queue was created for. * @vq_ops: the operations for this virtqueue (see below). * @priv: a pointer for the virtqueue implementation to use. */ struct virtqueue { - bool (*callback)(struct virtqueue *vq); + void (*callback)(struct virtqueue *vq); struct virtio_device *vdev; struct virtqueue_ops *vq_ops; void *priv; @@ -41,16 +39,19 @@ * vq: the struct virtqueue we're talking about. * len: the length written into the buffer * Returns NULL or the "data" token handed to add_buf. - * @restart: restart callbacks after callback returned false. + * @disable_cb: disable callbacks * vq: the struct virtqueue we're talking about. - * This returns "false" (and doesn't re-enable) if there are pending - * buffers in the queue, to avoid a race. - * @shutdown: "unadd" all buffers. + * Note that this is not necessarily synchronous, hence unreliable and only + * useful as an optimization. + * @enable_cb: restart callbacks after disable_cb. * vq: the struct virtqueue we're talking about. - * Remove everything from the queue. + * This re-enables callbacks; it returns "false" if there are pending + * buffers in the queue, to detect a possible race between the driver + * checking for more work, and enabling callbacks. * * Locking rules are straightforward: the driver is responsible for - * locking. No two operations may be invoked simultaneously. + * locking. No two operations may be invoked simultaneously, with the exception + * of @disable_cb. * * All operations can be called in any context. */ @@ -65,9 +66,8 @@ void *(*get_buf)(struct virtqueue *vq, unsigned int *len); - bool (*restart)(struct virtqueue *vq); - - void (*shutdown)(struct virtqueue *vq); + void (*disable_cb)(struct virtqueue *vq); + bool (*enable_cb)(struct virtqueue *vq); }; /** @@ -76,6 +76,7 @@ * @dev: underlying device. * @id: the device type identification (used to match it with a driver). * @config: the configuration ops for this device. + * @features: the features supported by both driver and device. * @priv: private pointer for the driver's use. */ struct virtio_device @@ -84,6 +85,8 @@ struct device dev; struct virtio_device_id id; struct virtio_config_ops *config; + /* Note that this is a Linux set_bit-style bitmap. */ + unsigned long features[1]; void *priv; }; @@ -94,15 +97,22 @@ * virtio_driver - operations for a virtio I/O driver * @driver: underlying device driver (populate name and owner). * @id_table: the ids serviced by this driver. + * @feature_table: an array of feature numbers supported by this device. + * @feature_table_size: number of entries in the feature table array. * @probe: the function to call when a device is found. Returns a token for * remove, or PTR_ERR(). * @remove: the function when a device is removed. + * @config_changed: optional function to call when the device configuration + * changes; may be called in interrupt context. */ struct virtio_driver { struct device_driver driver; const struct virtio_device_id *id_table; + const unsigned int *feature_table; + unsigned int feature_table_size; int (*probe)(struct virtio_device *dev); void (*remove)(struct virtio_device *dev); + void (*config_changed)(struct virtio_device *dev); }; int register_virtio_driver(struct virtio_driver *drv); --- linux-2.6.24.orig/include/linux/binfmts.h +++ linux-2.6.24/include/linux/binfmts.h @@ -80,6 +80,7 @@ extern int __must_check remove_arg_zero(struct linux_binprm *); extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); extern int flush_old_exec(struct linux_binprm * bprm); +extern void setup_new_exec(struct linux_binprm * bprm); extern int suid_dumpable; #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ --- linux-2.6.24.orig/include/linux/futex.h +++ linux-2.6.24/include/linux/futex.h @@ -153,6 +153,7 @@ #ifdef CONFIG_FUTEX extern void exit_robust_list(struct task_struct *curr); extern void exit_pi_state_list(struct task_struct *curr); +extern int futex_cmpxchg_enabled; #else static inline void exit_robust_list(struct task_struct *curr) { --- linux-2.6.24.orig/include/linux/kvm_host.h +++ linux-2.6.24/include/linux/kvm_host.h @@ -0,0 +1,313 @@ +#ifndef __KVM_HOST_H +#define __KVM_HOST_H + +/* + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#define KVM_MAX_VCPUS 16 +#define KVM_MEMORY_SLOTS 32 +/* memory slots that does not exposed to userspace */ +#define KVM_PRIVATE_MEM_SLOTS 4 + +#define KVM_PIO_PAGE_OFFSET 1 + +/* + * vcpu->requests bit members + */ +#define KVM_REQ_TLB_FLUSH 0 +#define KVM_REQ_MIGRATE_TIMER 1 +#define KVM_REQ_REPORT_TPR_ACCESS 2 +#define KVM_REQ_MMU_RELOAD 3 +#define KVM_REQ_TRIPLE_FAULT 4 + +struct kvm_vcpu; +extern struct kmem_cache *kvm_vcpu_cache; + +struct kvm_guest_debug { + int enabled; + unsigned long bp[4]; + int singlestep; +}; + +/* + * It would be nice to use something smarter than a linear search, TBD... + * Thankfully we dont expect many devices to register (famous last words :), + * so until then it will suffice. At least its abstracted so we can change + * in one place. + */ +struct kvm_io_bus { + int dev_count; +#define NR_IOBUS_DEVS 6 + struct kvm_io_device *devs[NR_IOBUS_DEVS]; +}; + +void kvm_io_bus_init(struct kvm_io_bus *bus); +void kvm_io_bus_destroy(struct kvm_io_bus *bus); +struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, gpa_t addr); +void kvm_io_bus_register_dev(struct kvm_io_bus *bus, + struct kvm_io_device *dev); + +struct kvm_vcpu { + struct kvm *kvm; +#ifdef CONFIG_PREEMPT_NOTIFIERS + struct preempt_notifier preempt_notifier; +#endif + int vcpu_id; + struct mutex mutex; + int cpu; + struct kvm_run *run; + int guest_mode; + unsigned long requests; + struct kvm_guest_debug guest_debug; + int fpu_active; + int guest_fpu_loaded; + wait_queue_head_t wq; + int sigset_active; + sigset_t sigset; + struct kvm_vcpu_stat stat; + +#ifdef CONFIG_HAS_IOMEM + int mmio_needed; + int mmio_read_completed; + int mmio_is_write; + int mmio_size; + unsigned char mmio_data[8]; + gpa_t mmio_phys_addr; +#endif + + struct kvm_vcpu_arch arch; +}; + +struct kvm_memory_slot { + gfn_t base_gfn; + unsigned long npages; + unsigned long flags; + unsigned long *rmap; + unsigned long *dirty_bitmap; + struct { + unsigned long rmap_pde; + int write_count; + } *lpage_info; + unsigned long userspace_addr; + int user_alloc; +}; + +struct kvm { + struct mutex lock; /* protects the vcpus array and APIC accesses */ + spinlock_t mmu_lock; + struct rw_semaphore slots_lock; + struct mm_struct *mm; /* userspace tied to this vm */ + int nmemslots; + struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + + KVM_PRIVATE_MEM_SLOTS]; + struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; + atomic_t online_vcpus; + struct list_head vm_list; + struct file *filp; + struct kvm_io_bus mmio_bus; + struct kvm_io_bus pio_bus; + struct kvm_vm_stat stat; + struct kvm_arch arch; +}; + +/* The guest did something we don't support. */ +#define pr_unimpl(vcpu, fmt, ...) \ + do { \ + if (printk_ratelimit()) \ + printk(KERN_ERR "kvm: %i: cpu%i " fmt, \ + current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__); \ + } while (0) + +#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) +#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) + +int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); +void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); + +void vcpu_load(struct kvm_vcpu *vcpu); +void vcpu_put(struct kvm_vcpu *vcpu); + +void decache_vcpus_on_cpu(int cpu); + + +int kvm_init(void *opaque, unsigned int vcpu_size, + struct module *module); +void kvm_exit(void); + +#define HPA_MSB ((sizeof(hpa_t) * 8) - 1) +#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) +static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } +struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva); + +extern struct page *bad_page; + +int is_error_page(struct page *page); +int kvm_is_error_hva(unsigned long addr); +int kvm_set_memory_region(struct kvm *kvm, + struct kvm_userspace_memory_region *mem, + int user_alloc); +int __kvm_set_memory_region(struct kvm *kvm, + struct kvm_userspace_memory_region *mem, + int user_alloc); +int kvm_arch_set_memory_region(struct kvm *kvm, + struct kvm_userspace_memory_region *mem, + struct kvm_memory_slot old, + int user_alloc); +void kvm_arch_flush_shadow(struct kvm *kvm); +gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); +struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); +unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); +void kvm_release_page_clean(struct page *page); +void kvm_release_page_dirty(struct page *page); +int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset, + int len); +int kvm_read_guest_atomic(struct kvm *kvm, gpa_t gpa, void *data, + unsigned long len); +int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len); +int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data, + int offset, int len); +int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, + unsigned long len); +int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); +int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); +struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); +int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); +void mark_page_dirty(struct kvm *kvm, gfn_t gfn); + +void kvm_vcpu_block(struct kvm_vcpu *vcpu); +void kvm_resched(struct kvm_vcpu *vcpu); +void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); +void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); +void kvm_flush_remote_tlbs(struct kvm *kvm); +void kvm_reload_remote_mmus(struct kvm *kvm); + +long kvm_arch_dev_ioctl(struct file *filp, + unsigned int ioctl, unsigned long arg); +long kvm_arch_vcpu_ioctl(struct file *filp, + unsigned int ioctl, unsigned long arg); +void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); +void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); + +int kvm_dev_ioctl_check_extension(long ext); + +int kvm_get_dirty_log(struct kvm *kvm, + struct kvm_dirty_log *log, int *is_dirty); +int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, + struct kvm_dirty_log *log); + +int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, + struct + kvm_userspace_memory_region *mem, + int user_alloc); +long kvm_arch_vm_ioctl(struct file *filp, + unsigned int ioctl, unsigned long arg); +void kvm_arch_destroy_vm(struct kvm *kvm); + +int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu); +int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu); + +int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu, + struct kvm_translation *tr); + +int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs); +int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs); +int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, + struct kvm_sregs *sregs); +int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, + struct kvm_sregs *sregs); +int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu, + struct kvm_debug_guest *dbg); +int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run); + +int kvm_arch_init(void *opaque); +void kvm_arch_exit(void); + +int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu); +void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu); + +void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu); +void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); +void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); +struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id); +int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu); +void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); + +int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu); +void kvm_arch_hardware_enable(void *garbage); +void kvm_arch_hardware_disable(void *garbage); +int kvm_arch_hardware_setup(void); +void kvm_arch_hardware_unsetup(void); +void kvm_arch_check_processor_compat(void *rtn); +int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); + +void kvm_free_physmem(struct kvm *kvm); + +struct kvm *kvm_arch_create_vm(void); +void kvm_arch_destroy_vm(struct kvm *kvm); + +int kvm_cpu_get_interrupt(struct kvm_vcpu *v); +int kvm_cpu_has_interrupt(struct kvm_vcpu *v); +void kvm_vcpu_kick(struct kvm_vcpu *vcpu); + +static inline void kvm_guest_enter(void) +{ + account_system_vtime(current); + current->flags |= PF_VCPU; +} + +static inline void kvm_guest_exit(void) +{ + account_system_vtime(current); + current->flags &= ~PF_VCPU; +} + +static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot) +{ + return slot - kvm->memslots; +} + +static inline gpa_t gfn_to_gpa(gfn_t gfn) +{ + return (gpa_t)gfn << PAGE_SHIFT; +} + +static inline void kvm_migrate_apic_timer(struct kvm_vcpu *vcpu) +{ + set_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests); +} + +enum kvm_stat_kind { + KVM_STAT_VM, + KVM_STAT_VCPU, +}; + +struct kvm_stats_debugfs_item { + const char *name; + int offset; + enum kvm_stat_kind kind; + struct dentry *dentry; +}; +extern struct kvm_stats_debugfs_item debugfs_entries[]; +bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu); + +#endif --- linux-2.6.24.orig/include/linux/security.h +++ linux-2.6.24/include/linux/security.h @@ -28,6 +28,7 @@ #include #include #include +#include /* PAGE_ALIGN */ #include #include #include @@ -56,13 +57,15 @@ extern int cap_bprm_set_security (struct linux_binprm *bprm); extern void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe); extern int cap_bprm_secureexec(struct linux_binprm *bprm); -extern int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags); -extern int cap_inode_removexattr(struct dentry *dentry, char *name); +extern int cap_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt, char *name, void *value, size_t size, int flags, struct file *file); +extern int cap_inode_removexattr(struct dentry *dentry, struct vfsmount *mnt, char *name, struct file *file); extern int cap_inode_need_killpriv(struct dentry *dentry); extern int cap_inode_killpriv(struct dentry *dentry); +extern int cap_file_mmap(struct file *file, unsigned long reqprot, + unsigned long prot, unsigned long flags, + unsigned long addr, unsigned long addr_only); extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); extern void cap_task_reparent_to_init (struct task_struct *p); -extern int cap_task_kill(struct task_struct *p, struct siginfo *info, int sig, u32 secid); extern int cap_task_setscheduler (struct task_struct *p, int policy, struct sched_param *lp); extern int cap_task_setioprio (struct task_struct *p, int ioprio); extern int cap_task_setnice (struct task_struct *p, int nice); @@ -85,6 +88,7 @@ extern int cap_netlink_recv(struct sk_buff *skb, int cap); extern unsigned long mmap_min_addr; +extern unsigned long dac_mmap_min_addr; /* * Values used in the task_security_ops calls */ @@ -111,6 +115,22 @@ #define LSM_UNSAFE_PTRACE 2 #define LSM_UNSAFE_PTRACE_CAP 4 +/* + * If a hint addr is less than mmap_min_addr change hint to be as + * low as possible but still greater than mmap_min_addr + */ +static inline unsigned long round_hint_to_min(unsigned long hint) +{ + hint &= PAGE_MASK; + if (((void *)hint != NULL) && + (hint < mmap_min_addr)) + return PAGE_ALIGN(mmap_min_addr); + return hint; +} + +extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp, + void __user *buffer, size_t *lenp, loff_t *ppos); + #ifdef CONFIG_SECURITY /** @@ -297,23 +317,28 @@ * Check permission to create a regular file. * @dir contains inode structure of the parent of the new file. * @dentry contains the dentry structure for the file to be created. + * @mnt is the vfsmount corresponding to @dentry (may be NULL). * @mode contains the file mode of the file to be created. * Return 0 if permission is granted. * @inode_link: * Check permission before creating a new hard link to a file. * @old_dentry contains the dentry structure for an existing link to the file. + * @old_mnt is the vfsmount corresponding to @old_dentry (may be NULL). * @dir contains the inode structure of the parent directory of the new link. * @new_dentry contains the dentry structure for the new link. + * @new_mnt is the vfsmount corresponding to @new_dentry (may be NULL). * Return 0 if permission is granted. * @inode_unlink: * Check the permission to remove a hard link to a file. * @dir contains the inode structure of parent directory of the file. * @dentry contains the dentry structure for file to be unlinked. + * @mnt is the vfsmount corresponding to @dentry (may be NULL). * Return 0 if permission is granted. * @inode_symlink: * Check the permission to create a symbolic link to a file. * @dir contains the inode structure of parent directory of the symbolic link. * @dentry contains the dentry structure of the symbolic link. + * @mnt is the vfsmount corresponding to @dentry (may be NULL). * @old_name contains the pathname of file. * Return 0 if permission is granted. * @inode_mkdir: @@ -321,12 +346,14 @@ * associated with inode strcture @dir. * @dir containst the inode structure of parent of the directory to be created. * @dentry contains the dentry structure of new directory. + * @mnt is the vfsmount corresponding to @dentry (may be NULL). * @mode contains the mode of new directory. * Return 0 if permission is granted. * @inode_rmdir: * Check the permission to remove a directory. * @dir contains the inode structure of parent of the directory to be removed. * @dentry contains the dentry structure of directory to be removed. + * @mnt is the vfsmount corresponding to @dentry (may be NULL). * Return 0 if permission is granted. * @inode_mknod: * Check permissions when creating a special file (or a socket or a fifo @@ -335,6 +362,7 @@ * and not this hook. * @dir contains the inode structure of parent of the new file. * @dentry contains the dentry structure of the new file. + * @mnt is the vfsmount corresponding to @dentry (may be NULL). * @mode contains the mode of the new file. * @dev contains the device number. * Return 0 if permission is granted. @@ -342,12 +370,15 @@ * Check for permission to rename a file or directory. * @old_dir contains the inode structure for parent of the old link. * @old_dentry contains the dentry structure of the old link. + * @old_mnt is the vfsmount corresponding to @old_dentry (may be NULL). * @new_dir contains the inode structure for parent of the new link. * @new_dentry contains the dentry structure of the new link. + * @new_mnt is the vfsmount corresponding to @new_dentry (may be NULL). * Return 0 if permission is granted. * @inode_readlink: * Check the permission to read the symbolic link. * @dentry contains the dentry structure for the file link. + * @mnt is the vfsmount corresponding to @dentry (may be NULL). * Return 0 if permission is granted. * @inode_follow_link: * Check permission to follow a symbolic link when looking up a pathname. @@ -371,6 +402,7 @@ * file attributes change (such as when a file is truncated, chown/chmod * operations, transferring disk quotas, etc). * @dentry contains the dentry structure for the file. + * @mnt is the vfsmount corresponding to @dentry (may be NULL). * @attr is the iattr structure containing the new file attributes. * Return 0 if permission is granted. * @inode_getattr: @@ -386,18 +418,18 @@ * inode. * @inode_setxattr: * Check permission before setting the extended attributes - * @value identified by @name for @dentry. + * @value identified by @name for @dentry and @mnt. * Return 0 if permission is granted. * @inode_post_setxattr: * Update inode security field after successful setxattr operation. - * @value identified by @name for @dentry. + * @value identified by @name for @dentry and @mnt. * @inode_getxattr: * Check permission before obtaining the extended attributes - * identified by @name for @dentry. + * identified by @name for @dentry and @mnt. * Return 0 if permission is granted. * @inode_listxattr: * Check permission before obtaining the list of extended attribute - * names for @dentry. + * names for @dentry and @mnt. * Return 0 if permission is granted. * @inode_removexattr: * Check permission before removing the extended attribute @@ -1247,32 +1279,45 @@ void (*inode_free_security) (struct inode *inode); int (*inode_init_security) (struct inode *inode, struct inode *dir, char **name, void **value, size_t *len); - int (*inode_create) (struct inode *dir, - struct dentry *dentry, int mode); - int (*inode_link) (struct dentry *old_dentry, - struct inode *dir, struct dentry *new_dentry); - int (*inode_unlink) (struct inode *dir, struct dentry *dentry); - int (*inode_symlink) (struct inode *dir, - struct dentry *dentry, const char *old_name); - int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, int mode); - int (*inode_rmdir) (struct inode *dir, struct dentry *dentry); + int (*inode_create) (struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, int mode); + int (*inode_link) (struct dentry *old_dentry, struct vfsmount *old_mnt, + struct inode *dir, struct dentry *new_dentry, + struct vfsmount *new_mnt); + int (*inode_unlink) (struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt); + int (*inode_symlink) (struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, const char *old_name); + int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, int mode); + int (*inode_rmdir) (struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt); int (*inode_mknod) (struct inode *dir, struct dentry *dentry, - int mode, dev_t dev); + struct vfsmount *mnt, int mode, dev_t dev); int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry, - struct inode *new_dir, struct dentry *new_dentry); - int (*inode_readlink) (struct dentry *dentry); + struct vfsmount *old_mnt, + struct inode *new_dir, struct dentry *new_dentry, + struct vfsmount *new_mnt); + int (*inode_readlink) (struct dentry *dentry, struct vfsmount *mnt); int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd); - int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); + int (*inode_setattr) (struct dentry *dentry, struct vfsmount *mnt, + struct iattr *attr); int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); void (*inode_delete) (struct inode *inode); - int (*inode_setxattr) (struct dentry *dentry, char *name, void *value, - size_t size, int flags); - void (*inode_post_setxattr) (struct dentry *dentry, char *name, void *value, + int (*inode_setxattr) (struct dentry *dentry, struct vfsmount *mnt, + char *name, void *value, size_t size, int flags, + struct file *file); + void (*inode_post_setxattr) (struct dentry *dentry, + struct vfsmount *mnt, + char *name, void *value, size_t size, int flags); - int (*inode_getxattr) (struct dentry *dentry, char *name); - int (*inode_listxattr) (struct dentry *dentry); - int (*inode_removexattr) (struct dentry *dentry, char *name); + int (*inode_getxattr) (struct dentry *dentry, struct vfsmount *mnt, + char *name, struct file *file); + int (*inode_listxattr) (struct dentry *dentry, struct vfsmount *mnt, + struct file *file); + int (*inode_removexattr) (struct dentry *dentry, struct vfsmount *mnt, + char *name, struct file *file); int (*inode_need_killpriv) (struct dentry *dentry); int (*inode_killpriv) (struct dentry *dentry); int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err); @@ -1476,6 +1521,7 @@ int security_settime(struct timespec *ts, struct timezone *tz); int security_vm_enough_memory(long pages); int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); +int security_vm_enough_memory_kern(long pages); int security_bprm_alloc(struct linux_binprm *bprm); void security_bprm_free(struct linux_binprm *bprm); void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); @@ -1503,30 +1549,43 @@ void security_inode_free(struct inode *inode); int security_inode_init_security(struct inode *inode, struct inode *dir, char **name, void **value, size_t *len); -int security_inode_create(struct inode *dir, struct dentry *dentry, int mode); -int security_inode_link(struct dentry *old_dentry, struct inode *dir, - struct dentry *new_dentry); -int security_inode_unlink(struct inode *dir, struct dentry *dentry); +int security_inode_create(struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, int mode); +int security_inode_link(struct dentry *old_dentry, struct vfsmount *old_mnt, + struct inode *dir, struct dentry *new_dentry, + struct vfsmount *new_mnt); +int security_inode_unlink(struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt); int security_inode_symlink(struct inode *dir, struct dentry *dentry, - const char *old_name); -int security_inode_mkdir(struct inode *dir, struct dentry *dentry, int mode); -int security_inode_rmdir(struct inode *dir, struct dentry *dentry); -int security_inode_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev); + struct vfsmount *mnt, const char *old_name); +int security_inode_mkdir(struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, int mode); +int security_inode_rmdir(struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt); +int security_inode_mknod(struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, int mode, dev_t dev); int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry, - struct inode *new_dir, struct dentry *new_dentry); -int security_inode_readlink(struct dentry *dentry); + struct vfsmount *old_mnt, struct inode *new_dir, + struct dentry *new_dentry, struct vfsmount *new_mnt); +int security_inode_readlink(struct dentry *dentry, struct vfsmount *mnt); int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); int security_inode_permission(struct inode *inode, int mask, struct nameidata *nd); -int security_inode_setattr(struct dentry *dentry, struct iattr *attr); +int security_inode_setattr(struct dentry *dentry, struct vfsmount *mnt, + struct iattr *attr); int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); void security_inode_delete(struct inode *inode); -int security_inode_setxattr(struct dentry *dentry, char *name, - void *value, size_t size, int flags); -void security_inode_post_setxattr(struct dentry *dentry, char *name, - void *value, size_t size, int flags); -int security_inode_getxattr(struct dentry *dentry, char *name); -int security_inode_listxattr(struct dentry *dentry); -int security_inode_removexattr(struct dentry *dentry, char *name); +int security_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt, + char *name, void *value, size_t size, int flags, + struct file *file); +void security_inode_post_setxattr(struct dentry *dentry, struct vfsmount *mnt, + char *name, void *value, size_t size, + int flags); +int security_inode_getxattr(struct dentry *dentry, struct vfsmount *mnt, + char *name, struct file *file); +int security_inode_listxattr(struct dentry *dentry, struct vfsmount *mnt, + struct file *file); +int security_inode_removexattr(struct dentry *dentry, struct vfsmount *mnt, + char *name, struct file *file); int security_inode_need_killpriv(struct dentry *dentry); int security_inode_killpriv(struct dentry *dentry); int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err); @@ -1684,14 +1743,23 @@ static inline int security_vm_enough_memory(long pages) { + WARN_ON(current->mm == NULL); return cap_vm_enough_memory(current->mm, pages); } static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) { + WARN_ON(mm == NULL); return cap_vm_enough_memory(mm, pages); } +static inline int security_vm_enough_memory_kern(long pages) +{ + /* If current->mm is a kernel thread then we will pass NULL, + for this specific case that is fine */ + return cap_vm_enough_memory(current->mm, pages); +} + static inline int security_bprm_alloc (struct linux_binprm *bprm) { return 0; @@ -1813,26 +1881,31 @@ static inline int security_inode_create (struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, int mode) { return 0; } static inline int security_inode_link (struct dentry *old_dentry, + struct vfsmount *old_mnt, struct inode *dir, - struct dentry *new_dentry) + struct dentry *new_dentry, + struct vfsmount *new_mnt) { return 0; } static inline int security_inode_unlink (struct inode *dir, - struct dentry *dentry) + struct dentry *dentry, + struct vfsmount *mnt) { return 0; } static inline int security_inode_symlink (struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, const char *old_name) { return 0; @@ -1840,19 +1913,22 @@ static inline int security_inode_mkdir (struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, int mode) { return 0; } static inline int security_inode_rmdir (struct inode *dir, - struct dentry *dentry) + struct dentry *dentry, + struct vfsmount *mnt) { return 0; } static inline int security_inode_mknod (struct inode *dir, struct dentry *dentry, + struct vfsmount *mnt, int mode, dev_t dev) { return 0; @@ -1860,13 +1936,16 @@ static inline int security_inode_rename (struct inode *old_dir, struct dentry *old_dentry, + struct vfsmount *old_mnt, struct inode *new_dir, - struct dentry *new_dentry) + struct dentry *new_dentry, + struct vfsmount *new_mnt) { return 0; } -static inline int security_inode_readlink (struct dentry *dentry) +static inline int security_inode_readlink(struct dentry *dentry, + struct vfsmount *mnt) { return 0; } @@ -1884,6 +1963,7 @@ } static inline int security_inode_setattr (struct dentry *dentry, + struct vfsmount *mnt, struct iattr *attr) { return 0; @@ -1898,29 +1978,40 @@ static inline void security_inode_delete (struct inode *inode) { } -static inline int security_inode_setxattr (struct dentry *dentry, char *name, - void *value, size_t size, int flags) -{ - return cap_inode_setxattr(dentry, name, value, size, flags); +static inline int security_inode_setxattr (struct dentry *dentry, + struct vfsmount *mnt, char *name, + void *value, size_t size, int flags, + struct file *file) +{ + return cap_inode_setxattr(dentry, mnt, name, value, size, flags, file); } -static inline void security_inode_post_setxattr (struct dentry *dentry, char *name, - void *value, size_t size, int flags) +static inline void security_inode_post_setxattr (struct dentry *dentry, + struct vfsmount *mnt, + char *name, + void *value, size_t size, + int flags) { } -static inline int security_inode_getxattr (struct dentry *dentry, char *name) +static inline int security_inode_getxattr (struct dentry *dentry, + struct vfsmount *mnt, char *name, + struct file *file) { return 0; } -static inline int security_inode_listxattr (struct dentry *dentry) +static inline int security_inode_listxattr (struct dentry *dentry, + struct vfsmount *mnt, + struct file *file) { return 0; } -static inline int security_inode_removexattr (struct dentry *dentry, char *name) +static inline int security_inode_removexattr (struct dentry *dentry, + struct vfsmount *mnt, char *name, + struct file *file) { - return cap_inode_removexattr(dentry, name); + return cap_inode_removexattr(dentry, mnt, name, file); } static inline int security_inode_need_killpriv(struct dentry *dentry) @@ -2112,7 +2203,7 @@ struct siginfo *info, int sig, u32 secid) { - return cap_task_kill(p, info, sig, secid); + return 0; } static inline int security_task_wait (struct task_struct *p) --- linux-2.6.24.orig/include/linux/dcache.h +++ linux-2.6.24/include/linux/dcache.h @@ -300,6 +300,8 @@ */ extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); +extern char *__d_path(struct dentry *, struct vfsmount *, struct dentry *, + struct vfsmount *, char *, int, int); extern char * d_path(struct dentry *, struct vfsmount *, char *, int); /* Allocation counts.. */ --- linux-2.6.24.orig/include/linux/wireless.h +++ linux-2.6.24/include/linux/wireless.h @@ -541,6 +541,16 @@ /* Maximum size of returned data */ #define IW_SCAN_MAX_DATA 4096 /* In bytes */ +/* Scan capability flags - in (struct iw_range *)->scan_capa */ +#define IW_SCAN_CAPA_NONE 0x00 +#define IW_SCAN_CAPA_ESSID 0x01 +#define IW_SCAN_CAPA_BSSID 0x02 +#define IW_SCAN_CAPA_CHANNEL 0x04 +#define IW_SCAN_CAPA_MODE 0x08 +#define IW_SCAN_CAPA_RATE 0x10 +#define IW_SCAN_CAPA_TYPE 0x20 +#define IW_SCAN_CAPA_TIME 0x40 + /* Max number of char in custom event - use multiple of them if needed */ #define IW_CUSTOM_MAX 256 /* In bytes */ @@ -963,6 +973,9 @@ __u16 old_num_channels; __u8 old_num_frequency; + /* Scan capabilities */ + __u8 scan_capa; /* IW_SCAN_CAPA_* bit field */ + /* Wireless event capability bitmasks */ __u32 event_capa[6]; --- linux-2.6.24.orig/include/linux/time.h +++ linux-2.6.24/include/linux/time.h @@ -173,6 +173,10 @@ { ns += a->tv_nsec; while(unlikely(ns >= NSEC_PER_SEC)) { + /* The following asm() prevents the compiler from + * optimising this loop into a modulo operation. */ + asm("" : "+r"(ns)); + ns -= NSEC_PER_SEC; a->tv_sec++; } --- linux-2.6.24.orig/include/linux/irq.h +++ linux-2.6.24/include/linux/irq.h @@ -367,6 +367,9 @@ __set_irq_handler(irq, handle, 1, NULL); } +extern void set_irq_noprobe(unsigned int irq); +extern void set_irq_probe(unsigned int irq); + /* Handle dynamic irq creation and destruction */ extern int create_irq(void); extern void destroy_irq(unsigned int irq); --- linux-2.6.24.orig/include/linux/compat.h +++ linux-2.6.24/include/linux/compat.h @@ -267,5 +267,7 @@ asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags, const struct compat_itimerspec __user *utmr); +extern void __user *compat_alloc_user_space(unsigned long len); + #endif /* CONFIG_COMPAT */ #endif /* _LINUX_COMPAT_H */ --- linux-2.6.24.orig/include/linux/fb.h +++ linux-2.6.24/include/linux/fb.h @@ -966,6 +966,9 @@ /* drivers/video/fb_defio.c */ extern void fb_deferred_io_init(struct fb_info *info); +extern void fb_deferred_io_open(struct fb_info *info, + struct inode *inode, + struct file *file); extern void fb_deferred_io_cleanup(struct fb_info *info); extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync); --- linux-2.6.24.orig/include/linux/Kbuild +++ linux-2.6.24/include/linux/Kbuild @@ -98,7 +98,6 @@ header-y += ixjuser.h header-y += jffs2.h header-y += keyctl.h -header-y += kvm.h header-y += limits.h header-y += lock_dlm_plock.h header-y += magic.h @@ -255,6 +254,7 @@ unifdef-y += kernelcapi.h unifdef-y += kernel.h unifdef-y += keyboard.h +unifdef-$(CONFIG_HAVE_KVM) += kvm.h unifdef-y += llc.h unifdef-y += loop.h unifdef-y += lp.h --- linux-2.6.24.orig/include/linux/sched.h +++ linux-2.6.24/include/linux/sched.h @@ -88,6 +88,7 @@ #include #include #include +#include #include @@ -847,6 +848,10 @@ void (*set_curr_task) (struct rq *rq); void (*task_tick) (struct rq *rq, struct task_struct *p); void (*task_new) (struct rq *rq, struct task_struct *p); + +#ifdef CONFIG_FAIR_GROUP_SCHED + void (*moved_group) (struct task_struct *p); +#endif }; struct load_weight { @@ -1039,7 +1044,7 @@ char comm[TASK_COMM_LEN]; /* executable name excluding path - access with [gs]et_task_comm (which lock it with task_lock()) - - initialized normally by flush_old_exec */ + - initialized normally by setup_new_exec */ /* file system info */ int link_count, total_link_count; #ifdef CONFIG_SYSVIPC @@ -1178,6 +1183,11 @@ int make_it_fail; #endif struct prop_local_single dirties; +#ifdef CONFIG_LATENCYTOP + int latency_record_count; + struct latency_record latency_record[LT_SAVECOUNT]; +#endif + struct list_head *scm_work_list; }; /* @@ -1449,6 +1459,12 @@ extern void sched_idle_next(void); +#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) +extern void wake_up_idle_cpu(int cpu); +#else +static inline void wake_up_idle_cpu(int cpu) { } +#endif + #ifdef CONFIG_SCHED_DEBUG extern unsigned int sysctl_sched_latency; extern unsigned int sysctl_sched_min_granularity; --- linux-2.6.24.orig/include/linux/mount.h +++ linux-2.6.24/include/linux/mount.h @@ -103,5 +103,10 @@ extern spinlock_t vfsmount_lock; extern dev_t name_to_dev_t(char *name); +extern char *d_namespace_path(struct dentry *, struct vfsmount *, char *, int); + +extern int default_relatime; +extern int relatime_interval; + #endif #endif /* _LINUX_MOUNT_H */ --- linux-2.6.24.orig/include/linux/ethtool.h +++ linux-2.6.24/include/linux/ethtool.h @@ -12,6 +12,7 @@ #ifndef _LINUX_ETHTOOL_H #define _LINUX_ETHTOOL_H +#include /* This should work for both 32 and 64 bit userland. */ struct ethtool_cmd { --- linux-2.6.24.orig/include/linux/sysctl.h +++ linux-2.6.24/include/linux/sysctl.h @@ -977,6 +977,8 @@ extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, struct file *, void __user *, size_t *, loff_t *); +extern char *sysctl_pathname(ctl_table *, char *, int); + extern int do_sysctl (int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp, void __user *newval, size_t newlen); --- linux-2.6.24.orig/include/linux/ktime.h +++ linux-2.6.24/include/linux/ktime.h @@ -310,6 +310,8 @@ return ktime_sub_ns(kt, usec * 1000); } +extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); + /* * The resolution of the clocks. The resolution value is returned in * the clock_getres() system call to give application programmers an --- linux-2.6.24.orig/include/linux/hugetlb.h +++ linux-2.6.24/include/linux/hugetlb.h @@ -8,6 +8,7 @@ #include #include #include +#include struct ctl_table; @@ -17,6 +18,7 @@ } int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); +int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); --- linux-2.6.24.orig/include/linux/random.h +++ linux-2.6.24/include/linux/random.h @@ -51,17 +51,6 @@ extern void get_random_bytes(void *buf, int nbytes); void generate_random_uuid(unsigned char uuid_out[16]); -extern __u32 secure_ip_id(__be32 daddr); -extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); -extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, - __be16 dport); -extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, - __be16 sport, __be16 dport); -extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, - __be16 sport, __be16 dport); -extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, - __be16 sport, __be16 dport); - #ifndef MODULE extern const struct file_operations random_fops, urandom_fops; #endif --- linux-2.6.24.orig/include/linux/rfkill.h +++ linux-2.6.24/include/linux/rfkill.h @@ -33,11 +33,13 @@ * RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device. * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. * RFKILL_TYPE_UWB: switch is on a ultra wideband device. + * RFKILL_TYPE_WIMAX: switch is on a WiMAX device. */ enum rfkill_type { RFKILL_TYPE_WLAN , RFKILL_TYPE_BLUETOOTH, RFKILL_TYPE_UWB, + RFKILL_TYPE_WIMAX, RFKILL_TYPE_MAX, }; --- linux-2.6.24.orig/include/linux/lguest_launcher.h +++ linux-2.6.24/include/linux/lguest_launcher.h @@ -23,7 +23,12 @@ struct lguest_device_desc { /* The device type: console, network, disk etc. Type 0 terminates. */ __u8 type; - /* The number of bytes of the config array. */ + /* The number of virtqueues (first in config array) */ + __u8 num_vq; + /* The number of bytes of feature bits. Multiply by 2: one for host + * features and one for guest acknowledgements. */ + __u8 feature_len; + /* The number of bytes of the config array after virtqueues. */ __u8 config_len; /* A status byte, written by the Guest. */ __u8 status; @@ -31,7 +36,7 @@ }; /*D:135 This is how we expect the device configuration field for a virtqueue - * (type VIRTIO_CONFIG_F_VIRTQUEUE) to be laid out: */ + * to be laid out in config space. */ struct lguest_vqconfig { /* The number of entries in the virtio_ring */ __u16 num; --- linux-2.6.24.orig/include/linux/ieee80211.h +++ linux-2.6.24/include/linux/ieee80211.h @@ -81,18 +81,18 @@ /* miscellaneous IEEE 802.11 constants */ -#define IEEE80211_MAX_FRAG_THRESHOLD 2346 -#define IEEE80211_MAX_RTS_THRESHOLD 2347 +#define IEEE80211_MAX_FRAG_THRESHOLD 2352 +#define IEEE80211_MAX_RTS_THRESHOLD 2353 #define IEEE80211_MAX_AID 2007 #define IEEE80211_MAX_TIM_LEN 251 -#define IEEE80211_MAX_DATA_LEN 2304 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section 6.2.1.1.2. - The figure in section 7.1.2 suggests a body size of up to 2312 - bytes is allowed, which is a bit confusing, I suspect this - represents the 2304 bytes of real data, plus a possible 8 bytes of - WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ + 802.11e clarifies the figure in section 7.1.2. The frame body is + up to 2304 octets long (maximum MSDU size) plus any crypt overhead. */ +#define IEEE80211_MAX_DATA_LEN 2304 +/* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */ +#define IEEE80211_MAX_FRAME_LEN 2352 #define IEEE80211_MAX_SSID_LEN 32 --- linux-2.6.24.orig/include/linux/stacktrace.h +++ linux-2.6.24/include/linux/stacktrace.h @@ -9,10 +9,13 @@ }; extern void save_stack_trace(struct stack_trace *trace); +extern void save_stack_trace_tsk(struct task_struct *tsk, + struct stack_trace *trace); extern void print_stack_trace(struct stack_trace *trace, int spaces); #else # define save_stack_trace(trace) do { } while (0) +# define save_stack_trace_tsk(tsk, trace) do { } while (0) # define print_stack_trace(trace, spaces) do { } while (0) #endif --- linux-2.6.24.orig/include/linux/delay.h +++ linux-2.6.24/include/linux/delay.h @@ -35,6 +35,7 @@ #define ndelay(x) udelay(((x)+999)/1000) #endif +extern unsigned long lpj_tsc; void calibrate_delay(void); void msleep(unsigned int msecs); unsigned long msleep_interruptible(unsigned int msecs); --- linux-2.6.24.orig/include/linux/kvm_types.h +++ linux-2.6.24/include/linux/kvm_types.h @@ -0,0 +1,53 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef __KVM_TYPES_H__ +#define __KVM_TYPES_H__ + +#include + +/* + * Address types: + * + * gva - guest virtual address + * gpa - guest physical address + * gfn - guest frame number + * hva - host virtual address + * hpa - host physical address + * hfn - host frame number + */ + +typedef unsigned long gva_t; +typedef u64 gpa_t; +typedef unsigned long gfn_t; + +typedef unsigned long hva_t; +typedef u64 hpa_t; +typedef unsigned long hfn_t; + +struct kvm_pio_request { + unsigned long count; + int cur_count; + gva_t guest_gva; + int in; + int port; + int size; + int string; + int down; + int rep; +}; + +#endif /* __KVM_TYPES_H__ */ --- linux-2.6.24.orig/include/linux/netfilter/Kbuild +++ linux-2.6.24/include/linux/netfilter/Kbuild @@ -28,6 +28,7 @@ header-y += xt_multiport.h header-y += xt_pkttype.h header-y += xt_policy.h +header-y += xt_quota.h header-y += xt_realm.h header-y += xt_sctp.h header-y += xt_state.h --- linux-2.6.24.orig/include/linux/nfsd/nfsd.h +++ linux-2.6.24/include/linux/nfsd/nfsd.h @@ -79,7 +79,8 @@ #ifdef CONFIG_NFSD_V4 __be32 nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *, struct nfs4_acl *); -int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **); +int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, + struct vfsmount *mnt, struct nfs4_acl **); #endif /* CONFIG_NFSD_V4 */ __be32 nfsd_create(struct svc_rqst *, struct svc_fh *, char *name, int len, struct iattr *attrs, --- linux-2.6.24.orig/include/linux/nfsd/xdr4.h +++ linux-2.6.24/include/linux/nfsd/xdr4.h @@ -207,10 +207,8 @@ u32 op_create; /* request */ u32 op_createmode; /* request */ u32 op_bmval[2]; /* request */ - union { /* request */ - struct iattr iattr; /* UNCHECKED4,GUARDED4 */ - nfs4_verifier verf; /* EXCLUSIVE4 */ - } u; + struct iattr iattr; /* UNCHECKED4, GUARDED4, EXCLUSIVE4_1 */ + nfs4_verifier verf; /* EXCLUSIVE4 */ clientid_t op_clientid; /* request */ struct xdr_netobj op_owner; /* request */ u32 op_seqid; /* request */ @@ -224,8 +222,8 @@ struct nfs4_stateowner *op_stateowner; /* used during processing */ struct nfs4_acl *op_acl; }; -#define op_iattr u.iattr -#define op_verf u.verf +#define op_iattr iattr +#define op_verf verf struct nfsd4_open_confirm { stateid_t oc_req_stateid /* request */; --- linux-2.6.24.orig/include/linux/ssb/ssb_regs.h +++ linux-2.6.24/include/linux/ssb/ssb_regs.h @@ -147,6 +147,10 @@ #define SSB_IDLOW_SSBREV 0xF0000000 /* Sonics Backplane Revision code */ #define SSB_IDLOW_SSBREV_22 0x00000000 /* <= 2.2 */ #define SSB_IDLOW_SSBREV_23 0x10000000 /* 2.3 */ +#define SSB_IDLOW_SSBREV_24 0x40000000 /* ?? Found in BCM4328 */ +#define SSB_IDLOW_SSBREV_25 0x50000000 /* ?? Not Found yet */ +#define SSB_IDLOW_SSBREV_26 0x60000000 /* ?? Found in some BCM4311/2 */ +#define SSB_IDLOW_SSBREV_27 0x70000000 /* ?? Found in some BCM4311/2 */ #define SSB_IDHIGH 0x0FFC /* SB Identification High */ #define SSB_IDHIGH_RCLO 0x0000000F /* Revision Code (low part) */ #define SSB_IDHIGH_CC 0x00008FF0 /* Core Code */ --- linux-2.6.24.orig/include/linux/mmc/mmc_protocol.h +++ linux-2.6.24/include/linux/mmc/mmc_protocol.h @@ -0,0 +1,366 @@ +/* + * mmc_protocol.h - MMC Protocol driver header file + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from previous mmc code in Linux kernel + * Copyright (c) 2002 Hewlett-Packard Company + * Copyright (c) 2002 Andrew Christian + * Copyright (c) 2006 Bridge Wu + */ + + +#ifndef __MMC_PROTOCOL_H__ +#define __MMC_PROTOCOL_H__ + + +#include + +#define MMC_PROTOCOL "mmc" + +/*card status*/ + +#define PARSE_U32(_buf) \ + (((u32)(_buf)[0]) << 24) | (((u32)(_buf)[1]) << 16) | \ + (((u32)(_buf)[2]) << 8) | ((u32)(_buf)[3]); + +#define PARSE_U16(_buf) \ + (((u16)(_buf)[0]) << 8) | ((u16)(_buf)[1]); + + +/* Standard MMC clock speeds */ +#define MMC_CARD_CLOCK_SLOW 0 /* The LOWEST clock for mmc */ +#define MMC_CARD_CLOCK_FAST 52000000 /* The HIGHEST clock for mmc */ + +/* command type: ac(addressed command), bcr(broadcase command with response), + * adtc(addressed data transfer command), bc(broadcase command) + */ + +/* Standard MMC commands (4.0) type argument response */ + + /* class 0, basic: 0-10, 12-15, 19 */ +#define MMC_GO_IDLE_STATE 0 /* bc */ +#define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ +#define MMC_ALL_SEND_CID 2 /* bcr R2 */ +#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ +#define MMC_SET_DSR 4 /* bc [31:16] DSR */ +#define MMC_RSVD5 5 +#define MMC_SWITCH 6 /* ac see comments below R1b */ +#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ +#define MMC_SEND_EXT_CSD 8 /* adtc R1 */ +#define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ +#define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ +#define MMC_STOP_TRANSMISSION 12 /* ac R1b */ +#define MMC_SEND_STATUS 13 /* ac [31:16] RCA R1 */ +#define MMC_BUSTEST_R 14 /* adtc R1 */ +#define MMC_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */ +#define MMC_BUSTEST_W 19 /* adtc R1 */ +/* CMD6: [25:24access,23:16index,15:8value,2:0cmd set] */ + + /* class 1, stream read: 11 */ +#define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ + + /* class 2, block read: 16-18, 23 */ +#define MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ +#define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ +#define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ + + /* class 3, stream write: 20 */ +#define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ + + /* class 4, block write: 16, 23-27 */ +#define MMC_SET_BLOCK_COUNT 23 /* ad [15:0] nob R1 */ +#define MMC_WRITE_BLOCK 24 /* adtc [31:0] data addr R1 */ +#define MMC_WRITE_MULTIPLE_BLOCK 25 /* adtc R1 */ +#define MMC_PROGRAM_CID 26 /* adtc R1 */ +#define MMC_PROGRAM_CSD 27 /* adtc R1 */ + + /* class 6, write protection: 28-30 */ +#define MMC_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */ +#define MMC_CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */ +#define MMC_SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */ + + /* class 5, erase: 35, 36, 38 */ +#define MMC_ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */ +#define MMC_ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */ +#define MMC_ERASE 37 /* ac R1b */ + + /* class 9, I/O mode: 39, 40 */ +#define MMC_FAST_IO 39 /* ac see comments below R4 */ +#define MMC_GO_IRQ_STATE 40 /* bcr R5 */ +/* [31:16RCA, 15:15reg write flag, 14:8reg address, 7:0reg data] */ + + /* class 7, lock card: 42 */ +#define MMC_LOCK_UNLOCK 42 /* adtc R1b */ + + /* class 8, application specific: 55, 56 */ +#define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ +#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1b */ + +#if 0 +#ifdef CONFIG_CEATA + + // CEATA command +#define CEATA_RW_MULTIPLE_REGISTER 60 /* R1B*/ +#define CEATA_RW_MULTIPLE_BLOCK 61 /* R1B*/ + + +//CEATA taskfile related +#define CEATA_FEATURES_EXP 0x01 +#define CEATA_SECTOR_COUNT_EXP 0x02 +#define CEATA_LBA_LOW_EXP 0x03 +#define CEATA_LBA_MID_EXP 0x04 +#define CEATA_LBA_HIGH_EXP 0x05 +#define CEATA_CONTROL 0x06 +#define CEATA_FEATURES_ERROR 0x09 +#define CEATA_SECTOR_COUNT 0x0A +#define CEATA_LBA_LOW 0x0B +#define CEATA_LBA_MID 0x0C +#define CEATA_LBA_HIGH 0x0D +#define CEATA_DEVICE_HEAD 0x0E +#define CEATA_COMMAND_STATUS 0x0F + +//CEATA command arguments to write to taskfile at COMMAND_STATUS(0x0F) +#define CEATA_READ_DMA_EXT 0x25 +#define CEATA_WRITE_DMA_EXT 0x35 +#define CEATA_STAND_BY_IMMEDIATE 0xE0 +#define CEATA_FLUSH_CACHE_EXT 0xEA +#define CEATA_IDENTIFY_DATA 0xEC + + +//CEATA taskfile file value at the status field(0x0F) +#define BSY 0x80 +#define ATA_ERROR 0x01 + +#endif +#endif + +/* + MMC status in R1 + Type + e : error bit + s : status bit + r : detected and set for the actual command response + x : detected and set during command execution. the host must poll + the card by sending status command in order to read these bits. + Clear condition + a : according to the card state + b : always related to the previous command. Reception of + a valid command will clear it (with a delay of one command) + c : clear by read + */ + +#define R1_OUT_OF_RANGE (1 << 31) /* er, c */ +#define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ +#define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ +#define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ +#define R1_ERASE_PARAM (1 << 27) /* ex, c */ +#define R1_WP_VIOLATION (1 << 26) /* erx, c */ +#define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ +#define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ +#define R1_COM_CRC_ERROR (1 << 23) /* er, b */ +#define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ +#define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ +#define R1_CC_ERROR (1 << 20) /* erx, c */ +#define R1_ERROR (1 << 19) /* erx, c */ +#define R1_UNDERRUN (1 << 18) /* ex, c */ +#define R1_OVERRUN (1 << 17) /* ex, c */ +#define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ +#define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ +#define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a, must be set 0 to MMC4.0 */ +#define R1_ERASE_RESET (1 << 13) /* sr, c */ + +#define R1_STATUS(x) (x & 0xFFFFE000) + +#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ +#define R1_READY_FOR_DATA (1 << 8) /* sx, a */ +#define R1_SWITCH_ERROR (1 << 7) /* E, X */ +#define R1_APP_CMD (1 << 5) /* sr, c */ + +#define MMC_SLOT_RCA(slot) (slot->id + 1) /* map the slot id to rca */ +enum mmc_status_error { + MMC_ERROR_NONE = 0, + MMC_ERROR_OUT_OF_RANGE, + MMC_ERROR_ADDRESS, + MMC_ERROR_BLOCK_LEN, + MMC_ERROR_ERASE_SEQ, + MMC_ERROR_ERASE_PARAM, + MMC_ERROR_WP_VIOLATION, + MMC_ERROR_CARD_IS_LOCKED, + MMC_ERROR_LOCK_UNLOCK_FAILED, + MMC_ERROR_COM_CRC, + MMC_ERROR_ILLEGAL_COMMAND, /* 10 */ + MMC_ERROR_CARD_ECC_FAILED, + MMC_ERROR_CC, + MMC_ERROR_GENERAL, + MMC_ERROR_UNDERRUN, + MMC_ERROR_OVERRUN, + MMC_ERROR_CID_CSD_OVERWRITE, + MMC_ERROR_STATE_MISMATCH, + MMC_ERROR_HEADER_MISMATCH, +}; + +enum card_state { + CARD_STATE_EMPTY = -1, + CARD_STATE_IDLE = 0, + CARD_STATE_READY = 1, + CARD_STATE_IDENT = 2, + CARD_STATE_STBY = 3, + CARD_STATE_TRAN = 4, + CARD_STATE_DATA = 5, + CARD_STATE_RCV = 6, + CARD_STATE_PRG = 7, + CARD_STATE_DIS = 8, + CARD_STATE_BTST = 9 +}; + +/* These are unpacked versions of the actual responses */ + +struct mmc_response_r1 { + u8 cmd; + u32 status; +}; + +struct mmc_cid { + u8 mid; + u16 oid; + u8 pnm[7]; /* Product name (we null-terminate) */ + u8 prv; + u32 psn; + u8 mdt; +}; + +struct mmc_csd { + u8 csd_structure; +#define CSD_STRUCT_1_0 0 /* Valid for system specification 1.0 - 1.2 */ +#define CSD_STRUCT_1_1 1 /* Valid for system specification 1.4 - 2.2 */ +#define CSD_STRUCT_1_2 2 /* Valid for system specification 3.1 */ + + u8 spec_vers; +#define CSD_SPEC_VERS_0 0 /* Implements system specification 1.0 - 1.2 */ +#define CSD_SPEC_VERS_1 1 /* Implements system specification 1.4 */ +#define CSD_SPEC_VERS_2 2 /* Implements system specification 2.0 - 2.2 */ +#define CSD_SPEC_VERS_3 3 /* Implements system specification 3.1 */ +#define CSD_SPEC_VERS_4 4 /* Implements system specification 4.0 - 4.2 */ + + u8 taac; + u8 nsac; + u8 tran_speed; + u16 ccc; + u8 read_bl_len; + u8 read_bl_partial; + u8 write_blk_misalign; + u8 read_blk_misalign; + u8 dsr_imp; + u16 c_size; + u8 vdd_r_curr_min; + u8 vdd_r_curr_max; + u8 vdd_w_curr_min; + u8 vdd_w_curr_max; + u8 c_size_mult; + union { + struct { /* MMC system specification version 3.1 */ + u8 erase_grp_size; + u8 erase_grp_mult; + } v31; + struct { /* MMC system specification version 2.2 */ + u8 sector_size; + u8 erase_grp_size; + } v22; + } erase; + u8 wp_grp_size; + u8 wp_grp_enable; + u8 default_ecc; + u8 r2w_factor; + u8 write_bl_len; + u8 write_bl_partial; + u8 file_format_grp; + u8 copy; + u8 perm_write_protect; + u8 tmp_write_protect; + u8 file_format; + u8 ecc; +}; + +struct mmc_ext_csd { + u8 s_cmd_set; + u8 sec_count; + u8 min_perf_w_8_52; + u8 min_perf_r_8_52; + u8 min_perf_w_26_4_52; + u8 min_perf_r_26_4_52; + u8 min_perf_w_4_26; + u8 min_perf_r_4_26; + u8 pwr_cl_26_360; + u8 pwr_cl_52_360; + u8 pwr_cl_26_195; + u8 pwr_cl_52_195; + u8 card_type; + u8 csd_structure; + u8 ext_csd_rev; + u8 cmd_set; + u8 cmd_set_rev; + u8 power_class; + u8 hs_timing; + u8 erased_mem_cont; +}; + +struct mmc_response_r3 { + u8 cmd; + u32 ocr; +#define MMC_ACCESS_MODE_MASK (0x3 << 29) /* mask to acess mode */ +#define MMC_ACCESS_MODE_SECTOR (0x2 << 29) /* sector access mode */ +#define MMC_ACCESS_MODE_BYTE (0x0 << 29) /* byte access mode */ +#define MMC_CARD_BUSY (1 << 31) /* Card Power up status bit */ +#define MMC_VDD_MASK (0xffff1 << 7) +}; + +struct mmc_response_r4 { /*Fast I/O */ + u8 cmd; + u16 rca; + u8 status; + u8 reg_addr; + u8 read_reg_contents; +}; + +struct mmc_response_r5 { /*Interrupt request */ + u8 cmd; + u16 rca; + u16 irq_data; +}; + +struct mmc_card { + struct mmc_cid cid; + struct mmc_csd csd; + struct mmc_ext_csd ext_csd; + /* The mmc card property */ + u32 vdd:24, + high_speed:2, + access_mode:2, + bus_width:4; + char *buf; + struct mss_ll_request llreq; + struct mss_cmd cmd; + struct mss_data data; + enum mmc_status_error errno; + enum card_state state; /* empty, ident, ready, whatever */ + u32 block_len; + u16 rca; +}; + +#endif /* end __MMC_PROTOCOL_H__ */ --- linux-2.6.24.orig/include/linux/mmc/sdio_protocol.h +++ linux-2.6.24/include/linux/mmc/sdio_protocol.h @@ -0,0 +1,374 @@ +/* + * sdio_protocol.h - SDIO Protocol driver header file + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from previous mmc code in Linux kernel + * Copyright (c) 2002 Hewlett-Packard Company + * Copyright (c) 2002 Andrew Christian + * Copyright (c) 2006 Bridge Wu + */ + + +#ifndef __SDIO_PROTOCOL_H__ +#define __SDIO_PROTOCOL_H__ + +#define SDIO_PROTOCOL "sdio" + +#define SDIO_READ 0 +#define SDIO_WRITE 1 + +#define CMD53_OP_FIXED 0 +#define CMD53_OP_INC 1 + +/* Standard SD clock speeds */ +#define SDIO_CARD_CLOCK_SLOW 0 /* 0/100KHz -- 400 kHz for initial setup */ +#define SDIO_CARD_CLOCK_FAST 25000000 /* 25 MHz for maximum for normal operation */ + +/* command type: ac(addressed command), bcr(broadcase command with response), + * adtc(addressed data transfer command), bc(broadcase command) + */ + +/* Standard SD commands (1.01) type argument response */ + /* class 0, basic: 0, 2-4, 7, 9, 10, 12, 13, 15 */ +#define SD_GO_IDLE_STATE 0 /* bc */ +#define SD_ALL_SEND_CID 2 /* bcr R2 */ +#define SD_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ +#define SD_SET_DSR 4 /* bc [31:16] RCA */ +#define SD_SELECT_CARD 7 /* ac [31:16] RCA R1 */ +#define SD_SEND_CSD 9 /* ac [31:16] RCA R2 */ +#define SD_SEND_CID 10 /* ac [31:16] RCA R2 */ +#define SD_STOP_TRANSMISSION 12 /* ac R1b */ +#define SD_SEND_STATUS 13 /* ac [31:16] RCA R1 */ +#define SD_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */ + + /* class 1: reserved */ + /* class 3: reserved */ + + /* class 2, block read: 16-18 */ +#define SD_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ +#define SD_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ +#define SD_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ + + /* class 4, block write: 16, 24, 25, 27 */ +#define SD_WRITE_BLOCK 24 /* adtc [31:0] data addr R1 */ +#define SD_WRITE_MULTIPLE_BLOCK 25 /* adtc [31:0] data addr R1 */ +#define SD_PROGRAM_CID 26 /* adtc R1 */ +#define SD_PROGRAM_CSD 27 /* adtc R1 */ +/* CMD26 appeared in SDMC state diagram(data transfer mode) */ + + /* class 6, write-protection: 28, 29, 30 */ +#define SD_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */ +#define SD_CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */ +#define SD_SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */ + + /* class 5, erase: 32, 33, 38 */ +#define SD_ERASE_WR_BLOCK_START 32 /* ac [31:0] data addr R1 */ +#define SD_ERASE_WR_BLOCK_END 33 /* ac [31:0] data addr R1 */ +#define SD_ERASE 38 /* ac R1b */ + + /* class 7, lock card: 42 */ +#define SD_LOCK_UNLOCK 42 /* adtc R1b */ + + /* class 8, application specific: 55, 56 */ +#define SD_APP_CMD 55 /* ac [31:16] RCA R1 */ +#define SD_GEN_CMD 56 /* adtc [0] RD/WR R1b */ + + /* class 8, application specific: ACMD6,13,22,23,41,42,51 */ +#define SD_SET_BUS_WIDTH 6 /* ac [1:0] BUS WIDTH R1 */ +#define SD_SD_STATUS 13 /* adtc R1 */ +#define SD_SEND_NUM_WR_BLOCKS 22 /* adtc R1 */ +#define SD_SET_WR_BLK_ERASE_COUNT 23 /* ac [22:0] No.Blocks R1 */ +#define SD_SD_SEND_OP_COND 41 /* bcr [31:0] OCR R3 */ +#define SD_SET_CLR_CARD_DETECT 42 /* ac [0] set_cd R1 */ +#define SD_SEND_SCR 51 /* adtc R1 */ + + + +/* SDIO cmd */ +#define IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */ +#define IO_RW_DIRECT 52 /* R5 */ +#define IO_RW_EXTENDED 53 /* R5 */ + +/* + SD card status in R1: compatible to the MMC protocol + (SD status: extended status field of 512b, ACMD13 require card to send this) + Type + e : error bit + s : status bit + r : detected and set for the actual command response + x : detected and set during command execution. the host must poll + the card by sending status command in order to read these bits. + Clear condition + a : according to the card state + b : always related to the previous command. Reception of + a valid command will clear it (with a delay of one command) + c : clear by read + */ + +#define R1_OUT_OF_RANGE (1 << 31) /* er, c */ +#define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ +#define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ +#define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ +#define R1_ERASE_PARAM (1 << 27) /* ex, c */ +#define R1_WP_VIOLATION (1 << 26) /* erx, c */ +#define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ +#define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ +#define R1_COM_CRC_ERROR (1 << 23) /* er, b */ +#define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ +#define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ +#define R1_CC_ERROR (1 << 20) /* erx, c */ +#define R1_ERROR (1 << 19) /* erx, c */ +#define R1_UNDERRUN (1 << 18) /* ex, c */ +#define R1_OVERRUN (1 << 17) /* ex, c */ +#define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ +#define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ +#define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ +#define R1_ERASE_RESET (1 << 13) /* sr, c */ +#define R1_STATUS(x) (x & 0xFFFFE000) + +#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ +#define R1_READY_FOR_DATA (1 << 8) /* sx, a */ +#define R1_APP_CMD (1 << 5) /* sr, c */ +#define R1_AKE_SEQ_ERROR (1 << 3) /* er, c */ + + +/** + * SD status: extended status field of 512b, ACMD13 require card to send this. + * [511:510] DAT_BUS_WIDTH SR A + * [509] SECURE_MODE SR A + * [495:480] SD_CARD_TYPE SR A + * [479:448] SIZE_OF_PROTECTED_AREA SR A + */ + +/* for SDIO response r5 r6*/ +#define R5_COM_CRC_ERROR (1 << 7) /* er, b */ +#define R5_ILLEGAL_COMMAND (1 << 6) /* er, b */ +#define R5_ERROR (1 << 3) /* er, c */ +#define R5_FUNCTION_NUMBER (1 << 1) /* er, c */ +#define R5_OUT_OF_RANGE (1 << 0) /* er, c */ +#define R5_CURRENT_STATE(x) ((x & 0x30) >> 4) /* sx, b (4 bits) */ + +#define R6_COM_CRC_ERROR (1 << 15) /* er, b */ +#define R6_ILLEGAL_COMMAND (1 << 14) /* er, b */ +#define R6_ERROR (1 << 13) /* erx, c */ +#define R6_STATUS(x) (x & 0xFFFFE000) +#define R6_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ +#define R6_READY_FOR_DATA (1 << 8) /* sx, a */ +#define R6_APP_CMD (1 << 5) /* sr, c */ + + +#define MAX_FUNC_NUMBER 8 + +/* cccr register */ +#define CCCR_SDIO_REVISION (0x00) +#define SD_SPEC_REVISION (0x01) +#define IO_ENABLE (0x02) +#define IO_READY (0x03) +#define INT_ENABLE (0x04) +#define INT_PENDING (0x05) +#define IO_ABORT (0x06) +#define BUS_IF_CTRL (0x07) +#define CARD_CAPABILITY (0x08) +#define COMMON_CIS_POINTER_1 (0x09) +#define COMMON_CIS_POINTER_2 (0x0a) +#define COMMON_CIS_POINTER_3 (0x0b) +#define BUS_SUSPEND (0x0c) +#define FUNCTION_SELECT (0x0d) +#define EXEC_FLAGS (0x0e) +#define READY_FLAGS (0x0f) +#define FN0_BLKSZ_1 (0x10) +#define FN0_BLKSZ_2 (0x11) +#define POWER_CTRL (0x12) + +/* fbr register */ +#define FNn_IF_CODE(n) ((n << 8) | 0x00) +#define FNn_EXT_IF_CODE(n) ((n << 8) | 0x01) +#define FNn_SPS(n) ((n << 8) | 0x02) +#define FNn_CIS_POINTER_1(n) ((n << 8) | 0x09) +#define FNn_CIS_POINTER_2(n) ((n << 8) | 0x0a) +#define FNn_CIS_POINTER_3(n) ((n << 8) | 0x0b) +#define FNn_CSA_POINTER_1(n) ((n << 8) | 0x0c) +#define FNn_CSA_POINTER_2(n) ((n << 8) | 0x0d) +#define FNn_CSA_POINTER_3(n) ((n << 8) | 0x0e) +#define FNn_CSA_ACCESS_WIN(n) ((n << 8) | 0x0f) +#define FNn_BLKSZ_1(n) ((n << 8) | 0x10) +#define FNn_BLKSZ_2(n) ((n << 8) | 0x11) + +/* CIS tuple codes supported by SDIO device */ +#define CISTPL_NULL (0x00) +#define CISTPL_CHECKSUM (0x10) +#define CISTPL_VERS_1 (0x15) +#define CISTPL_ALTSTR (0x16) +#define CISTPL_MANFID (0x20) +#define CISTPL_FUNCID (0x21) +#define CISTPL_FUNCE (0x22) +#define CISTPL_SDIO_STD (0x91) +#define CISTPL_SDIO_EXT (0x92) +#define CISTPL_END (0xff) + +#define SDIO_R (0) +#define SDIO_W (1) + +enum sdio_status_error { + SDIO_ERROR_NONE = 0, + SDIO_ERROR_COM_CRC, + SDIO_ERROR_ILLEGAL_COMMAND, /* 10 */ + SDIO_ERROR_GENERAL, + SDIO_ERROR_OUT_OF_RANGE, + SDIO_ERROR_FUNC_NUM, + SDIO_ERROR_STATE_MISMATCH, + SDIO_ERROR_HEADER_MISMATCH, +}; + + + +enum card_state { + CARD_STATE_EMPTY = -1, + CARD_STATE_INIT = 0, + CARD_STATE_STBY = 3, + CARD_STATE_TRAN = 4, + CARD_STATE_CMD = 9 +}; + + +struct sdio_response_r1 { + u8 cmd; + u32 status; +}; + +struct sdio_response_r4 { + u32 ocr; + u8 ready; + u8 mem_present; + u8 func_num; +}; + +struct sdio_response_r5 { + u8 cmd; + u8 status; + u8 data; +}; + +struct sdio_response_r6 { + u8 cmd; + u16 rca; + int status; +}; + +struct sdio_cccr { + u8 cccrx:4, + sdiox:4; + u8 sdx; + u8 ioex; + u8 iorx; + u8 intex; + u8 intx; + u8 buswidth:2, + cd:1; + /* card capability */ + u8 sdc:1, + smb:1, + srw:1, + sbs:1, + s4mi:1, + e4mi:1, + lsc:1, + ls4b:1; + /* pointer to common CIS */ + u32 pccis; + u8 br:1, + bs:1; + u8 fsx:4, + df:1; + u8 exx; + u8 rfx; + u16 fn0_blksz; + u8 smpc:1, + empc:1; +}; + +struct sdio_fbr { + u8 fun_if_code:4, + fun_support_csa:1, + fun_csa_enable:1; + u8 fun_ext_if_code; + u32 pfcis; + u32 pcsa; + u16 fn_blksz; +}; + +struct sdio_ccis { + u16 manufacturer; /* CISTPL_MANFID */ + u16 card_id; +#if 1 + /* it seems this is n/a for type common according to SDIO spec 1.1 */ + u8 device_class; /* CISTPL_FUNCID, should be 0x0c */ + + /* CISTPL_FUNCE tuple for function 0 */ + u16 fn0_block_size; + u8 max_tran_speed; +#endif +}; + +struct sdio_fcis { + u8 device_class; /* CISTPL_FUNCID, should be 0x0c */ + + /* CISTPL_FUNCE for function 1 - 7 */ + u8 func_info; + u8 std_io_rev; + u32 card_psn; + u32 csa_size; + u8 csa_property; + u16 max_blk_size; + u32 ocr; + u8 op_min_pwr; /* op:operating pwr: current in mA */ + u8 op_avg_pwr; + u8 op_max_pwr; + u8 sb_min_pwr; /* sb:standby */ + u8 sb_avg_pwr; + u8 sb_max_pwr; + u16 min_bw; /* min data transfer bandwidth */ + u16 opt_bw; /* optimum data transfer bandwidth */ + /* SDIO 1.0 not support and 1.1 suport */ + u16 enable_timeout_val; + /* added for 1.1 on 7.13 */ + u16 sp_avg_pwr; + u16 sp_max_pwr; + u16 hp_avg_pwr; + u16 hp_max_pwr; + u16 lp_avg_pwr; + u16 lp_max_pwr; +}; + +struct sdio_card { + u8 func_num; + u8 mem_present; + u16 rca; + struct sdio_cccr cccr; + struct sdio_fbr fbr[MAX_FUNC_NUMBER]; + struct sdio_ccis ccis; + struct sdio_fcis fcis[MAX_FUNC_NUMBER]; + struct mss_ll_request llreq; + struct mss_cmd cmd; + struct mss_data data; + enum sdio_status_error errno; + enum card_state state; +}; + +#endif --- linux-2.6.24.orig/include/linux/mmc/mss_core.h +++ linux-2.6.24/include/linux/mmc/mss_core.h @@ -0,0 +1,437 @@ +/* + * mss_core.h - MMC/SD/SDIO Core driver header file + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from previous mmc code in Linux kernel + * Copyright (c) 2002 Hewlett-Packard Company + * Copyright (c) 2002 Andrew Christian + * Copyright (c) 2006 Bridge Wu + */ + + +#ifndef __MSS_CORE_H__ +#define __MSS_CORE_H__ + +#include +#include + +/* MSS Core general results */ +enum mss_result { + MSS_ERROR_NONE = 0, + MSS_ERROR_NO_PROTOCOL = 1, + MSS_ERROR_REGISTER_CARD, + MSS_ERROR_MISMATCH_CARD, + MSS_ERROR_WRONG_CARD_TYPE, + MSS_ERROR_CARD_REMOVING, + MSS_ERROR_RESP_UNPACK, + MSS_ERROR_CRC, + MSS_ERROR_FLASH, + MSS_ERROR_TIMEOUT, + MSS_ERROR_LOCKED, + MSS_ERROR_WP, + MSS_ERROR_ACTION_UNSUPPORTED, + MSS_ERROR_DMA, + MSS_ERROR_WRONG_ARG, +}; + +#define MSS_MAX_RESPONSE_SIZE 18 +//#define MSS_SECTOR_SIZE 512 + +/** + * enum mss_rsp_type: MMC/SD/SDIO command response type. + * + * This is used by both protocol and controller to set MMC/SD/SDIO controller + * according to command response type. This is related to MMC/SD/SDIO + * protocol, also to MMC/SD/SDIO controller. So it is placed in core layer, + * rather than in protocol layer or controller layer. + */ +enum mss_rsp_type { + MSS_RESPONSE_NONE = 0, + MSS_RESPONSE_R1 = 1, + MSS_RESPONSE_R1B = 10, + MSS_RESPONSE_R2_CID = 2, + MSS_RESPONSE_R2_CSD = 20, + MSS_RESPONSE_R3 = 3, + MSS_RESPONSE_R4 = 4, + MSS_RESPONSE_R5 = 5, + MSS_RESPONSE_R6 = 6, + MSS_RESPONSE_R7 = 7, +}; + +enum mss_card_type { + MSS_UNKNOWN_CARD = 0, + MSS_MMC_CARD = 1, + MSS_CEATA, + MSS_SD_CARD , + MSS_SDIO_CARD , + MSS_COMBO_CARD , + MSS_UNCOMPATIBLE_CARD, +}; + +struct mss_request { + struct mss_card *card; /* Card */ + int action; /* what kind of request */ +/* MSS general action in prot_entry() */ +#define MSS_ACTION_BASE 0x80 +#define MSS_ACTION_PRIVATE 0x100 + +#define MSS_RECOGNIZE_CARD (MSS_ACTION_BASE + 1) +#define MSS_INIT_CARD (MSS_ACTION_BASE + 2) +#define MSS_READ_MEM (MSS_ACTION_BASE + 3) +#define MSS_WRITE_MEM (MSS_ACTION_BASE + 4) +#define MSS_LOCK_CARD (MSS_ACTION_BASE + 5) +#define MSS_UNLOCK_CARD (MSS_ACTION_BASE + 6) +#define MSS_QUERY_CARD (MSS_ACTION_BASE + 7) +#define MSS_GET_CAPACITY (MSS_ACTION_BASE + 8) + + int errno; /* protocl specific error */ + void *arg; /* argumnets for request */ + void *result; /* the request results */ +}; + +struct mss_rw_arg { + u32 block; /* Start block address, for sdio, reg addr */ + u32 nob; /* Length of block for read/write */ + u32 block_len; /* Size of block (sanity check) */ + unsigned int sg_len; + struct scatterlist *sg; + u8 func; /* for sdio */ + u8 opcode; /* for sdio */ + u8 val; /* for sdio */ +}; + +struct mss_rw_result { + u32 bytes_xfered; +}; + +struct mss_cmd { + u32 opcode; /* command opcode */ + u32 arg; /* arguments */ + u8 response[MSS_MAX_RESPONSE_SIZE]; /* Response of the command */ + u32 flags; /* Specail flags for command */ +/* + * Some controller needs know some special command. + * MSS_CMD_INIT: It is the first command after card is reset, and controller + * may need precede command with some MMC CLKs + * MSS_CMD_STOP: It is the command that need stop the cuurent data transmission. + * MSS_CMD_SDIO_EN: The command is sent with the effect that sdio interrupt is + * enabled in the controller. + */ +#define MSS_CMD_INIT (1 << 0) +#define MSS_CMD_STOP (1 << 1) +#define MSS_CMD_SDIO_EN (1 << 2) + + u32 rtype; /* response type */ + u32 error; + struct mss_ll_request *llreq; + struct mss_data *data; +}; + +#define MSS_INIT_CMD(cmd, c_opcode, c_arg, c_flags, c_rtype) \ + do { \ + (cmd)->opcode = c_opcode; \ + (cmd)->arg = c_arg; \ + (cmd)->flags = c_flags; \ + (cmd)->rtype = c_rtype; \ + } while (0) + +struct mss_data { + u32 timeout_ns; /* data time out in ns */ + u32 blocks; /* number of block */ + u32 blksz; /* block lenght */ + u32 flags; +#define MSS_DATA_WRITE (1 << 0) +#define MSS_DATA_READ (1 << 1) +#define MSS_DATA_STREAM (1 << 2) +#define MSS_DATA_MULTI (1 << 3) + + unsigned int sg_len; + struct scatterlist *sg; + unsigned int bytes_xfered; +}; + +#define MSS_INIT_DATA(data, d_nob, d_block_len, d_flags, d_sg_len, d_sg, \ + d_timeout_ns) \ + do { \ + (data)->timeout_ns = d_timeout_ns; \ + (data)->blocks = d_nob; \ + (data)->blksz = d_block_len; \ + (data)->flags = d_flags; \ + (data)->sg_len = d_sg_len; \ + (data)->sg = d_sg; \ + } while(0) + +struct mss_ll_request { + struct mss_cmd *cmd; + struct mss_data *data; + + void *done_data; + void (*done)(struct mss_ll_request *); +}; + +struct mss_card { + u32 card_type; /* MMC or SD or SDIO */ + u32 state; /* card states */ +/* + * Card can be in several states, such as when card is suspended, the states + * may be MSS_CARD_IDENTIFIED | MSS_CARD_SUSPEND. + * The states is from the top view, it is diffrent with the states defined in + * the protocol. + */ +#define MSS_CARD_REGISTERED (0x1 << 1) +#define MSS_CARD_REMOVING (0x1 << 2) +#define MSS_CARD_HANDLEIO (0x1 << 3) +#define MSS_CARD_SUSPENDED (0x1 << 4) +#define MSS_CARD_WP (0x1 << 5) +#define MSS_CARD_INVALID (0x1 << 6) + + void *prot_card; /* point to specific protocl card structure */ + struct mss_prot_driver *prot_driver; /* protocol driver */ + + u32 usage; + u32 bus_width; /* 1-bit or 4-bit or 8-bit bus width */ + + struct mss_slot *slot; /* in which slot ? */ + struct device dev; /* device on mmc_bus */ +}; + +struct mss_driver { + struct device_driver driver; /* driver on mmc_bus */ + void (*sdio_int_handler)(struct mss_card *); + void (*request_done)(struct mss_request *); +}; + +struct mss_slot { + /* point to real card if inserted, else NULL */ + struct mss_card *card; + struct mss_host *host; /* point to controller */ + u32 id; /* slot is, start from 0 */ + + struct delayed_work card_detect; + void *private; +}; + +struct mss_ios { + u32 clock; /* current controller clock */ + u32 bus_width:4, /* current bus width */ +#define MSS_BUSWIDTH_1BIT 0 +#define MSS_BUSWIDTH_4BIT 1 +#define MSS_BUSWIDTH_8BIT 2 + access_mode:2, +#define MSS_ACCESS_MODE_BYTE 0 +#define MSS_ACCESS_MODE_SECTOR 2 + + high_speed:2, +#define MSS_HIGH_SPEED 1 + + bus_mode:2, /* current bus mode */ +#define MSS_BUSMODE_OPENDRAIN 1 +#define MSS_BUSMODE_PUSHPULL 2 + + chip_select:2, +#define MSS_CS_NO_CARE 0 +#define MSS_CS_HIGH 1 +#define MSS_CS_LOW 2 + + power_mode:2, +#define MSS_POWER_OFF 1 +#define MSS_POWER_UP 2 +#define MSS_POWER_ON 3 + sdio_int:2; +#define MSS_SDIO_INT_DIS 0 +#define MSS_SDIO_INT_EN 1 + + u32 vdd; +}; + +/* Host operations */ +struct mss_host_ops { + void (*request)(struct mss_host *, struct mss_ll_request *); + void (*set_ios)(struct mss_host *, struct mss_ios *); + /* optioanl operations */ + int (*is_slot_empty)(struct mss_slot *); /* slot empty? */ + int (*is_slot_wp)(struct mss_slot *); /* write-protected ? */ +}; + +struct mss_host { + struct list_head node; /* list all controllers */ + struct mss_card *active_card; /* pointer to active slot */ + unsigned int slot_num; /* slots number of controller */ + unsigned int id; /* controller id */ + wait_queue_head_t wq; /* wait queue for host claim */ + unsigned int max_seg_size; + unsigned int max_hw_segs; + unsigned int max_phys_segs; + unsigned int max_sectors; + spinlock_t lock; + void *private; + struct device *dev; + + u32 f_min; /* min clock supported */ + u32 f_max; /* max clock supported */ + u32 vdd: 24, /* support VDD */ +#define MSS_VDD_170_195 (1 << 7) /* VDD voltage 1.45 - 1.50 */ +#define MSS_VDD_20_21 (1 << 8) /* VDD voltage 2.0 ~ 2.1 */ +#define MSS_VDD_21_22 (1 << 9) /* VDD voltage 2.1 ~ 2.2 */ +#define MSS_VDD_22_23 (1 << 10) /* VDD voltage 2.2 ~ 2.3 */ +#define MSS_VDD_23_24 (1 << 11) /* VDD voltage 2.3 ~ 2.4 */ +#define MSS_VDD_24_25 (1 << 12) /* VDD voltage 2.4 ~ 2.5 */ +#define MSS_VDD_25_26 (1 << 13) /* VDD voltage 2.5 ~ 2.6 */ +#define MSS_VDD_26_27 (1 << 14) /* VDD voltage 2.6 ~ 2.7 */ +#define MSS_VDD_27_28 (1 << 15) /* VDD voltage 2.7 ~ 2.8 */ +#define MSS_VDD_28_29 (1 << 16) /* VDD voltage 2.8 ~ 2.9 */ +#define MSS_VDD_29_30 (1 << 17) /* VDD voltage 2.9 ~ 3.0 */ +#define MSS_VDD_30_31 (1 << 18) /* VDD voltage 3.0 ~ 3.1 */ +#define MSS_VDD_31_32 (1 << 19) /* VDD voltage 3.1 ~ 3.2 */ +#define MSS_VDD_32_33 (1 << 20) /* VDD voltage 3.2 ~ 3.3 */ +#define MSS_VDD_33_34 (1 << 21) /* VDD voltage 3.3 ~ 3.4 */ +#define MSS_VDD_34_35 (1 << 22) /* VDD voltage 3.4 ~ 3.5 */ +#define MSS_VDD_35_36 (1 << 23) /* VDD voltage 3.5 ~ 3.6 */ + +#define MSS_VDD_20_26 (0x3f << 8) /* VDD voltage 2.0 to 2.6 */ +#define MSS_VDD_27_36 (0x1ff << 15) /* VDD voltage 2.7 to 3.6 */ +#define MSS_VDD_MASK (0xffff1 << 7) + + bus_width:4; /* Support max bus width */ + u32 sd_spec:8, + mmc_spec:8, + sdio_spec:8, + high_capacity:1, + high_speed:1; +#define MSS_SD_SPEC_NONE 0 +#define MSS_SD_SPEC_10 1 +#define MSS_SD_SPEC_11 2 +#define MSS_SD_SPEC_20 3 +#define MSS_MMC_SPEC_NONE 0 /* Do not support */ +#define MSS_MMC_SPEC_11_12 1 /* MMC specification 1.1 - 1.2 */ +#define MSS_MMC_SPEC_14 2 /* MMC specification 1.4 */ +#define MSS_MMC_SPEC_20_22 3 /* MMC specification 2.0 - 2.2 */ +#define MSS_MMC_SPEC_31 4 /* MMC specification 3.1 */ +#define MSS_MMC_SPEC_40_42 5 /* MMC specification 4.0 - 4.2 */ +#define MSS_SDIO_SPEC_NONE 0 +#define MSS_SDIO_SPEC_10 1 +#define MSS_SDIO_SPEC_11 2 + + struct mss_ios ios; + struct mss_host_ops *ops; + struct mss_slot slots[0]; +}; + +struct mss_prot_driver { + char *name; /* protocol name */ + struct list_head node; + + int (*prot_entry)(struct mss_card *, unsigned int, void *, void *); + int (*attach_card) (struct mss_card *); + void (*detach_card) (struct mss_card *); + int (*get_errno) (struct mss_card *); +}; + +static inline u32 unstuff_bits(u8 *resp, u32 start, u32 size, u32 bytes) +{ + u32 _end = bytes - (start / 8) - 1; + u32 _start = bytes - ((start + size - 1) / 8) - 1; + u8 shft = start % 8; + u32 mask = (1 << (((start + size) % 8) ? ((start + size) % 8) : 8)) - 1; + u32 res = 0; + + while (1) { + res = res << 8; + res |= resp[_start]; + if (_end != _start) + _start++; + else + break; + mask = mask << 8 | 0xFF; + } + res = (res & mask) >> shft; + + return res; +} + +/* to controller driver */ +void mss_detect_change(struct mss_host *, unsigned long delay, unsigned int); +int mss_scan_slot(struct work_struct *work); +void mss_scan_host(struct mss_host *); +struct mss_host * mss_alloc_host(unsigned int , unsigned int , unsigned int ); +void mss_free_host(struct mss_host *); +struct mss_host *mss_find_host(int ); +void mss_force_card_remove(struct mss_card *); +int register_mss_host(struct mss_host *); +void unregister_mss_host(struct mss_host *); + +/* to card driver */ +int register_mss_driver (struct mss_driver *); +void unregister_mss_driver (struct mss_driver *); +int mss_send_request(struct mss_request *); +unsigned int mss_get_capacity(struct mss_card *); +int mss_card_get(struct mss_card *); +void mss_card_put(struct mss_card *); + +/* to protocol driver */ +int register_mss_prot_driver(struct mss_prot_driver *); +void unregister_mss_prot_driver(struct mss_prot_driver *); +int mss_send_ll_req(struct mss_host *, struct mss_ll_request *); +int mss_send_simple_ll_req(struct mss_host *, struct mss_ll_request *, struct mss_cmd *, u32 , u32 , u32 , u32 ); +void mss_set_sdio_int(struct mss_host *, int ); +void mss_set_buswidth(struct mss_host *, int ); +void mss_set_busmode(struct mss_host *, int ); +void mss_set_clock(struct mss_host *, int ); + +#ifdef CONFIG_MMC_DEBUG +/* debug for mss_core */ +#define dbg(slot, format, arg...) \ + do { \ + printk(KERN_INFO "%s(): host%u slot%u, " \ + format "\n", __func__, \ + (slot)->host->id, (slot)->id, ##arg); \ + } while(0) + +/* +#define dbg(format, arg...) \ + do { \ + printk(KERN_INFO "%s(): " format "\n", \ + __func__, ##arg); \ + } while(0) + +*/ +/* debug for protocol */ +#define dbg2(slot, prot, format, arg...) printk(KERN_INFO "%s(): " \ + "host%u slot%u prot%s, " format "\n", __func__, \ + slot?slot->host->id:-1, slot?slot->id:-1, \ + prot?prot->name:"NULL", ##arg) + +/* debug for hw */ +#define dbg4(slot, format, arg...) do { \ + printk(KERN_INFO "%s(): ", __func__); \ + if (slot) \ + printk(KERN_INFO "host%u slot%u , ", slot->host->id, \ + slot->id); \ + printk(KERN_INFO format "\n", ##arg); \ + } while(0) + +#define dbg5(format, arg...) printk(KERN_INFO "%s(): " format "\n", __func__, ##arg) + +#else +#define dbg(slot, format, arg...) +#define dbg2(slot, prot, format, arg...) +#define dbg4(slot, format, arg...) +#define dbg5(format, arg...) +#endif +#endif --- linux-2.6.24.orig/include/linux/mmc/sd_protocol.h +++ linux-2.6.24/include/linux/mmc/sd_protocol.h @@ -0,0 +1,314 @@ +/* + * sd_protocol.h - SD Protocol driver header file + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from previous mmc code in Linux kernel + * Copyright (c) 2002 Hewlett-Packard Company + * Copyright (c) 2002 Andrew Christian + * Copyright (c) 2006 Bridge Wu + */ + + + +#ifndef __SD_PROTOCOL_H__ +#define __SD_PROTOCOL_H__ + +#include + +#define SD_PROTOCOL "sd" + +#define MSS_SD_QUERY_FUNC 0x100 +#define MSS_SD_SW_FUNC 0x101 + +/* Standard SD clock speeds */ +#define SD_CARD_CLOCK_SLOW 0 +#define SD_CARD_CLOCK_FAST 50000000 + +/* command type: ac(addressed command), bcr(broadcase command with response), + * adtc(addressed data transfer command), bc(broadcase command) + */ + +/* Standard SD commands (1.01) type argument response */ + /* class 0, basic: 0, 2-4, 7, 9, 10, 12, 13, 15 */ +#define SD_GO_IDLE_STATE 0 /* bc */ +#define SD_ALL_SEND_CID 2 /* bcr R2 */ +#define SD_SEND_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ +#define SD_SET_DSR 4 /* bc [31:16] RCA */ +#define SD_SELECT_CARD 7 /* ac [31:16] RCA R1 */ +#define SD_SEND_CSD 9 /* ac [31:16] RCA R2 */ +#define SD_SEND_CID 10 /* ac [31:16] RCA R2 */ +#define SD_STOP_TRANSMISSION 12 /* ac R1b */ +#define SD_SEND_STATUS 13 /* ac [31:16] RCA R1 */ +#define SD_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */ +#define SD_SW_FUNC 6 +#define SD_SEND_IF_COND 8 + + /* class 1: reserved */ + /* class 3: reserved */ + + /* class 2, block read: 16-18 */ +#define SD_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ +#define SD_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ +#define SD_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ + + /* class 4, block write: 16, 24, 25, 27 */ +#define SD_WRITE_BLOCK 24 /* adtc [31:0] data addr R1 */ +#define SD_WRITE_MULTIPLE_BLOCK 25 /* adtc [31:0] data addr R1 */ +#define SD_PROGRAM_CID 26 /* adtc R1 */ +#define SD_PROGRAM_CSD 27 /* adtc R1 */ +/* CMD26 appeared in SDMC state diagram(data transfer mode) */ + + /* class 6, write-protection: 28, 29, 30 */ +#define SD_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */ +#define SD_CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */ +#define SD_SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */ + + /* class 5, erase: 32, 33, 38 */ +#define SD_ERASE_WR_BLOCK_START 32 /* ac [31:0] data addr R1 */ +#define SD_ERASE_WR_BLOCK_END 33 /* ac [31:0] data addr R1 */ +#define SD_ERASE 38 /* ac R1b */ + + /* class 7, lock card: 42 */ +#define SD_LOCK_UNLOCK 42 /* adtc R1b */ + + /* class 8, application specific: 55, 56 */ +#define SD_APP_CMD 55 /* ac [31:16] RCA R1 */ +#define SD_GEN_CMD 56 /* adtc [0] RD/WR R1b */ + + /* class 8, application specific: ACMD6,13,22,23,41,42,51 */ +#define SD_SET_BUS_WIDTH 6 /* ac [1:0] BUS WIDTH R1 */ +#define SD_SD_STATUS 13 /* adtc R1 */ +#define SD_SEND_NUM_WR_BLOCKS 22 /* adtc R1 */ +#define SD_SET_WR_BLK_ERASE_COUNT 23 /* ac [22:0] No.Blocks R1 */ +#define SD_SD_SEND_OP_COND 41 /* bcr [31:0] OCR R3 */ +#define SD_SET_CLR_CARD_DETECT 42 /* ac [0] set_cd R1 */ +#define SD_SEND_SCR 51 /* adtc R1 */ + +/* + SD card status in R1: compatible to the MMC protocol + (SD status: extended status field of 512b, ACMD13 require card to send this) + Type + e : error bit + s : status bit + r : detected and set for the actual command response + x : detected and set during command execution. the host must poll + the card by sending status command in order to read these bits. + Clear condition + a : according to the card state + b : always related to the previous command. Reception of + a valid command will clear it (with a delay of one command) + c : clear by read + */ + +#define R1_OUT_OF_RANGE (1 << 31) /* er, c */ +#define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ +#define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ +#define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ +#define R1_ERASE_PARAM (1 << 27) /* ex, c */ +#define R1_WP_VIOLATION (1 << 26) /* erx, c */ +#define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ +#define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ +#define R1_COM_CRC_ERROR (1 << 23) /* er, b */ +#define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ +#define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ +#define R1_CC_ERROR (1 << 20) /* erx, c */ +#define R1_ERROR (1 << 19) /* erx, c */ +#define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ +#define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ +#define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ +#define R1_ERASE_RESET (1 << 13) /* sr, c */ +#define R1_STATUS(x) ((x) & 0xFFFFE000) + +#define R1_CURRENT_STATE(x) (((x) & 0x00001E00) >> 9) /* sx, b (4 bits) */ +#define R1_READY_FOR_DATA (1 << 8) /* sx, a */ +#define R1_APP_CMD (1 << 5) /* sr, c */ +#define R1_AKE_SEQ_ERROR (1 << 3) /* er, c */ + + +#define R6_COM_CRC_ERROR (1 << 15) /* er, b */ +#define R6_ILLEGAL_COMMAND (1 << 14) /* er, b */ +#define R6_ERROR (1 << 13) /* erx, c */ +#define R6_STATUS(x) ((x) & 0xFFFFE000) +#define R6_CURRENT_STATE(x) (((x) & 0x00001E00) >> 9) /* sx, b (4 bits) */ +#define R6_READY_FOR_DATA (1 << 8) /* sx, a */ +#define R6_APP_CMD (1 << 5) /* sr, c */ + +/** + * SD status: extended status field of 512b, ACMD13 require card to send this. + * [511:510] DAT_BUS_WIDTH SR A + * [509] SECURE_MODE SR A + * [495:480] SD_CARD_TYPE SR A + * [479:448] SIZE_OF_PROTECTED_AREA SR A + */ +enum sd_status_error { + SD_ERROR_NONE = 0, + SD_ERROR_OUT_OF_RANGE, + SD_ERROR_ADDRESS, + SD_ERROR_BLOCK_LEN, + SD_ERROR_ERASE_SEQ, + SD_ERROR_ERASE_PARAM, + SD_ERROR_WP_VIOLATION, + SD_ERROR_CARD_IS_LOCKED, + SD_ERROR_LOCK_UNLOCK_FAILED, + SD_ERROR_COM_CRC, + SD_ERROR_ILLEGAL_COMMAND, /* 10 */ + SD_ERROR_CARD_ECC_FAILED, + SD_ERROR_CC, + SD_ERROR_GENERAL, + SD_ERROR_CID_CSD_OVERWRITE, + SD_ERROR_AKE_SEQ, + SD_ERROR_SWFUNC, + SD_ERROR_STATE_MISMATCH, + SD_ERROR_HEADER_MISMATCH, +}; + + + +enum card_state { + CARD_STATE_EMPTY = -1, + CARD_STATE_IDLE = 0, + CARD_STATE_READY = 1, + CARD_STATE_IDENT = 2, + CARD_STATE_STBY = 3, + CARD_STATE_TRAN = 4, + CARD_STATE_DATA = 5, + CARD_STATE_RCV = 6, + CARD_STATE_PRG = 7, + CARD_STATE_DIS = 8, + CARD_STATE_CMD = 9 +}; + +struct sd_cid { + u8 mid; + u16 oid; + u8 pnm[6]; // Product name (we null-terminate) + u8 prv; + u32 psn; + u16 mdt; +}; + +struct sd_csd { + u8 csd_structure; +#define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */ +#define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */ +#define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 */ + u8 taac; + u8 nsac; + u8 tran_speed; + u16 ccc; + u8 read_bl_len; + u8 read_bl_partial; + u8 write_blk_misalign; + u8 read_blk_misalign; + u8 dsr_imp; + union { + struct { + u16 c_size; + u8 vdd_r_curr_min; + u8 vdd_r_curr_max; + u8 vdd_w_curr_min; + u8 vdd_w_curr_max; + u8 c_size_mult; + } csd1; + struct { + u32 c_size; + } csd2; + }csd; + u8 erase_blk_en; + u8 sector_size; + u8 wp_grp_size; + u8 wp_grp_enable; + u8 r2w_factor; + u8 write_bl_len; + u8 write_bl_partial; + u8 file_format_grp; + u8 copy; + u8 perm_write_protect; + u8 tmp_write_protect; + u8 file_format; +}; + +struct sd_scr { + u8 scr_structure; + u8 sd_spec; + u8 data_stat_after_erase; + u8 sd_security; + u8 sd_bus_width; +#define SCR_BUSWIDTH_1BIT 0 +#define SCR_BUSWIDTH_4BIT (1 << 2) + u8 init; +}; + +/* These are unpacked versions of the actual responses */ + +struct sd_response_r1 { + u8 cmd; + u32 status; +}; + +struct sd_response_r3 { + u8 cmd; + u32 ocr; +#define SD_OCR_CARD_BUSY (1 << 31) /* Card Power up status bit */ +#define SD_OCR_CCS (1 << 30) +}; + +struct sd_response_r6 { + u8 cmd; + u16 rca; + u16 status; +}; + +struct sd_response_r7 { + u8 cmd; + u8 ver; + u8 vca; + u8 pattern; +}; + +struct sw_func_status { + u16 current_consumption; + u16 func_support[6]; + u8 group_status[6]; + u16 func_busy[6]; +}; + +struct sd_card { + struct sd_cid cid; + struct sd_csd csd; + struct sd_scr scr; + u32 ocr; + u32 rca:16, + ver:8, + high_speed:2; + char *buf; + struct mss_ll_request llreq; + struct mss_cmd cmd; + struct mss_data data; + enum sd_status_error errno; + enum card_state state; + u32 block_len; +}; + +struct io_swfunc_request { + u16 current_acceptable; + u8 args[6]; +}; + +#endif --- linux-2.6.24.orig/include/linux/sunrpc/sched.h +++ linux-2.6.24/include/linux/sunrpc/sched.h @@ -55,6 +55,7 @@ struct rpc_message tk_msg; /* RPC call info */ __u8 tk_garb_retry; __u8 tk_cred_retry; + __u8 tk_rebind_retry; unsigned long tk_cookie; /* Cookie for batching tasks */ --- linux-2.6.24.orig/include/linux/netfilter_ipv6/Kbuild +++ linux-2.6.24/include/linux/netfilter_ipv6/Kbuild @@ -11,6 +11,7 @@ header-y += ip6t_limit.h header-y += ip6t_mac.h header-y += ip6t_mark.h +header-y += ip6t_mh.h header-y += ip6t_multiport.h header-y += ip6t_opts.h header-y += ip6t_owner.h --- linux-2.6.24.orig/include/linux/usb/serial.h +++ linux-2.6.24/include/linux/usb/serial.h @@ -243,6 +243,8 @@ void (*unthrottle) (struct usb_serial_port *port); int (*tiocmget) (struct usb_serial_port *port, struct file *file); int (*tiocmset) (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); + int (*get_icount)(struct tty_struct *tty, + struct serial_icounter_struct *icount); void (*read_int_callback)(struct urb *urb); void (*write_int_callback)(struct urb *urb); --- linux-2.6.24.orig/include/linux/usb/quirks.h +++ linux-2.6.24/include/linux/usb/quirks.h @@ -9,3 +9,6 @@ /* device can't resume correctly so reset it instead */ #define USB_QUIRK_RESET_RESUME 0x00000002 + +/* device can't handle Set-Interface requests */ +#define USB_QUIRK_NO_SET_INTF 0x00000004 --- linux-2.6.24.orig/include/net/scm.h +++ linux-2.6.24/include/net/scm.h @@ -14,8 +14,9 @@ struct scm_fp_list { - int count; - struct file *fp[SCM_MAX_FD]; + struct list_head list; + int count; + struct file *fp[SCM_MAX_FD]; }; struct scm_cookie --- linux-2.6.24.orig/include/net/rose.h +++ linux-2.6.24/include/net/rose.h @@ -14,6 +14,12 @@ #define ROSE_MIN_LEN 3 +#define ROSE_CALL_REQ_ADDR_LEN_OFF 3 +#define ROSE_CALL_REQ_ADDR_LEN_VAL 0xAA /* each address is 10 digits */ +#define ROSE_CALL_REQ_DEST_ADDR_OFF 4 +#define ROSE_CALL_REQ_SRC_ADDR_OFF 9 +#define ROSE_CALL_REQ_FACILITIES_OFF 14 + #define ROSE_GFI 0x10 #define ROSE_Q_BIT 0x80 #define ROSE_D_BIT 0x40 @@ -214,7 +220,7 @@ extern int rose_validate_nr(struct sock *, unsigned short); extern void rose_write_internal(struct sock *, int); extern int rose_decode(struct sk_buff *, int *, int *, int *, int *, int *); -extern int rose_parse_facilities(unsigned char *, struct rose_facilities_struct *); +extern int rose_parse_facilities(unsigned char *, unsigned int, struct rose_facilities_struct *); extern void rose_disconnect(struct sock *, int, int, int); /* rose_timer.c */ --- linux-2.6.24.orig/include/net/netlink.h +++ linux-2.6.24/include/net/netlink.h @@ -383,7 +383,7 @@ * * Returns the first attribute which matches the specified type. */ -static inline struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh, +static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh, int hdrlen, int attrtype) { return nla_find(nlmsg_attrdata(nlh, hdrlen), --- linux-2.6.24.orig/include/net/inet_sock.h +++ linux-2.6.24/include/net/inet_sock.h @@ -175,7 +175,8 @@ static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport, const __be32 faddr, const __be16 fport) { - return jhash_2words((__force __u32) laddr ^ (__force __u32) faddr, + return jhash_3words((__force __u32) laddr, + (__force __u32) faddr, ((__u32) lport) << 16 | (__force __u32)fport, inet_ehash_secret); } --- linux-2.6.24.orig/include/net/secure_seq.h +++ linux-2.6.24/include/net/secure_seq.h @@ -0,0 +1,20 @@ +#ifndef _NET_SECURE_SEQ +#define _NET_SECURE_SEQ + +#include + +extern __u32 secure_ip_id(__be32 daddr); +extern __u32 secure_ipv6_id(const __be32 daddr[4]); +extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); +extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, + __be16 dport); +extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, + __be16 sport, __be16 dport); +extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, + __be16 sport, __be16 dport); +extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, + __be16 sport, __be16 dport); +extern u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, + __be16 sport, __be16 dport); + +#endif /* _NET_SECURE_SEQ */ --- linux-2.6.24.orig/include/net/ipv6.h +++ linux-2.6.24/include/net/ipv6.h @@ -441,6 +441,8 @@ return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); } +extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); + /* * Prototypes exported by ipv6 */ --- linux-2.6.24.orig/include/net/transp_v6.h +++ linux-2.6.24/include/net/transp_v6.h @@ -16,6 +16,8 @@ struct flowi; +extern void initialize_hashidentrnd(void); + /* extention headers */ extern void ipv6_rthdr_init(void); extern void ipv6_frag_init(void); --- linux-2.6.24.orig/include/net/tcp.h +++ linux-2.6.24/include/net/tcp.h @@ -775,11 +775,14 @@ extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); /* Slow start with delack produces 3 packets of burst, so that - * it is safe "de facto". + * it is safe "de facto". This will be the default - same as + * the default reordering threshold - but if reordering increases, + * we must be able to allow cwnd to burst at least this much in order + * to not pull it back when holes are filled. */ static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp) { - return 3; + return tp->reordering; } /* RFC2861 Check whether we are limited by application or congestion window --- linux-2.6.24.orig/include/net/af_unix.h +++ linux-2.6.24/include/net/af_unix.h @@ -9,6 +9,7 @@ extern void unix_inflight(struct file *fp); extern void unix_notinflight(struct file *fp); extern void unix_gc(void); +extern void wait_for_unix_gc(void); #define UNIX_HASH_SIZE 256 @@ -54,6 +55,7 @@ atomic_t inflight; spinlock_t lock; unsigned int gc_candidate : 1; + unsigned int gc_maybe_cycle : 1; wait_queue_head_t peer_wait; }; #define unix_sk(__sk) ((struct unix_sock *)__sk) --- linux-2.6.24.orig/include/net/sctp/sm.h +++ linux-2.6.24/include/net/sctp/sm.h @@ -227,6 +227,9 @@ const struct sctp_chunk *, const __u8 *, const size_t ); +struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, + const struct sctp_chunk *, + struct sctp_paramhdr *); struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, const struct sctp_transport *, const void *payload, @@ -274,6 +277,7 @@ /* 2nd level prototypes */ void sctp_generate_t3_rtx_event(unsigned long peer); void sctp_generate_heartbeat_event(unsigned long peer); +void sctp_generate_proto_unreach_event(unsigned long peer); void sctp_ootb_pkt_free(struct sctp_packet *); --- linux-2.6.24.orig/include/net/sctp/structs.h +++ linux-2.6.24/include/net/sctp/structs.h @@ -751,6 +751,7 @@ struct iovec *data); void sctp_chunk_free(struct sctp_chunk *); void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); +void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data); struct sctp_chunk *sctp_chunkify(struct sk_buff *, const struct sctp_association *, struct sock *); @@ -982,6 +983,9 @@ /* Heartbeat timer is per destination. */ struct timer_list hb_timer; + /* Timer to handle ICMP proto unreachable envets */ + struct timer_list proto_unreach_timer; + /* Since we're using per-destination retransmission timers * (see above), we're also using per-destination "transmitted" * queues. This probably ought to be a private struct --- linux-2.6.24.orig/include/net/bluetooth/hci_core.h +++ linux-2.6.24/include/net/bluetooth/hci_core.h @@ -25,6 +25,8 @@ #ifndef __HCI_CORE_H #define __HCI_CORE_H +#include + #include /* HCI upper protocols */ @@ -93,7 +95,7 @@ atomic_t cmd_cnt; unsigned int acl_cnt; - unsigned int sco_cnt; + atomic_t sco_cnt; unsigned int acl_mtu; unsigned int sco_mtu; @@ -150,7 +152,6 @@ struct list_head list; atomic_t refcnt; - spinlock_t lock; bdaddr_t dst; __u16 handle; @@ -167,10 +168,11 @@ __u8 power_save; unsigned long pend; - unsigned int sent; + atomic_t sent; struct sk_buff_head data_q; + struct hrtimer tx_timer; struct timer_list disc_timer; struct timer_list idle_timer; --- linux-2.6.24.orig/include/net/bluetooth/sco.h +++ linux-2.6.24/include/net/bluetooth/sco.h @@ -26,12 +26,7 @@ #define __SCO_H /* SCO defaults */ -#define SCO_DEFAULT_MTU 500 -#define SCO_DEFAULT_FLUSH_TO 0xFFFF - #define SCO_CONN_TIMEOUT (HZ * 40) -#define SCO_DISCONN_TIMEOUT (HZ * 2) -#define SCO_CONN_IDLE_TIMEOUT (HZ * 60) /* SCO socket address */ struct sockaddr_sco { --- linux-2.6.24.orig/include/asm-arm/arch-pxa/pxa-regs.h +++ linux-2.6.24/include/asm-arm/arch-pxa/pxa-regs.h @@ -1669,6 +1669,7 @@ #define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */ #define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */ #define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */ +#define SSCR1_IFS (1 << 16) /* Invert Frame Signal */ #define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */ #define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */ --- linux-2.6.24.orig/include/asm-parisc/futex.h +++ linux-2.6.24/include/asm-parisc/futex.h @@ -56,6 +56,12 @@ int err = 0; int uval; + /* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is + * our gateway page, and causes no end of trouble... + */ + if (segment_eq(KERNEL_DS, get_fs()) && !uaddr) + return -EFAULT; + if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) return -EFAULT; @@ -67,5 +73,5 @@ return uval; } -#endif -#endif +#endif /*__KERNEL__*/ +#endif /*_ASM_PARISC_FUTEX_H*/ --- linux-2.6.24.orig/include/asm-parisc/compat.h +++ linux-2.6.24/include/asm-parisc/compat.h @@ -146,7 +146,7 @@ return (u32)(unsigned long)uptr; } -static __inline__ void __user *compat_alloc_user_space(long len) +static __inline__ void __user *arch_compat_alloc_user_space(long len) { struct pt_regs *regs = ¤t->thread.regs; return (void __user *)regs->gr[30]; --- linux-2.6.24.orig/include/asm-parisc/pdc.h +++ linux-2.6.24/include/asm-parisc/pdc.h @@ -645,8 +645,7 @@ void pdc_io_reset(void); void pdc_io_reset_devices(void); int pdc_iodc_getc(void); -int pdc_iodc_print(unsigned char *str, unsigned count); -void pdc_printf(const char *fmt, ...); +int pdc_iodc_print(const unsigned char *str, unsigned count); void pdc_emergency_unlock(void); int pdc_sti_call(unsigned long func, unsigned long flags, --- linux-2.6.24.orig/crypto/xcbc.c +++ linux-2.6.24/crypto/xcbc.c @@ -116,13 +116,16 @@ struct crypto_xcbc_ctx *ctx = crypto_hash_ctx_aligned(parent); struct crypto_cipher *tfm = ctx->child; int bs = crypto_hash_blocksize(parent); - unsigned int i = 0; - do { + for (;;) { + struct page *pg = sg_page(sg); + unsigned int offset = sg->offset; + unsigned int slen = sg->length; - struct page *pg = sg_page(&sg[i]); - unsigned int offset = sg[i].offset; - unsigned int slen = sg[i].length; + if (unlikely(slen > nbytes)) + slen = nbytes; + + nbytes -= slen; while (slen > 0) { unsigned int len = min(slen, ((unsigned int)(PAGE_SIZE)) - offset); @@ -177,9 +180,11 @@ offset = 0; pg++; } - nbytes-=sg[i].length; - i++; - } while (nbytes>0); + + if (!nbytes) + break; + sg = sg_next(sg); + } return 0; } --- linux-2.6.24.orig/crypto/md5.c +++ linux-2.6.24/crypto/md5.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #define MD5_DIGEST_SIZE 16 @@ -27,103 +28,12 @@ #define MD5_BLOCK_WORDS 16 #define MD5_HASH_WORDS 4 -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -#define MD5STEP(f, w, x, y, z, in, s) \ - (w += f(x, y, z) + in, w = (w<>(32-s)) + x) - struct md5_ctx { u32 hash[MD5_HASH_WORDS]; u32 block[MD5_BLOCK_WORDS]; u64 byte_count; }; -static void md5_transform(u32 *hash, u32 const *in) -{ - u32 a, b, c, d; - - a = hash[0]; - b = hash[1]; - c = hash[2]; - d = hash[3]; - - MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); - MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); - MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); - MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); - MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); - MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); - MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); - MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); - MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); - MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); - MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); - MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); - MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); - MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); - MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); - MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); - - MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); - MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); - MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); - MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); - MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); - MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); - MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); - MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); - MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); - MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); - MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); - MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); - MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); - MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); - MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); - MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); - - MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); - MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); - MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); - MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); - MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); - MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); - MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); - MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); - MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); - MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); - MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); - MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); - MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); - MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); - MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); - MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); - - MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); - MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); - MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); - MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); - MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); - MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); - MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); - MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); - MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); - MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); - MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); - MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); - MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); - MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); - MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); - MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); - - hash[0] += a; - hash[1] += b; - hash[2] += c; - hash[3] += d; -} - /* XXX: this stuff can be optimized */ static inline void le32_to_cpu_array(u32 *buf, unsigned int words) { --- linux-2.6.24.orig/crypto/xts.c +++ linux-2.6.24/crypto/xts.c @@ -77,16 +77,16 @@ } struct sinfo { - be128 t; + be128 *t; struct crypto_tfm *tfm; void (*fn)(struct crypto_tfm *, u8 *, const u8 *); }; static inline void xts_round(struct sinfo *s, void *dst, const void *src) { - be128_xor(dst, &s->t, src); /* PP <- T xor P */ + be128_xor(dst, s->t, src); /* PP <- T xor P */ s->fn(s->tfm, dst, dst); /* CC <- E(Key1,PP) */ - be128_xor(dst, dst, &s->t); /* C <- T xor CC */ + be128_xor(dst, dst, s->t); /* C <- T xor CC */ } static int crypt(struct blkcipher_desc *d, @@ -101,7 +101,6 @@ .tfm = crypto_cipher_tfm(ctx->child), .fn = fn }; - be128 *iv; u8 *wsrc; u8 *wdst; @@ -109,20 +108,20 @@ if (!w->nbytes) return err; + s.t = (be128 *)w->iv; avail = w->nbytes; wsrc = w->src.virt.addr; wdst = w->dst.virt.addr; /* calculate first value of T */ - iv = (be128 *)w->iv; - tw(crypto_cipher_tfm(ctx->tweak), (void *)&s.t, w->iv); + tw(crypto_cipher_tfm(ctx->tweak), w->iv, w->iv); goto first; for (;;) { do { - gf128mul_x_ble(&s.t, &s.t); + gf128mul_x_ble(s.t, s.t); first: xts_round(&s, wdst, wsrc); --- linux-2.6.24.orig/crypto/async_tx/async_xor.c +++ linux-2.6.24/crypto/async_tx/async_xor.c @@ -264,7 +264,7 @@ BUG_ON(src_cnt <= 1); - if (tx) { + if (tx && src_cnt <= device->max_xor) { dma_addr_t dma_addr; enum dma_data_direction dir; --- linux-2.6.24.orig/drivers/Kconfig +++ linux-2.6.24/drivers/Kconfig @@ -90,9 +90,5 @@ source "drivers/auxdisplay/Kconfig" -source "drivers/kvm/Kconfig" - source "drivers/uio/Kconfig" - -source "drivers/virtio/Kconfig" endmenu --- linux-2.6.24.orig/drivers/Makefile +++ linux-2.6.24/drivers/Makefile @@ -47,7 +47,6 @@ obj-$(CONFIG_PCCARD) += pcmcia/ obj-$(CONFIG_DIO) += dio/ obj-$(CONFIG_SBUS) += sbus/ -obj-$(CONFIG_KVM) += kvm/ obj-$(CONFIG_ZORRO) += zorro/ obj-$(CONFIG_MAC) += macintosh/ obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/ @@ -77,6 +76,7 @@ obj-$(CONFIG_CPU_FREQ) += cpufreq/ obj-$(CONFIG_CPU_IDLE) += cpuidle/ obj-$(CONFIG_MMC) += mmc/ +obj-$(CONFIG_MSS) += mmc/ obj-$(CONFIG_NEW_LEDS) += leds/ obj-$(CONFIG_INFINIBAND) += infiniband/ obj-$(CONFIG_SGI_SN) += sn/ --- linux-2.6.24.orig/drivers/pnp/pnpacpi/rsparser.c +++ linux-2.6.24/drivers/pnp/pnpacpi/rsparser.c @@ -85,7 +85,7 @@ i < PNP_MAX_IRQ) i++; if (i >= PNP_MAX_IRQ && !warned) { - printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ " + printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ " "resources: %d \n", PNP_MAX_IRQ); warned = 1; return; @@ -187,7 +187,7 @@ res->dma_resource[i].start = dma; res->dma_resource[i].end = dma; } else if (!warned) { - printk(KERN_ERR "pnpacpi: exceeded the max number of DMA " + printk(KERN_WARNING "pnpacpi: exceeded the max number of DMA " "resources: %d \n", PNP_MAX_DMA); warned = 1; } @@ -213,7 +213,7 @@ res->port_resource[i].start = io; res->port_resource[i].end = io + len - 1; } else if (!warned) { - printk(KERN_ERR "pnpacpi: exceeded the max number of IO " + printk(KERN_WARNING "pnpacpi: exceeded the max number of IO " "resources: %d \n", PNP_MAX_PORT); warned = 1; } @@ -241,7 +241,7 @@ res->mem_resource[i].start = mem; res->mem_resource[i].end = mem + len - 1; } else if (!warned) { - printk(KERN_ERR "pnpacpi: exceeded the max number of mem " + printk(KERN_WARNING "pnpacpi: exceeded the max number of mem " "resources: %d\n", PNP_MAX_MEM); warned = 1; } @@ -752,6 +752,12 @@ if (pnpacpi_supported_resource(res)) { (*resource)->type = res->type; (*resource)->length = sizeof(struct acpi_resource); + if (res->type == ACPI_RESOURCE_TYPE_IRQ) + (*resource)->data.irq.descriptor_length = + res->data.irq.descriptor_length; + if (res->type == ACPI_RESOURCE_TYPE_START_DEPENDENT) + (*resource)->data.start_dpf.descriptor_length = + res->data.start_dpf.descriptor_length; (*resource)++; } --- linux-2.6.24.orig/drivers/misc/thinkpad_acpi.c +++ linux-2.6.24/drivers/misc/thinkpad_acpi.c @@ -1986,6 +1986,10 @@ return len; } + /* Even reads can crash X.org, so... */ + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + status = video_outputsw_get(); if (status < 0) return status; @@ -2019,6 +2023,10 @@ if (video_supported == TPACPI_VIDEO_NONE) return -ENODEV; + /* Even reads can crash X.org, so... */ + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + enable = 0; disable = 0; @@ -4574,9 +4582,12 @@ "%s installed\n", ibm->name); if (ibm->read) { - entry = create_proc_entry(ibm->name, - S_IFREG | S_IRUGO | S_IWUSR, - proc_dir); + mode_t mode = iibm->base_procfs_mode; + + if (!mode) + mode = S_IRUGO; + + entry = create_proc_entry(ibm->name, mode, proc_dir); if (!entry) { printk(IBM_ERR "unable to create proc entry %s\n", ibm->name); @@ -4758,6 +4769,7 @@ }, { .init = video_init, + .base_procfs_mode = S_IRUSR, .data = &video_driver_data, }, { --- linux-2.6.24.orig/drivers/misc/thinkpad_acpi.h +++ linux-2.6.24/drivers/misc/thinkpad_acpi.h @@ -230,6 +230,7 @@ char param[32]; int (*init) (struct ibm_init_struct *); + mode_t base_procfs_mode; struct ibm_struct *data; }; --- linux-2.6.24.orig/drivers/mtd/chips/cfi_cmdset_0001.c +++ linux-2.6.24/drivers/mtd/chips/cfi_cmdset_0001.c @@ -669,7 +669,7 @@ /* Someone else might have been playing with it. */ return -EAGAIN; } - + /* Fall through */ case FL_READY: case FL_CFI_QUERY: case FL_JEDEC_QUERY: @@ -729,14 +729,14 @@ chip->state = FL_READY; return 0; + case FL_SHUTDOWN: + /* The machine is rebooting now,so no one can get chip anymore */ + return -EIO; case FL_POINT: /* Only if there's no operation suspended... */ if (mode == FL_READY && chip->oldstate == FL_READY) return 0; - - case FL_SHUTDOWN: - /* The machine is rebooting now,so no one can get chip anymore */ - return -EIO; + /* Fall through */ default: sleep: set_current_state(TASK_UNINTERRUPTIBLE); --- linux-2.6.24.orig/drivers/mtd/devices/block2mtd.c +++ linux-2.6.24/drivers/mtd/devices/block2mtd.c @@ -408,7 +408,6 @@ if (token[1]) { ret = parse_num(&erase_size, token[1]); if (ret) { - kfree(name); parse_err("illegal erase size"); } } --- linux-2.6.24.orig/drivers/ide/ide-cd.c +++ linux-2.6.24/drivers/ide/ide-cd.c @@ -2988,7 +2988,8 @@ if (strcmp(drive->id->model, "MATSHITADVD-ROM SR-8187") == 0 || strcmp(drive->id->model, "MATSHITADVD-ROM SR-8186") == 0 || strcmp(drive->id->model, "MATSHITADVD-ROM SR-8176") == 0 || - strcmp(drive->id->model, "MATSHITADVD-ROM SR-8174") == 0) + strcmp(drive->id->model, "MATSHITADVD-ROM SR-8174") == 0 || + strcmp(drive->id->model, "Optiarc DVD RW AD-5200A") == 0) CDROM_CONFIG_FLAGS(drive)->audio_play = 1; #if ! STANDARD_ATAPI --- linux-2.6.24.orig/drivers/ide/ide-cd.h +++ linux-2.6.24/drivers/ide/ide-cd.h @@ -15,7 +15,7 @@ memory, though. */ #ifndef VERBOSE_IDE_CD_ERRORS -#define VERBOSE_IDE_CD_ERRORS 1 +#define VERBOSE_IDE_CD_ERRORS 0 #endif --- linux-2.6.24.orig/drivers/ide/ppc/pmac.c +++ linux-2.6.24/drivers/ide/ppc/pmac.c @@ -1269,7 +1269,7 @@ int rc = 0; if (mesg.event != mdev->ofdev.dev.power.power_state.event - && mesg.event == PM_EVENT_SUSPEND) { + && (mesg.event & PM_EVENT_SLEEP)) { rc = pmac_ide_do_suspend(hwif); if (rc == 0) mdev->ofdev.dev.power.power_state = mesg; @@ -1374,7 +1374,7 @@ int rc = 0; if (mesg.event != pdev->dev.power.power_state.event - && mesg.event == PM_EVENT_SUSPEND) { + && (mesg.event & PM_EVENT_SLEEP)) { rc = pmac_ide_do_suspend(hwif); if (rc == 0) pdev->dev.power.power_state = mesg; --- linux-2.6.24.orig/drivers/virtio/virtio_ring.c +++ linux-2.6.24/drivers/virtio/virtio_ring.c @@ -87,6 +87,8 @@ if (vq->num_free < out + in) { pr_debug("Can't add buf len %i - avail = %i\n", out + in, vq->num_free); + /* We notify *even if* VRING_USED_F_NO_NOTIFY is set here. */ + vq->notify(&vq->vq); END_USE(vq); return -ENOSPC; } @@ -97,16 +99,14 @@ head = vq->free_head; for (i = vq->free_head; out; i = vq->vring.desc[i].next, out--) { vq->vring.desc[i].flags = VRING_DESC_F_NEXT; - vq->vring.desc[i].addr = (page_to_pfn(sg_page(sg))<offset; + vq->vring.desc[i].addr = sg_phys(sg); vq->vring.desc[i].len = sg->length; prev = i; sg++; } for (; in; i = vq->vring.desc[i].next, in--) { vq->vring.desc[i].flags = VRING_DESC_F_NEXT|VRING_DESC_F_WRITE; - vq->vring.desc[i].addr = (page_to_pfn(sg_page(sg))<offset; + vq->vring.desc[i].addr = sg_phys(sg); vq->vring.desc[i].len = sg->length; prev = i; sg++; @@ -171,16 +171,6 @@ vq->num_free++; } -/* FIXME: We need to tell other side about removal, to synchronize. */ -static void vring_shutdown(struct virtqueue *_vq) -{ - struct vring_virtqueue *vq = to_vvq(_vq); - unsigned int i; - - for (i = 0; i < vq->vring.num; i++) - detach_buf(vq, i); -} - static inline bool more_used(const struct vring_virtqueue *vq) { return vq->last_used_idx != vq->vring.used->idx; @@ -220,7 +210,14 @@ return ret; } -static bool vring_restart(struct virtqueue *_vq) +static void vring_disable_cb(struct virtqueue *_vq) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + + vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; +} + +static bool vring_enable_cb(struct virtqueue *_vq) { struct vring_virtqueue *vq = to_vvq(_vq); @@ -232,7 +229,6 @@ vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; mb(); if (unlikely(more_used(vq))) { - vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; END_USE(vq); return false; } @@ -253,26 +249,34 @@ if (unlikely(vq->broken)) return IRQ_HANDLED; + /* Other side may have missed us turning off the interrupt, + * but we should preserve disable semantic for virtio users. */ + if (unlikely(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) { + pr_debug("virtqueue interrupt after disable for %p\n", vq); + return IRQ_HANDLED; + } + pr_debug("virtqueue callback for %p (%p)\n", vq, vq->vq.callback); - if (vq->vq.callback && !vq->vq.callback(&vq->vq)) - vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; + if (vq->vq.callback) + vq->vq.callback(&vq->vq); return IRQ_HANDLED; } +EXPORT_SYMBOL_GPL(vring_interrupt); static struct virtqueue_ops vring_vq_ops = { .add_buf = vring_add_buf, .get_buf = vring_get_buf, .kick = vring_kick, - .restart = vring_restart, - .shutdown = vring_shutdown, + .disable_cb = vring_disable_cb, + .enable_cb = vring_enable_cb, }; struct virtqueue *vring_new_virtqueue(unsigned int num, struct virtio_device *vdev, void *pages, void (*notify)(struct virtqueue *), - bool (*callback)(struct virtqueue *)) + void (*callback)(struct virtqueue *)) { struct vring_virtqueue *vq; unsigned int i; @@ -311,9 +315,12 @@ return &vq->vq; } +EXPORT_SYMBOL_GPL(vring_new_virtqueue); void vring_del_virtqueue(struct virtqueue *vq) { kfree(to_vvq(vq)); } +EXPORT_SYMBOL_GPL(vring_del_virtqueue); +MODULE_LICENSE("GPL"); --- linux-2.6.24.orig/drivers/virtio/Kconfig +++ linux-2.6.24/drivers/virtio/Kconfig @@ -1,8 +1,35 @@ # Virtio always gets selected by whoever wants it. config VIRTIO - bool + tristate # Similarly the virtio ring implementation. config VIRTIO_RING - bool + tristate depends on VIRTIO + +config VIRTIO_PCI + tristate "PCI driver for virtio devices (EXPERIMENTAL)" + depends on PCI && EXPERIMENTAL + select VIRTIO + select VIRTIO_RING + ---help--- + This drivers provides support for virtio based paravirtual device + drivers over PCI. This requires that your VMM has appropriate PCI + virtio backends. Most QEMU based VMMs should support these devices + (like KVM or Xen). + + Currently, the ABI is not considered stable so there is no guarantee + that this version of the driver will work with your VMM. + + If unsure, say M. + +config VIRTIO_BALLOON + tristate "Virtio balloon driver (EXPERIMENTAL)" + select VIRTIO + select VIRTIO_RING + ---help--- + This driver supports increasing and decreasing the amount + of memory within a KVM guest. + + If unsure, say M. + --- linux-2.6.24.orig/drivers/virtio/Makefile +++ linux-2.6.24/drivers/virtio/Makefile @@ -1,2 +1,4 @@ obj-$(CONFIG_VIRTIO) += virtio.o obj-$(CONFIG_VIRTIO_RING) += virtio_ring.o +obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o +obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o --- linux-2.6.24.orig/drivers/virtio/virtio.c +++ linux-2.6.24/drivers/virtio/virtio.c @@ -80,19 +80,51 @@ dev->config->set_status(dev, dev->config->get_status(dev) | status); } +void virtio_check_driver_offered_feature(const struct virtio_device *vdev, + unsigned int fbit) +{ + unsigned int i; + struct virtio_driver *drv = container_of(vdev->dev.driver, + struct virtio_driver, driver); + + for (i = 0; i < drv->feature_table_size; i++) + if (drv->feature_table[i] == fbit) + return; + BUG(); +} +EXPORT_SYMBOL_GPL(virtio_check_driver_offered_feature); + static int virtio_dev_probe(struct device *_d) { - int err; + int err, i; struct virtio_device *dev = container_of(_d,struct virtio_device,dev); struct virtio_driver *drv = container_of(dev->dev.driver, struct virtio_driver, driver); + u32 device_features; + /* We have a driver! */ add_status(dev, VIRTIO_CONFIG_S_DRIVER); + + /* Figure out what features the device supports. */ + device_features = dev->config->get_features(dev); + + /* Features supported by both device and driver into dev->features. */ + memset(dev->features, 0, sizeof(dev->features)); + for (i = 0; i < drv->feature_table_size; i++) { + unsigned int f = drv->feature_table[i]; + BUG_ON(f >= 32); + if (device_features & (1 << f)) + set_bit(f, dev->features); + } + err = drv->probe(dev); if (err) add_status(dev, VIRTIO_CONFIG_S_FAILED); - else + else { add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK); + /* They should never have set feature bits beyond 32 */ + dev->config->set_features(dev, dev->features[0]); + } return err; } @@ -102,14 +134,20 @@ struct virtio_driver *drv = container_of(dev->dev.driver, struct virtio_driver, driver); - dev->config->set_status(dev, dev->config->get_status(dev) - & ~VIRTIO_CONFIG_S_DRIVER); drv->remove(dev); + + /* Driver should have reset device. */ + BUG_ON(dev->config->get_status(dev)); + + /* Acknowledge the device's existence again. */ + add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE); return 0; } int register_virtio_driver(struct virtio_driver *driver) { + /* Catch this early. */ + BUG_ON(driver->feature_table_size && !driver->feature_table); driver->driver.bus = &virtio_bus; driver->driver.probe = virtio_dev_probe; driver->driver.remove = virtio_dev_remove; @@ -130,6 +168,10 @@ dev->dev.bus = &virtio_bus; sprintf(dev->dev.bus_id, "%u", dev->index); + /* We always start by resetting the device, in case a previous + * driver messed it up. This also tests that code path a little. */ + dev->config->reset(dev); + /* Acknowledge that we've seen the device. */ add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE); @@ -148,55 +190,18 @@ } EXPORT_SYMBOL_GPL(unregister_virtio_device); -int __virtio_config_val(struct virtio_device *vdev, - u8 type, void *val, size_t size) -{ - void *token; - unsigned int len; - - token = vdev->config->find(vdev, type, &len); - if (!token) - return -ENOENT; - - if (len != size) - return -EIO; - - vdev->config->get(vdev, token, val, size); - return 0; -} -EXPORT_SYMBOL_GPL(__virtio_config_val); - -int virtio_use_bit(struct virtio_device *vdev, - void *token, unsigned int len, unsigned int bitnum) -{ - unsigned long bits[16]; - - /* This makes it convenient to pass-through find() results. */ - if (!token) - return 0; - - /* bit not in range of this bitfield? */ - if (bitnum * 8 >= len / 2) - return 0; - - /* Giant feature bitfields are silly. */ - BUG_ON(len > sizeof(bits)); - vdev->config->get(vdev, token, bits, len); - - if (!test_bit(bitnum, bits)) - return 0; - - /* Set acknowledge bit, and write it back. */ - set_bit(bitnum + len * 8 / 2, bits); - vdev->config->set(vdev, token, bits, len); - return 1; -} -EXPORT_SYMBOL_GPL(virtio_use_bit); - static int virtio_init(void) { if (bus_register(&virtio_bus) != 0) panic("virtio bus registration failed"); return 0; } + +static void __exit virtio_exit(void) +{ + bus_unregister(&virtio_bus); +} core_initcall(virtio_init); +module_exit(virtio_exit); + +MODULE_LICENSE("GPL"); --- linux-2.6.24.orig/drivers/virtio/virtio_balloon.c +++ linux-2.6.24/drivers/virtio/virtio_balloon.c @@ -0,0 +1,289 @@ +/* Virtio balloon implementation, inspired by Dor Loar and Marcelo + * Tosatti's implementations. + * + * Copyright 2008 Rusty Russell IBM Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +//#define DEBUG +#include +#include +#include +#include +#include +#include + +struct virtio_balloon +{ + struct virtio_device *vdev; + struct virtqueue *inflate_vq, *deflate_vq; + + /* Where the ballooning thread waits for config to change. */ + wait_queue_head_t config_change; + + /* The thread servicing the balloon. */ + struct task_struct *thread; + + /* Waiting for host to ack the pages we released. */ + struct completion acked; + + /* Do we have to tell Host *before* we reuse pages? */ + bool tell_host_first; + + /* The pages we've told the Host we're not using. */ + unsigned int num_pages; + struct list_head pages; + + /* The array of pfns we tell the Host about. */ + unsigned int num_pfns; + u32 pfns[256]; +}; + +static struct virtio_device_id id_table[] = { + { VIRTIO_ID_BALLOON, VIRTIO_DEV_ANY_ID }, + { 0 }, +}; + +static void balloon_ack(struct virtqueue *vq) +{ + struct virtio_balloon *vb; + unsigned int len; + + vb = vq->vq_ops->get_buf(vq, &len); + if (vb) + complete(&vb->acked); +} + +static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) +{ + struct scatterlist sg; + + sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns); + + init_completion(&vb->acked); + + /* We should always be able to add one buffer to an empty queue. */ + if (vq->vq_ops->add_buf(vq, &sg, 1, 0, vb) != 0) + BUG(); + vq->vq_ops->kick(vq); + + /* When host has read buffer, this completes via balloon_ack */ + wait_for_completion(&vb->acked); +} + +static void fill_balloon(struct virtio_balloon *vb, size_t num) +{ + /* We can only do one array worth at a time. */ + num = min(num, ARRAY_SIZE(vb->pfns)); + + for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) { + struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY); + if (!page) { + if (printk_ratelimit()) + dev_printk(KERN_INFO, &vb->vdev->dev, + "Out of puff! Can't get %zu pages\n", + num); + /* Sleep for at least 1/5 of a second before retry. */ + msleep(200); + break; + } + vb->pfns[vb->num_pfns] = page_to_pfn(page); + totalram_pages--; + vb->num_pages++; + list_add(&page->lru, &vb->pages); + } + + /* Didn't get any? Oh well. */ + if (vb->num_pfns == 0) + return; + + tell_host(vb, vb->inflate_vq); +} + +static void release_pages_by_pfn(const u32 pfns[], unsigned int num) +{ + unsigned int i; + + for (i = 0; i < num; i++) { + __free_page(pfn_to_page(pfns[i])); + totalram_pages++; + } +} + +static void leak_balloon(struct virtio_balloon *vb, size_t num) +{ + struct page *page; + + /* We can only do one array worth at a time. */ + num = min(num, ARRAY_SIZE(vb->pfns)); + + for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) { + page = list_first_entry(&vb->pages, struct page, lru); + list_del(&page->lru); + vb->pfns[vb->num_pfns] = page_to_pfn(page); + vb->num_pages--; + } + + if (vb->tell_host_first) { + tell_host(vb, vb->deflate_vq); + release_pages_by_pfn(vb->pfns, vb->num_pfns); + } else { + release_pages_by_pfn(vb->pfns, vb->num_pfns); + tell_host(vb, vb->deflate_vq); + } +} + +static void virtballoon_changed(struct virtio_device *vdev) +{ + struct virtio_balloon *vb = vdev->priv; + + wake_up(&vb->config_change); +} + +static inline s64 towards_target(struct virtio_balloon *vb) +{ + u32 v; + __virtio_config_val(vb->vdev, + offsetof(struct virtio_balloon_config, num_pages), + &v); + return v - vb->num_pages; +} + +static void update_balloon_size(struct virtio_balloon *vb) +{ + __le32 actual = cpu_to_le32(vb->num_pages); + + vb->vdev->config->set(vb->vdev, + offsetof(struct virtio_balloon_config, actual), + &actual, sizeof(actual)); +} + +static int balloon(void *_vballoon) +{ + struct virtio_balloon *vb = _vballoon; + + set_freezable(); + while (!kthread_should_stop()) { + s64 diff; + + try_to_freeze(); + wait_event_interruptible(vb->config_change, + (diff = towards_target(vb)) != 0 + || kthread_should_stop()); + if (diff > 0) + fill_balloon(vb, diff); + else if (diff < 0) + leak_balloon(vb, -diff); + update_balloon_size(vb); + } + return 0; +} + +static int virtballoon_probe(struct virtio_device *vdev) +{ + struct virtio_balloon *vb; + int err; + + vdev->priv = vb = kmalloc(sizeof(*vb), GFP_KERNEL); + if (!vb) { + err = -ENOMEM; + goto out; + } + + INIT_LIST_HEAD(&vb->pages); + vb->num_pages = 0; + init_waitqueue_head(&vb->config_change); + vb->vdev = vdev; + + /* We expect two virtqueues. */ + vb->inflate_vq = vdev->config->find_vq(vdev, 0, balloon_ack); + if (IS_ERR(vb->inflate_vq)) { + err = PTR_ERR(vb->inflate_vq); + goto out_free_vb; + } + + vb->deflate_vq = vdev->config->find_vq(vdev, 1, balloon_ack); + if (IS_ERR(vb->deflate_vq)) { + err = PTR_ERR(vb->deflate_vq); + goto out_del_inflate_vq; + } + + vb->thread = kthread_run(balloon, vb, "vballoon"); + if (IS_ERR(vb->thread)) { + err = PTR_ERR(vb->thread); + goto out_del_deflate_vq; + } + + vb->tell_host_first + = virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST); + + return 0; + +out_del_deflate_vq: + vdev->config->del_vq(vb->deflate_vq); +out_del_inflate_vq: + vdev->config->del_vq(vb->inflate_vq); +out_free_vb: + kfree(vb); +out: + return err; +} + +static void virtballoon_remove(struct virtio_device *vdev) +{ + struct virtio_balloon *vb = vdev->priv; + + kthread_stop(vb->thread); + + /* There might be pages left in the balloon: free them. */ + while (vb->num_pages) + leak_balloon(vb, vb->num_pages); + + /* Now we reset the device so we can clean up the queues. */ + vdev->config->reset(vdev); + + vdev->config->del_vq(vb->deflate_vq); + vdev->config->del_vq(vb->inflate_vq); + kfree(vb); +} + +static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST }; + +static struct virtio_driver virtio_balloon = { + .feature_table = features, + .feature_table_size = ARRAY_SIZE(features), + .driver.name = KBUILD_MODNAME, + .driver.owner = THIS_MODULE, + .id_table = id_table, + .probe = virtballoon_probe, + .remove = __devexit_p(virtballoon_remove), + .config_changed = virtballoon_changed, +}; + +static int __init init(void) +{ + return register_virtio_driver(&virtio_balloon); +} + +static void __exit fini(void) +{ + unregister_virtio_driver(&virtio_balloon); +} +module_init(init); +module_exit(fini); + +MODULE_DEVICE_TABLE(virtio, id_table); +MODULE_DESCRIPTION("Virtio balloon driver"); +MODULE_LICENSE("GPL"); --- linux-2.6.24.orig/drivers/virtio/virtio_pci.c +++ linux-2.6.24/drivers/virtio/virtio_pci.c @@ -0,0 +1,450 @@ +/* + * Virtio PCI driver + * + * This module allows virtio devices to be used over a virtual PCI device. + * This can be used with QEMU based VMMs like KVM or Xen. + * + * Copyright IBM Corp. 2007 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MODULE_AUTHOR("Anthony Liguori "); +MODULE_DESCRIPTION("virtio-pci"); +MODULE_LICENSE("GPL"); +MODULE_VERSION("1"); + +/* Our device structure */ +struct virtio_pci_device +{ + struct virtio_device vdev; + struct pci_dev *pci_dev; + + /* the IO mapping for the PCI config space */ + void __iomem *ioaddr; + + /* a list of queues so we can dispatch IRQs */ + spinlock_t lock; + struct list_head virtqueues; +}; + +struct virtio_pci_vq_info +{ + /* the actual virtqueue */ + struct virtqueue *vq; + + /* the number of entries in the queue */ + int num; + + /* the index of the queue */ + int queue_index; + + /* the virtual address of the ring queue */ + void *queue; + + /* the list node for the virtqueues list */ + struct list_head node; +}; + +/* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */ +static struct pci_device_id virtio_pci_id_table[] = { + { 0x1af4, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { 0 }, +}; + +MODULE_DEVICE_TABLE(pci, virtio_pci_id_table); + +/* A PCI device has it's own struct device and so does a virtio device so + * we create a place for the virtio devices to show up in sysfs. I think it + * would make more sense for virtio to not insist on having it's own device. */ +static struct device virtio_pci_root = { + .parent = NULL, + .bus_id = "virtio-pci", +}; + +/* Unique numbering for devices under the kvm root */ +static unsigned int dev_index; + +/* Convert a generic virtio device to our structure */ +static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev) +{ + return container_of(vdev, struct virtio_pci_device, vdev); +} + +/* virtio config->get_features() implementation */ +static u32 vp_get_features(struct virtio_device *vdev) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + + /* When someone needs more than 32 feature bits, we'll need to + * steal a bit to indicate that the rest are somewhere else. */ + return ioread32(vp_dev->ioaddr + VIRTIO_PCI_HOST_FEATURES); +} + +/* virtio config->set_features() implementation */ +static void vp_set_features(struct virtio_device *vdev, u32 features) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + + iowrite32(features, vp_dev->ioaddr + VIRTIO_PCI_GUEST_FEATURES); +} + +/* virtio config->get() implementation */ +static void vp_get(struct virtio_device *vdev, unsigned offset, + void *buf, unsigned len) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + void __iomem *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset; + u8 *ptr = buf; + int i; + + for (i = 0; i < len; i++) + ptr[i] = ioread8(ioaddr + i); +} + +/* the config->set() implementation. it's symmetric to the config->get() + * implementation */ +static void vp_set(struct virtio_device *vdev, unsigned offset, + const void *buf, unsigned len) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + void __iomem *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset; + const u8 *ptr = buf; + int i; + + for (i = 0; i < len; i++) + iowrite8(ptr[i], ioaddr + i); +} + +/* config->{get,set}_status() implementations */ +static u8 vp_get_status(struct virtio_device *vdev) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + return ioread8(vp_dev->ioaddr + VIRTIO_PCI_STATUS); +} + +static void vp_set_status(struct virtio_device *vdev, u8 status) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + /* We should never be setting status to 0. */ + BUG_ON(status == 0); + return iowrite8(status, vp_dev->ioaddr + VIRTIO_PCI_STATUS); +} + +static void vp_reset(struct virtio_device *vdev) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + /* 0 status means a reset. */ + return iowrite8(0, vp_dev->ioaddr + VIRTIO_PCI_STATUS); +} + +/* the notify function used when creating a virt queue */ +static void vp_notify(struct virtqueue *vq) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); + struct virtio_pci_vq_info *info = vq->priv; + + /* we write the queue's selector into the notification register to + * signal the other end */ + iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY); +} + +/* A small wrapper to also acknowledge the interrupt when it's handled. + * I really need an EIO hook for the vring so I can ack the interrupt once we + * know that we'll be handling the IRQ but before we invoke the callback since + * the callback may notify the host which results in the host attempting to + * raise an interrupt that we would then mask once we acknowledged the + * interrupt. */ +static irqreturn_t vp_interrupt(int irq, void *opaque) +{ + struct virtio_pci_device *vp_dev = opaque; + struct virtio_pci_vq_info *info; + irqreturn_t ret = IRQ_NONE; + unsigned long flags; + u8 isr; + + /* reading the ISR has the effect of also clearing it so it's very + * important to save off the value. */ + isr = ioread8(vp_dev->ioaddr + VIRTIO_PCI_ISR); + + /* It's definitely not us if the ISR was not high */ + if (!isr) + return IRQ_NONE; + + /* Configuration change? Tell driver if it wants to know. */ + if (isr & VIRTIO_PCI_ISR_CONFIG) { + struct virtio_driver *drv; + drv = container_of(vp_dev->vdev.dev.driver, + struct virtio_driver, driver); + + if (drv->config_changed) + drv->config_changed(&vp_dev->vdev); + } + + spin_lock_irqsave(&vp_dev->lock, flags); + list_for_each_entry(info, &vp_dev->virtqueues, node) { + if (vring_interrupt(irq, info->vq) == IRQ_HANDLED) + ret = IRQ_HANDLED; + } + spin_unlock_irqrestore(&vp_dev->lock, flags); + + return ret; +} + +/* the config->find_vq() implementation */ +static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index, + void (*callback)(struct virtqueue *vq)) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + struct virtio_pci_vq_info *info; + struct virtqueue *vq; + unsigned long flags; + u16 num; + int err; + + /* Select the queue we're interested in */ + iowrite16(index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); + + /* Check if queue is either not available or already active. */ + num = ioread16(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NUM); + if (!num || ioread32(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN)) + return ERR_PTR(-ENOENT); + + /* allocate and fill out our structure the represents an active + * queue */ + info = kmalloc(sizeof(struct virtio_pci_vq_info), GFP_KERNEL); + if (!info) + return ERR_PTR(-ENOMEM); + + info->queue_index = index; + info->num = num; + + info->queue = kzalloc(PAGE_ALIGN(vring_size(num,PAGE_SIZE)), GFP_KERNEL); + if (info->queue == NULL) { + err = -ENOMEM; + goto out_info; + } + + /* activate the queue */ + iowrite32(virt_to_phys(info->queue) >> PAGE_SHIFT, + vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); + + /* create the vring */ + vq = vring_new_virtqueue(info->num, vdev, info->queue, + vp_notify, callback); + if (!vq) { + err = -ENOMEM; + goto out_activate_queue; + } + + vq->priv = info; + info->vq = vq; + + spin_lock_irqsave(&vp_dev->lock, flags); + list_add(&info->node, &vp_dev->virtqueues); + spin_unlock_irqrestore(&vp_dev->lock, flags); + + return vq; + +out_activate_queue: + iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); + kfree(info->queue); +out_info: + kfree(info); + return ERR_PTR(err); +} + +/* the config->del_vq() implementation */ +static void vp_del_vq(struct virtqueue *vq) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); + struct virtio_pci_vq_info *info = vq->priv; + unsigned long flags; + + spin_lock_irqsave(&vp_dev->lock, flags); + list_del(&info->node); + spin_unlock_irqrestore(&vp_dev->lock, flags); + + vring_del_virtqueue(vq); + + /* Select and deactivate the queue */ + iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); + iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); + + kfree(info->queue); + kfree(info); +} + +static struct virtio_config_ops virtio_pci_config_ops = { + .get = vp_get, + .set = vp_set, + .get_status = vp_get_status, + .set_status = vp_set_status, + .reset = vp_reset, + .find_vq = vp_find_vq, + .del_vq = vp_del_vq, + .get_features = vp_get_features, + .set_features = vp_set_features, +}; + +/* the PCI probing function */ +static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, + const struct pci_device_id *id) +{ + struct virtio_pci_device *vp_dev; + int err; + + /* We only own devices >= 0x1000 and <= 0x103f: leave the rest. */ + if (pci_dev->device < 0x1000 || pci_dev->device > 0x103f) + return -ENODEV; + + if (pci_dev->revision != VIRTIO_PCI_ABI_VERSION) { + printk(KERN_ERR "virtio_pci: expected ABI version %d, got %d\n", + VIRTIO_PCI_ABI_VERSION, pci_dev->revision); + return -ENODEV; + } + + /* allocate our structure and fill it out */ + vp_dev = kzalloc(sizeof(struct virtio_pci_device), GFP_KERNEL); + if (vp_dev == NULL) + return -ENOMEM; + + snprintf(vp_dev->vdev.dev.bus_id, BUS_ID_SIZE, "virtio%d", dev_index); + vp_dev->vdev.index = dev_index; + dev_index++; + + vp_dev->vdev.dev.parent = &virtio_pci_root; + vp_dev->vdev.config = &virtio_pci_config_ops; + vp_dev->pci_dev = pci_dev; + INIT_LIST_HEAD(&vp_dev->virtqueues); + spin_lock_init(&vp_dev->lock); + + /* enable the device */ + err = pci_enable_device(pci_dev); + if (err) + goto out; + + err = pci_request_regions(pci_dev, "virtio-pci"); + if (err) + goto out_enable_device; + + vp_dev->ioaddr = pci_iomap(pci_dev, 0, 0); + if (vp_dev->ioaddr == NULL) + goto out_req_regions; + + pci_set_drvdata(pci_dev, vp_dev); + + /* we use the subsystem vendor/device id as the virtio vendor/device + * id. this allows us to use the same PCI vendor/device id for all + * virtio devices and to identify the particular virtio driver by + * the subsytem ids */ + vp_dev->vdev.id.vendor = pci_dev->subsystem_vendor; + vp_dev->vdev.id.device = pci_dev->subsystem_device; + + /* register a handler for the queue with the PCI device's interrupt */ + err = request_irq(vp_dev->pci_dev->irq, vp_interrupt, IRQF_SHARED, + vp_dev->vdev.dev.bus_id, vp_dev); + if (err) + goto out_set_drvdata; + + /* finally register the virtio device */ + err = register_virtio_device(&vp_dev->vdev); + if (err) + goto out_req_irq; + + return 0; + +out_req_irq: + free_irq(pci_dev->irq, vp_dev); +out_set_drvdata: + pci_set_drvdata(pci_dev, NULL); + pci_iounmap(pci_dev, vp_dev->ioaddr); +out_req_regions: + pci_release_regions(pci_dev); +out_enable_device: + pci_disable_device(pci_dev); +out: + kfree(vp_dev); + return err; +} + +static void __devexit virtio_pci_remove(struct pci_dev *pci_dev) +{ + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + + unregister_virtio_device(&vp_dev->vdev); + free_irq(pci_dev->irq, vp_dev); + pci_set_drvdata(pci_dev, NULL); + pci_iounmap(pci_dev, vp_dev->ioaddr); + pci_release_regions(pci_dev); + pci_disable_device(pci_dev); + kfree(vp_dev); +} + +#ifdef CONFIG_PM +static int virtio_pci_suspend(struct pci_dev *pci_dev, pm_message_t state) +{ + pci_save_state(pci_dev); + pci_set_power_state(pci_dev, PCI_D3hot); + return 0; +} + +static int virtio_pci_resume(struct pci_dev *pci_dev) +{ + pci_restore_state(pci_dev); + pci_set_power_state(pci_dev, PCI_D0); + return 0; +} +#endif + +static struct pci_driver virtio_pci_driver = { + .name = "virtio-pci", + .id_table = virtio_pci_id_table, + .probe = virtio_pci_probe, + .remove = virtio_pci_remove, +#ifdef CONFIG_PM + .suspend = virtio_pci_suspend, + .resume = virtio_pci_resume, +#endif +}; + +static int __init virtio_pci_init(void) +{ + int err; + + err = device_register(&virtio_pci_root); + if (err) + return err; + + err = pci_register_driver(&virtio_pci_driver); + if (err) + device_unregister(&virtio_pci_root); + + return err; +} + +module_init(virtio_pci_init); + +static void __exit virtio_pci_exit(void) +{ + device_unregister(&virtio_pci_root); + pci_unregister_driver(&virtio_pci_driver); +} + +module_exit(virtio_pci_exit); --- linux-2.6.24.orig/drivers/serial/68360serial.c +++ linux-2.6.24/drivers/serial/68360serial.c @@ -1379,6 +1379,30 @@ } +/* + * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) + * Return: write counters to the user passed counter struct + * NB: both 1->0 and 0->1 transitions are counted except for + * RI where only 0->1 is counted. + */ +static int rs_360_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) +{ + ser_info_t *info = (ser_info_t *)tty->driver_data; + struct async_icount cnow; + + local_irq_disable(); + cnow = info->state->icount; + local_irq_enable(); + + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + + return 0; +} + static int rs_360_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) { @@ -1392,7 +1416,7 @@ if (serial_paranoia_check(info, tty->name, "rs_ioctl")) return -ENODEV; - if ((cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { + if (cmd != TIOCMIWAIT) { if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; } @@ -1487,31 +1511,6 @@ return 0; #endif - /* - * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for - * RI where only 0->1 is counted. - */ - case TIOCGICOUNT: - local_irq_disable(); - cnow = info->state->icount; - local_irq_enable(); - p_cuser = (struct serial_icounter_struct *) arg; -/* error = put_user(cnow.cts, &p_cuser->cts); */ -/* if (error) return error; */ -/* error = put_user(cnow.dsr, &p_cuser->dsr); */ -/* if (error) return error; */ -/* error = put_user(cnow.rng, &p_cuser->rng); */ -/* if (error) return error; */ -/* error = put_user(cnow.dcd, &p_cuser->dcd); */ -/* if (error) return error; */ - - put_user(cnow.cts, &p_cuser->cts); - put_user(cnow.dsr, &p_cuser->dsr); - put_user(cnow.rng, &p_cuser->rng); - put_user(cnow.dcd, &p_cuser->dcd); - return 0; default: return -ENOIOCTLCMD; --- linux-2.6.24.orig/drivers/serial/serial_core.c +++ linux-2.6.24/drivers/serial/serial_core.c @@ -1022,10 +1022,10 @@ * NB: both 1->0 and 0->1 transitions are counted except for * RI where only 0->1 is counted. */ -static int uart_get_count(struct uart_state *state, - struct serial_icounter_struct __user *icnt) +static int uart_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) { - struct serial_icounter_struct icount; + struct uart_state *state = tty->driver_data; struct uart_icount cnow; struct uart_port *port = state->port; @@ -1033,19 +1033,19 @@ memcpy(&cnow, &port->icount, sizeof(struct uart_icount)); spin_unlock_irq(&port->lock); - icount.cts = cnow.cts; - icount.dsr = cnow.dsr; - icount.rng = cnow.rng; - icount.dcd = cnow.dcd; - icount.rx = cnow.rx; - icount.tx = cnow.tx; - icount.frame = cnow.frame; - icount.overrun = cnow.overrun; - icount.parity = cnow.parity; - icount.brk = cnow.brk; - icount.buf_overrun = cnow.buf_overrun; + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + icount->rx = cnow.rx; + icount->tx = cnow.tx; + icount->frame = cnow.frame; + icount->overrun = cnow.overrun; + icount->parity = cnow.parity; + icount->brk = cnow.brk; + icount->buf_overrun = cnow.buf_overrun; - return copy_to_user(icnt, &icount, sizeof(icount)) ? -EFAULT : 0; + return 0; } /* @@ -1098,10 +1098,6 @@ case TIOCMIWAIT: ret = uart_wait_modem_status(state, arg); break; - - case TIOCGICOUNT: - ret = uart_get_count(state, uarg); - break; } if (ret != -ENOIOCTLCMD) @@ -2197,6 +2193,7 @@ #endif .tiocmget = uart_tiocmget, .tiocmset = uart_tiocmset, + .get_icount = uart_get_icount, }; /** --- linux-2.6.24.orig/drivers/serial/8250.c +++ linux-2.6.24/drivers/serial/8250.c @@ -1822,6 +1822,8 @@ * allow register changes to become visible. */ spin_lock_irqsave(&up->port.lock, flags); + if (up->port.flags & UPF_SHARE_IRQ) + disable_irq_nosync(up->port.irq); wait_for_xmitr(up, UART_LSR_THRE); serial_out_sync(up, UART_IER, UART_IER_THRI); @@ -1833,6 +1835,8 @@ iir = serial_in(up, UART_IIR); serial_out(up, UART_IER, 0); + if (up->port.flags & UPF_SHARE_IRQ) + enable_irq(up->port.irq); spin_unlock_irqrestore(&up->port.lock, flags); /* --- linux-2.6.24.orig/drivers/video/chipsfb.c +++ linux-2.6.24/drivers/video/chipsfb.c @@ -459,7 +459,7 @@ if (state.event == pdev->dev.power.power_state.event) return 0; - if (state.event != PM_EVENT_SUSPEND) + if (!(state.event & PM_EVENT_SLEEP)) goto done; acquire_console_sem(); --- linux-2.6.24.orig/drivers/video/Kconfig +++ linux-2.6.24/drivers/video/Kconfig @@ -629,8 +629,8 @@ If unsure, say N. config FB_VESA - bool "VESA VGA graphics support" - depends on (FB = y) && X86 + tristate "VESA VGA graphics support" + depends on FB && X86 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT --- linux-2.6.24.orig/drivers/video/fb_defio.c +++ linux-2.6.24/drivers/video/fb_defio.c @@ -88,6 +88,17 @@ .page_mkwrite = fb_deferred_io_mkwrite, }; +static int fb_deferred_io_set_page_dirty(struct page *page) +{ + if (!PageDirty(page)) + SetPageDirty(page); + return 0; +} + +static const struct address_space_operations fb_deferred_io_aops = { + .set_page_dirty = fb_deferred_io_set_page_dirty, +}; + static int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma) { vma->vm_ops = &fb_deferred_io_vm_ops; @@ -137,6 +148,14 @@ } EXPORT_SYMBOL_GPL(fb_deferred_io_init); +void fb_deferred_io_open(struct fb_info *info, + struct inode *inode, + struct file *file) +{ + file->f_mapping->a_ops = &fb_deferred_io_aops; +} +EXPORT_SYMBOL_GPL(fb_deferred_io_open); + void fb_deferred_io_cleanup(struct fb_info *info) { struct fb_deferred_io *fbdefio = info->fbdefio; --- linux-2.6.24.orig/drivers/video/uvesafb.c +++ linux-2.6.24/drivers/video/uvesafb.c @@ -66,12 +66,14 @@ * find the kernel part of the task struct, copy the registers and * the buffer contents and then complete the task. */ -static void uvesafb_cn_callback(void *data) +static void uvesafb_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) { - struct cn_msg *msg = data; struct uvesafb_task *utask; struct uvesafb_ktask *task; + if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN)) + return; + if (msg->seq >= UVESAFB_TASKS_MAX) return; --- linux-2.6.24.orig/drivers/video/vesafb.c +++ linux-2.6.24/drivers/video/vesafb.c @@ -28,6 +28,12 @@ #define dac_reg (0x3c8) #define dac_val (0x3c9) +struct vesafb_info +{ + u32 pseudo_palette[256]; + int mtrr_hdl; +}; + /* --------------------------------------------------------------------- */ static struct fb_var_screeninfo vesafb_defined __initdata = { @@ -47,16 +53,37 @@ .accel = FB_ACCEL_NONE, }; +#ifndef MODULE static int inverse __read_mostly; +#endif static int mtrr __read_mostly; /* disable mtrr */ static int vram_remap __initdata; /* Set amount of memory to be used */ static int vram_total __initdata; /* Set total amount of memory */ static int pmi_setpal __read_mostly = 1; /* pmi for palette changes ??? */ +static int redraw __read_mostly; static int ypan __read_mostly; /* 0..nothing, 1..ypan, 2..ywrap */ +static int ywrap __read_mostly; static void (*pmi_start)(void) __read_mostly; static void (*pmi_pal) (void) __read_mostly; static int depth __read_mostly; static int vga_compat __read_mostly; + +module_param(redraw, bool, 0); +module_param(ypan, bool, 0); +module_param(ywrap, bool, 0); +module_param_named(vgapal, pmi_setpal, invbool, 0); +MODULE_PARM_DESC(vgapal, "Use VGA for setting palette (default)"); +module_param_named(pmipal, pmi_setpal, bool, 0); +MODULE_PARM_DESC(pmipal, "Use PMI for setting palette"); +module_param(mtrr, bool, 0); +MODULE_PARM_DESC(mtrr, "Enable MTRR support (default)"); +module_param_named(nomtrr, mtrr, invbool, 0); +MODULE_PARM_DESC(nomtrr, "Disable MTRR support"); +module_param(vram_remap, int, 0); +MODULE_PARM_DESC(vram_remap, "Set total amount of memory to be used"); +module_param(vram_total, int, 0); +MODULE_PARM_DESC(vram_total, "Total amount of memory"); + /* --------------------------------------------------------------------- */ static int vesafb_pan_display(struct fb_var_screeninfo *var, @@ -183,6 +210,7 @@ .fb_imageblit = cfb_imageblit, }; +#ifndef MODULE static int __init vesafb_setup(char *options) { char *this_opt; @@ -216,6 +244,7 @@ } return 0; } +#endif static int __init vesafb_probe(struct platform_device *dev) { @@ -463,8 +492,28 @@ return err; } +static int __exit vesafb_remove(struct platform_device *device) +{ + struct fb_info *info = dev_get_drvdata(&device->dev); + + unregister_framebuffer(info); +#ifdef CONFIG_MTRR + { + struct vesafb_info *vfb_info = (struct vesafb_info *) info->par; + if (vfb_info->mtrr_hdl >= 0) + mtrr_del(vfb_info->mtrr_hdl, 0, 0); + } +#endif + iounmap(info->screen_base); + framebuffer_release(info); + release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len); + + return 0; +} + static struct platform_driver vesafb_driver = { .probe = vesafb_probe, + .remove = vesafb_remove, .driver = { .name = "vesafb", }, @@ -475,11 +524,18 @@ static int __init vesafb_init(void) { int ret; +#ifndef MODULE char *option = NULL; /* ignore error return of fb_get_options */ fb_get_options("vesafb", &option); vesafb_setup(option); +#else + if (redraw) + ypan = 0; + if (ywrap) + ypan = 2; +#endif ret = platform_driver_register(&vesafb_driver); if (!ret) { @@ -498,6 +554,14 @@ return ret; } + +static void __exit vesafb_exit(void) +{ + platform_device_unregister(vesafb_device); + platform_driver_unregister(&vesafb_driver); +} + module_init(vesafb_init); +module_exit(vesafb_exit); MODULE_LICENSE("GPL"); --- linux-2.6.24.orig/drivers/video/fbmem.c +++ linux-2.6.24/drivers/video/fbmem.c @@ -1315,6 +1315,10 @@ if (res) module_put(info->fbops->owner); } +#ifdef CONFIG_FB_DEFERRED_IO + if (info->fbdefio) + fb_deferred_io_open(info, inode, file); +#endif return res; } @@ -1521,6 +1525,7 @@ static void __exit fbmem_exit(void) { + remove_proc_entry("fb", NULL); class_destroy(fb_class); unregister_chrdev(FB_MAJOR, "fb"); } --- linux-2.6.24.orig/drivers/video/nvidia/nvidia.c +++ linux-2.6.24/drivers/video/nvidia/nvidia.c @@ -1048,7 +1048,7 @@ acquire_console_sem(); par->pm_state = mesg.event; - if (mesg.event == PM_EVENT_SUSPEND) { + if (mesg.event & PM_EVENT_SLEEP) { fb_set_suspend(info, 1); nvidiafb_blank(FB_BLANK_POWERDOWN, info); nvidia_write_regs(par, &par->SavedReg); --- linux-2.6.24.orig/drivers/video/console/vgacon.c +++ linux-2.6.24/drivers/video/console/vgacon.c @@ -1268,7 +1268,7 @@ font->charcount = vga_512_chars ? 512 : 256; if (!font->data) return 0; - return vgacon_do_font_op(&state, font->data, 0, 0); + return vgacon_do_font_op(&state, font->data, 0, vga_512_chars); } #else --- linux-2.6.24.orig/drivers/video/sis/sis_main.c +++ linux-2.6.24/drivers/video/sis/sis_main.c @@ -1721,6 +1721,9 @@ break; case FBIOGET_VBLANK: + + memset(&sisvbblank, 0, sizeof(struct fb_vblank)); + sisvbblank.count = 0; sisvbblank.flags = sisfb_setupvbblankflags(ivideo, &sisvbblank.vcount, &sisvbblank.hcount); --- linux-2.6.24.orig/drivers/parisc/eisa_eeprom.c +++ linux-2.6.24/drivers/parisc/eisa_eeprom.c @@ -54,7 +54,7 @@ ssize_t ret; int i; - if (*ppos >= HPEE_MAX_LENGTH) + if (*ppos < 0 || *ppos >= HPEE_MAX_LENGTH) return 0; count = *ppos + count < HPEE_MAX_LENGTH ? count : HPEE_MAX_LENGTH - *ppos; --- linux-2.6.24.orig/drivers/media/video/tvaudio.c +++ linux-2.6.24/drivers/media/video/tvaudio.c @@ -156,7 +156,7 @@ { unsigned char buffer[2]; - if (-1 == subaddr) { + if (subaddr < 0) { v4l_dbg(1, debug, &chip->c, "%s: chip_write: 0x%x\n", chip->c.name, val); chip->shadow.bytes[1] = val; @@ -167,6 +167,13 @@ return -1; } } else { + if (subaddr + 1 >= ARRAY_SIZE(chip->shadow.bytes)) { + v4l_info(&chip->c, + "Tried to access a non-existent register: %d\n", + subaddr); + return -EINVAL; + } + v4l_dbg(1, debug, &chip->c, "%s: chip_write: reg%d=0x%x\n", chip->c.name, subaddr, val); chip->shadow.bytes[subaddr+1] = val; @@ -181,12 +188,20 @@ return 0; } -static int chip_write_masked(struct CHIPSTATE *chip, int subaddr, int val, int mask) +static int chip_write_masked(struct CHIPSTATE *chip, + int subaddr, int val, int mask) { if (mask != 0) { - if (-1 == subaddr) { + if (subaddr < 0) { val = (chip->shadow.bytes[1] & ~mask) | (val & mask); } else { + if (subaddr + 1 >= ARRAY_SIZE(chip->shadow.bytes)) { + v4l_info(&chip->c, + "Tried to access a non-existent register: %d\n", + subaddr); + return -EINVAL; + } + val = (chip->shadow.bytes[subaddr+1] & ~mask) | (val & mask); } } @@ -232,6 +247,15 @@ if (0 == cmd->count) return 0; + if (cmd->count + cmd->bytes[0] - 1 >= ARRAY_SIZE(chip->shadow.bytes)) { + v4l_info(&chip->c, + "Tried to access a non-existent register range: %d to %d\n", + cmd->bytes[0] + 1, cmd->bytes[0] + cmd->count - 1); + return -EINVAL; + } + + /* FIXME: it seems that the shadow bytes are wrong bellow !*/ + /* update our shadow register set; print bytes if (debug > 0) */ v4l_dbg(1, debug, &chip->c, "%s: chip_cmd(%s): reg=%d, data:", chip->c.name, name,cmd->bytes[0]); @@ -1765,7 +1789,7 @@ case VIDIOCSFREQ: case VIDIOC_S_FREQUENCY: chip->mode = 0; /* automatic */ - if (desc->checkmode) { + if (desc->checkmode && desc->setmode) { desc->setmode(chip,VIDEO_SOUND_MONO); if (chip->prevmode != VIDEO_SOUND_MONO) chip->prevmode = -1; /* reset previous mode */ --- linux-2.6.24.orig/drivers/media/video/compat_ioctl32.c +++ linux-2.6.24/drivers/media/video/compat_ioctl32.c @@ -504,6 +504,7 @@ static inline int microcode32(struct video_code *kp, struct video_code32 __user *up) { + return -EFAULT; if(!access_ok(VERIFY_READ, up, sizeof(struct video_code32)) || copy_from_user(kp->loadwhat, up->loadwhat, sizeof (up->loadwhat)) || get_user(kp->datasize, &up->datasize) || --- linux-2.6.24.orig/drivers/media/video/vivi.c +++ linux-2.6.24/drivers/media/video/vivi.c @@ -170,7 +170,7 @@ int users; /* various device info */ - struct video_device vfd; + struct video_device *vfd; struct vivi_dmaqueue vidq; @@ -986,7 +986,7 @@ printk(KERN_DEBUG "vivi: open called (minor=%d)\n",minor); list_for_each_entry(dev, &vivi_devlist, vivi_devlist) - if (dev->vfd.minor == minor) + if (dev->vfd->minor == minor) goto found; return -ENODEV; found: @@ -1067,7 +1067,7 @@ return videobuf_poll_stream(file, q, wait); } -static int vivi_release(struct inode *inode, struct file *file) +static int vivi_close(struct inode *inode, struct file *file) { struct vivi_fh *fh = file->private_data; struct vivi_dev *dev = fh->dev; @@ -1088,6 +1088,18 @@ return 0; } +static int vivi_release(struct vivi_dev *dev) +{ + if (-1 != dev->vfd->minor) + video_unregister_device(dev->vfd); + else + video_device_release(dev->vfd); + + dev->vfd = NULL; + + return 0; +} + static int vivi_mmap(struct file *file, struct vm_area_struct * vma) { @@ -1109,7 +1121,7 @@ static const struct file_operations vivi_fops = { .owner = THIS_MODULE, .open = vivi_open, - .release = vivi_release, + .release = vivi_close, .read = vivi_read, .poll = vivi_poll, .ioctl = video_ioctl2, /* V4L2 ioctl handler */ @@ -1117,12 +1129,12 @@ .llseek = no_llseek, }; -static struct video_device vivi = { +static struct video_device vivi_template = { .name = "vivi", .type = VID_TYPE_CAPTURE, .fops = &vivi_fops, .minor = -1, -// .release = video_device_release, + .release = video_device_release, .vidioc_querycap = vidioc_querycap, .vidioc_enum_fmt_cap = vidioc_enum_fmt_cap, @@ -1156,6 +1168,7 @@ { int ret; struct vivi_dev *dev; + struct video_device *vfd; dev = kzalloc(sizeof(*dev),GFP_KERNEL); if (NULL == dev) @@ -1174,7 +1187,18 @@ dev->vidq.timeout.data = (unsigned long)dev; init_timer(&dev->vidq.timeout); - ret = video_register_device(&vivi, VFL_TYPE_GRABBER, video_nr); + vfd = video_device_alloc(); + if (NULL == vfd) + return -ENOMEM; + + *vfd = vivi_template; + + ret = video_register_device(vfd, VFL_TYPE_GRABBER, video_nr); + snprintf(vfd->name, sizeof(vfd->name), "%s (%i)", + vivi_template.name, vfd->minor); + + dev->vfd = vfd; + printk(KERN_INFO "Video Technology Magazine Virtual Video Capture Board (Load status: %d)\n", ret); return ret; } @@ -1188,9 +1212,9 @@ list = vivi_devlist.next; list_del(list); h = list_entry(list, struct vivi_dev, vivi_devlist); + vivi_release(h); kfree (h); } - video_unregister_device(&vivi); } module_init(vivi_init); --- linux-2.6.24.orig/drivers/media/video/ivtv/ivtv-ioctl.c +++ linux-2.6.24/drivers/media/video/ivtv/ivtv-ioctl.c @@ -727,7 +727,8 @@ memset(vcap, 0, sizeof(*vcap)); strcpy(vcap->driver, IVTV_DRIVER_NAME); /* driver name */ - strcpy(vcap->card, itv->card_name); /* card type */ + strncpy(vcap->card, itv->card_name, + sizeof(vcap->card)-1); /* card type */ strcpy(vcap->bus_info, pci_name(itv->dev)); /* bus info... */ vcap->version = IVTV_DRIVER_VERSION; /* version */ vcap->capabilities = itv->v4l2_cap; /* capabilities */ --- linux-2.6.24.orig/drivers/media/video/ivtv/ivtvfb.c +++ linux-2.6.24/drivers/media/video/ivtv/ivtvfb.c @@ -378,6 +378,8 @@ struct fb_vblank vblank; u32 trace; + memset(&vblank, 0, sizeof(struct fb_vblank)); + vblank.flags = FB_VBLANK_HAVE_COUNT |FB_VBLANK_HAVE_VCOUNT | FB_VBLANK_HAVE_VSYNC; trace = read_reg(0x028c0) >> 16; --- linux-2.6.24.orig/drivers/media/video/ivtv/ivtv-driver.c +++ linux-2.6.24/drivers/media/video/ivtv/ivtv-driver.c @@ -687,6 +687,9 @@ itv->vbi.in.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; itv->vbi.sliced_in = &itv->vbi.in.fmt.sliced; + /* Init the sg table for osd/yuv output */ + sg_init_table(itv->udma.SGlist, IVTV_DMA_SG_OSD_ENT); + /* OSD */ itv->osd_global_alpha_state = 1; itv->osd_global_alpha = 255; --- linux-2.6.24.orig/drivers/media/video/em28xx/em28xx-cards.c +++ linux-2.6.24/drivers/media/video/em28xx/em28xx-cards.c @@ -274,6 +274,7 @@ { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 }, { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 }, { USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, + { USB_DEVICE(0x2040, 0x6502), .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, { }, }; --- linux-2.6.24.orig/drivers/media/video/saa7134/saa7134-dvb.c +++ linux-2.6.24/drivers/media/video/saa7134/saa7134-dvb.c @@ -826,6 +826,7 @@ static struct tda10086_config flydvbs = { .demod_address = 0x0e, .invert = 0, + .diseqc_tone = 0, }; /* ================================================================== --- linux-2.6.24.orig/drivers/media/video/cx88/cx88-cards.c +++ linux-2.6.24/drivers/media/video/cx88/cx88-cards.c @@ -1349,6 +1349,10 @@ }}, /* fixme: Add radio support */ .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0xe780, + }, }, [CX88_BOARD_ADSTECH_PTV_390] = { .name = "ADS Tech Instant Video PCI", --- linux-2.6.24.orig/drivers/media/dvb/ttpci/av7110_ca.c +++ linux-2.6.24/drivers/media/dvb/ttpci/av7110_ca.c @@ -277,7 +277,7 @@ { ca_slot_info_t *info=(ca_slot_info_t *)parg; - if (info->num > 1) + if (info->num < 0 || info->num > 1) return -EINVAL; av7110->ci_slot[info->num].num = info->num; av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ? --- linux-2.6.24.orig/drivers/media/dvb/ttpci/budget.c +++ linux-2.6.24/drivers/media/dvb/ttpci/budget.c @@ -351,6 +351,7 @@ static struct tda10086_config tda10086_config = { .demod_address = 0x0e, .invert = 0, + .diseqc_tone = 1, }; static u8 read_pwm(struct budget* budget) --- linux-2.6.24.orig/drivers/media/dvb/dvb-core/dvb_net.c +++ linux-2.6.24/drivers/media/dvb/dvb-core/dvb_net.c @@ -504,6 +504,7 @@ "bytes left in TS. Resyncing.\n", ts_remain); priv->ule_sndu_len = 0; priv->need_pusi = 1; + ts += TS_SZ; continue; } --- linux-2.6.24.orig/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ linux-2.6.24/drivers/media/dvb/dvb-usb/dib0700_devices.c @@ -230,6 +230,27 @@ } }; +static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap) +{ + if (adap->id == 0) { + dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); + msleep(10); + dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); + dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); + dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); + dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); + msleep(10); + dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); + msleep(10); + dib7000p_i2c_enumeration(&adap->dev->i2c_adap,1,18,stk7700d_dib7000p_mt2266_config); + } + + adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), + &stk7700d_dib7000p_mt2266_config[adap->id]); + + return adap->fe == NULL ? -ENODEV : 0; +} + static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap) { if (adap->id == 0) { @@ -821,6 +842,11 @@ { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) }, { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) }, /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) }, + { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) }, + { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) }, + { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) }, + { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) }, +/* 25 */ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) }, { 0 } /* Terminating entry */ }; MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); @@ -891,6 +917,10 @@ { "AVerMedia AVerTV DVB-T Express", { &dib0700_usb_id_table[20] }, { NULL }, + }, + { "Gigabyte U7000", + { &dib0700_usb_id_table[21], NULL }, + { NULL }, } }, @@ -974,6 +1004,25 @@ .num_adapters = 1, .adapter = { { + .frontend_attach = stk7700P2_frontend_attach, + .tuner_attach = stk7700d_tuner_attach, + + DIB0700_DEFAULT_STREAMING_CONFIG(0x02), + }, + }, + + .num_device_descs = 1, + .devices = { + { "ASUS My Cinema U3000 Mini DVBT Tuner", + { &dib0700_usb_id_table[23], NULL }, + { NULL }, + }, + } + }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, + + .num_adapters = 1, + .adapter = { + { .frontend_attach = stk7070p_frontend_attach, .tuner_attach = dib7070p_tuner_attach, @@ -983,7 +1032,7 @@ }, }, - .num_device_descs = 2, + .num_device_descs = 5, .devices = { { "DiBcom STK7070P reference design", { &dib0700_usb_id_table[15], NULL }, @@ -993,7 +1042,25 @@ { &dib0700_usb_id_table[16], NULL }, { NULL }, }, - } + { "Artec T14BR DVB-T", + { &dib0700_usb_id_table[22], NULL }, + { NULL }, + }, + { "ASUS My Cinema U3100 Mini DVBT Tuner", + { &dib0700_usb_id_table[24], NULL }, + { NULL }, + }, + { "Hauppauge Nova-T Stick", + { &dib0700_usb_id_table[25], NULL }, + { NULL }, + }, + }, + + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = dib0700_rc_keys, + .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_query = dib0700_rc_query + }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 2, --- linux-2.6.24.orig/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ linux-2.6.24/drivers/media/dvb/dvb-usb/dvb-usb-ids.h @@ -16,6 +16,7 @@ #define USB_VID_ALINK 0x05e3 #define USB_VID_ANCHOR 0x0547 #define USB_VID_ANUBIS_ELECTRONIC 0x10fd +#define USB_VID_ASUS 0x0b05 #define USB_VID_AVERMEDIA 0x07ca #define USB_VID_COMPRO 0x185b #define USB_VID_COMPRO_UNK 0x145f @@ -44,6 +45,7 @@ #define USB_VID_ULTIMA_ELECTRONIC 0x05d8 #define USB_VID_UNIWILL 0x1584 #define USB_VID_WIDEVIEW 0x14aa +#define USB_VID_GIGABYTE 0x1044 /* Product IDs */ #define USB_PID_ADSTECH_USB2_COLD 0xa333 @@ -99,6 +101,7 @@ #define USB_PID_ULTIMA_TVBOX_USB2_WARM 0x810a #define USB_PID_ARTEC_T14_COLD 0x810b #define USB_PID_ARTEC_T14_WARM 0x810c +#define USB_PID_ARTEC_T14BR 0x810f #define USB_PID_ULTIMA_TVBOX_USB2_FX_COLD 0x8613 #define USB_PID_ULTIMA_TVBOX_USB2_FX_WARM 0x1002 #define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e @@ -120,6 +123,7 @@ #define USB_PID_HAUPPAUGE_NOVA_T_500_2 0x9950 #define USB_PID_HAUPPAUGE_NOVA_T_STICK 0x7050 #define USB_PID_HAUPPAUGE_NOVA_T_STICK_2 0x7060 +#define USB_PID_HAUPPAUGE_NOVA_T_STICK_3 0x7070 #define USB_PID_HAUPPAUGE_NOVA_TD_STICK 0x9580 #define USB_PID_AVERMEDIA_EXPRESS 0xb568 #define USB_PID_AVERMEDIA_VOLAR 0xa807 @@ -170,6 +174,9 @@ #define USB_PID_OPERA1_WARM 0x3829 #define USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD 0x0514 #define USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM 0x0513 - +/* dom pour gigabyte u7000 */ +#define USB_PID_GIGABYTE_U7000 0x7001 +#define USB_PID_ASUS_U3000 0x171f +#define USB_PID_ASUS_U3100 0x173f #endif --- linux-2.6.24.orig/drivers/media/dvb/dvb-usb/ttusb2.c +++ linux-2.6.24/drivers/media/dvb/dvb-usb/ttusb2.c @@ -144,6 +144,7 @@ static struct tda10086_config tda10086_config = { .demod_address = 0x0e, .invert = 0, + .diseqc_tone = 1, }; static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap) --- linux-2.6.24.orig/drivers/media/dvb/dvb-usb/umt-010.c +++ linux-2.6.24/drivers/media/dvb/dvb-usb/umt-010.c @@ -104,7 +104,7 @@ /* parameter for the MPEG2-data transfer */ .stream = { .type = USB_BULK, - .count = 20, + .count = MAX_NO_URBS_FOR_DATA_STREAM, .endpoint = 0x06, .u = { .bulk = { --- linux-2.6.24.orig/drivers/media/dvb/frontends/tda10086.h +++ linux-2.6.24/drivers/media/dvb/frontends/tda10086.h @@ -33,6 +33,9 @@ /* does the "inversion" need inverted? */ u8 invert; + + /* do we need the diseqc signal with carrier? */ + u8 diseqc_tone; }; #if defined(CONFIG_DVB_TDA10086) || (defined(CONFIG_DVB_TDA10086_MODULE) && defined(MODULE)) --- linux-2.6.24.orig/drivers/media/dvb/frontends/tda10086.c +++ linux-2.6.24/drivers/media/dvb/frontends/tda10086.c @@ -106,9 +106,12 @@ static int tda10086_init(struct dvb_frontend* fe) { struct tda10086_state* state = fe->demodulator_priv; + u8 t22k_off = 0x80; dprintk ("%s\n", __FUNCTION__); + if (state->config->diseqc_tone) + t22k_off = 0; // reset tda10086_write_byte(state, 0x00, 0x00); msleep(10); @@ -158,7 +161,7 @@ tda10086_write_byte(state, 0x3d, 0x80); // setup SEC - tda10086_write_byte(state, 0x36, 0x80); // all SEC off, no 22k tone + tda10086_write_byte(state, 0x36, t22k_off); // all SEC off, 22k tone tda10086_write_byte(state, 0x34, (((1<<19) * (22000/1000)) / (SACLK/1000))); // } tone frequency tda10086_write_byte(state, 0x35, (((1<<19) * (22000/1000)) / (SACLK/1000)) >> 8); // } @@ -180,16 +183,20 @@ static int tda10086_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) { struct tda10086_state* state = fe->demodulator_priv; + u8 t22k_off = 0x80; dprintk ("%s\n", __FUNCTION__); + if (state->config->diseqc_tone) + t22k_off = 0; + switch (tone) { case SEC_TONE_OFF: - tda10086_write_byte(state, 0x36, 0x80); + tda10086_write_byte(state, 0x36, t22k_off); break; case SEC_TONE_ON: - tda10086_write_byte(state, 0x36, 0x81); + tda10086_write_byte(state, 0x36, 0x01 + t22k_off); break; } @@ -202,9 +209,13 @@ struct tda10086_state* state = fe->demodulator_priv; int i; u8 oldval; + u8 t22k_off = 0x80; dprintk ("%s\n", __FUNCTION__); + if (state->config->diseqc_tone) + t22k_off = 0; + if (cmd->msg_len > 6) return -EINVAL; oldval = tda10086_read_byte(state, 0x36); @@ -212,7 +223,8 @@ for(i=0; i< cmd->msg_len; i++) { tda10086_write_byte(state, 0x48+i, cmd->msg[i]); } - tda10086_write_byte(state, 0x36, 0x88 | ((cmd->msg_len - 1) << 4)); + tda10086_write_byte(state, 0x36, (0x08 + t22k_off) + | ((cmd->msg_len - 1) << 4)); tda10086_diseqc_wait(state); @@ -225,16 +237,20 @@ { struct tda10086_state* state = fe->demodulator_priv; u8 oldval = tda10086_read_byte(state, 0x36); + u8 t22k_off = 0x80; dprintk ("%s\n", __FUNCTION__); + if (state->config->diseqc_tone) + t22k_off = 0; + switch(minicmd) { case SEC_MINI_A: - tda10086_write_byte(state, 0x36, 0x84); + tda10086_write_byte(state, 0x36, 0x04 + t22k_off); break; case SEC_MINI_B: - tda10086_write_byte(state, 0x36, 0x86); + tda10086_write_byte(state, 0x36, 0x06 + t22k_off); break; } --- linux-2.6.24.orig/drivers/spi/pxa2xx_spi.c +++ linux-2.6.24/drivers/spi/pxa2xx_spi.c @@ -48,13 +48,19 @@ #define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK) #define IS_DMA_ALIGNED(x) (((u32)(x)&0x07)==0) -/* for testing SSCR1 changes that require SSP restart, basically - * everything except the service and interrupt enables */ -#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_EBCEI | SSCR1_SCFR \ +/* + * for testing SSCR1 changes that require SSP restart, basically + * everything except the service and interrupt enables, the pxa270 developer + * manual says only SSCR1_SCFR, SSCR1_SPH, SSCR1_SPO need to be in this + * list, but the PXA255 dev man says all bits without really meaning the + * service and interrupt enables + */ +#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_SCFR \ | SSCR1_ECRA | SSCR1_ECRB | SSCR1_SCLKDIR \ - | SSCR1_RWOT | SSCR1_TRAIL | SSCR1_PINTE \ - | SSCR1_STRF | SSCR1_EFWR |SSCR1_RFT \ - | SSCR1_TFT | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM) + | SSCR1_SFRMDIR | SSCR1_RWOT | SSCR1_TRAIL \ + | SSCR1_IFS | SSCR1_STRF | SSCR1_EFWR \ + | SSCR1_RFT | SSCR1_TFT | SSCR1_MWDS \ + | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM) #define DEFINE_SSP_REG(reg, off) \ static inline u32 read_##reg(void *p) { return __raw_readl(p + (off)); } \ @@ -961,9 +967,6 @@ if (drv_data->ssp_type == PXA25x_SSP) DCMD(drv_data->tx_channel) |= DCMD_ENDIRQEN; - /* Fix me, need to handle cs polarity */ - drv_data->cs_control(PXA2XX_CS_ASSERT); - /* Clear status and start DMA engine */ cr1 = chip->cr1 | dma_thresh | drv_data->dma_cr1; write_SSSR(drv_data->clear_sr, reg); @@ -973,9 +976,6 @@ /* Ensure we have the correct interrupt handler */ drv_data->transfer_handler = interrupt_transfer; - /* Fix me, need to handle cs polarity */ - drv_data->cs_control(PXA2XX_CS_ASSERT); - /* Clear status */ cr1 = chip->cr1 | chip->threshold | drv_data->int_cr1; write_SSSR(drv_data->clear_sr, reg); @@ -986,16 +986,29 @@ || (read_SSCR1(reg) & SSCR1_CHANGE_MASK) != (cr1 & SSCR1_CHANGE_MASK)) { + /* stop the SSP, and update the other bits */ write_SSCR0(cr0 & ~SSCR0_SSE, reg); if (drv_data->ssp_type != PXA25x_SSP) write_SSTO(chip->timeout, reg); - write_SSCR1(cr1, reg); + /* first set CR1 without interrupt and service enables */ + write_SSCR1(cr1 & SSCR1_CHANGE_MASK, reg); + /* restart the SSP */ write_SSCR0(cr0, reg); + } else { if (drv_data->ssp_type != PXA25x_SSP) write_SSTO(chip->timeout, reg); - write_SSCR1(cr1, reg); } + + /* FIXME, need to handle cs polarity, + * this driver uses struct pxa2xx_spi_chip.cs_control to + * specify a CS handling function, and it ignores most + * struct spi_device.mode[s], including SPI_CS_HIGH */ + drv_data->cs_control(PXA2XX_CS_ASSERT); + + /* after chip select, release the data by enabling service + * requests and interrupts, without changing any mode bits */ + write_SSCR1(cr1, reg); } static void pump_messages(struct work_struct *work) --- linux-2.6.24.orig/drivers/spi/atmel_spi.c +++ linux-2.6.24/drivers/spi/atmel_spi.c @@ -85,6 +85,16 @@ unsigned gpio = (unsigned) spi->controller_data; unsigned active = spi->mode & SPI_CS_HIGH; u32 mr; + int i; + u32 csr; + u32 cpol = (spi->mode & SPI_CPOL) ? SPI_BIT(CPOL) : 0; + + /* Make sure clock polarity is correct */ + for (i = 0; i < spi->master->num_chipselect; i++) { + csr = spi_readl(as, CSR0 + 4 * i); + if ((csr ^ cpol) & SPI_BIT(CPOL)) + spi_writel(as, CSR0 + 4 * i, csr ^ SPI_BIT(CPOL)); + } mr = spi_readl(as, MR); mr = SPI_BFINS(PCS, ~(1 << spi->chip_select), mr); --- linux-2.6.24.orig/drivers/base/platform.c +++ linux-2.6.24/drivers/base/platform.c @@ -647,7 +647,7 @@ high_totalram += high_totalram - 1; mask = (((u64)high_totalram) << 32) + 0xffffffff; } - return mask & *dev->dma_mask; + return mask; } EXPORT_SYMBOL_GPL(dma_get_required_mask); #endif --- linux-2.6.24.orig/drivers/acorn/char/defkeymap-l7200.c +++ linux-2.6.24/drivers/acorn/char/defkeymap-l7200.c @@ -347,40 +347,40 @@ }; struct kbdiacruc accent_table[MAX_DIACR] = { - {'`', 'A', '\300'}, {'`', 'a', '\340'}, - {'\'', 'A', '\301'}, {'\'', 'a', '\341'}, - {'^', 'A', '\302'}, {'^', 'a', '\342'}, - {'~', 'A', '\303'}, {'~', 'a', '\343'}, - {'"', 'A', '\304'}, {'"', 'a', '\344'}, - {'O', 'A', '\305'}, {'o', 'a', '\345'}, - {'0', 'A', '\305'}, {'0', 'a', '\345'}, - {'A', 'A', '\305'}, {'a', 'a', '\345'}, - {'A', 'E', '\306'}, {'a', 'e', '\346'}, - {',', 'C', '\307'}, {',', 'c', '\347'}, - {'`', 'E', '\310'}, {'`', 'e', '\350'}, - {'\'', 'E', '\311'}, {'\'', 'e', '\351'}, - {'^', 'E', '\312'}, {'^', 'e', '\352'}, - {'"', 'E', '\313'}, {'"', 'e', '\353'}, - {'`', 'I', '\314'}, {'`', 'i', '\354'}, - {'\'', 'I', '\315'}, {'\'', 'i', '\355'}, - {'^', 'I', '\316'}, {'^', 'i', '\356'}, - {'"', 'I', '\317'}, {'"', 'i', '\357'}, - {'-', 'D', '\320'}, {'-', 'd', '\360'}, - {'~', 'N', '\321'}, {'~', 'n', '\361'}, - {'`', 'O', '\322'}, {'`', 'o', '\362'}, - {'\'', 'O', '\323'}, {'\'', 'o', '\363'}, - {'^', 'O', '\324'}, {'^', 'o', '\364'}, - {'~', 'O', '\325'}, {'~', 'o', '\365'}, - {'"', 'O', '\326'}, {'"', 'o', '\366'}, - {'/', 'O', '\330'}, {'/', 'o', '\370'}, - {'`', 'U', '\331'}, {'`', 'u', '\371'}, - {'\'', 'U', '\332'}, {'\'', 'u', '\372'}, - {'^', 'U', '\333'}, {'^', 'u', '\373'}, - {'"', 'U', '\334'}, {'"', 'u', '\374'}, - {'\'', 'Y', '\335'}, {'\'', 'y', '\375'}, - {'T', 'H', '\336'}, {'t', 'h', '\376'}, - {'s', 's', '\337'}, {'"', 'y', '\377'}, - {'s', 'z', '\337'}, {'i', 'j', '\377'}, + {'`', 'A', 0300}, {'`', 'a', 0340}, + {'\'', 'A', 0301}, {'\'', 'a', 0341}, + {'^', 'A', 0302}, {'^', 'a', 0342}, + {'~', 'A', 0303}, {'~', 'a', 0343}, + {'"', 'A', 0304}, {'"', 'a', 0344}, + {'O', 'A', 0305}, {'o', 'a', 0345}, + {'0', 'A', 0305}, {'0', 'a', 0345}, + {'A', 'A', 0305}, {'a', 'a', 0345}, + {'A', 'E', 0306}, {'a', 'e', 0346}, + {',', 'C', 0307}, {',', 'c', 0347}, + {'`', 'E', 0310}, {'`', 'e', 0350}, + {'\'', 'E', 0311}, {'\'', 'e', 0351}, + {'^', 'E', 0312}, {'^', 'e', 0352}, + {'"', 'E', 0313}, {'"', 'e', 0353}, + {'`', 'I', 0314}, {'`', 'i', 0354}, + {'\'', 'I', 0315}, {'\'', 'i', 0355}, + {'^', 'I', 0316}, {'^', 'i', 0356}, + {'"', 'I', 0317}, {'"', 'i', 0357}, + {'-', 'D', 0320}, {'-', 'd', 0360}, + {'~', 'N', 0321}, {'~', 'n', 0361}, + {'`', 'O', 0322}, {'`', 'o', 0362}, + {'\'', 'O', 0323}, {'\'', 'o', 0363}, + {'^', 'O', 0324}, {'^', 'o', 0364}, + {'~', 'O', 0325}, {'~', 'o', 0365}, + {'"', 'O', 0326}, {'"', 'o', 0366}, + {'/', 'O', 0330}, {'/', 'o', 0370}, + {'`', 'U', 0331}, {'`', 'u', 0371}, + {'\'', 'U', 0332}, {'\'', 'u', 0372}, + {'^', 'U', 0333}, {'^', 'u', 0373}, + {'"', 'U', 0334}, {'"', 'u', 0374}, + {'\'', 'Y', 0335}, {'\'', 'y', 0375}, + {'T', 'H', 0336}, {'t', 'h', 0376}, + {'s', 's', 0337}, {'"', 'y', 0377}, + {'s', 'z', 0337}, {'i', 'j', 0377}, }; unsigned int accent_table_size = 68; --- linux-2.6.24.orig/drivers/isdn/hisax/hfc_usb.c +++ linux-2.6.24/drivers/isdn/hisax/hfc_usb.c @@ -818,8 +818,8 @@ } /* we have a complete hdlc packet */ if (finish) { - if ((!fifo->skbuff->data[fifo->skbuff->len - 1]) - && (fifo->skbuff->len > 3)) { + if (fifo->skbuff->len > 3 && + !fifo->skbuff->data[fifo->skbuff->len - 1]) { if (fifon == HFCUSB_D_RX) { DBG(HFCUSB_DBG_DCHANNEL, --- linux-2.6.24.orig/drivers/isdn/capi/capidrv.c +++ linux-2.6.24/drivers/isdn/capi/capidrv.c @@ -2332,13 +2332,14 @@ static void __exit capidrv_exit(void) { - char rev[10]; + char rev[32]; char *p; if ((p = strchr(revision, ':')) != 0) { - strcpy(rev, p + 1); - p = strchr(rev, '$'); - *p = 0; + strncpy(rev, p + 1, sizeof(rev)); + rev[sizeof(rev)-1] = 0; + if ((p = strchr(rev, '$')) != 0) + *p = 0; } else { strcpy(rev, " ??? "); } --- linux-2.6.24.orig/drivers/isdn/i4l/isdn_net.c +++ linux-2.6.24/drivers/isdn/i4l/isdn_net.c @@ -2010,6 +2010,7 @@ ndev->flags = IFF_NOARP|IFF_POINTOPOINT; ndev->type = ARPHRD_ETHER; ndev->addr_len = ETH_ALEN; + ndev->validate_addr = NULL; /* for clients with MPPP maybe higher values better */ ndev->tx_queue_len = 30; --- linux-2.6.24.orig/drivers/md/raid5.c +++ linux-2.6.24/drivers/md/raid5.c @@ -2348,25 +2348,15 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh, struct stripe_head_state *s, int disks) { + int canceled_check = 0; + set_bit(STRIPE_HANDLE, &sh->state); - /* Take one of the following actions: - * 1/ start a check parity operation if (uptodate == disks) - * 2/ finish a check parity operation and act on the result - * 3/ skip to the writeback section if we previously - * initiated a recovery operation - */ - if (s->failed == 0 && - !test_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending)) { - if (!test_and_set_bit(STRIPE_OP_CHECK, &sh->ops.pending)) { - BUG_ON(s->uptodate != disks); - clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags); - sh->ops.count++; - s->uptodate--; - } else if ( - test_and_clear_bit(STRIPE_OP_CHECK, &sh->ops.complete)) { - clear_bit(STRIPE_OP_CHECK, &sh->ops.ack); - clear_bit(STRIPE_OP_CHECK, &sh->ops.pending); + /* complete a check operation */ + if (test_and_clear_bit(STRIPE_OP_CHECK, &sh->ops.complete)) { + clear_bit(STRIPE_OP_CHECK, &sh->ops.ack); + clear_bit(STRIPE_OP_CHECK, &sh->ops.pending); + if (s->failed == 0) { if (sh->ops.zero_sum_result == 0) /* parity is correct (on disc, * not in buffer any more) @@ -2391,7 +2381,8 @@ s->uptodate++; } } - } + } else + canceled_check = 1; /* STRIPE_INSYNC is not set */ } /* check if we can clear a parity disk reconstruct */ @@ -2404,12 +2395,28 @@ clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending); } - /* Wait for check parity and compute block operations to complete - * before write-back + /* start a new check operation if there are no failures, the stripe is + * not insync, and a repair is not in flight */ - if (!test_bit(STRIPE_INSYNC, &sh->state) && - !test_bit(STRIPE_OP_CHECK, &sh->ops.pending) && - !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending)) { + if (s->failed == 0 && + !test_bit(STRIPE_INSYNC, &sh->state) && + !test_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending)) { + if (!test_and_set_bit(STRIPE_OP_CHECK, &sh->ops.pending)) { + BUG_ON(s->uptodate != disks); + clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags); + sh->ops.count++; + s->uptodate--; + } + } + + /* Wait for check parity and compute block operations to complete + * before write-back. If a failure occurred while the check operation + * was in flight we need to cycle this stripe through handle_stripe + * since the parity block may not be uptodate + */ + if (!canceled_check && !test_bit(STRIPE_INSYNC, &sh->state) && + !test_bit(STRIPE_OP_CHECK, &sh->ops.pending) && + !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending)) { struct r5dev *dev; /* either failed parity check, or recovery is happening */ if (s->failed == 0) @@ -3159,7 +3166,8 @@ atomic_inc(&conf->preread_active_stripes); list_add_tail(&sh->lru, &conf->handle_list); } - } + } else + blk_plug_device(conf->mddev->queue); } static void activate_bit_delay(raid5_conf_t *conf) @@ -3549,7 +3557,8 @@ goto retry; } finish_wait(&conf->wait_for_overlap, &w); - handle_stripe(sh, NULL); + set_bit(STRIPE_HANDLE, &sh->state); + clear_bit(STRIPE_DELAYED, &sh->state); release_stripe(sh); } else { /* cannot get stripe for read-ahead, just give-up */ @@ -3864,7 +3873,7 @@ * During the scan, completed stripes are saved for us by the interrupt * handler, so that they will not have to wait for our next wakeup. */ -static void raid5d (mddev_t *mddev) +static void raid5d(mddev_t *mddev) { struct stripe_head *sh; raid5_conf_t *conf = mddev_to_conf(mddev); @@ -3889,12 +3898,6 @@ activate_bit_delay(conf); } - if (list_empty(&conf->handle_list) && - atomic_read(&conf->preread_active_stripes) < IO_THRESHOLD && - !blk_queue_plugged(mddev->queue) && - !list_empty(&conf->delayed_list)) - raid5_activate_delayed(conf); - while ((bio = remove_bio_from_retry(conf))) { int ok; spin_unlock_irq(&conf->device_lock); --- linux-2.6.24.orig/drivers/md/dm.c +++ linux-2.6.24/drivers/md/dm.c @@ -1566,6 +1566,7 @@ { return md->disk; } +EXPORT_SYMBOL_GPL(dm_disk); int dm_suspended(struct mapped_device *md) { --- linux-2.6.24.orig/drivers/md/md.c +++ linux-2.6.24/drivers/md/md.c @@ -1847,17 +1847,6 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store); static ssize_t -super_show(mdk_rdev_t *rdev, char *page) -{ - if (rdev->sb_loaded && rdev->sb_size) { - memcpy(page, page_address(rdev->sb_page), rdev->sb_size); - return rdev->sb_size; - } else - return 0; -} -static struct rdev_sysfs_entry rdev_super = __ATTR_RO(super); - -static ssize_t errors_show(mdk_rdev_t *rdev, char *page) { return sprintf(page, "%d\n", atomic_read(&rdev->corrected_errors)); @@ -1959,7 +1948,6 @@ static struct attribute *rdev_default_attrs[] = { &rdev_state.attr, - &rdev_super.attr, &rdev_errors.attr, &rdev_slot.attr, &rdev_offset.attr, @@ -2881,7 +2869,8 @@ char *e; unsigned long long new = simple_strtoull(buf, &e, 10); - if (mddev->pers->quiesce == NULL) + if (mddev->pers == NULL || + mddev->pers->quiesce == NULL) return -EINVAL; if (buf == e || (*e && *e != '\n')) return -EINVAL; @@ -2909,7 +2898,8 @@ char *e; unsigned long long new = simple_strtoull(buf, &e, 10); - if (mddev->pers->quiesce == NULL) + if (mddev->pers == NULL || + mddev->pers->quiesce == NULL) return -EINVAL; if (buf == e || (*e && *e != '\n')) return -EINVAL; --- linux-2.6.24.orig/drivers/ssb/main.c +++ linux-2.6.24/drivers/ssb/main.c @@ -879,6 +879,11 @@ return SSB_TMSLOW_REJECT_22; case SSB_IDLOW_SSBREV_23: return SSB_TMSLOW_REJECT_23; + case SSB_IDLOW_SSBREV_24: /* TODO - find the proper REJECT bits */ + case SSB_IDLOW_SSBREV_25: /* same here */ + case SSB_IDLOW_SSBREV_26: /* same here */ + case SSB_IDLOW_SSBREV_27: /* same here */ + return SSB_TMSLOW_REJECT_23; /* this is a guess */ default: WARN_ON(1); } @@ -1032,6 +1037,12 @@ goto out; cc = &bus->chipco; + + if (!cc->dev) + goto out; + if (cc->dev->id.revision < 5) + goto out; + ssb_chipco_set_clockmode(cc, SSB_CLKMODE_SLOW); err = ssb_pci_xtal(bus, SSB_GPIO_XTAL | SSB_GPIO_PLL, 0); if (err) --- linux-2.6.24.orig/drivers/ssb/pci.c +++ linux-2.6.24/drivers/ssb/pci.c @@ -426,6 +426,7 @@ SPEX(crc, SSB_SPROM_REVISION, SSB_SPROM_REVISION_CRC, SSB_SPROM_REVISION_CRC_SHIFT); + if ((bus->chip_id & 0xFF00) == 0x4400) { /* Workaround: The BCM44XX chip has a stupid revision * number stored in the SPROM. @@ -443,6 +444,10 @@ if (out->revision >= 4) goto unsupported; } + if (out->r1.boardflags_lo == 0xFFFF) + out->r1.boardflags_lo = 0; /* per specs */ + if (out->r2.boardflags_hi == 0xFFFF) + out->r2.boardflags_hi = 0; /* per specs */ return 0; unsupported: --- linux-2.6.24.orig/drivers/ssb/driver_pcicore.c +++ linux-2.6.24/drivers/ssb/driver_pcicore.c @@ -517,7 +517,7 @@ } else { tmp = ssb_read32(dev, SSB_TPSFLAG); tmp &= SSB_TPSFLAG_BPFLAG; - intvec |= tmp; + intvec |= (1 << tmp); } ssb_write32(pdev, SSB_INTVEC, intvec); } --- linux-2.6.24.orig/drivers/input/keyboard/atkbd.c +++ linux-2.6.24/drivers/input/keyboard/atkbd.c @@ -809,6 +809,8 @@ static void atkbd_cleanup(struct serio *serio) { struct atkbd *atkbd = serio_get_drvdata(serio); + + atkbd_disable(atkbd); ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_BAT); } --- linux-2.6.24.orig/drivers/input/joystick/xpad.c +++ linux-2.6.24/drivers/input/joystick/xpad.c @@ -136,6 +136,7 @@ { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX }, { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX }, { 0x12ab, 0x8809, "Xbox DDR dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, + { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer", MAP_DPAD_TO_AXES, XTYPE_XBOX360 }, { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, { 0x045e, 0x028e, "Microsoft X-Box 360 pad", MAP_DPAD_TO_AXES, XTYPE_XBOX360 }, { 0xffff, 0xffff, "Chinese-made Xbox Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX }, @@ -180,6 +181,7 @@ static struct usb_device_id xpad_table [] = { { USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */ { USB_DEVICE_INTERFACE_PROTOCOL(0x045e, 0x028e, 1) }, /* X-Box 360 controller */ + { USB_DEVICE_INTERFACE_PROTOCOL(0x1430, 0x4748, 1) }, /* RedOctane Guitar Hero X-plorer */ { } }; --- linux-2.6.24.orig/drivers/input/serio/i8042-x86ia64io.h +++ linux-2.6.24/drivers/input/serio/i8042-x86ia64io.h @@ -270,6 +270,13 @@ DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"), }, }, + { + .ident = "IBM 2656", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "IBM"), + DMI_MATCH(DMI_PRODUCT_NAME, "2656"), + }, + }, { } }; --- linux-2.6.24.orig/drivers/input/mouse/appletouch.c +++ linux-2.6.24/drivers/input/mouse/appletouch.c @@ -62,6 +62,11 @@ #define GEYSER4_ISO_PRODUCT_ID 0x021B #define GEYSER4_JIS_PRODUCT_ID 0x021C +/* Updated codes for MacBook3,1 support */ +#define GEYSER4_HF_ANSI_PRODUCT_ID 0x0229 +#define GEYSER4_HF_ISO_PRODUCT_ID 0x022A +#define GEYSER4_HF_JIS_PRODUCT_ID 0x021B + #define ATP_DEVICE(prod) \ .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ USB_DEVICE_ID_MATCH_INT_CLASS | \ @@ -93,6 +98,11 @@ { ATP_DEVICE(GEYSER4_ISO_PRODUCT_ID) }, { ATP_DEVICE(GEYSER4_JIS_PRODUCT_ID) }, + /* Core2 Duo MacBook3,1 */ + { ATP_DEVICE(GEYSER4_HF_ANSI_PRODUCT_ID) }, + { ATP_DEVICE(GEYSER4_HF_ISO_PRODUCT_ID) }, + { ATP_DEVICE(GEYSER4_HF_JIS_PRODUCT_ID) }, + /* Terminating entry */ { } }; @@ -217,7 +227,10 @@ (productId == GEYSER3_JIS_PRODUCT_ID) || (productId == GEYSER4_ANSI_PRODUCT_ID) || (productId == GEYSER4_ISO_PRODUCT_ID) || - (productId == GEYSER4_JIS_PRODUCT_ID); + (productId == GEYSER4_JIS_PRODUCT_ID) || + (productId == GEYSER4_HF_ANSI_PRODUCT_ID) || + (productId == GEYSER4_HF_ISO_PRODUCT_ID) || + (productId == GEYSER4_HF_JIS_PRODUCT_ID); } /* --- linux-2.6.24.orig/drivers/input/mouse/alps.c +++ linux-2.6.24/drivers/input/mouse/alps.c @@ -37,6 +37,7 @@ #define ALPS_FW_BK_2 0x40 static const struct alps_model_info alps_model_data[] = { + { { 0x32, 0x02, 0x14 }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* Toshiba Salellite Pro M10 */ { { 0x33, 0x02, 0x0a }, 0x88, 0xf8, ALPS_OLDPROTO }, /* UMAX-530T */ { { 0x53, 0x02, 0x0a }, 0xf8, 0xf8, 0 }, { { 0x53, 0x02, 0x14 }, 0xf8, 0xf8, 0 }, @@ -54,6 +55,7 @@ { { 0x20, 0x02, 0x0e }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */ { { 0x22, 0x02, 0x0a }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, { { 0x22, 0x02, 0x14 }, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */ + { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude E6500 */ { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FW_BK_1 } /* Dell Vostro 1400 */ }; @@ -421,7 +423,8 @@ static int alps_reconnect(struct psmouse *psmouse) { - psmouse_reset(psmouse); + /* UBUNTU: Causes lockups on resume */ + /* psmouse_reset(psmouse); */ if (alps_hw_init(psmouse, NULL)) return -1; --- linux-2.6.24.orig/drivers/w1/w1_netlink.c +++ linux-2.6.24/drivers/w1/w1_netlink.c @@ -128,9 +128,8 @@ return err; } -static void w1_cn_callback(void *data) +static void w1_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) { - struct cn_msg *msg = data; struct w1_netlink_msg *m = (struct w1_netlink_msg *)(msg + 1); struct w1_netlink_cmd *cmd; struct w1_slave *sl; --- linux-2.6.24.orig/drivers/mmc/Kconfig +++ linux-2.6.24/drivers/mmc/Kconfig @@ -2,6 +2,8 @@ # MMC subsystem configuration # +menu "MMC/SD/SDIO support, can only select one arch from MMC and MSS" + menuconfig MMC tristate "MMC/SD card support" depends on HAS_IOMEM @@ -17,7 +19,6 @@ help This is an option for use by developers; most people should say N here. This enables MMC core and driver debugging. - if MMC source "drivers/mmc/core/Kconfig" @@ -27,3 +28,22 @@ source "drivers/mmc/host/Kconfig" endif # MMC + +config MSS + tristate "MSS architecture MMC/SD/SDIO Interface support" + help + MSS is an advanced version of the MMC protocol drivers + which abstracts the control layer to encompass multiple + media card formats. Simply define the protocols you + wish to use (one is MMC for instance, another is SD). + + If you want MSS support, you should say M here and also + to the specific drivers for your MSS interface. + +if MSS + +source "drivers/mmc/mss/Kconfig" + +endif + +endmenu --- linux-2.6.24.orig/drivers/mmc/Makefile +++ linux-2.6.24/drivers/mmc/Makefile @@ -9,4 +9,5 @@ obj-$(CONFIG_MMC) += core/ obj-$(CONFIG_MMC) += card/ obj-$(CONFIG_MMC) += host/ +obj-$(CONFIG_MSS) += mss/ --- linux-2.6.24.orig/drivers/mmc/card/block.c +++ linux-2.6.24/drivers/mmc/card/block.c @@ -46,7 +46,7 @@ #define MMC_SHIFT 3 #define MMC_NUM_MINORS (256 >> MMC_SHIFT) -static unsigned long dev_use[MMC_NUM_MINORS/(8*sizeof(unsigned long))]; +static DECLARE_BITMAP(dev_use,MMC_NUM_MINORS); /* * There is one mmc_blk_data per slot. --- linux-2.6.24.orig/drivers/mmc/mss/Kconfig +++ linux-2.6.24/drivers/mmc/mss/Kconfig @@ -0,0 +1,28 @@ +# +# MMC subsystem configuration +# + +comment "MSS structure support" + + +config MSS_BLOCK + tristate "MSS block device driver" + depends on MSS && BLOCK + default y + help + Say Y here to enable the MMC block device driver support. + This provides a block device driver, which you can use to + mount the filesystem. Almost everyone wishing MMC support + should say Y or M here. + +config MSS_SDHCI + tristate "MSS host controller driver" + depends on PCI && MSS + help + This select the generic Secure Digital Host Controller Interface. + It is used by manufacturers such as Texas Instruments(R), Ricoh(R) + and Toshiba(R). Most controllers found in laptops are of this type. + If you have a controller with this interface, say Y or M here. + + If unsure, say N. + --- linux-2.6.24.orig/drivers/mmc/mss/mmc_protocol.c +++ linux-2.6.24/drivers/mmc/mss/mmc_protocol.c @@ -0,0 +1,1049 @@ +/* + * mmc_protocol.c - MMC protocol driver + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from previous mmc code in Linux kernel + * Copyright (c) 2002 Hewlett-Packard Company + * Copyright (c) 2002 Andrew Christian + * Copyright (c) 2006 Bridge Wu + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* internal functions */ + +#define KBPS 1 +#define MBPS 1000 + +static u32 ts_exp[] = { 100*KBPS, 1*MBPS, 10*MBPS, 100*MBPS, 0, 0, 0, 0 }; +static u32 ts_mul[] = { 0, 1000, 1200, 1300, 1500, 2000, 2500, 3000, + 3500, 4000, 4500, 5000, 5500, 6000, 7000, 8000 }; + +static u32 mmc_tran_speed(u8 ts) +{ + u32 clock = ts_exp[(ts & 0x7)] * ts_mul[(ts & 0x78) >> 3]; + + return clock; +} + +static int mmc_unpack_r1(struct mss_cmd *cmd, struct mmc_response_r1 *r1, struct mmc_card *mmc_card) +{ + u8 *buf = cmd->response; + + mmc_card->errno = MMC_ERROR_NONE; + r1->cmd = unstuff_bits(buf, 40, 8, 6); + r1->status = unstuff_bits(buf, 8, 32, 6); + + if (R1_STATUS(r1->status)) { + if (r1->status & R1_OUT_OF_RANGE) + mmc_card->errno = MMC_ERROR_OUT_OF_RANGE; + if (r1->status & R1_ADDRESS_ERROR) + mmc_card->errno = MMC_ERROR_ADDRESS; + if (r1->status & R1_BLOCK_LEN_ERROR) + mmc_card->errno = MMC_ERROR_BLOCK_LEN; + if (r1->status & R1_ERASE_SEQ_ERROR) + mmc_card->errno = MMC_ERROR_ERASE_SEQ; + if (r1->status & R1_ERASE_PARAM) + mmc_card->errno = MMC_ERROR_ERASE_PARAM; + if (r1->status & R1_WP_VIOLATION) + mmc_card->errno = MMC_ERROR_WP_VIOLATION; + if (r1->status & R1_LOCK_UNLOCK_FAILED) + mmc_card->errno = MMC_ERROR_LOCK_UNLOCK_FAILED; + if (r1->status & R1_COM_CRC_ERROR) + mmc_card->errno = MMC_ERROR_COM_CRC; + if (r1->status & R1_ILLEGAL_COMMAND) + mmc_card->errno = MMC_ERROR_ILLEGAL_COMMAND; + if (r1->status & R1_CARD_ECC_FAILED) + mmc_card->errno = MMC_ERROR_CARD_ECC_FAILED; + if (r1->status & R1_CC_ERROR) + mmc_card->errno = MMC_ERROR_CC; + if (r1->status & R1_ERROR) + mmc_card->errno = MMC_ERROR_GENERAL; + if (r1->status & R1_UNDERRUN) + mmc_card->errno = MMC_ERROR_UNDERRUN; + if (r1->status & R1_OVERRUN) + mmc_card->errno = MMC_ERROR_OVERRUN; + if (r1->status & R1_CID_CSD_OVERWRITE) + mmc_card->errno = MMC_ERROR_CID_CSD_OVERWRITE; + } + + if (buf[0] != cmd->opcode) + mmc_card->errno = MMC_ERROR_HEADER_MISMATCH; + /* This should be last - it's the least dangerous error */ + if (R1_CURRENT_STATE(r1->status) != mmc_card->state ) { + dbg5("state dismatch:r1->status:%x,state:%x\n",R1_CURRENT_STATE(r1->status),mmc_card->state); + mmc_card->errno = MMC_ERROR_STATE_MISMATCH; + } + dbg5("mmc card error %d", mmc_card->errno); + if (mmc_card->errno) + return MSS_ERROR_RESP_UNPACK; + return 0; +} + +static int mmc_unpack_r3(struct mss_cmd *cmd, struct mmc_response_r3 *r3, struct mmc_card *mmc_card) +{ + u8 *buf = cmd->response; + + mmc_card->errno = MMC_ERROR_NONE; + r3->cmd = unstuff_bits(buf, 40, 8, 6); + r3->ocr = unstuff_bits(buf, 8, 32, 6); + + if (r3->cmd != 0x3f) { + mmc_card->errno = MMC_ERROR_HEADER_MISMATCH; + return MSS_ERROR_RESP_UNPACK; + } + return 0; +} + +/** + * Fast I/O, support for CEATA devices. + */ +static int mmc_unpack_r4( struct mss_cmd *cmd, struct mmc_response_r4 *r4, struct mmc_card *mmc_card) +{ + u8 *buf = cmd->response; + + mmc_card->errno = MMC_ERROR_NONE; + + r4->cmd = unstuff_bits(buf, 40, 8, 6); + r4->rca = unstuff_bits(buf, 24, 16, 6); + r4->status = unstuff_bits(buf, 23, 1, 6); + r4->reg_addr = unstuff_bits(buf, 16, 7, 6); + r4->read_reg_contents = unstuff_bits(buf, 8, 8, 6); + + if (r4->cmd != 0x27) { + mmc_card->errno = MMC_ERROR_HEADER_MISMATCH; + return MSS_ERROR_RESP_UNPACK; + } + return 0 ; +} + +/** + * Interrupt request. not supported temporarily. + */ +static int mmc_unpack_r5(struct mss_cmd *cmd, struct mmc_response_r5 *r5, struct mmc_card *mmc_card) +{ + u8 *buf = cmd->response; + + mmc_card->errno = MMC_ERROR_NONE; + + r5->cmd = unstuff_bits(buf, 40, 8, 6); + r5->rca = unstuff_bits(buf, 24, 16, 6); + r5->irq_data = unstuff_bits(buf, 8, 16, 6); + + if (r5->cmd != 0x28) { + mmc_card->errno = MMC_ERROR_HEADER_MISMATCH; + return MSS_ERROR_RESP_UNPACK; + } + return 0 ; +} + +static int mmc_unpack_cid(struct mss_cmd *cmd, struct mmc_cid *cid, struct mmc_card *mmc_card) +{ + u8 *buf = cmd->response; + + mmc_card->errno = MMC_ERROR_NONE; + if (buf[0] != 0x3f) { + mmc_card->errno = MMC_ERROR_HEADER_MISMATCH; + return MSS_ERROR_RESP_UNPACK; + } + buf = buf + 1; + + cid->mid = unstuff_bits(buf, 120, 8, 16); + cid->oid = unstuff_bits(buf, 104, 16, 16); + cid->pnm[0] = unstuff_bits(buf, 96, 8, 16); + cid->pnm[1] = unstuff_bits(buf, 88, 8, 16); + cid->pnm[2] = unstuff_bits(buf, 80, 8, 16); + cid->pnm[3] = unstuff_bits(buf, 72, 8, 16); + cid->pnm[4] = unstuff_bits(buf, 64, 8, 16); + cid->pnm[5] = unstuff_bits(buf, 56, 8, 16); + cid->pnm[6] = 0; + cid->prv = unstuff_bits(buf, 48, 8, 16); + cid->psn = unstuff_bits(buf, 16, 32, 16); + cid->mdt = unstuff_bits(buf, 8, 8, 16); + + return 0; +} + +static int mmc_unpack_csd(struct mss_cmd *cmd, struct mmc_csd *csd, struct mmc_card *mmc_card) +{ + u8 *buf = cmd->response; + + mmc_card->errno = MMC_ERROR_NONE; + if (buf[0] != 0x3f) { + mmc_card->errno = MMC_ERROR_HEADER_MISMATCH; + return MSS_ERROR_RESP_UNPACK; + } + buf = buf + 1; + + csd->csd_structure = unstuff_bits(buf, 126, 2, 16); + csd->spec_vers = unstuff_bits(buf, 122, 4, 16); + csd->taac = unstuff_bits(buf, 112, 8, 16); + csd->nsac = unstuff_bits(buf, 104, 8, 16); + csd->tran_speed = unstuff_bits(buf, 96, 8, 16); + csd->ccc = unstuff_bits(buf, 84, 12, 16);; + csd->read_bl_len = unstuff_bits(buf, 80, 4, 16); + csd->read_bl_partial = unstuff_bits(buf, 79, 1, 16); + csd->write_blk_misalign = unstuff_bits(buf, 78, 1, 16); + csd->read_blk_misalign = unstuff_bits(buf, 77, 1, 16); + csd->dsr_imp = unstuff_bits(buf, 76, 1, 16); + csd->c_size = unstuff_bits(buf, 62, 12, 16); + csd->vdd_r_curr_min = unstuff_bits(buf, 59, 3, 16); + csd->vdd_r_curr_max = unstuff_bits(buf, 56, 3, 16); + csd->vdd_w_curr_min = unstuff_bits(buf, 53, 3, 16); + csd->vdd_w_curr_max = unstuff_bits(buf, 50, 3, 16); + csd->c_size_mult = unstuff_bits(buf, 47, 3, 16); + switch (csd->csd_structure ) { + case CSD_STRUCT_1_0: + case CSD_STRUCT_1_1: + csd->erase.v22.sector_size = + unstuff_bits(buf, 42, 5, 16); + csd->erase.v22.erase_grp_size = + unstuff_bits(buf, 37, 5, 6); + break; + case CSD_STRUCT_1_2: + default: + csd->erase.v31.erase_grp_size = + unstuff_bits(buf, 42, 5, 16); + csd->erase.v31.erase_grp_mult = + unstuff_bits(buf, 37, 5, 16);; + break; + } + csd->wp_grp_size = unstuff_bits(buf, 32, 5, 16); + csd->wp_grp_enable = unstuff_bits(buf, 31, 1, 16); + csd->default_ecc = unstuff_bits(buf, 29, 2, 16); + csd->r2w_factor = unstuff_bits(buf, 26, 3, 16); + csd->write_bl_len = unstuff_bits(buf, 22, 4, 16); + csd->write_bl_partial = unstuff_bits(buf, 21, 1, 16); + csd->file_format_grp = unstuff_bits(buf, 16, 1, 16); + csd->copy = unstuff_bits(buf, 14, 1, 16); + csd->perm_write_protect = unstuff_bits(buf, 13, 1, 16); + csd->tmp_write_protect = unstuff_bits(buf, 12, 1, 16); + csd->file_format = unstuff_bits(buf, 10, 2, 16); + csd->ecc = unstuff_bits(buf, 8, 2, 16); + + printk(" csd_structure=%d spec_vers=%d taac=%02x nsac=%02x tran_speed=%02x\n" + " ccc=%04x read_bl_len=%d read_bl_partial=%d write_blk_misalign=%d\n" + " read_blk_misalign=%d dsr_imp=%d c_size=%d vdd_r_curr_min=%d\n" + " vdd_r_curr_max=%d vdd_w_curr_min=%d vdd_w_curr_max=%d c_size_mult=%d\n" + " wp_grp_size=%d wp_grp_enable=%d default_ecc=%d r2w_factor=%d\n" + " write_bl_len=%d write_bl_partial=%d file_format_grp=%d copy=%d\n" + " perm_write_protect=%d tmp_write_protect=%d file_format=%d ecc=%d\n", + csd->csd_structure, csd->spec_vers, + csd->taac, csd->nsac, csd->tran_speed, + csd->ccc, csd->read_bl_len, + csd->read_bl_partial, csd->write_blk_misalign, + csd->read_blk_misalign, csd->dsr_imp, + csd->c_size, csd->vdd_r_curr_min, + csd->vdd_r_curr_max, csd->vdd_w_curr_min, + csd->vdd_w_curr_max, csd->c_size_mult, + csd->wp_grp_size, csd->wp_grp_enable, + csd->default_ecc, csd->r2w_factor, + csd->write_bl_len, csd->write_bl_partial, + csd->file_format_grp, csd->copy, + csd->perm_write_protect, csd->tmp_write_protect, + csd->file_format, csd->ecc); + switch ( csd->csd_structure ) { + case CSD_STRUCT_1_0: + case CSD_STRUCT_1_1: + printk(" V22 sector_size=%d erase_grp_size=%d\n", + csd->erase.v22.sector_size, + csd->erase.v22.erase_grp_size); + break; + case CSD_STRUCT_1_2: + default: + printk(" V31 erase_grp_size=%d erase_grp_mult=%d\n", + csd->erase.v31.erase_grp_size, + csd->erase.v31.erase_grp_mult); + break; + + } + + return MSS_ERROR_NONE; +} + +static int mmc_unpack_ext_csd(u8 *buf, struct mmc_ext_csd *ext_csd) +{ + ext_csd->s_cmd_set = buf[504]; + ext_csd->sec_count = ((u32)buf[212]) << 24 | ((u32)buf[213]) << 16 | ((u32)buf[214]) << 8 | ((u32)buf[215]) ; + ext_csd->min_perf_w_8_52 = buf[210]; + ext_csd->min_perf_r_8_52 = buf[209]; + ext_csd->min_perf_w_26_4_52 = buf[208]; + ext_csd->min_perf_r_26_4_52 = buf[207]; + ext_csd->min_perf_w_4_26 = buf[206]; + ext_csd->min_perf_r_4_26 = buf[205]; + ext_csd->pwr_cl_26_360 = buf[203]; + ext_csd->pwr_cl_52_360 = buf[202]; + ext_csd->pwr_cl_26_195 = buf[201]; + ext_csd->pwr_cl_52_195 = buf[200]; + ext_csd->card_type = buf[196]; + ext_csd->csd_structure = buf[194]; + ext_csd->ext_csd_rev = buf[192]; + ext_csd->cmd_set = buf[191]; + ext_csd->cmd_set_rev = buf[189]; + ext_csd->power_class = buf[187]; + ext_csd->hs_timing = buf[185]; + ext_csd->erased_mem_cont = buf[183]; + + return 0; +} + +/** + * The blocks requested by the kernel may or may not match what we can do. + * Unfortunately, filesystems play fast and loose with block sizes, so we're + * stuck with this . + */ +static void mmc_fix_request_block_len(struct mss_card *card, int action, struct mss_rw_arg *arg) +{ + u16 block_len = 0; + struct mmc_card *mmc_card = card->prot_card; + struct mss_host *host = card->slot->host; + + switch(action) { + case MSS_DATA_READ: + block_len = 1 << mmc_card->csd.read_bl_len; + break; + case MSS_DATA_WRITE: + block_len = 1 << mmc_card->csd.write_bl_len; + break; + default: + return; + } + if (host->high_capacity && mmc_card->access_mode == MMC_ACCESS_MODE_SECTOR) + block_len = 512; + if (block_len < arg->block_len) { + int scale = arg->block_len / block_len; + arg->block_len = block_len; + arg->block *= scale; + arg->nob *= scale; + } +} + + +/***************************************************************************** + * + * protocol entry functions + * + ****************************************************************************/ + +static u32 mmc_make_cmd6_arg(u8 access, u8 index, u8 value, u8 cmdset) +{ + u32 ret; + ret = (access << 24) | (index << 16) | (value << 8) | cmdset; + return ret; +} + +static int mmc_get_status(struct mss_card *card, u32 *status) +{ + struct mmc_response_r1 r1; + struct mmc_card *mmc_card = card->prot_card; + struct mss_host *host = card->slot->host; + struct mss_ll_request *llreq = &mmc_card->llreq; + struct mss_cmd *cmd = &mmc_card->cmd; + int clock, ret, retries = 4; + + clock = mmc_tran_speed(mmc_card->csd.tran_speed); + mss_set_clock(card->slot->host, clock); + while (retries--) { + dbg5("rety"); + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SEND_STATUS, + mmc_card->rca << 16, MSS_RESPONSE_R1, 0); + dbg5("retry ret :%d", ret); + if (ret && !retries) + return ret; + else if (!ret) { + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) { + if (mmc_card->errno==MMC_ERROR_STATE_MISMATCH) { + mmc_card->state = + R1_CURRENT_STATE(r1.status); + mmc_card->errno = MMC_ERROR_NONE; + } + else + return ret; + } + else + break; + } + + clock = host->ios.clock; + clock = clock >> 1; + if (clock < MMC_CARD_CLOCK_SLOW || retries == 1) + clock = MMC_CARD_CLOCK_SLOW; + mss_set_clock(host, clock); + } + + *status = r1.status; + + return MSS_ERROR_NONE; +} + +static int mmc_recognize_card(struct mss_card *card) +{ + struct mmc_response_r3 r3; + struct mmc_card *mmc_card = card->prot_card; + struct mss_ios ios; + struct mss_host *host = card->slot->host; + struct mss_ll_request *llreq = &mmc_card->llreq; + struct mss_cmd *cmd = &mmc_card->cmd; + int ret; + u32 ocr = host->vdd; + + mmc_card->state = CARD_STATE_IDLE; + card->bus_width = MSS_BUSWIDTH_1BIT; + card->card_type = MSS_UNKNOWN_CARD; + + memcpy(&ios, &host->ios, sizeof(struct mss_ios)); + ios.bus_mode = MSS_BUSMODE_OPENDRAIN; + ios.clock = host->f_min; + ios.bus_width = MSS_BUSWIDTH_1BIT; + host->ops->set_ios(host, &ios); + + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_GO_IDLE_STATE, 0, + MSS_RESPONSE_NONE, MSS_CMD_INIT); + dbg2(card->slot, card->prot_driver, "Sending GO_IDLE cmd, ret:%d\n", ret); + if (ret) + return ret; + if (host->high_capacity) + ocr |= MMC_ACCESS_MODE_SECTOR; + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SEND_OP_COND, ocr, + MSS_RESPONSE_R3, 0); + dbg2(card->slot, card->prot_driver, "Sending SEND_OP_COND cmd, arg:0x%x\n, ret:%d", ocr, ret); + if (ret) + return ret; + + ret = mmc_unpack_r3(cmd, &r3, mmc_card); + dbg2(card->slot, card->prot_driver, "unapck ret %d, SEND_OP_COND ocr:0x%x", ret, r3.ocr); + if (!ret) { + if (r3.ocr & host->vdd) { + card->card_type = MSS_MMC_CARD; + } else { + printk(KERN_WARNING "uncompatible card\n"); + card->card_type = MSS_UNCOMPATIBLE_CARD; + } + return ret; + } + card->card_type = MSS_UNKNOWN_CARD; + + return MSS_ERROR_NONE; +} + +static int mmc_card_init(struct mss_card *card) +{ + struct mmc_response_r3 r3; + struct mmc_response_r1 r1; + struct mmc_cid cid; + struct mmc_card *mmc_card = card->prot_card; + struct mss_ios ios; + struct mss_host *host; + struct mss_ll_request *llreq = &mmc_card->llreq; + struct mss_cmd *cmd = &mmc_card->cmd; + struct mss_data *data = &mmc_card->data; + int ret; + u8 *g_buffer; + u32 ocr, arg, bus_width; + struct scatterlist sg; + + host = card->slot->host; + ocr = host->vdd; + + mmc_card->state = CARD_STATE_IDLE; + card->bus_width = MSS_BUSWIDTH_1BIT; + + memcpy(&ios, &host->ios, sizeof(struct mss_ios)); + ios.bus_mode = MSS_BUSMODE_OPENDRAIN; + ios.bus_width = MSS_BUSWIDTH_1BIT; + ios.clock = host->f_min; + host->ops->set_ios(host, &ios); + + dbg2(card->slot, card->prot_driver, "Sending GO_IDLE cmd, ret:%d\n", ret); + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_GO_IDLE_STATE, 0, + MSS_RESPONSE_NONE, MSS_CMD_INIT); + if (ret) + return ret; + + if (host->high_capacity) + ocr |= MMC_ACCESS_MODE_SECTOR; + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SEND_OP_COND, ocr, + MSS_RESPONSE_R3, 0); + dbg2(card->slot, card->prot_driver, "Sending SEND_OP_COND cmd, arg:0x%x\n, ret:%d", ocr, ret); + if (ret) + return ret; + + ret = mmc_unpack_r3(cmd, &r3, mmc_card); + dbg2(card->slot, card->prot_driver, "unapck ret %d, SEND_OP_COND ocr:0x%x", ret, r3.ocr); + if (ret) { + //printk(KERN_ERR "failed SEND_OP_COND error=%d (%s) \n", ret, mmc_result_to_string(ret)); + return ret; + } + + while (!(r3.ocr & MMC_CARD_BUSY)) { + //mdelay(20); + msleep(15); + dbg2(card->slot, card->prot_driver, "card is busy after SNED_OP_COND"); + ret = mss_send_simple_ll_req(host, llreq, cmd, + MMC_SEND_OP_COND, ocr, MSS_RESPONSE_R3, 0); + dbg2(card->slot, card->prot_driver, "Sending SEND_OP_COND cmd, arg:0x%x\n, ret:%d", ocr, ret); + if (ret) + return ret; + ret = mmc_unpack_r3(cmd, &r3, mmc_card); + dbg2(card->slot, card->prot_driver, "unapck ret %d, SEND_OP_COND ocr:0x%x", ret, r3.ocr); + if (ret) { + //printk(KERN_ERR ": failed SEND_OP_COND error=%d (%s) \n", retval, mmc_result_to_string(retval) ); + return ret; + } + } + + mmc_card->vdd = r3.ocr & MMC_VDD_MASK; + mmc_card->access_mode = r3.ocr & MMC_ACCESS_MODE_MASK; + mmc_card->state = CARD_STATE_READY; + + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_ALL_SEND_CID, 0, + MSS_RESPONSE_R2_CID, 0); + dbg2(card->slot, card->prot_driver, "Sending MMC_ALL_SEND_CID cmd, arg:0x%x\n, ret:%d", 0, ret); + if (ret) + return ret; + + memset(&cid, 0x0, sizeof(struct mmc_cid)); + ret = mmc_unpack_cid(cmd, &cid, mmc_card); + if (ret) + return ret; + + /* Not first init */ + if (mmc_card->cid.mid != 0) { + /* Card is changed */ + if (mmc_card->cid.mid != cid.mid || mmc_card->cid.oid != cid.oid + || mmc_card->cid.prv != cid.prv + || mmc_card->cid.psn != cid.psn + || mmc_card->cid.mdt != cid.mdt + || memcmp(mmc_card->cid.pnm, cid.pnm, 6)) + return MSS_ERROR_MISMATCH_CARD; + } + else + memcpy(&mmc_card->cid, &cid, sizeof(struct mmc_cid)); + + mmc_card->state = CARD_STATE_IDENT; + + mss_set_busmode(host, MSS_BUSMODE_PUSHPULL); + + mmc_card->rca = MMC_SLOT_RCA(card->slot); + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SET_RELATIVE_ADDR, + mmc_card->rca << 16, MSS_RESPONSE_R1, 0); + dbg2(card->slot, card->prot_driver, "Sending SET_REL_ADDR cmd, arg:0x%x\n, ret:%d", mmc_card->rca << 16, ret); + if (ret) + return ret; + + //mss_simple_cmd(dev, MMC_SET_RELATIVE_ADDR, (dev->slot->rca) << 16, RESPONSE_R1, buffer); + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) { + //printk(KERN_INFO "MMC: unable to SET_RELATIVE_ADDR error=%d (%s)\n", retval, mmc_result_to_string(retval) ); + return ret; + } + mmc_card->state = CARD_STATE_STBY; + + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SEND_CSD, + mmc_card->rca << 16, MSS_RESPONSE_R2_CSD, 0); + dbg2(card->slot, card->prot_driver, "Sending MMC_SEND_CSD cmd, arg:0x%x\n, ret:%d", mmc_card->rca << 16, ret); + if (ret) + return ret; + ret = mmc_unpack_csd(cmd, &mmc_card->csd, mmc_card); + if (ret) { + //printk(KERN_INFO "MMC: unable to SEND_CSD error=%d (%s)\n", retval, mmc_result_to_string(retval) ); + return ret; + } + + /* + * if it is MMC4.x-compatible card and how many bits are working. + */ + if (mmc_card->csd.spec_vers != CSD_SPEC_VERS_4 + || host->mmc_spec != MSS_MMC_SPEC_40_42) + goto exit; + + g_buffer = mmc_card->buf;//kmalloc(512, GFP_KERNEL); + /*if (!g_buffer) + return -ENOMEM; */ + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SELECT_CARD, + mmc_card->rca << 16, MSS_RESPONSE_R1B, 0); + if (ret) + return ret; + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) + return ret; + mmc_card->state = CARD_STATE_TRAN; + + /* + * set 1-bus mode in init. arg:access=0b11, arg:index=0xb7, arg:value=0 + * or CMD8 will not be responded with 1-bit/controller and 4-bit/card + * dev->bus_mode should be MSS_1_BIT before next command + * buffer = NULL; + */ + arg = mmc_make_cmd6_arg(0x3, 0xb7, 0, 0); + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SWITCH, arg, + MSS_RESPONSE_R1B, 0); + if (ret) + return ret; + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) + return ret; + + card->bus_width = MSS_BUSWIDTH_1BIT; + mss_set_buswidth(host, MSS_BUSWIDTH_1BIT); + + sg.page = virt_to_page(g_buffer); + sg.offset = offset_in_page(g_buffer); + sg.length = 512; + + memset(llreq, 0x0, sizeof(struct mss_ll_request)); + memset(cmd, 0x0, sizeof(struct mss_cmd)); + memset(data, 0x0, sizeof(struct mss_data)); + MSS_INIT_CMD(cmd, MMC_SEND_EXT_CSD, 0, 0, MSS_RESPONSE_R1); + MSS_INIT_DATA(data, 1, 512, MSS_DATA_READ, 1, &sg, 0); + llreq->cmd = cmd; + llreq->data = data; + + ret = mss_send_ll_req(host, &mmc_card->llreq); + if (ret) + return ret; + ret = mmc_unpack_ext_csd(g_buffer, &mmc_card->ext_csd); + if (ret) + return ret; + + /* + * use CMD19/CMD14 (BUSTEST_W/BUSTEST_R) to test supported bus mode. + */ + memset(g_buffer, 0xFF, 512); + bus_width = host->bus_width; + if (bus_width == MSS_BUSWIDTH_1BIT) + goto exit; + else if (bus_width == MSS_BUSWIDTH_4BIT) { + card->bus_width = MSS_BUSWIDTH_4BIT; + g_buffer[0] = 0xa5; /* 0b10100101 */ + g_buffer[1] = 0xFF; /* 0b11111111 */ + } + else if (bus_width == MSS_BUSWIDTH_8BIT) { + card->bus_width = MSS_BUSWIDTH_8BIT; + g_buffer[0] = 0xaa; /* 0b10101010 */ + g_buffer[1] = 0x55; /* 0b01010101 */ + } + else + goto exit; + + mss_set_buswidth(host, bus_width); + + memset(llreq, 0x0, sizeof(struct mss_ll_request)); + memset(cmd, 0x0, sizeof(struct mss_cmd)); + memset(data, 0x0, sizeof(struct mss_data)); + MSS_INIT_CMD(cmd, MMC_BUSTEST_W, 0, 0, MSS_RESPONSE_R1); + MSS_INIT_DATA(data, 1, 512, MSS_DATA_WRITE, 1, &sg, 0); + llreq->cmd = cmd; + llreq->data = data; + + ret = mss_send_ll_req(host, &mmc_card->llreq); + if (ret) + return ret; + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) + return ret; + + mmc_card->state = CARD_STATE_BTST; + memset(g_buffer, 0xFF, 512); + + memset(llreq, 0x0, sizeof(struct mss_ll_request)); + memset(cmd, 0x0, sizeof(struct mss_cmd)); + memset(data, 0x0, sizeof(struct mss_data)); + MSS_INIT_CMD(cmd, MMC_BUSTEST_R, 0, 0, MSS_RESPONSE_R1); + MSS_INIT_DATA(data, 1, 512, MSS_DATA_READ, 1, &sg, 0); + llreq->cmd = cmd; + llreq->data = data; + + ret = mss_send_ll_req(host, &mmc_card->llreq); + if (ret) + return ret; + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) + return ret; + + if ((g_buffer[0] == 0x55/*0b01010101*/) && + (g_buffer[1] == 0xaa/*0b10101010*/)) { + mmc_card->bus_width = MSS_BUSWIDTH_8BIT; + } + else if (g_buffer[0] == 0x5a /*0b01011010*/) { + mmc_card->bus_width = MSS_BUSWIDTH_4BIT; + } + else { + mmc_card->bus_width = MSS_BUSWIDTH_1BIT; + } + + mmc_card->state = CARD_STATE_TRAN; + + arg = mmc_make_cmd6_arg(0x3, 0xb7, mmc_card->bus_width, 0); + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SWITCH, arg, + MSS_RESPONSE_R1B, 0); + if (ret) + return ret; + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) + return ret; + + card->bus_width = mmc_card->bus_width; + /** + * use CMD6 to set high speed mode. arg:access=0b11, arg:index=0xb9, + * arg:value=1 according to card/controller high speed timing + * high speed mode for MMC-4.x compatible card. + */ + if (host->high_speed == MSS_HIGH_SPEED) { + mmc_make_cmd6_arg(0x3, 0xb9, 1, 0); + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SWITCH, arg, + MSS_RESPONSE_R1B, 0); + if (ret) + return ret; + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) + return ret; + memcpy(&ios, &host->ios, sizeof(struct mss_ios)); + ios.high_speed = MSS_HIGH_SPEED; + ios.clock = MMC_CARD_CLOCK_FAST; + host->ops->set_ios(host, &ios); + if (host->ios.high_speed != MSS_HIGH_SPEED) { + u32 clock = mmc_tran_speed(mmc_card->csd.tran_speed); + mss_set_clock(host, clock); + } + } + else { + /* change to the highest speed in normal mode */ + u32 clock = mmc_tran_speed(mmc_card->csd.tran_speed); + mss_set_clock(host, clock); + } + + /** + * use CMD6 to set power class. arg:access=0b11, arg:index=0xbb, + * arg:value=card power class code according to card/controller supported + * power class. We read value from PWL_CL_ff_vvv and set it to POWER_CLASS + * according to supported voltage and clock rate. + */ + + /* Deselect the card */ + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SELECT_CARD, 0, + MSS_RESPONSE_R1B, 0); + if (ret) + return ret; + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) + return ret; + mmc_card->state = CARD_STATE_STBY; + +exit: + return MSS_ERROR_NONE; +} + +static int mmc_read_write_entry(struct mss_card *card, int action, struct mss_rw_arg *arg, struct mss_rw_result *result) +{ + struct mmc_card *mmc_card = card->prot_card; + struct mss_host *host; + struct mss_ios ios; + struct mmc_response_r1 r1; + struct mss_ll_request *llreq = &mmc_card->llreq; + struct mss_cmd *cmd = &mmc_card->cmd; + struct mss_data *data = &mmc_card->data; + int ret, retries = 4, clock; + u32 status = 0; + int access_mode_sector = 0; + u32 cmdarg, blklen, opcode, flags; + + host = card->slot->host; + + ret = mmc_get_status(card, &status); + if (ret) + return ret; + + if (status & R1_CARD_IS_LOCKED) + return MSS_ERROR_LOCKED; + + if (action == MSS_WRITE_MEM && host->ops->is_slot_wp && + host->ops->is_slot_wp(card->slot)) + return MSS_ERROR_WP; + + if (mmc_card->state == CARD_STATE_STBY) { + ret = mss_send_simple_ll_req(host, llreq, cmd, MMC_SELECT_CARD, + mmc_card->rca << 16, MSS_RESPONSE_R1, 0); + if (ret) + return ret; + dbg5("select card cmd return ret:%d\n", ret); + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) + return ret; + } + mmc_card->state = CARD_STATE_TRAN; + + mmc_fix_request_block_len(card, action, arg); + access_mode_sector = (mmc_card->access_mode == MMC_ACCESS_MODE_SECTOR) + && host->high_capacity; + memcpy(&ios, &host->ios, sizeof(struct mss_ios)); + if (access_mode_sector) { + ios.access_mode = MSS_ACCESS_MODE_SECTOR; + cmdarg = arg->block; + blklen = 512; + } + else { + if (arg->block_len != mmc_card->block_len) { + ret = mss_send_simple_ll_req(host, llreq, cmd, + MMC_SET_BLOCKLEN, arg->block_len, + MSS_RESPONSE_R1, 0); + if (ret) + return ret; + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) + return ret; + mmc_card->block_len = arg->block_len; + } + cmdarg = arg->block * arg->block_len; + blklen = arg->block_len; + } + + if (mmc_card->csd.spec_vers == CSD_SPEC_VERS_4 && host->high_speed) { + ios.high_speed = MSS_HIGH_SPEED; + ios.clock = MMC_CARD_CLOCK_FAST; + } + else { + ios.clock = mmc_tran_speed(mmc_card->csd.tran_speed); + } + host->ops->set_ios(host, &ios); + + memset(llreq, 0x0, sizeof(struct mss_ll_request)); + memset(cmd, 0x0, sizeof(struct mss_cmd)); + memset(data, 0x0, sizeof(struct mss_data)); + llreq->cmd = cmd; + llreq->data = data; + +read_write_entry: + if (arg->nob > 1) { + if (action == MSS_READ_MEM) { + opcode = MMC_READ_MULTIPLE_BLOCK; + flags = MSS_DATA_READ | MSS_DATA_MULTI; + } + else { + opcode = MMC_WRITE_MULTIPLE_BLOCK; + flags = MSS_DATA_WRITE | MSS_DATA_MULTI; + } + + MSS_INIT_CMD(cmd, opcode, cmdarg, 0, MSS_RESPONSE_R1); + MSS_INIT_DATA(data, arg->nob, blklen, flags, arg->sg_len, + arg->sg, 0); + + ret = mss_send_ll_req(host, &mmc_card->llreq); + if (!ret) + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + + mmc_card->state = (action == MSS_WRITE_MEM) ? CARD_STATE_RCV + : CARD_STATE_DATA; + + if (ret) { + mss_send_simple_ll_req(host, llreq, cmd, + MMC_STOP_TRANSMISSION, 0, + (action == MSS_WRITE_MEM) ? + MSS_RESPONSE_R1B : MSS_RESPONSE_R1, 0); + mmc_card->state = CARD_STATE_TRAN; + + if (--retries) { + clock = host->ios.clock; + clock = clock >> 1; + if (clock < MMC_CARD_CLOCK_SLOW && retries == 1) + clock = MMC_CARD_CLOCK_SLOW; + mss_set_clock(host, clock); + goto read_write_entry; + } + return ret; + } + ret = mss_send_simple_ll_req(host, llreq, cmd, + MMC_STOP_TRANSMISSION, 0, + (action == MSS_WRITE_MEM) ? + MSS_RESPONSE_R1B : MSS_RESPONSE_R1, 0); + if (ret) + return ret; + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + mmc_card->state = CARD_STATE_TRAN; + + if (ret && (mmc_card->errno != MMC_ERROR_OUT_OF_RANGE)) + return ret; + } else { + if (action == MSS_READ_MEM) { + opcode = MMC_READ_SINGLE_BLOCK; + flags = MSS_DATA_READ; + } + else { + opcode = MMC_WRITE_BLOCK; + flags = MSS_DATA_WRITE; + } + MSS_INIT_CMD(cmd, opcode, cmdarg, 0, MSS_RESPONSE_R1); + MSS_INIT_DATA(data, arg->nob, blklen, flags, arg->sg_len, + arg->sg, 0); + + ret = mss_send_ll_req(host, &mmc_card->llreq); + if (!ret) + ret = mmc_unpack_r1(cmd, &r1, mmc_card); + if (ret) { + if (--retries) { + clock = host->ios.clock; + clock = clock >> 1; + if (clock < MMC_CARD_CLOCK_SLOW && retries == 1) + clock = MMC_CARD_CLOCK_SLOW; + mss_set_clock(host, clock); + goto read_write_entry; + } + return ret; + } + } + /* Deselect the card */ + /*mmc_simple_ll_req(host, mmc_card, MMC_SELECT_CARD, + 0, MSS_RESPONSE_NONE, 0); + if (ret) + return ret; + ret = mmc_unpack_r1(&mmc_card->cmd, &r1, mmc_card); + mmc_card->state = CARD_STATE_STBY;*/ + if (ret) + return ret; + result->bytes_xfered = data->bytes_xfered; + + return MSS_ERROR_NONE; +} + +/* count by 512 bytes */ +static int mmc_get_capacity(struct mss_card *card, u32 *size) +{ + int c_size = 0; + int c_size_mult = 0; + struct mmc_card *mmc_card = card->prot_card; + struct mss_host *host = card->slot->host; + + if (mmc_card->access_mode == MMC_ACCESS_MODE_SECTOR && host->high_capacity) + *size = mmc_card->ext_csd.sec_count; + else { + c_size = mmc_card->csd.c_size; + c_size_mult = mmc_card->csd.c_size_mult; + *size = (c_size + 1) + << (2 + c_size_mult + mmc_card->csd.read_bl_len - 9); + } + dbg5("the capacity :0x%x", *size); + return MSS_ERROR_NONE; +} + + +/***************************************************************************** + * + * protocol driver interface functions + * + ****************************************************************************/ + +static int mmc_prot_entry(struct mss_card *card, unsigned int action, void *arg, void *result) +{ + u32 status; + int ret; + + if (action != MSS_RECOGNIZE_CARD && card->card_type != MSS_MMC_CARD) + return MSS_ERROR_WRONG_CARD_TYPE; + switch (action) { + case MSS_RECOGNIZE_CARD: + ret = mmc_recognize_card(card); + break; + case MSS_INIT_CARD: + ret = mmc_card_init(card); + break; + case MSS_READ_MEM: + case MSS_WRITE_MEM: + if (!arg) + return -EINVAL; + ret = mmc_read_write_entry(card, action, arg, result); + break; + case MSS_QUERY_CARD: + ret = mmc_get_status(card, &status); + break; + case MSS_GET_CAPACITY: + ret = mmc_get_capacity(card, result); + break; + default: + ret = MSS_ERROR_ACTION_UNSUPPORTED; + break; + } + //dbg("mmc protocol entry exit, ret: %d, action: %d\n", ret, action); + return ret; +} + +static int mmc_prot_attach_card(struct mss_card *card) +{ + struct mmc_card *mmc_card; + +#define ALIGN32(x) (((x) + 31) & (~31)) + mmc_card = kzalloc(ALIGN32(ALIGN32(sizeof(struct mmc_card))) + 512, + GFP_KERNEL); + card->prot_card = mmc_card; + if (mmc_card) { + mmc_card->buf = (char *)ALIGN32((unsigned int)&mmc_card[1]); + return 0; + } + return -ENOMEM; +} + +static void mmc_prot_detach_card(struct mss_card *card) +{ + kfree(card->prot_card); +} + +static int mmc_prot_get_errno(struct mss_card *card) +{ + struct mmc_card *mmc_card = card->prot_card; + return mmc_card->errno; +} + +static struct mss_prot_driver mmc_protocol = { + .name = MMC_PROTOCOL, + .prot_entry = mmc_prot_entry, + .attach_card = mmc_prot_attach_card, + .detach_card = mmc_prot_detach_card, + .get_errno = mmc_prot_get_errno, +}; + +static int mmc_protocol_init(void) +{ + register_mss_prot_driver(&mmc_protocol); + return 0; +} + +static void mmc_protocol_exit(void) +{ + unregister_mss_prot_driver(&mmc_protocol); +} + + +module_init(mmc_protocol_init); +module_exit(mmc_protocol_exit); + +MODULE_AUTHOR("Bridge Wu"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MMC protocol driver"); --- linux-2.6.24.orig/drivers/mmc/mss/sd_protocol.c +++ linux-2.6.24/drivers/mmc/mss/sd_protocol.c @@ -0,0 +1,1100 @@ +/* + * sd_protocol.c - SD protocol driver + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from previous mmc code in Linux kernel + * Copyright (c) 2002 Hewlett-Packard Company + * Copyright (c) 2002 Andrew Christian + * Copyright (c) 2006 Bridge Wu + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define KBPS 1 +#define MBPS 1000 + +static u32 ts_exp[] = { 100*KBPS, 1*MBPS, 10*MBPS, 100*MBPS, 0, 0, 0, 0 }; +static u32 ts_mul[] = { 0, 1000, 1200, 1300, 1500, 2000, 2500, 3000, + 3500, 4000, 4500, 5000, 5500, 6000, 7000, 8000 }; + +static u32 sd_tran_speed(u8 ts) +{ + u32 clock = ts_exp[(ts & 0x7)] * ts_mul[(ts & 0x78) >> 3]; + + dbg5("clock :%d", clock); + return clock; +} + + +static int sd_unpack_r1(struct mss_cmd *cmd, struct sd_response_r1 *r1, struct sd_card *sd_card) +{ + u8 *buf = cmd->response; + + //debug(" result in r1: %d\n", request->result); + //if ( request->result ) return request->result; + + sd_card->errno = SD_ERROR_NONE; + r1->cmd = unstuff_bits(buf, 40, 8, 6); + r1->status = unstuff_bits(buf, 8, 32, 6); + + dbg5("status 0x%x", r1->status); + if (R1_STATUS(r1->status)) { + if (r1->status & R1_OUT_OF_RANGE) + sd_card->errno = SD_ERROR_OUT_OF_RANGE; + if (r1->status & R1_ADDRESS_ERROR) + sd_card->errno = SD_ERROR_ADDRESS; + if (r1->status & R1_BLOCK_LEN_ERROR) + sd_card->errno = SD_ERROR_BLOCK_LEN; + if (r1->status & R1_ERASE_SEQ_ERROR) + sd_card->errno = SD_ERROR_ERASE_SEQ; + if (r1->status & R1_ERASE_PARAM) + sd_card->errno = SD_ERROR_ERASE_PARAM; + if (r1->status & R1_WP_VIOLATION) + sd_card->errno = SD_ERROR_WP_VIOLATION; + if (r1->status & R1_LOCK_UNLOCK_FAILED) + sd_card->errno = SD_ERROR_LOCK_UNLOCK_FAILED; + if (r1->status & R1_COM_CRC_ERROR) + sd_card->errno = SD_ERROR_COM_CRC; + if (r1->status & R1_ILLEGAL_COMMAND) + sd_card->errno = SD_ERROR_ILLEGAL_COMMAND; + if (r1->status & R1_CARD_ECC_FAILED) + sd_card->errno = SD_ERROR_CARD_ECC_FAILED; + if (r1->status & R1_CC_ERROR) + sd_card->errno = SD_ERROR_CC; + if (r1->status & R1_ERROR) + sd_card->errno = SD_ERROR_GENERAL; + if (r1->status & R1_CID_CSD_OVERWRITE) + sd_card->errno = SD_ERROR_CID_CSD_OVERWRITE; + } + if (r1->status & R1_AKE_SEQ_ERROR) + sd_card->errno = SD_ERROR_CID_CSD_OVERWRITE; + + if (r1->cmd != cmd->opcode) + sd_card->errno = SD_ERROR_HEADER_MISMATCH; + dbg5("command:0x%x", r1->cmd); + /* This should be last - it's the least dangerous error */ + if (R1_CURRENT_STATE(r1->status) != sd_card->state ) { + dbg5("state dismatch:r1->status:%x,state:%x\n",R1_CURRENT_STATE(r1->status),sd_card->state); + sd_card->errno = SD_ERROR_STATE_MISMATCH; + } + dbg5("sd card error %d", sd_card->errno); + if (sd_card->errno) + return MSS_ERROR_RESP_UNPACK; + return 0; +} + +static int sd_unpack_r3(struct mss_cmd *cmd, struct sd_response_r3 *r3, struct sd_card *sd_card) +{ + u8 *buf = cmd->response; + + sd_card->errno = SD_ERROR_NONE; + r3->cmd = unstuff_bits(buf, 40, 8, 6); + r3->ocr = unstuff_bits(buf, 8, 32, 6); + dbg5("ocr=0x%x", r3->ocr); + + if (r3->cmd != 0x3f) { + sd_card->errno = SD_ERROR_HEADER_MISMATCH; + return MSS_ERROR_RESP_UNPACK; + } + return 0; +} + +static int sd_unpack_r6(struct mss_cmd *cmd, struct sd_response_r6 *r6, struct sd_card *sd_card) +{ + u8 *buf = cmd->response; + int errno = SD_ERROR_NONE; + + r6->cmd = unstuff_bits(buf, 40, 8, 6); + r6->rca = unstuff_bits(buf, 24, 16, 6); + r6->status = unstuff_bits(buf, 8, 16, 6); + if (R6_STATUS(r6->status)) { + if (r6->status & R6_COM_CRC_ERROR) + errno = SD_ERROR_COM_CRC; + if (r6->status & R6_ILLEGAL_COMMAND) + errno = SD_ERROR_ILLEGAL_COMMAND; + if (r6->status & R6_ERROR) + errno = SD_ERROR_CC; + } + if (r6->cmd != cmd->opcode) + errno = SD_ERROR_HEADER_MISMATCH; + /* This should be last - it's the least dangerous error */ + if (R1_CURRENT_STATE(r6->status) != sd_card->state) + errno = SD_ERROR_STATE_MISMATCH; + sd_card->errno = errno; + if (errno) + return MSS_ERROR_RESP_UNPACK; + return 0 ; +} + +static int sd_unpack_cid(struct mss_cmd *cmd, struct sd_cid *cid, struct sd_card *sd_card) +{ + u8 *buf = cmd->response; + + sd_card->errno = SD_ERROR_NONE; + if (buf[0] != 0x3f) { + sd_card->errno = SD_ERROR_HEADER_MISMATCH; + return MSS_ERROR_RESP_UNPACK; + } + buf = buf + 1; + + cid->mid = unstuff_bits(buf, 120, 8, 16); + cid->oid = unstuff_bits(buf, 104, 16, 16); + cid->pnm[0] = unstuff_bits(buf, 96, 8, 16); + cid->pnm[1] = unstuff_bits(buf, 88, 8, 16); + cid->pnm[2] = unstuff_bits(buf, 80, 8, 16); + cid->pnm[3] = unstuff_bits(buf, 72, 8, 16); + cid->pnm[4] = unstuff_bits(buf, 64, 8, 16); + cid->pnm[5] = 0; + cid->prv = unstuff_bits(buf, 56, 8, 16); + cid->psn = unstuff_bits(buf, 24, 32, 16); + cid->mdt = unstuff_bits(buf, 8, 12, 16); +/* + DEBUG(" mid=%d oid=%d pnm=%s prv=%d.%d psn=%08x mdt=%d/%d\n", + cid->mid, cid->oid, cid->pnm, + (cid->prv>>4), (cid->prv&0xf), + cid->psn, cid->mdt&&0xf, ((cid->mdt>>4)&0xff)+2000); +*/ + + return 0; +} + +static int sd_unpack_csd(struct mss_cmd *cmd, struct sd_csd *csd, struct sd_card *sd_card) +{ + u8 *buf = cmd->response; + + sd_card->errno = SD_ERROR_NONE; + if (buf[0] != 0x3f) { + sd_card->errno = SD_ERROR_HEADER_MISMATCH; + return MSS_ERROR_RESP_UNPACK; + } + buf = buf + 1; + + csd->csd_structure = unstuff_bits(buf, 126, 2, 16); + csd->taac = unstuff_bits(buf, 112, 8, 16); + csd->nsac = unstuff_bits(buf, 104, 8, 16); + csd->tran_speed = unstuff_bits(buf, 96, 8, 16); + csd->ccc = unstuff_bits(buf, 84, 12, 16); + csd->read_bl_len = unstuff_bits(buf, 80, 4, 16); + csd->read_bl_partial = unstuff_bits(buf, 79, 1, 16); + csd->write_blk_misalign = unstuff_bits(buf, 78, 1, 16); + csd->read_blk_misalign = unstuff_bits(buf, 77, 1, 16); + csd->dsr_imp = unstuff_bits(buf, 76, 1, 16); + if (csd->csd_structure == 0) { + csd->csd.csd1.c_size = unstuff_bits(buf, 62, 12, 16); + csd->csd.csd1.vdd_r_curr_min = unstuff_bits(buf, 59, 3, 16); + csd->csd.csd1.vdd_r_curr_max = unstuff_bits(buf, 56, 3, 16); + csd->csd.csd1.vdd_w_curr_min = unstuff_bits(buf, 53, 3, 16); + csd->csd.csd1.vdd_w_curr_max = unstuff_bits(buf, 50, 3, 16); + csd->csd.csd1.c_size_mult = unstuff_bits(buf, 47, 3, 16); + } + else if (csd->csd_structure == 1) { + csd->csd.csd2.c_size = unstuff_bits(buf, 48, 22, 16); + } + csd->erase_blk_en = unstuff_bits(buf, 46, 1, 16); + csd->sector_size = unstuff_bits(buf, 39, 7, 16); + csd->wp_grp_size = unstuff_bits(buf, 32, 7, 16); + csd->wp_grp_enable = unstuff_bits(buf, 31, 1, 16); + csd->r2w_factor = unstuff_bits(buf, 26, 3, 16); + csd->write_bl_len = unstuff_bits(buf, 22, 4, 16); + csd->write_bl_partial = unstuff_bits(buf, 21, 1, 16); + csd->file_format_grp = unstuff_bits(buf, 15, 1, 16); + csd->copy = unstuff_bits(buf, 14, 1, 16); + csd->perm_write_protect = unstuff_bits(buf, 13, 1, 16); + csd->tmp_write_protect = unstuff_bits(buf, 12, 1, 16); + csd->file_format = unstuff_bits(buf, 10, 2, 16); + + if (csd->csd_structure == 0) { + dbg5(" csd_structure=%d taac=%02x nsac=%02x tran_speed=%02x\n" + " ccc=%04x read_bl_len=%d read_bl_partial=%d write_blk_misalign=%d\n" + " read_blk_misalign=%d dsr_imp=%d c_size=%d vdd_r_curr_min=%d\n" + " vdd_r_curr_max=%d vdd_w_curr_min=%d vdd_w_curr_max=%d c_size_mult=%d\n" + " erase_blk_en=%d sector_size=%d wp_grp_size=%d wp_grp_enable=%d r2w_factor=%d\n" + " write_bl_len=%d write_bl_partial=%d file_format_grp=%d copy=%d\n" + " perm_write_protect=%d tmp_write_protect=%d file_format=%d\n", + csd->csd_structure,csd->taac, csd->nsac, csd->tran_speed, + csd->ccc, csd->read_bl_len, + csd->read_bl_partial, csd->write_blk_misalign, + csd->read_blk_misalign, csd->dsr_imp, + csd->csd.csd1.c_size, csd->csd.csd1.vdd_r_curr_min, + csd->csd.csd1.vdd_r_curr_max, csd->csd.csd1.vdd_w_curr_min, + csd->csd.csd1.vdd_w_curr_max, csd->csd.csd1.c_size_mult, + csd->erase_blk_en,csd->sector_size, + csd->wp_grp_size, csd->wp_grp_enable, + csd->r2w_factor, + csd->write_bl_len, csd->write_bl_partial, + csd->file_format_grp, csd->copy, + csd->perm_write_protect, csd->tmp_write_protect, + csd->file_format); + } + else if (csd->csd_structure == 1) { + dbg5(" csd_structure=%d taac=%02x nsac=%02x tran_speed=%02x\n" + " ccc=%04x read_bl_len=%d read_bl_partial=%d write_blk_misalign=%d\n" + " read_blk_misalign=%d dsr_imp=%d c_size=%d\n" + " erase_blk_en=%d sector_size=%d wp_grp_size=%d wp_grp_enable=%d r2w_factor=%d\n" + " write_bl_len=%d write_bl_partial=%d file_format_grp=%d copy=%d\n" + " perm_write_protect=%d tmp_write_protect=%d file_format=%d\n", + csd->csd_structure,csd->taac, csd->nsac, csd->tran_speed, + csd->ccc, csd->read_bl_len, + csd->read_bl_partial, csd->write_blk_misalign, + csd->read_blk_misalign, csd->dsr_imp, + csd->csd.csd2.c_size, + csd->erase_blk_en,csd->sector_size, + csd->wp_grp_size, csd->wp_grp_enable, + csd->r2w_factor, + csd->write_bl_len, csd->write_bl_partial, + csd->file_format_grp, csd->copy, + csd->perm_write_protect, csd->tmp_write_protect, + csd->file_format); + } + + return 0; +} + +static int sd_unpack_swfuncstatus(char *buf, struct sw_func_status *status) +{ + int i; + + buf += 34; + for (i = 0; i < 5; i++) { + status->func_busy[i] = buf[0] << 8 | buf[1]; + buf += 2; + } + buf += 1; + for (i = 0; i <= 5; i = i + 2) { + status->group_status[i] = buf[0] & 0xFF; + status->group_status[(i + 1)] = (buf[0] >> 4) & 0xFF; + buf += 1; + } + + for (i = 0; i <= 5; i++) { + status->func_support[i] = buf[0] << 8 | buf[1]; + buf += 2; + } + + status->current_consumption = buf[0] << 8 | buf[1]; + + return 0; +} + +static int sd_unpack_r7(struct mss_cmd *cmd, struct sd_response_r7 *r7, u16 arg, struct sd_card *sd_card) +{ + u8 *buf = cmd->response; + + r7->cmd = unstuff_bits(buf, 40, 8, 6); + r7->ver = unstuff_bits(buf, 20, 20, 6); + r7->vca = unstuff_bits(buf, 16, 4, 6); + r7->pattern = unstuff_bits(buf, 8, 8, 6); + +/* if ((r7->cmd | r7->ver | r7->vca | r7->pattern) == 0) + return MSS_NO_RESPONSE;*/ + if (r7->cmd != SD_SEND_IF_COND || r7->ver != 0 + || (r7->vca | r7->pattern) != arg) { + sd_card->errno = SD_ERROR_HEADER_MISMATCH; + return MSS_ERROR_RESP_UNPACK; + } + return 0; +} + +static int sd_unpack_scr(u8 *buf, struct sd_scr *scr) +{ + scr->scr_structure = unstuff_bits(buf, 60, 4, 8); + scr->sd_spec = unstuff_bits(buf, 56, 4, 8); + scr->data_stat_after_erase = unstuff_bits(buf, 55, 1, 8); + scr->sd_security = unstuff_bits(buf, 52, 3, 8); + scr->sd_bus_width = unstuff_bits(buf, 48, 4, 8); + scr->init = 1; + + dbg5("scr_stru:%d, spec:%d, sata:%d, security:%d, bus:%d", scr->scr_structure, scr->sd_spec, scr->data_stat_after_erase, scr->sd_security, scr->sd_bus_width); + return 0; +} + +static int sd_get_status(struct mss_card *card, int *status) +{ + struct sd_response_r1 r1; + struct sd_card *sd_card = card->prot_card; + struct mss_host *host = card->slot->host; + int clock, ret, retries = 4; + + clock = sd_tran_speed(sd_card->csd.tran_speed); + mss_set_clock(card->slot->host, clock); + while (retries--) { + dbg5("rety"); + ret = mss_send_simple_ll_req(host, &sd_card->llreq, + &sd_card->cmd, SD_SEND_STATUS, + sd_card->rca << 16, MSS_RESPONSE_R1, 0); + dbg5("retry ret :%d", ret); + if (ret && !retries) + return ret; + else if (!ret) { + ret = sd_unpack_r1(&sd_card->cmd, &r1, sd_card); + if (ret) { + if (sd_card->errno == SD_ERROR_STATE_MISMATCH) { + sd_card->state = R1_CURRENT_STATE(r1.status); + sd_card->errno = SD_ERROR_NONE; + } + else + return ret; + } + else + break; + } + + clock = host->ios.clock; + clock = clock >> 1; + if (clock < SD_CARD_CLOCK_SLOW || retries == 1) + clock = SD_CARD_CLOCK_SLOW; + mss_set_clock(host, clock); + } + + *status = r1.status; + + return MSS_ERROR_NONE; +} + +/** + * The blocks requested by the kernel may or may not match what we can do. + * Unfortunately, filesystems play fast and loose with block sizes, so we're + * stuck with this. + */ +static void sd_fix_request_block_len(struct mss_card *card, int action, struct mss_rw_arg *arg) +{ + u16 block_len = 0; + struct sd_card *sd_card = card->prot_card; + struct mss_host *host = card->slot->host; + + switch(action) { + case MSS_DATA_READ: + block_len = 1 << sd_card->csd.read_bl_len; + break; + case MSS_DATA_WRITE: + block_len = 1 << sd_card->csd.write_bl_len; + break; + default: + return; + } + if (host->high_capacity && (sd_card->ocr & SD_OCR_CCS)) + block_len = 512; + if (block_len < arg->block_len) { + int scale = arg->block_len / block_len; + arg->block_len = block_len; + arg->block *= scale; + arg->nob *= scale; + } +} + +static int sd_send_cmd6(struct mss_card *card, struct sw_func_status *status, int mode, u32 funcs) +{ + struct sd_response_r1 r1; + struct sd_card *sd_card = card->prot_card; + struct mss_ll_request *llreq = &sd_card->llreq; + struct mss_cmd *cmd = &sd_card->cmd; + struct mss_data *data = &sd_card->data; + struct mss_host *host= card->slot->host; + struct scatterlist sg; + char *g_buffer = sd_card->buf; + int ret; + /* Set the argumens for CMD6. */ + /* [31]: Mode + * [30:24]: reserved (all 0s) + * [23:20]: group 6 + * [19:16]: group 5 + * [15:12]: group 4 + * [11:8]: group 3 + * [7:4]: group 2 + * [3:0]: group 1 + */ + sg.page = virt_to_page(g_buffer); + sg.offset = offset_in_page(g_buffer); + sg.length = 8; + + memset(llreq, 0x0, sizeof(struct mss_ll_request)); + memset(cmd, 0x0, sizeof(struct mss_cmd)); + memset(data, 0x0, sizeof(struct mss_data)); + MSS_INIT_CMD(cmd, SD_SW_FUNC, (funcs | ((mode & 0x1) << 31)), 0, + MSS_RESPONSE_R1); + MSS_INIT_DATA(data, 1, 32, MSS_DATA_READ, 1, &sg, 0); + llreq->cmd = cmd; + llreq->data = data; + + ret = mss_send_ll_req(host, llreq); + if (ret) + return ret; + ret = sd_unpack_r1(cmd, &r1, sd_card); + if (ret) + return ret; + sd_unpack_swfuncstatus(g_buffer, status); + + return 0; +} + +/***************************************************************************** + * + * protocol entry functions + * + ****************************************************************************/ + +static int sd_recognize_card(struct mss_card *card) +{ + struct sd_response_r1 r1; + struct sd_response_r3 r3; + struct sd_response_r7 r7; + int ret; + struct sd_card *sd_card = (struct sd_card *)card->prot_card; + struct mss_ios ios; + struct mss_host *host = card->slot->host; + struct mss_ll_request *llreq = &sd_card->llreq; + struct mss_cmd *cmd = &sd_card->cmd; + + card->state = CARD_STATE_IDLE; + card->bus_width = MSS_BUSWIDTH_1BIT; + + memcpy(&ios, &host->ios, sizeof(struct mss_ios)); + ios.bus_mode = MSS_BUSMODE_OPENDRAIN; + ios.clock = host->f_min; + ios.bus_width = MSS_BUSWIDTH_1BIT; + host->ops->set_ios(host, &ios); + + card->card_type = MSS_UNKNOWN_CARD; + + ret = mss_send_simple_ll_req(host, llreq, cmd, + SD_GO_IDLE_STATE, 0, MSS_RESPONSE_NONE, MSS_CMD_INIT); + if (ret) + return ret; + if (host->sd_spec == MSS_SD_SPEC_20) { + if (!(host->vdd & MSS_VDD_27_36)) + return MSS_ERROR_NO_PROTOCOL; + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SEND_IF_COND, + 0x1AA, MSS_RESPONSE_R7, 0); + if (ret == MSS_ERROR_TIMEOUT) + goto next; + else if (ret) + return ret; + ret = sd_unpack_r7(cmd, &r7, 0x1AA, sd_card); + if (!ret) { + sd_card->ver = MSS_SD_SPEC_20; + goto next; + } + else + return ret; + } +next: + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_APP_CMD, 0, + MSS_RESPONSE_R1, 0); + if (ret) + return ret; + ret = sd_unpack_r1(cmd, &r1, sd_card); + if (ret) + return ret; + + + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SD_SEND_OP_COND, 0, + MSS_RESPONSE_R3, 0); + if (ret) + return ret; + ret = sd_unpack_r3(cmd, &r3, sd_card); + if (ret) + return ret; + + if (r3.ocr & host->vdd) { + card->card_type = MSS_SD_CARD; + sd_card->ver = MSS_SD_SPEC_20; + } + else + card->card_type = MSS_UNCOMPATIBLE_CARD; + + return MSS_ERROR_NONE; +} + + +/** + * sd_card_init + * @dev: mss_card_device + * + * return value: 0: success, -1: failed + */ +static int sd_card_init(struct mss_card *card) +{ + struct sd_response_r1 r1; + struct sd_response_r3 r3; + struct sd_response_r6 r6; + struct sd_response_r7 r7; + struct sd_cid cid; + int ret; + struct sd_card * sd_card= (struct sd_card *)card->prot_card; + struct mss_ios ios; + struct mss_host *host = card->slot->host; + struct mss_ll_request *llreq = &sd_card->llreq; + struct mss_cmd *cmd = &sd_card->cmd; + int hcs = 0; + + sd_card->state = CARD_STATE_IDLE; + card->bus_width = MSS_BUSWIDTH_1BIT; + sd_card->rca = 0; + + memcpy(&ios, &host->ios, sizeof(struct mss_ios)); + ios.bus_mode = MSS_BUSMODE_OPENDRAIN; + ios.bus_width = MSS_BUSWIDTH_1BIT; + ios.clock = host->f_min; + host->ops->set_ios(host, &ios); + + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_GO_IDLE_STATE, 0, + MSS_RESPONSE_NONE, MSS_CMD_INIT); + if (ret) + return ret; + /* + * We have to send cmd 8 to 2.0 card. It will tell the card that the + * host support 2.0 spec. + */ + if (sd_card->ver == MSS_SD_SPEC_20 && host->sd_spec == MSS_SD_SPEC_20) { + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SEND_IF_COND, + 0x1AA, MSS_RESPONSE_R7, 0); + if (ret) + return ret; + ret = sd_unpack_r7(cmd, &r7, 0x1AA, sd_card); + if (ret) + return ret; + if (host->high_capacity) + hcs = 1; + } + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_APP_CMD, 0, + MSS_RESPONSE_R1, 0); + if (ret) + return ret; + ret = sd_unpack_r1(cmd, &r1, sd_card); + if (ret) + return ret; + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SD_SEND_OP_COND, + hcs << 30 | host->vdd, MSS_RESPONSE_R3, 0); + if (ret) + return ret; + ret = sd_unpack_r3(cmd, &r3, sd_card); + if (ret) + return ret; + while (!(r3.ocr & SD_OCR_CARD_BUSY)) { + //mdelay(20); + msleep(15); + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_APP_CMD, 0, + MSS_RESPONSE_R1, 0); + if (ret) + return ret; + ret = sd_unpack_r1(cmd, &r1, sd_card); + if (ret) + return ret; + + ret = mss_send_simple_ll_req(host, llreq, cmd, + SD_SD_SEND_OP_COND, hcs << 30 | host->vdd, + MSS_RESPONSE_R3, 0); + if (ret) + return ret; + ret = sd_unpack_r3(cmd, &r3, sd_card); + if (ret) + return ret; + } + memcpy(&sd_card->ocr, &r3.ocr, sizeof(r3.ocr)); + sd_card->state = CARD_STATE_READY; + + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_ALL_SEND_CID, 0, + MSS_RESPONSE_R2_CID, 0); + if (ret) + return ret; + + memset(&cid, 0x0, sizeof(struct sd_cid)); + ret = sd_unpack_cid(cmd, &cid, sd_card); + if (ret) + return ret; + + if (sd_card->cid.mid != 0) { + if (sd_card->cid.mid != cid.mid || sd_card->cid.oid != cid.oid + || sd_card->cid.prv != cid.prv + || sd_card->cid.psn != cid.psn + || sd_card->cid.mdt != cid.mdt + || memcmp(sd_card->cid.pnm, cid.pnm, 6)) + return MSS_ERROR_MISMATCH_CARD; + + if (memcmp(&cid, &sd_card->cid, sizeof(struct sd_cid))) + return MSS_ERROR_MISMATCH_CARD; + } + else + memcpy(&sd_card->cid, &cid, sizeof(struct sd_cid)); + + sd_card->state = CARD_STATE_IDENT; + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SEND_RELATIVE_ADDR, + 0, MSS_RESPONSE_R6, 0); + if (ret) + return ret; + ret = sd_unpack_r6(cmd, &r6, sd_card); + if (ret) + return ret; + sd_card->state = CARD_STATE_STBY; + sd_card->rca = r6.rca; + + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SEND_CSD, + sd_card->rca << 16, MSS_RESPONSE_R2_CSD, 0); + if (ret) + return ret; + ret = sd_unpack_csd(cmd, &sd_card->csd, sd_card); + if (ret) + return ret; + + if (host->ops->is_slot_wp && host->ops->is_slot_wp(card->slot)) + card->state |= MSS_CARD_WP; + + return MSS_ERROR_NONE; +} + +static int sd_read_write_entry(struct mss_card *card, int action, struct mss_rw_arg *arg, struct mss_rw_result *result) +{ + struct sd_response_r1 r1; + struct mss_host *host = card->slot->host; + struct mss_ios ios; + int ret, retries = 4; + struct sd_card *sd_card = (struct sd_card *)card->prot_card; + struct mss_ll_request *llreq = &sd_card->llreq; + struct mss_cmd *cmd = &sd_card->cmd; + struct mss_data *data = &sd_card->data; + struct scatterlist sg; + char *g_buffer = sd_card->buf; + int status; + u32 clock; + u32 cmdarg, blklen, opcode, flags; + + dbg5("block:%d, nob:%d, blok_len:%d", arg->block, arg->nob, arg->block_len); + ret = sd_get_status(card, &status); + if (ret) + return ret; + + if (status & R1_CARD_IS_LOCKED) + return MSS_ERROR_LOCKED; + + if (action == MSS_WRITE_MEM && host->ops->is_slot_wp && + host->ops->is_slot_wp(card->slot)) + return MSS_ERROR_WP; + + if (sd_card->state == CARD_STATE_STBY) { + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SELECT_CARD, + sd_card->rca << 16, MSS_RESPONSE_R1B, 0); + if (ret) + return ret; + ret = sd_unpack_r1(cmd, &r1, sd_card); + if (ret) + return ret; + } + sd_card->state = CARD_STATE_TRAN; + + sd_fix_request_block_len(card, action, arg); + + + if (!sd_card->scr.init) { + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_APP_CMD, + sd_card->rca << 16, MSS_RESPONSE_R1, 0); + if (ret) + return ret; + + sg.page = virt_to_page(g_buffer); + sg.offset = offset_in_page(g_buffer); + sg.length = 8; + + memset(llreq, 0x0, sizeof(struct mss_ll_request)); + memset(cmd, 0x0, sizeof(struct mss_cmd)); + memset(data, 0x0, sizeof(struct mss_data)); + MSS_INIT_CMD(cmd, SD_SEND_SCR, 0, 0, MSS_RESPONSE_R1); + MSS_INIT_DATA(data, 1, 8, MSS_DATA_READ, 1, &sg, 0); + llreq->cmd = cmd; + llreq->data = data; + + ret = mss_send_ll_req(host, llreq); + if (ret) + return ret; + ret = sd_unpack_scr(g_buffer, &sd_card->scr); + if (ret) + return ret; + } + if (sd_card->scr.sd_bus_width == SCR_BUSWIDTH_1BIT) { + mss_set_buswidth(host, MSS_BUSWIDTH_1BIT); + card->bus_width = MSS_BUSWIDTH_1BIT; + } + else { + if (card->bus_width == MSS_BUSWIDTH_1BIT + && host->bus_width == MSS_BUSWIDTH_4BIT) { + mss_set_buswidth(host, MSS_BUSWIDTH_4BIT); + card->bus_width = MSS_BUSWIDTH_4BIT; + ret = mss_send_simple_ll_req(host, llreq, cmd, + SD_APP_CMD, sd_card->rca << 16, + MSS_RESPONSE_R1, 0); + if (ret) + return ret; + ret = sd_unpack_r1(cmd, &r1, sd_card); + if (ret) + return ret; + ret = mss_send_simple_ll_req(host, llreq, cmd, + SD_SET_BUS_WIDTH, 0x2, MSS_RESPONSE_R1, + 0); + if (ret) + return ret; + ret = sd_unpack_r1(cmd, &r1, sd_card); + if (ret) + return ret; + card->bus_width = MSS_BUSWIDTH_4BIT; + } + } + memset(llreq, 0x0, sizeof(struct mss_ll_request)); + memset(cmd, 0x0, sizeof(struct mss_cmd)); + memset(data, 0x0, sizeof(struct mss_data)); + + memcpy(&ios, &host->ios, sizeof(struct mss_ios)); + if ((sd_card->ocr & SD_OCR_CCS) && host->high_capacity) { + ios.access_mode = MSS_ACCESS_MODE_SECTOR; + cmdarg = arg->block; + blklen = 512; + } + else { + if (arg->block_len != sd_card->block_len) { + ret = mss_send_simple_ll_req(host, llreq, cmd, + SD_SET_BLOCKLEN, arg->block_len, + MSS_RESPONSE_R1, 0); + if (ret) + return ret; + ret = sd_unpack_r1(cmd, &r1, sd_card); + if (ret) + return ret; + sd_card->block_len = arg->block_len; + } + cmdarg = arg->block * arg->block_len; + blklen = arg->block_len; + } + ios.clock = sd_tran_speed(sd_card->csd.tran_speed); + host->ops->set_ios(host, &ios); + + llreq->cmd = cmd; + llreq->data = data; + +read_write_entry: + + if (arg->nob > 1) { + if (action == MSS_READ_MEM) { + opcode = SD_READ_MULTIPLE_BLOCK; + flags = MSS_DATA_READ | MSS_DATA_MULTI; + } + else { + opcode = SD_WRITE_MULTIPLE_BLOCK; + flags = MSS_DATA_WRITE | MSS_DATA_MULTI; + } + + MSS_INIT_CMD(cmd, opcode, cmdarg, 0, MSS_RESPONSE_R1); + MSS_INIT_DATA(data, arg->nob, blklen, flags, arg->sg_len, + arg->sg, 0); + + ret = mss_send_ll_req(host, llreq); + if (!ret) + ret = sd_unpack_r1(cmd, &r1, sd_card); + sd_card->state = (action == MSS_WRITE_MEM) ? CARD_STATE_RCV : CARD_STATE_DATA; + if (ret) { + mss_send_simple_ll_req(host, llreq, cmd, + SD_STOP_TRANSMISSION, 0, + (action == MSS_WRITE_MEM) ? + MSS_RESPONSE_R1B : MSS_RESPONSE_R1, 0); + sd_card->state = CARD_STATE_TRAN; + if (--retries) { + clock = host->ios.clock; + clock = clock >> 1; + if (clock < SD_CARD_CLOCK_SLOW && retries == 1) + clock = SD_CARD_CLOCK_SLOW; + mss_set_clock(host, clock); + goto read_write_entry; + } + return ret; + } + ret = mss_send_simple_ll_req(host, llreq, cmd, + SD_STOP_TRANSMISSION, 0, + (action == MSS_WRITE_MEM) ? + MSS_RESPONSE_R1B : MSS_RESPONSE_R1, 0); + if (ret) + return ret; + ret = sd_unpack_r1(cmd, &r1, sd_card); + sd_card->state = CARD_STATE_TRAN; + if (ret && (sd_card->errno != SD_ERROR_OUT_OF_RANGE)) + return ret; + } else { + if (action == MSS_READ_MEM) { + opcode = SD_READ_SINGLE_BLOCK; + flags = MSS_DATA_READ; + } + else { + opcode = SD_WRITE_BLOCK; + flags = MSS_DATA_WRITE; + } + MSS_INIT_CMD(cmd, opcode, cmdarg, 0, MSS_RESPONSE_R1); + MSS_INIT_DATA(data, arg->nob, blklen, flags, arg->sg_len, + arg->sg, 0); + + ret = mss_send_ll_req(host, llreq); + if (!ret) + ret = sd_unpack_r1(cmd, &r1, sd_card); + if (ret) { + if (--retries) { + clock = host->ios.clock; + clock = clock >> 1; + if (clock < SD_CARD_CLOCK_SLOW && retries == 1) + clock = SD_CARD_CLOCK_SLOW; + mss_set_clock(host, clock); + goto read_write_entry; + } + return ret; + } + } + /* Deselect the card */ + /*mmc_simple_ll_req(host, mmc_card, MMC_SELECT_CARD, + 0, MSS_RESPONSE_NONE, 0); + if (ret) + return ret; + ret = mmc_unpack_r1(&mmc_card->cmd, &r1, mmc_card); + mmc_card->state = CARD_STATE_STBY;*/ + if (ret) + return ret; + result->bytes_xfered = data->bytes_xfered; + + return MSS_ERROR_NONE; +} + +static int sd_query_function(struct mss_card *card, struct io_swfunc_request *r, struct sw_func_status *status) +{ + struct sd_card *sd_card = card->prot_card; + int i; + u32 arg = 0; + + if (card->slot->host->sd_spec != MSS_SD_SPEC_20 + || sd_card->ver != MSS_SD_SPEC_20) + return MSS_ERROR_ACTION_UNSUPPORTED; + for (i = 5; i > 0; i--) { + arg |= ((r->args[i] & 0xF) << (i << 2)); + } + return sd_send_cmd6(card, status, 0, arg); +} + +static int sd_sw_function(struct mss_card *card, struct io_swfunc_request *r) +{ + int ret, i; + u32 arg = 0; + struct sw_func_status status; + struct sd_card *sd_card = card->prot_card; + + if (card->slot->host->sd_spec != MSS_SD_SPEC_20 + || sd_card->ver != MSS_SD_SPEC_20) + return MSS_ERROR_ACTION_UNSUPPORTED; + for (i = 0; i < 6; i++) { + if (r->args[i] >= 0xF) { + goto switch_err; + } + } + /* Step 1: CMD6(mode = 0, func = 0xF(Don't Care) */ + ret = sd_send_cmd6(card, &status, 0, 0xFFFFFF); + if (ret) + goto switch_err; + + /* Step 2: Any Switch ? */ + for (i = 0; i < 6; i++) { + if (!((status.func_support[i]) & (0x1 << (r->args[i])))) + goto switch_err; + } + + for (i = 0; i < 6; i++) { + if (status.group_status[i] != r->args[i]) { + break; + } + } + if (i == 6) + return 0; + + /* Step 3: CMD6(mode = 0, func= funcX */ + for (i = 5; i > 0; i--) { + arg |= ((r->args[i]) << (i << 2)); + } + ret = sd_send_cmd6(card, &status, 0, arg); + if (ret) + goto switch_err; + if (status.current_consumption > r->current_acceptable) { + goto switch_err; + } + for (i = 0; i < 6; i++) { + if (status.group_status[i] != r->args[i]) { + goto switch_err; + } + } + ret = sd_send_cmd6(card, &status, 1, arg); + if (ret) + goto switch_err; + for (i = 0; i < 6; i++) { + if (status.group_status[i] != r->args[i]) { + goto switch_err; + } + } + return 0; +switch_err: + sd_card->errno = SD_ERROR_SWFUNC; + return MSS_ERROR_ACTION_UNSUPPORTED; +} +/* count by 512 bytes */ +static int sd_get_capacity(struct mss_card *card, u32 *size) +{ + struct sd_card *sd_card = card->prot_card; + int c_size = 0; + int c_size_mult = 0; + int blk_len = 0; + + if (sd_card->csd.csd_structure == 0) { + c_size = sd_card->csd.csd.csd1.c_size; + c_size_mult = sd_card->csd.csd.csd1.c_size_mult; + blk_len = sd_card->csd.read_bl_len - 9; + } + /* (csize + 1) * 512 * 1024 bytes */ + else if (sd_card->csd.csd_structure == 1) { + c_size = sd_card->csd.csd.csd2.c_size; + c_size_mult = 7; + blk_len = 2; + } + *size = (c_size + 1) << (2 + c_size_mult + blk_len); + return MSS_ERROR_NONE; +} + + + +/***************************************************************************** + * + * protocol driver interface functions + * + ****************************************************************************/ +static int sd_prot_entry(struct mss_card *card, unsigned int action, void *arg, void *result) +{ + int ret; + u32 status; + + if (action != MSS_RECOGNIZE_CARD && card->card_type != MSS_SD_CARD) + return MSS_ERROR_WRONG_CARD_TYPE; + switch (action) { + case MSS_RECOGNIZE_CARD: + ret = sd_recognize_card(card); + break; + case MSS_INIT_CARD: + ret = sd_card_init(card); + break; + case MSS_READ_MEM: + case MSS_WRITE_MEM: + if (!arg || !result) + return -EINVAL; + ret = sd_read_write_entry(card, action, arg, result); + break; + /* + case MSS_LOCK_UNLOCK: + ret = sd_lock_unlock_entry(dev); + break; + */ + case MSS_SD_QUERY_FUNC: + if (!arg || !result) + return -EINVAL; + ret = sd_query_function(card, arg, result); + break; + case MSS_SD_SW_FUNC: + if (!arg) + return -EINVAL; + ret = sd_sw_function(card, arg); + break; + case MSS_QUERY_CARD: + ret = sd_get_status(card, &status); + break; + case MSS_GET_CAPACITY: + ret = sd_get_capacity(card, result); + break; + default: + ret = MSS_ERROR_ACTION_UNSUPPORTED; + break; + } + return ret; +} + +static int sd_prot_attach_card(struct mss_card *card) +{ + struct sd_card *sd_card; + +#define ALIGN32(x) (((x) + 31) & (~31)) + sd_card = kzalloc(ALIGN32(ALIGN32(sizeof(struct sd_card))) + 512, + GFP_KERNEL); + card->prot_card = sd_card; + if (sd_card) { + sd_card->buf = (char *)ALIGN32((unsigned int)&sd_card[1]); + return 0; + } + return -ENOMEM; +} + +static void sd_prot_detach_card(struct mss_card *card) +{ + kfree(card->prot_card); +} + +static int sd_prot_get_errno(struct mss_card *card) +{ + struct sd_card *sd_card = card->prot_card; + + return sd_card->errno; +} + +static struct mss_prot_driver sd_protocol = { + .name = SD_PROTOCOL, + .prot_entry = sd_prot_entry, + .attach_card = sd_prot_attach_card, + .detach_card = sd_prot_detach_card, + .get_errno = sd_prot_get_errno, +}; + +/***************************************************************************** + * + * module init and exit functions + * + ****************************************************************************/ +static int sd_protocol_init(void) +{ + register_mss_prot_driver(&sd_protocol); + return 0; +} + +static void sd_protocol_exit(void) +{ + unregister_mss_prot_driver(&sd_protocol); +} + + +module_init(sd_protocol_init); +module_exit(sd_protocol_exit); + +MODULE_AUTHOR("Bridge Wu"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("SD protocol driver"); --- linux-2.6.24.orig/drivers/mmc/mss/mss_sdhci.h +++ linux-2.6.24/drivers/mmc/mss/mss_sdhci.h @@ -0,0 +1,248 @@ +/* + * mss_sdhci.h - SD Host Controller interface driver + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/* + * derived from linux/drivers/mmc/sdhci.h + * Copyright (c) 2005 Pierre Ossman + */ + + +/* + * PCI registers + */ +#define MSS_VDD_150 0 +#define MSS_VDD_155 1 +#define MSS_VDD_160 2 +#define MSS_VDD_165 3 +#define MSS_VDD_170 4 +#define MSS_VDD_180 5 +#define MSS_VDD_190 6 +#define MSS_VDD_200 7 +#define MSS_VDD_210 8 +#define MSS_VDD_220 9 +#define MSS_VDD_230 10 +#define MSS_VDD_240 11 +#define MSS_VDD_250 12 +#define MSS_VDD_260 13 +#define MSS_VDD_270 14 +#define MSS_VDD_280 15 +#define MSS_VDD_290 16 +#define MSS_VDD_300 17 +#define MSS_VDD_310 18 +#define MSS_VDD_320 19 +#define MSS_VDD_330 20 +#define MSS_VDD_340 21 +#define MSS_VDD_350 22 +#define MSS_VDD_360 23 + +#define PCI_SDHCI_IFPIO 0x00 +#define PCI_SDHCI_IFDMA 0x01 +#define PCI_SDHCI_IFVENDOR 0x02 + +#define PCI_SLOT_INFO 0x40 /* 8 bits */ +#define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7) +#define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07 + +/* + * Controller registers + */ +#define SDHCI_DMA_ADDRESS 0x00 +#define SDHCI_BLOCK_SIZE 0x04 +#define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF)) + +#define SDHCI_BLOCK_COUNT 0x06 +#define SDHCI_ARGUMENT 0x08 + +#define SDHCI_TRANSFER_MODE 0x0C +#define SDHCI_TRNS_DMA 0x01 +#define SDHCI_TRNS_BLK_CNT_EN 0x02 +#define SDHCI_TRNS_ACMD12 0x04 +#define SDHCI_TRNS_READ 0x10 +#define SDHCI_TRNS_MULTI 0x20 + +#define SDHCI_COMMAND 0x0E +#define SDHCI_CMD_RESP_MASK 0x03 +#define SDHCI_CMD_CRC 0x08 +#define SDHCI_CMD_INDEX 0x10 +#define SDHCI_CMD_DATA 0x20 + +#define SDHCI_CMD_RESP_NONE 0x00 +#define SDHCI_CMD_RESP_LONG 0x01 +#define SDHCI_CMD_RESP_SHORT 0x02 +#define SDHCI_CMD_RESP_SHORT_BUSY 0x03 + +#define SDHCI_MAKE_CMD(c, f) (((c & 0xff) << 8) | (f & 0xff)) + +#define SDHCI_RESPONSE 0x10 +#define SDHCI_BUFFER 0x20 +#define SDHCI_PRESENT_STATE 0x24 + +#define SDHCI_CMD_INHIBIT 0x00000001 +#define SDHCI_DATA_INHIBIT 0x00000002 +#define SDHCI_DOING_WRITE 0x00000100 +#define SDHCI_DOING_READ 0x00000200 +#define SDHCI_SPACE_AVAILABLE 0x00000400 +#define SDHCI_DATA_AVAILABLE 0x00000800 +#define SDHCI_CARD_PRESENT 0x00010000 +#define SDHCI_WRITE_PROTECT 0x00080000 + +#define SDHCI_HOST_CONTROL 0x28 +#define SDHCI_CTRL_LED 0x01 +#define SDHCI_CTRL_4BITBUS 0x02 +#define SDHCI_CTRL_HISPD 0x04 + +#define SDHCI_POWER_CONTROL 0x29 +#define SDHCI_POWER_ON 0x01 +#define SDHCI_POWER_180 0x0A +#define SDHCI_POWER_300 0x0C +#define SDHCI_POWER_330 0x0E + +#define SDHCI_BLOCK_GAP_CONTROL 0x2A + +#define SDHCI_WALK_UP_CONTROL 0x2B + +#define SDHCI_CLOCK_CONTROL 0x2C +#define SDHCI_DIVIDER_SHIFT 8 +#define SDHCI_CLOCK_CARD_EN 0x0004 +#define SDHCI_CLOCK_INT_STABLE 0x0002 +#define SDHCI_CLOCK_INT_EN 0x0001 + +#define SDHCI_TIMEOUT_CONTROL 0x2E + +#define SDHCI_SOFTWARE_RESET 0x2F +#define SDHCI_RESET_ALL 0x01 +#define SDHCI_RESET_CMD 0x02 +#define SDHCI_RESET_DATA 0x04 + +#define SDHCI_INT_STATUS 0x30 +#define SDHCI_INT_ENABLE 0x34 +#define SDHCI_SIGNAL_ENABLE 0x38 +#define SDHCI_INT_RESPONSE 0x00000001 +#define SDHCI_INT_DATA_END 0x00000002 +#define SDHCI_INT_BLK_GAP 0x00000004 +#define SDHCI_INT_DMA_END 0x00000008 +#define SDHCI_INT_SPACE_AVAIL 0x00000010 +#define SDHCI_INT_DATA_AVAIL 0x00000020 +#define SDHCI_INT_CARD_INSERT 0x00000040 +#define SDHCI_INT_CARD_REMOVE 0x00000080 +#define SDHCI_INT_CARD_INT 0x00000100 +#define SDHCI_INT_ERROR 0x00008000 +#define SDHCI_INT_TIMEOUT 0x00010000 +#define SDHCI_INT_CRC 0x00020000 +#define SDHCI_INT_END_BIT 0x00040000 +#define SDHCI_INT_INDEX 0x00080000 +#define SDHCI_INT_DATA_TIMEOUT 0x00100000 +#define SDHCI_INT_DATA_CRC 0x00200000 +#define SDHCI_INT_DATA_END_BIT 0x00400000 +#define SDHCI_INT_BUS_POWER 0x00800000 +#define SDHCI_INT_ACMD12ERR 0x01000000 + +#define SDHCI_INT_NORMAL_MASK 0x00007FFF +#define SDHCI_INT_ERROR_MASK 0xFFFF8000 + +#define SDHCI_INT_CMD_MASK (SDHCI_INT_RESPONSE | SDHCI_INT_TIMEOUT | \ + SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX) +#define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \ + SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \ + SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \ + SDHCI_INT_DATA_END_BIT) + +#define SDHCI_ACMD12_ERR 0x3C + +/* 3E-3F reserved */ + +#define SDHCI_CAPABILITIES 0x40 +#define SDHCI_TIMEOUT_CLK_MASK 0x0000003F +#define SDHCI_TIMEOUT_CLK_SHIFT 0 +#define SDHCI_TIMEOUT_CLK_UNIT 0x00000080 +#define SDHCI_CLOCK_BASE_MASK 0x00003F00 +#define SDHCI_CLOCK_BASE_SHIFT 8 +#define SDHCI_MAX_BLOCK_MASK 0x00030000 +#define SDHCI_MAX_BLOCK_SHIFT 16 +#define SDHCI_CAN_DO_HISPD 0x00200000 +#define SDHCI_CAN_DO_DMA 0x00400000 +#define SDHCI_CAN_VDD_330 0x01000000 +#define SDHCI_CAN_VDD_300 0x02000000 +#define SDHCI_CAN_VDD_180 0x04000000 + +/* 44-47 reserved for more caps */ + +#define SDHCI_MAX_CURRENT 0x48 + +/* 4C-4F reserved for more max current */ +/* 50-FB reserved */ + +#define SDHCI_SLOT_INT_STATUS 0xFC + +#define SDHCI_HOST_VERSION 0xFE +#define SDHCI_VENDOR_VER_MASK 0xFF00 +#define SDHCI_VENDOR_VER_SHIFT 8 +#define SDHCI_SPEC_VER_MASK 0x00FF +#define SDHCI_SPEC_VER_SHIFT 0 + +#define SDHCI_USE_DMA (1<<0) + +struct sdhci_chip; + +struct sdhci_host { + struct sdhci_chip *chip; + struct mss_host *mmc; /* MMC structure */ + + spinlock_t lock; /* Mutex */ + int flags; /* Host attributes */ + + + unsigned int max_clk; /* Max possible freq (MHz) */ + unsigned int timeout_clk; /* Timeout freq (KHz) */ + unsigned int max_block; /* Max block size (bytes) */ + + unsigned int clock; /* Current clock (MHz) */ + unsigned short power; /* Current voltage */ + + struct mss_ll_request *mrq; /* Current request */ + struct mss_cmd *cmd; /* Current command */ + struct mss_data *data; /* Current data request */ + struct mss_card *card; + + struct scatterlist *cur_sg; /* We're working on this */ + char *mapped_sg; /* This is where it's mapped */ + int num_sg; /* Entries left */ + int offset; /* Offset into current sg */ + int remain; /* Bytes left in current */ + int size; /* Remaining bytes in transfer */ + + char slot_descr[20]; /* Name for reservations */ + int irq; /* Device IRQ */ + int bar; /* PCI BAR index */ + unsigned long addr; /* Bus address */ + void __iomem * ioaddr; /* Mapped address */ + + struct tasklet_struct card_tasklet; /* Tasklet structures */ + struct tasklet_struct finish_tasklet; + + struct timer_list timer; /* Timer for timeouts */ +}; + +struct sdhci_chip { + struct pci_dev *pdev; + unsigned long quirks; + int num_slots; /* Slots on controller */ + struct sdhci_host *hosts[0]; /* Pointers to hosts */ +}; --- linux-2.6.24.orig/drivers/mmc/mss/Makefile +++ linux-2.6.24/drivers/mmc/mss/Makefile @@ -0,0 +1,13 @@ +# +# Makefile for the kernel MSS(mmc/sd/sdio) device drivers. +# + +# Core +obj-$(CONFIG_MSS) += mss_core.o mmc_protocol.o sdio_protocol.o sd_protocol.o + +# Media drivers +obj-$(CONFIG_MSS_BLOCK) += mss_block.o + +# Host drivers +obj-$(CONFIG_MSS_SDHCI) += mss_sdhci.o + --- linux-2.6.24.orig/drivers/mmc/mss/mss_block.c +++ linux-2.6.24/drivers/mmc/mss/mss_block.c @@ -0,0 +1,555 @@ +/* + * mss_block.c - MMC/SD Card driver (block device driver) + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from previous mmc code in Linux kernel + * Copyright (c) 2002 Hewlett-Packard Company + * Copyright (c) 2002 Andrew Christian + * Copyright (c) 2006 Bridge Wu + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include + +#include + +#define MSS_SHIFT 3 +#define MSS_SECTOR_SIZE (512) + +static int major; + +struct mss_disk { + struct request_queue *queue; + struct gendisk *disk; + struct mss_card *card; + struct class_device cdev; + + u32 flags; /* for suspend/resume */ +#define MSS_QUEUE_SUSPENDED (1 << 1) +#define MSS_QUEUE_EXIT (1 << 0) + struct completion thread_complete; + struct semaphore thread_sem; + wait_queue_head_t thread_wq; + spinlock_t request_lock; + struct scatterlist *sg; + struct request *req; +}; + +#define MSS_NUM_MINORS (256 << MSS_SHIFT) + +static unsigned long dev_use[MSS_NUM_MINORS/8*sizeof(unsigned long)]; + +static DECLARE_MUTEX(md_ref_mutex); + +static struct mss_disk *mss_disk_get(struct gendisk *disk) +{ + struct mss_disk *md; + + down(&md_ref_mutex); + md = disk->private_data; + if (md) { + if (mss_card_get(md->card) == 0) + class_device_get(&md->cdev); + else + md = NULL; + } + up(&md_ref_mutex); + + return md; +} + +static void mss_disk_put(struct mss_disk *md) +{ + struct mss_card *card = md->card; + + down(&md_ref_mutex); + class_device_put(&md->cdev); + mss_card_put(card); + up(&md_ref_mutex); +} + +static void mss_disk_release(struct class_device *cdev) +{ + struct mss_disk *md = container_of(cdev, struct mss_disk, cdev); + struct gendisk *disk = md->disk; + + /* Release the minor number */ + __clear_bit(disk->first_minor >> MSS_SHIFT, dev_use); + + put_disk(md->disk); + + /* Terminate the request handler thread */ + md->flags |= MSS_QUEUE_EXIT; + wake_up(&md->thread_wq); + wait_for_completion(&md->thread_complete); + + kfree(md->sg); + md->sg = NULL; + + blk_cleanup_queue(md->queue); + + put_device(&md->card->dev); + md->card = NULL; + kfree(md); +} + +static struct class mss_disk_class = { + .name = "mss disk", + .owner = THIS_MODULE, + .release = mss_disk_release, + //.class_dev_attrs = mss_disk_attrs, +}; + +static int mss_media_transfer(struct mss_disk *md, struct request *req) +{ + struct mss_request mreq; + struct mss_rw_arg marg; + struct mss_rw_result mres; + int ret; + + memset(&mreq, 0x0, sizeof(mreq)); + memset(&marg, 0x0, sizeof(marg)); + memset(&mres, 0x0, sizeof(marg)); + + mreq.arg = &marg; + mreq.result = &mres; + mreq.card = md->card; + do { + if (rq_data_dir(req) == READ) + mreq.action = MSS_READ_MEM; + else + mreq.action = MSS_WRITE_MEM; + + marg.nob = req->nr_sectors; + /* FIXME */ + marg.block_len = MSS_SECTOR_SIZE; + marg.block = req->sector; + marg.sg = md->sg; + marg.sg_len = blk_rq_map_sg(req->q, req, marg.sg); + + ret = mss_send_request(&mreq); + if (ret) + goto err; + dbg5("successful, bytes transfer :%x\n", mres.bytes_xfered); + ret = end_that_request_chunk(req, 1, mres.bytes_xfered); + if (!ret) { + add_disk_randomness(md->disk); + blkdev_dequeue_request(req); + end_that_request_last(req, 0); + } + } while (ret); + + return 1; +err: + dbg5("error, bytes transfer :%x\n", mres.bytes_xfered); + do { + ret = end_that_request_chunk(req, 0, + req->current_nr_sectors << 9); + } while (ret); + + add_disk_randomness(md->disk); + blkdev_dequeue_request(req); + end_that_request_last(req, 0); + + return 0; +} + +static int mss_queue_thread(void *d) +{ + struct mss_disk *md = d; + DECLARE_WAITQUEUE(wait, current); + + current->flags |= PF_MEMALLOC; + + daemonize("mmcqd%d", md->disk->first_minor >> MSS_SHIFT); + + complete(&md->thread_complete); + + down(&md->thread_sem); + add_wait_queue(&md->thread_wq, &wait); + do { + struct request *req = NULL; + + + /* masked by Feng */ + /* try_to_freeze(); */ + spin_lock_irq(&md->request_lock); + set_current_state(TASK_INTERRUPTIBLE); + if (!blk_queue_plugged(md->queue)) + md->req = req = elv_next_request(md->queue); + spin_unlock_irq(&md->request_lock); + + if (!req) { + if (md->flags & MSS_QUEUE_EXIT) + break; + up(&md->thread_sem); + schedule(); + down(&md->thread_sem); + continue; + } + set_current_state(TASK_RUNNING); + + mss_media_transfer(md, req); + } while (1); + remove_wait_queue(&md->thread_wq, &wait); + up(&md->thread_sem); + + complete_and_exit(&md->thread_complete, 0); + return 0; +} + +static int mss_media_preq(struct request_queue *q, struct request *req) +{ + struct mss_disk *md = q->queuedata; + if (!md || !md->card || + (md->card->state & (MSS_CARD_REMOVING | MSS_CARD_INVALID))) { + return BLKPREP_KILL; + } + return BLKPREP_OK; +} + + +/** + * mss_media_request + * @q: request queue + * + * entry function to request handling of MMC/SD block device driver. + * handle a request from request queue generated by upper layer. + */ +static void mss_media_request(request_queue_t *q) +{ + struct mss_disk *md = q->queuedata; + + if (md && !md->req) + wake_up(&md->thread_wq); +} + + +static int mss_blk_open(struct inode *inode, struct file *filp) +{ + struct gendisk *disk = inode->i_bdev->bd_disk; + struct mss_disk *md; + + md = mss_disk_get(disk); + if (!md) + return -ENXIO; + + if ((filp->f_mode & FMODE_WRITE) && (md->card->state & MSS_CARD_WP)) + return -EROFS; + /* FIXME check media change */ + check_disk_change(inode->i_bdev); + return 0; +} + +static int mss_blk_release(struct inode *inode, struct file *filep) +{ + struct gendisk *disk = inode->i_bdev->bd_disk; + struct mss_disk *md = disk->private_data; + + mss_disk_put(md); + return 0; +} + +static struct block_device_operations mss_bdops = { + .open = mss_blk_open, + .release = mss_blk_release, + //.media_changed = mss_media_changed, + //.revalidate_disk = mss_media_revalidate_disk, + .owner = THIS_MODULE, +}; + +/***************************************************************************** + * + * device driver functions + * + ****************************************************************************/ + +/** + * mss_card_probe + * @dev: device + * + * probe method to initialize block device. + * initialize mss_block_device, set capacity, load block driver(add_disk). + * + * invoked by bus_match (invoked by device_register or driver_register) + * must have device and driver, or this function cannot be invoked. + */ +static int mss_blk_probe(struct device *dev) +{ + struct mss_disk *md; + struct mss_card *card; + struct mss_host *host; + int devidx, ret = 0; + u64 limit = BLK_BOUNCE_HIGH; + + dbg5("read to probe card"); + devidx = find_first_zero_bit(dev_use, MSS_NUM_MINORS); + if (devidx >= MSS_NUM_MINORS) { + printk(KERN_ERR "can not find available minors"); + return -ENOSPC; + } + __set_bit(devidx, dev_use); + + card = container_of(dev, struct mss_card, dev); + + host = card->slot->host; + if (card->card_type != MSS_MMC_CARD && card->card_type != MSS_SD_CARD) { + printk(KERN_ERR "card(slot%d, host%d) is not memory card\n", + card->slot->id, host->id); + ret = -ENOTBLK; + goto clear_bit; + } + + md = kzalloc(sizeof(*md), GFP_KERNEL); + if (!md) { + printk(KERN_ERR "card(slot%d, host%d) alloc block_dev failed!" + "\n", card->slot->id, host->id); + ret = -ENOMEM; + goto clear_bit; + } + md->card = card; + md->disk = alloc_disk(1 << MSS_SHIFT); + if (md->disk == NULL) { + printk(KERN_ERR "card(slot%d, host%d) alloc disk failed!\n", + card->slot->id, host->id); + ret = -ENOMEM; + goto free_data; + } + md->disk->major = major; + md->disk->first_minor = devidx << MSS_SHIFT; + md->disk->fops = &mss_bdops; + md->disk->driverfs_dev = &card->dev; + md->disk->private_data = md; +// sprintf(md->disk->devfs_name, "mssblk%d", devidx); + sprintf(md->disk->disk_name, "mss/blk%d", devidx); + + class_device_initialize(&md->cdev); + md->cdev.dev = &card->dev; + md->cdev.class = &mss_disk_class; + strncpy(md->cdev.class_id, card->dev.bus_id, BUS_ID_SIZE); + ret = class_device_add(&md->cdev); + if (ret) { + goto free_disk; + } + get_device(&card->dev); + + spin_lock_init(&md->request_lock); + md->queue = blk_init_queue(mss_media_request, &md->request_lock); + if (!md->queue) { + ret = -ENOMEM; + goto remove_cdev; + } + if (host->dev->dma_mask && *host->dev->dma_mask) + limit = *host->dev->dma_mask; + + blk_queue_prep_rq(md->queue, mss_media_preq); + blk_queue_bounce_limit(md->queue, limit); + blk_queue_max_sectors(md->queue, host->max_sectors); + blk_queue_max_phys_segments(md->queue, host->max_phys_segs); + blk_queue_max_hw_segments(md->queue, host->max_hw_segs); + blk_queue_max_segment_size(md->queue, host->max_seg_size); + + md->queue->queuedata = md; + + md->sg = kmalloc(sizeof(struct scatterlist) * host->max_phys_segs, + GFP_KERNEL); + if (!md->sg) { + ret = -ENOMEM; + goto clean_queue; + } + + init_completion(&md->thread_complete); + init_waitqueue_head(&md->thread_wq); + init_MUTEX(&md->thread_sem); + + ret = kernel_thread(mss_queue_thread, md, CLONE_KERNEL); + if (ret < 0) { + goto free_sg; + } + wait_for_completion(&md->thread_complete); + init_completion(&md->thread_complete); + + md->disk->queue = md->queue; + dev_set_drvdata(dev, md); + blk_queue_hardsect_size(md->queue, MSS_SECTOR_SIZE); + set_capacity(md->disk, mss_get_capacity(card)/(MSS_SECTOR_SIZE/512) - 4); + add_disk(md->disk); + return 0; + +free_sg: + kfree(md->sg); +clean_queue: + blk_cleanup_queue(md->queue); +remove_cdev: + class_device_del(&md->cdev); + put_device(&card->dev); +free_disk: + put_disk(md->disk); +free_data: + kfree(md); +clear_bit: + __clear_bit(devidx, dev_use); + + return ret; +} + +/** + * mss_card_remove + * @dev: device + * + * remove method to remove block device. + * invoked by device_unregister or driver_unregister. + */ +static int mss_blk_remove(struct device *dev) +{ + struct mss_disk *md; + struct mss_card *card; + + card = container_of(dev, struct mss_card, dev); + md = dev_get_drvdata(dev); + + class_device_del(&md->cdev); + del_gendisk(md->disk); + md->disk->queue = NULL; + + down(&md_ref_mutex); + dev_set_drvdata(dev, NULL); + class_device_put(&md->cdev); + up(&md_ref_mutex); + + return 0; +} + +/** + * mss_card_suspend + * @dev: device + * @state: suspend state + * @level: suspend level + * + * card specific suspend. + * invoke blk_stop_queue to suspend request queue. + */ +static int mss_blk_suspend(struct device *dev, pm_message_t state)//, u32 level) +{ + struct mss_disk *md; + struct mss_card *card; + unsigned long flags; + + card = container_of(dev, struct mss_card, dev); + md = dev_get_drvdata(dev); + + if (!(md->flags & MSS_QUEUE_SUSPENDED)) { + md->flags |= MSS_QUEUE_SUSPENDED; + spin_lock_irqsave(&md->request_lock, flags); + blk_stop_queue(md->queue); + spin_unlock_irqrestore(&md->request_lock, flags); + } + + return 0; +} + +/** + * mss_card_resume + * @dev: device + * @level: suspend level + * + * card specific resume. + * invoke blk_start_queue to resume request queue. + */ +static int mss_blk_resume(struct device *dev)//, u32 level) +{ + struct mss_disk *md; + struct mss_card *card; + unsigned long flags; + + card = container_of(dev, struct mss_card, dev); + md = dev_get_drvdata(dev); + + if (md->flags & MSS_QUEUE_SUSPENDED) { + md->flags &= ~MSS_QUEUE_SUSPENDED; + spin_lock_irqsave(&md->request_lock, flags); + blk_start_queue(md->queue); + spin_unlock_irqrestore(&md->request_lock, flags); + } + + return 0; +} + +static struct mss_driver mss_block_driver = { + .driver = { + .name = "MMC_SD Block Driver", + .probe = mss_blk_probe, + .remove = mss_blk_remove, + .suspend = mss_blk_suspend, + .resume = mss_blk_resume, + }, +}; + +/***************************************************************************** + * + * module init and exit functions + * + ****************************************************************************/ +static int mss_card_driver_init(void) +{ + int ret = -ENOMEM; + + ret = register_blkdev(major, "mmc"); + if (ret < 0) { + printk(KERN_ERR "Unable to get major %d for MMC media: %d\n", + major, ret); + return ret; + } + if (major == 0) + major = ret; + + dbg5("Get major number :%d\n", major); +// devfs_mk_dir("mmc"); + + class_register(&mss_disk_class); + return register_mss_driver(&mss_block_driver); +} + +static void mss_card_driver_exit(void) +{ + unregister_mss_driver(&mss_block_driver); +// devfs_remove("mmc"); + unregister_blkdev(major, "mmc"); + class_unregister(&mss_disk_class); +} + + +module_init(mss_card_driver_init); +module_exit(mss_card_driver_exit); + +MODULE_AUTHOR("Bridge Wu"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Block device driver for MMC/SD card"); --- linux-2.6.24.orig/drivers/mmc/mss/sdio_protocol.c +++ linux-2.6.24/drivers/mmc/mss/sdio_protocol.c @@ -0,0 +1,1094 @@ +/* + * sdio_protocol.c - SDIO protocol driver + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from previous mmc code in Linux kernel + * Copyright (c) 2002 Hewlett-Packard Company + * Copyright (c) 2002 Andrew Christian + * Copyright (c) 2006 Bridge Wu + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/***************************************************************************** + * + * internal functions + * + ****************************************************************************/ + +#define KBPS 1 +#define MBPS 1000 + +static u32 ts_exp[] = { 100*KBPS, 1*MBPS, 10*MBPS, 100*MBPS, 0, 0, 0, 0 }; +static u32 ts_mul[] = { 0, 1000, 1200, 1300, 1500, 2000, 2500, 3000, + 3500, 4000, 4500, 5000, 5500, 6000, 7000, 8000 }; + +static u32 sdio_tran_speed( u8 ts ) +{ + u32 clock = ts_exp[(ts & 0x7)] * ts_mul[(ts & 0x78) >> 3]; + + dbg5("clock :%d", clock); + return clock; +} + +static int sdio_unpack_r1(struct mss_cmd *cmd, struct sdio_response_r1 *r1, struct sdio_card *sdio_card) +{ + u8 *buf = cmd->response; + + //debug(" result in r1: %d\n", request->result); + //if ( request->result ) return request->result; + + sdio_card->errno = SDIO_ERROR_NONE; + r1->cmd = unstuff_bits(buf, 40, 8, 6); + r1->status = unstuff_bits(buf, 8, 32, 6); + + dbg5("status 0x%x", r1->status); + if (R1_STATUS(r1->status)) { + if (r1->status & R1_OUT_OF_RANGE) + sdio_card->errno = SDIO_ERROR_OUT_OF_RANGE; + if (r1->status & R1_COM_CRC_ERROR) + sdio_card->errno = SDIO_ERROR_COM_CRC; + if (r1->status & R1_ILLEGAL_COMMAND) + sdio_card->errno = SDIO_ERROR_ILLEGAL_COMMAND; + if (r1->status & R1_ERROR) + sdio_card->errno = SDIO_ERROR_GENERAL; + } + + if (r1->cmd != cmd->opcode) + sdio_card->errno = SDIO_ERROR_HEADER_MISMATCH; + dbg5("command:0x%x", r1->cmd); + /* This should be last - it's the least dangerous error */ + if (sdio_card->errno != SDIO_ERROR_NONE) + return MSS_ERROR_RESP_UNPACK; + return MSS_ERROR_NONE; +} + + +static int sdio_unpack_r4(struct mss_cmd *cmd, struct sdio_response_r4 *r4, struct sdio_card *sdio_card) +{ + u8 *buf = cmd->response; + + r4->ocr = unstuff_bits(buf, 8, 24, 6); + r4->ready = unstuff_bits(buf, 39, 1, 6); + r4->mem_present = unstuff_bits(buf, 35, 1, 6); + r4->func_num = unstuff_bits(buf, 36, 3, 6); + dbg5("ocr=%08x,ready=%d,mp=%d,fun_num:%d\n", r4->ocr, r4->ready, +r4->mem_present, r4->func_num); + return 0; +} + + +static int sdio_unpack_r5(struct mss_cmd *cmd, struct sdio_response_r5 *r5, struct sdio_card *sdio_card) +{ + u8 *buf = cmd->response; + + sdio_card->errno = SDIO_ERROR_NONE; + r5->cmd = unstuff_bits(buf, 40, 8, 6); + r5->status = unstuff_bits(buf, 16, 8, 6); + r5->data = unstuff_bits(buf, 8, 8, 6); + dbg5("cmd=%d status=%02x,data:%02x", r5->cmd, r5->status, r5->data); + + if (r5->status) { + if (r5->status & R5_OUT_OF_RANGE) + return SDIO_ERROR_OUT_OF_RANGE; + if (r5->status & R5_COM_CRC_ERROR) + return SDIO_ERROR_COM_CRC; + if (r5->status & R5_ILLEGAL_COMMAND) + return SDIO_ERROR_ILLEGAL_COMMAND; + if (r5->status & R5_ERROR) + return SDIO_ERROR_GENERAL; + if (r5->status & R5_FUNCTION_NUMBER) + return SDIO_ERROR_FUNC_NUM; + } + + if (r5->cmd != cmd->opcode) { + return SDIO_ERROR_HEADER_MISMATCH; + } + + return 0; +} + +static u16 sdio_unpack_r6(struct mss_cmd *cmd, struct sdio_response_r6 *r6, struct sdio_card *sdio_card) +{ + u8 *buf = cmd->response; + int errno = SDIO_ERROR_NONE; + + r6->cmd = unstuff_bits(buf, 40, 8, 6); + r6->rca = unstuff_bits(buf, 24, 16, 6); + r6->status = unstuff_bits(buf, 8, 16, 6); + if (R6_STATUS(r6->status)) { + if (r6->status & R6_COM_CRC_ERROR) + errno = SDIO_ERROR_COM_CRC; + if (r6->status & R6_ILLEGAL_COMMAND) + errno = SDIO_ERROR_ILLEGAL_COMMAND; + if (r6->status & R6_ERROR) + errno = SDIO_ERROR_GENERAL; + } + if (r6->cmd != cmd->opcode) + errno = SDIO_ERROR_HEADER_MISMATCH; + sdio_card->errno = errno; + if (errno) + return MSS_ERROR_RESP_UNPACK; + return 0 ; + +} + + +/***************************************************************************** + * + * internal functions + * + ****************************************************************************/ + +/* sdio related function */ +static u32 sdio_make_cmd52_arg(int rw, int fun_num, int raw, int address, int write_data) +{ + u32 ret; + dbg5("rw:%d,fun:%d,raw:%d,address:%d,write_data:%d\n", + rw, fun_num, raw, address, write_data); + ret = (rw << 31) | (fun_num << 28) | (raw << 27) | (address << 9) | write_data; + return ret; +} + +static u32 sdio_make_cmd53_arg(int rw, int fun_num, int block_mode, int op_code, int address, int count) +{ + u32 ret; + dbg5("rw:%d,fun:%d,block_mode:%d,op_code:%d,address:%d,count:%d\n", + rw, fun_num, block_mode, op_code, address, count); + ret = (rw << 31) | (fun_num << 28) | (block_mode << 27) | (op_code << 26) | (address << 9) | count; + return ret; +} + +#define SDIO_FN0_READ_REG(addr) \ + do { \ + arg = sdio_make_cmd52_arg(SDIO_R, 0, 0, addr, 0); \ + ret = mss_send_simple_ll_req(host, llreq, cmd, \ + IO_RW_DIRECT, arg, MSS_RESPONSE_R5, \ + MSS_CMD_SDIO_EN); \ + if (ret) { \ + dbg5("CMD ERROR: ret = %d\n", ret); \ + return ret; \ + } \ + ret = sdio_unpack_r5(cmd, &r5, sdio_card); \ + if (ret) { \ + dbg5("UNPACK ERROR: ret = %d\n", ret); \ + return ret; \ + } \ + } while(0) + +#define SDIO_FN0_WRITE_REG(addr, val) \ + do { \ + arg = sdio_make_cmd52_arg(SDIO_W, 0, 0, addr, val); \ + ret = mss_send_simple_ll_req(host, llreq, cmd, \ + IO_RW_DIRECT, arg, MSS_RESPONSE_R5, \ + MSS_CMD_SDIO_EN); \ + if (ret) { \ + dbg5("CMD ERROR: ret = %d\n", ret); \ + return ret; \ + } \ + ret = sdio_unpack_r5(cmd, &r5, sdio_card); \ + if (ret) { \ + dbg5("UNPACK ERROR: ret = %d\n", ret); \ + return ret; \ + } \ + } while(0) + + +static int sdio_set_bus_width(struct mss_card *card, u8 buswidth) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct sdio_response_r5 r5; + int ret,arg; + + SDIO_FN0_WRITE_REG(BUS_IF_CTRL, buswidth); + card->bus_width = MSS_BUSWIDTH_4BIT; + + return 0; +} + +static int sdio_set_block_size(struct mss_card *card, u16 size, int func) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct sdio_response_r5 r5; + int ret,arg; + u8 tmp; + + if (func == 0) { + tmp = size & 0xff; + SDIO_FN0_WRITE_REG(FN0_BLKSZ_1, tmp); + + tmp = (size & 0xff00) >> 8; + SDIO_FN0_WRITE_REG(FN0_BLKSZ_2, tmp); + + sdio_card->cccr.fn0_blksz = size; + } else { + tmp = size & 0xff; + SDIO_FN0_WRITE_REG(FNn_BLKSZ_1(func), tmp); + + tmp = (size & 0xff00) >> 8; + SDIO_FN0_WRITE_REG(FNn_BLKSZ_2(func), tmp); + + sdio_card->fbr[func].fn_blksz = size; + } + + return 0; +} + +static int sdio_io_enable(struct mss_card *card, u8 set_mask) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct sdio_response_r5 r5; + int ret, arg; + + SDIO_FN0_WRITE_REG(IO_ENABLE, set_mask); + + return 0; +} + +static int sdio_interrupt_enable(struct mss_card *card, u8 set_mask) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct sdio_response_r5 r5; + int ret, arg; + + SDIO_FN0_WRITE_REG(INT_ENABLE, set_mask); + + return 0; +} + +static int sdio_csa_enable(struct mss_card *card, int func) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct sdio_response_r5 r5; + int arg; + int ret = 0; + + if(sdio_card->fbr[func].fun_support_csa == 0) + return ret; + + SDIO_FN0_WRITE_REG(FNn_IF_CODE(func), 0x80); + + return 0; +} + + +static int get_sdio_fbr_info(struct mss_card *card, int func) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct sdio_response_r5 r5; + int ret,arg; + u32 tmp; + + dbg5("get_sdio_fbr_info"); + SDIO_FN0_READ_REG(FNn_IF_CODE(func)); + sdio_card->fbr[func].fun_if_code = r5.data & 0xF; + sdio_card->fbr[func].fun_support_csa = (r5.data >> 6) & 0x1; + sdio_card->fbr[func].fun_csa_enable = (r5.data >> 7) & 0x1; + + SDIO_FN0_READ_REG(FNn_EXT_IF_CODE(func)); + sdio_card->fbr[func].fun_ext_if_code = r5.data; + + SDIO_FN0_READ_REG(FNn_CIS_POINTER_1(func)); + tmp = r5.data; + SDIO_FN0_READ_REG(FNn_CIS_POINTER_2(func)); + tmp |= r5.data << 8; + SDIO_FN0_READ_REG(FNn_CIS_POINTER_3(func)); + tmp |= r5.data << 16; + sdio_card->fbr[func].pfcis = tmp; + + SDIO_FN0_READ_REG(FNn_CSA_POINTER_1(func)); + tmp = r5.data; + SDIO_FN0_READ_REG(FNn_CSA_POINTER_2(func)); + tmp |= r5.data << 8; + SDIO_FN0_READ_REG(FNn_CSA_POINTER_3(func)); + tmp |= r5.data << 16; + sdio_card->fbr[func].pcsa = tmp; + + SDIO_FN0_READ_REG(FNn_BLKSZ_1(func)); + tmp = r5.data; + SDIO_FN0_READ_REG(FNn_BLKSZ_2(func)); + tmp |= r5.data << 8; + sdio_card->fbr[func].fn_blksz = tmp; + + dbg5("func:%d, csa:0x%x, cis:0x%x, blksz:0x%x", func, sdio_card->fbr[func].pcsa, sdio_card->fbr[func].pfcis, sdio_card->fbr[func].fn_blksz); + + return 0; +} + +static int get_sdio_cccr_info(struct mss_card *card) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct sdio_response_r5 r5; + int ret, arg; + u32 tmp; + + dbg5("get_sdio_cccr_info"); + SDIO_FN0_READ_REG(CCCR_SDIO_REVISION); + sdio_card->cccr.sdiox = (r5.data >> 4) & 0xf; + sdio_card->cccr.cccrx = r5.data & 0xf; + + SDIO_FN0_READ_REG(SD_SPEC_REVISION); + sdio_card->cccr.sdx = r5.data & 0xf; + + SDIO_FN0_READ_REG(IO_ENABLE); + sdio_card->cccr.ioex = r5.data; + + SDIO_FN0_READ_REG(IO_READY); + sdio_card->cccr.iorx = r5.data; + + SDIO_FN0_READ_REG(INT_ENABLE); + sdio_card->cccr.intex = r5.data; + + SDIO_FN0_READ_REG(INT_PENDING); + sdio_card->cccr.intx = r5.data; + + SDIO_FN0_READ_REG(BUS_IF_CTRL); + sdio_card->cccr.buswidth = r5.data & 0x3; + sdio_card->cccr.cd = (r5.data >> 7) & 0x1; + + SDIO_FN0_READ_REG(CARD_CAPABILITY); + sdio_card->cccr.sdc = r5.data & 0x1; + sdio_card->cccr.smb = (r5.data >> 1) & 0x1; + sdio_card->cccr.srw = (r5.data >> 2) & 0x1; + sdio_card->cccr.sbs = (r5.data >> 3) & 0x1; + sdio_card->cccr.s4mi = (r5.data >> 4) & 0x1; + sdio_card->cccr.e4mi = (r5.data >> 5) & 0x1; + sdio_card->cccr.lsc = (r5.data >> 6) & 0x1; + sdio_card->cccr.ls4b = (r5.data >> 7) & 0x1; + + SDIO_FN0_READ_REG(COMMON_CIS_POINTER_1); + tmp = r5.data; + SDIO_FN0_READ_REG(COMMON_CIS_POINTER_2); + tmp |= r5.data << 8; + SDIO_FN0_READ_REG(COMMON_CIS_POINTER_3); + tmp |= r5.data << 16; + sdio_card->cccr.pccis = tmp; + + SDIO_FN0_READ_REG(BUS_SUSPEND); + sdio_card->cccr.bs = r5.data & 0x1; + sdio_card->cccr.br = (r5.data >> 1) & 0x1; + + SDIO_FN0_READ_REG(FUNCTION_SELECT); + sdio_card->cccr.fsx = r5.data & 0xf; + sdio_card->cccr.df = (r5.data >> 7) & 0x1; + + SDIO_FN0_READ_REG(EXEC_FLAGS); + sdio_card->cccr.exx = r5.data; + + SDIO_FN0_READ_REG(READY_FLAGS); + sdio_card->cccr.rfx = r5.data; + + SDIO_FN0_READ_REG(FN0_BLKSZ_1); + tmp = r5.data; + SDIO_FN0_READ_REG(FN0_BLKSZ_2); + tmp |= r5.data << 8; + sdio_card->cccr.fn0_blksz = tmp; + + SDIO_FN0_READ_REG(POWER_CTRL); + sdio_card->cccr.smpc = r5.data & 0x1; + sdio_card->cccr.empc = (r5.data >> 1) & 0x1; + + dbg5("cccr, card capability: low_speed_card:%d" + " low_speed_card_4bit:%d int_bw_block:%d\n" + " suspend/resume:%d read/wait:%d multiblcok:%d direct_cmd:%d\n", + sdio_card->cccr.lsc, sdio_card->cccr.ls4b, + sdio_card->cccr.s4mi, sdio_card->cccr.sbs, + sdio_card->cccr.srw, sdio_card->cccr.smb, sdio_card->cccr.sdc); + dbg5("sdio:%d, sd:%d, cccr:%d, common cis:0x%x\n", sdio_card->cccr.sdiox, sdio_card->cccr.sdx, sdio_card->cccr.cccrx, sdio_card->cccr.pccis); + dbg5("spmc:%d\n", sdio_card->cccr.smpc); + dbg5("ioe:0x%x, ior:0x%x\n", sdio_card->cccr.ioex, sdio_card->cccr.iorx); + return 0; +} + +static int get_sdio_fcis_info(struct mss_card *card, int func) +{ + struct mss_host *host= card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + int ret, arg, tuple_body_len, tuple_type; + struct sdio_response_r5 r5; + u32 addr, next_addr; + u32 tmp; + u16 tmp16; + + dbg5("get_sdio_fcis_info"); + addr = sdio_card->fbr[func].pfcis; + + while(1) { + SDIO_FN0_READ_REG(addr); + tuple_type = r5.data; + + SDIO_FN0_READ_REG(addr + 1); + tuple_body_len = r5.data; + + next_addr = addr + 2 + r5.data; + switch (tuple_type) { + case CISTPL_NULL: + case CISTPL_END: + dbg5("cistpl null/end\n"); + goto finish; + case CISTPL_CHECKSUM: + dbg5("cistpl checksum\n"); + break; + case CISTPL_VERS_1: + dbg5("cistpl vers level 1\n"); + break; + case CISTPL_ALTSTR: + dbg5("cistpl altstr\n"); + break; + case CISTPL_MANFID: + dbg5("cistpl manfid\n"); + break; + case CISTPL_FUNCID: + dbg5("cistpl funcid\n"); + SDIO_FN0_READ_REG(addr + 2); + + if (r5.data != 0x0c) + dbg5("not a sdio card\n"); + else + dbg5(" a sdio card\n"); + + break; + case CISTPL_FUNCE: + /* Type of extended data, should be 1 */ + SDIO_FN0_READ_REG(addr + 2); + if (r5.data == 0x01) + dbg5("1 type extended tuple\n"); + + /* FUNCTION_INFO */ + SDIO_FN0_READ_REG(addr + 3); + sdio_card->fcis[func].func_info = r5.data; + + /* STD_IO_REV */ + SDIO_FN0_READ_REG(addr + 4); + sdio_card->fcis[func].std_io_rev = r5.data; + + /* card psn */ + SDIO_FN0_READ_REG(addr + 5); + tmp = r5.data; + SDIO_FN0_READ_REG(addr + 6); + tmp |= r5.data << 8; + SDIO_FN0_READ_REG(addr + 7); + tmp |= r5.data << 16; + SDIO_FN0_READ_REG(addr + 8); + tmp |= r5.data << 24; + sdio_card->fcis[func].card_psn = tmp; + + /* card csa size */ + SDIO_FN0_READ_REG(addr + 9); + tmp = r5.data; + SDIO_FN0_READ_REG(addr + 10); + tmp |= r5.data << 8; + SDIO_FN0_READ_REG(addr + 11); + tmp |= r5.data << 16; + SDIO_FN0_READ_REG(addr + 12); + tmp |= r5.data << 24; + sdio_card->fcis[func].csa_size = tmp; + + /* csa property */ + SDIO_FN0_READ_REG(addr + 13); + sdio_card->fcis[func].csa_property = r5.data; + + /* max_blk_size */ + SDIO_FN0_READ_REG(addr + 14); + tmp16 = r5.data; + SDIO_FN0_READ_REG(addr + 15); + tmp16 |= r5.data << 8; + sdio_card->fcis[func].max_blk_size = tmp16; + + /* ocr */ + SDIO_FN0_READ_REG(addr + 16); + tmp = r5.data; + SDIO_FN0_READ_REG(addr + 17); + tmp |= r5.data << 8; + SDIO_FN0_READ_REG(addr + 18); + tmp |= r5.data << 16; + SDIO_FN0_READ_REG(addr + 19); + tmp |= r5.data << 24; + sdio_card->fcis[func].ocr = tmp; + + /* pwr */ + SDIO_FN0_READ_REG(addr + 20); + sdio_card->fcis[func].op_min_pwr = r5.data; + + SDIO_FN0_READ_REG(addr + 21); + sdio_card->fcis[func].op_avg_pwr = r5.data; + + SDIO_FN0_READ_REG(addr + 22); + sdio_card->fcis[func].op_max_pwr = r5.data; + + SDIO_FN0_READ_REG(addr + 23); + sdio_card->fcis[func].sb_min_pwr = r5.data; + + SDIO_FN0_READ_REG(addr + 24); + sdio_card->fcis[func].sb_avg_pwr = r5.data; + + SDIO_FN0_READ_REG(addr + 25); + sdio_card->fcis[func].sb_max_pwr = r5.data; + + SDIO_FN0_READ_REG(addr + 26); + tmp16 = r5.data; + SDIO_FN0_READ_REG(addr + 27); + tmp16 |= r5.data << 8; + sdio_card->fcis[func].min_bw = tmp16; + + SDIO_FN0_READ_REG(addr + 28); + tmp16 = r5.data; + SDIO_FN0_READ_REG(addr + 29); + tmp16 |= r5.data << 8; + sdio_card->fcis[func].opt_bw = tmp16; + + // SDIO1.0 is 28, and 1.1 is 36 + if (sdio_card->cccr.sdiox == 0) + break; + SDIO_FN0_READ_REG(addr + 30); + tmp16 = r5.data; + SDIO_FN0_READ_REG(addr + 31); + tmp16 |= r5.data << 8; + sdio_card->fcis[func].enable_timeout_val= tmp16; + break; + case CISTPL_SDIO_STD: + dbg5("sdio std\n"); + break; + case CISTPL_SDIO_EXT: + dbg5("sdio std ext\n"); + break; + default : + dbg5("not supported cis\n"); + } + addr = next_addr; + } +finish: + dbg5("fcis %d\nfunction_info:0x%x std_io_rev:0x%x card_psn:0x%x\n" + "csa_size:0x%x csa_property:0x%x max_blk_size:0x%x\n" + "ocr:0x%x op_min_pwr:0x%x op_avg_pwr:0x%x op_max_pwr:0x%x" + "sb_min_pwr:0x%x sb_avg_pwr:0x%x sb_max_pwr:0x%x" + "min_bw:0x%x opt_bw:0x%x time out:%x\n",func, + sdio_card->fcis[func].func_info, sdio_card->fcis[func].std_io_rev, sdio_card->fcis[func].card_psn, + sdio_card->fcis[func].csa_size, sdio_card->fcis[func].csa_property, sdio_card->fcis[func].max_blk_size, + sdio_card->fcis[func].ocr, sdio_card->fcis[func].op_min_pwr, sdio_card->fcis[func].op_avg_pwr, sdio_card->fcis[func].op_max_pwr, + sdio_card->fcis[func].sb_min_pwr, sdio_card->fcis[func].sb_avg_pwr, sdio_card->fcis[func].sb_max_pwr, + sdio_card->fcis[func].min_bw, sdio_card->fcis[func].opt_bw, sdio_card->fcis[func].enable_timeout_val); + return 0; +} + +static int get_sdio_ccis_info(struct mss_card *card) +{ + struct mss_host *host= card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + int ret, arg, tuple_body_len, tuple_type; + struct sdio_response_r5 r5; + u32 addr, next_addr; + u16 tmp16; + + dbg5("get_sdio_ccis_info"); + addr = sdio_card->cccr.pccis; + while (1) { + SDIO_FN0_READ_REG(addr); + tuple_type = r5.data; + + SDIO_FN0_READ_REG(addr + 1); + tuple_body_len = r5.data; + next_addr = addr + 2 + r5.data; + + switch (tuple_type) { + case CISTPL_NULL: + case CISTPL_END: + dbg5("cistpl null/end\n"); + goto finish; + case CISTPL_CHECKSUM: + dbg5("cistpl checksum\n"); + break; + case CISTPL_VERS_1: + dbg5("cistpl vers level 1\n"); + break; + case CISTPL_ALTSTR: + dbg5("cistpl altstr\n"); + break; + case CISTPL_MANFID: + dbg5("cistpl manfid\n"); + SDIO_FN0_READ_REG(addr + 2); + tmp16 = r5.data; + SDIO_FN0_READ_REG(addr + 3); + tmp16 |= r5.data << 8; + sdio_card->ccis.manufacturer = tmp16; + + SDIO_FN0_READ_REG(addr + 4); + tmp16 = r5.data; + SDIO_FN0_READ_REG(addr + 5); + tmp16 |= r5.data << 8; + sdio_card->ccis.card_id = tmp16; + + break; + case CISTPL_FUNCID: + dbg5("cistpl funcid\n"); + SDIO_FN0_READ_REG(addr + 2); + if (r5.data != 0x0c) + dbg5("not a sdio card\n"); + else + dbg5(" a sdio card\n"); + + break; + case CISTPL_FUNCE: + dbg5("cistpl funce\n"); + SDIO_FN0_READ_REG(addr + 2); + if (r5.data == 0x00) + dbg5("0 type extended tuple\n"); + + SDIO_FN0_READ_REG(addr + 3); + tmp16 = r5.data; + SDIO_FN0_READ_REG(addr + 4); + tmp16 = r5.data << 8; + sdio_card->ccis.fn0_block_size = tmp16; + + SDIO_FN0_READ_REG(addr + 5); + sdio_card->ccis.max_tran_speed = r5.data; + //slot->tran_speed = card->ccis.max_tran_speed; + break; + case CISTPL_SDIO_STD: + dbg5("sdio std\n"); + break; + case CISTPL_SDIO_EXT: + dbg5("sdio std ext\n"); + break; + default: + dbg5("not supported cis\n"); + } + addr = next_addr; + } +finish: + dbg5("ccis:\nmanf:0x%x card_id:0x%x block_size:0x%x\nmax_tran_speed:0x%x\n",sdio_card->ccis.manufacturer, sdio_card->ccis.card_id, sdio_card->ccis.fn0_block_size, sdio_card->ccis.max_tran_speed); + return 0; +} + +/***************************************************************************** + * + * protocol entry functions + * + ****************************************************************************/ + +static int sdio_recognize_card(struct mss_card *card) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct mss_ios ios; + struct sdio_response_r4 r4; + int ret; + + card->card_type = MSS_UNKNOWN_CARD; + card->state = CARD_STATE_INIT; + card->bus_width = MSS_BUSWIDTH_1BIT; + + memcpy(&ios, &host->ios, sizeof(struct mss_ios)); + ios.clock = host->f_min; + ios.bus_width = MSS_BUSWIDTH_1BIT; + host->ops->set_ios(host, &ios); + + /* check if a sdio card, need not send CMD0 to reset for SDIO card */ + ret = mss_send_simple_ll_req(host, llreq, cmd, IO_SEND_OP_COND, + 0, MSS_RESPONSE_R4, 0); + if (ret) + return ret; + ret = sdio_unpack_r4(cmd, &r4, sdio_card); + if (ret) + return ret; + sdio_card->func_num = r4.func_num; + sdio_card->mem_present = r4.mem_present; + if (!r4.func_num) + return MSS_ERROR_NONE; + /* maybe COMBO_CARD. but we can return SDIO_CARD first, + * in sdio_card_init, we will judge further. + */ + if(r4.ocr & host->vdd) { + card->card_type = MSS_SDIO_CARD; + } else { + printk(KERN_WARNING "uncompatible card\n"); + card->card_type = MSS_UNCOMPATIBLE_CARD; + } + + return MSS_ERROR_NONE; +} + +static int sdio_card_init(struct mss_card *card) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct sdio_response_r1 r1; + struct sdio_response_r4 r4; + struct sdio_response_r6 r6; + struct mss_ios ios; + int ret, tmp, i; + u8 funcs; + + dbg5("card = %08X\n", (u32)card); + card->state = CARD_STATE_INIT; + card->bus_width = MSS_BUSWIDTH_1BIT; + + memcpy(&ios, &host->ios, sizeof(struct mss_ios)); + ios.clock = host->f_min; + ios.bus_width = MSS_BUSWIDTH_1BIT; + host->ops->set_ios(host, &ios); + + ret = mss_send_simple_ll_req(host, llreq, cmd, IO_SEND_OP_COND, + host->vdd, MSS_RESPONSE_R4, 0); + if (ret) + return ret; + ret = sdio_unpack_r4(cmd, &r4, sdio_card); + if (ret) + return ret; + + while (!r4.ready) { + //mdelay(20); + msleep(15); + ret = mss_send_simple_ll_req(host, llreq, cmd, IO_SEND_OP_COND, + host->vdd, MSS_RESPONSE_R4, 0); + if (ret) + return ret; + ret = sdio_unpack_r4(cmd, &r4, sdio_card); + if (ret) + return ret; + } + + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SET_RELATIVE_ADDR, + 0, MSS_RESPONSE_R6, 0); + if (ret) + return ret; + ret = sdio_unpack_r6(cmd, &r6, sdio_card); + if (ret) + return ret; + sdio_card->state = CARD_STATE_STBY; + sdio_card->rca = r6.rca; + + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SELECT_CARD, + (sdio_card->rca) << 16, MSS_RESPONSE_R1B, 0); + if (ret) + return ret; + ret = sdio_unpack_r1(cmd, &r1, sdio_card); + if (ret) + return ret; + + /** CARD_STATE_CMD */ + //slot->state = CARD_STATE_CMD; + //send CMD53 to let DATA BUS FREE, since bus_suspend not supported, need not to do this + //arg = sdio_make_cmd53_arg(SDIO_READ, 0, 0, 0, 0, 1); + //mss_simple_cmd( dev, IO_RW_EXTENDED, arg, RESPONSE_R5); + + + /** CARD_STATE_TRAN */ + sdio_card->state = CARD_STATE_CMD; + + + ret = get_sdio_cccr_info(card); + if (ret) + return ret; + funcs = sdio_card->func_num; + for(i = 1; i <= funcs; i++) { + ret = get_sdio_fbr_info(card, i); + if (ret) + return ret; + } + + ret = get_sdio_ccis_info(card); + if (ret) + return ret; + for(i = 1; i <= funcs; i++) { + ret = get_sdio_fcis_info(card, i); + if (ret) + return ret; + } + if(host->bus_width == MSS_BUSWIDTH_4BIT + && (!sdio_card->cccr.lsc || sdio_card->cccr.ls4b)) { + host->ios.bus_width = MSS_BUSWIDTH_4BIT; + sdio_set_bus_width(card, 2); + } + + /* enable function */ + tmp = 0; + for(i = 1; i <= funcs; i++) { + tmp |= (1 << i); + } + ret = sdio_io_enable(card, tmp); + if (ret) + return ret; + + /* enable interrupt */ + tmp = 1; + for(i = 1; i <= funcs; i++) { + tmp |= (1 << i); + } + ret = sdio_interrupt_enable(card, tmp); + if (ret) + return ret; + + /* enable card capabilites */ + for (i=1; i <= funcs; i++) { + sdio_csa_enable(card, i); + } + + mss_set_sdio_int(card->slot->host, 1); + + return MSS_ERROR_NONE; +} + +static int sdio_read_write_entry(struct mss_card *card, int action, struct mss_rw_arg *arg, struct mss_rw_result *result) +{ + struct mss_host *host = card->slot->host; + struct sdio_card *sdio_card = card->prot_card; + struct mss_cmd *cmd = &sdio_card->cmd; + struct mss_data *data = &sdio_card->data; + struct mss_ll_request *llreq = &sdio_card->llreq; + struct sdio_response_r5 r5; + struct sdio_response_r1 r1; + int ret; + u32 addr, blkmode, func, rw, rw_count, opcode, clock, cmdarg; + int retries = 4; + + if (sdio_card->state == CARD_STATE_STBY) { + ret = mss_send_simple_ll_req(host, llreq, cmd, SD_SELECT_CARD, + sdio_card->rca << 16, MSS_RESPONSE_R1B, 0); + if (ret) + return ret; + ret = sdio_unpack_r1(cmd, &r1, sdio_card); + if (ret) + return ret; + } + + mss_set_clock(host, sdio_tran_speed(sdio_card->ccis.max_tran_speed)); + func = arg->func; + if (func > sdio_card->func_num) + return MSS_ERROR_WRONG_ARG; + + if (arg->block_len == 0) { + blkmode = 0; + } + else { + if (!sdio_card->cccr.smb) + return MSS_ERROR_WRONG_ARG; + dbg5("blkzs:%d, %d\n", arg->block_len, sdio_card->fbr[func].fn_blksz); + if (arg->block_len != sdio_card->fbr[func].fn_blksz) { + ret = sdio_set_block_size(card, arg->block_len, func); + if (ret) + return ret; + } + blkmode = 1; + } + + rw = (action == MSS_READ_MEM) ? 0 : 1; + addr = arg->block; + opcode = (arg->opcode) ? 1 : 0; + rw_count = arg->nob; + + memset(llreq, 0x0, sizeof(struct mss_ll_request)); + memset(cmd, 0x0, sizeof(struct mss_cmd)); + memset(data, 0x0, sizeof(struct mss_data)); + +read_write_entry: + /* deal with request */ + /* if only one byte, then use CMD52 to read*/ + if (!blkmode && rw_count == 1) { + u8 val = (rw) ? arg->val : 0; + dbg5("use CMD52 to transfer data. rw direction: %d", rw); + cmdarg = sdio_make_cmd52_arg(rw, func, opcode, addr, val); + + dbg5("cmdarg :0x%x\n", cmdarg); + ret = mss_send_simple_ll_req(host, llreq, cmd, IO_RW_DIRECT, + cmdarg, MSS_RESPONSE_R5, + MSS_CMD_SDIO_EN); + if (!ret) + ret = sdio_unpack_r5(cmd, &r5, sdio_card); + if (!ret) + result->bytes_xfered = r5.data; + else if (ret && --retries) { + clock = host->ios.clock; + clock = clock >> 1; + if (clock < SDIO_CARD_CLOCK_SLOW && retries == 1) { + clock = SDIO_CARD_CLOCK_SLOW; + mss_set_clock(host, clock); + goto read_write_entry; + } + return ret; + } + dbg5("r5.data:0x%x\n",r5.data); + } + else { + cmdarg= sdio_make_cmd53_arg(rw, func, blkmode, opcode, addr, + rw_count); + MSS_INIT_CMD(cmd, IO_RW_EXTENDED, cmdarg, MSS_CMD_SDIO_EN, + MSS_RESPONSE_R5); + MSS_INIT_DATA(data, rw_count, arg->block_len, + ((rw) ? MSS_DATA_WRITE : MSS_DATA_READ), + arg->sg_len, arg->sg, 0); + llreq->cmd = cmd; + llreq->data = data; + + ret = mss_send_ll_req(host, llreq); + if (!ret) + ret = sdio_unpack_r5(cmd, &r5, sdio_card); + if (ret) { + if (--retries) { + clock = host->ios.clock; + clock = clock >> 1; + if (clock < SDIO_CARD_CLOCK_SLOW + && retries == 1) + clock = SDIO_CARD_CLOCK_SLOW; + mss_set_clock(host, clock); + goto read_write_entry; + } + return ret; + } + + } + return MSS_ERROR_NONE; +} + +/***************************************************************************** + * + * protocol driver interface functions + * + ****************************************************************************/ + +static int sdio_prot_entry(struct mss_card *card, unsigned int action, void *arg, void *result) +{ + int ret; + + dbg5("action = %d\n", action); + if (action != MSS_RECOGNIZE_CARD && card->card_type != MSS_SDIO_CARD) + return MSS_ERROR_WRONG_CARD_TYPE; + switch (action) { + case MSS_RECOGNIZE_CARD: + ret = sdio_recognize_card(card); + break; + case MSS_INIT_CARD: + ret = sdio_card_init(card); + break; + case MSS_READ_MEM: + case MSS_WRITE_MEM: + if (!arg || !result) + return -EINVAL; + ret = sdio_read_write_entry(card, action, arg, result); + break; + case MSS_QUERY_CARD: + ret = MSS_ERROR_NONE; + break; + default: + ret = MSS_ERROR_ACTION_UNSUPPORTED; + break; + } + + return ret; +} + +static int sdio_prot_attach_card(struct mss_card *card) +{ + struct sdio_card *sdio_card; + +#define ALIGN32(x) (((x) + 31) & (~31)) + sdio_card = kzalloc(ALIGN32(sizeof(struct sdio_card)), GFP_KERNEL); + card->prot_card = sdio_card; + if (sdio_card) { + return 0; + } + return -ENOMEM; +} + +static void sdio_prot_detach_card(struct mss_card *card) +{ + kfree(card->prot_card); +} + +static int sdio_prot_get_errno(struct mss_card *card) +{ + struct sdio_card *sdio_card = card->prot_card; + + return sdio_card->errno; +} + +static struct mss_prot_driver sdio_protocol = { + .name = SDIO_PROTOCOL, + .prot_entry = sdio_prot_entry, + .attach_card = sdio_prot_attach_card, + .detach_card = sdio_prot_detach_card, + .get_errno = sdio_prot_get_errno, +}; + +/***************************************************************************** + * + * module init and exit functions + * + ****************************************************************************/ +static int sdio_protocol_init(void) +{ + register_mss_prot_driver(&sdio_protocol); + return 0; +} + +static void sdio_protocol_exit(void) +{ + unregister_mss_prot_driver(&sdio_protocol); +} + + +module_init(sdio_protocol_init); +module_exit(sdio_protocol_exit); + +MODULE_AUTHOR("Bridge Wu"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("SDIO protocol driver"); --- linux-2.6.24.orig/drivers/mmc/mss/mss_core.c +++ linux-2.6.24/drivers/mmc/mss/mss_core.c @@ -0,0 +1,918 @@ +/* + * mss_core.c - MMC/SD/SDIO Core driver + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from previous mmc code in Linux kernel + * Copyright (c) 2002 Hewlett-Packard Company + * Copyright (c) 2002 Andrew Christian + * Copyright (c) 2006 Bridge Wu + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + + +static LIST_HEAD(mss_protocol_list); +static LIST_HEAD(mss_host_list); + +static void mss_power_up(struct mss_host *host) +{ + struct mss_ios ios; + + memcpy(&ios, &host->ios, sizeof(ios)); + ios.vdd = host->vdd; + ios.chip_select = MSS_CS_NO_CARE; + ios.power_mode = MSS_POWER_UP; + host->ops->set_ios(host, &ios); + + msleep(1); + + ios.clock = host->f_min; + ios.power_mode = MSS_POWER_ON; + host->ops->set_ios(host, &ios); + + msleep(2); +} + +static void mss_power_off(struct mss_host *host) +{ + struct mss_ios ios; + + memcpy(&ios, &host->ios, sizeof(ios)); + ios.clock = 0; + ios.chip_select = MSS_CS_NO_CARE; + ios.power_mode = MSS_POWER_OFF; + host->ops->set_ios(host, &ios); +} + +static void mss_idle_cards(struct mss_host *host) +{ + struct mss_ios ios; + + memcpy(&ios, &host->ios, sizeof(ios)); + ios.chip_select = MSS_CS_HIGH; + host->ops->set_ios(host, &ios); + msleep(1); + ios.chip_select = MSS_CS_NO_CARE; + host->ops->set_ios(host, &ios); + msleep(1); +} + +/* + * Only after card is initialized by protocol and be registed to mmc_bus, the + * state is changed to MSS_CARD_REGISTERED. + */ +static int mmc_bus_match(struct device *dev, struct device_driver *drv) +{ + struct mss_card *card; + + card = container_of(dev, struct mss_card, dev); + + dbg(card->slot, "bus match driver %s", drv->name); + /* when card->state is MSS_CARD_REGISTERED,it is accepted by protocol */ + if (card->prot_driver && (card->state & MSS_CARD_REGISTERED)) + return 1; + dbg(card->slot, "bus match driver %s fail", drv->name); + return 0; +} + +//static int mmc_bus_hotplug(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size) +//{ +// printk(KERN_INFO "*** HOT PLUG ***\n"); +// return 0; +//} + +static int mmc_bus_suspend(struct device * dev, pm_message_t state) +{ + int ret = 0; + struct mss_card *card; + + card = container_of(dev, struct mss_card, dev); + + if (card->state & MSS_CARD_HANDLEIO) + return -EAGAIN; + if (card->state & MSS_CARD_SUSPENDED) + return 0; + + if (dev->driver && dev->driver->suspend) { + ret = dev->driver->suspend(dev, state);//, SUSPEND_DISABLE); + if (ret == 0) + ret = dev->driver->suspend(dev, state);//, SUSPEND_SAVE_STATE); + if (ret == 0) + ret = dev->driver->suspend(dev, state);//, SUSPEND_POWER_DOWN); + } + /* mark MSS_CARD_SUSPEND here */ + card->state |= MSS_CARD_SUSPENDED; + return ret; +} +/* + * card may be removed or replaced by another card from the mmc_bus when it is + * sleeping, and the slot may be inserted a card when it is sleeping. + * The controller resume function need to take care about it. + */ +static int mmc_bus_resume(struct device * dev) +{ + int ret = 0; + struct mss_card *card; + + card = container_of(dev, struct mss_card, dev); + + /* it is new instered card or replaced card */ + if (!(card->state & MSS_CARD_SUSPENDED)) + return 0; + + card->state &= ~MSS_CARD_SUSPENDED; + if (dev->driver && dev->driver->resume) { + ret = dev->driver->resume(dev);//, RESUME_POWER_ON); + if (ret == 0) + ret = dev->driver->resume(dev);//, RESUME_RESTORE_STATE); + if (ret == 0) + ret = dev->driver->resume(dev);//, RESUME_ENABLE); + } + + return ret; +} + +static struct bus_type mmc_bus_type = { + .name = "mmc_bus", + .match = mmc_bus_match, +// .hotplug = mmc_bus_hotplug, + .suspend = mmc_bus_suspend, + .resume = mmc_bus_resume, +}; + +static void mss_card_device_release(struct device *dev) +{ + struct mss_card *card = container_of(dev, struct mss_card, dev); + + kfree(card); +} + +static void mss_claim_host(struct mss_host *host, struct mss_card *card) +{ + DECLARE_WAITQUEUE(wait, current); + unsigned long flags; + + /* + spin_lock_irqsave(&host->lock, flags); + while (host->active_card != NULL) { + spin_unlock_irqrestore(&host->lock, flags); + set_current_state(TASK_UNINTERRUPTIBLE); + add_wait_queue(&host->wq, &wait); + schedule(); + set_current_state(TASK_RUNNING); + remove_wait_queue(&host->wq, &wait); + spin_lock_irqsave(&host->lock, flags); + } + */ + + spin_lock_irqsave(&host->lock, flags); + while (host->active_card != NULL) { + set_current_state(TASK_UNINTERRUPTIBLE); + spin_unlock_irqrestore(&host->lock, flags); + add_wait_queue(&host->wq, &wait); + schedule(); + remove_wait_queue(&host->wq, &wait); + spin_lock_irqsave(&host->lock, flags); + } + set_current_state(TASK_RUNNING); + host->active_card = card; + spin_unlock_irqrestore(&host->lock, flags); +} + +static void mss_release_host(struct mss_host* host) +{ + unsigned long flags; + + BUG_ON(host->active_card == NULL); + + spin_lock_irqsave(&host->lock, flags); + host->active_card = NULL; + spin_unlock_irqrestore(&host->lock, flags); + + wake_up(&host->wq); + +} + +int mss_card_get(struct mss_card *card) +{ + if ((card->state & MSS_CARD_REMOVING) + || !(card->state & MSS_CARD_REGISTERED)) + return -ENXIO; + if (!get_device(&card->dev)) + return -ENXIO; + return 0; +} + +void mss_card_put(struct mss_card *card) +{ + put_device(&card->dev); +} + +/* + * finish handling a request. + */ +static void mss_finish_request(struct mss_request *req) +{ + struct mss_driver *drv; + struct mss_card *card = req->card; + + drv = container_of(card->dev.driver, struct mss_driver, driver); + if (drv && drv->request_done) + drv->request_done(req); +} + +/* + * Loop all the protocol in the mss_protocol_list, and find one protocol that + * can successful recognize and init the card. + */ +static int mss_attach_protocol(struct mss_card *card) +{ + struct list_head *item; + struct mss_prot_driver *pdrv = NULL; + struct mss_host *host = card->slot->host; + int ret; + + /* loop all the protocol, and find one that match the card */ + list_for_each(item, &mss_protocol_list) { + pdrv = list_entry(item, struct mss_prot_driver, node); + dbg(card->slot, "try protocol:%s", pdrv->name); + + ret = pdrv->attach_card(card); + if (ret) + continue; + dbg(card->slot, "protocol:%s allocate spec card", pdrv->name); + + mss_claim_host(host, card); + ret = pdrv->prot_entry(card, MSS_RECOGNIZE_CARD, NULL, NULL); + mss_release_host(host); + dbg(card->slot, "protocol:%s identy ret:%d, card type:%d\n", pdrv->name, ret, card->card_type); + if (ret) + continue; + switch (card->card_type) { + case MSS_MMC_CARD: + //case MSS_CE_ATA: + case MSS_SD_CARD: + case MSS_SDIO_CARD: + case MSS_COMBO_CARD: + //dbg("identified card type: %d", card_type); + goto identified; + /* + * The card can be recognized, but it deos not fit the + * controller. + */ + case MSS_UNCOMPATIBLE_CARD: + pdrv->detach_card(card); + return MSS_ERROR_NO_PROTOCOL; + /* The card can not be recognized by the protocl */ + case MSS_UNKNOWN_CARD: + pdrv->detach_card(card); + break; + default: + pdrv->detach_card(card); + printk(KERN_WARNING "protocol driver :%s return unknown value when recognize the card\n", pdrv->name); + break; + } + } + + return MSS_ERROR_NO_PROTOCOL; +identified: + card->prot_driver = pdrv; + return 0; +} + +/* Initialize card by the protocol */ +int mss_init_card(struct mss_card *card) +{ + int ret; + struct mss_host *host = card->slot->host; + + if (!card || !card->prot_driver) + return -EINVAL; + mss_claim_host(host, card); + ret = card->prot_driver->prot_entry(card, MSS_INIT_CARD, NULL, NULL); + mss_release_host(host); + + dbg5("return :%d", ret); + return ret; +} + +int mss_query_card(struct mss_card *card) +{ + int ret; + struct mss_host *host = card->slot->host; + + if (!card || !card->prot_driver) + return -EINVAL; + mss_claim_host(host, card); + ret = card->prot_driver->prot_entry(card, MSS_QUERY_CARD, NULL, NULL); + mss_release_host(host); + + return ret; +} + +static int __mss_insert_card(struct mss_card *card) +{ + int ret; + + dbg(card->slot, "attaching protocol"); + /* Step 1: Recognize the card */ + ret = mss_attach_protocol(card); + if (ret) + return ret; + + dbg(card->slot, "protocol%s attached", card->prot_driver->name); + /* Step 2, initialize the card */ + ret = mss_init_card(card); + if (ret) { + goto detach_prot; + } + + dbg(card->slot, "protocol%s inited", card->prot_driver->name); + /* Step 3, register the card to mmc bus */ + card->dev.release = mss_card_device_release; + card->dev.parent = card->slot->host->dev; + /* set bus_id and name */ + snprintf(&card->dev.bus_id[0], sizeof(card->dev.bus_id), "mmc%d%d", + card->slot->host->id, card->slot->id); + card->dev.bus = &mmc_bus_type; + + card->state |= MSS_CARD_REGISTERED; + ret = device_register(&card->dev); /* will call mss_card_probe */ + if (ret) { + ret = MSS_ERROR_REGISTER_CARD; + card->state &= ~MSS_CARD_REGISTERED; + goto detach_prot; + } + dbg(card->slot, "protocol%s registered\n", card->prot_driver->name); + return MSS_ERROR_NONE; + +detach_prot: + card->prot_driver->detach_card(card); + card->prot_driver = NULL; + return ret; +} + +/* + * After knowing a card has been inserted into the slot, this function should + * be invoked. At last, load card driver in card (done by card_driver->probe). + */ +static int mss_insert_card(struct mss_slot *slot) +{ + struct mss_card * card; + int ret; + + BUG_ON(slot->card); + dbg(slot, "card is inserting"); + card = kzalloc(sizeof(struct mss_card), GFP_KERNEL); + if (!card) + return -ENOMEM; + card->slot = slot; + slot->card = card; + + dbg(slot, "allocate card :0x%p", card); + ret = __mss_insert_card(card); + dbg(slot, "insert ret :%d", ret); + if (ret) { + dbg(slot, "free card"); + slot->card = NULL; + kfree(card); + } + return ret; +} + +static int __mss_eject_card(struct mss_card *card) +{ + card->state |= MSS_CARD_REMOVING; + + dbg(card->slot, "card state 0x%x", card->state); + + if (card->prot_driver) { + card->prot_driver->detach_card(card); + card->prot_driver = NULL; + } + if (card->state & MSS_CARD_REGISTERED) { + device_unregister(&(card->dev)); + //card->state &= ~MSS_CARD_REGISTERED; + } + + return 0; +} + +/* + * After knowing a card has been ejected from the slot, this function should + * be invoked. At last, unload card driver in card(done by card_driver->remove). + */ +static int mss_eject_card(struct mss_card *card) +{ + BUG_ON(!card); + + dbg(card->slot, "eject card 0x%x", card); + __mss_eject_card(card); + + card->slot->card = NULL; + card->slot = NULL; + //kfree(card); + + return 0; +} + +unsigned int mss_get_capacity(struct mss_card *card) +{ + int ret; + u32 cap; + + mss_claim_host(card->slot->host, card); + ret = card->prot_driver->prot_entry(card, MSS_GET_CAPACITY, NULL, &cap); + mss_release_host(card->slot->host); + dbg5("get capcacity:0x%x, ret:%d",cap, ret); + if (ret) + cap = 0; + return cap; +} + +int mss_scan_slot(struct work_struct *work) +{ + struct mss_card *card; + struct mss_host *host; + struct mss_slot *slot; + int ret = 0; + + slot = container_of(work, struct mss_slot, card_detect.work); + + card = slot->card; + host = slot->host; + + + printk("begin scan slot, id = %d card_type = %d\n", slot->id, + (card)?(card->card_type):0); + + /* slot has card in it before, and the card is resuming back */ + if (card && (card->state & MSS_CARD_SUSPENDED)) { + dbg(slot, "suspend, card state is 0x%x", card->state); + printk("suspend, card state is 0x%x", card->state); + /* card was ejected when it is suspended */ + if (host->ops->is_slot_empty + && host->ops->is_slot_empty(slot)) { + card->state |= MSS_CARD_REMOVING; + ret = MSS_ERROR_CARD_REMOVING; + } + else { + /* + * if host provides is_slot_empty, and it + * indicates that the card is in slot, then + * we try to init it. + * else, we try to init it directly. Obvisouly + * that if there is no card in the slot, the + * init will fail + */ + dbg(slot, "no is_slot_empty"); + ret = mss_init_card(card); + if (ret) + card->state |= MSS_CARD_INVALID; + } + } + else if (card && (card->state & MSS_CARD_INVALID)) { + + dbg(slot, "2222222222222"); + + card->state &= ~MSS_CARD_INVALID; + ret = mss_eject_card(card); + + if (!host->ops->is_slot_empty + || (host->ops->is_slot_empty && + !host->ops->is_slot_empty(slot))) { + ret = mss_insert_card(slot); + } + + } + /* slot has card in it before, and no suspend happens */ + else if (card && (card->state & MSS_CARD_REGISTERED)) { + dbg(slot, "33333333333"); + + dbg(slot, "register, card state is %d", card->state); + //printk("register, card state is %d", card->state); + if (host->ops->is_slot_empty) { + dbg(slot, "has is_slot_empty"); + /* card has been ejected */ + if (host->ops->is_slot_empty(slot)) + ret = mss_eject_card(card); + } + else { + /* + * We try to send the status query command. + * If card->state has set MSS_CARD_REGISRTEED, + * it indicates that the card has finished + * identification process, and it will response + * the SEND_STATUS command. + */ + dbg(slot, "no is_slot_empty"); + if (mss_query_card(card)) + /* Card has been ejected */ + ret = mss_eject_card(card); + } + } + /* slot has card in it, but the card is not registered */ + else if (card) { + /* This should never be happens, because when insert fail, we will delete the card */ + BUG(); + } + /* slot has no card in it before */ + else if (!card) { + dbg(slot, "no card in it before"); + + mss_power_off(host); + mss_power_up(host); + mss_idle_cards(host); + if (host->ops->is_slot_empty) { + /* slot is not empty */ + if (!host->ops->is_slot_empty(slot)) + ret = mss_insert_card(slot); + } + else { + /* try to insert a card */ + ret = mss_insert_card(slot); + } + } + else { + printk(KERN_ERR "Unexpected situation when scan host:%d" + ", slot:%d, card state:0x%x\n", host->id, + slot->id, card ? card->state : 0x0); + BUG(); + } + + return ret; +} + +void mss_detect_change(struct mss_host *host, unsigned long delay, unsigned int id) +{ + struct mss_slot *slot; + + slot = &host->slots[id]; + + //printk(" enter mss_detect_change(): delay = %d, id = %d, slot = 0x%xi\n", + // delay, id, slot); + + if (delay) + schedule_delayed_work(&slot->card_detect, delay); + else + schedule_work(&slot->card_detect); + + //printk("%s(): done and exit\n", __FUNCTION__); +} + +void mss_scan_host(struct mss_host *host) +{ + struct mss_slot *slot; + int i; + + for (i = 0; i < host->slot_num; i++) { + slot = &host->slots[i]; + mss_scan_slot(&slot->card_detect.work); + } +} + +void mss_force_card_remove(struct mss_card *card) +{ + mss_eject_card(card); +} + +static void mss_wait_done(struct mss_ll_request *llreq) +{ + complete(llreq->done_data); +} + +int mss_send_ll_req(struct mss_host *host, struct mss_ll_request *llreq) +{ + DECLARE_COMPLETION(complete); + + llreq->done = mss_wait_done; + llreq->done_data = &complete; + + llreq->cmd->llreq = llreq; + llreq->cmd->error = MSS_ERROR_NONE; + if (llreq->data) + llreq->cmd->data = llreq->data; +/* if (llreq->data && llreq->stop) { + llreq->stop->llreq = llreq; + llreq->stop->error = 0; + }*/ + host->ops->request(host, llreq); + wait_for_completion(&complete); +/* if (llreq->cmd->error || (llreq->stop && llreq->stop-error))*/ + + return llreq->cmd->error; +} + +int mss_send_simple_ll_req(struct mss_host *host, struct mss_ll_request *llreq, struct mss_cmd *cmd, u32 opcode, u32 arg, u32 rtype, u32 flags) +{ + memset(llreq, 0x0, sizeof(struct mss_ll_request)); + memset(cmd, 0x0, sizeof(struct mss_cmd)); + + cmd->opcode = opcode; + cmd->arg = arg; + cmd->rtype = rtype; + cmd->flags = flags; + + llreq->cmd = cmd; + + return mss_send_ll_req(host, llreq); +} + + +/* + * add controller into mss_host_list + */ +int register_mss_host(struct mss_host *host) +{ + list_add_tail(&host->node, &mss_host_list); + return 0; +} + +/* + * delete controller from mss_controller_list + */ +void unregister_mss_host(struct mss_host *host) +{ + + list_del(&host->node); +} + +/***************************************************************************** + * + * functions for protocol driver + * + ****************************************************************************/ + +/* + * add protocol driver into mss_protocol_list + */ +int register_mss_prot_driver(struct mss_prot_driver *drv) +{ + struct list_head *item; + struct mss_host *host; + struct mss_slot *slot; + int i; + + list_add(&drv->node, &mss_protocol_list); + + list_for_each(item, &mss_host_list) { + host = list_entry(item, struct mss_host, node); + for (i = 0; i < host->slot_num; i++) { + slot = &host->slots[i]; + if (!slot->card) + mss_scan_slot(&slot->card_detect.work); + } + } + return 0; +} + +/* + * delete protocol driver from mss_protocol_list + */ +void unregister_mss_prot_driver(struct mss_prot_driver *drv) +{ + struct mss_slot *slot; + struct list_head *item; + struct mss_host *host; + int i; + + list_del(&drv->node); + + list_for_each(item, &mss_host_list) { + host = list_entry(item, struct mss_host, node); + for (i = 0; i < host->slot_num; i++) { + slot = &host->slots[i]; + if (slot->card && slot->card->prot_driver == drv) + mss_eject_card(slot->card); + } + } + +} + +/***************************************************************************** + * + * interfaces for card driver + * + ****************************************************************************/ + +/* + * register card driver onto MMC bus + */ +int register_mss_driver (struct mss_driver *drv) +{ + drv->driver.bus = &mmc_bus_type; + return driver_register(&drv->driver); /* will call card_driver->probe */ +} + +/* + * unregister card driver from MMC bus + */ +void unregister_mss_driver (struct mss_driver *drv) +{ + driver_unregister(&drv->driver); +} + +/* + * enable SDIO interrupt, used by SDIO application driver + */ +void mss_set_sdio_int(struct mss_host *host, int sdio_en) +{ + struct mss_ios ios; + + dbg5("mss_set_sdio_int = %s", (sdio_en)?"ENABLE":"DISABLE"); + memcpy(&ios, &host->ios, sizeof(ios)); + ios.sdio_int = sdio_en; + host->ops->set_ios(host, &ios); +} + +void mss_set_clock(struct mss_host *host, int clock) +{ + struct mss_ios ios; + + memcpy(&ios, &host->ios, sizeof(ios)); + if (clock > host->f_max) + clock = host->f_max; + else if (clock < host->f_min) + clock = host->f_min; + ios.clock = clock; + host->ops->set_ios(host, &ios); +} + +void mss_set_buswidth(struct mss_host *host, int buswidth) +{ + struct mss_ios ios; + + memcpy(&ios, &host->ios, sizeof(ios)); + ios.bus_width = buswidth; + host->ops->set_ios(host, &ios); +} + +void mss_set_busmode(struct mss_host *host, int busmode) +{ + struct mss_ios ios; + + memcpy(&ios, &host->ios, sizeof(ios)); + ios.bus_mode = busmode; + host->ops->set_ios(host, &ios); +} + +int mss_send_request(struct mss_request *req) +{ + struct mss_host *host; + struct mss_card *card; +// unsigned long flags; + int ret; + + if (!req->card || !req->card->slot) + return -ENODEV; + card = req->card; + host = card->slot->host; + if (req->card->state & MSS_CARD_REMOVING) + return MSS_ERROR_CARD_REMOVING; + card->state |= MSS_CARD_HANDLEIO; + dbg5("claim host"); + mss_claim_host(host, card); + ret = card->prot_driver->prot_entry(card, req->action, req->arg, + req->result); + mss_release_host(host); + dbg5("release host"); + card->state &= ~MSS_CARD_HANDLEIO; + + if (ret) + req->errno = card->prot_driver->get_errno(card); + + return ret; +} + +struct mss_host * mss_alloc_host(unsigned int slot_num, unsigned int id, unsigned int private_size) +{ + struct mss_host *host; + struct mss_slot *slot; + int i = 0, size; + + printk("%s(): enter\n", __FUNCTION__); + + size = sizeof(struct mss_host) + sizeof(struct mss_slot) * slot_num + + private_size; + host = (struct mss_host *)kzalloc(size, GFP_KERNEL); + if (!host) + return NULL; + memset(host, 0x0, size); + host->id = id; + host->slot_num = slot_num; + while(i < slot_num) { + slot = &host->slots[i]; + slot->id = i; + slot->host = host; + INIT_DELAYED_WORK(&slot->card_detect, (void (*)(void *))mss_scan_slot); + i++; + } + host->private = (void *)&host->slots[slot_num]; + host->active_card = NULL; + init_waitqueue_head(&host->wq); + spin_lock_init(&host->lock); + + return host; +} + +void mss_free_host(struct mss_host *host) +{ + kfree(host); +} + +struct mss_host *mss_find_host(int id) +{ + struct list_head *pos; + struct mss_host *host; + + list_for_each(pos, &mss_host_list) { + host = list_entry(pos, struct mss_host, node); + if (host->id == id) + return host; + } + return NULL; +} + +/***************************************************************************** + * + * module init and exit functions + * + ****************************************************************************/ + +static int mss_core_driver_init(void) +{ + return bus_register(&mmc_bus_type); +} + +static void mss_core_driver_exit(void) +{ + bus_unregister(&mmc_bus_type); +} + + +EXPORT_SYMBOL_GPL(mss_detect_change); +EXPORT_SYMBOL_GPL(mss_scan_slot); +EXPORT_SYMBOL_GPL(mss_scan_host); +EXPORT_SYMBOL_GPL(mss_alloc_host); +EXPORT_SYMBOL_GPL(mss_free_host); +EXPORT_SYMBOL_GPL(mss_find_host); +EXPORT_SYMBOL_GPL(mss_force_card_remove); +EXPORT_SYMBOL_GPL(register_mss_host); +EXPORT_SYMBOL_GPL(unregister_mss_host); + +EXPORT_SYMBOL_GPL(register_mss_driver); +EXPORT_SYMBOL_GPL(unregister_mss_driver); +EXPORT_SYMBOL_GPL(mss_send_request); +EXPORT_SYMBOL_GPL(mss_get_capacity); + +EXPORT_SYMBOL_GPL(register_mss_prot_driver); +EXPORT_SYMBOL_GPL(unregister_mss_prot_driver); +EXPORT_SYMBOL_GPL(mss_send_ll_req); +EXPORT_SYMBOL_GPL(mss_send_simple_ll_req); +EXPORT_SYMBOL_GPL(mss_set_sdio_int); +EXPORT_SYMBOL_GPL(mss_set_buswidth); +EXPORT_SYMBOL_GPL(mss_set_clock); +EXPORT_SYMBOL_GPL(mss_set_busmode); +EXPORT_SYMBOL_GPL(mss_card_get); +EXPORT_SYMBOL_GPL(mss_card_put); + +module_init(mss_core_driver_init); +module_exit(mss_core_driver_exit); + +MODULE_AUTHOR("Bridge Wu"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Core driver for MMC/SD/SDIO card"); --- linux-2.6.24.orig/drivers/mmc/mss/mss_sdhci.c +++ linux-2.6.24/drivers/mmc/mss/mss_sdhci.c @@ -0,0 +1,1778 @@ +/* + * mss_sdhci.c - SD Host Controller interface driver + * + * Copyright (C) 2007 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 only + * for now as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * derived from linux/drivers/mmc/sdhci.c + * Copyright (c) 2005 Pierre Ossman + */ + + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "mss_sdhci.h" + + +#define DRIVER_NAME "sdhci" +#define BUGMAIL " " + +#define DBG(f, x...) \ + pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x) + +static unsigned int debug_nodma = 0; +static unsigned int debug_forcedma = 0; +static unsigned int debug_quirks = 0; + +#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0) +#define SDHCI_QUIRK_FORCE_DMA (1<<1) +/* Controller doesn't like some resets when there is no card inserted. */ +#define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<2) +#define SDHCI_QUIRK_SINGLE_POWER_WRITE (1<<3) + +static const struct pci_device_id pci_ids[] __devinitdata = { + { + .vendor = PCI_VENDOR_ID_RICOH, + .device = PCI_DEVICE_ID_RICOH_R5C822, + .subvendor = PCI_VENDOR_ID_IBM, + .subdevice = PCI_ANY_ID, + .driver_data = SDHCI_QUIRK_CLOCK_BEFORE_RESET | + SDHCI_QUIRK_FORCE_DMA, + }, + + { + .vendor = PCI_VENDOR_ID_RICOH, + .device = PCI_DEVICE_ID_RICOH_R5C822, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = SDHCI_QUIRK_FORCE_DMA | + SDHCI_QUIRK_NO_CARD_NO_RESET, + }, + + { + .vendor = PCI_VENDOR_ID_TI, + .device = PCI_DEVICE_ID_TI_XX21_XX11_SD, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = SDHCI_QUIRK_FORCE_DMA, + }, + + { + .vendor = PCI_VENDOR_ID_ENE, + .device = PCI_DEVICE_ID_ENE_CB712_SD, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE, + }, + + { /* Generic SD host controller */ + PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00) + }, + + { /* end: all zeroes */ }, +}; + +MODULE_DEVICE_TABLE(pci, pci_ids); + +static void sdhci_prepare_data(struct sdhci_host *, struct mss_data *); +static void sdhci_finish_data(struct sdhci_host *); + +static void sdhci_send_command(struct sdhci_host *, struct mss_cmd *); +static void sdhci_finish_command(struct sdhci_host *); + +struct proc_dir_entry *dir_sdhci = NULL; + +static inline struct sdhci_host* slot_to_host(struct mss_slot *slot) +{ + return (struct sdhci_host*)(slot->private); +} + +static inline struct sdhci_host* mss_to_host(struct mss_host *mss) +{ + return (struct sdhci_host*)(mss->private); +} + +static void sdhci_dumpregs(struct sdhci_host *host) +{ + printk(KERN_DEBUG DRIVER_NAME ": ============== REGISTER DUMP ==============\n"); + + printk(KERN_DEBUG DRIVER_NAME ": Sys addr: 0x%08x | Version: 0x%08x\n", + readl(host->ioaddr + SDHCI_DMA_ADDRESS), + readw(host->ioaddr + SDHCI_HOST_VERSION)); + printk(KERN_DEBUG DRIVER_NAME ": Blk size: 0x%08x | Blk cnt: 0x%08x\n", + readw(host->ioaddr + SDHCI_BLOCK_SIZE), + readw(host->ioaddr + SDHCI_BLOCK_COUNT)); + printk(KERN_DEBUG DRIVER_NAME ": Argument: 0x%08x | Trn mode: 0x%08x\n", + readl(host->ioaddr + SDHCI_ARGUMENT), + readw(host->ioaddr + SDHCI_TRANSFER_MODE)); + printk(KERN_DEBUG DRIVER_NAME ": Present: 0x%08x | Host ctl: 0x%08x\n", + readl(host->ioaddr + SDHCI_PRESENT_STATE), + readb(host->ioaddr + SDHCI_HOST_CONTROL)); + printk(KERN_DEBUG DRIVER_NAME ": Power: 0x%08x | Blk gap: 0x%08x\n", + readb(host->ioaddr + SDHCI_POWER_CONTROL), + readb(host->ioaddr + SDHCI_BLOCK_GAP_CONTROL)); + printk(KERN_DEBUG DRIVER_NAME ": Wake-up: 0x%08x | Clock: 0x%08x\n", + readb(host->ioaddr + SDHCI_WALK_UP_CONTROL), + readw(host->ioaddr + SDHCI_CLOCK_CONTROL)); + printk(KERN_DEBUG DRIVER_NAME ": Timeout: 0x%08x | Int stat: 0x%08x\n", + readb(host->ioaddr + SDHCI_TIMEOUT_CONTROL), + readl(host->ioaddr + SDHCI_INT_STATUS)); + printk(KERN_DEBUG DRIVER_NAME ": Int enab: 0x%08x | Sig enab: 0x%08x\n", + readl(host->ioaddr + SDHCI_INT_ENABLE), + readl(host->ioaddr + SDHCI_SIGNAL_ENABLE)); + printk(KERN_DEBUG DRIVER_NAME ": AC12 err: 0x%08x | Slot int: 0x%08x\n", + readw(host->ioaddr + SDHCI_ACMD12_ERR), + readw(host->ioaddr + SDHCI_SLOT_INT_STATUS)); + printk(KERN_DEBUG DRIVER_NAME ": Caps: 0x%08x | Max curr: 0x%08x\n", + readl(host->ioaddr + SDHCI_CAPABILITIES), + readl(host->ioaddr + SDHCI_MAX_CURRENT)); + + printk(KERN_DEBUG DRIVER_NAME ": ===========================================\n"); +} + +#ifdef CONFIG_PROC_FS +static int sdhci_read_proc(char* page, char** start, off_t off, int count, int* eof, void* data) { +int len = 0; +struct sdhci_host *host=(struct sdhci_host *)data; + + if (host == NULL) goto done; + + len += sprintf(page+len, DRIVER_NAME ": ============== REGISTER DUMP ==============\n"); + + len += sprintf(page+len, DRIVER_NAME ": Sys addr: 0x%08x | Version: 0x%08x\n", + readl(host->ioaddr + SDHCI_DMA_ADDRESS), + readw(host->ioaddr + SDHCI_HOST_VERSION)); + len += sprintf(page+len, DRIVER_NAME ": Blk size: 0x%08x | Blk cnt: 0x%08x\n", + readw(host->ioaddr + SDHCI_BLOCK_SIZE), + readw(host->ioaddr + SDHCI_BLOCK_COUNT)); + len += sprintf(page+len, DRIVER_NAME ": Argument: 0x%08x | Trn mode: 0x%08x\n", + readl(host->ioaddr + SDHCI_ARGUMENT), + readw(host->ioaddr + SDHCI_TRANSFER_MODE)); + len += sprintf(page+len, DRIVER_NAME ": Present: 0x%08x | Host ctl: 0x%08x\n", + readl(host->ioaddr + SDHCI_PRESENT_STATE), + readb(host->ioaddr + SDHCI_HOST_CONTROL)); + len += sprintf(page+len, DRIVER_NAME ": Power: 0x%08x | Blk gap: 0x%08x\n", + readb(host->ioaddr + SDHCI_POWER_CONTROL), + readb(host->ioaddr + SDHCI_BLOCK_GAP_CONTROL)); + len += sprintf(page+len, DRIVER_NAME ": Wake-up: 0x%08x | Clock: 0x%08x\n", + readb(host->ioaddr + SDHCI_WALK_UP_CONTROL), + readw(host->ioaddr + SDHCI_CLOCK_CONTROL)); + len += sprintf(page+len, DRIVER_NAME ": Timeout: 0x%08x | Int stat: 0x%08x\n", + readb(host->ioaddr + SDHCI_TIMEOUT_CONTROL), + readl(host->ioaddr + SDHCI_INT_STATUS)); + len += sprintf(page+len, DRIVER_NAME ": Int enab: 0x%08x | Sig enab: 0x%08x\n", + readl(host->ioaddr + SDHCI_INT_ENABLE), + readl(host->ioaddr + SDHCI_SIGNAL_ENABLE)); + len += sprintf(page+len, DRIVER_NAME ": AC12 err: 0x%08x | Slot int: 0x%08x\n", + readw(host->ioaddr + SDHCI_ACMD12_ERR), + readw(host->ioaddr + SDHCI_SLOT_INT_STATUS)); + len += sprintf(page+len, DRIVER_NAME ": Caps: 0x%08x | Max curr: 0x%08x\n", + readl(host->ioaddr + SDHCI_CAPABILITIES), + readl(host->ioaddr + SDHCI_MAX_CURRENT)); + + len += sprintf(page+len, DRIVER_NAME ": ===========================================\n"); + +done: + *eof = 1; + return len; +} +#endif + +/*****************************************************************************\ + * * + * Low level functions * + * * +\*****************************************************************************/ + +static void sdhci_reset(struct sdhci_host *host, u8 mask) +{ + unsigned long timeout; + + if (host->chip->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { + if (!(readl(host->ioaddr + SDHCI_PRESENT_STATE) & + SDHCI_CARD_PRESENT)) + return; + } + + writeb(mask, host->ioaddr + SDHCI_SOFTWARE_RESET); + + if (mask & SDHCI_RESET_ALL) + host->clock = 0; + + /* Wait max 100 ms */ + timeout = 100; + + /* hw clears the bit when it's done */ + while (readb(host->ioaddr + SDHCI_SOFTWARE_RESET) & mask) { + if (timeout == 0) { + printk(KERN_ERR "mmchost: Reset 0x%x never completed.\n", (int)mask); + sdhci_dumpregs(host); + return; + } + timeout--; + mdelay(1); + } +} + +static void sdhci_init(struct sdhci_host *host) +{ + u32 intmask; + + sdhci_reset(host, SDHCI_RESET_ALL); + + intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | + SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | + SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | + SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT | + SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | + SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE; + + writel(intmask, host->ioaddr + SDHCI_INT_ENABLE); + writel(intmask, host->ioaddr + SDHCI_SIGNAL_ENABLE); +} + +static void sdhci_activate_led(struct sdhci_host *host) +{ + u8 ctrl; + + ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); + ctrl |= SDHCI_CTRL_LED; + writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); +} + +static void sdhci_deactivate_led(struct sdhci_host *host) +{ + u8 ctrl; + + ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); + ctrl &= ~SDHCI_CTRL_LED; + writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); +} + +/*****************************************************************************\ + * * + * Core functions * + * * +\*****************************************************************************/ + +static inline char* sdhci_sg_to_buffer(struct sdhci_host* host) +{ + return page_address(host->cur_sg->page) + host->cur_sg->offset; +} + +static inline int sdhci_next_sg(struct sdhci_host* host) +{ + /* Skip to next SG entry. */ + host->cur_sg++; + host->num_sg--; + + /* Any entries left? */ + if (host->num_sg > 0) { + host->offset = 0; + host->remain = host->cur_sg->length; + } + + return host->num_sg; +} + +static void sdhci_read_block_pio(struct sdhci_host *host) +{ + int blksize, chunk_remain; + u32 data; + char *buffer; + int size; + + + blksize = host->data->blksz; + chunk_remain = 0; + data = 0; + + buffer = sdhci_sg_to_buffer(host) + host->offset; + + while (blksize) { + if (chunk_remain == 0) { + data = readl(host->ioaddr + SDHCI_BUFFER); + chunk_remain = min(blksize, 4); + } + + size = min(host->size, host->remain); + size = min(size, chunk_remain); + + chunk_remain -= size; + blksize -= size; + host->offset += size; + host->remain -= size; + host->size -= size; + while (size) { + *buffer = data & 0xFF; + buffer++; + data >>= 8; + size--; + } + + if (host->remain == 0) { + if (sdhci_next_sg(host) == 0) { + BUG_ON(blksize != 0); + return; + } + buffer = sdhci_sg_to_buffer(host); + } + } +} + +static void sdhci_write_block_pio(struct sdhci_host *host) +{ + int blksize, chunk_remain; + u32 data; + char *buffer; + int bytes, size; + + + blksize = host->data->blksz; + chunk_remain = 4; + data = 0; + + bytes = 0; + buffer = sdhci_sg_to_buffer(host) + host->offset; + + while (blksize) { + size = min(host->size, host->remain); + size = min(size, chunk_remain); + + chunk_remain -= size; + blksize -= size; + host->offset += size; + host->remain -= size; + host->size -= size; + while (size) { + data >>= 8; + data |= (u32)*buffer << 24; + buffer++; + size--; + } + + if (chunk_remain == 0) { + writel(data, host->ioaddr + SDHCI_BUFFER); + chunk_remain = min(blksize, 4); + } + + if (host->remain == 0) { + if (sdhci_next_sg(host) == 0) { + BUG_ON(blksize != 0); + return; + } + buffer = sdhci_sg_to_buffer(host); + } + } +} + +static void sdhci_transfer_pio(struct sdhci_host *host) +{ + u32 mask; + + BUG_ON(!host->data); + + if (host->size == 0) + return; + + if (host->data->flags & MSS_DATA_READ) + mask = SDHCI_DATA_AVAILABLE; + else + mask = SDHCI_SPACE_AVAILABLE; + + while (readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask) { + if (host->data->flags & MSS_DATA_READ) + sdhci_read_block_pio(host); + else + sdhci_write_block_pio(host); + + if (host->size == 0) + break; + + BUG_ON(host->num_sg == 0); + } + + DBG("PIO transfer complete.\n"); +} + + +static void sdhci_prepare_data(struct sdhci_host *host, struct mss_data *data) +{ + u8 count; + unsigned target_timeout, current_timeout; + + WARN_ON(host->data); + + if (data == NULL) + return; + + DBG("blksz %04x blks %04x flags %08x\n", + data->blksz, data->blocks, data->flags); + DBG("tsac %d ms\n", data->timeout_ns / 1000000); + + /* Sanity checks */ + BUG_ON(data->blksz * data->blocks > 524288); + //BUG_ON(data->blksz > host->mmc->max_blk_size); + BUG_ON(data->blocks > 65535); + + /* timeout in us */ + target_timeout = data->timeout_ns / 1000; + + /* + * Figure out needed cycles. + * We do this in steps in order to fit inside a 32 bit int. + * The first step is the minimum timeout, which will have a + * minimum resolution of 6 bits: + * (1) 2^13*1000 > 2^22, + * (2) host->timeout_clk < 2^16 + * => + * (1) / (2) > 2^6 + */ + count = 0; + current_timeout = (1 << 13) * 1000 / host->timeout_clk; + while (current_timeout < target_timeout) { + count++; + current_timeout <<= 1; + if (count >= 0xF) + break; + } + + if (count >= 0xF) { + printk(KERN_WARNING "mmchost: Too large timeout requested!\n"); + count = 0xE; + } + + if (count == 0) count = 0x8; /* add by feng for SD memory timeout issue */ + writeb(count, host->ioaddr + SDHCI_TIMEOUT_CONTROL); + + if (host->flags & SDHCI_USE_DMA) { + int count; + + count = pci_map_sg(host->chip->pdev, data->sg, data->sg_len, + (data->flags & MSS_DATA_READ)?PCI_DMA_FROMDEVICE:PCI_DMA_TODEVICE); + BUG_ON(count != 1); + + writel(sg_dma_address(data->sg), host->ioaddr + SDHCI_DMA_ADDRESS); + } else { + host->size = data->blksz * data->blocks; + + host->cur_sg = data->sg; + host->num_sg = data->sg_len; + + host->offset = 0; + host->remain = host->cur_sg->length; + } + + + /* We do not handle DMA boundaries, so set it to max (512 KiB) */ + writew(SDHCI_MAKE_BLKSZ(7, data->blksz), + host->ioaddr + SDHCI_BLOCK_SIZE); + writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT); +} + +static void sdhci_set_transfer_mode(struct sdhci_host *host, + struct mss_data *data) +{ + u16 mode; + + WARN_ON(host->data); + + if (data == NULL) + return; + + mode = SDHCI_TRNS_BLK_CNT_EN; + if (data->blocks > 1) + mode |= SDHCI_TRNS_MULTI; + if (data->flags & MSS_DATA_READ) + mode |= SDHCI_TRNS_READ; + if (host->flags & SDHCI_USE_DMA) + mode |= SDHCI_TRNS_DMA; + + writew(mode, host->ioaddr + SDHCI_TRANSFER_MODE); +} + +static void sdhci_finish_data(struct sdhci_host *host) +{ + struct mss_data *data; + struct mss_cmd *cmd; + u16 blocks; + + BUG_ON(!host->data); + BUG_ON(!host->mrq->cmd); + + data = host->data; + cmd = host->mrq->cmd; + host->data = NULL; + + if (host->flags & SDHCI_USE_DMA) { + pci_unmap_sg(host->chip->pdev, data->sg, data->sg_len, + (data->flags & MSS_DATA_READ)?PCI_DMA_FROMDEVICE:PCI_DMA_TODEVICE); + } + + /* + * Controller doesn't count down when in single block mode. + */ + if ((data->blocks == 1) && (cmd->error == MSS_ERROR_NONE)) + blocks = 0; + else + blocks = readw(host->ioaddr + SDHCI_BLOCK_COUNT); + data->bytes_xfered = data->blksz * (data->blocks - blocks); + + if ((cmd->error == MSS_ERROR_NONE) && blocks) { + printk(KERN_ERR "mmchost: Controller signalled completion even " + "though there were blocks left. Please report this " + "to " BUGMAIL ".\n"); + cmd->error = MSS_ERROR_CRC; + } else if (host->size != 0) { + printk(KERN_ERR "mmchost: %d bytes were left untransferred. " + "Please report this to " BUGMAIL ".\n", host->size); + cmd->error = MSS_ERROR_CRC; + } + + DBG("Ending data transfer (%d bytes)\n", data->bytes_xfered); + + tasklet_schedule(&host->finish_tasklet); +} + +static void sdhci_send_command(struct sdhci_host *host, struct mss_cmd *cmd) +{ + unsigned long flags; + u32 mask; + unsigned long timeout; + + WARN_ON(host->cmd); + + DBG("Sending cmd (%x)\n", cmd->opcode); + + /* Wait max 10 ms */ + timeout = 10; + + mask = SDHCI_CMD_INHIBIT; + + if ((cmd->data != NULL) || (cmd->rtype == MSS_RESPONSE_R1B)) + mask |= SDHCI_DATA_INHIBIT; + + while (readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask) { + if (timeout == 0) { + printk(KERN_ERR "mmchost: Controller never released " + "inhibit bit(s).\n"); + sdhci_dumpregs(host); + cmd->error = MSS_ERROR_CRC; + tasklet_schedule(&host->finish_tasklet); + return; + } + timeout--; + mdelay(1); + } + + mod_timer(&host->timer, jiffies + 10 * HZ); + + host->cmd = cmd; + + sdhci_prepare_data(host, cmd->data); + + writel(cmd->arg, host->ioaddr + SDHCI_ARGUMENT); + + sdhci_set_transfer_mode(host, cmd->data); + + + switch (cmd->rtype) { + case MSS_RESPONSE_NONE: + flags = SDHCI_CMD_RESP_NONE; + break; + case MSS_RESPONSE_R1: + flags = SDHCI_CMD_RESP_SHORT | SDHCI_CMD_CRC | SDHCI_CMD_INDEX; + break; + case MSS_RESPONSE_R1B: + flags = SDHCI_CMD_RESP_SHORT_BUSY | SDHCI_CMD_CRC | SDHCI_CMD_INDEX; + break; + case MSS_RESPONSE_R2_CID: + case MSS_RESPONSE_R2_CSD: + flags = SDHCI_CMD_RESP_LONG | SDHCI_CMD_CRC; + break; + case MSS_RESPONSE_R3: + flags = SDHCI_CMD_RESP_SHORT; + break; + case MSS_RESPONSE_R6: + flags = SDHCI_CMD_RESP_SHORT | SDHCI_CMD_CRC; + break; + default: + flags = SDHCI_CMD_RESP_SHORT; + } + + if (cmd->data) + flags |= SDHCI_CMD_DATA; + DBG("SEND CMD=%08X, ARG=%08X\n", + SDHCI_MAKE_CMD(cmd->opcode, flags), cmd->arg); + writew(SDHCI_MAKE_CMD(cmd->opcode, flags), + host->ioaddr + SDHCI_COMMAND); +} + +static void sdhci_finish_command(struct sdhci_host *host) +{ + int i; + u32 *rp; + + BUG_ON(host->cmd == NULL); + + if (host->cmd->rtype != MSS_RESPONSE_NONE) { + switch (host->cmd->rtype) { + case MSS_RESPONSE_R2_CID: + case MSS_RESPONSE_R2_CSD: + case MSS_RESPONSE_R3: + host->cmd->response[0] = 0x3f; + break; + case MSS_RESPONSE_R6: + case MSS_RESPONSE_R1: + case MSS_RESPONSE_R1B: + default: + host->cmd->response[0] = host->cmd->opcode; + } + rp = (u32 *)&host->cmd->response[1]; + if ((host->cmd->rtype == MSS_RESPONSE_R2_CID)|| + (host->cmd->rtype == MSS_RESPONSE_R2_CSD)) { + /* CRC is stripped so we need to do some shifting. */ + for (i = 0; i < 4; i++, rp++) { + *rp = readl(host->ioaddr + + SDHCI_RESPONSE + (3-i)*4) << 8; + if (i != 3) + *rp |= readb(host->ioaddr + + SDHCI_RESPONSE + (3-i)*4-1); + //*rp = BYTE_REVERSE(*rp); + *rp = ___arch__swab32(*rp); + } + } else { + *rp = readl(host->ioaddr + SDHCI_RESPONSE); + //*rp = BYTE_REVERSE(*rp); + *rp = ___arch__swab32(*rp); + } + } + + host->cmd->error = MSS_ERROR_NONE; + + DBG("Ending cmd (%x)\n", host->cmd->opcode); + + if (host->cmd->data) + host->data = host->cmd->data; + else + tasklet_schedule(&host->finish_tasklet); + + host->cmd = NULL; +} + +static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) +{ + int div; + //u8 ctrl; + u16 clk; + unsigned long timeout; + + if (clock == host->clock) + return; + + writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL); + + + /* + ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); + if (clock > 25000000) + ctrl |= SDHCI_CTRL_HISPD; + else + ctrl &= ~SDHCI_CTRL_HISPD; + writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); + */ + + if (clock == 0) + goto out; + + for (div = 1;div < 256;div *= 2) { + if ((host->max_clk / div) <= clock) + break; + } + div >>= 1; + + clk = div << SDHCI_DIVIDER_SHIFT; + clk |= SDHCI_CLOCK_INT_EN; + writew(clk, host->ioaddr + SDHCI_CLOCK_CONTROL); + + /* Wait max 10 ms */ + timeout = 10; + while (!((clk = readw(host->ioaddr + SDHCI_CLOCK_CONTROL)) + & SDHCI_CLOCK_INT_STABLE)) { + if (timeout == 0) { + printk(KERN_ERR "mmchost: Internal clock never estabilised.\n"); + sdhci_dumpregs(host); + return; + } + timeout--; + mdelay(1); + } + + clk |= SDHCI_CLOCK_CARD_EN; + writew(clk, host->ioaddr + SDHCI_CLOCK_CONTROL); + +out: + host->clock = clock; +} + +static void sdhci_set_power(struct sdhci_host *host, unsigned short power) +{ + u8 pwr; + int i; + + /* feng: modify ulong to ushort for 2.6.21 porting */ + if (power != (unsigned short)-1) { + for(i = 0; (i < 16)&&!(power&1); i++) power >>= 1; + power = i; + } + DBG("set power to %d\n", power); + + + if (host->power == power) + return; + + if (power == (unsigned short)-1) { + writeb(0, host->ioaddr + SDHCI_POWER_CONTROL); + goto out; + } + + /* + * Spec says that we should clear the power reg before setting + * a new value. Some controllers don't seem to like this though. + */ + if (!(host->chip->quirks & SDHCI_QUIRK_SINGLE_POWER_WRITE)) + writeb(0, host->ioaddr + SDHCI_POWER_CONTROL); + + pwr = SDHCI_POWER_ON; + + /* + switch (power) { + case MSS_VDD_170: + case MSS_VDD_180: + case MSS_VDD_190: + pwr |= SDHCI_POWER_180; + break; + case MSS_VDD_290: + case MSS_VDD_300: + case MSS_VDD_310: + pwr |= SDHCI_POWER_300; + break; + case MSS_VDD_320: + case MSS_VDD_330: + case MSS_VDD_340: + pwr |= SDHCI_POWER_330; + break; + default: + // mask by feng, temply masked it for debug + //BUG(); + } + */ + + /* added for temp use */ + pwr |= SDHCI_POWER_330; + + writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL); + +out: + host->power = power; + +} + +/*****************************************************************************\ + * * + * MMC callbacks * + * * +\*****************************************************************************/ + +static void sdhci_request(struct mss_host *mmc, struct mss_ll_request *mrq) +{ + struct sdhci_host *host; + unsigned long flags; + + host = mss_to_host(mmc); + if (mmc->active_card != NULL) + host->card = mmc->active_card; + + spin_lock_irqsave(&host->lock, flags); + + WARN_ON(host->mrq != NULL); + + sdhci_activate_led(host); + + host->mrq = mrq; + + if (!(readl(host->ioaddr + SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT)) { + host->mrq->cmd->error = MSS_ERROR_TIMEOUT; + tasklet_schedule(&host->finish_tasklet); + } else + sdhci_send_command(host, mrq->cmd); + + mmiowb(); + spin_unlock_irqrestore(&host->lock, flags); +} + +static void sdhci_set_ios(struct mss_host *mmc, struct mss_ios *ios) +{ + struct sdhci_host *host; + unsigned long flags; + u8 ctrl; + u32 intmask; + host = mss_to_host(mmc); + + DBG("clock %uHz busmode %u powermode %u cs %u Vdd %u width %u\n", + ios->clock, ios->bus_mode, ios->power_mode, + ios->chip_select, ios->vdd, ios->bus_width); + + spin_lock_irqsave(&host->lock, flags); + + /* + * Reset the chip on each power off. + * Should clear out any weird states. + */ + if (ios->power_mode == MSS_POWER_OFF) { + writel(0, host->ioaddr + SDHCI_SIGNAL_ENABLE); + sdhci_init(host); + } + + sdhci_set_clock(host, ios->clock); + + if (ios->power_mode == MSS_POWER_OFF) + sdhci_set_power(host, -1); + else + sdhci_set_power(host, ios->vdd); + + ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); + if (ios->bus_width == MSS_BUSWIDTH_4BIT) + ctrl |= SDHCI_CTRL_4BITBUS; + else + ctrl &= ~SDHCI_CTRL_4BITBUS; + + /* temply masked by feng + if (ios->timing == MMC_TIMING_SD_HS) + ctrl |= SDHCI_CTRL_HISPD; + else + ctrl &= ~SDHCI_CTRL_HISPD; + */ + + writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); + mmiowb(); + + + if (ios->sdio_int == MSS_SDIO_INT_EN) { + intmask = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE); + intmask |= SDHCI_INT_CARD_INT; + writel(intmask, host->ioaddr + SDHCI_SIGNAL_ENABLE); + + intmask = readl(host->ioaddr + SDHCI_INT_ENABLE); + intmask |= SDHCI_INT_CARD_INT; + writel(intmask, host->ioaddr + SDHCI_INT_ENABLE); + } else { + intmask = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE); + intmask &= ~(SDHCI_INT_CARD_INT); + writel(intmask, host->ioaddr + SDHCI_SIGNAL_ENABLE); + + intmask = readl(host->ioaddr + SDHCI_INT_ENABLE); + intmask &= ~(SDHCI_INT_CARD_INT); + writel(intmask, host->ioaddr + SDHCI_INT_ENABLE); + } + + + memcpy(&host->mmc->ios, ios, sizeof(struct mss_ios)); + spin_unlock_irqrestore(&host->lock, flags); +} + +/* +static int sdhci_slot_is_wp(struct mss_slot *slot) +{ + struct sdhci_host *host; + int present; + + host = slot_to_host(slot); + present = readl(host->ioaddr + SDHCI_PRESENT_STATE); + return !(present & SDHCI_WRITE_PROTECT); +} + +static int sdhci_slot_is_empty(struct mss_slot *slot) +{ + struct sdhci_host *host; + int present; + + host = slot_to_host(slot); + present = readl(host->ioaddr + SDHCI_PRESENT_STATE); + return !(present & SDHCI_CARD_PRESENT); +} + +static int sdhci_mss_slot_is_wp(struct mss_slot *slot) +{ + struct sdhci_host *host; + int result; + unsigned long flags; + + host = slot_to_host(slot); + spin_lock_irqsave(&host->lock, flags); + result = sdhci_slot_is_wp(slot); + spin_unlock_irqrestore(&host->lock, flags); + return result; +} + +static int sdhci_mss_slot_is_empty(struct mss_slot *slot) +{ + struct sdhci_host *host; + int result; + unsigned long flags; + + host = slot_to_host(slot); + spin_lock_irqsave(&host->lock, flags); + result = sdhci_slot_is_empty(slot); + spin_unlock_irqrestore(&host->lock, flags); + return result; +} +*/ + +static u32 sdhci_get_cur_state(struct mss_slot *slot) +{ + struct sdhci_host *host; + u32 state; + unsigned long flags; + + host = slot_to_host(slot); + spin_lock_irqsave(&host->lock, flags); + state = readl(host->ioaddr + SDHCI_PRESENT_STATE); + spin_unlock_irqrestore(&host->lock, flags); + return state; +} + +static int sdhci_mss_slot_is_wp(struct mss_slot *slot) +{ + return !( sdhci_get_cur_state(slot) & SDHCI_WRITE_PROTECT); +} + +static int sdhci_mss_slot_is_empty(struct mss_slot *slot) +{ + return !( sdhci_get_cur_state(slot) & SDHCI_CARD_PRESENT); +} + + +static struct mss_host_ops sdhci_ops = { + .request = sdhci_request, + .set_ios = sdhci_set_ios, + .is_slot_empty = sdhci_mss_slot_is_empty, + .is_slot_wp = sdhci_mss_slot_is_wp, +}; + +/*****************************************************************************\ + * * + * Tasklets * + * * +\*****************************************************************************/ + +static void sdhci_tasklet_card(unsigned long param) +{ + struct sdhci_host *host; + unsigned long flags; + + host = (struct sdhci_host*)param; + + spin_lock_irqsave(&host->lock, flags); + + if (!(readl(host->ioaddr + SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT)) { + if (host->mrq) { + printk(KERN_ERR "mmchost: Card removed during transfer!\n"); + printk(KERN_ERR "mmchost: Resetting controller.\n"); + + sdhci_reset(host, SDHCI_RESET_CMD); + sdhci_reset(host, SDHCI_RESET_DATA); + + host->mrq->cmd->error = MSS_ERROR_CRC; + tasklet_schedule(&host->finish_tasklet); + } + } + + spin_unlock_irqrestore(&host->lock, flags); + + + mss_detect_change(host->mmc, msecs_to_jiffies(500), 0); + //mmc_detect_change(host->mmc, msecs_to_jiffies(500)); + +} + +static void sdhci_tasklet_finish(unsigned long param) +{ + struct sdhci_host *host; + unsigned long flags; + struct mss_ll_request *mrq; + host = (struct sdhci_host*)param; + + spin_lock_irqsave(&host->lock, flags); + + del_timer(&host->timer); + + mrq = host->mrq; + + DBG("Ending request, cmd (%x)\n", mrq->cmd->opcode); + + /* + * The controller needs a reset of internal state machines + * upon error conditions. + */ + + if (mrq->cmd->error != MSS_ERROR_NONE) { + //if ((mrq->cmd->error != MSS_ERROR_NONE) || + // (mrq->data && ((mrq->data->error != MSS_ERROR_NONE) || + // (mrq->data->stop && (mrq->data->stop->error != MSS_ERROR_NONE))))) { + + /* Some controllers need this kick or reset won't work here */ + if (host->chip->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET) { + unsigned int clock; + + /* This is to force an update */ + clock = host->clock; + host->clock = 0; + sdhci_set_clock(host, clock); + } + + /* Spec says we should do both at the same time, but Ricoh + controllers do not like that. */ + sdhci_reset(host, SDHCI_RESET_CMD); + sdhci_reset(host, SDHCI_RESET_DATA); + } + + +// printk(KERN_EMERG "%%%%%%%%%%%%%host->cmd = NULL; host->data = NULL %%%%%%%%%%%%%%%%%%%%\n"); + host->cmd = NULL; + host->data = NULL; + + sdhci_deactivate_led(host); + + mmiowb(); + spin_unlock_irqrestore(&host->lock, flags); + + host->mrq->done(host->mrq); + host->mrq = NULL; +} + +static void sdhci_timeout_timer(unsigned long data) +{ + struct sdhci_host *host; + unsigned long flags; + + host = (struct sdhci_host*)data; + + spin_lock_irqsave(&host->lock, flags); + + + + if (host->data) { + host->mrq->cmd->error = MSS_ERROR_TIMEOUT; + sdhci_finish_data(host); + } else { + if (host->cmd) + host->cmd->error = MSS_ERROR_TIMEOUT; + else + host->mrq->cmd->error = MSS_ERROR_TIMEOUT; + + tasklet_schedule(&host->finish_tasklet); + } + + mmiowb(); + spin_unlock_irqrestore(&host->lock, flags); +} + +/*****************************************************************************\ + * * + * Interrupt handling * + * * +\*****************************************************************************/ + +static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) +{ + BUG_ON(intmask == 0); + + if (!host->cmd) { + printk(KERN_ERR "mmchost: Got command interrupt even though no " + "command operation was in progress.\n"); + sdhci_dumpregs(host); + return; + } + + if (intmask & SDHCI_INT_RESPONSE) + sdhci_finish_command(host); + else { + if (intmask & SDHCI_INT_TIMEOUT) + host->cmd->error = MSS_ERROR_TIMEOUT; + else if (intmask & SDHCI_INT_CRC) + host->cmd->error = MSS_ERROR_CRC; + else if (intmask & (SDHCI_INT_END_BIT | SDHCI_INT_INDEX)) + host->cmd->error = MSS_ERROR_CRC; + else + host->cmd->error = MSS_ERROR_CRC; + + tasklet_schedule(&host->finish_tasklet); + } +} + +static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) +{ + BUG_ON(intmask == 0); + + if (!host->data) { + /* + * A data end interrupt is sent together with the response + * for the stop command. + */ + if (intmask & SDHCI_INT_DATA_END) + return; + + printk(KERN_ERR "mmchost: Got data interrupt even though no " + "data operation was in progress.\n"); + sdhci_dumpregs(host); + + return; + } + + if (intmask & SDHCI_INT_DATA_TIMEOUT) + host->mrq->cmd->error = MSS_ERROR_TIMEOUT; + else if (intmask & SDHCI_INT_DATA_CRC) + host->mrq->cmd->error = MSS_ERROR_CRC; + else if (intmask & SDHCI_INT_DATA_END_BIT) + host->mrq->cmd->error = MSS_ERROR_CRC; + + if (host->mrq->cmd->error != MSS_ERROR_NONE) + sdhci_finish_data(host); + else { + if (intmask & (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL)) + sdhci_transfer_pio(host); + + if (intmask & SDHCI_INT_DATA_END) + sdhci_finish_data(host); + } +} + +/* static irqreturn_t sdhci_irq(int irq, void *dev_id, struct pt_regs *regs) */ +static irqreturn_t sdhci_irq(int irq, void *dev_id) +{ + irqreturn_t result; + struct sdhci_host* host = dev_id; + u32 intmask; + struct mss_driver *drv; + struct mss_card *card; + u32 imask; + + spin_lock(&host->lock); + + intmask = readl(host->ioaddr + SDHCI_INT_STATUS); + + if (!intmask || intmask == 0xffffffff) { + result = IRQ_NONE; + goto out; + } + + DBG("*** %s got interrupt: 0x%08x\n", host->slot_descr, intmask); + + if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { + writel(intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE), + host->ioaddr + SDHCI_INT_STATUS); + tasklet_schedule(&host->card_tasklet); + } + + intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); + + if (intmask & SDHCI_INT_CMD_MASK) { + writel(intmask & SDHCI_INT_CMD_MASK, + host->ioaddr + SDHCI_INT_STATUS); + sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK); + } + + if (intmask & SDHCI_INT_DATA_MASK) { + writel(intmask & SDHCI_INT_DATA_MASK, + host->ioaddr + SDHCI_INT_STATUS); + sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK); + } + + /* previous sdhci.c has no code for card interrupt handling */ + if (intmask & SDHCI_INT_CARD_INT) { + /* disable the card interrupt */ + imask = readl(host->ioaddr + SDHCI_INT_ENABLE); + imask &= ~(SDHCI_INT_CARD_INT); + writel(imask, host->ioaddr + SDHCI_INT_ENABLE); + + /* send the card interrupt to the SDIO app driver */ + card = host->card; + if (card) + drv = container_of(card->dev.driver, struct mss_driver, driver); + if (card && drv && (drv->sdio_int_handler != NULL)) + drv->sdio_int_handler(card); + } + + + intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK); + + if (intmask & SDHCI_INT_BUS_POWER) { + printk(KERN_ERR "mmchost: Card is consuming too much power!\n"); + writel(SDHCI_INT_BUS_POWER, host->ioaddr + SDHCI_INT_STATUS); + } + + intmask &= SDHCI_INT_BUS_POWER; + + if (intmask) { + printk(KERN_ERR "mmchost: Unexpected interrupt 0x%08x.\n", intmask); + sdhci_dumpregs(host); + + writel(intmask, host->ioaddr + SDHCI_INT_STATUS); + } + + result = IRQ_HANDLED; + + + mmiowb(); +out: + spin_unlock(&host->lock); + + return result; +} + +/*****************************************************************************\ + * * + * Suspend/resume * + * * +\*****************************************************************************/ + +#ifdef CONFIG_PM + +static int sdhci_suspend (struct pci_dev *pdev, pm_message_t state) +{ + struct sdhci_chip *chip; + int i, ret; + + chip = pci_get_drvdata(pdev); + if (!chip) + return 0; + + DBG("Suspending...\n"); + + pci_save_state(pdev); + pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); + + for (i = 0;i < chip->num_slots;i++) { + if (!chip->hosts[i]) + continue; + free_irq(chip->hosts[i]->irq, chip->hosts[i]); + } + + pci_disable_device(pdev); + pci_set_power_state(pdev, pci_choose_state(pdev, state)); + + return 0; +} + +static int sdhci_resume (struct pci_dev *pdev) +{ + struct sdhci_chip *chip; + int i, ret; + + chip = pci_get_drvdata(pdev); + if (!chip) + return 0; + + DBG("Resuming...\n"); + + pci_set_power_state(pdev, PCI_D0); + pci_restore_state(pdev); + ret = pci_enable_device(pdev); + if (ret) + return ret; + + for (i = 0;i < chip->num_slots;i++) { + if (!chip->hosts[i]) + continue; + if (chip->hosts[i]->flags & SDHCI_USE_DMA) + pci_set_master(pdev); + ret = request_irq(chip->hosts[i]->irq, sdhci_irq, + IRQF_SHARED, chip->hosts[i]->slot_descr, + chip->hosts[i]); + if (ret) + return ret; + sdhci_init(chip->hosts[i]); + mmiowb(); + } + + return 0; +} + +#else /* CONFIG_PM */ + +#define sdhci_suspend NULL +#define sdhci_resume NULL + +#endif /* CONFIG_PM */ + +/*****************************************************************************\ + * * + * Device probing/removal * + * * +\*****************************************************************************/ + +static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) +{ + int ret; + unsigned int version; + struct sdhci_chip *chip; + struct mss_host *mmc; + struct sdhci_host *host; +#ifdef CONFIG_PROC_FS + struct proc_dir_entry *proc_sdhci = NULL; + char pbuf[50]; +#endif + u8 first_bar; + unsigned int caps; + + u32 tmpval; + + + chip = pci_get_drvdata(pdev); + BUG_ON(!chip); + + ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &first_bar); + if (ret) + return ret; + first_bar &= PCI_SLOT_INFO_FIRST_BAR_MASK; + + if (first_bar > 5) { + printk(KERN_ERR DRIVER_NAME ": Invalid first BAR. Aborting.\n"); + return -ENODEV; + } + + if (!(pci_resource_flags(pdev, first_bar + slot) & IORESOURCE_MEM)) { + printk(KERN_ERR DRIVER_NAME ": BAR is not iomem. Aborting.\n"); + return -ENODEV; + } + + tmpval = pci_resource_len(pdev, first_bar + slot); + + if (pci_resource_len(pdev, first_bar + slot) != 0x100) { + printk(KERN_ERR DRIVER_NAME ": Invalid iomem size. " + "You may experience problems.\n"); + } + + if ((pdev->class & 0x0000FF) == PCI_SDHCI_IFVENDOR) { + printk(KERN_ERR DRIVER_NAME ": Vendor specific interface. Aborting.\n"); + return -ENODEV; + } + + if ((pdev->class & 0x0000FF) > PCI_SDHCI_IFVENDOR) { + printk(KERN_ERR DRIVER_NAME ": Unknown interface. Aborting.\n"); + return -ENODEV; + } + + //DBG("starting mss alloc process\n"); + + mmc = mss_alloc_host(1, 0, sizeof(struct sdhci_host)); + if (!mmc) + return -ENOMEM; + + host = mss_to_host(mmc); + host->mmc = mmc; + + host->chip = chip; + chip->hosts[slot] = host; + + mmc->slots->private = host; + host->card = NULL; + host->bar = first_bar + slot; + + host->addr = pci_resource_start(pdev, host->bar); + host->irq = pdev->irq; + + + snprintf(host->slot_descr, 20, "sdhci:slot%d", slot); + ret = pci_request_region(pdev, host->bar, host->slot_descr); + if (ret) + goto free; + + host->ioaddr = ioremap_nocache(host->addr, + pci_resource_len(pdev, host->bar)); + if (!host->ioaddr) { + ret = -ENOMEM; + goto release; + } + + sdhci_reset(host, SDHCI_RESET_ALL); + + version = readw(host->ioaddr + SDHCI_HOST_VERSION); + version = (version & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT; + if (version != 0) { + printk(KERN_ERR "%s: Unknown controller version (%d). " + "You may experience problems.\n", host->slot_descr, + version); + } + + caps = readl(host->ioaddr + SDHCI_CAPABILITIES); + + /*on R5C832 controller we just assume the DMA is supported. It is a work round to fix the silicon bug*/ + // caps &= ~SDHCI_CAN_DO_DMA; + + if (debug_nodma) + DBG("DMA forced off\n"); + else if (debug_forcedma) { + DBG("DMA forced on\n"); + host->flags |= SDHCI_USE_DMA; + } else if (chip->quirks & SDHCI_QUIRK_FORCE_DMA) + host->flags |= SDHCI_USE_DMA; + /* mask the check point for some DMA capable SDIO controller + reporting wrong information to PCI, and "caps" should be + enough for judging DMA capability */ + /* else if ((pdev->class & 0x0000FF) != PCI_SDHCI_IFDMA) + DBG("Controller doesn't have DMA interface\n"); */ + else if (!(caps & SDHCI_CAN_DO_DMA)) + DBG("Controller doesn't have DMA capability\n"); + else + host->flags |= SDHCI_USE_DMA; + + if (host->flags & SDHCI_USE_DMA) { + if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { + printk(KERN_WARNING "%s: No suitable DMA available. " + "Falling back to PIO.\n", host->slot_descr); + host->flags &= ~SDHCI_USE_DMA; + } + } + + if (host->flags & SDHCI_USE_DMA) + pci_set_master(pdev); + else /* XXX: Hack to get MMC layer to avoid highmem */ + pdev->dma_mask = 0; + + host->max_clk = + (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; + if (host->max_clk == 0) { + printk(KERN_ERR "%s: Hardware doesn't specify base clock " + "frequency.\n", host->slot_descr); + ret = -ENODEV; + goto unmap; + } + host->max_clk *= 1000000; + + host->timeout_clk = + (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; + if (host->timeout_clk == 0) { + printk(KERN_ERR "%s: Hardware doesn't specify timeout clock " + "frequency.\n", host->slot_descr); + ret = -ENODEV; + goto unmap; + } + if (caps & SDHCI_TIMEOUT_CLK_UNIT) + host->timeout_clk *= 1000; + + host->max_block = (caps & SDHCI_MAX_BLOCK_MASK) >> SDHCI_MAX_BLOCK_SHIFT; + if (host->max_block >= 3) { + printk(KERN_ERR "%s: Invalid maximum block size.\n", + host->slot_descr); + ret = -ENODEV; + goto unmap; + } + host->max_block = 512 << host->max_block; + + + /* Set host parameters. */ + mmc->ops = &sdhci_ops; + mmc->f_min = host->max_clk / 256; + mmc->f_max = host->max_clk; + mmc->dev = &pdev->dev; + mmc->vdd = 0; + + if (caps & SDHCI_CAN_VDD_330) { + mmc->vdd |= MSS_VDD_32_33|MSS_VDD_33_34; + } else if (caps & SDHCI_CAN_VDD_300) { + mmc->vdd |= MSS_VDD_29_30|MSS_VDD_30_31; + } else if (caps & SDHCI_CAN_VDD_180) { + mmc->vdd |= MSS_VDD_170_195; + } + mmc->ios.vdd = mmc->vdd; + + if (mmc->vdd == 0) { + printk(KERN_ERR "%s: Hardware doesn't report any " + "support voltages.\n", host->slot_descr); + ret = -ENODEV; + goto unmap; + } + mmc->bus_width = MSS_BUSWIDTH_4BIT; + + spin_lock_init(&host->lock); + + /* + * Maximum number of segments. Hardware cannot do scatter lists. + */ + if (host->flags & SDHCI_USE_DMA) + mmc->max_hw_segs = 1; + else + mmc->max_hw_segs = 16; + mmc->max_phys_segs = 16; + + /* + * Maximum number of sectors in one transfer. Limited by DMA boundary + * size (512KiB), which means (512 KiB/512=) 1024 entries. + */ + mmc->max_sectors = 1024; + + /* + * Maximum segment size. Could be one segment with the maximum number + * of sectors. + */ + mmc->max_seg_size = mmc->max_sectors * 512; + + /* + * Init tasklets. + */ + tasklet_init(&host->card_tasklet, + sdhci_tasklet_card, (unsigned long)host); + tasklet_init(&host->finish_tasklet, + sdhci_tasklet_finish, (unsigned long)host); + + setup_timer(&host->timer, sdhci_timeout_timer, (unsigned long)host); + + ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED, + host->slot_descr, host); + if (ret) + goto untasklet; + + sdhci_init(host); + mmiowb(); + + register_mss_host(mmc); + + printk(KERN_INFO "mmchost: SDHCI at 0x%08lx irq %d %s\n", + host->addr, host->irq, + (host->flags & SDHCI_USE_DMA)?"DMA":"PIO"); + + + mss_detect_change(host->mmc, msecs_to_jiffies(500), 0); + + +#ifdef CONFIG_PROC_FS + if (dir_sdhci) { + sprintf(pbuf, "%s.%d", pci_name(pdev), slot); + if ((proc_sdhci = create_proc_entry(pbuf, S_IRUSR | S_IRGRP | S_IROTH, dir_sdhci)) != NULL) + { + proc_sdhci->read_proc = sdhci_read_proc; + proc_sdhci->data = host; + } + } +#endif + return 0; + +untasklet: + tasklet_kill(&host->card_tasklet); + tasklet_kill(&host->finish_tasklet); +unmap: + iounmap(host->ioaddr); +release: + pci_release_region(pdev, host->bar); +free: + mss_free_host(mmc); + return ret; +} + +static void sdhci_remove_slot(struct pci_dev *pdev, int slot) +{ + struct sdhci_chip *chip; + struct mss_host *mmc; + struct sdhci_host *host; + struct mss_slot *mslot; + +#ifdef CONFIG_PROC_FS + char pbuf[50]; +#endif + + chip = pci_get_drvdata(pdev); + host = chip->hosts[slot]; + mmc = host->mmc; + + mslot = &mmc->slots[slot]; + if (mslot->card) + mss_force_card_remove(mslot->card); + + unregister_mss_host(mmc); + chip->hosts[slot] = NULL; + + sdhci_reset(host, SDHCI_RESET_ALL); + + free_irq(host->irq, host); + + del_timer_sync(&host->timer); + + tasklet_kill(&host->card_tasklet); + tasklet_kill(&host->finish_tasklet); + + iounmap(host->ioaddr); + + pci_release_region(pdev, host->bar); + +#ifdef CONFIG_PROC_FS + if (dir_sdhci) { + sprintf(pbuf, "%s.%d", pci_name(pdev), slot); + remove_proc_entry(pbuf, dir_sdhci); + } +#endif + mss_free_host(mmc); +} + +static int __devinit sdhci_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + int ret, i; + u8 slots, rev; + struct sdhci_chip *chip; + + + BUG_ON(pdev == NULL); + BUG_ON(ent == NULL); + + pci_read_config_byte(pdev, PCI_CLASS_REVISION, &rev); + + printk(KERN_INFO DRIVER_NAME + ": SDHCI controller found at %s [%04x:%04x] (rev %x)\n", + pci_name(pdev), (int)pdev->vendor, (int)pdev->device, + (int)rev); + + ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &slots); + if (ret) + return ret; + + slots = PCI_SLOT_INFO_SLOTS(slots) + 1; + if (slots == 0) + return -ENODEV; + + ret = pci_enable_device(pdev); + if (ret) + return ret; + + chip = kzalloc(sizeof(struct sdhci_chip) + + sizeof(struct sdhci_host*) * slots, GFP_KERNEL); + if (!chip) { + ret = -ENOMEM; + goto err; + } + + chip->pdev = pdev; + chip->quirks = ent->driver_data; + + if (debug_quirks) + chip->quirks = debug_quirks; + + chip->num_slots = slots; + pci_set_drvdata(pdev, chip); + + for (i = 0;i < slots;i++) { + ret = sdhci_probe_slot(pdev, i); + if (ret) { + for (i--;i >= 0;i--) + sdhci_remove_slot(pdev, i); + goto free; + } + } + + return 0; + +free: + pci_set_drvdata(pdev, NULL); + kfree(chip); +err: + pci_disable_device(pdev); + return ret; +} + +static void __devexit sdhci_remove(struct pci_dev *pdev) +{ + int i; + struct sdhci_chip *chip; + + chip = pci_get_drvdata(pdev); + + if (chip) { + for (i = 0;i < chip->num_slots;i++) + sdhci_remove_slot(pdev, i); + + pci_set_drvdata(pdev, NULL); + + kfree(chip); + } + + pci_disable_device(pdev); +} + +static struct pci_driver sdhci_driver = { + .name = DRIVER_NAME, + .id_table = pci_ids, + .probe = sdhci_probe, + .remove = __devexit_p(sdhci_remove), + .suspend = sdhci_suspend, + .resume = sdhci_resume, +}; + +/*****************************************************************************\ + * * + * Driver init/exit * + * * +\*****************************************************************************/ + +static int __init sdhci_drv_init(void) +{ + printk(KERN_INFO DRIVER_NAME + ": Secure Digital Host Controller Interface driver\n"); + printk(KERN_INFO DRIVER_NAME ": Copyright(c) Pierre Ossman\n"); + + + +#ifdef CONFIG_PROC_FS + if ((dir_sdhci = proc_mkdir("sdhci", NULL)) == NULL) + printk(KERN_WARNING "SDHCI failed to create proc interface\n"); +#endif + return pci_register_driver(&sdhci_driver); +} + +static void __exit sdhci_drv_exit(void) +{ + pci_unregister_driver(&sdhci_driver); +#ifdef CONFIG_PROC_FS + if (dir_sdhci) { + remove_proc_entry("sdhci", NULL); + dir_sdhci = NULL; + } +#endif +} + +module_init(sdhci_drv_init); +module_exit(sdhci_drv_exit); + +module_param(debug_nodma, uint, 0444); +module_param(debug_forcedma, uint, 0444); +module_param(debug_quirks, uint, 0444); + +MODULE_AUTHOR("Pierre Ossman "); +MODULE_DESCRIPTION("Secure Digital Host Controller Interface driver"); +MODULE_LICENSE("GPL"); + +MODULE_PARM_DESC(debug_nodma, "Forcefully disable DMA transfers. (default 0)"); +MODULE_PARM_DESC(debug_forcedma, "Forcefully enable DMA transfers. (default 0)"); +MODULE_PARM_DESC(debug_quirks, "Force certain quirks."); --- linux-2.6.24.orig/drivers/mmc/core/core.c +++ linux-2.6.24/drivers/mmc/core/core.c @@ -496,7 +496,7 @@ * This delay must be at least 74 clock sizes, or 1 ms, or the * time required to reach a stable voltage. */ - mmc_delay(2); + mmc_delay(10); } static void mmc_power_off(struct mmc_host *host) --- linux-2.6.24.orig/drivers/cpuidle/cpuidle.c +++ linux-2.6.24/drivers/cpuidle/cpuidle.c @@ -26,6 +26,8 @@ static int enabled_devices; +static int __cpuidle_register_device(struct cpuidle_device *dev); + /** * cpuidle_idle_call - the main idle loop * @@ -126,6 +128,12 @@ if (!dev->state_count) return -EINVAL; + if (dev->registered == 0) { + ret = __cpuidle_register_device(dev); + if (ret) + return ret; + } + if ((ret = cpuidle_add_state_sysfs(dev))) return ret; @@ -181,10 +189,13 @@ EXPORT_SYMBOL_GPL(cpuidle_disable_device); /** - * cpuidle_register_device - registers a CPU's idle PM feature + * __cpuidle_register_device - internal register function called before register + * and enable routines * @dev: the cpu + * + * cpuidle_lock mutex must be held before this is called */ -int cpuidle_register_device(struct cpuidle_device *dev) +static int __cpuidle_register_device(struct cpuidle_device *dev) { int ret; struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); @@ -196,23 +207,38 @@ init_completion(&dev->kobj_unregister); - mutex_lock(&cpuidle_lock); - per_cpu(cpuidle_devices, dev->cpu) = dev; list_add(&dev->device_list, &cpuidle_detected_devices); if ((ret = cpuidle_add_sysfs(sys_dev))) { - mutex_unlock(&cpuidle_lock); module_put(cpuidle_curr_driver->owner); return ret; } + dev->registered = 1; + return 0; +} + +/** + * cpuidle_register_device - registers a CPU's idle PM feature + * @dev: the cpu + */ +int cpuidle_register_device(struct cpuidle_device *dev) +{ + int ret; + + mutex_lock(&cpuidle_lock); + + if ((ret = __cpuidle_register_device(dev))) { + mutex_unlock(&cpuidle_lock); + return ret; + } + cpuidle_enable_device(dev); cpuidle_install_idle_handler(); mutex_unlock(&cpuidle_lock); return 0; - } EXPORT_SYMBOL_GPL(cpuidle_register_device); @@ -225,6 +251,9 @@ { struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); + if (dev->registered == 0) + return; + cpuidle_pause_and_lock(); cpuidle_disable_device(dev); --- linux-2.6.24.orig/drivers/pcmcia/cs.c +++ linux-2.6.24/drivers/pcmcia/cs.c @@ -565,7 +565,10 @@ if (!(skt->state & SOCKET_PRESENT)) { skt->state &= ~SOCKET_SUSPEND; - return socket_insert(skt); + /* UBUNTU: This causes problems on resume. Userspace + * scripts take care of this. */ + /* return socket_insert(skt); */ + return 0; } ret = socket_setup(skt, resume_delay); --- linux-2.6.24.orig/drivers/ata/ata_piix.c +++ linux-2.6.24/drivers/ata/ata_piix.c @@ -263,6 +263,14 @@ { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, /* SATA Controller IDE (Tolapai) */ { 0x8086, 0x5028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, tolapai_sata_ahci }, + /* SATA Controller IDE (ICH10) */ + { 0x8086, 0x3a00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, + /* SATA Controller IDE (ICH10) */ + { 0x8086, 0x3a06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, + /* SATA Controller IDE (ICH10) */ + { 0x8086, 0x3a20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, + /* SATA Controller IDE (ICH10) */ + { 0x8086, 0x3a26, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, { } /* terminate list */ }; @@ -700,6 +708,8 @@ { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ { 0x27DF, 0x103C, 0x30A1 }, /* ICH7 on HP Compaq nc2400 */ { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */ + { 0x24CA, 0x1025, 0x003d }, /* ICH4 on Acer TM290 */ + { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */ /* end marker */ { 0, } }; @@ -1129,7 +1139,7 @@ * cycles and power trying to do something to the sleeping * beauty. */ - if (piix_broken_suspend() && mesg.event == PM_EVENT_SUSPEND) { + if (piix_broken_suspend() && (mesg.event & PM_EVENT_SLEEP)) { pci_save_state(pdev); /* mark its power state as "unknown", since we don't --- linux-2.6.24.orig/drivers/ata/sata_nv.c +++ linux-2.6.24/drivers/ata/sata_nv.c @@ -1011,14 +1011,20 @@ } if (status & (NV_ADMA_STAT_DONE | - NV_ADMA_STAT_CPBERR)) { - u32 check_commands; + NV_ADMA_STAT_CPBERR | + NV_ADMA_STAT_CMD_COMPLETE)) { + u32 check_commands = notifier_clears[i]; int pos, error = 0; - if (ata_tag_valid(ap->link.active_tag)) - check_commands = 1 << ap->link.active_tag; - else - check_commands = ap->link.sactive; + if (status & NV_ADMA_STAT_CPBERR) { + /* Check all active commands */ + if (ata_tag_valid(ap->link.active_tag)) + check_commands = 1 << + ap->link.active_tag; + else + check_commands = ap-> + link.sactive; + } /** Check CPBs for completed commands */ while ((pos = ffs(check_commands)) && !error) { --- linux-2.6.24.orig/drivers/ata/pata_hpt37x.c +++ linux-2.6.24/drivers/ata/pata_hpt37x.c @@ -24,7 +24,7 @@ #include #define DRV_NAME "pata_hpt37x" -#define DRV_VERSION "0.6.9" +#define DRV_VERSION "0.6.11" struct hpt_clock { u8 xfer_speed; @@ -281,7 +281,7 @@ if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33)) mask &= ~ATA_MASK_UDMA; if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5)) - mask &= ~(0x1F << ATA_SHIFT_UDMA); + mask &= ~(0xE0 << ATA_SHIFT_UDMA); } return ata_pci_default_filter(adev, mask); } @@ -297,7 +297,7 @@ { if (adev->class == ATA_DEV_ATA) { if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5)) - mask &= ~ (0x1F << ATA_SHIFT_UDMA); + mask &= ~(0xE0 << ATA_SHIFT_UDMA); } return ata_pci_default_filter(adev, mask); } --- linux-2.6.24.orig/drivers/ata/libata-acpi.c +++ linux-2.6.24/drivers/ata/libata-acpi.c @@ -760,7 +760,8 @@ */ ata_link_for_each_dev(dev, &ap->link) { ata_acpi_clear_gtf(dev); - if (ata_dev_get_GTF(dev, NULL) >= 0) + if (ata_dev_enabled(dev) && + ata_dev_get_GTF(dev, NULL) >= 0) dev->flags |= ATA_DFLAG_ACPI_PENDING; } } else { @@ -770,7 +771,8 @@ */ ata_link_for_each_dev(dev, &ap->link) { ata_acpi_clear_gtf(dev); - dev->flags |= ATA_DFLAG_ACPI_PENDING; + if (ata_dev_enabled(dev)) + dev->flags |= ATA_DFLAG_ACPI_PENDING; } } } --- linux-2.6.24.orig/drivers/ata/pata_sis.c +++ linux-2.6.24/drivers/ata/pata_sis.c @@ -1006,6 +1006,7 @@ { PCI_VDEVICE(SI, 0x5513), }, /* SiS 5513 */ { PCI_VDEVICE(SI, 0x5518), }, /* SiS 5518 */ { PCI_VDEVICE(SI, 0x1180), }, /* SiS 1180 */ + { PCI_VDEVICE(SI, 0x1180), }, /* SiS 1180 */ { } }; --- linux-2.6.24.orig/drivers/ata/libata-core.c +++ linux-2.6.24/drivers/ata/libata-core.c @@ -103,9 +103,9 @@ module_param_named(fua, libata_fua, int, 0444); MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)"); -static int ata_ignore_hpa; +static int ata_ignore_hpa = 1; module_param_named(ignore_hpa, ata_ignore_hpa, int, 0644); -MODULE_PARM_DESC(ignore_hpa, "Ignore HPA limit (0=keep BIOS limits, 1=ignore limits, using full disk)"); +MODULE_PARM_DESC(ignore_hpa, "Ignore HPA limit (0=keep BIOS limits, 1=ignore limits, using full disk, default)"); static int libata_dma_mask = ATA_DMA_MASK_ATA|ATA_DMA_MASK_ATAPI|ATA_DMA_MASK_CFA; module_param_named(dma, libata_dma_mask, int, 0444); @@ -947,8 +947,8 @@ if (r_err) *r_err = err; - /* see if device passed diags: if master then continue and warn later */ - if (err == 0 && dev->devno == 0) + /* see if device passed diags: continue and warn later */ + if (err == 0) /* diagnostic fail : do nothing _YET_ */ dev->horkage |= ATA_HORKAGE_DIAGNOSTIC; else if (err == 1) @@ -1936,24 +1936,34 @@ id, sizeof(id[0]) * ATA_ID_WORDS, 0); if (err_mask) { if (err_mask & AC_ERR_NODEV_HINT) { - DPRINTK("ata%u.%d: NODEV after polling detection\n", - ap->print_id, dev->devno); + ata_dev_printk(dev, KERN_DEBUG, + "NODEV after polling detection\n"); return -ENOENT; } - /* Device or controller might have reported the wrong - * device class. Give a shot at the other IDENTIFY if - * the current one is aborted by the device. - */ - if (may_fallback && - (err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) { - may_fallback = 0; + if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) { + /* Device or controller might have reported + * the wrong device class. Give a shot at the + * other IDENTIFY if the current one is + * aborted by the device. + */ + if (may_fallback) { + may_fallback = 0; - if (class == ATA_DEV_ATA) - class = ATA_DEV_ATAPI; - else - class = ATA_DEV_ATA; - goto retry; + if (class == ATA_DEV_ATA) + class = ATA_DEV_ATAPI; + else + class = ATA_DEV_ATA; + goto retry; + } + + /* Control reaches here iff the device aborted + * both flavors of IDENTIFYs which happens + * sometimes with phantom devices. + */ + ata_dev_printk(dev, KERN_DEBUG, + "both IDENTIFYs aborted, assuming NODEV\n"); + return -ENOENT; } rc = -EIO; @@ -2295,19 +2305,8 @@ dev->flags |= ATA_DFLAG_DIPM; } - if (dev->horkage & ATA_HORKAGE_DIAGNOSTIC) { - /* Let the user know. We don't want to disallow opens for - rescue purposes, or in case the vendor is just a blithering - idiot */ - if (print_info) { - ata_dev_printk(dev, KERN_WARNING, -"Drive reports diagnostics failure. This may indicate a drive\n"); - ata_dev_printk(dev, KERN_WARNING, -"fault or invalid emulation. Contact drive vendor for information.\n"); - } - } - - /* limit bridge transfers to udma5, 200 sectors */ + /* Limit PATA drive on SATA cable bridge transfers to udma5, + 200 sectors */ if (ata_dev_knobble(dev)) { if (ata_msg_drv(ap) && print_info) ata_dev_printk(dev, KERN_INFO, @@ -2336,6 +2335,21 @@ if (ap->ops->dev_config) ap->ops->dev_config(dev); + if (dev->horkage & ATA_HORKAGE_DIAGNOSTIC) { + /* Let the user know. We don't want to disallow opens for + rescue purposes, or in case the vendor is just a blithering + idiot. Do this after the dev_config call as some controllers + with buggy firmware may want to avoid reporting false device + bugs */ + + if (print_info) { + ata_dev_printk(dev, KERN_WARNING, +"Drive reports diagnostics failure. This may indicate a drive\n"); + ata_dev_printk(dev, KERN_WARNING, +"fault or invalid emulation. Contact drive vendor for information.\n"); + } + } + if (ata_msg_probe(ap)) ata_dev_printk(dev, KERN_DEBUG, "%s: EXIT, drv_stat = 0x%x\n", __FUNCTION__, ata_chk_status(ap)); @@ -3039,7 +3053,7 @@ /* Early MWDMA devices do DMA but don't allow DMA mode setting. Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */ - if (dev->xfer_shift == ATA_SHIFT_MWDMA && + if (dev->xfer_shift == ATA_SHIFT_MWDMA && dev->dma_mode == XFER_MW_DMA_0 && (dev->id[63] >> 8) & 1) err_mask &= ~AC_ERR_DEV; @@ -4144,6 +4158,9 @@ /* NCQ is slow */ { "WDC WD740ADFD-00", NULL, ATA_HORKAGE_NONCQ }, { "WDC WD740ADFD-00NLR1", NULL, ATA_HORKAGE_NONCQ, }, + /* See also: http://lkml.org/lkml/2007/10/17/380 */ + { "WDC WD1500ADFD-0*", NULL, ATA_HORKAGE_NONCQ }, + { "WDC WD5000AAKS-0*", NULL, ATA_HORKAGE_NONCQ }, /* http://thread.gmane.org/gmane.linux.ide/14907 */ { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ }, /* NCQ is broken */ @@ -4159,6 +4176,25 @@ { "HTS541060G9SA00", "MB3OC60D", ATA_HORKAGE_NONCQ, }, { "HTS541080G9SA00", "MB4OC60D", ATA_HORKAGE_NONCQ, }, { "HTS541010G9SA00", "MBZOC60D", ATA_HORKAGE_NONCQ, }, + /* Drives which do spurious command completion */ + { "HTS541680J9SA00", "SB2IC7EP", ATA_HORKAGE_NONCQ, }, + { "HTS541612J9SA00", "SBDIC7JP", ATA_HORKAGE_NONCQ, }, + { "HDT722516DLA380", "V43OA96A", ATA_HORKAGE_NONCQ, }, + { "Hitachi HTS541616J9SA00", "SB4OC70P", ATA_HORKAGE_NONCQ, }, + { "Hitachi HTS542525K9SA00", "BBFOC31P", ATA_HORKAGE_NONCQ, }, + { "HTS722012K9A300", "DCCOC54P", ATA_HORKAGE_NONCQ, }, + { "WDC WD740ADFD-00NLR1", NULL, ATA_HORKAGE_NONCQ, }, + { "WDC WD3200AAJS-00RYA0", "12.01B01", ATA_HORKAGE_NONCQ, }, + { "FUJITSU MHV2080BH", "00840028", ATA_HORKAGE_NONCQ, }, + { "ST9120822AS", "3.CLF", ATA_HORKAGE_NONCQ, }, + { "ST9160821AS", "3.CLF", ATA_HORKAGE_NONCQ, }, + { "ST9160821AS", "3.ALD", ATA_HORKAGE_NONCQ, }, + { "ST9160821AS", "3.CCD", ATA_HORKAGE_NONCQ, }, + { "ST3160812AS", "3.ADJ", ATA_HORKAGE_NONCQ, }, + { "ST980813AS", "3.ADB", ATA_HORKAGE_NONCQ, }, + { "SAMSUNG HD401LJ", "ZZ100-15", ATA_HORKAGE_NONCQ, }, + { "Maxtor 7V300F0", "VA111900", ATA_HORKAGE_NONCQ, }, + { "FUJITSU MHW2160BH PL", "0084001E", ATA_HORKAGE_NONCQ, }, /* devices which puke on READ_NATIVE_MAX */ { "HDS724040KLSA80", "KFAOA20N", ATA_HORKAGE_BROKEN_HPA, }, @@ -7388,7 +7424,7 @@ pci_save_state(pdev); pci_disable_device(pdev); - if (mesg.event == PM_EVENT_SUSPEND) + if (mesg.event & PM_EVENT_SLEEP) pci_set_power_state(pdev, PCI_D3hot); } --- linux-2.6.24.orig/drivers/ata/pata_it821x.c +++ linux-2.6.24/drivers/ata/pata_it821x.c @@ -430,7 +430,7 @@ return ata_qc_issue_prot(qc); } printk(KERN_DEBUG "it821x: can't process command 0x%02X\n", qc->tf.command); - return AC_ERR_INVALID; + return AC_ERR_DEV; } /** @@ -516,6 +516,37 @@ printk("(%dK stripe)", adev->id[146]); printk(".\n"); } + /* This is a controller firmware triggered funny, don't + report the drive faulty! */ + adev->horkage &= ~ATA_HORKAGE_DIAGNOSTIC; +} + +/** + * it821x_ident_hack - Hack identify data up + * @ap: Port + * + * Walk the devices on this firmware driven port and slightly + * mash the identify data to stop us and common tools trying to + * use features not firmware supported. The firmware itself does + * some masking (eg SMART) but not enough. + * + * This is a bit of an abuse of the cable method, but it is the + * only method called at the right time. We could modify the libata + * core specifically for ident hacking but while we have one offender + * it seems better to keep the fallout localised. + */ + +static int it821x_ident_hack(struct ata_port *ap) +{ + struct ata_device *adev; + ata_link_for_each_dev(adev, &ap->link) { + if (ata_dev_enabled(adev)) { + adev->id[84] &= ~(1 << 6); /* No FUA */ + adev->id[85] &= ~(1 << 10); /* No HPA */ + adev->id[76] = 0; /* No NCQ/AN etc */ + } + } + return ata_cable_unknown(ap); } @@ -634,7 +665,7 @@ .thaw = ata_bmdma_thaw, .error_handler = ata_bmdma_error_handler, .post_internal_cmd = ata_bmdma_post_internal_cmd, - .cable_detect = ata_cable_unknown, + .cable_detect = it821x_ident_hack, .bmdma_setup = ata_bmdma_setup, .bmdma_start = ata_bmdma_start, --- linux-2.6.24.orig/drivers/ata/ahci.c +++ linux-2.6.24/drivers/ata/ahci.c @@ -85,6 +85,7 @@ board_ahci_ign_iferr = 2, board_ahci_sb600 = 3, board_ahci_mv = 4, + board_ahci_sb700 = 5, /* global controller registers */ HOST_CAP = 0x00, /* host capabilities */ @@ -442,6 +443,16 @@ .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, }, + /* board_ahci_sb700 */ + { + AHCI_HFLAGS (AHCI_HFLAG_IGN_SERR_INTERNAL | + AHCI_HFLAG_NO_PMP), + .flags = AHCI_FLAG_COMMON, + .link_flags = AHCI_LFLAG_COMMON, + .pio_mask = 0x1f, /* pio0-4 */ + .udma_mask = ATA_UDMA6, + .port_ops = &ahci_ops, + }, }; static const struct pci_device_id ahci_pci_tbl[] = { @@ -482,12 +493,12 @@ /* ATI */ { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */ - { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb600 }, /* ATI SB700/800 */ - { PCI_VDEVICE(ATI, 0x4391), board_ahci_sb600 }, /* ATI SB700/800 */ - { PCI_VDEVICE(ATI, 0x4392), board_ahci_sb600 }, /* ATI SB700/800 */ - { PCI_VDEVICE(ATI, 0x4393), board_ahci_sb600 }, /* ATI SB700/800 */ - { PCI_VDEVICE(ATI, 0x4394), board_ahci_sb600 }, /* ATI SB700/800 */ - { PCI_VDEVICE(ATI, 0x4395), board_ahci_sb600 }, /* ATI SB700/800 */ + { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb700 }, /* ATI SB700/800 */ + { PCI_VDEVICE(ATI, 0x4391), board_ahci_sb700 }, /* ATI SB700/800 */ + { PCI_VDEVICE(ATI, 0x4392), board_ahci_sb700 }, /* ATI SB700/800 */ + { PCI_VDEVICE(ATI, 0x4393), board_ahci_sb700 }, /* ATI SB700/800 */ + { PCI_VDEVICE(ATI, 0x4394), board_ahci_sb700 }, /* ATI SB700/800 */ + { PCI_VDEVICE(ATI, 0x4395), board_ahci_sb700 }, /* ATI SB700/800 */ /* VIA */ { PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */ @@ -579,6 +590,11 @@ }; +static inline int ahci_zero_nr_ports(u32 cap) +{ + return cap & ~0x1f; +} + static inline int ahci_nr_ports(u32 cap) { return (cap & 0x1f) + 1; @@ -644,6 +660,15 @@ cap &= ~HOST_CAP_PMP; } + if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361 && + port_map != 1) { + dev_printk(KERN_INFO, &pdev->dev, + "JMB361 has only one port, port_map 0x%x -> 0x%x\n", + port_map, 1); + port_map = 1; + cap = ahci_zero_nr_ports(cap); + } + /* * Temporary Marvell 6145 hack: PATA port presence * is asserted through the standard AHCI port @@ -1922,7 +1947,7 @@ void __iomem *mmio = host->iomap[AHCI_PCI_BAR]; u32 ctl; - if (mesg.event == PM_EVENT_SUSPEND) { + if (mesg.event & PM_EVENT_SLEEP) { /* AHCI spec rev1.1 section 8.3.3: * Software must disable interrupts prior to requesting a * transition of the HBA to D3 state. --- linux-2.6.24.orig/drivers/ata/pata_hpt366.c +++ linux-2.6.24/drivers/ata/pata_hpt366.c @@ -27,7 +27,7 @@ #include #define DRV_NAME "pata_hpt366" -#define DRV_VERSION "0.6.1" +#define DRV_VERSION "0.6.2" struct hpt_clock { u8 xfer_speed; @@ -180,9 +180,9 @@ if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33)) mask &= ~ATA_MASK_UDMA; if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3)) - mask &= ~(0x07 << ATA_SHIFT_UDMA); + mask &= ~(0xF8 << ATA_SHIFT_UDMA); if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4)) - mask &= ~(0x0F << ATA_SHIFT_UDMA); + mask &= ~(0xF0 << ATA_SHIFT_UDMA); } return ata_pci_default_filter(adev, mask); } --- linux-2.6.24.orig/drivers/ata/pata_serverworks.c +++ linux-2.6.24/drivers/ata/pata_serverworks.c @@ -226,7 +226,7 @@ for (i = 0; (p = csb_bad_ata100[i]) != NULL; i++) { if (!strcmp(p, model_num)) - mask &= ~(0x1F << ATA_SHIFT_UDMA); + mask &= ~(0xE0 << ATA_SHIFT_UDMA); } return ata_pci_default_filter(adev, mask); } --- linux-2.6.24.orig/drivers/watchdog/ib700wdt.c +++ linux-2.6.24/drivers/watchdog/ib700wdt.c @@ -155,7 +155,7 @@ return -EINVAL; for (i = 0x0F; i > -1; i--) - if (wd_times[i] > t) + if (wd_times[i] >= t) break; wd_margin = i; return 0; --- linux-2.6.24.orig/drivers/infiniband/ulp/srp/ib_srp.c +++ linux-2.6.24/drivers/infiniband/ulp/srp/ib_srp.c @@ -2055,6 +2055,7 @@ &host->target_list, list) { srp_remove_host(target->scsi_host); scsi_remove_host(target->scsi_host); + srp_remove_host(target->scsi_host); srp_disconnect_target(target); ib_destroy_cm_id(target->cm_id); srp_free_target_ib(target); --- linux-2.6.24.orig/drivers/infiniband/core/uverbs_cmd.c +++ linux-2.6.24/drivers/infiniband/core/uverbs_cmd.c @@ -877,68 +877,81 @@ return ret ? ret : in_len; } +static int copy_wc_to_user(void __user *dest, struct ib_wc *wc) +{ + struct ib_uverbs_wc tmp; + + tmp.wr_id = wc->wr_id; + tmp.status = wc->status; + tmp.opcode = wc->opcode; + tmp.vendor_err = wc->vendor_err; + tmp.byte_len = wc->byte_len; + tmp.imm_data = (__u32 __force) wc->imm_data; + tmp.qp_num = wc->qp->qp_num; + tmp.src_qp = wc->src_qp; + tmp.wc_flags = wc->wc_flags; + tmp.pkey_index = wc->pkey_index; + tmp.slid = wc->slid; + tmp.sl = wc->sl; + tmp.dlid_path_bits = wc->dlid_path_bits; + tmp.port_num = wc->port_num; + tmp.reserved = 0; + + if (copy_to_user(dest, &tmp, sizeof tmp)) + return -EFAULT; + + return 0; +} + ssize_t ib_uverbs_poll_cq(struct ib_uverbs_file *file, const char __user *buf, int in_len, int out_len) { struct ib_uverbs_poll_cq cmd; - struct ib_uverbs_poll_cq_resp *resp; + struct ib_uverbs_poll_cq_resp resp; + u8 __user *header_ptr; + u8 __user *data_ptr; struct ib_cq *cq; - struct ib_wc *wc; - int ret = 0; - int i; - int rsize; + struct ib_wc wc; + int ret; if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; - wc = kmalloc(cmd.ne * sizeof *wc, GFP_KERNEL); - if (!wc) - return -ENOMEM; - - rsize = sizeof *resp + cmd.ne * sizeof(struct ib_uverbs_wc); - resp = kmalloc(rsize, GFP_KERNEL); - if (!resp) { - ret = -ENOMEM; - goto out_wc; - } - cq = idr_read_cq(cmd.cq_handle, file->ucontext, 0); - if (!cq) { - ret = -EINVAL; - goto out; - } + if (!cq) + return -EINVAL; - resp->count = ib_poll_cq(cq, cmd.ne, wc); - - put_cq_read(cq); + /* we copy a struct ib_uverbs_poll_cq_resp to user space */ + header_ptr = (void __user *)(unsigned long) cmd.response; + data_ptr = header_ptr + sizeof resp; + + memset(&resp, 0, sizeof resp); + while (resp.count < cmd.ne) { + ret = ib_poll_cq(cq, 1, &wc); + if (ret < 0) + goto out_put; + if (!ret) + break; + + ret = copy_wc_to_user(data_ptr, &wc); + if (ret) + goto out_put; - for (i = 0; i < resp->count; i++) { - resp->wc[i].wr_id = wc[i].wr_id; - resp->wc[i].status = wc[i].status; - resp->wc[i].opcode = wc[i].opcode; - resp->wc[i].vendor_err = wc[i].vendor_err; - resp->wc[i].byte_len = wc[i].byte_len; - resp->wc[i].imm_data = (__u32 __force) wc[i].imm_data; - resp->wc[i].qp_num = wc[i].qp->qp_num; - resp->wc[i].src_qp = wc[i].src_qp; - resp->wc[i].wc_flags = wc[i].wc_flags; - resp->wc[i].pkey_index = wc[i].pkey_index; - resp->wc[i].slid = wc[i].slid; - resp->wc[i].sl = wc[i].sl; - resp->wc[i].dlid_path_bits = wc[i].dlid_path_bits; - resp->wc[i].port_num = wc[i].port_num; + data_ptr += sizeof(struct ib_uverbs_wc); + ++resp.count; } - if (copy_to_user((void __user *) (unsigned long) cmd.response, resp, rsize)) + if (copy_to_user(header_ptr, &resp, sizeof resp)) { ret = -EFAULT; + goto out_put; + } -out: - kfree(resp); + ret = in_len; -out_wc: - kfree(wc); - return ret ? ret : in_len; +out_put: + put_cq_read(cq); + return ret; } ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file *file, --- linux-2.6.24.orig/drivers/infiniband/core/cm.c +++ linux-2.6.24/drivers/infiniband/core/cm.c @@ -2808,6 +2808,7 @@ goto out; /* No match. */ } atomic_inc(&cur_cm_id_priv->refcount); + atomic_inc(&cm_id_priv->refcount); spin_unlock_irq(&cm.lock); cm_id_priv->id.cm_handler = cur_cm_id_priv->id.cm_handler; --- linux-2.6.24.orig/drivers/infiniband/core/cma.c +++ linux-2.6.24/drivers/infiniband/core/cma.c @@ -1121,9 +1121,17 @@ cm_id->context = conn_id; cm_id->cm_handler = cma_ib_handler; + /* + * Protect against the user destroying conn_id from another thread + * until we're done accessing it. + */ + atomic_inc(&conn_id->refcount); ret = conn_id->id.event_handler(&conn_id->id, &event); - if (!ret) + if (!ret) { + cma_deref_id(conn_id); goto out; + } + cma_deref_id(conn_id); /* Destroy the CM ID by returning a non-zero value. */ conn_id->cm_id.ib = NULL; @@ -1315,14 +1323,23 @@ event.event = RDMA_CM_EVENT_CONNECT_REQUEST; event.param.conn.private_data = iw_event->private_data; event.param.conn.private_data_len = iw_event->private_data_len; + + /* + * Protect against the user destroying conn_id from another thread + * until we're done accessing it. + */ + atomic_inc(&conn_id->refcount); ret = conn_id->id.event_handler(&conn_id->id, &event); if (ret) { /* User wants to destroy the CM ID */ conn_id->cm_id.iw = NULL; cma_exch(conn_id, CMA_DESTROYING); cma_enable_remove(conn_id); + cma_deref_id(conn_id); rdma_destroy_id(&conn_id->id); + goto out; } + cma_deref_id(conn_id); out: if (dev) --- linux-2.6.24.orig/drivers/dma/ioat_dma.c +++ linux-2.6.24/drivers/dma/ioat_dma.c @@ -726,6 +726,7 @@ if (new) { new->len = len; + new->async_tx.ack = 0; return &new->async_tx; } else return NULL; @@ -749,6 +750,7 @@ if (new) { new->len = len; + new->async_tx.ack = 0; return &new->async_tx; } else return NULL; --- linux-2.6.24.orig/drivers/bluetooth/bt3c_cs.c +++ linux-2.6.24/drivers/bluetooth/bt3c_cs.c @@ -344,7 +344,10 @@ unsigned int iobase; int iir; - BUG_ON(!info->hdev); + if (!info || !info->hdev) { + BT_ERR("Call of irq %d for unknown device", irq); + return IRQ_NONE; + } iobase = info->p_dev->io.BasePort1; --- linux-2.6.24.orig/drivers/bluetooth/dtl1_cs.c +++ linux-2.6.24/drivers/bluetooth/dtl1_cs.c @@ -298,7 +298,10 @@ int boguscount = 0; int iir, lsr; - BUG_ON(!info->hdev); + if (!info || !info->hdev) { + BT_ERR("Call of irq %d for unknown device", irq); + return IRQ_NONE; + } iobase = info->p_dev->io.BasePort1; --- linux-2.6.24.orig/drivers/bluetooth/bcm203x.c +++ linux-2.6.24/drivers/bluetooth/bcm203x.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -42,7 +43,7 @@ #define BT_DBG(D...) #endif -#define VERSION "1.1" +#define VERSION "1.0" static int ignore = 0; @@ -71,7 +72,7 @@ unsigned long state; - struct work_struct work; + struct timer_list timer; struct urb *urb; unsigned char *buffer; @@ -104,7 +105,7 @@ data->state = BCM203X_SELECT_MEMORY; - schedule_work(&data->work); + mod_timer(&data->timer, jiffies + (HZ / 10)); break; case BCM203X_SELECT_MEMORY: @@ -157,10 +158,9 @@ } } -static void bcm203x_work(struct work_struct *work) +static void bcm203x_timer(unsigned long user_data) { - struct bcm203x_data *data = - container_of(work, struct bcm203x_data, work); + struct bcm203x_data *data = (struct bcm203x_data *) user_data; if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0) BT_ERR("Can't submit URB"); @@ -247,11 +247,13 @@ release_firmware(firmware); - INIT_WORK(&data->work, bcm203x_work); + init_timer(&data->timer); + data->timer.function = bcm203x_timer; + data->timer.data = (unsigned long) data; usb_set_intfdata(intf, data); - schedule_work(&data->work); + mod_timer(&data->timer, jiffies + HZ); return 0; } --- linux-2.6.24.orig/drivers/bluetooth/btuart_cs.c +++ linux-2.6.24/drivers/bluetooth/btuart_cs.c @@ -294,7 +294,10 @@ int boguscount = 0; int iir, lsr; - BUG_ON(!info->hdev); + if (!info || !info->hdev) { + BT_ERR("Call of irq %d for unknown device", irq); + return IRQ_NONE; + } iobase = info->p_dev->io.BasePort1; --- linux-2.6.24.orig/drivers/bluetooth/hci_usb.c +++ linux-2.6.24/drivers/bluetooth/hci_usb.c @@ -132,6 +132,13 @@ /* Dell laptop with Broadcom chip */ { USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, + /* Dell Wireless 370 */ + { USB_DEVICE(0x413c, 0x8156), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, + /* Dell Wireless 410 */ + { USB_DEVICE(0x413c, 0x8152), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, + + /* Broadcom 2046 */ + { USB_DEVICE(0x0a5c, 0x2151), .driver_info = HCI_RESET }, /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, @@ -144,6 +151,7 @@ { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET }, /* RTX Telecom based adapters with buggy SCO support */ + { USB_DEVICE(0x0e5e, 0x6622), .driver_info = HCI_BROKEN_ISOC }, { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC }, { USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC }, @@ -1019,8 +1027,10 @@ while ((_urb = _urb_dequeue(q))) { /* reset queue since _urb_dequeue sets it to NULL */ _urb->queue = q; - usb_kill_urb(&_urb->urb); + spin_lock_irqsave(&q->lock, flags); list_add(&_urb->list, &killed); + spin_unlock_irqrestore(&q->lock, flags); + usb_kill_urb(&_urb->urb); } spin_lock_irqsave(&q->lock, flags); --- linux-2.6.24.orig/drivers/bluetooth/bluecard_cs.c +++ linux-2.6.24/drivers/bluetooth/bluecard_cs.c @@ -503,7 +503,10 @@ unsigned int iobase; unsigned char reg; - BUG_ON(!info->hdev); + if (!info || !info->hdev) { + BT_ERR("Call of irq %d for unknown device", irq); + return IRQ_NONE; + } if (!test_bit(CARD_READY, &(info->hw_state))) return IRQ_HANDLED; --- linux-2.6.24.orig/drivers/bluetooth/hci_ldisc.c +++ linux-2.6.24/drivers/bluetooth/hci_ldisc.c @@ -263,9 +263,16 @@ BT_DBG("tty %p", tty); + /* FIXME: This btw is bogus, nothing requires the old ldisc to clear + the pointer */ if (hu) return -EEXIST; + /* Error if the tty has no write op instead of leaving an exploitable + hole */ + if (tty->driver->write == NULL) + return -EOPNOTSUPP; + if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) { BT_ERR("Can't allocate control structure"); return -ENFILE; --- linux-2.6.24.orig/drivers/block/Kconfig +++ linux-2.6.24/drivers/block/Kconfig @@ -429,6 +429,7 @@ tristate "Virtio block driver (EXPERIMENTAL)" depends on EXPERIMENTAL && VIRTIO ---help--- - This is the virtual block driver for lguest. Say Y or M. + This is the virtual block driver for virtio. It can be used with + lguest or QEMU based VMMs (like KVM or Xen). Say Y or M. endif # BLK_DEV --- linux-2.6.24.orig/drivers/block/virtio_blk.c +++ linux-2.6.24/drivers/block/virtio_blk.c @@ -7,8 +7,10 @@ #include #define VIRTIO_MAX_SG (3+MAX_PHYS_SEGMENTS) +#define PART_BITS 4 + +static int major, index; -static unsigned char virtblk_index = 'a'; struct virtio_blk { spinlock_t lock; @@ -36,7 +38,7 @@ struct virtio_blk_inhdr in_hdr; }; -static bool blk_done(struct virtqueue *vq) +static void blk_done(struct virtqueue *vq) { struct virtio_blk *vblk = vq->vdev->priv; struct virtblk_req *vbr; @@ -65,7 +67,6 @@ /* In case queue is stopped waiting for more buffers. */ blk_start_queue(vblk->disk->queue); spin_unlock_irqrestore(&vblk->lock, flags); - return true; } static bool do_req(struct request_queue *q, struct virtio_blk *vblk, @@ -153,20 +154,37 @@ (void __user *)data); } +/* We provide getgeo only to please some old bootloader/partitioning tools */ +static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo) +{ + /* some standard values, similar to sd */ + geo->heads = 1 << 6; + geo->sectors = 1 << 5; + geo->cylinders = get_capacity(bd->bd_disk) >> 11; + return 0; +} + static struct block_device_operations virtblk_fops = { - .ioctl = virtblk_ioctl, - .owner = THIS_MODULE, + .ioctl = virtblk_ioctl, + .owner = THIS_MODULE, + .getgeo = virtblk_getgeo, }; +static int index_to_minor(int index) +{ + return index << PART_BITS; +} + static int virtblk_probe(struct virtio_device *vdev) { struct virtio_blk *vblk; - int err, major; - void *token; - unsigned int len; + int err; u64 cap; u32 v; + if (index_to_minor(index) >= 1 << MINORBITS) + return -ENOSPC; + vdev->priv = vblk = kmalloc(sizeof(*vblk), GFP_KERNEL); if (!vblk) { err = -ENOMEM; @@ -178,7 +196,7 @@ vblk->vdev = vdev; /* We expect one virtqueue, for output. */ - vblk->vq = vdev->config->find_vq(vdev, blk_done); + vblk->vq = vdev->config->find_vq(vdev, 0, blk_done); if (IS_ERR(vblk->vq)) { err = PTR_ERR(vblk->vq); goto out_free_vblk; @@ -190,17 +208,11 @@ goto out_free_vq; } - major = register_blkdev(0, "virtblk"); - if (major < 0) { - err = major; - goto out_mempool; - } - /* FIXME: How many partitions? How long is a piece of string? */ - vblk->disk = alloc_disk(1 << 4); + vblk->disk = alloc_disk(1 << PART_BITS); if (!vblk->disk) { err = -ENOMEM; - goto out_unregister_blkdev; + goto out_mempool; } vblk->disk->queue = blk_init_queue(do_virtblk_request, &vblk->lock); @@ -209,22 +221,33 @@ goto out_put_disk; } - sprintf(vblk->disk->disk_name, "vd%c", virtblk_index++); + if (index < 26) { + sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26); + } else if (index < (26 + 1) * 26) { + sprintf(vblk->disk->disk_name, "vd%c%c", + 'a' + index / 26 - 1, 'a' + index % 26); + } else { + const unsigned int m1 = (index / 26 - 1) / 26 - 1; + const unsigned int m2 = (index / 26 - 1) % 26; + const unsigned int m3 = index % 26; + sprintf(vblk->disk->disk_name, "vd%c%c%c", + 'a' + m1, 'a' + m2, 'a' + m3); + } + vblk->disk->major = major; - vblk->disk->first_minor = 0; + vblk->disk->first_minor = index_to_minor(index); vblk->disk->private_data = vblk; vblk->disk->fops = &virtblk_fops; + vblk->disk->driverfs_dev = &vdev->dev; + index++; /* If barriers are supported, tell block layer that queue is ordered */ - token = vdev->config->find(vdev, VIRTIO_CONFIG_BLK_F, &len); - if (virtio_use_bit(vdev, token, len, VIRTIO_BLK_F_BARRIER)) + if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER)) blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_TAG, NULL); - err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_CAPACITY, &cap); - if (err) { - dev_err(&vdev->dev, "Bad/missing capacity in config\n"); - goto out_cleanup_queue; - } + /* Host must always specify the capacity. */ + __virtio_config_val(vdev, offsetof(struct virtio_blk_config, capacity), + &cap); /* If capacity is too big, truncate with warning. */ if ((sector_t)cap != cap) { @@ -234,31 +257,25 @@ } set_capacity(vblk->disk, cap); - err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_SIZE_MAX, &v); + /* Host can optionally specify maximum segment size and number of + * segments. */ + err = virtio_config_val(vdev, VIRTIO_BLK_F_SIZE_MAX, + offsetof(struct virtio_blk_config, size_max), + &v); if (!err) blk_queue_max_segment_size(vblk->disk->queue, v); - else if (err != -ENOENT) { - dev_err(&vdev->dev, "Bad SIZE_MAX in config\n"); - goto out_cleanup_queue; - } - err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_SEG_MAX, &v); + err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX, + offsetof(struct virtio_blk_config, seg_max), + &v); if (!err) blk_queue_max_hw_segments(vblk->disk->queue, v); - else if (err != -ENOENT) { - dev_err(&vdev->dev, "Bad SEG_MAX in config\n"); - goto out_cleanup_queue; - } add_disk(vblk->disk); return 0; -out_cleanup_queue: - blk_cleanup_queue(vblk->disk->queue); out_put_disk: put_disk(vblk->disk); -out_unregister_blkdev: - unregister_blkdev(major, "virtblk"); out_mempool: mempool_destroy(vblk->pool); out_free_vq: @@ -274,12 +291,16 @@ struct virtio_blk *vblk = vdev->priv; int major = vblk->disk->major; + /* Nothing should be pending. */ BUG_ON(!list_empty(&vblk->reqs)); + + /* Stop all the virtqueues. */ + vdev->config->reset(vdev); + blk_cleanup_queue(vblk->disk->queue); put_disk(vblk->disk); unregister_blkdev(major, "virtblk"); mempool_destroy(vblk->pool); - /* There should be nothing in the queue now, so no need to shutdown */ vdev->config->del_vq(vblk->vq); kfree(vblk); } @@ -289,7 +310,13 @@ { 0 }, }; +static unsigned int features[] = { + VIRTIO_BLK_F_BARRIER, VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, +}; + static struct virtio_driver virtio_blk = { + .feature_table = features, + .feature_table_size = ARRAY_SIZE(features), .driver.name = KBUILD_MODNAME, .driver.owner = THIS_MODULE, .id_table = id_table, @@ -299,11 +326,15 @@ static int __init init(void) { + major = register_blkdev(0, "virtblk"); + if (major < 0) + return major; return register_virtio_driver(&virtio_blk); } static void __exit fini(void) { + unregister_blkdev(major, "virtblk"); unregister_virtio_driver(&virtio_blk); } module_init(init); --- linux-2.6.24.orig/drivers/block/ub.c +++ linux-2.6.24/drivers/block/ub.c @@ -657,7 +657,6 @@ if ((cmd = ub_get_cmd(lun)) == NULL) return -1; memset(cmd, 0, sizeof(struct ub_scsi_cmd)); - sg_init_table(cmd->sgv, UB_MAX_REQ_SG); blkdev_dequeue_request(rq); @@ -668,6 +667,7 @@ /* * get scatterlist from block layer */ + sg_init_table(&urq->sgv[0], UB_MAX_REQ_SG); n_elem = blk_rq_map_sg(lun->disk->queue, rq, &urq->sgv[0]); if (n_elem < 0) { /* Impossible, because blk_rq_map_sg should not hit ENOMEM. */ --- linux-2.6.24.orig/drivers/block/pktcdvd.c +++ linux-2.6.24/drivers/block/pktcdvd.c @@ -2403,7 +2403,7 @@ pkt_shrink_pktlist(pd); } -static struct pktcdvd_device *pkt_find_dev_from_minor(int dev_minor) +static struct pktcdvd_device *pkt_find_dev_from_minor(unsigned int dev_minor) { if (dev_minor >= MAX_WRITERS) return NULL; --- linux-2.6.24.orig/drivers/lguest/hypercalls.c +++ linux-2.6.24/drivers/lguest/hypercalls.c @@ -29,8 +29,10 @@ /*H:120 This is the core hypercall routine: where the Guest gets what it wants. * Or gets killed. Or, in the case of LHCALL_CRASH, both. */ -static void do_hcall(struct lguest *lg, struct hcall_args *args) +static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args) { + struct lguest *lg = cpu->lg; + switch (args->arg0) { case LHCALL_FLUSH_ASYNC: /* This call does nothing, except by breaking out of the Guest @@ -41,8 +43,8 @@ * do that. */ kill_guest(lg, "already have lguest_data"); break; - case LHCALL_CRASH: { - /* Crash is such a trivial hypercall that we do it in four + case LHCALL_SHUTDOWN: { + /* Shutdown is such a trivial hypercall that we do it in four * lines right here. */ char msg[128]; /* If the lgread fails, it will call kill_guest() itself; the @@ -50,24 +52,26 @@ __lgread(lg, msg, args->arg1, sizeof(msg)); msg[sizeof(msg)-1] = '\0'; kill_guest(lg, "CRASH: %s", msg); + if (args->arg2 == LGUEST_SHUTDOWN_RESTART) + lg->dead = ERR_PTR(-ERESTART); break; } case LHCALL_FLUSH_TLB: /* FLUSH_TLB comes in two flavors, depending on the * argument: */ if (args->arg1) - guest_pagetable_clear_all(lg); + guest_pagetable_clear_all(cpu); else - guest_pagetable_flush_user(lg); + guest_pagetable_flush_user(cpu); break; /* All these calls simply pass the arguments through to the right * routines. */ case LHCALL_NEW_PGTABLE: - guest_new_pagetable(lg, args->arg1); + guest_new_pagetable(cpu, args->arg1); break; case LHCALL_SET_STACK: - guest_set_stack(lg, args->arg1, args->arg2, args->arg3); + guest_set_stack(cpu, args->arg1, args->arg2, args->arg3); break; case LHCALL_SET_PTE: guest_set_pte(lg, args->arg1, args->arg2, __pte(args->arg3)); @@ -76,22 +80,22 @@ guest_set_pmd(lg, args->arg1, args->arg2); break; case LHCALL_SET_CLOCKEVENT: - guest_set_clockevent(lg, args->arg1); + guest_set_clockevent(cpu, args->arg1); break; case LHCALL_TS: /* This sets the TS flag, as we saw used in run_guest(). */ - lg->ts = args->arg1; + cpu->ts = args->arg1; break; case LHCALL_HALT: /* Similarly, this sets the halted flag for run_guest(). */ - lg->halted = 1; + cpu->halted = 1; break; case LHCALL_NOTIFY: - lg->pending_notify = args->arg1; + cpu->pending_notify = args->arg1; break; default: /* It should be an architecture-specific hypercall. */ - if (lguest_arch_do_hcall(lg, args)) + if (lguest_arch_do_hcall(cpu, args)) kill_guest(lg, "Bad hypercall %li\n", args->arg0); } } @@ -104,10 +108,11 @@ * Guest put them in the ring, but we also promise the Guest that they will * happen before any normal hypercall (which is why we check this before * checking for a normal hcall). */ -static void do_async_hcalls(struct lguest *lg) +static void do_async_hcalls(struct lg_cpu *cpu) { unsigned int i; u8 st[LHCALL_RING_SIZE]; + struct lguest *lg = cpu->lg; /* For simplicity, we copy the entire call status array in at once. */ if (copy_from_user(&st, &lg->lguest_data->hcall_status, sizeof(st))) @@ -119,7 +124,7 @@ /* We remember where we were up to from last time. This makes * sure that the hypercalls are done in the order the Guest * places them in the ring. */ - unsigned int n = lg->next_hcall; + unsigned int n = cpu->next_hcall; /* 0xFF means there's no call here (yet). */ if (st[n] == 0xFF) @@ -127,8 +132,8 @@ /* OK, we have hypercall. Increment the "next_hcall" cursor, * and wrap back to 0 if we reach the end. */ - if (++lg->next_hcall == LHCALL_RING_SIZE) - lg->next_hcall = 0; + if (++cpu->next_hcall == LHCALL_RING_SIZE) + cpu->next_hcall = 0; /* Copy the hypercall arguments into a local copy of * the hcall_args struct. */ @@ -139,7 +144,7 @@ } /* Do the hypercall, same as a normal one. */ - do_hcall(lg, &args); + do_hcall(cpu, &args); /* Mark the hypercall done. */ if (put_user(0xFF, &lg->lguest_data->hcall_status[n])) { @@ -149,23 +154,24 @@ /* Stop doing hypercalls if they want to notify the Launcher: * it needs to service this first. */ - if (lg->pending_notify) + if (cpu->pending_notify) break; } } /* Last of all, we look at what happens first of all. The very first time the * Guest makes a hypercall, we end up here to set things up: */ -static void initialize(struct lguest *lg) +static void initialize(struct lg_cpu *cpu) { + struct lguest *lg = cpu->lg; /* You can't do anything until you're initialized. The Guest knows the * rules, so we're unforgiving here. */ - if (lg->hcall->arg0 != LHCALL_LGUEST_INIT) { - kill_guest(lg, "hypercall %li before INIT", lg->hcall->arg0); + if (cpu->hcall->arg0 != LHCALL_LGUEST_INIT) { + kill_guest(lg, "hypercall %li before INIT", cpu->hcall->arg0); return; } - if (lguest_arch_init_hypercalls(lg)) + if (lguest_arch_init_hypercalls(cpu)) kill_guest(lg, "bad guest page %p", lg->lguest_data); /* The Guest tells us where we're not to deliver interrupts by putting @@ -185,7 +191,7 @@ * first write to a Guest page. This may have caused a copy-on-write * fault, but the old page might be (read-only) in the Guest * pagetable. */ - guest_pagetable_clear_all(lg); + guest_pagetable_clear_all(cpu); } /*H:100 @@ -194,27 +200,27 @@ * Remember from the Guest, hypercalls come in two flavors: normal and * asynchronous. This file handles both of types. */ -void do_hypercalls(struct lguest *lg) +void do_hypercalls(struct lg_cpu *cpu) { /* Not initialized yet? This hypercall must do it. */ - if (unlikely(!lg->lguest_data)) { + if (unlikely(!cpu->lg->lguest_data)) { /* Set up the "struct lguest_data" */ - initialize(lg); + initialize(cpu); /* Hcall is done. */ - lg->hcall = NULL; + cpu->hcall = NULL; return; } /* The Guest has initialized. * * Look in the hypercall ring for the async hypercalls: */ - do_async_hcalls(lg); + do_async_hcalls(cpu); /* If we stopped reading the hypercall ring because the Guest did a * NOTIFY to the Launcher, we want to return now. Otherwise we do * the hypercall. */ - if (!lg->pending_notify) { - do_hcall(lg, lg->hcall); + if (!cpu->pending_notify) { + do_hcall(cpu, cpu->hcall); /* Tricky point: we reset the hcall pointer to mark the * hypercall as "done". We use the hcall pointer rather than * the trap number to indicate a hypercall is pending. @@ -225,7 +231,7 @@ * Launcher, the run_guest() loop will exit without running the * Guest. When it comes back it would try to re-run the * hypercall. */ - lg->hcall = NULL; + cpu->hcall = NULL; } } --- linux-2.6.24.orig/drivers/lguest/core.c +++ linux-2.6.24/drivers/lguest/core.c @@ -174,20 +174,22 @@ /*H:030 Let's jump straight to the the main loop which runs the Guest. * Remember, this is called by the Launcher reading /dev/lguest, and we keep * going around and around until something interesting happens. */ -int run_guest(struct lguest *lg, unsigned long __user *user) +int run_guest(struct lg_cpu *cpu, unsigned long __user *user) { + struct lguest *lg = cpu->lg; + /* We stop running once the Guest is dead. */ while (!lg->dead) { /* First we run any hypercalls the Guest wants done. */ - if (lg->hcall) - do_hypercalls(lg); + if (cpu->hcall) + do_hypercalls(cpu); /* It's possible the Guest did a NOTIFY hypercall to the * Launcher, in which case we return from the read() now. */ - if (lg->pending_notify) { - if (put_user(lg->pending_notify, user)) + if (cpu->pending_notify) { + if (put_user(cpu->pending_notify, user)) return -EFAULT; - return sizeof(lg->pending_notify); + return sizeof(cpu->pending_notify); } /* Check for signals */ @@ -195,13 +197,13 @@ return -ERESTARTSYS; /* If Waker set break_out, return to Launcher. */ - if (lg->break_out) + if (cpu->break_out) return -EAGAIN; /* Check if there are any interrupts which can be delivered * now: if so, this sets up the hander to be executed when we * next run the Guest. */ - maybe_do_interrupt(lg); + maybe_do_interrupt(cpu); /* All long-lived kernel loops need to check with this horrible * thing called the freezer. If the Host is trying to suspend, @@ -215,7 +217,7 @@ /* If the Guest asked to be stopped, we sleep. The Guest's * clock timer or LHCALL_BREAK from the Waker will wake us. */ - if (lg->halted) { + if (cpu->halted) { set_current_state(TASK_INTERRUPTIBLE); schedule(); continue; @@ -226,15 +228,17 @@ local_irq_disable(); /* Actually run the Guest until something happens. */ - lguest_arch_run_guest(lg); + lguest_arch_run_guest(cpu); /* Now we're ready to be interrupted or moved to other CPUs */ local_irq_enable(); /* Now we deal with whatever happened to the Guest. */ - lguest_arch_handle_trap(lg); + lguest_arch_handle_trap(cpu); } + if (lg->dead == ERR_PTR(-ERESTART)) + return -ERESTART; /* The Guest is dead => "No such file or directory" */ return -ENOENT; } --- linux-2.6.24.orig/drivers/lguest/lguest_device.c +++ linux-2.6.24/drivers/lguest/lguest_device.c @@ -52,57 +52,89 @@ /*D:130 * Device configurations * - * The configuration information for a device consists of a series of fields. - * We don't really care what they are: the Launcher set them up, and the driver - * will look at them during setup. + * The configuration information for a device consists of one or more + * virtqueues, a feature bitmaks, and some configuration bytes. The + * configuration bytes don't really matter to us: the Launcher sets them up, and + * the driver will look at them during setup. * - * For us these fields come immediately after that device's descriptor in the - * lguest_devices page. - * - * Each field starts with a "type" byte, a "length" byte, then that number of - * bytes of configuration information. The device descriptor tells us the - * total configuration length so we know when we've reached the last field. */ + * A convenient routine to return the device's virtqueue config array: + * immediately after the descriptor. */ +static struct lguest_vqconfig *lg_vq(const struct lguest_device_desc *desc) +{ + return (void *)(desc + 1); +} + +/* The features come immediately after the virtqueues. */ +static u8 *lg_features(const struct lguest_device_desc *desc) +{ + return (void *)(lg_vq(desc) + desc->num_vq); +} -/* type + length bytes */ -#define FHDR_LEN 2 +/* The config space comes after the two feature bitmasks. */ +static u8 *lg_config(const struct lguest_device_desc *desc) +{ + return lg_features(desc) + desc->feature_len * 2; +} -/* This finds the first field of a given type for a device's configuration. */ -static void *lg_find(struct virtio_device *vdev, u8 type, unsigned int *len) +/* The total size of the config page used by this device (incl. desc) */ +static unsigned desc_size(const struct lguest_device_desc *desc) { + return sizeof(*desc) + + desc->num_vq * sizeof(struct lguest_vqconfig) + + desc->feature_len * 2 + + desc->config_len; +} + +/* This gets the device's feature bits. */ +static u32 lg_get_features(struct virtio_device *vdev) +{ + unsigned int i; + u32 features = 0; struct lguest_device_desc *desc = to_lgdev(vdev)->desc; - int i; + u8 *in_features = lg_features(desc); - for (i = 0; i < desc->config_len; i += FHDR_LEN + desc->config[i+1]) { - if (desc->config[i] == type) { - /* Mark it used, so Host can know we looked at it, and - * also so we won't find the same one twice. */ - desc->config[i] |= 0x80; - /* Remember, the second byte is the length. */ - *len = desc->config[i+1]; - /* We return a pointer to the field header. */ - return desc->config + i; - } - } + /* We do this the slow but generic way. */ + for (i = 0; i < min(desc->feature_len * 8, 32); i++) + if (in_features[i / 8] & (1 << (i % 8))) + features |= (1 << i); + + return features; +} - /* Not found: return NULL for failure. */ - return NULL; +static void lg_set_features(struct virtio_device *vdev, u32 features) +{ + unsigned int i; + struct lguest_device_desc *desc = to_lgdev(vdev)->desc; + /* Second half of bitmap is features we accept. */ + u8 *out_features = lg_features(desc) + desc->feature_len; + + memset(out_features, 0, desc->feature_len); + for (i = 0; i < min(desc->feature_len * 8, 32); i++) { + if (features & (1 << i)) + out_features[i / 8] |= (1 << (i % 8)); + } } /* Once they've found a field, getting a copy of it is easy. */ -static void lg_get(struct virtio_device *vdev, void *token, +static void lg_get(struct virtio_device *vdev, unsigned int offset, void *buf, unsigned len) { - /* Check they didn't ask for more than the length of the field! */ - BUG_ON(len > ((u8 *)token)[1]); - memcpy(buf, token + FHDR_LEN, len); + struct lguest_device_desc *desc = to_lgdev(vdev)->desc; + + /* Check they didn't ask for more than the length of the config! */ + BUG_ON(offset + len > desc->config_len); + memcpy(buf, lg_config(desc) + offset, len); } /* Setting the contents is also trivial. */ -static void lg_set(struct virtio_device *vdev, void *token, +static void lg_set(struct virtio_device *vdev, unsigned int offset, const void *buf, unsigned len) { - BUG_ON(len > ((u8 *)token)[1]); - memcpy(token + FHDR_LEN, buf, len); + struct lguest_device_desc *desc = to_lgdev(vdev)->desc; + + /* Check they didn't ask for more than the length of the config! */ + BUG_ON(offset + len > desc->config_len); + memcpy(lg_config(desc) + offset, buf, len); } /* The operations to get and set the status word just access the status field @@ -114,9 +146,20 @@ static void lg_set_status(struct virtio_device *vdev, u8 status) { + BUG_ON(!status); to_lgdev(vdev)->desc->status = status; } +/* To reset the device, we (ab)use the NOTIFY hypercall, with the descriptor + * address of the device. The Host will zero the status and all the + * features. */ +static void lg_reset(struct virtio_device *vdev) +{ + unsigned long offset = (void *)to_lgdev(vdev)->desc - lguest_devices; + + hcall(LHCALL_NOTIFY, (max_pfn<config->find(vdev, VIRTIO_CONFIG_F_VIRTQUEUE, &len); - if (!token) + /* We must have this many virtqueues. */ + if (index >= ldev->desc->num_vq) return ERR_PTR(-ENOENT); lvq = kmalloc(sizeof(*lvq), GFP_KERNEL); if (!lvq) return ERR_PTR(-ENOMEM); - /* Note: we could use a configuration space inside here, just like we - * do for the device. This would allow expansion in future, because - * our configuration system is designed to be expansible. But this is - * way easier. */ - if (len != sizeof(lvq->config)) { - dev_err(&vdev->dev, "Unexpected virtio config len %u\n", len); - err = -EIO; - goto free_lvq; - } - /* Make a copy of the "struct lguest_vqconfig" field. We need a copy - * because the config space might not be aligned correctly. */ - vdev->config->get(vdev, token, &lvq->config, sizeof(lvq->config)); + /* Make a copy of the "struct lguest_vqconfig" entry, which sits after + * the descriptor. We need a copy because the config space might not + * be aligned correctly. */ + memcpy(&lvq->config, lg_vq(ldev->desc)+index, sizeof(lvq->config)); + printk("Mapping virtqueue %i addr %lx\n", index, + (unsigned long)lvq->config.pfn << PAGE_SHIFT); /* Figure out how many pages the ring will take, and map that memory */ lvq->pages = lguest_map((unsigned long)lvq->config.pfn << PAGE_SHIFT, DIV_ROUND_UP(vring_size(lvq->config.num, @@ -259,11 +292,13 @@ /* The ops structure which hooks everything together. */ static struct virtio_config_ops lguest_config_ops = { - .find = lg_find, + .get_features = lg_get_features, + .set_features = lg_set_features, .get = lg_get, .set = lg_set, .get_status = lg_get_status, .set_status = lg_set_status, + .reset = lg_reset, .find_vq = lg_find_vq, .del_vq = lg_del_vq, }; @@ -329,13 +364,14 @@ struct lguest_device_desc *d; /* We start at the page beginning, and skip over each entry. */ - for (i = 0; i < PAGE_SIZE; i += sizeof(*d) + d->config_len) { + for (i = 0; i < PAGE_SIZE; i += desc_size(d)) { d = lguest_devices + i; /* Once we hit a zero, stop. */ if (d->type == 0) break; + printk("Device at %i has size %u\n", i, desc_size(d)); add_lguest_device(d); } } --- linux-2.6.24.orig/drivers/lguest/interrupts_and_traps.c +++ linux-2.6.24/drivers/lguest/interrupts_and_traps.c @@ -60,41 +60,42 @@ * We set up the stack just like the CPU does for a real interrupt, so it's * identical for the Guest (and the standard "iret" instruction will undo * it). */ -static void set_guest_interrupt(struct lguest *lg, u32 lo, u32 hi, int has_err) +static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi, int has_err) { unsigned long gstack, origstack; u32 eflags, ss, irq_enable; unsigned long virtstack; + struct lguest *lg = cpu->lg; /* There are two cases for interrupts: one where the Guest is already * in the kernel, and a more complex one where the Guest is in * userspace. We check the privilege level to find out. */ - if ((lg->regs->ss&0x3) != GUEST_PL) { + if ((cpu->regs->ss&0x3) != GUEST_PL) { /* The Guest told us their kernel stack with the SET_STACK * hypercall: both the virtual address and the segment */ - virtstack = lg->esp1; - ss = lg->ss1; + virtstack = cpu->esp1; + ss = cpu->ss1; - origstack = gstack = guest_pa(lg, virtstack); + origstack = gstack = guest_pa(cpu, virtstack); /* We push the old stack segment and pointer onto the new * stack: when the Guest does an "iret" back from the interrupt * handler the CPU will notice they're dropping privilege * levels and expect these here. */ - push_guest_stack(lg, &gstack, lg->regs->ss); - push_guest_stack(lg, &gstack, lg->regs->esp); + push_guest_stack(lg, &gstack, cpu->regs->ss); + push_guest_stack(lg, &gstack, cpu->regs->esp); } else { /* We're staying on the same Guest (kernel) stack. */ - virtstack = lg->regs->esp; - ss = lg->regs->ss; + virtstack = cpu->regs->esp; + ss = cpu->regs->ss; - origstack = gstack = guest_pa(lg, virtstack); + origstack = gstack = guest_pa(cpu, virtstack); } /* Remember that we never let the Guest actually disable interrupts, so * the "Interrupt Flag" bit is always set. We copy that bit from the * Guest's "irq_enabled" field into the eflags word: we saw the Guest * copy it back in "lguest_iret". */ - eflags = lg->regs->eflags; + eflags = cpu->regs->eflags; if (get_user(irq_enable, &lg->lguest_data->irq_enabled) == 0 && !(irq_enable & X86_EFLAGS_IF)) eflags &= ~X86_EFLAGS_IF; @@ -103,19 +104,19 @@ * "eflags" word, the old code segment, and the old instruction * pointer. */ push_guest_stack(lg, &gstack, eflags); - push_guest_stack(lg, &gstack, lg->regs->cs); - push_guest_stack(lg, &gstack, lg->regs->eip); + push_guest_stack(lg, &gstack, cpu->regs->cs); + push_guest_stack(lg, &gstack, cpu->regs->eip); /* For the six traps which supply an error code, we push that, too. */ if (has_err) - push_guest_stack(lg, &gstack, lg->regs->errcode); + push_guest_stack(lg, &gstack, cpu->regs->errcode); /* Now we've pushed all the old state, we change the stack, the code * segment and the address to execute. */ - lg->regs->ss = ss; - lg->regs->esp = virtstack + (gstack - origstack); - lg->regs->cs = (__KERNEL_CS|GUEST_PL); - lg->regs->eip = idt_address(lo, hi); + cpu->regs->ss = ss; + cpu->regs->esp = virtstack + (gstack - origstack); + cpu->regs->cs = (__KERNEL_CS|GUEST_PL); + cpu->regs->eip = idt_address(lo, hi); /* There are two kinds of interrupt handlers: 0xE is an "interrupt * gate" which expects interrupts to be disabled on entry. */ @@ -129,9 +130,10 @@ * * maybe_do_interrupt() gets called before every entry to the Guest, to see if * we should divert the Guest to running an interrupt handler. */ -void maybe_do_interrupt(struct lguest *lg) +void maybe_do_interrupt(struct lg_cpu *cpu) { unsigned int irq; + struct lguest *lg = cpu->lg; DECLARE_BITMAP(blk, LGUEST_IRQS); struct desc_struct *idt; @@ -145,7 +147,7 @@ sizeof(blk))) return; - bitmap_andnot(blk, lg->irqs_pending, blk, LGUEST_IRQS); + bitmap_andnot(blk, cpu->irqs_pending, blk, LGUEST_IRQS); /* Find the first interrupt. */ irq = find_first_bit(blk, LGUEST_IRQS); @@ -155,15 +157,15 @@ /* They may be in the middle of an iret, where they asked us never to * deliver interrupts. */ - if (lg->regs->eip >= lg->noirq_start && lg->regs->eip < lg->noirq_end) + if (cpu->regs->eip >= lg->noirq_start && cpu->regs->eip < lg->noirq_end) return; /* If they're halted, interrupts restart them. */ - if (lg->halted) { + if (cpu->halted) { /* Re-enable interrupts. */ if (put_user(X86_EFLAGS_IF, &lg->lguest_data->irq_enabled)) kill_guest(lg, "Re-enabling interrupts"); - lg->halted = 0; + cpu->halted = 0; } else { /* Otherwise we check if they have interrupts disabled. */ u32 irq_enabled; @@ -176,15 +178,15 @@ /* Look at the IDT entry the Guest gave us for this interrupt. The * first 32 (FIRST_EXTERNAL_VECTOR) entries are for traps, so we skip * over them. */ - idt = &lg->arch.idt[FIRST_EXTERNAL_VECTOR+irq]; + idt = &cpu->arch.idt[FIRST_EXTERNAL_VECTOR+irq]; /* If they don't have a handler (yet?), we just ignore it */ if (idt_present(idt->a, idt->b)) { /* OK, mark it no longer pending and deliver it. */ - clear_bit(irq, lg->irqs_pending); + clear_bit(irq, cpu->irqs_pending); /* set_guest_interrupt() takes the interrupt descriptor and a * flag to say whether this interrupt pushes an error code onto * the stack as well: virtual interrupts never do. */ - set_guest_interrupt(lg, idt->a, idt->b, 0); + set_guest_interrupt(cpu, idt->a, idt->b, 0); } /* Every time we deliver an interrupt, we update the timestamp in the @@ -245,19 +247,19 @@ } /* deliver_trap() returns true if it could deliver the trap. */ -int deliver_trap(struct lguest *lg, unsigned int num) +int deliver_trap(struct lg_cpu *cpu, unsigned int num) { /* Trap numbers are always 8 bit, but we set an impossible trap number * for traps inside the Switcher, so check that here. */ - if (num >= ARRAY_SIZE(lg->arch.idt)) + if (num >= ARRAY_SIZE(cpu->arch.idt)) return 0; /* Early on the Guest hasn't set the IDT entries (or maybe it put a * bogus one in): if we fail here, the Guest will be killed. */ - if (!idt_present(lg->arch.idt[num].a, lg->arch.idt[num].b)) + if (!idt_present(cpu->arch.idt[num].a, cpu->arch.idt[num].b)) return 0; - set_guest_interrupt(lg, lg->arch.idt[num].a, lg->arch.idt[num].b, - has_err(num)); + set_guest_interrupt(cpu, cpu->arch.idt[num].a, + cpu->arch.idt[num].b, has_err(num)); return 1; } @@ -309,10 +311,11 @@ * the Guest. * * Which is deeply unfair, because (literally!) it wasn't the Guests' fault. */ -void pin_stack_pages(struct lguest *lg) +void pin_stack_pages(struct lg_cpu *cpu) { unsigned int i; + struct lguest *lg = cpu->lg; /* Depending on the CONFIG_4KSTACKS option, the Guest can have one or * two pages of stack space. */ for (i = 0; i < lg->stack_pages; i++) @@ -320,7 +323,7 @@ * start of the page after the kernel stack. Subtract one to * get back onto the first stack page, and keep subtracting to * get to the rest of the stack pages. */ - pin_page(lg, lg->esp1 - 1 - i * PAGE_SIZE); + pin_page(cpu, cpu->esp1 - 1 - i * PAGE_SIZE); } /* Direct traps also mean that we need to know whenever the Guest wants to use @@ -331,21 +334,21 @@ * * In Linux each process has its own kernel stack, so this happens a lot: we * change stacks on each context switch. */ -void guest_set_stack(struct lguest *lg, u32 seg, u32 esp, unsigned int pages) +void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages) { /* You are not allowed have a stack segment with privilege level 0: bad * Guest! */ if ((seg & 0x3) != GUEST_PL) - kill_guest(lg, "bad stack segment %i", seg); + kill_guest(cpu->lg, "bad stack segment %i", seg); /* We only expect one or two stack pages. */ if (pages > 2) - kill_guest(lg, "bad stack pages %u", pages); + kill_guest(cpu->lg, "bad stack pages %u", pages); /* Save where the stack is, and how many pages */ - lg->ss1 = seg; - lg->esp1 = esp; - lg->stack_pages = pages; + cpu->ss1 = seg; + cpu->esp1 = esp; + cpu->lg->stack_pages = pages; /* Make sure the new stack pages are mapped */ - pin_stack_pages(lg); + pin_stack_pages(cpu); } /* All this reference to mapping stacks leads us neatly into the other complex @@ -383,7 +386,7 @@ * * We saw the Guest setting Interrupt Descriptor Table (IDT) entries with the * LHCALL_LOAD_IDT_ENTRY hypercall before: that comes here. */ -void load_guest_idt_entry(struct lguest *lg, unsigned int num, u32 lo, u32 hi) +void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int num, u32 lo, u32 hi) { /* Guest never handles: NMI, doublefault, spurious interrupt or * hypercall. We ignore when it tries to set them. */ @@ -392,13 +395,13 @@ /* Mark the IDT as changed: next time the Guest runs we'll know we have * to copy this again. */ - lg->changed |= CHANGED_IDT; + cpu->lg->changed |= CHANGED_IDT; /* Check that the Guest doesn't try to step outside the bounds. */ - if (num >= ARRAY_SIZE(lg->arch.idt)) - kill_guest(lg, "Setting idt entry %u", num); + if (num >= ARRAY_SIZE(cpu->arch.idt)) + kill_guest(cpu->lg, "Setting idt entry %u", num); else - set_trap(lg, &lg->arch.idt[num], num, lo, hi); + set_trap(cpu->lg, &cpu->arch.idt[num], num, lo, hi); } /* The default entry for each interrupt points into the Switcher routines which @@ -434,14 +437,14 @@ /*H:240 We don't use the IDT entries in the "struct lguest" directly, instead * we copy them into the IDT which we've set up for Guests on this CPU, just * before we run the Guest. This routine does that copy. */ -void copy_traps(const struct lguest *lg, struct desc_struct *idt, +void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, const unsigned long *def) { unsigned int i; /* We can simply copy the direct traps, otherwise we use the default * ones in the Switcher: they will return to the Host. */ - for (i = 0; i < ARRAY_SIZE(lg->arch.idt); i++) { + for (i = 0; i < ARRAY_SIZE(cpu->arch.idt); i++) { /* If no Guest can ever override this trap, leave it alone. */ if (!direct_trap(i)) continue; @@ -450,8 +453,8 @@ * Interrupt gates (type 14) disable interrupts as they are * entered, which we never let the Guest do. Not present * entries (type 0x0) also can't go direct, of course. */ - if (idt_type(lg->arch.idt[i].a, lg->arch.idt[i].b) == 0xF) - idt[i] = lg->arch.idt[i]; + if (idt_type(cpu->arch.idt[i].a, cpu->arch.idt[i].b) == 0xF) + idt[i] = cpu->arch.idt[i]; else /* Reset it to the default. */ default_idt_entry(&idt[i], i, def[i]); @@ -470,13 +473,13 @@ * infrastructure to set a callback at that time. * * 0 means "turn off the clock". */ -void guest_set_clockevent(struct lguest *lg, unsigned long delta) +void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta) { ktime_t expires; if (unlikely(delta == 0)) { /* Clock event device is shutting down. */ - hrtimer_cancel(&lg->hrt); + hrtimer_cancel(&cpu->hrt); return; } @@ -484,25 +487,25 @@ * all the time between now and the timer interrupt it asked for. This * is almost always the right thing to do. */ expires = ktime_add_ns(ktime_get_real(), delta); - hrtimer_start(&lg->hrt, expires, HRTIMER_MODE_ABS); + hrtimer_start(&cpu->hrt, expires, HRTIMER_MODE_ABS); } /* This is the function called when the Guest's timer expires. */ static enum hrtimer_restart clockdev_fn(struct hrtimer *timer) { - struct lguest *lg = container_of(timer, struct lguest, hrt); + struct lg_cpu *cpu = container_of(timer, struct lg_cpu, hrt); /* Remember the first interrupt is the timer interrupt. */ - set_bit(0, lg->irqs_pending); + set_bit(0, cpu->irqs_pending); /* If the Guest is actually stopped, we need to wake it up. */ - if (lg->halted) - wake_up_process(lg->tsk); + if (cpu->halted) + wake_up_process(cpu->tsk); return HRTIMER_NORESTART; } /* This sets up the timer for this Guest. */ -void init_clockdev(struct lguest *lg) +void init_clockdev(struct lg_cpu *cpu) { - hrtimer_init(&lg->hrt, CLOCK_REALTIME, HRTIMER_MODE_ABS); - lg->hrt.function = clockdev_fn; + hrtimer_init(&cpu->hrt, CLOCK_REALTIME, HRTIMER_MODE_ABS); + cpu->hrt.function = clockdev_fn; } --- linux-2.6.24.orig/drivers/lguest/Makefile +++ linux-2.6.24/drivers/lguest/Makefile @@ -19,3 +19,11 @@ @for f in Preparation Guest Drivers Launcher Host Switcher Mastery; do echo "{==- $$f -==}"; make -s $$f; done; echo "{==-==}" Preparation Preparation! Guest Drivers Launcher Host Switcher Mastery: @sh ../../Documentation/lguest/extract $(PREFIX) `find ../../* -name '*.[chS]' -wholename '*lguest*'` +Puppy: + @clear + @printf " __ \n (___()'\`;\n /, /\`\n \\\\\\\"--\\\\\\ \n" + @sleep 2; clear; printf "\n\n Sit!\n\n"; sleep 1; clear + @printf " __ \n ()'\`; \n /\\|\` \n / | \n(/_)_|_ \n" + @sleep 2; clear; printf "\n\n Stand!\n\n"; sleep 1; clear + @printf " __ \n ()'\`; \n /\\|\` \n /._.= \n /| / \n(_\_)_ \n" + @sleep 2; clear; printf "\n\n Good puppy!\n\n"; sleep 1; clear --- linux-2.6.24.orig/drivers/lguest/segments.c +++ linux-2.6.24/drivers/lguest/segments.c @@ -58,7 +58,7 @@ * Protection Fault in the Switcher when it restores a Guest segment register * which tries to use that entry. Then we kill the Guest for causing such a * mess: the message will be "unhandled trap 256". */ -static void fixup_gdt_table(struct lguest *lg, unsigned start, unsigned end) +static void fixup_gdt_table(struct lg_cpu *cpu, unsigned start, unsigned end) { unsigned int i; @@ -71,14 +71,14 @@ /* Segment descriptors contain a privilege level: the Guest is * sometimes careless and leaves this as 0, even though it's * running at privilege level 1. If so, we fix it here. */ - if ((lg->arch.gdt[i].b & 0x00006000) == 0) - lg->arch.gdt[i].b |= (GUEST_PL << 13); + if ((cpu->arch.gdt[i].b & 0x00006000) == 0) + cpu->arch.gdt[i].b |= (GUEST_PL << 13); /* Each descriptor has an "accessed" bit. If we don't set it * now, the CPU will try to set it when the Guest first loads * that entry into a segment register. But the GDT isn't * writable by the Guest, so bad things can happen. */ - lg->arch.gdt[i].b |= 0x00000100; + cpu->arch.gdt[i].b |= 0x00000100; } } @@ -109,31 +109,31 @@ /* This routine sets up the initial Guest GDT for booting. All entries start * as 0 (unusable). */ -void setup_guest_gdt(struct lguest *lg) +void setup_guest_gdt(struct lg_cpu *cpu) { /* Start with full 0-4G segments... */ - lg->arch.gdt[GDT_ENTRY_KERNEL_CS] = FULL_EXEC_SEGMENT; - lg->arch.gdt[GDT_ENTRY_KERNEL_DS] = FULL_SEGMENT; + cpu->arch.gdt[GDT_ENTRY_KERNEL_CS] = FULL_EXEC_SEGMENT; + cpu->arch.gdt[GDT_ENTRY_KERNEL_DS] = FULL_SEGMENT; /* ...except the Guest is allowed to use them, so set the privilege * level appropriately in the flags. */ - lg->arch.gdt[GDT_ENTRY_KERNEL_CS].b |= (GUEST_PL << 13); - lg->arch.gdt[GDT_ENTRY_KERNEL_DS].b |= (GUEST_PL << 13); + cpu->arch.gdt[GDT_ENTRY_KERNEL_CS].b |= (GUEST_PL << 13); + cpu->arch.gdt[GDT_ENTRY_KERNEL_DS].b |= (GUEST_PL << 13); } /*H:650 An optimization of copy_gdt(), for just the three "thead-local storage" * entries. */ -void copy_gdt_tls(const struct lguest *lg, struct desc_struct *gdt) +void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt) { unsigned int i; for (i = GDT_ENTRY_TLS_MIN; i <= GDT_ENTRY_TLS_MAX; i++) - gdt[i] = lg->arch.gdt[i]; + gdt[i] = cpu->arch.gdt[i]; } /*H:640 When the Guest is run on a different CPU, or the GDT entries have * changed, copy_gdt() is called to copy the Guest's GDT entries across to this * CPU's GDT. */ -void copy_gdt(const struct lguest *lg, struct desc_struct *gdt) +void copy_gdt(const struct lg_cpu *cpu, struct desc_struct *gdt) { unsigned int i; @@ -141,21 +141,22 @@ * replaced. See ignored_gdt() above. */ for (i = 0; i < GDT_ENTRIES; i++) if (!ignored_gdt(i)) - gdt[i] = lg->arch.gdt[i]; + gdt[i] = cpu->arch.gdt[i]; } /*H:620 This is where the Guest asks us to load a new GDT (LHCALL_LOAD_GDT). * We copy it from the Guest and tweak the entries. */ -void load_guest_gdt(struct lguest *lg, unsigned long table, u32 num) +void load_guest_gdt(struct lg_cpu *cpu, unsigned long table, u32 num) { + struct lguest *lg = cpu->lg; /* We assume the Guest has the same number of GDT entries as the * Host, otherwise we'd have to dynamically allocate the Guest GDT. */ - if (num > ARRAY_SIZE(lg->arch.gdt)) + if (num > ARRAY_SIZE(cpu->arch.gdt)) kill_guest(lg, "too many gdt entries %i", num); /* We read the whole thing in, then fix it up. */ - __lgread(lg, lg->arch.gdt, table, num * sizeof(lg->arch.gdt[0])); - fixup_gdt_table(lg, 0, ARRAY_SIZE(lg->arch.gdt)); + __lgread(lg, cpu->arch.gdt, table, num * sizeof(cpu->arch.gdt[0])); + fixup_gdt_table(cpu, 0, ARRAY_SIZE(cpu->arch.gdt)); /* Mark that the GDT changed so the core knows it has to copy it again, * even if the Guest is run on the same CPU. */ lg->changed |= CHANGED_GDT; @@ -165,12 +166,13 @@ * Remember that this happens on every context switch, so it's worth * optimizing. But wouldn't it be neater to have a single hypercall to cover * both cases? */ -void guest_load_tls(struct lguest *lg, unsigned long gtls) +void guest_load_tls(struct lg_cpu *cpu, unsigned long gtls) { - struct desc_struct *tls = &lg->arch.gdt[GDT_ENTRY_TLS_MIN]; + struct desc_struct *tls = &cpu->arch.gdt[GDT_ENTRY_TLS_MIN]; + struct lguest *lg = cpu->lg; __lgread(lg, tls, gtls, sizeof(*tls)*GDT_ENTRY_TLS_ENTRIES); - fixup_gdt_table(lg, GDT_ENTRY_TLS_MIN, GDT_ENTRY_TLS_MAX+1); + fixup_gdt_table(cpu, GDT_ENTRY_TLS_MIN, GDT_ENTRY_TLS_MAX+1); /* Note that just the TLS entries have changed. */ lg->changed |= CHANGED_GDT_TLS; } --- linux-2.6.24.orig/drivers/lguest/lguest_user.c +++ linux-2.6.24/drivers/lguest/lguest_user.c @@ -13,7 +13,7 @@ * LHREQ_BREAK and the value "1" to /dev/lguest to do this. Once the Launcher * has done whatever needs attention, it writes LHREQ_BREAK and "0" to release * the Waker. */ -static int break_guest_out(struct lguest *lg, const unsigned long __user *input) +static int break_guest_out(struct lg_cpu *cpu, const unsigned long __user*input) { unsigned long on; @@ -22,21 +22,21 @@ return -EFAULT; if (on) { - lg->break_out = 1; + cpu->break_out = 1; /* Pop it out of the Guest (may be running on different CPU) */ - wake_up_process(lg->tsk); + wake_up_process(cpu->tsk); /* Wait for them to reset it */ - return wait_event_interruptible(lg->break_wq, !lg->break_out); + return wait_event_interruptible(cpu->break_wq, !cpu->break_out); } else { - lg->break_out = 0; - wake_up(&lg->break_wq); + cpu->break_out = 0; + wake_up(&cpu->break_wq); return 0; } } /*L:050 Sending an interrupt is done by writing LHREQ_IRQ and an interrupt * number to /dev/lguest. */ -static int user_send_irq(struct lguest *lg, const unsigned long __user *input) +static int user_send_irq(struct lg_cpu *cpu, const unsigned long __user *input) { unsigned long irq; @@ -46,7 +46,7 @@ return -EINVAL; /* Next time the Guest runs, the core code will see if it can deliver * this interrupt. */ - set_bit(irq, lg->irqs_pending); + set_bit(irq, cpu->irqs_pending); return 0; } @@ -55,13 +55,21 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o) { struct lguest *lg = file->private_data; + struct lg_cpu *cpu; + unsigned int cpu_id = *o; /* You must write LHREQ_INITIALIZE first! */ if (!lg) return -EINVAL; + /* Watch out for arbitrary vcpu indexes! */ + if (cpu_id >= lg->nr_cpus) + return -EINVAL; + + cpu = &lg->cpus[cpu_id]; + /* If you're not the task which owns the Guest, go away. */ - if (current != lg->tsk) + if (current != cpu->tsk) return -EPERM; /* If the guest is already dead, we indicate why */ @@ -81,11 +89,49 @@ /* If we returned from read() last time because the Guest notified, * clear the flag. */ - if (lg->pending_notify) - lg->pending_notify = 0; + if (cpu->pending_notify) + cpu->pending_notify = 0; /* Run the Guest until something interesting happens. */ - return run_guest(lg, (unsigned long __user *)user); + return run_guest(cpu, (unsigned long __user *)user); +} + +static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip) +{ + if (id >= NR_CPUS) + return -EINVAL; + + cpu->id = id; + cpu->lg = container_of((cpu - id), struct lguest, cpus[0]); + cpu->lg->nr_cpus++; + init_clockdev(cpu); + + /* We need a complete page for the Guest registers: they are accessible + * to the Guest and we can only grant it access to whole pages. */ + cpu->regs_page = get_zeroed_page(GFP_KERNEL); + if (!cpu->regs_page) + return -ENOMEM; + + /* We actually put the registers at the bottom of the page. */ + cpu->regs = (void *)cpu->regs_page + PAGE_SIZE - sizeof(*cpu->regs); + + /* Now we initialize the Guest's registers, handing it the start + * address. */ + lguest_arch_setup_regs(cpu, start_ip); + + /* Initialize the queue for the waker to wait on */ + init_waitqueue_head(&cpu->break_wq); + + /* We keep a pointer to the Launcher task (ie. current task) for when + * other Guests want to wake this one (inter-Guest I/O). */ + cpu->tsk = current; + + /* We need to keep a pointer to the Launcher's memory map, because if + * the Launcher dies we need to clean it up. If we don't keep a + * reference, it is destroyed before close() is called. */ + cpu->mm = get_task_mm(cpu->tsk); + + return 0; } /*L:020 The initialization write supplies 4 pointer sized (32 or 64 bit) @@ -134,15 +180,10 @@ lg->mem_base = (void __user *)(long)args[0]; lg->pfn_limit = args[1]; - /* We need a complete page for the Guest registers: they are accessible - * to the Guest and we can only grant it access to whole pages. */ - lg->regs_page = get_zeroed_page(GFP_KERNEL); - if (!lg->regs_page) { - err = -ENOMEM; + /* This is the first cpu */ + err = lg_cpu_start(&lg->cpus[0], 0, args[3]); + if (err) goto release_guest; - } - /* We actually put the registers at the bottom of the page. */ - lg->regs = (void *)lg->regs_page + PAGE_SIZE - sizeof(*lg->regs); /* Initialize the Guest's shadow page tables, using the toplevel * address the Launcher gave us. This allocates memory, so can @@ -151,24 +192,6 @@ if (err) goto free_regs; - /* Now we initialize the Guest's registers, handing it the start - * address. */ - lguest_arch_setup_regs(lg, args[3]); - - /* The timer for lguest's clock needs initialization. */ - init_clockdev(lg); - - /* We keep a pointer to the Launcher task (ie. current task) for when - * other Guests want to wake this one (inter-Guest I/O). */ - lg->tsk = current; - /* We need to keep a pointer to the Launcher's memory map, because if - * the Launcher dies we need to clean it up. If we don't keep a - * reference, it is destroyed before close() is called. */ - lg->mm = get_task_mm(lg->tsk); - - /* Initialize the queue for the waker to wait on */ - init_waitqueue_head(&lg->break_wq); - /* We remember which CPU's pages this Guest used last, for optimization * when the same Guest runs on the same CPU twice. */ lg->last_pages = NULL; @@ -182,7 +205,8 @@ return sizeof(args); free_regs: - free_page(lg->regs_page); + /* FIXME: This should be in free_vcpu */ + free_page(lg->cpus[0].regs_page); release_guest: kfree(lg); unlock: @@ -202,30 +226,37 @@ struct lguest *lg = file->private_data; const unsigned long __user *input = (const unsigned long __user *)in; unsigned long req; + struct lg_cpu *uninitialized_var(cpu); + unsigned int cpu_id = *off; if (get_user(req, input) != 0) return -EFAULT; input++; /* If you haven't initialized, you must do that first. */ - if (req != LHREQ_INITIALIZE && !lg) - return -EINVAL; + if (req != LHREQ_INITIALIZE) { + if (!lg || (cpu_id >= lg->nr_cpus)) + return -EINVAL; + cpu = &lg->cpus[cpu_id]; + if (!cpu) + return -EINVAL; + } /* Once the Guest is dead, all you can do is read() why it died. */ if (lg && lg->dead) return -ENOENT; /* If you're not the task which owns the Guest, you can only break */ - if (lg && current != lg->tsk && req != LHREQ_BREAK) + if (lg && current != cpu->tsk && req != LHREQ_BREAK) return -EPERM; switch (req) { case LHREQ_INITIALIZE: return initialize(file, input); case LHREQ_IRQ: - return user_send_irq(lg, input); + return user_send_irq(cpu, input); case LHREQ_BREAK: - return break_guest_out(lg, input); + return break_guest_out(cpu, input); default: return -EINVAL; } @@ -241,6 +272,7 @@ static int close(struct inode *inode, struct file *file) { struct lguest *lg = file->private_data; + unsigned int i; /* If we never successfully initialized, there's nothing to clean up */ if (!lg) @@ -249,19 +281,23 @@ /* We need the big lock, to protect from inter-guest I/O and other * Launchers initializing guests. */ mutex_lock(&lguest_lock); - /* Cancels the hrtimer set via LHCALL_SET_CLOCKEVENT. */ - hrtimer_cancel(&lg->hrt); + /* Free up the shadow page tables for the Guest. */ free_guest_pagetable(lg); - /* Now all the memory cleanups are done, it's safe to release the - * Launcher's memory management structure. */ - mmput(lg->mm); + + for (i = 0; i < lg->nr_cpus; i++) { + /* Cancels the hrtimer set via LHCALL_SET_CLOCKEVENT. */ + hrtimer_cancel(&lg->cpus[i].hrt); + /* We can free up the register page we allocated. */ + free_page(lg->cpus[i].regs_page); + /* Now all the memory cleanups are done, it's safe to release + * the Launcher's memory management structure. */ + mmput(lg->cpus[i].mm); + } /* If lg->dead doesn't contain an error code it will be NULL or a * kmalloc()ed string, either of which is ok to hand to kfree(). */ if (!IS_ERR(lg->dead)) kfree(lg->dead); - /* We can free up the register page we allocated. */ - free_page(lg->regs_page); /* We clear the entire structure, which also marks it as free for the * next user. */ memset(lg, 0, sizeof(*lg)); --- linux-2.6.24.orig/drivers/lguest/page_tables.c +++ linux-2.6.24/drivers/lguest/page_tables.c @@ -94,10 +94,10 @@ /* These two functions just like the above two, except they access the Guest * page tables. Hence they return a Guest address. */ -static unsigned long gpgd_addr(struct lguest *lg, unsigned long vaddr) +static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr) { unsigned int index = vaddr >> (PGDIR_SHIFT); - return lg->pgdirs[lg->pgdidx].gpgdir + index * sizeof(pgd_t); + return cpu->lg->pgdirs[cpu->cpu_pgd].gpgdir + index * sizeof(pgd_t); } static unsigned long gpte_addr(struct lguest *lg, @@ -200,22 +200,23 @@ * * If we fixed up the fault (ie. we mapped the address), this routine returns * true. Otherwise, it was a real fault and we need to tell the Guest. */ -int demand_page(struct lguest *lg, unsigned long vaddr, int errcode) +int demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode) { pgd_t gpgd; pgd_t *spgd; unsigned long gpte_ptr; pte_t gpte; pte_t *spte; + struct lguest *lg = cpu->lg; /* First step: get the top-level Guest page table entry. */ - gpgd = lgread(lg, gpgd_addr(lg, vaddr), pgd_t); + gpgd = lgread(lg, gpgd_addr(cpu, vaddr), pgd_t); /* Toplevel not present? We can't map it in. */ if (!(pgd_flags(gpgd) & _PAGE_PRESENT)) return 0; /* Now look at the matching shadow entry. */ - spgd = spgd_addr(lg, lg->pgdidx, vaddr); + spgd = spgd_addr(lg, cpu->cpu_pgd, vaddr); if (!(pgd_flags(*spgd) & _PAGE_PRESENT)) { /* No shadow entry: allocate a new shadow PTE page. */ unsigned long ptepage = get_zeroed_page(GFP_KERNEL); @@ -297,19 +298,19 @@ * * This is a quick version which answers the question: is this virtual address * mapped by the shadow page tables, and is it writable? */ -static int page_writable(struct lguest *lg, unsigned long vaddr) +static int page_writable(struct lg_cpu *cpu, unsigned long vaddr) { pgd_t *spgd; unsigned long flags; /* Look at the current top level entry: is it present? */ - spgd = spgd_addr(lg, lg->pgdidx, vaddr); + spgd = spgd_addr(cpu->lg, cpu->cpu_pgd, vaddr); if (!(pgd_flags(*spgd) & _PAGE_PRESENT)) return 0; /* Check the flags on the pte entry itself: it must be present and * writable. */ - flags = pte_flags(*(spte_addr(lg, *spgd, vaddr))); + flags = pte_flags(*(spte_addr(cpu->lg, *spgd, vaddr))); return (flags & (_PAGE_PRESENT|_PAGE_RW)) == (_PAGE_PRESENT|_PAGE_RW); } @@ -317,10 +318,10 @@ /* So, when pin_stack_pages() asks us to pin a page, we check if it's already * in the page tables, and if not, we call demand_page() with error code 2 * (meaning "write"). */ -void pin_page(struct lguest *lg, unsigned long vaddr) +void pin_page(struct lg_cpu *cpu, unsigned long vaddr) { - if (!page_writable(lg, vaddr) && !demand_page(lg, vaddr, 2)) - kill_guest(lg, "bad stack page %#lx", vaddr); + if (!page_writable(cpu, vaddr) && !demand_page(cpu, vaddr, 2)) + kill_guest(cpu->lg, "bad stack page %#lx", vaddr); } /*H:450 If we chase down the release_pgd() code, it looks like this: */ @@ -358,28 +359,28 @@ * * The Guest has a hypercall to throw away the page tables: it's used when a * large number of mappings have been changed. */ -void guest_pagetable_flush_user(struct lguest *lg) +void guest_pagetable_flush_user(struct lg_cpu *cpu) { /* Drop the userspace part of the current page table. */ - flush_user_mappings(lg, lg->pgdidx); + flush_user_mappings(cpu->lg, cpu->cpu_pgd); } /*:*/ /* We walk down the guest page tables to get a guest-physical address */ -unsigned long guest_pa(struct lguest *lg, unsigned long vaddr) +unsigned long guest_pa(struct lg_cpu *cpu, unsigned long vaddr) { pgd_t gpgd; pte_t gpte; /* First step: get the top-level Guest page table entry. */ - gpgd = lgread(lg, gpgd_addr(lg, vaddr), pgd_t); + gpgd = lgread(cpu->lg, gpgd_addr(cpu, vaddr), pgd_t); /* Toplevel not present? We can't map it in. */ if (!(pgd_flags(gpgd) & _PAGE_PRESENT)) - kill_guest(lg, "Bad address %#lx", vaddr); + kill_guest(cpu->lg, "Bad address %#lx", vaddr); - gpte = lgread(lg, gpte_addr(lg, gpgd, vaddr), pte_t); + gpte = lgread(cpu->lg, gpte_addr(cpu->lg, gpgd, vaddr), pte_t); if (!(pte_flags(gpte) & _PAGE_PRESENT)) - kill_guest(lg, "Bad address %#lx", vaddr); + kill_guest(cpu->lg, "Bad address %#lx", vaddr); return pte_pfn(gpte) * PAGE_SIZE | (vaddr & ~PAGE_MASK); } @@ -399,11 +400,12 @@ /*H:435 And this is us, creating the new page directory. If we really do * allocate a new one (and so the kernel parts are not there), we set * blank_pgdir. */ -static unsigned int new_pgdir(struct lguest *lg, +static unsigned int new_pgdir(struct lg_cpu *cpu, unsigned long gpgdir, int *blank_pgdir) { unsigned int next; + struct lguest *lg = cpu->lg; /* We pick one entry at random to throw out. Choosing the Least * Recently Used might be better, but this is easy. */ @@ -413,7 +415,7 @@ lg->pgdirs[next].pgdir = (pgd_t *)get_zeroed_page(GFP_KERNEL); /* If the allocation fails, just keep using the one we have */ if (!lg->pgdirs[next].pgdir) - next = lg->pgdidx; + next = cpu->cpu_pgd; else /* This is a blank page, so there are no kernel * mappings: caller must map the stack! */ @@ -432,21 +434,22 @@ * Now we've seen all the page table setting and manipulation, let's see what * what happens when the Guest changes page tables (ie. changes the top-level * pgdir). This occurs on almost every context switch. */ -void guest_new_pagetable(struct lguest *lg, unsigned long pgtable) +void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable) { int newpgdir, repin = 0; + struct lguest *lg = cpu->lg; /* Look to see if we have this one already. */ newpgdir = find_pgdir(lg, pgtable); /* If not, we allocate or mug an existing one: if it's a fresh one, * repin gets set to 1. */ if (newpgdir == ARRAY_SIZE(lg->pgdirs)) - newpgdir = new_pgdir(lg, pgtable, &repin); + newpgdir = new_pgdir(cpu, pgtable, &repin); /* Change the current pgd index to the new one. */ - lg->pgdidx = newpgdir; + cpu->cpu_pgd = newpgdir; /* If it was completely blank, we map in the Guest kernel stack */ if (repin) - pin_stack_pages(lg); + pin_stack_pages(cpu); } /*H:470 Finally, a routine which throws away everything: all PGD entries in all @@ -468,11 +471,11 @@ * mapping. Since kernel mappings are in every page table, it's easiest to * throw them all away. This traps the Guest in amber for a while as * everything faults back in, but it's rare. */ -void guest_pagetable_clear_all(struct lguest *lg) +void guest_pagetable_clear_all(struct lg_cpu *cpu) { - release_all_pagetables(lg); + release_all_pagetables(cpu->lg); /* We need the Guest kernel stack mapped again. */ - pin_stack_pages(lg); + pin_stack_pages(cpu); } /*:*/ /*M:009 Since we throw away all mappings when a kernel mapping changes, our @@ -590,11 +593,11 @@ { /* We start on the first shadow page table, and give it a blank PGD * page. */ - lg->pgdidx = 0; - lg->pgdirs[lg->pgdidx].gpgdir = pgtable; - lg->pgdirs[lg->pgdidx].pgdir = (pgd_t*)get_zeroed_page(GFP_KERNEL); - if (!lg->pgdirs[lg->pgdidx].pgdir) + lg->pgdirs[0].gpgdir = pgtable; + lg->pgdirs[0].pgdir = (pgd_t *)get_zeroed_page(GFP_KERNEL); + if (!lg->pgdirs[0].pgdir) return -ENOMEM; + lg->cpus[0].cpu_pgd = 0; return 0; } @@ -606,7 +609,7 @@ /* We tell the Guest that it can't use the top 4MB of virtual * addresses used by the Switcher. */ || put_user(4U*1024*1024, &lg->lguest_data->reserve_mem) - || put_user(lg->pgdirs[lg->pgdidx].gpgdir,&lg->lguest_data->pgdir)) + || put_user(lg->pgdirs[0].gpgdir, &lg->lguest_data->pgdir)) kill_guest(lg, "bad guest page %p", lg->lguest_data); /* In flush_user_mappings() we loop from 0 to @@ -634,17 +637,18 @@ * Guest (and not the pages for other CPUs). We have the appropriate PTE pages * for each CPU already set up, we just need to hook them in now we know which * Guest is about to run on this CPU. */ -void map_switcher_in_guest(struct lguest *lg, struct lguest_pages *pages) +void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages) { pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages); pgd_t switcher_pgd; pte_t regs_pte; + unsigned long pfn; /* Make the last PGD entry for this Guest point to the Switcher's PTE * page for this CPU (with appropriate flags). */ switcher_pgd = __pgd(__pa(switcher_pte_page) | _PAGE_KERNEL); - lg->pgdirs[lg->pgdidx].pgdir[SWITCHER_PGD_INDEX] = switcher_pgd; + cpu->lg->pgdirs[cpu->cpu_pgd].pgdir[SWITCHER_PGD_INDEX] = switcher_pgd; /* We also change the Switcher PTE page. When we're running the Guest, * we want the Guest's "regs" page to appear where the first Switcher @@ -653,7 +657,8 @@ * CPU's "struct lguest_pages": if we make sure the Guest's register * page is already mapped there, we don't have to copy them out * again. */ - regs_pte = pfn_pte (__pa(lg->regs_page) >> PAGE_SHIFT, __pgprot(_PAGE_KERNEL)); + pfn = __pa(cpu->regs_page) >> PAGE_SHIFT; + regs_pte = pfn_pte(pfn, __pgprot(_PAGE_KERNEL)); switcher_pte_page[(unsigned long)pages/PAGE_SIZE%PTRS_PER_PTE] = regs_pte; } /*:*/ --- linux-2.6.24.orig/drivers/lguest/lg.h +++ linux-2.6.24/drivers/lguest/lg.h @@ -38,58 +38,71 @@ #define CHANGED_GDT_TLS 4 /* Actually a subset of CHANGED_GDT */ #define CHANGED_ALL 3 -/* The private info the thread maintains about the guest. */ -struct lguest -{ - /* At end of a page shared mapped over lguest_pages in guest. */ - unsigned long regs_page; - struct lguest_regs *regs; - struct lguest_data __user *lguest_data; +struct lguest; + +struct lg_cpu { + unsigned int id; + struct lguest *lg; struct task_struct *tsk; struct mm_struct *mm; /* == tsk->mm, but that becomes NULL on exit */ - u32 pfn_limit; - /* This provides the offset to the base of guest-physical - * memory in the Launcher. */ - void __user *mem_base; - unsigned long kernel_address; + u32 cr2; - int halted; int ts; - u32 next_hcall; u32 esp1; u8 ss1; + unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */ + + /* At end of a page shared mapped over lguest_pages in guest. */ + unsigned long regs_page; + struct lguest_regs *regs; + + int cpu_pgd; /* which pgd this cpu is currently using */ + /* If a hypercall was asked for, this points to the arguments. */ struct hcall_args *hcall; + u32 next_hcall; + + /* Virtual clock device */ + struct hrtimer hrt; /* Do we need to stop what we're doing and return to userspace? */ int break_out; wait_queue_head_t break_wq; + int halted; + + /* Pending virtual interrupts */ + DECLARE_BITMAP(irqs_pending, LGUEST_IRQS); + + struct lg_cpu_arch arch; +}; + +/* The private info the thread maintains about the guest. */ +struct lguest +{ + struct lguest_data __user *lguest_data; + struct lg_cpu cpus[NR_CPUS]; + unsigned int nr_cpus; + + u32 pfn_limit; + /* This provides the offset to the base of guest-physical + * memory in the Launcher. */ + void __user *mem_base; + unsigned long kernel_address; /* Bitmap of what has changed: see CHANGED_* above. */ int changed; struct lguest_pages *last_pages; - /* We keep a small number of these. */ - u32 pgdidx; struct pgdir pgdirs[4]; unsigned long noirq_start, noirq_end; - unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */ unsigned int stack_pages; u32 tsc_khz; /* Dead? */ const char *dead; - - struct lguest_arch arch; - - /* Virtual clock device */ - struct hrtimer hrt; - - /* Pending virtual interrupts */ - DECLARE_BITMAP(irqs_pending, LGUEST_IRQS); }; extern struct mutex lguest_lock; @@ -116,7 +129,7 @@ } while(0) /* (end of memory access helper routines) :*/ -int run_guest(struct lguest *lg, unsigned long __user *user); +int run_guest(struct lg_cpu *cpu, unsigned long __user *user); /* Helper macros to obtain the first 12 or the last 20 bits, this is only the * first step in the migration to the kernel types. pte_pfn is already defined @@ -126,52 +139,53 @@ #define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) /* interrupts_and_traps.c: */ -void maybe_do_interrupt(struct lguest *lg); -int deliver_trap(struct lguest *lg, unsigned int num); -void load_guest_idt_entry(struct lguest *lg, unsigned int i, u32 low, u32 hi); -void guest_set_stack(struct lguest *lg, u32 seg, u32 esp, unsigned int pages); -void pin_stack_pages(struct lguest *lg); +void maybe_do_interrupt(struct lg_cpu *cpu); +int deliver_trap(struct lg_cpu *cpu, unsigned int num); +void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int i, + u32 low, u32 hi); +void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages); +void pin_stack_pages(struct lg_cpu *cpu); void setup_default_idt_entries(struct lguest_ro_state *state, const unsigned long *def); -void copy_traps(const struct lguest *lg, struct desc_struct *idt, +void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, const unsigned long *def); -void guest_set_clockevent(struct lguest *lg, unsigned long delta); -void init_clockdev(struct lguest *lg); +void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta); +void init_clockdev(struct lg_cpu *cpu); bool check_syscall_vector(struct lguest *lg); int init_interrupts(void); void free_interrupts(void); /* segments.c: */ void setup_default_gdt_entries(struct lguest_ro_state *state); -void setup_guest_gdt(struct lguest *lg); -void load_guest_gdt(struct lguest *lg, unsigned long table, u32 num); -void guest_load_tls(struct lguest *lg, unsigned long tls_array); -void copy_gdt(const struct lguest *lg, struct desc_struct *gdt); -void copy_gdt_tls(const struct lguest *lg, struct desc_struct *gdt); +void setup_guest_gdt(struct lg_cpu *cpu); +void load_guest_gdt(struct lg_cpu *cpu, unsigned long table, u32 num); +void guest_load_tls(struct lg_cpu *cpu, unsigned long tls_array); +void copy_gdt(const struct lg_cpu *cpu, struct desc_struct *gdt); +void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt); /* page_tables.c: */ int init_guest_pagetable(struct lguest *lg, unsigned long pgtable); void free_guest_pagetable(struct lguest *lg); -void guest_new_pagetable(struct lguest *lg, unsigned long pgtable); +void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable); void guest_set_pmd(struct lguest *lg, unsigned long gpgdir, u32 i); -void guest_pagetable_clear_all(struct lguest *lg); -void guest_pagetable_flush_user(struct lguest *lg); +void guest_pagetable_clear_all(struct lg_cpu *cpu); +void guest_pagetable_flush_user(struct lg_cpu *cpu); void guest_set_pte(struct lguest *lg, unsigned long gpgdir, unsigned long vaddr, pte_t val); -void map_switcher_in_guest(struct lguest *lg, struct lguest_pages *pages); -int demand_page(struct lguest *info, unsigned long cr2, int errcode); -void pin_page(struct lguest *lg, unsigned long vaddr); -unsigned long guest_pa(struct lguest *lg, unsigned long vaddr); +void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages); +int demand_page(struct lg_cpu *cpu, unsigned long cr2, int errcode); +void pin_page(struct lg_cpu *cpu, unsigned long vaddr); +unsigned long guest_pa(struct lg_cpu *cpu, unsigned long vaddr); void page_table_guest_data_init(struct lguest *lg); /* /core.c: */ void lguest_arch_host_init(void); void lguest_arch_host_fini(void); -void lguest_arch_run_guest(struct lguest *lg); -void lguest_arch_handle_trap(struct lguest *lg); -int lguest_arch_init_hypercalls(struct lguest *lg); -int lguest_arch_do_hcall(struct lguest *lg, struct hcall_args *args); -void lguest_arch_setup_regs(struct lguest *lg, unsigned long start); +void lguest_arch_run_guest(struct lg_cpu *cpu); +void lguest_arch_handle_trap(struct lg_cpu *cpu); +int lguest_arch_init_hypercalls(struct lg_cpu *cpu); +int lguest_arch_do_hcall(struct lg_cpu *cpu, struct hcall_args *args); +void lguest_arch_setup_regs(struct lg_cpu *cpu, unsigned long start); /* /switcher.S: */ extern char start_switcher_text[], end_switcher_text[], switch_to_guest[]; @@ -181,7 +195,7 @@ void lguest_device_remove(void); /* hypercalls.c: */ -void do_hypercalls(struct lguest *lg); +void do_hypercalls(struct lg_cpu *cpu); void write_timestamp(struct lguest *lg); /*L:035 --- linux-2.6.24.orig/drivers/lguest/x86/core.c +++ linux-2.6.24/drivers/lguest/x86/core.c @@ -73,8 +73,9 @@ * since it last ran. We saw this set in interrupts_and_traps.c and * segments.c. */ -static void copy_in_guest_info(struct lguest *lg, struct lguest_pages *pages) +static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages) { + struct lguest *lg = cpu->lg; /* Copying all this data can be quite expensive. We usually run the * same Guest we ran last time (and that Guest hasn't run anywhere else * meanwhile). If that's not the case, we pretend everything in the @@ -90,42 +91,43 @@ pages->state.host_cr3 = __pa(current->mm->pgd); /* Set up the Guest's page tables to see this CPU's pages (and no * other CPU's pages). */ - map_switcher_in_guest(lg, pages); + map_switcher_in_guest(cpu, pages); /* Set up the two "TSS" members which tell the CPU what stack to use * for traps which do directly into the Guest (ie. traps at privilege * level 1). */ - pages->state.guest_tss.esp1 = lg->esp1; - pages->state.guest_tss.ss1 = lg->ss1; + pages->state.guest_tss.esp1 = cpu->esp1; + pages->state.guest_tss.ss1 = cpu->ss1; /* Copy direct-to-Guest trap entries. */ if (lg->changed & CHANGED_IDT) - copy_traps(lg, pages->state.guest_idt, default_idt_entries); + copy_traps(cpu, pages->state.guest_idt, default_idt_entries); /* Copy all GDT entries which the Guest can change. */ if (lg->changed & CHANGED_GDT) - copy_gdt(lg, pages->state.guest_gdt); + copy_gdt(cpu, pages->state.guest_gdt); /* If only the TLS entries have changed, copy them. */ else if (lg->changed & CHANGED_GDT_TLS) - copy_gdt_tls(lg, pages->state.guest_gdt); + copy_gdt_tls(cpu, pages->state.guest_gdt); /* Mark the Guest as unchanged for next time. */ lg->changed = 0; } /* Finally: the code to actually call into the Switcher to run the Guest. */ -static void run_guest_once(struct lguest *lg, struct lguest_pages *pages) +static void run_guest_once(struct lg_cpu *cpu, struct lguest_pages *pages) { /* This is a dummy value we need for GCC's sake. */ unsigned int clobber; + struct lguest *lg = cpu->lg; /* Copy the guest-specific information into this CPU's "struct * lguest_pages". */ - copy_in_guest_info(lg, pages); + copy_in_guest_info(cpu, pages); /* Set the trap number to 256 (impossible value). If we fault while * switching to the Guest (bad segment registers or bug), this will * cause us to abort the Guest. */ - lg->regs->trapnum = 256; + cpu->regs->trapnum = 256; /* Now: we push the "eflags" register on the stack, then do an "lcall". * This is how we change from using the kernel code segment to using @@ -143,7 +145,7 @@ * 0-th argument above, ie "a"). %ebx contains the * physical address of the Guest's top-level page * directory. */ - : "0"(pages), "1"(__pa(lg->pgdirs[lg->pgdidx].pgdir)) + : "0"(pages), "1"(__pa(lg->pgdirs[cpu->cpu_pgd].pgdir)) /* We tell gcc that all these registers could change, * which means we don't have to save and restore them in * the Switcher. */ @@ -161,12 +163,12 @@ /*H:040 This is the i386-specific code to setup and run the Guest. Interrupts * are disabled: we own the CPU. */ -void lguest_arch_run_guest(struct lguest *lg) +void lguest_arch_run_guest(struct lg_cpu *cpu) { /* Remember the awfully-named TS bit? If the Guest has asked to set it * we set it now, so we can trap and pass that trap to the Guest if it * uses the FPU. */ - if (lg->ts) + if (cpu->ts) lguest_set_ts(); /* SYSENTER is an optimized way of doing system calls. We can't allow @@ -180,7 +182,7 @@ /* Now we actually run the Guest. It will return when something * interesting happens, and we can examine its registers to see what it * was doing. */ - run_guest_once(lg, lguest_pages(raw_smp_processor_id())); + run_guest_once(cpu, lguest_pages(raw_smp_processor_id())); /* Note that the "regs" pointer contains two extra entries which are * not really registers: a trap number which says what interrupt or @@ -191,11 +193,11 @@ * bad virtual address. We have to grab this now, because once we * re-enable interrupts an interrupt could fault and thus overwrite * cr2, or we could even move off to a different CPU. */ - if (lg->regs->trapnum == 14) - lg->arch.last_pagefault = read_cr2(); + if (cpu->regs->trapnum == 14) + cpu->arch.last_pagefault = read_cr2(); /* Similarly, if we took a trap because the Guest used the FPU, * we have to restore the FPU it expects to see. */ - else if (lg->regs->trapnum == 7) + else if (cpu->regs->trapnum == 7) math_state_restore(); /* Restore SYSENTER if it's supposed to be on. */ @@ -214,18 +216,19 @@ * When the Guest uses one of these instructions, we get a trap (General * Protection Fault) and come here. We see if it's one of those troublesome * instructions and skip over it. We return true if we did. */ -static int emulate_insn(struct lguest *lg) +static int emulate_insn(struct lg_cpu *cpu) { + struct lguest *lg = cpu->lg; u8 insn; unsigned int insnlen = 0, in = 0, shift = 0; /* The eip contains the *virtual* address of the Guest's instruction: * guest_pa just subtracts the Guest's page_offset. */ - unsigned long physaddr = guest_pa(lg, lg->regs->eip); + unsigned long physaddr = guest_pa(cpu, cpu->regs->eip); /* This must be the Guest kernel trying to do something, not userspace! * The bottom two bits of the CS segment register are the privilege * level. */ - if ((lg->regs->cs & 3) != GUEST_PL) + if ((cpu->regs->cs & 3) != GUEST_PL) return 0; /* Decoding x86 instructions is icky. */ @@ -268,26 +271,27 @@ if (in) { /* Lower bit tells is whether it's a 16 or 32 bit access */ if (insn & 0x1) - lg->regs->eax = 0xFFFFFFFF; + cpu->regs->eax = 0xFFFFFFFF; else - lg->regs->eax |= (0xFFFF << shift); + cpu->regs->eax |= (0xFFFF << shift); } /* Finally, we've "done" the instruction, so move past it. */ - lg->regs->eip += insnlen; + cpu->regs->eip += insnlen; /* Success! */ return 1; } /*H:050 Once we've re-enabled interrupts, we look at why the Guest exited. */ -void lguest_arch_handle_trap(struct lguest *lg) +void lguest_arch_handle_trap(struct lg_cpu *cpu) { - switch (lg->regs->trapnum) { + struct lguest *lg = cpu->lg; + switch (cpu->regs->trapnum) { case 13: /* We've intercepted a General Protection Fault. */ /* Check if this was one of those annoying IN or OUT * instructions which we need to emulate. If so, we just go * back into the Guest after we've done it. */ - if (lg->regs->errcode == 0) { - if (emulate_insn(lg)) + if (cpu->regs->errcode == 0) { + if (emulate_insn(cpu)) return; } break; @@ -301,7 +305,8 @@ * * The errcode tells whether this was a read or a write, and * whether kernel or userspace code. */ - if (demand_page(lg, lg->arch.last_pagefault, lg->regs->errcode)) + if (demand_page(cpu, cpu->arch.last_pagefault, + cpu->regs->errcode)) return; /* OK, it's really not there (or not OK): the Guest needs to @@ -312,14 +317,14 @@ * happen before it's done the LHCALL_LGUEST_INIT hypercall, so * lg->lguest_data could be NULL */ if (lg->lguest_data && - put_user(lg->arch.last_pagefault, &lg->lguest_data->cr2)) + put_user(cpu->arch.last_pagefault, &lg->lguest_data->cr2)) kill_guest(lg, "Writing cr2"); break; case 7: /* We've intercepted a Device Not Available fault. */ /* If the Guest doesn't want to know, we already restored the * Floating Point Unit, so we just continue without telling * it. */ - if (!lg->ts) + if (!cpu->ts) return; break; case 32 ... 255: @@ -332,19 +337,19 @@ case LGUEST_TRAP_ENTRY: /* Our 'struct hcall_args' maps directly over our regs: we set * up the pointer now to indicate a hypercall is pending. */ - lg->hcall = (struct hcall_args *)lg->regs; + cpu->hcall = (struct hcall_args *)cpu->regs; return; } /* We didn't handle the trap, so it needs to go to the Guest. */ - if (!deliver_trap(lg, lg->regs->trapnum)) + if (!deliver_trap(cpu, cpu->regs->trapnum)) /* If the Guest doesn't have a handler (either it hasn't * registered any yet, or it's one of the faults we don't let * it handle), it dies with a cryptic error message. */ kill_guest(lg, "unhandled trap %li at %#lx (%#lx)", - lg->regs->trapnum, lg->regs->eip, - lg->regs->trapnum == 14 ? lg->arch.last_pagefault - : lg->regs->errcode); + cpu->regs->trapnum, cpu->regs->eip, + cpu->regs->trapnum == 14 ? cpu->arch.last_pagefault + : cpu->regs->errcode); } /* Now we can look at each of the routines this calls, in increasing order of @@ -487,17 +492,17 @@ /*H:122 The i386-specific hypercalls simply farm out to the right functions. */ -int lguest_arch_do_hcall(struct lguest *lg, struct hcall_args *args) +int lguest_arch_do_hcall(struct lg_cpu *cpu, struct hcall_args *args) { switch (args->arg0) { case LHCALL_LOAD_GDT: - load_guest_gdt(lg, args->arg1, args->arg2); + load_guest_gdt(cpu, args->arg1, args->arg2); break; case LHCALL_LOAD_IDT_ENTRY: - load_guest_idt_entry(lg, args->arg1, args->arg2, args->arg3); + load_guest_idt_entry(cpu, args->arg1, args->arg2, args->arg3); break; case LHCALL_LOAD_TLS: - guest_load_tls(lg, args->arg1); + guest_load_tls(cpu, args->arg1); break; default: /* Bad Guest. Bad! */ @@ -507,13 +512,14 @@ } /*H:126 i386-specific hypercall initialization: */ -int lguest_arch_init_hypercalls(struct lguest *lg) +int lguest_arch_init_hypercalls(struct lg_cpu *cpu) { u32 tsc_speed; + struct lguest *lg = cpu->lg; /* The pointer to the Guest's "struct lguest_data" is the only * argument. We check that address now. */ - if (!lguest_address_ok(lg, lg->hcall->arg1, sizeof(*lg->lguest_data))) + if (!lguest_address_ok(lg, cpu->hcall->arg1, sizeof(*lg->lguest_data))) return -EFAULT; /* Having checked it, we simply set lg->lguest_data to point straight @@ -521,7 +527,7 @@ * copy_to_user/from_user from now on, instead of lgread/write. I put * this in to show that I'm not immune to writing stupid * optimizations. */ - lg->lguest_data = lg->mem_base + lg->hcall->arg1; + lg->lguest_data = lg->mem_base + cpu->hcall->arg1; /* We insist that the Time Stamp Counter exist and doesn't change with * cpu frequency. Some devious chip manufacturers decided that TSC @@ -548,9 +554,9 @@ * * Most of the Guest's registers are left alone: we used get_zeroed_page() to * allocate the structure, so they will be 0. */ -void lguest_arch_setup_regs(struct lguest *lg, unsigned long start) +void lguest_arch_setup_regs(struct lg_cpu *cpu, unsigned long start) { - struct lguest_regs *regs = lg->regs; + struct lguest_regs *regs = cpu->regs; /* There are four "segment" registers which the Guest needs to boot: * The "code segment" register (cs) refers to the kernel code segment @@ -577,5 +583,5 @@ /* There are a couple of GDT entries the Guest expects when first * booting. */ - setup_guest_gdt(lg); + setup_guest_gdt(cpu); } --- linux-2.6.24.orig/drivers/macintosh/via-pmu.c +++ linux-2.6.24/drivers/macintosh/via-pmu.c @@ -2842,7 +2842,7 @@ EXPORT_SYMBOL(pmu_suspend); EXPORT_SYMBOL(pmu_resume); EXPORT_SYMBOL(pmu_unlock); -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) +#if defined(CONFIG_PPC32) EXPORT_SYMBOL(pmu_enable_irled); EXPORT_SYMBOL(pmu_battery_count); EXPORT_SYMBOL(pmu_batteries); --- linux-2.6.24.orig/drivers/macintosh/mediabay.c +++ linux-2.6.24/drivers/macintosh/mediabay.c @@ -447,6 +447,7 @@ return -ENODEV; } +EXPORT_SYMBOL(check_media_bay_by_base); int media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base, int irq, int index) @@ -487,6 +488,7 @@ return -ENODEV; } +EXPORT_SYMBOL(media_bay_set_ide_infos); static void media_bay_step(int i) { @@ -709,7 +711,8 @@ { struct media_bay_info *bay = macio_get_drvdata(mdev); - if (state.event != mdev->ofdev.dev.power.power_state.event && state.event == PM_EVENT_SUSPEND) { + if (state.event != mdev->ofdev.dev.power.power_state.event + && (state.event & PM_EVENT_SLEEP)) { down(&bay->lock); bay->sleeping = 1; set_mb_power(bay, 0); --- linux-2.6.24.orig/drivers/macintosh/smu.c +++ linux-2.6.24/drivers/macintosh/smu.c @@ -85,6 +85,7 @@ u32 cmd_buf_abs; /* command buffer absolute */ struct list_head cmd_list; struct smu_cmd *cmd_cur; /* pending command */ + int broken_nap; struct list_head cmd_i2c_list; struct smu_i2c_cmd *cmd_i2c_cur; /* pending i2c command */ struct timer_list i2c_timer; @@ -135,6 +136,19 @@ fend = faddr + smu->cmd_buf->length + 2; flush_inval_dcache_range(faddr, fend); + + /* We also disable NAP mode for the duration of the command + * on U3 based machines. + * This is slightly racy as it can be written back to 1 by a sysctl + * but that never happens in practice. There seem to be an issue with + * U3 based machines such as the iMac G5 where napping for the + * whole duration of the command prevents the SMU from fetching it + * from memory. This might be related to the strange i2c based + * mechanism the SMU uses to access memory. + */ + if (smu->broken_nap) + powersave_nap = 0; + /* This isn't exactly a DMA mapping here, I suspect * the SMU is actually communicating with us via i2c to the * northbridge or the CPU to access RAM. @@ -211,6 +225,10 @@ misc = cmd->misc; mb(); cmd->status = rc; + + /* Re-enable NAP mode */ + if (smu->broken_nap) + powersave_nap = 1; bail: /* Start next command if any */ smu_start_cmd(); @@ -461,7 +479,7 @@ if (np == NULL) return -ENODEV; - printk(KERN_INFO "SMU driver %s %s\n", VERSION, AUTHOR); + printk(KERN_INFO "SMU: Driver %s %s\n", VERSION, AUTHOR); if (smu_cmdbuf_abs == 0) { printk(KERN_ERR "SMU: Command buffer not allocated !\n"); @@ -533,6 +551,11 @@ goto fail; } + /* U3 has an issue with NAP mode when issuing SMU commands */ + smu->broken_nap = pmac_get_uninorth_variant() < 4; + if (smu->broken_nap) + printk(KERN_INFO "SMU: using NAP mode workaround\n"); + sys_ctrler = SYS_CTRLER_SMU; return 0; --- linux-2.6.24.orig/drivers/char/virtio_console.c +++ linux-2.6.24/drivers/char/virtio_console.c @@ -158,13 +158,13 @@ /* Find the input queue. */ /* FIXME: This is why we want to wean off hvc: we do nothing * when input comes in. */ - in_vq = vdev->config->find_vq(vdev, NULL); + in_vq = vdev->config->find_vq(vdev, 0, NULL); if (IS_ERR(in_vq)) { err = PTR_ERR(in_vq); goto free; } - out_vq = vdev->config->find_vq(vdev, NULL); + out_vq = vdev->config->find_vq(vdev, 1, NULL); if (IS_ERR(out_vq)) { err = PTR_ERR(out_vq); goto free_in_vq; --- linux-2.6.24.orig/drivers/char/defkeymap.c_shipped +++ linux-2.6.24/drivers/char/defkeymap.c_shipped @@ -223,40 +223,40 @@ }; struct kbdiacruc accent_table[MAX_DIACR] = { - {'`', 'A', '\300'}, {'`', 'a', '\340'}, - {'\'', 'A', '\301'}, {'\'', 'a', '\341'}, - {'^', 'A', '\302'}, {'^', 'a', '\342'}, - {'~', 'A', '\303'}, {'~', 'a', '\343'}, - {'"', 'A', '\304'}, {'"', 'a', '\344'}, - {'O', 'A', '\305'}, {'o', 'a', '\345'}, - {'0', 'A', '\305'}, {'0', 'a', '\345'}, - {'A', 'A', '\305'}, {'a', 'a', '\345'}, - {'A', 'E', '\306'}, {'a', 'e', '\346'}, - {',', 'C', '\307'}, {',', 'c', '\347'}, - {'`', 'E', '\310'}, {'`', 'e', '\350'}, - {'\'', 'E', '\311'}, {'\'', 'e', '\351'}, - {'^', 'E', '\312'}, {'^', 'e', '\352'}, - {'"', 'E', '\313'}, {'"', 'e', '\353'}, - {'`', 'I', '\314'}, {'`', 'i', '\354'}, - {'\'', 'I', '\315'}, {'\'', 'i', '\355'}, - {'^', 'I', '\316'}, {'^', 'i', '\356'}, - {'"', 'I', '\317'}, {'"', 'i', '\357'}, - {'-', 'D', '\320'}, {'-', 'd', '\360'}, - {'~', 'N', '\321'}, {'~', 'n', '\361'}, - {'`', 'O', '\322'}, {'`', 'o', '\362'}, - {'\'', 'O', '\323'}, {'\'', 'o', '\363'}, - {'^', 'O', '\324'}, {'^', 'o', '\364'}, - {'~', 'O', '\325'}, {'~', 'o', '\365'}, - {'"', 'O', '\326'}, {'"', 'o', '\366'}, - {'/', 'O', '\330'}, {'/', 'o', '\370'}, - {'`', 'U', '\331'}, {'`', 'u', '\371'}, - {'\'', 'U', '\332'}, {'\'', 'u', '\372'}, - {'^', 'U', '\333'}, {'^', 'u', '\373'}, - {'"', 'U', '\334'}, {'"', 'u', '\374'}, - {'\'', 'Y', '\335'}, {'\'', 'y', '\375'}, - {'T', 'H', '\336'}, {'t', 'h', '\376'}, - {'s', 's', '\337'}, {'"', 'y', '\377'}, - {'s', 'z', '\337'}, {'i', 'j', '\377'}, + {'`', 'A', 0300}, {'`', 'a', 0340}, + {'\'', 'A', 0301}, {'\'', 'a', 0341}, + {'^', 'A', 0302}, {'^', 'a', 0342}, + {'~', 'A', 0303}, {'~', 'a', 0343}, + {'"', 'A', 0304}, {'"', 'a', 0344}, + {'O', 'A', 0305}, {'o', 'a', 0345}, + {'0', 'A', 0305}, {'0', 'a', 0345}, + {'A', 'A', 0305}, {'a', 'a', 0345}, + {'A', 'E', 0306}, {'a', 'e', 0346}, + {',', 'C', 0307}, {',', 'c', 0347}, + {'`', 'E', 0310}, {'`', 'e', 0350}, + {'\'', 'E', 0311}, {'\'', 'e', 0351}, + {'^', 'E', 0312}, {'^', 'e', 0352}, + {'"', 'E', 0313}, {'"', 'e', 0353}, + {'`', 'I', 0314}, {'`', 'i', 0354}, + {'\'', 'I', 0315}, {'\'', 'i', 0355}, + {'^', 'I', 0316}, {'^', 'i', 0356}, + {'"', 'I', 0317}, {'"', 'i', 0357}, + {'-', 'D', 0320}, {'-', 'd', 0360}, + {'~', 'N', 0321}, {'~', 'n', 0361}, + {'`', 'O', 0322}, {'`', 'o', 0362}, + {'\'', 'O', 0323}, {'\'', 'o', 0363}, + {'^', 'O', 0324}, {'^', 'o', 0364}, + {'~', 'O', 0325}, {'~', 'o', 0365}, + {'"', 'O', 0326}, {'"', 'o', 0366}, + {'/', 'O', 0330}, {'/', 'o', 0370}, + {'`', 'U', 0331}, {'`', 'u', 0371}, + {'\'', 'U', 0332}, {'\'', 'u', 0372}, + {'^', 'U', 0333}, {'^', 'u', 0373}, + {'"', 'U', 0334}, {'"', 'u', 0374}, + {'\'', 'Y', 0335}, {'\'', 'y', 0375}, + {'T', 'H', 0336}, {'t', 'h', 0376}, + {'s', 's', 0337}, {'"', 'y', 0377}, + {'s', 'z', 0337}, {'i', 'j', 0377}, }; unsigned int accent_table_size = 68; --- linux-2.6.24.orig/drivers/char/synclink_gt.c +++ linux-2.6.24/drivers/char/synclink_gt.c @@ -1095,9 +1095,6 @@ unsigned int cmd, unsigned long arg) { struct slgt_info *info = tty->driver_data; - struct mgsl_icount cnow; /* kernel counter temps */ - struct serial_icounter_struct __user *p_cuser; /* user space */ - unsigned long flags; void __user *argp = (void __user *)arg; if (sanity_check(info, tty->name, "ioctl")) @@ -1105,7 +1102,7 @@ DBGINFO(("%s ioctl() cmd=%08X\n", info->device_name, cmd)); if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && - (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { + (cmd != TIOCMIWAIT)) { if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; } @@ -1141,30 +1138,39 @@ return get_gpio(info, argp); case MGSL_IOCWAITGPIO: return wait_gpio(info, argp); - case TIOCGICOUNT: - spin_lock_irqsave(&info->lock,flags); - cnow = info->icount; - spin_unlock_irqrestore(&info->lock,flags); - p_cuser = argp; - if (put_user(cnow.cts, &p_cuser->cts) || - put_user(cnow.dsr, &p_cuser->dsr) || - put_user(cnow.rng, &p_cuser->rng) || - put_user(cnow.dcd, &p_cuser->dcd) || - put_user(cnow.rx, &p_cuser->rx) || - put_user(cnow.tx, &p_cuser->tx) || - put_user(cnow.frame, &p_cuser->frame) || - put_user(cnow.overrun, &p_cuser->overrun) || - put_user(cnow.parity, &p_cuser->parity) || - put_user(cnow.brk, &p_cuser->brk) || - put_user(cnow.buf_overrun, &p_cuser->buf_overrun)) - return -EFAULT; - return 0; default: return -ENOIOCTLCMD; } return 0; } +static int get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) + +{ + struct slgt_info *info = tty->driver_data; + struct mgsl_icount cnow; /* kernel counter temps */ + unsigned long flags; + + spin_lock_irqsave(&info->lock,flags); + cnow = info->icount; + spin_unlock_irqrestore(&info->lock,flags); + + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + icount->rx = cnow.rx; + icount->tx = cnow.tx; + icount->frame = cnow.frame; + icount->overrun = cnow.overrun; + icount->parity = cnow.parity; + icount->brk = cnow.brk; + icount->buf_overrun = cnow.buf_overrun; + + return 0; +} + /* * support for 32 bit ioctl calls on 64 bit systems */ @@ -1250,10 +1256,6 @@ case MGSL_IOCSGPIO: case MGSL_IOCGGPIO: case MGSL_IOCWAITGPIO: - case TIOCGICOUNT: - rc = ioctl(tty, file, cmd, (unsigned long)(compat_ptr(arg))); - break; - case MGSL_IOCSTXIDLE: case MGSL_IOCTXENABLE: case MGSL_IOCRXENABLE: @@ -3563,6 +3565,7 @@ .hangup = hangup, .tiocmget = tiocmget, .tiocmset = tiocmset, + .get_icount = get_icount, }; static void slgt_cleanup(void) --- linux-2.6.24.orig/drivers/char/tty_io.c +++ linux-2.6.24/drivers/char/tty_io.c @@ -94,6 +94,7 @@ #include #include #include +#include #include #include @@ -2271,6 +2272,8 @@ list_del_init(&tty->tty_files); file_list_unlock(); + put_pid(tty->pgrp); + put_pid(tty->session); free_tty_struct(tty); } @@ -3300,6 +3303,20 @@ return retval; } +static int tty_tiocgicount(struct tty_struct *tty, void __user *arg) +{ + int retval = -EINVAL; + struct serial_icounter_struct icount; + memset(&icount, 0, sizeof(icount)); + if (tty->driver->get_icount) + retval = tty->driver->get_icount(tty, &icount); + if (retval != 0) + return retval; + if (copy_to_user(arg, &icount, sizeof(icount))) + return -EFAULT; + return 0; +} + /* * Split this up, as gcc can choke on it otherwise.. */ @@ -3433,6 +3450,12 @@ case TIOCMBIC: case TIOCMBIS: return tty_tiocmset(tty, file, cmd, p); + case TIOCGICOUNT: + retval = tty_tiocgicount(tty, p); + /* For the moment allow fall through to the old method */ + if (retval != -EINVAL) + return retval; + break; case TCFLSH: switch (arg) { case TCIFLUSH: @@ -3847,6 +3870,7 @@ driver->write_proc = op->write_proc; driver->tiocmget = op->tiocmget; driver->tiocmset = op->tiocmset; + driver->get_icount = op->get_icount; } --- linux-2.6.24.orig/drivers/char/mmtimer.c +++ linux-2.6.24/drivers/char/mmtimer.c @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include @@ -366,8 +368,8 @@ nsec = rtc_time() * sgi_clock_period + sgi_clock_offset.tv_nsec; - tp->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &tp->tv_nsec) - + sgi_clock_offset.tv_sec; + *tp = ns_to_timespec(nsec); + tp->tv_sec += sgi_clock_offset.tv_sec; return 0; }; @@ -375,11 +377,11 @@ { u64 nsec; - u64 rem; + u32 rem; nsec = rtc_time() * sgi_clock_period; - sgi_clock_offset.tv_sec = tp->tv_sec - div_long_long_rem(nsec, NSEC_PER_SEC, &rem); + sgi_clock_offset.tv_sec = tp->tv_sec - div_u64_rem(nsec, NSEC_PER_SEC, &rem); if (rem <= tp->tv_nsec) sgi_clock_offset.tv_nsec = tp->tv_sec - rem; @@ -532,9 +534,6 @@ return 0; } -#define timespec_to_ns(x) ((x).tv_nsec + (x).tv_sec * NSEC_PER_SEC) -#define ns_to_timespec(ts, nsec) (ts).tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &(ts).tv_nsec) - /* Assumption: it_lock is already held with irq's disabled */ static void sgi_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) { @@ -547,9 +546,8 @@ return; } - ns_to_timespec(cur_setting->it_interval, timr->it.mmtimer.incr * sgi_clock_period); - ns_to_timespec(cur_setting->it_value, (timr->it.mmtimer.expires - rtc_time())* sgi_clock_period); - return; + cur_setting->it_interval = ns_to_timespec(timr->it.mmtimer.incr * sgi_clock_period); + cur_setting->it_value = ns_to_timespec((timr->it.mmtimer.expires - rtc_time()) * sgi_clock_period); } @@ -568,8 +566,8 @@ sgi_timer_get(timr, old_setting); sgi_timer_del(timr); - when = timespec_to_ns(new_setting->it_value); - period = timespec_to_ns(new_setting->it_interval); + when = timespec_to_ns(&new_setting->it_value); + period = timespec_to_ns(&new_setting->it_interval); if (when == 0) /* Clear timer */ @@ -580,7 +578,7 @@ unsigned long now; getnstimeofday(&n); - now = timespec_to_ns(n); + now = timespec_to_ns(&n); if (when > now) when -= now; else --- linux-2.6.24.orig/drivers/char/Kconfig +++ linux-2.6.24/drivers/char/Kconfig @@ -80,6 +80,14 @@ information. For framebuffer console users, please refer to . +config DEV_KMEM + bool "/dev/kmem virtual device support" + help + Say Y here if you want to support the /dev/kmem device. The + /dev/kmem device is rarely used, but can be used for certain + kind of kernel debugging operations. + When in doubt, say "N". + config SERIAL_NONSTANDARD bool "Non-standard serial port support" depends on HAS_IOMEM --- linux-2.6.24.orig/drivers/char/synclinkmp.c +++ linux-2.6.24/drivers/char/synclinkmp.c @@ -1308,10 +1308,6 @@ unsigned int cmd, unsigned long arg) { SLMP_INFO *info = (SLMP_INFO *)tty->driver_data; - int error; - struct mgsl_icount cnow; /* kernel counter temps */ - struct serial_icounter_struct __user *p_cuser; /* user space */ - unsigned long flags; void __user *argp = (void __user *)arg; if (debug_level >= DEBUG_LEVEL_INFO) @@ -1322,7 +1318,7 @@ return -ENODEV; if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && - (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { + (cmd != TIOCMIWAIT)) { if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; } @@ -1360,40 +1356,38 @@ * NB: both 1->0 and 0->1 transitions are counted except for * RI where only 0->1 is counted. */ - case TIOCGICOUNT: - spin_lock_irqsave(&info->lock,flags); - cnow = info->icount; - spin_unlock_irqrestore(&info->lock,flags); - p_cuser = argp; - PUT_USER(error,cnow.cts, &p_cuser->cts); - if (error) return error; - PUT_USER(error,cnow.dsr, &p_cuser->dsr); - if (error) return error; - PUT_USER(error,cnow.rng, &p_cuser->rng); - if (error) return error; - PUT_USER(error,cnow.dcd, &p_cuser->dcd); - if (error) return error; - PUT_USER(error,cnow.rx, &p_cuser->rx); - if (error) return error; - PUT_USER(error,cnow.tx, &p_cuser->tx); - if (error) return error; - PUT_USER(error,cnow.frame, &p_cuser->frame); - if (error) return error; - PUT_USER(error,cnow.overrun, &p_cuser->overrun); - if (error) return error; - PUT_USER(error,cnow.parity, &p_cuser->parity); - if (error) return error; - PUT_USER(error,cnow.brk, &p_cuser->brk); - if (error) return error; - PUT_USER(error,cnow.buf_overrun, &p_cuser->buf_overrun); - if (error) return error; - return 0; default: return -ENOIOCTLCMD; } return 0; } +static int get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) +{ + SLMP_INFO *info = tty->driver_data; + struct mgsl_icount cnow; /* kernel counter temps */ + unsigned long flags; + + spin_lock_irqsave(&info->lock,flags); + cnow = info->icount; + spin_unlock_irqrestore(&info->lock,flags); + + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + icount->rx = cnow.rx; + icount->tx = cnow.tx; + icount->frame = cnow.frame; + icount->overrun = cnow.overrun; + icount->parity = cnow.parity; + icount->brk = cnow.brk; + icount->buf_overrun = cnow.buf_overrun; + + return 0; +} + /* * /proc fs routines.... */ @@ -3935,6 +3929,7 @@ .hangup = hangup, .tiocmget = tiocmget, .tiocmset = tiocmset, + .get_icount = get_icount, }; static void synclinkmp_cleanup(void) --- linux-2.6.24.orig/drivers/char/mem.c +++ linux-2.6.24/drivers/char/mem.c @@ -108,6 +108,30 @@ } #endif +#ifdef CONFIG_NONPROMISC_DEVMEM +static inline int range_is_allowed(unsigned long from, unsigned long to) +{ + unsigned long cursor; + + cursor = from >> PAGE_SHIFT; + while ((cursor << PAGE_SHIFT) < to) { + if (!devmem_is_allowed(cursor)) { + printk(KERN_INFO "Program %s tried to read /dev/mem " + "between %lx->%lx.\n", + current->comm, from, to); + return 0; + } + cursor++; + } + return 1; +} +#else +static inline int range_is_allowed(unsigned long from, unsigned long to) +{ + return 1; +} +#endif + /* * This funcion reads the *physical* memory. The f_pos points directly to the * memory location. @@ -157,6 +181,8 @@ */ ptr = xlate_dev_mem_ptr(p); + if (!range_is_allowed(p, p+count)) + return -EPERM; if (copy_to_user(buf, ptr, sz)) return -EFAULT; buf += sz; @@ -214,6 +240,8 @@ */ ptr = xlate_dev_mem_ptr(p); + if (!range_is_allowed(p, p+sz)) + return -EPERM; copied = copy_from_user(ptr, buf, sz); if (copied) { written += sz - copied; @@ -295,6 +323,7 @@ return 0; } +#ifdef CONFIG_DEVKMEM static int mmap_kmem(struct file * file, struct vm_area_struct * vma) { unsigned long pfn; @@ -315,6 +344,7 @@ vma->vm_pgoff = pfn; return mmap_mem(file, vma); } +#endif #ifdef CONFIG_CRASH_DUMP /* @@ -353,6 +383,7 @@ extern long vread(char *buf, char *addr, unsigned long count); extern long vwrite(char *buf, char *addr, unsigned long count); +#ifdef CONFIG_DEVKMEM /* * This function reads the *virtual* memory as seen by the kernel. */ @@ -557,6 +588,7 @@ *ppos = p; return virtr + wrote; } +#endif #ifdef CONFIG_DEVPORT static ssize_t read_port(struct file * file, char __user * buf, @@ -734,6 +766,7 @@ .get_unmapped_area = get_unmapped_area_mem, }; +#ifdef CONFIG_DEVKMEM static const struct file_operations kmem_fops = { .llseek = memory_lseek, .read = read_kmem, @@ -742,6 +775,7 @@ .open = open_kmem, .get_unmapped_area = get_unmapped_area_mem, }; +#endif static const struct file_operations null_fops = { .llseek = null_lseek, @@ -820,11 +854,13 @@ filp->f_mapping->backing_dev_info = &directly_mappable_cdev_bdi; break; +#ifdef CONFIG_DEVKMEM case 2: filp->f_op = &kmem_fops; filp->f_mapping->backing_dev_info = &directly_mappable_cdev_bdi; break; +#endif case 3: filp->f_op = &null_fops; break; @@ -873,7 +909,9 @@ const struct file_operations *fops; } devlist[] = { /* list of minor devices */ {1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops}, +#ifdef CONFIG_DEVKMEM {2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops}, +#endif {3, "null", S_IRUGO | S_IWUGO, &null_fops}, #ifdef CONFIG_DEVPORT {4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops}, --- linux-2.6.24.orig/drivers/char/selection.c +++ linux-2.6.24/drivers/char/selection.c @@ -268,7 +268,7 @@ /* Allocate a new buffer before freeing the old one ... */ multiplier = use_unicode ? 3 : 1; /* chars can take up to 3 bytes */ - bp = kmalloc((sel_end-sel_start)/2*multiplier+1, GFP_KERNEL); + bp = kmalloc(((sel_end-sel_start)/2+1)*multiplier, GFP_KERNEL); if (!bp) { printk(KERN_WARNING "selection: kmalloc() failed\n"); clear_selection(); --- linux-2.6.24.orig/drivers/char/synclink.c +++ linux-2.6.24/drivers/char/synclink.c @@ -2931,6 +2931,38 @@ } /* end of mgsl_break() */ +/* + * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) + * Return: write counters to the user passed counter struct + * NB: both 1->0 and 0->1 transitions are counted except for + * RI where only 0->1 is counted. + */ +static int msgl_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) + +{ + struct mgsl_struct * info = tty->driver_data; + struct mgsl_icount cnow; /* kernel counter temps */ + unsigned long flags; + + spin_lock_irqsave(&info->irq_spinlock,flags); + cnow = info->icount; + spin_unlock_irqrestore(&info->irq_spinlock,flags); + + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + icount->rx = cnow.rx; + icount->tx = cnow.tx; + icount->frame = cnow.frame; + icount->overrun = cnow.overrun; + icount->parity = cnow.parity; + icount->brk = cnow.brk; + icount->buf_overrun = cnow.buf_overrun; + return 0; +} + /* mgsl_ioctl() Service an IOCTL request * * Arguments: @@ -2955,7 +2987,7 @@ return -ENODEV; if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && - (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { + (cmd != TIOCMIWAIT)) { if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; } @@ -2965,11 +2997,7 @@ static int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg) { - int error; - struct mgsl_icount cnow; /* kernel counter temps */ void __user *argp = (void __user *)arg; - struct serial_icounter_struct __user *p_cuser; /* user space */ - unsigned long flags; switch (cmd) { case MGSL_IOCGPARAMS: @@ -2998,40 +3026,6 @@ case TIOCMIWAIT: return modem_input_wait(info,(int)arg); - /* - * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for - * RI where only 0->1 is counted. - */ - case TIOCGICOUNT: - spin_lock_irqsave(&info->irq_spinlock,flags); - cnow = info->icount; - spin_unlock_irqrestore(&info->irq_spinlock,flags); - p_cuser = argp; - PUT_USER(error,cnow.cts, &p_cuser->cts); - if (error) return error; - PUT_USER(error,cnow.dsr, &p_cuser->dsr); - if (error) return error; - PUT_USER(error,cnow.rng, &p_cuser->rng); - if (error) return error; - PUT_USER(error,cnow.dcd, &p_cuser->dcd); - if (error) return error; - PUT_USER(error,cnow.rx, &p_cuser->rx); - if (error) return error; - PUT_USER(error,cnow.tx, &p_cuser->tx); - if (error) return error; - PUT_USER(error,cnow.frame, &p_cuser->frame); - if (error) return error; - PUT_USER(error,cnow.overrun, &p_cuser->overrun); - if (error) return error; - PUT_USER(error,cnow.parity, &p_cuser->parity); - if (error) return error; - PUT_USER(error,cnow.brk, &p_cuser->brk); - if (error) return error; - PUT_USER(error,cnow.buf_overrun, &p_cuser->buf_overrun); - if (error) return error; - return 0; default: return -ENOIOCTLCMD; } @@ -4369,6 +4363,7 @@ .hangup = mgsl_hangup, .tiocmget = tiocmget, .tiocmset = tiocmset, + .get_icount = msgl_get_icount, }; /* --- linux-2.6.24.orig/drivers/char/random.c +++ linux-2.6.24/drivers/char/random.c @@ -1302,334 +1302,14 @@ }; #endif /* CONFIG_SYSCTL */ -/******************************************************************** - * - * Random funtions for networking - * - ********************************************************************/ +static u32 random_int_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned; -/* - * TCP initial sequence number picking. This uses the random number - * generator to pick an initial secret value. This value is hashed - * along with the TCP endpoint information to provide a unique - * starting point for each pair of TCP endpoints. This defeats - * attacks which rely on guessing the initial TCP sequence number. - * This algorithm was suggested by Steve Bellovin. - * - * Using a very strong hash was taking an appreciable amount of the total - * TCP connection establishment time, so this is a weaker hash, - * compensated for by changing the secret periodically. - */ - -/* F, G and H are basic MD4 functions: selection, majority, parity */ -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) (((x) & (y)) + (((x) ^ (y)) & (z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) - -/* - * The generic round function. The application is so specific that - * we don't bother protecting all the arguments with parens, as is generally - * good macro practice, in favor of extra legibility. - * Rotation is separate from addition to prevent recomputation - */ -#define ROUND(f, a, b, c, d, x, s) \ - (a += f(b, c, d) + x, a = (a << s) | (a >> (32 - s))) -#define K1 0 -#define K2 013240474631UL -#define K3 015666365641UL - -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - -static __u32 twothirdsMD4Transform (__u32 const buf[4], __u32 const in[12]) +static int __init random_int_secret_init(void) { - __u32 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; - - /* Round 1 */ - ROUND(F, a, b, c, d, in[ 0] + K1, 3); - ROUND(F, d, a, b, c, in[ 1] + K1, 7); - ROUND(F, c, d, a, b, in[ 2] + K1, 11); - ROUND(F, b, c, d, a, in[ 3] + K1, 19); - ROUND(F, a, b, c, d, in[ 4] + K1, 3); - ROUND(F, d, a, b, c, in[ 5] + K1, 7); - ROUND(F, c, d, a, b, in[ 6] + K1, 11); - ROUND(F, b, c, d, a, in[ 7] + K1, 19); - ROUND(F, a, b, c, d, in[ 8] + K1, 3); - ROUND(F, d, a, b, c, in[ 9] + K1, 7); - ROUND(F, c, d, a, b, in[10] + K1, 11); - ROUND(F, b, c, d, a, in[11] + K1, 19); - - /* Round 2 */ - ROUND(G, a, b, c, d, in[ 1] + K2, 3); - ROUND(G, d, a, b, c, in[ 3] + K2, 5); - ROUND(G, c, d, a, b, in[ 5] + K2, 9); - ROUND(G, b, c, d, a, in[ 7] + K2, 13); - ROUND(G, a, b, c, d, in[ 9] + K2, 3); - ROUND(G, d, a, b, c, in[11] + K2, 5); - ROUND(G, c, d, a, b, in[ 0] + K2, 9); - ROUND(G, b, c, d, a, in[ 2] + K2, 13); - ROUND(G, a, b, c, d, in[ 4] + K2, 3); - ROUND(G, d, a, b, c, in[ 6] + K2, 5); - ROUND(G, c, d, a, b, in[ 8] + K2, 9); - ROUND(G, b, c, d, a, in[10] + K2, 13); - - /* Round 3 */ - ROUND(H, a, b, c, d, in[ 3] + K3, 3); - ROUND(H, d, a, b, c, in[ 7] + K3, 9); - ROUND(H, c, d, a, b, in[11] + K3, 11); - ROUND(H, b, c, d, a, in[ 2] + K3, 15); - ROUND(H, a, b, c, d, in[ 6] + K3, 3); - ROUND(H, d, a, b, c, in[10] + K3, 9); - ROUND(H, c, d, a, b, in[ 1] + K3, 11); - ROUND(H, b, c, d, a, in[ 5] + K3, 15); - ROUND(H, a, b, c, d, in[ 9] + K3, 3); - ROUND(H, d, a, b, c, in[ 0] + K3, 9); - ROUND(H, c, d, a, b, in[ 4] + K3, 11); - ROUND(H, b, c, d, a, in[ 8] + K3, 15); - - return buf[1] + b; /* "most hashed" word */ - /* Alternative: return sum of all words? */ -} -#endif - -#undef ROUND -#undef F -#undef G -#undef H -#undef K1 -#undef K2 -#undef K3 - -/* This should not be decreased so low that ISNs wrap too fast. */ -#define REKEY_INTERVAL (300 * HZ) -/* - * Bit layout of the tcp sequence numbers (before adding current time): - * bit 24-31: increased after every key exchange - * bit 0-23: hash(source,dest) - * - * The implementation is similar to the algorithm described - * in the Appendix of RFC 1185, except that - * - it uses a 1 MHz clock instead of a 250 kHz clock - * - it performs a rekey every 5 minutes, which is equivalent - * to a (source,dest) tulple dependent forward jump of the - * clock by 0..2^(HASH_BITS+1) - * - * Thus the average ISN wraparound time is 68 minutes instead of - * 4.55 hours. - * - * SMP cleanup and lock avoidance with poor man's RCU. - * Manfred Spraul - * - */ -#define COUNT_BITS 8 -#define COUNT_MASK ((1 << COUNT_BITS) - 1) -#define HASH_BITS 24 -#define HASH_MASK ((1 << HASH_BITS) - 1) - -static struct keydata { - __u32 count; /* already shifted to the final position */ - __u32 secret[12]; -} ____cacheline_aligned ip_keydata[2]; - -static unsigned int ip_cnt; - -static void rekey_seq_generator(struct work_struct *work); - -static DECLARE_DELAYED_WORK(rekey_work, rekey_seq_generator); - -/* - * Lock avoidance: - * The ISN generation runs lockless - it's just a hash over random data. - * State changes happen every 5 minutes when the random key is replaced. - * Synchronization is performed by having two copies of the hash function - * state and rekey_seq_generator always updates the inactive copy. - * The copy is then activated by updating ip_cnt. - * The implementation breaks down if someone blocks the thread - * that processes SYN requests for more than 5 minutes. Should never - * happen, and even if that happens only a not perfectly compliant - * ISN is generated, nothing fatal. - */ -static void rekey_seq_generator(struct work_struct *work) -{ - struct keydata *keyptr = &ip_keydata[1 ^ (ip_cnt & 1)]; - - get_random_bytes(keyptr->secret, sizeof(keyptr->secret)); - keyptr->count = (ip_cnt & COUNT_MASK) << HASH_BITS; - smp_wmb(); - ip_cnt++; - schedule_delayed_work(&rekey_work, REKEY_INTERVAL); -} - -static inline struct keydata *get_keyptr(void) -{ - struct keydata *keyptr = &ip_keydata[ip_cnt & 1]; - - smp_rmb(); - - return keyptr; -} - -static __init int seqgen_init(void) -{ - rekey_seq_generator(NULL); + get_random_bytes(random_int_secret, sizeof(random_int_secret)); return 0; } -late_initcall(seqgen_init); - -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -__u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, - __be16 sport, __be16 dport) -{ - __u32 seq; - __u32 hash[12]; - struct keydata *keyptr = get_keyptr(); - - /* The procedure is the same as for IPv4, but addresses are longer. - * Thus we must use twothirdsMD4Transform. - */ - - memcpy(hash, saddr, 16); - hash[4]=((__force u16)sport << 16) + (__force u16)dport; - memcpy(&hash[5],keyptr->secret,sizeof(__u32) * 7); - - seq = twothirdsMD4Transform((const __u32 *)daddr, hash) & HASH_MASK; - seq += keyptr->count; - - seq += ktime_to_ns(ktime_get_real()); - - return seq; -} -EXPORT_SYMBOL(secure_tcpv6_sequence_number); -#endif - -/* The code below is shamelessly stolen from secure_tcp_sequence_number(). - * All blames to Andrey V. Savochkin . - */ -__u32 secure_ip_id(__be32 daddr) -{ - struct keydata *keyptr; - __u32 hash[4]; - - keyptr = get_keyptr(); - - /* - * Pick a unique starting offset for each IP destination. - * The dest ip address is placed in the starting vector, - * which is then hashed with random data. - */ - hash[0] = (__force __u32)daddr; - hash[1] = keyptr->secret[9]; - hash[2] = keyptr->secret[10]; - hash[3] = keyptr->secret[11]; - - return half_md4_transform(hash, keyptr->secret); -} - -#ifdef CONFIG_INET - -__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, - __be16 sport, __be16 dport) -{ - __u32 seq; - __u32 hash[4]; - struct keydata *keyptr = get_keyptr(); - - /* - * Pick a unique starting offset for each TCP connection endpoints - * (saddr, daddr, sport, dport). - * Note that the words are placed into the starting vector, which is - * then mixed with a partial MD4 over random data. - */ - hash[0]=(__force u32)saddr; - hash[1]=(__force u32)daddr; - hash[2]=((__force u16)sport << 16) + (__force u16)dport; - hash[3]=keyptr->secret[11]; - - seq = half_md4_transform(hash, keyptr->secret) & HASH_MASK; - seq += keyptr->count; - /* - * As close as possible to RFC 793, which - * suggests using a 250 kHz clock. - * Further reading shows this assumes 2 Mb/s networks. - * For 10 Mb/s Ethernet, a 1 MHz clock is appropriate. - * For 10 Gb/s Ethernet, a 1 GHz clock should be ok, but - * we also need to limit the resolution so that the u32 seq - * overlaps less than one time per MSL (2 minutes). - * Choosing a clock of 64 ns period is OK. (period of 274 s) - */ - seq += ktime_to_ns(ktime_get_real()) >> 6; -#if 0 - printk("init_seq(%lx, %lx, %d, %d) = %d\n", - saddr, daddr, sport, dport, seq); -#endif - return seq; -} - -/* Generate secure starting point for ephemeral IPV4 transport port search */ -u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport) -{ - struct keydata *keyptr = get_keyptr(); - u32 hash[4]; - - /* - * Pick a unique starting offset for each ephemeral port search - * (saddr, daddr, dport) and 48bits of random data. - */ - hash[0] = (__force u32)saddr; - hash[1] = (__force u32)daddr; - hash[2] = (__force u32)dport ^ keyptr->secret[10]; - hash[3] = keyptr->secret[11]; - - return half_md4_transform(hash, keyptr->secret); -} - -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, __be16 dport) -{ - struct keydata *keyptr = get_keyptr(); - u32 hash[12]; - - memcpy(hash, saddr, 16); - hash[4] = (__force u32)dport; - memcpy(&hash[5],keyptr->secret,sizeof(__u32) * 7); - - return twothirdsMD4Transform((const __u32 *)daddr, hash); -} -#endif - -#if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE) -/* Similar to secure_tcp_sequence_number but generate a 48 bit value - * bit's 32-47 increase every key exchange - * 0-31 hash(source, dest) - */ -u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, - __be16 sport, __be16 dport) -{ - u64 seq; - __u32 hash[4]; - struct keydata *keyptr = get_keyptr(); - - hash[0] = (__force u32)saddr; - hash[1] = (__force u32)daddr; - hash[2] = ((__force u16)sport << 16) + (__force u16)dport; - hash[3] = keyptr->secret[11]; - - seq = half_md4_transform(hash, keyptr->secret); - seq |= ((u64)keyptr->count) << (32 - HASH_BITS); - - seq += ktime_to_ns(ktime_get_real()); - seq &= (1ull << 48) - 1; -#if 0 - printk("dccp init_seq(%lx, %lx, %d, %d) = %d\n", - saddr, daddr, sport, dport, seq); -#endif - return seq; -} - -EXPORT_SYMBOL(secure_dccp_sequence_number); -#endif - -#endif /* CONFIG_INET */ - +late_initcall(random_int_secret_init); /* * Get a random word for internal kernel use only. Similar to urandom but @@ -1637,15 +1317,18 @@ * value is not cryptographically secure but for several uses the cost of * depleting entropy is too high */ +DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash); unsigned int get_random_int(void) { - /* - * Use IP's RNG. It suits our purpose perfectly: it re-keys itself - * every second, from the entropy pool (and thus creates a limited - * drain on it), and uses halfMD4Transform within the second. We - * also mix it with jiffies and the PID: - */ - return secure_ip_id((__force __be32)(current->pid + jiffies)); + __u32 *hash = get_cpu_var(get_random_int_hash); + unsigned int ret; + + hash[0] += current->pid + jiffies + get_cycles(); + md5_transform(hash, random_int_secret); + ret = hash[0]; + put_cpu_var(get_random_int_hash); + + return ret; } /* --- linux-2.6.24.orig/drivers/char/vt.c +++ linux-2.6.24/drivers/char/vt.c @@ -264,6 +264,10 @@ #define DO_UPDATE(vc) CON_IS_VISIBLE(vc) #endif +#ifdef CONFIG_PROM_CONSOLE +static int force_prom_console; +#endif + static inline unsigned short *screenpos(struct vc_data *vc, int offset, int viewed) { unsigned short *p; @@ -702,6 +706,7 @@ if (is_switch) { set_leds(); compute_shiftstate(); + notify_update(vc); } } @@ -2882,6 +2887,17 @@ .unthrottle = con_unthrottle, }; +#ifdef CONFIG_PROM_CONSOLE +static int __init check_prom_console(char *str) +{ + force_prom_console = 1; + printk ("PROM console forced!\n"); + return 1; +} + +__setup("forcepromconsole", check_prom_console); +#endif + int __init vty_init(void) { vcs_init(); @@ -2904,7 +2920,8 @@ kbd_init(); console_map_init(); #ifdef CONFIG_PROM_CONSOLE - prom_con_init(); + if (force_prom_console) + prom_con_init(); #endif #ifdef CONFIG_MDA_CONSOLE mda_console_init(); --- linux-2.6.24.orig/drivers/char/keyboard.c +++ linux-2.6.24/drivers/char/keyboard.c @@ -1067,6 +1067,8 @@ int code; switch (keycode) { + case KEY_RESERVED: + break; case KEY_PAUSE: put_queue(vc, 0xe1); put_queue(vc, 0x1d | up_flag); @@ -1126,6 +1128,8 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char up_flag) { + if (keycode == KEY_RESERVED) + return 0; if (keycode > 127) return -1; --- linux-2.6.24.orig/drivers/char/amiserial.c +++ linux-2.6.24/drivers/char/amiserial.c @@ -1255,6 +1255,36 @@ local_irq_restore(flags); } +/* + * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) + * Return: write counters to the user passed counter struct + * NB: both 1->0 and 0->1 transitions are counted except for + * RI where only 0->1 is counted. + */ +static int rs_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) +{ + struct async_struct *info = tty->driver_data; + struct async_icount cnow; + unsigned long flags; + + local_irq_save(flags); + cnow = info->state->icount; + local_irq_restore(flags); + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + icount->rx = cnow.rx; + icount->tx = cnow.tx; + icount->frame = cnow.frame; + icount->overrun = cnow.overrun; + icount->parity = cnow.parity; + icount->brk = cnow.brk; + icount->buf_overrun = cnow.buf_overrun; + + return 0; +} static int rs_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) @@ -1324,31 +1354,6 @@ } /* NOTREACHED */ - /* - * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for - * RI where only 0->1 is counted. - */ - case TIOCGICOUNT: - local_irq_save(flags); - cnow = info->state->icount; - local_irq_restore(flags); - icount.cts = cnow.cts; - icount.dsr = cnow.dsr; - icount.rng = cnow.rng; - icount.dcd = cnow.dcd; - icount.rx = cnow.rx; - icount.tx = cnow.tx; - icount.frame = cnow.frame; - icount.overrun = cnow.overrun; - icount.parity = cnow.parity; - icount.brk = cnow.brk; - icount.buf_overrun = cnow.buf_overrun; - - if (copy_to_user(argp, &icount, sizeof(icount))) - return -EFAULT; - return 0; case TIOCSERGWILD: case TIOCSERSWILD: /* "setserial -W" is called in Debian boot */ @@ -1947,6 +1952,7 @@ .read_proc = rs_read_proc, .tiocmget = rs_tiocmget, .tiocmset = rs_tiocmset, + .get_icount = rs_get_icount, }; /* --- linux-2.6.24.orig/drivers/char/vt_ioctl.c +++ linux-2.6.24/drivers/char/vt_ioctl.c @@ -35,6 +35,8 @@ #include #include +#define max_font_size 65536 + char vt_dont_switch; extern struct tty_driver *console_driver; @@ -1166,6 +1168,7 @@ static void complete_change_console(struct vc_data *vc) { unsigned char old_vc_mode; + struct vc_data *oldvc = vc_cons[fg_console].d; last_console = fg_console; @@ -1174,9 +1177,31 @@ * KD_TEXT mode or vice versa, which means we need to blank or * unblank the screen later. */ - old_vc_mode = vc_cons[fg_console].d->vc_mode; + old_vc_mode = oldvc->vc_mode; + +#if defined(CONFIG_VGA_CONSOLE) + if (old_vc_mode == KD_TEXT && oldvc->vc_sw == &vga_con && + oldvc->vc_sw->con_font_get) { + if (!oldvc->vc_font.data) + oldvc->vc_font.data = kmalloc(max_font_size, + GFP_KERNEL); + lock_kernel(); + oldvc->vc_sw->con_font_get(oldvc, &oldvc->vc_font); + unlock_kernel(); + } +#endif switch_screen(vc); +#if defined(CONFIG_VGA_CONSOLE) + if (vc->vc_mode == KD_TEXT && vc->vc_sw == &vga_con && + vc->vc_sw->con_font_set) { + if (vc->vc_font.data) { + lock_kernel(); + vc->vc_sw->con_font_set(vc, &vc->vc_font, 0); + unlock_kernel(); + } + } +#endif /* * This can't appear below a successful kill_pid(). If it did, * then the *blank_screen operation could occur while X, having --- linux-2.6.24.orig/drivers/char/mxser.c +++ linux-2.6.24/drivers/char/mxser.c @@ -448,6 +448,9 @@ /* above is modified by Victor Yu. 08-15-2002 */ +static int mxser_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount); + static const struct tty_operations mxser_ops = { .open = mxser_open, .close = mxser_close, @@ -468,6 +471,7 @@ .wait_until_sent = mxser_wait_until_sent, .tiocmget = mxser_tiocmget, .tiocmset = mxser_tiocmset, + .get_icount = mxser_get_icount, }; /* @@ -1352,37 +1356,6 @@ ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts)); })); break; - /* - * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for - * RI where only 0->1 is counted. - */ - case TIOCGICOUNT: - spin_lock_irqsave(&info->slock, flags); - cnow = info->icount; - spin_unlock_irqrestore(&info->slock, flags); - p_cuser = argp; - /* modified by casper 1/11/2000 */ - if (put_user(cnow.frame, &p_cuser->frame)) - return -EFAULT; - if (put_user(cnow.brk, &p_cuser->brk)) - return -EFAULT; - if (put_user(cnow.overrun, &p_cuser->overrun)) - return -EFAULT; - if (put_user(cnow.buf_overrun, &p_cuser->buf_overrun)) - return -EFAULT; - if (put_user(cnow.parity, &p_cuser->parity)) - return -EFAULT; - if (put_user(cnow.rx, &p_cuser->rx)) - return -EFAULT; - if (put_user(cnow.tx, &p_cuser->tx)) - return -EFAULT; - put_user(cnow.cts, &p_cuser->cts); - put_user(cnow.dsr, &p_cuser->dsr); - put_user(cnow.rng, &p_cuser->rng); - put_user(cnow.dcd, &p_cuser->dcd); - return 0; case MOXA_HighSpeedOn: return put_user(info->baud_base != 115200 ? 1 : 0, (int __user *)argp); case MOXA_SDS_RSTICOUNTER: { @@ -1625,6 +1598,39 @@ return 0; } + /* + * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) + * Return: write counters to the user passed counter struct + * NB: both 1->0 and 0->1 transitions are counted except for + * RI where only 0->1 is counted. + */ + +static int mxser_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) + +{ + struct mxser_port *info = tty->driver_data; + struct async_icount cnow; + unsigned long flags; + + spin_lock_irqsave(&info->slock, flags); + cnow = info->icount; + spin_unlock_irqrestore(&info->slock, flags); + + icount->frame = cnow.frame; + icount->brk = cnow.brk; + icount->overrun = cnow.overrun; + icount->buf_overrun = cnow.buf_overrun; + icount->parity = cnow.parity; + icount->rx = cnow.rx; + icount->tx = cnow.tx; + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + return 0; +} + static void mxser_stoprx(struct tty_struct *tty) { struct mxser_struct *info = tty->driver_data; --- linux-2.6.24.orig/drivers/char/cyclades.c +++ linux-2.6.24/drivers/char/cyclades.c @@ -3975,52 +3975,6 @@ })); break; - /* - * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for - * RI where only 0->1 is counted. - */ - case TIOCGICOUNT: - spin_lock_irqsave(&info->card->card_lock, flags); - cnow = info->icount; - spin_unlock_irqrestore(&info->card->card_lock, flags); - p_cuser = argp; - ret_val = put_user(cnow.cts, &p_cuser->cts); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.dsr, &p_cuser->dsr); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.rng, &p_cuser->rng); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.dcd, &p_cuser->dcd); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.rx, &p_cuser->rx); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.tx, &p_cuser->tx); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.frame, &p_cuser->frame); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.overrun, &p_cuser->overrun); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.parity, &p_cuser->parity); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.brk, &p_cuser->brk); - if (ret_val) - return ret_val; - ret_val = put_user(cnow.buf_overrun, &p_cuser->buf_overrun); - if (ret_val) - return ret_val; - ret_val = 0; - break; default: ret_val = -ENOIOCTLCMD; } @@ -4032,6 +3986,31 @@ return ret_val; } /* cy_ioctl */ +static int cy_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *sic) +{ + struct cyclades_port *info = tty->driver_data; + struct cyclades_icount cnow; /* Used to snapshot */ + unsigned long flags; + + spin_lock_irqsave(&info->card->card_lock, flags); + cnow = info->icount; + spin_unlock_irqrestore(&info->card->card_lock, flags); + + sic->cts = cnow.cts; + sic->dsr = cnow.dsr; + sic->rng = cnow.rng; + sic->dcd = cnow.dcd; + sic->rx = cnow.rx; + sic->tx = cnow.tx; + sic->frame = cnow.frame; + sic->overrun = cnow.overrun; + sic->parity = cnow.parity; + sic->brk = cnow.brk; + sic->buf_overrun = cnow.buf_overrun; + return 0; +} + /* * This routine allows the tty driver to be notified when * device's termios settings have changed. Note that a @@ -5312,6 +5291,7 @@ .read_proc = cyclades_get_proc_info, .tiocmget = cy_tiocmget, .tiocmset = cy_tiocmset, + .get_icount = cy_get_icount, }; static int __init cy_init(void) --- linux-2.6.24.orig/drivers/char/agp/generic.c +++ linux-2.6.24/drivers/char/agp/generic.c @@ -116,6 +116,9 @@ struct agp_memory *new; unsigned long alloc_size = num_agp_pages*sizeof(struct page *); + if (INT_MAX/sizeof(struct page *) < num_agp_pages) + return NULL; + new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL); if (new == NULL) return NULL; @@ -227,11 +230,14 @@ int scratch_pages; struct agp_memory *new; size_t i; + int cur_memory; if (!bridge) return NULL; - if ((atomic_read(&bridge->current_memory_agp) + page_count) > bridge->max_memory_agp) + cur_memory = atomic_read(&bridge->current_memory_agp); + if ((cur_memory + page_count > bridge->max_memory_agp) || + (cur_memory + page_count < page_count)) return NULL; if (type >= AGP_USER_TYPES) { @@ -1058,8 +1064,8 @@ return -EINVAL; } - /* AK: could wrap */ - if ((pg_start + mem->page_count) > num_entries) + if (((pg_start + mem->page_count) > num_entries) || + ((pg_start + mem->page_count) < pg_start)) return -EINVAL; j = pg_start; @@ -1091,7 +1097,7 @@ { size_t i; struct agp_bridge_data *bridge; - int mask_type; + int mask_type, num_entries; bridge = mem->bridge; if (!bridge) @@ -1103,6 +1109,11 @@ if (type != mem->type) return -EINVAL; + num_entries = agp_num_entries(); + if (((pg_start + mem->page_count) > num_entries) || + ((pg_start + mem->page_count) < pg_start)) + return -EINVAL; + mask_type = bridge->driver->agp_type_to_mask_type(bridge, type); if (mask_type != 0) { /* The generic routines know nothing of memory types */ @@ -1166,7 +1177,7 @@ { struct page * page; - page = alloc_page(GFP_KERNEL | GFP_DMA32); + page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO ); if (page == NULL) return NULL; --- linux-2.6.24.orig/drivers/char/agp/via-agp.c +++ linux-2.6.24/drivers/char/agp/via-agp.c @@ -548,6 +548,7 @@ ID(PCI_DEVICE_ID_VIA_VT3324), ID(PCI_DEVICE_ID_VIA_VT3336), ID(PCI_DEVICE_ID_VIA_P4M890), + ID(PCI_DEVICE_ID_VIA_VT3364), { } }; --- linux-2.6.24.orig/drivers/char/agp/ati-agp.c +++ linux-2.6.24/drivers/char/agp/ati-agp.c @@ -468,6 +468,10 @@ .chipset_name = "IGP9100/M", }, { + .device_id = PCI_DEVICE_ID_ATI_RS350_133, + .chipset_name = "IGP9000/M", + }, + { .device_id = PCI_DEVICE_ID_ATI_RS350_200, .chipset_name = "IGP9100/M", }, --- linux-2.6.24.orig/drivers/char/ip2/ip2main.c +++ linux-2.6.24/drivers/char/ip2/ip2main.c @@ -187,6 +187,8 @@ static int ip2_tiocmget(struct tty_struct *tty, struct file *file); static int ip2_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear); +static int ip2_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount); static void set_irq(int, int); static void ip2_interrupt_bh(struct work_struct *work); @@ -476,6 +478,7 @@ .read_proc = ip2_read_proc, .tiocmget = ip2_tiocmget, .tiocmset = ip2_tiocmset, + .get_icount = ip2_get_icount, }; /******************************************************************************/ @@ -2087,7 +2090,6 @@ i2ChanStrPtr pCh = DevTable[tty->index]; i2eBordStrPtr pB; struct async_icount cprev, cnow; /* kernel counter temps */ - struct serial_icounter_struct __user *p_cuser; int rc = 0; unsigned long flags; void __user *argp = (void __user *)arg; @@ -2256,34 +2258,6 @@ break; /* - * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for RI where - * only 0->1 is counted. The controller is quite capable of counting - * both, but this done to preserve compatibility with the standard - * serial driver. - */ - case TIOCGICOUNT: - ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc ); - - WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); - cnow = pCh->icount; - WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); - p_cuser = argp; - rc = put_user(cnow.cts, &p_cuser->cts); - rc = put_user(cnow.dsr, &p_cuser->dsr); - rc = put_user(cnow.rng, &p_cuser->rng); - rc = put_user(cnow.dcd, &p_cuser->dcd); - rc = put_user(cnow.rx, &p_cuser->rx); - rc = put_user(cnow.tx, &p_cuser->tx); - rc = put_user(cnow.frame, &p_cuser->frame); - rc = put_user(cnow.overrun, &p_cuser->overrun); - rc = put_user(cnow.parity, &p_cuser->parity); - rc = put_user(cnow.brk, &p_cuser->brk); - rc = put_user(cnow.buf_overrun, &p_cuser->buf_overrun); - break; - - /* * The rest are not supported by this driver. By returning -ENOIOCTLCMD they * will be passed to the line discipline for it to handle. */ @@ -2307,6 +2281,46 @@ return rc; } +static int ip2_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) +{ + i2ChanStrPtr pCh = DevTable[tty->index]; + i2eBordStrPtr pB; + struct async_icount cnow; /* kernel counter temp */ + unsigned long flags; + + if ( pCh == NULL ) + return -ENODEV; + + pB = pCh->pMyBord; + + /* + * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) + * Return: write counters to the user passed counter struct + * NB: both 1->0 and 0->1 transitions are counted except for RI where + * only 0->1 is counted. The controller is quite capable of counting + * both, but this done to preserve compatibility with the standard + * serial driver. + */ + + write_lock_irqsave(&pB->read_fifo_spinlock, flags); + cnow = pCh->icount; + write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); + + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + icount->rx = cnow.rx; + icount->tx = cnow.tx; + icount->frame = cnow.frame; + icount->overrun = cnow.overrun; + icount->parity = cnow.parity; + icount->brk = cnow.brk; + icount->buf_overrun = cnow.buf_overrun; + return 0; +} + /******************************************************************************/ /* Function: GetSerialInfo() */ /* Parameters: Pointer to channel structure */ --- linux-2.6.24.orig/drivers/char/tpm/tpm.c +++ linux-2.6.24/drivers/char/tpm/tpm.c @@ -922,7 +922,7 @@ spin_unlock(&driver_lock); - chip->data_buffer = kmalloc(TPM_BUFSIZE * sizeof(u8), GFP_KERNEL); + chip->data_buffer = kzalloc(TPM_BUFSIZE, GFP_KERNEL); if (chip->data_buffer == NULL) { chip->num_opens--; put_device(chip->dev); @@ -997,6 +997,7 @@ { struct tpm_chip *chip = file->private_data; int ret_size; + int rc; del_singleshot_timer_sync(&chip->user_read_timer); flush_scheduled_work(); @@ -1007,8 +1008,11 @@ ret_size = size; mutex_lock(&chip->buffer_mutex); - if (copy_to_user(buf, chip->data_buffer, ret_size)) + rc = copy_to_user(buf, chip->data_buffer, ret_size); + memset(chip->data_buffer, 0, ret_size); + if (rc) ret_size = -EFAULT; + mutex_unlock(&chip->buffer_mutex); } --- linux-2.6.24.orig/drivers/char/pcmcia/synclink_cs.c +++ linux-2.6.24/drivers/char/pcmcia/synclink_cs.c @@ -2263,6 +2263,32 @@ spin_unlock_irqrestore(&info->lock,flags); } +static int mgslpc_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) +{ + MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data; + struct mgsl_icount cnow; /* kernel counter temps */ + unsigned long flags; + + spin_lock_irqsave(&info->lock,flags); + cnow = info->icount; + spin_unlock_irqrestore(&info->lock,flags); + + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + icount->rx = cnow.rx; + icount->tx = cnow.tx; + icount->frame = cnow.frame; + icount->overrun = cnow.overrun; + icount->parity = cnow.parity; + icount->brk = cnow.brk; + icount->buf_overrun = cnow.buf_overrun; + + return 0; +} + /* Service an IOCTL request * * Arguments: @@ -2287,7 +2313,7 @@ return -ENODEV; if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && - (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { + (cmd != TIOCMIWAIT)) { if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; } @@ -2328,34 +2354,6 @@ return wait_events(info, argp); case TIOCMIWAIT: return modem_input_wait(info,(int)arg); - case TIOCGICOUNT: - spin_lock_irqsave(&info->lock,flags); - cnow = info->icount; - spin_unlock_irqrestore(&info->lock,flags); - p_cuser = argp; - PUT_USER(error,cnow.cts, &p_cuser->cts); - if (error) return error; - PUT_USER(error,cnow.dsr, &p_cuser->dsr); - if (error) return error; - PUT_USER(error,cnow.rng, &p_cuser->rng); - if (error) return error; - PUT_USER(error,cnow.dcd, &p_cuser->dcd); - if (error) return error; - PUT_USER(error,cnow.rx, &p_cuser->rx); - if (error) return error; - PUT_USER(error,cnow.tx, &p_cuser->tx); - if (error) return error; - PUT_USER(error,cnow.frame, &p_cuser->frame); - if (error) return error; - PUT_USER(error,cnow.overrun, &p_cuser->overrun); - if (error) return error; - PUT_USER(error,cnow.parity, &p_cuser->parity); - if (error) return error; - PUT_USER(error,cnow.brk, &p_cuser->brk); - if (error) return error; - PUT_USER(error,cnow.buf_overrun, &p_cuser->buf_overrun); - if (error) return error; - return 0; default: return -ENOIOCTLCMD; } --- linux-2.6.24.orig/drivers/char/drm/drm_drv.c +++ linux-2.6.24/drivers/char/drm/drm_drv.c @@ -386,19 +386,19 @@ DRM_INFO("Initialized %s %d.%d.%d %s\n", CORE_NAME, CORE_MAJOR, CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE); return 0; - err_p3: - drm_sysfs_destroy(drm_class); - err_p2: +err_p3: + drm_sysfs_destroy(); +err_p2: unregister_chrdev(DRM_MAJOR, "drm"); drm_free(drm_heads, sizeof(*drm_heads) * drm_cards_limit, DRM_MEM_STUB); - err_p1: +err_p1: return ret; } static void __exit drm_core_exit(void) { remove_proc_entry("dri", NULL); - drm_sysfs_destroy(drm_class); + drm_sysfs_destroy(); unregister_chrdev(DRM_MAJOR, "drm"); --- linux-2.6.24.orig/drivers/char/drm/drm_pciids.h +++ linux-2.6.24/drivers/char/drm/drm_pciids.h @@ -240,10 +240,17 @@ {0x1106, 0x3108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x1106, 0x3344, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x1106, 0x3343, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1106, 0x3230, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VIA_DX9_0}, \ {0x1106, 0x3157, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VIA_PRO_GROUP_A}, \ {0, 0, 0} + +#define via_chrome9DRV_PCI_IDS \ + {0x1106, 0x3225, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x1106, 0x3230, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VIA_CHROME9_DX9_0}, \ + {0x1106, 0x3371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x1106, 0x1122, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VIA_CHROME9_PCIE_GROUP},\ + {0, 0, 0} + #define i810_PCI_IDS \ {0x8086, 0x7121, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x7123, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ @@ -311,5 +318,6 @@ {0x8086, 0x29d2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2a02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2a12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x8086, 0x2a42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0, 0, 0} --- linux-2.6.24.orig/drivers/char/drm/drm_sysfs.c +++ linux-2.6.24/drivers/char/drm/drm_sysfs.c @@ -19,6 +19,43 @@ #include "drm_core.h" #include "drmP.h" +#define to_drm_device(d) container_of(d, struct drm_device, dev) + +/** + * drm_sysfs_suspend - DRM class suspend hook + * @dev: Linux device to suspend + * @state: power state to enter + * + * Just figures out what the actual struct drm_device associated with + * @dev is and calls its suspend hook, if present. + */ +static int drm_sysfs_suspend(struct device *dev, pm_message_t state) +{ + struct drm_device *drm_dev = to_drm_device(dev); + + if (drm_dev->driver->suspend) + return drm_dev->driver->suspend(drm_dev, state); + + return 0; +} + +/** + * drm_sysfs_resume - DRM class resume hook + * @dev: Linux device to resume + * + * Just figures out what the actual struct drm_device associated with + * @dev is and calls its resume hook, if present. + */ +static int drm_sysfs_resume(struct device *dev) +{ + struct drm_device *drm_dev = to_drm_device(dev); + + if (drm_dev->driver->resume) + return drm_dev->driver->resume(drm_dev); + + return 0; +} + /* Display the version of drm_core. This doesn't work right in current design */ static ssize_t version_show(struct class *dev, char *buf) { @@ -33,7 +70,7 @@ * @owner: pointer to the module that is to "own" this struct drm_sysfs_class * @name: pointer to a string for the name of this class. * - * This is used to create a struct drm_sysfs_class pointer that can then be used + * This is used to create DRM class pointer that can then be used * in calls to drm_sysfs_device_add(). * * Note, the pointer created here is to be destroyed when finished by making a @@ -50,6 +87,9 @@ goto err_out; } + class->suspend = drm_sysfs_suspend; + class->resume = drm_sysfs_resume; + err = class_create_file(class, &class_attr_version); if (err) goto err_out_class; @@ -63,94 +103,105 @@ } /** - * drm_sysfs_destroy - destroys a struct drm_sysfs_class structure - * @cs: pointer to the struct drm_sysfs_class that is to be destroyed + * drm_sysfs_destroy - destroys DRM class * - * Note, the pointer to be destroyed must have been created with a call to - * drm_sysfs_create(). + * Destroy the DRM device class. */ -void drm_sysfs_destroy(struct class *class) +void drm_sysfs_destroy(void) { - if ((class == NULL) || (IS_ERR(class))) + if ((drm_class == NULL) || (IS_ERR(drm_class))) return; - - class_remove_file(class, &class_attr_version); - class_destroy(class); + class_remove_file(drm_class, &class_attr_version); + class_destroy(drm_class); } -static ssize_t show_dri(struct class_device *class_device, char *buf) +static ssize_t show_dri(struct device *device, struct device_attribute *attr, + char *buf) { - struct drm_device * dev = ((struct drm_head *)class_get_devdata(class_device))->dev; + struct drm_device *dev = to_drm_device(device); if (dev->driver->dri_library_name) return dev->driver->dri_library_name(dev, buf); return snprintf(buf, PAGE_SIZE, "%s\n", dev->driver->pci_driver.name); } -static struct class_device_attribute class_device_attrs[] = { +static struct device_attribute device_attrs[] = { __ATTR(dri_library_name, S_IRUGO, show_dri, NULL), }; /** + * drm_sysfs_device_release - do nothing + * @dev: Linux device + * + * Normally, this would free the DRM device associated with @dev, along + * with cleaning up any other stuff. But we do that in the DRM core, so + * this function can just return and hope that the core does its job. + */ +static void drm_sysfs_device_release(struct device *dev) +{ + return; +} + +/** * drm_sysfs_device_add - adds a class device to sysfs for a character driver - * @cs: pointer to the struct class that this device should be registered to. - * @dev: the dev_t for the device to be added. - * @device: a pointer to a struct device that is assiociated with this class device. - * @fmt: string for the class device's name - * - * A struct class_device will be created in sysfs, registered to the specified - * class. A "dev" file will be created, showing the dev_t for the device. The - * pointer to the struct class_device will be returned from the call. Any further - * sysfs files that might be required can be created using this pointer. - * Note: the struct class passed to this function must have previously been - * created with a call to drm_sysfs_create(). - */ -struct class_device *drm_sysfs_device_add(struct class *cs, struct drm_head *head) -{ - struct class_device *class_dev; - int i, j, err; - - class_dev = class_device_create(cs, NULL, - MKDEV(DRM_MAJOR, head->minor), - &(head->dev->pdev)->dev, - "card%d", head->minor); - if (IS_ERR(class_dev)) { - err = PTR_ERR(class_dev); + * @dev: DRM device to be added + * @head: DRM head in question + * + * Add a DRM device to the DRM's device model class. We use @dev's PCI device + * as the parent for the Linux device, and make sure it has a file containing + * the driver we're using (for userspace compatibility). + */ +int drm_sysfs_device_add(struct drm_device *dev, struct drm_head *head) +{ + int err; + int i, j; + + dev->dev.parent = &dev->pdev->dev; + dev->dev.class = drm_class; + dev->dev.release = drm_sysfs_device_release; + /* + * This will actually add the major:minor file so that udev + * will create the device node. We don't want to do that just + * yet... + */ + /* dev->dev.devt = head->device; */ + snprintf(dev->dev.bus_id, BUS_ID_SIZE, "card%d", head->minor); + + err = device_register(&dev->dev); + if (err) { + DRM_ERROR("device add failed: %d\n", err); goto err_out; } - class_set_devdata(class_dev, head); - - for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++) { - err = class_device_create_file(class_dev, - &class_device_attrs[i]); + for (i = 0; i < ARRAY_SIZE(device_attrs); i++) { + err = device_create_file(&dev->dev, &device_attrs[i]); if (err) goto err_out_files; } - return class_dev; + return 0; err_out_files: if (i > 0) for (j = 0; j < i; j++) - class_device_remove_file(class_dev, - &class_device_attrs[i]); - class_device_unregister(class_dev); + device_remove_file(&dev->dev, &device_attrs[i]); + device_unregister(&dev->dev); err_out: - return ERR_PTR(err); + + return err; } /** - * drm_sysfs_device_remove - removes a class device that was created with drm_sysfs_device_add() - * @dev: the dev_t of the device that was previously registered. + * drm_sysfs_device_remove - remove DRM device + * @dev: DRM device to remove * * This call unregisters and cleans up a class device that was created with a * call to drm_sysfs_device_add() */ -void drm_sysfs_device_remove(struct class_device *class_dev) +void drm_sysfs_device_remove(struct drm_device *dev) { int i; - for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++) - class_device_remove_file(class_dev, &class_device_attrs[i]); - class_device_unregister(class_dev); + for (i = 0; i < ARRAY_SIZE(device_attrs); i++) + device_remove_file(&dev->dev, &device_attrs[i]); + device_unregister(&dev->dev); } --- linux-2.6.24.orig/drivers/char/drm/drm_stub.c +++ linux-2.6.24/drivers/char/drm/drm_stub.c @@ -168,11 +168,10 @@ goto err_g1; } - head->dev_class = drm_sysfs_device_add(drm_class, head); - if (IS_ERR(head->dev_class)) { + ret = drm_sysfs_device_add(dev, head); + if (ret) { printk(KERN_ERR "DRM: Error sysfs_device_add.\n"); - ret = PTR_ERR(head->dev_class); goto err_g2; } *heads = head; @@ -284,7 +283,7 @@ DRM_DEBUG("release secondary minor %d\n", minor); drm_proc_cleanup(minor, drm_proc_root, head->dev_root); - drm_sysfs_device_remove(head->dev_class); + drm_sysfs_device_remove(head->dev); *head = (struct drm_head) {.dev = NULL}; --- linux-2.6.24.orig/drivers/char/drm/via_chrome9_3d_reg.h +++ linux-2.6.24/drivers/char/drm/via_chrome9_3d_reg.h @@ -0,0 +1,401 @@ +/* + * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice + * (including the next paragraph) shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL VIA, S3 GRAPHICS, AND/OR + * ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef VIA_CHROME9_3D_REG_H +#define VIA_CHROME9_3D_REG_H + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +#define GetMMIORegister(base, offset) \ + (*(volatile unsigned int *)(void *)(((unsigned char *)(base)) + \ + (offset))) +#define SetMMIORegister(base, offset, val) \ + (*(volatile unsigned int *)(void *)(((unsigned char *)(base)) + \ + (offset)) = (val)) + +#define GetMMIORegisterU8(base, offset) \ + (*(volatile unsigned char *)(void *)(((unsigned char *)(base)) + \ + (offset))) +#define SetMMIORegisterU8(base, offset, val) \ + (*(volatile unsigned char *)(void *)(((unsigned char *)(base)) + \ + (offset)) = (val)) + +#define BCI_SEND(bci, value) (*(bci)++ = (unsigned long)(value)) +#define BCI_SET_STREAM_REGISTER(bci_base, bci_index, reg_value) \ +do { \ + unsigned long cmd; \ + \ + cmd = (0x90000000 \ + | (1<<16) /* stream processor register */ \ + | (bci_index & 0x3FFC)); /* MMIO register address */ \ + BCI_SEND(bci_base, cmd); \ + BCI_SEND(bci_base, reg_value); \ + } while (0) + +/* Command Header Type */ + +#define INV_AGPHeader0 0xFE000000 +#define INV_AGPHeader1 0xFE010000 +#define INV_AGPHeader2 0xFE020000 +#define INV_AGPHeader3 0xFE030000 +#define INV_AGPHeader4 0xFE040000 +#define INV_AGPHeader5 0xFE050000 +#define INV_AGPHeader6 0xFE060000 +#define INV_AGPHeader7 0xFE070000 +#define INV_AGPHeader82 0xFE820000 +#define INV_AGPHeader_MASK 0xFFFF0000 + +/*send pause address of AGP ring command buffer via_chrome9 this IO port*/ +#define INV_REG_PCIPAUSE 0x294 +#define INV_REG_PCIPAUSE_ENABLE 0x4 + +#define INV_CMDBUF_THRESHOLD (8) +#define INV_QW_PAUSE_ALIGN 0x40 + +/* Transmission IO Space*/ +#define INV_REG_CR_TRANS 0x041C +#define INV_REG_CR_BEGIN 0x0420 +#define INV_REG_CR_END 0x0438 + +#define INV_REG_3D_TRANS 0x043C +#define INV_REG_3D_BEGIN 0x0440 +#define INV_REG_3D_END 0x06FC +#define INV_REG_23D_WAIT 0x326C +/*3D / 2D ID Control (Only For Group A)*/ +#define INV_REG_2D3D_ID_CTRL 0x060 + + +/* Engine Status */ + +#define INV_RB_ENG_STATUS 0x0400 +#define INV_ENG_BUSY_HQV0 0x00040000 +#define INV_ENG_BUSY_HQV1 0x00020000 +#define INV_ENG_BUSY_CR 0x00000010 +#define INV_ENG_BUSY_MPEG 0x00000008 +#define INV_ENG_BUSY_VQ 0x00000004 +#define INV_ENG_BUSY_2D 0x00000002 +#define INV_ENG_BUSY_3D 0x00001FE1 +#define INV_ENG_BUSY_ALL \ + (INV_ENG_BUSY_2D | INV_ENG_BUSY_3D | INV_ENG_BUSY_CR) + +/* Command Queue Status*/ +#define INV_RB_VQ_STATUS 0x0448 +#define INV_VQ_FULL 0x40000000 + +/* AGP command buffer pointer current position*/ +#define INV_RB_AGPCMD_CURRADDR 0x043C + +/* AGP command buffer status*/ +#define INV_RB_AGPCMD_STATUS 0x0444 +#define INV_AGPCMD_InPause 0x80000000 + +/*AGP command buffer pause address*/ +#define INV_RB_AGPCMD_PAUSEADDR 0x045C + +/*AGP command buffer jump address*/ +#define INV_RB_AGPCMD_JUMPADDR 0x0460 + +/*AGP command buffer start address*/ +#define INV_RB_AGPCMD_STARTADDR 0x0464 + + +/* Constants */ +#define NUMBER_OF_EVENT_TAGS 1024 +#define NUMBER_OF_APERTURES_CLB 16 + +/* Register definition */ +#define HW_SHADOW_ADDR 0x8520 +#define HW_GARTTABLE_ADDR 0x8540 + +#define INV_HSWFlag_DBGMASK 0x00000FFF +#define INV_HSWFlag_ENCODEMASK 0x007FFFF0 +#define INV_HSWFlag_ADDRSHFT 8 +#define INV_HSWFlag_DECODEMASK \ + (INV_HSWFlag_ENCODEMASK << INV_HSWFlag_ADDRSHFT) +#define INV_HSWFlag_ADDR_ENCODE(x) 0xCC000000 +#define INV_HSWFlag_ADDR_DECODE(x) \ + (((unsigned int)x & INV_HSWFlag_DECODEMASK) >> INV_HSWFlag_ADDRSHFT) + + +#define INV_SubA_HAGPBstL 0x60000000 +#define INV_SubA_HAGPBstH 0x61000000 +#define INV_SubA_HAGPBendL 0x62000000 +#define INV_SubA_HAGPBendH 0x63000000 +#define INV_SubA_HAGPBpL 0x64000000 +#define INV_SubA_HAGPBpID 0x65000000 +#define INV_HAGPBpID_PAUSE 0x00000000 +#define INV_HAGPBpID_JUMP 0x00000100 +#define INV_HAGPBpID_STOP 0x00000200 + +#define INV_HAGPBpH_MASK 0x000000FF +#define INV_HAGPBpH_SHFT 0 + +#define INV_SubA_HAGPBjumpL 0x66000000 +#define INV_SubA_HAGPBjumpH 0x67000000 +#define INV_HAGPBjumpH_MASK 0x000000FF +#define INV_HAGPBjumpH_SHFT 0 + +#define INV_SubA_HFthRCM 0x68000000 +#define INV_HFthRCM_MASK 0x003F0000 +#define INV_HFthRCM_SHFT 16 +#define INV_HFthRCM_8 0x00080000 +#define INV_HFthRCM_10 0x000A0000 +#define INV_HFthRCM_18 0x00120000 +#define INV_HFthRCM_24 0x00180000 +#define INV_HFthRCM_32 0x00200000 + +#define INV_HAGPBClear 0x00000008 + +#define INV_HRSTTrig_RestoreAGP 0x00000004 +#define INV_HRSTTrig_RestoreAll 0x00000002 +#define INV_HAGPBTrig 0x00000001 + +#define INV_ParaSubType_MASK 0xff000000 +#define INV_ParaType_MASK 0x00ff0000 +#define INV_ParaOS_MASK 0x0000ff00 +#define INV_ParaAdr_MASK 0x000000ff +#define INV_ParaSubType_SHIFT 24 +#define INV_ParaType_SHIFT 16 +#define INV_ParaOS_SHIFT 8 +#define INV_ParaAdr_SHIFT 0 + +#define INV_ParaType_Vdata 0x00000000 +#define INV_ParaType_Attr 0x00010000 +#define INV_ParaType_Tex 0x00020000 +#define INV_ParaType_Pal 0x00030000 +#define INV_ParaType_FVF 0x00040000 +#define INV_ParaType_PreCR 0x00100000 +#define INV_ParaType_CR 0x00110000 +#define INV_ParaType_Cfg 0x00fe0000 +#define INV_ParaType_Dummy 0x00300000 + +#define INV_HWBasL_MASK 0x00FFFFFF +#define INV_HWBasH_MASK 0xFF000000 +#define INV_HWBasH_SHFT 24 +#define INV_HWBasL(x) ((unsigned int)(x) & INV_HWBasL_MASK) +#define INV_HWBasH(x) ((unsigned int)(x) >> INV_HWBasH_SHFT) +#define INV_HWBas256(x) ((unsigned int)(x) >> 8) +#define INV_HWPit32(x) ((unsigned int)(x) >> 5) + +/* Read Back Register Setting */ +#define INV_SubA_HSetRBGID 0x02000000 +#define INV_HSetRBGID_CR 0x00000000 +#define INV_HSetRBGID_FE 0x00000001 +#define INV_HSetRBGID_PE 0x00000002 +#define INV_HSetRBGID_RC 0x00000003 +#define INV_HSetRBGID_PS 0x00000004 +#define INV_HSetRBGID_XE 0x00000005 +#define INV_HSetRBGID_BE 0x00000006 + + +struct drm_clb_event_tag_info { + unsigned int *linear_address; + unsigned int *event_tag_linear_address; + int usage[NUMBER_OF_EVENT_TAGS]; + unsigned int pid[NUMBER_OF_EVENT_TAGS]; +}; + +static inline int IS_AGPHEADER_INV(unsigned int data) +{ + switch (data & INV_AGPHeader_MASK) { + case INV_AGPHeader0: + case INV_AGPHeader1: + case INV_AGPHeader2: + case INV_AGPHeader3: + case INV_AGPHeader4: + case INV_AGPHeader5: + case INV_AGPHeader6: + case INV_AGPHeader7: + return TRUE; + default: + return FALSE; + } +} + +/* Header0: 2D */ +#define ADDCmdHeader0_INVI(pCmd, dwCount) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader0; \ + *(pCmd)++ = (dwCount); \ + *(pCmd)++ = 0; \ + *(pCmd)++ = (unsigned int)INV_HSWFlag_ADDR_ENCODE(pCmd); \ +} + +/* Header1: 2D */ +#define ADDCmdHeader1_INVI(pCmd, dwAddr, dwCount) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader1 | (dwAddr); \ + *(pCmd)++ = (dwCount); \ + *(pCmd)++ = 0; \ + *(pCmd)++ = (unsigned int)INV_HSWFlag_ADDR_ENCODE(pCmd); \ +} + +/* Header2: CR/3D */ +#define ADDCmdHeader2_INVI(pCmd, dwAddr, dwType) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned int)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader2 | ((dwAddr)+4); \ + *(pCmd)++ = (dwAddr); \ + *(pCmd)++ = (dwType); \ + *(pCmd)++ = (unsigned int)INV_HSWFlag_ADDR_ENCODE(pCmd); \ +} + +/* Header2: CR/3D with SW Flag */ +#define ADDCmdHeader2_SWFlag_INVI(pCmd, dwAddr, dwType, dwSWFlag) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader2 | ((dwAddr)+4); \ + *(pCmd)++ = (dwAddr); \ + *(pCmd)++ = (dwType); \ + *(pCmd)++ = (dwSWFlag); \ +} + + +/* Header3: 3D */ +#define ADDCmdHeader3_INVI(pCmd, dwType, dwStart, dwCount) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader3 | INV_REG_3D_TRANS; \ + *(pCmd)++ = (dwCount); \ + *(pCmd)++ = (dwType) | ((dwStart) & 0xFFFF); \ + *(pCmd)++ = (unsigned int)INV_HSWFlag_ADDR_ENCODE(pCmd); \ +} + +/* Header3: 3D with SW Flag */ +#define ADDCmdHeader3_SWFlag_INVI(pCmd, dwType, dwStart, dwSWFlag, dwCount) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader3 | INV_REG_3D_TRANS; \ + *(pCmd)++ = (dwCount); \ + *(pCmd)++ = (dwType) | ((dwStart) & 0xFFFF); \ + *(pCmd)++ = (dwSWFlag); \ +} + +/* Header4: DVD */ +#define ADDCmdHeader4_INVI(pCmd, dwAddr, dwCount, id) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader4 | (dwAddr); \ + *(pCmd)++ = (dwCount); \ + *(pCmd)++ = (id); \ + *(pCmd)++ = 0; \ +} + +/* Header5: DVD */ +#define ADDCmdHeader5_INVI(pCmd, dwQWcount, id) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader5; \ + *(pCmd)++ = (dwQWcount); \ + *(pCmd)++ = (id); \ + *(pCmd)++ = 0; \ +} + +/* Header6: DEBUG */ +#define ADDCmdHeader6_INVI(pCmd) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader6; \ + *(pCmd)++ = 0; \ + *(pCmd)++ = 0; \ + *(pCmd)++ = 0; \ +} + +/* Header7: DMA */ +#define ADDCmdHeader7_INVI(pCmd, dwQWcount, id) \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader7; \ + *(pCmd)++ = (dwQWcount); \ + *(pCmd)++ = (id); \ + *(pCmd)++ = 0; \ +} + +/* Header82: Branch buffer */ +#define ADDCmdHeader82_INVI(pCmd, dwAddr, dwType); \ +{ \ + /* 4 unsigned int align, insert NULL Command for padding */ \ + while (((unsigned long *)(pCmd)) & 0xF) { \ + *(pCmd)++ = 0xCC000000; \ + } \ + *(pCmd)++ = INV_AGPHeader82 | ((dwAddr)+4); \ + *(pCmd)++ = (dwAddr); \ + *(pCmd)++ = (dwType); \ + *(pCmd)++ = 0xCC000000; \ +} + + +#define ADD2DCmd_INVI(pCmd, dwAddr, dwCmd) \ +{ \ + *(pCmd)++ = (dwAddr); \ + *(pCmd)++ = (dwCmd); \ +} + +#define ADDCmdData_INVI(pCmd, dwCmd) *(pCmd)++ = (dwCmd) + +#define ADDCmdDataStream_INVI(pCmdBuf, pCmd, dwCount) \ +{ \ + memcpy((pCmdBuf), (pCmd), ((dwCount)<<2)); \ + (pCmdBuf) += (dwCount); \ +} + +#endif --- linux-2.6.24.orig/drivers/char/drm/i915_drv.h +++ linux-2.6.24/drivers/char/drm/i915_drv.h @@ -114,6 +114,93 @@ spinlock_t swaps_lock; drm_i915_vbl_swap_t vbl_swaps; unsigned int swaps_pending; + + /* Register state */ + u8 saveLBB; + u32 saveDSPACNTR; + u32 saveDSPBCNTR; + u32 savePIPEACONF; + u32 savePIPEBCONF; + u32 savePIPEASRC; + u32 savePIPEBSRC; + u32 saveFPA0; + u32 saveFPA1; + u32 saveDPLL_A; + u32 saveDPLL_A_MD; + u32 saveHTOTAL_A; + u32 saveHBLANK_A; + u32 saveHSYNC_A; + u32 saveVTOTAL_A; + u32 saveVBLANK_A; + u32 saveVSYNC_A; + u32 saveBCLRPAT_A; + u32 savePIPEASTAT; + u32 saveDSPASTRIDE; + u32 saveDSPASIZE; + u32 saveDSPAPOS; + u32 saveDSPABASE; + u32 saveDSPASURF; + u32 saveDSPATILEOFF; + u32 savePFIT_PGM_RATIOS; + u32 saveBLC_PWM_CTL; + u32 saveBLC_PWM_CTL2; + u32 saveFPB0; + u32 saveFPB1; + u32 saveDPLL_B; + u32 saveDPLL_B_MD; + u32 saveHTOTAL_B; + u32 saveHBLANK_B; + u32 saveHSYNC_B; + u32 saveVTOTAL_B; + u32 saveVBLANK_B; + u32 saveVSYNC_B; + u32 saveBCLRPAT_B; + u32 savePIPEBSTAT; + u32 saveDSPBSTRIDE; + u32 saveDSPBSIZE; + u32 saveDSPBPOS; + u32 saveDSPBBASE; + u32 saveDSPBSURF; + u32 saveDSPBTILEOFF; + u32 saveVCLK_DIVISOR_VGA0; + u32 saveVCLK_DIVISOR_VGA1; + u32 saveVCLK_POST_DIV; + u32 saveVGACNTRL; + u32 saveADPA; + u32 saveLVDS; + u32 saveLVDSPP_ON; + u32 saveLVDSPP_OFF; + u32 saveDVOA; + u32 saveDVOB; + u32 saveDVOC; + u32 savePP_ON; + u32 savePP_OFF; + u32 savePP_CONTROL; + u32 savePP_CYCLE; + u32 savePFIT_CONTROL; + u32 save_palette_a[256]; + u32 save_palette_b[256]; + u32 saveFBC_CFB_BASE; + u32 saveFBC_LL_BASE; + u32 saveFBC_CONTROL; + u32 saveFBC_CONTROL2; + u32 saveIER; + u32 saveIIR; + u32 saveIMR; + u32 saveCACHE_MODE_0; + u32 saveDSPCLK_GATE_D; + u32 saveMI_ARB_STATE; + u32 saveSWF0[16]; + u32 saveSWF1[16]; + u32 saveSWF2[3]; + u8 saveMSR; + u8 saveSR[8]; + u8 saveGR[25]; + u8 saveAR_INDEX; + u8 saveAR[21]; + u8 saveDACMASK; + u8 saveDACDATA[256*3]; /* 256 3-byte colors */ + u8 saveCR[37]; } drm_i915_private_t; extern struct drm_ioctl_desc i915_ioctls[]; @@ -122,6 +209,7 @@ /* i915_dma.c */ extern void i915_kernel_lost_context(struct drm_device * dev); extern int i915_driver_load(struct drm_device *, unsigned long flags); +extern int i915_driver_unload(struct drm_device *); extern void i915_driver_lastclose(struct drm_device * dev); extern void i915_driver_preclose(struct drm_device *dev, struct drm_file *file_priv); @@ -200,7 +288,51 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); -#define GFX_OP_USER_INTERRUPT ((0<<29)|(2<<23)) +/* Extended config space */ +#define LBB 0xf4 + +/* VGA stuff */ + +#define VGA_ST01_MDA 0x3ba +#define VGA_ST01_CGA 0x3da + +#define VGA_MSR_WRITE 0x3c2 +#define VGA_MSR_READ 0x3cc +#define VGA_MSR_MEM_EN (1<<1) +#define VGA_MSR_CGA_MODE (1<<0) + +#define VGA_SR_INDEX 0x3c4 +#define VGA_SR_DATA 0x3c5 + +#define VGA_AR_INDEX 0x3c0 +#define VGA_AR_VID_EN (1<<5) +#define VGA_AR_DATA_WRITE 0x3c0 +#define VGA_AR_DATA_READ 0x3c1 + +#define VGA_GR_INDEX 0x3ce +#define VGA_GR_DATA 0x3cf +/* GR05 */ +#define VGA_GR_MEM_READ_MODE_SHIFT 3 +#define VGA_GR_MEM_READ_MODE_PLANE 1 +/* GR06 */ +#define VGA_GR_MEM_MODE_MASK 0xc +#define VGA_GR_MEM_MODE_SHIFT 2 +#define VGA_GR_MEM_A0000_AFFFF 0 +#define VGA_GR_MEM_A0000_BFFFF 1 +#define VGA_GR_MEM_B0000_B7FFF 2 +#define VGA_GR_MEM_B0000_BFFFF 3 + +#define VGA_DACMASK 0x3c6 +#define VGA_DACRX 0x3c7 +#define VGA_DACWX 0x3c8 +#define VGA_DACDATA 0x3c9 + +#define VGA_CR_INDEX_MDA 0x3b4 +#define VGA_CR_DATA_MDA 0x3b5 +#define VGA_CR_INDEX_CGA 0x3d4 +#define VGA_CR_DATA_CGA 0x3d5 + +#define GFX_OP_USER_INTERRUPT ((0<<29)|(2<<23)) #define GFX_OP_BREAKPOINT_INTERRUPT ((0<<29)|(1<<23)) #define CMD_REPORT_HEAD (7<<23) #define CMD_STORE_DWORD_IDX ((0x21<<23) | 0x1) @@ -215,6 +347,44 @@ #define BB1_UNPROTECTED (0<<0) #define BB2_END_ADDR_MASK (~0x7) +/* Framebuffer compression */ +#define FBC_CFB_BASE 0x03200 /* 4k page aligned */ +#define FBC_LL_BASE 0x03204 /* 4k page aligned */ +#define FBC_CONTROL 0x03208 +#define FBC_CTL_EN (1<<31) +#define FBC_CTL_PERIODIC (1<<30) +#define FBC_CTL_INTERVAL_SHIFT (16) +#define FBC_CTL_UNCOMPRESSIBLE (1<<14) +#define FBC_CTL_STRIDE_SHIFT (5) +#define FBC_CTL_FENCENO (1<<0) +#define FBC_COMMAND 0x0320c +#define FBC_CMD_COMPRESS (1<<0) +#define FBC_STATUS 0x03210 +#define FBC_STAT_COMPRESSING (1<<31) +#define FBC_STAT_COMPRESSED (1<<30) +#define FBC_STAT_MODIFIED (1<<29) +#define FBC_STAT_CURRENT_LINE (1<<0) +#define FBC_CONTROL2 0x03214 +#define FBC_CTL_FENCE_DBL (0<<4) +#define FBC_CTL_IDLE_IMM (0<<2) +#define FBC_CTL_IDLE_FULL (1<<2) +#define FBC_CTL_IDLE_LINE (2<<2) +#define FBC_CTL_IDLE_DEBUG (3<<2) +#define FBC_CTL_CPU_FENCE (1<<1) +#define FBC_CTL_PLANEA (0<<0) +#define FBC_CTL_PLANEB (1<<0) +#define FBC_FENCE_OFF 0x0321b + +#define FBC_LL_SIZE (1536) +#define FBC_LL_PAD (32) + +/* Interrupt bits: + */ +#define USER_INT_FLAG (1<<1) +#define VSYNC_PIPEB_FLAG (1<<5) +#define VSYNC_PIPEA_FLAG (1<<7) +#define HWB_OOM_FLAG (1<<13) /* binner out of memory */ + #define I915REG_HWSTAM 0x02098 #define I915REG_INT_IDENTITY_R 0x020a4 #define I915REG_INT_MASK_R 0x020a8 @@ -252,6 +422,11 @@ #define LP_RING 0x2030 #define HP_RING 0x2040 #define RING_TAIL 0x00 +/* The binner has its own ring buffer: + */ +#define HWB_RING 0x2400 + +#define RING_TAIL 0x00 #define TAIL_ADDR 0x001FFFF8 #define RING_HEAD 0x04 #define HEAD_WRAP_COUNT 0xFFE00000 @@ -269,11 +444,110 @@ #define RING_VALID 0x00000001 #define RING_INVALID 0x00000000 +/* Instruction parser error reg: + */ +#define IPEIR 0x2088 + +/* Scratch pad debug 0 reg: + */ +#define SCPD0 0x209c + +/* Error status reg: + */ +#define ESR 0x20b8 + +/* Secondary DMA fetch address debug reg: + */ +#define DMA_FADD_S 0x20d4 + +/* Memory Interface Arbitration State + */ +#define MI_ARB_STATE 0x20e4 + +/* Cache mode 0 reg. + * - Manipulating render cache behaviour is central + * to the concept of zone rendering, tuning this reg can help avoid + * unnecessary render cache reads and even writes (for z/stencil) + * at beginning and end of scene. + * + * - To change a bit, write to this reg with a mask bit set and the + * bit of interest either set or cleared. EG: (BIT<<16) | BIT to set. + */ +#define Cache_Mode_0 0x2120 +#define CACHE_MODE_0 0x2120 +#define CM0_MASK_SHIFT 16 +#define CM0_IZ_OPT_DISABLE (1<<6) +#define CM0_ZR_OPT_DISABLE (1<<5) +#define CM0_DEPTH_EVICT_DISABLE (1<<4) +#define CM0_COLOR_EVICT_DISABLE (1<<3) +#define CM0_DEPTH_WRITE_DISABLE (1<<1) +#define CM0_RC_OP_FLUSH_DISABLE (1<<0) + + +/* Graphics flush control. A CPU write flushes the GWB of all writes. + * The data is discarded. + */ +#define GFX_FLSH_CNTL 0x2170 + +/* Binner control. Defines the location of the bin pointer list: + */ +#define BINCTL 0x2420 +#define BC_MASK (1 << 9) + +/* Binned scene info. + */ +#define BINSCENE 0x2428 +#define BS_OP_LOAD (1 << 8) +#define BS_MASK (1 << 22) + +/* Bin command parser debug reg: + */ +#define BCPD 0x2480 + +/* Bin memory control debug reg: + */ +#define BMCD 0x2484 + +/* Bin data cache debug reg: + */ +#define BDCD 0x2488 + +/* Binner pointer cache debug reg: + */ +#define BPCD 0x248c + +/* Binner scratch pad debug reg: + */ +#define BINSKPD 0x24f0 + +/* HWB scratch pad debug reg: + */ +#define HWBSKPD 0x24f4 + +/* Binner memory pool reg: + */ +#define BMP_BUFFER 0x2430 +#define BMP_PAGE_SIZE_4K (0 << 10) +#define BMP_BUFFER_SIZE_SHIFT 1 +#define BMP_ENABLE (1 << 0) + +/* Get/put memory from the binner memory pool: + */ +#define BMP_GET 0x2438 +#define BMP_PUT 0x2440 +#define BMP_OFFSET_SHIFT 5 + +/* 3D state packets: + */ +#define GFX_OP_RASTER_RULES ((0x3<<29)|(0x7<<24)) + #define GFX_OP_SCISSOR ((0x3<<29)|(0x1c<<24)|(0x10<<19)) #define SC_UPDATE_SCISSOR (0x1<<1) #define SC_ENABLE_MASK (0x1<<0) #define SC_ENABLE (0x1<<0) +#define GFX_OP_LOAD_INDIRECT ((0x3<<29)|(0x1d<<24)|(0x7<<16)) + #define GFX_OP_SCISSOR_INFO ((0x3<<29)|(0x1d<<24)|(0x81<<16)|(0x1)) #define SCI_YMIN_MASK (0xffff<<16) #define SCI_XMIN_MASK (0xffff<<0) @@ -290,6 +564,7 @@ #define GFX_OP_DRAWRECT_INFO_I965 ((0x7900<<16)|0x2) +#define SRC_COPY_BLT_CMD ((2<<29)|(0x43<<22)|4) #define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6) #define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21) #define XY_SRC_COPY_BLT_WRITE_RGB (1<<20) @@ -301,6 +576,7 @@ #define MI_BATCH_NON_SECURE_I965 (1<<8) #define MI_WAIT_FOR_EVENT ((0x3<<23)) +#define MI_WAIT_FOR_PLANE_B_FLIP (1<<6) #define MI_WAIT_FOR_PLANE_A_FLIP (1<<2) #define MI_WAIT_FOR_PLANE_A_SCANLINES (1<<1) @@ -308,9 +584,542 @@ #define CMD_OP_DISPLAYBUFFER_INFO ((0x0<<29)|(0x14<<23)|2) #define ASYNC_FLIP (1<<22) +#define DISPLAY_PLANE_A (0<<20) +#define DISPLAY_PLANE_B (1<<20) + +/* Display regs */ +#define DSPACNTR 0x70180 +#define DSPBCNTR 0x71180 +#define DISPPLANE_SEL_PIPE_MASK (1<<24) + +/* Define the region of interest for the binner: + */ +#define CMD_OP_BIN_CONTROL ((0x3<<29)|(0x1d<<24)|(0x84<<16)|4) #define CMD_OP_DESTBUFFER_INFO ((0x3<<29)|(0x1d<<24)|(0x8e<<16)|1) -#define READ_BREADCRUMB(dev_priv) (((u32 *)(dev_priv->hw_status_page))[5]) +#define CMD_MI_FLUSH (0x04 << 23) +#define MI_NO_WRITE_FLUSH (1 << 2) +#define MI_READ_FLUSH (1 << 0) +#define MI_EXE_FLUSH (1 << 1) +#define MI_END_SCENE (1 << 4) /* flush binner and incr scene count */ +#define MI_SCENE_COUNT (1 << 3) /* just increment scene count */ + +#define BREADCRUMB_BITS 31 +#define BREADCRUMB_MASK ((1U << BREADCRUMB_BITS) - 1) + +#define READ_BREADCRUMB(dev_priv) (((volatile u32*)(dev_priv->hw_status_page))[5]) +#define READ_HWSP(dev_priv, reg) (((volatile u32*)(dev_priv->hw_status_page))[reg]) + +#define BLC_PWM_CTL 0x61254 +#define BACKLIGHT_MODULATION_FREQ_SHIFT (17) + +#define BLC_PWM_CTL2 0x61250 +/** + * This is the most significant 15 bits of the number of backlight cycles in a + * complete cycle of the modulated backlight control. + * + * The actual value is this field multiplied by two. + */ +#define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17) +#define BLM_LEGACY_MODE (1 << 16) +/** + * This is the number of cycles out of the backlight modulation cycle for which + * the backlight is on. + * + * This field must be no greater than the number of cycles in the complete + * backlight modulation cycle. + */ +#define BACKLIGHT_DUTY_CYCLE_SHIFT (0) +#define BACKLIGHT_DUTY_CYCLE_MASK (0xffff) + +#define I915_GCFGC 0xf0 +#define I915_LOW_FREQUENCY_ENABLE (1 << 7) +#define I915_DISPLAY_CLOCK_190_200_MHZ (0 << 4) +#define I915_DISPLAY_CLOCK_333_MHZ (4 << 4) +#define I915_DISPLAY_CLOCK_MASK (7 << 4) + +#define I855_HPLLCC 0xc0 +#define I855_CLOCK_CONTROL_MASK (3 << 0) +#define I855_CLOCK_133_200 (0 << 0) +#define I855_CLOCK_100_200 (1 << 0) +#define I855_CLOCK_100_133 (2 << 0) +#define I855_CLOCK_166_250 (3 << 0) + +/* p317, 319 + */ +#define VCLK2_VCO_M 0x6008 /* treat as 16 bit? (includes msbs) */ +#define VCLK2_VCO_N 0x600a +#define VCLK2_VCO_DIV_SEL 0x6012 + +#define VCLK_DIVISOR_VGA0 0x6000 +#define VCLK_DIVISOR_VGA1 0x6004 +#define VCLK_POST_DIV 0x6010 +/** Selects a post divisor of 4 instead of 2. */ +# define VGA1_PD_P2_DIV_4 (1 << 15) +/** Overrides the p2 post divisor field */ +# define VGA1_PD_P1_DIV_2 (1 << 13) +# define VGA1_PD_P1_SHIFT 8 +/** P1 value is 2 greater than this field */ +# define VGA1_PD_P1_MASK (0x1f << 8) +/** Selects a post divisor of 4 instead of 2. */ +# define VGA0_PD_P2_DIV_4 (1 << 7) +/** Overrides the p2 post divisor field */ +# define VGA0_PD_P1_DIV_2 (1 << 5) +# define VGA0_PD_P1_SHIFT 0 +/** P1 value is 2 greater than this field */ +# define VGA0_PD_P1_MASK (0x1f << 0) + +#define DSPCLK_GATE_D 0x6200 + +/* I830 CRTC registers */ +#define HTOTAL_A 0x60000 +#define HBLANK_A 0x60004 +#define HSYNC_A 0x60008 +#define VTOTAL_A 0x6000c +#define VBLANK_A 0x60010 +#define VSYNC_A 0x60014 +#define PIPEASRC 0x6001c +#define BCLRPAT_A 0x60020 +#define VSYNCSHIFT_A 0x60028 + +#define HTOTAL_B 0x61000 +#define HBLANK_B 0x61004 +#define HSYNC_B 0x61008 +#define VTOTAL_B 0x6100c +#define VBLANK_B 0x61010 +#define VSYNC_B 0x61014 +#define PIPEBSRC 0x6101c +#define BCLRPAT_B 0x61020 +#define VSYNCSHIFT_B 0x61028 + +#define PP_STATUS 0x61200 +# define PP_ON (1 << 31) +/** + * Indicates that all dependencies of the panel are on: + * + * - PLL enabled + * - pipe enabled + * - LVDS/DVOB/DVOC on + */ +# define PP_READY (1 << 30) +# define PP_SEQUENCE_NONE (0 << 28) +# define PP_SEQUENCE_ON (1 << 28) +# define PP_SEQUENCE_OFF (2 << 28) +# define PP_SEQUENCE_MASK 0x30000000 +#define PP_CONTROL 0x61204 +# define POWER_TARGET_ON (1 << 0) + +#define LVDSPP_ON 0x61208 +#define LVDSPP_OFF 0x6120c +#define PP_CYCLE 0x61210 + +#define PFIT_CONTROL 0x61230 +# define PFIT_ENABLE (1 << 31) +# define PFIT_PIPE_MASK (3 << 29) +# define PFIT_PIPE_SHIFT 29 +# define VERT_INTERP_DISABLE (0 << 10) +# define VERT_INTERP_BILINEAR (1 << 10) +# define VERT_INTERP_MASK (3 << 10) +# define VERT_AUTO_SCALE (1 << 9) +# define HORIZ_INTERP_DISABLE (0 << 6) +# define HORIZ_INTERP_BILINEAR (1 << 6) +# define HORIZ_INTERP_MASK (3 << 6) +# define HORIZ_AUTO_SCALE (1 << 5) +# define PANEL_8TO6_DITHER_ENABLE (1 << 3) + +#define PFIT_PGM_RATIOS 0x61234 +# define PFIT_VERT_SCALE_MASK 0xfff00000 +# define PFIT_HORIZ_SCALE_MASK 0x0000fff0 + +#define PFIT_AUTO_RATIOS 0x61238 + + +#define DPLL_A 0x06014 +#define DPLL_B 0x06018 +# define DPLL_VCO_ENABLE (1 << 31) +# define DPLL_DVO_HIGH_SPEED (1 << 30) +# define DPLL_SYNCLOCK_ENABLE (1 << 29) +# define DPLL_VGA_MODE_DIS (1 << 28) +# define DPLLB_MODE_DAC_SERIAL (1 << 26) /* i915 */ +# define DPLLB_MODE_LVDS (2 << 26) /* i915 */ +# define DPLL_MODE_MASK (3 << 26) +# define DPLL_DAC_SERIAL_P2_CLOCK_DIV_10 (0 << 24) /* i915 */ +# define DPLL_DAC_SERIAL_P2_CLOCK_DIV_5 (1 << 24) /* i915 */ +# define DPLLB_LVDS_P2_CLOCK_DIV_14 (0 << 24) /* i915 */ +# define DPLLB_LVDS_P2_CLOCK_DIV_7 (1 << 24) /* i915 */ +# define DPLL_P2_CLOCK_DIV_MASK 0x03000000 /* i915 */ +# define DPLL_FPA01_P1_POST_DIV_MASK 0x00ff0000 /* i915 */ +/** + * The i830 generation, in DAC/serial mode, defines p1 as two plus this + * bitfield, or just 2 if PLL_P1_DIVIDE_BY_TWO is set. + */ +# define DPLL_FPA01_P1_POST_DIV_MASK_I830 0x001f0000 +/** + * The i830 generation, in LVDS mode, defines P1 as the bit number set within + * this field (only one bit may be set). + */ +# define DPLL_FPA01_P1_POST_DIV_MASK_I830_LVDS 0x003f0000 +# define DPLL_FPA01_P1_POST_DIV_SHIFT 16 +# define PLL_P2_DIVIDE_BY_4 (1 << 23) /* i830, required in DVO non-gang */ +# define PLL_P1_DIVIDE_BY_TWO (1 << 21) /* i830 */ +# define PLL_REF_INPUT_DREFCLK (0 << 13) +# define PLL_REF_INPUT_TVCLKINA (1 << 13) /* i830 */ +# define PLL_REF_INPUT_TVCLKINBC (2 << 13) /* SDVO TVCLKIN */ +# define PLLB_REF_INPUT_SPREADSPECTRUMIN (3 << 13) +# define PLL_REF_INPUT_MASK (3 << 13) +# define PLL_LOAD_PULSE_PHASE_SHIFT 9 +/* + * Parallel to Serial Load Pulse phase selection. + * Selects the phase for the 10X DPLL clock for the PCIe + * digital display port. The range is 4 to 13; 10 or more + * is just a flip delay. The default is 6 + */ +# define PLL_LOAD_PULSE_PHASE_MASK (0xf << PLL_LOAD_PULSE_PHASE_SHIFT) +# define DISPLAY_RATE_SELECT_FPA1 (1 << 8) + +/** + * SDVO multiplier for 945G/GM. Not used on 965. + * + * \sa DPLL_MD_UDI_MULTIPLIER_MASK + */ +# define SDVO_MULTIPLIER_MASK 0x000000ff +# define SDVO_MULTIPLIER_SHIFT_HIRES 4 +# define SDVO_MULTIPLIER_SHIFT_VGA 0 + +/** @defgroup DPLL_MD + * @{ + */ +/** Pipe A SDVO/UDI clock multiplier/divider register for G965. */ +#define DPLL_A_MD 0x0601c +/** Pipe B SDVO/UDI clock multiplier/divider register for G965. */ +#define DPLL_B_MD 0x06020 +/** + * UDI pixel divider, controlling how many pixels are stuffed into a packet. + * + * Value is pixels minus 1. Must be set to 1 pixel for SDVO. + */ +# define DPLL_MD_UDI_DIVIDER_MASK 0x3f000000 +# define DPLL_MD_UDI_DIVIDER_SHIFT 24 +/** UDI pixel divider for VGA, same as DPLL_MD_UDI_DIVIDER_MASK. */ +# define DPLL_MD_VGA_UDI_DIVIDER_MASK 0x003f0000 +# define DPLL_MD_VGA_UDI_DIVIDER_SHIFT 16 +/** + * SDVO/UDI pixel multiplier. + * + * SDVO requires that the bus clock rate be between 1 and 2 Ghz, and the bus + * clock rate is 10 times the DPLL clock. At low resolution/refresh rate + * modes, the bus rate would be below the limits, so SDVO allows for stuffing + * dummy bytes in the datastream at an increased clock rate, with both sides of + * the link knowing how many bytes are fill. + * + * So, for a mode with a dotclock of 65Mhz, we would want to double the clock + * rate to 130Mhz to get a bus rate of 1.30Ghz. The DPLL clock rate would be + * set to 130Mhz, and the SDVO multiplier set to 2x in this register and + * through an SDVO command. + * + * This register field has values of multiplication factor minus 1, with + * a maximum multiplier of 5 for SDVO. + */ +# define DPLL_MD_UDI_MULTIPLIER_MASK 0x00003f00 +# define DPLL_MD_UDI_MULTIPLIER_SHIFT 8 +/** SDVO/UDI pixel multiplier for VGA, same as DPLL_MD_UDI_MULTIPLIER_MASK. + * This best be set to the default value (3) or the CRT won't work. No, + * I don't entirely understand what this does... + */ +# define DPLL_MD_VGA_UDI_MULTIPLIER_MASK 0x0000003f +# define DPLL_MD_VGA_UDI_MULTIPLIER_SHIFT 0 +/** @} */ + +#define DPLL_TEST 0x606c +# define DPLLB_TEST_SDVO_DIV_1 (0 << 22) +# define DPLLB_TEST_SDVO_DIV_2 (1 << 22) +# define DPLLB_TEST_SDVO_DIV_4 (2 << 22) +# define DPLLB_TEST_SDVO_DIV_MASK (3 << 22) +# define DPLLB_TEST_N_BYPASS (1 << 19) +# define DPLLB_TEST_M_BYPASS (1 << 18) +# define DPLLB_INPUT_BUFFER_ENABLE (1 << 16) +# define DPLLA_TEST_N_BYPASS (1 << 3) +# define DPLLA_TEST_M_BYPASS (1 << 2) +# define DPLLA_INPUT_BUFFER_ENABLE (1 << 0) + +#define ADPA 0x61100 +#define ADPA_DAC_ENABLE (1<<31) +#define ADPA_DAC_DISABLE 0 +#define ADPA_PIPE_SELECT_MASK (1<<30) +#define ADPA_PIPE_A_SELECT 0 +#define ADPA_PIPE_B_SELECT (1<<30) +#define ADPA_USE_VGA_HVPOLARITY (1<<15) +#define ADPA_SETS_HVPOLARITY 0 +#define ADPA_VSYNC_CNTL_DISABLE (1<<11) +#define ADPA_VSYNC_CNTL_ENABLE 0 +#define ADPA_HSYNC_CNTL_DISABLE (1<<10) +#define ADPA_HSYNC_CNTL_ENABLE 0 +#define ADPA_VSYNC_ACTIVE_HIGH (1<<4) +#define ADPA_VSYNC_ACTIVE_LOW 0 +#define ADPA_HSYNC_ACTIVE_HIGH (1<<3) +#define ADPA_HSYNC_ACTIVE_LOW 0 + +#define FPA0 0x06040 +#define FPA1 0x06044 +#define FPB0 0x06048 +#define FPB1 0x0604c +# define FP_N_DIV_MASK 0x003f0000 +# define FP_N_DIV_SHIFT 16 +# define FP_M1_DIV_MASK 0x00003f00 +# define FP_M1_DIV_SHIFT 8 +# define FP_M2_DIV_MASK 0x0000003f +# define FP_M2_DIV_SHIFT 0 + + +#define PORT_HOTPLUG_EN 0x61110 +# define SDVOB_HOTPLUG_INT_EN (1 << 26) +# define SDVOC_HOTPLUG_INT_EN (1 << 25) +# define TV_HOTPLUG_INT_EN (1 << 18) +# define CRT_HOTPLUG_INT_EN (1 << 9) +# define CRT_HOTPLUG_FORCE_DETECT (1 << 3) + +#define PORT_HOTPLUG_STAT 0x61114 +# define CRT_HOTPLUG_INT_STATUS (1 << 11) +# define TV_HOTPLUG_INT_STATUS (1 << 10) +# define CRT_HOTPLUG_MONITOR_MASK (3 << 8) +# define CRT_HOTPLUG_MONITOR_COLOR (3 << 8) +# define CRT_HOTPLUG_MONITOR_MONO (2 << 8) +# define CRT_HOTPLUG_MONITOR_NONE (0 << 8) +# define SDVOC_HOTPLUG_INT_STATUS (1 << 7) +# define SDVOB_HOTPLUG_INT_STATUS (1 << 6) + +#define SDVOB 0x61140 +#define SDVOC 0x61160 +#define SDVO_ENABLE (1 << 31) +#define SDVO_PIPE_B_SELECT (1 << 30) +#define SDVO_STALL_SELECT (1 << 29) +#define SDVO_INTERRUPT_ENABLE (1 << 26) +/** + * 915G/GM SDVO pixel multiplier. + * + * Programmed value is multiplier - 1, up to 5x. + * + * \sa DPLL_MD_UDI_MULTIPLIER_MASK + */ +#define SDVO_PORT_MULTIPLY_MASK (7 << 23) +#define SDVO_PORT_MULTIPLY_SHIFT 23 +#define SDVO_PHASE_SELECT_MASK (15 << 19) +#define SDVO_PHASE_SELECT_DEFAULT (6 << 19) +#define SDVO_CLOCK_OUTPUT_INVERT (1 << 18) +#define SDVOC_GANG_MODE (1 << 16) +#define SDVO_BORDER_ENABLE (1 << 7) +#define SDVOB_PCIE_CONCURRENCY (1 << 3) +#define SDVO_DETECTED (1 << 2) +/* Bits to be preserved when writing */ +#define SDVOB_PRESERVE_MASK ((1 << 17) | (1 << 16) | (1 << 14)) +#define SDVOC_PRESERVE_MASK (1 << 17) + +/** @defgroup LVDS + * @{ + */ +/** + * This register controls the LVDS output enable, pipe selection, and data + * format selection. + * + * All of the clock/data pairs are force powered down by power sequencing. + */ +#define LVDS 0x61180 +/** + * Enables the LVDS port. This bit must be set before DPLLs are enabled, as + * the DPLL semantics change when the LVDS is assigned to that pipe. + */ +# define LVDS_PORT_EN (1 << 31) +/** Selects pipe B for LVDS data. Must be set on pre-965. */ +# define LVDS_PIPEB_SELECT (1 << 30) + +/** + * Enables the A0-A2 data pairs and CLKA, containing 18 bits of color data per + * pixel. + */ +# define LVDS_A0A2_CLKA_POWER_MASK (3 << 8) +# define LVDS_A0A2_CLKA_POWER_DOWN (0 << 8) +# define LVDS_A0A2_CLKA_POWER_UP (3 << 8) +/** + * Controls the A3 data pair, which contains the additional LSBs for 24 bit + * mode. Only enabled if LVDS_A0A2_CLKA_POWER_UP also indicates it should be + * on. + */ +# define LVDS_A3_POWER_MASK (3 << 6) +# define LVDS_A3_POWER_DOWN (0 << 6) +# define LVDS_A3_POWER_UP (3 << 6) +/** + * Controls the CLKB pair. This should only be set when LVDS_B0B3_POWER_UP + * is set. + */ +# define LVDS_CLKB_POWER_MASK (3 << 4) +# define LVDS_CLKB_POWER_DOWN (0 << 4) +# define LVDS_CLKB_POWER_UP (3 << 4) + +/** + * Controls the B0-B3 data pairs. This must be set to match the DPLL p2 + * setting for whether we are in dual-channel mode. The B3 pair will + * additionally only be powered up when LVDS_A3_POWER_UP is set. + */ +# define LVDS_B0B3_POWER_MASK (3 << 2) +# define LVDS_B0B3_POWER_DOWN (0 << 2) +# define LVDS_B0B3_POWER_UP (3 << 2) + +#define PIPEACONF 0x70008 +#define PIPEACONF_ENABLE (1<<31) +#define PIPEACONF_DISABLE 0 +#define PIPEACONF_DOUBLE_WIDE (1<<30) +#define I965_PIPECONF_ACTIVE (1<<30) +#define PIPEACONF_SINGLE_WIDE 0 +#define PIPEACONF_PIPE_UNLOCKED 0 +#define PIPEACONF_PIPE_LOCKED (1<<25) +#define PIPEACONF_PALETTE 0 +#define PIPEACONF_GAMMA (1<<24) +#define PIPECONF_FORCE_BORDER (1<<25) +#define PIPECONF_PROGRESSIVE (0 << 21) +#define PIPECONF_INTERLACE_W_FIELD_INDICATION (6 << 21) +#define PIPECONF_INTERLACE_FIELD_0_ONLY (7 << 21) + +#define PIPEBCONF 0x71008 +#define PIPEBCONF_ENABLE (1<<31) +#define PIPEBCONF_DISABLE 0 +#define PIPEBCONF_DOUBLE_WIDE (1<<30) +#define PIPEBCONF_DISABLE 0 +#define PIPEBCONF_GAMMA (1<<24) +#define PIPEBCONF_PALETTE 0 + +#define PIPEBGCMAXRED 0x71010 +#define PIPEBGCMAXGREEN 0x71014 +#define PIPEBGCMAXBLUE 0x71018 +#define PIPEBSTAT 0x71024 +#define PIPEBFRAMEHIGH 0x71040 +#define PIPEBFRAMEPIXEL 0x71044 + +#define DSPACNTR 0x70180 +#define DSPBCNTR 0x71180 +#define DISPLAY_PLANE_ENABLE (1<<31) +#define DISPLAY_PLANE_DISABLE 0 +#define DISPPLANE_GAMMA_ENABLE (1<<30) +#define DISPPLANE_GAMMA_DISABLE 0 +#define DISPPLANE_PIXFORMAT_MASK (0xf<<26) +#define DISPPLANE_8BPP (0x2<<26) +#define DISPPLANE_15_16BPP (0x4<<26) +#define DISPPLANE_16BPP (0x5<<26) +#define DISPPLANE_32BPP_NO_ALPHA (0x6<<26) +#define DISPPLANE_32BPP (0x7<<26) +#define DISPPLANE_STEREO_ENABLE (1<<25) +#define DISPPLANE_STEREO_DISABLE 0 +#define DISPPLANE_SEL_PIPE_MASK (1<<24) +#define DISPPLANE_SEL_PIPE_A 0 +#define DISPPLANE_SEL_PIPE_B (1<<24) +#define DISPPLANE_SRC_KEY_ENABLE (1<<22) +#define DISPPLANE_SRC_KEY_DISABLE 0 +#define DISPPLANE_LINE_DOUBLE (1<<20) +#define DISPPLANE_NO_LINE_DOUBLE 0 +#define DISPPLANE_STEREO_POLARITY_FIRST 0 +#define DISPPLANE_STEREO_POLARITY_SECOND (1<<18) +/* plane B only */ +#define DISPPLANE_ALPHA_TRANS_ENABLE (1<<15) +#define DISPPLANE_ALPHA_TRANS_DISABLE 0 +#define DISPPLANE_SPRITE_ABOVE_DISPLAYA 0 +#define DISPPLANE_SPRITE_ABOVE_OVERLAY (1) + +#define DSPABASE 0x70184 +#define DSPASTRIDE 0x70188 + +#define DSPBBASE 0x71184 +#define DSPBADDR DSPBBASE +#define DSPBSTRIDE 0x71188 + +#define DSPAKEYVAL 0x70194 +#define DSPAKEYMASK 0x70198 + +#define DSPAPOS 0x7018C /* reserved */ +#define DSPASIZE 0x70190 +#define DSPBPOS 0x7118C +#define DSPBSIZE 0x71190 + +#define DSPASURF 0x7019C +#define DSPATILEOFF 0x701A4 + +#define DSPBSURF 0x7119C +#define DSPBTILEOFF 0x711A4 + +#define VGACNTRL 0x71400 +# define VGA_DISP_DISABLE (1 << 31) +# define VGA_2X_MODE (1 << 30) +# define VGA_PIPE_B_SELECT (1 << 29) + +/* + * Some BIOS scratch area registers. The 845 (and 830?) store the amount + * of video memory available to the BIOS in SWF1. + */ + +#define SWF0 0x71410 + +/* + * 855 scratch registers. + */ +#define SWF10 0x70410 + +#define SWF30 0x72414 + +/* + * Overlay registers. These are overlay registers accessed via MMIO. + * Those loaded via the overlay register page are defined in i830_video.c. + */ +#define OVADD 0x30000 + +#define DOVSTA 0x30008 +#define OC_BUF (0x3<<20) + +#define OGAMC5 0x30010 +#define OGAMC4 0x30014 +#define OGAMC3 0x30018 +#define OGAMC2 0x3001c +#define OGAMC1 0x30020 +#define OGAMC0 0x30024 +/* + * Palette registers + */ +#define PALETTE_A 0x0a000 +#define PALETTE_B 0x0a800 + +#define IS_I830(dev) ((dev)->pci_device == 0x3577) +#define IS_845G(dev) ((dev)->pci_device == 0x2562) +#define IS_I85X(dev) ((dev)->pci_device == 0x3582) +#define IS_I855(dev) ((dev)->pci_device == 0x3582) +#define IS_I865G(dev) ((dev)->pci_device == 0x2572) + +#define IS_I915G(dev) ((dev)->pci_device == 0x2582 || (dev)->pci_device == 0x258a) +#define IS_I915GM(dev) ((dev)->pci_device == 0x2592) +#define IS_I945G(dev) ((dev)->pci_device == 0x2772) +#define IS_I945GM(dev) ((dev)->pci_device == 0x27A2 ||\ + (dev)->pci_device == 0x27AE) +#define IS_I965G(dev) ((dev)->pci_device == 0x2972 || \ + (dev)->pci_device == 0x2982 || \ + (dev)->pci_device == 0x2992 || \ + (dev)->pci_device == 0x29A2 || \ + (dev)->pci_device == 0x2A02 || \ + (dev)->pci_device == 0x2A12 || \ + (dev)->pci_device == 0x2A42) + +#define IS_I965GM(dev) ((dev)->pci_device == 0x2A02) + +#define IS_IGD_GM(dev) ((dev)->pci_device == 0x2A42) + +#define IS_G33(dev) ((dev)->pci_device == 0x29C2 || \ + (dev)->pci_device == 0x29B2 || \ + (dev)->pci_device == 0x29D2) + +#define IS_I9XX(dev) (IS_I915G(dev) || IS_I915GM(dev) || IS_I945G(dev) || \ + IS_I945GM(dev) || IS_I965G(dev) || IS_G33(dev)) + +#define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \ + IS_I945GM(dev) || IS_I965GM(dev) || IS_IGD_GM(dev)) + +#define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_IGD_GM(dev)) + +#define PRIMARY_RINGBUFFER_SIZE (128*1024) #endif --- linux-2.6.24.orig/drivers/char/drm/Kconfig +++ linux-2.6.24/drivers/char/drm/Kconfig @@ -38,7 +38,7 @@ Choose this option if you have an ATI Radeon graphics card. There are both PCI and AGP versions. You don't need to choose this to run the Radeon in plain VGA mode. - + If M is selected, the module will be called radeon. config DRM_I810 @@ -71,9 +71,9 @@ 852GM, 855GM 865G or 915G integrated graphics. If M is selected, the module will be called i915. AGP support is required for this driver to work. This driver is used by the Intel driver in X.org 6.8 and - XFree86 4.4 and above. If unsure, build this and i830 as modules and + XFree86 4.4 and above. If unsure, build this and i830 as modules and the X server will load the correct one. - + endchoice config DRM_MGA @@ -88,7 +88,7 @@ tristate "SiS video cards" depends on DRM && AGP help - Choose this option if you have a SiS 630 or compatible video + Choose this option if you have a SiS 630 or compatible video chipset. If M is selected the module will be called sis. AGP support is required for this driver to work. @@ -98,6 +98,13 @@ help Choose this option if you have a Via unichrome or compatible video chipset. If M is selected the module will be called via. + +config DRM_VIA_CHROME9 + tristate "Via unichrome9 video cards" + depends on DRM + help + Choose this option if you have a Via unichrome9 or compatible video + chipset. If M is selected the module will be called via_chrome9. config DRM_SAVAGE tristate "Savage video cards" @@ -105,4 +112,3 @@ help Choose this option if you have a Savage3D/4/SuperSavage/Pro/Twister chipset. If M is selected the module will be called savage. - --- linux-2.6.24.orig/drivers/char/drm/i915_drv.c +++ linux-2.6.24/drivers/char/drm/i915_drv.c @@ -38,6 +38,495 @@ i915_PCI_IDS }; +enum pipe { + PIPE_A = 0, + PIPE_B, +}; + +static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + + if (pipe == PIPE_A) + return (I915_READ(DPLL_A) & DPLL_VCO_ENABLE); + else + return (I915_READ(DPLL_B) & DPLL_VCO_ENABLE); +} + +static void i915_save_palette(struct drm_device *dev, enum pipe pipe) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B); + u32 *array; + int i; + + if (!i915_pipe_enabled(dev, pipe)) + return; + + if (pipe == PIPE_A) + array = dev_priv->save_palette_a; + else + array = dev_priv->save_palette_b; + + for(i = 0; i < 256; i++) + array[i] = I915_READ(reg + (i << 2)); +} + +static void i915_restore_palette(struct drm_device *dev, enum pipe pipe) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B); + u32 *array; + int i; + + if (!i915_pipe_enabled(dev, pipe)) + return; + + if (pipe == PIPE_A) + array = dev_priv->save_palette_a; + else + array = dev_priv->save_palette_b; + + for(i = 0; i < 256; i++) + I915_WRITE(reg + (i << 2), array[i]); +} + +static u8 i915_read_indexed(u16 index_port, u16 data_port, u8 reg) +{ + outb(reg, index_port); + return inb(data_port); +} + +static u8 i915_read_ar(u16 st01, u8 reg, u16 palette_enable) +{ + inb(st01); + outb(palette_enable | reg, VGA_AR_INDEX); + return inb(VGA_AR_DATA_READ); +} + +static void i915_write_ar(u8 st01, u8 reg, u8 val, u16 palette_enable) +{ + inb(st01); + outb(palette_enable | reg, VGA_AR_INDEX); + outb(val, VGA_AR_DATA_WRITE); +} + +static void i915_write_indexed(u16 index_port, u16 data_port, u8 reg, u8 val) +{ + outb(reg, index_port); + outb(val, data_port); +} + +static void i915_save_vga(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int i; + u16 cr_index, cr_data, st01; + + /* VGA color palette registers */ + dev_priv->saveDACMASK = inb(VGA_DACMASK); + /* DACCRX automatically increments during read */ + outb(0, VGA_DACRX); + /* Read 3 bytes of color data from each index */ + for (i = 0; i < 256 * 3; i++) + dev_priv->saveDACDATA[i] = inb(VGA_DACDATA); + + /* MSR bits */ + dev_priv->saveMSR = inb(VGA_MSR_READ); + if (dev_priv->saveMSR & VGA_MSR_CGA_MODE) { + cr_index = VGA_CR_INDEX_CGA; + cr_data = VGA_CR_DATA_CGA; + st01 = VGA_ST01_CGA; + } else { + cr_index = VGA_CR_INDEX_MDA; + cr_data = VGA_CR_DATA_MDA; + st01 = VGA_ST01_MDA; + } + + /* CRT controller regs */ + i915_write_indexed(cr_index, cr_data, 0x11, + i915_read_indexed(cr_index, cr_data, 0x11) & + (~0x80)); + for (i = 0; i <= 0x24; i++) + dev_priv->saveCR[i] = + i915_read_indexed(cr_index, cr_data, i); + /* Make sure we don't turn off CR group 0 writes */ + dev_priv->saveCR[0x11] &= ~0x80; + + /* Attribute controller registers */ + inb(st01); + dev_priv->saveAR_INDEX = inb(VGA_AR_INDEX); + for (i = 0; i <= 0x14; i++) + dev_priv->saveAR[i] = i915_read_ar(st01, i, 0); + inb(st01); + outb(dev_priv->saveAR_INDEX, VGA_AR_INDEX); + inb(st01); + + /* Graphics controller registers */ + for (i = 0; i < 9; i++) + dev_priv->saveGR[i] = + i915_read_indexed(VGA_GR_INDEX, VGA_GR_DATA, i); + + dev_priv->saveGR[0x10] = + i915_read_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x10); + dev_priv->saveGR[0x11] = + i915_read_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x11); + dev_priv->saveGR[0x18] = + i915_read_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x18); + + /* Sequencer registers */ + for (i = 0; i < 8; i++) + dev_priv->saveSR[i] = + i915_read_indexed(VGA_SR_INDEX, VGA_SR_DATA, i); +} + +static void i915_restore_vga(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int i; + u16 cr_index, cr_data, st01; + + /* MSR bits */ + outb(dev_priv->saveMSR, VGA_MSR_WRITE); + if (dev_priv->saveMSR & VGA_MSR_CGA_MODE) { + cr_index = VGA_CR_INDEX_CGA; + cr_data = VGA_CR_DATA_CGA; + st01 = VGA_ST01_CGA; + } else { + cr_index = VGA_CR_INDEX_MDA; + cr_data = VGA_CR_DATA_MDA; + st01 = VGA_ST01_MDA; + } + + /* Sequencer registers, don't write SR07 */ + for (i = 0; i < 7; i++) + i915_write_indexed(VGA_SR_INDEX, VGA_SR_DATA, i, + dev_priv->saveSR[i]); + + /* CRT controller regs */ + /* Enable CR group 0 writes */ + i915_write_indexed(cr_index, cr_data, 0x11, dev_priv->saveCR[0x11]); + for (i = 0; i <= 0x24; i++) + i915_write_indexed(cr_index, cr_data, i, dev_priv->saveCR[i]); + + /* Graphics controller regs */ + for (i = 0; i < 9; i++) + i915_write_indexed(VGA_GR_INDEX, VGA_GR_DATA, i, + dev_priv->saveGR[i]); + + i915_write_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x10, + dev_priv->saveGR[0x10]); + i915_write_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x11, + dev_priv->saveGR[0x11]); + i915_write_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x18, + dev_priv->saveGR[0x18]); + + /* Attribute controller registers */ + inb(st01); + for (i = 0; i <= 0x14; i++) + i915_write_ar(st01, i, dev_priv->saveAR[i], 0); + inb(st01); /* switch back to index mode */ + outb(dev_priv->saveAR_INDEX | 0x20, VGA_AR_INDEX); + inb(st01); + + /* VGA color palette registers */ + outb(dev_priv->saveDACMASK, VGA_DACMASK); + /* DACCRX automatically increments during read */ + outb(0, VGA_DACWX); + /* Read 3 bytes of color data from each index */ + for (i = 0; i < 256 * 3; i++) + outb(dev_priv->saveDACDATA[i], VGA_DACDATA); + +} + +static int i915_suspend(struct drm_device *dev, pm_message_t state) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int i; + + if (!dev || !dev_priv) { + printk(KERN_ERR "dev: %p, dev_priv: %p\n", dev, dev_priv); + printk(KERN_ERR "DRM not initialized, aborting suspend.\n"); + return -ENODEV; + } + + if (state.event == PM_EVENT_PRETHAW) + return 0; + + pci_save_state(dev->pdev); + pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB); + + /* Pipe & plane A info */ + dev_priv->savePIPEACONF = I915_READ(PIPEACONF); + dev_priv->savePIPEASRC = I915_READ(PIPEASRC); + dev_priv->saveFPA0 = I915_READ(FPA0); + dev_priv->saveFPA1 = I915_READ(FPA1); + dev_priv->saveDPLL_A = I915_READ(DPLL_A); + if (IS_I965G(dev)) + dev_priv->saveDPLL_A_MD = I915_READ(DPLL_A_MD); + dev_priv->saveHTOTAL_A = I915_READ(HTOTAL_A); + dev_priv->saveHBLANK_A = I915_READ(HBLANK_A); + dev_priv->saveHSYNC_A = I915_READ(HSYNC_A); + dev_priv->saveVTOTAL_A = I915_READ(VTOTAL_A); + dev_priv->saveVBLANK_A = I915_READ(VBLANK_A); + dev_priv->saveVSYNC_A = I915_READ(VSYNC_A); + dev_priv->saveBCLRPAT_A = I915_READ(BCLRPAT_A); + + dev_priv->saveDSPACNTR = I915_READ(DSPACNTR); + dev_priv->saveDSPASTRIDE = I915_READ(DSPASTRIDE); + dev_priv->saveDSPASIZE = I915_READ(DSPASIZE); + dev_priv->saveDSPAPOS = I915_READ(DSPAPOS); + dev_priv->saveDSPABASE = I915_READ(DSPABASE); + if (IS_I965G(dev)) { + dev_priv->saveDSPASURF = I915_READ(DSPASURF); + dev_priv->saveDSPATILEOFF = I915_READ(DSPATILEOFF); + } + i915_save_palette(dev, PIPE_A); + dev_priv->savePIPEASTAT = I915_READ(I915REG_PIPEASTAT); + + /* Pipe & plane B info */ + dev_priv->savePIPEBCONF = I915_READ(PIPEBCONF); + dev_priv->savePIPEBSRC = I915_READ(PIPEBSRC); + dev_priv->saveFPB0 = I915_READ(FPB0); + dev_priv->saveFPB1 = I915_READ(FPB1); + dev_priv->saveDPLL_B = I915_READ(DPLL_B); + if (IS_I965G(dev)) + dev_priv->saveDPLL_B_MD = I915_READ(DPLL_B_MD); + dev_priv->saveHTOTAL_B = I915_READ(HTOTAL_B); + dev_priv->saveHBLANK_B = I915_READ(HBLANK_B); + dev_priv->saveHSYNC_B = I915_READ(HSYNC_B); + dev_priv->saveVTOTAL_B = I915_READ(VTOTAL_B); + dev_priv->saveVBLANK_B = I915_READ(VBLANK_B); + dev_priv->saveVSYNC_B = I915_READ(VSYNC_B); + dev_priv->saveBCLRPAT_A = I915_READ(BCLRPAT_A); + + dev_priv->saveDSPBCNTR = I915_READ(DSPBCNTR); + dev_priv->saveDSPBSTRIDE = I915_READ(DSPBSTRIDE); + dev_priv->saveDSPBSIZE = I915_READ(DSPBSIZE); + dev_priv->saveDSPBPOS = I915_READ(DSPBPOS); + dev_priv->saveDSPBBASE = I915_READ(DSPBBASE); + if (IS_I965GM(dev) || IS_IGD_GM(dev)) { + dev_priv->saveDSPBSURF = I915_READ(DSPBSURF); + dev_priv->saveDSPBTILEOFF = I915_READ(DSPBTILEOFF); + } + i915_save_palette(dev, PIPE_B); + dev_priv->savePIPEBSTAT = I915_READ(I915REG_PIPEBSTAT); + + /* CRT state */ + dev_priv->saveADPA = I915_READ(ADPA); + + /* LVDS state */ + dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL); + dev_priv->savePFIT_PGM_RATIOS = I915_READ(PFIT_PGM_RATIOS); + dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL); + if (IS_I965G(dev)) + dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2); + if (IS_MOBILE(dev) && !IS_I830(dev)) + dev_priv->saveLVDS = I915_READ(LVDS); + if (!IS_I830(dev) && !IS_845G(dev)) + dev_priv->savePFIT_CONTROL = I915_READ(PFIT_CONTROL); + dev_priv->saveLVDSPP_ON = I915_READ(LVDSPP_ON); + dev_priv->saveLVDSPP_OFF = I915_READ(LVDSPP_OFF); + dev_priv->savePP_CYCLE = I915_READ(PP_CYCLE); + + /* FIXME: save TV & SDVO state */ + + /* FBC state */ + dev_priv->saveFBC_CFB_BASE = I915_READ(FBC_CFB_BASE); + dev_priv->saveFBC_LL_BASE = I915_READ(FBC_LL_BASE); + dev_priv->saveFBC_CONTROL2 = I915_READ(FBC_CONTROL2); + dev_priv->saveFBC_CONTROL = I915_READ(FBC_CONTROL); + + /* Interrupt state */ + dev_priv->saveIIR = I915_READ(I915REG_INT_IDENTITY_R); + dev_priv->saveIER = I915_READ(I915REG_INT_ENABLE_R); + dev_priv->saveIMR = I915_READ(I915REG_INT_MASK_R); + + /* VGA state */ + dev_priv->saveVCLK_DIVISOR_VGA0 = I915_READ(VCLK_DIVISOR_VGA0); + dev_priv->saveVCLK_DIVISOR_VGA1 = I915_READ(VCLK_DIVISOR_VGA1); + dev_priv->saveVCLK_POST_DIV = I915_READ(VCLK_POST_DIV); + dev_priv->saveVGACNTRL = I915_READ(VGACNTRL); + + /* Clock gating state */ + dev_priv->saveDSPCLK_GATE_D = I915_READ(DSPCLK_GATE_D); + + /* Cache mode state */ + dev_priv->saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); + + /* Memory Arbitration state */ + dev_priv->saveMI_ARB_STATE = I915_READ(MI_ARB_STATE); + + /* Scratch space */ + for (i = 0; i < 16; i++) { + dev_priv->saveSWF0[i] = I915_READ(SWF0 + (i << 2)); + dev_priv->saveSWF1[i] = I915_READ(SWF10 + (i << 2)); + } + for (i = 0; i < 3; i++) + dev_priv->saveSWF2[i] = I915_READ(SWF30 + (i << 2)); + + i915_save_vga(dev); + + if (state.event == PM_EVENT_SUSPEND) { + /* Shut down the device */ + pci_disable_device(dev->pdev); + pci_set_power_state(dev->pdev, PCI_D3hot); + } + + return 0; +} + +static int i915_resume(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int i; + + pci_set_power_state(dev->pdev, PCI_D0); + pci_restore_state(dev->pdev); + if (pci_enable_device(dev->pdev)) + return -1; + + pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB); + + /* Pipe & plane A info */ + /* Prime the clock */ + if (dev_priv->saveDPLL_A & DPLL_VCO_ENABLE) { + I915_WRITE(DPLL_A, dev_priv->saveDPLL_A & + ~DPLL_VCO_ENABLE); + udelay(150); + } + I915_WRITE(FPA0, dev_priv->saveFPA0); + I915_WRITE(FPA1, dev_priv->saveFPA1); + /* Actually enable it */ + I915_WRITE(DPLL_A, dev_priv->saveDPLL_A); + udelay(150); + if (IS_I965G(dev)) + I915_WRITE(DPLL_A_MD, dev_priv->saveDPLL_A_MD); + udelay(150); + + /* Restore mode */ + I915_WRITE(HTOTAL_A, dev_priv->saveHTOTAL_A); + I915_WRITE(HBLANK_A, dev_priv->saveHBLANK_A); + I915_WRITE(HSYNC_A, dev_priv->saveHSYNC_A); + I915_WRITE(VTOTAL_A, dev_priv->saveVTOTAL_A); + I915_WRITE(VBLANK_A, dev_priv->saveVBLANK_A); + I915_WRITE(VSYNC_A, dev_priv->saveVSYNC_A); + I915_WRITE(BCLRPAT_A, dev_priv->saveBCLRPAT_A); + + /* Restore plane info */ + I915_WRITE(DSPASIZE, dev_priv->saveDSPASIZE); + I915_WRITE(DSPAPOS, dev_priv->saveDSPAPOS); + I915_WRITE(PIPEASRC, dev_priv->savePIPEASRC); + I915_WRITE(DSPABASE, dev_priv->saveDSPABASE); + I915_WRITE(DSPASTRIDE, dev_priv->saveDSPASTRIDE); + if (IS_I965G(dev)) { + I915_WRITE(DSPASURF, dev_priv->saveDSPASURF); + I915_WRITE(DSPATILEOFF, dev_priv->saveDSPATILEOFF); + } + + I915_WRITE(PIPEACONF, dev_priv->savePIPEACONF); + + i915_restore_palette(dev, PIPE_A); + /* Enable the plane */ + I915_WRITE(DSPACNTR, dev_priv->saveDSPACNTR); + I915_WRITE(DSPABASE, I915_READ(DSPABASE)); + + /* Pipe & plane B info */ + if (dev_priv->saveDPLL_B & DPLL_VCO_ENABLE) { + I915_WRITE(DPLL_B, dev_priv->saveDPLL_B & + ~DPLL_VCO_ENABLE); + udelay(150); + } + I915_WRITE(FPB0, dev_priv->saveFPB0); + I915_WRITE(FPB1, dev_priv->saveFPB1); + /* Actually enable it */ + I915_WRITE(DPLL_B, dev_priv->saveDPLL_B); + udelay(150); + if (IS_I965G(dev)) + I915_WRITE(DPLL_B_MD, dev_priv->saveDPLL_B_MD); + udelay(150); + + /* Restore mode */ + I915_WRITE(HTOTAL_B, dev_priv->saveHTOTAL_B); + I915_WRITE(HBLANK_B, dev_priv->saveHBLANK_B); + I915_WRITE(HSYNC_B, dev_priv->saveHSYNC_B); + I915_WRITE(VTOTAL_B, dev_priv->saveVTOTAL_B); + I915_WRITE(VBLANK_B, dev_priv->saveVBLANK_B); + I915_WRITE(VSYNC_B, dev_priv->saveVSYNC_B); + I915_WRITE(BCLRPAT_B, dev_priv->saveBCLRPAT_B); + + /* Restore plane info */ + I915_WRITE(DSPBSIZE, dev_priv->saveDSPBSIZE); + I915_WRITE(DSPBPOS, dev_priv->saveDSPBPOS); + I915_WRITE(PIPEBSRC, dev_priv->savePIPEBSRC); + I915_WRITE(DSPBBASE, dev_priv->saveDSPBBASE); + I915_WRITE(DSPBSTRIDE, dev_priv->saveDSPBSTRIDE); + if (IS_I965G(dev)) { + I915_WRITE(DSPBSURF, dev_priv->saveDSPBSURF); + I915_WRITE(DSPBTILEOFF, dev_priv->saveDSPBTILEOFF); + } + + I915_WRITE(PIPEBCONF, dev_priv->savePIPEBCONF); + + i915_restore_palette(dev, PIPE_B); + /* Enable the plane */ + I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR); + I915_WRITE(DSPBBASE, I915_READ(DSPBBASE)); + + /* CRT state */ + I915_WRITE(ADPA, dev_priv->saveADPA); + + /* LVDS state */ + if (IS_I965G(dev)) + I915_WRITE(BLC_PWM_CTL2, dev_priv->saveBLC_PWM_CTL2); + if (IS_MOBILE(dev) && !IS_I830(dev)) + I915_WRITE(LVDS, dev_priv->saveLVDS); + if (!IS_I830(dev) && !IS_845G(dev)) + I915_WRITE(PFIT_CONTROL, dev_priv->savePFIT_CONTROL); + + I915_WRITE(PFIT_PGM_RATIOS, dev_priv->savePFIT_PGM_RATIOS); + I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL); + I915_WRITE(LVDSPP_ON, dev_priv->saveLVDSPP_ON); + I915_WRITE(LVDSPP_OFF, dev_priv->saveLVDSPP_OFF); + I915_WRITE(PP_CYCLE, dev_priv->savePP_CYCLE); + I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL); + + /* FIXME: restore TV & SDVO state */ + + /* FBC info */ + I915_WRITE(FBC_CFB_BASE, dev_priv->saveFBC_CFB_BASE); + I915_WRITE(FBC_LL_BASE, dev_priv->saveFBC_LL_BASE); + I915_WRITE(FBC_CONTROL2, dev_priv->saveFBC_CONTROL2); + I915_WRITE(FBC_CONTROL, dev_priv->saveFBC_CONTROL); + + /* VGA state */ + I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL); + I915_WRITE(VCLK_DIVISOR_VGA0, dev_priv->saveVCLK_DIVISOR_VGA0); + I915_WRITE(VCLK_DIVISOR_VGA1, dev_priv->saveVCLK_DIVISOR_VGA1); + I915_WRITE(VCLK_POST_DIV, dev_priv->saveVCLK_POST_DIV); + udelay(150); + + /* Clock gating state */ + I915_WRITE (DSPCLK_GATE_D, dev_priv->saveDSPCLK_GATE_D); + + /* Cache mode state */ + I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000); + + /* Memory arbitration state */ + I915_WRITE (MI_ARB_STATE, dev_priv->saveMI_ARB_STATE | 0xffff0000); + + for (i = 0; i < 16; i++) { + I915_WRITE(SWF0 + (i << 2), dev_priv->saveSWF0[i]); + I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i+7]); + } + for (i = 0; i < 3; i++) + I915_WRITE(SWF30 + (i << 2), dev_priv->saveSWF2[i]); + + i915_restore_vga(dev); + + return 0; +} + static struct drm_driver driver = { /* don't use mtrr's here, the Xserver or user space app should * deal with them for intel hardware. @@ -47,8 +536,11 @@ DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL | DRIVER_IRQ_VBL2, .load = i915_driver_load, + .unload = i915_driver_unload, .lastclose = i915_driver_lastclose, .preclose = i915_driver_preclose, + .suspend = i915_suspend, + .resume = i915_resume, .device_is_agp = i915_driver_device_is_agp, .vblank_wait = i915_driver_vblank_wait, .vblank_wait2 = i915_driver_vblank_wait2, --- linux-2.6.24.orig/drivers/char/drm/drmP.h +++ linux-2.6.24/drivers/char/drm/drmP.h @@ -567,6 +567,8 @@ void (*postclose) (struct drm_device *, struct drm_file *); void (*lastclose) (struct drm_device *); int (*unload) (struct drm_device *); + int (*suspend) (struct drm_device *, pm_message_t state); + int (*resume) (struct drm_device *); int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv); void (*dma_ready) (struct drm_device *); int (*dma_quiescent) (struct drm_device *); @@ -642,6 +644,7 @@ * may contain multiple heads. */ struct drm_device { + struct device dev; /**< Linux device */ char *unique; /**< Unique identifier: e.g., busid */ int unique_len; /**< Length of unique field */ char *devname; /**< For /proc/interrupts */ @@ -1061,11 +1064,11 @@ extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); /* sysfs support (drm_sysfs.c) */ +struct drm_sysfs_class; extern struct class *drm_sysfs_create(struct module *owner, char *name); -extern void drm_sysfs_destroy(struct class *cs); -extern struct class_device *drm_sysfs_device_add(struct class *cs, - struct drm_head *head); -extern void drm_sysfs_device_remove(struct class_device *class_dev); +extern void drm_sysfs_destroy(void); +extern int drm_sysfs_device_add(struct drm_device *dev, struct drm_head *head); +extern void drm_sysfs_device_remove(struct drm_device *dev); /* * Basic memory manager support (drm_mm.c) --- linux-2.6.24.orig/drivers/char/drm/via_chrome9_dma.h +++ linux-2.6.24/drivers/char/drm/via_chrome9_dma.h @@ -0,0 +1,68 @@ +/* + * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice + * (including the next paragraph) shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL VIA, S3 GRAPHICS, AND/OR + * ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef _VIA_CHROME9_DMA_H_ +#define _VIA_CHROME9_DMA_H_ + +#define MAX_BCI_BUFFER_SIZE 16*1024*1024 + +enum cmd_request_type { + CM_REQUEST_BCI, + CM_REQUEST_DMA, + CM_REQUEST_RB, + CM_REQUEST_RB_FORCED_DMA, + CM_REQUEST_NOTAVAILABLE +}; + +struct cmd_get_space { + unsigned int dwRequestSize; + enum cmd_request_type hint; + volatile unsigned int *pCmdData; +}; + +struct cmd_release_space { + unsigned int dwReleaseSize; +}; + +extern int via_chrome9_hw_init(struct drm_device *dev, + struct drm_via_chrome9_init *init); +extern int via_chrome9_ioctl_flush(struct drm_device *dev, void *data, + struct drm_file *file_priv); +extern int via_chrome9_ioctl_free(struct drm_device *dev, void *data, + struct drm_file *file_prev); +extern int via_chrome9_ioctl_wait_chip_idle(struct drm_device *dev, + void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_flush_cache(struct drm_device *dev, + void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_flush(struct drm_device *dev, void *data, + struct drm_file *file_priv); +extern int via_chrome9_ioctl_free(struct drm_device *dev, void *data, + struct drm_file *file_priv); +extern unsigned int ProtectSizeValue(unsigned int size); +extern void SetAGPDoubleCmd_inv(struct drm_device *dev); +extern void SetAGPRingCmdRegs_inv(struct drm_device *dev); + +#endif --- linux-2.6.24.orig/drivers/char/drm/via_chrome9_dma.c +++ linux-2.6.24/drivers/char/drm/via_chrome9_dma.c @@ -0,0 +1,1147 @@ +/* + * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice + * (including the next paragraph) shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL VIA, S3 GRAPHICS, AND/OR + * ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "drmP.h" +#include "drm.h" +#include "via_chrome9_drm.h" +#include "via_chrome9_drv.h" +#include "via_chrome9_3d_reg.h" +#include "via_chrome9_dma.h" + +#define NULLCOMMANDNUMBER 256 +unsigned int NULL_COMMAND_INV[4] = + { 0xCC000000, 0xCD000000, 0xCE000000, 0xCF000000 }; + +void +via_chrome9ke_assert(int a) +{ +} + +unsigned int +ProtectSizeValue(unsigned int size) +{ + unsigned int i; + for (i = 0; i < 8; i++) + if ((size > (1 << (i + 12))) + && (size <= (1 << (i + 13)))) + return (i + 1); + return 0; +} + +static unsigned int +InitPCIEGART(struct drm_via_chrome9_private *dev_priv) +{ + unsigned int *pGARTTable; + unsigned int i, entries, GARTOffset; + unsigned char sr6a, sr6b, sr6c, sr6f, sr7b; + + if (!dev_priv->pagetable_map.pagetable_size) + return 0; + + entries = dev_priv->pagetable_map.pagetable_size / sizeof(unsigned int); + + pGARTTable = + ioremap_nocache(dev_priv->fb_base_address + + dev_priv->pagetable_map.pagetable_offset, + dev_priv->pagetable_map.pagetable_size); + if (pGARTTable) + dev_priv->pagetable_map.pagetable_handle = pGARTTable; + else + return 0; + + /*set gart table base */ + GARTOffset = dev_priv->pagetable_map.pagetable_offset; + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c &= (~0x80); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + sr6a = (unsigned char) ((GARTOffset & 0xff000) >> 12); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6a); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6a); + + sr6b = (unsigned char) ((GARTOffset & 0xff00000) >> 20); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6b); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6b); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c |= ((unsigned char) ((GARTOffset >> 28) & 0x01)); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x7b); + sr7b = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr7b &= (~0x0f); + sr7b |= ProtectSizeValue(dev_priv->pagetable_map.pagetable_size); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr7b); + + for (i = 0; i < entries; i++) + writel(0x80000000, pGARTTable + i); + /*flush */ + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6f); + do { + sr6f = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + } + while (sr6f & 0x80) + ; + + sr6f |= 0x80; + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6f); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c |= 0x80; + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + return 1; +} + + +static unsigned int * +AllocAndBindPCIEMemory(struct drm_via_chrome9_private *dev_priv, + unsigned int size, unsigned int offset) +{ + unsigned int *addrlinear; + unsigned int *pGARTTable; + unsigned int entries, alignedoffset, i; + unsigned char sr6c, sr6f; + + if (!size) + return NULL; + + entries = (size + PAGE_SIZE - 1) / PAGE_SIZE; + alignedoffset = (offset + PAGE_SIZE - 1) / PAGE_SIZE; + + if ((entries + alignedoffset) > + (dev_priv->pagetable_map.pagetable_size / sizeof(unsigned int))) + return NULL; + + addrlinear = + __vmalloc(entries * PAGE_SIZE, GFP_KERNEL | __GFP_HIGHMEM, + PAGE_KERNEL_NOCACHE); + + if (!addrlinear) + return NULL; + + pGARTTable = dev_priv->pagetable_map.pagetable_handle; + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c &= (~0x80); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6f); + do { + sr6f = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + } + while (sr6f & 0x80) + ; + + for (i = 0; i < entries; i++) + writel(page_to_pfn + (vmalloc_to_page((void *) addrlinear + PAGE_SIZE * i)) & + 0x3fffffff, pGARTTable + i + alignedoffset); + + sr6f |= 0x80; + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6f); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c |= 0x80; + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + return addrlinear; + +} + +void +SetAGPDoubleCmd_inv(struct drm_device *dev) +{ + /* we now don't use double buffer */ + return; +} + +void +SetAGPRingCmdRegs_inv(struct drm_device *dev) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = + (struct drm_via_chrome9_DMA_manager *) dev_priv->dma_manager; + unsigned int AGPBufLinearBase = 0, AGPBufPhysicalBase = 0; + unsigned long *pFree; + unsigned int dwStart, dwEnd, dwPause, AGPCurrAddr, AGPCurStat, CurrAGP; + unsigned int dwReg60, dwReg61, dwReg62, dwReg63, + dwReg64, dwReg65, dwJump; + + lpcmDMAManager->pFree = lpcmDMAManager->pBeg; + + AGPBufLinearBase = (unsigned int) lpcmDMAManager->addr_linear; + AGPBufPhysicalBase = + (dev_priv->chip_agp == + CHIP_PCIE) ? 0 : (unsigned int) dev->agp->base + + lpcmDMAManager->pPhysical; + /*add shadow offset */ + + CurrAGP = + GetMMIORegister(dev_priv->mmio->handle, INV_RB_AGPCMD_CURRADDR); + AGPCurStat = + GetMMIORegister(dev_priv->mmio->handle, INV_RB_AGPCMD_STATUS); + + if (AGPCurStat & INV_AGPCMD_InPause) { + AGPCurrAddr = + GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + pFree = (unsigned long *) (AGPBufLinearBase + AGPCurrAddr - + AGPBufPhysicalBase); + ADDCmdHeader2_INVI(pFree, INV_REG_CR_TRANS, INV_ParaType_Dummy); + if (dev_priv->chip_sub_index == CHIP_H6S2) + do { + ADDCmdData_INVI(pFree, 0xCCCCCCC0); + ADDCmdData_INVI(pFree, 0xDDD00000); + } + while ((u32)((unsigned int) pFree) & 0x7f) + ; + /*for 8*128bit aligned */ + else + do { + ADDCmdData_INVI(pFree, 0xCCCCCCC0); + ADDCmdData_INVI(pFree, 0xDDD00000); + } + while ((u32) ((unsigned int) pFree) & 0x1f) + ; + /*for 256bit aligned */ + dwPause = + (u32) (((unsigned int) pFree) - AGPBufLinearBase + + AGPBufPhysicalBase - 16); + + dwReg64 = INV_SubA_HAGPBpL | INV_HWBasL(dwPause); + dwReg65 = + INV_SubA_HAGPBpID | INV_HWBasH(dwPause) | + INV_HAGPBpID_STOP; + + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_TRANS, + INV_ParaType_PreCR); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + dwReg64); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + dwReg65); + + while ((GetMMIORegister + (dev_priv->mmio->handle, + INV_RB_ENG_STATUS) & INV_ENG_BUSY_ALL)); + } + dwStart = + (u32) ((unsigned int) lpcmDMAManager->pBeg - AGPBufLinearBase + + AGPBufPhysicalBase); + dwEnd = (u32) ((unsigned int) lpcmDMAManager->pEnd - AGPBufLinearBase + + AGPBufPhysicalBase); + + lpcmDMAManager->pFree = lpcmDMAManager->pBeg; + if (dev_priv->chip_sub_index == CHIP_H6S2) { + ADDCmdHeader2_INVI(lpcmDMAManager->pFree, INV_REG_CR_TRANS, + INV_ParaType_Dummy); + do { + ADDCmdData_INVI(lpcmDMAManager->pFree, 0xCCCCCCC0); + ADDCmdData_INVI(lpcmDMAManager->pFree, 0xDDD00000); + } + while ((u32)((unsigned long *) lpcmDMAManager->pFree) & 0x7f) + ; + } + dwJump = 0xFFFFFFF0; + dwPause = + (u32)(((unsigned int) lpcmDMAManager->pFree) - + 16 - AGPBufLinearBase + AGPBufPhysicalBase); + + DRM_DEBUG("dwStart = %08x, dwEnd = %08x, dwPause = %08x\n", dwStart, + dwEnd, dwPause); + + dwReg60 = INV_SubA_HAGPBstL | INV_HWBasL(dwStart); + dwReg61 = INV_SubA_HAGPBstH | INV_HWBasH(dwStart); + dwReg62 = INV_SubA_HAGPBendL | INV_HWBasL(dwEnd); + dwReg63 = INV_SubA_HAGPBendH | INV_HWBasH(dwEnd); + dwReg64 = INV_SubA_HAGPBpL | INV_HWBasL(dwPause); + dwReg65 = INV_SubA_HAGPBpID | INV_HWBasH(dwPause) | INV_HAGPBpID_PAUSE; + + if (dev_priv->chip_sub_index == CHIP_H6S2) + dwReg60 |= 0x01; + + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_TRANS, + INV_ParaType_PreCR); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg60); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg61); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg62); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg63); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg64); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg65); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + INV_SubA_HAGPBjumpL | INV_HWBasL(dwJump)); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + INV_SubA_HAGPBjumpH | INV_HWBasH(dwJump)); + + /* Trigger AGP cycle */ + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + INV_SubA_HFthRCM | INV_HFthRCM_10 | INV_HAGPBTrig); + + /*for debug */ + CurrAGP = + GetMMIORegister(dev_priv->mmio->handle, INV_RB_AGPCMD_CURRADDR); + + lpcmDMAManager->pInUseBySW = lpcmDMAManager->pFree; +} + +/* Do hw intialization and determine whether to use dma or mmio to +talk with hw */ +int +via_chrome9_hw_init(struct drm_device *dev, + struct drm_via_chrome9_init *init) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + unsigned retval = 0; + unsigned int *pGARTTable, *addrlinear = NULL; + int pages; + struct drm_clb_event_tag_info *event_tag_info; + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = NULL; + + if (init->chip_agp == CHIP_PCIE) { + dev_priv->pagetable_map.pagetable_offset = + init->garttable_offset; + dev_priv->pagetable_map.pagetable_size = init->garttable_size; + dev_priv->agp_size = init->agp_tex_size; + /*Henry :prepare for PCIE texture buffer */ + } else { + dev_priv->pagetable_map.pagetable_offset = 0; + dev_priv->pagetable_map.pagetable_size = 0; + } + + dev_priv->dma_manager = + kmalloc(sizeof(struct drm_via_chrome9_DMA_manager), GFP_KERNEL); + if (!dev_priv->dma_manager) { + DRM_ERROR("could not allocate system for dma_manager!\n"); + return -ENOMEM; + } + + lpcmDMAManager = + (struct drm_via_chrome9_DMA_manager *) dev_priv->dma_manager; + ((struct drm_via_chrome9_DMA_manager *) + dev_priv->dma_manager)->DMASize = init->DMA_size; + ((struct drm_via_chrome9_DMA_manager *) + dev_priv->dma_manager)->pPhysical = init->DMA_phys_address; + + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_TRANS, 0x00110000); + if (dev_priv->chip_sub_index == CHIP_H6S2) { + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + 0x06000000); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + 0x07100000); + } else { + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + 0x02000000); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + 0x03100000); + } + + /* Specify fence command read back ID */ + /* Default the read back ID is CR */ + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_TRANS, + INV_ParaType_PreCR); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + INV_SubA_HSetRBGID | INV_HSetRBGID_CR); + + DRM_DEBUG("begin to init\n"); + + if (dev_priv->chip_sub_index == CHIP_H6S2) { + dev_priv->pcie_vmalloc_nocache = 0; + if (dev_priv->pagetable_map.pagetable_size) + retval = InitPCIEGART(dev_priv); + + if (retval && dev_priv->drm_agp_type != DRM_AGP_DISABLED) { + addrlinear = + AllocAndBindPCIEMemory(dev_priv, + lpcmDMAManager->DMASize + + dev_priv->agp_size, 0); + if (addrlinear) { + dev_priv->pcie_vmalloc_nocache = (unsigned long) + addrlinear; + } else { + dev_priv->bci_buffer = + vmalloc(MAX_BCI_BUFFER_SIZE); + dev_priv->drm_agp_type = DRM_AGP_DISABLED; + } + } else { + dev_priv->bci_buffer = vmalloc(MAX_BCI_BUFFER_SIZE); + dev_priv->drm_agp_type = DRM_AGP_DISABLED; + } + } else { + if (dev_priv->drm_agp_type != DRM_AGP_DISABLED) { + pGARTTable = NULL; + addrlinear = (unsigned int *) + ioremap(dev->agp->base + + lpcmDMAManager->pPhysical, + lpcmDMAManager->DMASize); + dev_priv->bci_buffer = NULL; + } else { + dev_priv->bci_buffer = vmalloc(MAX_BCI_BUFFER_SIZE); + /*Homer, BCI path always use this block of memory8 */ + } + } + + /*till here we have known whether support dma or not */ + pages = dev->sg->pages; + event_tag_info = vmalloc(sizeof(struct drm_clb_event_tag_info)); + memset(event_tag_info, 0, sizeof(struct drm_clb_event_tag_info)); + if (!event_tag_info) + return DRM_ERROR(" event_tag_info allocate error!"); + + /* aligned to 16k alignment */ + event_tag_info->linear_address = + (int + *) (((unsigned int) dev_priv->shadow_map.shadow_handle + + 0x3fff) & 0xffffc000); + event_tag_info->event_tag_linear_address = + event_tag_info->linear_address + 3; + dev_priv->event_tag_info = (void *) event_tag_info; + dev_priv->max_apertures = NUMBER_OF_APERTURES_CLB; + + /* Initialize DMA data structure */ + lpcmDMAManager->DMASize /= sizeof(unsigned int); + lpcmDMAManager->pBeg = addrlinear; + lpcmDMAManager->pFree = lpcmDMAManager->pBeg; + lpcmDMAManager->pInUseBySW = lpcmDMAManager->pBeg; + lpcmDMAManager->pInUseByHW = lpcmDMAManager->pBeg; + lpcmDMAManager->LastIssuedEventTag = (unsigned int) (unsigned long *) + lpcmDMAManager->pBeg; + lpcmDMAManager->ppInUseByHW = + (unsigned int **) ((char *) (dev_priv->mmio->handle) + + INV_RB_AGPCMD_CURRADDR); + lpcmDMAManager->bDMAAgp = dev_priv->chip_agp; + lpcmDMAManager->addr_linear = (unsigned int *) addrlinear; + + if (dev_priv->drm_agp_type == DRM_AGP_DOUBLE_BUFFER) { + lpcmDMAManager->MaxKickoffSize = lpcmDMAManager->DMASize >> 1; + lpcmDMAManager->pEnd = + lpcmDMAManager->addr_linear + + (lpcmDMAManager->DMASize >> 1) - 1; + SetAGPDoubleCmd_inv(dev); + if (dev_priv->chip_sub_index == CHIP_H6S2) { + DRM_INFO("DMA buffer initialized finished. "); + DRM_INFO("Use PCIE Double Buffer type!\n"); + DRM_INFO("Total PCIE DMA buffer size = %8d bytes. \n", + lpcmDMAManager->DMASize << 2); + } else { + DRM_INFO("DMA buffer initialized finished. "); + DRM_INFO("Use AGP Double Buffer type!\n"); + DRM_INFO("Total AGP DMA buffer size = %8d bytes. \n", + lpcmDMAManager->DMASize << 2); + } + } else if (dev_priv->drm_agp_type == DRM_AGP_RING_BUFFER) { + lpcmDMAManager->MaxKickoffSize = lpcmDMAManager->DMASize; + lpcmDMAManager->pEnd = + lpcmDMAManager->addr_linear + lpcmDMAManager->DMASize; + SetAGPRingCmdRegs_inv(dev); + if (dev_priv->chip_sub_index == CHIP_H6S2) { + DRM_INFO("DMA buffer initialized finished. \n"); + DRM_INFO("Use PCIE Ring Buffer type!"); + DRM_INFO("Total PCIE DMA buffer size = %8d bytes. \n", + lpcmDMAManager->DMASize << 2); + } else { + DRM_INFO("DMA buffer initialized finished. "); + DRM_INFO("Use AGP Ring Buffer type!\n"); + DRM_INFO("Total AGP DMA buffer size = %8d bytes. \n", + lpcmDMAManager->DMASize << 2); + } + } else if (dev_priv->drm_agp_type == DRM_AGP_DISABLED) { + lpcmDMAManager->MaxKickoffSize = 0x0; + if (dev_priv->chip_sub_index == CHIP_H6S2) + DRM_INFO("PCIE init failed! Use PCI\n"); + else + DRM_INFO("AGP init failed! Use PCI\n"); + } + return 0; +} + +static void +kickoff_bci_inv(struct drm_via_chrome9_private *dev_priv, + struct drm_via_chrome9_flush *dma_info) +{ + u32 HdType, dwQWCount, i, dwCount, Addr1, Addr2, SWPointer, + SWPointerEnd; + unsigned long *pCmdData; + int result; + + /*pCmdData = __s3gke_vmalloc(dma_info->cmd_size<<2); */ + pCmdData = dev_priv->bci_buffer; + + if (!pCmdData) + return; + + result = copy_from_user((int *) pCmdData, dma_info->usermode_dma_buf, + dma_info->cmd_size << 2); + + SWPointer = 0; + SWPointerEnd = (u32) dma_info->cmd_size; + while (SWPointer < SWPointerEnd) { + HdType = pCmdData[SWPointer] & INV_AGPHeader_MASK; + switch (HdType) { + case INV_AGPHeader0: + case INV_AGPHeader5: + dwQWCount = pCmdData[SWPointer + 1]; + SWPointer += 4; + + for (i = 0; i < dwQWCount; i++) { + SetMMIORegister(dev_priv->mmio->handle, + pCmdData[SWPointer], + pCmdData[SWPointer + 1]); + SWPointer += 2; + } + break; + + case INV_AGPHeader1: + dwCount = pCmdData[SWPointer + 1]; + Addr1 = 0x0; + SWPointer += 4; /* skip 128-bit. */ + + for (; dwCount > 0; dwCount--, SWPointer++, + Addr1 += 4) { + SetMMIORegister(dev_priv->hostBlt->handle, + Addr1, pCmdData[SWPointer]); + } + break; + + case INV_AGPHeader4: + dwCount = pCmdData[SWPointer + 1]; + Addr1 = pCmdData[SWPointer] & 0x0000FFFF; + SWPointer += 4; /* skip 128-bit. */ + + for (; dwCount > 0; dwCount--, SWPointer++) + SetMMIORegister(dev_priv->mmio->handle, Addr1, + pCmdData[SWPointer]); + break; + + case INV_AGPHeader2: + Addr1 = pCmdData[SWPointer + 1] & 0xFFFF; + Addr2 = pCmdData[SWPointer] & 0xFFFF; + + /* Write first data (either ParaType or whatever) to + Addr1 */ + SetMMIORegister(dev_priv->mmio->handle, Addr1, + pCmdData[SWPointer + 2]); + SWPointer += 4; + + /* The following data are all written to Addr2, + until another header is met */ + while (!IS_AGPHEADER_INV(pCmdData[SWPointer]) + && (SWPointer < SWPointerEnd)) { + SetMMIORegister(dev_priv->mmio->handle, Addr2, + pCmdData[SWPointer]); + SWPointer++; + } + break; + + case INV_AGPHeader3: + Addr1 = pCmdData[SWPointer] & 0xFFFF; + Addr2 = Addr1 + 4; + dwCount = pCmdData[SWPointer + 1]; + + /* Write first data (either ParaType or whatever) to + Addr1 */ + SetMMIORegister(dev_priv->mmio->handle, Addr1, + pCmdData[SWPointer + 2]); + SWPointer += 4; + + for (i = 0; i < dwCount; i++) { + SetMMIORegister(dev_priv->mmio->handle, Addr2, + pCmdData[SWPointer]); + SWPointer++; + } + break; + + case INV_AGPHeader6: + break; + + case INV_AGPHeader7: + break; + + default: + SWPointer += 4; /* Advance to next header */ + } + + SWPointer = (SWPointer + 3) & ~3; + } +} + +void +kickoff_dma_db_inv(struct drm_device *dev) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = + dev_priv->dma_manager; + + u32 BufferSize = (u32) (lpcmDMAManager->pFree - lpcmDMAManager->pBeg); + + unsigned int AGPBufLinearBase = + (unsigned int) lpcmDMAManager->addr_linear; + unsigned int AGPBufPhysicalBase = + (unsigned int) dev->agp->base + lpcmDMAManager->pPhysical; + /*add shadow offset */ + + unsigned int dwStart, dwEnd, dwPause; + unsigned int dwReg60, dwReg61, dwReg62, dwReg63, dwReg64, dwReg65; + unsigned int CR_Status; + + if (BufferSize == 0) + return; + + /* 256-bit alignment of AGP pause address */ + if ((u32) ((unsigned long *) lpcmDMAManager->pFree) & 0x1f) { + ADDCmdHeader2_INVI(lpcmDMAManager->pFree, INV_REG_CR_TRANS, + INV_ParaType_Dummy); + do { + ADDCmdData_INVI(lpcmDMAManager->pFree, 0xCCCCCCC0); + ADDCmdData_INVI(lpcmDMAManager->pFree, 0xDDD00000); + } + while (((unsigned int) lpcmDMAManager->pFree) & 0x1f) + ; + } + + dwStart = + (u32) (unsigned long *)lpcmDMAManager->pBeg - + AGPBufLinearBase + AGPBufPhysicalBase; + dwEnd = (u32) (unsigned long *)lpcmDMAManager->pEnd - + AGPBufLinearBase + AGPBufPhysicalBase; + dwPause = + (u32)(unsigned long *)lpcmDMAManager->pFree - + AGPBufLinearBase + AGPBufPhysicalBase - 4; + + dwReg60 = INV_SubA_HAGPBstL | INV_HWBasL(dwStart); + dwReg61 = INV_SubA_HAGPBstH | INV_HWBasH(dwStart); + dwReg62 = INV_SubA_HAGPBendL | INV_HWBasL(dwEnd); + dwReg63 = INV_SubA_HAGPBendH | INV_HWBasH(dwEnd); + dwReg64 = INV_SubA_HAGPBpL | INV_HWBasL(dwPause); + dwReg65 = INV_SubA_HAGPBpID | INV_HWBasH(dwPause) | INV_HAGPBpID_STOP; + + /* wait CR idle */ + CR_Status = GetMMIORegister(dev_priv->mmio->handle, INV_RB_ENG_STATUS); + while (CR_Status & INV_ENG_BUSY_CR) + CR_Status = + GetMMIORegister(dev_priv->mmio->handle, + INV_RB_ENG_STATUS); + + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_TRANS, + INV_ParaType_PreCR); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg60); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg61); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg62); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg63); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg64); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg65); + + /* Trigger AGP cycle */ + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + INV_SubA_HFthRCM | INV_HFthRCM_10 | INV_HAGPBTrig); + + if (lpcmDMAManager->pBeg == lpcmDMAManager->addr_linear) { + /* The second AGP command buffer */ + lpcmDMAManager->pBeg = + lpcmDMAManager->addr_linear + + (lpcmDMAManager->DMASize >> 2); + lpcmDMAManager->pEnd = + lpcmDMAManager->addr_linear + lpcmDMAManager->DMASize; + lpcmDMAManager->pFree = lpcmDMAManager->pBeg; + } else { + /* The first AGP command buffer */ + lpcmDMAManager->pBeg = lpcmDMAManager->addr_linear; + lpcmDMAManager->pEnd = + lpcmDMAManager->addr_linear + + (lpcmDMAManager->DMASize / 2) - 1; + lpcmDMAManager->pFree = lpcmDMAManager->pBeg; + } + CR_Status = GetMMIORegister(dev_priv->mmio->handle, INV_RB_ENG_STATUS); +} + + +void +kickoff_dma_ring_inv(struct drm_device *dev) +{ + unsigned int dwPause, dwReg64, dwReg65; + + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = + dev_priv->dma_manager; + + unsigned int AGPBufLinearBase = + (unsigned int) lpcmDMAManager->addr_linear; + unsigned int AGPBufPhysicalBase = + (dev_priv->chip_agp == + CHIP_PCIE) ? 0 : (unsigned int) dev->agp->base + + lpcmDMAManager->pPhysical; + /*add shadow offset */ + + /* 256-bit alignment of AGP pause address */ + if (dev_priv->chip_sub_index == CHIP_H6S2) { + if ((u32) + ((unsigned long *) lpcmDMAManager->pFree) & 0x7f) { + ADDCmdHeader2_INVI(lpcmDMAManager->pFree, + INV_REG_CR_TRANS, + INV_ParaType_Dummy); + do { + ADDCmdData_INVI(lpcmDMAManager->pFree, + 0xCCCCCCC0); + ADDCmdData_INVI(lpcmDMAManager->pFree, + 0xDDD00000); + } + while ((u32)((unsigned long *) lpcmDMAManager->pFree) & + 0x7f) + ; + } + } else { + if ((u32) + ((unsigned long *) lpcmDMAManager->pFree) & 0x1f) { + ADDCmdHeader2_INVI(lpcmDMAManager->pFree, + INV_REG_CR_TRANS, + INV_ParaType_Dummy); + do { + ADDCmdData_INVI(lpcmDMAManager->pFree, + 0xCCCCCCC0); + ADDCmdData_INVI(lpcmDMAManager->pFree, + 0xDDD00000); + } + while ((u32)((unsigned long *) lpcmDMAManager->pFree) & + 0x1f) + ; + } + } + + + dwPause = (u32) ((unsigned long *) lpcmDMAManager->pFree) + - AGPBufLinearBase + AGPBufPhysicalBase - 16; + + dwReg64 = INV_SubA_HAGPBpL | INV_HWBasL(dwPause); + dwReg65 = INV_SubA_HAGPBpID | INV_HWBasH(dwPause) | INV_HAGPBpID_PAUSE; + + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_TRANS, + INV_ParaType_PreCR); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg64); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg65); + + lpcmDMAManager->pInUseBySW = lpcmDMAManager->pFree; +} + +static int +waitchipidle_inv(struct drm_via_chrome9_private *dev_priv) +{ + unsigned int count = 50000; + unsigned int eng_status; + unsigned int engine_busy; + + do { + eng_status = + GetMMIORegister(dev_priv->mmio->handle, + INV_RB_ENG_STATUS); + engine_busy = eng_status & INV_ENG_BUSY_ALL; + count--; + } + while (engine_busy && count) + ; + if (count && engine_busy == 0) + return 0; + return -1; +} + +void +get_space_db_inv(struct drm_device *dev, + struct cmd_get_space *lpcmGetSpaceData) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = + dev_priv->dma_manager; + + unsigned int dwRequestSize = lpcmGetSpaceData->dwRequestSize; + if (dwRequestSize > lpcmDMAManager->MaxKickoffSize) { + DRM_INFO("too big DMA buffer request!!!\n"); + via_chrome9ke_assert(0); + *lpcmGetSpaceData->pCmdData = (unsigned int) NULL; + return; + } + + if ((lpcmDMAManager->pFree + dwRequestSize) > + (lpcmDMAManager->pEnd - INV_CMDBUF_THRESHOLD * 2)) + kickoff_dma_db_inv(dev); + + *lpcmGetSpaceData->pCmdData = (unsigned int) lpcmDMAManager->pFree; +} + +void +RewindRingAGP_inv(struct drm_device *dev) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = + dev_priv->dma_manager; + + unsigned int AGPBufLinearBase = + (unsigned int) lpcmDMAManager->addr_linear; + unsigned int AGPBufPhysicalBase = + (dev_priv->chip_agp == + CHIP_PCIE) ? 0 : (unsigned int) dev->agp->base + + lpcmDMAManager->pPhysical; + /*add shadow offset */ + + unsigned int dwPause, dwJump; + unsigned int dwReg66, dwReg67; + unsigned int dwReg64, dwReg65; + + ADDCmdHeader2_INVI(lpcmDMAManager->pFree, INV_REG_CR_TRANS, + INV_ParaType_Dummy); + ADDCmdData_INVI(lpcmDMAManager->pFree, 0xCCCCCCC7); + if (dev_priv->chip_sub_index == CHIP_H6S2) + while ((unsigned int) lpcmDMAManager->pFree & 0x7F) + ADDCmdData_INVI(lpcmDMAManager->pFree, 0xCCCCCCC7); + else + while ((unsigned int) lpcmDMAManager->pFree & 0x1F) + ADDCmdData_INVI(lpcmDMAManager->pFree, 0xCCCCCCC7); + dwJump = ((u32) ((unsigned long *) lpcmDMAManager->pFree)) + - AGPBufLinearBase + AGPBufPhysicalBase - 16; + + lpcmDMAManager->pFree = lpcmDMAManager->pBeg; + + dwPause = ((u32) ((unsigned long *) lpcmDMAManager->pFree)) + - AGPBufLinearBase + AGPBufPhysicalBase - 16; + + dwReg64 = INV_SubA_HAGPBpL | INV_HWBasL(dwPause); + dwReg65 = INV_SubA_HAGPBpID | INV_HWBasH(dwPause) | INV_HAGPBpID_PAUSE; + + dwReg66 = INV_SubA_HAGPBjumpL | INV_HWBasL(dwJump); + dwReg67 = INV_SubA_HAGPBjumpH | INV_HWBasH(dwJump); + + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_TRANS, + INV_ParaType_PreCR); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg66); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg67); + + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg64); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, dwReg65); + lpcmDMAManager->pInUseBySW = lpcmDMAManager->pFree; +} + + +void +get_space_ring_inv(struct drm_device *dev, + struct cmd_get_space *lpcmGetSpaceData) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = + dev_priv->dma_manager; + unsigned int dwUnFlushed; + unsigned int dwRequestSize = lpcmGetSpaceData->dwRequestSize; + + unsigned int AGPBufLinearBase = + (unsigned int) lpcmDMAManager->addr_linear; + unsigned int AGPBufPhysicalBase = + (dev_priv->chip_agp == + CHIP_PCIE) ? 0 : (unsigned int) dev->agp->base + + lpcmDMAManager->pPhysical; + /*add shadow offset */ + u32 BufStart, BufEnd, CurSW, CurHW, NextSW, BoundaryCheck; + + dwUnFlushed = + (unsigned int) (lpcmDMAManager->pFree - lpcmDMAManager->pBeg); + /*default bEnableModuleSwitch is on for metro,is off for rest */ + /*cmHW_Module_Switch is context-wide variable which is enough for 2d/3d + switch in a context. */ + /*But we must keep the dma buffer being wrapped head and tail by 3d cmds + when it is kicked off to kernel mode. */ + /*Get DMA Space (If requested, or no BCI space and BCI not forced. */ + + if (dwRequestSize > lpcmDMAManager->MaxKickoffSize) { + DRM_INFO("too big DMA buffer request!!!\n"); + via_chrome9ke_assert(0); + *lpcmGetSpaceData->pCmdData = 0; + return; + } + + if (dwUnFlushed + dwRequestSize > lpcmDMAManager->MaxKickoffSize) + kickoff_dma_ring_inv(dev); + + BufStart = + (u32)((unsigned int) lpcmDMAManager->pBeg) - AGPBufLinearBase + + AGPBufPhysicalBase; + BufEnd = (u32)((unsigned int) lpcmDMAManager->pEnd) - AGPBufLinearBase + + AGPBufPhysicalBase; + dwRequestSize = lpcmGetSpaceData->dwRequestSize << 2; + NextSW = (u32) ((unsigned int) lpcmDMAManager->pFree) + dwRequestSize + + INV_CMDBUF_THRESHOLD * 8 - AGPBufLinearBase + + AGPBufPhysicalBase; + + CurSW = (u32)((unsigned int) lpcmDMAManager->pFree) - AGPBufLinearBase + + AGPBufPhysicalBase; + CurHW = GetMMIORegister(dev_priv->mmio->handle, INV_RB_AGPCMD_CURRADDR); + + if (NextSW >= BufEnd) { + kickoff_dma_ring_inv(dev); + CurSW = (u32) ((unsigned int) lpcmDMAManager->pFree) - + AGPBufLinearBase + AGPBufPhysicalBase; + /* make sure the last rewind is completed */ + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + while (CurHW > CurSW) + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + /* Sometime the value read from HW is unreliable, + so need double confirm. */ + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + while (CurHW > CurSW) + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + BoundaryCheck = + BufStart + dwRequestSize + INV_QW_PAUSE_ALIGN * 16; + if (BoundaryCheck >= BufEnd) + /* If an empty command buffer can't hold + the request data. */ + via_chrome9ke_assert(0); + else { + /* We need to guarntee the new commands have no chance + to override the unexected commands or wait until there + is no unexecuted commands in agp buffer */ + if (CurSW <= BoundaryCheck) { + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + while (CurHW < CurSW) + CurHW = GetMMIORegister( + dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + /*Sometime the value read from HW is unreliable, + so need double confirm. */ + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + while (CurHW < CurSW) { + CurHW = GetMMIORegister( + dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + } + RewindRingAGP_inv(dev); + CurSW = (u32) ((unsigned long *) + lpcmDMAManager->pFree) - + AGPBufLinearBase + AGPBufPhysicalBase; + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + /* Waiting until hw pointer jump to start + and hw pointer will */ + /* equal to sw pointer */ + while (CurHW != CurSW) { + CurHW = GetMMIORegister( + dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + } + } else { + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + + while (CurHW <= BoundaryCheck) { + CurHW = GetMMIORegister( + dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + } + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + /* Sometime the value read from HW is + unreliable, so need double confirm. */ + while (CurHW <= BoundaryCheck) { + CurHW = GetMMIORegister( + dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + } + RewindRingAGP_inv(dev); + } + } + } else { + /* no need to rewind Ensure unexecuted agp commands will + not be override by new + agp commands */ + CurSW = (u32) ((unsigned int) lpcmDMAManager->pFree) - + AGPBufLinearBase + AGPBufPhysicalBase; + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + + while ((CurHW > CurSW) && (CurHW <= NextSW)) + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + + /* Sometime the value read from HW is unreliable, + so need double confirm. */ + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + while ((CurHW > CurSW) && (CurHW <= NextSW)) + CurHW = GetMMIORegister(dev_priv->mmio->handle, + INV_RB_AGPCMD_CURRADDR); + } + /*return the space handle */ + *lpcmGetSpaceData->pCmdData = (unsigned int) lpcmDMAManager->pFree; +} + +void +release_space_inv(struct drm_device *dev, + struct cmd_release_space *lpcmReleaseSpaceData) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = + dev_priv->dma_manager; + unsigned int dwReleaseSize = lpcmReleaseSpaceData->dwReleaseSize; + int i = 0; + + lpcmDMAManager->pFree += dwReleaseSize; + + /* aligned address */ + while (((unsigned int) lpcmDMAManager->pFree) & 0xF) { + /* not in 4 unsigned ints (16 Bytes) align address, + insert NULL Commands */ + *lpcmDMAManager->pFree++ = NULL_COMMAND_INV[i & 0x3]; + i++; + } + + if ((dev_priv->chip_sub_index == CHIP_H5) + && (dev_priv->drm_agp_type == DRM_AGP_RING_BUFFER)) { + ADDCmdHeader2_INVI(lpcmDMAManager->pFree, INV_REG_CR_TRANS, + INV_ParaType_Dummy); + for (i = 0; i < NULLCOMMANDNUMBER; i++) + ADDCmdData_INVI(lpcmDMAManager->pFree, 0xCC000000); + } +} + +int +via_chrome9_ioctl_flush(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + struct drm_via_chrome9_flush *dma_info = data; + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + int ret = 0; + int result = 0; + struct cmd_get_space getspace; + struct cmd_release_space releasespace; + volatile unsigned long *pCmdData = NULL; + + switch (dma_info->dma_cmd_type) { + /* Copy DMA buffer to BCI command buffer */ + case flush_bci: + case flush_bci_and_wait: + if (dma_info->cmd_size <= 0) + return 0; + if (dma_info->cmd_size > MAX_BCI_BUFFER_SIZE) { + DRM_INFO("too big BCI space request!!!\n"); + return 0; + } + + kickoff_bci_inv(dev_priv, dma_info); + waitchipidle_inv(dev_priv); + break; + /* Use DRM DMA buffer manager to kick off DMA directly */ + case dma_kickoff: + break; + + /* Copy user mode DMA buffer to kernel DMA buffer, + then kick off DMA */ + case flush_dma_buffer: + case flush_dma_and_wait: + if (dma_info->cmd_size <= 0) + return 0; + + getspace.dwRequestSize = dma_info->cmd_size; + if ((dev_priv->chip_sub_index == CHIP_H5) + && (dev_priv->drm_agp_type == DRM_AGP_RING_BUFFER)) + getspace.dwRequestSize += (NULLCOMMANDNUMBER + 4); + /*henry:Patch for VT3293 agp ring buffer stability */ + getspace.pCmdData = (unsigned int *) &pCmdData; + + if (dev_priv->drm_agp_type == DRM_AGP_DOUBLE_BUFFER) + get_space_db_inv(dev, &getspace); + else if (dev_priv->drm_agp_type == DRM_AGP_RING_BUFFER) + get_space_ring_inv(dev, &getspace); + + if (pCmdData) { + /*copy data from userspace to kernel-dma-agp buffer */ + result = copy_from_user((int *) + pCmdData, + dma_info->usermode_dma_buf, + dma_info->cmd_size << 2); + releasespace.dwReleaseSize = dma_info->cmd_size; + release_space_inv(dev, &releasespace); + + if (dev_priv->drm_agp_type == DRM_AGP_DOUBLE_BUFFER) + kickoff_dma_db_inv(dev); + else if (dev_priv->drm_agp_type == DRM_AGP_RING_BUFFER) + kickoff_dma_ring_inv(dev); + + if (dma_info->dma_cmd_type == flush_dma_and_wait) + waitchipidle_inv(dev_priv); + } else { + DRM_INFO("No enough DMA space"); + ret = -ENOMEM; + } + break; + + default: + DRM_INFO("Invalid DMA buffer type"); + ret = -EINVAL; + break; + } + return ret; +} + +int +via_chrome9_ioctl_free(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + return 0; +} + +int +via_chrome9_ioctl_wait_chip_idle(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + + waitchipidle_inv(dev_priv); + /* maybe_bug here, do we always return 0 */ + return 0; +} + +int +via_chrome9_ioctl_flush_cache(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + return 0; +} --- linux-2.6.24.orig/drivers/char/drm/via_chrome9_mm.c +++ linux-2.6.24/drivers/char/drm/via_chrome9_mm.c @@ -0,0 +1,388 @@ +/* + * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice + * (including the next paragraph) shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL VIA, S3 GRAPHICS, AND/OR + * ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "drmP.h" +#include "via_chrome9_drm.h" +#include "via_chrome9_drv.h" +#include "drm_sman.h" +#include "via_chrome9_mm.h" + +#define VIA_CHROME9_MM_GRANULARITY 4 +#define VIA_CHROME9_MM_GRANULARITY_MASK ((1 << VIA_CHROME9_MM_GRANULARITY) - 1) + + +int via_chrome9_map_init(struct drm_device *dev, + struct drm_via_chrome9_init *init) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *)dev->dev_private; + + dev_priv->sarea = drm_getsarea(dev); + if (!dev_priv->sarea) { + DRM_ERROR("could not find sarea!\n"); + goto error; + } + dev_priv->sarea_priv = + (struct drm_via_chrome9_sarea *)((unsigned char *)dev_priv-> + sarea->handle + init->sarea_priv_offset); + + dev_priv->fb = drm_core_findmap(dev, init->fb_handle); + if (!dev_priv->fb) { + DRM_ERROR("could not find framebuffer!\n"); + goto error; + } + /* Frame buffer physical base address */ + dev_priv->fb_base_address = init->fb_base_address; + + if (init->shadow_size) { + /* find apg shadow region mappings */ + dev_priv->shadow_map.shadow = drm_core_findmap(dev, init-> + shadow_handle); + if (!dev_priv->shadow_map.shadow) { + DRM_ERROR("could not shadow map!\n"); + goto error; + } + dev_priv->shadow_map.shadow_size = init->shadow_size; + dev_priv->shadow_map.shadow_handle = (unsigned int *)dev_priv-> + shadow_map.shadow->handle; + init->shadow_handle = dev_priv->shadow_map.shadow->offset; + } + if (init->agp_tex_size && init->chip_agp != CHIP_PCIE) { + /* find apg texture buffer mappings */ + dev_priv->agp_tex = drm_core_findmap(dev, init->agp_tex_handle); + dev_priv->agp_size = init->agp_tex_size; + dev_priv->agp_offset = init->agp_tex_handle; + if (!dev_priv->agp_tex) { + DRM_ERROR("could not find agp texture map !\n"); + goto error; + } + } + /* find mmio/dma mappings */ + dev_priv->mmio = drm_core_findmap(dev, init->mmio_handle); + if (!dev_priv->mmio) { + DRM_ERROR("failed to find mmio region!\n"); + goto error; + } + + dev_priv->hostBlt = drm_core_findmap(dev, init->hostBlt_handle); + if (!dev_priv->hostBlt) { + DRM_ERROR("failed to find host bitblt region!\n"); + goto error; + } + + dev_priv->drm_agp_type = init->agp_type; + if (init->agp_type != AGP_DISABLED && init->chip_agp != CHIP_PCIE) { + dev->agp_buffer_map = drm_core_findmap(dev, init->dma_handle); + if (!dev->agp_buffer_map) { + DRM_ERROR("failed to find dma buffer region!\n"); + goto error; + } + } + + dev_priv->bci = (char *)dev_priv->mmio->handle + 0x10000; + + return 0; + +error: + /* do cleanup here, refine_later */ + return (-EINVAL); +} + +int via_chrome9_heap_management_init(struct drm_device *dev, + struct drm_via_chrome9_init *init) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + int ret = 0; + + /* video memory management. range: 0 ---- video_whole_size */ + mutex_lock(&dev->struct_mutex); + ret = drm_sman_set_range(&dev_priv->sman, VIA_CHROME9_MEM_VIDEO, + 0, dev_priv->available_fb_size >> VIA_CHROME9_MM_GRANULARITY); + if (ret) { + DRM_ERROR("VRAM memory manager initialization ******ERROR\ + !******\n"); + mutex_unlock(&dev->struct_mutex); + goto error; + } + dev_priv->vram_initialized = 1; + /* agp/pcie heap management. + note:because agp is contradict with pcie, so only one is enough + for managing both of them.*/ + init->agp_type = dev_priv->drm_agp_type; + if (init->agp_type != AGP_DISABLED && dev_priv->agp_size) { + ret = drm_sman_set_range(&dev_priv->sman, VIA_CHROME9_MEM_AGP, + 0, dev_priv->agp_size >> VIA_CHROME9_MM_GRANULARITY); + if (ret) { + DRM_ERROR("AGP/PCIE memory manager initialization ******ERROR\ + !******\n"); + mutex_unlock(&dev->struct_mutex); + goto error; + } + dev_priv->agp_initialized = 1; + } + mutex_unlock(&dev->struct_mutex); + return 0; + +error: + /* Do error recover here, refine_later */ + return -EINVAL; +} + + +void via_chrome9_memory_destroy_heap(struct drm_device *dev, + struct drm_via_chrome9_private *dev_priv) +{ + mutex_lock(&dev->struct_mutex); + drm_sman_cleanup(&dev_priv->sman); + dev_priv->vram_initialized = 0; + dev_priv->agp_initialized = 0; + mutex_unlock(&dev->struct_mutex); +} + +void via_chrome9_reclaim_buffers_locked(struct drm_device *dev, + struct drm_file *file_priv) +{ + return; +} + +int via_chrome9_ioctl_allocate_aperture(struct drm_device *dev, + void *data, struct drm_file *file_priv) +{ + return 0; +} + +int via_chrome9_ioctl_free_aperture(struct drm_device *dev, + void *data, struct drm_file *file_priv) +{ + return 0; +} + + +/* Allocate memory from DRM module for video playing */ +int via_chrome9_ioctl_allocate_mem_base(struct drm_device *dev, +void *data, struct drm_file *file_priv) +{ + struct drm_via_chrome9_mem *mem = data; + struct drm_memblock_item *item; + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + unsigned long tmpSize = 0, offset = 0, alignment = 0; + /* modify heap_type to agp for pcie, since we treat pcie/agp heap + no difference in heap management */ + if (mem->type == memory_heap_pcie) { + if (dev_priv->chip_agp != CHIP_PCIE) { + DRM_ERROR( + "User want to alloc memory from pcie heap but via_chrome9.ko\ + has no this heap exist.******ERROR******\n"); + return -EINVAL; + } + mem->type = memory_heap_agp; + } + + if (mem->type > VIA_CHROME9_MEM_AGP) { + DRM_ERROR("Unknown memory type allocation\n"); + return -EINVAL; + } + mutex_lock(&dev->struct_mutex); + if (0 == ((mem->type == VIA_CHROME9_MEM_VIDEO) ? + dev_priv->vram_initialized : dev_priv->agp_initialized)) { + DRM_ERROR("Attempt to allocate from uninitialized\ + memory manager.\n"); + mutex_unlock(&dev->struct_mutex); + return -EINVAL; + } + tmpSize = (mem->size + VIA_CHROME9_MM_GRANULARITY_MASK) >> + VIA_CHROME9_MM_GRANULARITY; + mem->size = tmpSize << VIA_CHROME9_MM_GRANULARITY; + alignment = (dev_priv->alignment & 0x80000000) ? dev_priv-> + alignment & 0x7FFFFFFF:0; + alignment /= (1 << VIA_CHROME9_MM_GRANULARITY); + item = drm_sman_alloc(&dev_priv->sman, mem->type, tmpSize, alignment, + (unsigned long)file_priv); + mutex_unlock(&dev->struct_mutex); + /* alloc failed */ + if (!item) { + DRM_ERROR("Allocate memory failed ******ERROR******.\n"); + return -ENOMEM; + } + /* Till here every thing is ok, we check the memory type allocated + and return appropriate value to user mode Here the value return to + user is very difficult to operate. BE CAREFULLY!!! */ + /* offset is used by user mode ap to calculate the virtual address + which is used to access the memory allocated */ + mem->index = item->user_hash.key; + offset = item->mm->offset(item->mm, item->mm_info) << + VIA_CHROME9_MM_GRANULARITY; + switch (mem->type) { + case VIA_CHROME9_MEM_VIDEO: + mem->offset = offset + dev_priv->back_offset; + break; + case VIA_CHROME9_MEM_AGP: + /* return different value to user according to the chip type */ + if (dev_priv->chip_agp == CHIP_PCIE) { + mem->offset = offset + + ((struct drm_via_chrome9_DMA_manager *)dev_priv-> + dma_manager)->DMASize * sizeof(unsigned long); + } else { + mem->offset = offset; + } + break; + default: + /* Strange thing happen! Faint. Code bug! */ + DRM_ERROR("Enter here is impossible ******\ + ERROR******.\n"); + return -EINVAL; + } + /*DONE. Need we call function copy_to_user ?NO. We can't even + touch user's space.But we are lucky, since kernel drm:drm_ioctl + will to the job for us. */ + return 0; +} + +/* Allocate video/AGP/PCIE memory from heap management */ +int via_chrome9_ioctl_allocate_mem_wrapper(struct drm_device + *dev, void *data, struct drm_file *file_priv) +{ + struct drm_via_chrome9_memory_alloc *memory_alloc = + (struct drm_via_chrome9_memory_alloc *)data; + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + struct drm_via_chrome9_mem mem; + + mem.size = memory_alloc->size; + mem.type = memory_alloc->heap_type; + dev_priv->alignment = memory_alloc->align | 0x80000000; + if (via_chrome9_ioctl_allocate_mem_base(dev, &mem, file_priv)) { + DRM_ERROR("Allocate memory error!.\n"); + return -ENOMEM; + } + dev_priv->alignment = 0; + /* Till here every thing is ok, we check the memory type allocated and + return appropriate value to user mode Here the value return to user is + very difficult to operate. BE CAREFULLY!!!*/ + /* offset is used by user mode ap to calculate the virtual address + which is used to access the memory allocated */ + memory_alloc->offset = mem.offset; + memory_alloc->heap_info.lpL1Node = (void *)mem.index; + memory_alloc->size = mem.size; + switch (memory_alloc->heap_type) { + case VIA_CHROME9_MEM_VIDEO: + memory_alloc->physaddress = memory_alloc->offset + + dev_priv->fb_base_address; + memory_alloc->linearaddress = (void *)memory_alloc->physaddress; + break; + case VIA_CHROME9_MEM_AGP: + /* return different value to user according to the chip type */ + if (dev_priv->chip_agp == CHIP_PCIE) { + memory_alloc->physaddress = memory_alloc->offset; + memory_alloc->linearaddress = (void *)memory_alloc-> + physaddress; + } else { + memory_alloc->physaddress = dev->agp->base + + memory_alloc->offset + + ((struct drm_via_chrome9_DMA_manager *) + dev_priv->dma_manager)->DMASize * sizeof(unsigned long); + memory_alloc->linearaddress = + (void *)memory_alloc->physaddress; + } + break; + default: + /* Strange thing happen! Faint. Code bug! */ + DRM_ERROR("Enter here is impossible ******ERROR******.\n"); + return -EINVAL; + } + return 0; +} + +int via_chrome9_ioctl_free_mem_wrapper(struct drm_device *dev, + void *data, struct drm_file *file_priv) +{ + struct drm_via_chrome9_memory_alloc *memory_alloc = data; + struct drm_via_chrome9_mem mem; + + mem.index = (unsigned long)memory_alloc->heap_info.lpL1Node; + if (via_chrome9_ioctl_freemem_base(dev, &mem, file_priv)) { + DRM_ERROR("function free_mem_wrapper error.\n"); + return -EINVAL; + } + + return 0; +} + +int via_chrome9_ioctl_freemem_base(struct drm_device *dev, + void *data, struct drm_file *file_priv) +{ + struct drm_via_chrome9_private *dev_priv = dev->dev_private; + struct drm_via_chrome9_mem *mem = data; + int ret; + + mutex_lock(&dev->struct_mutex); + ret = drm_sman_free_key(&dev_priv->sman, mem->index); + mutex_unlock(&dev->struct_mutex); + DRM_DEBUG("free = 0x%lx\n", mem->index); + + return ret; +} + +int via_chrome9_ioctl_check_vidmem_size(struct drm_device *dev, + void *data, struct drm_file *file_priv) +{ + return 0; +} + +int via_chrome9_ioctl_pciemem_ctrl(struct drm_device *dev, + void *data, struct drm_file *file_priv) +{ + int result = 0; + struct drm_via_chrome9_private *dev_priv = dev->dev_private; + struct drm_via_chrome9_pciemem_ctrl *pcie_memory_ctrl = data; + switch (pcie_memory_ctrl->ctrl_type) { + case pciemem_copy_from_user: + result = copy_from_user((void *)( + dev_priv->pcie_vmalloc_nocache+ + pcie_memory_ctrl->pcieoffset), + pcie_memory_ctrl->usermode_data, + pcie_memory_ctrl->size); + break; + case pciemem_copy_to_user: + result = copy_to_user(pcie_memory_ctrl->usermode_data, + (void *)(dev_priv->pcie_vmalloc_nocache+ + pcie_memory_ctrl->pcieoffset), + pcie_memory_ctrl->size); + break; + case pciemem_memset: + memset((void *)(dev_priv->pcie_vmalloc_nocache + + pcie_memory_ctrl->pcieoffset), + pcie_memory_ctrl->memsetdata, + pcie_memory_ctrl->size); + break; + default: + break; + } + return 0; +} --- linux-2.6.24.orig/drivers/char/drm/drm_lock.c +++ linux-2.6.24/drivers/char/drm/drm_lock.c @@ -53,6 +53,7 @@ DECLARE_WAITQUEUE(entry, current); struct drm_lock *lock = data; int ret = 0; + unsigned long irqflags; ++file_priv->lock_count; @@ -71,9 +72,9 @@ return -EINVAL; add_wait_queue(&dev->lock.lock_queue, &entry); - spin_lock(&dev->lock.spinlock); + spin_lock_irqsave(&dev->lock.spinlock, irqflags); dev->lock.user_waiters++; - spin_unlock(&dev->lock.spinlock); + spin_unlock_irqrestore(&dev->lock.spinlock, irqflags); for (;;) { __set_current_state(TASK_INTERRUPTIBLE); if (!dev->lock.hw_lock) { @@ -95,9 +96,9 @@ break; } } - spin_lock(&dev->lock.spinlock); + spin_lock_irqsave(&dev->lock.spinlock, irqflags); dev->lock.user_waiters--; - spin_unlock(&dev->lock.spinlock); + spin_unlock_irqrestore(&dev->lock.spinlock, irqflags); __set_current_state(TASK_RUNNING); remove_wait_queue(&dev->lock.lock_queue, &entry); @@ -198,8 +199,9 @@ { unsigned int old, new, prev; volatile unsigned int *lock = &lock_data->hw_lock->lock; + unsigned long irqflags; - spin_lock(&lock_data->spinlock); + spin_lock_irqsave(&lock_data->spinlock, irqflags); do { old = *lock; if (old & _DRM_LOCK_HELD) @@ -211,7 +213,7 @@ } prev = cmpxchg(lock, old, new); } while (prev != old); - spin_unlock(&lock_data->spinlock); + spin_unlock_irqrestore(&lock_data->spinlock, irqflags); if (_DRM_LOCKING_CONTEXT(old) == context) { if (old & _DRM_LOCK_HELD) { @@ -272,15 +274,16 @@ { unsigned int old, new, prev; volatile unsigned int *lock = &lock_data->hw_lock->lock; + unsigned long irqflags; - spin_lock(&lock_data->spinlock); + spin_lock_irqsave(&lock_data->spinlock, irqflags); if (lock_data->kernel_waiters != 0) { drm_lock_transfer(lock_data, 0); lock_data->idle_has_lock = 1; - spin_unlock(&lock_data->spinlock); + spin_unlock_irqrestore(&lock_data->spinlock, irqflags); return 1; } - spin_unlock(&lock_data->spinlock); + spin_unlock_irqrestore(&lock_data->spinlock, irqflags); do { old = *lock; @@ -344,19 +347,20 @@ void drm_idlelock_take(struct drm_lock_data *lock_data) { int ret = 0; + unsigned long irqflags; - spin_lock(&lock_data->spinlock); + spin_lock_irqsave(&lock_data->spinlock, irqflags); lock_data->kernel_waiters++; if (!lock_data->idle_has_lock) { - spin_unlock(&lock_data->spinlock); + spin_unlock_irqrestore(&lock_data->spinlock, irqflags); ret = drm_lock_take(lock_data, DRM_KERNEL_CONTEXT); - spin_lock(&lock_data->spinlock); + spin_lock_irqsave(&lock_data->spinlock, irqflags); if (ret == 1) lock_data->idle_has_lock = 1; } - spin_unlock(&lock_data->spinlock); + spin_unlock_irqrestore(&lock_data->spinlock, irqflags); } EXPORT_SYMBOL(drm_idlelock_take); @@ -364,8 +368,9 @@ { unsigned int old, prev; volatile unsigned int *lock = &lock_data->hw_lock->lock; + unsigned long irqflags; - spin_lock(&lock_data->spinlock); + spin_lock_irqsave(&lock_data->spinlock, irqflags); if (--lock_data->kernel_waiters == 0) { if (lock_data->idle_has_lock) { do { @@ -376,7 +381,7 @@ lock_data->idle_has_lock = 0; } } - spin_unlock(&lock_data->spinlock); + spin_unlock_irqrestore(&lock_data->spinlock, irqflags); } EXPORT_SYMBOL(drm_idlelock_release); --- linux-2.6.24.orig/drivers/char/drm/drm_bufs.c +++ linux-2.6.24/drivers/char/drm/drm_bufs.c @@ -429,6 +429,7 @@ return ret; } +EXPORT_SYMBOL(drm_rmmap); /* The rmmap ioctl appears to be unnecessary. All mappings are torn down on * the last close of the device, and this is necessary for cleanup when things --- linux-2.6.24.orig/drivers/char/drm/Makefile +++ linux-2.6.24/drivers/char/drm/Makefile @@ -18,6 +18,7 @@ sis-objs := sis_drv.o sis_mm.o savage-objs := savage_drv.o savage_bci.o savage_state.o via-objs := via_irq.o via_drv.o via_map.o via_mm.o via_dma.o via_verifier.o via_video.o via_dmablit.o +via_chrome9-objs := via_chrome9_drv.o via_chrome9_drm.o via_chrome9_mm.o via_chrome9_dma.o ifeq ($(CONFIG_COMPAT),y) drm-objs += drm_ioc32.o @@ -38,5 +39,4 @@ obj-$(CONFIG_DRM_SIS) += sis.o obj-$(CONFIG_DRM_SAVAGE)+= savage.o obj-$(CONFIG_DRM_VIA) +=via.o - - +obj-$(CONFIG_DRM_VIA_CHROME9) += via_chrome9.o --- linux-2.6.24.orig/drivers/char/drm/via_chrome9_mm.h +++ linux-2.6.24/drivers/char/drm/via_chrome9_mm.h @@ -0,0 +1,67 @@ +/* + * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice + * (including the next paragraph) shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL VIA, S3 GRAPHICS, AND/OR + * ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef _VIA_CHROME9_MM_H_ +#define _VIA_CHROME9_MM_H_ +struct drm_via_chrome9_pciemem_ctrl { + enum { + pciemem_copy_from_user = 0, + pciemem_copy_to_user, + pciemem_memset, + } ctrl_type; + unsigned int pcieoffset; + unsigned int size;/*in Byte*/ + unsigned char memsetdata;/*for memset*/ + void *usermode_data;/*user mode data pointer*/ +}; + +extern int via_chrome9_map_init(struct drm_device *dev, + struct drm_via_chrome9_init *init); +extern int via_chrome9_heap_management_init(struct drm_device + *dev, struct drm_via_chrome9_init *init); +extern void via_chrome9_memory_destroy_heap(struct drm_device + *dev, struct drm_via_chrome9_private *dev_priv); +extern int via_chrome9_ioctl_check_vidmem_size(struct drm_device + *dev, void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_pciemem_ctrl(struct drm_device *dev, + void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_allocate_aperture(struct drm_device + *dev, void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_free_aperture(struct drm_device *dev, + void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_allocate_mem_base(struct drm_device + *dev, void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_allocate_mem_wrapper( + struct drm_device *dev, void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_freemem_base(struct drm_device + *dev, void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_free_mem_wrapper(struct drm_device + *dev, void *data, struct drm_file *file_priv); +extern void via_chrome9_reclaim_buffers_locked(struct drm_device + *dev, struct drm_file *file_priv); + +#endif + --- linux-2.6.24.orig/drivers/char/drm/r128_cce.c +++ linux-2.6.24/drivers/char/drm/r128_cce.c @@ -353,6 +353,11 @@ DRM_DEBUG("\n"); + if (dev->dev_private) { + DRM_DEBUG("called when already initialized\n"); + return -EINVAL; + } + dev_priv = drm_alloc(sizeof(drm_r128_private_t), DRM_MEM_DRIVER); if (dev_priv == NULL) return -ENOMEM; @@ -650,6 +655,8 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev_priv); + if (dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4) { DRM_DEBUG("%s while CCE running\n", __FUNCTION__); return 0; @@ -672,6 +679,8 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev_priv); + /* Flush any pending CCE commands. This ensures any outstanding * commands are exectuted by the engine before we turn it off. */ @@ -709,10 +718,7 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); - if (!dev_priv) { - DRM_DEBUG("%s called before init done\n", __FUNCTION__); - return -EINVAL; - } + DEV_INIT_TEST_WITH_RETURN(dev_priv); r128_do_cce_reset(dev_priv); @@ -729,6 +735,8 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev_priv); + if (dev_priv->cce_running) { r128_do_cce_flush(dev_priv); } @@ -742,6 +750,8 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev->dev_private); + return r128_do_engine_reset(dev); } --- linux-2.6.24.orig/drivers/char/drm/i915_dma.c +++ linux-2.6.24/drivers/char/drm/i915_dma.c @@ -31,17 +31,6 @@ #include "i915_drm.h" #include "i915_drv.h" -#define IS_I965G(dev) (dev->pci_device == 0x2972 || \ - dev->pci_device == 0x2982 || \ - dev->pci_device == 0x2992 || \ - dev->pci_device == 0x29A2 || \ - dev->pci_device == 0x2A02 || \ - dev->pci_device == 0x2A12) - -#define IS_G33(dev) (dev->pci_device == 0x29b2 || \ - dev->pci_device == 0x29c2 || \ - dev->pci_device == 0x29d2) - /* Really want an OS-independent resettable timer. Would like to have * this loop run for (eg) 3 sec, but have the timer reset every time * the head pointer changes, so that EBUSY only happens if the ring @@ -90,6 +79,7 @@ static int i915_dma_cleanup(struct drm_device * dev) { + drm_i915_private_t *dev_priv = dev->dev_private; /* Make sure interrupts are disabled here because the uninstall ioctl * may not have been called from userspace and after dev_private * is freed, it's too late. @@ -97,52 +87,42 @@ if (dev->irq) drm_irq_uninstall(dev); - if (dev->dev_private) { - drm_i915_private_t *dev_priv = - (drm_i915_private_t *) dev->dev_private; - - if (dev_priv->ring.virtual_start) { - drm_core_ioremapfree(&dev_priv->ring.map, dev); - } - - if (dev_priv->status_page_dmah) { - drm_pci_free(dev, dev_priv->status_page_dmah); - /* Need to rewrite hardware status page */ - I915_WRITE(0x02080, 0x1ffff000); - } - - if (dev_priv->status_gfx_addr) { - dev_priv->status_gfx_addr = 0; - drm_core_ioremapfree(&dev_priv->hws_map, dev); - I915_WRITE(0x2080, 0x1ffff000); - } + if (dev_priv->ring.virtual_start) { + drm_core_ioremapfree(&dev_priv->ring.map, dev); + dev_priv->ring.virtual_start = 0; + dev_priv->ring.map.handle = 0; + dev_priv->ring.map.size = 0; + } - drm_free(dev->dev_private, sizeof(drm_i915_private_t), - DRM_MEM_DRIVER); + if (dev_priv->status_page_dmah) { + drm_pci_free(dev, dev_priv->status_page_dmah); + dev_priv->status_page_dmah = NULL; + /* Need to rewrite hardware status page */ + I915_WRITE(0x02080, 0x1ffff000); + } - dev->dev_private = NULL; + if (dev_priv->status_gfx_addr) { + dev_priv->status_gfx_addr = 0; + drm_core_ioremapfree(&dev_priv->hws_map, dev); + I915_WRITE(0x2080, 0x1ffff000); } return 0; } -static int i915_initialize(struct drm_device * dev, - drm_i915_private_t * dev_priv, - drm_i915_init_t * init) +static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init) { - memset(dev_priv, 0, sizeof(drm_i915_private_t)); + drm_i915_private_t *dev_priv = dev->dev_private; dev_priv->sarea = drm_getsarea(dev); if (!dev_priv->sarea) { DRM_ERROR("can not find sarea!\n"); - dev->dev_private = (void *)dev_priv; i915_dma_cleanup(dev); return -EINVAL; } dev_priv->mmio_map = drm_core_findmap(dev, init->mmio_offset); if (!dev_priv->mmio_map) { - dev->dev_private = (void *)dev_priv; i915_dma_cleanup(dev); DRM_ERROR("can not find mmio map!\n"); return -EINVAL; @@ -165,7 +145,6 @@ drm_core_ioremap(&dev_priv->ring.map, dev); if (dev_priv->ring.map.handle == NULL) { - dev->dev_private = (void *)dev_priv; i915_dma_cleanup(dev); DRM_ERROR("can not ioremap virtual address for" " ring buffer\n"); @@ -192,12 +171,11 @@ dev_priv->allow_batchbuffer = 1; /* Program Hardware Status Page */ - if (!IS_G33(dev)) { + if (!I915_NEED_GFX_HWS(dev)) { dev_priv->status_page_dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff); if (!dev_priv->status_page_dmah) { - dev->dev_private = (void *)dev_priv; i915_dma_cleanup(dev); DRM_ERROR("Can not allocate hardware status page\n"); return -ENOMEM; @@ -209,7 +187,6 @@ I915_WRITE(0x02080, dev_priv->dma_status_page); } DRM_DEBUG("Enabled hardware status page\n"); - dev->dev_private = (void *)dev_priv; return 0; } @@ -254,17 +231,12 @@ static int i915_dma_init(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_i915_private_t *dev_priv; drm_i915_init_t *init = data; int retcode = 0; switch (init->func) { case I915_INIT_DMA: - dev_priv = drm_alloc(sizeof(drm_i915_private_t), - DRM_MEM_DRIVER); - if (dev_priv == NULL) - return -ENOMEM; - retcode = i915_initialize(dev, dev_priv, init); + retcode = i915_initialize(dev, init); break; case I915_CLEANUP_DMA: retcode = i915_dma_cleanup(dev); @@ -748,6 +720,9 @@ drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_hws_addr_t *hws = data; + if (!I915_NEED_GFX_HWS(dev)) + return -EINVAL; + if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return -EINVAL; @@ -765,7 +740,6 @@ drm_core_ioremap(&dev_priv->hws_map, dev); if (dev_priv->hws_map.handle == NULL) { - dev->dev_private = (void *)dev_priv; i915_dma_cleanup(dev); dev_priv->status_gfx_addr = 0; DRM_ERROR("can not ioremap virtual address for" @@ -784,6 +758,15 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) { + struct drm_i915_private *dev_priv = dev->dev_private; + unsigned long base, size; + int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1; + + if (!IS_I9XX(dev)) { + dev->driver->suspend = NULL; + dev->driver->resume = NULL; + } + /* i915 has 4 more counters */ dev->counters += 4; dev->types[6] = _DRM_STAT_IRQ; @@ -791,24 +774,50 @@ dev->types[8] = _DRM_STAT_SECONDARY; dev->types[9] = _DRM_STAT_DMA; + dev_priv = drm_alloc(sizeof(drm_i915_private_t), DRM_MEM_DRIVER); + if (dev_priv == NULL) + return -ENOMEM; + + memset(dev_priv, 0, sizeof(drm_i915_private_t)); + + dev->dev_private = (void *)dev_priv; + + /* Add register map (needed for suspend/resume) */ + base = drm_get_resource_start(dev, mmio_bar); + size = drm_get_resource_len(dev, mmio_bar); + + ret = drm_addmap(dev, base, size, _DRM_REGISTERS, _DRM_KERNEL, + &dev_priv->mmio_map); + return ret; +} + +int i915_driver_unload(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + + if (dev_priv->mmio_map) + drm_rmmap(dev, dev_priv->mmio_map); + + drm_free(dev->dev_private, sizeof(drm_i915_private_t), + DRM_MEM_DRIVER); + return 0; } void i915_driver_lastclose(struct drm_device * dev) { - if (dev->dev_private) { - drm_i915_private_t *dev_priv = dev->dev_private; + drm_i915_private_t *dev_priv = dev->dev_private; + + if (dev_priv->agp_heap) i915_mem_takedown(&(dev_priv->agp_heap)); - } + i915_dma_cleanup(dev); } void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv) { - if (dev->dev_private) { - drm_i915_private_t *dev_priv = dev->dev_private; - i915_mem_release(dev, file_priv, dev_priv->agp_heap); - } + drm_i915_private_t *dev_priv = dev->dev_private; + i915_mem_release(dev, file_priv, dev_priv->agp_heap); } struct drm_ioctl_desc i915_ioctls[] = { @@ -828,7 +837,7 @@ DRM_IOCTL_DEF(DRM_I915_SET_VBLANK_PIPE, i915_vblank_pipe_set, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY ), DRM_IOCTL_DEF(DRM_I915_GET_VBLANK_PIPE, i915_vblank_pipe_get, DRM_AUTH ), DRM_IOCTL_DEF(DRM_I915_VBLANK_SWAP, i915_vblank_swap, DRM_AUTH), - DRM_IOCTL_DEF(DRM_I915_HWS_ADDR, i915_set_status_page, DRM_AUTH), + DRM_IOCTL_DEF(DRM_I915_HWS_ADDR, i915_set_status_page, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), }; int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); --- linux-2.6.24.orig/drivers/char/drm/r128_state.c +++ linux-2.6.24/drivers/char/drm/r128_state.c @@ -1245,14 +1245,18 @@ static int r128_cce_clear(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_r128_private_t *dev_priv = dev->dev_private; - drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; + drm_r128_sarea_t *sarea_priv; drm_r128_clear_t *clear = data; DRM_DEBUG("\n"); LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev_priv); + RING_SPACE_TEST_WITH_RETURN(dev_priv); + sarea_priv = dev_priv->sarea_priv; + if (sarea_priv->nbox > R128_NR_SAREA_CLIPRECTS) sarea_priv->nbox = R128_NR_SAREA_CLIPRECTS; @@ -1313,6 +1317,8 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev_priv); + RING_SPACE_TEST_WITH_RETURN(dev_priv); if (!dev_priv->page_flipping) @@ -1332,6 +1338,8 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev_priv); + RING_SPACE_TEST_WITH_RETURN(dev_priv); if (sarea_priv->nbox > R128_NR_SAREA_CLIPRECTS) @@ -1355,10 +1363,7 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); - if (!dev_priv) { - DRM_ERROR("%s called with no initialization\n", __FUNCTION__); - return -EINVAL; - } + DEV_INIT_TEST_WITH_RETURN(dev_priv); DRM_DEBUG("pid=%d index=%d count=%d discard=%d\n", DRM_CURRENTPID, vertex->idx, vertex->count, vertex->discard); @@ -1411,10 +1416,7 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); - if (!dev_priv) { - DRM_ERROR("%s called with no initialization\n", __FUNCTION__); - return -EINVAL; - } + DEV_INIT_TEST_WITH_RETURN(dev_priv); DRM_DEBUG("pid=%d buf=%d s=%d e=%d d=%d\n", DRM_CURRENTPID, elts->idx, elts->start, elts->end, elts->discard); @@ -1477,6 +1479,8 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev_priv); + DRM_DEBUG("pid=%d index=%d\n", DRM_CURRENTPID, blit->idx); if (blit->idx < 0 || blit->idx >= dma->buf_count) { @@ -1502,6 +1506,8 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev_priv); + RING_SPACE_TEST_WITH_RETURN(dev_priv); ret = -EINVAL; @@ -1532,6 +1538,8 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); + DEV_INIT_TEST_WITH_RETURN(dev_priv); + if (DRM_COPY_FROM_USER(&mask, stipple->mask, 32 * sizeof(u32))) return -EFAULT; @@ -1556,10 +1564,7 @@ LOCK_TEST_WITH_RETURN(dev, file_priv); - if (!dev_priv) { - DRM_ERROR("%s called with no initialization\n", __FUNCTION__); - return -EINVAL; - } + DEV_INIT_TEST_WITH_RETURN(dev_priv); DRM_DEBUG("indirect: idx=%d s=%d e=%d d=%d\n", indirect->idx, indirect->start, indirect->end, @@ -1621,10 +1626,7 @@ drm_r128_getparam_t *param = data; int value; - if (!dev_priv) { - DRM_ERROR("%s called with no initialization\n", __FUNCTION__); - return -EINVAL; - } + DEV_INIT_TEST_WITH_RETURN(dev_priv); DRM_DEBUG("pid=%d\n", DRM_CURRENTPID); --- linux-2.6.24.orig/drivers/char/drm/r128_drv.h +++ linux-2.6.24/drivers/char/drm/r128_drv.h @@ -418,6 +418,14 @@ * Misc helper macros */ +#define DEV_INIT_TEST_WITH_RETURN(_dev_priv) \ +do { \ + if (!_dev_priv) { \ + DRM_ERROR("called with no initialization\n"); \ + return -EINVAL; \ + } \ +} while (0) + #define RING_SPACE_TEST_WITH_RETURN( dev_priv ) \ do { \ drm_r128_ring_buffer_t *ring = &dev_priv->ring; int i; \ --- linux-2.6.24.orig/drivers/char/drm/via_chrome9_drm.c +++ linux-2.6.24/drivers/char/drm/via_chrome9_drm.c @@ -0,0 +1,993 @@ +/* + * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice + * (including the next paragraph) shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL VIA, S3 GRAPHICS, AND/OR + * ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#include "drmP.h" +#include "via_chrome9_drm.h" +#include "via_chrome9_drv.h" +#include "via_chrome9_mm.h" +#include "via_chrome9_dma.h" +#include "via_chrome9_3d_reg.h" + +#define VIA_CHROME9DRM_VIDEO_STARTADDRESS_ALIGNMENT 10 + + +void __via_chrome9ke_udelay(unsigned long usecs) +{ + unsigned long start; + unsigned long stop; + unsigned long period; + unsigned long wait_period; + struct timespec tval; + +#ifdef NDELAY_LIMIT +#define UDELAY_LIMIT (NDELAY_LIMIT/1000) /* supposed to be 10 msec */ +#else +#define UDELAY_LIMIT (10000) /* 10 msec */ +#endif + + if (usecs > UDELAY_LIMIT) { + start = jiffies; + tval.tv_sec = usecs / 1000000; + tval.tv_nsec = (usecs - tval.tv_sec * 1000000) * 1000; + wait_period = timespec_to_jiffies(&tval); + do { + stop = jiffies; + + if (stop < start) + period = ((unsigned long)-1 - start) + stop + 1; + else + period = stop - start; + + } while (period < wait_period); + } else + udelay(usecs); /* delay value might get checked once again */ +} + +int via_chrome9_ioctl_process_exit(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + return 0; +} + +int via_chrome9_ioctl_restore_primary(struct drm_device *dev, + void *data, struct drm_file *file_priv) +{ + return 0; +} + +void Initialize3DEngine(struct drm_via_chrome9_private *dev_priv) +{ + int i; + unsigned int StageOfTexture; + + if (dev_priv->chip_sub_index == CHIP_H5 || + dev_priv->chip_sub_index == CHIP_H5S1) { + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + 0x00010000); + + for (i = 0; i <= 0x8A; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (unsigned int) i << 24); + } + + /* Initial Texture Stage Setting*/ + for (StageOfTexture = 0; StageOfTexture < 0xf; + StageOfTexture++) { + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00020000 | 0x00000000 | + (StageOfTexture & 0xf)<<24)); + /* *((unsigned int volatile*)(pMapIOPort+HC_REG_TRANS_SET)) = + (0x00020000 | HC_ParaSubType_Tex0 | (StageOfTexture & + 0xf)<<24);*/ + for (i = 0 ; i <= 0x30 ; i++) { + /* *((unsigned int volatile*)(pMapIOPort+ + HC_REG_Hpara0)) = ((unsigned int) i << 24);*/ + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (unsigned int) i << 24); + } + } + + /* Initial Texture Sampler Setting*/ + for (StageOfTexture = 0; StageOfTexture < 0xf; + StageOfTexture++) { + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00020000 | 0x00020000 | + (StageOfTexture & 0xf)<<24)); + /* *((unsigned int volatile*)(pMapIOPort+ + HC_REG_TRANS_SET)) = (0x00020000 | 0x00020000 | + ( StageOfTexture & 0xf)<<24);*/ + for (i = 0 ; i <= 0x30 ; i++) { + /* *((unsigned int volatile*)(pMapIOPort+ + HC_REG_Hpara0)) = ((unsigned int) i << 24);*/ + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (unsigned int) i << 24); + } + } + + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00020000 | 0xfe000000)); + /* *((unsigned int volatile*)(pMapIOPort+HC_REG_TRANS_SET)) = + (0x00020000 | HC_ParaSubType_TexGen);*/ + for (i = 0 ; i <= 0x13 ; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (unsigned int) i << 24); + /* *((unsigned int volatile*)(pMapIOPort+ + HC_REG_Hpara0)) = ((unsigned int) i << 24);*/ + } + + /* Initial Gamma Table Setting*/ + /* Initial Gamma Table Setting*/ + /* 5 + 4 = 9 (12) dwords*/ + /* sRGB texture is not directly support by H3 hardware. + We have to set the deGamma table for texture sampling.*/ + + /* degamma table*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x15000000)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (0x40000000 | (30 << 20) | (15 << 10) | (5))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((119 << 20) | (81 << 10) | (52))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((283 << 20) | (219 << 10) | (165))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((535 << 20) | (441 << 10) | (357))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((119 << 20) | (884 << 20) | (757 << 10) | + (640))); + + /* gamma table*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x17000000)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (0x40000000 | (13 << 20) | (13 << 10) | (13))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (0x40000000 | (26 << 20) | (26 << 10) | (26))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (0x40000000 | (39 << 20) | (39 << 10) | (39))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((51 << 20) | (51 << 10) | (51))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((71 << 20) | (71 << 10) | (71))); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (87 << 20) | (87 << 10) | (87)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (113 << 20) | (113 << 10) | (113)); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (135 << 20) | (135 << 10) | (135)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (170 << 20) | (170 << 10) | (170)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (199 << 20) | (199 << 10) | (199)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (246 << 20) | (246 << 10) | (246)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (284 << 20) | (284 << 10) | (284)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (317 << 20) | (317 << 10) | (317)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (347 << 20) | (347 << 10) | (347)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (373 << 20) | (373 << 10) | (373)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (398 << 20) | (398 << 10) | (398)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (442 << 20) | (442 << 10) | (442)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (481 << 20) | (481 << 10) | (481)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (517 << 20) | (517 << 10) | (517)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (550 << 20) | (550 << 10) | (550)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (609 << 20) | (609 << 10) | (609)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (662 << 20) | (662 << 10) | (662)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (709 << 20) | (709 << 10) | (709)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (753 << 20) | (753 << 10) | (753)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (794 << 20) | (794 << 10) | (794)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (832 << 20) | (832 << 10) | (832)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (868 << 20) | (868 << 10) | (868)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (902 << 20) | (902 << 10) | (902)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (934 << 20) | (934 << 10) | (934)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (966 << 20) | (966 << 10) | (966)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (996 << 20) | (996 << 10) | (996)); + + + /* + For Interrupt Restore only All types of write through + regsiters should be write header data to hardware at + least before it can restore. H/W will automatically + record the header to write through state buffer for + resture usage. + By Jaren: + HParaType = 8'h03, HParaSubType = 8'h00 + 8'h11 + 8'h12 + 8'h14 + 8'h15 + 8'h17 + HParaSubType 8'h12, 8'h15 is initialized. + [HWLimit] + 1. All these write through registers can't be partial + update. + 2. All these write through must be AGP command + 16 entries : 4 128-bit data */ + + /* Initialize INV_ParaSubType_TexPal */ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x00000000)); + for (i = 0; i < 16; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x00000000); + } + + /* Initialize INV_ParaSubType_4X4Cof */ + /* 32 entries : 8 128-bit data */ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x11000000)); + for (i = 0; i < 32; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x00000000); + } + + /* Initialize INV_ParaSubType_StipPal */ + /* 5 entries : 2 128-bit data */ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x14000000)); + for (i = 0; i < (5+3); i++) { + SetMMIORegister(dev_priv->mmio->handle, + 0x440, 0x00000000); + } + + /* primitive setting & vertex format*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00040000 | 0x14000000)); + for (i = 0; i < 52; i++) { + SetMMIORegister(dev_priv->mmio->handle, + 0x440, ((unsigned int) i << 24)); + } + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + 0x00fe0000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x4000840f); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x47000400); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x44000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x46000000); + + /* setting Misconfig*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + 0x00fe0000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x00001004); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0800004b); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0a000049); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0b0000fb); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0c000001); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0d0000cb); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0e000009); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x10000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x110000ff); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x12000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x130000db); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x14000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x15000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x16000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x17000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x18000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x19000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x20000000); + } else if (dev_priv->chip_sub_index == CHIP_H6S2) { + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + 0x00010000); + for (i = 0; i <= 0x9A; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (unsigned int) i << 24); + } + + /* Initial Texture Stage Setting*/ + for (StageOfTexture = 0; StageOfTexture <= 0xf; + StageOfTexture++) { + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00020000 | 0x00000000 | + (StageOfTexture & 0xf)<<24)); + /* *((unsigned int volatile*)(pMapIOPort+ + HC_REG_TRANS_SET)) = + (0x00020000 | HC_ParaSubType_Tex0 | + (StageOfTexture & 0xf)<<24);*/ + for (i = 0 ; i <= 0x30 ; i++) { + /* *((unsigned int volatile*)(pMapIOPort+ + HC_REG_Hpara0)) =((unsigned int) i << 24);*/ + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (unsigned int) i << 24); + } + } + + /* Initial Texture Sampler Setting*/ + for (StageOfTexture = 0; StageOfTexture <= 0xf; + StageOfTexture++) { + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00020000 | 0x20000000 | + (StageOfTexture & 0xf)<<24)); + /* *((unsigned int volatile*)(pMapIOPort+ + HC_REG_TRANS_SET)) =(0x00020000 | 0x00020000 | + ( StageOfTexture & 0xf)<<24);*/ + for (i = 0 ; i <= 0x36 ; i++) { + /* *((unsigned int volatile*)(pMapIOPort+ + HC_REG_Hpara0)) =((unsigned int) i << 24);*/ + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (unsigned int) i << 24); + } + } + + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00020000 | 0xfe000000)); + for (i = 0 ; i <= 0x13 ; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (unsigned int) i << 24); + /* *((unsigned int volatile*)(pMapIOPort+ + HC_REG_Hpara0)) =((unsigned int) i << 24);*/ + } + + /* Initial Gamma Table Setting*/ + /* Initial Gamma Table Setting*/ + /* 5 + 4 = 9 (12) dwords*/ + /* sRGB texture is not directly support by + H3 hardware.*/ + /* We have to set the deGamma table for texture + sampling.*/ + + /* degamma table*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x15000000)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (0x40000000 | (30 << 20) | (15 << 10) | (5))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((119 << 20) | (81 << 10) | (52))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((283 << 20) | (219 << 10) | (165))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((535 << 20) | (441 << 10) | (357))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((119 << 20) | (884 << 20) | (757 << 10) + | (640))); + + /* gamma table*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x17000000)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (0x40000000 | (13 << 20) | (13 << 10) | (13))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (0x40000000 | (26 << 20) | (26 << 10) | (26))); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (0x40000000 | (39 << 20) | (39 << 10) | (39))); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, ((51 << 20) | (51 << 10) | (51))); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, ((71 << 20) | (71 << 10) | (71))); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (87 << 20) | (87 << 10) | (87)); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (113 << 20) | (113 << 10) | (113)); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (135 << 20) | (135 << 10) | (135)); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (170 << 20) | (170 << 10) | (170)); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (199 << 20) | (199 << 10) | (199)); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (246 << 20) | (246 << 10) | (246)); + SetMMIORegister(dev_priv->mmio->handle, + 0x440, (284 << 20) | (284 << 10) | (284)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (317 << 20) | (317 << 10) | (317)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (347 << 20) | (347 << 10) | (347)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (373 << 20) | (373 << 10) | (373)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (398 << 20) | (398 << 10) | (398)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (442 << 20) | (442 << 10) | (442)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (481 << 20) | (481 << 10) | (481)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (517 << 20) | (517 << 10) | (517)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (550 << 20) | (550 << 10) | (550)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (609 << 20) | (609 << 10) | (609)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (662 << 20) | (662 << 10) | (662)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (709 << 20) | (709 << 10) | (709)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (753 << 20) | (753 << 10) | (753)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (794 << 20) | (794 << 10) | (794)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (832 << 20) | (832 << 10) | (832)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (868 << 20) | (868 << 10) | (868)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (902 << 20) | (902 << 10) | (902)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (934 << 20) | (934 << 10) | (934)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (966 << 20) | (966 << 10) | (966)); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + (996 << 20) | (996 << 10) | (996)); + + + /* For Interrupt Restore only + All types of write through regsiters should be write + header data to hardware at least before it can restore. + H/W will automatically record the header to write + through state buffer for restureusage. + By Jaren: + HParaType = 8'h03, HParaSubType = 8'h00 + 8'h11 + 8'h12 + 8'h14 + 8'h15 + 8'h17 + HParaSubType 8'h12, 8'h15 is initialized. + [HWLimit] + 1. All these write through registers can't be partial + update. + 2. All these write through must be AGP command + 16 entries : 4 128-bit data */ + + /* Initialize INV_ParaSubType_TexPal */ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x00000000)); + for (i = 0; i < 16; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x00000000); + } + + /* Initialize INV_ParaSubType_4X4Cof */ + /* 32 entries : 8 128-bit data */ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x11000000)); + for (i = 0; i < 32; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x00000000); + } + + /* Initialize INV_ParaSubType_StipPal */ + /* 5 entries : 2 128-bit data */ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00030000 | 0x14000000)); + for (i = 0; i < (5+3); i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x00000000); + } + + /* primitive setting & vertex format*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00040000)); + for (i = 0; i <= 0x62; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((unsigned int) i << 24)); + } + + /*ParaType 0xFE - Configure and Misc Setting*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00fe0000)); + for (i = 0; i <= 0x47; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((unsigned int) i << 24)); + } + /*ParaType 0x11 - Frame Buffer Auto-Swapping and + Command Regulator Misc*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + (0x00110000)); + for (i = 0; i <= 0x20; i++) { + SetMMIORegister(dev_priv->mmio->handle, 0x440, + ((unsigned int) i << 24)); + } + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + 0x00fe0000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x4000840f); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x47000404); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x44000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x46000005); + + /* setting Misconfig*/ + SetMMIORegister(dev_priv->mmio->handle, 0x43C, + 0x00fe0000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x00001004); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x08000249); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0a0002c9); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0b0002fb); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0c000000); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0d0002cb); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x0e000009); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x10000049); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x110002ff); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x12000008); + SetMMIORegister(dev_priv->mmio->handle, 0x440, + 0x130002db); + } +} + +int via_chrome9_drm_resume(struct pci_dev *pci) +{ + struct drm_device *dev = (struct drm_device *)pci_get_drvdata(pci); + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *)dev->dev_private; + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = + dev_priv->dma_manager; + + Initialize3DEngine(dev_priv); + + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_TRANS, 0x00110000); + if (dev_priv->chip_sub_index == CHIP_H6S2) { + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + 0x06000000); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + 0x07100000); + } else{ + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + 0x02000000); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + 0x03100000); + } + + + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_TRANS, + INV_ParaType_PreCR); + SetMMIORegister(dev_priv->mmio->handle, INV_REG_CR_BEGIN, + INV_SubA_HSetRBGID | INV_HSetRBGID_CR); + + if (dev_priv->chip_sub_index == CHIP_H6S2) { + unsigned int *pGARTTable; + unsigned int i, entries, GARTOffset; + unsigned char sr6a, sr6b, sr6c, sr6f, sr7b; + unsigned int *addrlinear; + unsigned int size, alignedoffset; + + entries = dev_priv->pagetable_map.pagetable_size / + sizeof(unsigned int); + pGARTTable = dev_priv->pagetable_map.pagetable_handle; + + GARTOffset = dev_priv->pagetable_map.pagetable_offset; + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c &= (~0x80); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + sr6a = (unsigned char)((GARTOffset & 0xff000) >> 12); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6a); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6a); + + sr6b = (unsigned char)((GARTOffset & 0xff00000) >> 20); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6b); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6b); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c |= ((unsigned char)((GARTOffset >> 28) & 0x01)); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x7b); + sr7b = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr7b &= (~0x0f); + sr7b |= ProtectSizeValue(dev_priv-> + pagetable_map.pagetable_size); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr7b); + + for (i = 0; i < entries; i++) + writel(0x80000000, pGARTTable+i); + + /*flush*/ + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6f); + do { + sr6f = GetMMIORegisterU8(dev_priv->mmio->handle, + 0x83c5); + } while (sr6f & 0x80); + + sr6f |= 0x80; + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6f); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c |= 0x80; + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + size = lpcmDMAManager->DMASize * sizeof(unsigned int) + + dev_priv->agp_size; + alignedoffset = 0; + entries = (size + PAGE_SIZE - 1) / PAGE_SIZE; + addrlinear = (unsigned int *)dev_priv->pcie_vmalloc_nocache; + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c &= (~0x80); + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6f); + do { + sr6f = GetMMIORegisterU8(dev_priv->mmio->handle, + 0x83c5); + } while (sr6f & 0x80); + + for (i = 0; i < entries; i++) + writel(page_to_pfn(vmalloc_to_page((void *)addrlinear + + PAGE_SIZE * i)) & 0x3fffffff, pGARTTable+ + i+alignedoffset); + + sr6f |= 0x80; + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6f); + + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c4, 0x6c); + sr6c = GetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5); + sr6c |= 0x80; + SetMMIORegisterU8(dev_priv->mmio->handle, 0x83c5, sr6c); + + } + + if (dev_priv->drm_agp_type == DRM_AGP_DOUBLE_BUFFER) + SetAGPDoubleCmd_inv(dev); + else if (dev_priv->drm_agp_type == DRM_AGP_RING_BUFFER) + SetAGPRingCmdRegs_inv(dev); + return 0; +} + +int via_chrome9_drm_suspend(struct pci_dev *dev, + pm_message_t state) +{ + return 0; +} + +int via_chrome9_driver_load(struct drm_device *dev, + unsigned long chipset) +{ + struct drm_via_chrome9_private *dev_priv; + int ret = 0; + static int associate; + + if (!associate) { + pci_set_drvdata(dev->pdev, dev); + dev->pdev->driver = &dev->driver->pci_driver; + associate = 1; + } + + dev->counters += 4; + dev->types[6] = _DRM_STAT_IRQ; + dev->types[7] = _DRM_STAT_PRIMARY; + dev->types[8] = _DRM_STAT_SECONDARY; + dev->types[9] = _DRM_STAT_DMA; + + dev_priv = drm_calloc(1, sizeof(struct drm_via_chrome9_private), + DRM_MEM_DRIVER); + if (dev_priv == NULL) + return -ENOMEM; + + /* Clear */ + memset(dev_priv, 0, sizeof(struct drm_via_chrome9_private)); + + dev_priv->dev = dev; + dev->dev_private = (void *)dev_priv; + + dev_priv->chip_index = chipset; + + ret = drm_sman_init(&dev_priv->sman, 2, 12, 8); + if (ret) + drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER); + return ret; +} + +int via_chrome9_driver_unload(struct drm_device *dev) +{ + struct drm_via_chrome9_private *dev_priv = dev->dev_private; + + drm_sman_takedown(&dev_priv->sman); + + drm_free(dev_priv, sizeof(struct drm_via_chrome9_private), + DRM_MEM_DRIVER); + + return 0; +} + +static int via_chrome9_initialize(struct drm_device *dev, + struct drm_via_chrome9_init *init) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *)dev->dev_private; + + dev_priv->chip_agp = init->chip_agp; + dev_priv->chip_index = init->chip_index; + dev_priv->chip_sub_index = init->chip_sub_index; + + dev_priv->usec_timeout = init->usec_timeout; + dev_priv->front_offset = init->front_offset; + dev_priv->back_offset = init->back_offset >> + VIA_CHROME9DRM_VIDEO_STARTADDRESS_ALIGNMENT << + VIA_CHROME9DRM_VIDEO_STARTADDRESS_ALIGNMENT; + dev_priv->available_fb_size = init->available_fb_size - + (init->available_fb_size % + (1 << VIA_CHROME9DRM_VIDEO_STARTADDRESS_ALIGNMENT)); + dev_priv->depth_offset = init->depth_offset; + + /* Find all the map added first, doing this is necessary to + intialize hw */ + if (via_chrome9_map_init(dev, init)) { + DRM_ERROR("function via_chrome9_map_init ERROR !\n"); + goto error; + } + + /* Necessary information has been gathered for initialize hw */ + if (via_chrome9_hw_init(dev, init)) { + DRM_ERROR("function via_chrome9_hw_init ERROR !\n"); + goto error; + } + + /* After hw intialization, we have kown whether to use agp + or to use pcie for texture */ + if (via_chrome9_heap_management_init(dev, init)) { + DRM_ERROR("function \ + via_chrome9_heap_management_init ERROR !\n"); + goto error; + } + + return 0; + +error: + /* all the error recover has been processed in relevant function, + so here just return error */ + return -EINVAL; +} + +static void via_chrome9_cleanup(struct drm_device *dev, + struct drm_via_chrome9_init *init) +{ + struct drm_via_chrome9_DMA_manager *lpcmDMAManager = NULL; + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *)dev->dev_private; + DRM_DEBUG("function via_chrome9_cleanup run!\n"); + + if (!dev_priv) + return ; + + lpcmDMAManager = + (struct drm_via_chrome9_DMA_manager *)dev_priv->dma_manager; + if (dev_priv->pcie_vmalloc_nocache) { + vfree((void *)dev_priv->pcie_vmalloc_nocache); + dev_priv->pcie_vmalloc_nocache = 0; + if (lpcmDMAManager) + lpcmDMAManager->addr_linear = NULL; + } + + if (dev_priv->pagetable_map.pagetable_handle) { + iounmap(dev_priv->pagetable_map.pagetable_handle); + dev_priv->pagetable_map.pagetable_handle = NULL; + } + + if (lpcmDMAManager && lpcmDMAManager->addr_linear) { + iounmap(lpcmDMAManager->addr_linear); + lpcmDMAManager->addr_linear = NULL; + } + + kfree(lpcmDMAManager); + dev_priv->dma_manager = NULL; + + if (dev_priv->event_tag_info) { + vfree(dev_priv->event_tag_info); + dev_priv->event_tag_info = NULL; + } + + if (dev_priv->bci_buffer) { + vfree(dev_priv->bci_buffer); + dev_priv->bci_buffer = NULL; + } + + via_chrome9_memory_destroy_heap(dev, dev_priv); +} + +/* +Do almost everything intialize here,include: +1.intialize all addmaps in private data structure +2.intialize memory heap management for video agp/pcie +3.intialize hw for dma(pcie/agp) function + +Note:all this function will dispatch into relevant function +*/ +int via_chrome9_ioctl_init(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + struct drm_via_chrome9_init *init = (struct drm_via_chrome9_init *)data; + + switch (init->func) { + case VIA_CHROME9_INIT: + if (via_chrome9_initialize(dev, init)) { + DRM_ERROR("function via_chrome9_initialize error\n"); + return -1; + } + break; + + case VIA_CHROME9_CLEANUP: + via_chrome9_cleanup(dev, init); + break; + + default: + return -1; + } + + return 0; +} + +int via_chrome9_ioctl_allocate_event_tag(struct drm_device *dev, + void *data, struct drm_file *file_priv) +{ + struct drm_via_chrome9_event_tag *event_tag = data; + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *)dev->dev_private; + struct drm_clb_event_tag_info *event_tag_info = + dev_priv->event_tag_info; + unsigned int *event_addr = 0, i = 0; + + for (i = 0; i < NUMBER_OF_EVENT_TAGS; i++) { + if (!event_tag_info->usage[i]) + break; + } + + if (i < NUMBER_OF_EVENT_TAGS) { + event_tag_info->usage[i] = 1; + event_tag->event_offset = i; + event_tag->last_sent_event_value.event_low = 0; + event_tag->current_event_value.event_low = 0; + event_addr = event_tag_info->linear_address + + event_tag->event_offset * 4; + *event_addr = 0; + return 0; + } else { + return -7; + } + + return 0; +} + +int via_chrome9_ioctl_free_event_tag(struct drm_device *dev, + void *data, struct drm_file *file_priv) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *)dev->dev_private; + struct drm_clb_event_tag_info *event_tag_info = + dev_priv->event_tag_info; + struct drm_via_chrome9_event_tag *event_tag = data; + + event_tag_info->usage[event_tag->event_offset] = 0; + return 0; +} + +void via_chrome9_lastclose(struct drm_device *dev) +{ + via_chrome9_cleanup(dev, 0); + return ; +} + +static int via_chrome9_do_wait_vblank(struct drm_via_chrome9_private + *dev_priv) +{ + int i; + + for (i = 0; i < dev_priv->usec_timeout; i++) { + VIA_CHROME9_WRITE8(0x83d4, 0x34); + if ((VIA_CHROME9_READ8(0x83d5)) & 0x8) + return 0; + __via_chrome9ke_udelay(1); + } + + return (-1); +} + +void via_chrome9_preclose(struct drm_device *dev, struct drm_file *file_priv) +{ + struct drm_via_chrome9_private *dev_priv = + (struct drm_via_chrome9_private *) dev->dev_private; + struct drm_via_chrome9_sarea *sarea_priv = NULL; + + if (!dev_priv) + return ; + + sarea_priv = dev_priv->sarea_priv; + if (!sarea_priv) + return ; + + if ((sarea_priv->page_flip == 1) && + (sarea_priv->current_page != VIA_CHROME9_FRONT)) { + volatile unsigned long *bci_base; + if (via_chrome9_do_wait_vblank(dev_priv)) + return; + + bci_base = (volatile unsigned long *)(dev_priv->bci); + + BCI_SET_STREAM_REGISTER(bci_base, 0x81c4, 0xc0000000); + BCI_SET_STREAM_REGISTER(bci_base, 0x81c0, + dev_priv->front_offset); + BCI_SEND(bci_base, 0x64000000);/* wait vsync */ + + sarea_priv->current_page = VIA_CHROME9_FRONT; + } +} + +int via_chrome9_is_agp(struct drm_device *dev) +{ + /* filter out pcie group which has no AGP device */ + if (dev->pci_device == 0x1122) { + dev->driver->driver_features &= + ~(DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_REQUIRE_AGP); + return 0; + } + return 1; +} + --- linux-2.6.24.orig/drivers/char/drm/via_chrome9_drv.h +++ linux-2.6.24/drivers/char/drm/via_chrome9_drv.h @@ -0,0 +1,145 @@ +/* + * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice + * (including the next paragraph) shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL VIA, S3 GRAPHICS, AND/OR + * ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef _VIA_CHROME9_DRV_H_ +#define _VIA_CHROME9_DRV_H_ + +#include "drm_sman.h" +#define DRIVER_AUTHOR "Various" + +#define DRIVER_NAME "via_chrome9_chrome9" +#define DRIVER_DESC "VIA_CHROME9 Unichrome / Pro" +#define DRIVER_DATE "20080415" + +#define DRIVER_MAJOR 2 +#define DRIVER_MINOR 11 +#define DRIVER_PATCHLEVEL 1 + +#define via_chrome9_PCI_BUF_SIZE 60000 +#define via_chrome9_FIRE_BUF_SIZE 1024 +#define via_chrome9_NUM_IRQS 4 + +#define MAX_MEMORY_HEAPS 4 +#define NUMBER_OF_APERTURES 32 + +/*typedef struct drm_via_chrome9_shadow_map drm_via_chrome9_shadow_map_t;*/ +struct drm_via_chrome9_shadow_map { + struct drm_map *shadow; + unsigned int shadow_size; + unsigned int *shadow_handle; +}; + +/*typedef struct drm_via_chrome9_pagetable_map + *drm_via_chrome9_pagetable_map_t; + */ +struct drm_via_chrome9_pagetable_map { + unsigned int pagetable_offset; + unsigned int pagetable_size; + unsigned int *pagetable_handle; + unsigned int mmt_register; +}; + +/*typedef struct drm_via_chrome9_private drm_via_chrome9_private_t;*/ +struct drm_via_chrome9_private { + int chip_agp; + int chip_index; + int chip_sub_index; + + unsigned long front_offset; + unsigned long back_offset; + unsigned long depth_offset; + unsigned long fb_base_address; + unsigned long available_fb_size; + int usec_timeout; + int max_apertures; + struct drm_sman sman; + unsigned int alignment; + /* bit[31]:0:indicate no alignment needed,1:indicate + alignment needed and size is bit[0:30]*/ + + struct drm_map *sarea; + struct drm_via_chrome9_sarea *sarea_priv; + + struct drm_map *mmio; + struct drm_map *hostBlt; + struct drm_map *fb; + struct drm_map *front; + struct drm_map *back; + struct drm_map *depth; + struct drm_map *agp_tex; + unsigned int agp_size; + unsigned int agp_offset; + + struct semaphore *drm_s3g_sem; + + struct drm_via_chrome9_shadow_map shadow_map; + struct drm_via_chrome9_pagetable_map pagetable_map; + + char *bci; + + int aperture_usage[NUMBER_OF_APERTURES]; + void *event_tag_info; + + /* DMA buffer manager */ + void *dma_manager; + /* Indicate agp/pcie heap initialization flag */ + int agp_initialized; + /* Indicate video heap initialization flag */ + int vram_initialized; + + unsigned long pcie_vmalloc_addr; + + /* pointer to device information */ + void *dev; + /* if agp init fail, go ahead and force dri use PCI*/ + enum { + DRM_AGP_RING_BUFFER, + DRM_AGP_DOUBLE_BUFFER, + DRM_AGP_DISABLED + } drm_agp_type; + /*end*/ + + unsigned long *bci_buffer; + unsigned long pcie_vmalloc_nocache; +}; + + +enum via_chrome9_family { + VIA_CHROME9_OTHER = 0, /* Baseline */ + VIA_CHROME9_PRO_GROUP_A,/* Another video engine and DMA commands */ + VIA_CHROME9_DX9_0, + VIA_CHROME9_PCIE_GROUP +}; + +/* VIA_CHROME9 MMIO register access */ +#define VIA_CHROME9_BASE ((dev_priv->mmio)) + +#define VIA_CHROME9_READ(reg) DRM_READ32(VIA_CHROME9_BASE, reg) +#define VIA_CHROME9_WRITE(reg, val) DRM_WRITE32(VIA_CHROME9_BASE, reg, val) +#define VIA_CHROME9_READ8(reg) DRM_READ8(VIA_CHROME9_BASE, reg) +#define VIA_CHROME9_WRITE8(reg, val) DRM_WRITE8(VIA_CHROME9_BASE, reg, val) + +#endif --- linux-2.6.24.orig/drivers/char/drm/via_chrome9_drm.h +++ linux-2.6.24/drivers/char/drm/via_chrome9_drm.h @@ -0,0 +1,423 @@ +/* + * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice + * (including the next paragraph) shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL VIA, S3 GRAPHICS, AND/OR + * ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef _VIA_CHROME9_DRM_H_ +#define _VIA_CHROME9_DRM_H_ + +/* WARNING: These defines must be the same as what the Xserver uses. + * if you change them, you must change the defines in the Xserver. + */ + +#ifndef _VIA_CHROME9_DEFINES_ +#define _VIA_CHROME9_DEFINES_ + +#ifndef __KERNEL__ +#include "via_drmclient.h" +#endif + +#define VIA_CHROME9_NR_SAREA_CLIPRECTS 8 +#define VIA_CHROME9_NR_XVMC_PORTS 10 +#define VIA_CHROME9_NR_XVMC_LOCKS 5 +#define VIA_CHROME9_MAX_CACHELINE_SIZE 64 +#define XVMCLOCKPTR(saPriv,lockNo) \ + ((volatile struct drm_hw_lock *) \ + (((((unsigned long) (saPriv)->XvMCLockArea) + \ + (VIA_CHROME9_MAX_CACHELINE_SIZE - 1)) & \ + ~(VIA_CHROME9_MAX_CACHELINE_SIZE - 1)) + \ + VIA_CHROME9_MAX_CACHELINE_SIZE*(lockNo))) + +/* Each region is a minimum of 64k, and there are at most 64 of them. + */ +#define VIA_CHROME9_NR_TEX_REGIONS 64 +#define VIA_CHROME9_LOG_MIN_TEX_REGION_SIZE 16 +#endif + +#define VIA_CHROME9_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */ +#define VIA_CHROME9_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */ +#define VIA_CHROME9_UPLOAD_CTX 0x4 +#define VIA_CHROME9_UPLOAD_BUFFERS 0x8 +#define VIA_CHROME9_UPLOAD_TEX0 0x10 +#define VIA_CHROME9_UPLOAD_TEX1 0x20 +#define VIA_CHROME9_UPLOAD_CLIPRECTS 0x40 +#define VIA_CHROME9_UPLOAD_ALL 0xff + +/* VIA_CHROME9 specific ioctls */ +#define DRM_VIA_CHROME9_ALLOCMEM 0x00 +#define DRM_VIA_CHROME9_FREEMEM 0x01 +#define DRM_VIA_CHROME9_FREE 0x02 +#define DRM_VIA_CHROME9_ALLOCATE_EVENT_TAG 0x03 +#define DRM_VIA_CHROME9_FREE_EVENT_TAG 0x04 +#define DRM_VIA_CHROME9_ALLOCATE_APERTURE 0x05 +#define DRM_VIA_CHROME9_FREE_APERTURE 0x06 +#define DRM_VIA_CHROME9_ALLOCATE_VIDEO_MEM 0x07 +#define DRM_VIA_CHROME9_FREE_VIDEO_MEM 0x08 +#define DRM_VIA_CHROME9_WAIT_CHIP_IDLE 0x09 +#define DRM_VIA_CHROME9_PROCESS_EXIT 0x0A +#define DRM_VIA_CHROME9_RESTORE_PRIMARY 0x0B +#define DRM_VIA_CHROME9_FLUSH_CACHE 0x0C +#define DRM_VIA_CHROME9_INIT 0x0D +#define DRM_VIA_CHROME9_FLUSH 0x0E +#define DRM_VIA_CHROME9_CHECKVIDMEMSIZE 0x0F +#define DRM_VIA_CHROME9_PCIEMEMCTRL 0x10 +#define DRM_VIA_CHROME9_AUTH_MAGIC 0x11 + +#define DRM_IOCTL_VIA_CHROME9_INIT \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_INIT, \ + struct drm_via_chrome9_init) +#define DRM_IOCTL_VIA_CHROME9_FLUSH \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_FLUSH, \ + struct drm_via_chrome9_flush) +#define DRM_IOCTL_VIA_CHROME9_FREE \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_FREE, int) +#define DRM_IOCTL_VIA_CHROME9_ALLOCATE_EVENT_TAG \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_ALLOCATE_EVENT_TAG, \ + struct drm_event_via_chrome9_tag) +#define DRM_IOCTL_VIA_CHROME9_FREE_EVENT_TAG \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_FREE_EVENT_TAG, \ + struct drm_event_via_chrome9_tag) +#define DRM_IOCTL_VIA_CHROME9_ALLOCATE_APERTURE \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_ALLOCATE_APERTURE, \ + struct drm_via_chrome9_aperture) +#define DRM_IOCTL_VIA_CHROME9_FREE_APERTURE \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_FREE_APERTURE, \ + struct drm_via_chrome9_aperture) +#define DRM_IOCTL_VIA_CHROME9_ALLOCATE_VIDEO_MEM \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_ALLOCATE_VIDEO_MEM, \ + struct drm_via_chrome9_memory_alloc) +#define DRM_IOCTL_VIA_CHROME9_FREE_VIDEO_MEM \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_FREE_VIDEO_MEM, \ + struct drm_via_chrome9_memory_alloc) +#define DRM_IOCTL_VIA_CHROME9_WAIT_CHIP_IDLE \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_WAIT_CHIP_IDLE, int) +#define DRM_IOCTL_VIA_CHROME9_PROCESS_EXIT \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_PROCESS_EXIT, int) +#define DRM_IOCTL_VIA_CHROME9_RESTORE_PRIMARY \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_RESTORE_PRIMARY, int) +#define DRM_IOCTL_VIA_CHROME9_FLUSH_CACHE \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_FLUSH_CACHE, int) +#define DRM_IOCTL_VIA_CHROME9_ALLOCMEM \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_ALLOCMEM, int) +#define DRM_IOCTL_VIA_CHROME9_FREEMEM \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_FREEMEM, int) +#define DRM_IOCTL_VIA_CHROME9_CHECK_VIDMEM_SIZE \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_CHECKVIDMEMSIZE, \ + struct drm_via_chrome9_memory_alloc) +#define DRM_IOCTL_VIA_CHROME9_PCIEMEMCTRL \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_PCIEMEMCTRL,\ + drm_via_chrome9_pciemem_ctrl_t) +#define DRM_IOCTL_VIA_CHROME9_AUTH_MAGIC \ + DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CHROME9_AUTH_MAGIC, drm_auth_t) + +enum S3GCHIPIDS { + CHIP_UNKNOWN = -1, + CHIP_CMODEL, /*Model for any chip. */ + CHIP_CLB, /*Columbia */ + CHIP_DST, /*Destination */ + CHIP_CSR, /*Castlerock */ + CHIP_INV, /*Innovation (H3) */ + CHIP_H5, /*Innovation (H5) */ + CHIP_H5S1, /*Innovation (H5S1) */ + CHIP_H6S2, /*Innovation (H6S2) */ + CHIP_CMS, /*Columbia MS */ + CHIP_METRO, /*Metropolis */ + CHIP_MANHATTAN, /*manhattan */ + CHIP_MATRIX, /*matrix */ + CHIP_EVO, /*change for GCC 4.1 -add- 07.02.12*/ + CHIP_H6S1, /*Innovation (H6S1)*/ + CHIP_DST2, /*Destination-2 */ + CHIP_LAST /*Maximum number of chips supported. */ +}; + +enum VIA_CHROME9CHIPBUS { + CHIP_PCI, + CHIP_AGP, + CHIP_PCIE +}; + +struct drm_via_chrome9_init { + enum { + VIA_CHROME9_INIT = 0x01, + VIA_CHROME9_CLEANUP = 0x02 + } func; + int chip_agp; + int chip_index; + int chip_sub_index; + int usec_timeout; + unsigned int sarea_priv_offset; + unsigned int fb_cpp; + unsigned int front_offset; + unsigned int back_offset; + unsigned int depth_offset; + unsigned int mmio_handle; + unsigned int dma_handle; + unsigned int fb_handle; + unsigned int front_handle; + unsigned int back_handle; + unsigned int depth_handle; + + unsigned int fb_tex_offset; + unsigned int fb_tex_size; + + unsigned int agp_tex_size; + unsigned int agp_tex_handle; + unsigned int shadow_size; + unsigned int shadow_handle; + unsigned int garttable_size; + unsigned int garttable_offset; + unsigned long available_fb_size; + unsigned long fb_base_address; + unsigned int DMA_size; + unsigned long DMA_phys_address; + enum { + AGP_RING_BUFFER, + AGP_DOUBLE_BUFFER, + AGP_DISABLED + } agp_type; + unsigned int hostBlt_handle; +}; + +enum dma_cmd_type { + flush_bci = 0, + flush_bci_and_wait, + dma_kickoff, + flush_dma_buffer, + flush_dma_and_wait +}; + +struct drm_via_chrome9_flush { + enum dma_cmd_type dma_cmd_type; + /* command buffer index */ + int cmd_idx; + /* command buffer offset */ + int cmd_offset; + /* command dword size,command always from beginning */ + int cmd_size; + /* if use dma kick off,it is dma kick off command */ + unsigned long dma_kickoff[2]; + /* user mode DMA buffer pointer */ + unsigned int *usermode_dma_buf; +}; + +struct event_value { + int event_low; + int event_high; +}; + +struct drm_via_chrome9_event_tag { + unsigned int event_size; /* event tag size */ + int event_offset; /* event tag id */ + struct event_value last_sent_event_value; + struct event_value current_event_value; + int query_mask0; + int query_mask1; + int query_Id1; +}; + +/* Indices into buf.Setup where various bits of state are mirrored per + * context and per buffer. These can be fired at the card as a unit, + * or in a piecewise fashion as required. + */ + +#define VIA_CHROME9_TEX_SETUP_SIZE 8 + +/* Flags for clear ioctl + */ +#define VIA_CHROME9_FRONT 0x1 +#define VIA_CHROME9_BACK 0x2 +#define VIA_CHROME9_DEPTH 0x4 +#define VIA_CHROME9_STENCIL 0x8 +#define VIA_CHROME9_MEM_VIDEO 0 /* matches drm constant */ +#define VIA_CHROME9_MEM_AGP 1 /* matches drm constant */ +#define VIA_CHROME9_MEM_SYSTEM 2 +#define VIA_CHROME9_MEM_MIXED 3 +#define VIA_CHROME9_MEM_UNKNOWN 4 + +struct drm_via_chrome9_agp { + uint32_t offset; + uint32_t size; +}; + +struct drm_via_chrome9_fb { + uint32_t offset; + uint32_t size; +}; + +struct drm_via_chrome9_mem { + uint32_t context; + uint32_t type; + uint32_t size; + unsigned long index; + unsigned long offset; +}; + +struct drm_via_chrome9_aperture { + /*IN: The frame buffer offset of the surface. */ + int surface_offset; + /*IN: Surface pitch in byte, */ + int pitch; + /*IN: Surface width in pixel */ + int width; + /*IN: Surface height in pixel */ + int height; + /*IN: Surface color format, Columbia has more color formats */ + int color_format; + /*IN: Rotation degrees, only for Columbia */ + int rotation_degree; + /*IN Is the PCIE Video, for MATRIX support NONLOCAL Aperture */ + int isPCIEVIDEO; + /*IN: Is the surface tilled, only for Columbia */ + int is_tiled; + /*IN: Only allocate apertur, not hardware setup. */ + int allocate_only; + /* OUT: linear address for aperture */ + unsigned int *aperture_linear_address; + /*OUT: The pitch of the aperture,for CPU write not for GE */ + int aperture_pitch; + /*OUT: The index of the aperture */ + int aperture_handle; + int apertureID; + /* always =0xAAAAAAAA */ + /* Aligned surface's width(in pixel) */ + int width_aligned; + /* Aligned surface's height(in pixel) */ + int height_aligned; +}; + +/* + Some fileds of this data structure has no meaning now since + we have managed heap based on mechanism provided by DRM + Remain what it was to keep consistent with 3D driver interface. +*/ +struct drm_via_chrome9_memory_alloc { + enum { + memory_heap_video = 0, + memory_heap_agp, + memory_heap_pcie_video, + memory_heap_pcie, + max_memory_heaps + } heap_type; + struct { + void *lpL1Node; + unsigned int alcL1Tag; + unsigned int usageCount; + unsigned int dwVersion; + unsigned int dwResHandle; + unsigned int dwProcessID; + } heap_info; + unsigned int flags; + unsigned int size; + unsigned int physaddress; + unsigned int offset; + unsigned int align; + void *linearaddress; +}; + +struct drm_via_chrome9_dma_init { + enum { + VIA_CHROME9_INIT_DMA = 0x01, + VIA_CHROME9_CLEANUP_DMA = 0x02, + VIA_CHROME9_DMA_INITIALIZED = 0x03 + } func; + + unsigned long offset; + unsigned long size; + unsigned long reg_pause_addr; +}; + +struct drm_via_chrome9_cmdbuffer { + char __user *buf; + unsigned long size; +}; + +/* Warning: If you change the SAREA structure you must change the Xserver + * structure as well */ + +struct drm_via_chrome9_tex_region { + unsigned char next, prev; /* indices to form a circular LRU */ + unsigned char inUse; /* owned by a client, or free? */ + int age; /* tracked by clients to update local LRU's */ +}; + +struct drm_via_chrome9_sarea { + int page_flip; + int current_page; + unsigned int req_drawable;/* the X drawable id */ + unsigned int req_draw_buffer;/* VIA_CHROME9_FRONT or VIA_CHROME9_BACK */ + /* Last context that uploaded state */ + int ctx_owner; +}; + +struct drm_via_chrome9_cmdbuf_size { + enum { + VIA_CHROME9_CMDBUF_SPACE = 0x01, + VIA_CHROME9_CMDBUF_LAG = 0x02 + } func; + int wait; + uint32_t size; +}; + +struct drm_via_chrome9_DMA_manager { + unsigned int *addr_linear; + unsigned int DMASize; + unsigned int bDMAAgp; + unsigned int LastIssuedEventTag; + unsigned int *pBeg; + unsigned int *pInUseByHW; + unsigned int **ppInUseByHW; + unsigned int *pInUseBySW; + unsigned int *pFree; + unsigned int *pEnd; + + unsigned long pPhysical; + unsigned int MaxKickoffSize; +}; + +extern int via_chrome9_ioctl_wait_chip_idle(struct drm_device *dev, + void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_init(struct drm_device *dev, + void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_allocate_event_tag(struct drm_device + *dev, void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_free_event_tag(struct drm_device *dev, + void *data, struct drm_file *file_priv); +extern int via_chrome9_driver_load(struct drm_device *dev, + unsigned long chipset); +extern int via_chrome9_driver_unload(struct drm_device *dev); +extern int via_chrome9_ioctl_process_exit(struct drm_device *dev, + void *data, struct drm_file *file_priv); +extern int via_chrome9_ioctl_restore_primary(struct drm_device *dev, + void *data, struct drm_file *file_priv); +extern int via_chrome9_drm_resume(struct pci_dev *dev); +extern int via_chrome9_drm_suspend(struct pci_dev *dev, + pm_message_t state); +extern void __via_chrome9ke_udelay(unsigned long usecs); +extern void via_chrome9_lastclose(struct drm_device *dev); +extern void via_chrome9_preclose(struct drm_device *dev, + struct drm_file *file_priv); +extern int via_chrome9_is_agp(struct drm_device *dev); + + +#endif /* _VIA_CHROME9_DRM_H_ */ --- linux-2.6.24.orig/drivers/char/drm/drm_fops.c +++ linux-2.6.24/drivers/char/drm/drm_fops.c @@ -326,6 +326,7 @@ struct drm_file *file_priv = filp->private_data; struct drm_device *dev = file_priv->head->dev; int retcode = 0; + unsigned long irqflags; lock_kernel(); @@ -357,9 +358,11 @@ */ do{ - spin_lock(&dev->lock.spinlock); + spin_lock_irqsave(&dev->lock.spinlock, + irqflags); locked = dev->lock.idle_has_lock; - spin_unlock(&dev->lock.spinlock); + spin_unlock_irqrestore(&dev->lock.spinlock, + irqflags); if (locked) break; schedule(); --- linux-2.6.24.orig/drivers/char/drm/via_chrome9_drv.c +++ linux-2.6.24/drivers/char/drm/via_chrome9_drv.c @@ -0,0 +1,153 @@ +/* + * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice + * (including the next paragraph) shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL VIA, S3 GRAPHICS, AND/OR + * ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "drmP.h" +#include "via_chrome9_drm.h" +#include "via_chrome9_drv.h" +#include "via_chrome9_dma.h" +#include "via_chrome9_mm.h" + +#include "drm_pciids.h" + +static int dri_library_name(struct drm_device *dev, char *buf) +{ + return snprintf(buf, PAGE_SIZE, "via_chrome9"); +} + +int via_chrome9_drm_authmagic(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + return 0; +} + +struct drm_ioctl_desc via_chrome9_ioctls[] = { + DRM_IOCTL_DEF(DRM_VIA_CHROME9_INIT, via_chrome9_ioctl_init, + DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),/* via_chrome9_map.c*/ + DRM_IOCTL_DEF(DRM_VIA_CHROME9_FLUSH, via_chrome9_ioctl_flush, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_FREE, via_chrome9_ioctl_free, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_ALLOCATE_EVENT_TAG, + via_chrome9_ioctl_allocate_event_tag, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_FREE_EVENT_TAG, + via_chrome9_ioctl_free_event_tag, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_ALLOCATE_APERTURE, + via_chrome9_ioctl_allocate_aperture, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_FREE_APERTURE, + via_chrome9_ioctl_free_aperture, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_ALLOCATE_VIDEO_MEM, + via_chrome9_ioctl_allocate_mem_wrapper, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_FREE_VIDEO_MEM, + via_chrome9_ioctl_free_mem_wrapper, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_WAIT_CHIP_IDLE, + via_chrome9_ioctl_wait_chip_idle, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_PROCESS_EXIT, + via_chrome9_ioctl_process_exit, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_RESTORE_PRIMARY, + via_chrome9_ioctl_restore_primary, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_FLUSH_CACHE, + via_chrome9_ioctl_flush_cache, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_ALLOCMEM, + via_chrome9_ioctl_allocate_mem_base, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_FREEMEM, + via_chrome9_ioctl_freemem_base, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_CHECKVIDMEMSIZE, + via_chrome9_ioctl_check_vidmem_size, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_PCIEMEMCTRL, + via_chrome9_ioctl_pciemem_ctrl, DRM_AUTH), + DRM_IOCTL_DEF(DRM_VIA_CHROME9_AUTH_MAGIC, via_chrome9_drm_authmagic, 0) +}; + +int via_chrome9_max_ioctl = DRM_ARRAY_SIZE(via_chrome9_ioctls); + +static struct pci_device_id pciidlist[] = { + via_chrome9DRV_PCI_IDS +}; + +int via_chrome9_driver_open(struct drm_device *dev, + struct drm_file *priv) +{ + priv->authenticated = 1; + return 0; +} + +static struct drm_driver driver = { + .driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | + DRIVER_HAVE_DMA | DRIVER_FB_DMA | DRIVER_USE_MTRR, + .open = via_chrome9_driver_open, + .load = via_chrome9_driver_load, + .unload = via_chrome9_driver_unload, + .device_is_agp = via_chrome9_is_agp, + .dri_library_name = dri_library_name, + .reclaim_buffers = drm_core_reclaim_buffers, + .reclaim_buffers_locked = NULL, + .reclaim_buffers_idlelocked = via_chrome9_reclaim_buffers_locked, + .lastclose = via_chrome9_lastclose, + .preclose = via_chrome9_preclose, + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, + .ioctls = via_chrome9_ioctls, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, + .pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + .resume = via_chrome9_drm_resume, + .suspend = via_chrome9_drm_suspend, + }, + + .name = DRIVER_NAME, + .desc = DRIVER_DESC, + .date = DRIVER_DATE, + .major = DRIVER_MAJOR, + .minor = DRIVER_MINOR, + .patchlevel = DRIVER_PATCHLEVEL, +}; + +static int __init via_chrome9_init(void) +{ + driver.num_ioctls = via_chrome9_max_ioctl; + driver.dev_priv_size = sizeof(struct drm_via_chrome9_private); + return drm_init(&driver); +} + +static void __exit via_chrome9_exit(void) +{ + drm_exit(&driver); +} + +module_init(via_chrome9_init); +module_exit(via_chrome9_exit); + +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_LICENSE("GPL and additional rights"); --- linux-2.6.24.orig/drivers/acpi/toshiba_acpi.c +++ linux-2.6.24/drivers/acpi/toshiba_acpi.c @@ -27,13 +27,28 @@ * engineering the Windows drivers * Yasushi Nagato - changes for linux kernel 2.4 -> 2.5 * Rob Miller - TV out and hotkeys help + * Daniel Silverstone - Punting of hotkeys via acpi using a thread * + * PLEASE NOTE + * + * This is an experimental version of toshiba_acpi which includes emulation + * of the original toshiba driver's /proc/toshiba and /dev/toshiba, + * allowing Toshiba userspace utilities to work. The relevant code was + * based on toshiba.c (copyright 1996-2001 Jonathan A. Buzzard) and + * incorporated into this driver with help from Gintautas Miliauskas, + * Charles Schwieters, and Christoph Burger-Scheidlin. + * + * Caveats: + * * hotkey status in /proc/toshiba is not implemented + * * to make accesses to /dev/toshiba load this driver instead of + * the original driver, you will have to modify your module + * auto-loading configuration * * TODO * */ -#define TOSHIBA_ACPI_VERSION "0.18" +#define TOSHIBA_ACPI_VERSION "0.19a-dev" #define PROC_INTERFACE_VERSION 1 #include @@ -41,12 +56,32 @@ #include #include #include +#include +#include +#include +#include +#include #include - +#include #include #include +/* Some compatibility for isa legacy interface */ +#ifndef isa_readb + +#define isa_readb(a) readb(__ISA_IO_base + (a)) +#define isa_readw(a) readw(__ISA_IO_base + (a)) +#define isa_readl(a) readl(__ISA_IO_base + (a)) +#define isa_writeb(b,a) writeb(b,__ISA_IO_base + (a)) +#define isa_writew(w,a) writew(w,__ISA_IO_base + (a)) +#define isa_writel(l,a) writel(l,__ISA_IO_base + (a)) +#define isa_memset_io(a,b,c) memset_io(__ISA_IO_base + (a),(b),(c)) +#define isa_memcpy_fromio(a,b,c) memcpy_fromio((a),__ISA_IO_base + (b),(c)) +#define isa_memcpy_toio(a,b,c) memcpy_toio(__ISA_IO_base + (a),(b),(c)) + +#endif + MODULE_AUTHOR("John Belmonte"); MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver"); MODULE_LICENSE("GPL"); @@ -216,6 +251,11 @@ static int force_fan; static int last_key_event; static int key_event_valid; +static int hotkeys_over_acpi = 1; +static int hotkeys_check_per_sec = 2; + +module_param(hotkeys_over_acpi, uint, 0400); +module_param(hotkeys_check_per_sec, uint, 0400); typedef struct _ProcItem { const char *name; @@ -443,27 +483,34 @@ u32 hci_result; u32 value; - if (!key_event_valid) { - hci_read1(HCI_SYSTEM_EVENT, &value, &hci_result); - if (hci_result == HCI_SUCCESS) { - key_event_valid = 1; - last_key_event = value; - } else if (hci_result == HCI_EMPTY) { - /* better luck next time */ - } else if (hci_result == HCI_NOT_SUPPORTED) { - /* This is a workaround for an unresolved issue on - * some machines where system events sporadically - * become disabled. */ - hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); - printk(MY_NOTICE "Re-enabled hotkeys\n"); - } else { - printk(MY_ERR "Error reading hotkey status\n"); - goto end; + if (!hotkeys_over_acpi) { + if (!key_event_valid) { + hci_read1(HCI_SYSTEM_EVENT, &value, &hci_result); + if (hci_result == HCI_SUCCESS) { + key_event_valid = 1; + last_key_event = value; + } else if (hci_result == HCI_EMPTY) { + /* better luck next time */ + } else if (hci_result == HCI_NOT_SUPPORTED) { + /* This is a workaround for an + * unresolved issue on some machines + * where system events sporadically + * become disabled. */ + hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); + printk(MY_NOTICE "Re-enabled hotkeys\n"); + } else { + printk(MY_ERR "Error reading hotkey status\n"); + goto end; + } } + } else { + key_event_valid = 0; + last_key_event = 0; } p += sprintf(p, "hotkey_ready: %d\n", key_event_valid); p += sprintf(p, "hotkey: 0x%04x\n", last_key_event); + p += sprintf(p, "hotkeys_via_acpi: %d\n", hotkeys_over_acpi); end: return p; @@ -490,6 +537,179 @@ return p; } +/* /dev/toshiba and /proc/toshiba handlers {{{ + * + * ISSUE: lots of magic numbers and mysterious code + */ + +#define TOSH_MINOR_DEV 181 +#define OLD_PROC_TOSHIBA "toshiba" + +static int +tosh_acpi_bridge(SMMRegisters* regs) +{ + acpi_status status; + + /* assert(sizeof(SMMRegisters) == sizeof(u32)*HCI_WORDS); */ + status = hci_raw((u32*)regs, (u32*)regs); + if (status == AE_OK && (regs->eax & 0xff00) == HCI_SUCCESS) + return 0; + + return -EINVAL; +} + +static int +tosh_ioctl(struct inode* ip, struct file* fp, unsigned int cmd, + unsigned long arg) +{ + SMMRegisters regs; + unsigned short ax,bx; + int err; + + if ((!arg) || (cmd != TOSH_SMM)) + return -EINVAL; + + if (copy_from_user(®s, (SMMRegisters*)arg, sizeof(SMMRegisters))) + return -EFAULT; + + ax = regs.eax & 0xff00; + bx = regs.ebx & 0xffff; + + /* block HCI calls to read/write memory & PCI devices */ + if (((ax==HCI_SET) || (ax==HCI_GET)) && (bx>0x0069)) + return -EINVAL; + + err = tosh_acpi_bridge(®s); + + if (copy_to_user((SMMRegisters*)arg, ®s, sizeof(SMMRegisters))) + return -EFAULT; + + return err; +} + +static int +tosh_get_machine_id(void) +{ + int id; + unsigned short bx,cx; + unsigned long address; + + id = (0x100*(int)isa_readb(0xffffe))+((int)isa_readb(0xffffa)); + + /* do we have a SCTTable machine identication number on our hands */ + if (id==0xfc2f) { + bx = 0xe6f5; /* cheat */ + /* now twiddle with our pointer a bit */ + address = 0x000f0000+bx; + cx = isa_readw(address); + address = 0x000f0009+bx+cx; + cx = isa_readw(address); + address = 0x000f000a+cx; + cx = isa_readw(address); + /* now construct our machine identification number */ + id = ((cx & 0xff)<<8)+((cx & 0xff00)>>8); + } + + return id; +} + +static int tosh_id; +static int tosh_bios; +static int tosh_date; +static int tosh_sci; + +static struct file_operations tosh_fops = { + .owner = THIS_MODULE, + .ioctl = tosh_ioctl +}; + +static struct miscdevice tosh_device = { + TOSH_MINOR_DEV, + "toshiba", + &tosh_fops +}; + +static void +setup_tosh_info(void __iomem *bios) +{ + int major, minor; + int day, month, year; + + tosh_id = tosh_get_machine_id(); + + /* get the BIOS version */ + major = isa_readb(0xfe009)-'0'; + minor = ((isa_readb(0xfe00b)-'0')*10)+(isa_readb(0xfe00c)-'0'); + tosh_bios = (major*0x100)+minor; + + /* get the BIOS date */ + day = ((isa_readb(0xffff5)-'0')*10)+(isa_readb(0xffff6)-'0'); + month = ((isa_readb(0xffff8)-'0')*10)+(isa_readb(0xffff9)-'0'); + year = ((isa_readb(0xffffb)-'0')*10)+(isa_readb(0xffffc)-'0'); + tosh_date = (((year-90) & 0x1f)<<10) | ((month & 0xf)<<6) + | ((day & 0x1f)<<1); +} + +/* /proc/toshiba read handler */ +static int +tosh_get_info(char* buffer, char** start, off_t fpos, int length) +{ + char* temp = buffer; + /* TODO: tosh_fn_status() */ + int key = 0; + + /* Format: + * 0) Linux driver version (this will change if format changes) + * 1) Machine ID + * 2) SCI version + * 3) BIOS version (major, minor) + * 4) BIOS date (in SCI date format) + * 5) Fn Key status + */ + + temp += sprintf(temp, "1.1 0x%04x %d.%d %d.%d 0x%04x 0x%02x\n", + tosh_id, + (tosh_sci & 0xff00)>>8, + tosh_sci & 0xff, + (tosh_bios & 0xff00)>>8, + tosh_bios & 0xff, + tosh_date, + key); + + return temp-buffer; +} + +static int __init +old_driver_emulation_init(void) +{ + int status; + void __iomem *bios = ioremap(0xf0000, 0x10000); + if (!bios) + return -ENOMEM; + + if ((status = misc_register(&tosh_device))) { + printk(MY_ERR "failed to register misc device %d (\"%s\")\n", + tosh_device.minor, tosh_device.name); + return status; + } + + setup_tosh_info(bios); + create_proc_info_entry(OLD_PROC_TOSHIBA, 0, NULL, tosh_get_info); + + iounmap(bios); + + return 0; +} + +static void __exit +old_driver_emulation_exit(void) +{ + remove_proc_entry(OLD_PROC_TOSHIBA, NULL); + misc_deregister(&tosh_device); +} + +/* }}} end of /dev/toshiba and /proc/toshiba handlers */ + /* proc and module init */ @@ -538,16 +758,151 @@ .update_status = set_lcd_status, }; +static struct semaphore thread_sem; +static int thread_should_die; + +static struct acpi_device *threaded_device = 0; + +static void thread_deliver_button_event(u32 value) +{ + if (!threaded_device) return; + if( value == 0x0100 ) { + /* Ignore FN on its own */ + } else if( value & 0x80 ) { + acpi_bus_generate_proc_event( threaded_device, 1, value & ~0x80 ); + } else { + acpi_bus_generate_proc_event( threaded_device, 0, value ); + } +} + +static int toshiba_acpi_thread(void *data) +{ + int dropped = 0; + u32 hci_result, value; + + daemonize("ktoshkeyd"); + set_user_nice(current, 4); + thread_should_die = 0; + + up(&thread_sem); + + do { + /* In case we get stuck; we can rmmod the module here */ + if (thread_should_die) + break; + + hci_read1(HCI_SYSTEM_EVENT, &value, &hci_result); + if (hci_result == HCI_SUCCESS) { + dropped++; + } else if (hci_result == HCI_EMPTY) { + /* better luck next time */ + } else if (hci_result == HCI_NOT_SUPPORTED) { + /* This is a workaround for an unresolved issue on + * some machines where system events sporadically + * become disabled. */ + hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); + printk(MY_NOTICE "Re-enabled hotkeys\n"); + } + } while (hci_result != HCI_EMPTY); + + printk(MY_INFO "Dropped %d keys from the queue on startup\n", dropped); + + for (;;) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ / hotkeys_check_per_sec); + + if (thread_should_die) + break; + + if (try_to_freeze()) + continue; + + do { + hci_read1(HCI_SYSTEM_EVENT, &value, &hci_result); + if (hci_result == HCI_SUCCESS) { + thread_deliver_button_event(value); + } else if (hci_result == HCI_EMPTY) { + /* better luck next time */ + } else if (hci_result == HCI_NOT_SUPPORTED) { + /* This is a workaround for an + * unresolved issue on some machines + * where system events sporadically + * become disabled. */ + hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); + printk(MY_NOTICE "Re-enabled hotkeys\n"); + } + } while (hci_result == HCI_SUCCESS); + } + set_user_nice(current, -20); /* Become nasty so we are cleaned up + * before the module exits making us oops */ + up(&thread_sem); + return 0; +} + +static int acpi_toshkeys_add (struct acpi_device *device) +{ + threaded_device = device; + strcpy(acpi_device_name(device), "Toshiba laptop hotkeys"); + strcpy(acpi_device_class(device), "hkey"); + return 0; +} + +static int acpi_toshkeys_remove (struct acpi_device *device, int type) +{ + if (threaded_device == device) + threaded_device = 0; + return 0; +} + +static const struct acpi_device_id acpi_toshkeys_ids[] = { + { "TOS6200", 0 }, + { "TOS6207", 0 }, + { "TOS6208", 0 }, + {"", 0} +}; + +static struct acpi_driver acpi_threaded_toshkeys = { + .name = "Toshiba laptop hotkeys driver", + .class = "hkey", + .ids = acpi_toshkeys_ids, + .ops = { + .add = acpi_toshkeys_add, + .remove = acpi_toshkeys_remove, + }, +}; + +static int __init init_threaded_acpi(void) +{ + acpi_status result = AE_OK; + result = acpi_bus_register_driver(&acpi_threaded_toshkeys); + if( result < 0 ) + printk(MY_ERR "Registration of toshkeys acpi device failed\n"); + return result; +} + +static void kill_threaded_acpi(void) +{ + acpi_bus_unregister_driver(&acpi_threaded_toshkeys); +} + static void toshiba_acpi_exit(void) { if (toshiba_backlight_device) backlight_device_unregister(toshiba_backlight_device); + if (hotkeys_over_acpi) { + thread_should_die = 1; + down(&thread_sem); + kill_threaded_acpi(); + } + remove_device(); if (toshiba_proc_dir) remove_proc_entry(PROC_TOSHIBA, acpi_root_dir); + old_driver_emulation_exit(); + return; } @@ -555,6 +910,7 @@ { acpi_status status = AE_OK; u32 hci_result; + int status2; if (acpi_disabled) return -ENODEV; @@ -571,6 +927,9 @@ TOSHIBA_ACPI_VERSION); printk(MY_INFO " HCI method: %s\n", method_hci); + if ((status2 = old_driver_emulation_init())) + return status2; + force_fan = 0; key_event_valid = 0; @@ -598,7 +957,27 @@ toshiba_acpi_exit(); return ret; } - toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1; + toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1; + + if (hotkeys_over_acpi && ACPI_SUCCESS(status)) { + printk(MY_INFO "Toshiba hotkeys are sent as ACPI events\n"); + if (hotkeys_check_per_sec < 1) + hotkeys_check_per_sec = 1; + if (hotkeys_check_per_sec > 10) + hotkeys_check_per_sec = 10; + printk(MY_INFO "ktoshkeyd will check %d time%s per second\n", + hotkeys_check_per_sec, hotkeys_check_per_sec==1?"":"s"); + if (init_threaded_acpi() >= 0) { + init_MUTEX_LOCKED(&thread_sem); + kernel_thread(toshiba_acpi_thread, NULL, CLONE_KERNEL); + down(&thread_sem); + } else { + remove_device(); + remove_proc_entry(PROC_TOSHIBA, acpi_root_dir); + status = AE_ERROR; + printk(MY_INFO "ktoshkeyd initialisation failed. Refusing to load module\n"); + } + } return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; } --- linux-2.6.24.orig/drivers/acpi/osl.c +++ linux-2.6.24/drivers/acpi/osl.c @@ -312,6 +312,67 @@ return AE_OK; } +#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD +struct acpi_table_header * acpi_find_dsdt_initrd(void) +{ + struct file *firmware_file; + mm_segment_t oldfs; + unsigned long len, len2; + struct acpi_table_header *dsdt_buffer, *ret = NULL; + struct kstat stat; + /* maybe this could be an argument on the cmd line, but let's keep it simple for now */ + char *ramfs_dsdt_name = "/DSDT.aml"; + + printk(KERN_INFO PREFIX "Looking for DSDT in initramfs... "); + + /* + * Never do this at home, only the user-space is allowed to open a file. + * The clean way would be to use the firmware loader. But this code must be run + * before there is any userspace available. So we need a static/init firmware + * infrastructure, which doesn't exist yet... + */ + if (vfs_stat(ramfs_dsdt_name, &stat) < 0) { + printk("error, file %s not found.\n", ramfs_dsdt_name); + return ret; + } + + len = stat.size; + /* check especially against empty files */ + if (len <= 4) { + printk("error file is too small, only %lu bytes.\n", len); + return ret; + } + + firmware_file = filp_open(ramfs_dsdt_name, O_RDONLY, 0); + if (IS_ERR(firmware_file)) { + printk("error, could not open file %s.\n", ramfs_dsdt_name); + return ret; + } + + dsdt_buffer = ACPI_ALLOCATE(len); + if (!dsdt_buffer) { + printk("error when allocating %lu bytes of memory.\n", len); + goto err; + } + + oldfs = get_fs(); + set_fs(KERNEL_DS); + len2 = vfs_read(firmware_file, (char __user *)dsdt_buffer, len, &firmware_file->f_pos); + set_fs(oldfs); + if (len2 < len) { + printk("error trying to read %lu bytes from %s.\n", len, ramfs_dsdt_name); + ACPI_FREE(dsdt_buffer); + goto err; + } + + printk("successfully read %lu bytes from %s.\n", len, ramfs_dsdt_name); + ret = dsdt_buffer; +err: + filp_close(firmware_file, NULL); + return ret; +} +#endif + acpi_status acpi_os_table_override(struct acpi_table_header * existing_table, struct acpi_table_header ** new_table) @@ -319,13 +380,18 @@ if (!existing_table || !new_table) return AE_BAD_PARAMETER; + *new_table = NULL; + #ifdef CONFIG_ACPI_CUSTOM_DSDT if (strncmp(existing_table->signature, "DSDT", 4) == 0) *new_table = (struct acpi_table_header *)AmlCode; - else - *new_table = NULL; -#else - *new_table = NULL; +#endif +#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD + if (strncmp(existing_table->signature, "DSDT", 4) == 0) { + struct acpi_table_header* initrd_table = acpi_find_dsdt_initrd(); + if (initrd_table) + *new_table = initrd_table; + } #endif return AE_OK; } @@ -750,6 +816,7 @@ void acpi_os_wait_events_complete(void *context) { flush_workqueue(kacpid_wq); + flush_workqueue(kacpi_notify_wq); } EXPORT_SYMBOL(acpi_os_wait_events_complete); --- linux-2.6.24.orig/drivers/acpi/reboot.c +++ linux-2.6.24/drivers/acpi/reboot.c @@ -0,0 +1,81 @@ +#include +#include +#include +#include + +/* + * Some systems the have been proved to be able to reboot this way (even if + * some fail to claim this in the FADT). + */ +static struct dmi_system_id reboot_dmi_whitelist[] = { + { + .ident = "ASUS M6NE", + .matches = { + DMI_MATCH(DMI_BIOS_VERSION,"0208"), + DMI_MATCH(DMI_PRODUCT_NAME,"M6Ne"), + }, + }, + { + .ident = "Intel powered classmate PC", + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, + "Intel powered classmate PC"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Gen 1.5"), + }, + }, + {} +}; + +void acpi_reboot(void) +{ + struct acpi_generic_address *rr; + struct pci_bus *bus0; + u8 reset_value; + unsigned int devfn; + + if (acpi_disabled) + return; + + rr = &acpi_gbl_FADT.reset_register; + + /* + * For those systems that have not been whitelisted, check the ACPI + * flags and the register layout. + */ + if (!dmi_check_system(reboot_dmi_whitelist)) { + /* Is the reset register supported? */ + if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER)) + return; + /* Is the width and ofset as specified? */ + if (rr->bit_width != 8 || rr->bit_offset != 0) + return; + } + + reset_value = acpi_gbl_FADT.reset_value; + + /* The reset register can only exist in I/O, Memory or PCI config space + * on a device on bus 0. */ + switch (rr->space_id) { + case ACPI_ADR_SPACE_PCI_CONFIG: + /* The reset register can only live on bus 0. */ + bus0 = pci_find_bus(0, 0); + if (!bus0) + return; + /* Form PCI device/function pair. */ + devfn = PCI_DEVFN((rr->address >> 32) & 0xffff, + (rr->address >> 16) & 0xffff); + printk(KERN_DEBUG "Resetting with ACPI PCI RESET_REG."); + /* Write the value that resets us. */ + pci_bus_write_config_byte(bus0, devfn, + (rr->address & 0xffff), reset_value); + break; + + case ACPI_ADR_SPACE_SYSTEM_MEMORY: + case ACPI_ADR_SPACE_SYSTEM_IO: + printk(KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n"); + acpi_hw_low_level_write(8, reset_value, rr); + break; + } + /* Wait ten seconds */ + acpi_os_stall(10000000); +} --- linux-2.6.24.orig/drivers/acpi/processor_idle.c +++ linux-2.6.24/drivers/acpi/processor_idle.c @@ -125,52 +125,7 @@ static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = { { set_max_cstate, "IBM ThinkPad R40e", { DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET70WW")}, (void *)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW")}, (void *)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET43WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET45WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET47WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET50WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET52WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET55WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET56WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET59WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET61WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET62WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET64WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET65WW") }, (void*)1}, - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET68WW") }, (void*)1}, + DMI_MATCH(DMI_BIOS_VERSION,"1SET")}, (void *)1}, { set_max_cstate, "Medion 41700", { DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), DMI_MATCH(DMI_BIOS_VERSION,"R01-A1J")}, (void *)1}, @@ -1249,6 +1204,8 @@ { int result = 0; + if (boot_option_idle_override) + return 0; if (!pr) return -EINVAL; @@ -1593,6 +1550,7 @@ return -EINVAL; } + dev->cpu = pr->id; for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { cx = &pr->power.states[i]; state = &dev->states[count]; @@ -1651,7 +1609,10 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) { - int ret; + int ret = 0; + + if (boot_option_idle_override) + return 0; if (!pr) return -EINVAL; @@ -1666,8 +1627,11 @@ cpuidle_pause_and_lock(); cpuidle_disable_device(&pr->power.dev); acpi_processor_get_power_info(pr); - acpi_processor_setup_cpuidle(pr); - ret = cpuidle_enable_device(&pr->power.dev); + if (pr->flags.power) { + acpi_processor_setup_cpuidle(pr); + ret = cpuidle_enable_device(&pr->power.dev); + } + cpuidle_resume_and_unlock(); return ret; @@ -1683,6 +1647,8 @@ struct proc_dir_entry *entry = NULL; unsigned int i; + if (boot_option_idle_override) + return 0; if (!first_run) { dmi_check_system(processor_power_dmi_table); @@ -1717,10 +1683,9 @@ * Note that we use previously set idle handler will be used on * platforms that only support C1. */ - if ((pr->flags.power) && (!boot_option_idle_override)) { + if (pr->flags.power) { #ifdef CONFIG_CPU_IDLE acpi_processor_setup_cpuidle(pr); - pr->power.dev.cpu = pr->id; if (cpuidle_register_device(&pr->power.dev)) return -EIO; #endif @@ -1757,9 +1722,11 @@ int acpi_processor_power_exit(struct acpi_processor *pr, struct acpi_device *device) { + if (boot_option_idle_override) + return 0; + #ifdef CONFIG_CPU_IDLE - if ((pr->flags.power) && (!boot_option_idle_override)) - cpuidle_unregister_device(&pr->power.dev); + cpuidle_unregister_device(&pr->power.dev); #endif pr->flags.power_setup_done = 0; --- linux-2.6.24.orig/drivers/acpi/Kconfig +++ linux-2.6.24/drivers/acpi/Kconfig @@ -274,6 +274,23 @@ Enter the full path name to the file which includes the AmlCode declaration. +config ACPI_CUSTOM_DSDT_INITRD + bool "Read Custom DSDT from initramfs" + depends on BLK_DEV_INITRD + default y + help + The DSDT (Differentiated System Description Table) often needs to be + overridden because of broken BIOS implementations. If this feature is + activated you will be able to provide a customized DSDT by adding it + to your initramfs. For now you need to use a special mkinitrd tool. + For more details see or + . If there is no table found, it + will fallback to the custom DSDT in-kernel (if activated) or to the + DSDT from the BIOS. + + Even if you do not need a new one at the moment, you may want to use a + better implemented DSDT later. It is safe to say Y here. + config ACPI_BLACKLIST_YEAR int "Disable ACPI for systems before Jan 1st this year" if X86_32 default 0 --- linux-2.6.24.orig/drivers/acpi/processor_core.c +++ linux-2.6.24/drivers/acpi/processor_core.c @@ -622,7 +622,7 @@ int result = 0; acpi_status status = AE_OK; struct acpi_processor *pr; - + struct sys_device *sysdev; pr = acpi_driver_data(device); @@ -653,6 +653,11 @@ if (result) goto end; + sysdev = get_cpu_sysdev(pr->id); + if (sysdev && + sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) + return -EFAULT; + status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, acpi_processor_notify, pr); @@ -789,10 +794,13 @@ status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, acpi_processor_notify); + if (get_cpu_sysdev(pr->id)) + sysfs_remove_link(&device->dev.kobj, "sysdev"); + acpi_processor_remove_fs(device); processors[pr->id] = NULL; - + processor_device_array[pr->id] = NULL; kfree(pr); return 0; @@ -978,9 +986,9 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr) { - if (cpu_online(pr->id)) { - return (-EINVAL); - } + if (cpu_online(pr->id)) + cpu_down(pr->id); + arch_unregister_cpu(pr->id); acpi_unmap_lsapic(pr->id); return (0); --- linux-2.6.24.orig/drivers/acpi/Makefile +++ linux-2.6.24/drivers/acpi/Makefile @@ -21,7 +21,7 @@ # # ACPI Core Subsystem (Interpreter) # -obj-y += osl.o utils.o \ +obj-y += osl.o utils.o reboot.o\ dispatcher/ events/ executer/ hardware/ \ namespace/ parser/ resources/ tables/ \ utilities/ --- linux-2.6.24.orig/drivers/acpi/ec.c +++ linux-2.6.24/drivers/acpi/ec.c @@ -573,7 +573,7 @@ void *handler_context, void *region_context) { struct acpi_ec *ec = handler_context; - int result = 0, i = 0; + int result = 0, i; u8 temp = 0; if ((address > 0xFF) || !value || !handler_context) @@ -585,7 +585,18 @@ if (bits != 8 && acpi_strict) return AE_BAD_PARAMETER; - while (bits - i > 0) { + acpi_ec_burst_enable(ec); + + if (function == ACPI_READ) { + result = acpi_ec_read(ec, address, &temp); + *value = temp; + } else { + temp = 0xff & (*value); + result = acpi_ec_write(ec, address, temp); + } + + for (i = 8; unlikely(bits - i > 0); i += 8) { + ++address; if (function == ACPI_READ) { result = acpi_ec_read(ec, address, &temp); (*value) |= ((acpi_integer)temp) << i; @@ -593,10 +604,10 @@ temp = 0xff & ((*value) >> i); result = acpi_ec_write(ec, address, temp); } - i += 8; - ++address; } + acpi_ec_burst_disable(ec); + switch (result) { case -EINVAL: return AE_BAD_PARAMETER; --- linux-2.6.24.orig/drivers/acpi/scan.c +++ linux-2.6.24/drivers/acpi/scan.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include /* for acpi_ex_eisa_id_to_string() */ @@ -86,17 +87,37 @@ } static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL); -static int acpi_eject_operation(acpi_handle handle, int lockable) +static int acpi_bus_hot_remove_device(void *context) { + struct acpi_device *device; + acpi_handle handle = context; struct acpi_object_list arg_list; union acpi_object arg; acpi_status status = AE_OK; - /* - * TBD: evaluate _PS3? - */ + if (acpi_bus_get_device(handle, &device)) + return 0; + + if (!device) + return 0; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Hot-removing device %s...\n", device->dev.bus_id)); - if (lockable) { + + if (acpi_bus_trim(device, 1)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Removing device failed\n")); + return -1; + } + + /* power off device */ + status = acpi_evaluate_object(handle, "_PS3", NULL, NULL); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Power-off device failed\n")); + + if (device->flags.lockable) { arg_list.count = 1; arg_list.pointer = &arg; arg.type = ACPI_TYPE_INTEGER; @@ -112,24 +133,19 @@ /* * TBD: _EJD support. */ - status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL); - if (ACPI_FAILURE(status)) { - return (-ENODEV); - } + if (ACPI_FAILURE(status)) + return -ENODEV; - return (0); + return 0; } static ssize_t acpi_eject_store(struct device *d, struct device_attribute *attr, const char *buf, size_t count) { - int result; int ret = count; - int islockable; acpi_status status; - acpi_handle handle; acpi_object_type type = 0; struct acpi_device *acpi_device = to_acpi_device(d); @@ -148,17 +164,9 @@ goto err; } - islockable = acpi_device->flags.lockable; - handle = acpi_device->handle; - - result = acpi_bus_trim(acpi_device, 1); - - if (!result) - result = acpi_eject_operation(handle, islockable); - - if (result) { - ret = -EBUSY; - } + /* remove the device in another thread to fix the deadlock issue */ + ret = kernel_thread(acpi_bus_hot_remove_device, + acpi_device->handle, SIGCHLD); err: return ret; } @@ -1156,6 +1164,16 @@ acpi_device_set_id(device, parent, handle, type); /* + * The ACPI device is attached to acpi handle before getting + * the power/wakeup/peformance flags. Otherwise OS can't get + * the corresponding ACPI device by the acpi handle in the course + * of getting the power/wakeup/performance flags. + */ + result = acpi_device_set_context(device, type); + if (result) + goto end; + + /* * Power Management * ---------------- */ @@ -1185,8 +1203,6 @@ goto end; } - if ((result = acpi_device_set_context(device, type))) - goto end; result = acpi_device_register(device, parent); --- linux-2.6.24.orig/drivers/acpi/power.c +++ linux-2.6.24/drivers/acpi/power.c @@ -54,6 +54,14 @@ #define ACPI_POWER_RESOURCE_STATE_OFF 0x00 #define ACPI_POWER_RESOURCE_STATE_ON 0x01 #define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF + +#ifdef MODULE_PARAM_PREFIX +#undef MODULE_PARAM_PREFIX +#endif +#define MODULE_PARAM_PREFIX "acpi." +int acpi_power_nocheck; +module_param_named(power_nocheck, acpi_power_nocheck, bool, 000); + static int acpi_power_add(struct acpi_device *device); static int acpi_power_remove(struct acpi_device *device, int type); static int acpi_power_resume(struct acpi_device *device); @@ -225,11 +233,17 @@ if (ACPI_FAILURE(status)) return -ENODEV; - result = acpi_power_get_state(resource, &state); - if (result) - return result; - if (state != ACPI_POWER_RESOURCE_STATE_ON) - return -ENOEXEC; + if (!acpi_power_nocheck) { + /* + * If acpi_power_nocheck is set, it is unnecessary to check + * the power state after power transition. + */ + result = acpi_power_get_state(resource, &state); + if (result) + return result; + if (state != ACPI_POWER_RESOURCE_STATE_ON) + return -ENOEXEC; + } /* Update the power resource's _device_ power state */ resource->device->power.state = ACPI_STATE_D0; @@ -276,11 +290,17 @@ if (ACPI_FAILURE(status)) return -ENODEV; - result = acpi_power_get_state(resource, &state); - if (result) - return result; - if (state != ACPI_POWER_RESOURCE_STATE_OFF) - return -ENOEXEC; + if (!acpi_power_nocheck) { + /* + * If acpi_power_nocheck is set, it is unnecessary to check + * the power state after power transition. + */ + result = acpi_power_get_state(resource, &state); + if (result) + return result; + if (state != ACPI_POWER_RESOURCE_STATE_OFF) + return -ENOEXEC; + } /* Update the power resource's _device_ power state */ resource->device->power.state = ACPI_STATE_D3; --- linux-2.6.24.orig/drivers/acpi/video.c +++ linux-2.6.24/drivers/acpi/video.c @@ -72,6 +72,10 @@ MODULE_DESCRIPTION("ACPI Video Driver"); MODULE_LICENSE("GPL"); +static int no_automatic_changes = 1; + +module_param(no_automatic_changes, uint, 0600); + static int acpi_video_bus_add(struct acpi_device *device); static int acpi_video_bus_remove(struct acpi_device *device, int type); @@ -292,18 +296,26 @@ static int acpi_video_get_brightness(struct backlight_device *bd) { unsigned long cur_level; + int i; struct acpi_video_device *vd = (struct acpi_video_device *)bl_get_data(bd); acpi_video_device_lcd_get_level_current(vd, &cur_level); - return (int) cur_level; + for (i = 2; i < vd->brightness->count; i++) { + if (vd->brightness->levels[i] == cur_level) + /* The first two entries are special - see page 575 + of the ACPI spec 3.0 */ + return i-2; + } + return 0; } static int acpi_video_set_brightness(struct backlight_device *bd) { - int request_level = bd->props.brightness; + int request_level = bd->props.brightness+2; struct acpi_video_device *vd = (struct acpi_video_device *)bl_get_data(bd); - acpi_video_device_lcd_set_level(vd, request_level); + acpi_video_device_lcd_set_level(vd, + vd->brightness->levels[request_level]); return 0; } @@ -652,7 +664,6 @@ kfree(obj); if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){ - unsigned long tmp; static int count = 0; char *name; name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); @@ -660,11 +671,10 @@ return; sprintf(name, "acpi_video%d", count++); - acpi_video_device_lcd_get_level_current(device, &tmp); device->backlight = backlight_device_register(name, NULL, device, &acpi_backlight_ops); - device->backlight->props.max_brightness = max_level; - device->backlight->props.brightness = (int)tmp; + device->backlight->props.max_brightness = device->brightness->count-3; + device->backlight->props.brightness = acpi_video_get_brightness(device->backlight); backlight_update_status(device->backlight); kfree(name); @@ -1850,27 +1860,32 @@ switch (event) { case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */ - acpi_video_switch_brightness(video_device, event); + if (!no_automatic_changes) + acpi_video_switch_brightness(video_device, event); acpi_bus_generate_proc_event(device, event, 0); keycode = KEY_BRIGHTNESS_CYCLE; break; case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */ - acpi_video_switch_brightness(video_device, event); + if (!no_automatic_changes) + acpi_video_switch_brightness(video_device, event); acpi_bus_generate_proc_event(device, event, 0); keycode = KEY_BRIGHTNESSUP; break; case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS: /* Decrease brightness */ - acpi_video_switch_brightness(video_device, event); + if (!no_automatic_changes) + acpi_video_switch_brightness(video_device, event); acpi_bus_generate_proc_event(device, event, 0); keycode = KEY_BRIGHTNESSDOWN; break; case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightnesss */ - acpi_video_switch_brightness(video_device, event); + if (!no_automatic_changes) + acpi_video_switch_brightness(video_device, event); acpi_bus_generate_proc_event(device, event, 0); keycode = KEY_BRIGHTNESS_ZERO; break; case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */ - acpi_video_switch_brightness(video_device, event); + if (!no_automatic_changes) + acpi_video_switch_brightness(video_device, event); acpi_bus_generate_proc_event(device, event, 0); keycode = KEY_DISPLAY_OFF; break; --- linux-2.6.24.orig/drivers/acpi/bus.c +++ linux-2.6.24/drivers/acpi/bus.c @@ -49,6 +49,23 @@ #define STRUCT_TO_INT(s) (*((int*)&s)) +static int set_power_nocheck(const struct dmi_system_id *id) +{ + printk(KERN_NOTICE PREFIX "%s detected - " + "disable power check in power transistion\n", id->ident); + acpi_power_nocheck = 1; + return 0; +} +static struct dmi_system_id __cpuinitdata power_nocheck_dmi_table[] = { + { + set_power_nocheck, "HP Pavilion 05", { + DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), + DMI_MATCH(DMI_SYS_VENDOR, "HP Pavilion 05"), + DMI_MATCH(DMI_PRODUCT_VERSION, "2001211RE101GLEND") }, NULL}, + {}, +}; + + /* -------------------------------------------------------------------------- Device Management -------------------------------------------------------------------------- */ @@ -199,7 +216,19 @@ /* * Get device's current power state */ - acpi_bus_get_power(device->handle, &device->power.state); + if (!acpi_power_nocheck) { + /* + * Maybe the incorrect power state is returned on the bogus + * bios, which is different with the real power state. + * For example: the bios returns D0 state and the real power + * state is D3. OS expects to set the device to D0 state. In + * such case if OS uses the power state returned by the BIOS, + * the device can't be transisted to the correct power state. + * So if the acpi_power_nocheck is set, it is unnecessary to + * get the power state by calling acpi_bus_get_power. + */ + acpi_bus_get_power(device->handle, &device->power.state); + } if ((state == device->power.state) && !device->flags.force_power_state) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", state)); @@ -350,10 +379,11 @@ } spin_lock_irqsave(&acpi_bus_event_lock, flags); - entry = - list_entry(acpi_bus_event_list.next, struct acpi_bus_event, node); - if (entry) + if (!list_empty(&acpi_bus_event_list)) { + entry = list_entry(acpi_bus_event_list.next, + struct acpi_bus_event, node); list_del(&entry->node); + } spin_unlock_irqrestore(&acpi_bus_event_lock, flags); if (!entry) @@ -773,7 +803,11 @@ } } else disable_acpi(); - + /* + * If the laptop falls into the DMI check table, the power state check + * will be disabled in the course of device power transistion. + */ + dmi_check_system(power_nocheck_dmi_table); return result; } --- linux-2.6.24.orig/drivers/acpi/utilities/utobject.c +++ linux-2.6.24/drivers/acpi/utilities/utobject.c @@ -432,7 +432,7 @@ * element -- which is legal) */ if (!internal_object) { - *obj_length = 0; + *obj_length = sizeof(union acpi_object); return_ACPI_STATUS(AE_OK); } --- linux-2.6.24.orig/drivers/acpi/hardware/hwsleep.c +++ linux-2.6.24/drivers/acpi/hardware/hwsleep.c @@ -587,6 +587,13 @@ } /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ + /* + * Some BIOSes assume that WAK_STS will be cleared on resume and use + * it to determine whether the system is rebooting or resuming. Clear + * it for compatibility. + */ + acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1); + acpi_gbl_system_awake_and_running = TRUE; /* Enable power button */ --- linux-2.6.24.orig/drivers/acpi/executer/exconfig.c +++ linux-2.6.24/drivers/acpi/executer/exconfig.c @@ -268,6 +268,8 @@ struct acpi_table_desc table_desc; acpi_native_uint table_index; acpi_status status; + u32 length; + void *maddr; ACPI_FUNCTION_TRACE(ex_load_op); @@ -299,9 +301,24 @@ } } + length = obj_desc->region.length; + table_desc.pointer = ACPI_ALLOCATE(length); + if (!table_desc.pointer) { + return_ACPI_STATUS(AE_NO_MEMORY); + } + + maddr = acpi_os_map_memory(obj_desc->region.address, length); + if (!maddr) { + ACPI_FREE(table_desc.pointer); + return_ACPI_STATUS(AE_NO_MEMORY); + } + ACPI_MEMCPY(table_desc.pointer, maddr, length); + acpi_os_unmap_memory(maddr, length); + + /* Keep the address for the pretty table info print */ table_desc.address = obj_desc->region.address; table_desc.length = obj_desc->region.length; - table_desc.flags = ACPI_TABLE_ORIGIN_MAPPED; + table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED; break; case ACPI_TYPE_BUFFER: /* Buffer or resolved region_field */ --- linux-2.6.24.orig/drivers/acpi/resources/rsdump.c +++ linux-2.6.24/drivers/acpi/resources/rsdump.c @@ -87,8 +87,10 @@ * ******************************************************************************/ -struct acpi_rsdump_info acpi_rs_dump_irq[6] = { +struct acpi_rsdump_info acpi_rs_dump_irq[7] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_irq), "IRQ", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.descriptor_length), + "Descriptor Length", NULL}, {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.triggering), "Triggering", acpi_gbl_he_decode}, {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity", @@ -115,9 +117,11 @@ NULL} }; -struct acpi_rsdump_info acpi_rs_dump_start_dpf[3] = { +struct acpi_rsdump_info acpi_rs_dump_start_dpf[4] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_start_dpf), "Start-Dependent-Functions", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(start_dpf.descriptor_length), + "Descriptor Length", NULL}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.compatibility_priority), "Compatibility Priority", acpi_gbl_config_decode}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.performance_robustness), --- linux-2.6.24.orig/drivers/acpi/resources/rsirq.c +++ linux-2.6.24/drivers/acpi/resources/rsirq.c @@ -52,7 +52,7 @@ * acpi_rs_get_irq * ******************************************************************************/ -struct acpi_rsconvert_info acpi_rs_get_irq[7] = { +struct acpi_rsconvert_info acpi_rs_get_irq[8] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ, ACPI_RS_SIZE(struct acpi_resource_irq), ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)}, @@ -69,6 +69,12 @@ ACPI_EDGE_SENSITIVE, 1}, + /* Get the descriptor length (2 or 3 for IRQ descriptor) */ + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.descriptor_length), + AML_OFFSET(irq.descriptor_type), + 0}, + /* All done if no flag byte present in descriptor */ {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3}, @@ -94,7 +100,9 @@ * ******************************************************************************/ -struct acpi_rsconvert_info acpi_rs_set_irq[9] = { +struct acpi_rsconvert_info acpi_rs_set_irq[13] = { + /* Start with a default descriptor of length 3 */ + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ, sizeof(struct aml_resource_irq), ACPI_RSC_TABLE_SIZE(acpi_rs_set_irq)}, @@ -105,7 +113,7 @@ AML_OFFSET(irq.irq_mask), ACPI_RS_OFFSET(data.irq.interrupt_count)}, - /* Set the flags byte by default */ + /* Set the flags byte */ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering), AML_OFFSET(irq.flags), @@ -118,6 +126,33 @@ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable), AML_OFFSET(irq.flags), 4}, + + /* + * All done if the output descriptor length is required to be 3 + * (i.e., optimization to 2 bytes cannot be attempted) + */ + {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, + ACPI_RS_OFFSET(data.irq.descriptor_length), + 3}, + + /* Set length to 2 bytes (no flags byte) */ + + {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)}, + + /* + * All done if the output descriptor length is required to be 2. + * + * TBD: Perhaps we should check for error if input flags are not + * compatible with a 2-byte descriptor. + */ + {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, + ACPI_RS_OFFSET(data.irq.descriptor_length), + 2}, + + /* Reset length to 3 bytes (descriptor with flags byte) */ + + {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)}, + /* * Check if the flags byte is necessary. Not needed if the flags are: * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE @@ -134,7 +169,7 @@ ACPI_RS_OFFSET(data.irq.sharable), ACPI_EXCLUSIVE}, - /* irq_no_flags() descriptor can be used */ + /* We can optimize to a 2-byte irq_no_flags() descriptor */ {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)} }; --- linux-2.6.24.orig/drivers/acpi/resources/rsmisc.c +++ linux-2.6.24/drivers/acpi/resources/rsmisc.c @@ -497,6 +497,17 @@ } break; + case ACPI_RSC_EXIT_EQ: + /* + * Control - Exit conversion if equal + */ + if (*ACPI_ADD_PTR(u8, resource, + COMPARE_TARGET(info)) == + COMPARE_VALUE(info)) { + goto exit; + } + break; + default: ACPI_ERROR((AE_INFO, "Invalid conversion opcode")); --- linux-2.6.24.orig/drivers/acpi/resources/rscalc.c +++ linux-2.6.24/drivers/acpi/resources/rscalc.c @@ -211,6 +211,13 @@ * variable-length fields */ switch (resource->type) { + case ACPI_RESOURCE_TYPE_IRQ: + + if (resource->data.irq.descriptor_length == 2) { + total_size--; + } + break; + case ACPI_RESOURCE_TYPE_VENDOR: /* * Vendor Defined Resource: --- linux-2.6.24.orig/drivers/acpi/resources/rsio.c +++ linux-2.6.24/drivers/acpi/resources/rsio.c @@ -185,7 +185,7 @@ * ******************************************************************************/ -struct acpi_rsconvert_info acpi_rs_get_start_dpf[5] = { +struct acpi_rsconvert_info acpi_rs_get_start_dpf[6] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_START_DEPENDENT, ACPI_RS_SIZE(struct acpi_resource_start_dependent), ACPI_RSC_TABLE_SIZE(acpi_rs_get_start_dpf)}, @@ -196,6 +196,12 @@ ACPI_ACCEPTABLE_CONFIGURATION, 2}, + /* Get the descriptor length (0 or 1 for Start Dpf descriptor) */ + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.start_dpf.descriptor_length), + AML_OFFSET(start_dpf.descriptor_type), + 0}, + /* All done if there is no flag byte present in the descriptor */ {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 1}, @@ -219,7 +225,9 @@ * ******************************************************************************/ -struct acpi_rsconvert_info acpi_rs_set_start_dpf[6] = { +struct acpi_rsconvert_info acpi_rs_set_start_dpf[10] = { + /* Start with a default descriptor of length 1 */ + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_START_DEPENDENT, sizeof(struct aml_resource_start_dependent), ACPI_RSC_TABLE_SIZE(acpi_rs_set_start_dpf)}, @@ -236,6 +244,33 @@ AML_OFFSET(start_dpf.flags), 2}, /* + * All done if the output descriptor length is required to be 1 + * (i.e., optimization to 0 bytes cannot be attempted) + */ + {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, + ACPI_RS_OFFSET(data.start_dpf.descriptor_length), + 1}, + + /* Set length to 0 bytes (no flags byte) */ + + {ACPI_RSC_LENGTH, 0, 0, + sizeof(struct aml_resource_start_dependent_noprio)}, + + /* + * All done if the output descriptor length is required to be 0. + * + * TBD: Perhaps we should check for error if input flags are not + * compatible with a 0-byte descriptor. + */ + {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, + ACPI_RS_OFFSET(data.start_dpf.descriptor_length), + 0}, + + /* Reset length to 1 byte (descriptor with flags byte) */ + + {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)}, + + /* * All done if flags byte is necessary -- if either priority value * is not ACPI_ACCEPTABLE_CONFIGURATION */ --- linux-2.6.24.orig/drivers/uio/uio.c +++ linux-2.6.24/drivers/uio/uio.c @@ -447,6 +447,8 @@ vma->vm_flags |= VM_IO | VM_RESERVED; + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + return remap_pfn_range(vma, vma->vm_start, idev->info->mem[mi].addr >> PAGE_SHIFT, --- linux-2.6.24.orig/drivers/message/fusion/mptbase.c +++ linux-2.6.24/drivers/message/fusion/mptbase.c @@ -2844,6 +2844,16 @@ pfacts->IOCStatus = le16_to_cpu(pfacts->IOCStatus); pfacts->IOCLogInfo = le32_to_cpu(pfacts->IOCLogInfo); pfacts->MaxDevices = le16_to_cpu(pfacts->MaxDevices); + /* + * VMware emulation is broken, its PortFact's MaxDevices reports value + * programmed by IOC Init, so if you program IOC Init to 256 (which is 0, + * as that field is only 8 bit), it reports back 0 in port facts, instead + * of 256... And unfortunately using 256 triggers another bug in the + * code (parallel SCSI can have only 16 devices). + */ + if (pfacts->MaxDevices == 0) { + pfacts->MaxDevices = 16; + } pfacts->PortSCSIID = le16_to_cpu(pfacts->PortSCSIID); pfacts->ProtocolFlags = le16_to_cpu(pfacts->ProtocolFlags); pfacts->MaxPostedCmdBuffers = le16_to_cpu(pfacts->MaxPostedCmdBuffers); --- linux-2.6.24.orig/drivers/message/fusion/mptsas.c +++ linux-2.6.24/drivers/message/fusion/mptsas.c @@ -1699,6 +1699,11 @@ if (error) goto out_free_consistent; + if (!buffer->NumPhys) { + error = -ENODEV; + goto out_free_consistent; + } + /* save config data */ port_info->num_phys = buffer->NumPhys; port_info->phy_info = kcalloc(port_info->num_phys, --- linux-2.6.24.orig/drivers/s390/char/defkeymap.c +++ linux-2.6.24/drivers/s390/char/defkeymap.c @@ -151,8 +151,8 @@ }; struct kbdiacruc accent_table[MAX_DIACR] = { - {'^', 'c', '\003'}, {'^', 'd', '\004'}, - {'^', 'z', '\032'}, {'^', '\012', '\000'}, + {'^', 'c', 0003}, {'^', 'd', 0004}, + {'^', 'z', 0032}, {'^', 0012, 0000}, }; unsigned int accent_table_size = 4; --- linux-2.6.24.orig/drivers/hwmon/w83781d.c +++ linux-2.6.24/drivers/hwmon/w83781d.c @@ -1380,7 +1380,8 @@ /* Reserve the ISA region */ res = platform_get_resource(pdev, IORESOURCE_IO, 0); - if (!request_region(res->start, W83781D_EXTENT, "w83781d")) { + if (!request_region(res->start + W83781D_ADDR_REG_OFFSET, 2, + "w83781d")) { err = -EBUSY; goto exit; } @@ -1432,7 +1433,7 @@ device_remove_file(&pdev->dev, &dev_attr_name); kfree(data); exit_release_region: - release_region(res->start, W83781D_EXTENT); + release_region(res->start + W83781D_ADDR_REG_OFFSET, 2); exit: return err; } @@ -1446,7 +1447,7 @@ sysfs_remove_group(&pdev->dev.kobj, &w83781d_group); sysfs_remove_group(&pdev->dev.kobj, &w83781d_group_opt); device_remove_file(&pdev->dev, &dev_attr_name); - release_region(data->client.addr, W83781D_EXTENT); + release_region(data->client.addr + W83781D_ADDR_REG_OFFSET, 2); kfree(data); return 0; @@ -1820,8 +1821,17 @@ { int val, save, found = 0; - if (!request_region(address, W83781D_EXTENT, "w83781d")) + /* We have to request the region in two parts because some + boards declare base+4 to base+7 as a PNP device */ + if (!request_region(address, 4, "w83781d")) { + pr_debug("w83781d: Failed to request low part of region\n"); return 0; + } + if (!request_region(address + 4, 4, "w83781d")) { + pr_debug("w83781d: Failed to request high part of region\n"); + release_region(address, 4); + return 0; + } #define REALLY_SLOW_IO /* We need the timeouts for at least some W83781D-like @@ -1896,7 +1906,8 @@ val == 0x30 ? "W83782D" : "W83781D", (int)address); release: - release_region(address, W83781D_EXTENT); + release_region(address + 4, 4); + release_region(address, 4); return found; } --- linux-2.6.24.orig/drivers/hwmon/hdaps.c +++ linux-2.6.24/drivers/hwmon/hdaps.c @@ -521,10 +521,16 @@ HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T42"), HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T43"), HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T60"), + HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T61"), HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X40"), HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X41"), HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60"), + HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X61"), + HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X61 Tablet"), HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad Z60m"), + HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T61P"), + HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R61"), + HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T61"), { .ident = NULL } }; --- linux-2.6.24.orig/drivers/hwmon/coretemp.c +++ linux-2.6.24/drivers/hwmon/coretemp.c @@ -368,10 +368,10 @@ for_each_online_cpu(i) { struct cpuinfo_x86 *c = &cpu_data(i); - /* check if family 6, models e, f, 16 */ + /* check if family 6, models 0xe, 0xf, 0x16, 0x17 */ if ((c->cpuid_level < 0) || (c->x86 != 0x6) || !((c->x86_model == 0xe) || (c->x86_model == 0xf) || - (c->x86_model == 0x16))) { + (c->x86_model == 0x16) || (c->x86_model == 0x17))) { /* supported CPU not found, but report the unknown family 6 CPU */ --- linux-2.6.24.orig/drivers/hid/hid-input.c +++ linux-2.6.24/drivers/hid/hid-input.c @@ -34,10 +34,10 @@ #include #include -static int hid_pb_fnmode = 1; -module_param_named(pb_fnmode, hid_pb_fnmode, int, 0644); +static int hid_apple_fnmode = 1; +module_param_named(pb_fnmode, hid_apple_fnmode, int, 0644); MODULE_PARM_DESC(pb_fnmode, - "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)"); + "Mode of fn key on Apple keyboards (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)"); #define unk KEY_UNKNOWN @@ -98,20 +98,41 @@ u8 flags; }; -#define POWERBOOK_FLAG_FKEY 0x01 +#define APPLE_FLAG_FKEY 0x01 + +static struct hidinput_key_translation apple_fn_keys[] = { + { KEY_BACKSPACE, KEY_DELETE }, + { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, + { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, + { KEY_F3, KEY_CYCLEWINDOWS, APPLE_FLAG_FKEY }, /* Exposé */ + { KEY_F4, KEY_FN_F4, APPLE_FLAG_FKEY }, /* Dashboard */ + { KEY_F5, KEY_FN_F5 }, + { KEY_F6, KEY_FN_F6 }, + { KEY_F7, KEY_BACK, APPLE_FLAG_FKEY }, + { KEY_F8, KEY_PLAYPAUSE, APPLE_FLAG_FKEY }, + { KEY_F9, KEY_FORWARD, APPLE_FLAG_FKEY }, + { KEY_F10, KEY_MUTE, APPLE_FLAG_FKEY }, + { KEY_F11, KEY_VOLUMEDOWN, APPLE_FLAG_FKEY }, + { KEY_F12, KEY_VOLUMEUP, APPLE_FLAG_FKEY }, + { KEY_UP, KEY_PAGEUP }, + { KEY_DOWN, KEY_PAGEDOWN }, + { KEY_LEFT, KEY_HOME }, + { KEY_RIGHT, KEY_END }, + { } +}; static struct hidinput_key_translation powerbook_fn_keys[] = { { KEY_BACKSPACE, KEY_DELETE }, - { KEY_F1, KEY_BRIGHTNESSDOWN, POWERBOOK_FLAG_FKEY }, - { KEY_F2, KEY_BRIGHTNESSUP, POWERBOOK_FLAG_FKEY }, - { KEY_F3, KEY_MUTE, POWERBOOK_FLAG_FKEY }, - { KEY_F4, KEY_VOLUMEDOWN, POWERBOOK_FLAG_FKEY }, - { KEY_F5, KEY_VOLUMEUP, POWERBOOK_FLAG_FKEY }, - { KEY_F6, KEY_NUMLOCK, POWERBOOK_FLAG_FKEY }, - { KEY_F7, KEY_SWITCHVIDEOMODE, POWERBOOK_FLAG_FKEY }, - { KEY_F8, KEY_KBDILLUMTOGGLE, POWERBOOK_FLAG_FKEY }, - { KEY_F9, KEY_KBDILLUMDOWN, POWERBOOK_FLAG_FKEY }, - { KEY_F10, KEY_KBDILLUMUP, POWERBOOK_FLAG_FKEY }, + { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, + { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, + { KEY_F3, KEY_MUTE, APPLE_FLAG_FKEY }, + { KEY_F4, KEY_VOLUMEDOWN, APPLE_FLAG_FKEY }, + { KEY_F5, KEY_VOLUMEUP, APPLE_FLAG_FKEY }, + { KEY_F6, KEY_NUMLOCK, APPLE_FLAG_FKEY }, + { KEY_F7, KEY_SWITCHVIDEOMODE, APPLE_FLAG_FKEY }, + { KEY_F8, KEY_KBDILLUMTOGGLE, APPLE_FLAG_FKEY }, + { KEY_F9, KEY_KBDILLUMDOWN, APPLE_FLAG_FKEY }, + { KEY_F10, KEY_KBDILLUMUP, APPLE_FLAG_FKEY }, { KEY_UP, KEY_PAGEUP }, { KEY_DOWN, KEY_PAGEDOWN }, { KEY_LEFT, KEY_HOME }, @@ -142,7 +163,7 @@ { } }; -static struct hidinput_key_translation powerbook_iso_keyboard[] = { +static struct hidinput_key_translation apple_iso_keyboard[] = { { KEY_GRAVE, KEY_102ND }, { KEY_102ND, KEY_GRAVE }, { } @@ -160,39 +181,42 @@ return NULL; } -static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, +static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, struct hid_usage *usage, __s32 value) { struct hidinput_key_translation *trans; if (usage->code == KEY_FN) { - if (value) hid->quirks |= HID_QUIRK_POWERBOOK_FN_ON; - else hid->quirks &= ~HID_QUIRK_POWERBOOK_FN_ON; + if (value) hid->quirks |= HID_QUIRK_APPLE_FN_ON; + else hid->quirks &= ~HID_QUIRK_APPLE_FN_ON; input_event(input, usage->type, usage->code, value); return 1; } - if (hid_pb_fnmode) { + if (hid_apple_fnmode) { int do_translate; - trans = find_translation(powerbook_fn_keys, usage->code); + trans = find_translation((hid->product < 0x220 || + hid->product >= 0x300) ? + powerbook_fn_keys : apple_fn_keys, + usage->code); if (trans) { - if (test_bit(usage->code, hid->pb_pressed_fn)) + if (test_bit(usage->code, hid->apple_pressed_fn)) do_translate = 1; - else if (trans->flags & POWERBOOK_FLAG_FKEY) + else if (trans->flags & APPLE_FLAG_FKEY) do_translate = - (hid_pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) || - (hid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)); + (hid_apple_fnmode == 2 && (hid->quirks & HID_QUIRK_APPLE_FN_ON)) || + (hid_apple_fnmode == 1 && !(hid->quirks & HID_QUIRK_APPLE_FN_ON)); else - do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON); + do_translate = (hid->quirks & HID_QUIRK_APPLE_FN_ON); if (do_translate) { if (value) - set_bit(usage->code, hid->pb_pressed_fn); + set_bit(usage->code, hid->apple_pressed_fn); else - clear_bit(usage->code, hid->pb_pressed_fn); + clear_bit(usage->code, hid->apple_pressed_fn); input_event(input, usage->type, trans->to, value); @@ -200,8 +224,9 @@ } } - if (test_bit(usage->code, hid->pb_pressed_numlock) || - test_bit(LED_NUML, input->led)) { + if (hid->quirks & HID_QUIRK_APPLE_NUMLOCK_EMULATION && ( + test_bit(usage->code, hid->pb_pressed_numlock) || + test_bit(LED_NUML, input->led))) { trans = find_translation(powerbook_numlock_keys, usage->code); if (trans) { @@ -217,8 +242,8 @@ } } - if (hid->quirks & HID_QUIRK_POWERBOOK_ISO_KEYBOARD) { - trans = find_translation(powerbook_iso_keyboard, usage->code); + if (hid->quirks & HID_QUIRK_APPLE_ISO_KEYBOARD) { + trans = find_translation(apple_iso_keyboard, usage->code); if (trans) { input_event(input, usage->type, trans->to, value); return 1; @@ -228,31 +253,35 @@ return 0; } -static void hidinput_pb_setup(struct input_dev *input) +static void hidinput_apple_setup(struct input_dev *input) { struct hidinput_key_translation *trans; set_bit(KEY_NUMLOCK, input->keybit); /* Enable all needed keys */ + for (trans = apple_fn_keys; trans->from; trans++) + set_bit(trans->to, input->keybit); + for (trans = powerbook_fn_keys; trans->from; trans++) set_bit(trans->to, input->keybit); for (trans = powerbook_numlock_keys; trans->from; trans++) set_bit(trans->to, input->keybit); - for (trans = powerbook_iso_keyboard; trans->from; trans++) + for (trans = apple_iso_keyboard; trans->from; trans++) set_bit(trans->to, input->keybit); } #else -static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, - struct hid_usage *usage, __s32 value) +static inline int hidinput_apple_event(struct hid_device *hid, + struct input_dev *input, + struct hid_usage *usage, __s32 value) { return 0; } -static inline void hidinput_pb_setup(struct input_dev *input) +static inline void hidinput_apple_setup(struct input_dev *input) { } #endif @@ -785,14 +814,14 @@ } break; - case HID_UP_CUSTOM: /* Reported on Logitech and Powerbook USB keyboards */ + case HID_UP_CUSTOM: /* Reported on Logitech and Apple USB keyboards */ set_bit(EV_REP, input->evbit); switch(usage->hid & HID_USAGE) { case 0x003: - /* The fn key on Apple PowerBooks */ + /* The fn key on Apple USB keyboards */ map_key_clear(KEY_FN); - hidinput_pb_setup(input); + hidinput_apple_setup(input); break; default: goto ignore; @@ -867,9 +896,10 @@ map_key(BTN_1); } - if ((device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_7 | HID_QUIRK_2WHEEL_MOUSE_HACK_5)) && - (usage->type == EV_REL) && (usage->code == REL_WHEEL)) - set_bit(REL_HWHEEL, bit); + if ((device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_7 | HID_QUIRK_2WHEEL_MOUSE_HACK_5 | + HID_QUIRK_2WHEEL_MOUSE_HACK_B8)) && (usage->type == EV_REL) && + (usage->code == REL_WHEEL)) + set_bit(REL_HWHEEL, bit); if (((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_5) && (usage->hid == 0x00090005)) || ((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) @@ -967,6 +997,19 @@ return; } + if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) && + (usage->type == EV_REL) && + (usage->code == REL_WHEEL)) { + hid->delayed_value = value; + return; + } + + if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) && + (usage->hid == 0x000100b8)) { + input_event(input, EV_REL, value ? REL_HWHEEL : REL_WHEEL, hid->delayed_value); + return; + } + if ((hid->quirks & HID_QUIRK_INVERT_HWHEEL) && (usage->code == REL_HWHEEL)) { input_event(input, usage->type, usage->code, -value); return; @@ -977,7 +1020,7 @@ return; } - if ((hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) && hidinput_pb_event(hid, input, usage, value)) + if ((hid->quirks & HID_QUIRK_APPLE_HAS_FN) && hidinput_apple_event(hid, input, usage, value)) return; if (usage->hat_min < usage->hat_max || usage->hat_dir) { --- linux-2.6.24.orig/drivers/hid/usbhid/Kconfig +++ linux-2.6.24/drivers/hid/usbhid/Kconfig @@ -25,12 +25,13 @@ depends on USB_HID && INPUT=n config USB_HIDINPUT_POWERBOOK - bool "Enable support for iBook/PowerBook/MacBook/MacBookPro special keys" + bool "Enable support for Apple laptop/aluminum USB special keys" default n depends on USB_HID help Say Y here if you want support for the special keys (Fn, Numlock) on - Apple iBooks, PowerBooks, MacBooks and MacBook Pros. + Apple iBooks, PowerBooks, MacBooks, MacBook Pros and aluminum USB + keyboards. If unsure, say N. --- linux-2.6.24.orig/drivers/hid/usbhid/hid-quirks.c +++ linux-2.6.24/drivers/hid/usbhid/hid-quirks.c @@ -19,6 +19,7 @@ #define USB_VENDOR_ID_A4TECH 0x09da #define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006 +#define USB_DEVICE_ID_A4TECH_X5_005D 0x000a #define USB_VENDOR_ID_AASHIMA 0x06d6 #define USB_DEVICE_ID_AASHIMA_GAMEPAD 0x0025 @@ -59,6 +60,21 @@ #define USB_DEVICE_ID_APPLE_GEYSER4_ANSI 0x021a #define USB_DEVICE_ID_APPLE_GEYSER4_ISO 0x021b #define USB_DEVICE_ID_APPLE_GEYSER4_JIS 0x021c +#define USB_DEVICE_ID_APPLE_ALU_ANSI 0x0220 +#define USB_DEVICE_ID_APPLE_ALU_ISO 0x0221 +#define USB_DEVICE_ID_APPLE_ALU_JIS 0x0222 +#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI 0x0229 +#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO 0x022a +#define USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS 0x022b +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI 0x022c +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO 0x022d +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS 0x022e +#define USB_DEVICE_ID_APPLE_WELLSPRING_ANSI 0x0223 +#define USB_DEVICE_ID_APPLE_WELLSPRING_ISO 0x0224 +#define USB_DEVICE_ID_APPLE_WELLSPRING_JIS 0x0225 +#define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI 0x0230 +#define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO 0x0231 +#define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS 0x0232 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b #define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242 @@ -66,6 +82,9 @@ #define USB_VENDOR_ID_ASUS 0x0b05 #define USB_DEVICE_ID_ASUS_LCM 0x1726 +#define USB_VENDOR_ID_ASUS 0x0b05 +#define USB_DEVICE_ID_ASUS_LCM 0x1726 + #define USB_VENDOR_ID_ATEN 0x0557 #define USB_DEVICE_ID_ATEN_UC100KM 0x2004 #define USB_DEVICE_ID_ATEN_CS124U 0x2202 @@ -116,6 +135,7 @@ #define USB_VENDOR_ID_GAMERON 0x0810 #define USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR 0x0001 +#define USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR 0x0002 #define USB_VENDOR_ID_GENERAL_TOUCH 0x0dfc @@ -368,6 +388,7 @@ } hid_blacklist[] = { { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, + { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D, HID_QUIRK_2WHEEL_MOUSE_HACK_B8 }, { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_5 }, { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RECEIVER, HID_QUIRK_BAD_RELATIVE_KEYS }, @@ -377,6 +398,7 @@ { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, { USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR, HID_QUIRK_MULTI_INPUT }, + { USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, @@ -540,19 +562,34 @@ { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD}, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD}, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD}, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI, HID_QUIRK_APPLE_HAS_FN }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS, HID_QUIRK_APPLE_HAS_FN }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, { USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_W7658, HID_QUIRK_RESET_LEDS }, { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_KBD, HID_QUIRK_RESET_LEDS }, @@ -645,6 +682,8 @@ { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, + { USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM, HID_QUIRK_IGNORE}, + { 0, 0 } }; @@ -751,6 +790,7 @@ return 0; } +EXPORT_SYMBOL(usbhid_modify_dquirk); /** * usbhid_remove_all_dquirks: remove all runtime HID quirks from memory --- linux-2.6.24.orig/drivers/pci/setup-res.c +++ linux-2.6.24/drivers/pci/setup-res.c @@ -158,7 +158,7 @@ } if (ret) { - printk(KERN_ERR "PCI: Failed to allocate %s resource " + printk(KERN_WARNING "PCI: Failed to allocate %s resource " "#%d:%llx@%llx for %s\n", res->flags & IORESOURCE_IO ? "I/O" : "mem", resno, (unsigned long long)size, @@ -196,7 +196,7 @@ } if (ret) { - printk(KERN_ERR "PCI: Failed to allocate %s resource " + printk(KERN_WARNING "PCI: Failed to allocate %s resource " "#%d:%llx@%llx for %s\n", res->flags & IORESOURCE_IO ? "I/O" : "mem", resno, (unsigned long long)(res->end - res->start + 1), --- linux-2.6.24.orig/drivers/pci/quirks.c +++ linux-2.6.24/drivers/pci/quirks.c @@ -187,10 +187,12 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, quirk_vialatency ); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8371_1, quirk_vialatency ); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8361, quirk_vialatency ); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C691_0, quirk_vialatency ); /* Must restore this on a resume from RAM */ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, quirk_vialatency ); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8371_1, quirk_vialatency ); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8361, quirk_vialatency ); +DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C691_0, quirk_vialatency ); /* * VIA Apollo VP3 needs ETBF on BT848/878 @@ -869,13 +871,13 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb ); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb ); - -static void __devinit quirk_sb600_sata(struct pci_dev *pdev) +static void __devinit quirk_amd_ide_mode(struct pci_dev *pdev) { - /* set sb600 sata to ahci mode */ - if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) { - u8 tmp; + /* set sb600/sb700/sb800 sata to ahci mode */ + u8 tmp; + pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); + if (tmp == 0x01) { pci_read_config_byte(pdev, 0x40, &tmp); pci_write_config_byte(pdev, 0x40, tmp|1); pci_write_config_byte(pdev, 0x9, 1); @@ -883,10 +885,13 @@ pci_write_config_byte(pdev, 0x40, tmp); pdev->class = PCI_CLASS_STORAGE_SATA_AHCI; + dev_info(&pdev->dev, "set SATA to AHCI mode\n"); } } -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_sb600_sata); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode); +DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); +DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); /* * Serverworks CSB5 IDE does not fully support native mode @@ -950,6 +955,12 @@ * accesses to the SMBus registers, with potentially bad effects. Thus you * should be very careful when adding new entries: if SMM is accessing the * Intel SMBus, this is a very good reason to leave it hidden. + * + * Likewise, many recent laptops use ACPI for thermal management. If the + * ACPI DSDT code accesses the SMBus, then Linux should not access it + * natively, and keeping the SMBus hidden is the right thing to do. If you + * are about to add an entry in the table below, please first disassemble + * the DSDT and double-check that there is no code accessing the SMBus. */ static int asus_hides_smbus; @@ -1022,11 +1033,6 @@ case 0x12bd: /* HP D530 */ asus_hides_smbus = 1; } - else if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) - switch (dev->subsystem_device) { - case 0x099c: /* HP Compaq nx6110 */ - asus_hides_smbus = 1; - } } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG)) { if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) switch(dev->subsystem_device) { @@ -1711,10 +1717,89 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, quirk_nvidia_ck804_msi_ht_cap); +/* + * Force enable MSI mapping capability on HT bridges */ +static inline void ht_enable_msi_mapping(struct pci_dev *dev) +{ + int pos, ttl = 48; + + pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); + while (pos && ttl--) { + u8 flags; + + if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, + &flags) == 0) { + dev_info(&dev->dev, "Enabling HT MSI Mapping\n"); + + pci_write_config_byte(dev, pos + HT_MSI_FLAGS, + flags | HT_MSI_FLAGS_ENABLE); + } + pos = pci_find_next_ht_capability(dev, pos, + HT_CAPTYPE_MSI_MAPPING); + } +} + +static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev) +{ + struct pci_dev *host_bridge; + int pos, ttl = 48; + + /* + * HT MSI mapping should be disabled on devices that are below + * a non-Hypertransport host bridge. Locate the host bridge... + */ + host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); + if (host_bridge == NULL) { + dev_warn(&dev->dev, + "nv_msi_ht_cap_quirk didn't locate host bridge\n"); + return; + } + + pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE); + if (pos != 0) { + /* Host bridge is to HT */ + ht_enable_msi_mapping(dev); + return; + } + + /* Host bridge is not to HT, disable HT MSI mapping on this device */ + pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); + while (pos && ttl--) { + u8 flags; + + if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, + &flags) == 0) { + dev_info(&dev->dev, "Quirk disabling HT MSI mapping"); + pci_write_config_byte(dev, pos + HT_MSI_FLAGS, + flags & ~HT_MSI_FLAGS_ENABLE); + } + pos = pci_find_next_ht_capability(dev, pos, + HT_CAPTYPE_MSI_MAPPING); + } +} +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_quirk); + static void __devinit quirk_msi_intx_disable_bug(struct pci_dev *dev) { dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; } +static void __devinit quirk_msi_intx_disable_ati_bug(struct pci_dev *dev) +{ + struct pci_dev *p; + + /* SB700 MSI issue will be fixed at HW level from revision A21, + * we need check PCI REVISION ID of SMBus controller to get SB700 + * revision. + */ + p = pci_get_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, + NULL); + if (!p) + return; + + if ((p->revision < 0x3B) && (p->revision >= 0x30)) + dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; + pci_dev_put(p); +} DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780, quirk_msi_intx_disable_bug); @@ -1735,17 +1820,15 @@ quirk_msi_intx_disable_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4390, - quirk_msi_intx_disable_bug); + quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4391, - quirk_msi_intx_disable_bug); + quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4392, - quirk_msi_intx_disable_bug); + quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4393, - quirk_msi_intx_disable_bug); + quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4394, - quirk_msi_intx_disable_bug); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4395, - quirk_msi_intx_disable_bug); + quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4373, quirk_msi_intx_disable_bug); --- linux-2.6.24.orig/drivers/pci/pci.c +++ linux-2.6.24/drivers/pci/pci.c @@ -536,6 +536,7 @@ case PM_EVENT_PRETHAW: /* REVISIT both freeze and pre-thaw "should" use D0 */ case PM_EVENT_SUSPEND: + case PM_EVENT_HIBERNATE: return PCI_D3hot; default: printk("Unrecognized suspend event %d\n", state.event); --- linux-2.6.24.orig/drivers/pci/pci.h +++ linux-2.6.24/drivers/pci/pci.h @@ -39,9 +39,11 @@ #ifdef CONFIG_PCI_MSI void pci_no_msi(void); +void pci_yes_msi(void); extern void pci_msi_init_pci_dev(struct pci_dev *dev); #else static inline void pci_no_msi(void) { } +static inline void pci_yes_msi(void) { } static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } #endif --- linux-2.6.24.orig/drivers/firmware/dcdbas.c +++ linux-2.6.24/drivers/firmware/dcdbas.c @@ -658,4 +658,5 @@ MODULE_VERSION(DRIVER_VERSION); MODULE_AUTHOR("Dell Inc."); MODULE_LICENSE("GPL"); - +/* Any System or BIOS claiming to be by Dell */ +MODULE_ALIAS("dmi:*:[bs]vnD[Ee][Ll][Ll]*:*"); --- linux-2.6.24.orig/drivers/firmware/dmi_scan.c +++ linux-2.6.24/drivers/firmware/dmi_scan.c @@ -219,7 +219,7 @@ dev->name = "IPMI controller"; dev->device_data = data; - list_add(&dev->list, &dmi_devices); + list_add_tail(&dev->list, &dmi_devices); } /* @@ -389,6 +389,17 @@ } EXPORT_SYMBOL(dmi_get_system_info); +/** + * dmi_name_in_serial - Check if string is in the DMI product serial + * information. + */ +int dmi_name_in_serial(const char *str) +{ + int f = DMI_PRODUCT_SERIAL; + if (dmi_ident[f] && strstr(dmi_ident[f], str)) + return 1; + return 0; +} /** * dmi_name_in_vendors - Check if string is anywhere in the DMI vendor information. --- linux-2.6.24.orig/drivers/firmware/dell_rbu.c +++ linux-2.6.24/drivers/firmware/dell_rbu.c @@ -598,7 +598,7 @@ { int size = 0; if (!pos) - size = sprintf(buffer, "%s\n", image_type); + size = scnprintf(buffer, count, "%s\n", image_type); return size; } @@ -670,7 +670,7 @@ int size = 0; if (!pos) { spin_lock(&rbu_data.lock); - size = sprintf(buffer, "%lu\n", rbu_data.packetsize); + size = scnprintf(buffer, count, "%lu\n", rbu_data.packetsize); spin_unlock(&rbu_data.lock); } return size; --- linux-2.6.24.orig/drivers/firmware/Kconfig +++ linux-2.6.24/drivers/firmware/Kconfig @@ -17,6 +17,15 @@ obscure configurations. Most disk controller BIOS vendors do not yet implement this feature. +config EDD_OFF + bool "Sets default behavior for EDD detection to off" + depends on EDD + default n + help + Say Y if you want EDD disabled by default, even though it is compiled into the + kernel. Say N if you want EDD enabled by default. EDD can be dynamically set + using the kernel parameter 'edd={on|off}'. + config EFI_VARS tristate "EFI Variable Support via sysfs" depends on EFI --- linux-2.6.24.orig/drivers/firewire/fw-ohci.c +++ linux-2.6.24/drivers/firewire/fw-ohci.c @@ -1803,6 +1803,13 @@ page = payload >> PAGE_SHIFT; offset = payload & ~PAGE_MASK; rest = p->payload_length; + /* + * The controllers I've tested have not worked correctly when + * second_req_count is zero. Rather than do something we know won't + * work, return an error + */ + if (rest == 0) + return -EINVAL; /* FIXME: make packet-per-buffer/dual-buffer a context option */ while (rest > 0) { --- linux-2.6.24.orig/drivers/net/pppol2tp.c +++ linux-2.6.24/drivers/net/pppol2tp.c @@ -302,14 +302,14 @@ struct pppol2tp_session *session; struct hlist_node *walk; - read_lock(&tunnel->hlist_lock); + read_lock_bh(&tunnel->hlist_lock); hlist_for_each_entry(session, walk, session_list, hlist) { if (session->tunnel_addr.s_session == session_id) { - read_unlock(&tunnel->hlist_lock); + read_unlock_bh(&tunnel->hlist_lock); return session; } } - read_unlock(&tunnel->hlist_lock); + read_unlock_bh(&tunnel->hlist_lock); return NULL; } @@ -320,14 +320,14 @@ { struct pppol2tp_tunnel *tunnel = NULL; - read_lock(&pppol2tp_tunnel_list_lock); + read_lock_bh(&pppol2tp_tunnel_list_lock); list_for_each_entry(tunnel, &pppol2tp_tunnel_list, list) { if (tunnel->stats.tunnel_id == tunnel_id) { - read_unlock(&pppol2tp_tunnel_list_lock); + read_unlock_bh(&pppol2tp_tunnel_list_lock); return tunnel; } } - read_unlock(&pppol2tp_tunnel_list_lock); + read_unlock_bh(&pppol2tp_tunnel_list_lock); return NULL; } @@ -342,10 +342,11 @@ static void pppol2tp_recv_queue_skb(struct pppol2tp_session *session, struct sk_buff *skb) { struct sk_buff *skbp; + struct sk_buff *tmp; u16 ns = PPPOL2TP_SKB_CB(skb)->ns; - spin_lock(&session->reorder_q.lock); - skb_queue_walk(&session->reorder_q, skbp) { + spin_lock_bh(&session->reorder_q.lock); + skb_queue_walk_safe(&session->reorder_q, skbp, tmp) { if (PPPOL2TP_SKB_CB(skbp)->ns > ns) { __skb_insert(skb, skbp->prev, skbp, &session->reorder_q); PRINTK(session->debug, PPPOL2TP_MSG_SEQ, KERN_DEBUG, @@ -360,7 +361,7 @@ __skb_queue_tail(&session->reorder_q, skb); out: - spin_unlock(&session->reorder_q.lock); + spin_unlock_bh(&session->reorder_q.lock); } /* Dequeue a single skb. @@ -371,10 +372,9 @@ int length = PPPOL2TP_SKB_CB(skb)->length; struct sock *session_sock = NULL; - /* We're about to requeue the skb, so unlink it and return resources + /* We're about to requeue the skb, so return resources * to its current owner (a socket receive buffer). */ - skb_unlink(skb, &session->reorder_q); skb_orphan(skb); tunnel->stats.rx_packets++; @@ -442,7 +442,7 @@ * expect to send up next, dequeue it and any other * in-sequence packets behind it. */ - spin_lock(&session->reorder_q.lock); + spin_lock_bh(&session->reorder_q.lock); skb_queue_walk_safe(&session->reorder_q, skb, tmp) { if (time_after(jiffies, PPPOL2TP_SKB_CB(skb)->expires)) { session->stats.rx_seq_discards++; @@ -469,13 +469,18 @@ goto out; } } - spin_unlock(&session->reorder_q.lock); + __skb_unlink(skb, &session->reorder_q); + + /* Process the skb. We release the queue lock while we + * do so to let other contexts process the queue. + */ + spin_unlock_bh(&session->reorder_q.lock); pppol2tp_recv_dequeue_skb(session, skb); - spin_lock(&session->reorder_q.lock); + spin_lock_bh(&session->reorder_q.lock); } out: - spin_unlock(&session->reorder_q.lock); + spin_unlock_bh(&session->reorder_q.lock); } /* Internal receive frame. Do the real work of receiving an L2TP data frame @@ -766,14 +771,18 @@ err = 0; skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flags & MSG_DONTWAIT, &err); - if (skb) { - err = memcpy_toiovec(msg->msg_iov, (unsigned char *) skb->data, - skb->len); - if (err < 0) - goto do_skb_free; - err = skb->len; - } -do_skb_free: + if (!skb) + goto end; + + if (len > skb->len) + len = skb->len; + else if (len < skb->len) + msg->msg_flags |= MSG_TRUNC; + + err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len); + if (likely(err == 0)) + err = len; + kfree_skb(skb); end: return err; @@ -1058,7 +1067,7 @@ /* Get routing info from the tunnel socket */ dst_release(skb->dst); - skb->dst = sk_dst_get(sk_tun); + skb->dst = dst_clone(__sk_dst_get(sk_tun)); skb_orphan(skb); skb->sk = sk_tun; @@ -1106,7 +1115,7 @@ PRINTK(tunnel->debug, PPPOL2TP_MSG_CONTROL, KERN_INFO, "%s: closing all sessions...\n", tunnel->name); - write_lock(&tunnel->hlist_lock); + write_lock_bh(&tunnel->hlist_lock); for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) { again: hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) { @@ -1126,7 +1135,7 @@ * disappear as we're jumping between locks. */ sock_hold(sk); - write_unlock(&tunnel->hlist_lock); + write_unlock_bh(&tunnel->hlist_lock); lock_sock(sk); if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { @@ -1148,11 +1157,11 @@ * list so we are guaranteed to make forward * progress. */ - write_lock(&tunnel->hlist_lock); + write_lock_bh(&tunnel->hlist_lock); goto again; } } - write_unlock(&tunnel->hlist_lock); + write_unlock_bh(&tunnel->hlist_lock); } /* Really kill the tunnel. @@ -1161,9 +1170,9 @@ static void pppol2tp_tunnel_free(struct pppol2tp_tunnel *tunnel) { /* Remove from socket list */ - write_lock(&pppol2tp_tunnel_list_lock); + write_lock_bh(&pppol2tp_tunnel_list_lock); list_del_init(&tunnel->list); - write_unlock(&pppol2tp_tunnel_list_lock); + write_unlock_bh(&pppol2tp_tunnel_list_lock); atomic_dec(&pppol2tp_tunnel_count); kfree(tunnel); @@ -1239,9 +1248,9 @@ /* Delete the session socket from the * hash */ - write_lock(&tunnel->hlist_lock); + write_lock_bh(&tunnel->hlist_lock); hlist_del_init(&session->hlist); - write_unlock(&tunnel->hlist_lock); + write_unlock_bh(&tunnel->hlist_lock); atomic_dec(&pppol2tp_session_count); } @@ -1386,9 +1395,9 @@ /* Add tunnel to our list */ INIT_LIST_HEAD(&tunnel->list); - write_lock(&pppol2tp_tunnel_list_lock); + write_lock_bh(&pppol2tp_tunnel_list_lock); list_add(&tunnel->list, &pppol2tp_tunnel_list); - write_unlock(&pppol2tp_tunnel_list_lock); + write_unlock_bh(&pppol2tp_tunnel_list_lock); atomic_inc(&pppol2tp_tunnel_count); /* Bump the reference count. The tunnel context is deleted @@ -1593,11 +1602,11 @@ sk->sk_user_data = session; /* Add session to the tunnel's hash list */ - write_lock(&tunnel->hlist_lock); + write_lock_bh(&tunnel->hlist_lock); hlist_add_head(&session->hlist, pppol2tp_session_id_hash(tunnel, session->tunnel_addr.s_session)); - write_unlock(&tunnel->hlist_lock); + write_unlock_bh(&tunnel->hlist_lock); atomic_inc(&pppol2tp_session_count); @@ -2199,7 +2208,7 @@ int next = 0; int i; - read_lock(&tunnel->hlist_lock); + read_lock_bh(&tunnel->hlist_lock); for (i = 0; i < PPPOL2TP_HASH_SIZE; i++) { hlist_for_each_entry(session, walk, &tunnel->session_hlist[i], hlist) { if (curr == NULL) { @@ -2217,7 +2226,7 @@ } } out: - read_unlock(&tunnel->hlist_lock); + read_unlock_bh(&tunnel->hlist_lock); if (!found) session = NULL; @@ -2228,13 +2237,13 @@ { struct pppol2tp_tunnel *tunnel = NULL; - read_lock(&pppol2tp_tunnel_list_lock); + read_lock_bh(&pppol2tp_tunnel_list_lock); if (list_is_last(&curr->list, &pppol2tp_tunnel_list)) { goto out; } tunnel = list_entry(curr->list.next, struct pppol2tp_tunnel, list); out: - read_unlock(&pppol2tp_tunnel_list_lock); + read_unlock_bh(&pppol2tp_tunnel_list_lock); return tunnel; } --- linux-2.6.24.orig/drivers/net/sungem.c +++ linux-2.6.24/drivers/net/sungem.c @@ -910,7 +910,7 @@ * rx ring - must call napi_disable(), which * schedule_timeout()'s if polling is already disabled. */ - work_done += gem_rx(gp, budget); + work_done += gem_rx(gp, budget - work_done); if (work_done >= budget) return work_done; --- linux-2.6.24.orig/drivers/net/tehuti.c +++ linux-2.6.24/drivers/net/tehuti.c @@ -625,6 +625,12 @@ s_firmLoad[i] = CPU_CHIP_SWAP32(s_firmLoad[i]); } +static int bdx_range_check(struct bdx_priv *priv, u32 offset) +{ + return (offset > (u32) (BDX_REGS_SIZE / priv->nic->port_num)) ? + -EINVAL : 0; +} + static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) { struct bdx_priv *priv = ndev->priv; @@ -643,9 +649,15 @@ DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]); } + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + switch (data[0]) { case BDX_OP_READ: + error = bdx_range_check(priv, data[1]); + if (error < 0) + return error; data[2] = READ_REG(priv, data[1]); DBG("read_reg(0x%x)=0x%x (dec %d)\n", data[1], data[2], data[2]); @@ -655,6 +667,9 @@ break; case BDX_OP_WRITE: + error = bdx_range_check(priv, data[1]); + if (error < 0) + return error; WRITE_REG(priv, data[1], data[2]); DBG("write_reg(0x%x, 0x%x)\n", data[1], data[2]); break; --- linux-2.6.24.orig/drivers/net/niu.c +++ linux-2.6.24/drivers/net/niu.c @@ -33,8 +33,8 @@ #define DRV_MODULE_NAME "niu" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "0.6" -#define DRV_MODULE_RELDATE "January 5, 2008" +#define DRV_MODULE_VERSION "0.7" +#define DRV_MODULE_RELDATE "February 18, 2008" static char version[] __devinitdata = DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; @@ -1616,12 +1616,13 @@ if (index >= niu_num_alt_addr(np)) return -EINVAL; - if (np->flags & NIU_FLAGS_XMAC) + if (np->flags & NIU_FLAGS_XMAC) { reg = XMAC_ADDR_CMPEN; - else + mask = 1 << index; + } else { reg = BMAC_ADDR_CMPEN; - - mask = 1 << index; + mask = 1 << (index + 1); + } val = nr64_mac(reg); if (on) @@ -5147,7 +5148,12 @@ index++; } } else { - for (i = 0; i < niu_num_alt_addr(np); i++) { + int alt_start; + if (np->flags & NIU_FLAGS_XMAC) + alt_start = 0; + else + alt_start = 1; + for (i = alt_start; i < niu_num_alt_addr(np); i++) { err = niu_enable_alt_mac(np, i, 0); if (err) printk(KERN_WARNING PFX "%s: Error %d " --- linux-2.6.24.orig/drivers/net/virtio_net.c +++ linux-2.6.24/drivers/net/virtio_net.c @@ -24,6 +24,13 @@ #include #include +static int napi_weight = 128; +module_param(napi_weight, int, 0444); + +static int csum = 1, gso = 1; +module_param(csum, bool, 0444); +module_param(gso, bool, 0444); + /* FIXME: MTU in config. */ #define MAX_PACKET_LEN (ETH_HLEN+ETH_DATA_LEN) @@ -52,13 +59,14 @@ sg_init_one(sg, skb_vnet_hdr(skb), sizeof(struct virtio_net_hdr)); } -static bool skb_xmit_done(struct virtqueue *rvq) +static void skb_xmit_done(struct virtqueue *svq) { - struct virtnet_info *vi = rvq->vdev->priv; + struct virtnet_info *vi = svq->vdev->priv; - /* In case we were waiting for output buffers. */ + /* Suppress further interrupts. */ + svq->vq_ops->disable_cb(svq); + /* We were waiting for more output buffers. */ netif_wake_queue(vi->dev); - return true; } static void receive_skb(struct net_device *dev, struct sk_buff *skb, @@ -83,28 +91,16 @@ if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { pr_debug("Needs csum!\n"); - skb->ip_summed = CHECKSUM_PARTIAL; - skb->csum_start = hdr->csum_start; - skb->csum_offset = hdr->csum_offset; - if (skb->csum_start > skb->len - 2 - || skb->csum_offset > skb->len - 2) { - if (net_ratelimit()) - printk(KERN_WARNING "%s: csum=%u/%u len=%u\n", - dev->name, skb->csum_start, - skb->csum_offset, skb->len); + if (!skb_partial_csum_set(skb,hdr->csum_start,hdr->csum_offset)) goto frame_err; - } } if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { pr_debug("GSO!\n"); - switch (hdr->gso_type) { + switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { case VIRTIO_NET_HDR_GSO_TCPV4: skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; break; - case VIRTIO_NET_HDR_GSO_TCPV4_ECN: - skb_shinfo(skb)->gso_type = SKB_GSO_TCP_ECN; - break; case VIRTIO_NET_HDR_GSO_UDP: skb_shinfo(skb)->gso_type = SKB_GSO_UDP; break; @@ -118,6 +114,9 @@ goto frame_err; } + if (hdr->gso_type & VIRTIO_NET_HDR_GSO_ECN) + skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN; + skb_shinfo(skb)->gso_size = hdr->gso_size; if (skb_shinfo(skb)->gso_size == 0) { if (net_ratelimit()) @@ -170,12 +169,14 @@ vi->rvq->vq_ops->kick(vi->rvq); } -static bool skb_recv_done(struct virtqueue *rvq) +static void skb_recv_done(struct virtqueue *rvq) { struct virtnet_info *vi = rvq->vdev->priv; - netif_rx_schedule(vi->dev, &vi->napi); - /* Suppress further interrupts. */ - return false; + /* Schedule NAPI, Suppress further interrupts if successful. */ + if (netif_rx_schedule_prep(vi->dev, &vi->napi)) { + rvq->vq_ops->disable_cb(rvq); + __netif_rx_schedule(vi->dev, &vi->napi); + } } static int virtnet_poll(struct napi_struct *napi, int budget) @@ -201,9 +202,12 @@ /* Out of packets? */ if (received < budget) { netif_rx_complete(vi->dev, napi); - if (unlikely(!vi->rvq->vq_ops->restart(vi->rvq)) - && netif_rx_reschedule(vi->dev, napi)) + if (unlikely(!vi->rvq->vq_ops->enable_cb(vi->rvq)) + && napi_schedule_prep(napi)) { + vi->rvq->vq_ops->disable_cb(vi->rvq); + __netif_rx_schedule(vi->dev, napi); goto again; + } } return received; @@ -236,8 +240,6 @@ pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest)); - free_old_xmit_skbs(vi); - /* Encode metadata header at front. */ hdr = skb_vnet_hdr(skb); if (skb->ip_summed == CHECKSUM_PARTIAL) { @@ -250,10 +252,9 @@ } if (skb_is_gso(skb)) { + hdr->hdr_len = skb_transport_header(skb) - skb->data; hdr->gso_size = skb_shinfo(skb)->gso_size; - if (skb_shinfo(skb)->gso_type & SKB_GSO_TCP_ECN) - hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4_ECN; - else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) + if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6; @@ -261,19 +262,34 @@ hdr->gso_type = VIRTIO_NET_HDR_GSO_UDP; else BUG(); + if (skb_shinfo(skb)->gso_type & SKB_GSO_TCP_ECN) + hdr->gso_type |= VIRTIO_NET_HDR_GSO_ECN; } else { hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE; - hdr->gso_size = 0; + hdr->gso_size = hdr->hdr_len = 0; } vnet_hdr_to_sg(sg, skb); num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; __skb_queue_head(&vi->send, skb); + +again: + /* Free up any pending old buffers before queueing new ones. */ + free_old_xmit_skbs(vi); err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb); if (err) { pr_debug("%s: virtio not prepared to send\n", dev->name); - skb_unlink(skb, &vi->send); netif_stop_queue(dev); + + /* Activate callback for using skbs: if this returns false it + * means some were used in the meantime. */ + if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) { + vi->svq->vq_ops->disable_cb(vi->svq); + netif_start_queue(dev); + goto again; + } + __skb_unlink(skb, &vi->send); + return NETDEV_TX_BUSY; } vi->svq->vq_ops->kick(vi->svq); @@ -281,49 +297,46 @@ return 0; } -static int virtnet_open(struct net_device *dev) +#ifdef CONFIG_NET_POLL_CONTROLLER +static void virtnet_netpoll(struct net_device *dev) { struct virtnet_info *vi = netdev_priv(dev); - try_fill_recv(vi); + napi_schedule(&vi->napi); +} +#endif - /* If we didn't even get one input buffer, we're useless. */ - if (vi->num == 0) - return -ENOMEM; +static int virtnet_open(struct net_device *dev) +{ + struct virtnet_info *vi = netdev_priv(dev); napi_enable(&vi->napi); + + /* If all buffers were filled by other side before we napi_enabled, we + * won't get another interrupt, so process any outstanding packets + * now. virtnet_poll wants re-enable the queue, so we disable here. + * We synchronize against interrupts via NAPI_STATE_SCHED */ + if (netif_rx_schedule_prep(dev, &vi->napi)) { + vi->rvq->vq_ops->disable_cb(vi->rvq); + __netif_rx_schedule(dev, &vi->napi); + } return 0; } static int virtnet_close(struct net_device *dev) { struct virtnet_info *vi = netdev_priv(dev); - struct sk_buff *skb; napi_disable(&vi->napi); - /* networking core has neutered skb_xmit_done/skb_recv_done, so don't - * worry about races vs. get(). */ - vi->rvq->vq_ops->shutdown(vi->rvq); - while ((skb = __skb_dequeue(&vi->recv)) != NULL) { - kfree_skb(skb); - vi->num--; - } - vi->svq->vq_ops->shutdown(vi->svq); - while ((skb = __skb_dequeue(&vi->send)) != NULL) - kfree_skb(skb); - - BUG_ON(vi->num != 0); return 0; } static int virtnet_probe(struct virtio_device *vdev) { int err; - unsigned int len; struct net_device *dev; struct virtnet_info *vi; - void *token; /* Allocate ourselves a network device with room for our info */ dev = alloc_etherdev(sizeof(struct virtnet_info)); @@ -331,50 +344,57 @@ return -ENOMEM; /* Set up network device as normal. */ - ether_setup(dev); dev->open = virtnet_open; dev->stop = virtnet_close; dev->hard_start_xmit = start_xmit; dev->features = NETIF_F_HIGHDMA; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = virtnet_netpoll; +#endif SET_NETDEV_DEV(dev, &vdev->dev); /* Do we support "hardware" checksums? */ - token = vdev->config->find(vdev, VIRTIO_CONFIG_NET_F, &len); - if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_NO_CSUM)) { + if (csum && virtio_has_feature(vdev, VIRTIO_NET_F_CSUM)) { /* This opens up the world of extra features. */ dev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST; - if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_TSO4)) + if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) { + dev->features |= NETIF_F_TSO | NETIF_F_UFO + | NETIF_F_TSO_ECN | NETIF_F_TSO6; + } + /* Individual feature bits: what can host handle? */ + if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO4)) dev->features |= NETIF_F_TSO; - if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_UFO)) - dev->features |= NETIF_F_UFO; - if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_TSO4_ECN)) - dev->features |= NETIF_F_TSO_ECN; - if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_TSO6)) + if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO6)) dev->features |= NETIF_F_TSO6; + if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN)) + dev->features |= NETIF_F_TSO_ECN; + if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_HOST_UFO)) + dev->features |= NETIF_F_UFO; } /* Configuration may specify what MAC to use. Otherwise random. */ - token = vdev->config->find(vdev, VIRTIO_CONFIG_NET_MAC_F, &len); - if (token) { - dev->addr_len = len; - vdev->config->get(vdev, token, dev->dev_addr, len); + if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) { + vdev->config->get(vdev, + offsetof(struct virtio_net_config, mac), + dev->dev_addr, dev->addr_len); } else random_ether_addr(dev->dev_addr); /* Set up our device-specific information */ vi = netdev_priv(dev); - netif_napi_add(dev, &vi->napi, virtnet_poll, 16); + netif_napi_add(dev, &vi->napi, virtnet_poll, napi_weight); vi->dev = dev; vi->vdev = vdev; + vdev->priv = vi; /* We expect two virtqueues, receive then send. */ - vi->rvq = vdev->config->find_vq(vdev, skb_recv_done); + vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done); if (IS_ERR(vi->rvq)) { err = PTR_ERR(vi->rvq); goto free; } - vi->svq = vdev->config->find_vq(vdev, skb_xmit_done); + vi->svq = vdev->config->find_vq(vdev, 1, skb_xmit_done); if (IS_ERR(vi->svq)) { err = PTR_ERR(vi->svq); goto free_recv; @@ -389,10 +409,21 @@ pr_debug("virtio_net: registering device failed\n"); goto free_send; } + + /* Last of all, set up some receive buffers. */ + try_fill_recv(vi); + + /* If we didn't even get one input buffer, we're useless. */ + if (vi->num == 0) { + err = -ENOMEM; + goto unregister; + } + pr_debug("virtnet: registered device %s\n", dev->name); - vdev->priv = vi; return 0; +unregister: + unregister_netdev(dev); free_send: vdev->config->del_vq(vi->svq); free_recv: @@ -405,6 +436,20 @@ static void virtnet_remove(struct virtio_device *vdev) { struct virtnet_info *vi = vdev->priv; + struct sk_buff *skb; + + /* Stop all the virtqueues. */ + vdev->config->reset(vdev); + + /* Free our skbs in send and recv queues, if any. */ + while ((skb = __skb_dequeue(&vi->recv)) != NULL) { + kfree_skb(skb); + vi->num--; + } + while ((skb = __skb_dequeue(&vi->send)) != NULL) + kfree_skb(skb); + + BUG_ON(vi->num != 0); vdev->config->del_vq(vi->svq); vdev->config->del_vq(vi->rvq); @@ -417,7 +462,15 @@ { 0 }, }; +static unsigned int features[] = { + VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GSO, VIRTIO_NET_F_MAC, + VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, + VIRTIO_NET_F_HOST_ECN, +}; + static struct virtio_driver virtio_net = { + .feature_table = features, + .feature_table_size = ARRAY_SIZE(features), .driver.name = KBUILD_MODNAME, .driver.owner = THIS_MODULE, .id_table = id_table, --- linux-2.6.24.orig/drivers/net/bnx2.c +++ linux-2.6.24/drivers/net/bnx2.c @@ -87,6 +87,8 @@ BCM5708S, BCM5709, BCM5709S, + BCM5716, + BCM5716S, } board_t; /* indexed by board_t, above */ @@ -102,6 +104,8 @@ { "Broadcom NetXtreme II BCM5708 1000Base-SX" }, { "Broadcom NetXtreme II BCM5709 1000Base-T" }, { "Broadcom NetXtreme II BCM5709 1000Base-SX" }, + { "Broadcom NetXtreme II BCM5716 1000Base-T" }, + { "Broadcom NetXtreme II BCM5716 1000Base-SX" }, }; static struct pci_device_id bnx2_pci_tbl[] = { @@ -123,6 +127,10 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5709 }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5709S, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5709S }, + { PCI_VENDOR_ID_BROADCOM, 0x163b, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5716 }, + { PCI_VENDOR_ID_BROADCOM, 0x163c, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5716 }, { 0, } }; --- linux-2.6.24.orig/drivers/net/dl2k.c +++ linux-2.6.24/drivers/net/dl2k.c @@ -15,6 +15,7 @@ #define DRV_RELDATE "2007/08/12" #include "dl2k.h" #include +#include static char version[] __devinitdata = KERN_INFO DRV_NAME " " DRV_VERSION " " DRV_RELDATE "\n"; @@ -1276,55 +1277,21 @@ { int phy_addr; struct netdev_private *np = netdev_priv(dev); - struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru; - - struct netdev_desc *desc; - int i; + struct mii_ioctl_data *miidata = if_mii(rq); phy_addr = np->phy_addr; switch (cmd) { - case SIOCDEVPRIVATE: - break; - - case SIOCDEVPRIVATE + 1: - miidata->out_value = mii_read (dev, phy_addr, miidata->reg_num); + case SIOCGMIIPHY: + miidata->phy_id = phy_addr; break; - case SIOCDEVPRIVATE + 2: - mii_write (dev, phy_addr, miidata->reg_num, miidata->in_value); + case SIOCGMIIREG: + miidata->val_out = mii_read (dev, phy_addr, miidata->reg_num); break; - case SIOCDEVPRIVATE + 3: - break; - case SIOCDEVPRIVATE + 4: - break; - case SIOCDEVPRIVATE + 5: - netif_stop_queue (dev); + case SIOCSMIIREG: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + mii_write (dev, phy_addr, miidata->reg_num, miidata->val_in); break; - case SIOCDEVPRIVATE + 6: - netif_wake_queue (dev); - break; - case SIOCDEVPRIVATE + 7: - printk - ("tx_full=%x cur_tx=%lx old_tx=%lx cur_rx=%lx old_rx=%lx\n", - netif_queue_stopped(dev), np->cur_tx, np->old_tx, np->cur_rx, - np->old_rx); - break; - case SIOCDEVPRIVATE + 8: - printk("TX ring:\n"); - for (i = 0; i < TX_RING_SIZE; i++) { - desc = &np->tx_ring[i]; - printk - ("%02x:cur:%08x next:%08x status:%08x frag1:%08x frag0:%08x", - i, - (u32) (np->tx_ring_dma + i * sizeof (*desc)), - (u32)le64_to_cpu(desc->next_desc), - (u32)le64_to_cpu(desc->status), - (u32)(le64_to_cpu(desc->fraginfo) >> 32), - (u32)le64_to_cpu(desc->fraginfo)); - printk ("\n"); - } - printk ("\n"); - break; - default: return -EOPNOTSUPP; } --- linux-2.6.24.orig/drivers/net/Kconfig +++ linux-2.6.24/drivers/net/Kconfig @@ -3064,6 +3064,7 @@ tristate "Virtio network driver (EXPERIMENTAL)" depends on EXPERIMENTAL && VIRTIO ---help--- - This is the virtual network driver for lguest. Say Y or M. + This is the virtual network driver for virtio. It can be used with + lguest or QEMU based VMMs (like KVM or Xen). Say Y or M. endif # NETDEVICES --- linux-2.6.24.orig/drivers/net/plip.c +++ linux-2.6.24/drivers/net/plip.c @@ -903,17 +903,18 @@ struct net_local *nl; struct plip_local *rcv; unsigned char c0; + unsigned long flags; nl = netdev_priv(dev); rcv = &nl->rcv_data; - spin_lock_irq (&nl->lock); + spin_lock_irqsave (&nl->lock, flags); c0 = read_status(dev); if ((c0 & 0xf8) != 0xc0) { if ((dev->irq != -1) && (net_debug > 1)) printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); - spin_unlock_irq (&nl->lock); + spin_unlock_irqrestore (&nl->lock, flags); return; } @@ -942,7 +943,7 @@ break; } - spin_unlock_irq(&nl->lock); + spin_unlock_irqrestore(&nl->lock, flags); } static int --- linux-2.6.24.orig/drivers/net/dl2k.h +++ linux-2.6.24/drivers/net/dl2k.h @@ -388,8 +388,8 @@ MII_MSSR_CFG_RES = 0x4000, MII_MSSR_LOCAL_RCV_STATUS = 0x2000, MII_MSSR_REMOTE_RCVR = 0x1000, - MII_MSSR_LP_1000BT_HD = 0x0800, - MII_MSSR_LP_1000BT_FD = 0x0400, + MII_MSSR_LP_1000BT_FD = 0x0800, + MII_MSSR_LP_1000BT_HD = 0x0400, MII_MSSR_IDLE_ERR_COUNT = 0x00ff, }; @@ -471,13 +471,6 @@ char *data; }; -struct mii_data { - __u16 reserved; - __u16 reg_num; - __u16 in_value; - __u16 out_value; -}; - /* The Rx and Tx buffer descriptors. */ struct netdev_desc { __le64 next_desc; --- linux-2.6.24.orig/drivers/net/eql.c +++ linux-2.6.24/drivers/net/eql.c @@ -546,6 +546,8 @@ equalizer_t *eql; master_config_t mc; + memset(&mc, 0, sizeof(master_config_t)); + if (eql_is_master(dev)) { eql = netdev_priv(dev); mc.max_slaves = eql->max_slaves; --- linux-2.6.24.orig/drivers/net/sunvnet.c +++ linux-2.6.24/drivers/net/sunvnet.c @@ -201,15 +201,9 @@ struct sk_buff *skb; int err; - err = -EMSGSIZE; - if (unlikely(len < ETH_ZLEN || len > ETH_FRAME_LEN)) { - dev->stats.rx_length_errors++; - goto out_dropped; - } - skb = alloc_and_align_skb(dev, len); err = -ENOMEM; - if (unlikely(!skb)) { + if (!skb) { dev->stats.rx_missed_errors++; goto out_dropped; } @@ -219,7 +213,7 @@ err = ldc_copy(port->vio.lp, LDC_COPY_IN, skb->data, copy_len, 0, cookies, ncookies); - if (unlikely(err < 0)) { + if (err < 0) { dev->stats.rx_frame_errors++; goto out_free_skb; } --- linux-2.6.24.orig/drivers/net/sky2.c +++ linux-2.6.24/drivers/net/sky2.c @@ -119,6 +119,7 @@ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) }, /* 88E8038 */ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4355) }, /* 88E8040T */ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ @@ -3324,7 +3325,7 @@ default: gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); - gm_phy_write(hw, port, PHY_MARV_LED_OVER, + gm_phy_write(hw, port, PHY_MARV_LED_OVER, on ? PHY_M_LED_ALL : 0); } } @@ -4312,10 +4313,14 @@ if (!hw) return 0; + del_timer_sync(&hw->watchdog_timer); + cancel_work_sync(&hw->restart_work); + for (i = 0; i < hw->ports; i++) { struct net_device *dev = hw->dev[i]; struct sky2_port *sky2 = netdev_priv(dev); + netif_device_detach(dev); if (netif_running(dev)) sky2_down(dev); @@ -4366,6 +4371,8 @@ for (i = 0; i < hw->ports; i++) { struct net_device *dev = hw->dev[i]; + + netif_device_attach(dev); if (netif_running(dev)) { err = sky2_up(dev); if (err) { --- linux-2.6.24.orig/drivers/net/sis190.c +++ linux-2.6.24/drivers/net/sis190.c @@ -311,6 +311,7 @@ unsigned int type; u32 feature; } mii_chip_table[] = { + { "Atheros PHY AR8012", { 0x004d, 0xd020 }, LAN, 0 }, { "Broadcom PHY BCM5461", { 0x0020, 0x60c0 }, LAN, F_PHY_BCM5461 }, { "Broadcom PHY AC131", { 0x0143, 0xbc70 }, LAN, 0 }, { "Agere PHY ET1101B", { 0x0282, 0xf010 }, LAN, 0 }, @@ -1632,13 +1633,18 @@ static int sis190_get_mac_addr(struct pci_dev *pdev, struct net_device *dev) { - u8 from; + int rc; + + rc = sis190_get_mac_addr_from_eeprom(pdev, dev); + if (rc < 0) { + u8 reg; - pci_read_config_byte(pdev, 0x73, &from); + pci_read_config_byte(pdev, 0x73, ®); - return (from & 0x00000001) ? - sis190_get_mac_addr_from_apc(pdev, dev) : - sis190_get_mac_addr_from_eeprom(pdev, dev); + if (reg & 0x00000001) + rc = sis190_get_mac_addr_from_apc(pdev, dev); + } + return rc; } static void sis190_set_speed_auto(struct net_device *dev) --- linux-2.6.24.orig/drivers/net/niu.h +++ linux-2.6.24/drivers/net/niu.h @@ -499,7 +499,7 @@ #define BMAC_ADDR2 0x00110UL #define BMAC_ADDR2_ADDR2 0x000000000000ffffULL -#define BMAC_NUM_ALT_ADDR 7 +#define BMAC_NUM_ALT_ADDR 6 #define BMAC_ALT_ADDR0(NUM) (0x00118UL + (NUM)*0x18UL) #define BMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL --- linux-2.6.24.orig/drivers/net/forcedeth.c +++ linux-2.6.24/drivers/net/forcedeth.c @@ -5666,3 +5666,5 @@ module_init(init_nic); module_exit(exit_nic); + + --- linux-2.6.24.orig/drivers/net/macb.c +++ linux-2.6.24/drivers/net/macb.c @@ -148,7 +148,7 @@ if (phydev->duplex) reg |= MACB_BIT(FD); - if (phydev->speed) + if (phydev->speed == SPEED_100) reg |= MACB_BIT(SPD); macb_writel(bp, NCFGR, reg); @@ -1257,6 +1257,8 @@ if (dev) { bp = netdev_priv(dev); + if (bp->phy_dev) + phy_disconnect(bp->phy_dev); mdiobus_unregister(&bp->mii_bus); kfree(bp->mii_bus.irq); unregister_netdev(dev); --- linux-2.6.24.orig/drivers/net/r8169.c +++ linux-2.6.24/drivers/net/r8169.c @@ -77,11 +77,11 @@ /* MAC address length */ #define MAC_ADDR_LEN 6 +#define MAX_READ_REQUEST_SHIFT 12 #define RX_FIFO_THRESH 7 /* 7 means NO threshold, Rx buffer level before first PCI xfer. */ #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ -#define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC... */ #define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ @@ -111,6 +111,10 @@ RTL_GIGA_MAC_VER_04 = 0x04, // 8169SB RTL_GIGA_MAC_VER_05 = 0x05, // 8110SCd RTL_GIGA_MAC_VER_06 = 0x06, // 8110SCe + RTL_GIGA_MAC_VER_07 = 0x07, // 8102e + RTL_GIGA_MAC_VER_08 = 0x08, // 8102e + RTL_GIGA_MAC_VER_09 = 0x09, // 8102e + RTL_GIGA_MAC_VER_10 = 0x0a, // 8101e RTL_GIGA_MAC_VER_11 = 0x0b, // 8168Bb RTL_GIGA_MAC_VER_12 = 0x0c, // 8168Be RTL_GIGA_MAC_VER_13 = 0x0d, // 8101Eb @@ -137,6 +141,10 @@ _R("RTL8169sb/8110sb", RTL_GIGA_MAC_VER_04, 0xff7e1880), // 8169SB _R("RTL8169sc/8110sc", RTL_GIGA_MAC_VER_05, 0xff7e1880), // 8110SCd _R("RTL8169sc/8110sc", RTL_GIGA_MAC_VER_06, 0xff7e1880), // 8110SCe + _R("RTL8102e", RTL_GIGA_MAC_VER_07, 0xff7e1880), // PCI-E + _R("RTL8102e", RTL_GIGA_MAC_VER_08, 0xff7e1880), // PCI-E + _R("RTL8102e", RTL_GIGA_MAC_VER_09, 0xff7e1880), // PCI-E + _R("RTL8101e", RTL_GIGA_MAC_VER_10, 0xff7e1880), // PCI-E _R("RTL8168b/8111b", RTL_GIGA_MAC_VER_11, 0xff7e1880), // PCI-E _R("RTL8168b/8111b", RTL_GIGA_MAC_VER_12, 0xff7e1880), // PCI-E _R("RTL8101e", RTL_GIGA_MAC_VER_13, 0xff7e1880), // PCI-E 8139 @@ -178,7 +186,12 @@ MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl); -static int rx_copybreak = 200; +/* + * we set our copybreak very high so that we don't have + * to allocate 16k frames all the time (see note in + * rtl8169_open() + */ +static int rx_copybreak = 16383; static int use_dac; static struct { u32 msg_enable; @@ -212,9 +225,6 @@ Config5 = 0x56, MultiIntr = 0x5c, PHYAR = 0x60, - TBICSR = 0x64, - TBI_ANAR = 0x68, - TBI_LPAR = 0x6a, PHYstatus = 0x6c, RxMaxSize = 0xda, CPlusCmd = 0xe0, @@ -228,6 +238,32 @@ FuncForceEvent = 0xfc, }; +enum rtl8110_registers { + TBICSR = 0x64, + TBI_ANAR = 0x68, + TBI_LPAR = 0x6a, +}; + +enum rtl8168_8101_registers { + CSIDR = 0x64, + CSIAR = 0x68, +#define CSIAR_FLAG 0x80000000 +#define CSIAR_WRITE_CMD 0x80000000 +#define CSIAR_BYTE_ENABLE 0x0f +#define CSIAR_BYTE_ENABLE_SHIFT 12 +#define CSIAR_ADDR_MASK 0x0fff + + EPHYAR = 0x80, +#define EPHYAR_FLAG 0x80000000 +#define EPHYAR_WRITE_CMD 0x80000000 +#define EPHYAR_REG_MASK 0x1f +#define EPHYAR_REG_SHIFT 16 +#define EPHYAR_DATA_MASK 0xffff + DBG_REG = 0xd1, +#define FIX_NAK_1 (1 << 4) +#define FIX_NAK_2 (1 << 3) +}; + enum rtl_register_content { /* InterruptStatusBits */ SYSErr = 0x8000, @@ -281,7 +317,13 @@ TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */ /* Config1 register p.24 */ + LEDS1 = (1 << 7), + LEDS0 = (1 << 6), MSIEnable = (1 << 5), /* Enable Message Signaled Interrupt */ + Speed_down = (1 << 4), + MEMMAP = (1 << 3), + IOMAP = (1 << 2), + VPD = (1 << 1), PMEnable = (1 << 0), /* Power Management Enable */ /* Config2 register p. 25 */ @@ -291,6 +333,7 @@ /* Config3 register p.25 */ MagicPacket = (1 << 5), /* Wake up when receives a Magic Packet */ LinkUp = (1 << 4), /* Wake up when the cable connection is re-established */ + Beacon_en = (1 << 0), /* 8168 only. Reserved in the 8168b */ /* Config5 register p.27 */ BWF = (1 << 6), /* Accept Broadcast wakeup frame */ @@ -308,7 +351,16 @@ TBINwComplete = 0x01000000, /* CPlusCmd p.31 */ - PktCntrDisable = (1 << 7), // 8168 + EnableBist = (1 << 15), // 8168 8101 + Mac_dbgo_oe = (1 << 14), // 8168 8101 + Normal_mode = (1 << 13), // unused + Force_half_dup = (1 << 12), // 8168 8101 + Force_rxflow_en = (1 << 11), // 8168 8101 + Force_txflow_en = (1 << 10), // 8168 8101 + Cxpl_dbg_sel = (1 << 9), // 8168 8101 + ASF = (1 << 8), // 8168 8101 + PktCntrDisable = (1 << 7), // 8168 8101 + Mac_dbgo_sel = 0x001c, // 8168 RxVlan = (1 << 6), RxChkSum = (1 << 5), PCIDAC = (1 << 4), @@ -429,6 +481,7 @@ void (*hw_start)(struct net_device *); unsigned int (*phy_reset_pending)(void __iomem *); unsigned int (*link_ok)(void __iomem *); + int pcie_cap; struct delayed_work task; unsigned features; }; @@ -503,6 +556,77 @@ return value; } +static void mdio_patch(void __iomem *ioaddr, int reg_addr, int value) +{ + mdio_write(ioaddr, reg_addr, mdio_read(ioaddr, reg_addr) | value); +} + +static void rtl_ephy_write(void __iomem *ioaddr, int reg_addr, int value) +{ + unsigned int i; + + RTL_W32(EPHYAR, EPHYAR_WRITE_CMD | (value & EPHYAR_DATA_MASK) | + (reg_addr & EPHYAR_REG_MASK) << EPHYAR_REG_SHIFT); + + for (i = 0; i < 100; i++) { + if (!(RTL_R32(EPHYAR) & EPHYAR_FLAG)) + break; + udelay(10); + } +} + +static u16 rtl_ephy_read(void __iomem *ioaddr, int reg_addr) +{ + u16 value = 0xffff; + unsigned int i; + + RTL_W32(EPHYAR, (reg_addr & EPHYAR_REG_MASK) << EPHYAR_REG_SHIFT); + + for (i = 0; i < 100; i++) { + if (RTL_R32(EPHYAR) & EPHYAR_FLAG) { + value = RTL_R32(EPHYAR) & EPHYAR_DATA_MASK; + break; + } + udelay(10); + } + + return value; +} + +static void rtl_csi_write(void __iomem *ioaddr, int addr, int value) +{ + unsigned int i; + + RTL_W32(CSIDR, value); + RTL_W32(CSIAR, CSIAR_WRITE_CMD | (addr & CSIAR_ADDR_MASK) | + CSIAR_BYTE_ENABLE << CSIAR_BYTE_ENABLE_SHIFT); + + for (i = 0; i < 100; i++) { + if (!(RTL_R32(CSIAR) & CSIAR_FLAG)) + break; + udelay(10); + } +} + +static u32 rtl_csi_read(void __iomem *ioaddr, int addr) +{ + u32 value = ~0x00; + unsigned int i; + + RTL_W32(CSIAR, (addr & CSIAR_ADDR_MASK) | + CSIAR_BYTE_ENABLE << CSIAR_BYTE_ENABLE_SHIFT); + + for (i = 0; i < 100; i++) { + if (RTL_R32(CSIAR) & CSIAR_FLAG) { + value = RTL_R32(CSIDR); + break; + } + udelay(10); + } + + return value; +} + static void rtl8169_irq_mask_and_ack(void __iomem *ioaddr) { RTL_W16(IntrMask, 0x0000); @@ -726,8 +850,12 @@ } } - /* The 8100e/8101e do Fast Ethernet only. */ - if ((tp->mac_version == RTL_GIGA_MAC_VER_13) || + /* The 8100e/8101e/8102e do Fast Ethernet only. */ + if ((tp->mac_version == RTL_GIGA_MAC_VER_07) || + (tp->mac_version == RTL_GIGA_MAC_VER_08) || + (tp->mac_version == RTL_GIGA_MAC_VER_09) || + (tp->mac_version == RTL_GIGA_MAC_VER_10) || + (tp->mac_version == RTL_GIGA_MAC_VER_13) || (tp->mac_version == RTL_GIGA_MAC_VER_14) || (tp->mac_version == RTL_GIGA_MAC_VER_15) || (tp->mac_version == RTL_GIGA_MAC_VER_16)) { @@ -1136,9 +1264,22 @@ { 0x7c800000, 0x30000000, RTL_GIGA_MAC_VER_11 }, /* 8101 family. */ + { 0x7cf00000, 0x34a00000, RTL_GIGA_MAC_VER_09 }, + { 0x7cf00000, 0x24a00000, RTL_GIGA_MAC_VER_09 }, + { 0x7cf00000, 0x34900000, RTL_GIGA_MAC_VER_08 }, + { 0x7cf00000, 0x24900000, RTL_GIGA_MAC_VER_08 }, + { 0x7cf00000, 0x34800000, RTL_GIGA_MAC_VER_07 }, + { 0x7cf00000, 0x24800000, RTL_GIGA_MAC_VER_07 }, { 0x7cf00000, 0x34000000, RTL_GIGA_MAC_VER_13 }, + { 0x7cf00000, 0x34300000, RTL_GIGA_MAC_VER_10 }, { 0x7cf00000, 0x34200000, RTL_GIGA_MAC_VER_16 }, + { 0x7c800000, 0x34800000, RTL_GIGA_MAC_VER_09 }, + { 0x7c800000, 0x24800000, RTL_GIGA_MAC_VER_09 }, { 0x7c800000, 0x34000000, RTL_GIGA_MAC_VER_16 }, + /* 8102EL */ + { 0x7c800000, 0x24800000, RTL_GIGA_MAC_VER_16 }, + /* 8102E */ + { 0x7c800000, 0x34800000, RTL_GIGA_MAC_VER_16 }, /* FIXME: where did these entries come from ? -- FR */ { 0xfc800000, 0x38800000, RTL_GIGA_MAC_VER_15 }, { 0xfc800000, 0x30800000, RTL_GIGA_MAC_VER_14 }, @@ -1299,6 +1440,37 @@ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); } +static void rtl8101_hw_phy_config(void __iomem *ioaddr) +{ + struct phy_reg phy_reg_init[] = { + { 0x1f, 0x0000 }, + { 0x11, mdio_read(ioaddr,0x11) | 0x1000 }, + { 0x19, mdio_read(ioaddr,0x19) | 0x2000 }, + { 0x1f, 0x0003 }, + { 0x08, 0x441D }, + { 0x01, 0x9100 }, + { 0x1f, 0x0000 } + }; + + rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); +} + +static void rtl8102e_hw_phy_config(void __iomem *ioaddr) +{ + struct phy_reg phy_reg_init[] = { + { 0x1f, 0x0003 }, + { 0x08, 0x441d }, + { 0x01, 0x9100 }, + { 0x1f, 0x0000 } + }; + + mdio_write(ioaddr, 0x1f, 0x0000); + mdio_patch(ioaddr, 0x11, 1 << 12); + mdio_patch(ioaddr, 0x19, 1 << 13); + + rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); +} + static void rtl_hw_phy_config(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); @@ -1316,6 +1488,14 @@ case RTL_GIGA_MAC_VER_04: rtl8169sb_hw_phy_config(ioaddr); break; + case RTL_GIGA_MAC_VER_07: + case RTL_GIGA_MAC_VER_08: + case RTL_GIGA_MAC_VER_09: + rtl8102e_hw_phy_config(ioaddr); + break; + case RTL_GIGA_MAC_VER_13: + case RTL_GIGA_MAC_VER_16: + rtl8101_hw_phy_config(ioaddr); case RTL_GIGA_MAC_VER_18: rtl8168cp_hw_phy_config(ioaddr); break; @@ -1438,8 +1618,10 @@ rtl_hw_phy_config(dev); - dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); - RTL_W8(0x82, 0x01); + if (tp->mac_version <= RTL_GIGA_MAC_VER_06) { + dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); + RTL_W8(0x82, 0x01); + } pci_write_config_byte(tp->pci_dev, PCI_LATENCY_TIMER, 0x40); @@ -1617,6 +1799,7 @@ SET_NETDEV_DEV(dev, &pdev->dev); tp = netdev_priv(dev); tp->dev = dev; + tp->pci_dev = pdev; tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT); /* enable device (incl. PCI PM wakeup and hotplug setup) */ @@ -1687,6 +1870,10 @@ goto err_out_free_res_4; } + tp->pcie_cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); + if (!tp->pcie_cap && netif_msg_probe(tp)) + dev_info(&pdev->dev, "no PCI Express capability\n"); + /* Unneeded ? Don't mess with Mrs. Murphy. */ rtl8169_irq_mask_and_ack(ioaddr); @@ -1776,8 +1963,14 @@ dev->poll_controller = rtl8169_netpoll; #endif + /* Ubuntu temporary workaround for bug #76489, disable + * NETIF_F_TSO by default for RTL8111/8168B chipsets. + * People can re-enable if required */ + if (tp->mac_version == RTL_GIGA_MAC_VER_11 + || tp->mac_version == RTL_GIGA_MAC_VER_12) + dev->features &= ~NETIF_F_TSO; + tp->intr_mask = 0xffff; - tp->pci_dev = pdev; tp->mmio_addr = ioaddr; tp->align = cfg->align; tp->hw_start = cfg->hw_start; @@ -1843,11 +2036,15 @@ } static void rtl8169_set_rxbufsize(struct rtl8169_private *tp, - struct net_device *dev) + unsigned int mtu) { - unsigned int mtu = dev->mtu; + unsigned int max_frame = mtu + VLAN_ETH_HLEN + ETH_FCS_LEN; - tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE; + if (max_frame != 16383) + printk(KERN_WARNING "WARNING! Changing of MTU on this NIC" + "May lead to frame reception errors!\n"); + + tp->rx_buf_sz = (max_frame > RX_BUF_SIZE) ? max_frame : RX_BUF_SIZE; } static int rtl8169_open(struct net_device *dev) @@ -1857,7 +2054,17 @@ int retval = -ENOMEM; - rtl8169_set_rxbufsize(tp, dev); + /* + * Note that we use a magic value here, its wierd I know + * its done because, some subset of rtl8169 hardware suffers from + * a problem in which frames received that are longer than + * the size set in RxMaxSize register return garbage sizes + * when received. To avoid this we need to turn off filtering, + * which is done by setting a value of 16383 in the RxMaxSize register + * and allocating 16k frames to handle the largest possible rx value + * thats what the magic math below does. + */ + rtl8169_set_rxbufsize(tp, 16383 - VLAN_ETH_HLEN - ETH_FCS_LEN); /* * Rx and Tx desscriptors needs 256 bytes alignment. @@ -1980,10 +2187,10 @@ return cmd; } -static void rtl_set_rx_max_size(void __iomem *ioaddr) +static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) { /* Low hurts. Let's disable the filtering. */ - RTL_W16(RxMaxSize, 16383); + RTL_W16(RxMaxSize, rx_buf_sz); } static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) @@ -2030,7 +2237,7 @@ RTL_W8(EarlyTxThres, EarlyTxThld); - rtl_set_rx_max_size(ioaddr); + rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz); if ((tp->mac_version == RTL_GIGA_MAC_VER_01) || (tp->mac_version == RTL_GIGA_MAC_VER_02) || @@ -2083,18 +2290,57 @@ RTL_W16(IntrMask, tp->intr_event); } +static void rtl_tx_performance_tweak(struct pci_dev *pdev, u16 force) +{ + struct net_device *dev = pci_get_drvdata(pdev); + struct rtl8169_private *tp = netdev_priv(dev); + int cap = tp->pcie_cap; + + if (cap) { + u16 ctl; + + pci_read_config_word(pdev, cap + PCI_EXP_DEVCTL, &ctl); + ctl = (ctl & ~PCI_EXP_DEVCTL_READRQ) | force; + pci_write_config_word(pdev, cap + PCI_EXP_DEVCTL, ctl); + } +} + +static void rtl_csi_access_enable(void __iomem *ioaddr) +{ + u32 csi; + + csi = rtl_csi_read(ioaddr, 0x070c) & 0x00ffffff; + rtl_csi_write(ioaddr, 0x070c, csi | 0x27000000); +} + +struct ephy_info { + unsigned int offset; + u16 mask; + u16 bits; +}; + +static void rtl_ephy_init(void __iomem *ioaddr, struct ephy_info *e, int len) +{ + u16 w; + + while (len-- > 0) { + w = (rtl_ephy_read(ioaddr, e->offset) & ~e->mask) | e->bits; + rtl_ephy_write(ioaddr, e->offset, w); + e++; + } +} + static void rtl_hw_start_8168(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; struct pci_dev *pdev = tp->pci_dev; - u8 ctl; RTL_W8(Cfg9346, Cfg9346_Unlock); RTL_W8(EarlyTxThres, EarlyTxThld); - rtl_set_rx_max_size(ioaddr); + rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz); rtl_set_rx_tx_config_registers(tp); @@ -2102,10 +2348,7 @@ RTL_W16(CPlusCmd, tp->cp_cmd); - /* Tx performance tweak. */ - pci_read_config_byte(pdev, 0x69, &ctl); - ctl = (ctl & ~0x70) | 0x50; - pci_write_config_byte(pdev, 0x69, ctl); + rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT); RTL_W16(IntrMitigate, 0x5151); @@ -2121,8 +2364,6 @@ RTL_R8(IntrMask); - RTL_W32(RxMissed, 0); - rtl_set_rx_mode(dev); RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); @@ -2132,6 +2373,70 @@ RTL_W16(IntrMask, tp->intr_event); } +#define R810X_CPCMD_QUIRK_MASK (\ + EnableBist | \ + Mac_dbgo_oe | \ + Force_half_dup | \ + Force_half_dup | \ + Force_txflow_en | \ + Cxpl_dbg_sel | \ + ASF | \ + PktCntrDisable | \ + PCIDAC | \ + PCIMulRW) + +static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) +{ + static struct ephy_info e_info_8102e_1[] = { + { 0x01, 0, 0x6e65 }, + { 0x02, 0, 0x091f }, + { 0x03, 0, 0xc2f9 }, + { 0x06, 0, 0xafb5 }, + { 0x07, 0, 0x0e00 }, + { 0x19, 0, 0xec80 }, + { 0x01, 0, 0x2e65 }, + { 0x01, 0, 0x6e65 } + }; + u8 cfg1; + + rtl_csi_access_enable(ioaddr); + + RTL_W8(DBG_REG, FIX_NAK_1); + + rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT); + + RTL_W8(Config1, + LEDS1 | LEDS0 | Speed_down | MEMMAP | IOMAP | VPD | PMEnable); + RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en); + + cfg1 = RTL_R8(Config1); + if ((cfg1 & LEDS0) && (cfg1 & LEDS1)) + RTL_W8(Config1, cfg1 & ~LEDS0); + + RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK); + + rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1)); +} + +static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev) +{ + rtl_csi_access_enable(ioaddr); + + rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT); + + RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable); + RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en); + + RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK); +} + +static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev) +{ + rtl_hw_start_8102e_2(ioaddr, pdev); + + rtl_ephy_write(ioaddr, 0x03, 0xc2f9); +} + static void rtl_hw_start_8101(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); @@ -2140,15 +2445,33 @@ if ((tp->mac_version == RTL_GIGA_MAC_VER_13) || (tp->mac_version == RTL_GIGA_MAC_VER_16)) { - pci_write_config_word(pdev, 0x68, 0x00); - pci_write_config_word(pdev, 0x69, 0x08); + int cap = tp->pcie_cap; + + if (cap) { + pci_write_config_word(pdev, cap + PCI_EXP_DEVCTL, + PCI_EXP_DEVCTL_NOSNOOP_EN); + } + } + + switch (tp->mac_version) { + case RTL_GIGA_MAC_VER_07: + rtl_hw_start_8102e_1(ioaddr, pdev); + break; + + case RTL_GIGA_MAC_VER_08: + rtl_hw_start_8102e_3(ioaddr, pdev); + break; + + case RTL_GIGA_MAC_VER_09: + rtl_hw_start_8102e_2(ioaddr, pdev); + break; } RTL_W8(Cfg9346, Cfg9346_Unlock); RTL_W8(EarlyTxThres, EarlyTxThld); - rtl_set_rx_max_size(ioaddr); + rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz); tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; @@ -2165,8 +2488,6 @@ RTL_R8(IntrMask); - RTL_W32(RxMissed, 0); - rtl_set_rx_mode(dev); RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); @@ -2191,7 +2512,7 @@ rtl8169_down(dev); - rtl8169_set_rxbufsize(tp, dev); + rtl8169_set_rxbufsize(tp, dev->mtu); ret = rtl8169_init_ring(dev); if (ret < 0) @@ -2564,13 +2885,6 @@ opts1 |= FirstFrag; } else { len = skb->len; - - if (unlikely(len < ETH_ZLEN)) { - if (skb_padto(skb, ETH_ZLEN)) - goto err_update_stats; - len = ETH_ZLEN; - } - opts1 |= FirstFrag | LastFrag; tp->tx_skb[entry].skb = skb; } @@ -2608,7 +2922,6 @@ err_stop: netif_stop_queue(dev); ret = NETDEV_TX_BUSY; -err_update_stats: dev->stats.tx_dropped++; goto out; } @@ -2820,7 +3133,7 @@ pkt_size, PCI_DMA_FROMDEVICE); rtl8169_mark_to_asic(desc, tp->rx_buf_sz); } else { - pci_unmap_single(pdev, addr, pkt_size, + pci_unmap_single(pdev, addr, tp->rx_buf_sz, PCI_DMA_FROMDEVICE); tp->Rx_skbuff[entry] = NULL; } @@ -2977,6 +3290,17 @@ } #endif +static void rtl8169_rx_missed(struct net_device *dev, void __iomem *ioaddr) +{ + struct rtl8169_private *tp = netdev_priv(dev); + + if (tp->mac_version > RTL_GIGA_MAC_VER_06) + return; + + dev->stats.rx_missed_errors += (RTL_R32(RxMissed) & 0xffffff); + RTL_W32(RxMissed, 0); +} + static void rtl8169_down(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); @@ -2996,9 +3320,7 @@ rtl8169_asic_down(ioaddr); - /* Update the error counts. */ - dev->stats.rx_missed_errors += RTL_R32(RxMissed); - RTL_W32(RxMissed, 0); + rtl8169_rx_missed(dev, ioaddr); spin_unlock_irq(&tp->lock); @@ -3124,8 +3446,7 @@ if (netif_running(dev)) { spin_lock_irqsave(&tp->lock, flags); - dev->stats.rx_missed_errors += RTL_R32(RxMissed); - RTL_W32(RxMissed, 0); + rtl8169_rx_missed(dev, ioaddr); spin_unlock_irqrestore(&tp->lock, flags); } @@ -3150,8 +3471,7 @@ rtl8169_asic_down(ioaddr); - dev->stats.rx_missed_errors += RTL_R32(RxMissed); - RTL_W32(RxMissed, 0); + rtl8169_rx_missed(dev, ioaddr); spin_unlock_irq(&tp->lock); --- linux-2.6.24.orig/drivers/net/slip.c +++ linux-2.6.24/drivers/net/slip.c @@ -463,9 +463,14 @@ /* 20 sec timeout not reached */ goto out; } - printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, - (sl->tty->driver->chars_in_buffer(sl->tty) || sl->xleft) ? - "bad line quality" : "driver error"); + { + int cib = 0; + if (sl->tty->driver->chars_in_buffer) + cib = sl->tty->driver->chars_in_buffer(sl->tty); + printk(KERN_WARNING "%s: transmit timed out, %s?\n", + dev->name, (cib || sl->xleft) ? + "bad line quality" : "driver error"); + } sl->xleft = 0; sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); sl_unlock(sl); @@ -834,6 +839,8 @@ if(!capable(CAP_NET_ADMIN)) return -EPERM; + if (!tty->driver->write) + return -EOPNOTSUPP; /* RTnetlink lock is misused here to serialize concurrent opens of slip channels. There are better ways, but it is --- linux-2.6.24.orig/drivers/net/ppp_async.c +++ linux-2.6.24/drivers/net/ppp_async.c @@ -158,6 +158,9 @@ struct asyncppp *ap; int err; + if (!tty->driver->write) + return -EOPNOTSUPP; + err = -ENOMEM; ap = kzalloc(sizeof(*ap), GFP_KERNEL); if (!ap) --- linux-2.6.24.orig/drivers/net/ppp_synctty.c +++ linux-2.6.24/drivers/net/ppp_synctty.c @@ -207,6 +207,9 @@ struct syncppp *ap; int err; + if (!tty->driver->write) + return -EOPNOTSUPP; + ap = kzalloc(sizeof(*ap), GFP_KERNEL); err = -ENOMEM; if (!ap) --- linux-2.6.24.orig/drivers/net/bonding/bond_main.c +++ linux-2.6.24/drivers/net/bonding/bond_main.c @@ -4883,14 +4883,16 @@ down_write(&bonding_rwsem); /* Check to see if the bond already exists. */ - list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) - if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) { - printk(KERN_ERR DRV_NAME + if (name) { + list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) + if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) { + printk(KERN_ERR DRV_NAME ": cannot add bond %s; it already exists\n", - name); - res = -EPERM; - goto out_rtnl; - } + name); + res = -EPERM; + goto out_rtnl; + } + } bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", ether_setup); --- linux-2.6.24.orig/drivers/net/cxgb3/t3_hw.c +++ linux-2.6.24/drivers/net/cxgb3/t3_hw.c @@ -1730,7 +1730,6 @@ MC7_INTR_MASK}, {A_MC5_DB_INT_ENABLE, MC5_INTR_MASK}, {A_ULPRX_INT_ENABLE, ULPRX_INTR_MASK}, - {A_TP_INT_ENABLE, 0x3bfffff}, {A_PM1_TX_INT_ENABLE, PMTX_INTR_MASK}, {A_PM1_RX_INT_ENABLE, PMRX_INTR_MASK}, {A_CIM_HOST_INT_ENABLE, CIM_INTR_MASK}, @@ -1740,6 +1739,8 @@ adapter->slow_intr_mask = PL_INTR_MASK; t3_write_regs(adapter, intr_en_avp, ARRAY_SIZE(intr_en_avp), 0); + t3_write_reg(adapter, A_TP_INT_ENABLE, + adapter->params.rev >= T3_REV_C ? 0x2bfffff : 0x3bfffff); if (adapter->params.rev > 0) { t3_write_reg(adapter, A_CPL_INTR_ENABLE, --- linux-2.6.24.orig/drivers/net/cxgb3/cxgb3_main.c +++ linux-2.6.24/drivers/net/cxgb3/cxgb3_main.c @@ -1801,6 +1801,8 @@ case CHELSIO_GET_QSET_NUM:{ struct ch_reg edata; + memset(&edata, 0, sizeof(struct ch_reg)); + edata.cmd = CHELSIO_GET_QSET_NUM; edata.val = pi->nqsets; if (copy_to_user(useraddr, &edata, sizeof(edata))) --- linux-2.6.24.orig/drivers/net/hamradio/6pack.c +++ linux-2.6.24/drivers/net/hamradio/6pack.c @@ -601,6 +601,8 @@ if (!capable(CAP_NET_ADMIN)) return -EPERM; + if (!tty->driver->write) + return -EOPNOTSUPP; dev = alloc_netdev(sizeof(struct sixpack), "sp%d", sp_setup); if (!dev) { --- linux-2.6.24.orig/drivers/net/hamradio/mkiss.c +++ linux-2.6.24/drivers/net/hamradio/mkiss.c @@ -530,6 +530,7 @@ static int ax_xmit(struct sk_buff *skb, struct net_device *dev) { struct mkiss *ax = netdev_priv(dev); + int cib = 0; if (!netif_running(dev)) { printk(KERN_ERR "mkiss: %s: xmit call when iface is down\n", dev->name); @@ -545,10 +546,11 @@ /* 20 sec timeout not reached */ return 1; } + if (ax->tty->driver->chars_in_buffer) + cib = ax->tty->driver->chars_in_buffer(ax->tty); printk(KERN_ERR "mkiss: %s: transmit timed out, %s?\n", dev->name, - (ax->tty->driver->chars_in_buffer(ax->tty) || ax->xleft) ? - "bad line quality" : "driver error"); + cib || ax->xleft ? "bad line quality" : "driver error"); ax->xleft = 0; clear_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags); @@ -737,6 +739,8 @@ if (!capable(CAP_NET_ADMIN)) return -EPERM; + if (!tty->driver->write) + return -EOPNOTSUPP; dev = alloc_netdev(sizeof(struct mkiss), "ax%d", ax_setup); if (!dev) { --- linux-2.6.24.orig/drivers/net/appletalk/ipddp.c +++ linux-2.6.24/drivers/net/appletalk/ipddp.c @@ -173,8 +173,7 @@ ((struct net_device_stats *) dev->priv)->tx_packets++; ((struct net_device_stats *) dev->priv)->tx_bytes+=skb->len; - if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0) - dev_kfree_skb(skb); + aarp_send_ddp(rt->dev, skb, &rt->at, NULL); return 0; } --- linux-2.6.24.orig/drivers/net/irda/irtty-sir.c +++ linux-2.6.24/drivers/net/irda/irtty-sir.c @@ -64,7 +64,9 @@ IRDA_ASSERT(priv != NULL, return -1;); IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -1;); - return priv->tty->driver->chars_in_buffer(priv->tty); + if (priv->tty->driver->chars_in_buffer) + return priv->tty->driver->chars_in_buffer(priv->tty); + return 0; } /* Wait (sleep) until underlaying hardware finished transmission --- linux-2.6.24.orig/drivers/net/irda/nsc-ircc.c +++ linux-2.6.24/drivers/net/irda/nsc-ircc.c @@ -149,7 +149,7 @@ static chipio_t pnp_info; static const struct pnp_device_id nsc_ircc_pnp_table[] = { { .id = "NSC6001", .driver_data = 0 }, - { .id = "IBM0071", .driver_data = 0 }, + { .id = "IBM0071", .driver_data = 1 }, { } }; @@ -928,6 +928,9 @@ * On my box, cfg_base is in the PnP descriptor of the * motherboard. Oh well... Jean II */ + if (id->driver_data == 1) + dongle_id = 0x9; + if (pnp_port_valid(dev, 0) && !(pnp_port_flags(dev, 0) & IORESOURCE_DISABLED)) pnp_info.fir_base = pnp_port_start(dev, 0); --- linux-2.6.24.orig/drivers/net/pcmcia/smc91c92_cs.c +++ linux-2.6.24/drivers/net/pcmcia/smc91c92_cs.c @@ -559,8 +559,16 @@ /* Read the station address from the CIS. It is stored as the last (fourth) string in the Version 1 Version/ID tuple. */ - if (link->prod_id[3]) { - station_addr = link->prod_id[3]; + tuple->DesiredTuple = CISTPL_VERS_1; + if (first_tuple(link, tuple, parse) != CS_SUCCESS) { + rc = -1; + goto free_cfg_mem; + } + /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */ + if (next_tuple(link, tuple, parse) != CS_SUCCESS) + first_tuple(link, tuple, parse); + if (parse->version_1.ns > 3) { + station_addr = parse->version_1.str + parse->version_1.ofs[3]; if (cvt_ascii_address(dev, station_addr) == 0) { rc = 0; goto free_cfg_mem; --- linux-2.6.24.orig/drivers/net/e1000/e1000_main.c +++ linux-2.6.24/drivers/net/e1000/e1000_main.c @@ -218,6 +218,10 @@ MODULE_PARM_DESC(copybreak, "Maximum size of packet that is copied to a new buffer on receive"); +static int eeprom_bad_csum_allow __read_mostly = 0; +module_param(eeprom_bad_csum_allow, int, 0); +MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad EEPROM checksums"); + static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state); static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev); @@ -1001,16 +1005,19 @@ goto err_eeprom; } - /* before reading the EEPROM, reset the controller to - * put the device in a known good starting state */ + if (e1000_validate_eeprom_checksum(&adapter->hw) < 0) { + /* before reading the EEPROM, reset the controller to + * put the device in a known good starting state */ - e1000_reset_hw(&adapter->hw); + e1000_reset_hw(&adapter->hw); - /* make sure the EEPROM is good */ + /* make sure the EEPROM is good */ - if (e1000_validate_eeprom_checksum(&adapter->hw) < 0) { - DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n"); - goto err_eeprom; + if (e1000_validate_eeprom_checksum(&adapter->hw) < 0) { + DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n"); + if (!eeprom_bad_csum_allow) + goto err_eeprom; + } } /* copy the MAC address out of the EEPROM */ @@ -1911,18 +1918,6 @@ rctl &= ~E1000_RCTL_SZ_4096; rctl |= E1000_RCTL_BSEX; switch (adapter->rx_buffer_len) { - case E1000_RXBUFFER_256: - rctl |= E1000_RCTL_SZ_256; - rctl &= ~E1000_RCTL_BSEX; - break; - case E1000_RXBUFFER_512: - rctl |= E1000_RCTL_SZ_512; - rctl &= ~E1000_RCTL_BSEX; - break; - case E1000_RXBUFFER_1024: - rctl |= E1000_RCTL_SZ_1024; - rctl &= ~E1000_RCTL_BSEX; - break; case E1000_RXBUFFER_2048: default: rctl |= E1000_RCTL_SZ_2048; @@ -3532,13 +3527,7 @@ * larger slab size * i.e. RXBUFFER_2048 --> size-4096 slab */ - if (max_frame <= E1000_RXBUFFER_256) - adapter->rx_buffer_len = E1000_RXBUFFER_256; - else if (max_frame <= E1000_RXBUFFER_512) - adapter->rx_buffer_len = E1000_RXBUFFER_512; - else if (max_frame <= E1000_RXBUFFER_1024) - adapter->rx_buffer_len = E1000_RXBUFFER_1024; - else if (max_frame <= E1000_RXBUFFER_2048) + if (max_frame <= E1000_RXBUFFER_2048) adapter->rx_buffer_len = E1000_RXBUFFER_2048; else if (max_frame <= E1000_RXBUFFER_4096) adapter->rx_buffer_len = E1000_RXBUFFER_4096; @@ -4173,13 +4162,23 @@ PCI_DMA_FROMDEVICE); length = le16_to_cpu(rx_desc->length); + /* !EOP means multiple descriptors were used to store a single + * packet, if thats the case we need to toss it. In fact, we + * to toss every packet with the EOP bit clear and the next + * frame that _does_ have the EOP bit set, as it is by + * definition only a frame fragment + */ + if (unlikely(!(status & E1000_RXD_STAT_EOP))) + adapter->discarding = true; - if (unlikely(!(status & E1000_RXD_STAT_EOP))) { + if (adapter->discarding) { /* All receives must fit into a single buffer */ E1000_DBG("%s: Receive packet consumed multiple" " buffers\n", netdev->name); /* recycle */ buffer_info->skb = skb; + if (status & E1000_RXD_STAT_EOP) + adapter->discarding = false; goto next_desc; } --- linux-2.6.24.orig/drivers/net/e1000/e1000.h +++ linux-2.6.24/drivers/net/e1000/e1000.h @@ -343,6 +343,8 @@ boolean_t quad_port_a; unsigned long flags; uint32_t eeprom_wol; + + bool discarding; }; enum e1000_state_t { --- linux-2.6.24.orig/drivers/net/wireless/orinoco_cs.c +++ linux-2.6.24/drivers/net/wireless/orinoco_cs.c @@ -11,6 +11,7 @@ */ #define DRIVER_NAME "orinoco_cs" +#define OVERLAP_DRIVER_NAME "orinoco_cs_overlap" #define PFX DRIVER_NAME ": " #include @@ -440,66 +441,93 @@ " (David Gibson , " "Pavel Roskin , et al)"; -static struct pcmcia_device_id orinoco_cs_ids[] = { +/* + * PCMCIA IDs that are also defined in hostap_cs. + */ +static struct pcmcia_device_id orinoco_overlap_cs_ids[] = { PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7100), /* SonicWALL Long Range Wireless Card */ PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300), /* Sohoware NCP110, Philips 802.11b */ - PCMCIA_DEVICE_MANF_CARD(0x0089, 0x0002), /* AnyPoint(TM) Wireless II PC Card */ PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), /* 3Com AirConnect PCI 777A */ PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000), /* PROXIM RangeLAN-DS/LAN PC CARD */ PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002), /* Compaq WL100 11 Mbps Wireless Adapter */ + PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), /* Samsung SWL2000-N 11Mb/s WLAN Card */ + PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), /* Linksys WPC11 Version 2.5 */ + PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), /* Linksys WPC11 Version 3 */ + PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0002), /* Compaq HNW-100 11 Mbps Wireless Adapter */ + PCMCIA_DEVICE_MANF_CARD(0x02aa, 0x0002), /* ASUS SpaceLink WL-100 */ + PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), /* Airvast WN-100 */ + PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), /* Safeway 802.11b, ZCOMAX AirRunner/XI-300 */ + PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), /* D-Link DCF660, Sandisk Connect SDWCFB-000 */ + + PCMCIA_DEVICE_PROD_ID12("INTERSIL", "HFA384x/IEEE", 0x74c5e40d, 0xdb472a18), + PCMCIA_DEVICE_PROD_ID12("Intersil", "PRISM 2_5 PCMCIA ADAPTER", 0x4b801a17, 0x6345a0bf), + + PCMCIA_DEVICE_PROD_ID123("Intersil", "PRISM Freedom PCMCIA Adapter", "ISL37100P", 0x4b801a17, 0xf222ec2d, 0x630d52b2), + + PCMCIA_DEVICE_PROD_ID12("Addtron", "AWP-100 Wireless PCMCIA", 0xe6ec52ce, 0x08649af2), + PCMCIA_DEVICE_PROD_ID12("D", "Link DRC-650 11Mbps WLAN Card", 0x71b18589, 0xf144e3ac), + PCMCIA_DEVICE_PROD_ID12("D", "Link DWL-650 11Mbps WLAN Card", 0x71b18589, 0xb6f1b0ab), + PCMCIA_DEVICE_PROD_ID123("Instant Wireless ", " Network PC CARD", "Version 01.02", 0x11d901af, 0x6e9bd926, 0x4b74baa0), + PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2532W-B EliteConnect Wireless Adapter", 0xc4f8b18b, 0x196bd757), + PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2632W", 0xc4f8b18b, 0x474a1f2a), + PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-PCM-L11G", 0x2decece3, 0xf57ca4b3), + PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-CF-S11G", 0x2decece3, 0x82067c18), + PCMCIA_DEVICE_PROD_ID12("Compaq", "WL200_11Mbps_Wireless_PCI_Card", 0x54f7c49c, 0x15a75e5b), + PCMCIA_DEVICE_PROD_ID12("INTERSIL", "I-GATE 11M PC Card / PC Card plus", 0x74c5e40d, 0x8304ff77), + PCMCIA_DEVICE_PROD_ID12("Linksys", "Wireless CompactFlash Card", 0x0733cc81, 0x0c52f395), + PCMCIA_DEVICE_PROD_ID12("ZoomAir 11Mbps High", "Rate wireless Networking", 0x273fe3db, 0x32a1eaee), + PCMCIA_DEVICE_PROD_ID12("Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio", 0x5cd01705, 0x4271660f), + + PCMCIA_DEVICE_NULL, +}; + +static struct pcmcia_driver orinoco_overlap_driver = { + .owner = THIS_MODULE, + .drv = { + .name = OVERLAP_DRIVER_NAME, + }, + .probe = orinoco_cs_probe, + .remove = orinoco_cs_detach, + .id_table = orinoco_overlap_cs_ids, + .suspend = orinoco_cs_suspend, + .resume = orinoco_cs_resume, +}; + +static struct pcmcia_device_id orinoco_cs_ids[] = { + PCMCIA_DEVICE_MANF_CARD(0x0089, 0x0002), /* AnyPoint(TM) Wireless II PC Card */ PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002), /* Lucent Orinoco and old Intersil */ PCMCIA_DEVICE_MANF_CARD(0x016b, 0x0001), /* Ericsson WLAN Card C11 */ PCMCIA_DEVICE_MANF_CARD(0x01eb, 0x080a), /* Nortel Networks eMobility 802.11 Wireless Adapter */ PCMCIA_DEVICE_MANF_CARD(0x01ff, 0x0008), /* Intermec MobileLAN 11Mbps 802.11b WLAN Card */ - PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), /* Samsung SWL2000-N 11Mb/s WLAN Card */ PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002), /* AirWay 802.11 Adapter (PCMCIA) */ PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0001), /* ARtem Onair */ PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0305), /* Buffalo WLI-PCM-S11 */ - PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), /* Linksys WPC11 Version 2.5 */ - PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), /* Linksys WPC11 Version 3 */ - PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0002), /* Compaq HNW-100 11 Mbps Wireless Adapter */ PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0673), /* Linksys WCF12 Wireless CompactFlash Card */ - PCMCIA_DEVICE_MANF_CARD(0x02aa, 0x0002), /* ASUS SpaceLink WL-100 */ PCMCIA_DEVICE_MANF_CARD(0x02ac, 0x0002), /* SpeedStream SS1021 Wireless Adapter */ PCMCIA_DEVICE_MANF_CARD(0x14ea, 0xb001), /* PLANEX RoadLannerWave GW-NS11H */ - PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), /* Airvast WN-100 */ PCMCIA_DEVICE_MANF_CARD(0x9005, 0x0021), /* Adaptec Ultra Wireless ANW-8030 */ PCMCIA_DEVICE_MANF_CARD(0xc001, 0x0008), /* CONTEC FLEXSCAN/FX-DDS110-PCC */ PCMCIA_DEVICE_MANF_CARD(0xc250, 0x0002), /* Conceptronic CON11Cpro, EMTAC A2424i */ - PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), /* Safeway 802.11b, ZCOMAX AirRunner/XI-300 */ - PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), /* D-Link DCF660, Sandisk Connect SDWCFB-000 */ + PCMCIA_DEVICE_PROD_ID12(" ", "IEEE 802.11 Wireless LAN/PC Card", 0x3b6e20c8, 0xefccafe9), PCMCIA_DEVICE_PROD_ID12("3Com", "3CRWE737A AirConnect Wireless LAN PC Card", 0x41240e5b, 0x56010af3), PCMCIA_DEVICE_PROD_ID12("ACTIONTEC", "PRISM Wireless LAN PC Card", 0x393089da, 0xa71e69d5), - PCMCIA_DEVICE_PROD_ID12("Addtron", "AWP-100 Wireless PCMCIA", 0xe6ec52ce, 0x08649af2), PCMCIA_DEVICE_PROD_ID123("AIRVAST", "IEEE 802.11b Wireless PCMCIA Card", "HFA3863", 0xea569531, 0x4bcb9645, 0x355cb092), - PCMCIA_DEVICE_PROD_ID12("Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio", 0x5cd01705, 0x4271660f), PCMCIA_DEVICE_PROD_ID12("ASUS", "802_11b_PC_CARD_25", 0x78fc06ee, 0xdb9aa842), PCMCIA_DEVICE_PROD_ID12("ASUS", "802_11B_CF_CARD_25", 0x78fc06ee, 0x45a50c1e), PCMCIA_DEVICE_PROD_ID12("Avaya Communication", "Avaya Wireless PC Card", 0xd8a43b78, 0x0d341169), PCMCIA_DEVICE_PROD_ID12("BENQ", "AWL100 PCMCIA ADAPTER", 0x35dadc74, 0x01f7fedb), - PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-PCM-L11G", 0x2decece3, 0xf57ca4b3), - PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-CF-S11G", 0x2decece3, 0x82067c18), PCMCIA_DEVICE_PROD_ID12("Cabletron", "RoamAbout 802.11 DS", 0x32d445f5, 0xedeffd90), - PCMCIA_DEVICE_PROD_ID12("Compaq", "WL200_11Mbps_Wireless_PCI_Card", 0x54f7c49c, 0x15a75e5b), PCMCIA_DEVICE_PROD_ID123("corega", "WL PCCL-11", "ISL37300P", 0x0a21501a, 0x59868926, 0xc9049a39), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "Wireless LAN PCC-11", 0x5261440f, 0xa6405584), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "Wireless LAN PCCA-11", 0x5261440f, 0xdf6115f9), PCMCIA_DEVICE_PROD_ID12("corega_K.K.", "Wireless_LAN_PCCB-11", 0x29e33311, 0xee7a27ae), - PCMCIA_DEVICE_PROD_ID12("D", "Link DRC-650 11Mbps WLAN Card", 0x71b18589, 0xf144e3ac), - PCMCIA_DEVICE_PROD_ID12("D", "Link DWL-650 11Mbps WLAN Card", 0x71b18589, 0xb6f1b0ab), PCMCIA_DEVICE_PROD_ID12("D-Link Corporation", "D-Link DWL-650H 11Mbps WLAN Adapter", 0xef544d24, 0xcd8ea916), PCMCIA_DEVICE_PROD_ID12("Digital Data Communications", "WPC-0100", 0xfdd73470, 0xe0b6f146), PCMCIA_DEVICE_PROD_ID12("ELSA", "AirLancer MC-11", 0x4507a33a, 0xef54f0e3), PCMCIA_DEVICE_PROD_ID12("HyperLink", "Wireless PC Card 11Mbps", 0x56cc3f1a, 0x0bcf220c), - PCMCIA_DEVICE_PROD_ID123("Instant Wireless ", " Network PC CARD", "Version 01.02", 0x11d901af, 0x6e9bd926, 0x4b74baa0), PCMCIA_DEVICE_PROD_ID12("Intel", "PRO/Wireless 2011 LAN PC Card", 0x816cc815, 0x07f58077), - PCMCIA_DEVICE_PROD_ID12("INTERSIL", "HFA384x/IEEE", 0x74c5e40d, 0xdb472a18), - PCMCIA_DEVICE_PROD_ID12("INTERSIL", "I-GATE 11M PC Card / PC Card plus", 0x74c5e40d, 0x8304ff77), - PCMCIA_DEVICE_PROD_ID12("Intersil", "PRISM 2_5 PCMCIA ADAPTER", 0x4b801a17, 0x6345a0bf), - PCMCIA_DEVICE_PROD_ID123("Intersil", "PRISM Freedom PCMCIA Adapter", "ISL37100P", 0x4b801a17, 0xf222ec2d, 0x630d52b2), PCMCIA_DEVICE_PROD_ID12("LeArtery", "SYNCBYAIR 11Mbps Wireless LAN PC Card", 0x7e3b326a, 0x49893e92), - PCMCIA_DEVICE_PROD_ID12("Linksys", "Wireless CompactFlash Card", 0x0733cc81, 0x0c52f395), PCMCIA_DEVICE_PROD_ID12("Lucent Technologies", "WaveLAN/IEEE", 0x23eb9949, 0xc562e72a), PCMCIA_DEVICE_PROD_ID12("MELCO", "WLI-PCM-L11", 0x481e0094, 0x7360e410), PCMCIA_DEVICE_PROD_ID12("MELCO", "WLI-PCM-L11G", 0x481e0094, 0xf57ca4b3), @@ -516,11 +544,8 @@ PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PC CARD HARMONY 80211B", 0xc6536a5e, 0x090c3cd9), PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PCI CARD HARMONY 80211B", 0xc6536a5e, 0x9f494e26), PCMCIA_DEVICE_PROD_ID12("SAMSUNG", "11Mbps WLAN Card", 0x43d74cb4, 0x579bd91b), - PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2532W-B EliteConnect Wireless Adapter", 0xc4f8b18b, 0x196bd757), - PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2632W", 0xc4f8b18b, 0x474a1f2a), PCMCIA_DEVICE_PROD_ID12("Symbol Technologies", "LA4111 Spectrum24 Wireless LAN PC Card", 0x3f02b4d6, 0x3663cb0e), PCMCIA_DEVICE_PROD_ID123("The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", 0xa5f472c2, 0x590eb502, 0xc9049a39), - PCMCIA_DEVICE_PROD_ID12("ZoomAir 11Mbps High", "Rate wireless Networking", 0x273fe3db, 0x32a1eaee), PCMCIA_DEVICE_NULL, }; MODULE_DEVICE_TABLE(pcmcia, orinoco_cs_ids); @@ -537,18 +562,39 @@ .resume = orinoco_cs_resume, }; +static int orinoco_driver_registered = 0; +static int orinoco_overlap_driver_registered = 0; + static int __init init_orinoco_cs(void) { + int status; + printk(KERN_DEBUG "%s\n", version); - return pcmcia_register_driver(&orinoco_driver); + status = pcmcia_register_driver(&orinoco_driver); + if (status >= 0) + orinoco_driver_registered = 1; + + status = pcmcia_register_driver(&orinoco_overlap_driver); + if (status >= 0) + orinoco_overlap_driver_registered = 1; + + return status; } static void __exit exit_orinoco_cs(void) { - pcmcia_unregister_driver(&orinoco_driver); + if (orinoco_overlap_driver_registered) { + pcmcia_unregister_driver(&orinoco_overlap_driver); + orinoco_overlap_driver_registered = 0; + } + + if (orinoco_driver_registered) { + pcmcia_unregister_driver(&orinoco_driver); + orinoco_driver_registered = 0; + } } module_init(init_orinoco_cs); --- linux-2.6.24.orig/drivers/net/wireless/strip.c +++ linux-2.6.24/drivers/net/wireless/strip.c @@ -802,7 +802,8 @@ struct ktermios old_termios = *(tty->termios); tty->termios->c_cflag &= ~CBAUD; /* Clear the old baud setting */ tty->termios->c_cflag |= baudcode; /* Set the new baud setting */ - tty->driver->set_termios(tty, &old_termios); + if (tty->driver->set_termios) + tty->driver->set_termios(tty, &old_termios); } /* --- linux-2.6.24.orig/drivers/net/wireless/ipw2200.c +++ linux-2.6.24/drivers/net/wireless/ipw2200.c @@ -8912,6 +8912,8 @@ range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; + range->scan_capa = IW_SCAN_CAPA_ESSID | IW_SCAN_CAPA_TYPE; + IPW_DEBUG_WX("GET Range\n"); return 0; } --- linux-2.6.24.orig/drivers/net/wireless/hostap/hostap_hw.c +++ linux-2.6.24/drivers/net/wireless/hostap/hostap_hw.c @@ -3434,6 +3434,7 @@ memset(&wrqu, 0, sizeof(wrqu)); wrqu.ap_addr.sa_family = ARPHRD_ETHER; wireless_send_event(local->dev, SIOCGIWAP, &wrqu, NULL); + wireless_send_event(local->ddev, SIOCGIWAP, &wrqu, NULL); /* Disable hardware and firmware */ prism2_hw_shutdown(dev, 0); --- linux-2.6.24.orig/drivers/net/wireless/hostap/hostap_ioctl.c +++ linux-2.6.24/drivers/net/wireless/hostap/hostap_ioctl.c @@ -1089,6 +1089,9 @@ range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; + if (local->sta_fw_ver >= PRISM2_FW_VER(1,3,1)) + range->scan_capa = IW_SCAN_CAPA_ESSID; + return 0; } --- linux-2.6.24.orig/drivers/net/wireless/hostap/hostap_info.c +++ linux-2.6.24/drivers/net/wireless/hostap/hostap_info.c @@ -238,6 +238,7 @@ wrqu.data.length = 0; wrqu.data.flags = 0; wireless_send_event(local->dev, SIOCGIWSCAN, &wrqu, NULL); + wireless_send_event(local->ddev, SIOCGIWSCAN, &wrqu, NULL); /* Allow SIOCGIWSCAN handling to occur since we have received * scanning result */ @@ -450,8 +451,10 @@ * frames and can confuse wpa_supplicant about the current association * status. */ - if (connected || local->prev_linkstatus_connected) + if (connected || local->prev_linkstatus_connected) { wireless_send_event(local->dev, SIOCGIWAP, &wrqu, NULL); + wireless_send_event(local->ddev, SIOCGIWAP, &wrqu, NULL); + } local->prev_linkstatus_connected = connected; } --- linux-2.6.24.orig/drivers/net/wireless/hostap/hostap_main.c +++ linux-2.6.24/drivers/net/wireless/hostap/hostap_main.c @@ -1106,6 +1106,7 @@ (u8 *) &reason, 2); memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); wireless_send_event(local->dev, SIOCGIWAP, &wrqu, NULL); + wireless_send_event(local->ddev, SIOCGIWAP, &wrqu, NULL); return ret; } --- linux-2.6.24.orig/drivers/net/wireless/b43/phy.c +++ linux-2.6.24/drivers/net/wireless/b43/phy.c @@ -933,7 +933,7 @@ for (i = 0; i < B43_TAB_SIGMASQR_SIZE; i++) b43_ofdmtab_write16(dev, 0x5000, i, b43_tab_sigmasqr1[i]); - else if ((phy->rev > 2) && (phy->rev <= 8)) + else if ((phy->rev > 2) && (phy->rev <= 9)) for (i = 0; i < B43_TAB_SIGMASQR_SIZE; i++) b43_ofdmtab_write16(dev, 0x5000, i, b43_tab_sigmasqr2[i]); --- linux-2.6.24.orig/drivers/net/wireless/b43/dma.c +++ linux-2.6.24/drivers/net/wireless/b43/dma.c @@ -165,7 +165,7 @@ addrhi = (((u64) dmaaddr >> 32) & ~SSB_DMA_TRANSLATION_MASK); addrext = (((u64) dmaaddr >> 32) & SSB_DMA_TRANSLATION_MASK) >> SSB_DMA_TRANSLATION_SHIFT; - addrhi |= ssb_dma_translation(ring->dev->dev); + addrhi |= (ssb_dma_translation(ring->dev->dev) << 1); if (slot == ring->nr_slots - 1) ctl0 |= B43_DMA64_DCTL0_DTABLEEND; if (start) @@ -426,9 +426,21 @@ static int alloc_ringmemory(struct b43_dmaring *ring) { struct device *dev = ring->dev->dev->dev; + gfp_t flags = GFP_KERNEL; + /* The specs call for 4K buffers for 30- and 32-bit DMA with 4K + * alignment and 8K buffers for 64-bit DMA with 8K alignment. Testing + * has shown that 4K is sufficient for the latter as long as the buffer + * does not cross an 8K boundary. + * + * For unknown reasons - possibly a hardware error - the BCM4311 rev + * 02, which uses 64-bit DMA, needs the ring buffer in very low memory, + * which accounts for the GFP_DMA flag below. + */ + if (ring->dma64) + flags |= GFP_DMA; ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE, - &(ring->dmabase), GFP_KERNEL); + &(ring->dmabase), flags); if (!ring->descbase) { b43err(ring->dev->wl, "DMA ringmemory allocation failed\n"); return -ENOMEM; @@ -483,7 +495,7 @@ return 0; } -/* Reset the RX DMA channel */ +/* Reset the TX DMA channel */ int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64) { int i; @@ -647,7 +659,7 @@ b43_dma_write(ring, B43_DMA64_TXRINGHI, ((ringbase >> 32) & ~SSB_DMA_TRANSLATION_MASK) - | trans); + | (trans << 1)); } else { u32 ringbase = (u32) (ring->dmabase); @@ -680,8 +692,9 @@ b43_dma_write(ring, B43_DMA64_RXRINGHI, ((ringbase >> 32) & ~SSB_DMA_TRANSLATION_MASK) - | trans); - b43_dma_write(ring, B43_DMA64_RXINDEX, 200); + | (trans << 1)); + b43_dma_write(ring, B43_DMA64_RXINDEX, ring->nr_slots * + sizeof(struct b43_dmadesc64)); } else { u32 ringbase = (u32) (ring->dmabase); @@ -695,11 +708,12 @@ b43_dma_write(ring, B43_DMA32_RXRING, (ringbase & ~SSB_DMA_TRANSLATION_MASK) | trans); - b43_dma_write(ring, B43_DMA32_RXINDEX, 200); + b43_dma_write(ring, B43_DMA32_RXINDEX, ring->nr_slots * + sizeof(struct b43_dmadesc32)); } } - out: +out: return err; } @@ -1411,7 +1425,7 @@ goto drop; } } - if (unlikely(len > ring->rx_buffersize)) { + if (unlikely(len + ring->frameoffset > ring->rx_buffersize)) { /* The data did not fit into one descriptor buffer * and is split over multiple buffers. * This should never happen, as we try to allocate buffers --- linux-2.6.24.orig/drivers/net/wireless/b43/main.c +++ linux-2.6.24/drivers/net/wireless/b43/main.c @@ -101,6 +101,9 @@ SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 7), SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 9), SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 10), + SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 11), + SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13), + SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 15), SSB_DEVTABLE_END }; @@ -3079,7 +3082,7 @@ unsupported = 1; break; case B43_PHYTYPE_G: - if (phy_rev > 8) + if (phy_rev > 9) unsupported = 1; break; default: @@ -3739,7 +3742,7 @@ have_gphy = 0; switch (dev->phy.type) { case B43_PHYTYPE_A: - have_aphy = 1; + have_aphy = 0; break; case B43_PHYTYPE_B: have_bphy = 1; @@ -3850,8 +3853,16 @@ return err; } +#define IS_PDEV(pdev, _vendor, _device, _subvendor, _subdevice) ( \ + (pdev->vendor == PCI_VENDOR_ID_##_vendor) && \ + (pdev->device == _device) && \ + (pdev->subsystem_vendor == PCI_VENDOR_ID_##_subvendor) && \ + (pdev->subsystem_device == _subdevice) ) + static void b43_sprom_fixup(struct ssb_bus *bus) { + struct pci_dev *pdev; + /* boardflags workarounds */ if (bus->boardinfo.vendor == SSB_BOARDVENDOR_DELL && bus->chip_id == 0x4301 && bus->boardinfo.rev == 0x74) @@ -3859,6 +3870,15 @@ if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40) bus->sprom.r1.boardflags_lo |= B43_BFL_PACTRL; + if (bus->bustype == SSB_BUSTYPE_PCI) { + pdev = bus->host_pci; + if (IS_PDEV(pdev, BROADCOM, 0x4318, ASUSTEK, 0x100F) || + IS_PDEV(pdev, BROADCOM, 0x4320, DELL, 0x0003) || + IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0015) || + IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0014) || + IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0013)) + bus->sprom.r1.boardflags_lo &= ~B43_BFL_BTCOEXIST; + } /* Handle case when gain is not set in sprom */ if (bus->sprom.r1.antenna_gain_a == 0xFF) --- linux-2.6.24.orig/drivers/net/wireless/b43/dma.h +++ linux-2.6.24/drivers/net/wireless/b43/dma.h @@ -167,7 +167,7 @@ /* DMA engine tuning knobs */ #define B43_TXRING_SLOTS 128 #define B43_RXRING_SLOTS 64 -#define B43_DMA0_RX_BUFFERSIZE (2304 + 100) +#define B43_DMA0_RX_BUFFERSIZE (B43_DMA0_RX_FRAMEOFFSET + IEEE80211_MAX_FRAME_LEN) #define B43_DMA3_RX_BUFFERSIZE 16 #ifdef CONFIG_B43_DMA --- linux-2.6.24.orig/drivers/net/wireless/libertas/scan.c +++ linux-2.6.24/drivers/net/wireless/libertas/scan.c @@ -1022,8 +1022,8 @@ switch (elem->id) { case MFIE_TYPE_SSID: - bss->ssid_len = elem->len; - memcpy(bss->ssid, elem->data, elem->len); + bss->ssid_len = min_t(int, 32, elem->len); + memcpy(bss->ssid, elem->data, bss->ssid_len); lbs_deb_scan("ssid '%s', ssid length %u\n", escape_essid(bss->ssid, bss->ssid_len), bss->ssid_len); --- linux-2.6.24.orig/drivers/net/wireless/b43legacy/main.c +++ linux-2.6.24/drivers/net/wireless/b43legacy/main.c @@ -1500,6 +1500,7 @@ } if (!fw->initvals) { switch (dev->phy.type) { + case B43legacy_PHYTYPE_B: case B43legacy_PHYTYPE_G: if ((rev >= 5) && (rev <= 10)) filename = "b0g0initvals5"; @@ -1517,6 +1518,7 @@ } if (!fw->initvals_band) { switch (dev->phy.type) { + case B43legacy_PHYTYPE_B: case B43legacy_PHYTYPE_G: if ((rev >= 5) && (rev <= 10)) filename = "b0g0bsinitvals5"; --- linux-2.6.24.orig/drivers/net/wireless/b43legacy/xmit.c +++ linux-2.6.24/drivers/net/wireless/b43legacy/xmit.c @@ -606,7 +606,7 @@ tmp = hw->count; status.frame_count = (tmp >> 4); status.rts_count = (tmp & 0x0F); - tmp = hw->flags; + tmp = hw->flags << 1; status.supp_reason = ((tmp & 0x1C) >> 2); status.pm_indicated = !!(tmp & 0x80); status.intermediate = !!(tmp & 0x40); --- linux-2.6.24.orig/drivers/net/wireless/b43legacy/leds.c +++ linux-2.6.24/drivers/net/wireless/b43legacy/leds.c @@ -256,7 +256,7 @@ continue; #endif /* CONFIG_B43LEGACY_DEBUG */ default: - B43legacy_BUG_ON(1); + break; }; if (led->activelow) --- linux-2.6.24.orig/drivers/net/wan/sbni.c +++ linux-2.6.24/drivers/net/wan/sbni.c @@ -1317,7 +1317,7 @@ break; case SIOCDEVRESINSTATS : - if( current->euid != 0 ) /* root only */ + if (!capable(CAP_NET_ADMIN)) return -EPERM; memset( &nl->in_stats, 0, sizeof(struct sbni_in_stats) ); break; @@ -1334,7 +1334,7 @@ break; case SIOCDEVSHWSTATE : - if( current->euid != 0 ) /* root only */ + if (!capable(CAP_NET_ADMIN)) return -EPERM; spin_lock( &nl->lock ); @@ -1355,7 +1355,7 @@ #ifdef CONFIG_SBNI_MULTILINE case SIOCDEVENSLAVE : - if( current->euid != 0 ) /* root only */ + if (!capable(CAP_NET_ADMIN)) return -EPERM; if (copy_from_user( slave_name, ifr->ifr_data, sizeof slave_name )) @@ -1370,7 +1370,7 @@ return enslave( dev, slave_dev ); case SIOCDEVEMANSIPATE : - if( current->euid != 0 ) /* root only */ + if (!capable(CAP_NET_ADMIN)) return -EPERM; return emancipate( dev ); --- linux-2.6.24.orig/drivers/net/wan/x25_asy.c +++ linux-2.6.24/drivers/net/wan/x25_asy.c @@ -283,6 +283,10 @@ static void x25_asy_timeout(struct net_device *dev) { struct x25_asy *sl = (struct x25_asy*)(dev->priv); + int cib = 0; + + if (sl->tty->driver->chars_in_buffer) + cib = sl->tty->driver->chars_in_buffer(sl->tty); spin_lock(&sl->lock); if (netif_queue_stopped(dev)) { @@ -290,8 +294,7 @@ * 14 Oct 1994 Dmitry Gorodchanin. */ printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, - (sl->tty->driver->chars_in_buffer(sl->tty) || sl->xleft) ? - "bad line quality" : "driver error"); + (cib || sl->xleft) ? "bad line quality" : "driver error"); sl->xleft = 0; sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); x25_asy_unlock(sl); @@ -561,6 +564,9 @@ return -EEXIST; } + if (!tty->driver->write) + return -EOPNOTSUPP; + /* OK. Find a free X.25 channel to use. */ if ((sl = x25_asy_alloc()) == NULL) { return -ENFILE; --- linux-2.6.24.orig/drivers/net/e1000e/netdev.c +++ linux-2.6.24/drivers/net/e1000e/netdev.c @@ -388,15 +388,24 @@ buffer_info->dma = 0; length = le16_to_cpu(rx_desc->length); + /* + * !EOP means multiple descriptors were used to store a single + * packet, if that's the case we need to toss it. In fact, we + * need to toss every packet with the EOP bit clear and the + * next frame that _does_ have the EOP bit set, as it is by + * definition only a frame fragment + */ + if (unlikely(!(status & E1000_RXD_STAT_EOP))) + adapter->flags2 |= FLAG2_IS_DISCARDING; - /* !EOP means multiple descriptors were used to store a single - * packet, also make sure the frame isn't just CRC only */ - if (!(status & E1000_RXD_STAT_EOP) || (length <= 4)) { + if (adapter->flags2 & FLAG2_IS_DISCARDING) { /* All receives must fit into a single buffer */ ndev_dbg(netdev, "%s: Receive packet consumed " "multiple buffers\n", netdev->name); /* recycle */ buffer_info->skb = skb; + if (status & E1000_RXD_STAT_EOP) + adapter->flags2 &= ~FLAG2_IS_DISCARDING; goto next_desc; } @@ -648,10 +657,16 @@ PCI_DMA_FROMDEVICE); buffer_info->dma = 0; - if (!(staterr & E1000_RXD_STAT_EOP)) { + /* see !EOP comment in other rx routine */ + if (!(staterr & E1000_RXD_STAT_EOP)) + adapter->flags2 |= FLAG2_IS_DISCARDING; + + if (adapter->flags2 & FLAG2_IS_DISCARDING) { ndev_dbg(netdev, "%s: Packet Split buffers didn't pick " "up the full packet\n", netdev->name); dev_kfree_skb_irq(skb); + if (staterr & E1000_RXD_STAT_EOP) + adapter->flags2 &= ~FLAG2_IS_DISCARDING; goto next_desc; } @@ -813,6 +828,7 @@ rx_ring->next_to_clean = 0; rx_ring->next_to_use = 0; + adapter->flags2 &= ~FLAG2_IS_DISCARDING; writel(0, adapter->hw.hw_addr + rx_ring->head); writel(0, adapter->hw.hw_addr + rx_ring->tail); @@ -1686,22 +1702,13 @@ else rctl |= E1000_RCTL_LPE; + /* Enable hardware CRC frame stripping */ + rctl |= E1000_RCTL_SECRC; + /* Setup buffer sizes */ rctl &= ~E1000_RCTL_SZ_4096; rctl |= E1000_RCTL_BSEX; switch (adapter->rx_buffer_len) { - case 256: - rctl |= E1000_RCTL_SZ_256; - rctl &= ~E1000_RCTL_BSEX; - break; - case 512: - rctl |= E1000_RCTL_SZ_512; - rctl &= ~E1000_RCTL_BSEX; - break; - case 1024: - rctl |= E1000_RCTL_SZ_1024; - rctl &= ~E1000_RCTL_BSEX; - break; case 2048: default: rctl |= E1000_RCTL_SZ_2048; @@ -1751,9 +1758,6 @@ /* Enable Packet split descriptors */ rctl |= E1000_RCTL_DTYP_PS; - - /* Enable hardware CRC frame stripping */ - rctl |= E1000_RCTL_SECRC; psrctl |= adapter->rx_ps_bsize0 >> E1000_PSRCTL_BSIZE0_SHIFT; @@ -3345,13 +3349,7 @@ * larger slab size. * i.e. RXBUFFER_2048 --> size-4096 slab */ - if (max_frame <= 256) - adapter->rx_buffer_len = 256; - else if (max_frame <= 512) - adapter->rx_buffer_len = 512; - else if (max_frame <= 1024) - adapter->rx_buffer_len = 1024; - else if (max_frame <= 2048) + if (max_frame <= 2048) adapter->rx_buffer_len = 2048; else adapter->rx_buffer_len = 4096; --- linux-2.6.24.orig/drivers/net/e1000e/e1000.h +++ linux-2.6.24/drivers/net/e1000e/e1000.h @@ -267,6 +267,7 @@ unsigned long led_status; unsigned int flags; + unsigned int flags2; }; struct e1000_info { @@ -311,6 +312,8 @@ #define FLAG_RX_CSUM_ENABLED (1 << 28) #define FLAG_TSO_FORCE (1 << 29) +#define FLAG2_IS_DISCARDING (1 << 2) + #define E1000_RX_DESC_PS(R, i) \ (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) #define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i])) --- linux-2.6.24.orig/drivers/net/tulip/media.c +++ linux-2.6.24/drivers/net/tulip/media.c @@ -519,10 +519,11 @@ /* Enable autonegotiation: some boards default to off. */ if (tp->default_port == 0) { new_bmcr = mii_reg0 | BMCR_ANENABLE; - if (new_bmcr != mii_reg0) { - new_bmcr |= BMCR_ANRESTART; - ane_switch = 1; - } + /* DM9161E PHY seems to need to restart + * autonegotiation even if it defaults to enabled. + */ + new_bmcr |= BMCR_ANRESTART; + ane_switch = 1; } /* ...or disable nway, if forcing media */ else { --- linux-2.6.24.orig/drivers/net/tulip/tulip.h +++ linux-2.6.24/drivers/net/tulip/tulip.h @@ -37,7 +37,10 @@ #define TULIP_BAR 0 /* CBIO */ #endif - +#ifndef PCI_ULI5261_ID +#define PCI_ULI5261_ID 0x526110B9 /* ULi M5261 ID*/ +#define PCI_ULI5263_ID 0x526310B9 /* ULi M5263 ID*/ +#endif struct tulip_chip_table { char *chip_name; --- linux-2.6.24.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.24/drivers/net/tulip/tulip_core.c @@ -230,8 +230,12 @@ { 0x1259, 0xa120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x11F6, 0x9881, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMPEX9881 }, { 0x8086, 0x0039, PCI_ANY_ID, PCI_ANY_ID, 0, 0, I21145 }, + /* Ubuntu: On non-sparc, this seems to be handled better by the + * dmfe driver. */ +#ifdef __sparc__ { 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X }, { 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X }, +#endif { 0x1113, 0x1216, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 }, { 0x1113, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, @@ -394,6 +398,11 @@ goto media_picked; } } + if (tp->chip_id == PCI_ULI5261_ID || tp->chip_id == PCI_ULI5263_ID) { + for (i = tp->mtable->leafcount - 1; i >= 0; i--) + if (tulip_media_cap[tp->mtable->mleaf[i].media] & MediaIsMII) + goto media_picked; + } /* Start sensing first non-full-duplex media. */ for (i = tp->mtable->leafcount - 1; (tulip_media_cap[tp->mtable->mleaf[i].media] & MediaAlwaysFD) && i > 0; i--) --- linux-2.6.24.orig/drivers/net/skfp/skfddi.c +++ linux-2.6.24/drivers/net/skfp/skfddi.c @@ -998,9 +998,9 @@ break; case SKFP_CLR_STATS: /* Zero out the driver statistics */ if (!capable(CAP_NET_ADMIN)) { - memset(&lp->MacStat, 0, sizeof(lp->MacStat)); - } else { status = -EPERM; + } else { + memset(&lp->MacStat, 0, sizeof(lp->MacStat)); } break; default: --- linux-2.6.24.orig/drivers/net/usb/pegasus.c +++ linux-2.6.24/drivers/net/usb/pegasus.c @@ -1289,6 +1289,24 @@ } } +static int pegasus_blacklisted(struct usb_device *udev) +{ + struct usb_device_descriptor *udd = &udev->descriptor; + + /* Special quirk to keep the driver from handling the Belkin Bluetooth + * dongle which happens to have the same ID. + */ + if (udd->idVendor == VENDOR_BELKIN && udd->idProduct == 0x0121) { + if (udd->bDeviceClass == USB_CLASS_WIRELESS_CONTROLLER) { + if (udd->bDeviceProtocol == 1) { + return 1; + } + } + } + + return 0; +} + static int pegasus_probe(struct usb_interface *intf, const struct usb_device_id *id) { @@ -1300,6 +1318,12 @@ DECLARE_MAC_BUF(mac); usb_get_dev(dev); + + if (pegasus_blacklisted(dev)) { + res = -ENODEV; + goto out; + } + net = alloc_etherdev(sizeof(struct pegasus)); if (!net) { dev_err(&intf->dev, "can't allocate %s\n", "device"); --- linux-2.6.24.orig/drivers/net/usb/asix.c +++ linux-2.6.24/drivers/net/usb/asix.c @@ -1437,6 +1437,10 @@ // Belkin F5D5055 USB_DEVICE(0x050d, 0x5055), .driver_info = (unsigned long) &ax88178_info, +}, { + // Apple USB Ethernet Adapter + USB_DEVICE(0x05ac, 0x1402), + .driver_info = (unsigned long) &ax88772_info, }, { }, // END }; --- linux-2.6.24.orig/drivers/net/usb/rndis_host.c +++ linux-2.6.24/drivers/net/usb/rndis_host.c @@ -499,6 +499,14 @@ net->hard_header_len += sizeof (struct rndis_data_hdr); dev->hard_mtu = net->mtu + net->hard_header_len; + dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1); + if (dev->maxpacket == 0) { + if (netif_msg_probe(dev)) + dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n"); + retval = -EINVAL; + goto fail_and_release; + } + dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1); dev->rx_urb_size &= ~(dev->maxpacket - 1); u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size); --- linux-2.6.24.orig/drivers/scsi/gdth_proc.c +++ linux-2.6.24/drivers/scsi/gdth_proc.c @@ -694,15 +694,13 @@ { ulong flags; - spin_lock_irqsave(&ha->smp_lock, flags); - if (buf == ha->pscratch) { + spin_lock_irqsave(&ha->smp_lock, flags); ha->scratch_busy = FALSE; + spin_unlock_irqrestore(&ha->smp_lock, flags); } else { pci_free_consistent(ha->pdev, size, buf, paddr); } - - spin_unlock_irqrestore(&ha->smp_lock, flags); } #ifdef GDTH_IOCTL_PROC --- linux-2.6.24.orig/drivers/scsi/gdth.h +++ linux-2.6.24/drivers/scsi/gdth.h @@ -915,6 +915,7 @@ struct gdth_cmndinfo { /* per-command private info */ int index; int internal_command; /* don't call scsi_done */ + gdth_cmd_str *internal_cmd_str; /* crier for internal messages*/ dma_addr_t sense_paddr; /* sense dma-addr */ unchar priority; int timeout; --- linux-2.6.24.orig/drivers/scsi/scsi_lib.c +++ linux-2.6.24/drivers/scsi/scsi_lib.c @@ -298,7 +298,6 @@ page = sg_page(sg); off = sg->offset; len = sg->length; - data_len += len; while (len > 0 && data_len > 0) { /* --- linux-2.6.24.orig/drivers/scsi/mesh.c +++ linux-2.6.24/drivers/scsi/mesh.c @@ -1759,6 +1759,7 @@ switch (mesg.event) { case PM_EVENT_SUSPEND: + case PM_EVENT_HIBERNATE: case PM_EVENT_FREEZE: break; default: --- linux-2.6.24.orig/drivers/scsi/scsi_transport_fc.c +++ linux-2.6.24/drivers/scsi/scsi_transport_fc.c @@ -478,9 +478,29 @@ MODULE_PARM_DESC(dev_loss_tmo, "Maximum number of seconds that the FC transport should" " insulate the loss of a remote port. Once this value is" - " exceeded, the scsi target is removed. Value should be" + " exceeded, the scsi target may be removed. Reference the" + " remove_on_dev_loss module parameter. Value should be" " between 1 and SCSI_DEVICE_BLOCK_MAX_TIMEOUT."); +/* + * remove_on_dev_loss: controls whether the transport will + * remove a scsi target after the device loss timer expires. + * Removal on disconnect is modeled after the USB subsystem + * and expects subsystems layered on SCSI to be aware of + * potential device loss and handle it appropriately. However, + * many subsystems do not support device removal, leaving situations + * where structure references may remain, causing new device + * name assignments, etc., if the target returns. + */ +static unsigned int fc_remove_on_dev_loss = 0; +module_param_named(remove_on_dev_loss, fc_remove_on_dev_loss, + int, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(remove_on_dev_loss, + "Boolean. When the device loss timer fires, this variable" + " controls whether the scsi infrastructure for the target" + " device is removed. Values: zero means do not remove," + " non-zero means remove. Default is zero."); + /** * Netlink Infrastructure **/ @@ -2297,7 +2317,8 @@ if (i->f->terminate_rport_io) i->f->terminate_rport_io(rport); - scsi_remove_target(&rport->dev); + if (fc_remove_on_dev_loss) + scsi_remove_target(&rport->dev); } @@ -2934,9 +2955,13 @@ return; } - dev_printk(KERN_ERR, &rport->dev, - "blocked FC remote port time out: removing target and " - "saving binding\n"); + if (fc_remove_on_dev_loss) + dev_printk(KERN_ERR, &rport->dev, + "blocked FC remote port time out: removing target and " + "saving binding\n"); + else + dev_printk(KERN_ERR, &rport->dev, + "blocked FC remote port time out: saving binding\n"); list_move_tail(&rport->peers, &fc_host->rport_bindings); --- linux-2.6.24.orig/drivers/scsi/gdth.c +++ linux-2.6.24/drivers/scsi/gdth.c @@ -160,7 +160,7 @@ static void gdth_clear_events(void); static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp, - char *buffer, ushort count, int to_buffer); + char *buffer, ushort count); static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp); static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive); @@ -183,7 +183,6 @@ unsigned int cmd, unsigned long arg); static void gdth_flush(gdth_ha_str *ha); -static int gdth_halt(struct notifier_block *nb, ulong event, void *buf); static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, struct gdth_cmndinfo *cmndinfo); @@ -418,12 +417,6 @@ #include "gdth_proc.h" #include "gdth_proc.c" -/* notifier block to get a notify on system shutdown/halt/reboot */ -static struct notifier_block gdth_notifier = { - gdth_halt, NULL, 0 -}; -static int notifier_disabled = 0; - static gdth_ha_str *gdth_find_ha(int hanum) { gdth_ha_str *ha; @@ -446,8 +439,8 @@ for (i=0; icmndinfo[i].index == 0) { priv = &ha->cmndinfo[i]; - priv->index = i+1; memset(priv, 0, sizeof(*priv)); + priv->index = i+1; break; } } @@ -494,7 +487,6 @@ gdth_ha_str *ha = shost_priv(sdev->host); Scsi_Cmnd *scp; struct gdth_cmndinfo cmndinfo; - struct scatterlist one_sg; DECLARE_COMPLETION_ONSTACK(wait); int rval; @@ -508,13 +500,10 @@ /* use request field to save the ptr. to completion struct. */ scp->request = (struct request *)&wait; scp->timeout_per_command = timeout*HZ; - sg_init_one(&one_sg, gdtcmd, sizeof(*gdtcmd)); - gdth_set_sglist(scp, &one_sg); - gdth_set_sg_count(scp, 1); - gdth_set_bufflen(scp, sizeof(*gdtcmd)); scp->cmd_len = 12; memcpy(scp->cmnd, cmnd, 12); cmndinfo.priority = IOCTL_PRI; + cmndinfo.internal_cmd_str = gdtcmd; cmndinfo.internal_command = 1; TRACE(("__gdth_execute() cmd 0x%x\n", scp->cmnd[0])); @@ -2355,7 +2344,7 @@ * buffers, kmap_atomic() as needed. */ static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp, - char *buffer, ushort count, int to_buffer) + char *buffer, ushort count) { ushort cpcount,i, max_sg = gdth_sg_count(scp); ushort cpsum,cpnow; @@ -2381,10 +2370,7 @@ } local_irq_save(flags); address = kmap_atomic(sg_page(sl), KM_BIO_SRC_IRQ) + sl->offset; - if (to_buffer) - memcpy(buffer, address, cpnow); - else - memcpy(address, buffer, cpnow); + memcpy(address, buffer, cpnow); flush_dcache_page(sg_page(sl)); kunmap_atomic(address, KM_BIO_SRC_IRQ); local_irq_restore(flags); @@ -2438,7 +2424,7 @@ strcpy(inq.vendor,ha->oem_name); sprintf(inq.product,"Host Drive #%02d",t); strcpy(inq.revision," "); - gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data), 0); + gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data)); break; case REQUEST_SENSE: @@ -2448,7 +2434,7 @@ sd.key = NO_SENSE; sd.info = 0; sd.add_length= 0; - gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data), 0); + gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data)); break; case MODE_SENSE: @@ -2460,7 +2446,7 @@ mpd.bd.block_length[0] = (SECTOR_SIZE & 0x00ff0000) >> 16; mpd.bd.block_length[1] = (SECTOR_SIZE & 0x0000ff00) >> 8; mpd.bd.block_length[2] = (SECTOR_SIZE & 0x000000ff); - gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data), 0); + gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data)); break; case READ_CAPACITY: @@ -2470,7 +2456,7 @@ else rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1); rdc.block_length = cpu_to_be32(SECTOR_SIZE); - gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data), 0); + gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data)); break; case SERVICE_ACTION_IN: @@ -2482,7 +2468,7 @@ rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1); rdc16.block_length = cpu_to_be32(SECTOR_SIZE); gdth_copy_internal_data(ha, scp, (char*)&rdc16, - sizeof(gdth_rdcap16_data), 0); + sizeof(gdth_rdcap16_data)); } else { scp->result = DID_ABORT << 16; } @@ -2852,6 +2838,7 @@ static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) { register gdth_cmd_str *cmdp; + struct gdth_cmndinfo *cmndinfo = gdth_cmnd_priv(scp); int cmd_index; cmdp= ha->pccb; @@ -2860,7 +2847,7 @@ if (ha->type==GDT_EISA && ha->cmd_cnt>0) return 0; - gdth_copy_internal_data(ha, scp, (char *)cmdp, sizeof(gdth_cmd_str), 1); + *cmdp = *cmndinfo->internal_cmd_str; cmdp->RequestBuffer = scp; /* search free command index */ @@ -2975,7 +2962,7 @@ eindex = handle; estr->event_source = 0; - if (eindex >= MAX_EVENTS) { + if (eindex < 0 || eindex >= MAX_EVENTS) { spin_unlock_irqrestore(&ha->smp_lock, flags); return eindex; } @@ -3793,6 +3780,8 @@ gdth_ha_str *ha; ulong flags; + BUG_ON(list_empty(&gdth_instances)); + ha = list_first_entry(&gdth_instances, gdth_ha_str, list); spin_lock_irqsave(&ha->smp_lock, flags); @@ -4196,6 +4185,14 @@ ha = gdth_find_ha(gen.ionode); if (!ha) return -EFAULT; + + if (gen.data_len > INT_MAX) + return -EINVAL; + if (gen.sense_len > INT_MAX) + return -EINVAL; + if (gen.data_len + gen.sense_len > INT_MAX) + return -EINVAL; + if (gen.data_len + gen.sense_len != 0) { if (!(buf = gdth_ioctl_alloc(ha, gen.data_len + gen.sense_len, FALSE, &paddr))) @@ -4668,45 +4665,6 @@ } } -/* shutdown routine */ -static int gdth_halt(struct notifier_block *nb, ulong event, void *buf) -{ - gdth_ha_str *ha; -#ifndef __alpha__ - gdth_cmd_str gdtcmd; - char cmnd[MAX_COMMAND_SIZE]; -#endif - - if (notifier_disabled) - return NOTIFY_OK; - - TRACE2(("gdth_halt() event %d\n",(int)event)); - if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF) - return NOTIFY_DONE; - - notifier_disabled = 1; - printk("GDT-HA: Flushing all host drives .. "); - list_for_each_entry(ha, &gdth_instances, list) { - gdth_flush(ha); - -#ifndef __alpha__ - /* controller reset */ - memset(cmnd, 0xff, MAX_COMMAND_SIZE); - gdtcmd.BoardNode = LOCALBOARD; - gdtcmd.Service = CACHESERVICE; - gdtcmd.OpCode = GDT_RESET; - TRACE2(("gdth_halt(): reset controller %d\n", ha->hanum)); - gdth_execute(ha->shost, &gdtcmd, cmnd, 10, NULL); -#endif - } - printk("Done.\n"); - -#ifdef GDTH_STATISTICS - del_timer(&gdth_timer); -#endif - return NOTIFY_OK; -} - /* configure lun */ static int gdth_slave_configure(struct scsi_device *sdev) { @@ -4838,6 +4796,9 @@ if (error) goto out_free_coal_stat; list_add_tail(&ha->list, &gdth_instances); + + scsi_scan_host(shp); + return 0; out_free_coal_stat: @@ -4965,6 +4926,9 @@ if (error) goto out_free_coal_stat; list_add_tail(&ha->list, &gdth_instances); + + scsi_scan_host(shp); + return 0; out_free_ccb_phys: @@ -5102,6 +5066,9 @@ if (error) goto out_free_coal_stat; list_add_tail(&ha->list, &gdth_instances); + + scsi_scan_host(shp); + return 0; out_free_coal_stat: @@ -5132,13 +5099,13 @@ scsi_remove_host(shp); + gdth_flush(ha); + if (ha->sdev) { scsi_free_host_dev(ha->sdev); ha->sdev = NULL; } - gdth_flush(ha); - if (shp->irq) free_irq(shp->irq,ha); @@ -5164,6 +5131,24 @@ scsi_host_put(shp); } +static int gdth_halt(struct notifier_block *nb, ulong event, void *buf) +{ + gdth_ha_str *ha; + + TRACE2(("gdth_halt() event %d\n", (int)event)); + if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF) + return NOTIFY_DONE; + + list_for_each_entry(ha, &gdth_instances, list) + gdth_flush(ha); + + return NOTIFY_OK; +} + +static struct notifier_block gdth_notifier = { + gdth_halt, NULL, 0 +}; + static int __init gdth_init(void) { if (disable) { @@ -5226,7 +5211,6 @@ add_timer(&gdth_timer); #endif major = register_chrdev(0,"gdth", &gdth_fops); - notifier_disabled = 0; register_reboot_notifier(&gdth_notifier); gdth_polling = FALSE; return 0; @@ -5236,14 +5220,15 @@ { gdth_ha_str *ha; - list_for_each_entry(ha, &gdth_instances, list) - gdth_remove_one(ha); + unregister_chrdev(major, "gdth"); + unregister_reboot_notifier(&gdth_notifier); #ifdef GDTH_STATISTICS - del_timer(&gdth_timer); + del_timer_sync(&gdth_timer); #endif - unregister_chrdev(major,"gdth"); - unregister_reboot_notifier(&gdth_notifier); + + list_for_each_entry(ha, &gdth_instances, list) + gdth_remove_one(ha); } module_init(gdth_init); --- linux-2.6.24.orig/drivers/scsi/advansys.c +++ linux-2.6.24/drivers/scsi/advansys.c @@ -566,7 +566,7 @@ ASC_SCSI_BIT_ID_TYPE unit_not_ready; ASC_SCSI_BIT_ID_TYPE queue_full_or_busy; ASC_SCSI_BIT_ID_TYPE start_motor; - uchar overrun_buf[ASC_OVERRUN_BSIZE] __aligned(8); + uchar *overrun_buf; dma_addr_t overrun_dma; uchar scsi_reset_wait; uchar chip_no; @@ -6439,7 +6439,7 @@ i += 2; len += 2; } else { - unsigned char off = buf[i] * 2; + unsigned int off = buf[i] * 2; unsigned short word = (buf[off + 1] << 8) | buf[off]; AdvWriteWordAutoIncLram(iop_base, word); len += 2; @@ -13833,6 +13833,12 @@ */ if (ASC_NARROW_BOARD(boardp)) { ASC_DBG(2, "AscInitAsc1000Driver()\n"); + + asc_dvc_varp->overrun_buf = kzalloc(ASC_OVERRUN_BSIZE, GFP_KERNEL); + if (!asc_dvc_varp->overrun_buf) { + ret = -ENOMEM; + goto err_free_wide_mem; + } warn_code = AscInitAsc1000Driver(asc_dvc_varp); if (warn_code || asc_dvc_varp->err_code) { @@ -13840,8 +13846,10 @@ "warn 0x%x, error 0x%x\n", asc_dvc_varp->init_state, warn_code, asc_dvc_varp->err_code); - if (asc_dvc_varp->err_code) + if (asc_dvc_varp->err_code) { ret = -ENODEV; + kfree(asc_dvc_varp->overrun_buf); + } } } else { if (advansys_wide_init_chip(shost)) @@ -13894,6 +13902,7 @@ dma_unmap_single(board->dev, board->dvc_var.asc_dvc_var.overrun_dma, ASC_OVERRUN_BSIZE, DMA_FROM_DEVICE); + kfree(board->dvc_var.asc_dvc_var.overrun_buf); } else { iounmap(board->ioremap_addr); advansys_wide_free_mem(board); --- linux-2.6.24.orig/drivers/scsi/ips.c +++ linux-2.6.24/drivers/scsi/ips.c @@ -1580,7 +1580,7 @@ METHOD_TRACE("ips_make_passthru", 1); scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i) - length += sg[i].length; + length += sg->length; if (length < sizeof (ips_passthru_t)) { /* wrong size */ @@ -6842,13 +6842,10 @@ if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { IPS_PRINTK(KERN_WARNING, ha->pcidev, "Unable to install interrupt handler\n"); - scsi_host_put(sh); - return -1; + goto err_out_sh; } kfree(oldha); - ips_sh[index] = sh; - ips_ha[index] = ha; /* Store away needed values for later use */ sh->io_port = ha->io_addr; @@ -6867,10 +6864,21 @@ sh->max_channel = ha->nbus - 1; sh->can_queue = ha->max_cmds - 1; - scsi_add_host(sh, NULL); + if (scsi_add_host(sh, &ha->pcidev->dev)) + goto err_out; + + ips_sh[index] = sh; + ips_ha[index] = ha; + scsi_scan_host(sh); return 0; + +err_out: + free_irq(ha->pcidev->irq, ha); +err_out_sh: + scsi_host_put(sh); + return -1; } /*---------------------------------------------------------------------------*/ --- linux-2.6.24.orig/drivers/scsi/sd.c +++ linux-2.6.24/drivers/scsi/sd.c @@ -907,6 +907,7 @@ unsigned int xfer_size = SCpnt->request_bufflen; unsigned int good_bytes = result ? 0 : xfer_size; u64 start_lba = SCpnt->request->sector; + u64 end_lba = SCpnt->request->sector + (xfer_size / 512); u64 bad_lba; struct scsi_sense_hdr sshdr; int sense_valid = 0; @@ -945,26 +946,23 @@ goto out; if (xfer_size <= SCpnt->device->sector_size) goto out; - switch (SCpnt->device->sector_size) { - case 256: + if (SCpnt->device->sector_size < 512) { + /* only legitimate sector_size here is 256 */ start_lba <<= 1; - break; - case 512: - break; - case 1024: - start_lba >>= 1; - break; - case 2048: - start_lba >>= 2; - break; - case 4096: - start_lba >>= 3; - break; - default: - /* Print something here with limiting frequency. */ - goto out; - break; + end_lba <<= 1; + } else { + /* be careful ... don't want any overflows */ + u64 factor = SCpnt->device->sector_size / 512; + do_div(start_lba, factor); + do_div(end_lba, factor); } + + if (bad_lba < start_lba || bad_lba >= end_lba) + /* the bad lba was reported incorrectly, we have + * no idea where the error is + */ + goto out; + /* This computation should always be done in terms of * the resolution of the device's medium. */ @@ -1815,8 +1813,7 @@ goto done; } - if (mesg.event == PM_EVENT_SUSPEND && - sdkp->device->manage_start_stop) { + if ((mesg.event & PM_EVENT_SLEEP) && sdkp->device->manage_start_stop) { sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); ret = sd_start_stop_device(sdkp, 0); } --- linux-2.6.24.orig/drivers/scsi/aic7xxx/aic79xx_osm_pci.c +++ linux-2.6.24/drivers/scsi/aic7xxx/aic79xx_osm_pci.c @@ -110,7 +110,7 @@ pci_save_state(pdev); pci_disable_device(pdev); - if (mesg.event == PM_EVENT_SUSPEND) + if (mesg.event & PM_EVENT_SLEEP) pci_set_power_state(pdev, PCI_D3hot); return rc; --- linux-2.6.24.orig/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ linux-2.6.24/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c @@ -155,7 +155,7 @@ pci_save_state(pdev); pci_disable_device(pdev); - if (mesg.event == PM_EVENT_SUSPEND) + if (mesg.event & PM_EVENT_SLEEP) pci_set_power_state(pdev, PCI_D3hot); return rc; --- linux-2.6.24.orig/drivers/scsi/aic94xx/aic94xx_scb.c +++ linux-2.6.24/drivers/scsi/aic94xx/aic94xx_scb.c @@ -458,13 +458,19 @@ tc_abort = le16_to_cpu(tc_abort); list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) { - struct sas_task *task = ascb->uldd_task; + struct sas_task *task = a->uldd_task; - if (task && a->tc_index == tc_abort) { + if (a->tc_index != tc_abort) + continue; + + if (task) { failed_dev = task->dev; sas_task_abort(task); - break; + } else { + ASD_DPRINTK("R_T_A for non TASK scb 0x%x\n", + a->scb->header.opcode); } + break; } if (!failed_dev) { @@ -478,7 +484,7 @@ * that the EH will wake up and do something. */ list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) { - struct sas_task *task = ascb->uldd_task; + struct sas_task *task = a->uldd_task; if (task && task->dev == failed_dev && --- linux-2.6.24.orig/drivers/scsi/arcmsr/arcmsr_hba.c +++ linux-2.6.24/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1380,17 +1380,16 @@ switch(controlcode) { case ARCMSR_MESSAGE_READ_RQBUFFER: { - unsigned long *ver_addr; - dma_addr_t buf_handle; + unsigned char *ver_addr; uint8_t *pQbuffer, *ptmpQbuffer; int32_t allxfer_len = 0; - ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle); + ver_addr = kmalloc(1032, GFP_ATOMIC); if (!ver_addr) { retvalue = ARCMSR_MESSAGE_FAIL; goto message_out; } - ptmpQbuffer = (uint8_t *) ver_addr; + ptmpQbuffer = ver_addr; while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex) && (allxfer_len < 1031)) { pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex]; @@ -1419,25 +1418,24 @@ } arcmsr_iop_message_read(acb); } - memcpy(pcmdmessagefld->messagedatabuffer, (uint8_t *)ver_addr, allxfer_len); + memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, allxfer_len); pcmdmessagefld->cmdmessage.Length = allxfer_len; pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK; - pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle); + kfree(ver_addr); } break; case ARCMSR_MESSAGE_WRITE_WQBUFFER: { - unsigned long *ver_addr; - dma_addr_t buf_handle; + unsigned char *ver_addr; int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex; uint8_t *pQbuffer, *ptmpuserbuffer; - ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle); + ver_addr = kmalloc(1032, GFP_ATOMIC); if (!ver_addr) { retvalue = ARCMSR_MESSAGE_FAIL; goto message_out; } - ptmpuserbuffer = (uint8_t *)ver_addr; + ptmpuserbuffer = ver_addr; user_len = pcmdmessagefld->cmdmessage.Length; memcpy(ptmpuserbuffer, pcmdmessagefld->messagedatabuffer, user_len); wqbuf_lastindex = acb->wqbuf_lastindex; @@ -1483,7 +1481,7 @@ retvalue = ARCMSR_MESSAGE_FAIL; } } - pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle); + kfree(ver_addr); } break; --- linux-2.6.24.orig/drivers/scsi/megaraid/megaraid_sas.c +++ linux-2.6.24/drivers/scsi/megaraid/megaraid_sas.c @@ -3018,7 +3018,7 @@ return retval; } -static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUGO, megasas_sysfs_show_dbg_lvl, +static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUSR, megasas_sysfs_show_dbg_lvl, megasas_sysfs_set_dbg_lvl); /** --- linux-2.6.24.orig/drivers/connector/connector.c +++ linux-2.6.24/drivers/connector/connector.c @@ -34,17 +34,6 @@ MODULE_AUTHOR("Evgeniy Polyakov "); MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); -static u32 cn_idx = CN_IDX_CONNECTOR; -static u32 cn_val = CN_VAL_CONNECTOR; - -module_param(cn_idx, uint, 0); -module_param(cn_val, uint, 0); -MODULE_PARM_DESC(cn_idx, "Connector's main device idx."); -MODULE_PARM_DESC(cn_val, "Connector's main device val."); - -static DEFINE_MUTEX(notify_lock); -static LIST_HEAD(notify_list); - static struct cn_dev cdev; int cn_already_initialized = 0; @@ -126,10 +115,11 @@ /* * Callback helper - queues work and setup destructor for given data. */ -static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), void *data) +static int cn_call_callback(struct sk_buff *skb, void (*destruct_data)(void *), void *data) { struct cn_callback_entry *__cbq, *__new_cbq; struct cn_dev *dev = &cdev; + struct cn_msg *msg = NLMSG_DATA(nlmsg_hdr(skb)); int err = -ENODEV; spin_lock_bh(&dev->cbdev->queue_lock); @@ -137,7 +127,7 @@ if (cn_cb_equal(&__cbq->id.id, &msg->id)) { if (likely(!work_pending(&__cbq->work) && __cbq->data.ddata == NULL)) { - __cbq->data.callback_priv = msg; + __cbq->data.skb = skb; __cbq->data.ddata = data; __cbq->data.destruct_data = destruct_data; @@ -154,7 +144,7 @@ __new_cbq = kzalloc(sizeof(struct cn_callback_entry), GFP_ATOMIC); if (__new_cbq) { d = &__new_cbq->data; - d->callback_priv = msg; + d->skb = skb; d->callback = __cbq->data.callback; d->ddata = data; d->destruct_data = destruct_data; @@ -195,7 +185,7 @@ group = NETLINK_CB((skb)).dst_group; msg = NLMSG_DATA(nlh); - return cn_call_callback(msg, (void (*)(void *))kfree_skb, skb); + return cn_call_callback(skb, (void (*)(void *))kfree_skb, skb); } /* @@ -234,60 +224,13 @@ } /* - * Notification routing. - * - * Gets id and checks if there are notification request for it's idx - * and val. If there are such requests notify the listeners with the - * given notify event. - * - */ -static void cn_notify(struct cb_id *id, u32 notify_event) -{ - struct cn_ctl_entry *ent; - - mutex_lock(¬ify_lock); - list_for_each_entry(ent, ¬ify_list, notify_entry) { - int i; - struct cn_notify_req *req; - struct cn_ctl_msg *ctl = ent->msg; - int idx_found, val_found; - - idx_found = val_found = 0; - - req = (struct cn_notify_req *)ctl->data; - for (i = 0; i < ctl->idx_notify_num; ++i, ++req) { - if (id->idx >= req->first && - id->idx < req->first + req->range) { - idx_found = 1; - break; - } - } - - for (i = 0; i < ctl->val_notify_num; ++i, ++req) { - if (id->val >= req->first && - id->val < req->first + req->range) { - val_found = 1; - break; - } - } - - if (idx_found && val_found) { - struct cn_msg m = { .ack = notify_event, }; - - memcpy(&m.id, id, sizeof(m.id)); - cn_netlink_send(&m, ctl->group, GFP_KERNEL); - } - } - mutex_unlock(¬ify_lock); -} - -/* * Callback add routing - adds callback with given ID and name. * If there is registered callback with the same ID it will not be added. * * May sleep. */ -int cn_add_callback(struct cb_id *id, char *name, void (*callback)(void *)) +int cn_add_callback(struct cb_id *id, char *name, + void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) { int err; struct cn_dev *dev = &cdev; @@ -299,8 +242,6 @@ if (err) return err; - cn_notify(id, 0); - return 0; } EXPORT_SYMBOL_GPL(cn_add_callback); @@ -318,120 +259,14 @@ struct cn_dev *dev = &cdev; cn_queue_del_callback(dev->cbdev, id); - cn_notify(id, 1); } EXPORT_SYMBOL_GPL(cn_del_callback); -/* - * Checks two connector's control messages to be the same. - * Returns 1 if they are the same or if the first one is corrupted. - */ -static int cn_ctl_msg_equals(struct cn_ctl_msg *m1, struct cn_ctl_msg *m2) -{ - int i; - struct cn_notify_req *req1, *req2; - - if (m1->idx_notify_num != m2->idx_notify_num) - return 0; - - if (m1->val_notify_num != m2->val_notify_num) - return 0; - - if (m1->len != m2->len) - return 0; - - if ((m1->idx_notify_num + m1->val_notify_num) * sizeof(*req1) != - m1->len) - return 1; - - req1 = (struct cn_notify_req *)m1->data; - req2 = (struct cn_notify_req *)m2->data; - - for (i = 0; i < m1->idx_notify_num; ++i) { - if (req1->first != req2->first || req1->range != req2->range) - return 0; - req1++; - req2++; - } - - for (i = 0; i < m1->val_notify_num; ++i) { - if (req1->first != req2->first || req1->range != req2->range) - return 0; - req1++; - req2++; - } - - return 1; -} - -/* - * Main connector device's callback. - * - * Used for notification of a request's processing. - */ -static void cn_callback(void *data) -{ - struct cn_msg *msg = data; - struct cn_ctl_msg *ctl; - struct cn_ctl_entry *ent; - u32 size; - - if (msg->len < sizeof(*ctl)) - return; - - ctl = (struct cn_ctl_msg *)msg->data; - - size = (sizeof(*ctl) + ((ctl->idx_notify_num + - ctl->val_notify_num) * - sizeof(struct cn_notify_req))); - - if (msg->len != size) - return; - - if (ctl->len + sizeof(*ctl) != msg->len) - return; - - /* - * Remove notification. - */ - if (ctl->group == 0) { - struct cn_ctl_entry *n; - - mutex_lock(¬ify_lock); - list_for_each_entry_safe(ent, n, ¬ify_list, notify_entry) { - if (cn_ctl_msg_equals(ent->msg, ctl)) { - list_del(&ent->notify_entry); - kfree(ent); - } - } - mutex_unlock(¬ify_lock); - - return; - } - - size += sizeof(*ent); - - ent = kzalloc(size, GFP_KERNEL); - if (!ent) - return; - - ent->msg = (struct cn_ctl_msg *)(ent + 1); - - memcpy(ent->msg, ctl, size - sizeof(*ent)); - - mutex_lock(¬ify_lock); - list_add(&ent->notify_entry, ¬ify_list); - mutex_unlock(¬ify_lock); -} - static int __devinit cn_init(void) { struct cn_dev *dev = &cdev; - int err; dev->input = cn_rx_skb; - dev->id.idx = cn_idx; - dev->id.val = cn_val; dev->nls = netlink_kernel_create(&init_net, NETLINK_CONNECTOR, CN_NETLINK_USERS + 0xf, @@ -448,15 +283,6 @@ cn_already_initialized = 1; - err = cn_add_callback(&dev->id, "connector", &cn_callback); - if (err) { - cn_already_initialized = 0; - cn_queue_free_dev(dev->cbdev); - if (dev->nls->sk_socket) - sock_release(dev->nls->sk_socket); - return -EINVAL; - } - return 0; } @@ -466,7 +292,6 @@ cn_already_initialized = 0; - cn_del_callback(&dev->id); cn_queue_free_dev(dev->cbdev); if (dev->nls->sk_socket) sock_release(dev->nls->sk_socket); --- linux-2.6.24.orig/drivers/connector/cn_proc.c +++ linux-2.6.24/drivers/connector/cn_proc.c @@ -196,9 +196,9 @@ * cn_proc_mcast_ctl * @data: message sent from userspace via the connector */ -static void cn_proc_mcast_ctl(void *data) +static void cn_proc_mcast_ctl(struct cn_msg *msg, + struct netlink_skb_parms *nsp) { - struct cn_msg *msg = data; enum proc_cn_mcast_op *mc_op = NULL; int err = 0; --- linux-2.6.24.orig/drivers/connector/cn_queue.c +++ linux-2.6.24/drivers/connector/cn_queue.c @@ -36,8 +36,10 @@ struct cn_callback_entry *cbq = container_of(work, struct cn_callback_entry, work); struct cn_callback_data *d = &cbq->data; + struct cn_msg *msg = NLMSG_DATA(nlmsg_hdr(d->skb)); + struct netlink_skb_parms *nsp = &NETLINK_CB(d->skb); - d->callback(d->callback_priv); + d->callback(msg, nsp); d->destruct_data(d->ddata); d->ddata = NULL; @@ -45,7 +47,9 @@ kfree(d->free); } -static struct cn_callback_entry *cn_queue_alloc_callback_entry(char *name, struct cb_id *id, void (*callback)(void *)) +static struct cn_callback_entry * +cn_queue_alloc_callback_entry(char *name, struct cb_id *id, + void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) { struct cn_callback_entry *cbq; @@ -75,7 +79,8 @@ return ((i1->idx == i2->idx) && (i1->val == i2->val)); } -int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)) +int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, + void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) { struct cn_callback_entry *cbq, *__cbq; int found = 0; --- linux-2.6.24.orig/drivers/usb/misc/auerswald.c +++ linux-2.6.24/drivers/usb/misc/auerswald.c @@ -1945,13 +1945,23 @@ /* Try to get a suitable textual description of the device */ /* Device name:*/ ret = usb_string( cp->usbdev, AUSI_DEVICE, cp->dev_desc, AUSI_DLEN-1); - if (ret >= 0) { + /* + * If we were successful, and there is room remaining for a serial + * number then look it up and append it. Assume the serial number + * is at least 4 digits. + */ + if (ret >= 0 && ret < AUSI_DLEN-1-6-4) { u += ret; /* Append Serial Number */ memcpy(&cp->dev_desc[u], ",Ser# ", 6); u += 6; ret = usb_string( cp->usbdev, AUSI_SERIALNR, &cp->dev_desc[u], AUSI_DLEN-u-1); - if (ret >= 0) { + /* + * If we were successful and there is room remaining for + * the subscriber prefix then look it up and append it. + * Assume the subscriber number is at least 1 digit. + */ + if (ret >= 0 && ret < AUSI_DLEN-u-1-2-1) { u += ret; /* Append subscriber number */ memcpy(&cp->dev_desc[u], ", ", 2); --- linux-2.6.24.orig/drivers/usb/misc/iowarrior.c +++ linux-2.6.24/drivers/usb/misc/iowarrior.c @@ -373,7 +373,7 @@ case USB_DEVICE_ID_CODEMERCS_IOWPV2: case USB_DEVICE_ID_CODEMERCS_IOW40: /* IOW24 and IOW40 use a synchronous call */ - buf = kmalloc(8, GFP_KERNEL); /* 8 bytes are enough for both products */ + buf = kmalloc(count, GFP_KERNEL); if (!buf) { retval = -ENOMEM; goto exit; --- linux-2.6.24.orig/drivers/usb/serial/mos7720.c +++ linux-2.6.24/drivers/usb/serial/mos7720.c @@ -1487,6 +1487,9 @@ case TIOCGICOUNT: cnow = mos7720_port->icount; + + memset(&icount, 0, sizeof(struct serial_icounter_struct)); + icount.cts = cnow.cts; icount.dsr = cnow.dsr; icount.rng = cnow.rng; --- linux-2.6.24.orig/drivers/usb/serial/ch341.c +++ linux-2.6.24/drivers/usb/serial/ch341.c @@ -28,6 +28,7 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(0x4348, 0x5523) }, + { USB_DEVICE(0x1a86, 0x7523) }, { }, }; MODULE_DEVICE_TABLE(usb, id_table); --- linux-2.6.24.orig/drivers/usb/serial/ftdi_sio.c +++ linux-2.6.24/drivers/usb/serial/ftdi_sio.c @@ -310,6 +310,7 @@ }; static int ftdi_olimex_probe (struct usb_serial *serial); +static int ftdi_mtxorb_hack_setup (struct usb_serial *serial); static void ftdi_USB_UIRT_setup (struct ftdi_private *priv); static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv); @@ -317,6 +318,10 @@ .probe = ftdi_olimex_probe, }; +static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = { + .probe = ftdi_mtxorb_hack_setup, +}; + static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { .port_probe = ftdi_USB_UIRT_setup, }; @@ -379,6 +384,8 @@ { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, + { USB_DEVICE(MTXORB_VK_VID, MTXORB_VK_PID), + .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, @@ -492,6 +499,7 @@ { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) }, { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) }, { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) }, @@ -1299,6 +1307,23 @@ } return 0; +} + +/* + * The Matrix Orbital VK204-25-USB has an invalid IN endpoint. + * We have to correct it if we want to read from it. + */ +static int ftdi_mtxorb_hack_setup(struct usb_serial *serial) +{ + struct usb_host_endpoint *ep = serial->dev->ep_in[1]; + struct usb_endpoint_descriptor *ep_desc = &ep->desc; + + if (ep->enabled && ep_desc->wMaxPacketSize == 0) { + ep_desc->wMaxPacketSize = 0x40; + info("Fixing invalid wMaxPacketSize on read pipe"); + } + + return 0; } /* ftdi_shutdown is called from usbserial:usb_serial_disconnect --- linux-2.6.24.orig/drivers/usb/serial/pl2303.c +++ linux-2.6.24/drivers/usb/serial/pl2303.c @@ -89,6 +89,7 @@ { USB_DEVICE(COREGA_VENDOR_ID, COREGA_PRODUCT_ID) }, { USB_DEVICE(HL340_VENDOR_ID, HL340_PRODUCT_ID) }, { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) }, + { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, { } /* Terminating entry */ }; --- linux-2.6.24.orig/drivers/usb/serial/pl2303.h +++ linux-2.6.24/drivers/usb/serial/pl2303.h @@ -112,3 +112,7 @@ /* Y.C. Cable U.S.A., Inc - USB to RS-232 */ #define YCCABLE_VENDOR_ID 0x05ad #define YCCABLE_PRODUCT_ID 0x0fba + +/* Sanwa KB-USB2 multimeter cable (ID: 11ad:0001) */ +#define SANWA_VENDOR_ID 0x11ad +#define SANWA_PRODUCT_ID 0x0001 --- linux-2.6.24.orig/drivers/usb/serial/ti_usb_3410_5052.c +++ linux-2.6.24/drivers/usb/serial/ti_usb_3410_5052.c @@ -264,8 +264,8 @@ .description = "TI USB 3410 1 port adapter", .usb_driver = &ti_usb_driver, .id_table = ti_id_table_3410, - .num_interrupt_in = 1, - .num_bulk_in = 1, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = 1, .num_ports = 1, .attach = ti_startup, --- linux-2.6.24.orig/drivers/usb/serial/visor.c +++ linux-2.6.24/drivers/usb/serial/visor.c @@ -191,7 +191,7 @@ .id_table = id_table, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = 2, - .num_bulk_out = 2, + .num_bulk_out = NUM_DONT_CARE, .num_ports = 2, .open = visor_open, .close = visor_close, --- linux-2.6.24.orig/drivers/usb/serial/keyspan.h +++ linux-2.6.24/drivers/usb/serial/keyspan.h @@ -637,6 +637,7 @@ .description = "Keyspan - (without firmware)", .id_table = keyspan_pre_ids, .num_interrupt_in = NUM_DONT_CARE, + .num_interrupt_out = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = NUM_DONT_CARE, .num_ports = 1, @@ -651,6 +652,7 @@ .description = "Keyspan 1 port adapter", .id_table = keyspan_1port_ids, .num_interrupt_in = NUM_DONT_CARE, + .num_interrupt_out = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = NUM_DONT_CARE, .num_ports = 1, @@ -678,6 +680,7 @@ .description = "Keyspan 2 port adapter", .id_table = keyspan_2port_ids, .num_interrupt_in = NUM_DONT_CARE, + .num_interrupt_out = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = NUM_DONT_CARE, .num_ports = 2, @@ -705,6 +708,7 @@ .description = "Keyspan 4 port adapter", .id_table = keyspan_4port_ids, .num_interrupt_in = NUM_DONT_CARE, + .num_interrupt_out = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = NUM_DONT_CARE, .num_ports = 4, --- linux-2.6.24.orig/drivers/usb/serial/usb-serial.c +++ linux-2.6.24/drivers/usb/serial/usb-serial.c @@ -540,6 +540,18 @@ return -EINVAL; } +static int serial_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) +{ + struct usb_serial_port *port = tty->driver_data; + + dbg("%s - port %d", __func__, port->number); + + if (port->serial->type->get_icount) + return port->serial->type->get_icount(tty, icount); + return -EINVAL; +} + /* * We would be calling tty_wakeup here, but unfortunately some line * disciplines have an annoying habit of calling tty->write from @@ -844,6 +856,7 @@ serial->num_interrupt_in = num_interrupt_in; serial->num_interrupt_out = num_interrupt_out; +#if 0 /* check that the device meets the driver's requirements */ if ((type->num_interrupt_in != NUM_DONT_CARE && type->num_interrupt_in != num_interrupt_in) @@ -857,6 +870,7 @@ kfree(serial); return -EIO; } +#endif /* found all that we need */ dev_info(&interface->dev, "%s converter detected\n", @@ -1143,6 +1157,7 @@ .read_proc = serial_read_proc, .tiocmget = serial_tiocmget, .tiocmset = serial_tiocmset, + .get_icount = serial_get_icount, }; struct tty_driver *usb_serial_tty_driver; --- linux-2.6.24.orig/drivers/usb/serial/airprime.c +++ linux-2.6.24/drivers/usb/serial/airprime.c @@ -18,6 +18,16 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ + { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */ + { USB_DEVICE(0x0930, 0x1303) }, /* Toshiba (Novatel Wireless) HSDPA for M400 */ + { USB_DEVICE(0x106c, 0x3701) }, /* Audiovox PC5740 */ + { USB_DEVICE(0x106c, 0x3702) }, /* Sprint Pantech PX-500 DGE */ + { USB_DEVICE(0x1410, 0x4100) }, /* Novatel Wireless U727 */ + { USB_DEVICE(0x1410, 0x5100) }, /* Novatel Wireless U727 newer */ + { USB_DEVICE(0x1410, 0x6000) }, /* Novatel Wireless U760 */ + { USB_DEVICE(0x12d1, 0x1003) }, /* Huawei E220 */ + { USB_DEVICE(0x05c6, 0x6000) }, /* Momo design */ + { USB_DEVICE(0xf3d0, 0x0112) }, /* AirPrime 5220 */ { }, }; MODULE_DEVICE_TABLE(usb, id_table); --- linux-2.6.24.orig/drivers/usb/serial/mos7840.c +++ linux-2.6.24/drivers/usb/serial/mos7840.c @@ -2433,6 +2433,9 @@ case TIOCGICOUNT: cnow = mos7840_port->icount; smp_rmb(); + + memset(&icount, 0, sizeof(struct serial_icounter_struct)); + icount.cts = cnow.cts; icount.dsr = cnow.dsr; icount.rng = cnow.rng; --- linux-2.6.24.orig/drivers/usb/serial/option.c +++ linux-2.6.24/drivers/usb/serial/option.c @@ -180,6 +180,7 @@ { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */ { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ + { USB_DEVICE(DELL_VENDOR_ID, 0x8133) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */ { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */ { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, --- linux-2.6.24.orig/drivers/usb/serial/ftdi_sio.h +++ linux-2.6.24/drivers/usb/serial/ftdi_sio.h @@ -98,6 +98,13 @@ #define FTDI_MTXORB_5_PID 0xFA05 /* Matrix Orbital Product Id */ #define FTDI_MTXORB_6_PID 0xFA06 /* Matrix Orbital Product Id */ +/* + * The following are the values for the Matrix Orbital VK204-25-USB + * display, which use the FT232RL. + */ +#define MTXORB_VK_VID 0x1b3d +#define MTXORB_VK_PID 0x0158 + /* Interbiometrics USB I/O Board */ /* Developed for Interbiometrics by Rudolf Gugler */ #define INTERBIOMETRICS_VID 0x1209 --- linux-2.6.24.orig/drivers/usb/storage/transport.c +++ linux-2.6.24/drivers/usb/storage/transport.c @@ -1010,7 +1010,8 @@ US_DEBUGP("Bulk Status S 0x%x T 0x%x R %u Stat 0x%x\n", le32_to_cpu(bcs->Signature), bcs->Tag, residue, bcs->Status); - if (bcs->Tag != us->tag || bcs->Status > US_BULK_STAT_PHASE) { + if (!(bcs->Tag == us->tag || (us->flags & US_FL_BULK_IGNORE_TAG)) || + bcs->Status > US_BULK_STAT_PHASE) { US_DEBUGP("Bulk logical error\n"); return USB_STOR_TRANSPORT_ERROR; } --- linux-2.6.24.orig/drivers/usb/storage/protocol.c +++ linux-2.6.24/drivers/usb/storage/protocol.c @@ -194,7 +194,7 @@ * and the starting offset within the page, and update * the *offset and *index values for the next loop. */ cnt = 0; - while (cnt < buflen) { + while (cnt < buflen && sg) { struct page *page = sg_page(sg) + ((sg->offset + *offset) >> PAGE_SHIFT); unsigned int poff = @@ -249,7 +249,8 @@ unsigned int offset = 0; struct scatterlist *sg = NULL; - usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset, + buflen = min(buflen, srb->request_bufflen); + buflen = usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset, TO_XFER_BUF); if (buflen < srb->request_bufflen) srb->resid = srb->request_bufflen - buflen; --- linux-2.6.24.orig/drivers/usb/storage/unusual_devs.h +++ linux-2.6.24/drivers/usb/storage/unusual_devs.h @@ -161,6 +161,27 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_MAX_SECTORS_64 ), +/* Reported by Filip Joelsson */ +UNUSUAL_DEV( 0x0421, 0x005d, 0x0001, 0x0600, + "Nokia", + "Nokia 3110c", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + +/* Reported by CSECSY Laszlo */ +UNUSUAL_DEV( 0x0421, 0x0063, 0x0001, 0x0601, + "Nokia", + "Nokia 3109c", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + +/* Patch for Nokia 5310 capacity */ +UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591, + "Nokia", + "5310", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + /* Reported by Mario Rettig */ UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, "Nokia", @@ -226,6 +247,35 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_MAX_SECTORS_64 ), +/* Reported by Cedric Godin */ +UNUSUAL_DEV( 0x0421, 0x04b9, 0x0500, 0x0551, + "Nokia", + "5300", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + +/* Reported by Richard Nauber */ +UNUSUAL_DEV( 0x0421, 0x04fa, 0x0550, 0x0660, + "Nokia", + "6300", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + +/* Patch for Nokia 5310 capacity */ +UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591, + "Nokia", + "5310", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + +/* Submitted by Ricky Wong Yung Fei */ +/* Nokia 7610 Supernova - Too many sectors reported in usb storage mode */ +UNUSUAL_DEV( 0x0421, 0x00f5, 0x0000, 0x0470, + "Nokia", + "7610 Supernova", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + /* Reported by Olaf Hering from novell bug #105878 */ UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210, "SMSC", @@ -276,6 +326,18 @@ US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0), #endif +/* Reported by Tamas Kerecsen + * Obviously the PROM has not been customized by the VAR; + * the Vendor and Product string descriptors are: + * Generic Mass Storage (PROTOTYPE--Remember to change idVendor) + * Generic Manufacturer (PROTOTYPE--Remember to change idVendor) + */ +UNUSUAL_DEV( 0x045e, 0xffff, 0x0000, 0x0000, + "Mitac", + "GPS", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_MAX_SECTORS_64 ), + /* * This virtual floppy is found in Sun equipment (x4600, x4200m2, etc.) * Reported by Pete Zaitcev @@ -306,6 +368,13 @@ "Finecam S5", US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY), +/* Patch submitted by Jens Taprogge */ +UNUSUAL_DEV( 0x0482, 0x0107, 0x0100, 0x0100, + "Kyocera", + "CONTAX SL300R T*", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY | US_FL_NOT_LOCKABLE), + /* Reported by Paul Stewart * This entry is needed because the device reports Sub=ff */ UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001, @@ -328,6 +397,13 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), +/* Reported by Tobias Kunze Briseno */ +UNUSUAL_DEV( 0x04b0, 0x0403, 0x0200, 0x0200, + "NIKON", + "NIKON DSC D2H", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY), + /* Reported by Milinevsky Dmitry */ UNUSUAL_DEV( 0x04b0, 0x0409, 0x0100, 0x0100, "NIKON", @@ -357,14 +433,14 @@ US_FL_FIX_CAPACITY), /* Reported by Emil Larsson */ -UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0101, +UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0111, "NIKON", "NIKON DSC D80", US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), /* Reported by Ortwin Glueck */ -UNUSUAL_DEV( 0x04b0, 0x0413, 0x0110, 0x0110, +UNUSUAL_DEV( 0x04b0, 0x0413, 0x0110, 0x0111, "NIKON", "NIKON DSC D40", US_SC_DEVICE, US_PR_DEVICE, NULL, @@ -384,6 +460,13 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), +/* Reported by paul ready */ +UNUSUAL_DEV( 0x04b0, 0x0419, 0x0100, 0x0200, + "NIKON", + "NIKON DSC D300", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY), + /* Reported by Doug Maxey (dwm@austin.ibm.com) */ UNUSUAL_DEV( 0x04b3, 0x4001, 0x0110, 0x0110, "IBM", @@ -557,6 +640,13 @@ US_FL_SINGLE_LUN), #endif +/* Reported by Dmitry Khlystov */ +UNUSUAL_DEV( 0x04e8, 0x507c, 0x0220, 0x0220, + "Samsung", + "YP-U3", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_MAX_SECTORS_64), + /* Reported by Bob Sass -- only rev 1.33 tested */ UNUSUAL_DEV( 0x050d, 0x0115, 0x0133, 0x0133, "Belkin", @@ -947,6 +1037,13 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY ), +/* Reported by Adrian Pilchowiec */ +UNUSUAL_DEV( 0x071b, 0x3203, 0x0000, 0x0000, + "RockChip", + "MP3", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_NO_WP_DETECT | US_FL_MAX_SECTORS_64), + /* Reported by Massimiliano Ghilardi * This USB MP3/AVI player device fails and disconnects if more than 128 * sectors (64kB) are read/written in a single command, and may be present @@ -1176,6 +1273,13 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY), +/* Reported by Luciano Rocha */ +UNUSUAL_DEV( 0x0840, 0x0082, 0x0001, 0x0001, + "Argosy", + "Storage", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY), + /* Entry and supporting patch by Theodore Kilgore . * Flag will support Bulk devices which use a standards-violating 32-byte * Command Block Wrapper. Here, the "DC2MEGA" cameras (several brands) with @@ -1330,6 +1434,13 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY), +/* Reported by Rohan Hart */ +UNUSUAL_DEV( 0x2770, 0x915d, 0x0010, 0x0010, + "INTOVA", + "Pixtreme", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + /* * Entry for Jenoptik JD 5200z3 * @@ -1412,6 +1523,17 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64), +/* Patch by Leonid Petrov mail at lpetrov.net + * Reported by Robert Spitzenpfeil + * http://www.qbik.ch/usb/devices/showdev.php?id=1705 + * Updated to 103 device by MJ Ray mjr at phonecoop.coop + */ +UNUSUAL_DEV( 0x0f19, 0x0103, 0x0100, 0x0100, + "Oracom Co., Ltd", + "ORC-200M", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_RESIDUE ), + /* David Kuehling : * for MP3-Player AVOX WSX-300ER (bought in Japan). Reports lots of SCSI * errors when trying to write. @@ -1463,7 +1585,7 @@ "Sony Ericsson", "M600i", US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_FIX_CAPACITY ), + US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ), /* Reported by Kevin Cernekee * Tested on hardware version 1.10. @@ -1477,6 +1599,15 @@ US_SC_DEVICE, US_PR_DEVICE, usb_stor_ucr61s2b_init, 0 ), +/* Reported by Fabio Venturi + * The device reports a vendor-specific bDeviceClass. + */ +UNUSUAL_DEV( 0x10d6, 0x2200, 0x0100, 0x0100, + "Actions Semiconductor", + "Mtp device", + US_SC_DEVICE, US_PR_DEVICE, NULL, + 0), + /* Reported by Kevin Lloyd * Entry is needed for the initializer function override, * which instructs the device to load as a modem @@ -1550,13 +1681,35 @@ /* * Patch by Pete Zaitcev * Report by Mark Patton. Red Hat bz#208928. + * Added support for rev 0x0002 (Motorola ROKR W5) + * by Javier Smaldone */ -UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0001, +UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0002, "Motorola", - "RAZR V3i", + "RAZR V3i/ROKR W5", US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), +/* + * Patch by Jost Diederichs + */ +UNUSUAL_DEV(0x22b8, 0x6410, 0x0001, 0x9999, + "Motorola Inc.", + "Motorola Phone (RAZRV3xx)", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY), + +/* + * Patch by Constantin Baranov + * Report by Andreas Koenecke. + * Motorola ROKR Z6. + */ +UNUSUAL_DEV( 0x22b8, 0x6426, 0x0101, 0x0101, + "Motorola", + "MSnc.", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_INQUIRY | US_FL_FIX_CAPACITY | US_FL_BULK_IGNORE_TAG), + /* Reported by Radovan Garabik */ UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, "MPIO", @@ -1588,6 +1741,11 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_CAPACITY_HEURISTICS), +UNUSUAL_DEV( 0Xed10, 0x7636, 0x0001, 0x0001, + "TGE", + "Digital MP3 Audio Player", + US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ), + /* Control/Bulk transport for all SubClass values */ USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR), USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR), --- linux-2.6.24.orig/drivers/usb/class/cdc-acm.c +++ linux-2.6.24/drivers/usb/class/cdc-acm.c @@ -1183,6 +1183,9 @@ { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ }, + { USB_DEVICE(0x0e8d,0x0003), /* MediaTek Inc MT6227 */ + .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ + }, /* control interfaces with various AT-command sets */ { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, --- linux-2.6.24.orig/drivers/usb/class/usblp.c +++ linux-2.6.24/drivers/usb/class/usblp.c @@ -428,6 +428,7 @@ usblp->rcomplete = 0; if (handle_bidir(usblp) < 0) { + usb_autopm_put_interface(intf); usblp->used = 0; file->private_data = NULL; retval = -EIO; --- linux-2.6.24.orig/drivers/usb/gadget/ether.c +++ linux-2.6.24/drivers/usb/gadget/ether.c @@ -1561,6 +1561,7 @@ memcpy(req->buf, buf, n); req->complete = rndis_response_complete; rndis_free_response(dev->rndis_config, buf); + value = n; } /* else stalls ... spec says to avoid that */ } --- linux-2.6.24.orig/drivers/usb/host/ohci.h +++ linux-2.6.24/drivers/usb/host/ohci.h @@ -399,6 +399,8 @@ #define OHCI_QUIRK_ZFMICRO 0x20 /* Compaq ZFMicro chipset*/ #define OHCI_QUIRK_NEC 0x40 /* lost interrupts */ #define OHCI_QUIRK_FRAME_NO 0x80 /* no big endian frame_no shift */ +#define OHCI_QUIRK_HUB_POWER 0x100 /* distrust firmware power/oc setup */ +#define OHCI_QUIRK_AMD_ISO 0x200 /* ISO transfers*/ // there are also chip quirks/bugs in init logic struct work_struct nec_work; /* Worker for NEC quirk */ @@ -419,6 +421,10 @@ { return ohci->flags & OHCI_QUIRK_ZFMICRO; } +static inline int quirk_amdiso(struct ohci_hcd *ohci) +{ + return ohci->flags & OHCI_QUIRK_AMD_ISO; +} #else static inline int quirk_nec(struct ohci_hcd *ohci) { @@ -428,6 +434,10 @@ { return 0; } +static inline int quirk_amdiso(struct ohci_hcd *ohci) +{ + return 0; +} #endif /* convert between an hcd pointer and the corresponding ohci_hcd */ --- linux-2.6.24.orig/drivers/usb/host/ehci-dbg.c +++ linux-2.6.24/drivers/usb/host/ehci-dbg.c @@ -763,9 +763,7 @@ } if (ehci->reclaim) { - temp = scnprintf (next, size, "reclaim qh %p%s\n", - ehci->reclaim, - ehci->reclaim_ready ? " ready" : ""); + temp = scnprintf(next, size, "reclaim qh %p\n", ehci->reclaim); size -= temp; next += temp; } --- linux-2.6.24.orig/drivers/usb/host/ohci-pci.c +++ linux-2.6.24/drivers/usb/host/ohci-pci.c @@ -18,6 +18,28 @@ #error "This file is PCI bus glue. CONFIG_PCI must be defined." #endif +#include +#include + + +/* constants used to work around PM-related transfer + * glitches in some AMD 700 series southbridges + */ +#define AB_REG_BAR 0xf0 +#define AB_INDX(addr) ((addr) + 0x00) +#define AB_DATA(addr) ((addr) + 0x04) +#define AX_INDXC 0X30 +#define AX_DATAC 0x34 + +#define NB_PCIE_INDX_ADDR 0xe0 +#define NB_PCIE_INDX_DATA 0xe4 +#define PCIE_P_CNTL 0x10040 +#define BIF_NB 0x10002 + +static struct pci_dev *amd_smbus_dev; +static struct pci_dev *amd_hb_dev; +static int amd_ohci_iso_count; + /*-------------------------------------------------------------------------*/ static int broken_suspend(struct usb_hcd *hcd) @@ -143,6 +165,103 @@ return 0; } +static int ohci_quirk_amd700(struct usb_hcd *hcd) +{ + struct ohci_hcd *ohci = hcd_to_ohci(hcd); + u8 rev = 0; + + if (!amd_smbus_dev) + amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI, + PCI_DEVICE_ID_ATI_SBX00_SMBUS, NULL); + if (!amd_smbus_dev) + return 0; + + pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev); + if ((rev > 0x3b) || (rev < 0x30)) { + pci_dev_put(amd_smbus_dev); + amd_smbus_dev = NULL; + return 0; + } + + amd_ohci_iso_count++; + + if (!amd_hb_dev) + amd_hb_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x9600, NULL); + + ohci->flags |= OHCI_QUIRK_AMD_ISO; + ohci_dbg(ohci, "enabled AMD ISO transfers quirk\n"); + + return 0; +} + +/* + * The hardware normally enables the A-link power management feature, which + * lets the system lower the power consumption in idle states. + * + * Assume the system is configured to have USB 1.1 ISO transfers going + * to or from a USB device. Without this quirk, that stream may stutter + * or have breaks occasionally. For transfers going to speakers, this + * makes a very audible mess... + * + * That audio playback corruption is due to the audio stream getting + * interrupted occasionally when the link goes in lower power state + * This USB quirk prevents the link going into that lower power state + * during audio playback or other ISO operations. + */ +static void quirk_amd_pll(int on) +{ + u32 addr; + u32 val; + u32 bit = (on > 0) ? 1 : 0; + + pci_read_config_dword(amd_smbus_dev, AB_REG_BAR, &addr); + + /* BIT names/meanings are NDA-protected, sorry ... */ + + outl(AX_INDXC, AB_INDX(addr)); + outl(0x40, AB_DATA(addr)); + outl(AX_DATAC, AB_INDX(addr)); + val = inl(AB_DATA(addr)); + val &= ~((1 << 3) | (1 << 4) | (1 << 9)); + val |= (bit << 3) | ((!bit) << 4) | ((!bit) << 9); + outl(val, AB_DATA(addr)); + + if (amd_hb_dev) { + addr = PCIE_P_CNTL; + pci_write_config_dword(amd_hb_dev, NB_PCIE_INDX_ADDR, addr); + + pci_read_config_dword(amd_hb_dev, NB_PCIE_INDX_DATA, &val); + val &= ~(1 | (1 << 3) | (1 << 4) | (1 << 9) | (1 << 12)); + val |= bit | (bit << 3) | (bit << 12); + val |= ((!bit) << 4) | ((!bit) << 9); + pci_write_config_dword(amd_hb_dev, NB_PCIE_INDX_DATA, val); + + addr = BIF_NB; + pci_write_config_dword(amd_hb_dev, NB_PCIE_INDX_ADDR, addr); + + pci_read_config_dword(amd_hb_dev, NB_PCIE_INDX_DATA, &val); + val &= ~(1 << 8); + val |= bit << 8; + pci_write_config_dword(amd_hb_dev, NB_PCIE_INDX_DATA, val); + } +} + +static void amd_iso_dev_put(void) +{ + amd_ohci_iso_count--; + if (amd_ohci_iso_count == 0) { + if (amd_smbus_dev) { + pci_dev_put(amd_smbus_dev); + amd_smbus_dev = NULL; + } + if (amd_hb_dev) { + pci_dev_put(amd_hb_dev); + amd_hb_dev = NULL; + } + } + +} + /* List of quirks for OHCI */ static const struct pci_device_id ohci_pci_quirks[] = { { @@ -181,6 +300,19 @@ PCI_DEVICE(PCI_VENDOR_ID_ITE, 0x8152), .driver_data = (unsigned long) broken_suspend, }, + { + PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4397), + .driver_data = (unsigned long)ohci_quirk_amd700, + }, + { + PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4398), + .driver_data = (unsigned long)ohci_quirk_amd700, + }, + { + PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399), + .driver_data = (unsigned long)ohci_quirk_amd700, + }, + /* FIXME for some of the early AMD 760 southbridges, OHCI * won't work at all. blacklist them. */ --- linux-2.6.24.orig/drivers/usb/host/ehci-pci.c +++ linux-2.6.24/drivers/usb/host/ehci-pci.c @@ -305,7 +305,7 @@ /* emptying the schedule aborts any urbs */ spin_lock_irq(&ehci->lock); if (ehci->reclaim) - ehci->reclaim_ready = 1; + end_unlink_async(ehci); ehci_work(ehci); spin_unlock_irq(&ehci->lock); --- linux-2.6.24.orig/drivers/usb/host/ehci-hub.c +++ linux-2.6.24/drivers/usb/host/ehci-hub.c @@ -123,6 +123,8 @@ if (time_before (jiffies, ehci->next_statechange)) msleep(5); + del_timer_sync(&ehci->watchdog); + del_timer_sync(&ehci->iaa_watchdog); port = HCS_N_PORTS (ehci->hcs_params); spin_lock_irq (&ehci->lock); @@ -134,7 +136,7 @@ } ehci->command = ehci_readl(ehci, &ehci->regs->command); if (ehci->reclaim) - ehci->reclaim_ready = 1; + end_unlink_async(ehci); ehci_work(ehci); /* Unlike other USB host controller types, EHCI doesn't have @@ -171,7 +173,6 @@ } /* turn off now-idle HC */ - del_timer_sync (&ehci->watchdog); ehci_halt (ehci); hcd->state = HC_STATE_SUSPENDED; @@ -606,7 +607,7 @@ } break; case USB_PORT_FEAT_C_SUSPEND: - /* we auto-clear this feature */ + clear_bit(wIndex, &ehci->port_c_suspend); break; case USB_PORT_FEAT_POWER: if (HCS_PPC (ehci->hcs_params)) @@ -685,7 +686,7 @@ /* resume completed? */ else if (time_after_eq(jiffies, ehci->reset_done[wIndex])) { - status |= 1 << USB_PORT_FEAT_C_SUSPEND; + set_bit(wIndex, &ehci->port_c_suspend); ehci->reset_done[wIndex] = 0; /* stop resume signaling */ @@ -762,6 +763,8 @@ status |= 1 << USB_PORT_FEAT_RESET; if (temp & PORT_POWER) status |= 1 << USB_PORT_FEAT_POWER; + if (test_bit(wIndex, &ehci->port_c_suspend)) + status |= 1 << USB_PORT_FEAT_C_SUSPEND; #ifndef EHCI_VERBOSE_DEBUG if (status & ~0xffff) /* only if wPortChange is interesting */ --- linux-2.6.24.orig/drivers/usb/host/ehci-hcd.c +++ linux-2.6.24/drivers/usb/host/ehci-hcd.c @@ -109,7 +109,7 @@ #define EHCI_TUNE_MULT_TT 1 #define EHCI_TUNE_FLS 2 /* (small) 256 frame schedule */ -#define EHCI_IAA_JIFFIES (HZ/100) /* arbitrary; ~10 msec */ +#define EHCI_IAA_MSECS 10 /* arbitrary */ #define EHCI_IO_JIFFIES (HZ/10) /* io watchdog > irq_thresh */ #define EHCI_ASYNC_JIFFIES (HZ/20) /* async idle timeout */ #define EHCI_SHRINK_JIFFIES (HZ/200) /* async qh unlink delay */ @@ -266,6 +266,7 @@ /*-------------------------------------------------------------------------*/ +static void end_unlink_async(struct ehci_hcd *ehci); static void ehci_work(struct ehci_hcd *ehci); #include "ehci-hub.c" @@ -275,25 +276,62 @@ /*-------------------------------------------------------------------------*/ -static void ehci_watchdog (unsigned long param) +static void ehci_iaa_watchdog(unsigned long param) { struct ehci_hcd *ehci = (struct ehci_hcd *) param; unsigned long flags; spin_lock_irqsave (&ehci->lock, flags); - /* lost IAA irqs wedge things badly; seen with a vt8235 */ - if (ehci->reclaim) { - u32 status = ehci_readl(ehci, &ehci->regs->status); - if (status & STS_IAA) { - ehci_vdbg (ehci, "lost IAA\n"); + /* Lost IAA irqs wedge things badly; seen first with a vt8235. + * So we need this watchdog, but must protect it against both + * (a) SMP races against real IAA firing and retriggering, and + * (b) clean HC shutdown, when IAA watchdog was pending. + */ + if (ehci->reclaim + && !timer_pending(&ehci->iaa_watchdog) + && HC_IS_RUNNING(ehci_to_hcd(ehci)->state)) { + u32 cmd, status; + + /* If we get here, IAA is *REALLY* late. It's barely + * conceivable that the system is so busy that CMD_IAAD + * is still legitimately set, so let's be sure it's + * clear before we read STS_IAA. (The HC should clear + * CMD_IAAD when it sets STS_IAA.) + */ + cmd = ehci_readl(ehci, &ehci->regs->command); + if (cmd & CMD_IAAD) + ehci_writel(ehci, cmd & ~CMD_IAAD, + &ehci->regs->command); + + /* If IAA is set here it either legitimately triggered + * before we cleared IAAD above (but _way_ late, so we'll + * still count it as lost) ... or a silicon erratum: + * - VIA seems to set IAA without triggering the IRQ; + * - IAAD potentially cleared without setting IAA. + */ + status = ehci_readl(ehci, &ehci->regs->status); + if ((status & STS_IAA) || !(cmd & CMD_IAAD)) { COUNT (ehci->stats.lost_iaa); ehci_writel(ehci, STS_IAA, &ehci->regs->status); - ehci->reclaim_ready = 1; } + + ehci_vdbg(ehci, "IAA watchdog: status %x cmd %x\n", + status, cmd); + end_unlink_async(ehci); } - /* stop async processing after it's idled a bit */ + spin_unlock_irqrestore(&ehci->lock, flags); +} + +static void ehci_watchdog(unsigned long param) +{ + struct ehci_hcd *ehci = (struct ehci_hcd *) param; + unsigned long flags; + + spin_lock_irqsave(&ehci->lock, flags); + + /* stop async processing after it's idled a bit */ if (test_bit (TIMER_ASYNC_OFF, &ehci->actions)) start_unlink_async (ehci, ehci->async); @@ -363,8 +401,6 @@ static void ehci_work (struct ehci_hcd *ehci) { timer_action_done (ehci, TIMER_IO_WATCHDOG); - if (ehci->reclaim_ready) - end_unlink_async (ehci); /* another CPU may drop ehci->lock during a schedule scan while * it reports urb completions. this flag guards against bogus @@ -399,6 +435,7 @@ /* no more interrupts ... */ del_timer_sync (&ehci->watchdog); + del_timer_sync(&ehci->iaa_watchdog); spin_lock_irq(&ehci->lock); if (HC_IS_RUNNING (hcd->state)) @@ -447,6 +484,10 @@ ehci->watchdog.function = ehci_watchdog; ehci->watchdog.data = (unsigned long) ehci; + init_timer(&ehci->iaa_watchdog); + ehci->iaa_watchdog.function = ehci_iaa_watchdog; + ehci->iaa_watchdog.data = (unsigned long) ehci; + /* * hw default: 1K periodic list heads, one per frame. * periodic_size can shrink by USBCMD update if hcc_params allows. @@ -463,7 +504,6 @@ ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params); ehci->reclaim = NULL; - ehci->reclaim_ready = 0; ehci->next_uframe = -1; /* @@ -611,7 +651,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) { struct ehci_hcd *ehci = hcd_to_ehci (hcd); - u32 status, pcd_status = 0; + u32 status, pcd_status = 0, cmd; int bh; spin_lock (&ehci->lock); @@ -632,7 +672,7 @@ /* clear (just) interrupts */ ehci_writel(ehci, status, &ehci->regs->status); - ehci_readl(ehci, &ehci->regs->command); /* unblock posted write */ + cmd = ehci_readl(ehci, &ehci->regs->command); bh = 0; #ifdef EHCI_VERBOSE_DEBUG @@ -653,9 +693,17 @@ /* complete the unlinking of some qh [4.15.2.3] */ if (status & STS_IAA) { - COUNT (ehci->stats.reclaim); - ehci->reclaim_ready = 1; - bh = 1; + /* guard against (alleged) silicon errata */ + if (cmd & CMD_IAAD) { + ehci_writel(ehci, cmd & ~CMD_IAAD, + &ehci->regs->command); + ehci_dbg(ehci, "IAA with IAAD still set?\n"); + } + if (ehci->reclaim) { + COUNT(ehci->stats.reclaim); + end_unlink_async(ehci); + } else + ehci_dbg(ehci, "IAA with nothing to reclaim?\n"); } /* remote wakeup [4.3.1] */ @@ -761,10 +809,16 @@ static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) { - /* if we need to use IAA and it's busy, defer */ - if (qh->qh_state == QH_STATE_LINKED - && ehci->reclaim - && HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) { + /* failfast */ + if (!HC_IS_RUNNING(ehci_to_hcd(ehci)->state) && ehci->reclaim) + end_unlink_async(ehci); + + /* if it's not linked then there's nothing to do */ + if (qh->qh_state != QH_STATE_LINKED) + ; + + /* defer till later if busy */ + else if (ehci->reclaim) { struct ehci_qh *last; for (last = ehci->reclaim; @@ -774,12 +828,8 @@ qh->qh_state = QH_STATE_UNLINK_WAIT; last->reclaim = qh; - /* bypass IAA if the hc can't care */ - } else if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state) && ehci->reclaim) - end_unlink_async (ehci); - - /* something else might have unlinked the qh by now */ - if (qh->qh_state == QH_STATE_LINKED) + /* start IAA cycle */ + } else start_unlink_async (ehci, qh); } @@ -806,7 +856,19 @@ qh = (struct ehci_qh *) urb->hcpriv; if (!qh) break; - unlink_async (ehci, qh); + switch (qh->qh_state) { + case QH_STATE_LINKED: + case QH_STATE_COMPLETING: + unlink_async(ehci, qh); + break; + case QH_STATE_UNLINK: + case QH_STATE_UNLINK_WAIT: + /* already started */ + break; + case QH_STATE_IDLE: + WARN_ON(1); + break; + } break; case PIPE_INTERRUPT: @@ -898,6 +960,7 @@ unlink_async (ehci, qh); /* FALL THROUGH */ case QH_STATE_UNLINK: /* wait for hw to finish? */ + case QH_STATE_UNLINK_WAIT: idle_timeout: spin_unlock_irqrestore (&ehci->lock, flags); schedule_timeout_uninterruptible(1); --- linux-2.6.24.orig/drivers/usb/host/ohci-q.c +++ linux-2.6.24/drivers/usb/host/ohci-q.c @@ -49,6 +49,9 @@ switch (usb_pipetype (urb->pipe)) { case PIPE_ISOCHRONOUS: ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs--; + if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0 + && quirk_amdiso(ohci)) + quirk_amd_pll(1); break; case PIPE_INTERRUPT: ohci_to_hcd(ohci)->self.bandwidth_int_reqs--; @@ -680,6 +683,9 @@ data + urb->iso_frame_desc [cnt].offset, urb->iso_frame_desc [cnt].length, urb, cnt); } + if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0 + && quirk_amdiso(ohci)) + quirk_amd_pll(0); periodic = ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs++ == 0 && ohci_to_hcd(ohci)->self.bandwidth_int_reqs == 0; break; --- linux-2.6.24.orig/drivers/usb/host/ohci-hcd.c +++ linux-2.6.24/drivers/usb/host/ohci-hcd.c @@ -85,6 +85,21 @@ static int ohci_restart (struct ohci_hcd *ohci); #endif +#ifdef CONFIG_PCI +static void quirk_amd_pll(int state); +static void amd_iso_dev_put(void); +#else +static inline void quirk_amd_pll(int state) +{ + return; +} +static inline void amd_iso_dev_put(void) +{ + return; +} +#endif + + #include "ohci-hub.c" #include "ohci-dbg.c" #include "ohci-mem.c" @@ -885,6 +900,8 @@ if (quirk_zfmicro(ohci)) del_timer(&ohci->unlink_watchdog); + if (quirk_amdiso(ohci)) + amd_iso_dev_put(); remove_debug_files (ohci); ohci_mem_cleanup (ohci); --- linux-2.6.24.orig/drivers/usb/host/ehci.h +++ linux-2.6.24/drivers/usb/host/ehci.h @@ -74,7 +74,6 @@ /* async schedule support */ struct ehci_qh *async; struct ehci_qh *reclaim; - unsigned reclaim_ready : 1; unsigned scanning : 1; /* periodic schedule support */ @@ -98,6 +97,8 @@ dedicated to the companion controller */ unsigned long owned_ports; /* which ports are owned by the companion during a bus suspend */ + unsigned long port_c_suspend; /* which ports have + the change-suspend feature turned on */ /* per-HC memory pools (could be per-bus, but ...) */ struct dma_pool *qh_pool; /* qh per active urb */ @@ -105,6 +106,7 @@ struct dma_pool *itd_pool; /* itd per iso urb */ struct dma_pool *sitd_pool; /* sitd per split iso urb */ + struct timer_list iaa_watchdog; struct timer_list watchdog; unsigned long actions; unsigned stamp; @@ -140,9 +142,21 @@ } +static inline void +iaa_watchdog_start(struct ehci_hcd *ehci) +{ + WARN_ON(timer_pending(&ehci->iaa_watchdog)); + mod_timer(&ehci->iaa_watchdog, + jiffies + msecs_to_jiffies(EHCI_IAA_MSECS)); +} + +static inline void iaa_watchdog_done(struct ehci_hcd *ehci) +{ + del_timer(&ehci->iaa_watchdog); +} + enum ehci_timer_action { TIMER_IO_WATCHDOG, - TIMER_IAA_WATCHDOG, TIMER_ASYNC_SHRINK, TIMER_ASYNC_OFF, }; @@ -160,9 +174,6 @@ unsigned long t; switch (action) { - case TIMER_IAA_WATCHDOG: - t = EHCI_IAA_JIFFIES; - break; case TIMER_IO_WATCHDOG: t = EHCI_IO_JIFFIES; break; @@ -179,8 +190,7 @@ // async queue SHRINK often precedes IAA. while it's ready // to go OFF neither can matter, and afterwards the IO // watchdog stops unless there's still periodic traffic. - if (action != TIMER_IAA_WATCHDOG - && t > ehci->watchdog.expires + if (time_before_eq(t, ehci->watchdog.expires) && timer_pending (&ehci->watchdog)) return; mod_timer (&ehci->watchdog, t); --- linux-2.6.24.orig/drivers/usb/host/u132-hcd.c +++ linux-2.6.24/drivers/usb/host/u132-hcd.c @@ -3213,15 +3213,20 @@ dev_err(&u132->platform_dev->dev, "device is being removed\n"); return -ESHUTDOWN; } else { - int retval = 0; - if (state.event == PM_EVENT_FREEZE) { + int retval = 0, ports; + + switch (state.event) { + case PM_EVENT_FREEZE: retval = u132_bus_suspend(hcd); - } else if (state.event == PM_EVENT_SUSPEND) { - int ports = MAX_U132_PORTS; + break; + case PM_EVENT_SUSPEND: + case PM_EVENT_HIBERNATE: + ports = MAX_U132_PORTS; while (ports-- > 0) { port_power(u132, ports, 0); } - } + break; + } if (retval == 0) pdev->dev.power.power_state = state; return retval; --- linux-2.6.24.orig/drivers/usb/host/sl811-hcd.c +++ linux-2.6.24/drivers/usb/host/sl811-hcd.c @@ -1766,6 +1766,7 @@ retval = sl811h_bus_suspend(hcd); break; case PM_EVENT_SUSPEND: + case PM_EVENT_HIBERNATE: case PM_EVENT_PRETHAW: /* explicitly discard hw state */ port_power(sl811, 0); break; --- linux-2.6.24.orig/drivers/usb/host/ehci-q.c +++ linux-2.6.24/drivers/usb/host/ehci-q.c @@ -315,10 +315,10 @@ if (likely (last->urb != urb)) { ehci_urb_done(ehci, last->urb, last_status); count++; + last_status = -EINPROGRESS; } ehci_qtd_free (ehci, last); last = NULL; - last_status = -EINPROGRESS; } /* ignore urbs submitted during completions we reported */ @@ -973,7 +973,7 @@ struct ehci_qh *qh = ehci->reclaim; struct ehci_qh *next; - timer_action_done (ehci, TIMER_IAA_WATCHDOG); + iaa_watchdog_done(ehci); // qh->hw_next = cpu_to_hc32(qh->qh_dma); qh->qh_state = QH_STATE_IDLE; @@ -983,7 +983,6 @@ /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */ next = qh->reclaim; ehci->reclaim = next; - ehci->reclaim_ready = 0; qh->reclaim = NULL; qh_completions (ehci, qh); @@ -1059,11 +1058,10 @@ return; } - ehci->reclaim_ready = 0; cmd |= CMD_IAAD; ehci_writel(ehci, cmd, &ehci->regs->command); (void)ehci_readl(ehci, &ehci->regs->command); - timer_action (ehci, TIMER_IAA_WATCHDOG); + iaa_watchdog_start(ehci); } /*-------------------------------------------------------------------------*/ --- linux-2.6.24.orig/drivers/usb/core/message.c +++ linux-2.6.24/drivers/usb/core/message.c @@ -1189,7 +1189,10 @@ return -EINVAL; } - ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), + if (dev->quirks & USB_QUIRK_NO_SET_INTF) + ret = -EPIPE; + else + ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_INTERFACE, USB_RECIP_INTERFACE, alternate, interface, NULL, 0, 5000); --- linux-2.6.24.orig/drivers/usb/core/hub.c +++ linux-2.6.24/drivers/usb/core/hub.c @@ -327,6 +327,9 @@ return status; } +static int hub_port_status(struct usb_hub *hub, int port1, + u16 *status, u16 *change); + static void kick_khubd(struct usb_hub *hub) { unsigned long flags; @@ -602,6 +605,81 @@ kick_khubd(hub); } +#define HUB_RESET 1 +#define HUB_RESUME 2 +#define HUB_RESET_RESUME 3 + +#ifdef CONFIG_PM + +static void hub_restart(struct usb_hub *hub, int type) +{ + struct usb_device *hdev = hub->hdev; + int port1; + + /* Check each of the children to see if they require + * USB-PERSIST handling or disconnection. Also check + * each unoccupied port to make sure it is still disabled. + */ + for (port1 = 1; port1 <= hdev->maxchild; ++port1) { + struct usb_device *udev = hdev->children[port1-1]; + int status = 0; + u16 portstatus, portchange; + + if (!udev || udev->state == USB_STATE_NOTATTACHED) { + if (type != HUB_RESET) { + status = hub_port_status(hub, port1, + &portstatus, &portchange); + if (status == 0 && (portstatus & + USB_PORT_STAT_ENABLE)) + clear_port_feature(hdev, port1, + USB_PORT_FEAT_ENABLE); + } + continue; + } + + /* Was the power session lost while we were suspended? */ + switch (type) { + case HUB_RESET_RESUME: + portstatus = 0; + portchange = USB_PORT_STAT_C_CONNECTION; + break; + + case HUB_RESET: + case HUB_RESUME: + status = hub_port_status(hub, port1, + &portstatus, &portchange); + break; + } + + /* For "USB_PERSIST"-enabled children we must + * mark the child device for reset-resume and + * turn off the various status changes to prevent + * khubd from disconnecting it later. + */ + if (USB_PERSIST && udev->persist_enabled && status == 0 && + !(portstatus & USB_PORT_STAT_ENABLE)) { + if (portchange & USB_PORT_STAT_C_ENABLE) + clear_port_feature(hub->hdev, port1, + USB_PORT_FEAT_C_ENABLE); + if (portchange & USB_PORT_STAT_C_CONNECTION) + clear_port_feature(hub->hdev, port1, + USB_PORT_FEAT_C_CONNECTION); + udev->reset_resume = 1; + } + + /* Otherwise for a reset_resume we must disconnect the child, + * but as we may not lock the child device here + * we have to do a "logical" disconnect. + */ + else if (type == HUB_RESET_RESUME) + hub_port_logical_disconnect(hub, port1); + } + + hub_activate(hub); +} + +#endif /* CONFIG_PM */ + /* caller has locked the hub device */ static int hub_pre_reset(struct usb_interface *intf) { @@ -1989,49 +2067,20 @@ static int hub_resume(struct usb_interface *intf) { - struct usb_hub *hub = usb_get_intfdata (intf); - - dev_dbg(&intf->dev, "%s\n", __FUNCTION__); + struct usb_hub *hub = usb_get_intfdata(intf); - /* tell khubd to look for changes on this hub */ - hub_activate(hub); + dev_dbg(&intf->dev, "%s\n", __func__); + hub_restart(hub, HUB_RESUME); return 0; } static int hub_reset_resume(struct usb_interface *intf) { struct usb_hub *hub = usb_get_intfdata(intf); - struct usb_device *hdev = hub->hdev; - int port1; + dev_dbg(&intf->dev, "%s\n", __func__); hub_power_on(hub); - - for (port1 = 1; port1 <= hdev->maxchild; ++port1) { - struct usb_device *child = hdev->children[port1-1]; - - if (child) { - - /* For "USB_PERSIST"-enabled children we must - * mark the child device for reset-resume and - * turn off the connect-change status to prevent - * khubd from disconnecting it later. - */ - if (USB_PERSIST && child->persist_enabled) { - child->reset_resume = 1; - clear_port_feature(hdev, port1, - USB_PORT_FEAT_C_CONNECTION); - - /* Otherwise we must disconnect the child, - * but as we may not lock the child device here - * we have to do a "logical" disconnect. - */ - } else { - hub_port_logical_disconnect(hub, port1); - } - } - } - - hub_activate(hub); + hub_restart(hub, HUB_RESET_RESUME); return 0; } --- linux-2.6.24.orig/drivers/usb/core/quirks.c +++ linux-2.6.24/drivers/usb/core/quirks.c @@ -28,6 +28,9 @@ * devices is broken... */ static const struct usb_device_id usb_quirk_list[] = { + /* Action Semiconductor flash disk */ + { USB_DEVICE(0x10d6, 0x2200), .driver_info = USB_QUIRK_STRING_FETCH_255}, + /* CBM - Flash disk */ { USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME }, /* HP 5300/5370C scanner */ @@ -39,6 +42,9 @@ /* M-Systems Flash Disk Pioneers */ { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, + /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ + { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, + /* Philips PSC805 audio device */ { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, --- linux-2.6.24.orig/drivers/usb/core/devio.c +++ linux-2.6.24/drivers/usb/core/devio.c @@ -1152,8 +1152,6 @@ } } - free_async(as); - if (put_user(addr, (void __user * __user *)arg)) return -EFAULT; return 0; @@ -1184,8 +1182,11 @@ static int proc_reapurb(struct dev_state *ps, void __user *arg) { struct async *as = reap_as(ps); - if (as) - return processcompl(as, (void __user * __user *)arg); + if (as) { + int retval = processcompl(as, (void __user * __user *)arg); + free_async(as); + return retval; + } if (signal_pending(current)) return -EINTR; return -EIO; @@ -1193,11 +1194,16 @@ static int proc_reapurbnonblock(struct dev_state *ps, void __user *arg) { + int retval; struct async *as; - if (!(as = async_getcompleted(ps))) - return -EAGAIN; - return processcompl(as, (void __user * __user *)arg); + as = async_getcompleted(ps); + retval = -EAGAIN; + if (as) { + retval = processcompl(as, (void __user * __user *)arg); + free_async(as); + } + return retval; } #ifdef CONFIG_COMPAT @@ -1266,7 +1272,6 @@ } } - free_async(as); if (put_user(ptr_to_compat(addr), (u32 __user *)arg)) return -EFAULT; return 0; @@ -1275,8 +1280,11 @@ static int proc_reapurb_compat(struct dev_state *ps, void __user *arg) { struct async *as = reap_as(ps); - if (as) - return processcompl_compat(as, (void __user * __user *)arg); + if (as) { + int retval = processcompl_compat(as, (void __user * __user *)arg); + free_async(as); + return retval; + } if (signal_pending(current)) return -EINTR; return -EIO; @@ -1284,11 +1292,16 @@ static int proc_reapurbnonblock_compat(struct dev_state *ps, void __user *arg) { + int retval; struct async *as; - if (!(as = async_getcompleted(ps))) - return -EAGAIN; - return processcompl_compat(as, (void __user * __user *)arg); + retval = -EAGAIN; + as = async_getcompleted(ps); + if (as) { + retval = processcompl_compat(as, (void __user * __user *)arg); + free_async(as); + } + return retval; } #endif --- linux-2.6.24.orig/debian/control.stub.in +++ linux-2.6.24/debian/control.stub.in @@ -0,0 +1,81 @@ +Source: linux +Section: devel +Priority: optional +Maintainer: Ubuntu Kernel Team +Standards-Version: 3.6.1 +Build-Depends: debhelper (>= 3), module-init-tools, kernel-wedge (>= 2.24ubuntu1), gcc-4.1-hppa64 [hppa], binutils-hppa64 [hppa], device-tree-compiler [powerpc], gcc-4.1 [powerpc ia64], gawk [amd64 i386] +Build-Depends-Indep: xmlto, docbook-utils, gs, transfig, bzip2, sharutils + +Package: linux-kernel-devel +Architecture: all +Section: devel +Priority: optional +Depends: build-essential, git-core, gitk, rsync, curl, openssh-client, debhelper, kernel-package, kernel-wedge +Description: Linux kernel hacking dependencies + This is a dummy package that will install all possible packages + required to hack comfortably on the kernel. + +Package: linux-source-PKGVER +Architecture: all +Section: devel +Priority: optional +Provides: linux-source, linux-source-2.6 +Depends: binutils, bzip2, coreutils | fileutils (>= 4.0) +Recommends: libc-dev, gcc, make +Suggests: libncurses-dev | ncurses-dev, kernel-package, libqt3-dev +Description: Linux kernel source for version PKGVER with Ubuntu patches + This package provides the source code for the Linux kernel version PKGVER. + . + You may configure the kernel to your setup by typing "make config" and + following instructions, but you could get ncursesX.X-dev and try "make + menuconfig" for a jazzier, and easier to use interface. There are options + to use QT or GNOME based configuration interfaces, but they need + additional packages to be installed. Also, please read the detailed + documentation in the file + /usr/share/doc/linux-source-PKGVER/README.headers.gz. + . + If you wish to use this package to create a custom Linux kernel, then it + is suggested that you investigate the package kernel-package, which has + been designed to ease the task of creating kernel image packages. + . + If you are simply trying to build third-party modules for your kernel, + you do not want this package. Install the appropriate linux-headers + package instead. + +Package: linux-doc-PKGVER +Architecture: all +Section: doc +Priority: optional +Provides: linux-doc-2.6 +Conflicts: linux-doc-2.6 +Replaces: linux-doc-2.6 +Depends: coreutils | fileutils (>= 4.0) +Description: Linux kernel specific documentation for version PKGVER + This package provides the various readme's in the PKGVER kernel + Documentation/ subdirectory: these typically contain kernel-specific + installation notes for some drivers for example. See + /usr/share/doc/linux-doc-PKGVER/Documentation/00-INDEX for a list of what + is contained in each file. Please read the Changes file, as it contains + information about the problems, which may result by upgrading your + kernel. + +Package: linux-headers-PKGVER-ABINUM +Architecture: all +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0) +Provides: linux-headers, linux-headers-2.6 +Description: Header files related to Linux kernel version PKGVER + This package provides kernel header files for version PKGVER, for sites + that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-PKGVER-ABINUM/debian.README.gz for details + +Package: linux-libc-dev +Architecture: amd64 i386 powerpc sparc ia64 hppa lpia +Conflicts: libc6-dev (<< 2.3.2.ds1-6), libc6.1-dev (<< 2.3.2.ds1-6), dvb-dev (<< 1.0.1-6), amd64-libs-dev (<= 1.1), linux-kernel-headers +Replaces: libc6-dev (<< 2.3.2.ds1-6), libc6.1-dev (<< 2.3.2.ds1-6), dvb-dev (<< 1.0.1-6), linux-kernel-headers +Provides: linux-kernel-headers +Description: Linux Kernel Headers for development + This package provides headers from the Linux kernel. These headers + are used by the installed headers for GNU glibc and other system + libraries. --- linux-2.6.24.orig/debian/control.stub +++ linux-2.6.24/debian/control.stub @@ -0,0 +1,839 @@ +Source: linux +Section: devel +Priority: optional +Maintainer: Ubuntu Kernel Team +Standards-Version: 3.6.1 +Build-Depends: debhelper (>= 3), module-init-tools, kernel-wedge (>= 2.24ubuntu1), gcc-4.1-hppa64 [hppa], binutils-hppa64 [hppa], device-tree-compiler [powerpc], gcc-4.1 [powerpc ia64], gawk [amd64 i386] +Build-Depends-Indep: xmlto, docbook-utils, gs, transfig, bzip2, sharutils + +Package: linux-kernel-devel +Architecture: all +Section: devel +Priority: optional +Depends: build-essential, git-core, gitk, rsync, curl, openssh-client, debhelper, kernel-package, kernel-wedge +Description: Linux kernel hacking dependencies + This is a dummy package that will install all possible packages + required to hack comfortably on the kernel. + +Package: linux-source-2.6.24 +Architecture: all +Section: devel +Priority: optional +Provides: linux-source, linux-source-2.6 +Depends: binutils, bzip2, coreutils | fileutils (>= 4.0) +Recommends: libc-dev, gcc, make +Suggests: libncurses-dev | ncurses-dev, kernel-package, libqt3-dev +Description: Linux kernel source for version 2.6.24 with Ubuntu patches + This package provides the source code for the Linux kernel version 2.6.24. + . + You may configure the kernel to your setup by typing "make config" and + following instructions, but you could get ncursesX.X-dev and try "make + menuconfig" for a jazzier, and easier to use interface. There are options + to use QT or GNOME based configuration interfaces, but they need + additional packages to be installed. Also, please read the detailed + documentation in the file + /usr/share/doc/linux-source-2.6.24/README.headers.gz. + . + If you wish to use this package to create a custom Linux kernel, then it + is suggested that you investigate the package kernel-package, which has + been designed to ease the task of creating kernel image packages. + . + If you are simply trying to build third-party modules for your kernel, + you do not want this package. Install the appropriate linux-headers + package instead. + +Package: linux-doc-2.6.24 +Architecture: all +Section: doc +Priority: optional +Provides: linux-doc-2.6 +Conflicts: linux-doc-2.6 +Replaces: linux-doc-2.6 +Depends: coreutils | fileutils (>= 4.0) +Description: Linux kernel specific documentation for version 2.6.24 + This package provides the various readme's in the 2.6.24 kernel + Documentation/ subdirectory: these typically contain kernel-specific + installation notes for some drivers for example. See + /usr/share/doc/linux-doc-2.6.24/Documentation/00-INDEX for a list of what + is contained in each file. Please read the Changes file, as it contains + information about the problems, which may result by upgrading your + kernel. + +Package: linux-headers-2.6.24-32 +Architecture: all +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0) +Provides: linux-headers, linux-headers-2.6 +Description: Header files related to Linux kernel version 2.6.24 + This package provides kernel header files for version 2.6.24, for sites + that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details + +Package: linux-libc-dev +Architecture: amd64 i386 powerpc sparc ia64 hppa lpia +Conflicts: libc6-dev (<< 2.3.2.ds1-6), libc6.1-dev (<< 2.3.2.ds1-6), dvb-dev (<< 1.0.1-6), amd64-libs-dev (<= 1.1), linux-kernel-headers +Replaces: libc6-dev (<< 2.3.2.ds1-6), libc6.1-dev (<< 2.3.2.ds1-6), dvb-dev (<< 1.0.1-6), linux-kernel-headers +Provides: linux-kernel-headers +Description: Linux Kernel Headers for development + This package provides headers from the Linux kernel. These headers + are used by the installed headers for GNU glibc and other system + libraries. + +Package: linux-image-2.6.24-32-386 +Architecture: i386 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on i386 + This package contains the Linux kernel image for version 2.6.24 on + i386. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Alternate x86 (486 and better) processors. + . + Geared toward desktop systems. + . + You likely do not want to install this package directly. Instead, install + the linux-386 meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-386 +Architecture: i386 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on i386 + This package provides kernel header files for version 2.6.24 on + i386. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-debug-2.6.24-32-386 +Architecture: i386 +Section: devel +Priority: optional +Provides: linux-debug +Description: Linux kernel debug image for version 2.6.24 on i386 + This package provides a kernel debug image for version 2.6.24 on + i386. + . + This is for sites that wish to debug the kernel. + . + The kernel image contained in this package is NOT meant to boot from. It + is uncompressed, and unstripped. + +Package: linux-image-2.6.24-32-generic +Architecture: i386 amd64 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on x86/x86_64 + This package contains the Linux kernel image for version 2.6.24 on + x86/x86_64. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Generic processors. + . + Geared toward desktop systems. + . + You likely do not want to install this package directly. Instead, install + the linux-generic meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-generic +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on x86/x86_64 + This package provides kernel header files for version 2.6.24 on + x86/x86_64. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-debug-2.6.24-32-generic +Architecture: i386 amd64 +Section: devel +Priority: optional +Provides: linux-debug +Description: Linux kernel debug image for version 2.6.24 on x86/x86_64 + This package provides a kernel debug image for version 2.6.24 on + x86/x86_64. + . + This is for sites that wish to debug the kernel. + . + The kernel image contained in this package is NOT meant to boot from. It + is uncompressed, and unstripped. + +Package: linux-image-2.6.24-32-hppa32 +Architecture: hppa +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: palo +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 32-bit HP PA-RISC SMP + This package contains the Linux kernel image for version 2.6.24 on + 32-bit HP PA-RISC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 32-bit HP PA-RISC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-hppa32 meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-hppa32 +Architecture: hppa +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 32-bit HP PA-RISC SMP + This package provides kernel header files for version 2.6.24 on + 32-bit HP PA-RISC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-hppa64 +Architecture: hppa +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: palo +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 64-bit HP PA-RISC SMP + This package contains the Linux kernel image for version 2.6.24 on + 64-bit HP PA-RISC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 64-bit HP PA-RISC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-hppa64 meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-hppa64 +Architecture: hppa +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1-hppa64, binutils-hppa64, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 64-bit HP PA-RISC SMP + This package provides kernel header files for version 2.6.24 on + 64-bit HP PA-RISC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-itanium +Architecture: ia64 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: elilo (>= 3.6-1) +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Itanium SMP + This package contains the Linux kernel image for version 2.6.24 on + Itanium SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Itanium SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-itanium meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-itanium +Architecture: ia64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Itanium SMP + This package provides kernel header files for version 2.6.24 on + Itanium SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-mckinley +Architecture: ia64 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: elilo (>= 3.6-1) +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Itanium II SMP + This package contains the Linux kernel image for version 2.6.24 on + Itanium II SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Itanium II SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-mckinley meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-mckinley +Architecture: ia64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Itanium II SMP + This package provides kernel header files for version 2.6.24 on + Itanium II SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-powerpc +Architecture: powerpc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: yaboot +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 32-bit PowerPC + This package contains the Linux kernel image for version 2.6.24 on + 32-bit PowerPC. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 32-bit PowerPC processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-powerpc meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-powerpc +Architecture: powerpc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 32-bit PowerPC + This package provides kernel header files for version 2.6.24 on + 32-bit PowerPC. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-powerpc64-smp +Architecture: powerpc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: yaboot +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 64-bit PowerPC SMP + This package contains the Linux kernel image for version 2.6.24 on + 64-bit PowerPC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 64-bit PowerPC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-powerpc64-smp meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-powerpc64-smp +Architecture: powerpc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 64-bit PowerPC SMP + This package provides kernel header files for version 2.6.24 on + 64-bit PowerPC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-powerpc-smp +Architecture: powerpc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: yaboot +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 32-bit PowerPC SMP + This package contains the Linux kernel image for version 2.6.24 on + 32-bit PowerPC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 32-bit PowerPC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-powerpc-smp meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-powerpc-smp +Architecture: powerpc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 32-bit PowerPC SMP + This package provides kernel header files for version 2.6.24 on + 32-bit PowerPC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-server +Architecture: i386 amd64 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, kvm-api-4, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on x86/x86_64 + This package contains the Linux kernel image for version 2.6.24 on + x86/x86_64. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Server processors. + . + Geared toward server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-server meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-server +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on x86/x86_64 + This package provides kernel header files for version 2.6.24 on + x86/x86_64. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-debug-2.6.24-32-server +Architecture: i386 amd64 +Section: devel +Priority: optional +Provides: linux-debug +Description: Linux kernel debug image for version 2.6.24 on x86/x86_64 + This package provides a kernel debug image for version 2.6.24 on + x86/x86_64. + . + This is for sites that wish to debug the kernel. + . + The kernel image contained in this package is NOT meant to boot from. It + is uncompressed, and unstripped. + +Package: linux-image-2.6.24-32-sparc64 +Architecture: sparc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: silo +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 64-bit UltraSPARC + This package contains the Linux kernel image for version 2.6.24 on + 64-bit UltraSPARC. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 64-bit UltraSPARC processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-sparc64 meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-sparc64 +Architecture: sparc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 64-bit UltraSPARC + This package provides kernel header files for version 2.6.24 on + 64-bit UltraSPARC. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-sparc64-smp +Architecture: sparc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: silo +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 64-bit UltraSPARC SMP + This package contains the Linux kernel image for version 2.6.24 on + 64-bit UltraSPARC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 64-bit UltraSPARC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-sparc64-smp meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-sparc64-smp +Architecture: sparc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 64-bit UltraSPARC SMP + This package provides kernel header files for version 2.6.24 on + 64-bit UltraSPARC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-virtual +Architecture: i386 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on x86 + This package contains the Linux kernel image for version 2.6.24 on + x86. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Virtual processors. + . + Geared toward virtualised hardware. + . + You likely do not want to install this package directly. Instead, install + the linux-virtual meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-virtual +Architecture: i386 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on x86 + This package provides kernel header files for version 2.6.24 on + x86. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-debug-2.6.24-32-virtual +Architecture: i386 +Section: devel +Priority: optional +Provides: linux-debug +Description: Linux kernel debug image for version 2.6.24 on x86 + This package provides a kernel debug image for version 2.6.24 on + x86. + . + This is for sites that wish to debug the kernel. + . + The kernel image contained in this package is NOT meant to boot from. It + is uncompressed, and unstripped. + +Package: linux-image-2.6.24-32-lpia +Architecture: lpia +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Ubuntu Moblie and Embedded LPIA edition + This package contains the Linux kernel image for version 2.6.24 on + Ubuntu Moblie and Embedded LPIA edition. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports UME processors. + . + UME kernel + . + You likely do not want to install this package directly. Instead, install + the linux-lpia meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-lpia +Architecture: lpia +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Ubuntu Moblie and Embedded LPIA edition + This package provides kernel header files for version 2.6.24 on + Ubuntu Moblie and Embedded LPIA edition. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-rt +Architecture: i386 amd64 +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Ingo Molnar's full real time preemption patch (2.6.24.7-rt27) + This package contains the Linux kernel image for version 2.6.24 on + Ingo Molnar's full real time preemption patch (2.6.24.7-rt27). + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Generic processors. + . + RT kernel + . + You likely do not want to install this package directly. Instead, install + the linux-rt meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-rt +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Ingo Molnar's full real time preemption patch (2.6.24.7-rt27) + This package provides kernel header files for version 2.6.24 on + Ingo Molnar's full real time preemption patch (2.6.24.7-rt27). + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-lpiacompat +Architecture: lpia +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Ubuntu Moblie and Embedded-x86 compat edition + This package contains the Linux kernel image for version 2.6.24 on + Ubuntu Moblie and Embedded-x86 compat edition. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports UME processors. + . + UME kernel + . + You likely do not want to install this package directly. Instead, install + the linux-lpiacompat meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-lpiacompat +Architecture: lpia +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Ubuntu Moblie and Embedded-x86 compat edition + This package provides kernel header files for version 2.6.24 on + Ubuntu Moblie and Embedded-x86 compat edition. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-xen +Architecture: i386 amd64 +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on This kernel can be used for Xen dom0 and domU + This package contains the Linux kernel image for version 2.6.24 on + This kernel can be used for Xen dom0 and domU. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Generic processors. + . + Xen domO/domU + . + You likely do not want to install this package directly. Instead, install + the linux-xen meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-xen +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on This kernel can be used for Xen dom0 and domU + This package provides kernel header files for version 2.6.24 on + This kernel can be used for Xen dom0 and domU. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-openvz +Architecture: i386 amd64 +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on OpenVZ Virtualization enabled kernel + This package contains the Linux kernel image for version 2.6.24 on + OpenVZ Virtualization enabled kernel. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Generic processors. + . + OpenVZ kernel + . + You likely do not want to install this package directly. Instead, install + the linux-openvz meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-openvz +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on OpenVZ Virtualization enabled kernel + This package provides kernel header files for version 2.6.24 on + OpenVZ Virtualization enabled kernel. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. --- linux-2.6.24.orig/debian/copyright +++ linux-2.6.24/debian/copyright @@ -0,0 +1,30 @@ +This is the Ubuntu prepackaged version of the Linux kernel. +Linux was written by Linus Torvalds +and others. + +This package was put together by the Ubuntu Kernel Team, from +sources retrieved from upstream linux git. +The sources may be found at most Linux ftp sites, including +ftp://ftp.kernel.org/pub/linux/kernel/ + +This package is currently maintained by the +Ubuntu Kernel Team + +Linux is copyrighted by Linus Torvalds and others. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 dated June, 1991. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + +On Ubuntu Linux systems, the complete text of the GNU General +Public License v2 can be found in `/usr/share/common-licenses/GPL-2'. --- linux-2.6.24.orig/debian/changelog +++ linux-2.6.24/debian/changelog @@ -0,0 +1,8235 @@ +linux (2.6.24-32.106) hardy-proposed; urgency=low + + [Luis Henriques] + + * Release Tracking Bug + - LP: #1077976 + + [Upstream Kernel Changes] + + * net: fix divide by zero in tcp algorithm illinois + - LP: #1077091 + - CVE-2012-4565 + + -- Luis Henriques Mon, 12 Nov 2012 18:06:22 +0000 + +linux (2.6.24-32.105) hardy-proposed; urgency=low + + [Luis Henriques] + + * Release Tracking Bug + - LP: #1055388 + + [Upstream Kernel Changes] + + * net: sock: validate data_len before allocating skb in + sock_alloc_send_pskb() + - LP: #1006622 + - CVE-2012-2136 + + -- Luis Henriques Mon, 24 Sep 2012 10:17:02 +0100 + +linux (2.6.24-32.104) hardy-proposed; urgency=low + + [Luis Henriques] + + * Release Tracking Bug + - LP: #1023810 + + [Upstream Kernel Changes] + + * netfilter: nf_conntrack_reasm: properly handle packets fragmented into + a single fragment + - LP: #1023532 + - CVE-2012-2744 + * KVM: fix backport of 3e51570 on hardy + - LP: #971685 + - CVE-2012-1601 + + -- Luis Henriques Thu, 12 Jul 2012 10:13:07 +0100 + +linux (2.6.24-32.103) hardy-proposed; urgency=low + + [Luis Henriques] + + * Release Tracking Bug + - LP: #1020100 + + [Upstream Kernel Changes] + + * KVM: MMU: nuke shadowed pgtable pages and ptes on memslot destruction + - LP: #971685 + - CVE-2012-1601 + * KVM: MMU: do not free active mmu pages in free_mmu_pages() + - LP: #971685 + - CVE-2012-1601 + * KVM: Don't destroy vcpu in case vcpu_setup fails + - LP: #971685 + - CVE-2012-1601 + * KVM: Ensure all vcpus are consistent with in-kernel irqchip settings + - LP: #971685 + - CVE-2012-1601 + + -- Luis Henriques Mon, 02 Jul 2012 14:40:17 +0100 + +linux (2.6.24-31.102) hardy-proposed; urgency=low + + [Luis Henriques] + + * Release Tracking Bug + - LP: #1012143 + + [Tim Gardner] + + * [Config] control.stub is an intermediate product not a dependancy + - LP: #992414 + + [Upstream Kernel Changes] + + * dl2k: Clean up rio_ioctl + - CVE-2012-2313 + * hfsplus: Fix potential buffer overflows + - CVE-2012-2319 + + -- Luis Henriques Tue, 12 Jun 2012 15:07:18 +0100 + +linux (2.6.24-31.101) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #989988 + + [Upstream Kernel Changes] + + * jbd2: clear BH_Delay & BH_Unwritten in journal_unmap_buffer + - LP: #929781 + - CVE-2011-4086 + + -- Herton Ronaldo Krzesinski Fri, 27 Apr 2012 15:15:43 -0300 + +linux (2.6.24-31.100) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #948393 + + [Upstream Kernel Changes] + + * bsg: fix sysfs link remove warning + - LP: #946928 + + -- Herton Ronaldo Krzesinski Tue, 06 Mar 2012 17:41:15 -0300 + +linux (2.6.24-31.99) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #931627 + + [Andy Whitcroft] + + * debian -- validate patches are applied to openvz etc + + [Stefan Bader] + + * SAUCE: Return deny all as default in encode_share_access + - LP: #917829 + - CVE-2011-4324 + + [Tim Gardner] + + * [Config] Generate patch set from flattened sources + * [Config] Added apply-patch-to-binary-custom + * [Config] Flattened openvz + * [Config] Flattened xen + + [Upstream Kernel Changes] + + * sound/oss: remove offset from load_patch callbacks + - LP: #925337 + - CVE-2011-1476 + * sound/oss/opl3: validate voice and channel indexes + - LP: #925335 + - CVE-2011-1477 + * Fix for buffer overflow in ldm_frag_add not sufficient + - LP: #922371 + - CVE-2011-2182 + * Move "exit_robust_list" into mm_release() + - LP: #927889 + - CVE-2012-0028 + * futex: Nullify robust lists after cleanup + - LP: #927889 + - CVE-2012-0028 + + -- Herton Ronaldo Krzesinski Mon, 13 Feb 2012 17:25:53 -0200 + +linux (2.6.24-30.98) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #910893 + + [Upstream Kernel Changes] + + * TPM: Zero buffer after copying to userspace, CVE-2011-1162 + - LP: #899463 + - CVE-2011-1162 + * hfs: fix hfs_find_init() sb->ext_tree NULL ptr oops, CVE-2011-2203 + - LP: #899466 + - CVE-2011-2203 + * KEYS: Fix a NULL pointer deref in the user-defined key type, + CVE-2011-4110 + - LP: #894369, #unable to handle kernel NULL pointer dereference at 0000000000000008 + - CVE-2011-4110 + * ieee80211: Add IEEE80211_MAX_FRAME_LEN to linux/ieee80211.h + - LP: #905060 + - CVE-2011-3359 + * b43: allocate receive buffers big enough for max frame len + offset + - LP: #905060 + - CVE-2011-3359 + + -- Herton Ronaldo Krzesinski Mon, 02 Jan 2012 14:12:10 -0200 + +linux (2.6.24-30.97) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #897225 + + [Upstream Kernel Changes] + + * xfs: Fix possible memory corruption in xfs_readlink, CVE-2011-4077 + - LP: #887298 + - CVE-2011-4077 + * jbd/jbd2: validate sb->s_first in journal_get_superblock() + - LP: #893148 + - CVE-2011-4132 + * hfs: add sanity check for file name length, CVE-2011-4330 + - LP: #894374 + - CVE-2011-4330 + + -- Herton Ronaldo Krzesinski Mon, 28 Nov 2011 11:39:07 -0200 + +linux (2.6.24-30.96) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #887365 + + [Upstream Kernel Changes] + + * net_sched: Fix qdisc_notify() - CVE-2011-2525 + - LP: #869250 + - CVE-2011-2525 + * mm: avoid wrapping vm_pgoff in mremap(), CVE-2011-2496 + - LP: #869243 + - CVE-2011-2496 + * vm: fix vm_pgoff wrap in stack expansion, CVE-2011-2496 + - LP: #869243 + - CVE-2011-2496 + * vm: fix vm_pgoff wrap in upward expansion, CVE-2011-2496 + - LP: #869243 + - CVE-2011-2496 + * NLM: Don't hang forever on NLM unlock requests - CVE-2011-2491 + - LP: #869237 + - CVE-2011-2491 + * cifs: ensure we check both username and password when reusing a + session, CVE-2011-1585 + - LP: #869208 + - CVE-2011-1585 + * introduce explicit signed/unsigned 64bit divide, CVE-2011-3209 + - LP: #880890 + - CVE-2011-3209 + * remove div_long_long_rem, CVE-2011-3209 + - LP: #880890 + - CVE-2011-3209 + * gre: fix netns vs proto registration ordering, CVE-2011-1767 + - LP: #869213 + - CVE-2011-1767 + * tunnels: fix netns vs proto registration ordering, CVE-2011-1768 + - LP: #869215 + - CVE-2011-1768 + + -- Herton Ronaldo Krzesinski Mon, 07 Nov 2011 21:04:33 -0200 + +linux (2.6.24-29.95) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #871844 + + [Andy Whitcroft] + + * SAUCE: auerswald: validate the length of USB strings + - LP: #869195 + - CVE-2009-4067 + + [Upstream Kernel Changes] + + * crypto: Move md5_transform to lib/md5.c, CVE-2011-3188 + - LP: #834129 + - CVE-2011-3188 + * net: Compute protocol sequence numbers and fragment IDs using MD5, + CVE-2011-3188 + - LP: #834129 + - CVE-2011-3188 + * Make TASKSTATS require root access, CVE-2011-2494 + - LP: #866021 + - CVE-2011-2494 + * proc: restrict access to /proc/PID/io, CVE-2011-2495 + - LP: #866025 + - CVE-2011-2495 + * sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set, + CVE-2011-1573 + - LP: #869205 + - CVE-2011-1573 + + -- Herton Ronaldo Krzesinski Mon, 10 Oct 2011 12:56:15 -0300 + +linux (2.6.24-29.94) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #853945 + + [Upstream Kernel Changes] + + * ipv6: make fragment identifications less predictable, CVE-2011-2699 + - LP: #827685 + - CVE-2011-2699 + * splice: fix infinite loop in generic_file_splice_read() + - LP: #790557 + * cifs: fix possible memory corruption in CIFSFindNext, CVE-2011-3191 + - LP: #834135 + - CVE-2011-3191 + * befs: ensure fast symlinks are NUL-terminated, CVE-2011-2928 + - LP: #834124 + - CVE-2011-2928 + * befs: Validate length of long symbolic links, CVE-2011-2928 + - LP: #834124 + - CVE-2011-2928 + * Validate size of EFI GUID partition entries, CVE-2011-1776 + - LP: #844365 + - CVE-2011-1776 + * inet_diag: fix inet_diag_bc_audit(), CVE-2011-2213 + - LP: #838421 + - CVE-2011-2213 + * Bluetooth: Prevent buffer overflow in l2cap config request, + CVE-2011-2497 + - LP: #838423 + - CVE-2011-2497 + + -- Herton Ronaldo Krzesinski Mon, 19 Sep 2011 12:24:41 -0300 + +linux (2.6.24-29.93) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #823912 + + [Upstream Kernel Changes] + + * close races in /proc/*/{environ,auxv}, CVE-2011-1020 + - LP: #813026 + - CVE-2011-1020 + * dccp: fix oops on Reset after close, CVE-2011-1093 + - LP: #814087 + - CVE-2011-1093 + * Bluetooth: sco: fix information leak to userspace, CVE-2011-1078 + - LP: #816542 + - CVE-2011-1078 + * Bluetooth: bnep: fix buffer overflow, CVE-2011-1079 + - LP: #816544 + - CVE-2011-1079 + * bridge: netfilter: fix information leak, CVE-2011-1080 + - LP: #816545 + - CVE-2011-1080 + * char/tpm: Fix unitialized usage of data buffer, CVE-2011-1160 + - LP: #816546 + - CVE-2011-1160 + * irda: validate peer name and attribute lengths, CVE-2011-1180 + - LP: #816547 + - CVE-2011-1180 + * rose_loopback_timer sets VC number <= ROSE_DEFAULT_MAXVC, CVE-2011-1493 + - LP: #816550 + - CVE-2011-1493 + * ROSE: prevent heap corruption with bad facilities, CVE-2011-1493 + - LP: #816550 + - CVE-2011-1493 + * rose: Add length checks to CALL_REQUEST parsing, CVE-2011-1493 + - LP: #816550 + - CVE-2011-1493 + * Bluetooth: l2cap and rfcomm: fix 1 byte infoleak to userspace. + - LP: #819569 + - CVE-2011-2492 + + -- Herton Ronaldo Krzesinski Wed, 10 Aug 2011 10:07:45 -0300 + +linux (2.6.24-29.92) hardy-proposed; urgency=low + + [Herton R. Krzesinski] + + * Release Tracking Bug + - LP: #812360 + + [Upstream Kernel Changes] + + * af_unix: limit unix_tot_inflight CVE-2010-4249 + - LP: #769182 + - CVE-2010-4249 + * xfs: zero proper structure size for geometry calls CVE-2011-0711 + - LP: #767740 + - CVE-2011-0711 + * netfilter: ip_tables: fix infoleak to userspace CVE-2011-1171 + - LP: #801482 + - CVE-2011-1171 + * econet: 4 byte infoleak to the network CVE-2011-1173 + - LP: #801484 + - CVE-2011-1173 + * netfilter: arp_tables: fix infoleak to userspace CVE-2011-1170 + - LP: #801480 + * ipv6: netfilter: ip6_tables: fix infoleak to userspace CVE-2011-1172 + - LP: #801483 + - CVE-2011-1172 + * xen: don't allow blkback virtual CDROM device, CVE-2010-4238 + - LP: #803931 + - CVE-2010-4238 + * IB/uverbs: Handle large number of entries in poll CQ CVE-2010-4649 + - LP: #805512 + * ipc: initialize structure memory to zero for compat functions + CVE-2010-4073 + - LP: #806366 + - CVE-2010-4073 + * tcp: Increase TCP_MAXSEG socket option minimum CVE-2010-4165 + - LP: #806374 + - CVE-2010-4165 + * taskstats: don't allow duplicate entries in listener mode, + CVE-2011-2484 + - LP: #806390 + - CVE-2011-2484 + * netfilter: ipt_CLUSTERIP: fix buffer overflow, CVE-2011-2534 + - LP: #801473 + - CVE-2011-2534 + * nfs4: Ensure that ACL pages sent over NFS were not allocated from the + slab (v3), CVE-2011-1090 + - LP: #800775 + - CVE-2011-1090 + * fs/partitions: Validate map_count in Mac partition tables + - LP: #804225 + - CVE-2011-1010 + + -- Herton Ronaldo Krzesinski Mon, 18 Jul 2011 12:36:01 -0300 + +linux (2.6.24-29.91) hardy-proposed; urgency=low + + [Steve Conklin] + + * Release Tracking Bug + - LP: #801636 + + [Andy Whitcroft] + + * custom binaries need VERSION_SIGNATURE updated during prepare + - LP: #794698 + + [Stefan Bader] + + * (config) Disable COMPAT_VDSO for i386 Xen kernels + - LP: #794715 + * XEN: Add yield points to blktap and blkback + - LP: #791212 + - CVE-2010-4247 + * xen: Fix memory corruption caused by double free + - LP: #705562 + + [Upstream Kernel Changes] + + * agp: fix arbitrary kernel memory writes, CVE-1011-2022 + - LP: #788684 + - CVE-1011-2022 + * agp: fix OOM and buffer overflow + - LP: #791918 + - CVE-2011-1746 + * tty: icount changeover for other main devices, CVE-2010-4076, + CVE-2010-4077 + - LP: #794034 + - CVE-2010-4077 + * fs/partitions/efi.c: corrupted GUID partition tables can cause kernel + oops + - LP: #795418 + - CVE-2011-1577 + * Fix corrupted OSF partition table parsing + - LP: #796606 + - CVE-2011-1163 + * proc: avoid information leaks to non-privileged processes + - LP: #799906 + - CVE-2011-0726 + * proc: protect mm start_code/end_code in /proc/pid/stat + - LP: #799906 + - CVE-2011-0726 + * sctp: Fix a race between ICMP protocol unreachable and connect() + - LP: #799828 + - CVE-2010-4526 + * xen: blkback, blktap: Fix potential resource leak + - LP: #800254 + + -- Steve Conklin Fri, 24 Jun 2011 10:59:11 -0500 + +linux (2.6.24-29.90) hardy-proposed; urgency=low + + [ Herton R. Krzesinski ] + + * Release Tracking Bug + - LP: #788843 + + [Upstream Kernel Changes] + + * IB/cm: Bump reference count on cm_id before invoking callback, + CVE-2011-0695 + - LP: #770369 + - CVE-2011-0695 + * RDMA/cma: Fix crash in request handlers, CVE-2011-0695 + - LP: #770369 + - CVE-2011-0695 + * ALSA: caiaq - Fix possible string-buffer overflow, CVE-2011-0712 + - LP: #768448 + - CVE-2011-0712 + * Treat writes as new when holes span across page boundaries, + CVE-2011-0463 + - LP: #770483 + - CVE-2011-0463 + * net: clear heap allocations for privileged ethtool actions, + CVE-2010-4655 + - LP: #771445 + - CVE-2010-4655 + * usb: iowarrior: don't trust report_size for buffer size, CVE-2010-4656 + - LP: #711484 + - CVE-2010-4656 + * fs/partitions/ldm.c: fix oops caused by corrupted partition table, + CVE-2011-1017 + - LP: #771382 + - CVE-2011-1017 + * ldm: corrupted partition table can cause kernel oops, CVE-2011-1017 + - LP: #771382 + - CVE-2011-1017 + * next_pidmap: fix overflow condition, CVE-2011-1593 + - LP: #784727 + - CVE-2011-1593 + * proc: do proper range check on readdir offset, CVE-2011-1593 + - LP: #784727 + - CVE-2011-1593 + + -- Herton Ronaldo Krzesinski Thu, 26 May 2011 18:15:42 -0300 + +linux (2.6.24-29.89) hardy-proposed; urgency=low + + [ Steve Conklin ] + + * Release Tracking Bug + - LP: #768380 + + [Tim Gardner] + + * [Config] remove generated files + + [Upstream Kernel Changes] + + * econet: Fix crash in aun_incoming(). CVE-2010-4342 + - LP: #736394 + - CVE-2010-4342 + * sound: Prevent buffer overflow in OSS load_mixer_volumes, CVE-2010-4527 + - LP: #737073 + - CVE-2010-4527 + * irda: prevent integer underflow in IRLMP_ENUMDEVICES, CVE-2010-4529 + - LP: #737823 + - CVE-2010-4529 + * av7110: check for negative array offset, CVE-2011-0521 + - LP: #767526 + - CVE-2011-0521 + * xfs: prevent leaking uninitialized stack memory in FSGEOMETRY_V1, + CVE-2011-0711 + - LP: #767740 + - CVE-2011-0711 + + -- Steve Conklin Thu, 21 Apr 2011 09:28:26 -0500 + +linux (2.6.24-29.88) hardy-proposed; urgency=low + + [ Brad Figg ] + + * Release Tracking Bug + - LP: #736290 + + [Steve Conklin] + + * Ubuntu-2.6.24-29.87 + * [Config] Allow insertchanges to work in later version chroots + + [Upstream Kernel Changes] + + * do_exit(): make sure that we run with get_fs() == USER_DS, + CVE-2010-4258 + - LP: #723945 + - CVE-2010-4258 + * Make the bulkstat_one compat ioctl handling more sane + - LP: #692848 + * Fix xfs_bulkstat_one size checks & error handling + - LP: #692848 + * xfs: always use iget in bulkstat + - LP: #692848 + * x25: Prevent crashing when parsing bad X.25 facilities CVE-2010-4164 + - LP: #731199 + - CVE-2010-4164 + * Revised [CVE-2010-4346 Hardy] install_special_mapping skips + security_file_mmap check. CVE-2010-4346 + - LP: #731971 + - CVE-2010-4346 + + -- Brad Figg Wed, 16 Mar 2011 09:43:35 -0700 + +linux (2.6.24-29.87) hardy-proposed; urgency=low + + [ Steve Conklin ] + + * Release Tracking Bug + - LP: #725138 + + [Upstream Kernel Changes] + + * bluetooth: Fix missing NULL check, CVE-2010-4242 + - LP: #714846 + - CVE-2010-4242 + * NFS: fix the return value of nfs_file_fsync() + - LP: #585657 + * bio: take care not overflow page count when mapping/copying user data, + CVE-2010-4162 + - LP: #721441 + - CVE-2010-4162 + * filter: make sure filters dont read uninitialized memory + - LP: #721282 + - CVE-2010-4158 + * tty: Make tiocgicount a handler, CVE-2010-4076, CVE-2010-4077 + - LP: #720189 + - CVE-2010-4077 + * block: check for proper length of iov entries earlier in + blk_rq_map_user_iov(), CVE-2010-4163 + - LP: #721504 + - CVE-2010-4163 + + -- Steve Conklin Fri, 25 Feb 2011 10:38:03 -0600 + +linux (2.6.24-28.86) hardy-proposed; urgency=low + + [ Brad Figg ] + + * Release Tracking Bug + - LP: #716166 + + [Tim Gardner] + + * xen unified block-device I/O interface back end can orphan devices, + CVE-2010-3699 + - LP: #708019 + - CVE-2010-3699 + + [Upstream Kernel Changes] + + * Hardy SRU: thinkpad-acpi: lock down video output state access, + CVE-2010-3448 + - LP: #706999 + - CVE-2010-3448 + * net: Limit socket I/O iovec total length to INT_MAX., CVE-2010-3859 + - LP: #711855, #708839 + - CVE-2010-4160 + * net: Truncate recvfrom and sendto length to INT_MAX., CVE-2010-3859 + - LP: #711855, #708839 + - CVE-2010-4160 + * net: ax25: fix information leak to userland, CVE-2010-3875 + - LP: #710714 + - CVE-2010-3875 + * net: ax25: fix information leak to userland harder, CVE-2010-3875 + - LP: #710714 + - CVE-2010-3875 + * memory corruption in X.25 facilities parsing, CVE-2010-3873 + - LP: #709372 + - CVE-2010-3873 + * net: packet: fix information leak to userland, CVE-2010-3876 + - LP: #710714 + - CVE-2010-3876 + * net: tipc: fix information leak to userland, CVE-2010-3877 + - LP: #711291 + - CVE-2010-3877 + * KVM: VMX: fix vmx null pointer dereference on debug register access, + CVE-2010-0435 + - LP: #712615 + - CVE-2010-0435 + * gdth: integer overflow in ioctl, CVE-2010-4157 + - LP: #711797 + - CVE-2010-4157 + * posix-cpu-timers: workaround to suppress the problems with mt exec, + CVE-2010-4248 + - LP: #712609 + - CVE-2010-4248 + * ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory, + CVE-2010-4080, CVE-2010-4081 + - LP: #712723, #712737 + - CVE-2010-4081 + * sys_semctl: fix kernel stack leakage, CVE-2010-4083 + - LP: #712749 + - CVE-2010-4083 + * inet_diag: Make sure we actually run the same bytecode we audited, + CVE-2010-3880 + - LP: #711865 + - CVE-2010-3880 + + -- Brad Figg Wed, 09 Feb 2011 15:14:25 -0800 + +linux (2.6.24-28.85) hardy-proposed; urgency=low + + [ Brad Figg ] + + * Tracking Bug + - LP: #708315 + + [Upstream Kernel Changes] + + * ata_piix: IDE mode SATA patch for Intel ICH10 DeviceID's + - LP: #693401 + * USB: serial/mos*: prevent reading uninitialized stack memory, + CVE-2010-4074 + - LP: #706149 + - CVE-2010-4074 + * KVM: Fix fs/gs reload oops with invalid ldt + - LP: #707000 + - CVE-2010-3698 + * drivers/video/sis/sis_main.c: prevent reading uninitialized stack + memory, CVE-2010-4078 + - LP: #707579 + - CVE-2010-4078 + * V4L/DVB: ivtvfb: prevent reading uninitialized stack memory, + CVE-2010-4079 + - LP: #707649 + - CVE-2010-4079 + + -- Brad Figg Wed, 26 Jan 2011 14:36:13 +0000 + +linux (2.6.24-28.84) hardy-proposed; urgency=low + + [ Steve Conklin ] + + * Tracking Bug + - LP: #698185 + + -- Steve Conklin Wed, 12 Jan 2011 09:01:01 -0600 + +linux (2.6.24-28.83) hardy-proposed; urgency=low + + [ Steve Conklin ] + * tracking bug moved from here to latest entry + + + -- Steve Conklin Thu, 06 Jan 2011 12:39:01 -0600 + +linux (2.6.24-28.82) hardy-proposed; urgency=low + + [ Leann Ogasawara ] + + * Revert "SAUCE: AF_ECONET saddr->cookie prevent NULL pointer + dereference" + * Revert "SAUCE: AF_ECONET SIOCSIFADDR ioctl does not check privileges" + * Revert "SAUCE: AF_ECONET prevent kernel stack overflow" + + [Upstream Kernel Changes] + + * xfs: validate untrusted inode numbers during lookup + - CVE-2010-2943 + * xfs: rename XFS_IGET_BULKSTAT to XFS_IGET_UNTRUSTED + - CVE-2010-2943 + * xfs: remove block number from inode lookup code + - CVE-2010-2943 + * xfs: fix untrusted inode number lookup + - CVE-2010-2943 + * drivers/net/cxgb3/cxgb3_main.c: prevent reading uninitialized stack + memory + - CVE-2010-3296 + * drivers/net/eql.c: prevent reading uninitialized stack memory + - CVE-2010-3297 + * setup_arg_pages: diagnose excessive argument size + - CVE-2010-3858 + * ipc: shm: fix information leak to userland + - CVE-2010-4072 + * econet: disallow NULL remote addr for sendmsg(), fixes CVE-2010-3849 + - CVE-2010-3849 + * econet: fix CVE-2010-3850 + - CVE-2010-3850 + * econet: fix CVE-2010-3848 + - CVE-2010-3848 + + -- Leann Ogasawara Wed, 01 Dec 2010 08:51:48 -0800 + +linux (2.6.24-28.81) hardy-security; urgency=low + + [ Leann Ogasawara ] + + * SAUCE: AF_ECONET prevent kernel stack overflow + - CVE-2010-3848 + * SAUCE: AF_ECONET SIOCSIFADDR ioctl does not check privileges + - CVE-2010-3850 + * SAUCE: AF_ECONET saddr->cookie prevent NULL pointer dereference + - CVE-2010-3849 + + -- Leann Ogasawara Fri, 19 Nov 2010 16:29:54 -0800 + +linux (2.6.24-28.80) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * v4l: disable dangerous buggy compat function + - CVE-2010-2963 + * xfs: prevent swapext from operating on write-only files + - CVE-2010-2226 + * cifs: Fix a kernel BUG with remote OS/2 server (try #3) + - CVE-2010-2248 + * nfsd4: bug in read_buf + - CVE-2010-2521 + * GFS2: rename causes kernel Oops + - CVE-2010-2798 + * net sched: fix some kernel memory leaks + - CVE-2010-2942 + * jfs: don't allow os2 xattr namespace overlap with others + - CVE-2010-2946 + * irda: Correctly clean up self->ias_obj on irda_bind() failure. + - CVE-2010-2954 + * ext4: consolidate in_range() definitions + - CVE-2010-3015 + * aio: check for multiplication overflow in do_io_submit + - CVE-2010-3067 + * xfs: prevent reading uninitialized stack memory + - CVE-2010-3078 + * ALSA: seq/oss - Fix double-free at error path of snd_seq_oss_open() + - CVE-2010-3080 + * rose: Fix signedness issues wrt. digi count. + - CVE-2010-3310 + * sctp: Do not reset the packet during sctp_packet_config(). + - CVE-2010-3432 + * Fix pktcdvd ioctl dev_minor range check + - CVE-2010-3437 + * ALSA: prevent heap corruption in snd_ctl_new() + - CVE-2010-3442 + * net sched: fix kernel leak in act_police + - CVE-2010-3477 + * Fix out-of-bounds reading in sctp_asoc_get_hmac() + - CVE-2010-3705 + * remove dashes in git commands for compatibility with later build + environments + + -- Steve Conklin Wed, 06 Oct 2010 16:08:52 +0100 + +linux (2.6.24-28.79) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * compat: Make compat_alloc_user_space() incorporate the access_ok() + - CVE-2010-3081 + + -- Stefan Bader Thu, 16 Sep 2010 10:20:48 +0200 + +linux (2.6.24-28.77) hardy-security; urgency=low + + [Stefan Bader] + + * mm: Use helper to find real vma with stack guard page + - LP: #620994 + - CVE-2010-2240 + * mm: Do not assume ENOMEM when looking at a split stack vma + - LP: #620994 + - CVE-2010-2240 + + -- Stefan Bader Wed, 25 Aug 2010 12:54:28 +0000 + +linux (2.6.24-28.75) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * mm: keep a guard page below a grow-down stack segment + - CVE-2010-2240 + * mm: fix missing page table unmap for stack guard page failure case + - CVE-2010-2240 + * mm: fix page table unmap for stack guard page properly + - CVE-2010-2240 + * mm: fix up some user-visible effects of the stack guard page + - CVE-2010-2240 + * x86: don't send SIGBUS for kernel page faults + - CVE-2010-2240 + * mm: pass correct mm when growing stack + - CVE-2010-2240 + * OPENVZ: Fixup patches to memory.c and mlock.c + - CVE-2010-2240 + + -- Stefan Bader Wed, 18 Aug 2010 11:27:41 +0200 + +linux (2.6.24-28.73) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * sctp: Fix skb_over_panic resulting from multiple invalid parameter + errors (CVE-2010-1173) (v4) + - CVE-2010-1173 + * sctp: fix append error cause to ERROR chunk correctly + - CVE-2010-1173 + * GFS2: Fix writing to non-page aligned gfs2_quota structures + - CVE-2010-1436 + * KEYS: find_keyring_by_name() can gain access to a freed keyring + - CVE-2010-1437 + * sparc64: Fix sun4u execute bit check in TSB I-TLB load. + - CVE-2010-1451 + * GFS2: Fix permissions checking for setflags ioctl() + - CVE-2010-1641 + * nfsd: fix vm overcommit crash + - CVE-2010-1643 + * nfsd: fix vm overcommit crash fix #2 + - CVE-2008-7256 + * ecryptfs: Bugfix for error related to ecryptfs_hash_buckets + - CVE-2010-2492 + + -- Stefan Bader Tue, 20 Jul 2010 18:21:57 +0200 + +linux (2.6.24-28.71) hardy-proposed; urgency=low + + [Upstream Kernel Changes] + + * tcp FRTO: Fix fallback to conventional recovery + - LP: #567394 + * tcp FRTO: SACK variant is errorneously used with NewReno + - LP: #567394 + * tcp FRTO: work-around inorder receivers + - LP: #567394 + + -- Stefan Bader Wed, 09 Jun 2010 11:15:27 +0200 + +linux (2.6.24-28.70) hardy-security; urgency=low + + [Stefan Bader] + + * OPENVZ: Fix patch failure on fs/namei.c + - CVE-2010-1088 + * KVM: x86: Completely backport get_cpl functionality + - CVE-2010-0298 + - CVE-2010-0306 + + [Upstream Kernel Changes] + + * virtio: finer-grained features for virtio_net + - CVE-2010-0741 + * virtio: explicit advertisement of driver features + - CVE-2010-0741 + * USB: usbfs: properly clean up the as structure on error paths + - CVE-2010-1083 + * Bluetooth: Fix potential bad memory access with sysfs files + - CVE-2010-1084 + * dvb-core: Fix DoS bug in ULE decapsulation code that can be triggered + by an invalid Payload Pointer + - CVE-2010-1086 + * ipv6: Fix OOPS in ip6_dst_lookup_tail(). + - CVE-2010-0437 + * GFS2: Skip check for mandatory locks when unlocking + - CVE-2010-0727 + * tipc: Fix oops on send prior to entering networked mode (v3) + - CVE-2010-1187 + * idr: fix a critical misallocation bug, take#2 + - LP: #485556 + * tty: release_one_tty() forgets to put pids + - CVE-2010-1162 + * fix LOOKUP_FOLLOW on automount "symlinks" + - CVE-2010-1088 + * NFS: Fix an Oops when truncating a file + - CVE-2010-1087 + * r8169: Fix receive buffer length when MTU is between 1515 and 1536 + - CVE-2009-4537 + * r8169: offical fix for CVE-2009-4537 (overlength frame DMAs) + - CVE-2009-4537 + * KVM: introduce kvm_read_guest_virt, kvm_write_guest_virt + - CVE-2010-0298 + - CVE-2010-0306 + * KVM: remove the vmap usage + - CVE-2010-0298 + - CVE-2010-0306 + * KVM: x86 emulator: Check CPL level during privilege instruction + emulation + - CVE-2010-0298 + - CVE-2010-0306 + * KVM: x86 emulator: Add Virtual-8086 mode of emulation + - CVE-2010-0298 + - CVE-2010-0306 + * KVM: x86 emulator: fix memory access during x86 emulation + - CVE-2010-0298 + - CVE-2010-0306 + * KVM: x86 emulator: Check IOPL level during io instruction emulation + - CVE-2010-0298 + - CVE-2010-0306 + * KVM: VMX: Use macros instead of hex value on cr0 initialization + - CVE-2010-0298 + - CVE-2010-0306 + * KVM: SVM: Reset cr0 properly on vcpu reset + - CVE-2010-0298 + - CVE-2010-0306 + + -- Stefan Bader Tue, 25 May 2010 12:14:20 +0000 + +linux (2.6.24-27.69) hardy-proposed; urgency=low + + [Colin Ian King] + + * SAUCE: Disable 4MB page tables for Atom, work around errata AAE44 + - LP: #523112, #322867 + + [Stefan Bader] + + * Fix build failure in bnx2 + - LP: #435185 + + [Upstream Kernel Changes] + + * bnx2: Add PCI ID for 5716. + - LP: #435185 + * bnx2: Add PCI ID for 5716S. + - LP: #435185 + + -- Stefan Bader Thu, 18 Mar 2010 00:13:51 +0000 + +linux (2.6.24-27.68) hardy-security; urgency=low + + [Stefan Bader] + + * xen: Remove TIF_ABI_PENDING bit + - CVE-2010-0307 + * openvz: Remove TIF_ABI_PENDING bit + - CVE-2010-0307 + * openvz: Adapt connector code patch + - CVE-2010-0410 + * rt: Remove TIF_ABI_PENDING bit + - CVE-2010-0307 + + [Surbhi Palande] + + * Revert "[Upstream] e1000: enhance frame fragment detection" + - CVE-2009-4536 + * Revert "[Upstream] e1000e: enhance frame fragment detection" + - CVE-2009-4538 + + [Upstream Kernel Changes] + + * e1000: enhance frame fragment detection + - CVE-2009-4536 + * e1000/e1000e: don't use small hardware rx buffers + - CVE-2009-4536 + * e1000e: enhance frame fragment detection + - CVE-2009-4538 + * connector: Delete buggy notification code. + - CVE-2010-0410 + * Fix potential crash with sys_move_pages + - CVE-2010-0415 + * futex: Handle user space corruption gracefully + - CVE-2010-0622 + * x86: Increase MIN_GAP to include randomized stack + - LP: #504164 + * Split 'flush_old_exec' into two functions + - CVE-2010-0307 + * Fix 'flush_old_exec()/setup_new_exec()' split + - CVE-2010-0307 + * x86: get rid of the insane TIF_ABI_PENDING bit + - CVE-2010-0307 + * powerpc: TIF_ABI_PENDING bit removal + - CVE-2010-0307 + * sparc: TIF_ABI_PENDING bit removal + - CVE-2010-0307 + * x86: set_personality_ia32() misses force_personality32 + - CVE-2010-0307 + + -- Stefan Bader Tue, 09 Mar 2010 22:21:39 +0100 + +linux (2.6.24-27.67) hardy-proposed; urgency=low + + [Upstream Kernel Changes] + + * USB: usb-storage: unusual_devs entry for Oracom MP3 player + - LP: #522059 + * USB: quirks and unusual_devs entry for Actions flash drive + - LP: #522059 + * usb-storage: add unusual_devs entry for Samsung YP-U3 + - LP: #522059 + * USB: Fix M600i unusual_devs entry + - LP: #522059 + * USB: Add support for ROKR W5 in unusual_devs.h + - LP: #522059 + * USB: usb-storage Motorola Phone Razr v3xx US_FL_FIX_CAPACITY patch + - LP: #522059 + * usb-storage: unusual_devs entry for Nokia 5300 + - LP: #522059 + * USB: Fix the Nokia 6300 storage-mode. + - LP: #522059 + * USB: Fixing Nokia 3310c in storage mode + - LP: #522059 + * USB: unusual_devs addition for RockChip MP3 player + - LP: #522059 + * usb: unusual devs patch for Nokia 5310 Music Xpress + - LP: #522059 + * USB: unusual_devs entry for Argosy USB mass-storage interface + - LP: #522059 + * usb: unusual devs patch for Nokia 7610 Supernova + - LP: #522059 + * USB: storage: updates unusual_devs entry for the Nokia 6300 + - LP: #522059 + * USB: storage: update unusual_devs entries for Nokia 5300 and 5310 + - LP: #522059 + * USB: storage: unusual_devs entry for Mio C520-GPS + - LP: #522059 + * USB: storage: unusual_devs.h: Nokia 3109c addition + - LP: #522059 + + -- Stefan Bader Wed, 17 Feb 2010 21:34:27 +0100 + +linux (2.6.24-27.66) hardy-proposed; urgency=low + + [Upstream Kernel Changes] + + * bridge: handle process all link-local frames + - LP: #508008 + * USB: storage: Nikon D80 new FW still needs Fixup + - LP: #518750 + * USB: INTOVA Pixtreme camera mass storage device + - LP: #518750 + * USB: usb-storage: quirk around v1.11 firmware on Nikon D4 + - LP: #518750 + * USB: Unusual dev for the "Kyocera / Contax SL300R T*" digital camera. + - LP: #518750 + * USB: add Nikon D300 camera to unusual_devs + - LP: #518750 + * USB: usb-storage: unusual_devs entry for Nikon D2H + - LP: #518750 + + -- Stefan Bader Tue, 09 Feb 2010 14:16:25 +0100 + +linux (2.6.24-27.65) hardy-security; urgency=low + + [Leann Ogasawara] + + * [Upstream] e1000: enhance frame fragment detection + - CVE-2009-4536 + * [Upstream] e1000e: enhance frame fragment detection + - CVE-2009-4538 + * OPENVZ: untangle the do_mremap() mess + - CVE-2010-0291 + * XEN: untangle the do_mremap() mess + - CVE-2010-0291 + + [Tim Gardner] + + * (config) Enable ipv6 filter modules on virtual flavour + - LP: #487010 + + [Upstream Kernel Changes] + + * hfs: fix a potential buffer overflow + - CVE-2009-4020 + * fuse: prevent fuse_put_request on invalid pointer + - CVE-2009-4021 + * KVM: x86 emulator: limit instructions to 15 bytes + - CVE-2009-4031 + * ext4: Avoid null pointer dereference when decoding EROFS w/o a journal + - CVE-2009-4308 + * firewire: ohci: handle receive packets with a data length of zero + - CVE-2009-4138 + * kernel/signal.c: fix kernel information leak with print-fatal-signals=1 + - CVE-2010-0003 + * netfilter: ebtables: enforce CAP_NET_ADMIN + - CVE-2010-0007 + * untangle the do_mremap() mess + - CVE-2010-0291 + + -- Leann Ogasawara Wed, 09 Dec 2009 17:16:25 +0000 + +linux (2.6.24-26.64) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * net ax25: Fix signed comparison in the sockopt handler + - CVE-2009-2909 + * x86: Don't leak 64-bit kernel register values to 32-bit processes + - CVE-2009-2910 + * tc: Fix unitialized kernel memory leak + - CVE-2009-3228 + * fs: pipe.c null pointer dereference + - CVE-2009-3547 + * netlink: fix typo in initialization + - CVE-2009-3612 + * r8169: use hardware auto-padding. + - CVE-2009-3613 + * r8169: balance pci_map / pci_unmap pair + - CVE-2009-3613 + * drm/r128: Add test for initialisation to all ioctls that require it + - CVE-2009-3620 + * AF_UNIX: Fix deadlock on connecting to shutdown socket + - CVE-2009-3621 + * KVM: Prevent overflow in KVM_GET_SUPPORTED_CPUID + - CVE-2009-3638 + * KVM: VMX: Check cpl before emulating debug register access + - CVE-2009-3722 + * connector: Keep the skb in cn_callback_data + - CVE-2009-3725 + * connector: Provide the sender's credentials to the callback + - CVE-2009-3725 + * connector: Fix incompatible pointer type warning + - CVE-2009-3725 + * uvesafb/connector: Disallow unpliviged users to send netlink packets + - CVE-2009-3725 + * NFSv4: Fix a problem whereby a buggy server can oops the kernel + - CVE-2009-3726 + * megaraid_sas: remove sysfs dbg_lvl world writeable permissions + - CVE-2009-3889 + * isdn: hfc_usb: Fix read buffer overflow + - CVE-2009-4005 + * gdth: Prevent negative offsets in ioctl CVE-2009-3080 + - CVE-2009-3080 + + -- Leann Ogasawara Mon, 23 Nov 2009 13:47:55 -0800 + +linux (2.6.24-25.63) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * eCryptfs: Prevent lower dentry from going negative during unlink + - CVE-2009-2908 + + -- Leann Ogasawara Mon, 19 Oct 2009 22:47:16 -0400 + +linux (2.6.24-25.62) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * parisc: isa-eeprom - Fix loff_t usage + - CVE-2009-2846 + * do_sigaltstack: avoid copying 'stack_t' as a structure to user space + - CVE-2009-2847 + * execve: must clear current->clear_child_tid + - CVE-2009-2848 + * md: avoid dereferencing NULL pointer when accessing suspend_* sysfs + attributes. + - CVE-2009-2849 + * appletalk: Fix skb leak when ipddp interface is not loaded + - CVE-2009-2903 + * NET: llc, zero sockaddr_llc struct + - CVE-2009-3001 + * appletalk: fix atalk_getname() leak + - CVE-2009-3002 + * econet: Fix econet_getname() leak + - CVE-2009-3002 + * irda: Fix irda_getname() leak + - CVE-2009-3002 + * netrom: Fix nr_getname() leak + - CVE-2009-3002 + * rose: Fix rose_getname() leak + - CVE-2009-3002 + * random: make get_random_int() more random + - CVE-2009-3238 + * capabilities: move cap_file_mmap to commoncap.c + - CVE-2009-2695 + * SELinux: call cap_file_mmap in selinux_file_mmap + - CVE-2009-2695 + * security/SELinux: seperate lsm specific mmap_min_addr + - CVE-2009-2695 + * security: define round_hint_to_min in !CONFIG_SECURITY + - CVE-2009-2695 + * KVM: x86: Disallow hypercalls for guest callers in rings > 0 + - CVE-2009-3290 + * nfsd4: turn nfsd4_open struct's iattr/verf union into separate fields + - CVE-2009-3286 + + -- Leann Ogasawara Mon, 05 Oct 2009 16:27:30 -0700 + +linux (2.6.24-24.61) hardy-proposed; urgency=low + + [Alok N Kataria] + + * x86: use cpu_khz for loops_per_jiffy calculation + - LP: #418154 + + [Leann Ogasawara] + + * Enable multicast routing (including PIM1 and PIM2) for hppa, ia64, + sparc + - LP: #416266 + + -- Stefan Bader Wed, 26 Aug 2009 16:06:03 +0200 + +linux (2.6.24-24.60) hardy-proposed; urgency=low + + [Stefan Bader] + + * SAUCE: init: Add extra mark_rodata_ro quirk for Acer Aspire One + - LP: #322867 + + [Upstream Kernel Changes] + + * USB: EHCI: fix remote-wakeup regression + - LP: #406419 + + -- Stefan Bader Tue, 18 Aug 2009 18:25:47 +0200 + +linux (2.6.24-24.59) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * Make sock_sendpage() use kernel_sendpage() + - CVE-2009-2692 + + -- Stefan Bader Mon, 17 Aug 2009 19:46:45 +0200 + +linux (2.6.24-24.57) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * Add '-fno-delete-null-pointer-checks' to gcc CFLAGS + - LP: #403647 + * personality: fix PER_CLEAR_ON_SETID + - CVE-2009-1895 + * KVM: detect if VCPU triple faults + - CVE-2009-2287 + * KVM: x86: check for cr3 validity in ioctl_set_sregs + - CVE-2009-2287 + * r8169: fix crash when large packets are received + - CVE-2009-1389 + * eCryptfs: Check Tag 11 literal data buffer size + - CVE-2009-2406 + * eCryptfs: parse_tag_3_packet check tag 3 packet encrypted key size + - CVE-2009-2407 + + -- Stefan Bader Thu, 23 Jul 2009 15:37:05 +0200 + +linux (2.6.24-24.56) hardy-proposed; urgency=low + + [Stefan Bader] + + * Rebuild of 2.6.24-24.54 with 2.6.24-24.55 security release applied + + -- Stefan Bader Sat, 20 Jun 2009 00:14:36 +0200 + +linux (2.6.24-24.54) hardy-proposed; urgency=low + + [Andy Whitcroft] + + * SAUCE: do not make sysdev links for processors which are not booted + - LP: #295091 + + [Brad Figg] + + * SAUCE: Add information to recognize Toshiba Satellite Pro M10 Alps Touchpad + - LP: #330885 + * SAUCE: Add signatures to airprime driver to support newer Novatel devices + - LP: #365291 + + [Stefan Bader] + + * SAUCE: vgacon: Return the upper half of 512 character fonts + - LP: #355057 + + [Upstream Kernel Changes] + + * SUNRPC: Fix autobind on cloned rpc clients + - LP: #341783, #212485 + * Input: atkbd - mark keyboard as disabled when suspending/unloading + - LP: #213988 + * x86: mtrr: don't modify RdDram/WrDram bits of fixed MTRRs + - LP: #292619 + * sis190: add identifier for Atheros AR8021 PHY + - LP: #247889 + * bluetooth hid: enable quirk handling for Apple Wireless Keyboards in + 2.6.24 + - LP: #227501 + * nfsd: move callback rpc_client creation into separate thread + - LP: #253004 + * nfsd4: probe callback channel only once + - LP: #253004 + + -- Stefan Bader Thu, 19 Mar 2009 01:28:13 +0100 + +linux (2.6.24-24.55) hardy-security; urgency=low + + [Stefan Bader] + + * cifs: backport buffer size fixes for CIFSGetDFSRefer() + - CVE-2009-1633 + * OPENVZ: Fixup for 'kill sig -1' must only apply to caller's namespace + - CVE-2009-1338 + + [Upstream Kernel Changes] + + * nfsd: nfsd should drop CAP_MKNOD for non-root + - CVE-2009-1072 + * KVM: VMX: Don't allow uninhibited access to EFER on i386 + - CVE-2009-1242 + * exit_notify: kill the wrong capable(CAP_KILL) check + - CVE-2009-1337 + * e1000: add missing length check to e1000 receive routine + - CVE-2009-1385 + * Fix memory overwrite when saving nativeFileSystem field during mount + - CVE-2009-1439 + * cifs: Increase size of tmp_buf in cifs_readdir to avoid potential + overflows + - CVE-2009-1633 + * cifs: fix unicode string area word alignment in session setup + - CVE-2009-1633 + * sparc64: Fix crash with /proc/iomem + - CVE-2009-1914 + * splice: fix deadlock in splicing to file + - CVE-2009-1961 + * agp: zero pages before sending to userspace + - CVE-2009-1192 + * af_rose/x25: Sanity check the maximum user frame size + - CVE-2009-1265 + * 'kill sig -1' must only apply to caller's namespace + - CVE-2009-1338 + * nfs: Fix NFS v4 client handling of MAY_EXEC in nfs_permission. + - CVE-2009-1630 + + -- Stefan Bader Mon, 15 Jun 2009 14:01:58 +0200 + +linux (2.6.24-24.53) hardy-proposed; urgency=low + [Stefan Bader] + + * Rebuild of 2.6.24-24.51 with 2.6.24-23.52 security patches applied. + + -- Stefan Bader Sun, 05 Apr 2009 08:23:06 -0400 + +linux (2.6.24-24.51) hardy-proposed; urgency=low + + [Alessio Igor Bogani] + + * rt: Updated PREEMPT_RT support to rt27 + - LP: #324275 + + [Steve Beattie] + + * fix apparmor memory leak on deleted file ops + - LP: #329489 + + [Upstream Kernel Changes] + + * KVM: MMU: Add locking around kvm_mmu_slot_remove_write_access() + - LP: #335097, #333409 + * serial: 8250: fix shared interrupts issues with SMP and RT kernels + - LP: #280821 + * 8250.c: port.lock is irq-safe + - LP: #280821 + * ACPI: Clear WAK_STS on resume + - LP: #251338 + + -- Stefan Bader Wed, 25 Feb 2009 10:18:56 +0100 + +linux (2.6.24-24.50) hardy-proposed; urgency=low + + [Alok Kataria] + + * x86: add X86_FEATURE_HYPERVISOR feature bit + - LP: #319945 + * x86: add a synthetic TSC_RELIABLE feature bit + - LP: #319945 + * x86: vmware: look for DMI string in the product serial key + - LP: #319945 + * x86: Hypervisor detection and get tsc_freq from hypervisor + - LP: #319945 + * x86: Use the synthetic TSC_RELIABLE bit to workaround virtualization + anomalies. + - LP: #319945 + * x86: Skip verification by the watchdog for TSC clocksource. + - LP: #319945 + * x86: Mark TSC synchronized on VMware. + - LP: #319945 + + [Colin Ian King] + + * SAUCE: Bluetooth USB: fix kernel panic during suspend while streaming + audio to bluetooth headset + - LP: #331106 + + [James Troup] + + * XEN: Enable architecture specific get_unmapped_area_topdown + - LP: #237724 + + [Stefan Bader] + + * Xen: Fix FTBS after Vmware TSC updates. + - LP: #319945 + + [Upstream Kernel Changes] + + * r8169: fix RxMissed register access + - LP: #324760 + * r8169: Tx performance tweak helper + - LP: #326891 + * r8169: use pci_find_capability for the PCI-E features + - LP: #326891 + * r8169: add 8168/8101 registers description + - LP: #326891 + * r8169: add hw start helpers for the 8168 and the 8101 + - LP: #326891 + * r8169: additional 8101 and 8102 support + - LP: #326891 + * Fix memory corruption in console selection + - LP: #329007 + + -- Stefan Bader Fri, 30 Jan 2009 11:35:26 +0100 + +linux (2.6.24-23.52) hardy-security; urgency=low + + [Stefan Bader] + * rt: Fix FTBS caused by shm changes + - CVE-2009-0859 + + [Steve Beattie] + + * fix apparmor memory leak on deleted file ops + - LP: #329489 + + [Upstream Kernel Changes] + + * NFS: Remove the buggy lock-if-signalled case from do_setlk() + - CVE-2008-4307 + * sctp: Avoid memory overflow while FWD-TSN chunk is received with bad + stream ID + - CVE-2009-0065 + * net: 4 bytes kernel memory disclosure in SO_BSDCOMPAT gsopt try #2 + - CVE-2009-0676 + * sparc: Fix mremap address range validation. + - CVE-2008-6107 + * copy_process: fix CLONE_PARENT && parent_exec_id interaction + - CVE-2009-0028 + * security: introduce missing kfree + - CVE-2009-0031 + * eCryptfs: check readlink result was not an error before using it + - CVE-2009-0269 + * dell_rbu: use scnprintf() instead of less secure sprintf() + - CVE-2009-0322 + * drivers/net/skfp: if !capable(CAP_NET_ADMIN): inverted logic + - CVE-2009-0675 + * Ext4: Fix online resize block group descriptor corruption + - CVE-2009-0745 + * ext4: Initialize the new group descriptor when resizing the filesystem + - CVE-2009-0745 + * ext4: Add sanity check to make_indexed_dir + - CVE-2009-0746 + * x86-64: syscall-audit: fix 32/64 syscall hole + - CVE-2009-0834 + * x86-64: seccomp: fix 32/64 syscall hole + - CVE-2009-0835 + * shm: fix shmctl(SHM_INFO) lockup with !CONFIG_SHMEM + - CVE-2009-0859 + * apparmor: Fix handling of larger number of profiles + - LP: #345144 + * udf: Fix oops when invalid character in filename occurs + - LP: #321606 + * Fix memory corruption in console selection + - CVE-2009-1046 + * SPARC64: Loosen checks in exception table handling. + - LP: #301608, #349655 + + -- Stefan Bader Mon, 16 Mar 2009 18:39:14 +0100 + +linux (2.6.24-23.49) hardy-proposed; urgency=low + + [Colin Ian King] + + * drm/i915 fixes to AR register restore + - LP: #302421 + + [Fabio M. Di Nitto] + + * Enable USB serial support on sparc + - LP: #305188 + + [Stefan Bader] + + * openvz: Adapt openvz patch to compile with improved tcp hash + - LP: #301608 + * Ubuntu-2.6.24-23.47 + * Merge of Ubuntu-2.6.24-23.48 security release + + [Tim Gardner] + + * Enable CONFIG_NFSD_V4=y in -virtual flavour. + - LP: #224138 + + [Upstream Kernel Changes] + + * SPARC64: Loosen checks in exception table handling. + - LP: #301608 + * SPARC: Fix link errors with gcc-4.3 + - LP: #301608 + * TCP: Improve ipv4 established hash function. + - LP: #301608 + * NIU: More BMAC alt MAC address fixes. + - LP: #301608 + * NIU: Fix BMAC alternate MAC address indexing. + - LP: #301608 + * NIU: Bump driver version and release date. + - LP: #301608 + + [Zhao Yakui] + + * Add "acpi.power_nocheck=1" to disable power state check in power + transition + - LP: #69925 + * ACPI: Attach the ACPI device to the ACPI handle as early as possible + - LP: #69925 + * ACPI: Add DMI check to disable power state check in power transition + - LP: #69925 + + -- Stefan Bader Sat, 24 Jan 2009 15:07:12 +0100 + +linux (2.6.24-23.48) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * ATM: CVE-2008-5079: duplicate listen() on socket corrupts the vcc table + - CVE-2008-5079 + * libertas: fix buffer overrun + - CVE-2008-5134 + * Fix inotify watch removal/umount races + - CVE-2008-5182 + * net: Fix soft lockups/OOM issues w/ unix garbage collector + - CVE-2008-5300 + * Enforce a minimum SG_IO timeout + - CVE-2008-5700 + * ib700wdt.c - fix buffer_underflow bug + - CVE-2008-5702 + + -- Stefan Bader Wed, 14 Jan 2009 17:46:55 +0100 + +linux (2.6.24-23.47) hardy-proposed; urgency=low + + [Colin Ian King] + + * drm/i915 fixes to AR register restore + - LP: #302421 + + [Fabio M. Di Nitto] + + * Enable USB serial support on sparc + - LP: #305188 + + [Stefan Bader] + + * openvz: Adapt openvz patch to compile with improved tcp hash + - LP: #301608 + + [Tim Gardner] + + * Enable CONFIG_NFSD_V4=y in -virtual flavour. + - LP: #224138 + + [Upstream Kernel Changes] + + * SPARC64: Loosen checks in exception table handling. + - LP: #301608 + * SPARC: Fix link errors with gcc-4.3 + - LP: #301608 + * TCP: Improve ipv4 established hash function. + - LP: #301608 + * NIU: More BMAC alt MAC address fixes. + - LP: #301608 + * NIU: Fix BMAC alternate MAC address indexing. + - LP: #301608 + * NIU: Bump driver version and release date. + - LP: #301608 + + [Zhao Yakui] + + * Add "acpi.power_nocheck=1" to disable power state check in power + transition + - LP: #69925 + * ACPI: Attach the ACPI device to the ACPI handle as early as possible + - LP: #69925 + * ACPI: Add DMI check to disable power state check in power transition + - LP: #69925 + + -- Stefan Bader Wed, 03 Dec 2008 16:16:13 +0100 + +linux (2.6.24-23.46) hardy-proposed; urgency=low + + [Alessio Igor Bogani] + + * rt: Updated PREEMPT_RT support to rt21 + - LP: #302138 + + [Amit Kucheria] + + * SAUCE: Update lpia patches from moblin tree + - LP: #291457 + + [Andy Whitcroft] + + * SAUCE: replace gfs2_bitfit with upstream version to prevent oops + - LP: #276641 + + [Colin Ian King] + + * isdn: Do not validate ISDN net device address prior to interface-up + - LP: #237306 + * hwmon: (coretemp) Add Penryn CPU to coretemp + - LP: #235119 + * USB: add support for Motorola ROKR Z6 cellphone in mass storage mode + - LP: #263217 + * md: fix an occasional deadlock in raid5 + - LP: #208551 + + [Stefan Bader] + + * SAUCE: buildenv: Show CVE entries in printchanges + * SAUCE: buildenv: Send git-ubuntu-log informational message to stderr + * Xen: dma: avoid unnecessarily SWIOTLB bounce buffering + - LP: #247148 + * Update openvz patchset to apply to latest stable tree. + - LP: #301634 + * XEN: Fix FTBS with stable updates + - LP: #301634 + + [Steve Conklin] + + * Add HID quirk for dual USB gamepad + - LP: #140608 + + [Tim Gardner] + + * Enable CONFIG_AX25_DAMA_SLAVE=y + - LP: #257684 + * SAUCE: Correctly blacklist Thinkpad r40e in ACPI + - LP: #278794 + * SAUCE: ALPS touchpad for Dell Latitude E6500/E6400 + - LP: #270643 + + [Upstream Kernel Changes] + + * Revert "[Bluetooth] Eliminate checks for impossible conditions in IRQ + handler" + - LP: #217659 + * KVM: VMX: Clear CR4.VMXE in hardware_disable + - LP: #268981 + * iov_iter_advance() fix + - LP: #231746 + * Fix off-by-one error in iov_iter_advance() + - LP: #231746 + * USB: serial: ch341: New VID/PID for CH341 USB-serial + - LP: #272485 + * x86: Fix 32-bit x86 MSI-X allocation leakage + - LP: #273103 + * b43legacy: Fix failure in rate-adjustment mechanism + - LP: #273143 + * x86: Reserve FIRST_DEVICE_VECTOR in used_vectors bitmap. + - LP: #276334 + * openvz: merge missed fixes from vanilla 2.6.24 openvz branch + - LP: #298059 + * openvz: some autofs related fixes + - LP: #298059 + * openvz: fix ve stop deadlock after nfs connect + - LP: #298059 + * openvz: fix netlink and rtnl inside container + - LP: #298059 + * openvz: fix wrong size of ub0_percpu + - LP: #298059 + * openvz: fix OOPS while stopping VE started before binfmt_misc.ko loaded + - LP: #298059 + * x86-64: Fix "bytes left to copy" return value for copy_from_user() + * NET: Fix race in dev_close(). (Bug 9750) + - LP: #301608 + * IPV6: Fix IPsec datagram fragmentation + - LP: #301608 + * IPV6: dst_entry leak in ip4ip6_err. + - LP: #301608 + * IPV4: Remove IP_TOS setting privilege checks. + - LP: #301608 + * IPCONFIG: The kernel gets no IP from some DHCP servers + - LP: #301608 + * IPCOMP: Disable BH on output when using shared tfm + - LP: #301608, #242804 + * IRQ_NOPROBE helper functions + - LP: #301608 + * MIPS: Mark all but i8259 interrupts as no-probe. + - LP: #301608 + * ub: fix up the conversion to sg_init_table() + - LP: #301608 + * x86: adjust enable_NMI_through_LVT0() + - LP: #301608 + * SCSI ips: handle scsi_add_host() failure, and other err cleanups + - LP: #301608 + * CRYPTO xcbc: Fix crash with IPsec + - LP: #301608 + * CRYPTO xts: Use proper alignment + - LP: #301608 + * SCSI ips: fix data buffer accessors conversion bug + - LP: #301608 + * SCSI aic94xx: fix REQ_TASK_ABORT and REQ_DEVICE_RESET + - LP: #301608 + * x86: replace LOCK_PREFIX in futex.h + - LP: #301608 + * ARM pxa: fix clock lookup to find specific device clocks + - LP: #301608 + * futex: fix init order + - LP: #301608 + * futex: runtime enable pi and robust functionality + - LP: #301608 + * file capabilities: simplify signal check + - LP: #301608 + * hugetlb: ensure we do not reference a surplus page after handing it to + buddy + - LP: #301608 + * ufs: fix parenthesisation in ufs_set_fs_state() + - LP: #301608 + * spi: pxa2xx_spi clock polarity fix + - LP: #301608 + * NETFILTER: Fix incorrect use of skb_make_writable + - LP: #301608 + * NETFILTER: fix ebtable targets return + - LP: #301608 + * SCSI advansys: fix overrun_buf aligned bug + - LP: #301608 + * pata_hpt*, pata_serverworks: fix UDMA masking + - LP: #301608 + * moduleparam: fix alpha, ia64 and ppc64 compile failures + - LP: #301608 + * PCI x86: always use conf1 to access config space below 256 bytes + - LP: #301608 + * e1000e: Fix CRC stripping in hardware context bug + - LP: #301608 + * atmel_spi: fix clock polarity + - LP: #301608 + * x86: move out tick_nohz_stop_sched_tick() call from the loop + - LP: #301608 + * macb: Fix speed setting + - LP: #301608 + * ioat: fix 'ack' handling, driver must ensure that 'ack' is zero + - LP: #301608 + * VT notifier fix for VT switch + - LP: #301608 + * USB: ftdi_sio: Workaround for broken Matrix Orbital serial port + - LP: #301608 + * USB: ftdi_sio - really enable EM1010PC + - LP: #301608 + * SCSI: fix BUG when sum(scatterlist) > bufflen + - LP: #301608 + * x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC + - LP: #301608 + * Fix default compose table initialization + - LP: #301608 + * SCSI: gdth: bugfix for the at-exit problems + - LP: #301608 + * sched: fix race in schedule() + - LP: #301608 + * nfsd: fix oops on access from high-numbered ports + - LP: #301608 + * sched_nr_migrate wrong mode bits + - LP: #301608 + * NETFILTER: xt_time: fix failure to match on Sundays + - LP: #301608 + * NETFILTER: nfnetlink_queue: fix computation of allocated size for + netlink skb + - LP: #301608 + * NETFILTER: nfnetlink_log: fix computation of netlink skb size + - LP: #301608 + * zisofs: fix readpage() outside i_size + - LP: #301608 + * jbd2: correctly unescape journal data blocks + - LP: #301608 + * jbd: correctly unescape journal data blocks + - LP: #301608 + * aio: bad AIO race in aio_complete() leads to process hang + - LP: #301608 + * async_tx: avoid the async xor_zero_sum path when src_cnt > + device->max_xor + - LP: #301608 + * SCSI advansys: Fix bug in AdvLoadMicrocode + - LP: #301608 + * BLUETOOTH: Fix bugs in previous conn add/del workqueue changes. + - LP: #301608 + * relay: fix subbuf_splice_actor() adding too many pages + - LP: #301608 + * slab: NUMA slab allocator migration bugfix + - LP: #301608 + * S390 futex: let futex_atomic_cmpxchg_pt survive early functional tests. + - LP: #301608 + * Linux 2.6.24.4 + - LP: #301608 + * time: prevent the loop in timespec_add_ns() from being optimised away + - LP: #301632 + * kbuild: soften modpost checks when doing cross builds + - LP: #301632 + * mtd: memory corruption in block2mtd.c + - LP: #301632 + * md: remove the 'super' sysfs attribute from devices in an 'md' array + - LP: #301632 + * V4L: ivtv: Add missing sg_init_table() + - LP: #301632 + * UIO: add pgprot_noncached() to UIO mmap code + - LP: #301632 + * USB: new quirk flag to avoid Set-Interface + - LP: #301632 + * NOHZ: reevaluate idle sleep length after add_timer_on() + - LP: #301632 + * slab: fix cache_cache bootstrap in kmem_cache_init() + - LP: #301632 + * xen: fix RMW when unmasking events + - LP: #301632 + * xen: mask out SEP from CPUID + - LP: #301632 + * xen: fix UP setup of shared_info + - LP: #301632 + * PERCPU : __percpu_alloc_mask() can dynamically size percpu_data storage + - LP: #301632 + * alloc_percpu() fails to allocate percpu data + - LP: #301632 + * vfs: fix data leak in nobh_write_end() + - LP: #301632 + * pci: revert SMBus unhide on HP Compaq nx6110 + - LP: #301632 + * vmcoreinfo: add the symbol "phys_base" + - LP: #301632 + * USB: Allow initialization of broken keyspan serial adapters. + - LP: #301632 + * USB: serial: fix regression in Visor/Palm OS module for kernels >= + 2.6.24 + - LP: #301632 + * USB: serial: ti_usb_3410_5052: Correct TUSB3410 endpoint requirements. + - LP: #301632 + * CRYPTO xcbc: Fix crash when ipsec uses xcbc-mac with big data chunk + - LP: #301632 + * mtd: fix broken state in CFI driver caused by FL_SHUTDOWN + - LP: #301632 + * ipmi: change device node ordering to reflect probe order + - LP: #301632 + * AX25 ax25_out: check skb for NULL in ax25_kick() + - LP: #301632 + * NET: include into linux/ethtool.h for __u* typedef + - LP: #301632 + * SUNGEM: Fix NAPI assertion failure. + - LP: #301632 + * INET: inet_frag_evictor() must run with BH disabled + - LP: #301632 + * LLC: Restrict LLC sockets to root + - LP: #301632 + * netpoll: zap_completion_queue: adjust skb->users counter + - LP: #301632 + * PPPOL2TP: Make locking calls softirq-safe + - LP: #301632 + * PPPOL2TP: Fix SMP issues in skb reorder queue handling + - LP: #301632 + * NET: Add preemption point in qdisc_run + - LP: #301632 + * sch_htb: fix "too many events" situation + - LP: #301632 + * SCTP: Fix local_addr deletions during list traversals. + - LP: #301632 + * NET: Fix multicast device ioctl checks + - LP: #301632 + * TCP: Fix shrinking windows with window scaling + - LP: #301632 + * TCP: Let skbs grow over a page on fast peers + - LP: #301632 + * VLAN: Don't copy ALLMULTI/PROMISC flags from underlying device + - LP: #301632 + * SPARC64: Fix atomic backoff limit. + - LP: #301632 + * SPARC64: Fix __get_cpu_var in preemption-enabled area. + - LP: #301632 + * SPARC64: flush_ptrace_access() needs preemption disable. + - LP: #301632 + * libata: assume no device is attached if both IDENTIFYs are aborted + - LP: #301632 + * sis190: read the mac address from the eeprom first + - LP: #301632 + * bluetooth: hci_core: defer hci_unregister_sysfs() + - LP: #301632 + * SPARC64: Fix FPU saving in 64-bit signal handling. + - LP: #301632 + * DVB: tda10086: make the 22kHz tone for DISEQC a config option + - LP: #301632 + * HFS+: fix unlink of links + - LP: #301632, #154416 + * plip: replace spin_lock_irq with spin_lock_irqsave in irq context + - LP: #301632 + * signalfd: fix for incorrect SI_QUEUE user data reporting + - LP: #301632 + * POWERPC: Fix build of modular drivers/macintosh/apm_emu.c + - LP: #301632 + * PARISC futex: special case cmpxchg NULL in kernel space + - LP: #301632 + * PARISC pdc_console: fix bizarre panic on boot + - LP: #301632 + * PARISC fix signal trampoline cache flushing + - LP: #301632 + * acpi: bus: check once more for an empty list after locking it + - LP: #301632 + * fbdev: fix /proc/fb oops after module removal + - LP: #301632 + * macb: Call phy_disconnect on removing + - LP: #301632 + * file capabilities: remove cap_task_kill() + - LP: #301632 + * locks: fix possible infinite loop in fcntl(F_SETLKW) over nfs + - LP: #301632 + * Linux 2.6.24.5 + - LP: #301632 + * splice: use mapping_gfp_mask + - LP: #301634 + * fix oops on rmmod capidrv + - LP: #301634 + * USB: gadget: queue usb USB_CDC_GET_ENCAPSULATED_RESPONSE message + - LP: #301634 + * JFFS2: Fix free space leak with in-band cleanmarkers + - LP: #301634 + * Increase the max_burst threshold from 3 to tp->reordering. + - LP: #301634 + * USB: remove broken usb-serial num_endpoints check + - LP: #301634 + * V4L: Fix VIDIOCGAP corruption in ivtv + - LP: #301634 + * Linux 2.6.24.6, 2.6.24.7 + - LP: #301634 + + -- Stefan Bader Mon, 24 Nov 2008 09:44:34 +0100 + +linux (2.6.24-22.45) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * Don't allow splice() to files opened with O_APPEND + - CVE-2008-4554 + * sctp: Fix oops when INIT-ACK indicates that peer doesn't support AUTH + - CVE-2008-4576 + * sctp: Fix kernel panic while process protocol violation parameter + - CVE-2008-4618 + * hfsplus: fix Buffer overflow with a corrupted image + - CVE-2008-4933 + * hfsplus: check read_mapping_page() return value + - CVE-2008-4934 + * net: Fix recursive descent in __scm_destroy(). + - CVE-2008-5029 + * net: unix: fix inflight counting bug in garbage collector + - CVE-2008-5029 + * security: avoid calling a NULL function pointer in + drivers/video/tvaudio.c + - CVE-2008-5033 + * hfs: fix namelength memory corruption + - CVE-2008-5025 + * V4L/DVB (9621): Avoid writing outside shadow.bytes[] array + + -- Stefan Bader Tue, 18 Nov 2008 17:19:02 +0100 + +linux (2.6.24-22.44) hardy-proposed; urgency=low + + [Amit Kucheria] + + * SAUCE: Update lpia patches from moblin tree + - LP: #291457 + + [Colin Ian King] + + * isdn: Do not validate ISDN net device address prior to interface-up + - LP: #237306 + * hwmon: (coretemp) Add Penryn CPU to coretemp + - LP: #235119 + * USB: add support for Motorola ROKR Z6 cellphone in mass storage mode + - LP: #263217 + * md: fix an occasional deadlock in raid5 + - LP: #208551 + * Revert "[Bluetooth] Eliminate checks for impossible conditions in IRQ + handler" + - LP: #217659 + + [Stefan Bader] + + * SAUCE: buildenv: Show CVE entries in printchanges + * SAUCE: buildenv: Send git-ubuntu-log informational message to stderr + + [Tim Gardner] + + * Enable CONFIG_AX25_DAMA_SLAVE=y + - LP: #257684 + * SAUCE: Correctly blacklist Thinkpad r40e in ACPI + - LP: #278794 + * SAUCE: ALPS touchpad for Dell Latitude E6500/E6400 + - LP: #270643 + * KVM: VMX: Clear CR4.VMXE in hardware_disable + - LP: #268981 + * USB: serial: ch341: New VID/PID for CH341 USB-serial + - LP: #272485 + * x86: Fix 32-bit x86 MSI-X allocation leakage + - LP: #273103 + * b43legacy: Fix failure in rate-adjustment mechanism + - LP: #273143 + * x86: Reserve FIRST_DEVICE_VECTOR in used_vectors bitmap. + - LP: #276334 + + -- Stefan Bader Thu, 23 Oct 2008 07:52:39 -0400 + +linux (2.6.24-21.43) hardy-security; urgency=low + + [Stefan Bader] + + * Enable CONFIG_DEBUG_RODATA=y for all architectures. + + [Upstream Kernel Changes] + + * Fix ZERO_PAGE breakage with vmware + - CVE-2008-2372 + * wan: Missing capability checks in sbni_ioctl() + - CVE-2008-3525 + * sctp: add verification checks to SCTP_AUTH_KEY option + - CVE-2008-3526, CVE-2008-4445 + * tmpfs: fix kernel BUG in shmem_delete_inode + - CVE-2008-3534 + * fbdefio: add set_page_dirty handler to deferred IO FB + - CVE-2008-3534 + * iov_iter_advance() fix + - LP: #231746 + * Fix off-by-one error in iov_iter_advance() + - LP: #231746 + - CVE-2008-3535 + * Incorrect length was used in SCTP_*_AUTH_CHUNKS socket option + - CVE-2008-3792 + * sctp: fix potential panics in the SCTP-AUTH API. + - CVE-2008-3792 + * nfsd: fix buffer overrun decoding NFSv4 acl + - CVE-2008-3915 + * sctp: fix random memory dereference with SCTP_HMAC_IDENT option. + - CVE-2008-4113 + * Only allow access to DRM_I915_HWS_ADDR ioctl() for Xserver. + - CVE-2008-383 + + -- Stefan Bader Wed, 01 Oct 2008 16:59:37 -0400 + +linux (2.6.24-21.42) hardy-proposed; urgency=low + + [Stefan Bader] + + * Print bug reference number for upstream changes + + [Tim Gardner] + + * b43 - Add Dell adapter to Bluetooth coexiastence check. + - LP: #257020 + * Enabled CONFIG_NF_CT_NETLINK/CONFIG_NF_CONNTRACK_EVENTS in -virtual + - LP: #257569 + + [Upstream Kernel Changes] + + * eCryptfs: use page_alloc not kmalloc to get a page of memory + - LP: #242448 + * openvz: sync with stable 2.6.18-rhel5 branch + - LP: #258044 + * USB: quirk PLL power down mode + - LP: #257931 + * acpi: unneccessary to scan the PCI bus already scanned + - LP: #258143 + * eCryptfs: make ecryptfs_prepare_write decrypt the page + - LP: #242448 + * gdth: don't call pci_free_consistent under spinlock + - LP: #199934 + * SCSI: gdth: fix to internal commands execution + - LP: #199934 + * r8169: avoid thrashing PCI conf space above RTL_GIGA_MAC_VER_06 + - LP: #141343 + * (CVE-2008-3276) dccp: change L/R must have at least one byte in the + dccpsf_val field + * suspend-vs-iommu: prevent suspend if we could not resume + - LP: #257293 + * x86, gart: add resume handling + - LP: #257293 + + -- Stefan Bader Wed, 22 Aug 2008 12:07:28 -0400 + +linux (2.6.24-21.40) hardy-proposed; urgency=low + + [Tim Gardner] + + * Bump ABI for WiMax 'enum rfkill_type' additions. + + [Upstream Kernel Changes] + + * b43: Add more btcoexist workarounds + - LP: #257020 + + -- Tim Gardner Mon, 11 Aug 2008 13:13:46 -0600 + +linux (2.6.24-20.39) hardy-proposed; urgency=low + + [Amit Kucheria] + + * rfkill: add the WiMAX radio type + - LP: #253347 + * if_arp: add a WiMax pseudo header + - LP: #253347 + + [Stefan Bader] + + * Backport ability to reset the machine using the RESET_REG of ACPI + - LP: #249296 + * SAUCE: Add the ability to whitelist systems to use ACPI reboot + - LP: #249296 + * SAUCE: Add reboot=a preselection quirk + - LP: #249296 + * Backport make USB-PERSIST work after every system sleep + - LP: #254783 + + [Upstream Kernel Changes] + + * V4L/DVB (7068): Add support for WinTV Nova-T-CE driver + - LP: #238164 + * [NETFILTER]: {ip,ip6,nfnetlink}_queue: fix SKB_LINEAR_ASSERT when + mangling packet data + - LP: #236699 + * sky2: 88E8040T pci device id + - LP: #237211 + * md: close a livelock window in handle_parity_checks5 + - LP: #244377 + * Fix typos from signal_32/64.h merge + - LP: #230315 + + -- Stefan Bader Fri, 08 Aug 2008 11:39:18 -0400 + +linux (2.6.24-20.38) hardy-proposed; urgency=low + + [Tim Gardner] + + * SAUCE: Export usbhid_modify_dquirk for LBM module bcm5974 + - LP: #250838 + * Enable TULIP ethernet support in virtual appliance flavour + - LP: #250857 + * VIA AGP VT3364 is not detected + - LP: #251854 + * VIA - Add VIA DRM Chrome9 3D engine + - LP: #251862 + + [Upstream Kernel Changes] + + * net/usb: add support for Apple USB Ethernet Adapter + - LP: #232200 + * acpi: fix "buggy BIOS check" when CPUs are hot removed + - LP: #248509 + * x86: fix paranoia about using BIOS quickboot mechanism. + - LP: #248905 + * flush kacpi_notify_wq before removing notify handler + - LP: #248509 + * fix a deadlock issue when poking "eject" file + - LP: #248509 + * force offline the processor during hot-removal + - LP: #248509 + * create sysfs link from acpi device to sysdev for cpu + - LP: #248509 + * x86: fix bootup crash in native_read_tsc() (aka use XMM2) + - LP: #249135 + * x86: lfence fix - LFENCE is available on XMM2 or higher + Intel CPUs - not XMM or higher... + - LP: #249135 + + -- Tim Gardner Fri, 25 Jul 2008 22:12:46 -0600 + +linux (2.6.24-20.37) hardy-proposed; urgency=low + + [Colin Ian King] + + * scheduling while atomic: archhttp64/7146/0x1000000001 + - LP: #235889 + * Slim USB Apple Keyboard not working correctly when pressing the + "numlock" key + - LP: #201887 + + [Linus Torvalds] + + * Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP + - LP: #246663 + + [Michael Frey (Senior Manager, MID)] + + * SAUCE: Send HCI_RESET for Broadcomm 2046 + - LP: #241749 + + [Stefan Bader] + + * drivers: fix dma_get_required_mask + - LP: #238118 + * Modify log generation to catch bug numbers when adding with git-am. + * ACPICA: Fix for resource descriptor optimization issues for _CRS/_SRC + - LP: #152187 + * ACPI: Fix acpi_processor_idle and idle= boot parameters interaction + - LP: #241229 + * cpuidle acpi driver: fix oops on AC<->DC + - LP: #241229 + * ACPI: EC: Do the byte access with a fast path + - LP: #191137 + * ACPI: EC: Some hardware requires burst mode to operate properly + - LP: #191137 + + [Tejun Heo] + + * ahci: jmb361 has only one port + - LP: #244363 + + [Tim Gardner] + + * Add native_read_tsc to non __i386__ code. + - LP: #249135 + * Fix x86-64 FTBS after upstream cherry-pick of + 898ad535e2c81e0b02628c1ee5d8400c971500dd + - LP: #249135 + * Use readtsc-barrier in xen + - LP: #249135 (for the previous 7 log entries) + * Enabled CONFIG_NETDEVICES_MULTIQUEUE=y in order to support 802.11n + - LP: #241423 + * SAUCE: e1000 checksum recheck after reset + - LP: #60388 + * Enable CONFIG_CIFS_UPCALL=y to support Kerberos authentication + - LP: #236830 + * Clear host capabilities number of ports after quirking JMB361 + - LP: #244363 + + [Upstream Kernel Changes] + + * x86: tsc prevent time going backwards + - LP: #221351 + * x86: implement support to synchronize RDTSC through MFENCE on AMD CPUs + * x86: Implement support to synchronize RDTSC with LFENCE on Intel CPUs + * x86: move nop declarations into separate include file + * x86: introduce rdtsc_barrier() + * x86: remove get_cycles_sync + * x86: read_tsc sync + * Add barriers to native_read_tsc + - LP: #249135 (for the previous 7 log entries) + * hwmon: (w83781d) Fix I/O resource conflict with PNP + - LP: #242761 + * inotify: fix race + * inotify: remove debug code + - LP: #104837 (previous 2 log entries) + * openvz: sync with stable 2.6.18-rhel5 branch + - LP: #249137 + * UBUNTU SAUCE: Setup PHYs correctly on rtl8101/2(e) hardware + - LP: #240648 + * UBUNTU SAUCE: Update rtl8101/2(e) hardware initialization value + - LP: #240648 + * x86: remove 6 bank limitation in 64 bit MCE reporting code + - LP: #239666 + + -- Tim Gardner Wed, 09 Jul 2008 14:55:14 -0600 + +linux (2.6.24-19.41) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * Fix compiler warning on 64-bit + follow-up for CVE-2008-1673 + * netfilter: nf_nat_snmp_basic: fix a range check in NAT for SNMP + follow-up for CVE-2008-1673 + + -- Stefan.Bader Tue, 19 Aug 2008 15:02:19 -0400 + +linux (2.6.24-19.37) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * (CVE-2008-2812) TTY: fix for tty operations bugs + * (CVE-2008-3272) sound: ensure device number is valid in + snd_seq_oss_synth_make_info + * (CVE-2008-3275) vfs: fix lookup on deleted directory + + -- Ben Collins Tue, 05 Aug 2008 22:28:53 +0000 + +linux (2.6.24-19.36) hardy-security; urgency=low + + * Fixed hppa FTBS by adding ABI files from -19.33. + + -- Tim Gardner Fri, 11 Jul 2008 08:26:29 -0600 + +linux (2.6.24-19.35) hardy-security; urgency=low + + [Upstream Kernel Changes] + + * (CVE-2007-6282) [ESP]: Ensure IV is in linear part of the skb to avoid + BUG() due to OOB access + * (CVE-2008-1673) asn1: additional sanity checking during BER decoding + * (CVE-2008-2136) sit: Add missing kfree_skb() on pskb_may_pull() + failure. + * (CVE-2008-2137) sparc: Fix mmap VA span checking. + * (CVE-2008-2148) vfs: fix permission checking in sys_utimensat + * (CVE-2008-2358) dccp: return -EINVAL on invalid feature length + * (CVE-2008-2750) l2tp: Fix potential memory corruption in + pppol2tp_recvmsg() + * (CVE-2008-1615) x86_64: fix CS corruption on iret + * fuse: fix permission checking + * (CVE-2008-2826) sctp: Make sure N * sizeof(union sctp_addr) does not + overflow. + + -- Tim Gardner Tue, 01 Jul 2008 10:40:28 -0600 + +linux (2.6.24-19.34) hardy-proposed; urgency=low + + [Amit Kucheria] + + * Revert "Update lpia configs to move modules into the kernel" + * LPIA: More conservative culling of LPIA config + + -- Tim Gardner Thu, 05 Jun 2008 09:30:31 -0600 + +linux (2.6.24-19.33) hardy-proposed; urgency=low + + [Alessio Igor Bogani] + + * rt: Updated configuration files + * rt: Disable Dynamic Ticks (CONFIG_NO_HZ) + - LP: #229499 + + [Amit Kucheria] + + * LPIA: USB Client PV release from Intel + * Update lpia configs to move modules into the kernel + + [Colin Ian King] + + * SAUCE: Blacklist IBM 2656 in serio/i8042 + - LP: #21558 + * Fix ipv6 temporary address creation failure + - LP: #210742 + * rndis_host: fix transfer size negotiation + - LP: #192411 + * sata_nv: correct completion handling that fixes system reboots + - LP: #210637 + * drm_sysfs_suspend uses KERN_ERR in printk + - LP: #234239 + + [Mario Limonciello] + + * SAUCE: Work around ACPI corruption upon suspend on some Dell machines. + - LP: #183033 + * SAUCE: Wakeup BT input devices that have been suspended + - LP: #175743 + + [Stefan Bader] + + * cx88: enable radio GPIO correctly + - LP: #209971 + * fix IS_I9XX macro in i915 DRM driver + - LP: #204762 + * x86: fix long standing bug with usb after hibernation with 4GB ram + - LP: #206996 + + [Tim Gardner] + + * rpcb_getport_async in sunrpc can cause oops on Hardy + - LP: #224750 + * kernel: fix x86 DMI checks for PCI quirks + - LP: #225811 + * b43: Workaround invalid bluetooth settings + - LP: #197959 + * ssb: Fix IRQ vectors enable for early cards. + - LP: #197959 + * ssb: Fix TMS low bitmask reject code. + - LP: #197959 + * ssb: Fix all-ones boardflags + - LP: #197959 + * b43legacy: fix hard crash when BCM4303 present. + - LP: #192720 + * b43legacy: Fix bug in firmware loading for 802..11b devices. + - LP: #192720 + * b43legacy: Prevent spamming the logs when LED encoding in SPROM is + faulty. + - LP: #192720 + * block: fix blkdev_issue_flush() not detecting and passing EOPNOTSUPP + back + - LP: #215110 + * V4L/DVB (7132): Add USB ID for a newer variant of Hauppauge WinTV-HVR + 900 + - LP: #195435 + * Add Lenovo Thinkpad X61 DMI Quirk support. + * Enable powerpc-smp64 CONFIG_PASEMI_MAC=m + - LP: #213668 + * OpenVZ kernel: non-POSIX behavior in mmap functions + - LP: #231400 + * SAUCE: fn key doesn't work in hardy with macbook pro fourth generation + (4,1) + - LP: #207127 + * MMC bitmap overflow in 64 bit kernel + - LP: #88992 + * revert: UBUNTU: TSC Clocksource can cause hangs and time jumps + This patch appears to cause suspend to RAM regressions (see LP #226279) + -LP: #221351 + + [Upstream Kernel Changes] + + * openvz: make stat and fstat agree on (st_dev, st_ino) in VE + - LP: #226335 + * V4L/DVB (7066): ASUS My Cinema U3000 Mini DVBT Tuner + - LP: #95277 + * r8169: fix oops in r8169_get_mac_version + - LP: #223656 + * PCI: quirks: set 'En' bit of MSI Mapping for devices onHT-based nvidia + platform + - LP: #181081 + * HID: Implement horizontal wheel handling for A4 Tech X5-005D + - LP: #201964 + * ata-acpi: don't call _GTF for disabled drive + - LP: #202767 + + * openvz: sync 2.6.24-ovz004 => 2.6.24-ovz005 + * openvz: UBC: drop cpuset lock from OOM handling + * openvz: IPv6: get frag's owner VE from inet_frag_queue + * openvz: proc: fix proc_cwd_link + * openvz: VLAN: fix rmmod 8021q with vlan interface setup + * openvz: Remove spurious warnings in kernel/time.c + - LP: #231400, #230432, and #235207 + + -- Tim Gardner Sun, 04 May 2008 20:22:21 -0600 + +linux (2.6.24-18.32) hardy-security; urgency=low + + * CVE-2007-6694: [POWERPC] CHRP: Fix possible NULL pointer dereference + * fix SMP ordering hole in fcntl_setlk() (CVE-2008-1669) + * Fix dnotify/close race (CVE-2008-1375) + * tehuti: check register size (CVE-2008-1675) + * tehuti: move ioctl perm check closer to function start (CVE-2008-1675) + + -- Ben Collins Mon, 19 May 2008 16:50:11 +0000 + +linux (2.6.24-17.31) hardy; urgency=low + + [Alessio Igor Bogani] + + * rt: Fix mutex in the toshiba_acpi driver + * rt: Updated configuration files + + [Ben Collins] + + * build: Fix revert detection in git-ubuntu-log + * SAUCE: Re-add eeprom_bad_csum_allow module-param + - LP: #60388 + + [Stefan Bader] + + * Pulled updates to openvz custom build. Fixes openvz 'refuses to boot' problem. + - LP: #210672 + * sched: retain vruntime, fix delayed key events when CONFIG_FAIR_GROUP_SCHED. + - LP: #218516 + * UBUNTU: SAUCE: Add blacklist support to fix Belkin bluetooth dongle. + - LP: #140511 + + [Tim Gardner] + + * Enable CONFIG_ISCSI_TCP for -virtual + - LP: #218215 + * build: Add fancontrol modules to powerpc64-smp debian installer + * Fix Xen Dom0/DomU bridging + - LP: #218126 + * TSC Clocksource can cause hangs and time jumps + - LP: #221351 + * Kernel should use CONFIG_FAIR_CGROUP_SCHED. Fixes high load issues + with pulseaudio. + - LP: #188226 + + [Upstream Kernel Changes] + + * KVM: MMU: prepopulate guest pages after write-protecting + - LP: #221032 + + -- Tim Gardner Fri, 11 Apr 2008 07:59:10 -0600 + +linux (2.6.24-16.30) hardy; urgency=low + + * Fix amd64/i386 ABI and module check FTBS by creating an ignore + and ignore.modules in the ABI directory. + + -- Tim Gardner Wed, 09 Apr 2008 21:58:25 -0600 + +linux (2.6.24-16.29) hardy; urgency=low + + [Stephan Bader] + + * UBUNTU: SAUCE: mmc: Increase power_up deleay to fix TI readers + + [Alessio Igor Bogani] + + * rt: Updated configuration files + + [Chuck Short] + + * Xen updates for vitrio changes. + + [Tim Gardner] + + * openvz updates for vitrio changes. + + -- Tim Gardner Tue, 08 Apr 2008 21:48:16 -0600 + +linux (2.6.24-16.28) hardy; urgency=low + + [Tim Gardner] + + * Revert "UBUNTU: x86: tsc prevent time going backwards" + + [Kees Cook] + + * AppArmor: implement mmap_min_addr check as done in mainline. + + [Soren Hansen] + + * Bring our virtio code up to date with 2.6.25-rc7 + + [Upstream Kernel Changes] + + * Ubuntu: Revert all our virtio changes + * lguest: Reboot support + * lguest: adapt launcher to per-cpuness + * virtio: Implement skb_partial_csum_set, for setting partial csums on + untrusted packets. + * virtio: simplify config mechanism. + * virtio: explicit enable_cb/disable_cb rather than callback return. + * virtio: configuration change callback + * virtio: Fix vring_init/vring_size to take unsigned long + * virtio: clarify NO_NOTIFY flag usage + * virtio: remove unused id field from struct virtio_blk_outhdr + * virtio: Net header needs hdr_len + * virtio: Tweak virtio_net defines + * virtio: populate network rings in the probe routine, not open + * virtio: reset function + * virtio: handle interrupts after callbacks turned off + * virtio: Use the sg_phys convenience function. + * virtio: Allow virtio to be modular and used by modules + * virtnet: remove double ether_setup + * virtio: flush buffers on open + * virtio: free transmit skbs when notified, not on next xmit. + * virtio_net: parametrize the napi_weight for virtio receive queue. + * virtio_blk: provide getgeo + * virtio_blk: Dont waste major numbers + * virtio_blk: implement naming for vda-vdz,vdaa-vdzz,vdaaa-vdzzz + * virtio: PCI device + * virtio: Use PCI revision field to indicate virtio PCI ABI version + * virtio: balloon driver + * virtio net: fix oops on interface-up + * virtio: add missing #include + * virtio: fix race in enable_cb + * virtio: handle > 2 billion page balloon targets + * virtio_net: Fix oops on early interrupts - introduced by virtio reset + code + * lguest: Do not append space to guests kernel command line + * virtio: Use spin_lock_irqsave/restore for virtio-pci + * virtio: Fix sysfs bits to have proper block symlink + * virtio: Enable netpoll interface for netconsole logging + * virtio_pci: unregister virtio device at device remove + * lguest: Add puppies which where previously missing. + * lguest: lguest.txt documentation fix + * lguest: Don't need comment terminator before disk section. + * virtio_pci iomem annotations + * virtio_net: remove overzealous printk + * virtio: remove overzealous BUG_ON. + + -- Tim Gardner Tue, 08 Apr 2008 11:53:49 -0600 + +linux (2.6.24-15.27) hardy; urgency=low + + [Alan Stern] + + * usb-storage: don't access beyond the end of the sg buffer + - LP: #204922 + + [Mario Limonciello] + + * Enable Reset and SCO workaround on Dell 410 BT adapter + + [Tim Gardner] + + * Enable CONFIG_E1000 in the i386 virtual image. + - LP: #205646 + + [Thomas Gleixner] + + * x86: tsc prevent time going backwards + + [Matthew Garrett] + + * Fix framebuffer fonts on non-x86 platforms + + -- Tim Gardner Fri, 04 Apr 2008 08:14:49 -0600 + +linux (2.6.24-15.26) hardy; urgency=low + + [Colin Ian King] + + * airprime.c supports more devices + - LP: #208250 + + [Kees Cook] + + * AppArmor: get latest batch of upstream fixes into Hardy (svn 1160) + + [Stefan Bader] + + * ACPI: fix boot oops regression in kernel + - LP: #207014 + + [Tim Gardner] + + * Enable CGROUPS for non x86/x86_64 arches, all flavours. + - LP: #188226 + + -- Tim Gardner Thu, 03 Apr 2008 07:00:29 -0600 + +linux (2.6.24-14.25) hardy; urgency=low + + [Mario Limonciello] + + * Resolve sky2 race condition leading to failed suspends + - LP: #210877 + + [Tim Gardner] + + * Copy drivers/media internal header files into header + package for external LUM compilation. This paves the + way for LP #202065. + + -- Tim Gardner Wed, 02 Apr 2008 08:28:32 -0600 + +linux (2.6.24-14.24) hardy; urgency=low + + [Amit Kucheria] + + * LPIA: Update from moblin + * LPIA: Fix reboot problem after S3/S4 + * LPIA: Integrate latest Dabney thermal patches + * LPIA: Change-umd_dbg-debug-level-to-KERN_INFO + * LPIA: Compile modules into kernel to save on boot time + * LPIA: lots of Dabney CONFIG options dissapeared + * LPIA: Purge nonexistent config options + + [Jay Chetty] + + * UBUNTU:USBC:Integrated USBC 2.0.0.32L.0009 + + [Misha Zhilin] + + * USB: ehci: handle large bulk URBs correctly (again) + - LP: #204857 + + [Tim Gardner] + + * frame buffer regression - screen blank except for blinking cursor after + fbcon vtswitch + - LP: #201591 + * Blacklist Bluetooth Dell Wireless 370 for SCO MTU + - LP: #209715 + * Set CONFIG_FAIR_CGROUP_SCHED for server flavours. + - LP: #188226 + * Add DMI IO_DELAY support. + - LP: #200057 + + -- Tim Gardner Mon, 31 Mar 2008 11:19:49 -0600 + +linux (2.6.24-13.23) hardy; urgency=low + + [Alessio Igor Bogani] + + * rt: Updated configuration files + + [Ben Collins] + + * openvz: New custom flavour for OpenVZ + * config: Disable IDE AMD driver in favor of PATA version + - LP: #181561 + * config: Disable IDE VIA driver in favor of PATA version + - LP: #181561 + * drivers/video: Restore gutsy backlight dimming behavior + - LP: #205261 + * build/config: Enable CONFIG_CIFS_WEAK_PW_HASH + - LP: #202445 + + [Colin Ian King] + + * SAUCE: Add support for version 4 of Chelsio NICs in cxgb3 driver + - LP: #201893 + + [Kees Cook] + + * AppArmor: re-add missing "type" field in syslog reports. + - LP: #202888 + * kvm: reset TSS on x86_64 to avoid ioperm bitmap corruption + - LP: #144900 + + [Stefan Bader] + + * USB: EHCI: add separate IAA watchdog timer + - LP: #198619 + * SAUCE: Always use SCO protocol (disable eSCO support) + - LP: #39414 + * PM: Introduce PM_EVENT_HIBERNATE callback state + - LP: #201086 + + [Tim Gardner] + + * Disable DRM suspend/resume on pre-915 Intel chips + - LP: #207496 + * frame buffer regression - screen blank except for blinking cursor after fbcon + vtswitch + - LP: #201591 + + -- Tim Gardner Wed, 19 Mar 2008 10:05:05 -0400 + +linux (2.6.24-12.22) hardy; urgency=low + + [Ben Collins] + + * custom/rt: Disable toshiba_acpi, since it isn't compatible + + -- Ben Collins Wed, 12 Mar 2008 14:38:59 -0400 + +linux (2.6.24-12.21) hardy; urgency=low + + [Ben Collins] + + * build: Fix vesafb module inclusion into initrd subdir + - LP: #129910 + * net/bluetooth: POWERBOOK => APPLE, fix for apple keyboard patch + * custom/xen: Remove asix portion of xen patch, breaks driver + - LP: #199296 + + [Colin Ian King] + + * SAUCE: fix Udma not fully available in Acer 1694 Wlmi + - LP: #187121 + * SAUCE: Update toshiba_acpi.c to version 0.19a + - LP: #77026 + + [Stefan Bader] + + * x86: Clear DF before calling signal handler + * Enable FN key on Apple aluminum bluetooth keyboard + - LP: #162083 + + -- Ben Collins Tue, 11 Mar 2008 13:20:49 -0400 + +linux (2.6.24-12.20) hardy; urgency=low + + [Ben Collins] + + * Enable CONFIG_SOUND at least, so alsa build in lum works + - LP: #200338 + + -- Ben Collins Mon, 10 Mar 2008 08:15:00 -0400 + +linux (2.6.24-12.19) hardy; urgency=low + + * Re-upload of -12.18 to fix build failures + * Fixup binary-custom configs + * Fixup xen patch to cope with kvm changes + + [Amit Kucheria] + + * Move Marvell 8686 and 8688 to LUM + * Poulsbo: Sync patches with moblin/ume-hardy tree + * Break if a patch fails to apply + * SAUCE: implement smarter atime updates support + - LP: #199427 + * Enable USB_PERSIST to allow devices with /root on usb to work with + suspend + * Enable USB_PERSIST across the board + + [Ben Collins] + + * build/config: Really fix ide on smp ppc configs + * build/configs: Enable relatime config option for all flavors + * build/abi: Ignore ide-core module for ppc, moved to built-in + + [Colin Ian King] + + * fix reversed logic for bbuild check leads to -j1 default + - LP: #197040 + * Enable IDE_PMAC for powerpc-smp + - LP: #196686 + * Disable CONFIG_USB_OHCI_HCD_SSB + - LP: #182716 + * SAUCE: fix arcmsr + archttp64 calls dma_free_coherent() with irqs + disabled - dmesg filled with warnings + - LP: #194207 + + [Jorge Boncompte [DTI2]] + + * Fix Messed multicast lists after dev_mc_sync/unsync + - LP: #193468 + + [Stefan Bader] + + * Add support for Apple Aluminium keyboards. + - LP: #162083 + * SAUCE: Restore VT fonts on switch + + [Upstream Kernel Changes] + + * [NET]: Messed multicast lists after dev_mc_sync/unsync + * KVM: x86 emulator: add support for group decoding + * KVM: x86 emulator: group decoding for group 1A + * KVM: x86 emulator: Group decoding for group 3 + * KVM: x86 emulator: Group decoding for groups 4 and 5 + * KVM: x86 emulator: add group 7 decoding + * KVM: constify function pointer tables + * KVM: Only x86 has pio + * KVM: x86 emulator: group decoding for group 1 instructions + * KVM: MMU: Decouple mmio from shadow page tables + * KVM: Limit vcpu mmap size to one page on non-x86 + * KVM: VMX: Enable Virtual Processor Identification (VPID) + * KVM: Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier + * KVM: Disable pagefaults during copy_from_user_inatomic() + * KVM: make EFER_RESERVED_BITS configurable for architecture code + * KVM: align valid EFER bits with the features of the host system + * KVM: allow access to EFER in 32bit KVM + * kvm: i386 fix + * KVM: export information about NPT to generic x86 code + * KVM: MMU: make the __nonpaging_map function generic + * KVM: export the load_pdptrs() function to modules + * KVM: MMU: add TDP support to the KVM MMU + * KVM: x86 emulator: Fix 'jmp abs' + * KVM: x86 emulator: fix group 5 decoding + * KVM: Fix kvm_arch_vcpu_ioctl_set_sregs so that set_cr0 works properly + * KVM: Make the supported cpuid list a host property rather than a vm + property + * KVM: emulate access to MSR_IA32_MCG_CTL + * KVM: remove the usage of the mmap_sem for the protection of the memory + slots. + * KVM: SVM: allocate the MSR permission map per VCPU + * KVM: make MMU_DEBUG compile again + * KVM: paravirtualized clocksource: host part + * KVM: Add missing semicolon + * KVM: x86 emulator: add ad_mask static inline + * KVM: x86 emulator: make register_address, address_mask static inlines + * KVM: x86 emulator: make register_address_increment and JMP_REL static + inlines + * KVM: Add API to retrieve the number of supported vcpus per vm + * KVM: Increase vcpu count to 16 + * KVM: Add API for determining the number of supported memory slots + * KVM: Increase the number of user memory slots per vm + * KVM: Add stat counter for hypercalls + * KVM: x86 emulator: fix sparse warnings in x86_emulate.c + * KVM: sparse fixes for kvm/x86.c + * KVM: Implement dummy values for MSR_PERF_STATUS + * KVM: MMU: ignore zapped root pagetables + * KVM: call write_guest_time as soon as we register the paravirt clock + * KVM: MMU: large page support + * KVM: Prefix control register accessors with kvm_ to avoid namespace + pollution + * KVM: Avoid infinite-frequency local apic timer + * KVM: Route irq 0 to vcpu 0 exclusively + * KVM: SVM: add support for Nested Paging + * KVM: SVM: enable LBR virtualization + * KVM: SVM: make iopm_base static + * KVM: SVM: let init_vmcb() take struct vcpu_svm as parameter + * KVM: VMX: fix typo in VMX header define + * KVM: SVM: fix Windows XP 64 bit installation crash + * KVM: VMX: Fix invalid opcode of VPID + * KVM: VMX: Handle machines without EFER + * KVM: move alloc_apic_access_page() outside of non-preemptable region + * KVM: VMX: unifdef the EFER specific code + * KVM: SVM: move feature detection to hardware setup code + * KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM + * dlm: fix rcom_names message to self + * virtio: Net header needs hdr_len + + -- Tim Gardner Mon, 03 Mar 2008 07:07:16 -0700 + +linux (2.6.24-11.17) hardy; urgency=low + + [Alan Cox] + + * Pull in fixes for pata_it821x. + - LP: #106931 + + [Alessio Igor Bogani] + + * rt: Synchronized with upstream (2.6.24.3-rt3) + * rt: Updated configuration files + + [Amit Kucheria] + + * Add AGP support for Radeon Mobility 9000 chipset + - LP: #178634 + * Bluetooth: SCO flow control to enable bluetooth headsets + + [Ben Collins] + + * binary: Include vesafs in initrd subdir, should fix vga= usage + + [Colin Ian King] + + * AMD SB700 south bridge support patches + - LP: #195354 + * BCM4311 Revision 2 fix + - LP: #184600 + + [Mauro Carvalho Chehab] + + * V4L/DVB (6753): Fix vivi to support non-zero minor node + + [Tim Gardner] + + * Merged 2.6.24.3 + * Add atl1 to d-i bits. + - LP: #159561 + * SAUCE: Add xpad support for RedOctane Guitar Hero + - LP: #196745 + + [Upstream Kernel Changes] + + * DVB: cx23885: add missing subsystem ID for Hauppauge HVR1800 Retail + * slab: fix bootstrap on memoryless node + * vm audit: add VM_DONTEXPAND to mmap for drivers that need it + (CVE-2008-0007) + * USB: keyspan: Fix oops + * usb gadget: fix fsl_usb2_udc potential OOPS + * USB: CP2101 New Device IDs + * USB: add support for 4348:5523 WinChipHead USB->RS 232 adapter + * USB: Sierra - Add support for Aircard 881U + * USB: Adding YC Cable USB Serial device to pl2303 + * USB: sierra driver - add devices + * USB: ftdi_sio - enabling multiple ELV devices, adding EM1010PC + * USB: ftdi-sio: Patch to add vendor/device id for ATK_16IC CCD + * USB: sierra: add support for Onda H600/Zte MF330 datacard to USB Driver + for Sierra Wireless + * USB: remove duplicate entry in Option driver and Pl2303 driver for + Huawei modem + * USB: pl2303: add support for RATOC REX-USB60F + * USB: ftdi driver - add support for optical probe device + * USB: use GFP_NOIO in reset path + * USB: Variant of the Dell Wireless 5520 driver + * USB: storage: Add unusual_dev for HP r707 + * USB: fix usbtest halt check on big endian systems + * USB: handle idVendor of 0x0000 + * USB: Fix usb_serial_driver structure for Kobil cardreader driver. + * forcedeth: mac address mcp77/79 + * lockdep: annotate epoll + * sys_remap_file_pages: fix ->vm_file accounting + * PCI: Fix fakephp deadlock + * ACPI: update ACPI blacklist + * x86: restore correct module name for apm + * sky2: restore multicast addresses after recovery + * sky2: fix for WOL on some devices + * b43: Fix suspend/resume + * b43: Drop packets we are not able to encrypt + * b43: Fix dma-slot resource leakage + * b43legacy: fix PIO crash + * b43legacy: fix suspend/resume + * b43legacy: drop packets we are not able to encrypt + * b43legacy: fix DMA slot resource leakage + * selinux: fix labeling of /proc/net inodes + * b43: Reject new firmware early + * sched: let +nice tasks have smaller impact + * sched: fix high wake up latencies with FAIR_USER_SCHED + * fix writev regression: pan hanging unkillable and un-straceable + * Driver core: Revert "Fix Firmware class name collision" + * drm: the drm really should call pci_set_master.. + * splice: missing user pointer access verification (CVE-2008-0009/10) + * Linux 2.6.24.1 + * splice: fix user pointer access in get_iovec_page_array() + * Linux 2.6.24.2 + * ACPI: video: Rationalise ACPI backlight implementation + * ACPI: video: Ignore ACPI video devices that aren't present in hardware + * SPARC/SPARC64: Fix usage of .section .sched.text in assembler code. + * NETFILTER: nf_conntrack_tcp: conntrack reopening fix + * NFS: Fix a potential file corruption issue when writing + * inotify: fix check for one-shot watches before destroying them + * hugetlb: add locking for overcommit sysctl + * XFS: Fix oops in xfs_file_readdir() + * Fix dl2k constants + * SCSI: sd: handle bad lba in sense information + * TCP: Fix a bug in strategy_allowed_congestion_control + * TC: oops in em_meta + * SELinux: Fix double free in selinux_netlbl_sock_setsid() + * PKT_SCHED: ematch: oops from uninitialized variable (resend) + * NET: Add if_addrlabel.h to sanitized headers. + * IPV4: fib_trie: apply fixes from fib_hash + * IPV4: fib: fix route replacement, fib_info is shared + * IPCOMP: Fix reception of incompressible packets + * IPCOMP: Fetch nexthdr before ipch is destroyed + * INET_DIAG: Fix inet_diag_lock_handler error path. + * INET: Prevent out-of-sync truesize on ip_fragment slow path + * BLUETOOTH: Add conn add/del workqueues to avoid connection fail. + * AUDIT: Increase skb->truesize in audit_expand + * Be more robust about bad arguments in get_user_pages() + * Disable G5 NAP mode during SMU commands on U3 + * hrtimer: fix *rmtp handling in hrtimer_nanosleep() + * hrtimer: fix *rmtp/restarts handling in compat_sys_nanosleep() + * SLUB: Deal with annoying gcc warning on kfree() + * hrtimer: check relative timeouts for overflow + * hrtimer: catch expired CLOCK_REALTIME timers early + * genirq: do not leave interupts enabled on free_irq + * S390: Fix futex_atomic_cmpxchg_std inline assembly. + * USB: fix pm counter leak in usblp + * SCSI: gdth: scan for scsi devices + * PCMCIA: Fix station address detection in smc + * POWERPC: Revert chrp_pci_fixup_vt8231_ata devinit to fix libata on + pegasos + * bonding: fix NULL pointer deref in startup processing + * x86_64: CPA, fix cache attribute inconsistency bug + * Linux 2.6.24.3 + + -- Tim Gardner Mon, 25 Feb 2008 12:28:13 -0700 + +linux (2.6.24-10.16) hardy; urgency=low + + [Alessio Igor Bogani] + + * rt: Synchronized with upstream (2.6.24.2-rt2) + * rt: Updated configuration files + + [Eric Piel] + + * SAUCE: ACPI: Allow custom DSDT tables to be loaded from initramfs + Amit Kucheria consolidated the DSDT patch with another fix that + ifdefs symbols required when BLK_DEV_INITR is disabled. + + [Stefan Bader] + + * Add Optiarc DVD drive to audio quirks list. + - LP: #186664 + * Update drm and i915 drm driver to fix suspend issues. + - LP: #189260 + + [Tim Gardner] + + * Fix FTBS without BLK_DEV_INITRD + - LP: #193507 + * 64 bit CPA cache attribute bug + - LP: #193736 + * Implemented default EDD control + + [Upstream Kernel Changes] + + * bonding: fix NULL pointer deref in startup processing + * dlm: bind connections from known local address when using TCP + * dlm: proper prototypes + * dlm: don't print common non-errors + * dlm: use dlm prefix on alloc and free functions + * dlm: close othercons + * dlm: align midcomms message buffer + * dlm: swap bytes for rcom lock reply + * dlm: use fixed errno values in messages + * dlm: clear ast_type when removing from astqueue + * dlm: recover locks waiting for overlap replies + * dlm: another call to confirm_master in receive_request_reply + * dlm: reject messages from non-members + * dlm: validate messages before processing + * dlm: reject normal unlock when lock is waiting for lookup + * dlm: limit dir lookup loop + * dlm: fix possible use-after-free + * dlm: change error message to debug + * dlm: keep cached master rsbs during recovery + * dlm: Sanity check namelen before copying it + * dlm: clean ups + * dlm: static initialization improvements + * dlm: use proper C for dlm/requestqueue stuff (and fix alignment bug) + * dlm: dlm_process_incoming_buffer() fixes + * dlm: do not byteswap rcom_lock + * dlm: do not byteswap rcom_config + * dlm: use proper type for ->ls_recover_buf + * dlm: missing length check in check_config() + * dlm: validate data in dlm_recover_directory() + * dlm: verify that places expecting rcom_lock have packet long enough + * dlm: receive_rcom_lock_args() overflow check + * dlm: make find_rsb() fail gracefully when namelen is too large + * dlm: fix overflows when copying from ->m_extra to lvb + * dlm: fix dlm_dir_lookup() handling of too long names + * dlm: dlm/user.c input validation fixes + * dlm: proper types for asts and basts + * dlm: eliminate astparam type casting + * dlm: add __init and __exit marks to init and exit functions + * virtio: Use PCI revision field to indicate virtio PCI ABI version + + -- Tim Gardner Tue, 19 Feb 2008 09:57:18 -0700 + +linux (2.6.24-9.15) hardy; urgency=low + + [Alessio Igor Bogani] + + * rt: Fix FTBS + * rt: Updated configuration files + + [Tim Gardner] + + * SAUCE: make /dev/kmem a config option + * SAUCE: x86: introduce /dev/mem restrictions with a config option + * Fixed CGROUP FTBS caused by AppArmor patch. + * Enabled CGROUP and CPUSETS for server flavor. + - LP: #182434 + + [Colin King] + + * Turn on /proc/acpi/alarm for x86_64 (amd64) + - LP: #186297 + + [Upstream Kernel Changes] + + * Ubuntu: LatencyTOP infrastructure patch + + -- Tim Gardner Thu, 14 Feb 2008 13:34:55 -0700 + +linux (2.6.24-8.14) hardy; urgency=low + + [cking] + + * Support Novatel U727 EVDO modem: Add pid and vid to + drivers/usb/serial/airprime.c + - LP: #150996 + * Enable speedstep for sonoma processors. + - LP: #132271 + + [Stefan Bader] + + * SAUCE: Export dm_disk function of device-mapper + + -- Tim Gardner Wed, 13 Feb 2008 21:47:18 -0700 + +linux (2.6.24-8.13) hardy; urgency=low + + [Soren Hansen] + + * Add missing iscsi modules to kernel udebs + + [Stefan Bader] + + * Lower message level for PCI memory and I/O allocation. + + [Tim Gardner] + + * Enabled IP_ADVANCED_ROUTER and IP_MULTIPLE_TABLES in sparc, hppa + - LP: #189560 + * Compile RealTek 8139 using PIO method. + - LP: #90271 + * Add WD WD800ADFS NCQ horkage quirk support. + - LP: #147858 + + [Upstream Kernel Changes] + + * Introduce WEXT scan capabilities + * DVB: cx23885: add missing subsystem ID for Hauppauge HVR1800 Retail + * slab: fix bootstrap on memoryless node + * vm audit: add VM_DONTEXPAND to mmap for drivers that need it + (CVE-2008-0007) + * USB: keyspan: Fix oops + * usb gadget: fix fsl_usb2_udc potential OOPS + * USB: CP2101 New Device IDs + * USB: add support for 4348:5523 WinChipHead USB->RS 232 adapter + * USB: Sierra - Add support for Aircard 881U + * USB: Adding YC Cable USB Serial device to pl2303 + * USB: sierra driver - add devices + * USB: ftdi_sio - enabling multiple ELV devices, adding EM1010PC + * USB: ftdi-sio: Patch to add vendor/device id for ATK_16IC CCD + * USB: sierra: add support for Onda H600/Zte MF330 datacard to USB Driver + for Sierra Wireless + * USB: remove duplicate entry in Option driver and Pl2303 driver for + Huawei modem + * USB: pl2303: add support for RATOC REX-USB60F + * USB: ftdi driver - add support for optical probe device + * USB: use GFP_NOIO in reset path + * USB: Variant of the Dell Wireless 5520 driver + * USB: storage: Add unusual_dev for HP r707 + * USB: fix usbtest halt check on big endian systems + * USB: handle idVendor of 0x0000 + * forcedeth: mac address mcp77/79 + * lockdep: annotate epoll + * sys_remap_file_pages: fix ->vm_file accounting + * PCI: Fix fakephp deadlock + * ACPI: update ACPI blacklist + * x86: restore correct module name for apm + * sky2: restore multicast addresses after recovery + * sky2: fix for WOL on some devices + * b43: Fix suspend/resume + * b43: Drop packets we are not able to encrypt + * b43: Fix dma-slot resource leakage + * b43legacy: fix PIO crash + * b43legacy: fix suspend/resume + * b43legacy: drop packets we are not able to encrypt + * b43legacy: fix DMA slot resource leakage + * selinux: fix labeling of /proc/net inodes + * b43: Reject new firmware early + * sched: let +nice tasks have smaller impact + * sched: fix high wake up latencies with FAIR_USER_SCHED + * fix writev regression: pan hanging unkillable and un-straceable + * Driver core: Revert "Fix Firmware class name collision" + * drm: the drm really should call pci_set_master.. + * splice: missing user pointer access verification (CVE-2008-0009/10) + * Linux 2.6.24.1 + * splice: fix user pointer access in get_iovec_page_array() + * Linux 2.6.24.2 + + -- Tim Gardner Thu, 07 Feb 2008 06:50:13 -0700 + +linux (2.6.24-7.12) hardy; urgency=low + + [Jay Chetty] + + * Added patch to fix legacy USB interrupt issue + * Enabled Poulsbo PATA udma5 support + * Add touchscreen doubleclick workaround + + [Amit Kucheria] + + * Add AGP support for Radeon Mobility 9000 chipset + - LP: #178634 + + [Soren Hansen] + + * Add virtio modules to the relevant udebs + * Add missing "?" for virtio modules in storage-core-modules + + [Stefan Bader] + + * Added vendor id for Dell 5720 broadband modem + + -- Jay Chetty Wed, 06 Feb 2008 14:13:41 -0800 + +linux (2.6.24-7.11) hardy; urgency=low + + [Jay Chetty] + + * poulsbo: Add a 100ms delay for SiB workaround + + [Tim Gardner] + + * -6.10 should have been an ABI bump, but due to incomplete build testing + went undetected. + + -- Tim Gardner Mon, 04 Feb 2008 19:13:52 -0700 + +linux (2.6.24-6.10) hardy; urgency=low + + [Alessio Igor Bogani] + + * rt: Synced with upstream, removed old kvm related patches and updated + configurations files. + + [Chuck Short] + + * SAUCE: Enable Xen + + [Soren Hansen] + + * Update kvm driver to kvm-60. + * Added CONFIG_ARCH_SUPPORTS_KVM=y for lpia, i386, and amd64 + * Add rtl8139 driver to -virtual flavour + + [Stefan Bader] + + * Fix usb_serial_driver structure for Kobil cardreader driver. + - LP: #183109 + * Lower warning level of pci resource allocation messages. + - LP: #159241 + + [Tim Gardner] + + * Enabled CONFIG_BLK_DEV_IDE_PMAC + - LP: #185862 + * Add virtio config options to lpiacompat. + * SAUCE: Export symbols for aufs (in lum). + * Enabled Xen + + [Upstream Kernel Changes] + + * KVM: mmu: add missing dirty page tracking cases + * KVM: Move virtualization deactivation from CPU_DEAD state to + CPU_DOWN_PREPARE + * KVM: Cosmetics + * KVM: vmx: hack set_cr0_no_modeswitch() to actually do modeswitch + * KVM: Use ARRAY_SIZE macro instead of manual calculation. + * KVM: Use page_private()/set_page_private() apis + * KVM: add MSR based hypercall API + * KVM: Add host hypercall support for vmx + * KVM: Add hypercall host support for svm + * KVM: Wire up hypercall handlers to a central arch-independent location + * KVM: svm: init cr0 with the wp bit set + * KVM: SVM: intercept SMI to handle it at host level + * KVM: More 0 -> NULL conversions + * kvm, dirty pages log: adding some calls to mark_page_dirty() + * KVM: Add internal filesystem for generating inodes + * KVM: Create an inode per virtual machine + * KVM: Rename some kvm_dev_ioctl_*() functions to kvm_vm_ioctl_*() + * KVM: Move kvm_vm_ioctl_create_vcpu() around + * KVM: Per-vcpu inodes + * KVM: Bump API version + * .gitignore: ignore emacs backup files (*~) + * kvm: dirty pages log: fix bitmap size/access calculation + * kvm: move do_remove_write_access() up + * kvm: dirty page logging: remove write access permissions when + dirty-page-logging is enabled + * KVM: Add missing calls to mark_page_dirty() + * KVM: Fix dirty page log bitmap size/access calculation + * kvm: move do_remove_write_access() up + * KVM: Remove write access permissions when dirty-page-logging is enabled + * KVM: Fix bogus failure in kvm.ko module initialization + * KVM: Move kvmfs magic number to + * KVM: Unset kvm_arch_ops if arch module loading failed + * KVM: Fix guest register corruption on paravirt hypercall + * KVM: Use the generic skip_emulated_instruction() in hypercall code + * KVM: Use own minor number + * KVM: Fix guest sysenter on vmx + * KVM: Export + * KVM: Fix bogus sign extension in mmu mapping audit + * KVM: MMU: Fix guest writes to nonpae pde + * KVM: MMU: Fix host memory corruption on i386 with >= 4GB ram + * KVM: trivial whitespace fixes + * KVM: always reload segment selectors + * KVM: Remove extraneous guest entry on mmio read + * added KVM_GET_MEM_MAP ioctl to get the memory bitmap for a memory slot + * KVM: Prevent system selectors leaking into guest on real->protected + mode transition on vmx + * KVM: Use a shared page for kernel/user communication when runing a vcpu + * KVM: Do not communicate to userspace through cpu registers during PIO + * KVM: Initialize PIO I/O count + * KVM: Handle cpuid in the kernel instead of punting to userspace + * KVM: Remove the 'emulated' field from the userspace interface + * KVM: Remove minor wart from KVM_CREATE_VCPU ioctl + * KVM: Renumber ioctls + * KVM: Add method to check for backwards-compatible API extensions + * KVM: Allow userspace to process hypercalls which have no kernel handler + * KVM: Fold kvm_run::exit_type into kvm_run::exit_reason + * KVM: Add a special exit reason when exiting due to an interrupt + * KVM: Initialize the apic_base msr on svm too + * KVM: Add guest mode signal mask + * KVM: Allow kernel to select size of mmap() buffer + * KVM: Future-proof argument-less ioctls + * KVM: Avoid guest virtual addresses in string pio userspace interface + * KVM: MMU: Remove unnecessary check for pdptr access + * KVM: MMU: Remove global pte tracking + * KVM: Workaround vmx inability to virtualize the reset state + * KVM: Remove set_cr0_no_modeswitch() arch op + * KVM: Modify guest segments after potentially switching modes + * KVM: Hack real-mode segments on vmx from KVM_SET_SREGS + * KVM: Don't allow the guest to turn off the cpu cache + * KVM: Remove unused and write-only variables + * KVM: Handle writes to MCG_STATUS msr + * KVM: MMU: Fix hugepage pdes mapping same physical address with + different access + * KVM: SVM: Ensure timestamp counter monotonicity + * KVM: Remove unused function + * KVM: Remove debug message + * KVM: x86 emulator: fix bit string operations operand size + * KVM: SVM: enable LBRV virtualization if available + * Add mmu cache clear function + * KVM: Simply gfn_to_page() + * KVM: Add physical memory aliasing feature + * KVM: Add fpu get/set operations + * KVM: Use kernel-standard types + * KVM: Fix overflow bug in overflow detection code + * KVM: Fix memory leak on pio completion + * KVM: Handle partial pae pdptr + * KVM: Fix string pio when count == 0 + * KVM: Use slab caches to allocate mmu data structures + * KVM: Retry sleeping allocation if atomic allocation fails + * KVM: Fix pio completion + * KVM: SVM: Report hardware exit reason to userspace instead of dmesg + * KVM: Handle guest page faults when emulating mmio + * KVM: VMX: Reduce unnecessary saving of host msrs + * KVM: Fix off-by-one when writing to a nonpae guest pde + * KVM: VMX: Don't switch 64-bit msrs for 32-bit guests + * KVM: Fold drivers/kvm/kvm_vmx.h into drivers/kvm/vmx.c + * KVM: VMX: Only save/restore MSR_K6_STAR if necessary + * KVM: Per-vcpu statistics + * KVM: Silence compile warning on i386 + * KVM: Allow passing 64-bit values to the emulated read/write API + * KVM: Lazy FPU support for SVM + * KVM: Fix msr-avoidance regression on Core processors + * KVM: Don't complain about cpu erratum AA15 + * KVM: Document MSR_K6_STAR's special place in the msr index array + * KVM: MMU: Avoid heavy ASSERT at non debug mode. + * KVM: Initialize cr0 to indicate an fpu is present + * KVM: We want asserts on debug builds, not release + * KVM: Avoid unused function warning due to assertion removal + * KVM: VMX: Avoid unnecessary vcpu_load()/vcpu_put() cycles + * KVM: Move need_resched() check to common code + * KVM: VMX: Properly shadow the CR0 register in the vcpu struct + * KVM: VMX: Add lazy FPU support for VT + * KVM: fix an if() condition + * KVM: SVM: Only save/restore MSRs when needed + * KVM: Remove trailing whitespace + * KVM: Remove extraneous guest entry on mmio read + * KVM: Don't require explicit indication of completion of mmio or pio + * KVM: Remove unused 'instruction_length' + * KVM: VMX: Enable io bitmaps to avoid IO port 0x80 VMEXITs + * KVM: SVM: Allow direct guest access to PC debug port + * KVM: Fix RMW mmio handling + * KVM: Assume that writes smaller than 4 bytes are to non-pagetable pages + * KVM: Avoid saving and restoring some host CPU state on lightweight + vmexit + * KVM: Unindent some code + * KVM: Reduce misfirings of the fork detector + * KVM: Be more careful restoring fs on lightweight vmexit + * KVM: Unify kvm_mmu_pre_write() and kvm_mmu_post_write() + * KVM: MMU: Respect nonpae pagetable quadrant when zapping ptes + * KVM: Update shadow pte on write to guest pte + * KVM: Increase mmu shadow cache to 1024 pages + * KVM: Fix potential guest state leak into host + * KVM: Prevent guest fpu state from leaking into the host + * KVM: Move some more msr mangling into vmx_save_host_state() + * KVM: Rationalize exception bitmap usage + * KVM: Consolidate guest fpu activation and deactivation + * KVM: Ensure host cr0.ts is saved + * KVM: Set cr0.mp for guests + * KVM: Implement IA32_EBL_CR_POWERON msr + * KVM: MMU: Simplify kvm_mmu_free_page() a tiny bit + * KVM: MMU: Store shadow page tables as kernel virtual addresses, not + physical + * KVM: VMX: Only reload guest msrs if they are already loaded + * KVM: Avoid corrupting tr in real mode + * KVM: Fix vmx I/O bitmap initialization on highmem systems + * KVM: Remove merge artifact + * KVM: VMX: Use local labels in inline assembly + * KVM: VMX: Handle #SS faults from real mode + * KVM: VMX: Avoid saving and restoring msrs on lightweight vmexit + * KVM: VMX: Compile-fix for 32-bit hosts + * KVM: VMX: Cleanup redundant code in MSR set + * KVM: VMX: Fix a typo which mixes X86_64 and CONFIG_X86_64 + * KVM: VMX: Avoid saving and restoring msr_efer on lightweight vmexit + * KVM: VMX: Remove warnings on i386 + * Use menuconfig objects II - KVM/Virt + * KVM: x86 emulator: implement wbinvd + * KVM: Fix includes + * KVM: Use symbolic constants instead of magic numbers + * KVM: MMU: Use slab caches for shadow pages and their headers + * KVM: MMU: Simplify fetch() a little bit + * KVM: MMU: Move set_pte_common() to pte width dependent code + * KVM: MMU: Pass the guest pde to set_pte_common + * KVM: MMU: Fold fix_read_pf() into set_pte_common() + * KVM: MMU: Fold fix_write_pf() into set_pte_common() + * KVM: Move shadow pte modifications from set_pte/set_pde to + set_pde_common() + * KVM: Make shadow pte updates atomic + * KVM: MMU: Make setting shadow ptes atomic on i386 + * KVM: MMU: Remove cr0.wp tricks + * KVM: MMU: Simpify accessed/dirty/present/nx bit handling + * KVM: MMU: Don't cache guest access bits in the shadow page table + * KVM: MMU: Remove unused large page marker + * KVM: VMX: Fix asm constraint + * KVM: Lazy guest cr3 switching + * KVM: Replace C code with call to ARRAY_SIZE() macro. + * KVM: Remove unnecessary initialization and checks in mark_page_dirty() + * KVM: Fix vcpu freeing for guest smp + * KVM: Fix adding an smp virtual machine to the vm list + * KVM: Enable guest smp + * KVM: Move duplicate halt handling code into kvm_main.c + * KVM: Emulate hlt on real mode for Intel + * KVM: Keep an upper bound of initialized vcpus + * KVM: Flush remote tlbs when reducing shadow pte permissions + * KVM: SVM: Replace memset(, 0, PAGESIZE) with clear_page() + * KVM: VMX: Replace memset(, 0, PAGESIZE) with clear_page() + * KVM: Require a cpu which can set 64-bit values atomically + * KVM: Initialize the BSP bit in the APIC_BASE msr correctly + * KVM: VMX: Ensure vcpu time stamp counter is monotonous + * KVM: Bring local tree in line with origin + * KVM: Implement emulation of "pop reg" instruction (opcode 0x58-0x5f) + * KVM: Implement emulation of instruction "ret" (opcode 0xc3) + * KVM: Adds support for in-kernel mmio handlers + * KVM: VMX: Fix interrupt checking on lightweight exit + * KVM: Add support for in-kernel pio handlers + * KVM: Fix x86 emulator writeback + * KVM: Avoid useless memory write when possible + * KVM: VMX: Reinitialize the real-mode tss when entering real mode + * KVM: MMU: Fix Wrong tlb flush order + * KVM: VMX: Remove unnecessary code in vmx_tlb_flush() + * KVM: SVM: Reliably detect if SVM was disabled by BIOS + * KVM: Remove kvmfs in favor of the anonymous inodes source + * KVM: Clean up #includes + * KVM: Fix svm availability check miscompile on i386 + * HOTPLUG: Add CPU_DYING notifier + * HOTPLUG: Adapt cpuset hotplug callback to CPU_DYING + * HOTPLUG: Adapt thermal throttle to CPU_DYING + * SMP: Implement on_cpu() + * KVM: Keep track of which cpus have virtualization enabled + * KVM: Tune hotplug/suspend IPIs + * KVM: Use CPU_DYING for disabling virtualization + * KVM: MMU: Store nx bit for large page shadows + * KVM: Fix *nopage() in kvm_main.c + * KVM: SMP: Add vcpu_id field in struct vcpu + * KVM - add hypercall nr to kvm_run + * KVM:: Future-proof the exit information union ABI + * KVM: In-kernel string pio write support + * KVM: Fix memory slot management functions for guest smp + * KVM: x86 emulator: implement rdmsr and wrmsr + * KVM: Trivial: /dev/kvm interface is no longer experimental. + * KVM: Trivial: Remove unused struct cpu_user_regs declaration + * KVM: Trivial: Make decode_register() static + * KVM: Trivial: Comment spelling may escape grep + * KVM: Trivial: Avoid hardware_disable predeclaration + * KVM: Trivial: Use standard CR0 flags macros from asm/cpu-features.h + * Use standard CR3 flags, tighten checking + * Use standard CR4 flags, tighten checking + * KVM: Trivial: Use standard BITMAP macros, open-code userspace-exposed + header + * KVM: Set exit_reason to KVM_EXIT_MMIO where run->mmio is initialized. + * KVM: Use standard CR8 flags, and fix TPR definition + * KVM: MMU: Fix oopses with SLUB + * KVM: x86 emulator: fix cmov for writeback changes + * KVM: MMU: Fix cleaning up the shadow page allocation cache + * KVM: Require CONFIG_ANON_INODES + * KVM: x86 emulator: fix faulty check for two-byte opcode + * KVM: Correctly handle writes crossing a page boundary + * KVM: Fix unlikely kvm_create vs decache_vcpus_on_cpu race + * KVM: Hoist kvm_mmu_reload() out of the critical section + * KVM: Fix removal of nx capability from guest cpuid + * KVM: Move gfn_to_page out of kmap/unmap pairs + * KVM: disable writeback for 0x0f 0x01 instructions. + * KVM: VMX: Import some constants of vmcs from IA32 SDM + * KVM: Remove dead code in the cmpxchg instruction emulation + * KVM: load_pdptrs() cleanups + * KVM: Remove arch specific components from the general code + * KVM: Dynamically allocate vcpus + * KVM: VMX: Improve the method of writing vmcs control + * KVM: Use the scheduler preemption notifiers to make kvm preemptible + * KVM: Convert vm lock to a mutex + * KVM: fx_init() needs preemption disabled while it plays with the FPU + state + * KVM: VMX: pass vcpu_vmx internally + * KVM: Remove three magic numbers + * KVM: SVM: de-containization + * KVM: SVM: internal function name cleanup + * KVM: x86 emulator: disable writeback for debug register instructions + * KVM: Change the emulator_{read,write,cmpxchg}_* functions to take a + vcpu + * KVM: Remove kvm_{read,write}_guest() + * KVM: Use kmem cache for allocating vcpus + * KVM: Use alignment properties of vcpu to simplify FPU ops + * KVM: kvm_vm_ioctl_get_dirty_log restore "nothing dirty" optimization + * KVM: VMX: Add cpu consistency check + * KVM: Don't assign vcpu->cr3 if it's invalid: check first, set last + * KVM: Cleanup mark_page_dirty + * KVM: SVM: Make set_msr_interception more reliable + * KVM: Remove redundant alloc_vmcs_cpu declaration + * KVM: Fix defined but not used warning in drivers/kvm/vmx.c + * KVM: Remove stat_set from debugfs + * KVM: Remove unneeded kvm_dev_open and kvm_dev_release functions. + * KVM: Add and use pr_unimpl for standard formatting of unimplemented + features + * KVM: Use kmem_cache_free for kmem_cache_zalloc'ed objects + * KVM: VMX: Remove a duplicated ia32e mode vm entry control + * KVM: Remove useless assignment + * KVM: Cleanup string I/O instruction emulation + * KVM: Clean up kvm_setup_pio() + * KVM: VMX: Don't require cr8 load/store exit capability when running on + 32-bit + * KVM: Close minor race in signal handling + * KVM: Communicate cr8 changes to userspace + * KVM: x86 emulator: implement 'and $imm, %{al|ax|eax}' + * KVM: x86 emulator: implement 'jmp rel' instruction (opcode 0xe9) + * KVM: x86 emulator: Implement 'jmp rel short' instruction (opcode 0xeb) + * KVM: x86 emulator: implement 'push reg' (opcodes 0x50-0x57) + * KVM: VMX: allow rmode_tss_base() to work with >2G of guest memory + * KVM: Avoid calling smp_call_function_single() with interrupts disabled + * KVM: MMU: Fix rare oops on guest context switch + * KVM: Support more memory slots + * KVM: X86 emulator: fix 'push reg' writeback + * KVM: VMX: Split segments reload in vmx_load_host_state() + * KVM: Add support for in-kernel PIC emulation + * KVM: Define and use cr8 access functions + * KVM: Emulate local APIC in kernel + * KVM: In-kernel I/O APIC model + * KVM: Emulate hlt in the kernel + * KVM: Protect in-kernel pio using kvm->lock + * KVM: Add get/set irqchip ioctls for in-kernel PIC live migration + support + * KVM: Bypass irq_pending get/set when using in kernel irqchip + * KVM: in-kernel IOAPIC save and restore support + * KVM: in-kernel LAPIC save and restore support + * KVM: pending irq save/restore + * KVM: VMX: Use shadow TPR/cr8 for 64-bits guests + * KVM: Keep track of missed timer irq injections + * KVM: Migrate lapic hrtimer when vcpu moves to another cpu + * KVM: disable tpr/cr8 sync when in-kernel APIC is used + * KVM: VMX: Fix tpr threshold updating + * KVM: deliver PIC interrupt only to vcpu0 + * KVM: round robin for APIC lowest priority delivery mode + * KVM: enable in-kernel APIC INIT/SIPI handling + * KVM: Set the ET flag in CR0 after initializing FX + * KVM: Remove the unused invlpg member of struct kvm_arch_ops. + * KVM: Clean up unloved invlpg emulation + * KVM: Keep control regs in sync + * KVM: Hoist SVM's get_cs_db_l_bits into core code. + * KVM: Simplify memory allocation + * KVM: Rename kvm_arch_ops to kvm_x86_ops + * KVM: Fix lapic 64-bit division on 32-bit hosts + * KVM: fix apic timer migration when inactive + * KVM: MMU: Don't do GFP_NOWAIT allocations + * KVM: Remove smp_processor_id() in kvm_vcpu_kick() + * KVM: VMX: Move vm entry failure handling to the exit handler + * KVM: Move main vcpu loop into subarch independent code + * KVM: Fix link error to "genapic" + * KVM: VMX: Fix exit qualification width on i386 + * KVM: x86 emulator: push imm8 + * KVM: x86 emulator: call near + * KVM: x86 emulator: pushf + * KVM: Improve emulation failure reporting + * KVM: VMX: Prevent setting CPU_BASED_TPR_SHADOW on i386 host + * KVM: x86 emulator: sort opcodes into ascending order + * KVM: x86 emulator: imlpement jump conditional relative + * KVM: X86 emulator: jump conditional short + * KVM: x86 emulator: lea + * KVM: x86 emulator: jmp abs + * KVM: x86 emulator: fix src, dst value initialization + * KVM: x86 emulator: popf + * KVM: Skip pio instruction when it is emulated, not executed + * KVM: fix PIC interrupt delivery on different APIC conditions + * KVM: Fix kvm_vcpu_ioctl_get_sregs() warning on i386 + * KVM: Remove errant printk() in kvm_vcpu_ioctl_get_sregs() + * KVM: Fix virtualization menu help text + * KVM: x86 emulator: Add vmmcall/vmcall to x86_emulate (v3) + * KVM: Refactor hypercall infrastructure (v3) + * KVM: x86 emulator: remove unused functions + * KVM: x86 emulator: move all x86_emulate_memop() to a structure + * KVM: x86 emulator: move all decoding process to function + x86_decode_insn() + * KVM: emulate_instruction() calls now x86_decode_insn() and + x86_emulate_insn() + * KVM: Call x86_decode_insn() only when needed + * KVM: Fix ioapic level-triggered interrupt redelivery + * KVM: Fix #UD exception delivery + * KVM: VMX: Further reduce efer reloads + * KVM: VMX: Fix build on i386 due to EFER_LMA not defined + * KVM: Fix ioapic.c compilation failure due to missing include + * KVM: x86 emulator: fix merge screwup due to emulator split + * KVM: x85 emulator: Correct inconcistency in between cr2 and ctxt->cr2. + * KVM: Avoid redelivery of edge-triggered irq if it is already in service + * KVM: Implement ioapic irq polarity bit + * KVM: x86 emulator: fix repne/repnz decoding + * KVM: Fix host oops due to guest changing efer + * KVM: Fix ioapic edge-triggered interrupts + * KVM: MMU: Set shadow pte atomically in mmu_pte_write_zap_pte() + * KVM: Allow not-present guest page faults to bypass kvm + * KVM: MMU: Make flooding detection work when guest page faults are + bypassed + * KVM: MMU: Ignore reserved bits in cr3 in non-pae mode + * KVM: x86 emulator: split some decoding into functions for readability + * KVM: x86 emulator: remove _eflags and use directly ctxt->eflags. + * KVM: x86 emulator: Remove no_wb, use dst.type = OP_NONE instead + * KVM: x86_emulator: no writeback for bt + * KVM: apic round robin cleanup + * KVM: Purify x86_decode_insn() error case management + * KVM: x86 emulator: Any legacy prefix after a REX prefix nullifies its + effect + * i386: Expose IOAPIC register definitions even if CONFIG_X86_IO_APIC is + not set + * KVM: x86 emulator: On a pop instruction, don't restore ECX and EIP on + error + * KVM: x86 emulator: remove unused variable + * KVM: VMX: Don't clear the vmcs if the vcpu is not loaded on any + processor + * KVM: VMX: Simplify vcpu_clear() + * KVM: Remove the usage of paeg->private field by rmap + * KVM: x86 emulator: Correct management of REP prefix + * KVM: Add general accessors to read and write guest memory + * KVM: Allow dynamic allocation of the mmu shadow cache size + * KVM: Check I/O APIC indirect index before writing + * KVM: Add kvm_free_lapic() to pair with kvm_create_lapic() + * KVM: Hoist kvm_create_lapic() into kvm_vcpu_init() + * KVM: Remove gratuitous casts from lapic.c + * KVM: CodingStyle cleanup + * KVM: VMX: Handle NMIs before enabling interrupts and preemption + * KVM: Support assigning userspace memory to the guest + * KVM: Export PIC reset for kernel device reset + * KVM: Split IOAPIC reset function and export for kernel RESET + * KVM: VMX: Reset mmu context when entering real mode + * KVM: Replace enum by #define + * KVM: Move x86 msr handling to new files x86.[ch] + * KVM: MMU: Clean up MMU functions to take struct kvm when appropriate + * KVM: MMU: More struct kvm_vcpu -> struct kvm cleanups + * KVM: Move guest pte dirty bit management to the guest pagetable walker + * KVM: MMU: Fix nx access bit for huge pages + * KVM: MMU: Disable write access on clean large pages + * KVM: MMU: Instatiate real-mode shadows as user writable shadows + * KVM: MMU: Move dirty bit updates to a separate function + * KVM: MMU: When updating the dirty bit, inform the mmu about it + * KVM: Portability: split kvm_vcpu_ioctl + * KVM: Restore missing #include + * KVM: Add some \n in ioapic_debug() + * KVM: x86 emulator: implement 'movnti mem, reg' + * KVM: MMU: Call update_dirty_bit() without disabling preemption + * KVM: Move apic timer interrupt backlog processing to common code + * KVM: Move interrupt injection out of interrupt disabled section + * KVM: Rename KVM_TLB_FLUSH to KVM_REQ_TLB_FLUSH + * KVM: VMX: Force vm86 mode if setting flags during real mode + * KVM: MMU: Simplify page table walker + * KVM: Actually move the interrupt injection code out of the critical + section + * KVM: x86 emulator: cmc, clc, cli, sti + * KVM: x86 emulator: use a defined flag definition + * KVM: x86 emulator: fix access registers for instructions with ModR/M + byte and Mod = 3 + * KVM: MMU: Add rmap_next(), a helper for walking kvm rmaps + * KVM: MMU: Keep a reverse mapping of non-writable translations + * KVM: MMU: Make gfn_to_page() always safe + * KVM: Partial swapping of guest memory + * KVM: VMX: Initialize vcpu with preemption enabled + * KVM: Use virtual cpu accounting if available for guest times. + * KVM: Move kvm_guest_exit() after local_irq_enable() + * KVM: MMU: Fix dirty bit pte gpa calculation + * KVM: Allocate userspace memory for older userspace + * KVM: Portability: Split kvm_vcpu into arch dependent and independent + parts (part 1) + * KVM: Fix local apic timer divide by zero + * KVM: Move vmx_vcpu_reset() out of vmx_vcpu_setup() + * KVM: Add a might_sleep() annotation to gfn_to_page() + * KVM: VMX: vmx_vcpu_setup(): remove unused variable. + * KVM: Per-architecture hypercall definitions + * KVM: Use new smp_call_function_mask() in kvm_flush_remote_tlbs() + * KVM: Unmap kernel-allocated memory on slot destruction + * KVM: Export memory slot allocation mechanism + * KVM: Add kernel-internal memory slots + * KVM: Add ioctl to tss address from userspace, + * KVM: x86 emulator: fix 'push imm8' emulation + * KVM: VMX: Let gcc to choose which registers to save (x86_64) + * KVM: VMX: Let gcc to choose which registers to save (i386) + * KVM: SVM: Let gcc to choose which registers to save (x86_64) + * KVM: SVM: Let gcc to choose which registers to save (i386) + * KVM: x86 emulator: invd instruction + * KVM: SVM: Intercept the 'invd' and 'wbinvd' instructions + * KVM: x86 emulator: don't depend on cr2 for mov abs emulation + * KVM: Move page fault processing to common code + * KVM: MMU: Topup the mmu memory preallocation caches before emulating an + insn + * KVM: Portability: Split kvm_vm_ioctl v3 + * KVM: Portability: Move memory segmentation to x86.c + * KVM: Portability: move get/set_apic_base to x86.c + * KVM: Portability: Move control register helper functions to x86.c + * KVM: VMX: Enable memory mapped TPR shadow (FlexPriority) + * KVM: Fix gfn_to_page() acquiring mmap_sem twice + * KVM: Portability: Move kvm_get/set_msr[_common] to x86.c + * KVM: Portability: Move x86 emulation and mmio device hook to x86.c + * KVM: Portability: Move pio emulation functions to x86.c + * KVM: x86 emulator: Extract the common code of SrcReg and DstReg + * KVM: x86 emulator: centralize decoding of one-byte register access + insns + * KVM: Simplify decode_register_operand() calling convention + * KVM: Make mark_page_dirty() work for aliased pages too. + * KVM: x86 emulator: Hoist modrm and abs decoding into separate functions + * KVM: Portability: Make exported debugfs data architecture-specific + * KVM: Portability: Move x86 instruction emulation code to x86.c + * KVM: Portability: Move x86 FPU handling to x86.c + * KVM: Portability: Move x86 vcpu ioctl handlers to x86.c + * KVM: x86 emulator: Move one-byte insns with reg operand into one-byte + section + * KVM: VMX: Fix repeated allocation of apic access page on smp + * KVM: SVM: Fix SMP with kernel apic + * KVM: Add make_page_dirty() to kvm_clear_guest_page() + * KVM: SVM: Defer nmi processing until switch to host state is complete + * KVM: VMX: Avoid reloading host efer on cpus that don't have it + * KVM: VMX: Use vmx to inject real interrupts + * KVM: Go back to atomically injecting interrupts + * KVM: VMX: Comment VMX primary/secondary exec ctl definitions + * KVM: VMX: wbinvd exiting + * KVM: x86 emulator: fix JMP_REL + * KVM: x86 emulator: fix the saving of of the eip value + * KVM: x86 emulator: remove 8 bytes operands emulator for call near + instruction + * KVM: Simplify CPU_TASKS_FROZEN cpu notifier handling + * KVM: add kvm_is_error_hva() + * KVM: introduce gfn_to_hva() + * KVM: Change kvm_{read,write}_guest() to use copy_{from,to}_user() + * KVM: Portability: Move some includes to x86.c + * KVM: Portability: Move kvm_x86_ops to x86.c + * KVM: Portability: Add vcpu and hardware management arch hooks + * KVM: Portability: Combine kvm_init and kvm_init_x86 + * KVM: Portability: Move x86 specific code from kvm_init() to kvm_arch() + * KVM: x86 emulator: modify 'lods', and 'stos' not to depend on CR2 + * KVM: Portability: move KVM_CHECK_EXTENSION + * KVM: VMX: Consolidate register usage in vmx_vcpu_run() + * KVM: Portability: Make kvm_vcpu_ioctl_translate arch dependent + * KVM: x86 emulator: Rename 'cr2' to 'memop' + * KVM: Remove ptr comparisons to 0 + * KVM: Remove __init attributes for kvm_init_debug and kvm_init_msr_list + * KVM: Portability: Add two hooks to handle kvm_create and destroy vm + * KVM: Replace 'light_exits' stat with 'host_state_reload' + * KVM: Add fpu_reload counter + * KVM: Add instruction emulation statistics + * KVM: Extend stats support for VM stats + * KVM: MMU: Add some mmu statistics + * KVM: x86 emulator: Use emulator_write_emulated and not + emulator_write_std + * KVM: Make unloading of FPU state when putting vcpu arch-independent + * KVM: SVM: Disable Lazy FPU optimization + * KVM: Portability: Move kvm_vcpu_ioctl_get_dirty_log to arch-specific + file + * KVM: Portability: MMU initialization and teardown split + * KVM: Portability: Move some macro definitions from kvm.h to x86.h + * KVM: Portability: Move struct kvm_x86_ops definition to x86.h + * KVM: Portability: Move vcpu regs enumeration definition to x86.h + * KVM: Move some static inline functions out from kvm.h into x86.h + * KVM: Portability: Move some function declarations to x86.h + * KVM: VMX: Force seg.base == (seg.sel << 4) in real mode + * KVM: MMU: Change guest pte access to kvm_{read,write}_guest() + * kvm: simplify kvm_clear_guest_page() + * KVM: Add missing #include + * KVM: MMU: Remove unused variable + * KVM: Remove unused "rmap_overflow" variable + * KVM: Correct consistent typo: "destory" -> "destroy" + * KVM: Move misplaced comment + * KVM: Portability: Move kvm_memory_alias to asm/kvm.h + * KVM: Portability: Move x86 pic strutctures + * KVM: Portability: Move kvm_regs to + * KVM: Portability: Move structure lapic_state to + * KVM: Portability: Move kvm_segment & kvm_dtable structure to + + * KVM: Portability: Move kvm_sregs and msr structures to + * KVM: Portability: Move cpuid structures to + * KVM: Export include/asm-x86/kvm.h + * KVM: MMU: Fix potential memory leak with smp real-mode + * KVM: MMU: Selectively set PageDirty when releasing guest memory + * KVM: x86 emulator: retire ->write_std() + * KVM: x86 emulator: prefetch up to 15 bytes of the instruction executed + * KVM: SVM: Fix FPU leak and re-enable lazy FPU switching + * KVM: Recalculate mmu pages needed for every memory region change + * KVM: Portability: Split kvm_set_memory_region() to have an arch + callout + * KVM: Split vcpu creation to avoid vcpu_load() before preemption setup + * KVM: MMU: Implement guest page fault bypass for nonpae + * KVM: Add statistic for remote tlb flushes + * KVM: MMU: Avoid unnecessary remote tlb flushes when guest updates a pte + * KVM: Add parentheses to silence gcc + * KVM: Don't bother the mmu if cr3 load doesn't change cr3 + * KVM: MMU: Code cleanup + * KVM: MMU: Introduce and use gpte_to_gfn() + * KVM: MMU: Move pse36 handling to the guest walker + * KVM: MMU: Remove extra gaddr parameter from set_pte_common() + * KVM: MMU: Remove set_pde() + * KVM: MMU: Adjust page_header_update_slot() to accept a gfn instead of a + gpa + * KVM: MMU: Introduce gfn_to_gpa() + * KVM: MMU: Simplify nonpaging_map() + * KVM: MMU: Remove gva_to_hpa() + * KVM: Remove gpa_to_hpa() + * KVM: MMU: Rename variable of type 'struct kvm_mmu_page *' + * KVM: MMU: Rename 'release_page' + * KVM: Disallow fork() and similar games when using a VM + * KVM: Enhance guest cpuid management + * KVM: Replace private 'struct segment descriptor' by x86's desc_struct + * KVM: Remove segment_descriptor, part 2 + * KVM: Fix compile error on i386 + * KVM: VMX: Read & store IDT_VECTORING_INFO_FIELD + * KVM: Fix faults during injection of real-mode interrupts + * KVM: x86 emulator: Fix instruction fetch cache hit check + * KVM: VMX: Remove the secondary execute control dependency on irqchip + * KVM: Portability: Move unalias_gfn to arch dependent file + * KVM: x86 emulator: Make a distinction between repeat prefixes F3 and F2 + * KVM: x86 emulator: address size and operand size overrides are sticky + * KVM: Remove desc.h include in kvm_main.c + * KVM: Revert segment_descriptor.h removal + * KVM: Remove misleading check for mmio during event injection + * KVM: MMU: mark pages that were inserted to the shadow pages table as + accessed + * KVM: x86 emulator: rename REP_REPE_PREFIX + * KVM: x86 emulator: cmps instruction + * KVM: Add ifdef in irqchip struct for x86 only structures + * KVM: Fix cpuid2 killing 32-bit guests on non-NX machines + * KVM: x86 emulator: Move rep processing before instruction execution + * KVM: x86 emulator: unify two switches + * KVM: x86 emulator: unify four switch statements into two + * KVM: Don't bypass the mmu if in pae and pdptrs changed + * KVM: Portability: Move KVM_INTERRUPT vcpu ioctl to x86.c + * KVM: Correct kvm_init() error paths not freeing bad_pge. + * KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM + * KVM: SVM: Remove KVM specific defines for MSR_EFER + * KVM: Replace kvm_lapic with kvm_vcpu in ioapic/lapic interface + * KVM: Replace dest_Lowest_Prio and dest_Fixed with self-defined macros + * KVM: Extend ioapic code to support iosapic + * KVM: Portability: Move address types to their own header file + * KVM: Portability: Move IO device definitions to its own header file + * KVM: Portability: Stop including x86-specific headers in kvm_main.c + * KVM: Portability: Create kvm_arch_vcpu_runnable() function + * KVM: Convert KVM from ->nopage() to ->fault() + * KVM: MMU: Remove unused prev_shadow_ent variable from fetch() + * KVM: Generalize exception injection mechanism + * KVM: Replace page fault injection by the generalized exception queue + * KVM: Replace #GP injection by the generalized exception queue + * KVM: Use generalized exception queue for injecting #UD + * KVM: x86 emulator: fix eflags preparation for emulation + * KVM: VMX: Avoid exit when setting cr8 if the local apic is in the + kernel + * KVM: SVM: Emulate read/write access to cr8 + * KVM: x86 emulator: Fix stack instructions on 64-bit mode + * KVM: SVM: Trap access to the cr8 register + * KVM: VMX: Fix cr8 exit optimization + * KVM: MMU: Use cmpxchg for pte updates on walk_addr() + * KVM: MMU: Simplify calculation of pte access + * KVM: MMU: Set nx bit correctly on shadow ptes + * KVM: MMU: Move pte access calculation into a helper function + * KVM: MMU: Fix inherited permissions for emulated guest pte updates + * KVM: MMU: No need to pick up nx bit from guest pte + * KVM: MMU: Pass pte dirty flag to set_pte() instead of calculating it + on-site + * KVM: MMU: Remove walker argument to set_pte() + * KVM: MMU: Move set_pte() into guest paging mode independent code + * KVM: MMU: Adjust mmu_set_spte() debug code for gpte removal + * KVM: MMU: Use mmu_set_spte() for real-mode shadows + * KVM: SVM: Exit to userspace if write to cr8 and not using in-kernel + apic + * KVM: SVM: support writing 0 to K8 performance counter control registers + * KVM: MMU: Fix kunmap_atomic() call in cmpxchg_gpte() + * KVM: MMU: Fix SMP shadow instantiation race + * KVM: LAPIC: minor debugging compile fix + * KVM: MMU: emulated cmpxchg8b should be atomic on i386 + * KVM: Fix bad kunmap_atomic() paramerter inm cmpxchg emulation + * KVM: Make cmpxchg emulation compile on i386 + * KVM: Another cmpxchg i386 compile fix + * KVM: Another cmpxchg emulation compile fix + * KVM: Another cmpxchg emulation compile fix + * KVM: Portability: Move kvm{pic,ioapic} accesors to x86 specific code + * KVM: Portability: Introduce kvm_vcpu_arch + * KVM: Portability: Split mmu-related static inline functions to mmu.h + * KVM: Portability: Move kvm_vcpu definition back to kvm.h + * KVM: Portability: Expand the KVM_VCPU_COMM in kvm_vcpu structure. + * KVM: Portability: Move kvm_vcpu_stat to x86.h + * KVM: Portability: Move memslot aliases to new struct kvm_arch + * KVM: Portability: Move mmu-related fields to kvm_arch + * KVM: Portability: move vpic and vioapic to kvm_arch + * KVM: Portability: Move round_robin_prev_vcpu and tss_addr to kvm_arch + * KVM: Portability: Move kvm_vm_stat to x86.h + * KVM: VMX: Add printk_ratelimit in vmx_intr_assist + * KVM: Move arch dependent files to new directory arch/x86/kvm/ + * KVM: Move drivers/kvm/* to virt/kvm/ + * KVM: Fix compile error in asm/kvm_host.h + * KVM: Move irqchip declarations into new ioapic.h and lapic.h + * KVM: Move ioapic code to common directory. + * KVM: Move kvm_vcpu_kick() to x86.c + * KVM: Expose ioapic to ia64 save/restore APIs + * KVM: MMU: Coalesce remote tlb flushes + * KVM: MMU: Add cache miss statistic + * KVM: Print data for unimplemented wrmsr + * KVM: Ensure pages are copied on write + * KVM: MMU: Fix cmpxchg8b emulation on i386 (again) + * KVM: x86 emulator: Add vmmcall/vmcall to x86_emulate (v3) + * KVM: Refactor hypercall infrastructure (v3) + * KVM: x86 emulator: remove unused functions + * KVM: x86 emulator: move all x86_emulate_memop() to a structure + * KVM: x86 emulator: move all decoding process to function + x86_decode_insn() + * KVM: emulate_instruction() calls now x86_decode_insn() and + x86_emulate_insn() + * KVM: Call x86_decode_insn() only when needed + * KVM: VMX: Further reduce efer reloads + * KVM: Allow not-present guest page faults to bypass kvm + * KVM: MMU: Make flooding detection work when guest page faults are + bypassed + * KVM: MMU: Ignore reserved bits in cr3 in non-pae mode + * KVM: x86 emulator: split some decoding into functions for readability + * KVM: x86 emulator: remove _eflags and use directly ctxt->eflags. + * KVM: x86 emulator: Remove no_wb, use dst.type = OP_NONE instead + * KVM: x86_emulator: no writeback for bt + * KVM: Purify x86_decode_insn() error case management + * KVM: x86 emulator: Any legacy prefix after a REX prefix nullifies its + effect + * KVM: VMX: Don't clear the vmcs if the vcpu is not loaded on any + processor + * KVM: VMX: Simplify vcpu_clear() + * KVM: Remove the usage of page->private field by rmap + * KVM: Add general accessors to read and write guest memory + * KVM: Allow dynamic allocation of the mmu shadow cache size + * KVM: Add kvm_free_lapic() to pair with kvm_create_lapic() + * KVM: Hoist kvm_create_lapic() into kvm_vcpu_init() + * KVM: Remove gratuitous casts from lapic.c + * KVM: CodingStyle cleanup + * KVM: Support assigning userspace memory to the guest + * KVM: Move x86 msr handling to new files x86.[ch] + * KVM: MMU: Clean up MMU functions to take struct kvm when appropriate + * KVM: MMU: More struct kvm_vcpu -> struct kvm cleanups + * KVM: Move guest pte dirty bit management to the guest pagetable walker + * KVM: MMU: Fix nx access bit for huge pages + * KVM: MMU: Disable write access on clean large pages + * KVM: MMU: Instantiate real-mode shadows as user writable shadows + * KVM: MMU: Move dirty bit updates to a separate function + * KVM: MMU: When updating the dirty bit, inform the mmu about it + * KVM: Portability: split kvm_vcpu_ioctl + * KVM: apic round robin cleanup + * KVM: Add some \n in ioapic_debug() + * KVM: Move apic timer interrupt backlog processing to common code + * KVM: Rename KVM_TLB_FLUSH to KVM_REQ_TLB_FLUSH + * KVM: x86 emulator: Implement emulation of instruction: inc & dec + * KVM: MMU: Simplify page table walker + * KVM: x86 emulator: cmc, clc, cli, sti + * KVM: MMU: Add rmap_next(), a helper for walking kvm rmaps + * KVM: MMU: Keep a reverse mapping of non-writable translations + * KVM: MMU: Make gfn_to_page() always safe + * KVM: MMU: Partial swapping of guest memory + * KVM: Use virtual cpu accounting if available for guest times. + * KVM: Allocate userspace memory for older userspace + * KVM: Portability: Split kvm_vcpu into arch dependent and independent + parts (part 1) + * KVM: Move vmx_vcpu_reset() out of vmx_vcpu_setup() + * KVM: Add a might_sleep() annotation to gfn_to_page() + * KVM: Export PIC reset for kernel device reset + * KVM: Split IOAPIC reset function and export for kernel RESET + * KVM: Per-architecture hypercall definitions + * KVM: Unmap kernel-allocated memory on slot destruction + * KVM: Export memory slot allocation mechanism + * KVM: Add kernel-internal memory slots + * KVM: Add ioctl to tss address from userspace, + * KVM: VMX: Let gcc to choose which registers to save (x86_64) + * KVM: VMX: Let gcc to choose which registers to save (i386) + * KVM: SVM: Let gcc to choose which registers to save (x86_64) + * KVM: SVM: Let gcc to choose which registers to save (i386) + * KVM: x86 emulator: don't depend on cr2 for mov abs emulation + * KVM: Move page fault processing to common code + * KVM: MMU: Topup the mmu memory preallocation caches before emulating an + insn + * KVM: Portability: Split kvm_vm_ioctl v3 + * KVM: Portability: Move memory segmentation to x86.c + * KVM: Portability: move get/set_apic_base to x86.c + * KVM: Portability: Move control register helper functions to x86.c + * KVM: VMX: Enable memory mapped TPR shadow (FlexPriority) + * KVM: Fix gfn_to_page() acquiring mmap_sem twice + * KVM: Portability: Move kvm_get/set_msr[_common] to x86.c + * KVM: Portability: Move x86 emulation and mmio device hook to x86.c + * KVM: Portability: Move pio emulation functions to x86.c + * KVM: x86 emulator: Extract the common code of SrcReg and DstReg + * KVM: x86 emulator: centralize decoding of one-byte register access + insns + * KVM: Simplify decode_register_operand() calling convention + * KVM: Make mark_page_dirty() work for aliased pages too. + * KVM: x86 emulator: Hoist modrm and abs decoding into separate functions + * KVM: Portability: Make exported debugfs data architecture-specific + * KVM: Portability: Move x86 instruction emulation code to x86.c + * KVM: Portability: Move x86 FPU handling to x86.c + * KVM: Portability: Move x86 vcpu ioctl handlers to x86.c + * KVM: Add make_page_dirty() to kvm_clear_guest_page() + * KVM: VMX: Use vmx to inject real-mode interrupts + * KVM: VMX: Read & store IDT_VECTORING_INFO_FIELD + * KVM: Fix faults during injection of real-mode interrupts + * KVM: VMX: Comment VMX primary/secondary exec ctl definitions + * KVM: VMX: wbinvd exiting + * KVM: x86 emulator: remove 8 bytes operands emulator for call near + instruction + * KVM: Simplify CPU_TASKS_FROZEN cpu notifier handling + * KVM: add kvm_is_error_hva() + * KVM: introduce gfn_to_hva() + * KVM: Change kvm_{read,write}_guest() to use copy_{from,to}_user() + * KVM: Portability: Move some includes to x86.c + * KVM: Portability: Move kvm_x86_ops to x86.c + * KVM: Portability: Add vcpu and hardware management arch hooks + * KVM: Portability: Combine kvm_init and kvm_init_x86 + * KVM: Portability: Move x86 specific code from kvm_init() to kvm_arch() + * KVM: x86 emulator: modify 'lods', and 'stos' not to depend on CR2 + * KVM: Portability: move KVM_CHECK_EXTENSION + * KVM: VMX: Consolidate register usage in vmx_vcpu_run() + * KVM: Portability: Make kvm_vcpu_ioctl_translate arch dependent + * KVM: Remove ptr comparisons to 0 + * KVM: Remove __init attributes for kvm_init_debug and kvm_init_msr_list + * KVM: Portability: Add two hooks to handle kvm_create and destroy vm + * KVM: Replace 'light_exits' stat with 'host_state_reload' + * KVM: Add fpu_reload counter + * KVM: Add instruction emulation statistics + * KVM: Extend stats support for VM stats + * KVM: MMU: Add some mmu statistics + * KVM: Make unloading of FPU state when putting vcpu arch-independent + * KVM: Portability: Move kvm_vcpu_ioctl_get_dirty_log to arch-specific + file + * KVM: Portability: MMU initialization and teardown split + * KVM: Portability: Move some macro definitions from kvm.h to x86.h + * KVM: Portability: Move struct kvm_x86_ops definition to x86.h + * KVM: Portability: Move vcpu regs enumeration definition to x86.h + * KVM: Move some static inline functions out from kvm.h into x86.h + * KVM: Portability: Move some function declarations to x86.h + * KVM: VMX: Force seg.base == (seg.sel << 4) in real mode + * KVM: MMU: Change guest pte access to kvm_{read,write}_guest() + * KVM: Simplify kvm_clear_guest_page() + * KVM: Add missing #include + * KVM: MMU: Remove unused variable + * KVM: Remove unused "rmap_overflow" variable + * KVM: Correct consistent typo: "destory" -> "destroy" + * KVM: Move misplaced comment + * KVM: Portability: Move kvm_memory_alias to asm/kvm.h + * KVM: Portability: Move x86 pic strutctures + * KVM: Portability: Move kvm_regs to + * KVM: Portability: Move structure lapic_state to + * KVM: Portability: Move kvm_segment & kvm_dtable structure to + + * KVM: Portability: Move kvm_sregs and msr structures to + * KVM: Portability: Move cpuid structures to + * KVM: Export include/asm-x86/kvm.h + * KVM: MMU: Fix potential memory leak with smp real-mode + * KVM: MMU: Selectively set PageDirty when releasing guest memory + * KVM: x86 emulator: retire ->write_std() + * KVM: x86 emulator: prefetch up to 15 bytes of the instruction executed + * KVM: Recalculate mmu pages needed for every memory region change + * KVM: Portability: Split kvm_set_memory_region() to have an arch + callout + * KVM: Split vcpu creation to avoid vcpu_load() before preemption setup + * KVM: MMU: Implement guest page fault bypass for nonpae + * KVM: Add statistic for remote tlb flushes + * KVM: MMU: Avoid unnecessary remote tlb flushes when guest updates a pte + * KVM: Don't bother the mmu if cr3 load doesn't change cr3 + * KVM: MMU: Code cleanup + * KVM: MMU: Introduce and use gpte_to_gfn() + * KVM: MMU: Move pse36 handling to the guest walker + * KVM: MMU: Remove extra gaddr parameter from set_pte_common() + * KVM: MMU: Remove set_pde() + * KVM: MMU: Adjust page_header_update_slot() to accept a gfn instead of a + gpa + * KVM: MMU: Introduce gfn_to_gpa() + * KVM: MMU: Simplify nonpaging_map() + * KVM: MMU: Remove gva_to_hpa() + * KVM: Remove gpa_to_hpa() + * KVM: MMU: Rename variables of type 'struct kvm_mmu_page *' + * KVM: MMU: Rename 'release_page' + * KVM: Disallow fork() and similar games when using a VM + * KVM: Enhance guest cpuid management + * KVM: VMX: Remove the secondary execute control dependency on irqchip + * KVM: Portability: Move unalias_gfn to arch dependent file + * KVM: x86 emulator: Make a distinction between repeat prefixes F3 and F2 + * KVM: x86 emulator: address size and operand size overrides are sticky + * KVM: Remove misleading check for mmio during event injection + * KVM: MMU: mark pages that were inserted to the shadow pages table as + accessed + * KVM: x86 emulator: rename REP_REPE_PREFIX + * KVM: x86 emulator: Rename 'cr2' to 'memop' + * KVM: x86 emulator: cmps instruction + * KVM: Add ifdef in irqchip struct for x86 only structures + * KVM: Fix cpuid2 killing 32-bit guests on non-NX machines + * KVM: x86 emulator: Move rep processing before instruction execution + * KVM: x86 emulator: unify two switches + * KVM: x86 emulator: unify four switch statements into two + * KVM: Portability: Move KVM_INTERRUPT vcpu ioctl to x86.c + * KVM: Correct kvm_init() error paths not freeing bad_pge. + * KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM + * KVM: SVM: Remove KVM specific defines for MSR_EFER + * KVM: Replace kvm_lapic with kvm_vcpu in ioapic/lapic interface + * KVM: Replace dest_Lowest_Prio and dest_Fixed with self-defined macros + * KVM: Extend ioapic code to support iosapic + * KVM: Portability: Move address types to their own header file + * KVM: Portability: Move IO device definitions to its own header file + * KVM: Portability: Stop including x86-specific headers in kvm_main.c + * KVM: Portability: Create kvm_arch_vcpu_runnable() function + * KVM: Convert KVM from ->nopage() to ->fault() + * KVM: MMU: Remove unused prev_shadow_ent variable from fetch() + * KVM: Generalize exception injection mechanism + * KVM: Replace page fault injection by the generalized exception queue + * KVM: Replace #GP injection by the generalized exception queue + * KVM: Use generalized exception queue for injecting #UD + * KVM: x86 emulator: fix eflags preparation for emulation + * KVM: VMX: Avoid exit when setting cr8 if the local apic is in the + kernel + * KVM: SVM: Emulate read/write access to cr8 + * KVM: x86 emulator: Fix stack instructions on 64-bit mode + * KVM: SVM: Trap access to the cr8 register + * KVM: VMX: Fix cr8 exit optimization + * KVM: MMU: Use cmpxchg for pte updates on walk_addr() + * KVM: MMU: Simplify calculation of pte access + * KVM: MMU: Set nx bit correctly on shadow ptes + * KVM: MMU: Move pte access calculation into a helper function + * KVM: MMU: Fix inherited permissions for emulated guest pte updates + * KVM: MMU: No need to pick up nx bit from guest pte + * KVM: MMU: Pass pte dirty flag to set_pte() instead of calculating it + on-site + * KVM: MMU: Remove walker argument to set_pte() + * KVM: MMU: Move set_pte() into guest paging mode independent code + * KVM: MMU: Adjust mmu_set_spte() debug code for gpte removal + * KVM: MMU: Use mmu_set_spte() for real-mode shadows + * KVM: SVM: Exit to userspace if write to cr8 and not using in-kernel + apic + * KVM: MMU: Fix SMP shadow instantiation race + * KVM: LAPIC: minor debugging compile fix + * KVM: SVM: support writing 0 to K8 performance counter control registers + * KVM: MMU: emulated cmpxchg8b should be atomic on i386 + * KVM: Portability: Move kvm{pic,ioapic} accesors to x86 specific code + * KVM: Portability: Introduce kvm_vcpu_arch + * KVM: Portability: Split mmu-related static inline functions to mmu.h + * KVM: Portability: Move kvm_vcpu definition back to kvm.h + * KVM: Portability: Expand the KVM_VCPU_COMM in kvm_vcpu structure. + * KVM: Portability: Move kvm_vcpu_stat to x86.h + * KVM: Portability: Move memslot aliases to new struct kvm_arch + * KVM: Portability: Move mmu-related fields to kvm_arch + * KVM: Portability: move vpic and vioapic to kvm_arch + * KVM: Portability: Move round_robin_prev_vcpu and tss_addr to kvm_arch + * KVM: Portability: Move kvm_vm_stat to x86.h + * KVM: VMX: Add printk_ratelimit in vmx_intr_assist + * KVM: Move arch dependent files to new directory arch/x86/kvm/ + * KVM: Move drivers/kvm/* to virt/kvm/ + * KVM: Move irqchip declarations into new ioapic.h and lapic.h + * KVM: Move ioapic code to common directory. + * KVM: Move kvm_vcpu_kick() to x86.c + * KVM: Expose ioapic to ia64 save/restore APIs + * KVM: MMU: Coalesce remote tlb flushes + * KVM: MMU: Add cache miss statistic + * KVM: Print data for unimplemented wrmsr + * KVM: Ensure pages are copied on write + * KVM: local APIC TPR access reporting facility + * KVM: Accelerated apic support + * KVM: Disable vapic support on Intel machines with FlexPriority + * KVM: MMU: Concurrent guest walkers + * KVM: Add kvm_read_guest_atomic() + * KVM: MMU: Avoid calling gfn_to_page() in mmu_set_spte() + * KVM: MMU: Switch to mmu spinlock + * KVM: MMU: Move kvm_free_some_pages() into critical section + * KVM: MMU: Broaden scope of mmap_sem to include actual mapping + * KVM: MMU: Fix recursive locking of mmap_sem() + * KVM: Fix unbalanced mmap_sem operations in cmpxchg8b emulation + * KVM: Mark vapic page as dirty for save/restore/migrate + * KVM: x86 emulator: Only allow VMCALL/VMMCALL trapped by #UD + * KVM: MMU: Update shadow ptes on partial guest pte writes + * KVM: MMU: Simplify hash table indexing + * KVM: Portability: Move kvm_fpu to asm-x86/kvm.h + * KVM: MMU: Fix dirty page setting for pages removed from rmap + * KVM: Initialize the mmu caches only after verifying cpu support + * KVM: Fix unbounded preemption latency + * KVM: Put kvm_para.h include outside __KERNEL__ + * KVM: Move apic timer migration away from critical section + * KVM: SVM: Fix lazy FPU switching + * KVM: MMU: Fix gpa truncation when reading a pte + * [GFS2] Handle multiple glock demote requests + * [GFS2] Clean up internal read function + * [GFS2] Use ->page_mkwrite() for mmap() + * [GFS2] Remove useless i_cache from inodes + * [GFS2] Remove unused field in struct gfs2_inode + * [GFS2] Add gfs2_is_writeback() + * [GFS2] Introduce gfs2_set_aops() + * [GFS2] Split gfs2_writepage into three cases + * [GFS2] Add writepages for GFS2 jdata + * [GFS2] Don't hold page lock when starting transaction + * [GFS2] Use correct include file in ops_address.c + * [GFS2] Remove unused variables + * [GFS2] Remove "reclaim limit" + * [GFS2] Add sync_page to metadata address space operations + * [GFS2] Reorder writeback for glock sync + * [GFS2] Remove flags no longer required + * [GFS2] Given device ID rather than s_id in "id" sysfs file + * [GFS2] check kthread_should_stop when waiting + * [GFS2] Don't add glocks to the journal + * [GFS2] Use atomic_t for journal free blocks counter + * [GFS2] Move gfs2_logd into log.c + * [GFS2] Don't periodically update the jindex + * [GFS2] Check for installation of mount helpers for DLM mounts + * [GFS2] tidy up error message + * [GFS2] Fix runtime issue with UP kernels + * [GFS2] remove unnecessary permission checks + * [GFS2] Fix build warnings + * [GFS2] Remove unrequired code + * [GFS2] Remove lock methods for lock_nolock protocol + * [GFS2] patch to check for recursive lock requests in gfs2_rename code + path + * [GFS2] Remove unused variable + * [GFS2] use pid for plock owner for nfs clients + * [GFS2] Remove function gfs2_get_block + * [GFS2] Journal extent mapping + * [GFS2] Get rid of useless "found" variable in quota.c + * [GFS2] Run through full bitmaps quicker in gfs2_bitfit + * [GFS2] Reorganize function gfs2_glmutex_lock + * [GFS2] Only fetch the dinode once in block_map + * [GFS2] Function meta_read optimization + * [GFS2] Incremental patch to fix compiler warning + * [GFS2] Eliminate the no longer needed sd_statfs_mutex + * [GFS2] Minor correction + * [GFS2] Fix log block mapper + * [GFS2] Remove unused variable + * [GFS2] Allow page migration for writeback and ordered pages + * [GFS2] Initialize extent_list earlier + * [GFS2] Fix problems relating to execution of files on GFS2 + * [GFS2] Fix assert in log code + * [GFS2] Reduce inode size by moving i_alloc out of line + * [GFS2] Remove unneeded i_spin + * [GFS2] gfs2_alloc_required performance + * [GFS2] Fix write alloc required shortcut calculation + * [GFS2] Fix typo + * [GFS2] Fix page_mkwrite truncation race path + * [GFS2] Lockup on error + * [GFS2] Allow journal recovery on read-only mount + + -- Tim Gardner Sun, 27 Jan 2008 20:37:18 -0700 + +linux (2.6.24-5.9) hardy; urgency=low + + [Amit Kucheria] + + * Fix LPIA FTBFS due to virtio Ignore: yes + + [Upstream Kernel Changes] + + * ACPI: processor: Fix null pointer dereference in throttling + * [SPARC64]: Fix of section mismatch warnings. + * [SPARC64]: Fix section error in sparcspkr + * [SPARC]: Constify function pointer tables. + * [BLUETOOTH]: Move children of connection device to NULL before + connection down. + * [TULIP] DMFE: Fix SROM parsing regression. + * [IPV4]: Add missing skb->truesize increment in ip_append_page(). + * iwlwifi: fix possible read attempt on ucode that is not available + * [NETNS]: Re-export init_net via EXPORT_SYMBOL. + * [INET]: Fix truesize setting in ip_append_data + * sis190: add cmos ram access code for the SiS19x/968 chipset pair + * sis190: remove duplicate INIT_WORK + * sis190: mdio operation failure is not correctly detected + * sis190: scheduling while atomic error + * Update ctime and mtime for memory-mapped files + * [SCSI] initio: fix module hangs on loading + * xen: disable vcpu_info placement for now + * agp/intel: add support for E7221 chipset + * drm/i915: add support for E7221 chipset + * DMI: move dmi_available declaration to linux/dmi.h + * DMI: create dmi_get_slot() + * ACPI: create acpi_dmi_dump() + * ACPI: on OSI(Linux), print needed DMI rather than requesting dmidecode + output + * ACPI: Delete Intel Customer Reference Board (CRB) from OSI(Linux) DMI + list + * ACPI: make _OSI(Linux) console messages smarter + * ACPI: Add ThinkPad R61, ThinkPad T61 to OSI(Linux) white-list + * ACPI: DMI blacklist to reduce console warnings on OSI(Linux) systems. + * ACPI: EC: fix dmesg spam regression + * ACPI: EC: add leading zeros to debug messages + * Pull bugzilla-9747 into release branch + * Pull bugzilla-8459 into release branch + * Pull bugzilla-9798 into release branch + * Pull dmi-2.6.24 into release branch + * [SPARC64]: Partially revert "Constify function pointer tables." + * lockdep: fix kernel crash on module unload + * sysctl: kill binary sysctl KERN_PPC_L2CR + * fix hugepages leak due to pagetable page sharing + * spi: omap2_mcspi PIO RX fix + * Linux 2.6.24 + + -- Tim Gardner Fri, 25 Jan 2008 01:44:27 -0700 + +linux (2.6.24-5.8) hardy; urgency=low + + [Alessio Igor Bogani] + + * rt: Update to 2.6.24-rc8-rt1 + * rt: Update configuration files + + [Amit Kucheria] + + * Asix: fix breakage caused in 2.6.24-rc7 + * Add CONFIG_CPUSETS to server-related flavours + - LP: #182434 + + [Chuck Short] + + * SAUCE: ata: blacklist FUJITSU MHW2160BH PL + - LP: #175834 + + [Kees Cook] + + * AppArmor: updated patch series to upstream SVN 1079. + + [Soren Hansen] + + * Updated configs to enable virtio stuff Ignore: yes + + [Stefan Bader] + + * Enabled CONFIG_BSD_PROCESS_ACCT=y for sparc. + - LP: #176587 + * Enable CONFIG_AUDITSYSCALL=y. + - LP: #140784 + * Added CONFIG_AUDIT_SYSCALL=y to custom lpia(compat) + * Enabled CONFIG_HUGETLBFS=y for i386/server amd64/server and ia64. + * Lower priority of pnpacpi resource messages to warning level. + - LP: #159241 + * Fix the messed up message level of pnpacpi parser. + + [Tim Gardner] + + * Start new release, bump ABI to -5 + * Disabled iwlwifi preperatory to moving it to l-u-m. + * Enabled CONFIG_USB_SERIAL_KEYSPAN + * Disabled CONFIG_CGROUPS. + * Virtio config settings for -rt. + * Re-enable IWLWIFI in the kernel. + * Fixed -rt saa7134-core.c FTBS + + [Upstream Kernel Changes] + + * Input: Handle EV_PWR type of input caps in input_set_capability. + * Input: jornada680_kbd - fix default keymap + * increase PNP_MAX_PORT to 40 from 24 + * sched: fix gcc warnings + * leds: Fix leds_list_lock locking issues + * leds: Fix locomo LED driver oops + * x86: fix asm-x86/byteorder.h for userspace export + * x86: fix asm-x86/msr.h for user-space export + * ACPI: EC: Enable boot EC before bus_scan + * ACPI: Make sysfs interface in ACPI power optional. + * fix lguest rmmod "bad pgd" + * slub: provide /proc/slabinfo + * [POWERPC] Fix build failure on Cell when CONFIG_SPU_FS=y + * slub: register slabinfo to procfs + * [SCSI] scsi_sysfs: restore prep_fn when ULD is removed + * Unify /proc/slabinfo configuration + * scsi: revert "[SCSI] Get rid of scsi_cmnd->done" + * restrict reading from /proc//maps to those who share ->mm or can + ptrace pid + * Fix kernel/ptrace.c compile problem (missing "may_attach()") + * hwmon: (w83627ehf) Be more careful when changing VID input level + * NFS: Fix a possible Oops in fs/nfs/super.c + * NFSv4: Fix circular locking dependency in nfs4_kill_renewd + * NFS: add newline to kernel warning message in auth_gss code + * NFSv4: nfs4_open_confirm must not set the open_owner as confirmed on + error + * NFSv4: Fix open_to_lock_owner sequenceid allocation... + * gameport: don't export functions that are static inline + * Input: spitzkbd - fix suspend key handling + * Input: pass EV_PWR events to event handlers + * [ARM] 4735/1: Unbreak pxa25x suspend/resume + * IB/srp: Fix list corruption/oops on module reload + * Console is utf-8 by default + * [IA64] Update Altix BTE error return status patch + * [IA64] Update Altix nofault code + * [X25]: Add missing x25_neigh_put + * [XFRM]: Do not define km_migrate() if !CONFIG_XFRM_MIGRATE + * [CASSINI]: Fix endianness bug. + * [CASSINI]: Revert 'dont touch page_count'. + * [CASSINI]: Program parent Intel31154 bridge when necessary. + * [CASSINI]: Set skb->truesize properly on receive packets. + * [CASSINI]: Fix two obvious NAPI bugs. + * [CASSINI]: Bump driver version and release date. + * [INET]: Fix netdev renaming and inet address labels + * [CONNECTOR]: Return proper error code in cn_call_callback() + * [ISDN] i4l: 'NO CARRIER' message lost after ldisc flush + * [ISDN]: i4l: Fix DLE handling for i4l-audio + * fix: using joysticks in 32 bit applications on 64 bit systems + * [ARM] 4691/1: add missing i2c_board_info struct for at91rm9200 + * hda_intel suspend latency: shorten codec read + * CPU hotplug: fix cpu_is_offline() on !CONFIG_HOTPLUG_CPU + * Linux 2.6.24-rc7 + * sh: Fix argument page dcache flushing regression. + * V4L/DVB (6944a): Fix Regression VIDIOCGMBUF ioctl hangs on bttv driver + * V4L/DVB (6916): ivtv: udelay has to be changed *after* the eeprom was + read, not before + * [MIPS] Move inclusing of kernel/time/Kconfig menu to appropriate place + * [MIPS] Alchemy: Fix use of __init code bug exposed by modpost warning + * [MIPS] Fix IP32 breakage + * [MIPS] Assume R4000/R4400 newer than 3.0 don't have the mfc0 count bug + * [MIPS] Fix CONFIG_BOOT_RAW. + * ACPI: Reintroduce run time configurable max_cstate for !CPU_IDLE case + * core dump: real_parent ppid + * acct: real_parent ppid + * IB/mlx4: Fix value of pkey_index in QP1 completions + * IB/srp: Release transport before removing host + * x86: fix do_fork_idle section mismatch + * spi_bitbang: always grab lock with irqs blocked + * fat: optimize fat_count_free_clusters() + * KEYS: fix macro + * md: fix data corruption when a degraded raid5 array is reshaped + * xip: fix get_zeroed_page with __GFP_HIGHMEM + * eCryptfs: fix dentry handling on create error, unlink, and inode + destroy + * vmcoreinfo: add the array length of "free_list" for filtering free + pages + * dmi-id: fix for __you_cannot_kmalloc_that_much failure + * snd_mixer_oss_build_input(): fix for __you_cannot_kmalloc_that_much + failure with gcc-3.2 + * Fix crash with FLAT_MEMORY and ARCH_PFN_OFFSET != 0 + * hfs: handle more on-disk corruptions without oopsing + * pl2303: Fix mode switching regression + * futex: Prevent stale futex owner when interrupted/timeout + * [NIU]: Fix slowpath interrupt handling. + * [NIU]: Missing ->last_rx update. + * [NIU]: Fix potentially stuck TCP socket send queues. + * [NIU]: Update driver version and release date. + * [IPV4] raw: Strengthen check on validity of iph->ihl + * [IPV4] ipconfig: Fix regression in ip command line processing + * [NET]: Fix netx-eth.c compilation. + * [METH]: Fix MAC address handling. + * [TULIP]: NAPI full quantum bug. + * [ATM]: [nicstar] delay irq setup until card is configured + * [SCTP]: Fix the name of the authentication event. + * [SCTP]: Correctly handle AUTH parameters in unexpected INIT + * [SCTP]: Add back the code that accounted for FORWARD_TSN parameter in + INIT. + * [IRDA]: irda_create() nuke user triggable printk + * b43: Fix rxheader channel parsing + * [NET]: Do not grab device reference when scheduling a NAPI poll. + * [NET]: Add NAPI_STATE_DISABLE. + * [NET]: Do not check netif_running() and carrier state in ->poll() + * ssb: Fix probing of PCI cores if PCI and PCIE core is available + * mac80211: return an error when SIWRATE doesn't match any rate + * [NETXEN]: Fix ->poll() done logic. + * [NET]: Fix drivers to handle napi_disable() disabling interrupts. + * [NET]: Stop polling when napi_disable() is pending. + * [NET]: Make ->poll() breakout consistent in Intel ethernet drivers. + * [NET] Intel ethernet drivers: update MAINTAINERS + * [NET]: kaweth was forgotten in msec switchover of usb_start_wait_urb + * [IPV4] ROUTE: ip_rt_dump() is unecessary slow + * [NET]: Clone the sk_buff 'iif' field in __skb_clone() + * [LRO] Fix lro_mgr->features checks + * [NET]: mcs7830 passes msecs instead of jiffies to usb_control_msg + * [FORCEDETH]: Fix reversing the MAC address on suspend. + * [XFRM]: xfrm_algo_clone() allocates too much memory + * [SOCK]: Adds a rcu_dereference() in sk_filter + * [CONNECTOR]: Don't touch queue dev after decrement of ref count. + * [IPV6]: IPV6_MULTICAST_IF setting is ignored on link-local connect() + * [ATM]: Check IP header validity in mpc_send_packet + * show_task: real_parent + * [SCSI] qla1280: fix 32 bit segment code + * [NIU]: Support for Marvell PHY + * [NEIGH]: Fix race between neigh_parms_release and neightbl_fill_parms + * [IPV4] ROUTE: fix rcu_dereference() uses in /proc/net/rt_cache + * [AX25]: Kill user triggable printks. + * [ARM] pxa: silence warnings from cpu_is_xxx() macros + * [POWERPC] efika: add phy-handle property for fec_mpc52xx + * [ARM] vfp: fix fuitod/fsitod instructions + * [CRYPTO] padlock: Fix alignment fault in aes_crypt_copy + * rt2x00: Allow rt61 to catch up after a missing tx report + * rt2x00: Corectly initialize rt2500usb MAC + * rt2x00: Put 802.11 data on 4 byte boundary + * NFSv4: Give the lock stateid its own sequence queue + * sata_qstor: use hardreset instead of softreset + * libata-sff: PCI IRQ handling fix + * pata_pdc202xx_old: Further fixups + * pata_ixp4xx_cf: fix compilation introduced by ata_port_desc() + conversion + * libata-pmp: 4726 hates SRST + * libata-pmp: propagate timeout to host link + * libata: don't normalize UNKNOWN to NONE after reset + * Update kernel parameter document for libata DMA mode setting knobs. + * sata_sil24: prevent hba lockup when pass-through ATA commands are used + * ide: workaround suspend bug for ACPI IDE + * ide: fix cable detection for SATA bridges + * trm290: do hook dma_host_{on,off} methods (take 2) + * libata and starting/stopping ATAPI floppy devices + * ACPI : Not register gsi for PCI IDE controller in legacy mode + * ACPICA: fix acpi_serialize hang regression + * sh: Force __access_ok() to obey address space limit. + * [AX25] af_ax25: Possible circular locking. + * ACPI: apply quirk_ich6_lpc_acpi to more ICH8 and ICH9 + * [POWERPC] Fix CPU hotplug when using the SLB shadow buffer + * [BLUETOOTH]: rfcomm tty BUG_ON() code fix + * [BLUETOOTH]: Always send explicit hci_ll wake-up acks. + * [DECNET] ROUTE: fix rcu_dereference() uses in /proc/net/decnet_cache + * [VLAN]: nested VLAN: fix lockdep's recursive locking warning + * [MACVLAN]: Prevent nesting macvlan devices + * [NETFILTER]: ip6t_eui64: Fixes calculation of Universal/Local bit + * [NETFILTER]: xt_helper: Do not bypass RCU + * [XFS] fix unaligned access in readdir + * Don't blatt first element of prv in sg_chain() + * loop: fix bad bio_alloc() nr_iovec request + * block: fix blktrace timestamps + * blktrace: kill the unneeded initcall + * V4L/DVB (6999): ivtv: stick to udelay=10 after all + * V4L/DVB (7001): av7110: fix section mismatch + * [MIPS] Wrong CONFIG option prevents setup of DMA zone. + * [MIPS] pnx8xxx: move to clocksource + * [MIPS] Malta: Fix software reset on big endian + * [MIPS] Lasat: Fix built in separate object directory. + * [MIPS] Replace 40c7869b693b18412491fdcff64682215b739f9e kludge + * Pull bugzilla-5637 into release branch + * Pull bugzilla-8171 into release branch + * Pull bugzilla-8973 into release branch + * PM: ACPI and APM must not be enabled at the same time + * Pull bugzilla-9194 into release branch + * Pull bugzilla-9494 into release branch + * Pull bugzilla-9535 into release branch + * Pull bugzilla-9627 into release branch + * Pull bugzilla-9683 into release branch + * IDE: terminate ACPI DMI list + * cache invalidation error for buffered write + * ps3fb: prevent use after free of fb_info + * ps3fb: fix deadlock on kexec() + * [NETFILTER]: bridge: fix double POST_ROUTING invocation + * xircom_cb endianness fixes + * de4x5 fixes + * endianness noise in tulip_core + * netxen: update MAINTAINERS + * netxen: update driver version + * netxen: stop second phy correctly + * netxen: optimize tx handling + * netxen: fix byte-swapping in tx and rx + * 3c509: PnP resource management fix + * Fixed a small typo in the loopback driver + * ip1000: menu location change + * r8169: fix missing loop variable increment + * [usb netdev] asix: fix regression + * fs_enet: check for phydev existence in the ethtool handlers + * Use access mode instead of open flags to determine needed permissions + * sky2: large memory workaround. + * sky2: remove check for PCI wakeup setting from BIOS + * spidernet MAINTAINERship update + * pnpacpi: print resource shortage message only once + * Pull bugzilla-9535 into release branch + * [SPARC]: Make gettimeofday() monotonic again. + * [SPARC64]: Fix build with SPARSEMEM_VMEMMAP disabled. + * remove task_ppid_nr_ns + * knfsd: Allow NFSv2/3 WRITE calls to succeed when krb5i etc is used. + * Input: improve Kconfig help entries for HP Jornada devices + * [TOKENRING]: rif_timer not initialized properly + * modules: de-mutex more symbol lookup paths in the module code + * w1: decrement slave counter only in ->release() callback + * Kick CPUS that might be sleeping in cpus_idle_wait + * TPM: fix suspend and resume failure + * MAINTAINERS: email update and add missing entry + * quicklists: Only consider memory that can be used with GFP_KERNEL + * macintosh: fix fabrication of caplock key events + * scsi/qla2xxx/qla_os.c section fix + * cciss: section mismatch + * advansys: fix section mismatch warning + * hugetlbfs: fix quota leak + * s3c2410fb: fix incorrect argument type in resume function + * CRIS: define __ARCH_WANT_SYS_RT_SIGSUSPEND in unistd.h for CRIS + * CRIS v10: correct do_signal to fix oops and clean up signal handling in + general + * CRIS v10: kernel/time.c needs to include linux/vmstat.h to compile + * uvesafb: fix section mismatch warnings + * CRIS v10: driver for ds1302 needs to include cris-specific i2c.h + * OSS msnd: fix array overflows + * i2c-omap: Fix NULL pointer dereferencing + * i2c: Spelling fixes + * i2c: Driver IDs are optional + * i2c-sibyte: Fix an error path + * fix the "remove task_ppid_nr_ns" commit + * [MIPS] Kconfig fixes for BCM47XX platform + * [MIPS] Cobalt: Fix ethernet interrupts for RaQ1 + * [MIPS] Cobalt: Qube1 has no serial port so don't use it + * [MIPS] Cacheops.h: Fix typo. + * ata_piix: ignore ATA_DMA_ERR on vmware ich4 + * sata_sil24: fix stupid typo + * sata_sil24: freeze on non-dev errors reported via CERR + * libata: relocate sdev->manage_start_stop configuration + * [POWERPC] Fix boot failure on POWER6 + * x86: fix boot crash on HIGHMEM4G && SPARSEMEM + * x86: asm-x86/msr.h: pull in linux/types.h + * x86: fix RTC_AIE with CONFIG_HPET_EMULATE_RTC + * Fix ARM profiling/instrumentation configuration + * Fix Blackfin HARDWARE_PM support + * libata fixes for sparse-found problems + * [libata] pata_bf54x: checkpatch fixes + * [libata] core checkpatch fix + * libata: correct handling of TSS DVD + * [IA64] Fix unaligned handler for floating point instructions with base + update + * Linux 2.6.24-rc8 + * lockdep: fix internal double unlock during self-test + * lockdep: fix workqueue creation API lockdep interaction + * lockdep: more hardirq annotations for notify_die() + * hostap: section mismatch warning + * wireless/libertas support for 88w8385 sdio older revision + * ipw2200: fix typo in kerneldoc + * b43: fix use-after-free rfkill bug + * rt2x00: Fix ieee80211 payload alignment + * sysfs: make sysfs_lookup() return ERR_PTR(-ENOENT) on failed lookup + * sysfs: fix bugs in sysfs_rename/move_dir() + * Use access mode instead of open flags to determine needed permissions + (CVE-2008-0001) + * IB/ipath: Fix receiving UD messages with immediate data + * [NET]: Fix TX timeout regression in Intel drivers. + * [NIU]: Fix 1G PHY link state handling. + * [SPARC64]: Fix hypervisor TLB operation error reporting. + * Input: mousedev - handle mice that use absolute coordinates + * Input: usbtouchscreen - fix buffer overflow, make more egalax work + * Input: psmouse - fix potential memory leak in psmouse_connect() + * Input: psmouse - fix input_dev leak in lifebook driver + * Input: ALPS - fix sync loss on Acer Aspire 5720ZG + * ipg: balance locking in irq handler + * ipg: plug Tx completion leak + * ipg: fix queue stop condition in the xmit handler + * ipg: fix Tx completion irq request + * cpufreq: Initialise default governor before use + * hfs: fix coverity-found null deref + * pnpacpi: print resource shortage message only once (more) + * CRIS v10: vmlinux.lds.S: ix kernel oops on boot and use common defines + * mm: fix section mismatch warning in page_alloc.c + * jbd: do not try lock_acquire after handle made invalid + * alpha: fix conversion from denormal float to double + * #ifdef very expensive debug check in page fault path + * Fix unbalanced helper_lock in kernel/kmod.c + * fix wrong sized spinlock flags argument + * bonding: fix locking in sysfs primary/active selection + * bonding: fix ASSERT_RTNL that produces spurious warnings + * bonding: fix locking during alb failover and slave removal + * bonding: release slaves when master removed via sysfs + * bonding: Fix up parameter parsing + * bonding: fix lock ordering for rtnl and bonding_rwsem + * bonding: Don't hold lock when calling rtnl_unlock + * Documentation: add a guideline for hard_start_xmit method + * atl1: fix frame length bug + * S2io: Fixed synchronization between scheduling of napi with card reset + and close + * dscc4 endian fixes + * wan/lmc bitfields fixes + * sbni endian fixes + * 3c574, 3c515 bitfields abuse + * dl2k: BMCR_t fixes + * dl2k: ANAR, ANLPAR fixes + * dl2k: BMSR fixes + * dl2k: MSCR, MSSR, ESR, PHY_SCR fixes + * dl2k: the rest + * Replace cpmac fix + * [WATCHDOG] Revert "Stop looking for device as soon as one is found" + * [WATCHDOG] clarify watchdog operation in documentation + * x86: add support for the latest Intel processors to Oprofile + * Selecting LGUEST should turn on Guest support, as in 2.6.23. + * ARM: OMAP1: Keymap fix for f-sample and p2-sample + * ARM: OMAP1: Fix compile for board-nokia770 + * pata_pdc202xx_old: Fix crashes with ATAPI + * arch: Ignore arch/i386 and arch/x86_64 + * Remove bogus duplicate CONFIG_LGUEST_GUEST entry. + * [ARM] pxa: don't rely on r2 being preserved over a function call + * [ARM] 4748/1: dca: source drivers/dca/Kconfig in arch/arm/Kconfig to + fix warning + * rfkill: call rfkill_led_trigger_unregister() on error + * [IPV6]: Mischecked tw match in __inet6_check_established. + * [IPV4] fib_hash: fix duplicated route issue + * [IPV4] fib_trie: fix duplicated route issue + * [NET]: Fix interrupt semaphore corruption in Intel drivers. + * [IPV4] FIB_HASH : Avoid unecessary loop in fn_hash_dump_zone() + * [IPV6] ROUTE: Make sending algorithm more friendly with RFC 4861. + * [NETFILTER]: bridge-netfilter: fix net_device refcnt leaks + * [NEIGH]: Revert 'Fix race between neigh_parms_release and + neightbl_fill_parms' + * [IrDA]: af_irda memory leak fixes + * [ATM] atm/idt77105.c: Fix section mismatch. + * [ATM] atm/suni.c: Fix section mismatch. + * [AF_KEY]: Fix skb leak on pfkey_send_migrate() error + * [NET]: rtnl_link: fix use-after-free + * [IPV6]: ICMP6_MIB_OUTMSGS increment duplicated + * [IPV6]: RFC 2011 compatibility broken + * [ICMP]: ICMP_MIB_OUTMSGS increment duplicated + * selinux: fix memory leak in netlabel code + * [MIPS] SMTC: Fix build error. + * [MIPS] Malta: Fix reading the PCI clock frequency on big-endian + * tc35815: Use irq number for tc35815-mac platform device id + * keyspan: fix oops + * hrtimer: fix section mismatch + * timer: fix section mismatch + * CRIS: add missed local_irq_restore call + * s3c2410_fb: fix line length calculation + * Fix filesystem capability support + * sched: group scheduler, set uid share fix + * hwmon: (it87) request only Environment Controller ports + * W1: w1_therm.c ds18b20 decode freezing temperatures correctly + * W1: w1_therm.c is flagging 0C etc as invalid + * rcu: fix section mismatch + * Fix file references in documentation and Kconfig + * x86: GEODE fix a race condition in the MFGPT timer tick + * virtnet: remove double ether_setup + * virtio:simplify-config-mechanism + * virtio: An entropy device, as suggested by hpa. + * virtio: Export vring functions for modules to use + * virtio: Put the virtio under the virtualization menu + * virtio:pci-device + * Fix vring_init/vring_size to take unsigned long + * virtio:vring-kick-when-empty + * virtio:explicit-callback-disable + * virtio:net-flush-queue-on-init + * virtio:net-fix-xmit-skb-free-real + * Parametrize the napi_weight for virtio receive queue. + * Handle module unload Add the device release function. + * Update all status fields on driver unload + * Make virtio modules GPL + * Make virtio_pci license be GPL2+ + * Use Qumranet donated PCI vendor/device IDs + * virtio:more-interrupt-suppression + * Reboot Implemented + * lguest:reboot-fix + * introduce vcpu struct + * adapt lguest launcher to per-cpuness + * initialize vcpu + * per-cpu run guest + * make write() operation smp aware + * make hypercalls use the vcpu struct + * per-vcpu lguest timers + * per-vcpu interrupt processing. + * map_switcher_in_guest() per-vcpu + * make emulate_insn receive a vcpu struct. + * make registers per-vcpu + * replace lguest_arch with lg_cpu_arch. + * per-vcpu lguest task management + * makes special fields be per-vcpu + * make pending notifications per-vcpu + * per-vcpu lguest pgdir management + + -- Tim Gardner Thu, 17 Jan 2008 14:45:01 -0700 + +linux (2.6.24-4.7) hardy; urgency=low + + [Amit Kucheria] + + * Poulsbo: Add SD8686 and 8688 WLAN drivers + * Poulsbo: Mass update of patches to be identical to those on moblin + * SAUCE: make fc transport removal of target configurable OriginalAuthor: + Michael Reed sgi.com> OriginalLocation: + http://thread.gmane.org/gmane.linux.scsi/25318 Bug: 163075 + + [Fabio M. Di Nitto] + + * Fix handling of gcc-4.1 for powerpc and ia64 + + [Tim Gardner] + + * Re-engineered architecture specific linux-headers compiler version + dependencies. + * Doh! Changed header-depends to header_depends. + + -- Tim Gardner Fri, 11 Jan 2008 07:10:46 -0700 + +linux (2.6.24-4.6) hardy; urgency=low + + [Alessio Igor Bogani] + + * Fix -rt build FTBS. + + [Amit Kucheria] + + * LPIACOMPAT: Update thermal patches to be inline with lpia flavour + * Poulsbo: Add USB Controller patch and corresponding config change + + [Fabio M. Di Nitto] + + * Enable aoe and nbd modules on hppa Ignore: yes + * Fix ia64 build by using gcc-4.1 + + [Tim Gardner] + + * Enable JFFS2 LZO compression. + - LP: #178343 + * Remove IS_G33 special handling. + - LP: #174367 + * Enabled CONFIG_SECURITY_CAPABILITIES and + CONFIG_SECURITY_FILE_CAPABILITIES + - LP: #95089 + * Enabled CONFIG_TASKSTATS and CONFIG_TASK_IO_ACCOUNTING + * Turned CONFIG_SECURITY_FILE_CAPABILITIES back off. + * Enabled CONFIG_B43LEGACY=m + * Enabled CONFIG_SCSI_QLOGIC_1280=m + * Enabled CONFIG_FUSION=y for virtual + * USB bluetooth device 0x0e5e:0x6622 floods errors to syslog + - LP: #152689 + * Removed lpia from d-i. + * Added ia64 modules. + * Added hppa32/64 modules. + + [Upstream Kernel Changes] + + * DMI autoload dcdbas on all Dell systems. + * sched: fix gcc warnings + * leds: Fix leds_list_lock locking issues + * leds: Fix locomo LED driver oops + * x86: fix asm-x86/byteorder.h for userspace export + * x86: fix asm-x86/msr.h for user-space export + * fix lguest rmmod "bad pgd" + * slub: provide /proc/slabinfo + * [POWERPC] Fix build failure on Cell when CONFIG_SPU_FS=y + * slub: register slabinfo to procfs + * [SCSI] scsi_sysfs: restore prep_fn when ULD is removed + * Unify /proc/slabinfo configuration + * scsi: revert "[SCSI] Get rid of scsi_cmnd->done" + * restrict reading from /proc//maps to those who share ->mm or can + ptrace pid + * Fix kernel/ptrace.c compile problem (missing "may_attach()") + * hwmon: (w83627ehf) Be more careful when changing VID input level + * NFS: Fix a possible Oops in fs/nfs/super.c + * NFSv4: Fix circular locking dependency in nfs4_kill_renewd + * NFS: add newline to kernel warning message in auth_gss code + * NFSv4: nfs4_open_confirm must not set the open_owner as confirmed on + error + * NFSv4: Fix open_to_lock_owner sequenceid allocation... + * IB/srp: Fix list corruption/oops on module reload + * Console is utf-8 by default + * [IA64] Update Altix BTE error return status patch + * [IA64] Update Altix nofault code + * [X25]: Add missing x25_neigh_put + * [XFRM]: Do not define km_migrate() if !CONFIG_XFRM_MIGRATE + * [CASSINI]: Fix endianness bug. + * [CASSINI]: Revert 'dont touch page_count'. + * [CASSINI]: Program parent Intel31154 bridge when necessary. + * [CASSINI]: Set skb->truesize properly on receive packets. + * [CASSINI]: Fix two obvious NAPI bugs. + * [CASSINI]: Bump driver version and release date. + * [INET]: Fix netdev renaming and inet address labels + * [CONNECTOR]: Return proper error code in cn_call_callback() + * [ISDN] i4l: 'NO CARRIER' message lost after ldisc flush + * [ISDN]: i4l: Fix DLE handling for i4l-audio + * fix: using joysticks in 32 bit applications on 64 bit systems + * hda_intel suspend latency: shorten codec read + * CPU hotplug: fix cpu_is_offline() on !CONFIG_HOTPLUG_CPU + * Linux 2.6.24-rc7 + * PIE executable randomization (upstream cherry pick by kees) + + -- Tim Gardner Fri, 04 Jan 2008 07:15:47 -0700 + +linux (2.6.24-3.5) hardy; urgency=low + + [Alessio Igor Bogani] + + * rt: Fix rt preempt patchset version + * Updated README file for binary custom flavours + * Fix -rt build FTBS. + * rt: Update configuration files + + [Tim Gardner] + + * SAUCE: Add extra headers to linux-libc-dev + + [Upstream Kernel Changes] + + * [WATCHDOG] at32ap700x_wdt: add support for boot status and add fix for + silicon errata + * [WATCHDOG] Stop looking for device as soon as one is found + * [WATCHDOG] bfin_wdt, remove SPIN_LOCK_UNLOCKED + * [WATCHDOG] Sbus: cpwatchdog, remove SPIN_LOCK_UNLOCKED + * [WATCHDOG] IT8212F watchdog driver + * ACPI: acpiphp: Remove dmesg spam on device remove + * [WATCHDOG] ipmi: add the standard watchdog timeout ioctls + * [WATCHDOG] add Nano 7240 driver + * ACPI: battery: fix ACPI battery technology reporting + * [ARM] 4667/1: CM-X270 fixes + * [ARM] 4690/1: PXA: fix CKEN corruption in PXA27x AC97 cold reset code + * [IPV6] XFRM: Fix auditing rt6i_flags; use RTF_xxx flags instead of + RTCF_xxx. + * [IPV4]: Swap the ifa allocation with the"ipv4_devconf_setall" call + * [IPv4] ESP: Discard dummy packets introduced in rfc4303 + * [IPv6] ESP: Discard dummy packets introduced in rfc4303 + * [UM]: Fix use of skb after netif_rx + * [XTENSA]: Fix use of skb after netif_rx + * [S390]: Fix use of skb after netif_rx + * [BNX2]: Add PHY_DIS_EARLY_DAC workaround. + * [BNX2]: Fix RX packet rot. + * [BNX2]: Update version to 1.6.9. + * [NET]: Fix wrong comments for unregister_net* + * [VLAN]: Fix potential race in vlan_cleanup_module vs + vlan_ioctl_handler. + * [IPSEC]: Fix potential dst leak in xfrm_lookup + * V4L/DVB (6485): ivtv: fix compile warning + * V4L/DVB (6540): em28xx: fix failing autodetection after the reboot + * V4L/DVB (6542): Fix S-video mode on tvp5150 + * V4L/DVB (6579): Fix bug #8824: Correct support for Diseqc on tda10086 + * V4L/DVB (6581): Fix: avoids negative vma usage count + * V4L/DVB (6601): V4L: videobuf-core locking fixes and comments + * V4L/DVB (6602): V4L: Convert videobuf drivers to videobuf_stop + * V4L/DVB (6615): V4L: Fix VIDIOCGMBUF locking in saa7146 + * V4L/DVB (6629): zl10353: fix default adc_clock and TRL nominal rate + calculation + * V4L/DVB (6666): saa7134-alsa: fix period handling + * V4L/DVB (6684): Complement va_start() with va_end() + style fixes + * V4L/DVB (6686): saa7134: fix composite over s-video input on the Tevion + MD 9717 + * V4L/DVB (6690): saa7134: fix ignored interrupts + * V4L/DVB (6751): V4L: Memory leak! Fix count in videobuf-vmalloc mmap + * V4L/DVB (6746): saa7134-dvb: fix tuning for WinTV HVR-1110 + * V4L/DVB (6750): Fix in-kernel compilation for cxusb + * V4L/DVB (6733): DVB: Compile 3000MC-specific DIB code only for + CONFIG_DVB_DIB3000MC + * V4L/DVB (6794): Fix compilation when dib3000mc is compiled as a module + * NFS: Fix NFS mountpoint crossing... + * V4L/DVB (6796): ivtv/ section fix + * V4L/DVB (6797): bt8xx/ section fixes + * NFSv2/v3: Fix a memory leak when using -onolock + * V4L/DVB (6609): Re-adds lock safe videobuf_read_start + * i2c: Delete an outdated piece of documentation + * i2c-gpio: Initialize adapter class + * i2c: Add missing spaces in split log messages + * i2c/isp1301_omap: Build fix + * [SERIAL] sparc: Infrastructure to fix section mismatch bugs. + * NFS: Fix an Oops in NFS unmount + * sdhci: describe quirks + * sdhci: don't warn about sdhci 2.0 controllers + * sdhci: use PIO when DMA can't satisfy the request + * sdhci: support JMicron JMB38x chips + * mmc: remove unused 'mode' from the mmc_host structure + * IB/ehca: Return correct number of SGEs for SRQ + * IB/ehca: Serialize HCA-related hCalls if necessary + * ide-scsi: add ide_scsi_hex_dump() helper + * ide: add missing checks for control register existence + * ide: deprecate CONFIG_BLK_DEV_OFFBOARD + * ide: fix ide_scan_pcibus() error message + * ide: coding style fixes for drivers/ide/setup-pci.c + * ide: add /sys/bus/ide/devices/*/{model,firmware,serial} sysfs entries + * ide: DMA reporting and validity checking fixes (take 3) + * ide-cd: remove dead post_transform_command() + * pdc202xx_new: fix Promise TX4 support + * hpt366: fix HPT37x PIO mode timings (take 2) + * ide: remove dead code from __ide_dma_test_irq() + * ide: remove stale changelog from ide-disk.c + * ide: remove stale changelog from ide-probe.c + * ide: fix ->io_32bit race in set_io_32bit() + * MAINTAINERS: update the NFS CLIENT entry + * V4L/DVB (6803): buf-core.c locking fixes + * [SPARC64]: Fix two kernel linear mapping setup bugs. + * IB/ehca: Fix lock flag variable location, bump version number + * kbuild: re-enable Makefile generation in a new O=... directory + * V4L/DVB (6798): saa7134: enable LNA in analog mode for Hauppauge WinTV + HVR-1110 + * V4L/DVB (6814): Makefile: always enter video/ + * V4L/DVB (6819): i2c: fix drivers/media/video/bt866.c + * V4L/DVB (6820): s5h1409: QAM SNR related fixes + * ACPI: video_device_list corruption + * ACPI: fix modpost warnings + * ACPI: thinkpad-acpi: fix lenovo keymap for brightness + * Pull thinkpad-2.6.24 into release branch + * Pull battery-2.6.24 into release branch + * [POWERPC] Fix typo #ifdef -> #ifndef + * [POWERPC] Kill non-existent symbols from ksyms and commproc.h + * [POWRPC] CPM2: Eliminate section mismatch warning in cpm2_reset(). + * [POWERPC] 82xx: mpc8272ads, pq2fads: Update defconfig with + CONFIG_FS_ENET_MDIO_FCC + * [POWERPC] iSeries: don't printk with HV spinlock held + * [POWERPC] Fix rounding bug in emulation for double float operating + * [POWERPC] Make PS3_SYS_MANAGER default y, not m + * [MIPS] time: Set up Cobalt's mips_hpt_frequency + * [MIPS] Alchemy: fix PCI resource conflict + * [MIPS] Alchemy: fix off by two error in __fixup_bigphys_addr() + * [MIPS] Atlas, Malta: Don't free firmware memory on free_initmem. + * [MIPS] PCI: Make pcibios_fixup_device_resources ignore legacy + resources. + * [MIPS] time: Delete weak definition of plat_time_init() due to gcc bug. + * [MIPS] Ensure that ST0_FR is never set on a 32 bit kernel + * [SPARC32]: Silence sparc32 warnings on missing syscalls. + * Pull hotplug into release branch + * ACPI: SBS: Reset alarm bit + * ACPI: SBS: Ignore alarms coming from unknown devices + * ACPI: SBS: Return rate in mW if capacity in mWh + * Pull bugzilla-9362 into release branch + * sky2: RX lockup fix + * sundance fixes + * starfire VLAN fix + * e100: free IRQ to remove warningwhenrebooting + * hamachi endianness fixes + * drivers/net/sis190.c section fix + * drivers/net/s2io.c section fixes + * ucc_geth: minor whitespace fix + * net: smc911x: shut up compiler warnings + * Net: ibm_newemac, remove SPIN_LOCK_UNLOCKED + * ixgb: make sure jumbos stay enabled after reset + * [NETFILTER]: ctnetlink: set expected bit for related conntracks + * [NETFILTER]: ip_tables: fix compat copy race + * [XFRM]: Display the audited SPI value in host byte order. + * [NETFILTER]: xt_hashlimit should use time_after_eq() + * [TIPC]: Fix semaphore handling. + * [SYNCPPP]: Endianness and 64bit fixes. + * [NETFILTER]: bridge: fix missing link layer headers on outgoing routed + packets + * [ATM]: Fix compiler warning noise with FORE200E driver + * [IPV4]: Updates to nfsroot documentation + * [BRIDGE]: Assign random address. + * [IPV6]: Fix the return value of ipv6_getsockopt + * [IPV4]: Make tcp_input_metrics() get minimum RTO via tcp_rto_min() + * [AX25]: Locking dependencies fix in ax25_disconnect(). + * [SCTP]: Flush fragment queue when exiting partial delivery. + * [IRDA]: Race between open and disconnect in irda-usb. + * [IRDA]: mcs7780 needs to free allocated rx buffer. + * [IRDA]: irlmp_unregister_link() needs to free lsaps. + * [IRDA]: stir4200 fixes. + * [IRDA]: irda parameters warning fixes. + * [S390] pud_present/pmd_present bug. + * [ARM] 4710/1: Fix coprocessor 14 usage for debug messages via ICEDCC + * [ARM] 4694/1: IXP4xx: Update clockevent support for shutdown and resume + * kobject: fix the documentation of how kobject_set_name works + * tipar: remove obsolete module + * HOWTO: Change man-page maintainer address for Japanese HOWTO + * Add Documentation for FAIR_USER_SCHED sysfs files + * HOWTO: change addresses of maintainer and lxr url for Korean HOWTO + * add stable_api_nonsense.txt in korean + * HOWTO: update misspelling and word incorrected + * PCI: Restore PCI expansion ROM P2P prefetch window creation + * USB: sierra: fix product id + * usb-storage: Fix devices that cannot handle 32k transfers + * USB: cp2101: new device id + * USB: option: Bind to the correct interface of the Huawei E220 + * usb.h: fix kernel-doc warning + * USB: fix locking loop by avoiding flush_scheduled_work + * USB: use IRQF_DISABLED for HCD interrupt handlers + * USB: at91_udc: correct hanging while disconnecting usb cable + * usb: Remove broken optimisation in OHCI IRQ handler + * USB: revert portions of "UNUSUAL_DEV: Sync up some reported devices + from Ubuntu" + * ocfs2: fix exit-while-locked bug in ocfs2_queue_orphans() + * ocfs2: Don't panic when truncating an empty extent + * ocfs2: Allow for debugging of transaction extends + * ocfs2: Re-journal buffers after transaction extend + * pcnet_cs: add new id + * ucc_geth: really fix section mismatch + * sis190 endianness + * libertas: add Dan Williams as maintainer + * zd1211rw: Fix alignment problems + * wireless/ipw2200.c: add __dev{init,exit} annotations + * ieee80211_rate: missed unlock + * iwlwifi3945/4965: fix rate control algo reference leak + * libertas: select WIRELESS_EXT + * bcm43xx_debugfs sscanf fix + * b43: Fix rfkill radio LED + * iwlwifi: fix rf_kill state inconsistent during suspend and resume + * sata_sil: fix spurious IRQ handling + * libata: clear link->eh_info.serror from ata_std_postreset() + * libata: add ST3160023AS / 3.42 to NCQ blacklist + * sata_mv: improve warnings about Highpoint RocketRAID 23xx cards + * libata-acpi: adjust constness in ata_acpi_gtm/stm() parameters + * libata: update ata_*_printk() macros such that level can be a variable + * libata: add more opcodes to ata.h + * libata: ata_dev_disable() should be called from EH context + * libata-acpi: add new hooks ata_acpi_dissociate() and + ata_acpi_on_disable() + * libata-acpi: implement and use ata_acpi_init_gtm() + * libata-acpi: implement dev->gtf_cache and evaluate _GTF right after + _STM during resume + * libata-acpi: improve ACPI disabling + * libata-acpi: improve _GTF execution error handling and reporting + * libata-acpi: implement _GTF command filtering + * libata: update atapi_eh_request_sense() such that lbam/lbah contains + buffer size + * libata: fix ATAPI draining + * fix headers_install + * revert "Hibernation: Use temporary page tables for kernel text mapping + on x86_64" + * uml: stop gdb from deleting breakpoints when running UML + * alpha: strncpy/strncat fixes + * rtc-at32ap700x: fix irq init oops + * parport: "dev->timeslice" is an unsigned long, not an int + * ecryptfs: initialize new auth_tokens before teardown + * Fix lguest documentation + * sparsemem: make SPARSEMEM_VMEMMAP selectable + * fs/Kconfig: grammar fix + * ext3, ext4: avoid divide by zero + * alpha: build fixes + * cpufreq: fix missing unlocks in cpufreq_add_dev error paths. + * mm/sparse.c: check the return value of sparse_index_alloc() + * mm/sparse.c: improve the error handling for sparse_add_one_section() + * pktcdvd: add kobject_put when kobject register fails + * drivers/macintosh/via-pmu.c: Added a missing iounmap + * drivers/cpufreq/cpufreq_stats.c section fix + * apm_event{,info}_t are userspace types + * mm: fix page allocation for larger I/O segments + * ecryptfs: set s_blocksize from lower fs in sb + * I/OAT: fixups from code comments + * I/OAT: fix null device in call to dev_err() + * fix bloat-o-meter for ppc64 + * ecryptfs: fix fsx data corruption problems + * Documentation: update hugetlb information + * Fix compilation warning in dquot.c + * SLUB: remove useless masking of GFP_ZERO + * quicklist: Set tlb->need_flush if pages are remaining in quicklist 0 + * sysctl: fix ax25 checks + * [XFS] Don't wait for pending I/Os when purging blocks beyond eof. + * [XFS] Put the correct offset in dirent d_off + * block: use jiffies conversion functions in scsi_ioctl.c + * as-iosched: fix incorrect comments + * as-iosched: fix write batch start point + * block: let elv_register() return void + * Cleanup umem driver: fix most checkpatch warnings, conform to kernel + * sched: fix crash on ia64, introduce task_current() + * sched: mark rwsem functions as __sched for wchan/profiling + * sched: sysctl, proc_dointvec_minmax() expects int values for + * sched: touch softlockup watchdog after idling + * sched: do not hurt SCHED_BATCH on wakeup + * oprofile: op_model_athlon.c support for AMD family 10h barcelona + performance counters + * clockevents: fix reprogramming decision in oneshot broadcast + * genirq: add unlocked version of set_irq_handler() + * timer: kernel/timer.c section fixes + * x86: jprobe bugfix + * x86: kprobes bugfix + * x86: also define AT_VECTOR_SIZE_ARCH + * genirq: revert lazy irq disable for simple irqs + * x86: fix "Kernel panic - not syncing: IO-APIC + timer doesn't work!" + * [SCSI] sym53c8xx: fix free_irq() regression + * [SCSI] dpt_i2o: driver is only 32 bit so don't set 64 bit DMA mask + * [SCSI] sym53c8xx: fix "irq X: nobody cared" regression + * [SCSI] initio: fix conflict when loading driver + * [SCSI] st: fix kernel BUG at include/linux/scatterlist.h:59! + * [SCSI] initio: bugfix for accessors patch + * IA64: Slim down __clear_bit_unlock + * [IA64] signal: remove redundant code in setup_sigcontext() + * [IA64] ia32 nopage + * [IA64] Avoid unnecessary TLB flushes when allocating memory + * [IA64] Two trivial spelling fixes + * [IA64] print kernel release in OOPS to make kerneloops.org happy + * [IA64] set_thread_area fails in IA32 chroot + * [IA64] Remove compiler warinings about uninitialized variable in + irq_ia64.c + * [IA64] Remove assembler warnings on head.S + * [IA64] Fix Altix BTE error return status + * [IA64] Guard elfcorehdr_addr with #if CONFIG_PROC_FS + * [IA64] make flush_tlb_kernel_range() an inline function + * [IA64] Adjust CMCI mask on CPU hotplug + * Do dirty page accounting when removing a page from the page cache + * x86 apic_32.c section fix + * x86 smpboot_32.c section fixes + * x86_32: select_idle_routine() must be __cpuinit + * x86_32: disable_pse must be __cpuinitdata + * x86: fix show cpuinfo cpu number always zero + * ps3fb: Update for firmware 2.10 + * ps3fb: Fix ps3fb free_irq() dev_id + * pata_hpt37x: Fix HPT374 detection + * mac80211: Drop out of associated state if link is lost + * mac80211: fix header ops + * NET: mac80211: fix inappropriate memory freeing + * [TG3]: Endianness annotations. + * [TG3]: Endianness bugfix. + * rtl8187: Add USB ID for Sitecom WL-168 v1 001 + * p54: add Kconfig description + * iwlwifi: fix possible priv->mutex deadlock during suspend + * ipw2200: prevent alloc of unspecified size on stack + * [IPV4] ARP: Remove not used code + * [IPSEC]: Avoid undefined shift operation when testing algorithm ID + * [XFRM]: Audit function arguments misordered + * [IPV4] ip_gre: set mac_header correctly in receive path + * [NET]: Correct two mistaken skb_reset_mac_header() conversions. + * [SPARC64]: Fix OOPS in dma_sync_*_for_device() + * sched: rt: account the cpu time during the tick + * debug: add end-of-oops marker + * mm: fix exit_mmap BUG() on a.out binary exit + * dm: table detect io beyond device + * dm mpath: hp requires scsi + * dm crypt: fix write endio + * dm: trigger change uevent on rename + * dm: merge max_hw_sector + * dm crypt: use bio_add_page + * [SPARC64]: Spelling fixes + * [SPARC32]: Spelling fixes + * [NET] include/net/: Spelling fixes + * [DCCP]: Spelling fixes + * [IRDA]: Spelling fixes + * [IPV6]: Spelling fixes + * [NET] net/core/: Spelling fixes + * [PKT_SCHED]: Spelling fixes + * [NETLABEL]: Spelling fixes + * [SCTP]: Spelling fixes + * [NETFILTER]: Spelling fixes + * [NETFILTER] ipv4: Spelling fixes + * [ATM]: Spelling fixes + * [NET]: Fix function put_cmsg() which may cause usr application memory + overflow + * x86: fix die() to not be preemptible + * x86: intel_cacheinfo.c: cpu cache info entry for Intel Tolapai + * [XFS] Fix mknod regression + * [XFS] Initialise current offset in xfs_file_readdir correctly + * Linux 2.6.24-rc6 + * [IPV4]: OOPS with NETLINK_FIB_LOOKUP netlink socket + * SLUB: Improve hackbench speed + * typhoon: endianness bug in tx/rx byte counters + * typhoon: missing le32_to_cpu() in get_drvinfo + * typhoon: set_settings broken on big-endian + * typhoon: missed rx overruns on big-endian + * typhoon: memory corruptor on big-endian if TSO is enabled + * typhoon: trivial endianness annotations + * cycx: annotations and fixes (.24 fodder?) + * asix fixes + * yellowfin: annotations and fixes (.24 fodder?) + * dl2k endianness fixes (.24 fodder?) + * r8169 endianness + * rrunner: use offsetof() instead of homegrown insanity + * 3c574 and 3c589 endianness fixes (.24?) + * fec_mpc52xx: write in C... + * 3c359 endianness annotations and fixes + * MACB: clear transmit buffers properly on transmit underrun + * UIO: Add a MAINTAINERS entry for Userspace I/O + * Modules: fix memory leak of module names + * USB: Unbreak fsl_usb2_udc + * USB: VID/PID update for sierra + * USB: New device ID for the CP2101 driver + * quicklists: do not release off node pages early + * ecryptfs: fix string overflow on long cipher names + * Fix computation of SKB size for quota messages + * Don't send quota messages repeatedly when hardlimit reached + * ecryptfs: fix unlocking in error paths + * ecryptfs: redo dget,mntget on dentry_open failure + * MAINTAINERS: mailing list archives are web links + * ps3: vuart: fix error path locking + * lib: proportion: fix underflow in prop_norm_percpu() + * pcmcia: remove pxa2xx_lubbock build warning + * kconfig: obey KCONFIG_ALLCONFIG choices with randconfig. + * tty: fix logic change introduced by wait_event_interruptible_timeout() + * uml: user of helper_wait() got missed when it got extra arguments + * V4L/DVB (6871): Kconfig: VIDEO_CX23885 must select DVB_LGDT330X + * V4L/DVB (6876): ivtv: mspx4xx needs a longer i2c udelay + * drivers/ide/: Spelling fixes + * ide-cd: fix SAMSUNG CD-ROM SCR-3231 quirk + * ide-cd: fix ACER/AOpen 24X CDROM speed reporting on big-endian machines + * ide-cd: use ide_cd_release() in ide_cd_probe() + * ide-cd: fix error messages in cdrom_{read,write}_check_ireason() + * ide-cd: add missing 'ireason' masking to cdrom_write_intr() + * ide-cd: fix error messages in cdrom_write_intr() + * ide-cd: add error message for DMA error to cdrom_read_intr() + * ide-cd: fix error message in cdrom_pc_intr() + * ide-cd: fix 'ireason' reporting in cdrom_pc_intr() + * MAINTAINERS: update ide-cd entry + * [SPARC64]: Implement pci_resource_to_user() + * mac80211: round station cleanup timer + * mac80211: warn when receiving frames with unaligned data + * [NETFILTER]: nf_conntrack_ipv4: fix module parameter compatibility + * [TUNTAP]: Fix wrong debug message. + * [NET] tc_nat: header install + * [VETH]: move veth.h to include/linux + * [IPV4]: Fix ip command line processing. + * Revert quicklist need->flush fix + * [CRYPTO] padlock: Fix spurious ECB page fault + * [POWERPC] Oprofile: Remove dependency on spufs module + * [POWERPC] PS3: Fix printing of os-area magic numbers + * [PCI] Do not enable CRS Software Visibility by default + * [IPV4] Fix ip=dhcp regression + * [SERIAL]: Fix section mismatches in Sun serial console drivers. + * [TCP]: use non-delayed ACK for congestion control RTT + * [BLUETOOTH]: put_device before device_del fix + + -- Tim Gardner Sat, 22 Dec 2007 15:16:11 -0700 + +linux (2.6.24-2.4) hardy; urgency=low + + [Alessio Igor Bogani] + + * rt: First import for Hardy + + [Amit Kucheria] + + * LPIA: Fix FTBFS for hda + * LPIA: Trim configs including disabling stock DRM + + [Tim Gardner] + + * SAUCE: Increase CONFIG_IDE_MAX_HWIFS to 8 (from 4) + - LP: #157909 + Then reverted since it causes an ABI bump. Will pick it up + again when next the ABI changes. + * Expose apm for applications. + + -- Tim Gardner Wed, 19 Dec 2007 13:17:31 -0700 + +linux (2.6.24-2.3) hardy; urgency=low + + [Amit Kucheria] + + * LPIA: Add thermal framework from Intel + * LPIA: Poulsbo-specific patches + * LPIA: Add thermal framework from Intel + + [Tim Gardner] + + * SAUCE: hdaps module does not load on Thinkpad T61P + - LP: #133636 + + [Upstream Kernel Changes] + + * Rebased against 2.6.24-rc5 + + -- Tim Gardner Wed, 12 Dec 2007 13:58:52 -0700 + +linux (2.6.24-1.2) hardy; urgency=low + + [Ben Collins] + + * cell: Remove cell custom flavour, merged upstream + * apparmor: Added module from SVN repo + * ubuntu: Update configs to enable apparmor + * ubuntu/configs: Disable vga type framebuffers on hppa32. Fixes FTBFS + + [Tim Gardner] + + * Add support for PPA builds. + + [Upstream Kernel Changes] + + * [SPARC64] Export symbols for sunvnet and sunvdc to be built modular + + -- Ben Collins Fri, 07 Dec 2007 15:18:32 -0500 + +linux (2.6.24-1.1) hardy; urgency=low + + [Ben Collins] + + * ubuntu: Disable custom binary flavours for now + * ubuntu: Remove cruft in headers-postinst + * ubuntu: Set skipabi/skipmodule to true if prev_revions == 0.0 + * ubuntu: Do not fail on missing module lists when skipmodule is set + * ubuntu: capability.ko is built-in now, no need to place in initrd. + * ubuntu: Change to "linux" instead of "linux-source-2.6.x" + * d-i: cdrom-modules disappeared, and sha256/aes modules renamed. + * ubuntu-build: Add asm_link= to arch rules, and use them + * config: Re-enable snd-hda-intel + + -- Ben Collins Wed, 28 Nov 2007 12:58:37 -0500 + +linux-source-2.6.22 (2.6.22-14.46) gutsy; urgency=low + + [Upstream Kernel Changes] + + * [SPARC64]: Fix bugs in SYSV IPC handling in 64-bit processes. + + -- Kyle McMartin Sun, 14 Oct 2007 20:30:09 +0000 + +linux-source-2.6.22 (2.6.22-14.45) gutsy; urgency=low + + [Upstream Kernel Changes] + + * [SPARC64]: Fix register usage in xor_raid_4(). + + -- Kyle McMartin Sun, 14 Oct 2007 12:34:44 -0400 + +linux-source-2.6.22 (2.6.22-14.44) gutsy; urgency=low + + [Kyle McMartin] + + * Revert "sparc wants ehci built in" + + [Upstream Kernel Changes] + + * Revert "[PATCH]: Gutsy OHCI hang workaround for Huron" + * [USB]: Serialize EHCI CF initialization. + + -- Kyle McMartin Sun, 14 Oct 2007 16:25:51 +0000 + +linux-source-2.6.22 (2.6.22-14.43) gutsy; urgency=low + + [Kyle McMartin] + + * sparc wants ehci built in + + -- Kyle McMartin Tue, 09 Oct 2007 20:07:58 +0000 + +linux-source-2.6.22 (2.6.22-14.42) gutsy; urgency=low + + [Kyle McMartin] + + * fix up module-check to bail early if asked to ignore modules + * disable kernel DRM on lpia (we provide one in lum) + - LP: #145168 + * add ignore for ia64 abi too + + [Upstream Kernel Changes] + + * [NIU]: Use netif_msg_*(). + * [NIU]: Use pr_info(). + * [NIU]: Remove redundant BUILD_BUG_ON() in __niu_wait_bits_clear(). + * [NIU]: Remove BUG_ON() NULL pointer checks. + * [NIU]: Use dev_err(). + * [NIU]: Fix x86_64 build failure. + * [NIU]: Use linux/io.h instead of asm/io.h + * [NIU]: Fix some checkpatch caught coding style issues. + * [NIU]: Fix shadowed local variables. + * [NIU]: Fix locking errors in link_status_10g(). + * [NIU]: Document a few magic constants using comments. + * [NIU]: MII phy handling fixes. + * [NIU]: Make sure link_up status is set to something in + link_status_{1,10}g(). + * [PATCH]: Gutsy OHCI hang workaround for Huron + + -- Kyle McMartin Tue, 09 Oct 2007 17:25:06 +0000 + +linux-source-2.6.22 (2.6.22-14.41) gutsy; urgency=low + + [Ben Collins] + + * ubuntu/d-i: Add niu to nic-modules + + [Kyle McMartin] + + * vesafb is not for ia64 + * remove CONFIG_NIU from places it shouldn't be + * fix orinoco_cs oops + - LP: #149997 + + [Upstream Kernel Changes] + + * [SPARC64]: Allow userspace to get at the machine description. + * [SPARC64]: Niagara-2 optimized copies. + * [SPARC64]: Do not touch %tick_cmpr on sun4v cpus. + * [SPARC64]: SMP trampoline needs to avoid %tick_cmpr on sun4v too. + * [SPARC64]: Create a HWCAP_SPARC_N2 and report it to userspace on + Niagara-2. + * [MATH-EMU]: Fix underflow exception reporting. + * [SPARC64]: Need to clobber global reg vars in switch_to(). + * [MATH]: Fix typo in FP_TRAPPING_EXCEPTIONS default setting. + * [SUNVDC]: Use slice 0xff on VD_DISK_TYPE_DISK. + * [SPARC64]: Fix type and constant sizes wrt. sun4u IMAP/ICLR handling. + * [SPARC64]: Enable MSI on sun4u Fire PCI-E controllers. + * [SPARC64]: Fix several bugs in MSI handling. + * [SPARC64]: Fix booting on V100 systems. + * [SPARC64]: Fix lockdep, particularly on SMP. + * [SPARC64]: Warn user if cpu is ignored. + * [SUNSAB]: Fix several bugs. + * [SUNSAB]: Fix broken SYSRQ. + * [SPARC64]: Fix missing load-twin usage in Niagara-1 memcpy. + * [SPARC64]: Don't use in/local regs for ldx/stx data in N1 memcpy. + * [SPARC64]: Fix domain-services port probing. + * [SPARC64]: VIO device addition log message level is too high. + * [SPARC64]: check fork_idle() error + * [SPARC64]: Fix 'niu' complex IRQ probing. + * [NIU]: Add Sun Neptune ethernet driver. + + -- Kyle McMartin Tue, 09 Oct 2007 00:38:16 +0000 + +linux-source-2.6.22 (2.6.22-13.40) gutsy; urgency=low + + [Amit Kucheria] + + * Enable CONFIG_VM86 for LPIA + - LP: #146311 + * Update configuration files + * Disable MSI by default + * Add mmconf documentation + * Update configuration files + + [Bartlomiej Zolnierkiewicz] + + * ide-disk: workaround for buggy HPA support on ST340823A (take 3) + - LP: #26119 + + [Ben Collins] + + * ubuntu/cell: Fixup ps3 related modules for d-i, enable RTAS console + * ubuntu/cell: Enable CELLEB and related modules (pata_scc) + * ubuntu/cell: Move ps3rom to storage-core. Also use spidernet, not + spider_net. + * ubuntu/cell: Set PS3_MANAGER=y + * ubuntu: Set NR_CPUS=256 for sparc64-smp + + [Chuck Short] + + * [USB] USB] Support for MediaTek MT6227 in cdc-acm. + - LP: #134123 + * [XEN] Fix xen vif create with more than 14 guests. + - LP: #14486 + + [Jorge Juan Chico] + + * ide: ST320413A has the same problem as ST340823A + - LP: #26119 + + [Kyle McMartin] + + * fix -rt build + * fix ia32entry-xen.S for CVE-2007-4573 + * fix build when CONFIG_PCI_MSI is not set + + [Matthew Garrett] + + * hostap: send events on data interface as well as master interface + - LP: #57146 + * A malformed _GTF object should not prevent ATA device recovery + - LP: #139079 + * hostap: send events on data interface as well as master interface + - LP: #57146 + * A malformed _GTF object should not prevent ATA device recovery + - LP: #139079 + * Don't lose appletouch button release events + * Fix build with appletouch change + * Disable Thinkpad backlight support on machines with ACPI video + - LP: #148055 + * Don't attempt to register a callback if there is no CMOS object + - LP: #145857 + * Update ACPI bay hotswap code to support locking + - LP: #148219 + * Update ACPI bay hotswap code to support locking + - LP: #148219 + * Don't attempt to register a callback if there is no CMOS object + - LP: #145857 + * Disable Thinkpad backlight support on machines with ACPI video + - LP: #148055 + + [Steffen Klassert] + + * 3c59x: fix duplex configuration + - LP: #94186 + + [Thomas Gleixner] + + * clockevents: remove the suspend/resume workaround^Wthinko + + [Tim Gardner] + + * orinoco_cs.ko missing + - LP: #125832 + * Marvell Technology ethernet card not recognized and not operational + - LP: #135316 + * Marvell Technology ethernet card not recognized and not operational + - LP: #135316 + * acpi_scan_rsdp() breaks some PCs by not honouring ACPI specification + - LP: #144336 + * VIA southbridge Intel id missing + - LP: #128289 + * Add T-Sinus 111card to hostap_cs driver to be able to upload firmware + - LP: #132466 + * RTL8111 PCI Express Gigabit driver r8169 big files produce slow file + transfer + - LP: #114171 + * Guest OS does not recognize a lun with non zero target id on Vmware ESX + Server + - LP: #140761 + * Modualrize vesafb + - LP: #139505 + * Nikon cameras need support in unusual_devs.h + - LP: #134477 + * agp for i830m broken in gutsy + - LP: #139767 + * hdaps: Added support for Thinkpad T61 + - LP: #147383 + * xen: Update config for i386 + - LP: #139047 + * xen: resync for amd64 + - LP: #139047 + * ide-disk: workaround for buggy HPA support on ST340823A (take 4) + - LP: #26119 + + [Upstream Kernel Changes] + + * Convert snd-page-alloc proc file to use seq_file (CVE-2007-4571) + * Linux 2.6.22.8 + * ACPI: disable lower idle C-states across suspend/resume + * V4L: ivtv: fix VIDIOC_S_FBUF: new OSD values were never set + * DVB: get_dvb_firmware: update script for new location of sp8870 + firmware + * DVB: get_dvb_firmware: update script for new location of tda10046 + firmware + * DVB: b2c2-flexcop: fix Airstar HD5000 tuning regression + * setpgid(child) fails if the child was forked by sub-thread + * sigqueue_free: fix the race with collect_signal() + * kconfig: oldconfig shall not set symbols if it does not need to + * MTD: Makefile fix for mtdsuper + * USB: fix linked list insertion bugfix for usb core + * ACPI: Validate XSDT, use RSDT if XSDT fails + * POWERPC: Flush registers to proper task context + * 3w-9xxx: Fix dma mask setting + * MTD: Initialise s_flags in get_sb_mtd_aux() + * JFFS2: fix write deadlock regression + * V4L: cx88: Avoid a NULL pointer dereference during mpeg_open() + * hwmon: End of I/O region off-by-one + * Fix debug regression in video/pwc + * splice: fix direct splice error handling + * rpc: fix garbage in printk in svc_tcp_accept() + * disable sys_timerfd() + * afs: mntput called before dput + * Fix DAC960 driver on machines which don't support 64-bit DMA + * Fix "Fix DAC960 driver on machines which don't support 64-bit DMA" + * firewire: fw-ohci: ignore failure of pci_set_power_state (fix suspend + regression) + * futex_compat: fix list traversal bugs + * Leases can be hidden by flocks + * ext34: ensure do_split leaves enough free space in both blocks + * nfs: fix oops re sysctls and V4 support + * dir_index: error out instead of BUG on corrupt dx dirs + * ieee1394: ohci1394: fix initialization if built non-modular + * Correctly close old nfsd/lockd sockets. + * Fix race with shared tag queue maps + * crypto: blkcipher_get_spot() handling of buffer at end of page + * fix realtek phy id in forcedeth + * Fix decnet device address listing. + * Fix device address listing for ipv4. + * Fix inet_diag OOPS. + * Fix IPV6 append OOPS. + * Fix IPSEC AH4 options handling + * Fix ipv6 double-sock-release with MSG_CONFIRM + * Fix IPV6 DAD handling + * Fix ipv6 source address handling. + * Fix oops in vlan and bridging code + * Fix tc_ematch kbuild + * Handle snd_una in tcp_cwnd_down() + * Fix TCP DSACK cwnd handling + * Fix datagram recvmsg NULL iov handling regression. + * Fix pktgen src_mac handling. + * Fix sparc64 v100 platform booting. + * bcm43xx: Fix cancellation of work queue crashes + * Linux 2.6.22.9 + * usb: serial/pl2303: support for BenQ Siemens Mobile Phone EF81 + * pata_it821x: fix lost interrupt with atapi devices + * i915: make vbl interrupts work properly on i965g/gm hw. + + -- Kyle McMartin Thu, 04 Oct 2007 13:57:53 +0000 + +linux-source-2.6.22 (2.6.22-12.39) gutsy; urgency=low + + [Ben Collins] + + * ubuntu: Re-order deps so that binary-custom is done before + binary-udebs. Fixes ppc build + + [Upstream Kernel Changes] + + * x86_64: Zero extend all registers after ptrace in 32bit entry path. + * Linux 2.6.22.7 + + -- Ben Collins Sun, 23 Sep 2007 11:05:32 -0400 + +linux-source-2.6.22 (2.6.22-12.38) gutsy; urgency=low + + [Kyle McMartin] + + * add -12 abi files + * update getabis for new flavours + + -- Kyle McMartin Fri, 21 Sep 2007 13:35:49 -0400 + +linux-source-2.6.22 (2.6.22-12.37) gutsy; urgency=low + + [Kyle McMartin] + + * enable d-i for cell flavour + * ignore ABI check on all hppa flavours + + -- Kyle McMartin Fri, 21 Sep 2007 11:28:34 -0400 + +linux-source-2.6.22 (2.6.22-12.36) gutsy; urgency=low + + [Ben Collins] + + * ABI bump due to LED support being enabled. + + [Kyle McMartin] + + * fix memory leak in psparse.c + - Bug introduced in previous commit to acpi + + [Upstream Kernel Changes] + + * Ubuntu: Allocate acpi_devices structure rather than leaving it on the + stack. + * ipw2100: Fix `iwpriv set_power` error + * Fix ipw2200 set wrong power parameter causing firmware error + * [SCSI] Fix async scanning double-add problems + - LP: #110997 + + -- Ben Collins Thu, 20 Sep 2007 11:34:52 -0400 + +linux-source-2.6.22 (2.6.22-11.34) gutsy; urgency=low + + [Alan Stern] + + * USB: disable autosuspend by default for non-hubs + - LP: #85488 + + [Ben Collins] + + * ubuntu: Enable LEDS_TRIGGERS and related options + - Needed for iwlwifi + * ubuntu: Add real ABI files for virtual flavour + * ubuntu: Re-enable missing CONFIG_SERPENT for hppa64 + - Noticed by Lamont + * ubuntu: Add linux-headers postinst to handle hooks + - LP: #125816 + * ubuntu: Add support for /etc/kernel/headers_postinst.d/ to + headers-postinst + - LP: #120049 + * cell: Add binary-custom flavour "cell" to support ps3 + + [Mattia Dongili] + + * sony-laptop: restore the last user requested brightness level on + resume. + - LP: #117331 + + [Tejun Heo] + + * ata_piix: fix suspend/resume for some TOSHIBA laptops + - LP: #139045 + * PCI: export __pci_reenable_device() + - needed for ata_piix change + + [Tim Gardner] + + * Enable Sierra Wireless MC8775 0x6813 + - LP: #131167 + + [Zhang Rui] + + * ACPI: work around duplicate name "VID" problem on T61 + - Noted by mjg59 + + -- Ben Collins Sun, 16 Sep 2007 22:31:47 -0400 + +linux-source-2.6.22 (2.6.22-11.33) gutsy; urgency=low + + [Alessio Igor Bogani] + + * rt: Update to rt9 + * rt: Update configuration files + + [Ben Collins] + + * ubuntu: Enable A100 driver + - LP: #138632 + * libata: Default to hpa being overridden + + [Chuck Short] + + * [HDAPS] Add support for Thinkpad R61. + * [LIBATA] Add more hard drives to blacklist. + * [USB] Added support for Sprint Pantech PX-500. + * [XEN] No really enable amd64. + * [XEN] Fix amd64 yet again. + + [Matthew Garrett] + + * alter default behaviour of ACPI video module + * Add infrastructure for notification on ACPI method execution + * Get thinkpad_acpi to send notifications on CMOS updates + * Add support to libata-acpi for acpi-based bay hotplug + + [Phillip Lougher] + + * Add kernel flavour optimised for virtualised environments + * Change abi-check script to check for $flavour.ignore in previous abi + * Disable abi and module check for virtual flavour + + [Richard Hughes] + + * Refresh laptop lid status on resume + + [Upstream Kernel Changes] + + * [pata_marvell]: Add more identifiers + + -- Ben Collins Sun, 16 Sep 2007 22:13:08 -0400 + +linux-source-2.6.22 (2.6.22-11.32) gutsy; urgency=low + + [Amit Kucheria] + + * Build system: Allow custom builds to comprise multiple patches + * Move UME to a Custom build and add first setup of thermal framework + + [Ben Collins] + + * ubuntu: Enable CONFIG_BLK_DEV_IO_TRACE + * bcm203x: Fix firmware loading + - LP: #85247 + * ubuntu: mtd changes caused module renaming. Ignore + * rt: Do not patch top level Makefile for SUBLEVEL. Will always end up + breaking + + [Chuck Short] + + * [USB] Unusual Device support for Gold MP3 Player Energy + - LP: #125250 + * [SIERRA] Adds support for Onda H600 ZTE MF330 + - LP: #129433 + * [HDAPS] Add Thinkpad T61P to whitelist. + - LP: #133636 + * [USB] Add support for Toshiba (Novatel Wireless) HSDPA for M400. + - LP: #133650 + + [Kyle McMartin] + + * apparmor 10.3 hooks + * unionfs 2.1 hooks + * nuke UNION_FS stuff from fs/{Kconfig,Makefile} + + [Tim Gardner] + + * Paravirt-ops I/O hypercalls + * Fix lazy vmalloc bug for Gutsy + * bluetooth headset patch + - LP: #130870 + * Add the PCI ID of this ICH4 in list of laptops that use short cables. + * v2.6.22.5 merge + * Update Xen config options. + - LP: #132726 + * Remove mtd modules from ABI + * Support parallel= in DEB_BUILD_OPTIONS + - LP: #136426 + + [Upstream Kernel Changes] + + * hwmon: fix w83781d temp sensor type setting + * hwmon: (smsc47m1) restore missing name attribute + * sky2: restore workarounds for lost interrupts + * sky2: carrier management + * sky2: check for more work before leaving NAPI + * sky2: check drop truncated packets + * revert "x86, serial: convert legacy COM ports to platform devices" + * ACPICA: Fixed possible corruption of global GPE list + * ACPICA: Clear reserved fields for incoming ACPI 1.0 FADTs + * AVR32: Fix atomic_add_unless() and atomic_sub_unless() + * r8169: avoid needless NAPI poll scheduling + * forcedeth: fix random hang in forcedeth driver when using netconsole + * libata: add ATI SB700 device IDs to AHCI driver + * Hibernation: do not try to mark invalid PFNs as nosave + * i386: allow debuggers to access the vsyscall page with compat vDSO + * x86_64: Check for .cfi_rel_offset in CFI probe + * x86_64: Change PMDS invocation to single macro + * i386: Handle P6s without performance counters in nmi watchdog + * i386: Fix double fault handler + * JFFS2 locking regression fix. + * [Input]: appletouch - improve powersaving for Geyser3 devices + * [Input]: add driver for Fujitsu serial touchscreens + * [sdhci]: add support to ENE-CB714 + * v2.6.22.5 + * [MTD] Makefile fix for mtdsuper + * ocfs2: Fix bad source start calculation during kernel writes + * NET: Share correct feature code between bridging and bonding + * sky2: don't clear phy power bits + * uml: fix previous request size limit fix + * i386: fix lazy mode vmalloc synchronization for paravirt + * signalfd: fix interaction with posix-timers + * signalfd: make it group-wide, fix posix-timers scheduling + * DCCP: Fix DCCP GFP_KERNEL allocation in atomic context + * IPV6: Fix kernel panic while send SCTP data with IP fragments + * IPv6: Invalid semicolon after if statement + * Fix soft-fp underflow handling. + * Netfilter: Missing Kbuild entry for netfilter + * SNAP: Fix SNAP protocol header accesses. + * NET: Fix missing rcu unlock in __sock_create() + * SPARC64: Fix sparc64 task stack traces. + * SPARC64: Fix sparc64 PCI config accesses on sun4u + * TCP: Do not autobind ports for TCP sockets + * TCP: Fix TCP rate-halving on bidirectional flows. + * TCP: Fix TCP handling of SACK in bidirectional flows. + * PPP: Fix PPP buffer sizing. + * PCI: lets kill the 'PCI hidden behind bridge' message + * PCI: disable MSI on RS690 + * PCI: disable MSI on RD580 + * PCI: disable MSI on RX790 + * USB: allow retry on descriptor fetch errors + * USB: fix DoS in pwc USB video driver + * usb: add PRODUCT, TYPE to usb-interface events + * Linux 2.6.22.6 + * V4L/DVB (6042): b2c2-flexcop: fix Airstar HD5000 tuning regression + * V4L/DVB (5967): ivtv: fix VIDIOC_S_FBUF:new OSD values where never set + * Re-add _GTM and _STM support + + -- Ben Collins Fri, 31 Aug 2007 16:26:56 -0400 + +linux-source-2.6.22 (2.6.22-10.30) gutsy; urgency=low + + * URGENT upload to fix FTBFS with xen-{i386,amd64} configs, + lpia d-i ftbfs, xen ftbfs. + * URGENT fix module-check to actually ignore things + * URGENT ignore ume modules + + [Alek Du] + + * Add Intel Poulsbo chipset Libata support + + [Amit Kucheria] + + * Update configuration files + * Enable stylus on Lenovo X60/X61 thinkpads + + [Ben Collins] + + * ubuntu: Disable snd-hda-intel, in favor of lum updated version + + [Kyle McMartin] + + * apparmor 10.3 hooks + * add lpia d-i udeb generation + * fix bits of rt/diff for -rt8 + * fix rt/diff for 2.6.22.3 changes + * fix up rt/diff for stable 2.6.22.4 + + [LaMont Jones] + + * Update configuration files + + [Phillip Lougher] + + * WriteSupportForNTFS: make fuse module available to d-i + + [Tim Gardner] + + * Gutsy Tribe 3 CD don't load on Dell Inspiron 1501 + - LP: #121111 + * Update configuration files + * Update configuration files + * Update configuration files + + [Upstream Kernel Changes] + + * [SPARC64]: Fix handling of multiple vdc-port nodes. + * [SPARC64]: Tweak assertions in sun4v_build_virq(). + * [SPARC64]: Fix log message type in vio_create_one(). + * [SPARC64]: Fix two year old bug in early bootup asm. + * [SPARC64]: Improve VIO device naming further. + * [SPARC64]: Handle multiple domain-services-port nodes properly. + * [SPARC64]: Add proper multicast support to VNET driver. + * [SPARC64]: Do not flood log with failed DS messages. + * [SPARC64]: Use KERN_ERR in IRQ manipulation error printks. + * [SPARC64]: Fix virq decomposition. + * [SPARC]: Fix serial console device detection. + * [SPARC64]: fix section mismatch warning in pci_sunv4 + * [SPARC64]: fix section mismatch warning in mdesc.c + * [SPARC64] viohs: extern on function definition + * [SPARC64]: Fix sun4u PCI config space accesses on sun4u. + * [SPARC64]: Fix show_stack() when stack argument is NULL. + * [SUNLANCE]: Fix sparc32 crashes by using of_*() interfaces. + * [SPARC]: Centralize find_in_proplist() instead of duplicating N times. + * [SPARC64]: Fix hard-coding of cpu type output in /proc/cpuinfo on + sun4v. + * [SPARC64]: Do not assume sun4v chips have load-twin/store-init support. + * [SPARC64]: Fix memory leak when cpu hotplugging. + * USB: cdc-acm: fix sysfs attribute registration bug + * TCP FRTO retransmit bug fix + * Fix TC deadlock. + * Fix IPCOMP crashes. + * Fix console write locking in sparc drivers. + * Add a PCI ID for santa rosa's PATA controller. + * Missing header include in ipt_iprange.h + * SCTP scope_id handling fix + * Fix rfkill IRQ flags. + * gen estimator timer unload race + * gen estimator deadlock fix + * Fix error queue socket lookup in ipv6 + * Fix ipv6 link down handling. + * Netpoll leak + * Sparc64 bootup assembler bug + * Fix ipv6 tunnel endianness bug. + * Fix sparc32 memset() + * Fix sparc32 udelay() rounding errors. + * Fix TCP IPV6 MD5 bug. + * KVM: SVM: Reliably detect if SVM was disabled by BIOS + * USB: fix warning caused by autosuspend counter going negative + * usb-serial: Fix edgeport regression on non-EPiC devices + * Fix reported task file values in sense data + * aacraid: fix security hole + * firewire: fw-sbp2: set correct maximum payload (fixes CardBus adapters) + * make timerfd return a u64 and fix the __put_user + * V4L: Add check for valid control ID to v4l2_ctrl_next + * V4L: ivtv: fix broken VBI output support + * V4L: ivtv: fix DMA timeout when capturing VBI + another stream + * V4L: ivtv: Add locking to ensure stream setup is atomic + * V4L: wm8775/wm8739: Fix memory leak when unloading module + * Input: lifebook - fix an oops on Panasonic CF-18 + * splice: fix double page unlock + * drm/i915: Fix i965 secured batchbuffer usage (CVE-2007-3851) + * Fix leak on /proc/lockdep_stats + * CPU online file permission + * Fix user struct leakage with locked IPC shem segment + * md: handle writes to broken raid10 arrays gracefully + * md: raid10: fix use-after-free of bio + * pcmcia: give socket time to power down + * Fix leaks on /proc/{*/sched, sched_debug, timer_list, timer_stats} + * futex: pass nr_wake2 to futex_wake_op + * "ext4_ext_put_in_cache" uses __u32 to receive physical block number + * Include serial_reg.h with userspace headers + * dm io: fix panic on large request + * i386: HPET, check if the counter works + * fw-ohci: fix "scheduling while atomic" + * firewire: fix memory leak of fw_request instances + * softmac: Fix ESSID problem + * eCryptfs: ecryptfs_setattr() bugfix + * nfsd: fix possible read-ahead cache and export table corruption + * readahead: MIN_RA_PAGES/MAX_RA_PAGES macros + * fs: 9p/conv.c error path fix + * forcedeth bug fix: cicada phy + * forcedeth bug fix: vitesse phy + * forcedeth bug fix: realtek phy + * acpi-cpufreq: Proper ReadModifyWrite of PERF_CTL MSR + * jbd commit: fix transaction dropping + * jbd2 commit: fix transaction dropping + * hugetlb: fix race in alloc_fresh_huge_page() + * do not limit locked memory when RLIMIT_MEMLOCK is RLIM_INFINITY + * uml: limit request size on COWed devices + * sony-laptop: fix bug in event handling + * destroy_workqueue() can livelock + * drivers/video/macmodes.c:mac_find_mode() mustn't be __devinit + * cfq-iosched: fix async queue behaviour + * libata: add FUJITSU MHV2080BH to NCQ blacklist + * ieee1394: revert "sbp2: enforce 32bit DMA mapping" + * nfsd: fix possible oops on re-insertion of rpcsec_gss modules + * dm raid1: fix status + * dm io: fix another panic on large request + * dm snapshot: permit invalid activation + * dm: disable barriers + * cr_backlight_probe() allocates too little storage for struct cr_panel + * ACPI: dock: fix opps after dock driver fails to initialize + * Hangup TTY before releasing rfcomm_dev + * Keep rfcomm_dev on the list until it is freed + * nf_conntrack: don't track locally generated special ICMP error + * IPV6: /proc/net/anycast6 unbalanced inet6_dev refcnt + * sysfs: release mutex when kmalloc() failed in sysfs_open_file(). + * Netfilter: Fix logging regression + * USB: fix for ftdi_sio quirk handling + * sx: switch subven and subid values + * UML: exports for hostfs + * Linux 2.6.22.2 + * fix oops in __audit_signal_info() + * random: fix bound check ordering (CVE-2007-3105) + * softmac: Fix deadlock of wx_set_essid with assoc work + * ata_piix: update map 10b for ich8m + * PPC: Revert "[POWERPC] Don't complain if size-cells == 0 in + prom_parse()" + * PPC: Revert "[POWERPC] Add 'mdio' to bus scan id list for platforms + with QE UEC" + * powerpc: Fix size check for hugetlbfs + * direct-io: fix error-path crashes + * stifb: detect cards in double buffer mode more reliably + * pata_atiixp: add SB700 PCI ID + * CPUFREQ: ondemand: fix tickless accounting and software coordination + bug + * CPUFREQ: ondemand: add a check to avoid negative load calculation + * Linux 2.6.22.3 + * intel_agp: really fix 945/965GME + * Reset current->pdeath_signal on SUID binary execution (CVE-2007-3848) + * MSS(mmc/sd/sdio) driver patch + + -- Kyle McMartin Thu, 16 Aug 2007 12:17:27 -0400 + +linux-source-2.6.22 (2.6.22-9.25) gutsy; urgency=low + + [Kyle McMartin] + + * ubuntu: Fix FTBFS -- forgot to bump debian/abi + + -- Kyle McMartin Thu, 02 Aug 2007 22:13:28 +0000 + +linux-source-2.6.22 (2.6.22-9.24) gutsy; urgency=low + + [Colin Watson] + + * provide Provides for fs-*-modules udebs + + [Matthias Klose] + + * test $dilist before using it + + [Lamont Jones] + + * hppa: Update abi files + + -- Kyle McMartin Thu, 02 Aug 2007 18:26:34 +0000 + +linux-source-2.6.22 (2.6.22-9.23) gutsy; urgency=low + + [Ben Collins] + + * ubuntu: Add missing newline to module-check script + * ubuntu: Add lpia to linux-libc-dev. Should finally build now. + + -- Ben Collins Thu, 02 Aug 2007 13:10:23 -0400 + +linux-source-2.6.22 (2.6.22-9.22) gutsy; urgency=low + + [Ben Collins] + + * ubuntu: Use DEB_HOST_ARCH, not DEB_HOST_ARCH_CPU + + -- Ben Collins Thu, 02 Aug 2007 08:44:09 -0400 + +linux-source-2.6.22 (2.6.22-9.21) gutsy; urgency=low + + [Ben Collins] + + * lpia: Add build stuff for lpia architecture + + [LaMont Jones] + + * abi files for hppa + * UBUNTU-HPPA: configs that seem to work + * hppa: abi files for 9.20 + + -- Ben Collins Wed, 01 Aug 2007 11:12:59 -0400 + +linux-source-2.6.22 (2.6.22-9.20) gutsy; urgency=low + + [Ben Collins] + + * tulip: Fix for Uli5261 chipsets. + * tulip: Define ULI PCI ID's + * tulip: Let dmfe handle davicom on non-sparc + * input: Allow root to inject unknown scan codes. + * irda: Default to dongle type 9 on IBM hardware + * input/mouse/alps: Do not call psmouse_reset() for alps + * pcmcia: Do not insert pcmcia cards on resume + * ide-cd: Disable verbose errors. + * block: Make CDROMEJECT more robust + * pm: Config option to disable handling of console during suspend/resume. + * version: Implement version_signature proc file. + * update toshiba_acpi to 0.19a-dev + * xpad: Update to latest version from xbox-linux. + * ubuntu: Enable setting of CONFIG_VERSION_SIGNATURE at build time + * toshiba_acpi: Don't use init_MUTEX_LOCKED + + [Chuck Short] + + * [USB]: add ASUS LCM to the blacklist + * [NET]: Add mcp73 to forcedeth. + * [USB]: Added support for Sanwa PC5000 multimeter usb cable (KB-USB2). + * [ATA] Add support for Sb700 AHCI nor-raid5 and raid5 + + [Fabio M. Di Nitto] + + * drivers/char/vt.c: make promcon driver init a boot option. + + [Kyle McMartin] + + * Disable MMCONFIG by default + + [Phillip Lougher] + + * fix NFS mounting regression from Edgy->Feisty + * r8169: disable TSO by default for RTL8111/8168B chipsets. + + [Tim Gardner] + + * Catch nonsense keycodes and silently ignore + * Cause SoftMac to emit an association event when setting ESSID. + + -- Ben Collins Mon, 30 Jul 2007 12:01:43 -0400 + +linux-source-2.6.22 (2.6.22-9.19) gutsy; urgency=low + + [Amit Kucheria] + + * Fix for FTBFS bug 123178 + * Fix for FTBFS bug 123178 + * Add devices to USB quirks to prevent USB autosuspend + * More devices added to USB quirks + - LP: #85488 + * Support for ENE CB-712/4 SD card reader + * Reorder quirk list based on Vendor/Product ID + + [Ben Collins] + + * ubuntu: Enable HOTPLUG_CPU in sparc64-smp config. + * ubuntu: Add xen to amd64 custom builds + * ubuntu: Update real-time kernel to -rt4 + * rt: Patch from Alessio Igor Bogani for RT-8 + + [Chuck Short] + + * IDE: add MHV2080BH to NCQ blacklist + * XEN: update to 2.6.22 final and amd64 support. + * NET: Add more pci-ids to zd1211rw + * IDE: add new PCI ID + * USB: fix oops in ftdi_sio + + [Eric Piel] + + * ACPI: Allow custom DSDT tables to be loaded from initramfs + + [Ryan Lortie] + + * Macbook calibration loop fix + - LP: #54621 + + [Upstream Kernel Changes] + + * NETFILTER: {ip, nf}_conntrack_sctp: fix remotely triggerable NULL ptr + dereference (CVE-2007-2876) + * Linux 2.6.22.1 + * [SPARC64]: Use KERN_ERR in sun4v IRQ printk()'s. + * [SPARC64]: Add LDOM virtual channel driver and VIO device layer. + * [SPARC64]: Add Sun LDOM virtual network driver. + * [SPARC64]: Add Sun LDOM virtual disk driver. + * [SPARC64]: Create proper obppath sysfs files for VIO bus devices. + * [SPARC64] LDC: Do limited polled retry on setting RX queue head. + * [SUNVNET]: Validate RX descriptor size field. + * [SPARC64]: Add missing symbol exports for LDOM infrastructure. + * [SPARC64]: Temporary workaround for LDC INO double-delivery. + * [SPARC64]: Create 'devspec' nodes for vio devices. + * [SPARC64]: vdev->type can be NULL, handle this in devspec_show(). + * [SPARC64]: Assorted LDC bug cures. + * [SPARC64]: Add domain-services nodes to VIO device tree. + * [SPARC64]: Export powerd facilities for external entities. + * [SPARC64]: Initial domain-services driver. + * [SPARC64]: Use more mearningful names for IRQ registry. + * [SPARC64]: Abstract out mdesc accesses for better MD update handling. + * [SPARC64]: Fix MD property lifetime bugs. + * [SPARC64]: Fix setting of variables in LDOM guest. + * [SPARC64]: Initial LDOM cpu hotplug support. + * [SPARC64]: Unconditionally register vio_bus_type. + * [SPARC64]: Fix build regressions added by dr-cpu changes. + * [SPARC64]: mdesc.c needs linux/mm.h + * [SPARC64]: SMP build fixes. + * [SPARC64]: More sensible udelay implementation. + * [SPARC64]: Process dr-cpu events in a kthread instead of workqueue. + * [SPARC64]: Add ->set_affinity IRQ handlers. + * [SPARC64]: Fix leak when DR added cpu does not bootup. + * [SPARC64]: Clear cpu_{core,sibling}_map[] in + smp_fill_in_sib_core_maps() + * [SPARC64]: Give more accurate errors in dr_cpu_configure(). + * [SERIAL]: Fix console write locking in sparc drivers. + * [TIMER]: Fix clockevent notifications on 64-bit. + * [SPARC64]: dr-cpu unconfigure support. + * [SPARC64]: Fix UP build. + * [SPARC64]: SMP build fix. + * [SPARC64]: Fix race between MD update and dr-cpu add. + * [SERIAL] SUNHV: Fix jerky console on LDOM guests. + * [SPARC64]: Kill explicit %gl register reference. + * [SPARC64]: Add basic infrastructure for MD add/remove notification. + * [SPARC64]: Simplify VDC device probing. + * [SPARC64]: Simplify VNET probing. + * [SPARC64]: Massively simplify VIO device layer and support hot + add/remove. + * [SPARC64]: Handle LDC resets properly in domain-services driver. + * [SPARC64]: Handle reset events in vio_link_state_change(). + * [SPARC64]: Fix reset handling in VNET driver. + * [SPARC64]: Set vio->desc_buf to NULL after freeing. + * [SPARC64]: Fix MODULE_DEVICE_TABLE() specification in VDC and VNET. + * [SPARC64]: Fix device type matching in VIO's devspec_show(). + * Add empty + * Add dummy isa_(bus|virt)_to_(virt|bus) inlines + * Clean up sti_flush + * Do not allow STI_CONSOLE to be modular + * Use compat_sys_getdents + + -- Ben Collins Sat, 28 Jul 2007 12:30:53 -0400 + +linux-source-2.6.22 (2.6.22-8.18) gutsy; urgency=low + + [Ben Collins] + + * ubuntu: *sigh* update xen config to fix FTBFS + + -- Ben Collins Thu, 12 Jul 2007 14:23:20 +0100 + +linux-source-2.6.22 (2.6.22-8.17) gutsy; urgency=low + + [Ben Collins] + + * ubuntu: Actually enable the -xen build. + + -- Ben Collins Thu, 12 Jul 2007 09:51:01 +0100 + +linux-source-2.6.22 (2.6.22-8.16) gutsy; urgency=low + + * Removed CONFIG_BLINK from all configs and added to modules.ignore + * This fixes a build failure for 8.15 + + [Alexey Starikovskiy] + + * Fix ACPI battery detection on Asus + + [Amit Kucheria] + + * Export symbols required to build GFS1 in LUM + * Update configuration files + * 2.6.22-7.14 ABI + * Remove old ABI + * Update d-i modules to support Sparc LDOM + * Introducing the UME kernel flavour + + [Jacob Pan] + + * Poulsbo SMBus Controller + * Intel Poulsbo SCH IDE Controller + * Intel Poulsbo HD audio controller + + [Phillip Lougher] + + * xen: Update custom binary flavour (Xen 3.1 for 2.6.22-rc5) + * xen: Update xen/config.i386 to enable PAE + + [Upstream Kernel Changes] + + * [SCSI] fusion: fix for BZ 8426 - massive slowdown on SCSI CD/DVD drive + * [XFS] Update the MAINTAINERS file entry for XFS. + * IB/mlx4: Fix handling of wq->tail for send completions + * IB/mlx4: Fix warning in rounding up queue sizes + * [SCSI] ESP: Don't forget to clear ESP_FLAG_RESETTING. + * firewire: fix hang after card ejection + * ieee1394: fix to ether1394_tx in ether1394.c + * [ARM] Add support for pause_on_oops and display preempt/smp options + * sh: Fix restartable syscall arg5 clobbering. + * ACPI: gracefully print null trip-point device + * ACPICA: fix error path in new external package objects as method + arguments + * sh: oops_enter()/oops_exit() in die(). + * [ARM] Update show_regs/oops register format + * IB/mlx4: Handle new FW requirement for send request prefetching + * IB/mlx4: Get rid of max_inline_data calculation + * IB/mlx4: Handle buffer wraparound in __mlx4_ib_cq_clean() + * IB/mlx4: Handle FW command interface rev 3 + * Fix signalfd interaction with thread-private signals + * sched: fix SysRq-N (normalize RT tasks) + * Fix possible runqueue lock starvation in wait_task_inactive() + * sh: Handle -ERESTART_RESTARTBLOCK for restartable syscalls. + * sh64: Handle -ERESTART_RESTARTBLOCK for restartable syscalls. + * [POWERPC] Fix snd-powermac refcounting bugs + * [XFS] s/memclear_highpage_flush/zero_user_page/ + * [XFS] Update the MAINTAINERS file entry for XFS - change git repo name. + * [XFRM]: Fix MTU calculation for non-ESP SAs + * [IPVS]: Fix state variable on failure to start ipvs threads + * [AF_RXRPC]: Return the number of bytes buffered in rxrpc_send_data() + * [S390] Missing blank when appending cio_ignore kernel parameter + * [S390] Fix zfcpdump header + * [S390] Fix yet another two section mismatches. + * [S390] Print list of modules on die(). + * [S390] Add oops_enter()/oops_exit() calls to die(). + * [S390] Move psw_set_key. + * [POWERPC] rheap - eliminates internal fragments caused by alignment + * [POWERPC] PowerPC: Prevent data exception in kernel space (32-bit) + * [POWERPC] Fix powermac late initcall to only run on powermac + * [MIPS] Don't drag a platform specific header into generic arch code. + * x86_64: Fix readahead/sync_file_range/fadvise64 compat calls + * x86_64: Fix eventd/timerfd syscalls + * x86: Disable DAC on VIA bridges + * x86_64: Quieten Atari keyboard warnings in Kconfig + * x86: Only make Macintosh drivers default on Macs + * x86: Disable KPROBES with DEBUG_RODATA for now + * x86: change_page_attr bandaids + * x86_64: fix link warning between for .text and .init.text + * Fix up CREDIT entry ordering + * firewire: Only set client->iso_context if allocation was successful. + * spidernet: null out skb pointer after its been used. + * spidernet: Cure RX ram full bug + * spidernet: Don't terminate the RX ring + * spidernet: silence the ramfull messages + * spidernet: turn off descriptor chain end interrupt. + * spidernet: checksum and ethtool + * bonding: Fix use after free in unregister path + * bonding: Fix 802.3ad no carrier on "no partner found" instance + * s390: print correct level for HiperSockets devices + * s390: qeth driver does not recover + * s390: avoid inconsistent lock state in qeth + * s390: qeth: wrong packet length in qdio header + * s390: Use ccw_device_get_id() in qeth/claw drivers + * s390: don't call iucv_path_connect from tasklet context + * s390: netiucv spinlock initializer cleanup + * s390: netiucv inlining cleanup + * forcedeth: use unicast receive mode for WoL + * natsemi irq flags + * cxgb3 - fix skb->dev dereference + * cxgb3 - fix netpoll hanlder + * cxgb3 - Fix direct XAUI support + * cxgb3 - Stop mac RX when changing MTU + * cxgb3 - MAC watchdog update + * PATA: Add the MCP73/77 support to PATA driver + * pata_it821x: (partially) fix DMA in RAID mode + * libata: more NONCQ devices + * kerneldoc fix in libata + * ahci: fix PORTS_IMPL override + * fix module_param mistake in it821x + * Blackfin arch: update ANOMALY handling + * Blackfin arch: update printk to use KERN_EMERG and reformat crash + output + * Blackfin arch: add missing braces around array bfin serial init + * Blackfin arch: match kernel startup messaage with new linker script + * Blackfin arch: move cond_syscall() behind __KERNEL__ like all other + architectures + * Blackfin arch: Add definition of dma_mapping_error + * Blackfin arch: add proper const volatile to addr argument to the read + functions + * [AGPGART] intel_agp: don't load if no IGD and AGP port + * IB/umem: Fix possible hang on process exit + * IPoIB/cm: Initialize RX before moving QP to RTR + * IPoIB/cm: Fix interoperability when MTU doesn't match + * IPoIB/cm: Remove dead definition of struct ipoib_cm_id + * IB/mlx4: Correct max_srq_wr returned from mlx4_ib_query_device() + * [PARISC] stop lcd driver from stripping initial whitespace + * [PARISC] Handle wrapping in expand_upwards() + * [PARISC] Fix unwinder on 64-bit kernels + * [PARISC] unwinder improvements + * page_mapping must avoid slub pages + * posix-timers: Prevent softirq starvation by small intervals and SIG_IGN + * Allow DEBUG_RODATA and KPROBES to co-exist + * [NETFILTER]: nf_conntrack_sip: add missing message types containing RTP + info + * [NETFILTER]: nfctnetlink: Don't allow to change helper + * [IPV6] NDISC: Fix thinko to control Router Preference support. + * [IPV4]: include sysctl.h from inetdevice.h + * i386: Make CMPXCHG64 only dependent on PAE + * x86_64: Fix only make Macintosh drivers default on Macs + * x86_64: Ignore compat mode SYSCALL when IA32_EMULATION is not defined + * [AVR32] Fix bug in invalidate_dcache_region() + * [AVR32] NGW100, Remove relics of the old USART mapping scheme + * [AVR32] Initialize dma_mask and dma_coherent_mask + * [AVR32] Update defconfigs + * ACPI: fix 2.6.20 SMP boot regression + * [SKBUFF]: Fix incorrect config #ifdef around skb_copy_secmark + * [TIPC]: Fix infinite loop in netlink handler + * [PPP]: Revert 606f585e363527da9feaed79465132c0c661fd9e + * [PPP]: Fix osize too small errors when decoding mppe. + * [TCP] tcp_read_sock: Allow recv_actor() return return negative error + value. + * [NET]: Re-enable irqs before pushing pending DMA requests + * [NET]: Make skb_seq_read unmap the last fragment + * hwmon/coretemp: fix a broken error path + * fix refcounting of nsproxy object when unshared + * console UTF-8 fixes (fix) + * SM501: suspend support + * SM501: initialise SDRAM clock before bus clocks + * SM501: Fix sm501_init_reg() mask/set order + * SM501: Clock updates and checks + * SM501: Add Documentation/SM501.txt + * SM501: Check SM501 ID register on initialisation + * SLUB: fix behavior if the text output of list_locations overflows + PAGE_SIZE + * sched: fix next_interval determination in idle_balance() + * update checkpatch.pl to version 0.05 + * alpha: fix alignment problem in csum_ipv6_magic() + * Char: stallion, fix oops during init with ISA cards + * uml: use generic BUG + * uml: add asm/paravirt.h + * "volatile considered harmful" + * document nlink function + * slab allocators: MAX_ORDER one off fix + * update checkpatch.pl to version 0.06 + * x86_64: fix misplaced `continue' in mce.c + * ext2: disallow setting xip on remount + * audit: fix oops removing watch if audit disabled + * ext3: lost brelse in ext3_read_inode() + * ext4: lost brelse in ext4_read_inode() + * ACPI: preserve the ebx value in acpi_copy_wakeup_routine + * FUTEX: Restore the dropped ERSCH fix + * Linus 2.6.22-rc6 + * [ARM] 4452/1: Force the literal pool dump before reloc_end + * [ARM] 4449/1: more entries in arch/arm/boot/.gitignore + * fix nmi_watchdog=2 bootup hang + * [POWERPC] Update g5_defconfig + * [POWERPC] Update defconfigs + * [POWERPC] Fix VDSO gettimeofday() when called with NULL struct timeval + * [POWERPC] Fix subtle FP state corruption bug in signal return on SMP + * USB: g_file_storage: call allow_signal() + * USB: ti serial driver sleeps with spinlock held + * USB: memory leak in iowarrior.c + * USB: usblcd doesn't limit memory consumption during write + * USB: fix race leading to use after free in io_edgeport + * USB: add new device id to option driver + * USB: ftdio_sio: New IPlus device ID + * [MIPS] __ucmpdi2 arguments are unsigned long long. + * [MIPS] add io_map_base to pci_controller on Cobalt + * [MIPS] remove "support for" from system type entry + * [MIPS] Alchemy: Fix wrong cast + * [MIPS] Fix pb1500 reg B access + * [MIPS] AP/SP requires shadow registers, auto enable support. + * [MIPS] 20K: Handle WAIT related bugs according to errata information + * [MIPS] use compat_siginfo in rt_sigframe_n32 + * [MIPS] Remove a duplicated local variable in test_and_clear_bit() + * [MIPS] EMMA2RH: Disable GEN_RTC, it can't possibly work. + * [MIPS] SMTC and non-SMTC kernel and modules are incompatible + * [MIPS] Count timer interrupts correctly. + * x86_64: set the irq_chip name for lapic + * x86_64 irq: use mask/unmask and proper locking in fixup_irqs() + * [SPARC64]: Add irqs to mdesc_node. + * [SPARC64]: Fix VIRQ enabling. + * [SPARC64]: Need to set state to IDLE during sun4v IRQ enable. + * [SPARC64]: Add LDOM virtual channel driver and VIO device layer. + * [SPARC64]: Add Sun LDOM virtual network driver. + * [SPARC64]: Add Sun LDOM virtual disk driver. + * [SPARC64]: Create proper obppath sysfs files for VIO bus devices. + * [SPARC64] LDC: Do limited polled retry on setting RX queue head. + * [GFS2] Fix gfs2_block_truncate_page err return + * [DLM] Telnet to port 21064 can stop all lockspaces + * [GFS2] inode size inconsistency + * [GFS2] remounting w/o acl option leaves acls enabled + * [GFS2] System won't suspend with GFS2 file system mounted + * [GFS2] git-gfs2-nmw-build-fix + * [GFS2] Obtaining no_formal_ino from directory entry + * [GFS2] Remove i_mode passing from NFS File Handle + * [SUNVNET]: Validate RX descriptor size field. + * [SPARC64]: Add missing symbol exports for LDOM infrastructure. + * [SPARC64]: Temporary workaround for LDC INO double-delivery. + * [SPARC64]: Create 'devspec' nodes for vio devices. + * [SPARC64]: vdev->type can be NULL, handle this in devspec_show(). + + -- Amit Kucheria Mon, 09 Jul 2007 12:55:56 +0300 + +linux-source-2.6.22 (2.6.22-7.14) gutsy; urgency=low + + [Ben Collins] + + * build/vars: Provide ivtv-modules + * Bump ABI + * ubuntu/config: Enable Intermediate Functional Block device + * coredump: Fix typo in patch merge + * ubuntu/scripts: Make sure to symlink *.lds for ia64 builds + * ubuntu/config: Enable NO_HZ for server and sparc64 targets. + * ubuntu/config: Remove bigiron target, see if anyone complains + * ubuntu: Ok, really remove bigiron + * ubuntu/control-scripts: Fo sho, remove the debconf stuff from controls + scripts + * AppArmor: Enable exports and changes for AppArmor usage + * ubuntu: Add feisty changelog for historical purposes. + + [Colin Watson] + + * Move isofs to storage-core-modules udeb from fs-core-modules. + + [Upstream Kernel Changes] + + * [MTD] [MAPS] don't force uclinux mtd map to be root dev + * [MTD] generalise the handling of MTD-specific superblocks + * [SCSI] zfcp: avoid clutter in erp_dbf + * [SCSI] zfcp: IO stall after deleting and path checker changes after + reenabling zfcp devices + * [SCSI] ipr: Proper return codes for eh_dev_reset for SATA devices + * [SCSI] stex: fix id mapping issue + * [SCSI] stex: extend hard reset wait time + * [SCSI] stex: fix reset recovery for console device + * [SCSI] stex: minor cleanup and version update + * [SCSI] MegaRAID: Update MAINTAINERS email-id + * [SCSI] tgt: fix a rdma indirect transfer error bug + * [SCSI] NCR53C9x: correct spelling mistake in deprecation notice + * [SCSI] aacraid: Correct sa platform support. (Was: [Bug 8469] Bad EIP + value on pentium3 SMP kernel-2.6.21.1) + * [SCSI] aacraid: fix panic on short Inquiry + * [WATCHDOG] ks8695_wdt.c - new KS8695 watchdog driver + * [JFFS2] Fix BUG() caused by failing to discard xattrs on deleted files. + * [JFFS2] Fix potential memory leak of dead xattrs on unmount. + * [SCSI] sd: fix refcounting regression in suspend/resume routines + * [SCSI] aacraid: apply commit config for reset_devices flag + * [SCSI] aic7xxx: fix aicasm build failure with gcc-3.4.6 + * [SCSI] aic94xx: asd_clear_nexus should fail if the cleared task does + not complete + * [SCSI] fusion: Fix |/|| confusion + * parisc: make command_line[] static + * parisc: sync compat getdents + * [PARISC] Move #undef to end of syscall table + * [PARISC] Wire up kexec_load syscall + * parisc: convert /proc/gsc/pcxl_dma to seq_file + * [PARISC] Let PA-8900 processors boot + * [PARISC] Disable LWS debugging + * [PARISC] spelling fixes: arch/parisc/ + * sh: section mismatch fixes for system timer. + * [PARISC] ROUND_UP macro cleanup in arch/parisc + * [PARISC] ROUNDUP macro cleanup in drivers/parisc + * [PPC] Fix COMMON symbol warnings + * [PPC] Remove duplicate export of __div64_32. + * [POWERPC] 52xx: unbreak lite5200 dts (_pic vs. -pic) + * [POWERPC] QE: fix Kconfig 'select' warning with UCC_FAST + * [POWERPC] Fix Section mismatch warnings + * [POWERPC] Fix modpost warning + * [PPC] Fix modpost warning + * [CIFS] Fix oops on failed cifs mount (in kthread_stop) + * [POWERPC] Fix Kconfig warning + * [CIFS] typo in previous patch + * [SCSI] megaraid_sas: intercept cmd timeout and throttle io + * [WATCHDOG] clean-up watchdog documentation + * drm: Spinlock initializer cleanup + * drm/radeon: add more IGP chipset pci ids + * drm: make sure the drawable code doesn't call malloc(0). + * [PARISC] kobject is embedded in subsys, not kset + * [PARISC] Build fixes for power.c + * [ARM] 4401/1: S3C2443: Add definitions for port GPIOJ + * [ARM] 4402/1: S3C2443: Add physical address of HSMMC controller + * [ARM] 4403/1: Make the PXA-I2C driver work with lockdep validator + * [ARM] 4404/1: Trivial IXP42x Kconfig cleanup + * [ARM] 4405/1: NSLU2, DSM-G600 frequency fixup code + * [ARM] 4406/1: Trivial NSLU2 / NAS-100D header & setup code cleanup + * [ARM] remove unused header file: arch/arm/mach-s3c2410/bast.h + * [PARISC] fix lasi_82596 build + * [PARISC] fix section mismatch in parport_gsc + * [PARISC] fix section mismatch in parisc STI video drivers + * [PARISC] fix section mismatch in ccio-dma + * [PARISC] fix section mismatches in arch/parisc/kernel + * [PARISC] fix section mismatch in parisc eisa driver + * [PARISC] fix section mismatch in superio serial drivers + * [PARISC] Wire up utimensat/signalfd/timerfd/eventfd syscalls + * hwmon/ds1621: Fix swapped temperature limits + * hwmon/coretemp: Add more safety checks + * hwmon/w83627hf: Be quiet when no chip is found + * hwmon-vid: Don't spam the logs when VRM version is missing + * hwmon/applesmc: Simplify dependencies + * hwmon/applesmc: Handle name file creation error and deletion + * ieee1394: sbp2: include workqueue.h + * ieee1394: eth1394: remove bogus netif_wake_queue + * ieee1394: eth1394: handle tlabel exhaustion + * ieee1394: eth1394: bring back a parent device + * ieee1394: raw1394: Fix async send + * firewire: Add missing byteswapping for receive DMA programs. + * firewire: prefix modules with firewire- instead of fw- + * firewire: fix return code + * [libata] Add drive to NCQ blacklist + * [ARM] enable arbitary speed tty ioctls and split input/output speed + * Input: db9 - do not ignore dev2 module parameter + * Input: logips2pp - fix typo in Kconfig + * [XFS] Write at EOF may not update filesize correctly. + * [SCSI] pluto: Use wait_for_completion_timeout. + * [SPARC64]: Kill unused DIE_PAGE_FAULT enum value. + * [SPARC64]: Don't be picky about virtual-dma values on sun4v. + * [SPARC32]: Removes mismatch section warnigs in sparc time.c file + * [SERIAL] sunzilog: section mismatch fix + * [SPARC64]: PCI device scan is way too verbose by default. + * [SCSI] jazz_esp: Converted to use esp_core. + * [SCSI] ESP: Kill SCSI_ESP_CORE and link directly just like jazz_esp + * [SPARC64]: Fix typo in sun4v_hvapi_register error handling. + * [SPARC64]: Report proper system soft state to the hypervisor. + * [SPARC64]: Negotiate hypervisor API for PCI services. + * [SPARC64]: Use machine description and OBP properly for cpu probing. + * [SPARC64]: Eliminate NR_CPUS limitations. + * [SPARC64]: arch/sparc64/time.c doesn't compile on Ultra 1 (no PCI) + * [SPARC]: Linux always started with 9600 8N1 + * [SPARC64]: Fix _PAGE_EXEC_4U check in sun4u I-TLB miss handler. + * [SPARC]: Emulate cmpxchg like parisc + * [SPARC]: Mark as emulating cmpxchg, add appropriate depends for DRM. + * [SPARC64]: Fix two bugs wrt. kernel 4MB TSB. + * [SPARC64]: Fill holes in hypervisor APIs and fix KTSB registry. + * mac80211: fail back to use associate from reassociate + * mac80211: fix memory leak when defrag fragments + * mac80211: always set carrier status on open + * mac80211: avoid null ptr deref in ieee80211_ibss_add_sta + * prism54: fix monitor mode oops + * ieee80211: fix incomplete error message + * softmac: alloc_ieee80211() NULL check + * hostap: Allocate enough tailroom for TKIP + * sparc64: fix alignment bug in linker definition script + * USB: replace flush_workqueue with cancel_sync_work + * ACPICA: allow Load(OEMx) tables + * ACPI: thermal: Replace pointer with name in trip_points + * ACPI: extend "acpi_osi=" boot option + * IB/mthca: Fix handling of send CQE with error for QPs connected to SRQ + * IPoIB/cm: Fix performance regression on Mellanox + * IB/cm: Fix stale connection detection + * IB/mlx4: Fix last allocated object tracking in bitmap allocator + * NOHZ: prevent multiplication overflow - stop timer for huge timeouts + * random: fix error in entropy extraction + * random: fix seeding with zero entropy + * ACPI: Make _OSI(Linux) a special case + * ACPI: add __init to acpi_initialize_subsystem() + * [PARISC] fix "ENTRY" macro redefinition + * [PARISC] fix section mismatch in smp.c + * [PARISC] remove remnants of parisc-specific softirq code + * [PARISC] fix trivial spelling nit in asm/linkage.h + * [PARISC] fix null ptr deref in unwind.c + * [PARISC] fix "reduce size of task_struct on 64-bit machines" fallout + * [PARISC] be more defensive in process.c::get_wchan + * [ARM] use __used attribute + * [ARM] Fix stacktrace FP range checking + * [ARM] oprofile: avoid lockdep warnings on mpcore oprofile init + * [ARM] 4411/1: KS8695: Another serial driver fix + * [ARM] 4412/1: S3C2412: reset errata fix + * [ARM] 4414/1: S3C2443: sparse fix for clock.c + * [ARM] 4415/1: AML5900: fix sparse warnings from map_io + * [ARM] 4416/1: NWFPE: fix undeclared symbols + * [ARM] 4410/1: Remove extern declarations in coyote/ixdpg425-pci.c + * [ARM] 4394/1: ARMv7: Add the TLB range operations + * [ARM] 4417/1: Serial: Fix AMBA drivers locking + * sky2: dont set bogus bit in PHY register + * sky2: checksum offload plus vlan bug + * sky2: program proper register for fiber PHY + * defxx: Fix the handling of ioremap() failures + * e1000: restore netif_poll_enable call but make sure IRQs are off + * sky2: enable IRQ on duplex renegotiation + * ehea: Fixed multi queue RX bug + * [SCSI] fix CONFIG_SCSI_WAIT_SCAN=m + * [SCSI] qla2xxx: fix timeout in qla2x00_down_timeout + * [ARM] Fix some section mismatch warnings + * alpha: cleanup in bitops.h + * alpha: support new syscalls + * fix possible null ptr deref in kallsyms_lookup + * NFS: Fix a refcount leakage in O_DIRECT + * a bug in ramfs_nommu_resize function, passing old size to vmtruncate + * sh: Fix pcrel too far for in_nmi label. + * sh: Trivial fix for dma-api compile failure. + * sh: Fix vsyscall build failure. + * sh: trivial build cleanups. + * sh: support older gcc's + * [ALSA] HDA: Add support for Gateway NX860 + * [ALSA] HDA: Add more systems to Sigmatel codec + * [ALSA] HDA: Fix headphone mute issue on non-eapd Conexant systems + * [ALSA] hda-codec - Add support for ASUS A8J modem + * [ALSA] ali5451 - Fix possible NULL dereference + * [ALSA] hda-intel: fix ASUS M2V detection + * [ALSA] Fix ASoC s3c24xx-pcm spinlock bug + * [ALSA] hda-codec - Add quirk for MSI S420 + * [ALSA] hda-codec - Add quirk for Supermicro PDSBA to alc883_cfg_tbl[] + * [ALSA] hda-codec - Add support for MSI K9N Ultra + * [ALSA] hda-codec - Fix pin configs for Gateway MX6453 + * [ALSA] hda-codec - Fix input with STAC92xx + * [ALSA] hda-codec - Fix STAC922x capture boost level + * [CRYPTO] cryptd: Fix problem with cryptd and the freezer + * [CASSINI]: Fix printk message typo. + * [XFRM]: Allow XFRM_ACQ_EXPIRES to be tunable via sysctl. + * [XFRM]: xfrm_larval_drop sysctl should be __read_mostly. + * [IPSEC]: Fix IPv6 AH calculation in outbound + * [IPV6] ROUTE: No longer handle ::/0 specially. + * [NET]: parse ip:port strings correctly in in4_pton + * [IPSEC]: Fix panic when using inter address familiy IPsec on loopback. + * [IPV4]: Kill references to bogus non-existent CONFIG_IP_NOSIOCRT + * [AF_PACKET]: Kill bogus CONFIG_PACKET_MULTICAST + * [IPV6]: Fix build warning. + * [AF_PACKET]: Kill CONFIG_PACKET_SOCKET. + * [SOCK]: Shrink struct sock by 8 bytes on 64-bit. + * [TCP]: Consolidate checking for tcp orphan count being too big. + * [NET] napi: Call __netif_rx_complete in netif_rx_complete + * [IPV6] ADDRCONF: Fix conflicts in DEVCONF_xxx constant. + * [TCP] tcp_probe: a trivial fix for mismatched number of printl + arguments. + * [TCP] tcp_probe: use GCC printf attribute + * [BRIDGE]: Reduce frequency of forwarding cleanup timer in bridge. + * [BRIDGE]: Round off STP perodic timers. + * [IPSEC]: Add xfrm_sysctl.txt. + * [SPARC64]: Add missing NCS and SVC hypervisor interfaces. + * [SPARC32]: Build fix. + * [SPARC]: Missing #include in drivers/sbus/char/flash.c + * [ALSA] version 1.0.14 + * neofb: Fix pseudo_palette array overrun in neofb_setcolreg + * smpboot: fix cachesize comparison in smp_tune_scheduling() + * at91: fix enable/disable_irq_wake symmetry in pcmcia driver + * SLUB: More documentation + * pci-quirks: fix MSI disabling on RS400-200 and RS480 + * ntfs_init_locked_inode(): fix array indexing + * m68k: runtime patching infrastructure + * SLUB: Fix NUMA / SYSFS bootstrap issue + * afs: needs sched.h + * m68k: discontinuous memory support + * [S390] Add exception handler for diagnose 224 + * [S390] dasd_eer: use mutex instead of semaphore + * [S390] arch/s390/kernel/debug.c: use mutex instead of semaphore + * [S390] raw3270: use mutex instead of semaphore + * [S390] Fix section annotations. + * [S390] cio: Use device_schedule_callback() for removing disconnected + devices. + * [S390] cio: deregister ccw device when pgid disband failed + * ACPI: thinkpad-acpi: do not use named sysfs groups + * ieee1394: fix calculation of sysfs attribute "address" + * ieee1394: sbp2: offer SAM-conforming target port ID in sysfs + * firewire: fw-sbp2: implement sysfs ieee1394_id + * firewire: add to MAINTAINERS + * firewire: Implement suspend/resume PCI driver hooks. + * firewire: Change struct fw_cdev_iso_packet to not use bitfields. + * firewire: Install firewire-constants.h and firewire-cdev.h for + userspace. + * EXT4: Fix whitespace + * Remove unnecessary exported symbols. + * ext4: Extent overlap bugfix + * When ext4_ext_insert_extent() fails to insert new blocks + * Define/reserve new ext4 superblock fields + * msi: fix ARM compile + * PCI: disable MSI by default on systems with Serverworks HT1000 chips + * PCI: Fix pci_find_present + * PCI: i386: fixup for Siemens Nixdorf AG FSC Multiprocessor Interrupt + Controllers + * PCI: quirk disable MSI on via vt3351 + * [XTENSA] fix bit operations in bitops.h + * [XTENSA] Spelling fixes in arch/xtensa + * [XTENSA] fix sources using deprecated assembler directive + * [XTENSA] Remove multi-exported symbols from xtensa_ksyms.c + * [XTENSA] Use generic 64-bit division + * [XTENSA] clean-up header files + * [XTENSA] Move common sections into bss sections + * [XTENSA] Remove non-rt signal handling + * Xtensa: use asm-generic/fcntl.h + * [JFFS2] Fix buffer length calculations in jffs2_get_inode_nodes() + * Fix vmi.c compilation + * x86_64: allocate sparsemem memmap above 4G + * Add select PHYLIB to the UCC_GETH Kconfig option + * Fix possible UDF data corruption + * m68k: parenthesis balance + * msi: fix the ordering of msix irqs + * msi: mask the msix vector before we unmap it + * potential parse error in ifdef + * parse errors in ifdefs + * pci_ids: update patch for Intel ICH9M + * x86: fix oprofile double free + * Work around Dell E520 BIOS reboot bug + * fix compat futex code for private futexes + * skeletonfb: fix of xxxfb_setup ifdef + * vt8623fb: arkfb: null pointer dereference fix + * cfag12864bfb: Use sys_ instead of cfb_ framebuffer accessors + * fbdev: Move declaration of fb_class to + * misc/tifm_7xx1: replace deprecated irq flag + * add a trivial patch style checker + * Documentation: How to use GDB to decode OOPSes + * RTC: use fallback IRQ if PNP tables don't provide one + * memory hotplug: fix unnecessary calling of init_currenty_empty_zone() + * tty: fix leakage of -ERESTARTSYS to userland + * ISDN4Linux: fix maturity label + * Fix broken CLIR in isdn driver + * prism54: MAINTAINERS update + * atmel_spi dma address bugfix + * h8300 trival patches + * ALPHA: support graphics on non-zero PCI domains + * ALPHA: correct low-level I/O routines for sable-lynx + * ALPHA: misc fixes + * Better documentation for ERESTARTSYS + * serial_core.h: include + * SPI: Freescale iMX SPI controller driver fixes + * SLUB: fix locking for hotplug callbacks + * pm3fb: switching between X and fb fix + * microcode: fix section mismatch warning + * isdn: fix section mismatch warnings + * acpi: fix section mismatch warning in asus + toshiba + * kvm: fix section mismatch warning in kvm-intel.o + * net/hp100: fix section mismatch warning + * timer statistics: fix race + * timer stats: speedups + * [SCSI] aacraid: fix shutdown handler to also disable interrupts. + * [MTD] Fix error checking after get_mtd_device() in get_sb_mtd functions + * [JFFS2] Fix obsoletion of metadata nodes in jffs2_add_tn_to_tree() + * ACPI: Section mismatch ... acpi_map_pxm_to_node + * ACPICA: Support for external package objects as method arguments + * Pull now into release branch + * Pull osi-now into release branch + * [POWERPC] Update documentation for of_find_node_by_type() + * [POWERPC] Fix ppc32 single-stepping out of syscalls + * [POWERPC] Fix compiler/assembler flags for Ebony platform boot files + * [POWERPC] Fix possible access to free pages + * [POWERPC] ps3/interrupt.c uses get_hard_smp_processor_id + * [POWERPC] pasemi idle uses hard_smp_processor_id + * [POWERPC] Create a zImage for legacy iSeries + * [POWERPC] Don't use HOSTCFLAGS in BOOTCFLAGS + * [POWERPC] Fix compile warning in pseries xics code + * [POWERPC] Fix return from pte_alloc_one() in out-of-memory case + * [POWERPC] Compare irq numbers with NO_IRQ not IRQ_NONE + * [POWERPC] Don't allow PMAC_APM_EMU for 64-bit + * [POWERPC] Fix compile breakage for IBM/AMCC 4xx arch/ppc platforms + * [POWERPC] Fix zImage.coff generation for 32-bit pmac + * [ARM] 4392/2: Do not corrupt the SP register in compressed/head.S + * [ARM] 4418/1: AT91: Number of programmable clocks differs + * [ARM] 4419/1: AT91: SAM9 USB clocks check for suspending + * [ARM] 4422/1: Fix default value handling in gpio_direction_output (PXA) + * [ARM] Solve buggy smp_processor_id() usage + * qla3xxx: device doesnt do hardware checksumming. + * VLAN: kill_vid is only useful for VLAN filtering devices + * sky2: Fix VLAN unregistration + * 8139cp: fix VLAN unregistration + * atl1: eliminate unneeded kill_vid code + * network drivers: eliminate unneeded kill_vid code + * e1000: disable polling before registering netdevice + * smc91x: sh solution engine fixes. + * Update tulip maintainer email address + * NetXen: Removal of extra free_irq call + * myri10ge: report link up/down in standard ethtool way + * NET: add MAINTAINERS entry for ucc_geth driver + * [ARM] 4421/1: AT91: Value of _KEY fields. + * [PARISC] Fix bug when syscall nr is __NR_Linux_syscalls + * [AF_UNIX]: Make socket locking much less confusing. + * [TG3]: Fix link problem on Dell's onboard 5906. + * [AF_UNIX]: Fix datagram connect race causing an OOPS. + * [TCP]: Use default 32768-61000 outgoing port range in all cases. + * [ATM]: Fix warning. + * [NET]: Make net watchdog timers 1 sec jiffy aligned. + * [NET]: Fix comparisons of unsigned < 0. + * [TCP]: Fix GSO ignorance of pkts_acked arg (cong.cntrl modules) + * [NET] gso: Fix GSO feature mask in sk_setup_caps + * [IPV4]: Fix "ipOutNoRoutes" counter error for TCP and UDP + * [ICMP]: Fix icmp_errors_use_inbound_ifaddr sysctl + * [VIDEO]: XVR500 and XVR2500 require FB=y + * [ATA]: Don't allow to enable this for SPARC64 without PCI. + * sh: Fix in_nmi symbol build error. + * sh: microdev: Fix compile warnings. + * sh: Fix SH4-202 clock fwk set_rate() mismatch. + * sh: voyagergx: Fix build warnings. + * sh: ioremap() through PMB needs asm/mmu.h. + * sh: Fix se73180 platform device registration. + * Input: ucb1x00 - do not access input_dev->private directly + * Input: reduce raciness when input handlers disconnect + * [PARISC] Fix kernel panic in check_ivt + * [SCSI] atari_NCR5380: update_timeout removal + * [SCSI] JAZZ ESP and SUN ESP need SPI_ATTRS + * [CIFS] fix mempool destroy done in wrong order in cifs error path + * SPI dynamic busid generation bugfix + * mtrr atomicity fix + * vanishing ioctl handler debugging + * libata: always use polling SETXFER + * Linux 2.6.22-rc4 + * [SPARC64]: Move topology init code into new file, sysfs.c + * [SPARC64]: Export basic cpu properties via sysfs. + * [SPARC64]: Fix service channel hypervisor function names. + * [SPARC64]: Provide mmu statistics via sysfs. + * [SPARC64]: Proper multi-core scheduling support. + * [SPARC64]: Make core and sibling groups equal on UltraSPARC-IV. + * [SPARC64]: Fix {mc,smt}_capable(). + * [SPARC64]: Fill in gaps in non-PCI dma_*() NOP implementation. + * [ATA]: Back out bogus (SPARC64 && !PCI) Kconfig depends. + * [VIDEO]: Fix section mismatch warning in promcon. + * [CIFS] whitespace cleanup + * [ARM] Fix 4417/1: Serial: Fix AMBA drivers locking + * [VIDEO] ffb: The pseudo_palette is only 16 elements long + * [ARM] pxa: fix pxa27x keyboard driver + * [VIDEO] sunxvr2500fb: Fix pseudo_palette array size + * [VIDEO] sunxvr500fb: Fix pseudo_palette array size + * [CIFS] whitespace cleanup part 2 + * [CIFS] Missing flag on negprot needed for some servers to force packet + signing + * [MIPS] Atlas, Malta, SEAD: Remove scroll from interrupt handler. + * [MIPS] Remove duplicate fpu enable hazard code. + * [MIPS] EMMA2RH: remove dead KGDB code + * [MIPS] RM300: Fix MMIO problems by marking the PCI INT ACK region busy + * [MIPS] Fix VGA corruption on RM300C + * [MIPS] Drop __ARCH_WANT_SYS_FADVISE64 + * [MIPS] Make dma_map_sg handle sg elements which are longer than one + page + * [MIPS] Fix some system calls with long long arguments + * [MIPS] Remove prototype for deleted function qemu_handle_int + * [MIPS] Fix some minor typoes in arch/mips/Kconfig. + * [MIPS] Fix warning by moving do_default_vi into CONFIG_CPU_MIPSR2_SRS + * [AGPGART] intel_agp: cleanup intel private data + * [AGPGART] intel_agp: use table for device probe + * [AGPGART] intel_agp: add support for 965GME/GLE + * [AGPGART] intel_agp: add support for 945GME + * [AGPGART] intel_agp: Add support for G33, Q33 and Q35 chipsets + * ocfs2: Fix masklog breakage + * ocfs2: Fix invalid assertion during write on 64k pages + * [POWERPC] pasemi: Fix iommu + 64K PAGE_SIZE bug + * [POWERPC] spufs: Refuse to load the module when not running on cell + * [POWERPC] spufs: Hook up spufs_release_mem + * [POWERPC] spufs: Fix gang destroy leaks + * [POWERPC] spufs: Free mm if spufs_fill_dir() failed + * [POWERPC] spufs: Synchronize pte invalidation vs ps close + * [POWERPC] spufs scheduler: Fix wakeup races + * [POWERPC] Fix pci_setup_phb_io_dynamic for pci_iomap + * [POWERPC] cbe_cpufreq: Limit frequency via cpufreq notifier chain + * [POWERPC] scc_sio: Fix link failure + * [POWERPC] Fix typo in booting-without-of-txt section numbering + * [POWERPC] spufs: Don't yield nosched context + * [POWERPC] Add table of contents to booting-without-of.txt + * [POWERPC] spufs: Fix error handling in spufs_fill_dir() + * mmc-atmel: remove linux/mmc/protocol.h dependencies + * au1xmmc: Replace C code with call to ARRAY_SIZE() macro. + * mmc: fix broken if clause + * mmc: don't call switch on old cards + * [POWERPC] Fix building of COFF zImages + * checkpatch.pl: should be executable + * Restrict clearing TIF_SIGPENDING + * mlx4_core: Fix CQ context layout + * mlx4_core: Initialize ctx_list and ctx_lock earlier + * mlx4_core: Free catastrophic error MSI-X interrupt with correct dev_id + * IB/mthca, mlx4_core: Fix typo in comment + * [BNX2]: Fix netdev watchdog on 5708. + * [BNX2]: Add missing wait in bnx2_init_5709_context(). + * [BNX2]: Enable DMA on 5709. + * [BNX2]: Fix occasional counter corruption on 5708. + * [BNX2]: Update version and reldate. + * [TCP]: Honour sk_bound_dev_if in tcp_v4_send_ack + * [IPV4]: Only panic if inetdev_init fails for loopback + * [IPV4]: Convert IPv4 devconf to an array + * [IPV4]: Add default config support after inetdev_init + * [IPV4]: Restore old behaviour of default config values + * [RFKILL]: Make rfkill->name const + * [TCP]: Use LIMIT_NETDEBUG in tcp_retransmit_timer(). + * [TCP] tcp_probe: Attach printf attribute properly to printl(). + * [NETLINK]: Mark netlink policies const + * [RTNETLINK]: ifindex 0 does not exist + * [NETFILTER]: nf_conntrack: fix helper module unload races + * [NETFILTER]: ip_tables: fix compat related crash + * [NETFILTER]: nf_conntrack_amanda: fix textsearch_prepare() error check + * [AF_UNIX]: Fix stream recvmsg() race. + * [UDP]: Revert 2-pass hashing changes. + * [NET]: Avoid duplicate netlink notification when changing link state + * [NET_SCHED]: Fix filter double free + * xfrm: Add security check before flushing SAD/SPD + * [SPARC64]: Fix 2 bugs in PCI Sabre bus scanning. + * [SPARC64]: Fix SBUS IRQ regression caused by PCI-E driver. + * frv: build fix + * enable interrupts in user path of page fault. + * RAMFS NOMMU: missed POSIX UID/GID inode attribute checking + * [SPARC64]: Include instead of . + * [SPARC64]: Handle PCI bridges without 'ranges' property. + * mlx4_core: Check firmware command interface revision + * mlx4_core: Don't set MTT address in dMPT entries with PA set + * IB/mlx4: Fix zeroing of rnr_retry value in ib_modify_qp() + * RDMA/cma: Fix initialization of next_port + * IB/mlx4: Make sure RQ allocation is always valid + * splice: move inode size check into generic_file_splice_read() + * splice: remove do_splice_direct() symbol export + * pipe: move pipe_inode_info structure decleration up before it's used + * splice: move balance_dirty_pages_ratelimited() outside of splice actor + * splice: __generic_file_splice_read: fix i_size_read() length checks + * splice: __generic_file_splice_read: fix read/truncate race + * V4L/DVB (5702): Fix Kconfig items to avoid linkedition errors + * V4L/DVB (5700): Saa7111: fix picture settings cache bug + * V4L/DVB (5699): Cinergyt2: fix file release handler + * V4L/DVB (5675): Move big PIO accesses from the interrupt handler to a + workhandler + * V4L/DVB (5716): Tda10086,tda826x: fix tuning, STR/SNR values + * V4L/DVB (5720): Usbvision: fix urb allocation and submits + * V4L/DVB (5730): Remove unused V4L2_CAP_VIDEO_OUTPUT_POS + * V4L/DVB (5732): Add ivtv CROPCAP support and fix ivtv S_CROP for video + output. + * V4L/DVB (5736): Add V4L2_FBUF_CAP/FLAG_LOCAL/GLOBAL_INV_ALPHA + * V4L/DVB (5673): Fix audio stuttering for saa711x/ivtv when in radio + mode. + * V4L/DVB (5761): Fix broken b2c2 dependency on non x86 architectures + * V4L/DVB (5751): Ivtv: fix ia64 printk format warnings. + * serverworks: remove crappy code + * serverworks: fix CSB6 tuning logic + * it821x: RAID mode fixes + * ide: HPA detect from resume + * ide: generic IDE PCI driver, add another device exception + * hpt366: disallow Ultra133 for HPT374 + * Add the PATA controller device ID to pci_ids.h for MCP73/MCP77. + * ide: Add the MCP73/77 support to PATA driver + * [CIFS] CIFS should honour umask + * update Documentation/driver-model/platform.txt + * Driver core: keep PHYSDEV for old struct class_device + * Driver core: kill unused code + * kobject: use the proper printk level for kobject error + * firmware: remove orphaned Email + * [IPV4]: Do not remove idev when addresses are cleared + * [NetLabel]: consolidate the struct socket/sock handling to just struct + sock + * [CIPSO]: Fix several unaligned kernel accesses in the CIPSO engine. + * USB: set default y for CONFIG_USB_DEVICE_CLASS + * usblp: Don't let suspend to kill ->used + * USB: usb gadgets avoid le{16,32}_to_cpup() + * USB: UNUSUAL_DEV: Sync up some reported devices from Ubuntu + * USB: cxacru: add Documentation file + * USB: cxacru: create sysfs attributes in atm_start instead of bind + * USB: cxacru: ignore error trying to start ADSL in atm_start + * USB: Fix up bogus bInterval values in endpoint descriptors + * OHCI: Fix machine check in ohci_hub_status_data + * update checkpatch.pl to version 0.03 + * m68knommu: fix ColdFire timer off by 1 + * nommu: report correct errno in message + * loop: preallocate eight loop devices + * document Acked-by: + * update feature-removal-schedule.txt to include deprecated functions + * mount -t tmpfs -o mpol=: check nodes online + * slab: fix alien cache handling + * potential parse error in ifdef part 3 + * SLUB: return ZERO_SIZE_PTR for kmalloc(0) + * uml: fix kernel stack size on x86_64 + * Documentation/atomic_ops.txt typo fix + * Move three functions that are only needed for CONFIG_MEMORY_HOTPLUG + * Char: stallion, don't fail with less than max panels + * Char: stallion, alloc tty before pci devices init + * Char: stallion, proper fail return values + * uml: get declaration of simple_strtoul + * isdn/diva: fix section mismatch + * sata_promise: use TF interface for polling NODATA commands + * rt-mutex: fix stale return value + * rt-mutex: fix chain walk early wakeup bug + * pi-futex: fix exit races and locking problems + * fix sysrq-m oops + * x86_64: oops_begin() fix + * reiserfs: mailing list has moved + * checkpatch: produce fewer lines of output + * MAINTAINERS: corrections + * hexdump: more output formatting + * update checkpatch.pl to version 0.04 + * Protect from multiple inclusion + * [IrDA]: Fix Rx/Tx path race. + * [IrDA]: f-timer reloading when sending rejected frames. + * ibmveth: Fix h_free_logical_lan error on pool resize + * ibmveth: Automatically enable larger rx buffer pools for larger mtu + * typo in via-velocity.c + * NetXen: Fix ping issue after reboot on Blades with 3.4.19 firmware + * NetXen: Fix compile failure seen on PPC architecture + * ehea: Fixed possible kernel panic on VLAN packet recv + * phylib: add RGMII-ID mode to the Marvell m88e1111 PHY to fix broken + ucc_geth + * net: fix typo in drivers/net/usb/Kconfig + * remove unused variable in pata_isapnp + * libata: disable NCQ for HITACHI HTS541680J9SA00/SB21C7EP + * libata: fix probe time irq printouts + * libata: print device model and firmware revision for ATAPI devices + * libata: fix hw_sata_spd_limit initialization + * ahci: Add MCP73/MCP77 support to AHCI driver + * libata-core/sff: Fix multiple assumptions about DMA + * libata: Correct abuse of language + * libata passthru: update protocol numbers + * libata passthru: support PIO multi commands + * libata passthru: map UDMA protocols + * libata passthru: always enforce correct DEV bit + * libata passthru: update cached device paramters + * i915: add new pciids for 945GME, 965GME/GLE + * drm/i915: Add support for the G33, Q33, and Q35 chipsets. + * drm: fix radeon setparam on 32/64 bit systems. + * [ARM] VFP: fix section mismatch error + * libata: force PIO on IOMEGA ZIP 250 ATAPI + * libata: limit post SRST nsect/lbal wait to ~100ms + * Blackfin arch: remove defconfig file + * Blackfin arch: DMA code minor naming convention fix + * Blackfin arch: spelling fixes + * Blackfin arch: fix bug ad1836 fails to build properly for BF533-EZKIT + * Blackfin arch: all symbols were offset by 4k, since we didn't have the + __text label. + * Blackfin arch: mark our memory init functions with __init so they get + freed after init + * Blackfin arch: implement a basic /proc/sram file for L1 allocation + visibility + * Blackfin arch: fixup Blackfin MAINTIANERS team member list + * Blackfin arch: scrub old console defines + * Blackfin arch: update defconfigs + * Blackfin arch: unify differences between our diff head.S files -- no + functional changes + * Blackfin arch: move more of our startup code to .init so it can be + freed once we are up and running + * Blackfin arch: add proper ENDPROC() + * Blackfin arch: try to split up functions like this into smaller units + according to LKML review + * Blackfin arch: fix spelling typo in output + * Blackfin arch: As Mike pointed out range goes form m..MAX_BLACKFIN_GPIO + -1 + * Blackfin arch: add missing gpio.h header to fix compiling in some pm + configurations + * Blackfin arch: add support for Alon Bar-Lev's dynamic kernel + command-line + * Blackfin arch: fix bug can not wakeup from sleep via push buttons + * Blackfin arch: make sure we initialize our L1 Data B section properly + based on the linked kernel + * Blackfin arch: redo our linker script a bit + * Blackfin arch: move HI/LO macros into blackfin.h and punt the rest of + macros.h as it includes VDSP macros we never use + * Blackfin serial driver: hook up our UARTs STP bit with userspaces + CMSPAR + * Blackfin serial driver: ignore framing and parity errors + * Blackfin serial driver: actually implement the break_ctl() function + * Blackfin serial driver: decouple PARODD and CMSPAR checking from PARENB + * Blackfin RTC drivers: update MAINTAINERS information + * Blackfin SPI driver: tweak spi cleanup function to match newer kernel + changes + * [ARM] 4442/1: OSIRIS: Fix CPLD register definitions + * [ARM] 4443/1: OSIRIS: Add watchdog device to machine devices + * [ARM] 4444/2: OSIRIS: CPLD suspend fix + * [ARM] 4445/1: ANUBIS: Fix CPLD registers + * Blackfin SPI driver: fix bug SPI DMA incomplete transmission + * Blackfin SMC91X ethernet supporting driver: SMC91C111 LEDs are note + drived in the kernel like in uboot + * [MIPS] Fix KMODE for the R3000 + * [MIPS] SMTC: Don't set and restore irqregs ptr from self_ipi. + * [MIPS] Always install the DSP exception handler. + * [MIPS] Atlas: Fix build. + * [MIPS] Wire up utimensat, signalfd, timerfd, eventfd + * [MIPS] SMTC: Fix warning. + * [MIPS] SMTC: Don't continue in set_vi_srs_handler on detected bad + arguments. + * [MIPS] SMTC: The MT ASE requires to initialize c0_pagemask and + c0_wired. + * [MIPS] SMTC: Fix build error caused by nonsense code. + * [MIPS] Fix modpost warnings by making start_secondary __cpuinit + * [MIPS] Fix IP27 build + * [MIPS] Fix smp barriers in test_and_{change,clear,set}_bit + * libertas: scan two channels per scan command + * libertas: rename wlan_association_worker + * libertas: a debug output was missing a newline + * libertas: fix removal of all debugfs files + * libertas: remove deprecated pm_register and associated code + * libertas: remove __FILE__ from debug output + * libertas: remove unused/superfluous definitions of DEV_NAME_LEN + * libertas: move vendor & product id's into if_usb.c + * libertas: make libertas_wlan_data_rates static + * libertas: fix scanning from associate path + * libertas: exclude non-used code when PROC_DEBUG is not set + * libertas: make debug configurable + * libertas: tune debug code + * libertas: single out mesh code + * libertas: change debug output of libertas_interrupt() + * libertas: get rid of libertas_sbi_get_priv() + * libertas: fix SSID output + * libertas: changed some occurences of kmalloc() + memset(&a,0,sz) to + kzalloc() + * libertas: move reset_device() code main.c to if_usb.c + * libertas: split wlan_add_card() + * libertas: fixed transmission flow control on the mesh interface + * libertas: fix error handling of card initialization + * libertas: added transmission failures to mesh statistics + * libertas: wakeup both mesh and normal wakeup when getting out of scan + * libertas: indirect all hardware access via hw_XXXX functions + * libertas: move contents of fw.h to decl.h + * libertas: split module into two (libertas.ko and usb8xxx.ko) + * libertas: fix RESET logic at unload time + * libertas: let DRV_NAME be overridable + * libertas: remove unused variables in wlan_dev_t + * libertas: fixed incorrect assigment of fcs errors to frag errors + * libertas: add URB debug info + * libertas: fixed kernel oops on module/card removal + * libertas: call SET_NETDEV_DEV from common code + * libertas: replace 'macaddress' with 'bssid' + * libertas: correctly unregister mesh netdev on error + * libertas: don't tear down netdev in libertas_activate_card + * libertas: version bump (321p0) and cmds update for new fw (5.220.10.p0) + * libertas: updated mesh commands for 5.220.9.p11 + * libertas: make scan result handling more flexible + * libertas: fix 'keep previous scan' behavior + * libertas: cleanup of fwt_list_route processing + * libertas: fix oops on rmmod + * libertas: move channel changing into association framework + * libertas: make association paths consistent + * libertas: use MAC_FMT and MAC_ARG where appropriate + * libertas: use compare_ether_addr() rather than memcmp() where + appropriate + * libertas: fix debug enter/leave prints for + libertas_execute_next_command + * libertas: correctly balance locking in libertas_process_rx_command + * libertas: correct error report paths for wlan_fwt_list_ioctl + * libertas: fix deadlock SIOCGIWSCAN handler + * libertas: fix default adhoc channel + * libertas: honor specific channel requests during association + * libertas: send SIOCGIWSCAN event after partial scans too + * libertas: debug print spacing fixes in assoc.c + * libertas: add more verbose debugging to libertas_cmd_80211_authenticate + * libertas: Make WPA work through supplicant handshake + * libertas: updated readme file + * libertas: make mac address configuration work with mesh interface too + * libertas: split wext for eth and msh + * libertas: support for mesh autostart on firmware 5.220.11 + * libertas: fix character set in README + * libertas: sparse fixes + * libertas: first pass at fixing up endianness issues + * libertas: More endianness fixes. + * libertas: more endianness fixes, in tx.c this time + * libertas: don't byte-swap firmware version number. It's a byte array. + * libertas: fix big-endian associate command. + * libertas: tweak association debug output + * libertas: remove structure WLAN_802_11_SSID and libertas_escape_essid + * libertas: remove WPA_SUPPLICANT structure + * libertas: reduce SSID and BSSID mixed-case abuse + * kbuild: fix sh64 section mismatch problems + * cfg80211: fix signed macaddress in sysfs + * mac80211: fix debugfs tx power reduction output + * mac80211: Don't stop tx queue on master device while scanning. + * Input: usbtouchscreen - fix fallout caused by move from drivers/usb + * Input: i8042 - add ASUS P65UP5 to the noloop list + * Input: i8042 - add ULI EV4873 to noloop list + * [PARISC] remove global_ack_eiem + * libertas: pull current channel from firmware on mesh autostart + * libertas: deauthenticate from AP in channel switch + * libertas: actually send mesh frames to mesh netdev + * libertas: convert libertas_mpp into anycast_mask + * [PPP_MPPE]: Fix "osize too small" check. + * NetXen: Fix link status messages + * myri10ge: limit the number of recoveries + * myri10ge: report when the link partner is running in Myrinet mode + * myri10ge: update driver version + * sysfs: store sysfs inode nrs in s_ino to avoid readdir oopses + * sysfs: fix condition check in sysfs_drop_dentry() + * sysfs: fix race condition around sd->s_dentry, take#2 + * [TCP]: Fix left_out setting during FRTO + * Input: move input-polldev to drivers/input + * [SPARC64]: Wire up cookie based sun4v interrupt registry. + * [SPARC64]: Fix IO/MEM space sizing for PCI. + * [SPARC64]: Really fix parport. + * [SPARC64]: Fix args to sun4v_ldc_revoke(). + * [TCP]: Set initial_ssthresh default to zero in Cubic and BIC. + * mmc-omap: fix sd response type 6 vs. 1 + * mmc: get back read-only switch function + * [SCTP]: Correctly set daddr for IPv6 sockets during peeloff + * [SCTP]: Allow unspecified port in sctp_bindx() + * [SCTP] Fix leak in sctp_getsockopt_local_addrs when copy_to_user fails + * [SCTP] Update pmtu handling to be similar to tcp + * [SCTP] Flag a pmtu change request + * [SCTP] Don't disable PMTU discovery when mtu is small + * [POWERPC] Fix per-cpu allocation on oldworld SMP powermacs + * [POWERPC] Fix console output getting dropped on platforms without + udbg_putc + * [AVR32] ratelimit segfault reporting rate + * [AVR32] gpio_*_cansleep() fix + * [AVR32] STK1000: Set SPI_MODE_3 in the ltv350qv board info + * [AVR32] Define ARCH_KMALLOC_MINALIGN to L1_CACHE_BYTES + * [MIPS] Malta: Fix for SOCitSC based Maltas + * [MIPS] Separate performance counter interrupts + * [MIPS] Fix builds where MSC01E_xxx is undefined. + * [TCP]: Add missing break to TCP option parsing code + * [IPV6] addrconf: Fix IPv6 on tuntap tunnels + * [AGPGART] intel_agp: fix device probe + * KVM: Prevent guest fpu state from leaking into the host + * splice: adjust balance_dirty_pages_ratelimited() call + * splice: fix leak of pages on short splice to pipe + * splice: only check do_wakeup in splice_to_pipe() for a real pipe + * [TCP]: Congestion control API RTT sampling fix + * [TCP]: Fix logic breakage due to DSACK separation + * [RXRPC] net/rxrpc/ar-connection.c: fix NULL dereference + * block: always requeue !fs requests at the front + * mm: Fix memory/cpu hotplug section mismatch and oops. + * Resume from RAM on HPC nx6325 broken + * ide-scsi: fix OOPS in idescsi_expiry() + * fix radeon setparam on 32/64 systems, harder. + * tty: restore locked ioctl file op + * i386: fix NMI watchdog not reserving its MSRs + * i386: use the right wrapper to disable the NMI watchdog + * SLUB slab validation: Alloc while interrupts are disabled must use + GFP_ATOMIC + * Restore shmid as inode# to fix /proc/pid/maps ABI breakage + * i386 mm: use pte_update() in ptep_test_and_clear_dirty() + * cpuset: zero malloc - fix for old cpusets + * toshiba_acpi: fix section mismatch in allyesconfig + * swsusp: Fix userland interface + * perfctr-watchdog: fix interchanged parameters to + release_{evntsel,perfctr}_nmi + * fuse: ->fs_flags fixlet + * md: fix two raid10 bugs + * md: fix bug in error handling during raid1 repair + * spi doc updates + * uml: remove PAGE_SIZE from libc code + * uml: kill x86_64 STACK_TOP_MAX + * random: fix output buffer folding + * Rework ptep_set_access_flags and fix sun4c + * SLUB: minimum alignment fixes + * udf: fix possible leakage of blocks + * hugetlb: fix get_policy for stacked shared memory files + * shm: fix the filename of hugetlb sysv shared memory + * Linux 2.6.22-rc5 + * [GFS2] flush the glock completely in inode_go_sync + * [DLM] fix a couple of races + * [GFS2] kernel changes to support new gfs2_grow command + * [GFS2] Kernel changes to support new gfs2_grow command (part 2) + * [GFS2] use zero_user_page + * [GFS2] Addendum patch 2 for gfs2_grow + * [GFS2] Reduce size of struct gdlm_lock + * [GFS2] Clean up inode number handling + * [GFS2] Quotas non-functional - fix bug + * [DLM] keep dlm from panicing when traversing rsb list in debugfs + * [DLM] block scand during recovery [1/6] + * [DLM] add lock timeouts and warnings [2/6] + * [DLM] dlm_device interface changes [3/6] + * [DLM] cancel in conversion deadlock [4/6] + * [DLM] fix new_lockspace error exit [5/6] + * [DLM] wait for config check during join [6/6] + * [DLM] fix compile breakage + * [GFS2] latest gfs2-nmw headers break userland build + * [DLM] Compile fix + * [DLM] timeout fixes + * [DLM] canceling deadlocked lock + * [DLM] dumping master locks + * [DLM] show default protocol + * [GFS2] Quotas non-functional - fix another bug + * [GFS2] Make the log reserved blocks depend on block size + * [DLM] fix socket shutdown + * [GFS2] fix jdata issues + * [GFS2] Fix sign problem in quota/statfs and cleanup _host structures + * [GFS2] Add nanosecond timestamp feature + * [DLM] fix reference counting + * [DLM] variable allocation + * [GFS2] Fix typo in rename of directories + * [GFS2] Fix bug in error path of inode + * [GFS2] Can't mount GFS2 file system on AoE device + * [GFS2] Recovery for lost unlinked inodes + * [GFS2] gfs2_lookupi() uninitialised var fix + * [GFS2] set plock owner in GETLK info + * [GFS2] return conflicts for GETLK + * [GFS2] Fix deallocation issues + * [DLM] don't require FS flag on all nodes + * [GFS2] Journaled file write/unstuff bug + * [GFS2] Remove bogus '\0' in rgrp.c + * [GFS2] Use zero_user_page() in stuffed_readpage() + * [GFS2] assertion failure after writing to journaled file, umount + * [GFS2] Simplify multiple glock aquisition + * [GFS2] Addendum to the journaled file/unmount patch + + -- Ben Collins Fri, 01 Jun 2007 12:15:58 -0400 + +linux-source-2.6.22 (2.6.22-6.13) gutsy; urgency=low + + [Ben Collins] + + * Bump ABI + * build/scripts: Remove all remnants of debconf from control scripts + * build/config: Re-enable paravirt/vmi + * build/config: Build ide-core as a module + * i386/x86_64: Allow disabling the putstr's from compressed boot wrapper + * PM: Do not require dev spew to get PM_DEBUG + * RTC: Ratelimit "lost interrupts" message + * UNUSUAL_DEV: Sync up some reported devices from Ubuntu + * build/d-i: Include ide-core in storage-core udeb, not that it's modular + * build/d-i: Make ide-modules depend on storage-code-modules + * build/config: Enable CONFIG_TIMER_STATS on x86_64. + * build/config: Disable CONFIG_RTC_DRV_CMOS + * build/config: Enable TIMER_STATS everywhere. + * build/config: Enable SND_AC97_POWER_SAVE + - LP: #116679 + * kmod: Improve call_usermodehelper_pipe to handle data close + * coredump: Convert to new call_usermodehelper_pipe symantics + * PPC: Only set hwif stuff when ide-core is non-modular + * PPC/MEDIABAY: Export some functions for modular ide-core/ppc-ide + + [Colin Watson] + + * Move isofs to storage-core-modules udeb from fs-core-modules. + + [Upstream Kernel Changes] + + * Input: logips2pp - add type 72 (PS/2 TrackMan Marble) + * Input: adbhid - do not access input_dev->private directly + * sh: Shut up compiler warnings in __do_page_fault(). + * sh: Fix up psw build rules for r7780rp. + * sh: Kill off pmb slab cache destructor. + * sh: landisk: rtc-rs5c313 support. + * sh: landisk: Header cleanups. + * input: hp680_ts compile fixes. + * [ARM] 4375/1: sharpsl_pm: Fix compile warnings + * [ARM] 4376/1: Selects GENERIC_GPIO for ARCH_IXP4XX in Kconfig + * [ARM] 4378/1: KS8695: Serial driver fix + * [ARM] Remove Integrator/CP SMP platform support + * [ARM] 4382/1: iop13xx: fix msi support + * [ARM] 4383/1: iop: fix usage of '__init' and 'inline' in iop files + * [ARM] 4384/1: S3C2412/13 SPI registers offset correction + * [ARM] Update ARM syscalls + * [ARM] Silence OMAP kernel configuration warning + * [ARM] gic: Fix gic cascade irq handling + * [ARM] integrator: fix pci_v3 compile error with DEBUG_LL + * [ARM] ARMv6: add CPU_HAS_ASID configuration + * [CRYPTO] padlock: Make CRYPTO_DEV_PADLOCK a tristate again + * [CRYPTO] tcrypt: Add missing error check + * eventfd use waitqueue lock ... + * timerfd use waitqueue lock ... + * [IA64] Fix bogus messages about system calls not implemented. + * [IA64] Yet another section mismatch warning + * Fix roundup_pow_of_two(1) + * Further update of the i386 boot documentation + * cciss: Fix pci_driver.shutdown while device is still active + * Linux v2.6.22-rc2 + * [CRYPTO] api: Read module pointer before freeing algorithm + * powerpc: Fix the MODALIAS generation in modpost for of devices + * kbuild: include limits.h in sumversion.c for PATH_MAX + * kconfig: search harder for curses library in check-lxdialog.sh + * kbuild: make modpost section warnings clearer + * kbuild: make better section mismatch reports on i386, arm and mips + * kbuild: add "Section mismatch" warning whitelist for powerpc + * all-archs: consolidate .text section definition in asm-generic + * all-archs: consolidate .data section definition in asm-generic + * kbuild: introduce __init_refok/__initdata_refok to supress section + mismatch warnings + * init/main: use __init_refok to fix section mismatch + * mm: fix section mismatch warnings + * mm/slab: fix section mismatch warning + * IB/core: Free umem when mm is already gone + * IB/ipath: Fix potential deadlock with multicast spinlocks + * IB/core: Add helpers for uncached GID and P_Key searches + * IB/core: Use start_port() and end_port() + * IPoIB: Handle P_Key table reordering + * IB/ehca: Return proper error code if register_mr fails + * IB/mthca: Fix use-after-free on device restart + * IB/mlx4: Fix check of max_qp_dest_rdma in modify QP + * IB/mthca: Set GRH:HopLimit when building MLX headers + * IB/mlx4: Set GRH:HopLimit when sending globally routed MADs + * IB/mthca: Fix RESET to ERROR transition + * IB/mlx4: Fix RESET to RESET and RESET to ERROR transitions + * mlx4_core: Fix array overrun in dump_dev_cap_flags() + * IB/mlx4: Fix check of opcode in mlx4_ib_post_send() + * [IPV6]: Add ip6_tunnel.h to headers_install + * [RFKILL]: Fix check for correct rfkill allocation + * [NET]: Fix net/core/skbuff.c gcc-3.2.3 compilation error + * [TCP] FRTO: Add missing ECN CWR sending to one of the responses + * [TCP] FRTO: Prevent state inconsistency in corner cases + * [IPSEC] pfkey: Load specific algorithm in pfkey_add rather than all + * [NETFILTER]: nf_conntrack: fix use-after-free in helper destroy + callback invocation + * [NETFILTER]: nf_conntrack_ipv4: fix incorrect #ifdef config name + * [IPV4]: icmp: fix crash with sysctl_icmp_errors_use_inbound_ifaddr + * [NET]: Fix race condition about network device name allocation. + * IB/mlx4: Pass send queue sizes from userspace to kernel + * [ARM] 4387/1: fix /proc/cpuinfo formatting for pre-ARM7 parts + * [ARM] 4388/1: no need for arm/mm mmap range checks for non-mmu + * [ARM] 4395/1: S3C24XX: add include of to relevant + machines + * [ARM] 4396/1: S3C2443: Add missing HCLK clocks + * [ARM] 4397/1: S3C2443: remove SDI0/1 IRQ ambiguity + * [ARM] 4398/1: S3C2443: Fix watchdog IRQ number + * [ARM] 4399/2: S3C2443: Fix SMDK2443 nand timings + * [ARM] 4400/1: S3C24XX: Add high-speed MMC device definition + * [ARM] at91_adc parenthesis balance + * [ARM] spelling fixes + * IB/mlx4: Check if SRQ is full when posting receive + * spelling fixes: arch/sh/ + * sh: revert addition of page fault notifiers + * sh: Wire up signalfd/timerfd/eventfd syscalls. + * sh: Fix up various compile warnings for SE boards. + * sh: Fix page size alignment in __copy_user_page(). + * sh: Disable psw support for R7785RP. + * fs: Kill sh dependency for binfmt_flat. + * sh: disable genrtc support. + * sh: sr.bl toggling around idle sleep. + * sh: Wire up kdump crash kernel exec in die(). + * sh: Fix clock multiplier on SH7722. + * sh: Fix dreamcast build for IRQ changes. + * [S390] cio: Update documentation. + * [S390] Wire up sys_utimensat. + * [S390] Wire up signald, timerfd and eventfd syscalls. + * [S390] Make use of kretprobe_assert. + * [S390] More verbose show_mem() like other architectures. + * Fix "fs: convert core functions to zero_user_page" + * Detach sched.h from mm.h + * Blackfin arch: Add Workaround for ANOMALY 05000257 + * Blackfin arch: add SPI MMC driver support on bf533-stamp, tested on + STAMP-BF533 + * Blackfin arch: ISP1761 doesn't work for USB flash disk + * Blackfin arch: fix a few random warnings + * Blackfin arch: Add configuration data for ISP176x on BF561 + * Blackfin arch: mark a bunch of local functions as static + * Blackfin arch: Fix reserved map after we changed PORT_H definition + * Blackfin arch: Move write to VR_CTL closer to IDLE + * Blackfin arch: DMA operation cleanup + * Blackfin arch: GPIO fix some defines + * Blackfin arch: fix trace output for FLAT binaries + * Blackfin arch: Fix bug using usb keyboard crashes kernel + * Blackfin arch: initial tepla-bf561 board support + * Blackfin arch: make sure we declare the revid functions as pure (since + they are) + * Blackfin arch: dont clear status register bits in SWRST so we can + actually use it + * Blackfin arch: finish removing p* volatile defines for MMRs + * Blackfin arch: move board specific setup out of common init code and + into the board specific init code + * Blackfin arch: issue reset via SWRST so we dont clobber the watchdog + state + * Blackfin arch: document why we have to touch the UART peripheral in our + boot up code + * Blackfin arch: dma_memcpy borken for > 64K + * Blackfin arch: dont clear the bit that tells coreb to start booting + * Blackfin arch: make sure we use local labels + * Blackfin arch: update blackfin header files to latest one in VDSP. + * Blackfin arch: cache SWRST value at bootup so other things like + watchdog can non-destructively query it + * Blackfin arch: fix signal handling bug + * Blackfin arch: Change NO_ACCESS_CHECK to ACCESS_CHECK + * Blackfin arch: add board default configs to blackfin arch + * Blackfin arch: update defconfig files + * Blackfin arch: update pm.c according to power management API change. + * Blackfin serial driver: fix overhead issue + * Blackfin serial driver: implement support for ignoring parity/break + errors + * Blackfin SPI: cleanup according to David Brownell's review + * x86_64: Update defconfig + * i386: Update defconfig + * x86_64: Support x86_64 in make buildtar + * i386: Fix K8/core2 oprofile on multiple CPUs + * x86_64: Support gcc 5 properly + * i386: Clear MCE flag on AMD K6 + * i386: Fix wrong CPU error message in early boot path + * i386: Enable CX8/PGE CPUID bits early on VIA C3 + * x86_64: early_print kernel console should send CRLF not LFCR + * x86_64: vsyscall time() fix + * i386: fix PGE mask + * LDM: Fix for Windows Vista dynamic disks + * IB/ipoib: Fix typos in error messages + * IPoIB/cm: Fix SRQ WR leak + * IB/cm: Improve local id allocation + * e1000: Don't enable polling in open() (was: e1000: assertion hit in + e1000_clean(), kernel 2.6.21.1) + * declance: Remove a dangling spin_unlock_irq() thingy + * Add constant for FCS/CRC length (frame check sequence) + * ahci: disable 64bit dma on sb600 + * libata: Add Seagate STT20000A to DMA blacklist. + * pata_hpt366: Enable bits are unreliable so don't use them + * ata_piix: clean up + * libata: Kiss post_set_mode goodbye + * libata: Trim trailing whitespace + * partitions/LDM: build fix + * Make 'headerscheck' stop immediately on an error + * Fix headers check fallout + * [POWERPC] Fix smp_call_function to be preempt-safe + * [POWERPC] Add missing pmc_type fields in cpu_table + * [POWERPC] Fix typo: MMCR0_PMA0 != MMCR0_PMAO + * [POWERPC] Fix powerpc vmlinux.lds.S + * [POWERPC] Fix warning in 32-bit builds with CONFIG_HIGHMEM + * libertas: skb dereferenced after netif_rx + * drivers/net/wireless/libertas/fw.c: fix use-before-check + * drivers/net/wireless/libertas/rx.c: fix use-after-free + * [IA64] Improve unwind checking. + * [IA64] Only unwind non-running tasks. + * [IA64] fix kmalloc(0) in arch/ia64/pci/pci.c + * i2c: Legacy i2c drivers shouldn't issue uevents + * i2c-tiny-usb: Fix truncated adapter name + * i2c-s3c2410: Fix build warning + * V4L/DVB (5639): Fix Kconfig dependencies for ivtv + * V4L/DVB (5640): Fix: em28xx shouldn't be selecting VIDEO_BUF + * V4L/DVB (5670): Adding new fields to v4l2_pix_format broke the ABI, + reverted that change + * V4L/DVB (5639a): Fix dst usage count + * V4L/DVB (5630): Dvb-core: Handle failures to create devices + * V4L/DVB (5680): Tuner-simple.c fix suport for SECAM with FI1216MF + * V4L/DVB (5690): Cafe_ccic: Properly power down the sensor + * V4L/DVB (5691): Ov7670: reset clkrc in rgb565 mode + * [IPSEC]: Fix warnings with casting int to pointer + * [AF_RXRPC]: AF_RXRPC depends on IPv4 + * [AF_RXRPC]: Make call state names available if CONFIG_PROC_FS=n + * [RTNETLINK]: Allow changing of subsets of netdevice flags in + rtnl_setlink + * [RTNETLINK]: Remove remains of wireless extensions over rtnetlink + * Input: iforce - fix force feedback not working + * Input: iforce - minor clean-ups + * Input: ALPS - force stream mode + * Input: ucb1400_ts - use sched_setscheduler() + * Input: ucb1x00-ts - remove commented out code + * Input: input-polldev - add module info + * Input: ads7846 - document that it handles tsc2046 too + * Input: ads7846 - SPI_CPHA mode bugfix + * USB: fix omninet memory leak found by coverity + * USB: remove useless check in mos7840 found by coverity + * usb-storage: ignore Sitecom WL-117 USB-WLAN + * USB: fix more ftdi-elan/u132-hcd #include lossage + * USB: handle more rndis_host oddities + * USB: remove usb DocBook warnings + * USB: address FIXME in usbnet w.r.t drivers claiming multiple interfaces + * EHCI: fix problem with BIOS handoff + * USB: more autosuspend timer stuff + * USB: remove unneeded WARN_ON + * USB: New device PID for ftdi_sio driver + * USB: set the correct Interrupt interval in usb_bulk_msg + * USB: fsl_usb2_udc: Fix UMTI_WIDE support and a compile warning + * USB: auerswald: fix file release handler + * USB: Remove duplicate IDs from option card driver + * USB: Deref URB after usbmon is done with it + * USB: remove short initial timeout for device descriptor fetch + * USB: don't try to kzalloc 0 bytes + * USB: Onetouch - switch to using input_dev->dev.parent + * USB: Fix debug output of ark3116 + * USB: usblp: Use correct DMA address in case of probe error + * USB: Fix USB OHCI Subvendor for Toshiba Portege 4000 + * USB: make the autosuspend workqueue thread freezable + * USB: handle errors in power/level attribute + * USB: fix ratelimit call semantics + * USB: ftdi_sio: Add USB Product Id for OpenDCC + * USB: ldusb bugfix + * USB: Add support for Sierra Wireless Aircard 595U + * USB: Add support for Olimex arm-usb-ocd JTAG interface serial port + * IB/mlx4: Don't allocate RQ doorbell if using SRQ + * [IA64] start_secondary() and smp_callin() should be __cpuinit + * add the IDE device ID for ATI SB700 + * ide/pci/serverworks.c: Fix corruption/timeouts with MegaIDE + * Add two missing chipsets to drivers/ide/ide-proc.c + * Match DMA blacklist entries between ide-dma.c and libata-core.c + * ide serverworks warning fixes + * freezer: close potential race between refrigerator and thaw_tasks + * freezer: fix vfork problem + * freezer: take kernel_execve into consideration + * freezer: fix kthread_create vs freezer theoretical race + * freezer: fix PF_NOFREEZE vs freezeable race + * freezer: move frozen_process() to kernel/power/process.c + * Ignore bogus ACPI info for offline CPUs + * SLUB Debug: Fix object size calculation + * fuse: fix mknod of regular file + * mpc52xx_psc_spi: fix it for CONFIG_PPC_MERGE + * spi doc update: describe clock mode bits + * NOHZ: Rate limit the local softirq pending warning output + * genhd: expose AN to user space + * genhd: send async notification on media change + * capability.h warning fix + * spi/spidev: check message size before copying + * uml: improve PTRACE_SYSEMU checking + * prohibit rcutorture from being compiled into the kernel + * Documentation: fix the explanation of Kconfig files + * Avoid zero size allocation in cache_k8_northbridges() + * recalc_sigpending_tsk fixes + * optimize compat_core_sys_select() by a using stack space for small fd + sets + * spi: potential memleak in spidev_ioctl + * fbdev: cleanup of sparc FB options + * pm2fb: RDAC_WR barriers clean up + * pm3fb: various fixes + * w100fb: fix compile warnings + * ps3fb: use FB_SYS_* instead of FB_CFB_* + * imxfb: remove ifdefs + * imxfb: fix memory hole + * Missing 'const' from reiserfs MIN_KEY declaration. + * uselib: add missing MNT_NOEXEC check + * fuse: generic_write_checks() for direct_io + * fuse: delete inode on drop + * fix unused setup_nr_node_ids + * SLUB Debug: fix check for super sized slabs (>512k 64bit, >256k 32bit) + * Char: cyclades, fix deadlock + * simplify cleanup_workqueue_thread() + * phantom: move to unlocked_ioctl + * Misc: phantom, take care of pci posting + * power: Fix sizeof(PAGE_SIZE) typo + * update dontdiff file + * signalfd: retrieve multiple signals with one read() call + * i2o: destroy event queue only when drv->event is set + * i2o: fix notifiers when max_drivers is configured + * i2o: eliminate a peculiar constraint on i2o_max_drivers + * i386, x86-64: show that CONFIG_HOTPLUG_CPU is required for suspend on + SMP + * md: avoid overflow in raid0 calculation with large components + * md: don't write more than is required of the last page of a bitmap + * md: fix bug with linear hot-add and elsewhere + * documentation: Documentation/initrd.txt + * HiSax: fix error checking for hisax_register()] + * applesmc - sensors patch missing from 2.6.22-rc2 + * Off by one in floppy.c + * eCryptfs: delay writing 0's after llseek until write + * document clocksources + * ehci-fsl: fix cache coherency problem on system with large memory + * Prevent going idle with softirq pending + * i386: fix early usage of atomic_add_return and local_add_return on real + i386 + * Documentation/memory-barriers.txt: various fixes + * omap_uwire: SPI_CPHA mode bugfix + * capifunc warning fixes + * drivers/isdn/hardware/eicon/message.c warning fixes + * i386 bigsmp: section mismatch fixes + * boot documentation: clarifications + * mmc: clean up unused parts of block driver + * mmc: mark unmaintained drivers + * mmc: Add maintainers for TI OMAP MMC interface + * mmc: add maintainer for iMX MMC interface + * mmc: add maintainer for ARM Primecell controller + * [CRYPTO] geode: Fix in-place operations and set key + * [Bluetooth] Always send HCI_Reset for Broadcom devices + * [Bluetooth] Fix L2CAP configuration parameter handling + * NFS: Avoid a deadlock situation on write + * NFS: Fix handful of compiler warnings in direct.c + * NFS: Fix nfs_direct_dirty_pages() + * Don't call a warnign a bug. It's a warning. + * [IA64] Fix using uninitialized data in _PDC setup + * [IA64] Cleanup acpi header to reuse the generic _PDC defines + * Documentation: Fix up docs still talking about i_sem + * [IA64] acpi_get_sysname() should be __init + * IB/mlx4: Initialize send queue entry ownership bits + * IB/ehca: Fix number of send WRs reported for new QP + * IPoIB/cm: Fix timeout check in ipoib_cm_dev_stop() + * IPoIB/cm: Drain cq in ipoib_cm_dev_stop() + * ucc_geth: Fix MODULE_DEVICE_TABLE() duplication + * ucc_geth:trivial fix + * asix.c - Add Belkin F5D5055 ids + * fix compiler warning in fixed.c + * remove unnecessary dependency on VIA velocity config + * meth driver renovation + * spidernet: skb used after netif_receive_skb + * chelsio parenthesis fix + * forcedeth: fix cpu irq mask + * [NET_SCHED]: Fix qdisc_restart return value when dequeue is empty + * [IPV6]: Ignore ipv6 events on non-IPV6 capable devices. + * [ATM]: Use mutex instead of binary semaphore in idt77252 driver. + * [DCCP]: Use menuconfig objects. + * [IPVS]: Use menuconfig objects. + * [SCTP]: Use menuconfig objects. + * [TIPC]: Use menuconfig objects. + * [ARCNET]: Use menuconfig objects. + * [TR]: Use menuconfig objects. + * [RTNETLINK]: Fix sending netlink message when replace route. + * [TIPC]: Fixed erroneous introduction of for_each_netdev + * [DCCP]: Fix build warning when debugging is disabled. + * [NET_SCHED]: sch_htb: fix event cache time calculation + * [NETFILTER]: nf_conntrack_ftp: fix newline sequence number update + * [NETFILTER]: nf_conntrack_ftp: fix newline sequence number calculation + * [NETFILTER]: nf_conntrack_h323: fix ASN.1 types + * [NETFILTER]: nf_conntrack_h323: fix get_h225_addr() for IPv6 address + access + * [NETFILTER]: nf_conntrack_h323: remove unnecessary process of + Information signal + * [NETFILTER]: nf_conntrack_h323: add missing T.120 address in OLCA + * [NETFILTER]: nf_nat_h323: call set_h225_addr instead of + set_h225_addr_hook + * [NET]: "wrong timeout value" in sk_wait_data() v2 + * hpt3x2n: Correct revision boundary + * pata_sis: Fix and clean up some timing setups + * ata_piix: add short 40c quirk for Acer Aspire 2030, take #2 + * libata: don't consider 0xff as port empty if SStatus is available + * libata: -ENODEV during prereset isn't an error + * pata_via: Handle laptops via DMI + * [CASSINI]: Check pci_set_mwi() return value. + * [XFRM]: Allow packet drops during larval state resolution. + * [libata] sata_promise: fix flags typo + * [libata] sata_mv: add TODO list + * Fix build failure for drivers/ata/pata_scc.c + * libata: sata_sis fixes + * [libata] Fix decoding of 6-byte commands + * [libata] sata_via, pata_via: Add PCI IDs. + * ocfs2: trylock in ocfs2_readpage() + * ocfs2: unmap_mapping_range() in ocfs2_truncate() + * ocfs2: use zero_user_page + * ocfs2: fix inode leak + * ocfs2: use generic_segment_checks + * pata: Trivia + * pata_hpt37x: Further improvements based on the IDE updates and vendor + drivers + * fix compat console unimap regression + * Linux 2.6.22-rc3 + + -- Ben Collins Thu, 31 May 2007 12:35:44 -0400 + +linux-source-2.6.22 (2.6.22-5.11) gutsy; urgency=low + + [Ben Collins] + + * build/headers/ppc: Correct asm-ppc -> asm for arch symlink + * build/headers/ia64: Fix find command line to correctly pull in *.lds + files + * Bump ABI + + [Upstream Kernel Changes] + + * [IA64] spelling fixes: arch/ia64/ + * [AVR32] Remove bogus comment in arch/avr32/kernel/irq.c + * [AVR32] optimize pagefault path + * [AVR32] Wire up signalfd, timerfd and eventfd + * [IA64] wire up {signal,timer,event}fd syscalls + * [IA64] kdump on INIT needs multi-nodes sync-up (v.2) + * [IA64] s/scalibility/scalability/ + * [AVR32] Implement platform hooks for atmel_lcdfb driver + * [IA64] Fix section conflict of ia64_mlogbuf_finish + * [SPARC64]: Add hypervisor API negotiation and fix console bugs. + * pata_scc had been missed by ata_std_prereset() switch + * libata: separate out ata_dev_reread_id() + * libata: during revalidation, check n_sectors after device is configured + * libata-acpi: add ATA_FLAG_ACPI_SATA port flag + * libata: fix shutdown warning message printing + * libata: track spindown status and skip spindown_compat if possible + * [ALSA] usb-audio: another Logitech QuickCam ID + * [ALSA] hda-codec - Make the mixer capability check more robust + * [ALSA] ASoC AC97 static GPL symbol fix + * [ALSA] ASoC AC97 device reg bugfix + * [ALSA] hda-codec - Fix ALC882/861VD codec support on some laptops + * [ALSA] version 1.0.14rc4 + * [ALSA] Fix probe of non-PnP ISA devices + * [ALSA] Include quirks from Ubuntu Dapper/Edgy/Feisty + * [ALSA] usbaudio - Coping with short replies in usbmixer + * [IA64] optimize pagefaults a little + * Fix ACPI suspend / device suspend ordering problem + * AFS: write back dirty data on unmount + * SLUB: It is legit to allocate a slab of the maximum permitted size + * slub: don't confuse ctor and dtor + * AFS: Fix afs_prepare_write() + * spi: fix spidev for >sizeof(long)/32 devices + * parport_pc needs dma-mapping.h + * Fix: find_or_create_page skips cpuset memory spreading. + * slob: implement RCU freeing + * Slab allocators: Drop support for destructors + * SLUB: Remove depends on EXPERIMENTAL and !ARCH_USES_SLAB_PAGE_STRUCT + * SLAB: Move two remaining SLAB specific definitions to slab_def.h + * SLUB: Define functions for cpu slab handling instead of using + PageActive + * slab: warn on zero-length allocations + * slub: fix handling of oversized slabs + * SLUB: slabinfo fixes + * SLUB: Do our own flags based on PG_active and PG_error + * Remove SLAB_CTOR_CONSTRUCTOR + * SLUB: Simplify debug code + * Slab allocators: define common size limitations + * acpi: fix potential call to a freed memory section. + * i386/x86-64: fix section mismatch + * Make __vunmap static + * simplify compat_sys_timerfd + * Let smp_call_function_single return -EBUSY on UP + * Refine SCREEN_INFO sanity check for vgacon initialization + * make freezeable workqueues singlethread + * parport: mailing list is subscribers-only + * docbook: make kernel-locking table readable + * gpio interface loosens call restrictions + * rtc-omap build fix + * rtc kconfig clarification + * icom: add new sub-device-id to support new adapter + * make sysctl/kernel/core_pattern and fs/exec.c agree on maximum core + filename size + * ecryptfs: use zero_user_page + * i386: don't check_pgt_cache in flush_tlb_mm + * circular locking dependency found in QUOTA OFF + * swsusp: fix sysfs interface + * Fix page allocation flags in grow_dev_page() + * mm: more rmap checking + * NS16550A: Restore HS settings in EXCR2 on resume + * Fix incorrect prototype for ipxrtr_route_packet() + * sky2: remove Gigabyte 88e8056 restriction + * sky2: PHY register settings + * sky2: keep track of receive alloc failures + * sky2: MIB counter overflow handling + * sky2: remove dual port workaround + * sky2: memory barriers change + * small netdevices.txt fix + * ibm_emac: fix section mismatch warnings + * ibm_emac: improved PHY support + * ibm_emac: fix link speed detection change + * gianfar: Add I/O barriers when touching buffer descriptor ownership. + * spidernet: node-aware skbuff allocation + * NetXen: Fix NetXen driver ping on system-p + * ixgb: don't print error if pci_enable_msi() fails, cleanup minor leak + * e1000: Fix msi enable leak on error, don't print error message, cleanup + * drivers/ata: remove the wildcard from sata_nv driver + * sata_nv: fix fallout of devres conversion + * libata: remove libata.spindown_compat + * sata_via: pcim_iomap_regions() conversion missed BAR5 + + -- Ben Collins Thu, 17 May 2007 14:54:16 -0400 + +linux-source-2.6.22 (2.6.22-4.10) gutsy; urgency=low + + [Ben Collins] + + * Bump ABI + * build/config: Disable obsolete tsdev driver. + * build: Add tsdev to list of modules intentionally removed. + * build/headers: Include *.lds files (fixes ia64 headers). + * build/headers: Add arch/powerpc/include/asm symlink to get all headers. + * build/module-check: Fix logic for printed messages. + * build/maintainer: Use linux instead of upstream-linux for local diffs + * build/config: Enable SLUB slab allocator (vs. SLAB). + * build/config: Disable orinoco_nortel, use prefered hostap_plx + * build/config: Disable ir-usb in favor of irda-usb + * build/config: Disable sis5513(ide) in favor of pata_sis(libata) + * build/config: Disable piix(ide) in favour of pata_oldpiix, ata_piix and + pata_mpiix (libata) + * build/config: Disable zaurus driver in favour of the cdc_ether driver + * build/abi: Note a few modules intentionally removed. + * build/config: Disable mxb and dpc7146 driver in favour of hexium_orion + * build/config: Disable usbtest driver (for development only) + * build/config: Disable keyspan driver in favour of keyspan_pda + * build/abi: Add mxb and usbtest to list of removed modules. + + [Upstream Kernel Changes] + + * net: Trivial MLX4_DEBUG dependency fix. + * mlx4_core: Remove unused doorbell_lock + * [CPUFREQ] Support rev H AMD64s in powernow-k8 + * [CPUFREQ] powernow-k7: fix MHz rounding issue with perflib + * [AGPGART] Fix wrong ID in via-agp.c + * sh64: ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c + * spelling fixes: arch/sh64/ + * sh64: Wire up many new syscalls. + * sh64: Fixups for the irq_regs changes. + * sh64: dma-mapping updates. + * sh64: ppoll/pselect6() and restartable syscalls. + * sh64: Fixup sh-sci build. + * sh64: Update cayman defconfig. + * sh64: generic quicklist support. + * sh64: Add .gitignore entry for syscalltab. + * IB/mlx4: Fix uninitialized spinlock for 32-bit archs + * IB/ipath: Shadow the gpio_mask register + * IB/ehca: Serialize hypervisor calls in ehca_register_mr() + * IB/ehca: Correctly set GRH mask bit in ehca_modify_qp() + * IB/ehca: Fix AQP0/1 QP number + * IB/ehca: Remove _irqsave, move #ifdef + * IB/ehca: Beautify sysfs attribute code and fix compiler warnings + * IB/ehca: Disable scaling code by default, bump version number + * RDMA/cma: Simplify device removal handling code + * RDMA/cma: Fix synchronization with device removal in cma_iw_handler + * RDMA/cma: Add check to validate that cm_id is bound to a device + * IB/mthca: Fix posting >255 recv WRs for Tavor + * IB/mthca: Set cleaned CQEs back to HW ownership when cleaning CQ + * IPoIB/cm: Optimize stale connection detection + * [CPUFREQ] Correct revision mask for powernow-k8 + * fix epoll single pass code and add wait-exclusive flag + * epoll locks changes and cleanups + * epoll: fix some comments + * epoll: move kfree inside ep_free + * nommu: add ioremap_page_range() + * h8300 atomic.h update + * alpha: fix hard_smp_processor_id compile error + * m68k: implement __clear_user() + * Remove cpu hotplug defines for __INIT & __INITDATA + * i386: move common parts of smp into their own file + * i386: fix voyager build + * SLUB: CONFIG_LARGE_ALLOCS must consider MAX_ORDER limit + * ll_rw_blk: fix gcc 4.2 warning on current_io_context() + * pasemi_mac: Fix register defines + * pasemi_mac: Interrupt ack fixes + * pasemi_mac: Terminate PCI ID list + * pasemi_mac: Fix local-mac-address parsing + * smc911x: fix compilation breakage + * ucc_geth: eliminate max-speed, change interface-type to + phy-connection-type + * pdc202xx_old: rewrite mode programming code (v2) + * serverworks: PIO mode setup fixes + * sis5513: PIO mode setup fixes + * alim15x3: use ide_tune_dma() + * pdc202xx_new: use ide_tune_dma() + * ide: always disable DMA before tuning it + * cs5530/sc1200: add ->udma_filter methods + * ide: use ide_tune_dma() part #2 + * cs5530/sc1200: DMA support cleanup + * cs5530/sc1200: add ->speedproc support + * sl82c105: add speedproc() method and MWDMA0/1 support + * ide: remove ide_dma_enable() + * ide: add missing validity checks for identify words 62 and 63 + * ide: remove ide_use_dma() + * sl82c105: Switch to ref counting API + * Use menuconfig objects: IDE + * x86: Fix discontigmem + non-HIGHMEM compile + * missing mm.h in fw-ohci + * missing dependencies for USB drivers in input + * missing includes in mlx4 + * em28xx and ivtv should depend on PCI + * rpadlpar breakage - fallout of struct subsystem removal + * m32r: __xchg() should be always_inline + * audit_match_signal() and friends are used only if CONFIG_AUDITSYSCALL + is set + * fix uml-x86_64 + * arm: walk_stacktrace() needs to be exported + + -- Ben Collins Tue, 15 May 2007 10:13:23 -0400 + +linux-source-2.6.22 (2.6.22-3.9) gutsy; urgency=low + + * Fixup firmware-modules -> efi-modules in exclude files. + + [Ben Collins] + + * build/config: Enable CONFIG_TIMER_STATS + * build/config: Disable CONFIG_IRQBALANCE, handled in userspace now + * build: Update modules that have been deprecated + * sparc64: Get some drivers compiling, till patches get upstream. + * powerpc: Add 64-bit cmp op for 32-bit. + * build/config: Disable apm_emu, pasemi_mac and cbe_cpufreq on ppc64 + * build/d-i(cjwatson): Rename firmware-modules to efi-modules + + -- Ben Collins Fri, 11 May 2007 09:38:50 +0200 + +linux-source-2.6.22 (2.6.22-2.7) gutsy; urgency=low + + [Changes for 2.7] + + * Added some more modules going missing to ignore. + * Disable ADB_PMU_LED on powerpc64. FTBFS. + + [Ben Collins] + + * XXX: Well, xen and rt got disabled in this upload. Hopefully things will + get working again soon. + + * build: Add check for nrcpus on buildd's for CONCURRENCY_LEVEL + * build: No longer provide ndiswrapper or ivtv modules (l-u-m does). + * build/d-i: Remove firmware lists, since we no longer supply those udebs + * build: Remove more firmware stuff + * build/control: Build-dep on coreutils + * Update configuration files + * build/custom: Updated xen/rt patches and configs. + * build: Make sure to use /bin/bash for headers_install + * build: Add SHELL=/bin/bash to headers_install + * Update configuration files + * Bump ABI + * Update module lists to match module name changes and merges. + * build/rt: Trimmed down real-time patch from Alessio Igor Bogani. + * Update configuration files + * Update configuration files + * build/rt: Fix typo in diff + * Update configuration files + * build: make explicit binary-headers target + * Update configuration files + * build/control-scripts: Remove debconf from pre-rm script + * build/ia64: Compress and use vmlinuz for target install + * build/config: Diable OSS i810_audio driver (Alsa driver prefered) + * build/config: Disable OSS cs4232 driver (Alsa prefered) + * build/config: Disable OSS via82xx driver (Alsa prefered) + * build/config: Disable OSS trident driver (Alsa prefered) + * build/config: Disable OSS Sound Blaster driver (Alsa prefered) + * build/config: Disable IDE generic, ata_generic prefered + * build/config: Disable siimage, pata_sil680 prefered + * build/module-check: More robust module checking + * build: Call module-check with perl, not $SHELL + * Update configuration files + * build: Fixup calling conventions of module-check + * build: Add modules.ignore from 1.3 revision + * build/config: Disable obsolete MOXA_SMARTIO in favor of new driver. + * build/config: Disable orinoco_cs in favor of hostap_cs + * build/config: Disable orinoco_pci in favor of hostap_pci + * build/config: Disable orinoco_{plx,tmd} in favor of hostap_plx + * build/config: Disable sk98lin in favor of skge + * build: Add more modules intentionally removed since 1.3 + + -- Ben Collins Fri, 27 Apr 2007 09:04:29 -0400 + +linux-source-2.6.22 (2.6.22-1.3) gutsy; urgency=low + + [Ben Collins] + + * build: Only use bzip2 for linux-image, and pre-depend on proper dpkg + + [2.6.22-1.2] + + [Ben Collins] + + * build: Add build-arch target. FTBFS + + [2.6.22-1.1] + + [Ben Collins] + + * debian: New build system, from scratch + * debian: Rename place holder so debian/stamps/ sticks around + * debian: Create stamp-flavours at start of build (for build scripts) + * debian/abi: Add revision 0.0 bootstrap module list. + * debian: Fix backwards logic in module/abi checkers. + * debian: Add arch= to vars.* files + * Update configuration files + * build: Added control scripts for images + * build/config: Disable CONFIG_PARAVIRT for now + * build/config: Enable CONFIG_FB_VESA + * build: Take CONCURRENCY_LEVEL from env if it exists. + * build: Do not print SHAs by default for changelog + * build/config(i386): Disable NO_HZ on all but generic + * build: Implement udeb rules + * build/d-i: Remove speakup-modules udeb + * build/udebs: Fix a couple trivial errors in the build. + * build/config: Disable CONFIG_FB_IMSTT on powerpc64-smp (no NVRAM) + * build/config: Disable some modules for ppc64 that don't use DMA API + * build/config: Yet another module to disable on ppc64 + * build/tests: New test infrastructure + * build: Special kernel build infrastructure + * build: Fix typo from last commit + * build/custom: Move custom files for each flavour into subdir. + * build/config: Disable some drivers on sparc that don't support DMA API + * build/sparc: Add new compress_file config, and use it for sparc + * build: Fix typo in compress_file commit. + * build/schedcfs: Update to v6 of the patch. + * build: Fix control file generation for custom images + * build: Correct message in link-headers + * build: 2.6.21 is released, force our SUBLEVEL to .22 + * build/vars: kvm API is at 4, provide that. + * build/custom: Allow custom builds to override things like build_image + * build/custom: Fix type causing custom rules not to be included. + * build/custom: Hello Xen 3.0.5 + * build/custom: Remove sched-cfs. Superseded in use by rt. + * build/custom: Add 2.6.21-rt1 patch for -rt custom flavour + * build/link-headers: Make sure to copy new files for custom + + -- Ben Collins Fri, 27 Apr 2007 08:29:00 -0400 --- linux-2.6.24.orig/debian/rules +++ linux-2.6.24/debian/rules @@ -0,0 +1,136 @@ +#!/usr/bin/make -f +# +# debian/rules for Ubuntu linux +# +# Use this however you want, just give credit where credit is due. +# +# Copyright (c) 2007 Ben Collins +# + +# dpkg-buildpackage passes options that are incomptatible +# with the kernel build. +unexport CFLAGS +unexport LDFLAGS + +# This is the debhelper compatability version to use. +export DH_COMPAT=4 +export LC_ALL=C +export SHELL=/bin/bash -e + +# Common variables for all architectures +include debian/rules.d/0-common-vars.mk + +# Pill in some arch specific stuff +include debian/rules.d/$(arch).mk + +# Maintainer targets +include debian/rules.d/1-maintainer.mk + +# Debian Build System targets +binary: binary-indep binary-arch + +build: build-arch build-indep + +clean: debian/control + dh_testdir + dh_testroot + dh_clean + + # d-i stuff + rm -rf modules kernel-versions package-list + rm -rf debian/d-i-$(arch) + + # normal build junk + rm -rf debian/abi/$(release)-$(revision) + rm -rf $(builddir) + rm -f $(stampdir)/stamp-* + rm -rf debian/linux-* + + # This gets rid of the d-i packages in control + cp -f debian/control.stub debian/control + + # Prepare the mammoth patchsets for openvz and xen from + # their flattended sources. + for i in debian/binary-custom.d/*; do \ + if [ -d $$i/src ] ; then \ + mkdir -p $$i/patchset; \ + if ! diff -r -u --new-file --exclude=.git --exclude=debian --exclude=.gitignore \ + --from-file=. $$i/src > $$i/patchset/000.patch; then \ + echo "Ignore this error. diff returns 1 if any files are different." > /dev/null; \ + fi; \ + rm -rf $$i/src; \ + fi; \ + done + + +# Builds the image, arch headers and debug packages +include debian/rules.d/2-binary-arch.mk + +# Rules for building the udebs (debian-installer) +include debian/rules.d/5-udebs.mk + +# Builds the source, doc and linux-headers indep packages +include debian/rules.d/3-binary-indep.mk + +# Various checks to be performed on builds +include debian/rules.d/4-checks.mk + +# Custom binary images (universe/unsupported) +include debian/rules.d/6-binary-custom.mk \ + $(patsubst %,debian/binary-custom.d/%/rules,$(custom_flavours)) + +# Misc stuff +.PHONY: debian/control.stub +debian/control.stub: debian/d-i/kernel-versions.in \ + debian/scripts/control-create \ + debian/control.stub.in \ + debian/changelog \ + $(wildcard debian/control.d/*) \ + $(patsubst %,debian/binary-custom.d/%/vars,$(all_custom_flavours)) + for i in debian/d-i/kernel-versions.in debian/control.stub.in; do \ + new=`echo $$i | sed 's/\.in$$//'`; \ + cat $$i | sed -e 's/PKGVER/$(release)/g' -e 's/ABINUM/$(abinum)/g' > \ + $$new; \ + done + flavours="$(wildcard debian/control.d/vars.*) $(patsubst %,debian/binary-custom.d/%/vars,$(all_custom_flavours))";\ + for i in $$flavours; do \ + $(SHELL) debian/scripts/control-create $$i | \ + sed -e 's/PKGVER/$(release)/g' -e 's/ABINUM/$(abinum)/g' >>\ + debian/control.stub; \ + done + cp debian/control.stub debian/control + +.PHONY: debian/control +debian/control: debian/control.stub + rm -rf modules kernel-versions package-list + mkdir -p modules/$(arch)/ + cp debian/d-i/modules/* modules/$(arch)/ + cp debian/d-i/package-list debian/d-i/kernel-versions . + touch modules/$(arch)/kernel-image + + # Per flavour module lists + flavour_modules=`ls debian/d-i/modules.$(arch)-* 2>/dev/null` \ + || true; \ + if [ "$$flavour_modules" != "" ]; then \ + for flav in $$flavour_modules; do \ + name=`echo $$flav | sed 's/.*\/modules.$(arch)-//'`; \ + mkdir modules/$(arch)-$$name; \ + (cd debian/d-i/modules/; tar cf - `cat ../../../$$flav`) |\ + (cd modules/$(arch)-$$name/; tar xf -); \ + touch modules/$(arch)-$$name/kernel-image; \ + done; \ + fi + + # Remove unwanted stuff + if [ -r "debian/d-i/exclude-modules.$(arch)" ]; then \ + (cat debian/d-i/exclude-modules.$(arch); \ + ls modules/$(arch)/) | sort | uniq -d | \ + (cd modules/$(arch)/; xargs rm -f); \ + fi + + if [ ! -d modules/$(build_arch) ]; then \ + mkdir -p modules/$(build_arch); \ + cp modules/$(arch)/* modules/$(build_arch); \ + fi + + kernel-wedge gen-control > debian/control --- linux-2.6.24.orig/debian/changelog.historical +++ linux-2.6.24/debian/changelog.historical @@ -0,0 +1,4408 @@ +linux-source-2.6.20 (2.6.20-16.30) UNRELEASED; urgency=low + + CHANGELOG: Do not edit directly. Autogenerated at release. + CHANGELOG: Use the printchanges target to see the curent changes. + CHANGELOG: Use the insertchanges target to create the final log. + + -- Phillip lougher Mon, 11 Jun 2007 19:25:08 +0100 + +linux-source-2.6.20 (2.6.20-16.29) feisty-security; urgency=low + + [Phillip Lougher] + + * Revert "{ata_,}piix: Consolidate PCI IDs. Move ata_piix pata IDs to + piix" + - GIT-SHA d20328e312148f5c47cb38482e967ed9a1b7fdb9 + + [Tim Gardner] + + * Work around Dell E520 BIOS reboot bug. + - GIT-SHA 7d6ddf6fc8d2b5f40faac3c7915df71b4acb2fd4 + - Bug #114854 + + [Upstream Kernel Changes] + + * Fix VMI logic error + * [CRYPTO] geode: Fix in-place operations and set key (CVE-2007-2451) + * random: fix error in entropy extraction (CVE-2007-2453) + * random: fix seeding with zero entropy (CVE-2007-2453) + * [Bluetooth] Fix L2CAP and HCI setsockopt() information leaks (CVE-2007-1353) + + + -- Phillip lougher Thu, 07 Jun 2007 12:51:55 +0100 + +linux-source-2.6.20 (2.6.20-16.28) feisty-security; urgency=low + + [Ben Collins] + + * rtc: Ratelimit "lost interrupts" message. + - GIT-SHA 0102aad3b17d22e67864aa5afd88bc108b881141 + * vbox: Remove this driver. It will be outdated by release. + - GIT-SHA 60c8a6c1fbe7ed5dc28ccdd5a48c624e9ece56f3 + * hppa: Build fixes from jbailey. + - GIT-SHA 4f87aff6afe3479c98f8a64e05c866027e7d473d + * mmc: Set parent for block dev's to host, not class device. + - GIT-SHA 0400a0ceb5afa2afcda76c92d4425c4696e72845 + - Bug #99648 + + [Daniel Chen] + + * sound/pci/: Forward-port intel8x0 quirks from ubuntu-edgy.git + (intel8x0.c) + - GIT-SHA a2ce991fa1b7d601c428564f3741044a492d13a4 + * sound/pci/: Forward-port more intel8x0 quirks from kernel-team@ + (intel8x0.c) + - GIT-SHA 5263bd37eeeedc72447441bdec9fc47e7cca83d9 + * sound/pci/hda/: Revert Toshiba model setting (ALC861_TOSHIBA) for SSID + 1179:ff10 (patch_realtek.c) + - GIT-SHA b6fffb0f499459dfaef0f022f2da1f3fcb4fbdc2 + * sound/pci/hda/: Add missing SSID for ALC861-VD (patch_realtek.c) + - GIT-SHA 0ca1a43cc8e4d484963a7f6e4866602d5fe576db + * sound/pci/ac97/: Fix regression from Edgy - readd jack sense blacklist + entries (ac97_patch.c) + - GIT-SHA 963f93d185fc40ab7853ce75480a5fbcd607e070 + * sound/pci/hda/: Fix regression from Edgy - incorrect model quirk for + ALC861-VD (patch_realtek.c) + - GIT-SHA 382e158458c0771a6bd48cc8a64df6e24a46682e + * sound/pci/hda/: Fix inaudible sound on yet another Toshiba laptop - + incorrect model quirk (patch_realtek.c) + - GIT-SHA fbbec3e6208990a1dbe34766396084d683bc3322 + + [Fabio M. Di Nitto] + + * [OCFS2] Local mounts should skip inode updates + - GIT-SHA 8cbf682c7a9016caf65fb30bb67d1e2de3e924c6 + + [Kyle McMartin] + + * Enable ICH8GM (Crestline) support + - GIT-SHA 5b87e59b3898d33e11f71fcc037e7d1c6480aee0 + * bcm43xx: Update to 2.6.21 + - GIT-SHA 9424583295f2fa0920a611eb0f37ccd8fb2dc453 + * p54pci: Fix error path when eeprom read fails + - GIT-SHA c10305577fa669b114bcb03d6f80bdcbcd46a93a + + [Phillip Lougher] + + * Squashfs: add SetPageError handling + - GIT-SHA ff5082e7b9e1b48d33bbb26fbe9104ee1956688a + * Fix pata_sis crashes preventing booting + - GIT-SHA 1b27e19fa9145a1579cfecccf7d5be7d7e242e46 + - Bug #107774 + * Initialize the Broadcom USB Bluetooth device in Dell laptops. + - GIT-SHA 0f50a719466ae29c18b9b75df3ae64312d6523cf + * Update tifm driver to 0.8d + - GIT-SHA 6bec583645852716f3fee4a7d2534be1acf060d6 + - Bug #53923 + * sound/pci/hda/: Forcibly set the maximum number of codecs (hda_intel.c) + - GIT-SHA d8f18e83ea5ef15ab519f6bf03cccb3bdeb2e469 + - Bug #106843 + * Change CONFIG_NR_CPUS from 32 to 64. + - GIT-SHA 00f6cb2c3cda7dab1d02ceb444f5a34506c7a30d + + [Tim Gardner] + + * Added more USB device IDs + - GIT-SHA 139e45123031d80bebcb8e609d6a079538db0970 + * Prevent i2c_ec module from faulting becasue of uninitialized device + parent. + - GIT-SHA 490e63428ab4b3801bc94f520097fd43a57fbc3f + * Initialize the device with the ACPI structure. + - GIT-SHA 5df920c2fd7da80ea1d47d0c664a747700bf33f1 + * Backported from 2.6.21-rc6 + - GIT-SHA 4d0bb04551b393dfc12552d26dff259034c7620c + * Remove vboxdrv from the module lists. + - GIT-SHA 4aae55dc540f17b7b295047b99f4f68c43d01930 + * Cause SoftMac to emit an association event when setting ESSID. + - GIT-SHA c7a6bbdf4493b2951f02c924bd4a85d01b46c839 + - Bug #https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/103768 + + [Upstream Kernel Changes] + + * ocfs2_dlm: Missing get/put lockres in dlm_run_purge_lockres + * ocfs2_dlm: Add missing locks in dlm_empty_lockres + * ocfs2_dlm: Fix lockres ref counting bug + * ocfs2_dlm: Check for migrateable lockres in dlm_empty_lockres() + * [PS3] Add HV call to local_irq_restore(). + * i2c: Remove the warning on missing adapter device + * 2.6.21 fix lba48 bug in libata fill_result_tf() + * futex: PI state locking fix + * [APPLETALK]: Fix a remotely triggerable crash (CVE-2007-1357) + * [IPV6]: Fix for ipv6_setsockopt NULL dereference (CVE-2007-1388) + * DCCP: Fix exploitable hole in DCCP socket options (CVE-2007-1730) + * [IPv4] fib: Fix out of bound access of fib_props[] (CVE-2007-2172) + * (Denial of Service security fix from stable kernel 2.6.20.8) + * (Fix to Denial of Service security fix, from stable kernel 2.6.20.10) + * (ipv6 security bug fix from stable kernel 2.6.20.9) + * (Bug fix to ipv6 security fix, from stable kernel 2.6.20.10) + * [SPARC64]: SUN4U PCI-E controller support. + * [VIDEO]: Add Sun XVR-500 framebuffer driver. + * [VIDEO]: Add Sun XVR-2500 framebuffer driver. + * [SPARC64]: Fix recursion in PROM tree building. + * [SPARC64]: Bump PROMINTR_MAX to 32. + * [SPARC64]: Correct FIRE_IOMMU_FLUSHINV register offset. + * [SPARC64]: Add bq4802 TOD chip support, as found on ultra45. + * [SERIAL] SUNHV: Add an ID string. + * [SPARC64]: Be more resiliant with PCI I/O space regs. + * [SPARC64]: Add missing cpus_empty() check in hypervisor xcall handling. + * Input: i8042 - fix AUX IRQ delivery check + * Input: i8042 - another attempt to fix AUX delivery checks + * Input: i8042 - fix AUX port detection with some chips + * [IPV6]: ipv6_fl_socklist is inadvertently shared. (CVE-2007-1592) + + [Wang Zhenyu] + + * intel_agp: fix G965 GTT size detect + - GIT-SHA 8d9fac9fa2123f186f9f7c2b5ba7aaa594de1b58 + + -- Phillip Lougher Tue, 22 May 2007 20:01:42 +0100 + +linux-source-2.6.20 (2.6.20-15.27) feisty; urgency=low + + [Ben Collins] + + * ubuntu: Revert back to amd74xx and disable the troublesome pata_amd + - GIT-SHA 5e93e85491bf4804954643141af47a4692d59a91 + + -- Ben Collins Sat, 14 Apr 2007 17:41:11 -0400 + +linux-source-2.6.20 (2.6.20-15.26) feisty; urgency=low + + [Ben Collins] + + * libata: Rework logic for hpa_resize to work around bad returns from + SET_MAX + - GIT-SHA 5d5f973bfa93079d8dd13a21e2af32306d5a009f + + -- Ben Collins Sat, 14 Apr 2007 15:50:34 -0400 + +linux-source-2.6.20 (2.6.20-15.25) feisty; urgency=low + + [Ben Collins] + + * sata_nv: Revert patch that enabled ADMA for NODATA transfers. + - GIT-SHA 6429d0744ca5ffe007109ef4d70414bebe15966c + * libata: Completely avoid HPA code paths when ignore_hpa=0 + - GIT-SHA 9e3e1aea530dcb2e792f14e365a0d6d95539bfa9 + + -- Ben Collins Fri, 13 Apr 2007 13:39:36 -0400 + +linux-source-2.6.20 (2.6.20-15.24) feisty; urgency=low + + [Ben Collins] + + * libata: Re-add the tracking of n_sectors_boot + - GIT-SHA 1fa3ab07416406841cc1c7064b55fb084bbb1e3f + * i2c_ec: Do not set parent device. Current ACPI is not setup for this. + - GIT-SHA d80fb3540d170f18639c08f64afd133129bed856 + - Bug #96480 + + [Upstream Kernel Changes] + + * 2.6.21 fix lba48 bug in libata fill_result_tf() + + -- Ben Collins Thu, 12 Apr 2007 18:58:24 -0400 + +linux-source-2.6.20 (2.6.20-14.23) feisty; urgency=low + + [Ben Collins] + + * piix: Revery back to using piix (IDE) driver instead of ata_piix + (libata) driver for Intel PATA chipsets. + - GIT-SHA a4b5f29bd0754d49a818a30126c45e3b94ec127c + - Bug #96857 + * piix: Put some newer chipsets back to ata_piix. + - GIT-SHA 18a347500d3c6a2c636ac81556cfa2e1daed70b4 + * libata: Add patch to support recognizing HPA drives. + - GIT-SHA ddc27b2bb3c66026044efc3a4d97f22cd1e9243b + * mmc: Set parent for block dev's to host, not class device. + - GIT-SHA 104cff7bb0413b58091e2e45b6dfda210c1028fe + - Bug #99648 + + -- Ben Collins Thu, 12 Apr 2007 14:01:17 -0400 + +linux-source-2.6.20 (2.6.20-14.22) feisty; urgency=low + + [Ben Collins] + + * powerpc: Make ps3 work in multiplatform kernel + - GIT-SHA 54517f89a70e7cea696d1d21d13b86000c20daf4 + * drivers/ata/: Sync with libata-dev#upstream (ref + 1770cd662ad619e78d73a08a2f12f203656e705b) + - GIT-SHA 6fff74ec14bcaf6ac8bf156787961db83d6c90cd + * debian/rules: Add NOEXTRAS build option to not build things like + lowlatency and crashdump kernels. + - GIT-SHA 76f9f235bbdf048db4f09ef2874ae5766276222a + * libata-acpi: Add _GTM and _STM support to libata + - GIT-SHA 2939a7a99cfac2d0e1b120098c2541514ba48ff4 + * libata-acpi: Cleanup and enable acpi for pata drives by default. + - GIT-SHA 36fe5af2bb79195923a08acc0ebd74a2dd90e0f7 + * pci: Git rid of duplicate quirk exports. + - GIT-SHA a8779f83252855ce1a79ef633be5e8c3c2fe56f9 + * ps3: Merge bits so that ps3 can be compiled into powerpc64-smp + - GIT-SHA 462362a41075c7c803e4b49dbdcccda400a3a8f8 + * ubuntu: Remove remnants of ps3 kernel, now merged with ppc64-smp. + - GIT-SHA 2ba1dc63ca38d8e80c8ad0126dc1eba8c3eb080c + * ps3: Include asm/firmware.h for device-init.c + - GIT-SHA 9e4507538545341dc8ec645249513081ec423970 + * ubuntu: Update sata/pata d-i module lists. + - GIT-SHA 75e3656071e565efe201ac2c287f4743d2e93e0b + * snd_ps3: New driver for ps3 sound, of course. + - GIT-SHA e1a797d335353ad9c16e2cbe080699e41c5828a6 + * libusual: Add my U3 Cruzer as a single LUN device (has driver iso) + - GIT-SHA 2ff96660777c0936ac8064fb2c20b22e4954ef71 + * ps3: Sync to latest ps3-linux-dev git. We now have snd_ps3. + - GIT-SHA 563465bcc598e5f5bce463f78c11a5859814c08c + * gelic_net: Allocate gelic_irq_status from GFP_DMA so it works with + __pa() + - GIT-SHA 3b56675a8df0c4b2a5fd09d663bb880a1024cd44 + * ubuntu/net/ipg: Add MODULE_DEVIVCE_TABLE for autoload of module + - GIT-SHA 025a73f21cf92ae4abe6928bb37ec4176da11eae + - Bug #86388 + * acpi: Make the lack of DSDT.aml in initramfs not sound like an error. + - GIT-SHA 7711ba4a2e77f02793fdceefddc1c9c198f68dce + + [Colin Watson] + + * d-i: Fix fs-core-modules description. + - GIT-SHA 6ab196033b5d41b8d5545a28da6d7c5f672f75ee + * d-i: Restore fat-modules udeb, split out from fs-secondary-modules. + - GIT-SHA 7e436bb85a1483978103b0f236993d7ac1dc20ff + + [Daniel Chen] + + * sound/pci/hda/: Add quirk for Dell Dimension E520 (patch_sigmatel.c) + - GIT-SHA de4755b3b5e905194d9a9d06eb86a9200c28c864 + * sound/pci/hda/: Add missing mic boost mixer controls (patch_analog.c) + - GIT-SHA e882468a6dc91bd9235a548a011c25a43878b70b + * sound/pci/hda/: Add (un)muting for jack sense on Lenovo 3000 N100 + (patch_analog.c) + - GIT-SHA 7c726dbd0d2dd4237d9a4c9a64c41821956d8901 + * sound/pci/hda/: Add missing array terminators resulting in premature + optimisation (patch_conexant.c) + - GIT-SHA 5448559cd8ce389393697b28b6903c876f535c6b + * sound/pci/hda/: Add support for AD1986A Ultra model (patch_analog.c) + - GIT-SHA 0d95cfd2b39aed11eeb72d5fe3889b933bb362e0 + + [Fabio M. Di Nitto] + + * [OCFS2] Wrap access of directory allocations with ip_alloc_sem. + - GIT-SHA ba2f1bf8193c9e0b338f45714f102468c862cc4c + * [OCFS2] Properly lock extent map size changes. + - GIT-SHA a98ce36259ee1f83442f93845b830f6033dc90c8 + * [OCFS2] Local mounts should not truncate the extent map. + - GIT-SHA e87ad18113393107fc7d5a86e6bbd9b32dd44b6c + + [Matthew Garrett] + + * Add _GTM and _STM support to libata + - GIT-SHA 5d320f7915c4124ed56aeb619efbae7ff3beb9d2 + + [Tim Gardner] + + * [SATA ACPI] Fix some thinkos from + 36fe5af2bb79195923a08acc0ebd74a2dd90e0f7 + - GIT-SHA cbf8b6de0c9a84344e16847b03db5adcf0f0c855 + * Catch nonsense keycodes and silently ignore. + - GIT-SHA 560b0ff514b90e4c8bfbddbce3a54c218dc9ff85 + + [Upstream Kernel Changes] + + * Upstream sky2 driver updates + * [PS3] Storage cleanups, defconfig updates. + * [PS3] Fixes for SDK 2.0 toolchain. + * [PS3] Add spufs-avoid-accessing-to-released-inode.diff. + * [PS3] Add spufs-always-release-mapping-lock.diff, + spufs-fix-ctx-lifetimes.diff. + * [PS3] Storage bus dma updates. + * Add NOPFN_REFAULT result from vm_ops->nopfn() + * genirq: do not mask interrupts by default + * add vm_insert_pfn() + + [Zachary Amsden] + + * Urgent fix for VMI in HIGHMEM configurations + - GIT-SHA 72e461e0d638eb608c6ae07f7991e1063c5cbdeb + + -- Ben Collins Sun, 1 Apr 2007 13:03:28 -0400 + +linux-source-2.6.20 (2.6.20-13.21) feisty; urgency=low + + [Ben Collins] + + * debian/config: Enable CONFIG_DEBUG_FS. + - GIT-SHA a02719608695e5d59344600353d4872775a9ae3b + * rtl8187: Rename dir's from 818x to 8187. + - GIT-SHA ef3d971e78ca393bb1bcf3f46895849848010a7e + * rtl818x: Re-add old driver, fixing oops in old code as well. + - GIT-SHA d5d0ac60abafb7438f6736f9033208cac1572c82 + - Bug #78255 + * bluetooth: Update stack to latest code from bluez + - GIT-SHA 138bb4d3d2e65988cefcbd59b180b3788305f071 + - Bug #91194 + * rt2x00-legacy: Re-add rt2570 driver. + - GIT-SHA 43ab28f4b58f129611be5e784cd72ab2b5c46505 + * rt2500usb: Disable module alias when rt2570 is built. + - GIT-SHA ab16ae43815bcf9215965b87d4b05dbcc03e3574 + * mmc: Update to latest git supplied mmc core. + - GIT-SHA 5bf598b427d0ff75bef7186a75194b6b9102e224 + - Bug #93171 + * tifm: Update tifm core. + - GIT-SHA c25cfc3ad3cb8cac3474febfe66cff8ee0bfba18 + * lmpcm_usb: USB Logitech MediaPlay Cordless Mouse driver + - GIT-SHA c4291c4e7b6c2facfd65d3d9460fa667066d1e54 + - Bug #86035 + * drivers/media: Disable CONFIG_VIDEO_HELPER_CHIPS_AUTO to allow all + modules to be built. + - GIT-SHA 994e8c1e58d7b138880190796e6bd0ce3dcbd62a + * unusual_dev: Netac OnlyDisk Mini U2CV2 512MB USB 2.0 Flash Drive + - GIT-SHA ef90ffeabdca584d3539ae00ce746256d818a1a4 + - Bug #94371 + * speedstep-centrino: Include linux-phc built-in tables. + - GIT-SHA fc9f7238d11d5a9ff03ce67fae0b5b5c9fd7f436 + - Bug #63789 + * drivers/char/{agp/drm}: Resync with 2.6.21-rc4. + - GIT-SHA 1eae0b2972e215e9f13b99b7fb64b90db04cc556 + * ps3: Update ps3-storage and ps3fb drivers. + - GIT-SHA f2d4c3f34a613671bbcbc4696ccac6e7737b623a + * ps3: Updates for vuart, ps3av and sys-manager + - GIT-SHA b02d7d3f27d539713d6abba6e23db0b0f758d682 + * ide/generic: Remove errant jmicron entries. + - GIT-SHA d76099fde0ef127fa4f532c72bcd948caca7c2c1 + - Bug #84964 + * xpad: Update to latest version from xbox-linux. + - GIT-SHA 829dee658c6d3d09f049ca430a79997e5ba44838 + - Bug #94560 + * uvcvideo: Update to latest SVN version. + - GIT-SHA 7ca4b455c60b38ad53d03834fe03799ace81166d + - Bug #86754 + * ivtv: Update to 0.10.1 + - GIT-SHA b428794c3de387e2f701a768f98a302d3b4c98ea + - Bug #88680 + * ata_piix/piix: Prefer piix for device 7111 (PIIX4) + - GIT-SHA 9c7b34046bd9de870713e4630b06f95260d37973 + - Bug #94637 + * vboxdrv: Added VirtualBox kernel modules, v1.3.8 + - GIT-SHA 36b8eb8995ff04facae364706f6598fd6dce1cc4 + - Bug #81527 + * ata_piix/piix: Have piix handle device ID 0x24db + - GIT-SHA a083e4e48de3d5399788264259f42db157787603 + - Bug #95105 + + [Daniel T. Chen] + + * sound/pci/hda/: Simplify acer quirk (patch_realtek.c) + - GIT-SHA 1144a6d2628cb11286d8dc44a6f4fa0b740266ef + * sound/pci/hda/: Use proper constraints for HDA spec (hda_intel.c) + - GIT-SHA a51fa971bcf05e18dc9d315c36549126cc5b68ba + * sound/pci/hda/: Fix AZX models (hda_codec.c) + - GIT-SHA 1939127f3614de9f12dc4d42fb9c5b04081fbf0a + * sound/pci/hda/: Fix generic parser (hda_codec.c) + - GIT-SHA d0e1a1280e03111d26c63504451d3bf4378d668c + * sound/pci/hda/: Convert Sigmatel models to enums; differentiate between + Mac Pro revisions (patch_sigmatel.c) + - GIT-SHA e813cfe016a57c0155660f7c247b479bbeb9c8d8 + * sound/pci/hda/: Add _cfg_tbl[] quirk entries (patch_sigmatel.c) + - GIT-SHA 4a56b2a0ccadded72b1575c42db461f18fd2cc75 + * sound/pci/hda/: Fix front/rear mic inputs on AD1986A (patch_analog.c) + - GIT-SHA 50c1252587fc4df1f15248d2ceae8e87225f1283 + * sound/pci/hda/: Probe additional codec slots only if necessary + (hda_intel.c) + - GIT-SHA 81347c779c57515b0375650328cb4054a820a5d9 + + [Fabio M. Di Nitto] + + * Enable CONFIG_DEBUGFS=y + - GIT-SHA 52899638c7ab7e38dad47b884382bdb4e0814ea1 + + [Kyle McMartin] + + * Add Netac OnlyDisk Mini to unusual_devs.h + - GIT-SHA 999e79c3ffa906a970b717821b459724b9c2d939 + - Bug #94371 + + [Phillip Lougher] + + * fix NFS mounting regression from Edgy->Feisty + - GIT-SHA 1ad6cbd54fd2506a39f203cc6b4163d985f94cf0 + - Bug #94814 + + [Tejun Heo] + + * sd: implement stop_on_shutdown + - GIT-SHA 5fafa8d12092c5d722fc02e245b4977fd0765f68 + + [Upstream Kernel Changes] + + * fix process crash caused by randomisation and 64k pages + * HID: zeroing of bytes in output fields is bogus + * libata: don't whine if ->prereset() returns -ENOENT + * sata_sil24: Add Adaptec 1220SA PCI ID + * sata_inic162x: kill double region requests + * libata: kernel-doc fix + * pata_ixp4xx_cf: fix oops on detach + * pata_ixp4xx_cf: fix interrupt + * Execute AML Notify() requests on stack (Ubuntu Bug: 63123) + * Fix buffer overflow and races in capi debug functions + * [SPARC64]: store-init needs trailing membar. + * i2c: Declare more i2c_adapter parent devices + * ieee1394: cycle timer read extension for raw1394 + * ieee1394: fix another deadlock in nodemgr + * ia64: fix noncoherent DMA API so devres builds + + -- Ben Collins Sun, 18 Mar 2007 22:52:00 -0400 + +linux-source-2.6.20 (2.6.20-12.20) feisty; urgency=low + + [Upstream Kernel Changes] + + * pci_iomap_regions() error handling fix + - Fixes bug #93648 + + -- Ben Collins Wed, 21 Mar 2007 11:47:18 -0400 + +linux-source-2.6.20 (2.6.20-12.19) feisty; urgency=low + + [Ben Collins] + + * piix: Fix typo that allowed this module to override ata_piix. + - GIT-SHA 80bc1fd97d95519b2ab8c5007924f9e591838351 + - Bug #84964 + * vdso: Fix incompatibility between vdso and paravirt+vmi + - GIT-SHA 83821a009b3ec3f3d3ebaeda9a4f45900928900c + * drivers/ata/: Sync with upstream for new drivers and acpi fixes. + - GIT-SHA c38186b50b5d8444091a2f974e035abeb783499b + * debian/d-i/: Update sata/pata module listings. + - GIT-SHA e2c160419a8c50e9adc5de4b81e33251a7e952af + * rt2x00: Disable module aliases if legacy drivers are built. + - GIT-SHA a4e3d596f4b304e01ce04e43762ddf3873635a8c + * rt2x00-legacy: Re-add some legacy drivers since mainline isn't working + everywhere yet. + - GIT-SHA 59992a59a531f62aeb82384abc8296779092f1cc + * rt2x00-legacy/rt61: Fix big-endian compilation. + - GIT-SHA 6603c59fa3aee248aaf5ae73015ad155977ddad8 + * lib/iomap: Only build on architectures that need it. + - GIT-SHA fb3d5ca41505e11b8cd2cd85bc8db0571d58a6ae + * rt61: Fixup build on ppc. + - GIT-SHA 8c7eebfaf5c0ea44e7a77165894ebd3861ed3668 + + [Dan Hecht] + + * Feisty VMI paravirt-ops: Fix cpu hotplug on VMI + - GIT-SHA 44bbb009bb465537b9d7660a101641174f67b678 + + [Daniel T. Chen] + + * sound/pci/hda/: LP: #92909: Fix regression in -11.18 for Toshiba + Satellite M115 - S3094 (patch_realtek.c) + - GIT-SHA ff352c874a71fcce9af5f04d19360a0a8a4318b8 + * sound/pci/: LP: #90349: Add SSID for Dell Inspiron 9100 to headphone + quirk table (intel8x0.c) + - GIT-SHA 94ea2cdff6440a5bc8602cc8431380a690520f80 + + [Fabio M. Di Nitto] + + * Make scsi_proc_hostdir_add silent on failure + - GIT-SHA a6ad8ab034e40e188825cede360f69e8101351d3 + + [Upstream Kernel Changes] + + * Synced drivers/ata/ + * ACPI support for IDE devices + * ide-acpi support warning fix + * Disable NMI watchdog by default properly + * devres: device resource management + * sort the devres mess out + * Add pci class code for SATA & AHCI, and replace some magic numbers. + * PCI: allow multiple calls to pcim_pin_device() + * devres: release resources on device_del() + + -- Ben Collins Sat, 17 Mar 2007 11:15:27 -0400 + +linux-source-2.6.20 (2.6.20-11.18) feisty; urgency=low + + [Ben Collins] + + * mac80211/d80211: Switch from d80211 backport to mac80211 from + intellinuxwireless.org + - GIT-SHA 5be1800f366dd9be849c44d1f9a57f938ee04a54 + * adm8211/p54: Convert to use mac80211. + - GIT-SHA 91601e433a7e126260c65ed5ed219691e3ed2b9a + * rt2x00: Fixup Kconfig for mac80211 + - GIT-SHA 07feef3cb5e135d9479d86863ed857b3f89b7deb + * ac97: make patch_ad1986 global for use in other files. + - GIT-SHA f032849c2162da0a2939ebd6451c9bed8b496709 + * wireless: Fix Kconfig for wext-compat + - GIT-SHA fcd5dcb1753f14697319dba5b6ab570def81b9ea + * mac80211: Fixups for correct usage. + - GIT-SHA 22fa222a8a195ea11f3066bd72d426e7ada4b24f + * net/core/wireless.o: Disable in favor of mac80211. + - GIT-SHA 5ea988da86d00b6917d55c4aa6cdc2381e81b113 + * Makefile: Add mac80211 wireless directory to drivers-y. + - GIT-SHA 96aaf9171af0900733952db97b422f5bb0e0cb19 + * adm8211: Update from wireless-dev + - GIT-SHA 3222b8da95637eb5d96b6b092c101dfb70c10e36 + * p54: Update from wireless-dev + - GIT-SHA ee719880109e8d4c53097f7d3e7680e7e6b71087 + * rtl818x/rtl8187: Remove old broken drivers. + - GIT-SHA 7a8d4270ccc39bec2e66d6196ca50d1aa91bfcee + * rtl818x: Add 8180/8187 driver from wireless-dev + - GIT-SHA d3de93c8319a0dfe58e37eb7c27371f2f2d52456 + * eeprom_93cx6: Taken from wireless-dev for rtl818x driver. + - GIT-SHA 2199d23aed53519d2814c6547e47bae72180212f + * rt2x00: Remove legacy and update to mac80211 (wireless-dev) code. + - GIT-SHA 3bc9d8de616716014f0db7de5d36be0587fdea6b + * bxm43xx: Add mac80211 variant of driver (sans module aliases). + - GIT-SHA 883ff4b3fcabad5271995327d9f26512bda33687 + * zd1211rw: Add mac80211 variant of driver (sans module aliases). + - GIT-SHA dde6813b66f1f31c766fcbbdcc20fb43cadd0be4 + * ssb: Update from wireless-dev for bcm43xx usage. + - GIT-SHA 3b86466916f303503d8052b41b720d12fd82d4dd + * kvm: Update to kvm-16. + - GIT-SHA d0388ee0c445d54fef0be4da7f283069c82df80d + * ubuntu/: Fixup some dma-mapping.h includes needed. + - GIT-SHA 3f3f237e8f9c9f986c464abc9ac75d7c4d3ae119 + * d-i: Update nic module listings. + - GIT-SHA f442d4e826548d027373b28562529fa5489105a2 + * prism54_softmac: Remove ancient prism54 code in favor of p54. + - GIT-SHA d924ddb5eb75f16473f7703d17e347dc350d0d4a + * vdso: Fix incompatibility between vdso and paravirt+vmi + - GIT-SHA 77b43e78df1c73c0a8f1333fa9bc440201bf3094 + * bluetooth: SCO flow control patch from bluez website. Fixes BTSCO. + - GIT-SHA a3e22dab227fcdc2778f19c462476bf3c6186938 + * btsco: Update to Revision 1.16 from CVS. + - GIT-SHA edc8305ea5d3b4056369c24c09b12a23b3d0857e + * d-i: Build udebs for ps3. + - GIT-SHA 1255b98db417c2ec0465ed73045b9101c244283c + * quickcam: Add 0.6.6 driver (from qc-usb package). + - GIT-SHA 6cfdbcfc6427769567a0b4bb593751c089f3d852 + * ubuntu/: Rework Makefiles for proper -y/-m recursion. + - GIT-SHA 84440f2f67b8cc89e11aeb5e6ccc4f38fd9f91d4 + * Makefile: Move ubuntu/ to just drivers-y. + - GIT-SHA d8b88338578e9fded8380d94e71d8292ac0eee7d + * ubuntu/: Add ubuntu/net/wireless/ to obj-y for CONFIG_WIRELESS_EXT. + - GIT-SHA 3c4dc7409d831ec9ff68ee7f8624ee6f0714eb34 + * Release 2.6.20-11.18 + - GIT-SHA 94830a5986ed94c5d6402827553bf6b5319a7e32 + * debian/d-i/: Allow per-flavour udeb module listings. + - GIT-SHA 6a2a10a8d622cc80d4a1668ce6fc095c84dceb7e + * ubuntu/: Remove crufty file. + - GIT-SHA 420dd6113f06f136ec745ff0f88776b210c971bf + + [Dan Hecht] + + * Feisty VMI paravirt-ops: fix prototype pragma to match definition + - GIT-SHA 0ebf6936c9e9dc252c7257da8efe471582c36f73 + + [Daniel T. Chen] + + * sound/pci/hda/: (Many) Bug fixes; add Macbook/Pro, Fujitsu, and Lenovo + 3000 C200 support (patch_realtek.c) + - GIT-SHA 21621559de65fb1b336fac148b98637db9b8876e + * sound/pci/: Fix muted speaker on resume from suspend-to-RAM + (intel8x0.c) + - GIT-SHA c73679b8f2fdec4083612671afcf72fe26681b4c + * sound/pci/ac97/: Backport AD1xxx AC'97 fixes (ac97_{codec,patch}.c) + - GIT-SHA b86ead0f620209dcd96c30decc8362ebe2ed5bff + * sound/pci/ac97/: Add MSI L720 laptop to quirk list (ac97_patch.c) + - GIT-SHA 252b8b19279355f1bf4f90b14269a936c3e26322 + * sound/pci/hda/: Add support for Fujitsu EAPD model (patch_conexant.c) + - GIT-SHA 94e796e42ba693e81a0e6497d9477cdbb742ce4c + * sound/pci/hda/: LP #74677: Add models to HDA AD codec (patch_analog.c) + - GIT-SHA 85e78cc0ca76490eec7d956998afe309bc1e4024 + * sound/pci/hda/: Fix codec initialization on ATI HDA chips (hda_intel.c) + - GIT-SHA aa53cf8aff62b05396b1a98e37bbf401e8fb2aa0 + * sound/pci/hda/: Fix speaker output on MacPro (patch_sigmatel.c) + - GIT-SHA 5e06d854c5fe5cdc3692ec067355411725a3ac9e + * include/sound/: Add missing struct member (ac97_codec.h) + - GIT-SHA 658cfb791c276d372433f4ee3b57c8bef99a986d + * sound/pci/: LP: #88080: Fix Oops triggered from interrupt handler + (intel8x0.c) + - GIT-SHA 8376f4bfd0af249c8ab0c9c788184147db07984f + * sound/pci/hda/: Add SSID for HP d5700 to ALC260 quirk table + (patch_realtek.c) + - GIT-SHA f57799abf88ad79fdab977ce40b118d900f8ffc7 + + [David Miller] + + * Fix mach64 with gcc-4.1 and later... + - GIT-SHA 11057e22f19a953916315bbbf2889d6293d31177 + + [Fabio M. Di Nitto] + + * debian/firmware: Update ql2400 file. + - GIT-SHA 40a42fab6f35773ee0dd0a58083897771fd07468 + * Disable CONFIG_IP_ROUTE_MULTIPATH_CACHED for real. + - GIT-SHA 7b7dc1f9197a0d8347517362aad8003882812949 + * Readd gnbd driver + - GIT-SHA de6fffe4180e18f64648d82697d3ca79e180da75 + + [Kyle McMartin] + + * acpi/hotkey: Add loglevel to "Using ... hotkey" printk + - GIT-SHA 398c3db849ca235addc3bc16b8c683f180518661 + + [Upstream Kernel Changes] + + * ocfs2: ocfs2_link() journal credits update + * ocfs2_dlm: fix cluster-wide refcounting of lock resources + * fs/ocfs2/dlm/: make functions static + * ocfs2_dlm: Fixes race between migrate and dirty + * ocfs2_dlm: Make dlmunlock() wait for migration to complete + * ocfs2_dlm: Fix migrate lockres handler queue scanning + * ocfs2_dlm: Flush dlm workqueue before starting to migrate + * ocfs2_dlm: Drop inflight refmap even if no locks found on the lockres + * ocfs2_dlm: Dlm dispatch was stopping too early + * ocfs2_dlm: wake up sleepers on the lockres waitqueue + * ocfs2_dlm: Silence a failed convert + * ocfs2_dlm: Cookies in locks not being printed correctly in error + messages + * ocfs2: Added post handler callable function in o2net message handler + * ocfs2_dlm: Calling post handler function in assert master handler + * ocfs2: Binds listener to the configured ip address + * ocfs2_dlm: Ensure correct ordering of set/clear refmap bit on lockres + * ocfs2_dlm: disallow a domain join if node maps mismatch + * ocfs2_dlm: Silence some messages during join domain + * ocfs2_dlm: Add timeout to dlm join domain + * ocfs2: ocfs2_link() journal credits update + * x86_64: fix 2.6.18 regression - PTRACE_OLDSETOPTIONS should be accepted + * rtc-pcf8563: detect polarity of century bit automatically + * prism54: correct assignment of DOT1XENABLE in WE-19 codepaths + * pata_amd: fix an obvious bug in cable detection + * knfsd: Fix a race in closing NFSd connections. + * Keys: Fix key serial number collision handling + * ide: fix drive side 80c cable check + * bcm43xx: Fix for oops on resume + * bcm43xx: Fix for oops on ampdu status + * AGP: intel-agp bugfix + * Missing critical phys_to_virt in lib/swiotlb.c + * USB: fix concurrent buffer access in the hub driver + * usbaudio - Fix Oops with broken usb descriptors + * usbaudio - Fix Oops with unconventional sample rates + * hda-intel - Don't try to probe invalid codecs + * Fix various bugs with aligned reads in RAID5. + * Fix ATM initcall ordering. + * Fix TCP FIN handling + * Fix allocation failure handling in multicast + * md: Avoid possible BUG_ON in md bitmap handling. + * Fix compile error for e500 core based processors + * ieee1394: video1394: DMA fix + * ieee1394: fix host device registering when nodemgr disabled + * Fix null pointer dereference in appledisplay driver + * USB HID: Fix USB vendor and product IDs endianness for USB HID devices + * Kconfig: FAULT_INJECTION can be selected only if LOCKDEP is enabled. + * MTD: Fatal regression in drivers/mtd/redboot.c in 2.6.20 + * IPV6: HASHTABLES: Use appropriate seed for caluculating ehash index. + * EHCI: turn off remote wakeup during shutdown + * Avoid using nfsd process pools on SMP machines. + * Fix recently introduced problem with shutting down a busy NFS server. + * UHCI: fix port resume problem + * Fix atmarp.h for userspace + * Clear TCP segmentation offload state in ipt_REJECT + * Fix IPX module unload + * Prevent pseudo garbage in SYN's advertized window + * Fix oops in xfrm_audit_log() + * sky2: dont flush good pause frames + * sky2: transmit timeout deadlock + * x86_64: Fix wrong gcc check in bitops.h + * x86: Don't require the vDSO for handling a.out signals + * i386: Fix broken CONFIG_COMPAT_VDSO on i386 + * bcm43xx: fix for 4309 + * md: Fix raid10 recovery problem. + * dvbdev: fix illegal re-usage of fileoperations struct + * V4L: pvrusb2: Fix video corruption on stream start + * V4L: pvrusb2: Handle larger cx2341x firmware images + * DVB: cxusb: fix firmware patch for big endian systems + * DVB: digitv: open nxt6000 i2c_gate for TDED4 tuner handling + * V4L: fix cx25840 firmware loading + * V4L: cx88-blackbird: allow usage of 376836 and 262144 sized firmware + images + * Fix posix-cpu-timer breakage caused by stale p->last_ran value + * swsusp: Fix possible oops in userland interface + * sata_sil: ignore and clear spurious IRQs while executing commands by + polling + * fix umask when noACL kernel meets extN tuned for ACLs + * UML - Fix 2.6.20 hang + * mmc: Power quirk for ENE controllers + * bcm43xx: Fix assertion failures in interrupt handler + * libata: add missing PM callbacks + * libata: add missing CONFIG_PM in LLDs + * POWERPC: Fix performance monitor exception + * HID: fix possible double-free on error path in hid parser + * Fix interrupt probing on E450 sparc64 systems + * Fix xfrm_add_sa_expire() return value + * Fix skb data reallocation handling in IPSEC + * Fix %100 cpu spinning on sparc64 + * Fix TCP MD5 locking. + * Don't add anycast reference to device multiple times + * Fix anycast procfs device leak + * Fix reference counting (memory leak) problem in __nfulnl_send() and + callers related to packet queueing. + * export blk_recount_segments + * forcedeth: disable msix + * tty_io: fix race in master pty close/slave pty close path + * sched: fix SMT scheduler bug + * USB: usbnet driver bugfix + * RPM: fix double free in portmapper code + * NLM: Fix double free in __nlm_async_call + * kexec: Fix CONFIG_SMP=n compilation V2 (ia64) + * Fix MTRR compat ioctl + * ufs: restore back support of openstep + * v9fs_vfs_mkdir(): fix a double free + * enable mouse button 2+3 emulation for x86 macs + * hugetlb: preserve hugetlb pte dirty state + * m32r: build fix for processors without ISA_DSP_LEVEL2 + * kernel/time/clocksource.c needs struct task_struct on m68k + * buffer: memorder fix + * Char: specialix, isr have 2 params + * lockdep: forward declare struct task_struct + * kvm: Fix asm constraint for lldt instruction + * ueagle-atm.c needs sched.h + * fix section mismatch warning in lockdep + * throttle_vm_writeout(): don't loop on GFP_NOFS and GFP_NOIO allocations + * revert "drivers/net/tulip/dmfe: support basic carrier detection" + * video/aty/mach64_ct.c: fix bogus delay loop + * pktcdvd: Correctly set cmd_len field in pkt_generic_packet + * ATA: convert GSI to irq on ia64 + * gfs2: fix locking mistake + * TCP: Fix minisock tcp_create_openreq_child() typo. + * Fix buffer overflow in Omnikey CardMan 4040 driver (CVE-2007-0005) + * x86-64: survive having no irq mapping for a vector + * IPV6: Handle np->opt being NULL in ipv6_getsockopt_sticky() + [CVE-2007-1000] + * Linux 2.6.20.2 + * conntrack: fix {nf, ip}_ct_iterate_cleanup endless loops + * nf_conntrack/nf_nat: fix incorrect config ifdefs + * tcp conntrack: accept SYN|URG as valid + * nfnetlink_log: fix reference leak + * nfnetlink_log: fix use after free + * nfnetlink_log: fix NULL pointer dereference + * nfnetlink_log: fix possible NULL pointer dereference + * ip6_route_me_harder should take into account mark + * nf_conntrack: fix incorrect classification of IPv6 fragments as + ESTABLISHED + * nfnetlink_log: zero-terminate prefix + * nfnetlink_log: fix crash on bridged packet + * Fix bug 7994 sleeping function called from invalid context + * bcm43xx: Fix problem with >1 GB RAM + * Fix compat_getsockopt + * fix for bugzilla #7544 (keyspan USB-to-serial converter) + * Fix callback bug in connector + * Fix sparc64 device register probing + * Fix timewait jiffies + * Fix UDP header pointer after pskb_trim_rcsum() + * Linux 2.6.20.3 + + -- Ben Collins Wed, 14 Mar 2007 13:24:01 -0400 + +linux-source-2.6.20 (2.6.20-10.17) feisty; urgency=low + + [Ben Collins] + + * powerpc: Fix build failure caused by include ordering. + - GIT-SHA ae1f75e4b3e0a5645c5c2e0ace4d98a5c41663bf + * ps3: Update to latest code in linux-ps3.git + - GIT-SHA 87402da9dab94849527c685f09b3aef61b8ccc32 + * i386: Allow VDSO + PARAVIRT + - GIT-SHA a3718cc571410e202382daca05e809fbeb7ffe41 + * acpi: DSDT from initramfs patch + - GIT-SHA 7b650b00d82ec5c80452b2f99de1cfdbae2a465b + * ps3: Use what kexec passed to us. + - GIT-SHA 7711acb4b58f1313830940008ccc03275265c705 + * ps3: Do not call early_init_dt_scan_memory() on PS3 (we use lv1 + routines) + - GIT-SHA daf88d0260215ce90b293c52c65adc819e4a8f65 + * gelic_net: Allocate gelic_irq_status with card struct. + - GIT-SHA a85fc7b805b0b16f4bd97fa707affd71b3a672d9 + * ps3: Disable debug messages. + - GIT-SHA 84fd42468c726cffaafd58df6019e5278c111ef5 + * ps3: Export a few repository symbols (GPL) for storage driver as + module. + - GIT-SHA 26b5fe72a4dfc4fc3293f4020add9b55fde73e67 + * kvm: Update to kvm-15 + - GIT-SHA addefaae3b6bbd33e0ccf804e01a2afc102ee0d5 + * ndiswrapper: Update to v1.38 + - GIT-SHA d45dc1f185baa28a04551acd7d96ad1102633f7a + * ipw3945: Add max timeout_spin for thermal. Avoids softlock up. + - GIT-SHA 5d6caa9edbffa13973a6f9bbbdf47473ac18dc16 + * configs: Enable PM_TRACE on x86_64. + - GIT-SHA 8bb67c60933e524f06133796fb8c60bf0c68fb0e + * tifm_7xx1: include linux/dma-mapping.h (ftbfs on sparc) + - GIT-SHA a44e76a014641330f064062eb86d1e1dce79a57e + * pci: Add empty decleration for pci_yes_msi() on non-msi architectures + - GIT-SHA 96d5fb49720b2ae60406394ca29e96ce0919d83d + + [Dan Hecht] + + * Feisty VMI paravirt-ops: fix vmi timer interrupt handler nested + xtime_lock + - GIT-SHA 3187b0e329245f3667b399dd4a0e8a687f44bce5 + * Feisty VMI paravirt-ops: fix no_timer_check compile fix + - GIT-SHA adec0fc22dcc9039a22f47dfa009d0d76ba37c14 + * Feisty VMI paravirt-ops: unconditionally enable disable_nodelay + - GIT-SHA 1aace0a61ee4e2f5d465f7667445d76ac944538e + + [Daniel T. Chen] + + * sound/pci/{ali5451,ca0106,echoaudio,riptide,rme9652}/: Add missing + sysfs device assignment for ALSA PCI drivers + ({ali5451,ca0106_main,echoaudio,riptide,hdspm}.c) + - GIT-SHA 7324806accd810818a7b66ba17f6ff5923743b2f + * sound/pci/hda/: Add SSID for LG LW40 Express (patch_realtek.c) + - GIT-SHA c3979792b7026ae9f43c5147e9617cf701af054b + * sound/pci/hda/: LP #88452: Fix headphone jack sense regression in + 2.6.20-9.16 on 504[57] (patch_conexant.c) + - GIT-SHA 5bb5522b65050a448245acdb42a63a590c385921 + + [Kyle McMartin] + + * drivers/ata: Enable libata Host Protected Area support + - GIT-SHA a0e61542121a0519bfbe9f6e43980ec96a16156e + * Disable MSI by default + - GIT-SHA dc205519fa6c5e487e9829090145d3eb3e73b496 + * Disable MMCONFIG by default + - GIT-SHA d613cff3d5968d3e93bad197480b90733c71b984 + * Update nozomi driver + - GIT-SHA ece7562eae20233c9ebca8677104f4f99680ab71 + * Add eeprom_bad_csum_allow option to e1000 + - GIT-SHA 4f26a22422aaf987a34b76451383cb243088498c + * Enable TCP_MD5SIG + - GIT-SHA 8afc57f2791aebc0a1180749438c7c84f0e812d0 + * UBUNTU:usb/serial: New device IDs for cp2101 driver + - GIT-SHA cdbb30cb9a1667a84f759b10b1fe714bcedf4084 + * Disable CONFIG_IP_ROUTE_MULTIPATH_CACHED + - GIT-SHA 14dfd17d483d8466faf3605cf931c5f2fc7eac63 + - Bug ##90597 + * Disable CONFIG_ACPI_DEBUG + - GIT-SHA 57516b6c60cdb5b97caed872a638d8efbd8e524e + + [Matthew Garrett] + + * Allow appletouch to bind to Apple touchpads + - GIT-SHA 5bb33520e67b89386880d3a218ecfde550848b5b + * add module_device_table entry for applesmc in order to have it + autoloaded + - GIT-SHA 524e8b89b619f19b70dd38e45fa9a59ff30a82c3 + + [Phillip Lougher] + + * Backport NFS branch oops fix from Unionfs 2.0 + - GIT-SHA feea4eb6e27ac04bbc34a525a6599a79204e81f0 + - Bug #85145 + * Backport unionfs_statfs() from Unionfs 2.0 + - GIT-SHA a47c7c9186612ad5f59bcca95bd5fac5cb01b287 + - Bug #90088 + * i2c-matroxfb: add code to correctly set .class field + - GIT-SHA 82e00f0e073de4849f6cd6ee8b361c28f952ca8d + - Bug #80608 + * i2c-matroxfb: fix typo in patch + - GIT-SHA 85294b26c526ce28c2e513b04293561fe2c8d5f4 + - Bug #80608 + * TI FlashMedia xx12/xx21 driver update to 0.8 release (20070222) + - GIT-SHA a3e42adedcd3c2f3364e6b620e12b14c68c7a149 + - Bug #82680 + + [Upstream Kernel Changes] + + * [PARISC] Delete arch/parisc/mm/kmap.c again + * [PARISC] Show more memory information and memory layout at bootup + * [PARISC] Unbreak discontigmem mem_init() + * [PARISC] Fix ccio_request_resource when CONFIG_IOMMU_CCIO is not + defined + * [PARISC] HPPB bus updates for E-Class systems + * [PARISC] [MUX] Mux driver bug fix + * [PARISC] [MUX] Mux driver updates + * [PARISC] [MUX] Claim resources for the Mux driver + * [PARISC] [MUX] Make the Serial Mux driver work as module + * [PARISC] [MUX] Detect multiple cards in the correct order + * [PARISC] [MUX] Correctly report the number of available ports + * [PARISC] [MUX] Get the hversion directly from the parisc_device + * [PARISC] parisc-agp: Fix integer/pointer warning + * [PARISC] sparse fixes + * [PARISC] more sparse fixes + * [PARISC] Reserve 1GB of space for vmalloc/tmpalias space on parisc64 + * [PARISC] Fix PCI bus numbering in the presence of Cardbus bridges + * [PARISC] avoid compiler warnings when compiling 64bit + * [PARISC] bloody printf fmt string warnings + * [TRIVIAL] [PARISC] Fix module.c printk message, add missing ')' + * [PARISC] lasi_82596: use BUILD_BUG_ON() and constify static array + * [PARISC] Make Lasi Ethernet depend on GSC only + * [PARISC] Remove GCC_VERSION usage as suggested by Adrian Bunk + * [PARISC] pdcpat remove extra brackets + * [PARISC] Remove duplicate PDC_PAT_CELL defines + * WorkStruct: Fix up some PA-RISC work items + * [PARISC] Move spinlock_t out of struct cpu_data + * [PARISC] Fix thinko in cpu_data.lock removal + * parisc: fix module_param iommu permission + * PA-RISC: Fix bogus warnings from modpost + * use __u64 rather than u64 in parisc statfs structs + * [PARISC] Optimize TLB flush on SMP systems + * [PARISC] Clean up the cache and tlb headers + * [PARISC] Only write to memory in test_and_set_bit/test_and_clear_bit if + we're + * [PARISC] "Fix" circular includes + * [PARISC] Add prototypes for flush_user_dcache_range and + flush_user_icache_range + * [PARISC] Remove sched.h from uaccess.h on parisc + * [PARISC] Fix show_stack() when we can't kmalloc + * [PARISC] Generic BUG + * [PARISC] fix build for WARN_ON() when CONFIG_DEBUG_BUGVERBOSE=y + * [PARISC] whitespace cleanups and unify 32/64bit user-access assembler + inlines + * [PARISC] fix fixup declarations for 32bit and use CONFIG_64BIT + * [PARISC] dump stack backtrace on BUG() and add syslog-levels to + printk()s + * [PARISC] add missing syscalls for vmsplice, move_pages, getcpu & + epoll_pwait + * [PARISC] lba_pci format warnings + * [PARISC] Use fstatat64 instead of newfstatat syscall + * [PARISC] use fls_long in irq.c + * [PARISC] a and b in "break a,b" message were swapped + * [PARISC] GENERIC_TIME patchset for parisc + * [PARISC] disable cr16 clocksource when multiple CPUs are online + * [PARISC] Convert soft power switch driver to kthread + * [PARISC] detect recursive kernel crash earlier + * [PARISC] Add TIF_RESTORE_SIGMASK support + * [PARISC] use less assembler statements in syscall path + * [PARISC] display parisc device modalias in sysfs + * [PARISC] move parisc_device_id definition to mod_devicetable.h + * [PARISC] generate modalias for parisc_device_id tables + * [PARISC] rename *_ANY_ID to PA_*_ANY_ID in the exported header + * [PARISC] factor syscall_restart code out of do_signal + * [PARISC] clean up debugging printks in smp.c + * [PARISC] kill ENTRY_SYS_CPUS + * [PARISC] implement standard ENTRY(), END() and ENDPROC() + * [PARISC] Fixes /proc/cpuinfo cache output on B160L + * [PARISC] fix ENTRY() and ENDPROC() for 64bit-parisc + * [PARISC] more ENTRY(), ENDPROC(), END() conversions + * [PARISC] add ASM_EXCEPTIONTABLE_ENTRY() macro + * [PARISC] use CONFIG_64BIT instead of __LP64__ + * [PARISC] convert to use CONFIG_64BIT instead of __LP64__ + * [PARISC] add ENTRY()/ENDPROC() and simplify assembly of HP/UX emulation + code + * [PARISC] do not export get_register/set_register + * [PARISC] fix section mismatch warnings in harmony sound driver + * [PARISC] Reorder syscalls to match unistd.h + * Fix a free-wrong-pointer bug in nfs/acl server (CVE-2007-0772) + * Linux 2.6.20.1 + * [PARISC] Add missing statfs64 and fstatfs64 syscalls + * [PARISC] Use symbolic last syscall in __NR_Linux_syscalls + * add vm_insert_pfn() + * Add NOPFN_REFAULT result from vm_ops->nopfn() + * [SPARC64]: Fix PCI interrupts on E450 et al. + * sata_sil: ignore and clear spurious IRQs while executing commands by + polling + + -- Ben Collins Sun, 11 Mar 2007 06:23:55 -0400 + +linux-source-2.6.20 (2.6.20-9.16) feisty; urgency=low + + == Re-upload for build failures == + + [Ben Collins] + + * d80211/dadwifi: Get rid of this, causes dumb failures + - GIT-SHA fe8556a197d3f3f01e2e71785b3eff55f9a98a0f + * powerpc: ifdef use of spu logo function + - GIT-SHA 8cf5e8f8e79e53b5d13038326a50f94c81bb01e8 + * ssb: Include dma-mapping.h + - GIT-SHA 7fbf0dd183ffbfcd01efebe4bd90172a4346190d + + == 2.6.20-9.15 == + + [Ben Collins] + + * sata_sis: Sync with upstream v0.7 + - GIT-SHA 54db2f91cd5a9115faf2a1142c3788665d4c08de + * d-i: Make storage-core-modules provide loop-modules + - GIT-SHA e9a5522297506bb285ef4c0c803a64fb289abe72 + * pm_trace: Fixup for non-pm architectures (compile failure) + - GIT-SHA 08cfd02cd6fab74af88fda7127d7ab5249a4606c + * ps3: Pull patches from linux-ps3.git HEAD. + - GIT-SHA 05383a8254692b547ae676b59b45d66f19229a27 + * ps3av: Allow native HDMI modes for boot case. + - GIT-SHA 641ab76ed883342c2a19df4c33ac17d795d2f5ca + * bcm43xx-dscape: Remove module_dev_table to avoid autoloading + - GIT-SHA 2082dec4a8ee18cf694a1f26bb136280c1053911 + * bcm43xx: Re-enable stock bcm43xx driver. + - GIT-SHA e5375f74acdad5cd54b7a1c96bd7aff6056941a6 + * bcm43xx-dscape: Actually rename this module to bcm43xx-dscape. + - GIT-SHA 7f8dabc63ea45b2ae0c411073b9044dc0904ea14 + * bcm43xx: Patch for DMA over 1G. + - GIT-SHA 032a9bb14008b8ab88e1e22ee956650de7532c6a + * bcm43xx: Patch to detect radio enable/disable. + - GIT-SHA 95824fb76a8b2ede3156f46c7be19dcf7656e75e + * bcm43xx: Fix bcm4309, patch from upstream -stable. + - GIT-SHA e9b2f2ef91b51796aec064f95f5a816b60498af0 + * namespace: AppArmor patches to export symbols as needed. + - GIT-SHA 9a364aef1f798c16648ef8611eedc675c6c522e8 + * gspcav1: SPCA Driver, for v4l1 + - GIT-SHA f5d420265ac21729cf4ba0d342b370066a2ac7a2 + * ubuntu/: Update kbuild for gspcav1 + - GIT-SHA 814e37d1e7f4ead8a8ca9bf1a238078489ebf0c0 + * iwlwifi: Update to v0.0.8 + - GIT-SHA 968a3b550a7640b4a508e784bb095af8d761d731 + * debian/firmware: Add iwlwifi ucode + - GIT-SHA 76a733559ffdb665a5c5b092c6d7921e9dca38d7 + * ubuntu/ssb: Set better defaults in Kconfig for Ubuntu setups + - GIT-SHA d0c669fe2ebaed94f9837eca9cc3646cca014057 + * bcm43xx-d80211: Disable MODULE_DEVICE_TABLE so it isn't auto-loaded + - GIT-SHA 65c348e7886894076b7610ab3df9162c4d1dfe73 + * fs/exec: Always set max rlim for piped core. + - GIT-SHA 1e0f4a95ab56cadb1e37fb36ee1bc51f7697e062 + - Bug #87065 + * Allow mac mouse emul to be compiled on non-ppc + - GIT-SHA 5ceb16c6c1ebe24463a05328b3b72eea88c21ef8 + - Bug #81421 + * drivers/ide/: Check for pata modules enabled as modules too. + - GIT-SHA 3abf25603e6c855027ea11f9420ae7bddc3f02aa + * i386/pci: Quieten some messages. + - GIT-SHA 8897331220c73b367ad0ab4756f7b0f6cbb51c85 + - Bug #54294 + + [Daniel T. Chen] + + * sound/pci/hda/: Add support for Medion and Toshiba models + (patch_realtek.c) + - GIT-SHA d0c374e410e02bbe608b1eb05ea830326305b25f + * sound/pci/hda/: Add support for more ALC262, ALC883 and ALC660 models + (patch_realtek.c) + - GIT-SHA dab0d409a6253e89769f230190c852f8326f7fcb + * sound/pci/hda/: Add support for Asus models (patch_realtek.c) + - GIT-SHA f281cbd170b929b0b92cabefdfd4ba43616172b0 + * sound/pci/hda/: Add laptop-eapd model for Clevo M540JE, M550JE laptops + (Nvidia MCP51 chipset, ALC883 codec) (patch_realtek.c) + - GIT-SHA b37d077f39d082a5622c70d34be9247691f4cc99 + * sound/pci/hda/: More Conexant HDA fixes (patch_conexant.c) + - GIT-SHA b55060489d99586e5aff8000e74a1f1f195dd20d + * sound/pci/hda/: Add Dell models to STAC_REF and fix probe OOPS + (patch_sigmatel.c) + - GIT-SHA 25107d232a38e525b0a89884315d18eb495c1575 + * sound/pci/ac97/: Fix silent output with Conexant Cx20551 codec + (ac97_codec.c, ac97_patch.c, ac97_patch.h) + - GIT-SHA 1b3afda1c3af46ea96e9c5a3992a7ca83716a6a8 + * sound/pci/hda/: (Re)Add support for Macmini/Macbook/Macbook Pro + (patch_sigmatel.c) + - GIT-SHA 2fadead62fc6222b10799bd8cb134cfb6a79171f + + [Fabio M. Di Nitto] + + * ubuntu/fs/gfs: full update for 2.6.20 as of CVS20070216 + - GIT-SHA a81d2cf71db54eadcae6e213c625287236942eb9 + + [Kyle McMartin] + + * debian/firmware: Add aic94xx firmware + - GIT-SHA 6b0cc3fd1e98f3d1ba4bff6e26af4c94e206257c + * debian/d-i/firmware: Add scsi-firmware + - GIT-SHA 14d79cfe7725796e200c1dd20d92e8d58ba4b9b6 + * debian/: regen control{,.stub} + - GIT-SHA 60e2542a78f55537f6eb5757da0c7b925d3fe9b8 + + [Matthew Garrett] + + * Avoid the hid driver binding the Apple IR controller + - GIT-SHA 482271127ff1e7e3b321867648ea6cb199f6ecf6 + * Add PM_TRACE support for x86_64 + - GIT-SHA c63e3d917a84214a98c81ae497bcd4a72ead62ed + + [Phillip Lougher] + + * r8169: disable TSO by default for RTL8111/8168B chipsets. + - GIT-SHA 0cc30725f64a07cc4084d9e6d1637de405315815 + - Bug #76489 + * r8087: Fix bug in workqueue changes for 2.6.20 + - GIT-SHA 07e3458bdf5ba97519a58e089841ccb185ede7d2 + + [Upstream Kernel Changes] + + * Updated d80211 bcm43xx + * Add ssb support + * Update adm8211 drivers + * Update p54 driver + * Fix config symbol names + * Really fix config symbol names + * Add iwlwifi + * Fix the iwlwifi build + * Make SSB busses children of their parent device + * Add dadwifi (doesn't really work yet, but builds) + + -- Ben Collins Mon, 12 Feb 2007 20:22:14 -0500 + +linux-source-2.6.20 (2.6.20-8.14) feisty; urgency=low + + [Ben Collins] + + * acx: Add wlan_compat bits for ia64 + - GIT-SHA 4f29d1a99f1f8b096aaec9dc7df81cce54aa72b3 + * power: Disable the "Adding/Removing info for" printk's + - GIT-SHA daff39bf329d2522663343d6835f15eb17c0068d + * i82365: Probe before adding platform dev. + - GIT-SHA 06fd3fa13e3b336fcea01c326f3af314e5f37688 + * fs/exec: Fix call_usermodehelper_pipe() to allow waiting for exit + - GIT-SHA bfefaf3d2bd72a193bf5809639180a94ddc032ff + + [Upstream Kernel Changes] + + * sata_promise: TX2plus PATA support + * sata_promise: ATAPI support + * sata_promise: ATAPI cleanup + * sata_promise: issue ATAPI commands as normal packets + * sata_promise: handle ATAPI_NODATA ourselves + + -- Ben Collins Fri, 09 Feb 2007 10:24:58 -0500 + +linux-source-2.6.20 (2.6.20-7.13) feisty; urgency=low + + [Ben Collins - 7.13] + + * adm8211: Include dma-mapping.h for DMA_* constants. + - GIT-SHA d2ef9310ac1482f9230c89161260d74a86b1c9f1 + * p54: Include dma-mapping.h + - GIT-SHA d53668d200221d86b0889706e6560f0579246adc + * ubuntu/: Remove extraneous rt2x00 subdir from d80211 Makefile. + - GIT-SHA 2e9e9411c163478a7ba4aa389fcea2f553045a78 + + [Ben Collins] + + * drivers/core: Add sysfs attr to disable auto binding of drivers/devices + - GIT-SHA 22e8edadfe0141ea0e9f4b3c9626c3f97bf76c93 + * Disable prism2_cs in favor of orinoco/hostap modules. + - GIT-SHA 30cde452a15d9d1f27d20ea95d5fdba319ccd252 + * Update tifm core to latest version. + - GIT-SHA 6e2e96b61fea2d370777af7affe0008a7a7769b4 + * tifm: Update sd driver to latest version. + - GIT-SHA 8b69d97c3415de445ac7f9feff6152f130d001bc + * tifm_memstick: New driver. + - GIT-SHA d4d68aec79a4cb26d49893b0e98212e98549e806 + * netdev header: Add ieee80211 pointer for d80211. + - GIT-SHA 9d5f35c65ae15e6205221dd259a472edcb697812 + * ubuntu/net: Add SSB driver. + - GIT-SHA 4a4e7f2b0d1c71bbf7bb98a3c7981cae1e963d75 + * d80211: Add devicescape 802.11 stack. + - GIT-SHA 4d0fb64df98a9e21644525615df34ab2056eb569 + * p54: d80211 version of prism54 drivers + - GIT-SHA 140c080a78cde3f2a96e55da9ca2b25e44682b3c + * adm8211: d80211 version of this driver. + - GIT-SHA bfb106b04449dc080024eb7dd9e8dd486bcd6d7c + * rt2x00: Use in-tree d80211 now. + - GIT-SHA ffd2b8634285fe51f7a1dbe941a3d3de9682959d + * bcm43xx: d80211 version of this driver. + - GIT-SHA 1c965fad34ead0323464b2fc2f154b769e23d0fa + * ubuntu/wireless: Kbuild mechanisms for d80211 drivers. + - GIT-SHA fa6f353d01467a991d32dfecab5a8d0a97a0ab15 + * ubuntu/net: Add proper obj-* for d80211. + - GIT-SHA 1c197c4b327899fa52334b876f0481e466b5ca33 + * Compile fixes for d80211 drivers. + - GIT-SHA d1fccda7269b068993e9cbfcb59876ca8034ab87 + * rt2x00: Shift to d80211 compatible code. + - GIT-SHA 2a05970a2dc1b4a50ffd1c94d0986d8d1d6c6c3d + * tifm_7xx1: Add defines for new devices. + - GIT-SHA f824ad5dcb0d62f09b78a7930436c513d0128a1d + * ps3fb: Build for PPC_PS3 only + - GIT-SHA f5e173c8b9ff3692f595c417938083b13e64e11a + * powerpc: Export some ps3 symbols for storage module. + - GIT-SHA ec400176132803af41c6aecb3b12db9a31b9c845 + * debian: Correctly copy the ubuntu/include dir to headers pkg. + - GIT-SHA ed07298c5e4d0ddcafed16c448b03113d9759585 + * drivers/video/Kconfig: Fix missing select + - GIT-SHA 6976480384e97a384a9f0e95566d57710389e695 + * ubuntu/wireless: Add and switch to rt61 and rt73 legacy drivers. + - GIT-SHA 04e61f157c9e6f803495f37771ada12ee962a21c + * ubuntu/wireless: rt61 and rt73 should be x86 only. + - GIT-SHA e4adb1e93f9dae772ea6afdcefa036fb0300d1ff + * arch/powerpc: __start_initialization_ps3 should not be called unless + romboot + - GIT-SHA 92d9beacf533c488921d88d1cfc04ecaac73091f + * paravirt: Temporarily remove the _GPL from the paravirt_ops export. + - GIT-SHA dc9ad6a068aee49ff28d684240ef728e4fbd3ccc + * serio: Remove device on shutdown to avoid buggy hw issues. + - GIT-SHA 29f0b9969512eb7b312b0760d7bea7e652e8764e + - Bug #82681 + * zd1211rw: Add support for USR805423 + - GIT-SHA 6a04f78207354e5802e36ed8667d14161a3091f6 + - Bug #82578 + * configs: Provide kvm-modules-APIVER for userspace to dep on. + - GIT-SHA 6ac8dc6d7cccec4d44aa5dfe0c0893cf74110dd6 + - Bug #82258 + * sound/hda_sigmatel: Fix ftbfs in last commit. + - GIT-SHA 7a4d0ac5947972f4ca432c723141310c52d40a4e + * linux_logo: Fix typo from extra_logo changes. + - GIT-SHA 2fcc2e7e6f09eb5a7a7ec4bf318da3c2dc329ec1 + * x86: Remove kdump kernel target since stock kernel can relocate. + - GIT-SHA 3404865f24d45497625128c96a0a0aac09742292 + * ppc: Wrap use of logo with CONFIG_LOGO + - GIT-SHA e047adc25bee4c0c508e2ed4d165a5e317dbf716 + * ppc/ps3: Fix dev_dbg() missing paren. + - GIT-SHA 9a81097a5db61b2c1c53281c6c3a1105b697b2b8 + * fs/exec: Increase size of psuedo rlim for piped core. + - GIT-SHA c92e62051e81a485016b1eb33a25d0d56ec6e3f3 + * fs/exec: Add a CORE_REAL_RLIM env for when we override it. + - GIT-SHA f0fa902c99ae4b462a57239c4828bf2a9b1054f6 + * atl1: Replace PCI vendor macro with constant. + - GIT-SHA c1c238a318c39d3c4f021a3767e9188b5a0cf66b + * megaraid: Add CERC device support patch. + - GIT-SHA 66f63e20e2e9a7fc796f6a9b1af9b3f0019085e3 + * ipw3945: Update to v1.2.0 + - GIT-SHA 1c2e8dfd7e9984658df98ad59e35ce122b47b119 + * Update ipw3945 ucode to 1.14.2. + - GIT-SHA d0f9c02060e586553cfff48776abb7d4e5e8d614 + * debian/config: Enable CONFIG_PM_TRACE to help debug suspend/resume + problems. + - GIT-SHA d52b29c1f900b5089592a20b0e6a0f39aa8c707d + * toshiba_acpi: Add hotkeys support. + - GIT-SHA ce6b8dd74b92e479aad58444b531685500a19aca + - Bug #77026 + + [Dan Hecht] + + * Feisty VMI paravirt-ops: enable vdso even when paravirt enabled + - GIT-SHA 067e03f920818d3b40062be994fd72f6d73b84ee + * Feisty VMI paravirt-ops: export paravirt_ops symbol + - GIT-SHA 4535bc1f5a50a20c2db2784cc655e75672ec92f4 + * Feisty VMI paravirt-ops: use real delay for i8042 + - GIT-SHA 89e6be485bb2f833eadb649daf8cff712fef500b + * Feisty VMI paravirt-ops: fix vmi-timer no-idle-hz idling code + - GIT-SHA d3153a3f8aa3f3c36d9132a58083e1c6bdc079da + * Feisty VMI paravirt-ops: fix profile_pc cpl checks + - GIT-SHA be7fd2bd3b9f85a4121303b8a354a08ba1f05af9 + * Feisty VMI paravirt-ops: Fix sched_clock units in VMI case + - GIT-SHA 16872a27f546105702324c8ebd400893b9a3196f + * Feisty VMI paravirt-ops: fix HIGHPTE when running on vmi hypervisor + - GIT-SHA a5bee01a5fe6c709fadcac4037da76fb77eb4841 + + [Daniel T. Chen] + + * sound/pci/hda/: Add Sigmatel 9205 EAPD support (patch_sigmatel.c) + - GIT-SHA 42a2e17c3caf2e69c54ecf265509c15b086a6dc6 + * sound/pci/hda/: Add digital mic support for STAC HDA (patch_sigmatel.c) + - GIT-SHA 0d584c03b7589c69541ca98854ceca1e76c44818 + * sound/pci/hda/: Add support for more STAC HDA codecs (patch_sigmatel.c) + - GIT-SHA a7346022281e59443ab0408ffe4ac2ae3abe785d + + [Kyle McMartin] + + * nozomi: Added driver + - GIT-SHA b4f2f69278e511e34d2cf248d1d74a4eb1a1e518 + * atl1: Add driver + - GIT-SHA be86d24abdff0cc9ab502e174e3be29cac040991 + * acx: Update driver + - GIT-SHA 11216265914d055c8b46ecb741b882f810e69946 + * Fix Attansic L1 Gigabit Ethernet driver + - GIT-SHA 657112d01c49bc4f4ed3de6ec30aca5801beb302 + + [Upstream Kernel Changes] + + * [libata sata_promise] support PATA ports on SATA controllers + * make sata_promise PATA ports work + * [AGPGART] intel_agp: restore graphics device's pci space early in + resume + * [PS3] Import + ps3-linux-patches-efc1ddc7203ae9a2418e03a9dbbafb260f4fe2a3. + * [PS3] Cleanup fb patches. + * [PS3] Export ps3_get_firmware_version(). + * [ARM] 4084/1: Remove CONFIG_DEBUG_WAITQ + * [ARM] 4085/1: AT91: Header fixes. + * [ARM] 4086/1: AT91: Whitespace cleanup + * [ARM] 4087/1: AT91: CPU reset for SAM9x processors + * [ARM] 4088/1: AT91: Unbalanced IRQ in serial driver suspend/resume + * [ARM] 4089/1: AT91: GPIO wake IRQ cleanup + * [ARM] 4092/1: i.MX/MX1 CPU Frequency scaling latency definition + * [ARM] 4095/1: S3C24XX: Fix GPIO set for Bank A + * [ARM] 4096/1: S3C24XX: change return code form s3c2410_gpio_getcfg() + * [ARM] Fix show_mem() for discontigmem + * [ARM] Update mach-types + * [ARM] 4100/1: iop3xx: fix cpu mask for iop333 + * [ARM] Fix AMBA serial drivers for non-first serial ports + * [ARM] 4102/1: Allow for PHYS_OFFSET on any valid 2MiB address + * [ARM] 4106/1: S3C2410: typo fixes in register definitions + * [PS3] Prepare patches for 2.6.21 submission. + * [ARM] 4112/1: Only ioremap to supersections if DOMAIN_IO is zero + * [ARM] 4111/1: Allow VFP to work with thread migration on SMP + * HID: fix memleaking of collection + * USB HID: fix hid_blacklist clash for 0x08ca/0x0010 + * HID: fix hid-input mapping for Firefly Mini Remote Control + * [PS3] Prepare av and fb patches for 2.6.21 submission. + * [PS3] Prepared patches for 2.6.21 submission. + * ahci: port_no should be used when clearing IRQ in ahci_thaw() + * libata: fix ata_eh_suspend() return value + * ide: update MAINTAINERS entry + * jmicron: fix warning + * atiixp.c: remove unused code + * atiixp.c: sb600 ide only has one channel + * atiixp.c: add cable detection support for ATI IDE + * ide/generic: Jmicron has its own drivers now + * ia64: add pci_get_legacy_ide_irq() + * ide: add missing __init tags to IDE PCI host drivers + * ide: unregister idepnp driver on unload + * via82cxxx/pata_via: correct PCI_DEVICE_ID_VIA_SATA_EIDE ID and add + support for CX700 and 8237S + * [SCSI] Fix scsi_add_device() for async scanning + * [SCSI] qla4xxx: bug fixes + * [SCSI] st: A MTIOCTOP/MTWEOF within the early warning will cause the + file number to be incorrect + * [AGPGART] Prevent (unlikely) memory leak in amd_create_gatt_pages() + * [AGPGART] Remove pointless typedef in ati-agp + * [AGPGART] Remove pointless assignment. + * [AGPGART] Add new IDs to VIA AGP. + * [CPUFREQ] check sysfs_create_link return value + * [CPUFREQ] Remove unneeded errata workaround from p4-clockmod. + * [ARM] 4117/1: S3C2412: Fix writel() usage in selection code + * [PS3] Prepare av and fb patches for 2nd round 2.6.21 submission. + * ALSA: Fix sysfs breakage + * Fix balance_dirty_page() calculations with CONFIG_HIGHMEM + * [PS3] Move system-bus to platform directory. + * sky2: revert IRQ dance on suspend/resume + * [PS3] Fixed ps3_map_sg, enabled CONFIG_USB_STORAGE. + * Fix try_to_free_buffer() locking + * Fix SG_IO timeout jiffy conversion + * Malta: Fix build if CONFIG_MTD is diabled. + * [MIPS] Ocelot G: Fix a few misspellings of CONFIG_GALILEO_GT64240_ETH + * [MIPS] Fix typo of "CONFIG_MT_SMP". + * HID: fix pb_fnmode and move it to generic HID + * pata_sil680: PIO1 taskfile transfers overclocking fix (repost) + * ata_if_xfermask() word 51 fix + * pata_platform: set_mode fix + * libata-scsi: ata_task_ioctl should return ATA registers from sense data + * libata: fix translation for START STOP UNIT + * b44: Fix frequent link changes + * net: ifb error path loop fix + * FS_ENET: OF-related fixup for FEC and SCC MAC's + * 82596 warning fixes + * ehea: Fixed wrong jumbo frames status query + * ehea: Fixed missing tasklet_kill() call + * bonding: ARP monitoring broken on x86_64 + * e100: fix irq leak on suspend/resume + * b44: src_desc->addr is little-endian + * Broadcom 4400 resume small fix + * namespaces: fix exit race by splitting exit + * uml: fix mknod + * use __u8/__u32 in userspace ioctl defines for I2O + * Fix "CONFIG_X86_64_" typo in drivers/kvm/svm.c + * m68k: uaccess.h needs sched.h + * fs/lockd/clntlock.c: add missing newlines to dprintk's + * knfsd: ratelimit some nfsd messages that are triggered by external + events + * use __u8 rather than u8 in userspace SIZE defines in hdreg.h + * fuse: fix bug in control filesystem mount + * ufs: alloc metadata null page fix + * ufs: truncate negative to unsigned fix + * ufs: reallocation fix + * cdev.h: forward declarations + * `make help' in build tree doesn't show headers_* targets + * i386: In assign_irq_vector look at all vectors before giving up + * mm: mremap correct rmap accounting + * missing exports of pm_power_off() on alpha and sparc32 + * mtd/nand/cafe.c missing include of dma-mapping.h + * sym53c500_cs: remove bogus call fo free_dma() + * pata_platform: fallout from set_mode() change + * missing dma_sync_single_range_for{cpu,device} on alpha + * dma-mapping.h stubs fix + * b44: src_desc->addr is little-endian + * fix indentation-related breakage in Kconfig.i386 + * [PS3] More av and fb prepearations for 2nd round 2.6.21 submission. + * [MAINTAINERS]: netfilter@ is subscribers-only + * [NETFILTER]: xt_connbytes: fix division by zero + * [NETFILTER]: SIP conntrack: fix skipping over user info in SIP headers + * [NETFILTER]: SIP conntrack: fix out of bounds memory access + * [IPV6]: Fix up some CONFIG typos + * [IPV6]: fix BUG of ndisc_send_redirect() + * [SCTP]: Force update of the rto when processing HB-ACK + * [PS3] Finish system bus move. + * Don't allow the stack to grow into hugetlb reserved regions + * translate dashes in filenames for headers install + * Remove warning: VFS is out of sync with lock manager + * kprobes: replace magic numbers with enum + * Fix VIA quirks + * jmicron: 40/80pin primary detection + * uml: fix signal frame alignment + * ntfs: kmap_atomic() atomicity fix + * IPMI: fix timeout list handling + * Linux 2.6.20-rc7 + * [NETFILTER]: xt_hashlimit: fix ip6tables dependency + * fix frv headers_check + * mca_nmi_hook() can be called at any point + * ide section fixes + * endianness bug: ntohl() misspelled as >> 24 in fh_verify(). + * fork_idle() should be __cpuinit, not __devinit + * __crc_... is intended to be absolute + * efi_set_rtc_mmss() is not __init + * sanitize sections for sparc32 smp + * radio modems sitting on serial port are not for s390 + * uml-i386: fix build breakage with CONFIG_HIGHMEM + * via quirk update + * pci: remove warning messages + * KVM: fix lockup on 32-bit intel hosts with nx disabled in the bios + * procfs: Fix listing of /proc/NOT_A_TGID/task + * sysrq: showBlockedTasks is sysrq-W + * via82cxxx: fix typo ("cx7000" should be corrected to "cx700") + * Remove avr32@atmel.com from MAINTAINERS + * [SPARC32]: Fix over-optimization by GCC near ip_fast_csum. + * [NET_SCHED]: act_ipt: fix regression in ipt action + * [BNX2]: PHY workaround for 5709 A0. + * e100: fix napi ifdefs removing needed code + * MAINTAINERS: ufs entry + * ahci/pata_jmicron: fix JMicron quirk + * pata_atiixp: propogate cable detection hack from drivers/ide to the new + driver + * pata_via: Correct missing comments + * libata: Fix ata_busy_wait() kernel docs + * libata: Initialize nbytes for internal sg commands + * [SCSI] sd: udev accessing an uninitialized scsi_disk field results in a + crash + * [NETFILTER]: ctnetlink: fix compile failure with NF_CONNTRACK_MARK=n + * [NETFILTER]: nf_conntrack_h323: fix compile error with CONFIG_IPV6=m, + CONFIG_NF_CONNTRACK_H323=y + * [PS3] SPE logo, sys-manager cleanups. + * aio: fix buggy put_ioctx call in aio_complete - v2 + * kexec: Avoid migration of already disabled irqs (ia64) + * net/smc911x: match up spin lock/unlock + * alpha: fix epoll syscall enumerations + * revert blockdev direct io back to 2.6.19 version + * Altix: more ACPI PRT support + * x86-64: define dma noncoherent API functions + * fix rtl8150 + * EFI x86: pass firmware call parameters on the stack + * Linux 2.6.20 + * [GFS2] don't try to lockfs after shutdown + * [DLM] fix resend rcom lock + * [DLM] fix old rcom messages + * [DLM] add version check + * [DLM] fix send_args() lvb copying + * [DLM] fix receive_request() lvb copying + * [DLM] fix lost flags in stub replies + * [DLM] fs/dlm/lowcomms-tcp.c: remove 2 functions + * [GFS2] Fix DIO deadlock + * [GFS2] Fail over to readpage for stuffed files + * [GFS2] Fix change nlink deadlock + * [DLM] Fix schedule() calls + * [DLM] Fix spin lock already unlocked bug + * [GFS2] Fix ordering of page disposal vs. glock_dq + * [GFS2] BZ 217008 fsfuzzer fix. + * [GFS2] Fix gfs2_rename deadlock + * [DLM] change some log_error to log_debug + * [DLM] rename dlm_config_info fields + * [DLM] add config entry to enable log_debug + * [DLM] expose dlm_config_info fields in configfs + * [GFS2] gfs2 knows of directories which it chooses not to display + * [GFS2] make gfs2_change_nlink_i() static + * [DLM] Use workqueues for dlm lowcomms + * [DLM] fix user unlocking + * [DLM] fix master recovery + * [GFS2] Add writepages for "data=writeback" mounts + * [GFS2] Clean up/speed up readdir + * [GFS2] Remove max_atomic_write tunable + * [GFS2] Shrink gfs2_inode memory by half + * [GFS2] Remove the "greedy" function from glock.[ch] + * [GFS2] Remove unused go_callback operation + * [GFS2] Remove local exclusive glock mode + * [DLM] lowcomms tidy + * [GFS2] Tidy up glops calls + * [DLM] fix lowcomms receiving + * [GFS2] Remove queue_empty() function + * [GFS2] Compile fix for glock.c + * [GFS2] use CURRENT_TIME_SEC instead of get_seconds in gfs2 + * [GFS2] Fix typo in glock.c + * [DLM] Make sock_sem into a mutex + * [DLM] saved dlm message can be dropped + * [DLM] can miss clearing resend flag + * [GFS2] Fix recursive locking attempt with NFS + * [GFS2] Fix list corruption in lops.c + * [GFS2] increase default lock limit + * [GFS2] make lock_dlm drop_count tunable in sysfs + * [GFS2/DLM] use sysfs + * [GFS2/DLM] fix GFS2 circular dependency + * [GFS2] more CURRENT_TIME_SEC + * [GFS2] Put back semaphore to avoid umount problem + * [GFS2] Fix unlink deadlocks + * [DLM/GFS2] indent help text + * [DLM] zero new user lvbs + * [DLM] fix softlockup in dlm_recv + * [GFS2] nfsd readdirplus assertion failure + * libata: ACPI and _GTF support + * libata: ACPI _SDD support + * libata: change order of _SDD/_GTF execution (resend #3) + * libata: wrong sizeof for BUFFER + + -- Ben Collins Tue, 30 Jan 2007 10:42:16 -0500 + +linux-source-2.6.20 (2.6.20-6.8) feisty; urgency=low + + [Ben Collins] + + * zd1211rw: Add WL-117 ZyDAS device (also to unusual_devs) + - GIT-SHA f4e590f04c115142f97ae121d1907a4c782f8fe0 + - Bug #78311 + * ubuntu/gfs1: Fixups for build warnings + - GIT-SHA e25792fce5c6d02004e51171387daabf811ae5ae + * ubuntu/mol: Fixes to build again. Fabio owes me a beer. + - GIT-SHA f57afa67e6410d9c3a21d3bf64fb4274c8d83bd2 + * acpi/osl: Dedicated work queue for notify() execution + - GIT-SHA 2365e9585cdc207280bbda4017921aa8b6e5224a + - Bug #75398 + * ubuntu/gfs1: Fix compile failure. + - GIT-SHA aed1705a979b1a4b228598980af5b6095cdb6cb5 + * debian/config: Disable via_pata and re-enable via-ide driver. + - GIT-SHA ec624a5acacae28761f73aa70f61d441fa9931c4 + - Bug #75492 + * fs/exec.c: Implement new style of apport interaction. + - GIT-SHA 1c3aaaa6866c3129e854887cee5180d0881742e1 + * debian/firmware: Update zd1211b_uphr file. + - GIT-SHA d17e13bfd559680e92ddc42b10d0bc0c1f81fd8c + + [Daniel T. Chen] + + * sound/pci/hda/: Add Conexant HDA codec support (hda_patch.h) + - GIT-SHA d3cba8f9d6053991b4979cbef059f9b9c3a49ace + * sound/pci/hda/: Add Conexant HDA codec support (Makefile) + - GIT-SHA c91da21e199515d9ac8daf99a4ffb9771ee249bc + * sound/pci/hda/: Add Conexant HDA codec support (patch_conexant.c) + - GIT-SHA b13229d7257c689bf6f9595b29aa812e918e3439 + + [Upstream Kernel Changes] + + * [JFFS2] kill warning RE debug-only variables + * [MTD NAND] Initial import of CAFÉ NAND driver. + * [MTD] SSFDC must depend on BLOCK + * [MTD NAND] OLPC CAFÉ driver update + * [MTD] MAPS: Add parameter to amd76xrom to override rom window size + * [MTD] CHIPS: Support for SST 49LF040B flash chip + * [MTD] MAPS: Support for BIOS flash chips on Intel ESB2 southbridge + * [JFFS2] Use rb_first() and rb_last() cleanup + * [MTD] JEDEC probe: fix comment typo (devic) + * [MTD] MAPS: esb2rom: use hotplug safe interfaces + * [JFFS2] Fix jffs2_follow_link() typo + * [MTD] NAND: AT91 NAND driver + * [MTD] mtdchar: Fix MEMGETOOBSEL and ECCGETLAYOUT ioctls + * [MTD] MAPS: Remove ITE 8172G and Globespan IVR MTD support + * [MTD] NAND: nandsim page-wise allocation (1/2) + * [MTD] NAND: nandsim page-wise allocation (2/2) + * [MTD] NAND: nandsim coding style fix + * [MTD] core: trivial comments fix + * [MTD] NOR: leave Intel chips in read-array mode on suspend + * [MTD] NAND: nandsim: support subpage write + * [MTD] NAND: Combined oob buffer so it's contiguous with data + * [MTD] NAND: Correct setting of chip->oob_poi OOB buffer + * [MTD] NAND: Add hardware ECC correction support to CAFÉ NAND driver + * [MTD] NAND: CAFÉ NAND driver cleanup, fix ECC on reading empty flash + * [MTD] NAND: Disable ECC checking on CAFÉ since it's broken for now + * [MTD] NAND: Fix nand_default_mark_blockbad() when flash-based BBT + disabled + * [MTD] NAND: Café ECC -- remove spurious BUG_ON() in err_pos() + * [MTD] NAND: Reset Café controller before initialising. + * [MTD] CAFÉ NAND: Add 'slowtiming' parameter, default usedma and + checkecc on + * [MTD] NAND: Add ECC debugging for CAFÉ + * [MTD] NAND: Remove empty block ECC workaround + * [MTD] NAND: Fix timing calculation in CAFÉ debugging message + * [MTD] NAND: Use register #defines throughout CAFÉ driver, not numbers + * [MTD] NAND: Add register debugging spew option to CAFÉ driver + * [MTD] NAND: Fix ECC settings in CAFÉ controller driver. + * MTD: OneNAND: interrupt based wait support + * [MTD] OneNAND: lock support + * [MTD] OneNAND: Single bit error detection + * [MTD] [NAND] rtc_from4.c: use lib/bitrev.c + * [MTD] make drivers/mtd/cmdlinepart.c:mtdpart_setup() static + * [MTD] [NAND] Fix endianess bug in ndfc.c + * [MTD] [MAPS] Support for BIOS flash chips on the nvidia ck804 + southbridge + * [MTD] Allow variable block sizes in mtd_blkdevs + * [MTD] [NAND] remove len/ooblen confusion. + * [MTD] Fix printk format warning in physmap. (resources again) + * [MTD] replace kmalloc+memset with kzalloc + * [MTD] [NAND] Update CAFÉ driver interrupt handler prototype + * [MTD] [NAND] fix ifdef option in nand_ecc.c + * [MTD] Tidy bitrev usage in rtc_from4.c + * [MTD] increase MAX_MTD_DEVICES + * [MTD] fix map probe name for cstm_mips_ixx + * [MTD] add MTD_BLKDEVS Kconfig option + * [MTD] NAND: add subpage write support + * [MTD] add get_mtd_device_nm() function + * [MTD] add get and put methods + * [MTD] return error code from get_mtd_device() + * [MTD] Use EXPORT_SYMBOL_GPL() for exported symbols. + * [MTD] Remove trailing whitespace + * [MTD] bugfix: DataFlash is not bit writable + * [MTD] [NAND] Compile fix in rfc_from4.c + * [MTD] redboot partition combined fis / config problem + * [MTD] NAND: use SmartMedia ECC byte order for ndfc + * [MTD] nandsim: bugfix in page addressing + * [MTD] NAND: Support for 16-bit bus-width on AT91. + * [MTD] Support combined RedBoot FIS directory and configuration area + * [MTD] of_device-based physmap driver + * [MTD] ESB2ROM uses PCI + * [MTD] Fix SSFDC build for variable blocksize. + * [JFFS2] replace kmalloc+memset with kzalloc + * [MTD] Fix ssfdc blksize typo + * [MTD] OneNAND: fix oob handling in recent oob patch + * [MTD] Nuke IVR leftovers + * [JFFS2] add cond_resched() when garbage collecting deletion dirent + * [CIFS] Update CIFS version number + * [JFFS2] Fix error-path leak in summary scan + * ieee80211: WLAN_GET_SEQ_SEQ fix (select correct region) + * ipw2100: Fix dropping fragmented small packet problem + * [SCSI] advansys: wrap PCI table inside ifdef CONFIG_PCI + * [SCSI] qla2xxx: make qla2x00_reg_remote_port() static + * [SCSI] Add missing completion to scsi_complete_async_scans() + * [SCSI] scsi_transport_spi: fix sense buffer size error + * [SCSI] seagate: remove BROKEN tag + * [SCSI] qla2xxx: Don't log trace-control async-events. + * [SCSI] qla2xxx: Correct endianess issue while interrogating MS status. + * [SCSI] qla2xxx: Use proper prep_ms_iocb() function during GFPN_ID. + * [SCSI] qla2xxx: Detect GPSC capabilities within a fabric. + * [SCSI] qla2xxx: Correct IOCB queueing mechanism for ISP54XX HBAs. + * [SCSI] qla2xxx: Correct reset handling logic. + * [SCSI] qla2xxx: Perform a fw-dump when an ISP23xx RISC-paused state is + detected. + * [SCSI] qla2xxx: Use generic isp_ops.fw_dump() function. + * [SCSI] qla2xxx: Update version number to 8.01.07-k4. + * ARM: OMAP: fix MMC workqueue changes + * MMC: at91 mmc linkage updates + * i2c-pnx: Fix interrupt handler, get rid of EARLY config option + * i2c-pnx: Add entry to MAINTAINERS + * i2c: Migration aids for i2c_adapter.dev removal + * ACPI: Altix: ACPI _PRT support + * IB/mthca: Fix off-by-one in FMR handling on memfree + * i2c-mv64xxx: Fix random oops at boot + * i2c/m41t00: Do not forget to write year + * UHCI: make test for ASUS motherboard more specific + * UHCI: support device_may_wakeup + * USB: fix interaction between different interfaces in an "Option" usb + device + * USB: funsoft is borken on sparc + * USB: omap_udc build fixes (sync with linux-omap) + * USB Storage: unusual_devs: add supertop drives + * USB storage: fix ipod ejecting issue + * USB: small update to Documentation/usb/acm.txt + * USB: Fixed bug in endpoint release function. + * sisusb_con warning fixes + * USB: usblp.c - add Kyocera Mita FS 820 to list of "quirky" printers + * USB: asix: Fix AX88772 device PHY selection + * PCI: disable PCI_MULTITHREAD_PROBE + * Driver core: Fix prefix driver links in /sys/module by bus-name + * ACPI: ec: enable printk on cmdline use + * Add AFS_SUPER_MAGIC to magic.h + * Fix implicit declarations in via-pmu + * Fix leds-s3c24xx hardware.h reference + * start_kernel: test if irq's got enabled early, barf, and disable them + again + * kernelparams: detect if and which parameter parsing enabled irq's + * PCI: prevent down_read when pci_devices is empty + * via82cxxx: fix cable detection + * KVM: Fix GFP_KERNEL alloc in atomic section bug + * KVM: Use raw_smp_processor_id() instead of smp_processor_id() where + applicable + * KVM: Recover after an arch module load failure + * KVM: Improve interrupt response + * rtc-at91rm9200 build fix + * Fix BUG at drivers/scsi/scsi_lib.c:1118 caused by "pktsetup dvd + /dev/sr0" + * atiixp: Old drivers/ide layer driver for the ATIIXP hang fix + * adfs: fix filename handling + * swsusp: Do not fail if resume device is not set + * profiling: fix sched profiling typo + * i386: Restore CONFIG_PHYSICAL_START option + * Sanely size hash tables when using large base pages + * i386: fix modpost warning in SMP trampoline code + * i386: fix another modpost warning + * i386: modpost smpboot code warning fix + * ip2 warning fix + * fix memory corruption from misinterpreted bad_inode_ops return values + * fix BUG_ON(!PageSlab) from fallback_alloc + * Update the rtc-rs5c372 driver + * KVM: Prevent stale bits in cr0 and cr4 + * KVM: MMU: Implement simple reverse mapping + * KVM: MMU: Teach the page table walker to track guest page table gfns + * KVM: MMU: Load the pae pdptrs on cr3 change like the processor does + * KVM: MMU: Fold fetch_guest() into init_walker() + * KVM: MU: Special treatment for shadow pae root pages + * KVM: MMU: Use the guest pdptrs instead of mapping cr3 in pae mode + * KVM: MMU: Make the shadow page tables also special-case pae + * KVM: MMU: Make kvm_mmu_alloc_page() return a kvm_mmu_page pointer + * KVM: MMU: Shadow page table caching + * KVM: MMU: Write protect guest pages when a shadow is created for them + * KVM: MMU: Let the walker extract the target page gfn from the pte + * KVM: MMU: Support emulated writes into RAM + * KVM: MMU: Zap shadow page table entries on writes to guest page tables + * KVM: MMU: If emulating an instruction fails, try unprotecting the page + * KVM: MMU: Implement child shadow unlinking + * KVM: MMU: kvm_mmu_put_page() only removes one link to the page + * KVM: MMU: oom handling + * KVM: MMU: Remove invlpg interception + * KVM: MMU: Remove release_pt_page_64() + * KVM: MMU: Handle misaligned accesses to write protected guest page + tables + * KVM: MMU: kvm a little earlier + * KVM: Avoid oom on cr3 switch + * KVM: Add missing 'break' + * KVM: Don't set guest cr3 from vmx_vcpu_setup() + * KVM: MMU: Add missing dirty bit + * KVM: Make loading cr3 more robust + * KVM: Simplify mmu_alloc_roots() + * KVM: Simplify test for interrupt window + * pata_optidma: typo in Kconfig + * hpt37x: Two important bug fixes + * Check for populated zone in __drain_pages + * qconf: fix SIGSEGV on empty menu items + * fix the toshiba_acpi write_lcd return value + * fix OOM killing of swapoff + * fix garbage instead of zeroes in UFS + * shrink_all_memory(): fix lru_pages handling + * connector: some fixes for ia64 unaligned access errors + * [ARM] 4079/1: iop: Update MAINTAINERS + * [ARM] 4070/1: arch/arm/kernel: fix warnings from missing includes + * [ARM] 4082/1: iop3xx: fix iop33x gpio register offset + * [SCSI] scsi_scan: fix report lun problems with CDROM or RBC devices + * [SCSI] iscsi: fix 2.6.19 data digest calculation bug + * [SCSI] iscsi: fix crypto_alloc_hash() error check + * [SCSI] iscsi: newline in printk + * [SCSI] iscsi: simplify IPv6 and IPv4 address printing + * [SCSI] libiscsi: fix senselen calculation + * [SCSI] aacraid: Product List Update + * [SCSI] scsi: lpfc error path fix + * [SCSI] sr: fix error code check in sr_block_ioctl() + * [SCSI] 3ware 8000 serialize reset code + * [SCSI] megaraid_sas: Update module author + * [SCSI] fusion: fibre channel: return DID_ERROR for + MPI_IOCSTATUS_SCSI_IOC_TERMINATED + * [SCSI] fusion: power pc and miscellaneous bug fixs + * [SCSI] fusion: MODULE_VERSION support + * [SCSI] fusion: bump version + * [SCSI] qla1280: set residual correctly + * ixgb: Fix early TSO completion + * ixgb: Maybe stop TX if not enough free descriptors + * [ARM] Fix kernel-mode undefined instruction aborts + * Linux 2.6.20-rc4 + * IB/iser: Return error code when PDUs may not be sent + * qla3xxx: Remove NETIF_F_LLTX from driver features. + * qla3xxx: Add delay to NVRAM register access. + * RDMA/iwcm: iWARP connection timeouts shouldn't be reported as rejects + * RDMA/ucma: Fix struct ucma_event leak when backlog is full + * RDMA/ucma: Don't report events with invalid user context + * IB/mthca: Fix PRM compliance problem in atomic-send completions + * i915: Fix a DRM_ERROR that should be DRM_DEBUG. + * HID: fix mappings for DiNovo Edge Keyboard - Logitech USB BT receiver + * HID: tiny patch to remove a kmalloc cast + * HID: mousepoll parameter makes no sense for generic HID + * [ARM] Fix potential MMCI bug + * [ARM] pass vma for flush_anon_page() + * [ARM] Resolve fuse and direct-IO failures due to missing cache flushes + * [ARM] Provide basic printk_clock() implementation + * [MIPS] Malta: Add missing MTD file. + * [MIPS] csum_partial and copy in parallel + * [MIPS] SMTC build fix + * [MIPS] Fix build errors on SEAD + * [MIPS] pnx8550: Fix write_config_byte() PCI config space accessor + * [MIPS] TX49: Fix use of CDEX build_store_reg() + * [MIPS] PNX8550: Fix system timer support + * [POWERPC] Fix bogus BUG_ON() in in hugetlb_get_unmapped_area() + * [POWERPC] Fix unbalanced uses of of_node_put + * [POWERPC] Avoid calling get_irq_server() with a real, not virtual irq. + * [POWERPC] Fix manual assembly WARN_ON() in enter_rtas(). + * [POWERPC] Update ppc64_defconfig + * [POWERPC] Add legacy iSeries to ppc64_defconfig + * [POWERPC] 52xx: Don't use device_initcall to probe of_platform_bus + * [POWERPC] Fix mpc52xx fdt to use correct device_type for sound devices + * [POWERPC] Don't include powerpc/sysdev/rom.o for arch/ppc builds + * [POWERPC] Fix mpc52xx serial driver to work for arch/ppc again + * [POWERPC] disable PReP and EFIKA during make oldconfig + * [POWERPC] iSeries: fix mf proc initialisation + * [POWERPC] iSeries: fix proc/iSeries initialisation + * [POWERPC] iSeries: fix lpevents initialisation + * [POWERPC] iSeries: fix viopath initialisation + * [POWERPC] iSeries: fix setup initcall + * [POWERPC] Fix corruption in hcall9 + * [POWERPC] Fix bugs in the hypervisor call stats code + * forcedeth: sideband management fix + * s390: qeth driver fixes: VLAN hdr, perf stats + * s390: qeth driver fixes: packet socket + * s390: qeth driver fixes: atomic context fixups + * s390: iucv Kconfig help description changes + * chelsio: error path fix + * pcnet_cs : add new id + * [ALSA] Audio: Add nvidia HD Audio controllers of MCP67 support to + hda_intel.c + * [ALSA] Fix potential NULL pointer dereference in echoaudio midi + * [ALSA] usb-audio: work around wrong frequency in CM6501 descriptors + * [ALSA] hda_intel: ALSA HD Audio patch for Intel ICH9 + * [ALSA] hda-codec - Fix NULL dereference in generic hda code + * [ALSA] _snd_cmipci_uswitch_put doesn't set zero flags + * [ALSA] usb: usbmixer error path fix + * [ALSA] usbaudio - Fix kobject_add() error at reconnection + * [INET]: Fix incorrect "inet_sock->is_icsk" assignment. + * [X25]: Trivial, SOCK_DEBUG's in x25_facilities missing newlines + * [Bluetooth] Add packet size checks for CAPI messages + * [Bluetooth] More checks if DLC is still attached to the TTY + * [Bluetooth] Fix uninitialized return value for RFCOMM sendmsg() + * [Bluetooth] Handle device registration failures + * [Bluetooth] Correct SCO buffer size for another ThinkPad laptop + * [Bluetooth] Correct SCO buffer for Broadcom based HP laptops + * [Bluetooth] Correct SCO buffer for Broadcom based Dell laptops + * NetLabel: correct locking in selinux_netlbl_socket_setsid() + * NetLabel: correct CIPSO tag handling when adding new DOI definitions + * [BNX2]: Don't apply CRC PHY workaround to 5709. + * [BNX2]: Fix 5709 Serdes detection. + * [BNX2]: Fix bug in bnx2_nvram_write(). + * [BNX2]: Update version and reldate. + * [TG3]: Add PHY workaround for 5755M. + * [NETFILTER]: nf_conntrack_netbios_ns: fix uninitialized member in + expectation + * [TCP]: Fix iov_len calculation in tcp_v4_send_ack(). + * [S390] memory detection misses 128k. + * [S390] cio: use barrier() in stsch_reset. + * [S390] Fix cpu hotplug (missing 'online' attribute). + * [S390] Fix vmalloc area size calculation. + * [S390] don't call handle_mm_fault() if in an atomic context. + * [S390] locking problem with __cpcmd. + * [ALSA] version 1.0.14rc1 + * HID: Fix DRIVER_DESC macro + * i2c/pci: fix sis96x smbus quirk once and for all + * IB/ehca: Use proper GFP_ flags for get_zeroed_page() + * IB/mthca: Don't execute QUERY_QP firmware command for QP in RESET state + * [NETFILTER]: nf_conntrack_ipv6: fix crash when handling fragments + * [NETFILTER]: arp_tables: fix userspace compilation + * [NETFILTER]: nf_nat: fix hanging connections when loading the NAT + module + * [NETFILTER]: tcp conntrack: fix IP_CT_TCP_FLAG_CLOSE_INIT value + * [SCTP]: Fix err_hdr assignment in sctp_init_cause. + * [INET]: style updates for the inet_sock->is_icsk assignment fix + * [IPV4] devinet: inetdev_init out label moved after RCU assignment + * [JFFS2] Reschedule in loops + * [JFFS2] use the ref_offset macro + * [MTD] OneNAND: fix onenand_wait bug + * [MTD] OneNAND: add subpage write support + * [MTD] OneNAND: release CPU in cycles + * [MTD] OneNAND: fix onenand_wait bug in read ecc error + * [MTD] OneNAND: Implement read-while-load + * [MTD] OneNAND: return ecc error code only when 2-bit ecc occurs + * [MTD] OneNAND: Handle DDP chip boundary during read-while-load + * MAINTAINERS: maintainer for sata_promise + * fix linux banner format string + * ieee1394: sbp2: fix probing of some DVD-ROM/RWs + * [MIPS] PNX8550: Fix system timer initialization + * [MIPS] Fix N32 SysV IPC routines + * [MIPS] Alchemy: Fix PCI-memory access + * Page allocation hooks for VMI backend + * Paravirt CPU hypercall batching mode + * IOPL handling for paravirt guests + * SMP boot hook for paravirt + * VMI backend for paravirt-ops + * VMI timer patches + * Vmi compile fix + * Vmi native fix + * x86-64: Update defconfig + * i386: Update defconfig + * x86-64: Make noirqdebug_setup function non init to fix modpost warning + * x86-64: Use different constraint for gcc < 4.1 in bitops.h + * i386: cpu hotplug/smpboot misc MODPOST warning fixes + * i386: make apic probe function non-init + * x86-64: modpost add more symbols to whitelist pattern2 + * x86-64: Modpost whitelist reference to more symbols (pattern 3) + * x86-64: pci quirks MODPOST warning fix + * x86-64: - Ignore long SMI interrupts in clock calibration + * x86-64: tighten up printks + * i386: Fix memory hotplug related MODPOST generated warning + * i386: Convert some functions to __init to avoid MODPOST warnings + * x86-64: Fix warnings in ia32_aout.c + * ACPI: rename cstate_entry_s to cstate_entry + * ACPI: delete two spurious ACPI messages + * ACPI: schedule obsolete features for deletion + * ACPI: update MAINTAINERS + * Pull trivial into release branch + * Don't put "linux_banner" in the .init section + * sched: tasks cannot run on cpus onlined after boot + * increment pos before looking for the next cap in __pci_find_next_ht_cap + * Fix sparsemem on Cell + * qconf: (re)fix SIGSEGV on empty menu items + * rtc-sh: correctly report rtc_wkalrm.enabled + * Change cpu_up and co from __devinit to __cpuinit + * Kdump documentation update + * i386: sched_clock using init data tsc_disable fix + * md: pass down BIO_RW_SYNC in raid{1,10} + * KVM: add VM-exit profiling + * NFS: Fix race in nfs_release_page() + * really fix funsoft driver + * Revert bd_mount_mutex back to a semaphore + * intel-rng workarounds + * Fix HWRNG built-in initcalls priority + * fix typo in geode_configre()@cyrix.c + * FD_ZERO build fix + * PCMCIA: fix drivers broken by recent cleanup + * blktrace: only add a bounce trace when we really bounce + * Linux v2.6.20-rc5 + * [JFFS2] debug.h: include for current->pid + * omap: Update MMC response types + * mmc: Correct definition of R6 + * V4L/DVB (5019): Fix the frame->grabstate update in read() entry point. + * V4L/DVB (5020): Fix: disable interrupts while at KM_BOUNCE_READ + * V4L/DVB (5021): Cx88xx: Fix lockup on suspend + * V4L/DVB (5024): Fix quickcam communicator driver for big endian + architectures + * V4L/DVB (5029): Ks0127 status flags + * V4L/DVB (5033): MSI TV@nywhere Plus fixes + * V4L/DVB (5069): Fix bttv and friends on 64bit machines with lots of + memory + * V4L/DVB (5071): Tveeprom: autodetect LG TAPC G701D as tuner type 37 + * V4L/DVB (5023): Fix compilation on ppc32 architecture + * bcm43xx: Fix failure to deliver PCI-E interrupts + * NTFS: 2.1.28 - Fix deadlock reported by Sergey Vlasov due to + ntfs_put_inode(). + * NTFS: Forgot to bump version number in makefile to 2.1.28... + * 8139cp: Don't blindly enable interrupts + * myri10ge: make wc_fifo usage load-time tunable + * myri10ge: check that we can get an irq + * myri10ge: update driver version to 1.2.0 + * Update ucc_geth.c for new workqueue structure + * Fix phy_read/write redefinition errors in ucc_geth_phy.c + * hwmon/w83793: Remove the description of AMDSI and update the voltage + formula + * hwmon: Fix the VRD 11 decoding + * hwmon/w83793: Ignore disabled temperature channels + * hwmon/w83793: Fix the fan input detection + * hwmon/w83793: Hide invalid VID readings + * [MIPS] SMTC: Fix cp0 hazard. + * [MIPS] Delete duplicate call to load_irq_save. + * sis190: failure to set the MAC address from EEPROM + * libata doc: "error : unterminated entity reference exceptions" + * sata_via: add PCI ID 0x5337 + * libata: initialize qc->dma_dir to DMA_NONE + * libata: fix handling of port actions in per-dev action mask + * sata_mv HighPoint 2310 support (88SX7042) + * HID: fix some ARM builds due to HID brokenness - make USB_HID depend on + INPUT + * HID: GEYSER4_ISO needs quirk + * HID: update MAINTAINERS entry for USB-HID + * HID: proper LED-mapping for SpaceNavigator + * HID: compilation fix when DEBUG_DATA is defined + * HID: hid/hid-input.c doesn't need to include linux/usb/input.h + * HID: add missing RX, RZ and RY enum values to hid-debug output + * HID: put usb_interface instead of usb_device into hid->dev to fix + udevinfo breakage + * hid-core.c: Adds GTCO CalComp Interwrite IPanel PIDs to blacklist + * [CIFS] Remove 2 unneeded kzalloc casts + * [CIFS] cifs sprintf fix + * ocfs2: Don't print errors when following symlinks + * ocfs2: Directory c/mtime update fixes + * ocfs2: cleanup ocfs2_iget() errors + * ocfs2: Add backup superblock info to ocfs2_fs.h + * [CIFS] Fix oops when Windows server sent bad domain name null + terminator + * [POWERPC] Remove bogus sanity check in pci -> OF node code + * [POWERPC] Fix cell's mmio nvram to properly parse device tree + * [POWERPC] Fix broken DMA on non-LPAR pSeries + * [POWERPC] Make it blatantly clear; mpc5200 device tree is not yet + stable + * [POWERPC] Fix OF node refcnt underflow in 836x and 832x platform code + * [POWERPC] atomic_dec_if_positive sign extension fix + * usbtouchscreen: make ITM screens report BTN_TOUCH as zero when not + touched + * USB: asix: Detect internal PHY and enable/use accordingly + * USB: rndis_host: fix crash while probing a Nokia S60 mobile + * USB: make usbhid ignore Imation Disc Stakka + * USB: unusual_devs.h for 0x046b:ff40 + * USB: add vendor/device id for Option GT Max 3.6 cards + * USB: disable USB_MULTITHREAD_PROBE + * USB: Fix for typo in ohci-ep93xx.c + * USB: unusual_devs.h entry for nokia 6233 + * PCI: Unhide the SMBus on the Asus P4P800-X + * PCI: rework Documentation/pci.txt + * PCI: fix pci-driver kernel-doc + * [Bluetooth] Missing endian swapping for L2CAP socket list + * [Bluetooth] Restrict well known PSM to privileged users + * IB/srp: Check match_strdup() return + * IB/ehca: Fix improper use of yield() with spinlock held + * IB/ehca: Fix mismatched spin_unlock in irq handler + * vmx: Fix register constraint in launch code + * x86: fix PDA variables to work during boot + * modify 3c589_cs to be SMP safe + * Note that JFFS (v1) is to be deleted, in feature-removal-schedule.txt + * more ftape removal + * PHY: Export phy ethtool helpers + * ehea: Fixed wrong dereferencation + * ehea: Fixing firmware queue config issue + * ehea: Modified initial autoneg state determination + * ehea: New method to determine number of available ports + * ehea: Improved logging of permission issues + * ehea: Added logging off associated errors + * ehea: Fixed possible nullpointer access + * NetXen: Firmware check modifications + * NetXen: Use pci_register_driver() instead of pci_module_init() in + init_module + * [ALSA] Repair snd-usb-usx2y over OHCI + * fix "kvm: add vm exit profiling" + * Revert nmi_known_cpu() check during boot option parsing + * blockdev direct_io: fix signedness bug + * SubmitChecklist update + * paravirt: mark the paravirt_ops export internal + * KVM: make sure there is a vcpu context loaded when destroying the mmu + * KVM: fix race between mmio reads and injected interrupts + * KVM: x86 emulator: fix bit string instructions + * KVM: fix bogus pagefault on writable pages + * rtc-sh: act on rtc_wkalrm.enabled when setting an alarm + * fix blk_direct_IO bio preparation + * tlclk: bug fix + misc fixes + * mbind: restrict nodes to the currently allowed cpuset + * resierfs: avoid tail packing if an inode was ever mmapped + * Kdump documentation update: kexec-tools update + * Kdump documentation update: ia64 portion + * acpi: remove "video device notify" message + * [MIPS] SMTC: Instant IPI replay. + * [MIPS] Vr41xx: Fix after GENERIC_HARDIRQS_NO__DO_IRQ change + * elevator: move clearing of unplug flag earlier + * notifiers: fix blocking_notifier_call_chain() scalability + * funsoft: ktermios fix + * horizon.c: missing __devinit + * s2io bogus memset + * fix prototype of csum_ipv6_magic() (ia64) + * correct sys_shmget allocation check + * s2io bogus memset + * mv643xx_eth: Fix race condition in mv643xx_eth_free_tx_descs + * Clear spurious irq stat information when adding irq handler + * email change for shemminger@osdl.org + * Change Linus' email address too + * V4L/DVB (5123): Buf_qbuf: fix: videobuf_queue->stream corruption and + lockup + * [IPSEC] flow: Fix potential memory leak + * [IPV6] MCAST: Fix joining all-node multicast group on device + initialization. + * [SELINUX]: increment flow cache genid + * [NETFILTER]: ctnetlink: fix leak in ctnetlink_create_conntrack error + path + * [NETFILTER]: fix xt_state compile failure + * [SCTP]: Set correct error cause value for missing parameters + * [SCTP]: Verify some mandatory parameters. + * [SCTP]: Correctly handle unexpected INIT-ACK chunk. + * [SCTP]: Fix SACK sequence during shutdown + * [X.25]: Add missing sock_put in x25_receive_data + * [IrDA]: irda-usb TX path optimization (was Re: IrDA spams logfiles - + since 2.6.19) + * [IrDA]: Removed incorrect IRDA_ASSERT() + * [IPSEC]: Policy list disorder + * [TCP]: skb is unexpectedly freed. + * [IRDA] vlsi_ir.{h,c}: remove kernel 2.4 code + * [NETFILTER]: Fix iptables ABI breakage on (at least) CRIS + * [NET]: Process include/linux/if_{addr,link}.h with unifdef + * [TCP]: rare bad TCP checksum with 2.6.19 + * [IPV6]: Fixed the size of the netlink message notified by + inet6_rt_notify(). + * [IP] TUNNEL: Fix to be built with user application. + * [SCTP]: Fix compiler warning. + * ahci: make ULi M5288 ignore interface fatal error bit + * sata_nv: don't rely on NV_INT_DEV indication with ADMA + * ahci: don't enter slumber on power down + * libata: Fixup n_elem initialization + * libata: Initialize qc->pad_len + * [POWERPC] PS3: Fix uniprocessor kernel build + * [POWERPC] ps3_free_io_irq: Fix inverted error check + * [MIPS] There is no __GNUC_MAJOR__ + * [MIPS] Fix APM build + * [MIPS] SMTC: Fix TLB sizing bug for TLB of 64 >= entries + * [MIPS] SMTC: Fix module build by exporting symbol + * [MIPS] vr41xx: need one more nop with mtc0_tlbw_hazard() + * [MIPS] Fix reported amount of freed memory - it's in kB not bytes + * [MIPS] VPE loader: Initialize lists before they're actually being used + ... + * [MIPS] Fix wrong checksum calculation on 64-bit MIPS + * NFS: Fix Oops in rpc_call_sync() + * NFS: Fix races in nfs_revalidate_mapping() + * [IPV4]: Fix the fib trie iterator to work with a single entry routing + tables + * [AF_PACKET]: Fix BPF handling. + * libata cmd64x: whack into a shape that looks like the documentation + * libata hpt3xn: Hopefully sort out the DPLL logic versus the vendor code + * libata: set_mode, Fix the FIXME + * Linux 2.6.20-rc6 + * [TCP]: Fix sorting of SACK blocks. + * sata_via: don't diddle with ATA_NIEN in ->freeze + * ahci: improve and limit spurious interrupt messages, take#3 + * libata: implement ATA_FLAG_IGN_SIMPLEX and use it in sata_uli + * libata-sff: Don't call bmdma_stop on non DMA capable controllers + * [BNX2]: Fix 2nd port's MAC address. + * [DECNET]: Handle a failure in neigh_parms_alloc (take 2) + * x86_64: fix put_user for 64-bit constant + * [AF_PACKET]: Check device down state before hard header callbacks. + * [TCP]: Restore SKB socket owner setting in tcp_transmit_skb(). + * [NETFILTER]: nf_nat: fix ICMP translation with statically linked + conntrack + * [NETFILTER]: nf_nat_pptp: fix expectation removal + * [NETFILTER]: nf_conntrack_pptp: fix NAT setup of expected GRE + connections + * [AVR32] Export clear_page symbol + * [AVR32] Update ATSTK1000 defconfig: Enable macb by default + * Resurrect 'try_to_free_buffers()' VM hackery + * Write back inode data pages even when the inode itself is locked + * KVM: SVM: Fix SVM idt confusion + * KVM: Emulate IA32_MISC_ENABLE msr + * KVM: MMU: Perform access checks in walk_addr() + * KVM: MMU: Report nx faults to the guest + * KVM: SVM: Propagate cpu shutdown events to userspace + * S3C24XX: fix passing spi chipselect to select routine + * spi: fix error setting the spi mode in pxa2xx_spi.c + * Fix CONFIG_COMPAT_VDSO + * Fix gate_vma.vm_flags + * Add VM_ALWAYSDUMP + * i386 vDSO: use VM_ALWAYSDUMP + * x86_64 ia32 vDSO: use VM_ALWAYSDUMP + * powerpc vDSO: use VM_ALWAYSDUMP + * x86_64 ia32 vDSO: define arch_vma_name + * Fix NULL ->nsproxy dereference in /proc/*/mounts + * SPI: alternative fix for spi_busnum_to_master + * ACPI: fix cpufreq regression + * Gigaset ISDN driver error handling fixes + * knfsd: update email address and status for NFSD in MAINTAINERS + * knfsd: fix setting of ACL server versions + * knfsd: fix an NFSD bug with full sized, non-page-aligned reads + * knfsd: replace some warning ins nfsfh.h with BUG_ON or WARN_ON + * knfsd: Don't mess with the 'mode' when storing a exclusive-create + cookie + * md: update email address and status for MD in MAINTAINERS + * md: make 'repair' actually work for raid1 + * md: make sure the events count in an md array never returns to zero + * md: avoid reading past the end of a bitmap file + * 9p: fix bogus return code checks during initialization + * 9p: fix rename return code + * 9p: update documentation regarding server applications + * 9p: fix segfault caused by race condition in meta-data operations + * 9p: null terminate error strings for debug print + * dm-multipath: fix stall on noflush suspend/resume + * remove __devinit markings from rtc_sysfs_add_device() + * fix various kernel-doc in header files + * knfsd: Fix type mismatch with filldir_t used by nfsd + * md: fix potential memalloc deadlock in md + * MM: Remove invalidate_inode_pages2_range() debug + * Fix UML on non-standard VM split hosts + * md: remove unnecessary printk when raid5 gets an unaligned read. + * core-dumping unreadable binaries via PT_INTERP + * netdev: add a MAINTAINERS entry for via-velocity and update my address + * Fix race in efi variable delete code + * ahci: fix endianness in spurious interrupt message + * sata_via: style clean up, no indirect method call in LLD + * ahci: use 0x80 as wait stat value instead of 0xff + * Fix Maple PATA IRQ assignment. + * ocfs2: fix thinko in ocfs2_backup_super_blkno() + * Boot loader ID for Gujin + * [SPARC64]: Set g4/g5 properly in sun4v dtlb-prot handling. + * [SELINUX]: Fix 2.6.20-rc6 build when no xfrm + * [IPV4]: Fix single-entry /proc/net/fib_trie output. + * [POWERPC] PS3: add not complete comment to kconfig + * [POWERPC] Fix sys_pciconfig_iobase bus matching + + -- Ben Collins Sat, 06 Jan 2007 13:41:11 -0500 + +linux-source-2.6.20 (2.6.20-5.7) feisty; urgency=low + + [Upstream Kernel Changes] + + * [PARTITION]: Add whole_disk attribute. + * [AGPGART] K8M890 support for amd-k8. + * [SPARC64]: Add obppath sysfs attribute for SBUS and PCI devices. + * [AGPGART] Remove unnecessary flushes when inserting and removing pages. + * [CPUFREQ] select consistently + * [CPUFREQ] Bug fix for acpi-cpufreq and cpufreq_stats oops on frequency + change notification + * [CPUFREQ] speedstep-centrino: missing space and bracket + * [AGPGART] fix detection of aperture size versus GTT size on G965 + * [AGPGART] Fix PCI-posting flush typo. + * [CPUFREQ] longhaul: Fix up unreachable code. + * [CPUFREQ] Longhaul - Fix up powersaver assumptions. + * backlight: fix backlight_device_register compile failures + * ACPI: EC: move verbose printk to debug build only + * ACPI: increase ACPI_MAX_REFERENCE_COUNT for larger systems + * ACPI: fix section mis-match build warning + * ACPI: asus_acpi: new MAINTAINER + * [AGPGART] drivers/char/agp/sgi-agp.c: check kmalloc() return value + * [CPUFREQ] Longhaul - Always guess FSB + * [CPUFREQ] Uninitialized use of cmd.val in + arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c:acpi_cpufreq_target() + * [CPUFREQ] longhaul: Kill off warnings introduced by recent changes. + * cdrom: set default timeout to 7 seconds + * ide-cd maintainer + * [SOUND] Sparc CS4231: Fix IRQ return value and initialization. + * [NET]: ifb double-counts packets + * [PKTGEN]: Convert to kthread API. + * [NET] drivers/net/loopback.c: convert to module_init() + * [NETFILTER] xt_hashlimit.c: fix typo + * [XFRM_USER]: avoid pointless void ** casts + * [AF_NETLINK]: module_put cleanup + * [X25]: proper prototype for x25_init_timers() + * [SOUND] Sparc CS4231: Use 64 for period_bytes_min + * [SUNGEM]: PHY updates & pause fixes (#2) + * Fix some ARM builds due to HID brokenness + * HID: fix help texts in Kconfig + * [NETFILTER]: compat offsets size change + * [NETFILTER]: Fix routing of REJECT target generated packets in output + chain + * [NETFILTER]: New connection tracking is not EXPERIMENTAL anymore + * [NETFILTER]: nf_nat: fix MASQUERADE crash on device down + * [NETFILTER]: ebtables: don't compute gap before checking struct type + * [TCP]: Use old definition of before + + -- Ben Collins Fri, 05 Jan 2007 01:27:26 -0500 + +linux-source-2.6.20 (2.6.20-4.6) feisty; urgency=low + + [Ben Collins] + + * acpi/ec: Quiet "evaluating _XX" messages + - GIT-SHA 312a9aed094affc358a8e22b17b209059e68252e + - Bug #77867 + + -- Ben Collins Wed, 03 Jan 2007 16:58:54 -0500 + +linux-source-2.6.20 (2.6.20-4.5) feisty; urgency=low + + [Ben Collins] + + * toshiba_acpi: Add toshset patch + - GIT-SHA 1ffa3a0ddcf076a379a1674725c80fd752e00ed9 + - Bug #73011 + * pm: Config option to disable handling of console during suspend/resume. + - GIT-SHA e301ddf3803af8e6e87048216c63f2adb3e98f10 + - Bug #56591 + * speakup: Update to latest CVS + - GIT-SHA 5f635ed9ba1cbaa1f6f3a0b1b9cba94be3129d2a + * speakup: Include jiffies.h (removed during update) + - GIT-SHA 1bbf403f5d5bb47b707fa4664c815ec42c155279 + + [Upstream Kernel Changes] + + * zd1211rw: Call ieee80211_rx in tasklet + * ieee80211softmac: Fix errors related to the work_struct changes + * ieee80211softmac: Fix mutex_lock at exit of ieee80211_softmac_get_genie + * e1000: The user-supplied itr setting needs the lower 2 bits masked off + * e1000: dynamic itr: take TSO and jumbo into account + * e1000: For sanity, reformat e1000_set_mac_type(), struct + e1000_hw[_stats] + * e1000: omit stats for broken counter in 82543 + * e1000: consolidate managability enabling/disabling + * e1000: Fix Wake-on-Lan with forced gigabit speed + * e1000: disable TSO on the 82544 with slab debugging + * e1000: workaround for the ESB2 NIC RX unit issue + * e1000: fix to set the new max frame size before resetting the adapter + * e1000: fix ethtool reported bus type for older adapters + * e1000: narrow down the scope of the tipg timer tweak + * e1000: Fix PBA allocation calculations + * e1000: Make the copybreak value a module parameter + * e1000: 3 new driver stats for managability testing + * e1000: No-delay link detection at interface up + * netxen: remove private ioctl + * netpoll: drivers must not enable IRQ unconditionally in their NAPI + handler + * r8169: use the broken_parity_status field in pci_dev + * myri10ge: match number of save_state and restore + * myri10ge: move request_irq to myri10ge_open + * myri10ge: make msi configurable at runtime through sysfs + * myri10ge: no need to save MSI and PCIe state in the driver + * myri10ge: handle failures in suspend and resume + * e1000: Do not truncate TSO TCP header with 82544 workaround + * via-velocity uses INET interfaces + * sky2: dual port NAPI problem + * sky2: power management/MSI workaround + * sky2: phy power down needs PCI config write enabled + * ep93xx: some minor cleanups to the ep93xx eth driver + * PHY probe not working properly for ibm_emac (PPC4xx) + * NetXen: Adding new device ids. + * NetXen: driver reload fix for newer firmware. + * NetXen: Using correct CHECKSUM flag. + * NetXen: Multiple adapter fix. + * NetXen: Link status message correction for quad port cards. + * NetXen: work queue fixes. + * NetXen: Fix for PPC machines. + * NetXen: Reducing ring sizes for IOMMU issue. + * forcedeth: modified comment header + * r8169: extraneous Cmd{Tx/Rx}Enb write + * V4L/DVB (4955): Fix autosearch index + * V4L/DVB (4956): [NOVA-T-USB2] Put remote-debugging in the right place + * V4L/DVB (4958): Fix namespace conflict between w9968cf.c on MIPS + * V4L/DVB (4959): Usbvision: possible cleanups + * V4L/DVB (4960): Removal of unused code from usbvision-i2c.c + * V4L/DVB (4964): VIDEO_PALETTE_YUYV and VIDEO_PALETTE_YUV422 are the + same palette + * V4L/DVB (4967): Add missing tuner module option pal=60 for PAL-60 + support. + * V4L/DVB (4968): Add PAL-60 support for cx2584x. + * V4L/DVB (4970): Usbvision memory fixes + * V4L/DVB (4972): Dvb-core: fix bug in CRC-32 checking on 64-bit systems + * V4L/DVB (4973): Dvb-core: fix printk type warning + * V4L/DVB (4979): Fixes compilation when CONFIG_V4L1_COMPAT is not + selected + * V4L/DVB (4980): Fixes bug 7267: PAL/60 is not working + * V4L/DVB (4982): Fix broken audio mode handling for line-in in msp3400. + * V4L/DVB (4983): Force temporal filter to 0 when scaling to prevent + ghosting. + * V4L/DVB (4984): LOG_STATUS should show the real temporal filter value. + * V4L/DVB (4988): Cx2341x audio_properties is an u16, not u8 + * V4L/DVB (4990): Cpia2/cpia2_usb.c: fix error-path leak + * V4L/DVB (4991): Cafe_ccic.c: fix NULL dereference + * V4L/DVB (4992): Fix typo in saa7134-dvb.c + * V4L/DVB (4994): Vivi: fix use after free in list_for_each() + * V4L/DVB (4995): Vivi: fix kthread_run() error check + * V4L/DVB (4996): Msp3400: fix kthread_run error check + * V4L/DVB (4997): Bttv: delete duplicated ioremap() + * V4L/DVB (5014): Allyesconfig build fixes on some non x86 arch + * V4L/DVB (5001): Add two required headers on kernel 2.6.20-rc1 + * V4L/DVB (5012): Usbvision fix: It was using "&&" instead "&" + * V4L/DVB (5010): Cx88: Fix leadtek_eeprom tagging + * [S390] Change max. buffer size for monwriter device. + * [S390] cio: fix stsch_reset. + * ocfs2: don't print error in ocfs2_permission() + * ocfs2: Allow direct I/O read past end of file + * ocfs2: ignore NULL vfsmnt in ocfs2_should_update_atime() + * ocfs2: always unmap in ocfs2_data_convert_worker() + * ocfs2: export heartbeat thread pid via configfs + * VM: Fix nasty and subtle race in shared mmap'ed page writeback + * ieee1394: sbp2: pass REQUEST_SENSE through to the target + * ieee1394: sbp2: fix bogus dma mapping + * [ARM] 4063/1: ep93xx: fix IRQ_EP93XX_GPIO?MUX numbering + * [ARM] 4064/1: make pxa_get_cycles() static + * [ARM] 4065/1: S3C24XX: dma printk fixes + * [ARM] 4066/1: correct a comment about PXA's sched_clock range + * [ARM] 4071/1: S3C24XX: Documentation update + * [ARM] 4073/1: Prevent s3c24xx drivers from including + asm/arch/hardware.h and asm/arch/irqs.h + * [ARM] 4074/1: Flat loader stack alignment + * [ARM] 4077/1: iop13xx: fix __io() macro + * [ARM] 4078/1: Fix ARM copypage cache coherency problems + * Fix IPMI watchdog set_param_str() using kstrdup + * Fix lock inversion aio_kick_handler() + * powerpc iseries link error in allmodconfig + * change WARN_ON back to "BUG: at ..." + * rcu: rcutorture suspend fix + * fix oom killer kills current every time if there is memory-less-node + take2 + * Add .gitignore file for relocs in arch/i386 + * pci/probe: fix macro that confuses kernel-doc + * Char: mxser, fix oops when removing opened + * IB/mthca: Fix FMR breakage caused by kmemdup() conversion + * MAINTAINERS: email addr change for Eric Moore + * make fn_keys work again on power/macbooks + * Char: isicom, eliminate spinlock recursion + * Update to Documentation/tty.txt on line disciplines + * fix mrproper incompleteness + * sched: fix cond_resched_softirq() offset + * Fix compilation of via-pmu-backlight + * module: fix mod_sysfs_setup() return value + * ramfs breaks without CONFIG_BLOCK + * MM: SLOB is broken by recent cleanup of slab.h + * cciss: build with PROC_FS=n + * page_mkclean_one(): fix call to set_pte_at() + * SPI: define null tx_buf to mean "shift out zeroes" + * m25p80 build fixes (with MTD debug) + * SPI/MTD: mtd_dataflash oops prevention + * ARM: OMAP: fix GPMC compiler errors + * ARM: OMAP: fix missing header on apollon board + * Buglet in vmscan.c + * cpuset procfs warning fix + * respect srctree/objtree in Documentation/DocBook/Makefile + * spi_s3c24xx_gpio: use right header + * lockdep: printk warning fix + * PIIX: remove check for broken MW DMA mode 0 + * PIIX/SLC90E66: PIO mode fallback fix + * Update CREDITS and MAINTAINERS entries for Lennert Buytenhek + * KVM: Use boot_cpu_data instead of current_cpu_data + * KVM: Simplify is_long_mode() + * KVM: Initialize kvm_arch_ops on unload + * KVM: Implement a few system configuration msrs + * KVM: Move common msr handling to arch independent code + * KVM: More msr misery + * KVM: Rename some msrs + * KVM: Fix oops on oom + * kvm: fix GFP_KERNEL allocation in atomic section in + kvm_dev_ioctl_create_vcpu() + * sparc32: add offset in pci_map_sg() + * fuse: fix typo + * [SPARC64]: Fix "mem=xxx" handling. + * [SPARC64]: Fix of_iounmap() region release. + * [SPARC64]: Update defconfig. + * [SPARC64]: Handle ISA devices with no 'regs' property. + * [NET]: Add memory barrrier to netif_poll_enable() + * [NET]: Don't export linux/random.h outside __KERNEL__. + * [XFRM]: Algorithm lookup using .compat name + * restore ->pdeath_signal behaviour + * sound: hda: detect ALC883 on MSI K9A Platinum motherboards (MS-7280) + * libata: fix combined mode + * cfq-iosched: merging problem + * selinux: fix selinux_netlbl_inode_permission() locking + * Fix insta-reboot with "i386: Relocatable kernel support" + * [ARM] Fix VFP initialisation issue for SMP systems + * [ARM] 4080/1: Fix for the SSCR0_SlotsPerFrm macro + * [ARM] 4081/1: Add definition for TI Sync Serial Protocol + * x86_64: Fix dump_trace() + + -- Ben Collins Mon, 25 Dec 2006 19:30:22 -0500 + +linux-source-2.6.20 (2.6.20-3.4) feisty; urgency=low + + * Fix FTBFS due to changes in kernel-wedge. + + [Ben Collins] + + * ubuntu/media/usbvideo: Add USB Video Class driver (iSight) + - GIT-SHA a948310ffdeb5d8dddff193aa31da63039d985d5 + * ubuntu/media: Add usbvideo to build. + - GIT-SHA 545ee922c0c492929eaa0a4c675c0f6d3dbc4cfd + * prism2: Fix incorrect conversion of work queue. + - GIT-SHA 44e61605e7d160397082028780da4f749c13db00 + - Bug #76220 + * uvcvideo: Fix usb urb callback prototypes. + - GIT-SHA 4aea9254ec30b7422ca59a617f6a59d951e0769e + * debian/config: Disable speedstep_centrino in favor of acpi_cpufreq. + - GIT-SHA 2a0e7ef37fb8db5953f4c467219552835d7dddd8 + * Fix compile breakage. Patch taken from lkml (will be reverted). + - GIT-SHA 93a714f337c0636b72d605400f41347c4465a344 + * Add ivtv firmware. + - GIT-SHA 9ed1a41d11cffb205f425cc71e7f6c605b284d25 + * sata_svw: Check for error from ata_device_ata() + - GIT-SHA 4b0e1e03cb077b5659d656d8b869c11e2ae47f94 + - Bug #76391 + * pmu-backlight: Fixup for change in backlight_register. + - GIT-SHA c4f21571091b0b7eb798b1e76956b53475bcb5d8 + + [Upstream Kernel Changes] + + * ACPI: Remove unnecessary from/to-void* and to-void casts in + drivers/acpi + * ACPI: avoid gcc warnings in ACPI mutex debug code + * ACPI: uninline ACPI global locking functions + * ACPI: acpi-cpufreq: remove unused data when !CONFIG_SMP + * ACPI: ibm_acpi: Add support for the generic backlight device + * ACPI: asus_acpi: Add support for the generic backlight device + * ACPI: toshiba_acpi: Add support for the generic backlight device + * ACPI: make ec_transaction not extern + * ACPI: optimize pci_rootbridge search + * ACPI: dock: use mutex instead of spinlock + * ACPI: S4: Use "platform" rather than "shutdown" mode by default + * ACPI: Get rid of 'unused variable' warning in + acpi_ev_global_lock_handler() + * ACPI: update comment + * ACPI: button: register with input layer + * ACPI: ibm-acpi: new ibm-acpi maintainer + * ACPI: ibm-acpi: do not use / in driver names + * ACPI: ibm-acpi: trivial Lindent cleanups + * ACPI: ibm-acpi: Use a enum to select the thermal sensor reading + strategy + * ACPI: ibm-acpi: Implement direct-ec-access thermal reading modes for up + to 16 sensors + * ACPI: ibm-acpi: document thermal sensor locations for the A31 + * ACPI: ibm-acpi: prepare to cleanup fan_read and fan_write + * ACPI: ibm-acpi: clean up fan_read + * ACPI: ibm-acpi: break fan_read into separate functions + * ACPI: ibm-acpi: cleanup fan_write + * ACPI: ibm-acpi: document fan control + * ACPI: ibm-acpi: extend fan status functions + * ACPI: ibm-acpi: fix and extend fan enable + * ACPI: ibm-acpi: fix and extend fan control functions + * ACPI: ibm-acpi: store embedded controller firmware version for matching + * ACPI: ibm-acpi: workaround for EC 0x2f initialization bug + * ACPI: ibm-acpi: implement fan watchdog command + * ACPI: ibm-acpi: add support for the ultrabay on the T60,X60 + * ACPI: ibm-acpi: make non-generic bay support optional + * ACPI: ibm-acpi: backlight device cleanup + * ACPI: ibm-acpi: style fixes and cruft removal + * ACPI: ibm-acpi: update version and copyright + * ACPI: dock: Make the dock station driver a platform device driver. + * ACPI: dock: fix build warning + * ACPI: dock: Add a docked sysfs file to the dock driver. + * ACPI: dock: Fix symbol conflict between acpiphp and dock + * ACPI: ec: Allow for write semantics in any command. + * ACPI: ec: Enable EC GPE at beginning of transaction + * ACPI: ec: Increase timeout from 50 to 500 ms to handle old slow + machines. + * ACPI: ec: Read status register from check_status() function + * ACPI: ec: Remove expect_event and all races around it. + * ACPI: ec: Remove calls to clear_gpe() and enable_gpe(), as these are + handled at + * ACPI: ec: Query only single query at a time. + * ACPI: ec: Change semaphore to mutex. + * ACPI: ec: Rename gpe_bit to gpe + * ACPI: ec: Drop udelay() from poll mode. Loop by reading status field + instead. + * ACPI: ec: Acquire Global Lock under EC mutex. + * ACPI: ec: Style changes. + * ACPI: ec: Change #define to enums there possible. + * ACPI: ec: Lindent once again + * drm: fix return value check + * DRM: handle pci_enable_device failure + * i915_vblank_tasklet: Try harder to avoid tearing. + * [CPUFREQ] fixes typo in cpufreq.c + * [CPUFREQ] Trivial cleanup for acpi read/write port in acpi-cpufreq.c + * Generic HID layer - build: USB_HID should select HID + * input/hid: Supporting more keys from the HUT Consumer Page + * Generic HID layer - update MAINTAINERS + * ACPI: dock: add uevent to indicate change in device status + * drm: Unify radeon offset checking. + * [DLM] fix compile warning + * [GFS2] Fix Kconfig + * IB: Fix ib_dma_alloc_coherent() wrapper + * IB/srp: Fix FMR mapping for 32-bit kernels and addresses above 4G + * Fix "delayed_work_pending()" macro expansion + * IB/mthca: Add HCA profile module parameters + * IB/mthca: Use DEFINE_MUTEX() instead of mutex_init() + * Pull ec into test branch + * Pull dock into test branch + * Pull button into test branch + * Pull platform-drivers into test branch + * ACPI: ibm_acpi: respond to workqueue update + * Pull trivial into test branch + * ACPI: fix git automerge failure + * Pull bugfix into test branch + * Pull style into test branch + * ata_piix: IDE mode SATA patch for Intel ICH9 + * ata_piix: use piix_host_stop() in ich_pata_ops + * [libata] use kmap_atomic(KM_IRQ0) in SCSI simulator + * [libata] sata_svw: Disable ATAPI DMA on current boards (errata + workaround) + * libata: don't initialize sg in ata_exec_internal() if DMA_NONE (take + #2) + * ahci: do not mangle saved HOST_CAP while resetting controller + * ata: fix platform_device_register_simple() error check + * initializer entry defined twice in pata_rz1000 + * Fix help text for CONFIG_ATA_PIIX + * pata_via: Cable detect error + * Fix incorrect user space access locking in mincore() + * Make workqueue bit operations work on "atomic_long_t" + * Fix up mm/mincore.c error value cases + * m68k trivial build fixes + * sys_mincore: s/max/min/ + * [ARM] Add more syscalls + * [SPARC64]: Kill no-remapping-needed code in head.S + * [SPARC64]: Minor irq handling cleanups. + * [DocBook]: Fix two typos in generic IRQ docs. + * [SUNKBD]: Fix sunkbd_enable(sunkbd, 0); obvious. + * [SPARC64]: Mirror x86_64's PERCPU_ENOUGH_ROOM definition. + * [SPARC]: Update defconfig. + * [CPUFREQ] set policy->curfreq on initialization + * [ARM] Fix BUG()s in ioremap() code + * [ARM] 4034/1: pxafb: Fix compile errors + * [ARM] 4035/1: fix collie compilation + * [ARM] 4038/1: S3C24XX: Fix copyrights in include/asm-arm/arch-s3c2410 + (core) + * [ARM] 4039/1: S3C24XX: Fix copyrights in include/asm-arm/arch-s3c2410 + (mach) + * [ARM] 4040/1: S3C24XX: Fix copyrights in arch/arm/mach-s3c2410 + * [ARM] 4041/1: S3C24XX: Fix sparse errors from VA addresses + * [ARM] 4042/1: H1940: Fix sparse errors from VA addresses + * [ARM] 4043/1: S3C24XX: fix sparse warnings in + arch/arm/mach-s3c2410/s3c2440-clock.c + * [ARM] 4044/1: S3C24XX: fix sparse warnings in + arch/arm/mach-s3c2410/s3c2442-clock.c + * [ARM] 4045/1: S3C24XX: remove old VA for non-shared areas + * [ARM] 4046/1: S3C24XX: fix sparse errors arch/arm/mach-s3c2410 + * [ARM] 4048/1: S3C24XX: make s3c2410_pm_resume() static + * [ARM] 4049/1: S3C24XX: fix sparse warning due to upf_t in regs-serial.h + * [ARM] 4050/1: S3C24XX: remove old changelogs in arch/arm/mach-s3c2410 + * [ARM] 4051/1: S3C24XX: clean includes in S3C2440 and S3C2442 support + * [CPUFREQ] Advise not to use longhaul on VIA C7. + * [CPUFREQ] longhaul compile fix. + * [ARM] Fix warnings from asm/system.h + * [ARM] 4052/1: S3C24XX: Fix PM in arch/arm/mach-s3c2410/Kconfig + * [ARM] 4054/1: ep93xx: add HWCAP_CRUNCH + * [ARM] 4055/1: iop13xx: fix phys_io/io_pg_offst for iq81340mc/sc + * [ARM] 4056/1: iop13xx: fix resource.end off-by-one in flash setup + * [ARM] 4057/1: ixp23xx: unconditionally enable hardware coherency + * [ARM] 4015/1: s3c2410 cpu ifdefs + * [SPARC]: Make bitops use same spinlocks as atomics. + * more work_struct fixes: tas300x sound drivers + * [TG3]: replace kmalloc+memset with kzalloc + * [AX.25]: Mark all kmalloc users __must_check + * [AX.25]: Fix unchecked ax25_protocol_register uses. + * [AX.25]: Fix unchecked ax25_listen_register uses + * [AX.25]: Fix unchecked nr_add_node uses. + * [AX.25]: Fix unchecked ax25_linkfail_register uses + * [AX.25]: Fix unchecked rose_add_loopback_node uses + * [AX.25]: Fix unchecked rose_add_loopback_neigh uses + * [BNX2]: Fix panic in bnx2_tx_int(). + * [BNX2]: Fix bug in bnx2_nvram_write(). + * [BNX2]: Fix minor loopback problem. + * [NETFILTER] IPV6: Fix dependencies. + * [TG3]: Assign tp->link_config.orig_* values. + * [TG3]: Fix race condition when calling register_netdev(). + * [TG3]: Power down/up 5906 PHY correctly. + * [TG3]: Update version and reldate. + * [CONNECTOR]: Fix compilation breakage introduced recently. + * [TCP]: Fix oops caused by tcp_v4_md5_do_del + * [TCP]: Trivial fix to message in tcp_v4_inbound_md5_hash + * [IPV4]: Fix BUG of ip_rt_send_redirect() + * [CONNECTOR]: Replace delayed work with usual work queue. + * cciss: set default raid level when reading geometry fails + * cciss: fix XFER_READ/XFER_WRITE in do_cciss_request + * drm: savage: compat fix from drm git. + * drm: fixup comment header style + * drm: make kernel context switch same as for drm git tree. + * drm: r128: comment aligment with drm git + * drm: Stop defining pci_pretty_name + * ->nr_sectors and ->hard_nr_sectors are not used for BLOCK_PC requests + * Remove queue merging hooks + * __blk_rq_map_user() doesn't need to grab the queue_lock + * __blk_rq_unmap_user() fails to return error + * Fixup blk_rq_unmap_user() API + * [PARTITION]: Add whole_disk attribute. + * [POWERPC] cell: update cell_defconfig + * [POWERPC] cell: add forward struct declarations to spu.h + * [POWERPC] cell: Enable spider workarounds on all PCI buses + * [POWERPC] cell: Fix spufs with "new style" device-tree + * [POWERPC] spufs: fix assignment of node numbers + * [POWERPC] powerpc: add scanning of ebc bus to of_platform + * [ARM] 4022/1: iop13xx: generic irq fixups + * [ARM] 4059/1: VR1000: fix LED3's platform device number + * [ARM] 4061/1: xsc3: change of maintainer + * [ARM] 4060/1: update several ARM defconfigs + * [ARM] 4062/1: S3C24XX: Anubis and Osiris shuld have CONFIG_PM_SIMTEC + * ACPI: ibm_acpi: allow clean removal + * ACPI: fix single linked list manipulation + * ACPI: prevent processor module from loading on failures + * [POWERPC] Workaround oldworld OF bug with IRQs & P2P bridges + * [POWERPC] iSeries: fix viodasd init + * [POWERPC] iSeries: fix viotape init + * [POWERPC] iSeries: fix iseries_veth init + * [POWERPC] iSeries: fix viocd init + * [POWERPC] iSeries: fix viocons init + * [POWERPC] iSeries: fix CONFIG_VIOPATH dependency + * [POWERPC] Fix build of cell zImage.initrd + * [POWERPC] Probe Efika platform before CHRP. + * [POWERPC] Update MTD OF documentation + * [POWERPC] Fix PCI device channel state initialization + * [POWERPC] Fix register save area alignment for swapcontext syscall + * ACPI: make drivers/acpi/ec.c:ec_ecdt static + * ACPI: fix NULL check in drivers/acpi/osl.c + * ACPI: Kconfig - depend on PM rather than selecting it + * ACPI: Implement acpi_video_get_next_level() + * ACPI: video: Add dev argument for backlight_device_register + * fbdev: update after backlight argument change + * ACPI: Add support for acpi_load_table/acpi_unload_table_id + * Pull platform-drivers into test branch + * Pull ec into test branch + * Pull bugfix into test branch + * merge linus into test branch + * Pull sgi into test branch + * [ALSA] via82xx: add __devinitdata + * [ALSA] sound/usb/usbaudio: Handle return value of usb_register() + * [ALSA] sound: Don't include i2c-dev.h + * [ALSA] ac97_codec (ALC655): add EAPD hack for MSI L725 laptop + * [ALSA] use the ALIGN macro + * [ALSA] use the roundup macro + * [ALSA] ymfpci: fix swap_rear for S/PDIF passthrough + * [ALSA] hda-codec - Fix wrong error checks in patch_{realtek,analog}.c + * [ALSA] hda-codec - Don't return error at initialization of modem codec + * [ALSA] hdsp: precise_ptr control switched off by default + * [ALSA] hda-codec - Fix a typo + * [ALSA] pcm core: fix silence_start calculations + * [ALSA] hda-codec - Add model for HP q965 + * [ALSA] sound/core/control.c: remove dead code + * [ALSA] hda-codec - Fix model for ASUS V1j laptop + * [ALSA] hda-codec - Fix detection of supported sample rates + * [ALSA] hda-codec - Verbose proc output for PCM parameters + * [ALSA] ac97 - Fix potential negative array index + * [ALSA] hda-codec - fix typo in PCI IDs + * [ALSA] Fix races in PCM OSS emulation + * [ALSA] Fix invalid assignment of PCI revision + * [ALSA] Remove IRQF_DISABLED for shared PCI irqs + * [ALSA] snd_hda_intel 3stack mode for ASUS P5P-L2 + * [ALSA] sound: initialize rawmidi substream list + * [ALSA] sound: fix PCM substream list + * [ALSA] snd-ca0106: Add new card variant. + * [ALSA] snd-ca0106: Fix typos. + * [ALSA] ac97_codec - trivial fix for bit update functions + * [ALSA] ac97: Identify CMI9761 chips. + * [ALSA] version 1.0.14rc1 + * cfq-iosched: don't allow sync merges across queues + * block: document io scheduler allow_merge_fn hook + * [libata] pata_cs5530: suspend/resume support tweak + * [libata] pata_via: suspend/resume support fix + * USB: Fix oops in PhidgetServo + * USB: fix transvibrator disconnect race + * USB: airprime: add device id for dell wireless 5500 hsdpa card + * USB: ftdi_sio - MachX product ID added + * USB: removing ifdefed code from gl620a + * usb serial: Eliminate bogus ioctl code + * USB: mutexification of usblp + * Add Baltech Reader ID to CP2101 driver + * USB: Prevent the funsoft serial device from entering raw mode + * USB: fix ohci.h over-use warnings + * USB: rtl8150 new device id + * usb-storage: Ignore the virtual cd-drive of the Huawei E220 USB Modem + * usb-gsm-driver: Added VendorId and ProductId for Huawei E220 USB Modem + * USB: fix Wacom Intuos3 4x6 bugs + * USB AUERSWALD: replace kmalloc+memset with kzalloc + * USB: Nokia E70 is an unusual device + * UHCI: module parameter to ignore overcurrent changes + * USB: gadget driver unbind() is optional; section fixes; misc + * USB: MAINTAINERS update, EHCI and OHCI + * USB: ohci whitespace/comment fixups + * USB: ohci at91 warning fix + * USB: ohci handles hardware faults during root port resets + * USB: OHCI support for PNX8550 + * USB: at91 udc, support at91sam926x addresses + * USB: at91_udc, misc fixes + * USB: u132-hcd/ftdi-elan: add support for Option GT 3G Quad card + * USB: at91_udc: allow drivers that support high speed + * USB: at91_udc: Cleanup variables after failure in + usb_gadget_register_driver() + * USB: at91_udc: Additional checks + * USB: fix to usbfs_snoop logging of user defined control urbs + * PCI: use /sys/bus/pci/drivers//new_id first + * pci: add class codes for Wireless RF controllers + * PCI quirks: remove redundant check + * rpaphp: compiler warning cleanup + * PCI: pcieport-driver: remove invalid warning message + * pci: Introduce pci_find_present + * PCI: Create __pci_bus_find_cap_start() from __pci_bus_find_cap() + * PCI: Add pci_find_ht_capability() for finding Hypertransport + capabilities + * PCI: Use pci_find_ht_capability() in drivers/pci/htirq.c + * PCI: Add #defines for Hypertransport MSI fields + * PCI: Use pci_find_ht_capability() in drivers/pci/quirks.c + * PCI: Only check the HT capability bits in mpic.c + * PCI: Fix multiple problems with VIA hardware + * PCI: Be a bit defensive in quirk_nvidia_ck804() so we don't risk + dereferencing a NULL pdev. + * PCI: don't export device IDs to userspace + * PCI legacy resource fix + * PCI: ATI sb600 sata quirk + * shpchp: remove unnecessary struct php_ctlr + * shpchp: cleanup struct controller + * shpchp: remove shpchprm_get_physical_slot_number + * shpchp: cleanup shpchp.h + * acpiphp: Link-time error for PCI Hotplug + * kref refcnt and false positives + * kobject: kobject_uevent() returns manageable value + * Driver core: proper prototype for drivers/base/init.c:driver_init() + * [libata] Move some PCI IDs from sata_nv to ahci + * libata: clean up variable name usage in xlat related functions + * libata: kill @cdb argument from xlat methods + * libata: take scmd->cmd_len into account when translating SCSI commands + * USB: Nokia E70 is an unusual device + * usb serial: add support for Novatel S720/U720 CDMA/EV-DO modems + * bluetooth: add support for another Kensington dongle + * [libata] sata_svw, sata_vsc: kill iomem warnings + * USB Storage: remove duplicate Nokia entry in unusual_devs.h + * ACPI: replace kmalloc+memset with kzalloc + * __set_irq_handler bogus space + * x86_64: fix boot hang caused by CALGARY_IOMMU_ENABLED_BY_DEFAULT + * x86_64: fix boot time hang in detect_calgary() + * sched: improve efficiency of sched_fork() + * fix leaks on pipe(2) failure exits + * workqueue: fix schedule_on_each_cpu() + * Clean up and make try_to_free_buffers() not race with dirty pages + * VM: Remove "clear_page_dirty()" and "test_clear_page_dirty()" functions + * Fix JFS after clear_page_dirty() removal + * fuse: remove clear_page_dirty() call + * Fix XFS after clear_page_dirty() removal + * elevator: fixup typo in merge logic + * truncate: dirty memory accounting fix + * KVM: add valid_vcpu() helper + * KVM: AMD SVM: handle MSR_STAR in 32-bit mode + * KVM: AMD SVM: Save and restore the floating point unit state + * KVM: Use more traditional error handling in kvm_mmu_init() + * KVM: Do not export unsupported msrs to userspace + * KVM: Force real-mode cs limit to 64K + * KVM: Handle p5 mce msrs + * KVM: API versioning + * CONFIG_VM_EVENT_COUNTER comment decrustify + * Conditionally check expected_preempt_count in __resched_legal() + * Fix for shmem_truncate_range() BUG_ON() + * rtc warning fix + * slab: fix kmem_ptr_validate definition + * fix kernel-doc warnings in 2.6.20-rc1 + * make kernel/printk.c:ignore_loglevel_setup() static + * fs/sysv/: proper prototypes for 2 functions + * Fix swapped parameters in mm/vmscan.c + * Add cscope generated files to .gitignore + * sched: remove __cpuinitdata anotation to cpu_isolated_map + * fix vm_events_fold_cpu() build breakage + * genirq: fix irq flow handler uninstall + * smc911x: fix netpoll compilation faliure + * smc911 workqueue fixes + * fsstack: Remove inode copy + * lock debugging: fix DEBUG_LOCKS_WARN_ON() & debug_locks_silent + * Make JFFS depend on CONFIG_BROKEN + * Add a new section to CodingStyle, promoting include/linux/kernel.h + * fix aoe without scatter-gather [Bug 7662] + * mm: more rmap debugging + * handle SLOB with sparsemen + * compile error of register_memory() + * audit: fix kstrdup() error check + * gss_spkm3: fix error handling in module init + * schedule_timeout(): improve warning message + * microcode: fix mc_cpu_notifier section warning + * MAINTAINERS: fix email for S3C2410 and S3C2440 + * tlclk: delete unnecessary sysfs_remove_group + * gxt4500: Fix colormap and PLL setting, support GXT6000P + * fdtable: Provide free_fdtable() wrapper + * kernel-doc: allow unnamed structs/unions + * kernel-doc: remove Martin from MAINTAINERS + * mips: if_fddi.h: Add a missing inclusion + * memory hotplug: fix compile error for i386 with NUMA config + * ptrace: Fix EFL_OFFSET value according to i386 pda changes + * relay: remove inlining + * increase CARDBUS_MEM_SIZE + * md: fix a few problems with the interface (sysfs and ioctl) to md + * fix s3c24xx gpio driver (include linux/workqueue.h) + * jbd: wait for already submitted t_sync_datalist buffer to complete + * sched: fix bad missed wakeups in the i386, x86_64, ia64, ACPI and APM + idle code + * build compile.h earlier + * Fix reparenting to the same thread group. (take 2) + * serial/uartlite: Only enable port if request_port succeeded + * Fix up page_mkclean_one(): virtual caches, s390 + * NetLabel: perform input validation earlier on CIPSOv4 DOI add ops + * NetLabel: correctly fill in unused CIPSOv4 level and category mappings + * [ATM]: Remove dead ATM_TNETA1570 option. + * [ATM] drivers/atm/fore200e.c: Cleanups. + * [TCP]: Fix ambiguity in the `before' relation. + * [SCTP]: Don't export include/linux/sctp.h to userspace. + * [SCTP]: Fix typo adaption -> adaptation as per the latest API draft. + * [SCTP]: make 2 functions static + * [IPV6]: Dumb typo in generic csum_ipv6_magic() + * [UDP]: Fix reversed logic in udp_get_port(). + * cfq-iosched: tighten allow merge criteria + * Call init_timer() for ISDN PPP CCP reset state timer + * Clean up and export cancel_dirty_page() to modules + * Fix reiserfs after "test_clear_page_dirty()" removal + * suspend: fix suspend on single-CPU systems + * arch/i386/pci/mmconfig.c tlb flush fix + * Fix up CIFS for "test_clear_page_dirty()" removal + * Linux 2.6.20-rc2 + + -- Ben Collins Sat, 16 Dec 2006 01:56:51 -0500 + +linux-source-2.6.20 (2.6.20-2.2) feisty; urgency=low + + [Ben Collins] + + * debian/config: Enable pata_marvell. + - GIT-SHA 8140eb247a50883afe037f57d4afd143cee902a6 + * ivtv: Add new mpeg encoder driver. + - GIT-SHA fc0ee3058f7ae7096235648aa1dbdf114fa3fc58 + * ubuntu/media: Add ivtv to build. + - GIT-SHA 4850a6d86424b28f967e2eab425152ba4f4147e8 + * ubuntu/ivtv: Build fixes for 2.6.20 (INIT_WORK). + - GIT-SHA fa28b2f82bba8c1bb014ab7de500d48b77404abf + * debian/d-i/package-list: Add nic-firmware + - GIT-SHA 42e1278480fe3c33e5c14fb056c34718fac5e713 + - Bug #73896 + * debian/d-i: Split out nfs modules into nfs-modules. + - GIT-SHA 941250b257eb8bbe7ad811fa56c6ec4973ec6545 + - Bug #73910 + * debian/d-i: Add cdrom modules + - GIT-SHA c2670818134e76c571cbc17aa26551d0064305e0 + - Bug #73911 + * include/asm-*/setup.h: Set command line size to 1024 + - GIT-SHA 3812de95f1b4d800081e7f06c5b9bc9c3873003c + - Bug #23716 + * debian/d-i: Add block and message udeb's. + - GIT-SHA 6e997e89249bfd8bbc20bf1f0349fb0bccde2d95 + * ide/piix: ifdef out some pci id's when ata_piix is enabled. + - GIT-SHA d28a0a771e1c30c5b89999e5c51e33471a6f6ed2 + + [Upstream Kernel Changes] + + * [CPUFREQ] Documentation fix + * [CPUFREQ][1/8] acpi-cpufreq: software coordination and handle all CPUs + in the group + * [CPUFREQ][2/8] acpi: reorganize code to make MSR support addition + easier + * [CPUFREQ][3/8] acpi-cpufreq: Pull in MSR based transition support + * [CPUFREQ][4/8] acpi-cpufreq: Mark speedstep-centrino ACPI as deprecated + * [CPUFREQ][5/8] acpi-cpufreq: lindent acpi-cpufreq.c + * [CPUFREQ][6/8] acpi-cpufreq: Eliminate get of current freq on + notification + * [CPUFREQ][7/8] acpi-cpufreq: Fix get of current frequency breakage + * [CPUFREQ][8/8] acpi-cpufreq: Add support for freq feedback from + hardware + * [CPUFREQ] sc520_freq.c: ioremap balanced with iounmap + * [CPUFREQ] Fix speedstep-smi CPU detection to not run on Pentium 4. + * [CPUFREQ] Remove duplicate include from acpi-cpufreq + * [CPUFREQ] acpi-cpufreq: Fix up some CodingStyle nits leftover from the + lindenting. + * [CPUFREQ] handle sysfs errors + * [CPUFREQ] speedstep-centrino: remove dead code + * [CPUFREQ] ifdef more unused on !SMP code. + * [AGPGART] Fix up misprogrammed bridges with incorrect AGPv2 rates. + * [CPUFREQ] Fix coding style issues in cpufreq. + * [CPUFREQ] p4-clockmod: add more CPUs + * [CPUFREQ] speedstep-centrino should ignore upper performance control + bits + * [CPUFREQ] Fix build failure on x86-64 + * JFS: Fix conflicting superblock flags + * [WATCHDOG] rm9k_wdt: fix compilation + * [WATCHDOG] rm9k_wdt: fix interrupt handler arguments + * [WATCHDOG] watchdog miscdevice patch + * ocfs2: local mounts + * ocfs2: update mount option documentation + * ocfs2: Synchronize feature incompat flags in ocfs2_fs.h + * [patch 1/3] OCFS2 - Expose struct o2nm_cluster + * [patch 2/3] OCFS2 Configurable timeouts + * [ARM] 4010/1: AT91SAM9260-EK board: Prepare for MACB Ethernet support + * [ARM] 4011/1: AT91SAM9260: Fix compilation with NAND driver + * [ARM] Handle HWCAP_VFP in VFP support code + * [ARM] Formalise the ARMv6 processor name string + * [ARM] 4004/1: S3C24XX: UDC remove implict addition of VA to regs + * [ARM] Add sys_*at syscalls + * i2c: Fix documentation typos + * i2c: Update the list of driver IDs + * i2c: Delete the broken i2c-ite bus driver + * i2c: New Philips PNX bus driver + * i2c: Add request/release_mem_region to i2c-ibm_iic bus driver + * i2c: Cleanups to the i2c-nforce2 bus driver + * i2c: Add support for nested i2c bus locking + * i2c: New Atmel AT91 bus driver + * i2c: Use put_user instead of copy_to_user where possible + * i2c: Whitespace cleanups + * i2c: Use the __ATTR macro where possible + * i2c: i2c-i801 documentation update + * i2c: fix broken ds1337 initialization + * i2c: New ARM Versatile/Realview bus driver + * i2c: Discard the i2c algo del_bus wrappers + * i2c: Enable PEC on more i2c-i801 devices + * i2c: Fix return value check in i2c-dev + * i2c: Refactor a kfree in i2c-dev + * i2c: Fix OMAP clock prescaler to match the comment + * [patch 3/3] OCFS2 Configurable timeouts - Protocol changes + * [ARM] Clean up KERNEL_RAM_ADDR + * sh: Reworked swap cache entry encoding for SH-X2 MMU. + * sh: Shut up csum_ipv6_magic() warnings. + * sh: push-switch fixups for work_struct API damage. + * sh: Add uImage and S-rec generation support. + * sh: SH-2 defconfig updates. + * sh: register rtc resources for sh775x. + * rtc: rtc-sh: fix for period rtc interrupts. + * sh: landisk board build fixes. + * sh: gcc4 symbol export fixups. + * sh: IPR IRQ updates for SH7619/SH7206. + * sh: Trivial build fixes for SH-2 support. + * sh: Fix Solution Engine 7619 build. + * sh: Split out atomic ops logically. + * serial: sh-sci: Shut up various sci_rxd_in() gcc4 warnings. + * sh: Kill off unused SE7619 I/O ops. + * rtc: rtc-sh: fix rtc for out-by-one for the month. + * rtc: rtc-sh: alarm support. + * sh: BUG() handling through trapa vector. + * sh: Fix get_wchan(). + * sh: Fixup kernel_execve() for syscall cleanups. + * sh: Convert remaining remap_area_pages() users to ioremap_page_range(). + * sh: Fixup dma_cache_sync() callers. + * sh: SH-MobileR SH7722 CPU support. + * sh: Fixup sh_bios() trap handling. + * sh: Hook up SH7722 scif ipr interrupts. + * sh: Fixup .data.page_aligned. + * sh: Fix .empty_zero_page alignment for PAGE_SIZE > 4096. + * sh: Use early_param() for earlyprintk parsing. + * sh: Fixup SH-2 BUG() trap handling. + * remove blk_queue_activity_fn + * fix SG_IO bio leak + * remove unnecessary blk_queue_bounce in SG_IO + * V4L/DVB (4954): Fix: On ia64, i2c adap->inb/adap->outb are wrongly + evaluated + * lockdep: fix seqlock_init() + * net, 8139too.c: fix netpoll deadlock + * netpoll: fix netpoll lockup + * hwmon/f71805f: Store the fan control registers + * hwmon/f71805f: Add manual fan speed control + * hwmon/f71805f: Let the user adjust the PWM base frequency + * hwmon/f71805f: Support DC fan speed control mode + * hwmon/f71805f: Add support for "speed mode" fan speed control + * hwmon/f71805f: Document the fan control features + * hwmon/pc87360: Autodetect the VRM version + * hwmon/hdaps: Move the DMI detection data to .data + * hwmon/hdaps: Update the list of supported devices + * hwmon/it87: Remove the SMBus interface support + * hwmon: New PC87427 hardware monitoring driver + * hwmon/f71805f: Add support for the Fintek F71872F/FG chip + * hwmon/f71805f: Always create all fan inputs + * hwmon/f71805f: Fix the device address decoding + * hwmon: Update Rudolf Marek's e-mail address + * hwmon: New Winbond W83793 hardware monitoring driver + * hwmon/w83793: Add documentation and maintainer + * hwmon: New AMS hardware monitoring driver + * hwmon: Add MAINTAINERS entry for new ams driver + * EXT{2,3,4}_FS: remove outdated part of the help text + * [IA64] Do not call SN_SAL_SET_CPU_NUMBER twice on cpu 0 + * Use consistent casing in help message + * [IA64] CONFIG_KEXEC/CONFIG_CRASH_DUMP permutations + * [IA64] Kexec/Kdump: honour non-zero crashkernel offset. + * [IA64] kexec/kdump: tidy up declaration of relocate_new_kernel_t + * Fix small typo in drivers/serial/icom.c + * Remove duplicate "have to" in comment + * Kconfig: fix spelling error in config KALLSYMS help text + * include/linux/compiler.h: reject gcc 3 < gcc 3.2 + * remove config ordering/dependency between ucb1400-ts and sound + subsystem + * [IA64] s/termios/ktermios/ in simserial.c + * fix typo in net/ipv4/ip_fragment.c + * um: replace kmalloc+memset with kzalloc + * e100: replace kmalloc with kcalloc + * kconfig: Standardize "depends" -> "depends on" in Kconfig files + * configfs.h: Remove dead macro definitions. + * fs: Convert kmalloc() + memset() to kzalloc() in fs/. + * Jon needs a new shift key. + * Fix typo in new debug options. + * Fix inotify maintainers entry + * [IA64] fix arch/ia64/mm/contig.c:235: warning: unused variable `nid' + * [IA64] - Reduce overhead of FP exception logging messages + * [IA64] fix possible XPC deadlock when disconnecting + * IB/fmr: ib_flush_fmr_pool() may wait too long + * IB/ipath: Remove unused "write-only" variables + * IB/iser: Remove unused "write-only" variables + * RDMA/amso1100: Fix memory leak in c2_qp_modify() + * IB/ipath: Fix IRQ for PCI Express HCAs + * RDMA/cma: Remove unneeded qp_type parameter from rdma_cm + * RDMA/cma: Report connect info with connect events + * RDMA/cma: Allow early transition to RTS to handle lost CM messages + * RDMA/cma: Add support for RDMA_PS_UDP + * RDMA/cma: Export rdma cm interface to userspace + * [IA64] Take defensive stance on ia64_pal_get_brand_info() + * [IA64] enable trap code on slot 1 + * [IA64] kprobe clears qp bits for special instructions + * [CPUFREQ] Optimize gx-suspmod revision ID fetching + * [CPUFREQ] speedstep-centrino should ignore upper performance control + bits + * [CPUFREQ] Fix the bug in duplicate freq elimination code in + acpi-cpufreq + * [CPUFREQ] Fix git URL. + * IB: Add DMA mapping functions to allow device drivers to interpose + * IB/ipath: Implement new verbs DMA mapping functions + * IB/core: Use the new verbs DMA mapping functions + * [CPUFREQ] p4-clockmod: fix support for Core + * IPoIB: Use the new verbs DMA mapping functions + * IB/srp: Use new verbs IB DMA mapping functions + * IB/iser: Use the new verbs DMA mapping functions + * [CPUFREQ] Longhaul - fix 200MHz FSB + * [CPUFREQ] Longhaul - Add support for CN400 + * [WATCHDOG] pcwd_usb.c generic HID include file + * IPoIB: Make sure struct ipoib_neigh.queue is always initialized + * [AGPGART] agp-amd64: section mismatches with HOTPLUG=n + * [AGPGART] VIA and SiS AGP chipsets are x86-only + * Propagate down request sync flag + * [PATCH 1/2] cciss: map out more memory for config table + * [PATCH 2/2] cciss: remove calls to pci_disable_device + * Allow as-iosched to be unloaded + * [ARM] Unuse another Linux PTE bit + * [ARM] Clean up ioremap code + * [ARM] 4012/1: Clocksource for pxa + * [ARM] 4013/1: clocksource driver for netx + * [ARM] 4014/1: include drivers/hid/Kconfig + * Fixup cciss error handling + * [ARM] Remove empty fixup function + * arch/i386/kernel/smpboot.c: remove unneeded ifdef + * tty: export get_current_tty + * KVM: Add missing include + * KVM: Put KVM in a new Virtualization menu + * KVM: Clean up AMD SVM debug registers load and unload + * KVM: Replace __x86_64__ with CONFIG_X86_64 + * fix more workqueue build breakage (tps65010) + * another build fix, header rearrangements (OSK) + * uml: fix net_kern workqueue abuse + * isdn/gigaset: fix possible missing wakeup + * i2o_exec_exit and i2o_driver_exit should not be __exit. + * Fix section mismatch in parainstructions + * KVM: Make the GET_SREGS and SET_SREGS ioctls symmetric + * KVM: Move find_vmx_entry() to vmx.c + * KVM: Remove extranous put_cpu() from vcpu_put() + * KVM: MMU: Ignore pcd, pwt, and pat bits on ptes + * KVM: Add MAINTAINERS entry + * vt: fix comments to not refer to kill_proc + * kconfig: new function "bool conf_get_changed(void)" + * kconfig: make sym_change_count static, let it be altered by 2 functions + only + * kconfig: add "void conf_set_changed_callback(void (*fn)(void))", use it + in qconf.cc + * kconfig: set gconf's save-widget's sensitivity according to .config's + changed state + * reorder struct pipe_buf_operations + * slab: fix sleeping in atomic bug + * Fix crossbuilding checkstack + * md: Don't assume that READ==0 and WRITE==1 - use the names explicitly + * KVM: Disallow the kvm-amd module on intel hardware, and vice versa + * KVM: Don't touch the virtual apic vt registers on 32-bit + * KVM: Fix vmx hardware_enable() on macbooks + * w1: Fix for kconfig entry typo + * isicom: fix build with PCI disabled + * mxser_new: fix non-PCI build + * sx: fix non-PCI build + * cciss: map out more memory for config table + * cciss: remove calls to pci_disable_device + * Cleanup slab headers / API to allow easy addition of new slab + allocators + * More slab.h cleanups + * cpuset: rework cpuset_zone_allowed api + * SLAB: use a multiply instead of a divide in obj_to_index() + * PM: Fix freezing of stopped tasks + * PM: Fix SMP races in the freezer + * Xtensa: Add ktermios and minor filename fix + * touch_atime() cleanup + * relative atime + * ocfs2: relative atime support + * optimize o_direct on block devices + * debug: add sysrq_always_enabled boot option + * lockdep: filter off by default + * lockdep: improve verbose messages + * lockdep: improve lockdep_reset() + * lockdep: clean up VERY_VERBOSE define + * lockdep: use chain hash on CONFIG_DEBUG_LOCKDEP too + * lockdep: print irq-trace info on asserts + * lockdep: fix possible races while disabling lock-debugging + * Use activate_mm() in fs/aio.c:use_mm() + * Fix numerous kcalloc() calls, convert to kzalloc() + * tty: remove useless memory barrier + * CONFIG_COMPUTONE should depend on ISA|EISA|PCI + * appldata_mem dependes on vm counters + * uml problems with linux/io.h + * missing includes in hilkbd + * hci endianness annotations + * lockd endianness annotations + * rtc: fx error case + * RTC driver init adjustment + * rtc: remove syslog spam on registration + * rtc framewok: rtc_wkalrm.enabled reporting updates + * tty_io.c balance tty_ldisc_ref() + * n_r3964: Use struct pid to track user space clients + * smbfs: Make conn_pid a struct pid + * ncpfs: Use struct pid to track the userspace watchdog process + * ncpfs: ensure we free wdog_pid on parse_option or fill_inode failure + * update Tigran's email addresses + * one more EXPORT_UNUSED_SYMBOL removal + * remove the broken BLK_DEV_SWIM_IOP driver + * knfsd: nfsd4: remove a dprink from nfsd4_lock + * knfsd: svcrpc: fix gss krb5i memory leak + * knfsd: nfsd4: clarify units of COMPOUND_SLACK_SPACE + * knfsd: nfsd: make exp_rootfh handle exp_parent errors + * knfsd: nfsd: simplify exp_pseudoroot + * knfsd: nfsd4: handling more nfsd_cross_mnt errors in nfsd4 readdir + * knfsd: nfsd: don't drop silently on upcall deferral + * knfsd: svcrpc: remove another silent drop from deferral code + * knfsd: nfsd4: pass saved and current fh together into nfsd4 operations + * knfsd: nfsd4: remove spurious replay_owner check + * knfsd: nfsd4: move replay_owner to cstate + * knfsd: nfsd4: don't inline nfsd4 compound op functions + * knfsd: nfsd4: make verify and nverify wrappers + * knfsd: nfsd4: reorganize compound ops + * knfsd: nfsd4: simplify migration op check + * knfsd: nfsd4: simplify filehandle check + * knfsd: Don't ignore kstrdup failure in rpc caches + * knfsd: Fix up some bit-rot in exp_export + * Optimize calc_load() + * ide: HPT3xxN clocking fixes + * ide: fix HPT37x timing tables + * ide: optimize HPT37x timing tables + * ide: fix HPT3xx hotswap support + * ide: fix the case of multiple HPT3xx chips present + * ide: HPT3xx: fix PCI clock detection + * HPT37x: read f_CNT saved by BIOS from port + * fbdev: remove references to non-existent fbmon_valid_timings() + * sstfb: add sysfs interface + * getting rid of all casts of k[cmz]alloc() calls + * Add support for Korenix 16C950-based PCI cards + * Fix COW D-cache aliasing on fork + * Pass vma argument to copy_user_highpage(). + * MIPS: Fix COW D-cache aliasing on fork + * Optimize D-cache alias handling on fork + * Add missing KORENIX PCI ID's + * [ARM] 4016/1: prefetch macro is wrong wrt gcc's + "delete-null-pointer-checks" + * [ARM] Provide a method to alter the control register + * [ARM] 3992/1: i.MX/MX1 CPU Frequency scaling support + * [IA64] Move sg_dma_{len,address} from pci.h to scatterlist.h + * [ARM] 4017/1: [Jornada7xx] - Updating Jornada720.c + * Driver core: show "initstate" of module + * driver core: delete virtual directory on class_unregister() + * DebugFS : inotify create/mkdir support + * DebugFS : coding style fixes + * DebugFS : file/directory creation error handling + * DebugFS : more file/directory creation error handling + * DebugFS : file/directory removal fix + * Driver core: "platform_driver_probe() can save codespace": save + codespace + * Driver core: Make platform_device_add_data accept a const pointer + * Driver core: deprecate PM_LEGACY, default it to N + * [NETFILTER]: Fix INET=n linking error + * [NETFILTER]: nf_nat: fix NF_NAT dependency + * [NETFILTER]: x_tables: error if ip_conntrack is asked to handle IPv6 + packets + * [NETFILTER]: x_tables: add missing try to load conntrack from + match/targets + * [NETFILTER]: ip_tables: ipt and ipt_compat checks unification + * [NETFILTER]: {ip,ip6,arp}_tables: fix exponential worst-case search for + loops + * [DCCP] ccid3: return value in ccid3_hc_rx_calc_first_li + * [IPV6]: Fix IPV6_UNICAST_HOPS getsockopt(). + * [TCP]: Fix oops caused by __tcp_put_md5sig_pool() + * [SCTP]: Handle address add/delete events in a more efficient way. + * [SCTP]: Enable auto loading of SCTP when creating an ipv6 SCTP socket. + * [SCTP]: Add support for SCTP_CONTEXT socket option. + * [IPV6]: Make fib6_node subtree depend on IPV6_SUBTREES + * Linux v2.6.20-rc1 + * ib_verbs: Use explicit if-else statements to avoid errors with do-while + macros + * [S390] update default configuration + * [S390] hypfs fixes + * [S390] Hipersocket multicast queue: make sure outbound handler is + called + * [S390] zcrypt: module unload fixes. + * [S390] sclp_cpi module license. + * [S390] Fix reboot hang on LPARs + * [S390] Fix reboot hang + * [S390] Save prefix register for dump on panic + * [S390] cio: css_register_subchannel race. + * Remove stack unwinder for now + + -- Ben Collins Wed, 13 Dec 2006 11:29:31 -0500 + +linux-source-2.6.20 (2.6.20-1.1) feisty; urgency=low + + [Ben Collins] + + * debian/: Fix lowlatency config rewrite so PREEMPT gets enabled. + - GIT-SHA 510032237707def6475ec51a206644ebf90da9c9 + * debian/: Add initramfs hook for copying firmware needed in initrd. + - GIT-SHA 2f049facd27d03ca42d0a00bcba3567ea6c43c1c + * x86: Revert patch that allows disabling hyper-threading. + - GIT-SHA a5443e2694749510381b4c54b95f5a3ee2656dcf + * debian/: Revert kernelfirmware changes in favour of initramfs-tools + solution. + - GIT-SHA b4ce570a6dff8b1acfb130e0840ef7bc1ca3194f + * forcedeth: Revert phy patch. + - GIT-SHA 3cd0410cba86a7e97535f5d7dda18a71ec91b772 + * rt2x00: Added drivers from Edgy with build fixes. + - GIT-SHA 3e684dade463576854892501ab33b3f4e6557b6a + * arch/sparc64/prom: Remove local change. + - GIT-SHA e9f507d104bbe9a1bf58671408682c095615c93d + * ndsiwrapper: Added driver + - GIT-SHA d11fd0dd38f5e903108e6205e38dfcf84ea149c6 + * ubuntu/: Compile fixes for header changes in 2.6.20 + - GIT-SHA 9fe44155276658fad4afab56bd80229bb9b903dc + * ubuntu/wireless/rt2x00: Add eeprom module to Makefile. + - GIT-SHA b6406283cc8b87b4f118e532d31f627b4071a086 + * kernel/workqueue: Export current_is_kevent() for libphy. + - GIT-SHA 6f786ce77e68085661a02ee99cfb4b7ca290fb17 + * debian/config: Enable all keyspan fw extensions. + - GIT-SHA 97079628a3cc9921eb5d7149580d2971860980eb + * ubuntu/: Add includes to make up for header changes on x86_64. + - GIT-SHA 1315457d772e24484c9fb5cfae2cf5dcbed6588d + * Remove UP-APIC off-by-default patch. + - GIT-SHA 57daa7b7720d9581f9a2261ef57d70c4160617b9 + * ubuntu/: INIT_WORK changes for ubuntu supplied drivers. + - GIT-SHA 5e330f1f67613ff6d092261c03ba3816a4e9c76d + * debian/config/: Disable legacy rt2x00 drivers, and enable newer ones. + - GIT-SHA 5f3f7f497bf055ee9e8796e08cc14f55e78b7b84 + * ubuntu/ndiswrapper: Allow enabling of OWN_WQ. + - GIT-SHA aef1808d7ce20b989c5da8e8fa983d23d8831447 + * ubuntu/misc/Kconfig: Add NIDSWRAPPER_WQ option. + - GIT-SHA 683ceae36cc76dccf60d0b42b6f7e6dc664338b9 + * ubuntu/fs/asfs: Fix compiler failure with new upstream code. + - GIT-SHA e651660640a32c6701a43ba6ea6b0b88ad3f2f70 + * ubuntu/: kmem_cache and SLAB_{ATOMIC,KERNEL} fixes. + - GIT-SHA 420832806cb9387909466f70739ca6a29281fac2 + * ubuntu/rtl_ieee80211/: Add some compatibility crypto calls. + - GIT-SHA 84d69c35b71f8daff106ff50471ee447adaaf6a9 + * ubuntu/: Fixes for freezer stuff moving to linux/freezer.h + - GIT-SHA f2fc18057022e3b792cddc8326e6116a08bd392b + * libata: Fix legacy mode for things like piix. + - GIT-SHA b604c4235e72743435b81fe20bfd78343edd159f + * ia64: Move sg_dma_* functions from pci.h to scatterlist.h + - GIT-SHA 71f54a36da8d5d098cdd13f86dabe8621834ba45 + * bacom_app: Fix typo introduced in + 15b1c0e822f578306332d4f4c449250db5c5dceb + - GIT-SHA 06c07cb91d6185f691bbd034670308c61bf70dcf + * dmasound: Fix INIT_WORK usage. + - GIT-SHA 9ba10c5168a94a51844b368af0fdcea22aa2ffe2 + * (promise) support PATA ports on SATA controllers + - GIT-SHA 1bcbb7e20a7eab8427ac9b227b3db887d873cbac + * Patch to correct INIT_WORK conversion. + - GIT-SHA d3e411fc1bf19f179b76b1e6e4e13127252e4c64 + * rt2500-legacy: Fixes for INIT_WORK changes. + - GIT-SHA 28b1115c58bda8f1eddffdf855d9034b0c33a7d7 + + [Kyle McMartin] + + * ipw3945: Update to v1.1.3 + - GIT-SHA d5969a44fb688e2a619b3320a571c584a1d6452f + * ubuntu/wireless/: Finish cleaning up INIT_WORK + - GIT-SHA 0f91ed3ff67c95751252172bb48b5fd96980c71f + + -- Ben Collins Tue, 28 Nov 2006 22:53:51 -0500 + +linux-source-2.6.19 (2.6.19-7.10) feisty; urgency=low + + [Ben Collins] + + * amd76x_edac: Disable because of conflict with amd_k7_agp. + - GIT-SHA 6027f7346f0f996c8efca626dec3b327bd7dca9e + - Bug #71522 + * debian/config: Disable aic7xxx_old (scary stuff) + - GIT-SHA a5a7e7b6bd8bb31c9c871aae441d1efd85ef815b + * debian/config: Enable qla2xxx FC driver. + - GIT-SHA afdcea31e92bf7d0de2938848ac21e87fe3ce584 + * debian/firmware: Add qla2xxx firmware. + - GIT-SHA c980a1cfa2bc6623c9732ebae9d63aae9f0d7e27 + * Add a lowlatency kernel target. + - GIT-SHA 1b7aff0509741650a83c7afddc5406ac5278a2c2 + * ubuntu/mactel: Add applesmc driver. + - GIT-SHA c983d32ab69771aadbf7d8f8451f3c28eda8223f + * ubuntu/mactel: Add apple IR driver. + - GIT-SHA 26bb7f92982a1e94c3743e8ebddda8c878979d35 + * debian/bin: Tuck my build scripts in here for public consumption. + - GIT-SHA a77f2b3d8fa59395d3be8e966411e4490a6f8779 + * git-ubuntu-log: Use Text::Wrap to format comments into changelog. + - GIT-SHA 997bab71d64926c335703bbaf5dc4d36bce3b335 + + [Fabio M. Di Nitto] + + * ubuntu/fs/gfs update to 24/11/2006 CVS snapshot + - GIT-SHA c8f1688a4d613c62d6e019aa66b2fd4817209e51 + + [Upstream Kernel Changes] + + * x86-64: Fix C3 timer test + * x86-64: increase PHB1 split transaction timeout + * [ARM] 3933/1: Source drivers/ata/Kconfig + * [ARM] ebsa110: fix warnings generated by asm/arch/io.h + * IB/ipath: Depend on CONFIG_NET + * [XFS] Fix uninitialized br_state and br_startoff in + * [XFS] Stale the correct inode when freeing clusters. + * x86_64: Align data segment to PAGE_SIZE boundary + * Fix CPU_FREQ_GOV_ONDEMAND=y compile error + * [IPV6] ROUTE: Try to use router which is not known unreachable. + * [IPV6] ROUTE: Prefer reachable nexthop only if the caller requests. + * [IPV6] ROUTE: Do not enable router reachability probing in router mode. + * [IPV6] IP6TUNNEL: Delete all tunnel device when unloading module. + * [IPV6] IP6TUNNEL: Add missing nf_reset() on input path. + * [Bluetooth] Attach low-level connections to the Bluetooth bus + * [Bluetooth] Handling pending connect attempts after inquiry + * [Bluetooth] Check if RFCOMM session is still attached to the TTY + * [Bluetooth] Always include MTU in L2CAP config responses + * [Bluetooth] Ignore L2CAP config requests on disconnect + * [IGMP]: Fix IGMPV3_EXP() normalization bit shift value. + * [XFRM]: Sub-policies broke policy events + * [XFRM]: nlmsg length not computed correctly in the presence of + subpolicies + * [BLUETOOTH]: Fix unaligned access in hci_send_to_sock. + * [POWERPC] Revert "[POWERPC] Enable generic rtc hook for the MPC8349 + mITX" + * [POWERPC] Revert "[POWERPC] Add powerpc get/set_rtc_time interface to + new generic rtc class" + * [IRDA]: Lockdep fix. + * [IPV6]: Fix address/interface handling in UDP and DCCP, according to + the scoping architecture. + * [TG3]: Add missing unlock in tg3_open() error path. + * [POWERPC] Fix ucc_geth of_device discovery on mpc832x + * Don't call "note_interrupt()" with irq descriptor lock held + * [AGP] Fix intel 965 AGP memory mapping function + * [ARM] 3942/1: ARM: comment: consistent_sync should not be called + directly + * [ARM] 3941/1: [Jornada7xx] - Addition to MAINTAINERS + * [AGP] Allocate AGP pages with GFP_DMA32 by default + * [MIPS] Hack for SB1 cache issues + * make au1xxx-ide compile again + * Correct bound checking from the value returned from _PPC method. + * Fix i2c-ixp4xx compile (missing brace) + * x86_64: fix bad page state in process 'swapper' + * fix "pcmcia: fix 'rmmod pcmcia' with unbound devices" + * initramfs: handle more than one source dir or file list + * fuse: fix Oops in lookup + * mounstats NULL pointer dereference + * debugfs: add header file + * Documentation/rtc.txt updates (for rtc class) + * rtc framework handles periodic irqs + * rtc class locking bugfixes + * drivers/rtc/rtc-rs5c372.c: fix a NULL dereference + * reiserfs: fmt bugfix + * Fix device_attribute memory leak in device_del + * qconf: fix uninitialsied member + * fix menuconfig colours with TERM=vt100 + * sgiioc4: Disable module unload + * fix copy_process() error check + * tlclk: fix platform_device_register_simple() error check + * Enforce "unsigned long flags;" when spinlocking + * lockdep: spin_lock_irqsave_nested() + * usb: ati remote memleak fix + * uml: make execvp safe for our usage + * [NETFILTER]: H.323 conntrack: fix crash with CONFIG_IP_NF_CT_ACCT + * [UDP]: Make udp_encap_rcv use pskb_may_pull + * [NET]: Fix kfifo_alloc() error check. + * [6PACK]: Masking bug in 6pack driver. + * [NET]: Re-fix of doc-comment in sock.h + * [XFRM] STATE: Fix to respond error to get operation if no matching + entry exists. + * V4L/DVB (4831): Fix tuning on older budget DVBS cards. + * V4L/DVB (4840): Budget: diseqc_method module parameter for cards with + subsystem-id 13c2:1003 + * V4L/DVB (4832): Fix uninitialised variable in dvb_frontend_swzigzag + * V4L/DVB (4849): Add missing spin_unlock to saa6588 decoder driver + * V4L/DVB (4865): Fix: Slot 0 not NULL on disconnecting SN9C10x PC Camera + * V4L/DVB (4885): Improve saa711x check + * Fix incorrent type of flags in + * Fix 'ALIGN()' macro, take 2 + + -- Ben Collins Tue, 21 Nov 2006 08:55:49 -0500 + +linux-source-2.6.19 (2.6.19-6.9) feisty; urgency=low + + [Ben Collins] + + * debian/post-install: Requires built scripts directory. + - GIT-SHA 6f4e4b8f3cf138b57825ed12a0b05ed5bf727216 + + -- Ben Collins Mon, 20 Nov 2006 19:44:27 -0500 + +linux-source-2.6.19 (2.6.19-6.8) feisty; urgency=low + + [Ben Collins] + + * ndsiwrapper: Updates driver to 1.28. + - GIT-SHA a37fed032ec826103a75e51ff1f82c5fea8e9b73 + * debian/*: Update ndiswrapper-modules provides to 1.9 API + - GIT-SHA 4b81c3da5bc7ddf7671f1dd8da2536495e5750ae + * debian/bin/git-hooks/commit-msg: Update to understand merges. + - GIT-SHA 41f189eba8d5645ef0b000007b42f9b26f243297 + * debian/{post,header}-install: Fixup header dirs and symlinks + - GIT-SHA 932cf4988ab7e53d6e71631604aec55c65d4ffa2 + + [Upstream Kernel Changes] + + * [SCSI] aic94xx SCSI timeout fix + * [SCSI] aic94xx SCSI timeout fix: SMP retry fix. + * [SCSI] 3ware 9000 add support for 9650SE + * [SCSI] sg: fix incorrect last scatg length + * [ARM] 3857/2: pnx4008: add devices' registration + * [SCSI] iscsi: always release crypto + * [SCSI] iscsi: add newlines to debug messages + * [SCSI] iscsi_tcp: fix xmittask oops + * [SCSI] iscsi class: update version + * [SCSI] gdth: Fix && typos + * [SCSI] psi240i.c: fix an array overrun + * [ARM] Remove PM_LEGACY=y from selected ARM defconfigs + * hpt37x: Check the enablebits + * pata_artop: fix "& (1 >>" typo + * libata: fix double-completion on error + * x86-64: Fix partial page check to ensure unusable memory is not being marked usable. + * x86-64: Fix PTRACE_[SG]ET_THREAD_AREA regression with ia32 emulation. + * x86-64: shorten the x86_64 boot setup GDT to what the comment says + * x86-64: Handle reserve_bootmem_generic beyond end_pfn + * x86-64: setup saved_max_pfn correctly (kdump) + * x86: Add acpi_user_timer_override option for Asus boards + * x86-64: Fix vgetcpu when CONFIG_HOTPLUG_CPU is disabled + * x86-64: Fix race in exit_idle + * setup_irq(): better mismatch debugging + * fix via586 irq routing for pirq 5 + * revert "PCI: quirk for IBM Dock II cardbus controllers" + * drivers/ide: stray bracket + * autofs4: panic after mount fail + * nvidiafb: fix unreachable code in nv10GetConfig + * usb: MAINTAINERS updates + * hugetlb: prepare_hugepage_range check offset too + * hugetlb: check for brk() entering a hugepage region + * libata: Convert from module_init to subsys_initcall + * cciss: fix iostat + * cpqarray: fix iostat + * Char: isicom, fix close bug + * ALSA: hda-intel - Disable MSI support by default + * Use delayed disable mode of ioapic edge triggered interrupts + * [IA64] bte_unaligned_copy() transfers one extra cache line. + * [POWERPC] Add the thread_siblings files to sysfs + * [POWERPC] Wire up sys_move_pages + * powerpc: windfarm shall request it's sub modules + * Linux 2.6.19-rc6 + * [TG3]: Increase 5906 firmware poll time. + * [NETFILTER]: nfnetlink_log: fix byteorder of NFULA_SEQ_GLOBAL + * [NETFILTER]: Use pskb_trim in {ip,ip6,nfnetlink}_queue + * [NETFILTER]: ip6_tables: fixed conflicted optname for getsockopt + * [NETFILTER]: ip6_tables: use correct nexthdr value in ipv6_find_hdr() + * [TCP]: Fix up sysctl_tcp_mem initialization. + * [TG3]: Disable TSO on 5906 if CLKREQ is enabled. + * [IA64] irqs: use `name' not `typename' + * [IA64] typename -> name conversion + * [IA64] use generic_handle_irq() + * [IA64] a fix towards allmodconfig build + * ipmi: use platform_device_add() instead of platform_device_register() to register device allocated dynamically + * some irq_chip variables point to NULL + * pnx4008: rename driver + * pnx4008:fix NULL dereference in rgbfb + * eCryptfs: dput() lower d_parent on rename + * set default video mode on PowerBook Wallstreet + * IB/ipath - fix driver build for platforms with PCI, but not HT + * parport: fix compilation failure + * hfs_fill_super returns success even if no root inode + * Update udf documentation to reflect current state of read/write support + * dell_rbu: fix error check + * AFS: Amend the AFS configuration options + * Don't give bad kprobes example aka ") < 0))" typo + * fat: add fat_getattr() + * Fix strange size check in __get_vm_area_node() + * eCryptfs: CIFS nlink fixes + * scsi: clear garbage after CDBs on SG_IO + * IPoIB: Clear high octet in QP number + * x86-64: Fix vsyscall.c compilation on UP + * x86_64: fix CONFIG_CC_STACKPROTECTOR build bug + * OHCI: disallow autostop when wakeup is not available + * USB: ftdi_sio: adds vendor/product id for a RFID construction kit + * USB: ftdi driver pid for dmx-interfaces + * USB: Fix UCR-61S2B unusual_dev entry + * USB: OHCI: fix root-hub resume bug + * USB: correct keymapping on Powerbook built-in USB ISO keyboards + * USB Storage: unusual_devs.h entry for Sony Ericsson P990i + * USB: hid-core: Add quirk for new Apple keyboard/trackpad + * usb-storage: Remove duplicated unusual_devs.h entries for Sony Ericsson P990i + * USB: Fixed outdated usb_get_device_descriptor() documentation + * USB: ipaq: Add HTC Modem Support + * USB: auerswald possible memleak fix + * W1: ioremap balanced with iounmap + * debugfs: check return value correctly + * aoe: Add forgotten NULL at end of attribute list in aoeblk.c + * Fix radeon DDC regression + * Fix generic fb_ddc i2c edid probe msg + * lkkbd: Remove my old snail-mail address + * x86_64: stack unwinder crash fix + * i386/x86_64: ACPI cpu_idle_wait() fix + * lockdep: fix static keys in module-allocated percpu areas + * Update my CREDITS entry + * [CRYPTO] api: Remove one too many semicolon + * pcmcia: fix 'rmmod pcmcia' with unbound devices + * i2c-ixp4xx: fix ") != 0))" typo + * scx200_acb: handle PCI errors + * x86_64: fix memory hotplug build with NUMA=n + * ftape: fix printk format warnings + * fix build error for HISAX_NETJET + * m68knommu: fix up for the irq_handler_t changes + * Add "pure_initcall" for static variable initialization + + -- Ben Collins Wed, 15 Nov 2006 13:39:18 -0800 + +linux-source-2.6.19 (2.6.19-6.7) feisty; urgency=low + + [Ben Collins] + + * debian/post-install: Fix typo in asm-ppc header symlinking. + - GIT-SHA 6031489f1288795bface60bf3be309f70046ab58 + + [Upstream Kernel Changes] + + * [CIFS] NFS stress test generates flood of "close with pending write" messages + * [CIFS] Explicitly set stat->blksize + * bcm43xx: Drain TX status before starting IRQs + * bcm43xx: Add error checking in bcm43xx_sprom_write() + * x86-64: clean up io-apic accesses + * x86-64: write IO APIC irq routing entries in correct order + * [CIFS] Fix mount failure when domain not specified + * Regression in 2.6.19-rc microcode driver + * A minor fix for set_mb() in Documentation/memory-barriers.txt + * nfsd4: reindent do_open_lookup() + * nfsd4: fix open-create permissions + * i386: Force data segment to be 4K aligned + * dm: fix find_device race + * dm: suspend: fix error path + * dm: multipath: fix rr_add_path order + * dm: raid1: fix waiting for io on suspend + * drivers/telephony/ixj: fix an array overrun + * Tigran has moved + * md: change ONLINE/OFFLINE events to a single CHANGE event + * md: fix sizing problem with raid5-reshape and CONFIG_LBD=n + * md: do not freeze md threads for suspend + * kretprobe: fix kretprobe-booster to save regs and set status + * ia64: select ACPI_NUMA if ACPI + * sysctl: Undeprecate sys_sysctl + * IPMI: Clean up the waiting message queue properly on unload + * IPMI: retry messages on certain error returns + * ipmi_si_intf.c: fix "&& 0xff" typos + * htirq: refactor so we only have one function that writes to the chip + * htirq: allow buggy drivers of buggy hardware to write the registers + * IB/ipath - program intconfig register using new HT irq hook + * nfsd: fix spurious error return from nfsd_create in async case + * [POWERPC] Make sure initrd and dtb sections get into zImage correctly + * MMC: Poll card status after rescanning cards + * MMC: Do not set unsupported bits in OCR response + * IB/ehca: Assure 4K alignment for firmware control blocks + * [CIFS] Fix minor problem with previous patch + * [IPVS]: Compile fix for annotations in userland. + * [POWERPC] CPM_UART: Fix non-console transmit + * [POWERPC] CPM_UART: Fix non-console initialisation + * [POWERPC] pseries: Force 4k update_flash block and list sizes + * [POWERPC] Fix cell "new style" mapping and add debug + * [POWERPC] cell: set ARCH_SPARSEMEM_DEFAULT in Kconfig + * bonding: lockdep annotation + * com20020 build fix + * drivers cris: return on NULL dev_alloc_skb() + * [IPVS]: More endianness fixed. + * [XFS] 956618: Linux crashes on boot with XFS-DMAPI filesystem when + * [XFS] Keep lockdep happy. + * [XFS] rename uio_read() to xfs_uio_read() + * [XFS] 956664: dm_read_invis() changes i_atime + * [XFS] Clean up i_flags and i_flags_lock handling. + * [XFS] Prevent a deadlock when xfslogd unpins inodes. + * [XFS] Remove KERNEL_VERSION macros from xfs_dmapi.h + * V4L/DVB (4795): Tda826x: use correct max frequency + * V4L/DVB (4802): Cx88: fix remote control on WinFast 2000XP Expert + * V4L/DVB (4804): Fix missing i2c dependency for saa7110 + * V4L/DVB (4814): Remote support for Avermedia 777 + * V4L/DVB (4815): Remote support for Avermedia A16AR + * V4L/DVB (4816): Change tuner type for Avermedia A16AR + * V4L/DVB (4817): Fix uses of "&&" where "&" was intended + * V4L/DVB (4818): Flexcop-usb: fix debug printk + * vmalloc: optimization, cleanup, bugfixes + * pci: don't try to remove sysfs files before they are setup. + * mspec driver build fix + * IPMI: Fix more && typos + * Patch for nvidia divide by zero error for 7600 pci-express card + * Fix missing parens in set_personality() + * .gitignore: add miscellaneous files + * fix Data Acess error in dup_fd + * Fix misrouted interrupts deadlocks + * SCSI core: always store >= 36 bytes of INQUIRY data + * IB/ehca: Use named constant for max mtu + * IB/ehca: Activate scaling code by default + * RDMA/amso1100: Fix unitialized pseudo_netdev accessed in c2_register_device + * RDMA/amso1100: Fix && typo + * IB/mad: Fix race between cancel and receive completion + * Fix bad data direction in SG_IO + * ide-cd: only set rq->errors SCSI style for block pc requests + * [dvb saa7134] Fix missing 'break' for avermedia card case + -- Ben Collins Wed, 15 Nov 2006 13:37:45 -0800 + +linux-source-2.6.19 (2.6.19-5.7) feisty; urgency=low + + [Ben Collins] + + * ubuntu/acerhk: Make this X86_32 only. + - GIT-SHA 58f2ee6dede56d3e412f17561cca861ab155ebfc + + [Upstream Kernel Changes] + + * [ARM] 3917/1: Fix dmabounce symbol exports + * [ARM] 3915/1: S3C2412: Add s3c2410_gpio_getirq() to general gpio.c + * [ARM] 3912/1: Make PXA270 advertise HWCAP_IWMMXT capability + * [ARM] 3918/1: ixp4xx irq-chip rework + * [ARM] 3919/1: Fixed definition of some PXA270 CIF related registers + * [ARM] 3920/1: S3C24XX: Remove smdk2410_defconfig + * [ARM] 3921/1: S3C24XX: remove bast_defconfig + * [ARM] 3922/1: S3C24XX: update s3c2410_defconfig to 2.6.19-rc4 + * [ARM] 3923/1: S3C24XX: update s3c2410_defconfig with new drivers + * [ARM] 3926/1: make timer led handle HZ != 100 + * [ARM] 3927/1: Allow show_mem() to work with holes in memory map. + * Update for the srm_env driver. + * [NET]: kconfig, correct traffic shaper + * [TCP]: Don't use highmem in tcp hash size calculation. + * [PKT_SCHED] sch_htb: Use hlist_del_init(). + * [NETPOLL]: Compute checksum properly in netpoll_send_udp(). + * [NET]: Set truesize in pskb_copy + * [TG3]: Fix array overrun in tg3_read_partno(). + * [DECNET]: Endianess fixes (try #2) + * Linux 2.6.19-rc5 + * [libata] sata_via: fix obvious typo + + -- Ben Collins Tue, 07 Nov 2006 15:18:08 -0800 + +linux-source-2.6.19 (2.6.19-5.6) feisty; urgency=low + + [Ben Collins] + + * debian/bin/git-hooks: Add my hooks for git. + - GIT-SHA 2786fe5a5cd024947d2eec6d9f9014c8a91a4e21 + * acerhk: Acer Travelmate support for special keys. + - GIT-SHA 827225e724afd903b316359effdbb8ae1139cf7b + * rfswitch: Software radio kill switch support. + - GIT-SHA 911f283b4150f73809331a7bcd4812e8d9903a70 + * ubuntu/{av5100,pbe5}: Remove inclusion of linux/config.h + - GIT-SHA 5e6495e09eed2d37c5e19cb827d55b1372f81dbb + * ipg: Added ICPlus 1000A Gigabit Ethernet Driver + - GIT-SHA 9cf35c595ca98658a03932342a4b5d65e36b1226 + * ubuntu/ipg: Fix PCI device ide. + - GIT-SHA 2cc83690105c317ad32ab5340677e894448fe552 + * ipw3945: Update to v1.1.2 + - GIT-SHA 9ad82afb9d97986a46fa849f8e590c070d8a53b5 + * powerpc: Make sure to create arch/powerpc/include/asm symlink + - GIT-SHA 2d655eb92d3a1fa9cdfdd3d5cc01568f0e5d03a7 + + [Upstream Kernel Changes] + + * ieee80211: don't flood log with errors + * hostap_plx: fix CIS verification + * bcm43xx: Fix low-traffic netdev watchdog TX timeouts + * bcm43xx: fix unexpected LED control values in BCM4303 sprom + * V4L/DVB (4752): DVB: Add DVB_FE_CUSTOMISE support for MT2060 + * V4L/DVB (4785): Budget-ci: Change DEBIADDR_IR to a safer default + * V4L/DVB (4786): Pvrusb2: use NULL instead of 0 + * V4L/DVB (4787): Budget-ci: Inversion setting fixed for Technotrend 1500 T + * V4L/DVB (4770): Fix mode switch of Compro Videomate T300 + * V4L/DVB (4784): [saa7146_i2c] short_delay mode fixed for fast machines + * V4L/DVB (4751): Fix DBV_FE_CUSTOMISE for card drivers compiled into kernel + * [IPX]: Trivial parts of endianness annotations + * [IPX]: Annotate and fix IPX checksum + * [IPV6]: Fix ECN bug on big-endian + * [NETFILTER] bug: NFULA_CFG_QTHRESH uses 32bit + * [NETFILTER] bug: nfulnl_msg_config_mode ->copy_range is 32bit + * [NETFILTER] bug: skb->protocol is already net-endian + * [TG3]: Fix 2nd ifup failure on 5752M. + * [PKTGEN]: TCI endianness fixes + * [NET]: __alloc_pages() failures reported due to fragmentation + * [IPV6]: Add ndisc_netdev_notifier unregister. + * [IPV6]: Give sit driver an appropriate module alias. + * [NETLABEL]: Fix build failure. + * [SPARC]: Fix robust futex syscalls and wire up migrate_pages. + * ehea: Nullpointer dereferencation fix + * ehea: Removed redundant define + * ehea: 64K page support fix + * Kconfig: remove redundant NETDEVICES depends + * AVR32: Get rid of board_early_init + * AVR32: Fix thinko in generic_find_next_zero_le_bit() + * Fix the spurious unlock_cpu_hotplug false warnings + * Fix for LKDTM MEM_SWAPOUT crashpoint + * isdn/gigaset: convert warning message + * lockdep: fix delayacct locking bug + * Improve the removed sysctl warnings + * sysctl: allow a zero ctl_name in the middle of a sysctl table + * sysctl: implement CTL_UNNUMBERED + * sunrpc: add missing spin_unlock + * [S390] revert add_active_range() usage patch. + * [S390] IRQs too early enabled. + * AVR32: Wire up sys_epoll_pwait + * AVR32: Add missing return instruction in __raw_writesb + * [GFS2] don't panic needlessly + * [GFS2] Fix incorrect fs sync behaviour. + * [GFS2] Fix OOM error handling + * [DLM] Fix kref_put oops + * [DLM] fix oops in kref_put when removing a lockspace + * [MIPS] Ocelot C: Fix large number of warnings. + * [MIPS] Ocelot C: fix eth registration after conversion to platform_device + * [MIPS] Ocelot C: Fix warning about missmatching format string. + * [MIPS] Ocelot C: Fix mapping of ioport address range. + * [MIPS] Ocelot 3: Fix large number of warnings. + * [MIPS] SB1: On bootup only flush cache on local CPU. + * [MIPS] Ocelot C: Fix MAC address detection after platform_device conversion. + * [MIPS] Ocelot 3: Fix MAC address detection after platform_device conversion. + * [MIPS] EV64120: Fix timer initialization for HZ != 100. + * [MIPS] Make irq number allocator generally available for fixing EV64120. + * [MIPS] EV64120: Fix PCI interrupt allocation. + * [MIPS] Fix EV64120 and Ocelot builds by providing a plat_timer_setup(). + * b44: change comment about irq mask register + * e1000: Fix regression: garbled stats and irq allocation during swsusp + + -- Ben Collins Tue, 7 Nov 2006 14:17:22 -0800 + +linux-source-2.6.19 (2.6.19-5.5) feisty; urgency=low + + [Ben Collins] + + * dev_acpi: Added ACPI Device driver + - GIT-SHA e076c92971e36ea2e629be25462ab40ad20cb704 + * pcc-acpi: Panasonc ACPI Driver + - GIT-SHA 95569514a203153c4c4496c8d9c118b39785022c + * ubuntu/acpi: New driver section + - GIT-SHA e22846d3da0ed6f835bcb60485a9bc93eb9ffc6a + * sony_acpi: Add Sony ACPI Laptop driver + - GIT-SHA e4d2ffe08e0b6930582bd81938fe7d2730a0b953 + * tc1100-wmi: Add IBM TC1100 WMI driver + - GIT-SHA e69c9de0b0a12f0917e2f2266c128dd2752c56f2 + * debian: Enable ABI checking + - GIT-SHA 328078e283ff6eacaf5d1a62720fede1e2a68780 + * ubuntu/acpi: Make ACPI sub menu depend on ACPI + - GIT-SHA f55d355afa1ed54296103ddc1f05afb08e5cfca0 + * debian/rules: Export KPKG_ARCH for post-install script. + - GIT-SHA d1669dc891344b6c155037d81234e0218bfbba90 + * ubuntu: Fix wireless drivers to be compatible with WE >= 21 + - GIT-SHA 2e0a08b1d1451201bcac8dae36cd42fdf07735e1 + + [Upstream Kernel Changes] + + * [IA64] don't double >> PAGE_SHIFT pointer for /dev/kmem access + * jfs: Add splice support + * [CIFS] Fix readdir breakage when blocksize set too small + * [CIFS] Allow null user connections + * [NET] sealevel: uses arp_broken_ops + * [APPLETALK]: Fix potential OOPS in atalk_sendmsg(). + * [XFRM] xfrm_user: Fix unaligned accesses. + * [NET]: Fix segmentation of linear packets + * [DCCP]: fix printk format warnings + * [ETH1394]: Fix unaligned accesses. + * [SCTP]: Always linearise packet on input + * [NET]: fix uaccess handling + * [IPV6]: fix lockup via /proc/net/ip6_flowlabel + * [NETFILTER]: remove masq/NAT from ip6tables Kconfig help + * [NETFILTER]: Missed and reordered checks in {arp,ip,ip6}_tables + * [NETFILTER]: ip_tables: compat error way cleanup + * [NETFILTER]: nf_conntrack: add missing unlock in get_next_corpse() + * [NETFILTER]: ip_tables: compat code module refcounting fix + * [NetLabel]: protect the CIPSOv4 socket option from setsockopt() + * [SCTP]: Correctly set IP id for SCTP traffic + * [SCTP]: Remove temporary associations from backlog and hash. + * [IPV6]: return EINVAL for invalid address with flowlabel lease request + * [SPARC64]: Fix Tomatillo/Schizo IRQ handling. + * [SPARC64]: Add some missing print_symbol() calls. + * sh: Wire up new syscalls. + * video: Fix include in hp680_bl. + * sh: Update r7780rp_defconfig. + * sh: Fix IPR-IRQ's for IRQ-chip change breakage. + * sh: Titan defconfig update. + * IB/iser: Start connection after enabling iSER + * RDMA/cma: rdma_bind_addr() leaks a cma_dev reference count + * IB/ehca: Fix eHCA driver compilation for uniprocessor + * IB/amso1100: Use dma_alloc_coherent() instead of kmalloc/dma_map_single + * IB/amso1100: Fix incorrect pr_debug() + * IB/uverbs: Return sq_draining value in query_qp response + * [IPV6]: fix flowlabel seqfile handling + * find_bd_holder() fix + * uml ubd driver: allow using up to 16 UBD devices + * uml ubd driver: document some struct fields + * uml ubd driver: var renames + * uml ubd driver: give better names to some functions. + * uml ubd driver: change ubd_lock to be a mutex + * uml ubd driver: ubd_io_lock usage fixup + * uml ubd driver: convert do_ubd to a boolean variable + * uml ubd driver: reformat ubd_config + * uml ubd driver: use bitfields where possible + * uml ubd driver: do not store error codes as ->fd + * uml ubd driver: various little changes + * uml: add _text definition to linker scripts + * uml: add INITCALLS + * taskstats: fix sub-threads accounting + * eCryptfs: Clean up crypto initialization + * eCryptfs: Hash code to new crypto API + * eCryptfs: Cipher code to new crypto API + * eCryptfs: Consolidate lower dentry_open's + * eCryptfs: Remove ecryptfs_umount_begin + * eCryptfs: Fix handling of lower d_count + * md: check bio address after mapping through partitions. + * CFQ: request <-> request merging rr_list fixup + * SCSI: ISCSI build failure + * IB/mthca: Fix MAD extended header format for MAD_IFC firmware command + * [MIPS] TX4927: Remove indent error message that somehow ended in the code. + * [MIPS] Add missing file for support of backplane on TX4927 based board + * [MIPS] Sort out missuse of __init for prom_getcmdline() + * [MIPS] Yosemite: fix uninitialized variable in titan_i2c_xfer() + * [MIPS] Fix warning of printk format in mips_srs_init() + * [MIPS] VSMP: Fix initialization ordering bug. + * [MIPS] Flags must be unsigned long. + * [MIPS] VSMP: Synchronize cp0 counters on bootup. + * [MIPS] Fixup migration to GENERIC_TIME + * [IA64] cpu-hotplug: Fixing confliction between CPU hot-add and IPI + * [IA64] MCA recovery: Montecito support + * [IA64] move SAL_CACHE_FLUSH check later in boot + * [IA64] Correct definition of handle_IPI + * ep93xx_eth: fix RX/TXstatus ring full handling + * ep93xx_eth: fix unlikely(x) > y test + * ep93xx_eth: don't report RX errors + * tokenring: fix module_init error handling + * n2: fix confusing error code + * sky2: not experimental + * myri10ge: ServerWorks HT2000 PCI id is already defined in pci_ids.h + * ehea: kzalloc GFP_ATOMIC fix + * net s2io: return on NULL dev_alloc_skb() + * skge, sky2, et all. gplv2 only + * sky2: netpoll on dual port cards + * sata_sis: fix flags handling for the secondary port + * Add 0x7110 piix to ata_piix.c + * libata: unexport ata_dev_revalidate() + * ata_piix: allow 01b MAP for both ICH6M and ICH7M + * [POWERPC] Fix various offb issues + * [POWERPC] Fix rmb() for e500-based machines it + * [POWERPC] Fix oprofile support for e500 in arch/powerpc + * [POWERPC] Use 4kB iommu pages even on 64kB-page systems + * [POWERPC] qe_lib: qe_issue_cmd writes wrong value to CECDR + * [POWERPC] Make current preempt-safe + * [POWERPC] Make high hugepage areas preempt safe + * [POWERPC] Make mmiowb's io_sync preempt safe + * [POWERPC] Disallow kprobes on emulate_step and branch_taken + * [POWERPC] Make alignment exception always check exception table + * ahci: fix status register check in ahci_softreset + * [libata] sata_nv: Add PCI IDs + * i386: clean up io-apic accesses + * [MIPS] 16K & 64K page size fixes + * [MIPS] SMTC: Fix crash if # of TC's > # of VPE's after pt_regs irq cleanup. + * [MIPS] SMTC: Synchronize cp0 counters on bootup. + * [MIPS] Fix warning in mips-boards generic PCI + * i386: write IO APIC irq routing entries in correct order + * powerpc: Eliminate "exceeds stub group size" linker warning + * [TIPC] net/tipc/port.c: fix NULL dereference + * [TCP]: Set default congestion control when no sysctl. + * [IPV6]: File the fingerprints off ah6->spi/esp6->spi + * [SPARC64]: Fix futex_atomic_cmpxchg_inatomic implementation. + * [CIFS] report rename failure when target file is locked by Windows + * [MIPS] Fix merge screwup by patch(1) + * [MIPS] IP27: Allow SMP ;-) Another changeset messed up by patch. + * [MIPS] Fix warning about init_initrd() call if !CONFIG_BLK_DEV_INITRD. + * [MIPS] Ocelot G: Fix : "CURRENTLY_UNUSED" is not defined warning. + * [MIPS] Don't use R10000 llsc workaround version for all llsc-full processors. + * [MIPS] Do not use -msym32 option for modules. + * RDMA/addr: Use client registration to fix module unload race + * [libata] Add support for PATA controllers of MCP67 to pata_amd.c. + * [libata] Add support for AHCI controllers of MCP67. + * pci_ids.h: Add NVIDIA PCI ID + * PCI: Revert "PCI: i386/x86_84: disable PCI resource decode on device disable" + * PCI: Let PCI_MULTITHREAD_PROBE depend on BROKEN + * USB: add another sierra wireless device id + * USB: usb-storage: Unusual_dev update + * hid-core: big-endian fix fix + * USB: new VID/PID-combos for cp2101 + * USB: sierra: Fix id for Sierra Wireless MC8755 in new table + * usbtouchscreen: use endpoint address from endpoint descriptor + * USB: failure in usblp's error path + * USB: usblp: fix system suspend for some systems + * USB: HID: add blacklist AIRcable USB, little beautification + * USB: fix compiler issues with newer gcc versions + * USB: xpad: additional USB id's added + * USB Storage: unusual_devs.h entry for Sony Ericsson P990i + * USB: use MII hooks only if CONFIG_MII is enabled + * eCryptfs: Fix pointer deref + * tidy "md: check bio address after mapping through partitions" + * md: send online/offline uevents when an md array starts/stops + * sys_pselect7 vs compat_sys_pselect7 uaccess error handling + * update some docbook comments + * docbook: merge journal-api into filesystems.tmpl + * Fix ipc entries removal + * mm: un-needed add-store operation wastes a few bytes + * fix UFS superblock alignment issues + * lkdtm: cleanup headers and module_param/MODULE_PARM_DESC + * Cleanup read_pages() + * cifs: ->readpages() fixes + * fuse: ->readpages() cleanup + * gfs2: ->readpages() fixes + * edac_mc: fix error handling + * NFS4: fix for recursive locking problem + * ipmi_si_intf.c sets bad class_mask with PCI_DEVICE_CLASS + * init_reap_node() initialization fix + * Add printk_timed_ratelimit() + * schedule removal of FUTEX_FD + * acpi_noirq section fix + * swsusp: debugging + * spi section fix + * reiserfs: reset errval after initializing bitmap cache + * uml: fix I/O hang + * uml: include tidying + * Create compat_sys_migrate_pages + * powerpc: wire up sys_migrate_pages + * drivers/isdn/hysdn/hysdn_sched.c: sleep after taking spinlock fix + * fix Documentation/accounting/getdelays.c buf size + * IDE: Add the support of nvidia PATA controllers of MCP67 to amd74xx.c + * Fix sys_move_pages when a NULL node list is passed + * Fix user.* xattr permission check for sticky dirs + * splice: fix problem introduced with inode diet + * Revert unintentional "volatile" changes in ipc/msg.c + * Fix unlikely (but possible) race condition on task->user access + * Make sure "user->sigpending" count is in sync + + -- Ben Collins Mon, 6 Nov 2006 07:11:08 -0800 + +linux-source-2.6.19 (2.6.19-4.4) feisty; urgency=low + + [Ben Collins] + + * debian: Fix ppc defconfig, and d-i braindamage + - GIT-SHA 3805cd5ab6796f26fdd2b69d58d72d5bf33f96bb + * debian: Prefix make-kpkg calls with sparc64 on sparc for now. + - GIT-SHA 3b2a6a332c9febffda9cdc26a9a0572ec859e999 + + [Upstream Kernel Changes] + + * CFQ: use irq safe locking in cfq_cic_link() + * CFQ: bad locking in changed_ioprio() + * Fix dmsetup table output change + * ioc4_serial: irq flags fix + * ndiswrapper: don't set the module->taints flags + * isdn/gigaset: avoid cs->dev null pointer dereference + * lockdep: annotate DECLARE_WAIT_QUEUE_HEAD + * cryptocop: double spin_lock_irqsave() + * MTD: fix last kernel-doc warning + * docbook: make a filesystems book + * Fix "Remove the use of _syscallX macros in UML" + * uml: fix compilation options for USER_OBJS + * xacct_add_tsk: fix pure theoretical ->mm use-after-free + * drivers/ide/pci/generic.c: add missing newline to the all-generic-ide message + * sunrpc: fix refcounting problems in rpc servers + * APM: URL of APM 1.2 specs has changed + * fix "sunrpc: fix refcounting problems in rpc servers" + * fix i386 regparm=3 RT signal handlers on x86_64 + * [MIPS] Oprofile: fix on non-VSMP / non-SMTC SMP configurations. + * [MIPS] Au1xx0 code sets incorrect mips_hpt_frequency + * [MIPS] Oprofile: Fix MIPSxx counter number detection. + * [MIPS] SMTC: Make 8 the default number of processors. + * [MIPS] Fix warning about unused definition in c-sb1.c + * [MIPS] Make SB1 cache flushes not to use on_each_cpu + * [MIPS] Wire up getcpu(2) and epoll_wait(2) syscalls. + * [MIPS] Au1000: Fix warning about unused variable. + * [MIPS] Fix return value of TXX9 SPI interrupt handler + * [MIPS] Ocelot G: Fix build error and numerous warnings. + * [MIPS] EMMA 2 / Markeins: Fix build wreckage due to genirq wreckage. + * [MIPS] EMMA 2 / Markeins: Formitting fixes split from actual address fixes. + * [MIPS] EMMA 2 / Markeins: Convert to name struct resource initialization. + * [MIPS] EMMA 2 / Markeins: struct resource takes physical addresses. + * [MIPS] JMR3927: Fixup another victim of the irq pt_regs cleanup. + * [MIPS] MIPS doesn't need compat_sys_getdents. + * fix bd_claim_by_kobject error handling + * clean up add_bd_holder() + * Linux 2.6.19-rc4 + + -- Ben Collins Tue, 31 Oct 2006 10:45:07 -0500 + +linux-source-2.6.19 (2.6.19-3.3) feisty; urgency=low + + [Ben Collins] + + * Revert "ppc: Add defconfig for build" + - GIT-SHA 540057c30de97922c99dcd198e1535c3986abfa0 + * debian: Add defconfig setting for each arch + - GIT-SHA 03248c8d8e00151e085448684eacdafb3acc0833 + * debian/rules: Re-add kernel-wedge workaround to fix sparc FTBFS + - GIT-SHA b0ea4d18b8c8bfdef670980700b2f78948205819 + + -- Ben Collins Tue, 31 Oct 2006 10:02:36 -0500 + +linux-source-2.6.19 (2.6.19-2.2) feisty; urgency=low + + [Ben Collins] + + * btsco: Added new driver + - GIT-SHA 18b128d55a6297da941055abda677cde1c1086ed + * at76: Atmel USB Driver + - GIT-SHA f2460fe216447baa35b7f7a9ca8d440f4922719e + * at76-usb-firmware: Added firmware for Atmel USB + - GIT-SHA b618084d1cf221755848d42bb5b45fe5b97479e1 + * ppc: Add defconfig for build + - GIT-SHA 7eefca4e80cd6016ecec0cf27e1e9dadb05e2e9f + * debian: git-ubuntu-log: Ommit matching revert/commits. + - GIT-SHA 68ed886f702f70e43f4e835d768a38309a4120ca + * debian: Fix KPKG_(ARCH|SUBARCH) to fix sparc64 build failure. + - GIT-SHA 0973b171e2334735687c647673e76f94d21a6d3c + * debian: insert-changes: New script. + - GIT-SHA 492ef6bf5f17554ab82ab170e728e51de7fc1fb1 + + [Upstream Kernel Changes] + + * e1000: FIX: don't poke at manageability registers for incompatible adapters + * e1000: FIX: 82542 doesn't support WoL + * e1000: FIX: fix wrong txdctl threshold bitmasks + * e1000: FIX: Disable Packet Split for non jumbo frames + * e1000: FIX: Don't limit descriptor size to 4kb for PCI-E adapters + * e1000: FIX: move length adjustment due to crc stripping disabled. + * e1000: Increment version to 7.2.9-k4 + * e100: account for closed interface when shutting down + * pcmcia: at91_cf update + * pcmcia: add more IDs to hostap_cs.c + * pcmcia: update alloc_io_space for conflict checking for multifunction PC card + * pcmcia/ds: driver layer error checking + * CONFIG_PM=n slim: drivers/pcmcia/* + * i82092: wire up errors from pci_register_driver() + * pcmcia: au1000_generic fix + * ioremap balanced with iounmap for drivers/pcmcia + * Export soc_common_drv_pcmcia_remove to allow modular PCMCIA. + * PCMCIA: handle sysfs, PCI errors + * PCMCIA: fix __must_check warnings + * [SPARC64]: Fix central/FHC bus handling on Ex000 systems. + * [SPARC64]: Fix memory corruption in pci_4u_free_consistent(). + * [TCP] cubic: scaling error + * [TCP] H-TCP: fix integer overflow + * [BRIDGE]: correct print message typo + * [SPARC]: Fix bus_id[] string overflow. + * [S390] sys_getcpu compat wrapper. + * [S390] Initialize interval value to 0. + * [S390] cio: css_probe_device() must be called enabled. + * [S390] uaccess error handling. + * [S390] Improve AP bus device removal. + * [S390] cio: Make ccw_device_register() static. + * acpiphp: fix latch status + * PCI: fix pci_fixup_video as it blows up on sparc64 + * PCI: x86-64: mmconfig missing printk levels + * PCI: reset pci device state to unknown state for resume + * PCI: Remove quirk_via_abnormal_poweroff + * vmlinux.lds: consolidate initcall sections + * drivers: wait for threaded probes between initcall levels + * silence 'make xmldocs' warning by adding missing description of 'raw' in nand_base.c:1485 + * [ARM] Fix SMP irqflags support + * [ARM] Add realview SMP default configuration + * [ARM] Add __must_check to uaccess functions + * [ARM] 3909/1: Disable UWIND_INFO for ARM (again) + * [ARM] 3899/1: Fix the normalization of the denormal double precision number. + * [ARM] 3900/1: Fix VFP Division by Zero exception handling. + * mm: clean up pagecache allocation + * vmscan: Fix temp_priority race + * Use min of two prio settings in calculating distress for reclaim + * ext4: fix printk format warnings + * jbd: journal_dirty_data re-check for unmapped buffers + * jbd2: journal_dirty_data re-check for unmapped buffers + * fix efi_memory_present_wrapper() + * md: fix bug where spares don't always get rebuilt properly when they become live + * md: simplify checking of available size when resizing an array + * md: fix up maintenance of ->degraded in multipath + * md: fix printk format warnings, seen on powerpc64: + * memory hotplug: __GFP_NOWARN is better for __kmalloc_section_memmap() + * Fix potential OOPs in blkdev_open() + * __vmalloc with GFP_ATOMIC causes 'sleeping from invalid context' + * visws build fix + * Add missing space in module.c for taintskernel + * ioc4: fix printk format warning + * cciss: fix printk format warning + * hugetlb: fix size=4G parsing + * hugetlb: fix prio_tree unit + * hugetlb: fix absurd HugePages_Rsvd + * missing unused dentry in prune_dcache()? + * VFS: Fix an error in unused dentry counting + * Constify compat_get_bitmap argument + * strstrip remove last blank fix + * fill_tgid: fix task_struct leak and possible oops + * bacct_add_tsk: fix unsafe and wrong parent/group_leader dereference + * taskstats_tgid_free: fix usage + * taskstats_tgid_alloc: optimization + * taskstats: kill ->taskstats_lock in favor of ->siglock + * taskstats: don't use tasklist_lock + * fill_tgid: cleanup delays accounting + * move SYS_HYPERVISOR inside the Generic Driver menu + * time_adjust cleared before use + * cpu-hotplug: release `workqueue_mutex' properly on CPU hot-remove + * JMB 368 PATA detection + * workqueue: update kerneldoc + * Calculation fix for memory holes beyong the end of physical memory + * [ARM] Fix i2c-pxa slave mode support + * [ARM] Fix suspend oops caused by PXA2xx PCMCIA driver + * [ARM] Add KBUILD_IMAGE target support + * Fix GFP_HIGHMEM slab panic + * [ARM] 3913/1: n2100: fix IRQ routing for second ethernet port + * ieee1394: ohci1394: revert fail on error in suspend + * taskstats: fix sk_buff leak + * taskstats: fix sk_buff size calculation + * m68k: consolidate initcall sections + * [WATCHDOG] sc1200wdt.c pnp unregister fix. + + + -- Ben Collins Thu, 26 Oct 2006 23:16:13 -0400 + +linux-source-2.6.19 (2.6.19-1.1) feisty; urgency=low + + [Ben Collins] + + * Makefile: Disable compiler stack protection + - GIT-SHA 88e5d8158cceacb7e7b559f5af74f729a17ade71 + * Add git-ubuntu-log parsing script. + - GIT-SHA 5d781e48af9265470bc5de9cfd072b80918e1db8 + * Disable APIC on UP machines by default + - GIT-SHA ce3c49d6164180bcb0e5d6a455f3ae163914af52 + * Quieten compressed boot messages. + - GIT-SHA b31aa3e4c69d1fc4868d39dc63bc2a4baab497b1 + * Add config option to disable hyperthreading by default + - GIT-SHA 161459709590b06c515c7e2657c376e28a98fdc1 + * Default to dongle type 9 on IBM hardware. + - GIT-SHA eb2eaa11c75f1c656a3bef54bef3e8c92e52049d + * Add "TOSHIBA CD-ROM XM-1702BC" to ide-dma blacklist + - GIT-SHA e64e371c8cdba5c0af8d8c8eaef69f07cd3b87b5 + * net/sunhme: Fix Sun Happy Meal ethernet lockups on Ultra 1E + - GIT-SHA add87b82b6ea9b4a9c695d4fb0b5ae1d4ce655cc + * pcmcia: Do not insert pcmcia cards on resume + - GIT-SHA 9334fc580d26a92c81651df4669ce8c19a68b260 + * scsi/BusLogic: Add MODULE_DEVICE_TABLE for autoloading + - GIT-SHA 55f6d5c8bf31270f7289ce9865cb15528327cca8 + * input/mouse/alps: Do not call psmouse_reset() for alps + - GIT-SHA fb3c8d616c602b8876dc50e89ac4987f5ba05bfe + * scsi: Add Matshita DMC-LC33 to devlist + - GIT-SHA b7f273bde8e6e02a6dea490f877ef9ee4f390448 + * scsi: Restore generic SCSI proc_info function + - GIT-SHA 9c1a5525614014486d2ba5ed1181f777c55587f3 + * ide: Make some drivers modular + - GIT-SHA 9ecb5d7cc5db4071f4d9218f8acff96ab5d599f0 + * ide/pnp: Allow ide-pnp to be modular. + - GIT-SHA 924f6bd12dc99b5176940895ec26607f2144b0f1 + * video/vesafb: Modularize + - GIT-SHA f160678572c5cbd97cc96a761d95646fb4c3a50f + * pcmcia: Add missing device releases + - GIT-SHA e3eeb6ee8e14cdcaccf0213446bef4a26ba78bcb + * general: Quieten noisy printk's + - GIT-SHA 13dbeb0d68d892cce0483594fbd795c289ae7c27 + * acpi: Allow loading of DSDT from initrd + - GIT-SHA 5272d84c2ae7ad6dcf98ec83fe2f510a0b8912ee + * ide: Cleaner merge of ide_scan_pcibus() changes (modular) + - GIT-SHA ab460a6bf9bb00b39443190efbc44cf8a9358032 + * video/vesafb: Fixup vesafb modular code to merge with platform driver changes. + - GIT-SHA 08c62e8dea078ca4510f00bbf1e8dce0cef53716 + * ide: Export ide_scan_direction + - GIT-SHA 1b49a08481e74417c114f16c2c6ec0e4e6d282e0 + * ide: Fix Oops in IDE caused by __init for ide_pci_scanbus() + - GIT-SHA d3e3800f6826c7a57872dd22ac93d034d36c91db + * fs: Revert bd_claim change. + - GIT-SHA 8cbff5a651066cd43f6736a45181c0549d91662a + * drivers/video: Fix some video drivers unchecked use of nvram functions + - GIT-SHA e79b253cceeee1f4022b825e3c6acbc9690b81a7 + * tulip: Fix for Uli5261 chipsets. + - GIT-SHA 278130f8818f8ac6550760807815d24dbeee6470 + * net/tulip: Define ULI PCI ID's + - GIT-SHA 68cdca366a7410a1a5c86f1365072edfedbc911c + * ia64: Export some extra symbols so we can build vga16fb + - GIT-SHA 48b37aa458e7e61f396f0bc2e4b8a4bdd039005a + * video: Enable VesaFB for ia64. + - GIT-SHA 9d859229d3ec3bb4325b65e05387f2d6cd12627f + * ide: Revert some of the "modular ide" patch. + - GIT-SHA ccbe68cc3928e6275f4fefed7856c7754d10dd84 + * vga16fb: Set default timings to 640x400 for compatibility. + - GIT-SHA 20556d56d5e13a642d5da77e4fd877f00a63bbdc + * block: Make CDROMEJECT more robust + - GIT-SHA 933956f84fdb520d9cce720fabbb6236efaa188f + * powerpc: Disable prom_printf + - GIT-SHA 52bca28eb10d88db59b8b16fd28f7bd71c859404 + * ide-cd: Disable verbose errors. + - GIT-SHA 72d40db7ba7478afe35e7302d0d61c2bcd41fa53 + * tulip: Fix mdio related lockups. Update from upstream driver. + - GIT-SHA e74fe2962b8fde95756505782a3226a5e30b92c2 + * input: Allow root to inject unknown scan codes. + - GIT-SHA 9dba2e8158382af26d4460242ffe6d45803f43fb + * 3w-9xxx: Add .proc_name member to scsi_host_template + - GIT-SHA a120864ddf97dcaf0a5565ffd2539852e884f411 + * synaptics: Add Toshiba Protege M300 to rate=40 blacklist. + - GIT-SHA d9b4f0e739d81b75fae3f9545d598d865e391e35 + * vga16fb: Do not use 640x480 on certain machines + - GIT-SHA faffc346a48402547964adde5b5c4bf3b37572a8 + * forcedeth: Let the driver work when no PHY is found + - GIT-SHA eb2bbfea12d9f3599ed6019fce78a5bb3b70f9d8 + - Bug #45257 + * tulip: Let dmfe handle davicom on non-sparc. + - GIT-SHA 901dcff694d2c177078a2f9a0e81d765c7db41fb + - Bug #48287 + * speakup: Driver addition + - GIT-SHA 1cf0afb09a96f1c381a9ac42ab56115c957177ab + * kbd: Fix typo in speakup patch + - GIT-SHA 71aeabbdc6e922a454cbb96c93bda44cd6f34613 + * powerpc: Allow config of pSeries panel message + - GIT-SHA 8290fcc662b7a9cb3035222f3c2f0160f5a14fcd + * general: crash helper support for apport + - GIT-SHA d9291b92a80b54e2212348ff82cd6c374351dd05 + * version: Implement version_signature proc file. + - GIT-SHA 87c212ae348ed89e2177af1907fbfff22b758eb4 + * hid-core: Add noget quirk for turbox keyboard. + - GIT-SHA c6ecb350590cbbb62207ecda8acdb36dc503830e + * ipw2100: Add option to disable C3/C4 state transistions. + - GIT-SHA a2a9f735de0c61a7be45ab0c55eea593098de70a + * ubuntu: Create ubuntu driver directory. + - GIT-SHA ce47ddb0f4e34a60599bedc8f0bff996ed252e6f + * hdrinst: Add stub for gfs headers + - GIT-SHA 6fde7f59fd4e921d8255c2fd6ebabc622c88947c + * general: Add MODULE_DEV_TABLE to some drivers for autoloading. + - GIT-SHA bef1c07e02bd1fb0bb2eb020e5c58dd12e56d53f + * i8042: Quiten message about no controlles being found. + - GIT-SHA a438ddf2becf5f6d4a5db68acf0cd9648030d192 + * asfs: Add Amiga Smart File System + - GIT-SHA 63e625a65070eee461f5f4bedd550e39ed8c171e + * kbuild: Add ubuntu/include/ for external driver includes. + - GIT-SHA 6cc08947078031622ef777dc91630b2a25e1cc51 + * fs: Export __d_path symbol for dazuko. + - GIT-SHA f816e1d4eab62bc229991a614f63731f599bf9ae + * speakup: Merges fixes and patches from Edgy. + - GIT-SHA d2c7021c474d7bbaeafd96f890471476514e219d + * ixj: Fix PCI vendor/device ID's for QUICKNET. + - GIT-SHA 7742c3f2837c62c64c08736ca8f6b8931258ba6b + * asfs: Compile fixes. + - GIT-SHA da4e90d5cb6bc656861de64cb200d6de124c39ce + * vt: Fix speakup code to compile. + - GIT-SHA a0ec07a4417656566e19d8415dbc86e91d6f974a + * kbuild: Fix location of ubuntu/include addition to LINUXINCLUDES + - GIT-SHA a30f7b62339415a90a6024ada0e2f10f86a85dbd + * general: Various compile fixes for edgy patch merges. + - GIT-SHA eea36c5c4f202eb95108fd8c1ef9fe5f38c10bcf + * dazuko: Added driver + - GIT-SHA 1283c07c2260047335a58be437dc8ba558011770 + * squashfs: Added v3.1-r2 driver + - GIT-SHA 6acce7627f044b72930dd6cc563aed9559a4b8c4 + * unionfs: Add 20060916 snapshot + - GIT-SHA c375f3b13be8c1f3aba1316b01332f7951d4dda2 + * gfs: Merged from Edgy + - GIT-SHA 29decd8128961ed2a79235240172ec2f646103f4 + * rt2x00: Added drivers from Edgy with build fixes. + - GIT-SHA e8a710260e32cefb7236a8bd3a111387818786c0 + * linux-wlan-ng: Added driver + - GIT-SHA 36d255e73f30f68a23d61048d3f0627bc5241025 + * ndsiwrapper: Added driver + - GIT-SHA f1e27ae3a39b0d389f212df44d6ab5468d04647d + * cloop: Added compressed loop driver + - GIT-SHA 26cb677f9b9205a2ed77a4ee4c554bcdd498eaa4 + * dm-bbr: Added new driver + - GIT-SHA ee36ac9e9c3065f8f594493a3be2e0ae4196e46e + * acx: Add driver from Edgy + - GIT-SHA 959183847e71f99bee6e5682708a672b9c2abd02 + * ipw3945: Add new driver + - GIT-SHA cc542d63e9bc05438570c084e6b701e82aafbda2 + * adm8211: Add new driver + - GIT-SHA 6a9957bd934f4db1dc80a5d7b48638e3373d7c88 + * rtl818x: Add new drivers + - GIT-SHA 9533d6e292539fae27c6062dbf4ba2b663caaa28 + * prism54_softmac: Add new driver + - GIT-SHA 559b895c45424e974caadc3ec249d5cdbcd5ddf4 + * fsam7400: Add new driver + - GIT-SHA 78b8978053c2ee6d0cbd42aec330d6ee2b555212 + * mol: Add Mac-On-Linux driver + - GIT-SHA 51410652caa26b301d6ac968d6fce04c1f21d925 + * ov511: Add ov511 camera driver + - GIT-SHA 63f1564f55645b26f157c418a6e28fb49b23a52b + * zd1211: Install firmware in subdirectory, like the driver expects it. + - GIT-SHA 33564d1acfa96e8cba778e2efb6b0376aad09e12 + * kbuild: Do not add debian/ to clean-dirs. + - GIT-SHA 8e1027b4fefded38704dd473394e2f7238012940 + * debian/: We don't need to run make-kpkg clean in the top level. + - GIT-SHA a8e5dc70095ebd21e21896c82cab8394e5c25a7c + * ubuntu/: Update all drivers for 2.6.19 changes + - GIT-SHA a8dc19f626a200ee837af570ce59a732b3094aa5 + * ubuntu/: More fixes for warnings. ubuntu/ is pretty much warning free + - GIT-SHA 807da64fba9aa414f256ea4d5664a448f9023d78 + * gfs2/dlm: Remove. These modules are in-tree now. + - GIT-SHA bb62e6c94034978605cc148d6c94dd15036eaf4e + * gfs2: Export extra symbols for gfs1 + - GIT-SHA d999702b86414c59d62f9b34450129a9221b523d + * kbuild: Allow header_install to work with O= + - GIT-SHA afa95b842e7b00b21537f2203e4879c2d860a3e9 + * debian/d-i: Update md-modules udeb list. + - GIT-SHA ed24b1fc393feb10061f83bbf152f7718cc94a83 + * debian/: Complete rework of d-i (kernel-wedge) handling + - GIT-SHA 435d7a8fa97f08f1ed39520bf4122434ad7d57ac + * ide: Disable some PCI entries when duplicate ATA driver is enabled. + - GIT-SHA c97951e8a2b085c6ec47fee8f1f933185bde3d75 + * fsam7400: Include linux/io.h for check_signature() + - GIT-SHA fb04e20928624ec398c54131fa7736a2fb6a971e + * sbus: BBC and ENVCTRL both need to be built-in + - GIT-SHA 75bc2c9764754ae2b446ac5613b7a33c2d7a0379 + * prism2: Make modules depend on subsystems. + - GIT-SHA 5d084bc0a60a146d81a910580eeb29a7e92d89d6 + * sparc: Fix some section mismatch warnings from sbus modules. + - GIT-SHA a1e1b46410e1095bad4e401d7bc0591d44137e2a + * kbuild: Remove local change for -fno-stack-protector. + - GIT-SHA 10137f027764e20df233111725a7b148047d92d1 + * sbus/char, synaptics: Revert local Ubuntu changes + - GIT-SHA a3852f015830915eb3fb33b8fea85a5edd7a5838 + * mv643xx: Remove pci dev table. Not needed for this driver. + - GIT-SHA f098f17a693fefb6aa03d4ac317faf4f92c0d05a + * imsttfb: Set USE_NV_MODES to 0 when CONFIG_NVRAM is not set + - GIT-SHA 292f071fb9492af9042e840ca81397108dd0ea83 + * prism2_plx: Disable on ppc for now. + - GIT-SHA db1b9f970535fdc567e08bca05b8bcf6a4e1f07f + * ppc: Do not re-export kd_mksound. + - GIT-SHA 5b7d5bbf5171fcb92d78b0e3fa5437ec6f912838 + * atm/block/wan: Require ISA_DMA_API for some drivers. + - GIT-SHA 40215f7cfb9ec59a90b781c50ffc9424ef16b3ba + * hvcs: select HVC_CONSOLE when enabled. + - GIT-SHA e41dbec0326f0e75e6a80b248b5c26f75899f866 + * ppc: Do not enable ISA_DMA_API on PPC64 + - GIT-SHA 75b0757318306ddd6868d65f2e2da6c806f140f6 + * tmscsim, i2o_config: Depends on ISA_DMA_API + - GIT-SHA f86bd4404911d9107c3bf7e36c894fa5907fac8c + * drivers/atm: Add CPPFLAGS to fore200e-fw endian check. + - GIT-SHA 694db9ff7e16042b3f58bbc01d19ef08609315ce + * bcm43xx: Move dma-mapping.h include to fix compile failure + - GIT-SHA 9cc7a903b72c231510f4cae7e9dee27b0ebc6d2c + + [Chuck Short] + + * atkbd: Disables stupid keyboard warning. + - GIT-SHA aedc2d9246885a41346584b1fe91696611eea756 + + [Fabio M. Di Nitto] + + * drivers/char/vt.c: make promcon driver init a boot option. + - GIT-SHA 41a393f2d8829bceb5c5da136dd12f3dcbe6c94c + + -- Ben Collins Thu, 26 Oct 2006 21:58:29 -0400 --- linux-2.6.24.orig/debian/control +++ linux-2.6.24/debian/control @@ -0,0 +1,839 @@ +Source: linux +Section: devel +Priority: optional +Maintainer: Ubuntu Kernel Team +Standards-Version: 3.6.1 +Build-Depends: debhelper (>= 3), module-init-tools, kernel-wedge (>= 2.24ubuntu1), gcc-4.1-hppa64 [hppa], binutils-hppa64 [hppa], device-tree-compiler [powerpc], gcc-4.1 [powerpc ia64], gawk [amd64 i386] +Build-Depends-Indep: xmlto, docbook-utils, gs, transfig, bzip2, sharutils + +Package: linux-kernel-devel +Architecture: all +Section: devel +Priority: optional +Depends: build-essential, git-core, gitk, rsync, curl, openssh-client, debhelper, kernel-package, kernel-wedge +Description: Linux kernel hacking dependencies + This is a dummy package that will install all possible packages + required to hack comfortably on the kernel. + +Package: linux-source-2.6.24 +Architecture: all +Section: devel +Priority: optional +Provides: linux-source, linux-source-2.6 +Depends: binutils, bzip2, coreutils | fileutils (>= 4.0) +Recommends: libc-dev, gcc, make +Suggests: libncurses-dev | ncurses-dev, kernel-package, libqt3-dev +Description: Linux kernel source for version 2.6.24 with Ubuntu patches + This package provides the source code for the Linux kernel version 2.6.24. + . + You may configure the kernel to your setup by typing "make config" and + following instructions, but you could get ncursesX.X-dev and try "make + menuconfig" for a jazzier, and easier to use interface. There are options + to use QT or GNOME based configuration interfaces, but they need + additional packages to be installed. Also, please read the detailed + documentation in the file + /usr/share/doc/linux-source-2.6.24/README.headers.gz. + . + If you wish to use this package to create a custom Linux kernel, then it + is suggested that you investigate the package kernel-package, which has + been designed to ease the task of creating kernel image packages. + . + If you are simply trying to build third-party modules for your kernel, + you do not want this package. Install the appropriate linux-headers + package instead. + +Package: linux-doc-2.6.24 +Architecture: all +Section: doc +Priority: optional +Provides: linux-doc-2.6 +Conflicts: linux-doc-2.6 +Replaces: linux-doc-2.6 +Depends: coreutils | fileutils (>= 4.0) +Description: Linux kernel specific documentation for version 2.6.24 + This package provides the various readme's in the 2.6.24 kernel + Documentation/ subdirectory: these typically contain kernel-specific + installation notes for some drivers for example. See + /usr/share/doc/linux-doc-2.6.24/Documentation/00-INDEX for a list of what + is contained in each file. Please read the Changes file, as it contains + information about the problems, which may result by upgrading your + kernel. + +Package: linux-headers-2.6.24-32 +Architecture: all +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0) +Provides: linux-headers, linux-headers-2.6 +Description: Header files related to Linux kernel version 2.6.24 + This package provides kernel header files for version 2.6.24, for sites + that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details + +Package: linux-libc-dev +Architecture: amd64 i386 powerpc sparc ia64 hppa lpia +Conflicts: libc6-dev (<< 2.3.2.ds1-6), libc6.1-dev (<< 2.3.2.ds1-6), dvb-dev (<< 1.0.1-6), amd64-libs-dev (<= 1.1), linux-kernel-headers +Replaces: libc6-dev (<< 2.3.2.ds1-6), libc6.1-dev (<< 2.3.2.ds1-6), dvb-dev (<< 1.0.1-6), linux-kernel-headers +Provides: linux-kernel-headers +Description: Linux Kernel Headers for development + This package provides headers from the Linux kernel. These headers + are used by the installed headers for GNU glibc and other system + libraries. + +Package: linux-image-2.6.24-32-386 +Architecture: i386 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on i386 + This package contains the Linux kernel image for version 2.6.24 on + i386. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Alternate x86 (486 and better) processors. + . + Geared toward desktop systems. + . + You likely do not want to install this package directly. Instead, install + the linux-386 meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-386 +Architecture: i386 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on i386 + This package provides kernel header files for version 2.6.24 on + i386. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-debug-2.6.24-32-386 +Architecture: i386 +Section: devel +Priority: optional +Provides: linux-debug +Description: Linux kernel debug image for version 2.6.24 on i386 + This package provides a kernel debug image for version 2.6.24 on + i386. + . + This is for sites that wish to debug the kernel. + . + The kernel image contained in this package is NOT meant to boot from. It + is uncompressed, and unstripped. + +Package: linux-image-2.6.24-32-generic +Architecture: i386 amd64 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on x86/x86_64 + This package contains the Linux kernel image for version 2.6.24 on + x86/x86_64. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Generic processors. + . + Geared toward desktop systems. + . + You likely do not want to install this package directly. Instead, install + the linux-generic meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-generic +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on x86/x86_64 + This package provides kernel header files for version 2.6.24 on + x86/x86_64. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-debug-2.6.24-32-generic +Architecture: i386 amd64 +Section: devel +Priority: optional +Provides: linux-debug +Description: Linux kernel debug image for version 2.6.24 on x86/x86_64 + This package provides a kernel debug image for version 2.6.24 on + x86/x86_64. + . + This is for sites that wish to debug the kernel. + . + The kernel image contained in this package is NOT meant to boot from. It + is uncompressed, and unstripped. + +Package: linux-image-2.6.24-32-hppa32 +Architecture: hppa +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: palo +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 32-bit HP PA-RISC SMP + This package contains the Linux kernel image for version 2.6.24 on + 32-bit HP PA-RISC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 32-bit HP PA-RISC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-hppa32 meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-hppa32 +Architecture: hppa +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 32-bit HP PA-RISC SMP + This package provides kernel header files for version 2.6.24 on + 32-bit HP PA-RISC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-hppa64 +Architecture: hppa +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: palo +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 64-bit HP PA-RISC SMP + This package contains the Linux kernel image for version 2.6.24 on + 64-bit HP PA-RISC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 64-bit HP PA-RISC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-hppa64 meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-hppa64 +Architecture: hppa +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1-hppa64, binutils-hppa64, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 64-bit HP PA-RISC SMP + This package provides kernel header files for version 2.6.24 on + 64-bit HP PA-RISC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-itanium +Architecture: ia64 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: elilo (>= 3.6-1) +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Itanium SMP + This package contains the Linux kernel image for version 2.6.24 on + Itanium SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Itanium SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-itanium meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-itanium +Architecture: ia64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Itanium SMP + This package provides kernel header files for version 2.6.24 on + Itanium SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-mckinley +Architecture: ia64 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: elilo (>= 3.6-1) +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Itanium II SMP + This package contains the Linux kernel image for version 2.6.24 on + Itanium II SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Itanium II SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-mckinley meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-mckinley +Architecture: ia64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Itanium II SMP + This package provides kernel header files for version 2.6.24 on + Itanium II SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-powerpc +Architecture: powerpc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: yaboot +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 32-bit PowerPC + This package contains the Linux kernel image for version 2.6.24 on + 32-bit PowerPC. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 32-bit PowerPC processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-powerpc meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-powerpc +Architecture: powerpc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 32-bit PowerPC + This package provides kernel header files for version 2.6.24 on + 32-bit PowerPC. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-powerpc64-smp +Architecture: powerpc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: yaboot +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 64-bit PowerPC SMP + This package contains the Linux kernel image for version 2.6.24 on + 64-bit PowerPC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 64-bit PowerPC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-powerpc64-smp meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-powerpc64-smp +Architecture: powerpc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 64-bit PowerPC SMP + This package provides kernel header files for version 2.6.24 on + 64-bit PowerPC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-powerpc-smp +Architecture: powerpc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: yaboot +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 32-bit PowerPC SMP + This package contains the Linux kernel image for version 2.6.24 on + 32-bit PowerPC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 32-bit PowerPC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-powerpc-smp meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-powerpc-smp +Architecture: powerpc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, gcc-4.1, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 32-bit PowerPC SMP + This package provides kernel header files for version 2.6.24 on + 32-bit PowerPC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-server +Architecture: i386 amd64 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, kvm-api-4, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on x86/x86_64 + This package contains the Linux kernel image for version 2.6.24 on + x86/x86_64. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Server processors. + . + Geared toward server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-server meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-server +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on x86/x86_64 + This package provides kernel header files for version 2.6.24 on + x86/x86_64. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-debug-2.6.24-32-server +Architecture: i386 amd64 +Section: devel +Priority: optional +Provides: linux-debug +Description: Linux kernel debug image for version 2.6.24 on x86/x86_64 + This package provides a kernel debug image for version 2.6.24 on + x86/x86_64. + . + This is for sites that wish to debug the kernel. + . + The kernel image contained in this package is NOT meant to boot from. It + is uncompressed, and unstripped. + +Package: linux-image-2.6.24-32-sparc64 +Architecture: sparc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: silo +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 64-bit UltraSPARC + This package contains the Linux kernel image for version 2.6.24 on + 64-bit UltraSPARC. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 64-bit UltraSPARC processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-sparc64 meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-sparc64 +Architecture: sparc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 64-bit UltraSPARC + This package provides kernel header files for version 2.6.24 on + 64-bit UltraSPARC. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-sparc64-smp +Architecture: sparc +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, redhat-cluster-modules, ivtv-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: silo +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on 64-bit UltraSPARC SMP + This package contains the Linux kernel image for version 2.6.24 on + 64-bit UltraSPARC SMP. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports 64-bit UltraSPARC SMP processors. + . + Geared toward desktop or server systems. + . + You likely do not want to install this package directly. Instead, install + the linux-sparc64-smp meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-sparc64-smp +Architecture: sparc +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on 64-bit UltraSPARC SMP + This package provides kernel header files for version 2.6.24 on + 64-bit UltraSPARC SMP. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-virtual +Architecture: i386 +Section: base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on x86 + This package contains the Linux kernel image for version 2.6.24 on + x86. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Virtual processors. + . + Geared toward virtualised hardware. + . + You likely do not want to install this package directly. Instead, install + the linux-virtual meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-virtual +Architecture: i386 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on x86 + This package provides kernel header files for version 2.6.24 on + x86. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-debug-2.6.24-32-virtual +Architecture: i386 +Section: devel +Priority: optional +Provides: linux-debug +Description: Linux kernel debug image for version 2.6.24 on x86 + This package provides a kernel debug image for version 2.6.24 on + x86. + . + This is for sites that wish to debug the kernel. + . + The kernel image contained in this package is NOT meant to boot from. It + is uncompressed, and unstripped. + +Package: linux-image-2.6.24-32-lpia +Architecture: lpia +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Ubuntu Moblie and Embedded LPIA edition + This package contains the Linux kernel image for version 2.6.24 on + Ubuntu Moblie and Embedded LPIA edition. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports UME processors. + . + UME kernel + . + You likely do not want to install this package directly. Instead, install + the linux-lpia meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-lpia +Architecture: lpia +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Ubuntu Moblie and Embedded LPIA edition + This package provides kernel header files for version 2.6.24 on + Ubuntu Moblie and Embedded LPIA edition. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-rt +Architecture: i386 amd64 +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Ingo Molnar's full real time preemption patch (2.6.24.7-rt27) + This package contains the Linux kernel image for version 2.6.24 on + Ingo Molnar's full real time preemption patch (2.6.24.7-rt27). + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Generic processors. + . + RT kernel + . + You likely do not want to install this package directly. Instead, install + the linux-rt meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-rt +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Ingo Molnar's full real time preemption patch (2.6.24.7-rt27) + This package provides kernel header files for version 2.6.24 on + Ingo Molnar's full real time preemption patch (2.6.24.7-rt27). + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-lpiacompat +Architecture: lpia +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on Ubuntu Moblie and Embedded-x86 compat edition + This package contains the Linux kernel image for version 2.6.24 on + Ubuntu Moblie and Embedded-x86 compat edition. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports UME processors. + . + UME kernel + . + You likely do not want to install this package directly. Instead, install + the linux-lpiacompat meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-lpiacompat +Architecture: lpia +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on Ubuntu Moblie and Embedded-x86 compat edition + This package provides kernel header files for version 2.6.24 on + Ubuntu Moblie and Embedded-x86 compat edition. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-xen +Architecture: i386 amd64 +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on This kernel can be used for Xen dom0 and domU + This package contains the Linux kernel image for version 2.6.24 on + This kernel can be used for Xen dom0 and domU. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Generic processors. + . + Xen domO/domU + . + You likely do not want to install this package directly. Instead, install + the linux-xen meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-xen +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on This kernel can be used for Xen dom0 and domU + This package provides kernel header files for version 2.6.24 on + This kernel can be used for Xen dom0 and domU. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. + +Package: linux-image-2.6.24-32-openvz +Architecture: i386 amd64 +Section: universe/base +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, kvm-api-4, redhat-cluster-modules +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: lilo (>= 19.1) | grub +Suggests: fdutils, linux-doc-2.6.24 | linux-source-2.6.24 +Description: Linux kernel image for version 2.6.24 on OpenVZ Virtualization enabled kernel + This package contains the Linux kernel image for version 2.6.24 on + OpenVZ Virtualization enabled kernel. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports Generic processors. + . + OpenVZ kernel + . + You likely do not want to install this package directly. Instead, install + the linux-openvz meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-2.6.24-32-openvz +Architecture: i386 amd64 +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-2.6.24-32, ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version 2.6.24 on OpenVZ Virtualization enabled kernel + This package provides kernel header files for version 2.6.24 on + OpenVZ Virtualization enabled kernel. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-2.6.24-32/debian.README.gz for details. --- linux-2.6.24.orig/debian/d-i/exclude-modules.hppa +++ linux-2.6.24/debian/d-i/exclude-modules.hppa @@ -0,0 +1,11 @@ +firewire-core-modules +efi-modules +socket-modules +irda-modules +floppy-modules +fb-modules +acpi-modules +cdrom-modules +nfs-modules +nic-usb-modules +fancontrol-modules --- linux-2.6.24.orig/debian/d-i/exclude-modules.sparc +++ linux-2.6.24/debian/d-i/exclude-modules.sparc @@ -0,0 +1,11 @@ +efi-modules +nic-pcmcia-modules +pcmcia-modules +pcmcia-storage-modules +socket-modules +irda-modules +floppy-modules +fb-modules +acpi-modules +cdrom-modules +fancontrol-modules --- linux-2.6.24.orig/debian/d-i/exclude-modules.lpia +++ linux-2.6.24/debian/d-i/exclude-modules.lpia @@ -0,0 +1,9 @@ +efi-modules +serial-modules +cdrom-modules +plip-modules +md-modules +pcmcia-storage-modules +nic-pcmcia-modules +pcmcia-modules +fancontrol-modules --- linux-2.6.24.orig/debian/d-i/exclude-modules.i386 +++ linux-2.6.24/debian/d-i/exclude-modules.i386 @@ -0,0 +1,2 @@ +efi-modules +fancontrol-modules --- linux-2.6.24.orig/debian/d-i/package-list +++ linux-2.6.24/debian/d-i/package-list @@ -0,0 +1,180 @@ +Package: acpi-modules +Depends: kernel-image +Priority: standard +Description: Support for ACPI + +Package: efi-modules +Depends: kernel-image +Priority: standard +Description: EFI support + +Package: fat-modules +Depends: kernel-image +Priority: standard +Description: FAT filesystem support + This includes Windows FAT and VFAT support. + +Package: fb-modules +Depends: kernel-image +Priority: standard +Description: Framebuffer modules + +Package: firewire-core-modules +Depends: kernel-image, storage-core-modules +Priority: standard +Description: Firewire (IEEE-1394) Support + +Package: floppy-modules +Depends: kernel-image +Priority: standard +Description: Floppy driver support + +Package: fs-core-modules +Depends: kernel-image +Priority: standard +Provides: ext2-modules, ext3-modules, jfs-modules, reiserfs-modules, xfs-modules +Description: Base filesystem modules + This includes ext2, ext3, jfs, reiserfs and xfs. + +Package: fs-secondary-modules +Depends: kernel-image, fat-modules +Priority: standard +Provides: ntfs-modules, ufs-modules, hfs-modules, affs-modules +Description: Extra filesystem modules + This includes support for Windows NTFS, SysV UFS, MacOS HFS and HFSPlus and + Amiga AFFS. + +Package: ide-modules +Depends: kernel-image, storage-core-modules +Priority: standard +Description: IDE support + +Package: input-modules +Depends: kernel-image, usb-modules +Priority: standard +Description: Support for various input methods + +Package: ipv6-modules +Depends: kernel-image +Priority: standard +Description: Support for IPv6 networking + +Package: irda-modules +Depends: kernel-image, nic-shared-modules +Priority: standard +Description: Support for Infrared protocols + +Package: md-modules +Depends: kernel-image +Priority: standard +Description: Multi-device support (raid, device-mapper, lvm) + +Package: nic-modules +Depends: kernel-image, nic-shared-modules +Priority: standard +Description: Network interface support + +Package: nic-pcmcia-modules +Depends: kernel-image, nic-shared-modules, nic-modules +Priority: standard +Description: PCMCIA network interface support + +Package: nic-usb-modules +Depends: kernel-image, nic-shared-modules, usb-modules +Priority: standard +Description: USB network interface support + +Package: parport-modules +Depends: kernel-image +Priority: standard +Description: Parallel port support + +Package: pata-modules +Depends: kernel-image, storage-core-modules +Priority: standard +Description: PATA support modules + +Package: pcmcia-modules +Depends: kernel-image +Priority: standard +Description: PCMCIA Modules + +Package: pcmcia-storage-modules +Depends: kernel-image, scsi-modules +Priority: standard +Description: PCMCIA storage support + +Package: plip-modules +Depends: kernel-image, nic-shared-modules, parport-modules +Priority: standard +Description: PLIP (parallel port) networking support + +Package: ppp-modules +Depends: kernel-image, nic-shared-modules, serial-modules +Priority: standard +Description: PPP (serial port) networking support + +Package: sata-modules +Depends: kernel-image, storage-core-modules +Priority: standard +Description: SATA storage support + +Package: scsi-modules +Depends: kernel-image, storage-core-modules +Priority: standard +Description: SCSI storage support + +Package: serial-modules +Depends: kernel-image +Priority: standard +Description: Serial port support + +Package: socket-modules +Depends: kernel-image +Priority: standard +Description: Unix socket support + +Package: storage-core-modules +Depends: kernel-image +Priority: standard +Provides: loop-modules +Description: Core storage support + Includes core SCSI, LibATA, USB-Storage. Also includes related block + devices for CD, Disk and Tape medium (and IDE Floppy). + +Package: usb-modules +Depends: kernel-image, storage-core-modules +Priority: standard +Description: Core USB support + +Package: nfs-modules +Priority: standard +Depends: kernel-image +Description: NFS filesystem drivers + Includes the NFS client driver, and supporting modules. + +Package: block-modules +Priority: standard +Depends: kernel-image, storage-core-modules, parport-modules +Description: Block storage devices + This package contains the block storage devices, including DAC960 and + paraide. + +Package: message-modules +Priority: standard +Depends: kernel-image, storage-core-modules, scsi-modules +Description: Fusion and i2o storage modules + This package containes the fusion and i2o storage modules. + +Package: crypto-modules +Priority: extra +Depends: kernel-image +Description: crypto modules + This package contains crypto modules. + +Package: fancontrol-modules +Priority: standard +Depends: kernel-image +Description: Apple powermac fancontrol modules + Contains drivers for macintosh i2c bus as well as for the monitoring devices + connected to it. This allows to control the fans during installation. --- linux-2.6.24.orig/debian/d-i/exclude-modules.amd64 +++ linux-2.6.24/debian/d-i/exclude-modules.amd64 @@ -0,0 +1,3 @@ +efi-modules +cdrom-modules +fancontrol-modules --- linux-2.6.24.orig/debian/d-i/exclude-modules.powerpc +++ linux-2.6.24/debian/d-i/exclude-modules.powerpc @@ -0,0 +1,5 @@ +efi-modules +fb-modules +acpi-modules +cdrom-modules +fancontrol-modules --- linux-2.6.24.orig/debian/d-i/kernel-versions.in +++ linux-2.6.24/debian/d-i/kernel-versions.in @@ -0,0 +1,15 @@ +# arch version flavour installedname suffix bdep +amd64 PKGVER-ABINUM generic PKGVER-ABINUM-generic - + +hppa PKGVER-ABINUM hppa32 PKGVER-ABINUM-hppa32 y +hppa PKGVER-ABINUM hppa64 PKGVER-ABINUM-hppa64 y + +i386 PKGVER-ABINUM 386 PKGVER-ABINUM-386 - +i386 PKGVER-ABINUM generic PKGVER-ABINUM-generic - + +ia64 PKGVER-ABINUM itanium PKGVER-ABINUM-itanium - + +powerpc PKGVER-ABINUM powerpc PKGVER-ABINUM-powerpc - +powerpc PKGVER-ABINUM powerpc64-smp PKGVER-ABINUM-powerpc64-smp - + +sparc PKGVER-ABINUM sparc64 PKGVER-ABINUM-sparc64 - --- linux-2.6.24.orig/debian/d-i/kernel-versions +++ linux-2.6.24/debian/d-i/kernel-versions @@ -0,0 +1,15 @@ +# arch version flavour installedname suffix bdep +amd64 2.6.24-32 generic 2.6.24-32-generic - + +hppa 2.6.24-32 hppa32 2.6.24-32-hppa32 y +hppa 2.6.24-32 hppa64 2.6.24-32-hppa64 y + +i386 2.6.24-32 386 2.6.24-32-386 - +i386 2.6.24-32 generic 2.6.24-32-generic - + +ia64 2.6.24-32 itanium 2.6.24-32-itanium - + +powerpc 2.6.24-32 powerpc 2.6.24-32-powerpc - +powerpc 2.6.24-32 powerpc64-smp 2.6.24-32-powerpc64-smp - + +sparc 2.6.24-32 sparc64 2.6.24-32-sparc64 - --- linux-2.6.24.orig/debian/d-i/exclude-modules.ia64 +++ linux-2.6.24/debian/d-i/exclude-modules.ia64 @@ -0,0 +1,4 @@ +socket-modules +floppy-modules +cdrom-modules +fancontrol-modules --- linux-2.6.24.orig/debian/d-i/modules/fb-modules +++ linux-2.6.24/debian/d-i/modules/fb-modules @@ -0,0 +1,3 @@ +fbcon ? +vesafb ? +vga16fb ? --- linux-2.6.24.orig/debian/d-i/modules/pata-modules +++ linux-2.6.24/debian/d-i/modules/pata-modules @@ -0,0 +1,44 @@ +ata_generic ? +pata_ali ? +pata_amd ? +pata_artop ? +pata_atiixp ? +pata_cmd640 ? +pata_cmd64x ? +pata_cs5520 ? +pata_cs5530 ? +pata_cs5535 ? +pata_cypress ? +pata_efar ? +pata_hpt366 ? +pata_hpt37x ? +pata_hpt3x2n ? +pata_hpt3x3 ? +pata_isapnp ? +pata_it8213 ? +pata_it821x ? +pata_ixp4xx_cf ? +pata_jmicron ? +pata_legacy ? +pata_marvell ? +pata_mpc52xx ? +pata_mpiix ? +pata_netcell ? +pata_ns87410 ? +pata_oldpiix ? +pata_opti ? +pata_optidma ? +pata_pdc2027x ? +pata_pdc202xx_old ? +pata_platform ? +pata_qdi ? +pata_radisys ? +pata_rz1000 ? +pata_sc1200 ? +pata_scc ? +pata_serverworks ? +pata_sil680 ? +pata_sl82c105 ? +pata_triflex ? +pata_via ? +pata_winbond ? --- linux-2.6.24.orig/debian/d-i/modules/nic-pcmcia-modules +++ linux-2.6.24/debian/d-i/modules/nic-pcmcia-modules @@ -0,0 +1,19 @@ +3c574_cs ? +3c589_cs ? +airo_cs ? +atmel_cs ? +axnet_cs ? +com20020_cs ? +fmvj18x_cs ? +ibmtr_cs ? +netwave_cs ? +nmclan_cs ? +orinoco_cs ? +pcnet_cs ? +ray_cs ? +smc91c92_cs ? +wavelan_cs ? +wl3501_cs ? +xirc2ps_cs ? +xircom_cb ? +xircom_tulip_cb ? --- linux-2.6.24.orig/debian/d-i/modules/efi-modules +++ linux-2.6.24/debian/d-i/modules/efi-modules @@ -0,0 +1 @@ +efivars ? --- linux-2.6.24.orig/debian/d-i/modules/ide-modules +++ linux-2.6.24/debian/d-i/modules/ide-modules @@ -0,0 +1,45 @@ +ide-generic ? +ide-pnp ? +icside ? +rapide ? +bast-ide ? +ide-cris ? +ali14xx ? +dtc2278 ? +ht6560b ? +qd65xx ? +umc8672 ? +ide-cs ? +hd ? +swarm ? +au1xxx-ide ? +aec62xx ? +alim15x3 ? +amd74xx ? +atiixp ? +cmd64x ? +cs5520 ? +cs5530 ? +cs5535 ? +sc1200 ? +cy82c693 ? +hpt34x ? +hpt366 ? +it821x ? +jmicron ? +ns87415 ? +opti621 ? +pdc202xx_old ? +pdc202xx_new ? +piix ? +rz1000 ? +serverworks ? +sgiioc4 ? +siimage ? +sis5513 ? +sl82c105 ? +slc90e66 ? +triflex ? +trm290 ? +via82cxxx ? +generic ? --- linux-2.6.24.orig/debian/d-i/modules/sata-modules +++ linux-2.6.24/debian/d-i/modules/sata-modules @@ -0,0 +1,18 @@ +ahci ? +ata_piix ? +# Required by sata_sis +pata_sis ? +pdc_adma ? +sata_inic162x ? +sata_mv ? +sata_nv ? +sata_promise ? +sata_qstor ? +sata_sil ? +sata_sil24 ? +sata_sis ? +sata_svw ? +sata_sx4 ? +sata_uli ? +sata_via ? +sata_vsc ? --- linux-2.6.24.orig/debian/d-i/modules/usb-modules +++ linux-2.6.24/debian/d-i/modules/usb-modules @@ -0,0 +1,5 @@ +ehci-hcd ? +ohci-hcd ? +sl811-hcd ? +uhci-hcd ? +usbserial ? --- linux-2.6.24.orig/debian/d-i/modules/crypto-modules +++ linux-2.6.24/debian/d-i/modules/crypto-modules @@ -0,0 +1,9 @@ +aes_generic +blowfish +twofish +serpent +sha256_generic +cbc ? +ebc ? +crc32c ? +libcrc32c ? --- linux-2.6.24.orig/debian/d-i/modules/scsi-modules +++ linux-2.6.24/debian/d-i/modules/scsi-modules @@ -0,0 +1,113 @@ +# SCSI +raid_class ? +scsi_transport_spi ? +scsi_transport_fc ? +scsi_transport_iscsi ? +scsi_transport_sas ? +iscsi_tcp ? +libiscsi ? +amiga7xx ? +a3000 ? +a2091 ? +gvp11 ? +mvme147 ? +sgiwd93 ? +cyberstorm ? +cyberstormII ? +blz2060 ? +blz1230 ? +fastlane ? +oktagon_esp_mod ? +atari_scsi ? +mac_scsi ? +mac_esp ? +sun3_scsi ? +mvme16x ? +bvme6000 ? +sim710 ? +advansys ? +psi240i ? +BusLogic ? +dpt_i2o ? +u14-34f ? +ultrastor ? +aha152x ? +aha1542 ? +aha1740 ? +aic7xxx_old ? +ips ? +fd_mcs ? +fdomain ? +in2000 ? +g_NCR5380 ? +g_NCR5380_mmio ? +NCR53c406a ? +NCR_D700 ? +NCR_Q720_mod ? +sym53c416 ? +qlogicfas408 ? +qla1280 ? +pas16 ? +seagate ? +seagate ? +t128 ? +dmx3191d ? +dtc ? +zalon7xx ? +eata_pio ? +wd7000 ? +mca_53c9x ? +ibmmca ? +eata ? +dc395x ? +tmscsim ? +megaraid ? +atp870u ? +esp ? +gdth ? +initio ? +a100u2w ? +qlogicpti ? +ide-scsi ? +mesh ? +mac53c94 ? +pluto ? +dec_esp ? +3w-xxxx ? +3w-9xxx ? +ppa ? +imm ? +jazz_esp ? +sun3x_esp ? +fcal ? +lasi700 ? +nsp32 ? +ipr ? +hptiop ? +stex ? +osst ? +sg ? +ch ? +scsi_debug ? +aacraid ? +aic7xxx ? +aic79xx ? +aic94xx ? +arcmsr ? +acornscsi_mod ? +arxescsi ? +cumana_1 ? +cumana_2 ? +ecoscsi ? +oak ? +powertec ? +eesox ? +ibmvscsic ? +libsas ? +lpfc ? +megaraid_mm ? +megaraid_mbox ? +megaraid_sas ? +qla2xxx ? +sym53c8xx ? +qla4xxx ? --- linux-2.6.24.orig/debian/d-i/modules/fat-modules +++ linux-2.6.24/debian/d-i/modules/fat-modules @@ -0,0 +1,8 @@ +# Windows filesystems ? +fat ? +vfat ? + +# Supporting modules ? +nls_cp437 ? +nls_iso8859-1 ? +nls_utf8 ? --- linux-2.6.24.orig/debian/d-i/modules/acpi-modules +++ linux-2.6.24/debian/d-i/modules/acpi-modules @@ -0,0 +1,2 @@ +fan ? +thermal ? --- linux-2.6.24.orig/debian/d-i/modules/storage-core-modules +++ linux-2.6.24/debian/d-i/modules/storage-core-modules @@ -0,0 +1,48 @@ +# For SATA and PATA +libata ? + +# For SCSI (and for ATA and USB) +scsi_mod ? + +# IDE Core support +ide-core ? + +# USB Core for usb-storage ? +usbcore ? + +## Block level modules for each bus type ? + +# Generic cdrom support ? +cdrom ? + +# PS3 storage lib +ps3stor_lib ? +# PS3 Optical Storage +ps3rom ? + +# Anything that wants cdrom support will want isofs too +isofs ? + +# IDE Block devices ? +ide-cd ? +ide-disk ? +ide-floppy ? +ide-tape ? + +# SCSI Block devices ? +sd_mod ? +sr_mod ? +st ? + +# USB Storage modull ? +usb-storage ? + +# Loop modules (loop is built-in on sparc64) +loop ? +cloop ? + +# virtio modules +virtio ? +virtio_ring ? +virtio_pci ? +virtio_blk ? --- linux-2.6.24.orig/debian/d-i/modules/pcmcia-storage-modules +++ linux-2.6.24/debian/d-i/modules/pcmcia-storage-modules @@ -0,0 +1,6 @@ +pata_pcmcia ? +qlogic_cs ? +fdomain_cs ? +aha152x_cs ? +nsp_cs ? +sym53c500_cs ? --- linux-2.6.24.orig/debian/d-i/modules/firewire-core-modules +++ linux-2.6.24/debian/d-i/modules/firewire-core-modules @@ -0,0 +1,4 @@ +ieee1394 ? +ohci1394 ? +sbp2 ? +eth1394 ? --- linux-2.6.24.orig/debian/d-i/modules/irda-modules +++ linux-2.6.24/debian/d-i/modules/irda-modules @@ -0,0 +1,26 @@ +act200l-sir ? +actisys-sir ? +ali-ircc ? +donauboe ? +esi-sir ? +girbil-sir ? +ircomm ? +ircomm-tty ? +irda ? +irda-usb ? +irlan ? +irnet ? +irport ? +irtty-sir ? +litelink-sir ? +ma600-sir ? +mcp2120-sir ? +nsc-ircc ? +old_belkin-sir ? +sir-dev ? +smsc-ircc2 ? +stir4200 ? +tekram-sir ? +via-ircc ? +vlsi_ir ? +w83977af_ir ? --- linux-2.6.24.orig/debian/d-i/modules/socket-modules +++ linux-2.6.24/debian/d-i/modules/socket-modules @@ -0,0 +1 @@ +af_packet ? --- linux-2.6.24.orig/debian/d-i/modules/block-modules +++ linux-2.6.24/debian/d-i/modules/block-modules @@ -0,0 +1,33 @@ +cryptoloop ? +DAC960 ? +aoe ? +cciss ? +cpqarray ? +nbd ? +bpck6 ? +aten ? +bpck ? +comm ? +dstr ? +epat ? +epia ? +fit2 ? +fit3 ? +friq ? +frpw ? +kbic ? +ktti ? +on20 ? +on26 ? +paride ? +pcd ? +pd ? +pf ? +pg ? +pt ? +pktcdvd ? +ps3disk ? +sunvdc ? +sx8 ? +umem ? +xd ? --- linux-2.6.24.orig/debian/d-i/modules/floppy-modules +++ linux-2.6.24/debian/d-i/modules/floppy-modules @@ -0,0 +1 @@ +floppy ? --- linux-2.6.24.orig/debian/d-i/modules/plip-modules +++ linux-2.6.24/debian/d-i/modules/plip-modules @@ -0,0 +1 @@ +plip ? --- linux-2.6.24.orig/debian/d-i/modules/ppp-modules +++ linux-2.6.24/debian/d-i/modules/ppp-modules @@ -0,0 +1,6 @@ +ppp_async ? +ppp_deflate ? +ppp_mppe ? +pppoe ? +pppox ? +ppp_synctty ? --- linux-2.6.24.orig/debian/d-i/modules/speakup-modules +++ linux-2.6.24/debian/d-i/modules/speakup-modules @@ -0,0 +1,16 @@ +speakup_keyhelp ? +speakupmain ? +speakup_acntpc ? +speakup_acntsa ? +speakup_apollo ? +speakup_audptr ? +speakup_bns ? +speakup_decext ? +speakup_decpc ? +speakup_dectlk ? +speakup_dtlk ? +speakup_keypc ? +speakup_ltlk ? +speakup_sftsyn ? +speakup_spkout ? +speakup_txprt ? --- linux-2.6.24.orig/debian/d-i/modules/fs-core-modules +++ linux-2.6.24/debian/d-i/modules/fs-core-modules @@ -0,0 +1,5 @@ +ext2 ? +ext3 ? +jfs ? +reiserfs ? +xfs ? --- linux-2.6.24.orig/debian/d-i/modules/input-modules +++ linux-2.6.24/debian/d-i/modules/input-modules @@ -0,0 +1,12 @@ +atkbd ? +evdev ? +hil_kbd ? +hilkbd ? +hil_mlc ? +hp_sdc ? +hp_sdc_mlc ? +i8042 ? +mousedev ? +psmouse ? +usbhid ? +usbkbd ? --- linux-2.6.24.orig/debian/d-i/modules/message-modules +++ linux-2.6.24/debian/d-i/modules/message-modules @@ -0,0 +1,13 @@ +mptbase ? +mptctl ? +mptfc ? +mptlan ? +mptsas ? +mptscsih ? +mptspi ? +i2o_block ? +i2o_bus ? +i2o_config ? +i2o_core ? +i2o_proc ? +i2o_scsi ? --- linux-2.6.24.orig/debian/d-i/modules/ipv6-modules +++ linux-2.6.24/debian/d-i/modules/ipv6-modules @@ -0,0 +1 @@ +ipv6 ? --- linux-2.6.24.orig/debian/d-i/modules/serial-modules +++ linux-2.6.24/debian/d-i/modules/serial-modules @@ -0,0 +1,3 @@ +generic_serial ? +serial_cs ? +synclink_cs ? --- linux-2.6.24.orig/debian/d-i/modules/nic-usb-modules +++ linux-2.6.24/debian/d-i/modules/nic-usb-modules @@ -0,0 +1,11 @@ +catc ? +kaweth ? +pegasus ? +prism2_usb ? +rtl8150 ? +usbnet ? +zd1211rw ? +zd1201 ? +rt2500usb ? +rt73usb ? +rt2570 ? --- linux-2.6.24.orig/debian/d-i/modules/nfs-modules +++ linux-2.6.24/debian/d-i/modules/nfs-modules @@ -0,0 +1,3 @@ +nfs ? +lockd ? +sunrpc ? --- linux-2.6.24.orig/debian/d-i/modules/md-modules +++ linux-2.6.24/debian/d-i/modules/md-modules @@ -0,0 +1,17 @@ +dm-crypt ? +dm-emc ? +dm-mirror ? +dm-mod ? +dm-multipath ? +dm-round-robin ? +dm-snapshot ? +dm-zero ? +faulty ? +linear ? +md-mod ? +multipath ? +raid0 ? +raid10 ? +raid1 ? +raid456 ? +xor ? --- linux-2.6.24.orig/debian/d-i/modules/nic-shared-modules +++ linux-2.6.24/debian/d-i/modules/nic-shared-modules @@ -0,0 +1,23 @@ +# PHY +8390 ? +mii ? + +# CRC modules ? +crc-ccitt ? +crc-itu-t ? + +# mac80211 stuff ? +mac80211 ? +rc80211_simple ? +cfg80211 ? + +# rt2x00 lib ? +rt2x00lib ? + +# Wireless 802.11 modules ? +ieee80211 ? +ieee80211_crypt ? +ieee80211_crypt_ccmp ? +ieee80211_crypt_tkip ? +ieee80211_crypt_wep ? +ieee80211softmac ? --- linux-2.6.24.orig/debian/d-i/modules/nic-modules +++ linux-2.6.24/debian/d-i/modules/nic-modules @@ -0,0 +1,147 @@ +3c359 ? +3c501 ? +3c503 ? +3c505 ? +3c507 ? +3c509 ? +3c515 ? +3c523 ? +3c527 ? +3c59x ? +8139cp ? +8139too ? +82596 ? +abyss ? +ac3200 ? +adm8211 ? +airo ? +airport ? +amd8111e ? +arc4 ? +arcnet ? +arc-rawmode ? +arc-rimi ? +arlan ? +at1700 ? +atl1 ? +atmel ? +atmel_pci ? +b44 ? +bcm43xx ? +bcm43xx-mac80211 ? +bmac ? +bnx2 ? +bonding ? +cassini ? +com20020 ? +com20020-pci ? +com90io ? +com90xx ? +cs89x0 ? +de2104x ? +de4x5 ? +de600 ? +de620 ? +defxx ? +depca ? +dl2k ? +dmfe ? +dummy ? +e100 ? +e1000 ? +e1000e ? +e2100 ? +eepro ? +eepro100 ? +eexpress ? +epic100 ? +eql ? +es3210 ? +eth16i ? +ewrk3 ? +fealnx ? +forcedeth ? +ps3_gelic ? +hamachi ? +hermes ? +hp ? +hp100 ? +hp-plus ? +ibmtr ? +ipddp ? +ipw2100 ? +ipw2200 ? +ipw3945 ? +ixgb ? +lance ? +lanstreamer ? +lasi_82596 ? +lne390 ? +lp486e ? +mace ? +mv643xx_eth ? +myri_sbus ? +natsemi ? +ne ? +ne2 ? +ne2k-pci ? +ne3210 ? +netconsole ? +ni5010 ? +ni52 ? +ni65 ? +niu ? +ns83820 ? +olympic ? +orinoco ? +orinoco_pci ? +orinoco_plx ? +orinoco_tmd ? +pcnet32 ? +prism54 ? +r8169 ? +rate_control ? +rfc1051 ? +rfc1201 ? +rrunner ? +rt2400 ? +rt2500 ? +rt61pci ? +s2io ? +shaper ? +sis190 ? +sis900 ? +spidernet ? +skfp ? +skge ? +sk98lin ? +sky2 ? +smc9194 ? +smc-ultra ? +smc-ultra32 ? +starfire ? +strip ? +sunbmac ? +sundance ? +sungem ? +sungem_phy ? +sunhme ? +sunlance ? +sunqe ? +sunvnet ? +tg3 ? +tlan ? +tms380tr ? +tmspci ? +tulip ? +tun ? +typhoon ? +uli526x ? +via-rhine ? +via-velocity ? +virtio_net ? +wavelan ? +wd ? +winbond-840 ? +yellowfin ? +znet ? --- linux-2.6.24.orig/debian/d-i/modules/pcmcia-modules +++ linux-2.6.24/debian/d-i/modules/pcmcia-modules @@ -0,0 +1,8 @@ +i82092 ? +i82365 ? +pcmcia ? +pcmcia_core ? +pd6729 ? +rsrc_nonstatic ? +tcic ? +yenta_socket ? --- linux-2.6.24.orig/debian/d-i/modules/parport-modules +++ linux-2.6.24/debian/d-i/modules/parport-modules @@ -0,0 +1,3 @@ +parport ? +parport_pc ? +parport_sunbpp ? --- linux-2.6.24.orig/debian/d-i/modules/fs-secondary-modules +++ linux-2.6.24/debian/d-i/modules/fs-secondary-modules @@ -0,0 +1,13 @@ +# Windows filesystems; fuse is needed for ntfs-3g. +fuse ? +ntfs ? + +# UFS (Unix SysV) +ufs ? + +# Mac HFS +hfs ? +hfsplus ? + +# Amiga fs ? +affs ? --- linux-2.6.24.orig/debian/commit-templates/external-driver +++ linux-2.6.24/debian/commit-templates/external-driver @@ -0,0 +1,19 @@ +# Ubuntu external driver commit. +# +# NOTE: This gets reformatted for README.Ubuntu-External-Drivers and +# debian/changelog. +# +# This is only needed when a driver is added, updated or removed. It is +# not needed when patches or fixes are applied to the driver. If the +# driver is being removed, add the line: +# +# Removing: yes +# +# to the commit, and you can remove all other tags (except UBUNTU:). +# +UBUNTU: +ExternalDriver: +Description: +Url: +Mask: +Version: --- linux-2.6.24.orig/debian/commit-templates/update-configs +++ linux-2.6.24/debian/commit-templates/update-configs @@ -0,0 +1,9 @@ +UBUNTU: Put your _meaningful_ one line commit message here. +# +# This template is used for commit messages that don't need to +# show up in debian/changelog. Administrative stuff like config +# updates, ABI bumps, etc. Setting 'Ignore: yes' prevents +# 'debian/rules insertchanges' from inserting this commit meesage +# as a changelog entry. +# +Ignore: yes --- linux-2.6.24.orig/debian/commit-templates/bumpabi +++ linux-2.6.24/debian/commit-templates/bumpabi @@ -0,0 +1,2 @@ +UBUNTU: Bump ABI +Ignore: yes --- linux-2.6.24.orig/debian/commit-templates/newrelease +++ linux-2.6.24/debian/commit-templates/newrelease @@ -0,0 +1,2 @@ +UBUNTU: Start new release +Ignore: yes --- linux-2.6.24.orig/debian/commit-templates/sauce-patch +++ linux-2.6.24/debian/commit-templates/sauce-patch @@ -0,0 +1,37 @@ +# Ubuntu commit template. +# +# NOTE: This gets reformatted for debian/changelog +# +# +# SAUCE refers to the fact that this patch might not go upstream, but we need to +# carry it to successive releases. In most cases you DONOT want to use this +# template. +# +# An example of a SAUCE patch is the ACPI DSDT-in-initramfs patch which has been +# refused upstream, but still provides useful functionality to users with broken +# BIOSes. +# +#------------------------------------------------------------------------- +# +# The initial UBUNTU is a flag that this is an Ubuntu commit. It will be +# referenced to the Author in the debian/changelog entry. +# +# The text following is the short message that will be placed in the +# changelog. Extra text on the following lines will be ignored, but left +# in the git commit. Lines with # will be ignored in the commit. +# +# OriginalAuthor allows for alternate attribution. +# +# OriginalLocation allows for a URL or description of where the patch came +# from. +# +# BugLink is a reference (url) to a Malone bug. +# +# Ignore: yes will keep this commit from showing up in the changelog. +# +UBUNTU: SAUCE: +# OriginalAuthor: +# OriginalLocation: +# BugLink: +# Ignore: yes +# Other text below here. --- linux-2.6.24.orig/debian/commit-templates/patch +++ linux-2.6.24/debian/commit-templates/patch @@ -0,0 +1,26 @@ +# Ubuntu commit template. +# +# NOTE: This gets reformatted for debian/changelog +# +# The initial UBUNTU is a flag that this is an Ubuntu commit. It will be +# referenced to the Author in the debian/changelog entry. +# +# The text following is the short message that will be placed in the +# changelog. Extra text on the following lines will be ignored, but left +# in the git commit. Lines with # will be ignored in the commit. +# +# OriginalAuthor allows for alternate attribution. +# +# OriginalLocation allows for a URL or description of where the patch came +# from. +# +# BugLink is a reference (url) to a Malone bug. +# +# Ignore: yes will keep this commit from showing up in the changelog. +# +UBUNTU: +# OriginalAuthor: +# OriginalLocation: +# BugLink: +# Ignore: yes +# Other text below here. --- linux-2.6.24.orig/debian/commit-templates/missing-modules +++ linux-2.6.24/debian/commit-templates/missing-modules @@ -0,0 +1,2 @@ +UBUNTU: build/modules: Add modules that have intentionally gone missing +Ignore: yes --- linux-2.6.24.orig/debian/rules.d/i386.mk +++ linux-2.6.24/debian/rules.d/i386.mk @@ -0,0 +1,21 @@ +build_arch = i386 +header_arch = x86_64 +asm_link = x86 +defconfig = defconfig +# +# Only build -386 and -generic for PPA. +# +flavours = 386 generic +flavours += server virtual +build_image = bzImage +kernel_file = arch/$(build_arch)/boot/bzImage +install_file = vmlinuz + +do_debug_image = true + +loader = grub + +# +# No custom binaries for the PPA build. +# +custom_flavours = rt xen openvz --- linux-2.6.24.orig/debian/rules.d/ia64.mk +++ linux-2.6.24/debian/rules.d/ia64.mk @@ -0,0 +1,11 @@ +build_arch = ia64 +header_arch = $(build_arch) +asm_link = $(build_arch) +defconfig = defconfig +flavours = itanium mckinley +build_image = vmlinux +kernel_file = $(build_image) +install_file = vmlinuz +compress_file = yes + +loader = elilo --- linux-2.6.24.orig/debian/rules.d/2-binary-arch.mk +++ linux-2.6.24/debian/rules.d/2-binary-arch.mk @@ -0,0 +1,224 @@ +# We don't want make removing intermediary stamps +.SECONDARY : + +# Prepare the out-of-tree build directory + +prepare-%: $(stampdir)/stamp-prepare-% + @# Empty for make to be happy +$(stampdir)/stamp-prepare-%: target_flavour = $* +$(stampdir)/stamp-prepare-%: $(confdir)/config $(confdir)/config.% + @echo "Preparing $*..." + install -d $(builddir)/build-$* + touch $(builddir)/build-$*/ubuntu-build + cat $^ | sed -e 's/.*CONFIG_VERSION_SIGNATURE.*/CONFIG_VERSION_SIGNATURE="Ubuntu $(release)-$(revision)-$*"/' > $(builddir)/build-$*/.config + find $(builddir)/build-$* -name "*.ko" | xargs rm -f + $(kmake) O=$(builddir)/build-$* silentoldconfig prepare scripts + touch $@ + + +# Do the actual build, including image and modules +build-%: $(stampdir)/stamp-build-% + @# Empty for make to be happy +$(stampdir)/stamp-build-%: target_flavour = $* +$(stampdir)/stamp-build-%: $(stampdir)/stamp-prepare-% + @echo "Building $*..." + $(kmake) O=$(builddir)/build-$* $(conc_level) $(build_image) + $(kmake) O=$(builddir)/build-$* $(conc_level) modules + @touch $@ + +# Install the finished build +install-%: pkgdir = $(CURDIR)/debian/linux-image-$(release)$(debnum)-$* +install-%: dbgpkgdir = $(CURDIR)/debian/linux-image-debug-$(release)$(debnum)-$* +install-%: basepkg = linux-headers-$(release)$(debnum) +install-%: hdrdir = $(CURDIR)/debian/$(basepkg)-$*/usr/src/$(basepkg)-$* +install-%: target_flavour = $* +install-%: $(stampdir)/stamp-build-% checks-% + dh_testdir + dh_testroot + dh_clean -k -plinux-image-$(release)$(debnum)-$* + dh_clean -k -plinux-headers-$(release)$(debnum)-$* + dh_clean -k -plinux-image-debug-$(release)$(debnum)-$* + + # The main image +ifeq ($(compress_file),) + install -m644 -D $(builddir)/build-$*/$(kernel_file) \ + $(pkgdir)/boot/$(install_file)-$(release)$(debnum)-$* +else + install -d $(pkgdir)/boot/ + gzip -c9v $(builddir)/build-$*/$(kernel_file) > \ + $(pkgdir)/boot/$(install_file)-$(release)$(debnum)-$* + chmod 644 $(pkgdir)/boot/$(install_file)-$(release)$(debnum)-$* +endif + install -m644 $(builddir)/build-$*/.config \ + $(pkgdir)/boot/config-$(release)$(debnum)-$* + install -m644 $(abidir)/$* \ + $(pkgdir)/boot/abi-$(release)$(debnum)-$* + install -m644 $(builddir)/build-$*/System.map \ + $(pkgdir)/boot/System.map-$(release)$(debnum)-$* + $(kmake) O=$(builddir)/build-$* modules_install \ + INSTALL_MOD_PATH=$(pkgdir)/ + rm -f $(pkgdir)/lib/modules/$(release)$(debnum)-$*/build + rm -f $(pkgdir)/lib/modules/$(release)$(debnum)-$*/source +ifeq ($(no_image_strip),) + find $(pkgdir)/ -name \*.ko -print | xargs strip --strip-debug +endif + # Some initramfs-tools specific modules + install -d $(pkgdir)/lib/modules/$(release)$(debnum)-$*/initrd + if [ -f $(pkgdir)/lib/modules/$(release)$(debnum)-$*/kernel/drivers/video/vesafb.ko ]; then\ + ln -f $(pkgdir)/lib/modules/$(release)$(debnum)-$*/kernel/drivers/video/vesafb.ko \ + $(pkgdir)/lib/modules/$(release)$(debnum)-$*/initrd/; \ + fi + + # Now the image scripts + install -d $(pkgdir)/DEBIAN + for script in postinst postrm preinst prerm; do \ + sed -e 's/=V/$(release)$(debnum)-$*/g' -e 's/=K/$(install_file)/g' \ + -e 's/=L/$(loader)/g' -e 's@=B@$(build_arch)@g' \ + debian/control-scripts/$$script > $(pkgdir)/DEBIAN/$$script; \ + chmod 755 $(pkgdir)/DEBIAN/$$script; \ + done + + # Debug image is simple +ifneq ($(do_debug_image),) + install -m644 -D $(builddir)/build-$*/vmlinux \ + $(dbgpkgdir)//boot/vmlinux-debug-$(release)$(debnum)-$* +endif + + # The flavour specific headers image + # XXX Would be nice if we didn't have to dupe the original builddir + install -m644 -D $(builddir)/build-$*/.config \ + $(hdrdir)/.config + $(kmake) O=$(hdrdir) silentoldconfig prepare scripts + # We'll symlink this stuff + rm -f $(hdrdir)/Makefile + rm -rf $(hdrdir)/include2 + # Script to symlink everything up + $(SHELL) debian/scripts/link-headers "$(hdrdir)" "$(basepkg)" \ + "" "$(build_arch)" "$*" + # Setup the proper asm symlink + rm -f $(hdrdir)/include/asm + ln -s asm-$(asm_link) $(hdrdir)/include/asm + # The build symlink + install -d debian/$(basepkg)-$*/lib/modules/$(release)$(debnum)-$* + ln -s /usr/src/$(basepkg)-$* \ + debian/$(basepkg)-$*/lib/modules/$(release)$(debnum)-$*/build + # And finally the symvers + install -m644 $(builddir)/build-$*/Module.symvers \ + $(hdrdir)/Module.symvers + + # Now the header scripts + install -d $(CURDIR)/debian/$(basepkg)-$*/DEBIAN + for script in postinst; do \ + sed -e 's/=V/$(release)$(debnum)-$*/g' -e 's/=K/$(install_file)/g' \ + debian/control-scripts/headers-$$script > \ + $(CURDIR)/debian/$(basepkg)-$*/DEBIAN/$$script; \ + chmod 755 $(CURDIR)/debian/$(basepkg)-$*/DEBIAN/$$script; \ + done + + # At the end of the package prep, call the tests + DPKG_ARCH="$(arch)" KERN_ARCH="$(build_arch)" FLAVOUR="$*" \ + VERSION="$(release)$(debnum)" REVISION="$(revision)" \ + PREV_REVISION="$(prev_revision)" ABI_NUM="$(abinum)" \ + PREV_ABI_NUM="$(prev_abinum)" BUILD_DIR="$(builddir)/build-$*" \ + INSTALL_DIR="$(pkgdir)" SOURCE_DIR="$(CURDIR)" \ + run-parts -v debian/tests + + +headers_tmp := $(CURDIR)/debian/tmp-headers +headers_dir := $(CURDIR)/debian/linux-libc-dev + +hmake := $(MAKE) -C $(CURDIR) O=$(headers_tmp) SUBLEVEL=$(SUBLEVEL) \ + EXTRAVERSION=$(debnum) INSTALL_HDR_PATH=$(headers_tmp)/install \ + SHELL="$(SHELL)" + +install-arch-headers: + dh_testdir + dh_testroot + dh_clean -k -plinux-libc-dev + + rm -rf $(headers_tmp) + install -d $(headers_tmp) $(headers_dir)/usr/include/ + + $(hmake) ARCH=$(header_arch) $(defconfig) + mv $(headers_tmp)/.config $(headers_tmp)/.config.old + sed -e 's/^# \(CONFIG_MODVERSIONS\) is not set$$/\1=y/' \ + -e 's/.*CONFIG_LOCALVERSION_AUTO.*/# CONFIG_LOCALVERSION_AUTO is not set/' \ + $(headers_tmp)/.config.old > $(headers_tmp)/.config + $(hmake) ARCH=$(header_arch) silentoldconfig + $(hmake) ARCH=$(header_arch) headers_install + + mv $(headers_tmp)/install/include/asm* \ + $(headers_dir)/usr/include/ + mv $(headers_tmp)/install/include/linux \ + $(headers_dir)/usr/include/ + + rm -rf $(headers_tmp) + +binary-arch-headers: install-arch-headers + dh_testdir + dh_testroot + + dh_installchangelogs -plinux-libc-dev + dh_installdocs -plinux-libc-dev + dh_compress -plinux-libc-dev + dh_fixperms -plinux-libc-dev + dh_installdeb -plinux-libc-dev + dh_gencontrol -plinux-libc-dev + dh_md5sums -plinux-libc-dev + dh_builddeb -plinux-libc-dev + +binary-%: pkgimg = linux-image-$(release)$(debnum)-$* +binary-%: pkghdr = linux-headers-$(release)$(debnum)-$* +binary-%: dbgpkg = linux-image-debug-$(release)$(debnum)-$* +binary-%: install-% + dh_testdir + dh_testroot + + dh_installchangelogs -p$(pkgimg) + dh_installdocs -p$(pkgimg) + dh_compress -p$(pkgimg) + dh_fixperms -p$(pkgimg) + dh_installdeb -p$(pkgimg) + dh_gencontrol -p$(pkgimg) + dh_md5sums -p$(pkgimg) + dh_builddeb -p$(pkgimg) -- -Zbzip2 -z9 + + dh_installchangelogs -p$(pkghdr) + dh_installdocs -p$(pkghdr) + dh_compress -p$(pkghdr) + dh_fixperms -p$(pkghdr) + dh_shlibdeps -p$(pkghdr) + dh_installdeb -p$(pkghdr) + dh_gencontrol -p$(pkghdr) + dh_md5sums -p$(pkghdr) + dh_builddeb -p$(pkghdr) + +ifneq ($(do_debug_image),) + dh_installchangelogs -p$(dbgpkg) + dh_installdocs -p$(dbgpkg) + dh_compress -p$(dbgpkg) + dh_fixperms -p$(dbgpkg) + dh_installdeb -p$(dbgpkg) + dh_gencontrol -p$(dbgpkg) + dh_md5sums -p$(dbgpkg) + dh_builddeb -p$(dbgpkg) +endif + +$(stampdir)/stamp-flavours: + @echo $(flavours) $(custom_flavours) > $@ + +binary-debs: $(stampdir)/stamp-flavours $(addprefix binary-,$(flavours)) \ + binary-arch-headers + +build-debs: $(addprefix build-,$(flavours)) + +build-arch-deps = build-debs +build-arch-deps += build-custom + +build-arch: $(build-arch-deps) + +binary-arch-deps = binary-debs +binary-arch-deps += binary-custom +binary-arch-deps += binary-udebs + +binary-arch: $(binary-arch-deps) --- linux-2.6.24.orig/debian/rules.d/0-common-vars.mk +++ linux-2.6.24/debian/rules.d/0-common-vars.mk @@ -0,0 +1,120 @@ +# Rip some version information from our changelog +release := $(shell sed -n '1s/^.*(\(.*\)-.*).*$$/\1/p' debian/changelog) +revisions := $(shell sed -n 's/^linux\ .*($(release)-\(.*\)).*$$/\1/p' debian/changelog | tac) +revision ?= $(word $(words $(revisions)),$(revisions)) +prev_revisions := $(filter-out $(revision),0.0 $(revisions)) +prev_revision := $(word $(words $(prev_revisions)),$(prev_revisions)) + +# This is an internally used mechanism for the daily kernel builds. It +# creates packages who's ABI is suffixed with a minimal representation of +# the current git HEAD sha. If .git/HEAD is not present, then it uses the +# uuidgen program, +# +# AUTOBUILD can also be used by anyone wanting to build a custom kernel +# image, or rebuild the entire set of Ubuntu packages using custom patches +# or configs. +ppa_file := $(CURDIR)/ppa_build_sha +is_ppa_build := $(shell if [ -f $(ppa_file) ] ; then echo yes; fi;) +ifndef AUTOBUILD +AUTOBUILD := $(is_ppa_build) +endif + +# +# This is a way to support some external variables. A good example is +# a local setup for ccache and distcc See LOCAL_ENV_CC and +# LOCAL_ENV_DISTCC_HOSTS in the definition of kmake. +# For example: +# LOCAL_ENV_CC="ccache distcc" +# LOCAL_ENV_DISTCC_HOSTS="localhost 10.0.2.5 10.0.2.221" +# +local_env_file := $(CURDIR)/../.hardy-env +have_local_env := $(shell if [ -f $(local_env_file) ] ; then echo yes; fi;) +ifneq ($(have_local_env),) +include $(local_env_file) +endif + +# +# Set this variable to 'true' in the arch makefile in order to +# avoid building udebs for the debian installer. see lpia.mk as +# an example of an architecture specific override. +# +disable_d_i = no + +export AUTOBUILD +ifeq ($(AUTOBUILD),) +abi_suffix = +else +skipabi = true +skipmodule = true +gitver=$(shell if test -f .git/HEAD; then cat .git/HEAD; else uuidgen; fi) +gitverpre=$(shell echo $(gitver) | cut -b -3) +gitverpost=$(shell echo $(gitver) | cut -b 38-40) +abi_suffix = -$(gitverpre)$(gitverpost) +endif + +ifeq ($(prev_revision),0.0) +skipabi = true +skipmodule = true +endif + +ifneq ($(NOKERNLOG),) +ubuntu_log_opts += --no-kern-log +endif +ifneq ($(PRINTSHAS),) +ubuntu_log_opts += --print-shas +endif + +abinum := $(shell echo $(revision) | sed -e 's/\..*//')$(abisuffix) +prev_abinum := $(shell echo $(prev_revision) | sed -e 's/\..*//')$(abisuffix) +debnum := -$(abinum) + +# We force the sublevel to be exactly what we want. The actual source may +# be an in development git tree. We want to force it here instead of +# committing changes to the top level Makefile +SUBLEVEL := $(shell echo $(release) | awk -F. '{print $$3}') + +export abinum debnum version + +arch := $(shell dpkg-architecture -qDEB_HOST_ARCH) +abidir := $(CURDIR)/debian/abi/$(release)-$(revision)/$(arch) +prev_abidir := $(CURDIR)/debian/abi/$(release)-$(prev_revision)/$(arch) +confdir := $(CURDIR)/debian/config/$(arch) +builddir := $(CURDIR)/debian/build +stampdir := $(CURDIR)/debian/stamps + +# Support parallel= in DEB_BUILD_OPTIONS (see #209008) +COMMA=, +ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) + CONCURRENCY_LEVEL := $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) +endif + +ifeq ($(CONCURRENCY_LEVEL),) + # Check the environment + CONCURRENCY_LEVEL := $(shell echo $$CONCURRENCY_LEVEL) + # No? Check if this is on a buildd + ifeq ($(CONCURRENCY_LEVEL),) + ifeq ($(wildcard /CurrentlyBuilding),) + CONCURRENCY_LEVEL := $(shell expr `getconf _NPROCESSORS_ONLN` \* 2) + endif + endif + # Default to hogging them all (and then some) + ifeq ($(CONCURRENCY_LEVEL),) + CONCURRENCY_LEVEL := $(shell expr `getconf _NPROCESSORS_ONLN` \* 2) + endif +endif + +conc_level = -j$(CONCURRENCY_LEVEL) + +# target_flavour is filled in for each step +kmake = make ARCH=$(build_arch) EXTRAVERSION=$(debnum)-$(target_flavour) +kmake += SUBLEVEL=$(SUBLEVEL) +ifneq ($(LOCAL_ENV_CC),) +kmake += CC=$(LOCAL_ENV_CC) DISTCC_HOSTS=$(LOCAL_ENV_DISTCC_HOSTS) +endif + +all_custom_flavours = lpia rt lpiacompat xen openvz + +# Checks if a var is overriden by the custom rules. Called with var and +# flavour as arguments. +custom_override = \ + $(shell if [ -n "$($(1)_$(2))" ]; then echo "$($(1)_$(2))"; else echo "$($(1))"; fi) --- linux-2.6.24.orig/debian/rules.d/1-maintainer.mk +++ linux-2.6.24/debian/rules.d/1-maintainer.mk @@ -0,0 +1,108 @@ +# The following targets are for the maintainer only! do no run if you don't +# know what they do. + +.PHONY: printenv updateconfigs printchanges insertchanges startnewrelease diffupstream help + +help: + @echo "These are the targets in addition to the normal debian ones:" + @echo + @echo " printenv : Print some variables used in the build" + @echo + @echo " updateconfigs : Update debian/config/*" + @echo + @echo " editconfigs : Update debian/config/* interactively" + @echo + @echo " printchanges : Print the current changelog entries (from git)" + @echo + @echo " insertchanges : Insert current changelog entries (from git)" + @echo + @echo " startnewrelease : Start a new changelog set" + @echo + @echo " diffupstream : Diff stock kernel code against upstream (git)" + @echo + @echo " prepare-ppa : Prepare a PPA source upload" + @echo + @echo " help : If you are kernel hacking, you need the professional" + @echo " version of this" + @echo + @echo "Environment variables:" + @echo + @echo " NOKERNLOG : Do not add upstream kernel commits to changelog" + @echo " CONCURRENCY_LEVEL=X" + @echo " : Use -jX for kernel compile" + @echo " PRINTSHAS : Include SHAs for commits in changelog" + +ARCH_CONFIGS=i386 amd64 ia64 hppa powerpc sparc + +updateconfigs: + dh_testdir + @for arch in $(ARCH_CONFIGS); do \ + $(SHELL) debian/scripts/misc/oldconfig $$arch; \ + done + rm -rf build + +editconfigs: + dh_testdir + @for arch in $(ARCH_CONFIGS); do \ + $(SHELL) debian/scripts/misc/doconfig $$arch; \ + done + rm -rf build + +printenv: + dh_testdir + @echo "release = $(release)" + @echo "revisions = $(revisions)" + @echo "revision = $(revision)" + @echo "prev_revisions = $(prev_revisions)" + @echo "prev_revision = $(prev_revision)" + @echo "debnum = $(debnum)" + @echo "abinum = $(abinum)" + @echo "gitver = $(gitver)" + @echo "flavours = $(flavours)" + @echo "custom_flavours = $(custom_flavours)" +ifneq ($(SUBLEVEL),) + @echo "SUBLEVEL = $(SUBLEVEL)" +endif + @echo "CONCURRENCY_LEVEL = $(CONCURRENCY_LEVEL)" + +printchanges: + @git log Ubuntu-$(release)-$(prev_revision)..HEAD | \ + perl -w -f debian/scripts/misc/git-ubuntu-log $(ubuntu_log_opts) + +insertchanges: + @perl -w -f debian/scripts/misc/validate-patch-range Ubuntu-$(release)-$(prev_revision) HEAD + @perl -w -f debian/scripts/misc/insert-changes.pl + +diffupstream: + @git-diff-tree -p refs/remotes/linux-2.6/master..HEAD $(shell ls | grep -vE '^(ubuntu|debian|\.git.*)') + +startnewrelease: + dh_testdir + @nextminor=$(shell expr `echo $(revision) | awk -F. '{print $$2}'` + 1); \ + user=$(shell whoami); \ + memyselfandirene="$$(getent passwd $$user | cut -d ":" -f 5 | cut -d "," -f 1)"; \ + now="$(shell date -R)"; \ + echo "Creating new changelog set for $(release)-$(abinum).$$nextminor..."; \ + echo -e "linux ($(release)-$(abinum).$$nextminor) UNRELEASED; urgency=low\n" > debian/changelog.new; \ + echo " CHANGELOG: Do not edit directly. Autogenerated at release." >> \ + debian/changelog.new; \ + echo " CHANGELOG: Use the printchanges target to see the curent changes." \ + >> debian/changelog.new; \ + echo " CHANGELOG: Use the insertchanges target to create the final log." \ + >> debian/changelog.new; \ + echo -e "\n -- $$memyselfandirene <$$user@ubuntu.com> $$now\n" >> \ + debian/changelog.new ; \ + cat debian/changelog >> debian/changelog.new; \ + mv debian/changelog.new debian/changelog + +# +# If $(ppa_file) exists, then only the standard flavours are built for PPA, e.g., +# 386, 386-generic, and amd64-generic. +# +prepare-ppa: + @echo Execute debian/scripts/misc/prepare-ppa-source to prepare an upload + @echo for a PPA build. You must do this outside of debian/rules since it cannot + @echo nest. + +print-ppa-file-name: + @echo $(ppa_file) --- linux-2.6.24.orig/debian/rules.d/hppa.mk +++ linux-2.6.24/debian/rules.d/hppa.mk @@ -0,0 +1,12 @@ +build_arch = parisc +header_arch = $(build_arch) +asm_link = $(build_arch) +defconfig = defconfig +flavours = hppa32 hppa64 +build_image = vmlinux +kernel_file = $(build_image) +install_file = $(build_image) + +no_image_strip = true + +loader = palo --- linux-2.6.24.orig/debian/rules.d/lpia.mk +++ linux-2.6.24/debian/rules.d/lpia.mk @@ -0,0 +1,21 @@ +build_arch = i386 +header_arch = i386 +asm_link = x86 +defconfig = defconfig +flavours = +build_image = bzImage +kernel_file = arch/$(build_arch)/boot/bzImage +install_file = vmlinuz + +do_debug_image = true + +loader = grub + +#custom_flavours = lpiacompat lpia +custom_flavours = lpia lpiacompat + +# +# Set this variable to 'true' in order to +# avoid building udebs for the debian installer. +# +disable_d_i = true --- linux-2.6.24.orig/debian/rules.d/powerpc.mk +++ linux-2.6.24/debian/rules.d/powerpc.mk @@ -0,0 +1,12 @@ +build_arch = powerpc +header_arch = $(build_arch) +asm_link = $(build_arch) +defconfig = pmac32_defconfig +flavours = powerpc powerpc-smp powerpc64-smp +build_image = vmlinux +kernel_file = $(build_image) +install_file = $(build_image) + +loader = yaboot + +custom_flavours = --- linux-2.6.24.orig/debian/rules.d/5-udebs.mk +++ linux-2.6.24/debian/rules.d/5-udebs.mk @@ -0,0 +1,31 @@ +do-binary-udebs: + dh_testdir + dh_testroot + + # unpack the kernels into a temporary directory + mkdir -p debian/d-i-${arch} + + imagelist=$$(cat kernel-versions | grep ^${arch} | awk '{print $$4}') && \ + for i in $$imagelist; do \ + dpkg -x $$(ls ../linux-image-$$i\_*${arch}.deb) \ + debian/d-i-${arch}; \ + done + + touch ignore-dups + export SOURCEDIR=debian/d-i-${arch} && \ + kernel-wedge install-files && \ + kernel-wedge check + + # Build just the udebs + dilist=$$(dh_listpackages -s | grep "\-di$$") && \ + [ -z "$dilist" ] || \ + for i in $$dilist; do \ + dh_fixperms -p$$i; \ + dh_gencontrol -p$$i; \ + dh_builddeb -p$$i; \ + done + +binary-udebs: binary-debs binary-custom debian/control + if [ "$(disable_d_i)" != "true" ]; then \ + debian/rules do-binary-udebs; \ + fi --- linux-2.6.24.orig/debian/rules.d/3-binary-indep.mk +++ linux-2.6.24/debian/rules.d/3-binary-indep.mk @@ -0,0 +1,81 @@ +build-indep: + +docpkg = linux-doc-$(release) +docdir = $(CURDIR)/debian/$(docpkg)/usr/share/doc/$(docpkg) +install-doc: + dh_testdir + dh_testroot + dh_clean -k -p$(docpkg) + + # First the html docs + install -d $(docdir)/linux-doc-tmp + $(kmake) O=$(docdir)/linux-doc-tmp htmldocs + mv $(docdir)/linux-doc-tmp/Documentation/DocBook \ + $(docdir)/html + rm -rf $(docdir)/linux-doc-tmp + + # Copy the rest + cp -a Documentation $(docdir) + rm -rf $(docdir)/DocBook + +srcpkg = linux-source-$(release) +srcdir = $(CURDIR)/debian/$(srcpkg)/usr/src/$(srcpkg) +install-source: + dh_testdir + dh_testroot + dh_clean -k -p$(srcpkg) + + install -d $(srcdir) + find . -path './debian/*' -prune -o \ + -path './.*' -prune -o -print | \ + cpio -pd --preserve-modification-time $(srcdir) + (cd $(srcdir)/..; tar cf - $(srcpkg)) | bzip2 -9c > \ + $(srcdir).tar.bz2 + rm -rf $(srcdir) + +indep_hdrpkg = linux-headers-$(release)$(debnum) +indep_hdrdir = $(CURDIR)/debian/$(indep_hdrpkg)/usr/src/$(indep_hdrpkg) +install-headers: + dh_testdir + dh_testroot + dh_clean -k -p$(indep_hdrpkg) + + install -d $(indep_hdrdir) + find . -path './debian/*' -prune -o -path './include/*' -prune \ + -o -path './scripts/*' -prune -o -type f \ + \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \ + -name '*.sh' -o -name '*.pl' -o -name '*.lds' \) \ + -print | cpio -pd --preserve-modification-time $(indep_hdrdir) + # Copy headers for LUM + cp -a drivers/media/dvb/dvb-core/*.h $(indep_hdrdir)/drivers/media/dvb/dvb-core + cp -a drivers/media/video/*.h $(indep_hdrdir)/drivers/media/video + cp -a drivers/media/dvb/dvb-core/*.h $(indep_hdrdir)/drivers/media/dvb/dvb-core + cp -a drivers/media/dvb/frontends/*.h $(indep_hdrdir)/drivers/media/dvb/frontends + cp -a scripts include $(indep_hdrdir) + +install-indep: install-source install-headers install-doc + +binary-headers: install-headers + dh_testdir + dh_testroot + dh_installchangelogs -p$(indep_hdrpkg) + dh_installdocs -p$(indep_hdrpkg) + dh_compress -p$(indep_hdrpkg) + dh_fixperms -p$(indep_hdrpkg) + dh_installdeb -p$(indep_hdrpkg) + dh_gencontrol -p$(indep_hdrpkg) + dh_md5sums -p$(indep_hdrpkg) + dh_builddeb -p$(indep_hdrpkg) + +binary-indep: install-indep + dh_testdir + dh_testroot + + dh_installchangelogs -i + dh_installdocs -i + dh_compress -i + dh_fixperms -i + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i --- linux-2.6.24.orig/debian/rules.d/6-binary-custom.mk +++ linux-2.6.24/debian/rules.d/6-binary-custom.mk @@ -0,0 +1,134 @@ +# This could be somewhere else, but we stub this file so that the include +# in debian/rules doesn't have an empty list. +binary-custom: $(addprefix custom-binary-,$(custom_flavours)) +build-custom: $(addprefix custom-build-,$(custom_flavours)) + +# Custom targets can dep on these targets to help things along. They can +# also override it with a :: target for addition processing. +custom-prepare-%: $(stampdir)/stamp-custom-prepare-% + @# Empty for make to be happy +$(stampdir)/stamp-custom-prepare-%: target_flavour = $* +$(stampdir)/stamp-custom-prepare-%: origsrc = $(builddir)/custom-source-$* +$(stampdir)/stamp-custom-prepare-%: srcdir = $(builddir)/custom-build-$* +$(stampdir)/stamp-custom-prepare-%: debian/binary-custom.d/%/config.$(arch) \ + debian/binary-custom.d/%/patchset + @echo "Preparing custom $*..." + rm -rf $(origsrc) + install -d $(origsrc) + install -d $(srcdir) + touch $(srcdir)/ubuntu-build + find . \( -path ./debian -o -path ./.git -o -name .gitignore \) \ + -prune -o -print | cpio -dumpl $(origsrc) + for patch in `ls debian/binary-custom.d/$*/patchset/*.patch | sort`; do \ + echo $$patch; \ + patch -p1 -d $(origsrc) < $$patch ;\ + done + cat $< | sed -e 's/.*CONFIG_VERSION_SIGNATURE.*/CONFIG_VERSION_SIGNATURE="Ubuntu $(release)-$(revision)-$*"/' > $(srcdir)/.config + + $(kmake) -C $(origsrc) O=$(srcdir) silentoldconfig prepare scripts + touch $@ + +custom-build-%: $(stampdir)/stamp-custom-build-% + @# Empty for make to be happy +$(stampdir)/stamp-custom-build-%: target_flavour = $* +$(stampdir)/stamp-custom-build-%: origsrc = $(builddir)/custom-source-$* +$(stampdir)/stamp-custom-build-%: srcdir = $(builddir)/custom-build-$* +$(stampdir)/stamp-custom-build-%: bimage = $(call custom_override,build_image,$*) +$(stampdir)/stamp-custom-build-%: $(stampdir)/stamp-custom-prepare-% + @echo "Building custom $*..." + $(kmake) -C $(origsrc) O=$(srcdir) $(conc_level) + $(kmake) -C $(origsrc) O=$(srcdir) $(conc_level) modules + @touch $@ + +custom-install-%: pkgdir = $(CURDIR)/debian/linux-image-$(release)$(debnum)-$* +custom-install-%: basepkg = linux-headers-$(release)$(debnum) +custom-install-%: hdrdir = $(CURDIR)/debian/$(basepkg)-$*/usr/src/$(basepkg)-$* +custom-install-%: target_flavour = $* +custom-install-%: origsrc = $(builddir)/custom-source-$* +custom-install-%: srcdir = $(builddir)/custom-build-$* +custom-install-%: kfile = $(call custom_override,kernel_file,$*) +custom-install-%: $(stampdir)/stamp-custom-build-% + dh_testdir + dh_testroot + dh_clean -k -plinux-image-$(release)$(debnum)-$* + dh_clean -k -plinux-headers-$(release)$(debnum)-$* + + # The main image + # xen doesnt put stuff in the same directory. its quirky that way + if [ $(target_flavour) == "xen" ]; then \ + install -m644 -D $(srcdir)/arch/x86/boot/vmlinuz $(pkgdir)/boot/$(install_file)-$(release)$(debnum)-$* ; \ + else \ + install -m644 -D $(srcdir)/$(kfile) $(pkgdir)/boot/$(install_file)-$(release)$(debnum)-$* ; \ + fi + + install -m644 $(srcdir)/.config \ + $(pkgdir)/boot/config-$(release)$(debnum)-$* + install -m644 $(srcdir)/System.map \ + $(pkgdir)/boot/System.map-$(release)$(debnum)-$* + $(kmake) -C $(origsrc) O=$(srcdir) modules_install \ + INSTALL_MOD_PATH=$(pkgdir)/ + rm -f $(pkgdir)/lib/modules/$(release)$(debnum)-$*/build + rm -f $(pkgdir)/lib/modules/$(release)$(debnum)-$*/source +ifeq ($(no_image_strip),) + find $(pkgdir)/ -name \*.ko -print | xargs strip --strip-debug +endif + # Some initramfs-tools specific modules + install -d $(pkgdir)/lib/modules/$(release)$(debnum)-$*/initrd + #ln -f $(pkgdir)/lib/modules/$(release)$(debnum)-$*/kernel/security/capability.ko \ + # $(pkgdir)/lib/modules/$(release)$(debnum)-$*/initrd/ + + # Now the image scripts + install -d $(pkgdir)/DEBIAN + for script in postinst postrm preinst prerm; do \ + sed -e 's/=V/$(release)$(debnum)-$*/g' -e 's/=K/$(install_file)/g' \ + -e 's/=L/$(loader)/g' -e 's@=B@$(build_arch)@g' \ + debian/control-scripts/$$script > $(pkgdir)/DEBIAN/$$script; \ + chmod 755 $(pkgdir)/DEBIAN/$$script; \ + done + + # The flavour specific headers image + # XXX Would be nice if we didn't have to dupe the original builddir + install -m644 -D $(srcdir)/.config \ + $(hdrdir)/.config + $(kmake) -C $(origsrc) O=$(hdrdir) silentoldconfig prepare scripts + # We'll symlink this stuff + rm -f $(hdrdir)/Makefile + rm -rf $(hdrdir)/include2 + # Script to symlink everything up + $(SHELL) debian/scripts/link-headers "$(hdrdir)" "$(basepkg)" \ + "$(origsrc)" "$(build_arch)" "$*" + # Setup the proper asm symlink + rm -f $(hdrdir)/include/asm + ln -s asm-$(asm_link) $(hdrdir)/include/asm + # The build symlink + install -d debian/$(basepkg)-$*/lib/modules/$(release)$(debnum)-$* + ln -s /usr/src/$(basepkg)-$* \ + debian/$(basepkg)-$*/lib/modules/$(release)$(debnum)-$*/build + # And finally the symvers + install -m644 $(srcdir)/Module.symvers \ + $(hdrdir)/Module.symvers + +custom-binary-%: pkgimg = linux-image-$(release)$(debnum)-$* +custom-binary-%: pkghdr = linux-headers-$(release)$(debnum)-$* +custom-binary-%: custom-install-% + dh_testdir + dh_testroot + + dh_installchangelogs -p$(pkgimg) + dh_installdocs -p$(pkgimg) + dh_compress -p$(pkgimg) + dh_fixperms -p$(pkgimg) + dh_installdeb -p$(pkgimg) + dh_gencontrol -p$(pkgimg) + dh_md5sums -p$(pkgimg) + dh_builddeb -p$(pkgimg) -- -Zbzip2 -z9 + + dh_installchangelogs -p$(pkghdr) + dh_installdocs -p$(pkghdr) + dh_compress -p$(pkghdr) + dh_fixperms -p$(pkghdr) + dh_shlibdeps -p$(pkghdr) + dh_installdeb -p$(pkghdr) + dh_gencontrol -p$(pkghdr) + dh_md5sums -p$(pkghdr) + dh_builddeb -p$(pkghdr) --- linux-2.6.24.orig/debian/rules.d/sparc.mk +++ linux-2.6.24/debian/rules.d/sparc.mk @@ -0,0 +1,11 @@ +build_arch = sparc64 +header_arch = $(build_arch) +asm_link = $(build_arch) +defconfig = defconfig +flavours = sparc64 sparc64-smp +build_image = image +kernel_file = arch/$(build_arch)/boot/image +install_file = vmlinuz +compress_file = Yes + +loader = silo --- linux-2.6.24.orig/debian/rules.d/amd64.mk +++ linux-2.6.24/debian/rules.d/amd64.mk @@ -0,0 +1,18 @@ +build_arch = x86_64 +header_arch = $(build_arch) +asm_link = x86 +defconfig = defconfig +flavours = generic +flavours += server +build_image = bzImage +kernel_file = arch/$(build_arch)/boot/bzImage +install_file = vmlinuz + +do_debug_image = true + +loader = grub + +# +# No custom binaries for the PPA build. +# +custom_flavours = rt xen openvz --- linux-2.6.24.orig/debian/rules.d/4-checks.mk +++ linux-2.6.24/debian/rules.d/4-checks.mk @@ -0,0 +1,26 @@ +# Check ABI for package against last release (if not same abinum) +abi-%: $(abidir)/% + @# Empty for make to be happy +$(abidir)/%: $(stampdir)/stamp-build-% + install -d $(abidir) + sed -e 's/^\(.\+\)[[:space:]]\+\(.\+\)[[:space:]]\(.\+\)$$/\3 \2 \1/' \ + $(builddir)/build-$*/Module.symvers | sort > $@ + +abi-check-%: $(abidir)/% + @$(SHELL) debian/scripts/abi-check "$*" "$(prev_abinum)" "$(abinum)" \ + "$(prev_abidir)" "$(abidir)" "$(skipabi)" + +# Check the module list against the last release (always) +module-%: $(abidir)/%.modules + @# Empty for make to be happy +$(abidir)/%.modules: $(stampdir)/stamp-build-% + install -d $(abidir) + find $(builddir)/build-$*/ -name \*.ko | \ + sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > $@ + +module-check-%: $(abidir)/%.modules + @perl -f debian/scripts/module-check "$*" \ + "$(prev_abidir)" "$(abidir)" $(skipmodule) + +checks-%: abi-check-% module-check-% + @# Will be calling more stuff later --- linux-2.6.24.orig/debian/control-scripts/postrm +++ linux-2.6.24/debian/control-scripts/postrm @@ -0,0 +1,376 @@ +#! /usr/bin/perl +# -*- Mode: Cperl -*- +# image.postrm --- +# Author : Manoj Srivastava ( srivasta@glaurung.green-gryphon.com ) +# Created On : Sat May 15 11:05:13 1999 +# Created On Node : glaurung.green-gryphon.com +# Last Modified By : Manoj Srivastava +# Last Modified On : Wed Sep 13 11:26:19 2006 +# Last Machine Used: glaurung.internal.golden-gryphon.com +# Update Count : 57 +# Status : Unknown, Use with caution! +# HISTORY : +# Description : +# +# $Id: image.postrm,v 1.31 2003/10/07 16:24:20 srivasta Exp $ +# + + +# +#use strict; #for debugging +use Cwd 'abs_path'; + +$|=1; + +# Predefined values: +my $version = "=V"; +my $link_in_boot = ""; # Should be empty, mostly +my $no_symlink = ""; # Should be empty, mostly +my $reverse_symlink = ""; # Should be empty, mostly +my $do_symlink = "Yes"; # target machine defined +my $do_boot_enable = "Yes"; # target machine defined +my $do_bootfloppy = "Yes"; # target machine defined +my $do_bootloader = "Yes"; # target machine defined +my $move_image = ''; # target machine defined +my $kimage = "=K"; # Should be empty, mostly +my $loader = "=L"; # lilo, silo, quik, palo, vmelilo, or nettrom +my $image_dir = "/boot"; # where the image is located +my $clobber_modules = ''; # target machine defined +my $initrd = "YES"; # initrd kernel +my $do_initrd = ''; # Normally, we don't +my $warn_initrd = 'YES'; # Normally we do +my $use_hard_links = ''; # hardlinks do not work across fs boundaries +my $postinst_hook = ''; #Normally we do not +my $postrm_hook = ''; #Normally we do not +my $preinst_hook = ''; #Normally we do not +my $prerm_hook = ''; #Normally we do not +my $minimal_swap = ''; # Do not swap symlinks +my $ignore_depmod_err = ''; # normally we do not +my $relink_build_link = 'YES'; # There is no harm in checking the link +my $force_build_link = ''; # we shall not create a dangling link +my $kernel_arch = "=B"; +my $ramdisk = "/usr/sbin/update-initramfs"; +my $package_name = "linux-image-$version"; + +my $Loader = "NoLOADER"; # +$Loader = "LILO" if $loader =~ /^lilo/io; +$Loader = "SILO" if $loader =~ /^silo/io; +$Loader = "QUIK" if $loader =~ /^quik/io; +$Loader = "yaboot" if $loader =~ /^yaboot/io; +$Loader = "PALO" if $loader =~ /^palo/io; +$Loader = "NETTROM" if $loader =~ /^nettrom/io; +$Loader = "VMELILO" if $loader =~ /^vmelilo/io; +$Loader = "ZIPL" if $loader =~ /^zipl/io; +$Loader = "ELILO" if $loader =~ /^elilo/io; + + +# This should not point to /tmp, because of security risks. +my $temp_file_name = "/var/log/$loader" . "_log.$$"; + +#known variables +my @boilerplate = (); +my @silotemplate = (); +my @quiktemplate = (); +my @palotemplate = (); +my @vmelilotemplate = (); +my $bootdevice = ''; +my $rootdevice = ''; +my $rootdisk = ''; +my $rootpartition = ''; +my $image_dest = "/"; +my $realimageloc = "/$image_dir/"; +my $have_conffile = ""; +my $CONF_LOC = '/etc/kernel-img.conf'; +my $relative_links = ''; +my $silent_modules = ''; +my $silent_loader = ''; +my $warn_reboot = 'Yes'; # Warn that we are installing a version of + # the kernel we are running + +chdir('/') or die "could not chdir to /:$!\n"; +# remove multiple leading slashes; make sure there is at least one. +$realimageloc =~ s|^/*|/|o; +$realimageloc =~ s|/+|/|o; + + +if (-r "$CONF_LOC" && -f "$CONF_LOC" ) { + if (open(CONF, "$CONF_LOC")) { + while () { + chomp; + s/\#.*$//g; + next if /^\s*$/; + + $do_symlink = "" if /^\s*do_symlinks\s*=\s*(no|false|0)\s*$/ig; + $no_symlink = "" if /^\s*no_symlinks\s*=\s*(no|false|0)\s*$/ig; + $reverse_symlink = "" if /^\s*reverse_symlinks\s*=\s*(no|false|0)\s*$/ig; + $link_in_boot = "" if /^\s*image_in_boot\s*=\s*(no|false|0)\s*$/ig; + $link_in_boot = "" if /^\s*link_in_boot\s*=\s*(no|false|0)\s*$/ig; + $move_image = "" if /^\s*move_image\s*=\s*(no|false|0)\s*$/ig; + $clobber_modules = '' if /^\s*clobber_modules\s*=\s*(no|false|0)\s*$/ig; + $do_boot_enable = '' if /^\s*do_boot_enable\s*=\s*(no|false|0)\s*$/ig; + $do_bootfloppy = '' if /^\s*do_bootfloppy\s*=\s*(no|false|0)\s*$/ig; + $relative_links = '' if /^\s*relative_links \s*=\s*(no|false|0)\s*$/ig; + $do_bootloader = '' if /^\s*do_bootloader\s*=\s*(no|false|0)\s*$/ig; + $do_initrd = '' if /^\s*do_initrd\s*=\s*(no|false|0)\s*$/ig; + $warn_initrd = '' if /^\s*warn_initrd\s*=\s*(no|false|0)\s*$/ig; + $use_hard_links = '' if /^\s*use_hard_links\s*=\s*(no|false|0)\s*$/ig; + $silent_modules = '' if /^\s*silent_modules\s*=\s*(no|false|0)\s*$/ig; + $silent_loader = '' if /^\s*silent_loader\s*=\s*(no|false|0)\s*$/ig; + $warn_reboot = '' if /^\s*warn_reboot\s*=\s*(no|false|0)\s*$/ig; + $minimal_swap = '' if /^\s*minimal_swap\s*=\s*(no|false|0)\s*$/ig; + $ignore_depmod_err = '' if /^\s*ignore_depmod_err\s*=\s*(no|false|0)\s*$/ig; + $relink_build_link = '' if /^\s*relink_build_link\s*=\s*(no|false|0)\s*$/ig; + $force_build_link = '' if /^\s*force_build_link\s*=\s*(no|false|0)\s*$/ig; + + $do_symlink = "Yes" if /^\s*do_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $no_symlink = "Yes" if /^\s*no_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $reverse_symlink = "Yes" if /^\s*reverse_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $link_in_boot = "Yes" if /^\s*image_in_boot\s*=\s*(yes|true|1)\s*$/ig; + $link_in_boot = "Yes" if /^\s*link_in_boot\s*=\s*(yes|true|1)\s*$/ig; + $move_image = "Yes" if /^\s*move_image\s*=\s*(yes|true|1)\s*$/ig; + $clobber_modules = "Yes" if /^\s*clobber_modules\s*=\s*(yes|true|1)\s*$/ig; + $do_boot_enable = "Yes" if /^\s*do_boot_enable\s*=\s*(yes|true|1)\s*$/ig; + $do_bootfloppy = "Yes" if /^\s*do_bootfloppy\s*=\s*(yes|true|1)\s*$/ig; + $do_bootloader = "Yes" if /^\s*do_bootloader\s*=\s*(yes|true|1)\s*$/ig; + $relative_links = "Yes" if /^\s*relative_links\s*=\s*(yes|true|1)\s*$/ig; + $do_initrd = "Yes" if /^\s*do_initrd\s*=\s*(yes|true|1)\s*$/ig; + $warn_initrd = "Yes" if /^\s*warn_initrd\s*=\s*(yes|true|1)\s*$/ig; + $use_hard_links = "Yes" if /^\s*use_hard_links\s*=\s*(yes|true|1)\s*$/ig; + $silent_modules = 'Yes' if /^\s*silent_modules\s*=\s*(yes|true|1)\s*$/ig; + $silent_loader = 'Yes' if /^\s*silent_loader\s*=\s*(yes|true|1)\s*$/ig; + $warn_reboot = 'Yes' if /^\s*warn_reboot\s*=\s*(yes|true|1)\s*$/ig; + $minimal_swap = 'Yes' if /^\s*minimal_swap\s*=\s*(yes|true|1)\s*$/ig; + $ignore_depmod_err = 'Yes' if /^\s*ignore_depmod_err\s*=\s*(yes|true|1)\s*$/ig; + $relink_build_link = 'Yes' if /^\s*relink_build_link\s*=\s*(yes|true|1)\s*$/ig; + $force_build_link = 'Yes' if /^\s*force_build_link\s*=\s*(yes|true|1)\s*$/ig; + + $image_dest = "$1" if /^\s*image_dest\s*=\s*(\S+)/ig; + $postinst_hook = "$1" if /^\s*postinst_hook\s*=\s*(\S+)/ig; + $postrm_hook = "$1" if /^\s*postrm_hook\s*=\s*(\S+)/ig; + $preinst_hook = "$1" if /^\s*preinst_hook\s*=\s*(\S+)/ig; + $prerm_hook = "$1" if /^\s*prerm_hook\s*=\s*(\S+)/ig; + $ramdisk = "$1" if /^\s*ramdisk\s*=\s*(.+)$/ig; + } + close CONF; + $have_conffile = "Yes"; + } +} + +if ($link_in_boot) { + $image_dest = "/$image_dir/"; + $image_dest =~ s|^/*|/|o; +} + +$image_dest = "$image_dest/"; +$image_dest =~ s|/+$|/|o; + +# The destdir may be gone by now. +if (-d "$image_dest") { + chdir("$image_dest") or die "could not chdir to $image_dest:$!\n"; +} + +# Paranoid check to make sure that the correct value is put in there +if (! $kimage) {$kimage = "vmlinuz"} # Hmm. empty +elsif ($kimage =~ m/^b?zImage$/o) {$kimage = "vmlinuz"} # these produce vmlinuz +elsif ($kimage =~ m/^[iI]mage$/o) { my $nop = $kimage;} +elsif ($kimage =~ m/^vmlinux$/o) { my $nop = $kimage;} +else {$kimage = "vmlinuz"} # default + +$ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch; + + +###################################################################### +###################################################################### +############ +###################################################################### +###################################################################### +sub remove_sym_link { + my $bad_image = $_[0]; + + warn "Removing symbolic link $bad_image \n"; + if ($loader =~ /lilo/i) + { + warn "Unless you used the optional flag in lilo, \n"; + } + warn " you may need to re-run your boot loader" . ($loader ? "[$loader]":"") + . "\n"; + # Remove the dangling link + unlink "$bad_image"; +} + +###################################################################### +###################################################################### +############ +###################################################################### +###################################################################### +sub CanonicalizePath { + my $path = join '/', @_; + my @work = split '/', $path; + my @out; + my $is_absolute; + + if (@work && $work[0] eq "") { $is_absolute = 1; shift @work; } + + while (@work) { + my $seg = shift @work; + if ($seg eq "." || $seg eq "") { + } elsif ($seg eq "..") { + if (@out && $out[-1] ne "..") { + pop @out; + } else { + # Leading "..", or "../..", etc. + push @out, $seg; + } + } else { + push @out, $seg; + } + } + + unshift @out, "" if $is_absolute; + return join('/', @out); +} + +###################################################################### +###################################################################### +############ +###################################################################### +###################################################################### +# This removes dangling symlinks. What do we do about hard links? Surely a +# something with the nane $image_dest . "$kimage" ought not to be left behind? +sub image_magic { + my $kimage = $_[0]; + my $image_dest = $_[1]; + + if (-l "$kimage") { + # There is a symbolic link + my $force_move = 0; + my $vmlinuz_target = readlink "$kimage"; + my $real_target = ''; + $real_target = abs_path($vmlinuz_target) if defined ($vmlinuz_target); + if (!defined($vmlinuz_target) || ! -f "$real_target") { + # what, a dangling symlink? + warn "The link " . $image_dest . "$kimage is a damaged link\n"; + # Remove the dangling link + &remove_sym_link("$kimage"); + } + else { + my $canonical_target = CanonicalizePath("$vmlinuz_target"); + if (! -e $canonical_target) { + warn "The link " . $image_dest . "$kimage is a dangling link\n"; + &remove_sym_link("$kimage"); + } + } + } +} + +# set the env var stem +$ENV{'STEM'} = "linux"; + +sub exec_script { + my $type = shift; + my $script = shift; + print STDERR "Running $type hook script $script.\n"; + system ("$script $version $realimageloc$kimage-$version") && + print STDERR "User $type hook script [$script] "; + if ($?) { + if ($? == -1) { + print STDERR "failed to execute: $!\n"; + } + elsif ($? & 127) { + printf STDERR "died with signal %d, %s coredump\n", + ($? & 127), ($? & 128) ? 'with' : 'without'; + } + else { + printf STDERR "exited with value %d\n", $? >> 8; + } + } +} +sub run_hook { + my $type = shift; + my $script = shift; + if ($script =~ m,^/,) { + # Full path provided for the hook script + if (-x "$script") { + &exec_script($type,$script); + } + else { + warn "The provided $type hook script [$script] could not be run.\n"; + } + } + else { + # Look for it in a safe path + for my $path ('/bin', '/sbin', '/usr/bin', '/usr/sbin') { + if (-x "$path/$script") { + &exec_script($type, "$path/$script"); + return 0; + } + } + # No luck + print STDERR "Could not find $type hook script [$script].\n"; + warn "Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'\n"; + } +} + +## Run user hook script here, if any +if ($postrm_hook) { + &run_hook("postrm", $postrm_hook); +} +if (-d "/etc/kernel/postrm.d") { + warn "Examining /etc/kernel/postrm.d .\n"; + system ("run-parts --verbose --exit-on-error --arg=$version " . + "--arg=$realimageloc$kimage-$version " . + "/etc/kernel/postrm.d") && + die "Failed to process /etc/kernel/postrm.d"; +} +if (-d "/etc/kernel/postrm.d/$version") { + warn "Examining /etc/kernel/postrm.d/$version .\n"; + system ("run-parts --verbose --exit-on-error --arg=$version " . + "--arg=$realimageloc$kimage-$version " . + "/etc/kernel/postrm.d/$version") && + die "Failed to process /etc/kernel/postrm.d/$version"; +} + +# check and remove damaged and dangling symlinks +if ($ARGV[0] !~ /upgrade/) { + system("$ramdisk -d -k " . $version . " > /dev/null 2>&1"); + if (-f $realimageloc . "initrd.img-$version.bak") { + unlink $realimageloc . "initrd.img-$version.bak"; + } + image_magic($kimage, $image_dest); + image_magic($kimage . ".old", $image_dest); + image_magic("initrd.img", $image_dest) if $initrd; + image_magic("initrd.img.old", $image_dest) if $initrd; +} + + +# Ignore all invocations except when called on to purge. +exit 0 unless $ARGV[0] =~ /purge/; + +my @files_to_remove = qw{ + modules.dep modules.isapnpmap modules.pcimap + modules.usbmap modules.parportmap + modules.generic_string modules.ieee1394map + modules.ieee1394map modules.pnpbiosmap + modules.alias modules.ccwmap modules.inputmap + modules.symbols build source modules.ofmap + }; + +foreach my $extra_file (@files_to_remove) { + if (-f "/lib/modules/$version/$extra_file") { + unlink "/lib/modules/$version/$extra_file"; + } +} + +if (-d "/lib/modules/$version" ) { + system ("rmdir", "/lib/modules/$version"); +} + +exit 0; + +__END__ + + + + + + --- linux-2.6.24.orig/debian/control-scripts/postinst +++ linux-2.6.24/debian/control-scripts/postinst @@ -0,0 +1,1087 @@ +#! /usr/bin/perl +# OriginalAuthor : Manoj Srivastava ( srivasta@pilgrim.umass.edu ) +# +# Customized for Ubuntu by: Ben Collins + +#use strict; #for debugging +use Cwd 'abs_path'; + +$|=1; + +# Predefined values: +my $version = "=V"; +my $link_in_boot = ""; # Should be empty, mostly +my $no_symlink = ""; # Should be empty, mostly +my $reverse_symlink = ""; # Should be empty, mostly +my $do_symlink = "Yes"; # target machine defined +my $do_boot_enable = "Yes"; # target machine defined +my $do_bootfloppy = "Yes"; # target machine defined +my $do_bootloader = "Yes"; # target machine defined +my $move_image = ''; # target machine defined +my $kimage = "=K"; # Should be empty, mostly +my $loader = "=L"; # lilo, silo, quik, palo, vmelilo, nettrom, arcboot or delo +my $image_dir = "/boot"; # where the image is located +my $clobber_modules = ''; # target machine defined +my $relative_links = ""; # target machine defined +my $initrd = "YES"; # initrd kernel +my $do_initrd = ''; # Normally we do not +my $use_hard_links = ''; # hardlinks do not work across fs boundaries +my $postinst_hook = ''; #Normally we do not +my $postrm_hook = ''; #Normally we do not +my $preinst_hook = ''; #Normally we do not +my $prerm_hook = ''; #Normally we do not +my $minimal_swap = ''; # Do not swap symlinks +my $ignore_depmod_err = ''; # normally we do not +my $kernel_arch = "=B"; +my $ramdisk = "/usr/sbin/update-initramfs"; # List of tools to create initial ram fs. +my $notifier = "/usr/share/update-notifier/notify-reboot-required"; +my $package_name = "linux-image-$version"; +my $explicit_do_loader = 'Yes'; + +my $Loader = "NoLOADER"; # +$Loader = "LILO" if $loader =~ /^lilo/io; +$Loader = "SILO" if $loader =~ /^silo/io; +$Loader = "QUIK" if $loader =~ /^quik/io; +$Loader = "yaboot" if $loader =~ /^yaboot/io; +$Loader = "PALO" if $loader =~ /^palo/io; +$Loader = "NETTROM" if $loader =~ /^nettrom/io; +$Loader = "VMELILO" if $loader =~ /^vmelilo/io; +$Loader = "ZIPL" if $loader =~ /^zipl/io; +$Loader = "ELILO" if $loader =~ /^elilo/io; +$Loader = "ARCBOOT" if $loader =~ /^arcboot/io; +$Loader = "DELO" if $loader =~ /^delo/io; + +# This should not point to /tmp, because of security risks. +my $temp_file_name = "/var/log/$loader" . "_log.$$"; + +#known variables +my $image_dest = "/"; +my $realimageloc = "/$image_dir/"; +my $have_conffile = ""; +my $silent_modules = ''; +my $silent_loader = ''; +my $warn_reboot = 'Yes'; # Warn that we are installing a version of + # the kernel we are running + +my $modules_base = '/lib/modules'; +my $CONF_LOC = '/etc/kernel-img.conf'; + +# Ignore all invocations except when called on to configure. +exit 0 unless $ARGV[0] =~ /configure/; + +my $DEBUG = 0; + +# Do some preliminary sanity checks here to ensure we actually have an +# valid image dir +chdir('/') or die "could not chdir to /:$!\n"; +die "Internal Error: ($image_dir) is not a directory!\n" + unless -d $image_dir; + +# remove multiple leading slashes; make sure there is at least one. +$realimageloc =~ s|^/*|/|o; +$realimageloc =~ s|/+|/|o; +die "Internal Error: ($realimageloc) is not a directory!\n" + unless -d $realimageloc; + +if (-r "$CONF_LOC" && -f "$CONF_LOC" ) { + if (open(CONF, "$CONF_LOC")) { + while () { + chomp; + s/\#.*$//g; + next if /^\s*$/; + + $do_symlink = "" if /^\s*do_symlinks\s*=\s*(no|false|0)\s*$/ig; + $no_symlink = "" if /^\s*no_symlinks\s*=\s*(no|false|0)\s*$/ig; + $reverse_symlink = "" if /^\s*reverse_symlink\s*=\s*(no|false|0)\s*$/ig; + $link_in_boot = "" if /^\s*image_in_boot\s*=\s*(no|false|0)\s*$/ig; + $link_in_boot = "" if /^\s*link_in_boot\s*=\s*(no|false|0)\s*$/ig; + $move_image = "" if /^\s*move_image\s*=\s*(no|false|0)\s*$/ig; + $clobber_modules = '' if /^\s*clobber_modules\s*=\s*(no|false|0)\s*$/ig; + $do_boot_enable = '' if /^\s*do_boot_enable\s*=\s*(no|false|0)\s*$/ig; + $do_bootfloppy = '' if /^\s*do_bootfloppy\s*=\s*(no|false|0)\s*$/ig; + $relative_links = '' if /^\s*relative_links \s*=\s*(no|false|0)\s*$/ig; + $do_bootloader = '' if /^\s*do_bootloader\s*=\s*(no|false|0)\s*$/ig; + $explicit_do_loader = '' if /^\s*do_bootloader\s*=\s*(no|false|0)\s*$/ig; + $do_initrd = '' if /^\s*do_initrd\s*=\s*(no|false|0)\s*$/ig; + $use_hard_links = '' if /^\s*use_hard_links\s*=\s*(no|false|0)\s*$/ig; + $silent_modules = '' if /^\s*silent_modules\s*=\s*(no|false|0)\s*$/ig; + $silent_loader = '' if /^\s*silent_loader\s*=\s*(no|false|0)\s*$/ig; + $warn_reboot = '' if /^\s*warn_reboot\s*=\s*(no|false|0)\s*$/ig; + $minimal_swap = '' if /^\s*minimal_swap\s*=\s*(no|false|0)\s*$/ig; + $ignore_depmod_err = '' if /^\s*ignore_depmod_err\s*=\s*(no|false|0)\s*$/ig; + + $do_symlink = "Yes" if /^\s*do_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $no_symlink = "Yes" if /^\s*no_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $reverse_symlink = "Yes" if /^\s*reverse_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $link_in_boot = "Yes" if /^\s*image_in_boot\s*=\s*(yes|true|1)\s*$/ig; + $link_in_boot = "Yes" if /^\s*link_in_boot\s*=\s*(yes|true|1)\s*$/ig; + $move_image = "Yes" if /^\s*move_image\s*=\s*(yes|true|1)\s*$/ig; + $clobber_modules = "Yes" if /^\s*clobber_modules\s*=\s*(yes|true|1)\s*$/ig; + $do_boot_enable = "Yes" if /^\s*do_boot_enable\s*=\s*(yes|true|1)\s*$/ig; + $do_bootfloppy = "Yes" if /^\s*do_bootfloppy\s*=\s*(yes|true|1)\s*$/ig; + $do_bootloader = "Yes" if /^\s*do_bootloader\s*=\s*(yes|true|1)\s*$/ig; + $explicit_do_loader = "YES" if /^\s*do_bootloader\s*=\s*(yes|true|1)\s*$/ig; + $relative_links = "Yes" if /^\s*relative_links\s*=\s*(yes|true|1)\s*$/ig; + $do_initrd = "Yes" if /^\s*do_initrd\s*=\s*(yes|true|1)\s*$/ig; + $use_hard_links = "Yes" if /^\s*use_hard_links\s*=\s*(yes|true|1)\s*$/ig; + $silent_modules = 'Yes' if /^\s*silent_modules\s*=\s*(yes|true|1)\s*$/ig; + $silent_loader = 'Yes' if /^\s*silent_loader\s*=\s*(yes|true|1)\s*$/ig; + $warn_reboot = 'Yes' if /^\s*warn_reboot\s*=\s*(yes|true|1)\s*$/ig; + $minimal_swap = 'Yes' if /^\s*minimal_swap\s*=\s*(yes|true|1)\s*$/ig; + $ignore_depmod_err = 'Yes' if /^\s*ignore_depmod_err\s*=\s*(yes|true|1)\s*$/ig; + + $image_dest = "$1" if /^\s*image_dest\s*=\s*(\S+)/ig; + $postinst_hook = "$1" if /^\s*postinst_hook\s*=\s*(\S+)/ig; + $postrm_hook = "$1" if /^\s*postrm_hook\s*=\s*(\S+)/ig; + $preinst_hook = "$1" if /^\s*preinst_hook\s*=\s*(\S+)/ig; + $prerm_hook = "$1" if /^\s*prerm_hook\s*=\s*(\S+)/ig; + $ramdisk = "$1" if /^\s*ramdisk\s*=\s*(.+)$/ig; + } + close CONF; + $have_conffile = "Yes"; + } +} + + + +# For some versions of kernel-package, we had this warning in the +# postinst, but the rules did not really interpolate the value in. +# Here is a sanity check. +my $pattern = "=" . "I"; +$initrd=~ s/^$pattern$//; + +if ($link_in_boot) { + $image_dest = "/$image_dir/"; # same as realimageloc +} + +# Tack on at least one trainling / +$image_dest = "$image_dest/"; +$image_dest =~ s|^/*|/|o; +$image_dest =~ s|/+$|/|o; + +if (! -d "$image_dest") { + die "Expected Image Destination dir ($image_dest) to be a valid directory!\n"; +} + +# sanity +if (!($do_bootfloppy || $do_bootloader)) { + $do_boot_enable = ''; +} +if ($do_symlink && $no_symlink) { + warn "Both do_symlinks and no_symlinks options enabled; disabling no_symlinks\n"; + $no_symlink = 0; +} + +# most of our work is done in $image_dest (nominally /) +chdir("$image_dest") or die "could not chdir to $image_dest:$!\n"; + +# Paranoid check to make sure that the correct value is put in there +if (! $kimage) { $kimage = "vmlinuz"; } # Hmm. empty +elsif ($kimage =~ m/^b?zImage$/o) { $kimage = "vmlinuz"; } # these produce vmlinuz +elsif ($kimage =~ m/^[iI]mage$/o) { my $nop = $kimage; } +elsif ($kimage =~ m/^vmlinux$/o) { my $nop = $kimage; } +else { $kimage = "vmlinuz"; } # Default + +$ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch; + + +die "Internal Error: Could not find image (" . $realimageloc + . "$kimage-$version)\n" unless -e $realimageloc + . "$kimage-$version"; + +# search for the boot loader in the path +my $loader_exec; +($loader_exec = $loader) =~ s|.*/||; +my ($loaderloc) = grep -x, map "$_/$loader_exec", + map { length($_) ? $_ : "." } split /:/, $ENV{PATH}; + + +###################################################################### +###################################################################### +########### Test whether a relative symlinkwould be OK ####### +###################################################################### +###################################################################### +sub test_relative { + my %params = @_; + my $cwd; + + die "Internal Error: Missing Required paramater 'Old Dir' " + unless $params{'Old Dir'}; + die "Internal Error: Missing Required paramater New Dir' " + unless $params{'New Dir'}; + + + die "Internal Error: No such dir $params{'Old Dir'} " + unless -d $params{'Old Dir'}; + die "Internal Error: No such dir $params{'New Dir'} " + unless -d $params{'New Dir'}; + + warn "Test relative: testing $params{'Old Dir'} -> $params{'New Dir'}" + if $DEBUG; + chomp($cwd = `pwd`); + chdir ($params{'New Dir'}) or die "Could not chdir to $params{'New Dir'}:$!"; + my $ok = 0; + $params{'Old Dir'} =~ s|^/*||o; + if (-d $params{'Old Dir'} ) { + if (defined $params{'Test File'}) { + if (-e $params{'Old Dir'} . $params{'Test File'}) { + $ok = 1; + } + } else { + $ok = 1; # well, backward compatibility + } + } + chdir ($cwd) or die "Could not chdir to $params{'New Dir'}:$!"; + return $ok; +} + +###################################################################### +###################################################################### +############ +###################################################################### +###################################################################### +# sub CanonicalizePath { +# my $path = join '/', @_; +# my @work = split '/', $path; +# my @out; +# my $is_absolute; + +# if (@work && $work[0] eq "") { +# $is_absolute = 1; shift @work; +# } + +# while (@work) { +# my $seg = shift @work; +# if ($seg eq "." || $seg eq "") { +# } +# elsif ($seg eq "..") { +# if (@out && $out[-1] ne "..") { +# pop @out; +# } +# else { +# # Leading "..", or "../..", etc. +# push @out, $seg; +# } +# } +# else { +# push @out, $seg; +# } +# } + +# unshift @out, "" if $is_absolute; +# return join('/', @out); +# } +###################################################################### +###################################################################### +############ +###################################################################### +###################################################################### + +sub spath { + my %params = @_; + + die "Missing Required paramater 'Old'" unless $params{'Old'}; + die "Missing Required paramater 'New'" unless $params{'New'}; + + my @olddir = split '/', `readlink -q -m $params{'Old'}`; + my @newdir = split '/', `readlink -q -m $params{'New'}`; + my @outdir = @olddir; + + my $out = ''; + my $i; + for ($i = 0; $i <= $#olddir && $i <= $#newdir; $i++) { + $out++ if ($olddir[$i] ne $newdir[$i]); + shift @outdir unless $out; + unshift @outdir, ".." if $out; + } + if ($#newdir > $#olddir) { + for ($i=0; $i < $#newdir; $i++) { + unshift @outdir, ".."; + } + } + return join ('/', @outdir); +} +###################################################################### +###################################################################### +############ +###################################################################### +###################################################################### + + +# This routine actually moves the kernel image +# From: $realimageloc/$kimage-$version (/boot/vmlinuz-2.6.12) +# To: $image_dest/$kimage-$version (/vmlinuz-2.6.12) +# Note that the image is moved to a versioned destination, but ordinary +# symlinks we create otherwise are not normally versioned +sub really_move_image { + my $src_dir = $_[0]; + my $target = $_[1]; + my $dest_dir = $_[2]; + + warn "Really move image: src_dir=$src_dir, target=$target,\n destdir=$dest_dir" + if $DEBUG; + if (-e "$target") { + # we should be in dir $dest_dir == $image_dest /, normally + rename("$target", "$target.$$") || + die "failed to move " . $dest_dir . "$target:$!"; + warn "mv $target $target.$$" if $DEBUG; + } + warn "mv -f $src_dir$target $target" if $DEBUG; + my $ret = system("mv -f " . $src_dir . "$target " . + " $target"); + if ($ret) { + die("Failed to move " . $src_dir . "$target to " + . $dest_dir . "$target.\n"); + } + # Ok, now we may clobber the previous .old files + if (-e "$target.$$") { + rename("$target.$$", "$target.old") || + die "failed to move " . $dest_dir . "$target:$!"; + warn "mv $target.$$ $target " if $DEBUG; + } +} + +# Normally called after really_move_image; and only called if we asked for +# reversed link this routine reverses the symbolic link that is notmally +# created. Since the real kernel image has been moved over to +# $image_dest/$kimage-$version. So, this routine links +# From: $image_dest/$kimage-$version (/vmlinuz-2.6.12) +# To: $realimageloc/$kimage-$version (/boot/vmlinuz-2.6.12) +sub really_reverse_link { + my $src_dir = $_[0]; + my $link_name = $_[1]; + my $dest_dir = $_[2]; + warn "Really reverse link: src_dir=$src_dir, link name=$link_name\n" . + "\tdestdir=$dest_dir" if $DEBUG; + + my $Old = $dest_dir; + if (test_relative ('Old Dir' => $Old, 'New Dir' => $src_dir, + 'Test File' => "$link_name")) { + $Old =~ s|^/*||o; + } + # Special case is they are in the same dir + my $rel_path = spath('Old' => "$Old", 'New' => "$src_dir" ); + $Old ="" if $rel_path =~ m/^\s*$/o; + + if ($use_hard_links =~ m/YES/i) { + link($Old . "$link_name", $src_dir . "$link_name") || + die("Failed to symbolic-link " . $dest_dir . "$link_name to " . $src_dir + . "$link_name .\n"); + warn "ln " . $Old . "$link_name " . $src_dir . "$link_name" if $DEBUG; + } + else { + symlink($Old . "$link_name", $src_dir . "$link_name") || + die("Failed to link " . $dest_dir . "$link_name to " . $src_dir . + "$link_name .\n"); + warn "ln -s " . $Old . "$link_name " . $src_dir . "$link_name" if $DEBUG; + } +} + +# This routine is invoked if there is a symbolic link in place +# in $image_dest/$kimage -- so a symlink exists in the destination. +# What we are trying to determine is if we need to move the symbolic link over +# to the the .old location +sub move_p { + my $kimage = $_[0]; # Name of the symbolic link + my $image_dest = $_[1]; # The directory the links goes into + my $image_name = $_[2]; + my $src_dir = $_[3]; + my $force_move = 0; + warn "Move?: kimage=$kimage, image_dest=$image_dest, \n" . + "\timage_name=$image_name, src_dir=$src_dir" if $DEBUG; + + if ($no_symlink || $reverse_symlink) { + # we do not want links, yet we have a symbolic link here! + warn "found a symbolic link in " . $image_dest . "$kimage \n" . + "even though no_symlink is defined\n" if $no_symlink; + warn "found a symbolic link in " . $image_dest . "$kimage \n" . + "even though reverse_symlink is defined\n" if $reverse_symlink; + # make sure we change this state of affairs + $force_move = 1; + return $force_move; + } + + warn "DEBUG: OK. We found symlink, and we should have a symlink here.\n" + if $DEBUG; + my $vmlinuz_target = readlink "$kimage"; + my $real_target = ''; + my $target = `readlink -q -m "${realimageloc}${kimage-$version}"`; + $real_target = abs_path($vmlinuz_target) if defined($vmlinuz_target); + + if (!defined($vmlinuz_target) || ! -f "$real_target") { + # what, a dangling symlink? + warn "The link " . $image_dest . "$kimage is a dangling link" . + "to $real_target\n"; + $force_move = 1; + return $force_move; + } + + + warn "DEBUG: The link $kimage points to ($vmlinuz_target)\n" if $DEBUG; + warn "DEBUG: ($vmlinuz_target) is really ($real_target)\n" if $DEBUG; + my $cwd; + chomp ($cwd=`pwd`); + if ($vmlinuz_target !~ m|^/|o) { + $vmlinuz_target = $cwd . "/" . $vmlinuz_target; + $vmlinuz_target =~ s|/+|/|o; + } + $vmlinuz_target = `readlink -q -m $vmlinuz_target`; + + if ("$vmlinuz_target" ne "$target") { + warn "DEBUG: We need to handle this.\n" if $DEBUG; + if ($minimal_swap) { + warn "DEBUG: Minimal swap.\n" if $DEBUG; + if (-l "$kimage.old") { + warn "DEBUG: There is an old link at $kimage.old\n" if $DEBUG; + my $old_target = readlink "$kimage.old"; + my $real_old_target = ''; + $real_old_target=abs_path($old_target) if defined ($old_target); + + if ($real_old_target && -f "$real_old_target") { + if ($old_target !~ m|^/|o) { + $old_target = $cwd . "/" . $old_target; + $old_target =~ s|/+|/|o; + } + $old_target = `readlink -q -m $old_target`; + if ("$old_target" ne "$target") { + $force_move = 1; + warn "DEBUG: Old link ($old_target) does not point to us ($target)\n" + if $DEBUG; + } + else { # The .old points to the current + warn "$kimage.old --> $target -- doing nothing"; + $force_move = 0; + } + } + else { + warn "DEBUG: Well, the old link does not exist -- so we move\n" + if $DEBUG; + $force_move = 1; + } + } + else { + warn "DEBUG: No .old link -- OK to move\n" + if $DEBUG; + $force_move = 1; + } + } + else { + warn "DEBUG: ok, minimal swap is no-- so we move.\n" + if $DEBUG; + $force_move = 1; + } + } + else { # already have proper link + warn "$kimage($vmlinuz_target) points to $target ($real_target) -- doing nothing"; + $force_move = 0; + } + return $force_move; +} + + +# This routine moves the symbolic link around (/vmlinuz -> /vmlinuz.old) +# It pays attention to whether we should the fact whether we should be using +# hard links or not. +sub really_move_link { + my $kimage = $_[0]; # Name of the symbolic link + my $image_dest = $_[1]; # The directory the links goes into + my $image_name = $_[2]; + my $src_dir = $_[3]; + warn "really_move_link: kimage=$kimage, image_dest=$image_dest\n" . + "\t image_name=$image_name, src_dir=$src_dir" if $DEBUG; + + # don't clobber $kimage.old quite yet + rename("$kimage", "$kimage.$$") || + die "failed to move " . $image_dest . "$kimage:$!"; + warn "mv $kimage $kimage.$$" if $DEBUG; + my $Old = $src_dir; + my $cwd; + + chomp($cwd=`pwd`); + if (test_relative ('Old Dir' => $Old, 'New Dir' => $cwd, + 'Test File' => "$image_name")) { + $Old =~ s|^/*||o; + } + # Special case is they are in the same dir + my $rel_path = spath('Old' => "$Old", 'New' => "$cwd" ); + $Old ="" if $rel_path =~ m/^\s*$/o; + + if ($use_hard_links =~ m/YES/i) { + warn "ln ${Old}${image_name} $kimage" if $DEBUG; + if (! link("${Old}${image_name}", "$kimage")) { + rename("$kimage.$$", "$kimage"); + die("Failed to link ${Old}${image_name} to " . + "${image_dest}${kimage}.\n"); + } + } + else { + warn "ln -s ${Old}${image_name} $kimage" if $DEBUG; + if (! symlink("${Old}${image_name}", "$kimage")) { + rename("$kimage.$$", "$kimage"); + die("Failed to symbolic-link ${Old}${image_name} to " . + "${image_dest}${kimage}.\n"); + } + } + + # Ok, now we may clobber the previous .old file + if (-l "$kimage.old" || ! -e "$kimage.old" ) { + rename("$kimage.$$", "$kimage.old"); + warn "mv $kimage.$$ $kimage.old" if $DEBUG; + } + else { + warn "$kimage.old is not a symlink, not clobbering\n"; + warn "rm $kimage.$$"; + unlink "$kimage.$$" if $DEBUG; + } +} + +# This routine handles a request to do symlinks, but there is no +# symlink file already there. Either we are supposed to use copy, or we are +# installing on a pristine system, or the user does not want symbolic links at +# all. We use a configuration file to tell the last two cases apart, creating +# a config file if needed. +sub handle_missing_link { + my $kimage = $_[0]; # Name of the symbolic link + my $image_dest = $_[1]; # The directory the links goes into + my $image_name = $_[2]; + my $src_dir = $_[3]; + warn "handle_missing_link: kimage=$kimage, image_dest=$image_dest\n" . + "\t image_name=$image_name, src_dir=$src_dir" if $DEBUG; + + if ($no_symlink) { + warn "cp -a --backup=t $realimageloc$image_name $kimage" if $DEBUG; + my $ret = system("cp -a --backup=t " . $realimageloc . + "$image_name " . " $kimage"); + if ($ret) { + die("Failed to copy " . $realimageloc . "$image_name to " + . $image_dest . "$kimage .\n"); + } + } + elsif ($reverse_symlink) { + warn "mv -f $realimageloc$image_name $kimage" if $DEBUG; + my $ret = system("mv -f " . $realimageloc . "$image_name " + . "$kimage"); + if ($ret) { + die("Failed to move " . $realimageloc . "$image_name to " + . $image_dest . "$kimage .\n"); + } + } + else { + if (! $have_conffile) { + my $ret; + my $answer=''; + $do_symlink = "Yes"; + + if (open(CONF, ">$CONF_LOC")) { + print CONF "# Kernel Image management overrides\n"; + print CONF "# See kernel-img.conf(5) for details\n"; + if ($loader =~ /palo/i) { + print CONF "link_in_boot = Yes\n"; + print CONF "do_symlinks = Yes\n"; + print CONF "relative_links = Yes\n"; + print CONF "do_bootloader = No\n"; + } else { + print CONF "do_symlinks = $do_symlink\n"; + } + close CONF; + } + $have_conffile = "Yes"; + } + } + + if (! $no_symlink && $do_symlink =~ /Yes/i) { + my $Old = $realimageloc; + my $New = $image_dest; + my $Name = "$image_name"; + my $Link_Dest = "$kimage"; + + if ($reverse_symlink) { + $Old = $image_dest; + $New = $realimageloc; + $Name = "$kimage"; + $Link_Dest = $realimageloc . "$image_name"; + } + if (test_relative ('Old Dir' => $Old, + 'New Dir' => $New, + 'Test File' => $Name)) { + $Old =~ s|^/*||o; + } + # Special case is they are in the same dir + my $rel_path = spath('Old' => "$Old", 'New' => "$New" ); + $Old ="" if $rel_path =~ m/^\s*$/o; + + symlink($Old . "$Name", "$Link_Dest") || + die("Failed to symbolic-link ${Old}$Name to $Link_Dest.\n"); + warn "ln -s ${Old}$Name $Link_Dest" if $DEBUG; + + } +} + +# This routine handles the rest of the cases, where the user has requested +# non-traditional handling, like using cp, or reverse symlinks, or hard links. +sub handle_non_symlinks { + my $kimage = $_[0]; # Name of the symbolic link + my $image_dest = $_[1]; # The directory the links goes into + my $image_name = $_[2]; + my $src_dir = $_[3]; + warn "handle_non_link: kimage=$kimage, image_dest=$image_dest\n" . + "\t image_name=$image_name, src_dir=$src_dir" if $DEBUG; + + # Save the current image. We do this in all four cases + rename("$kimage", "$kimage.$$") || + die "failed to move " . $image_dest . "$kimage:$!"; + warn "mv $kimage $kimage.$$" if $DEBUG; + + ##,#### + # case One + #`#### + if ($no_symlink) { + # Maybe /$image_dest is on a dos system? + warn "cp -a --backup=t $realimageloc$image_name $kimage" if $DEBUG; + my $ret = system("cp -a --backup=t " . $realimageloc + . "$image_name " . "$kimage"); + if ($ret) { + if (-e "$kimage.$$") { + rename("$kimage.$$", "$kimage"); + warn "mv $kimage.$$ $kimage" if $DEBUG; + } + die("Failed to copy " . $realimageloc . "$image_name to " + . $image_dest . "$kimage .\n"); + } + } + ##,#### + # case Two + #`#### + elsif ($reverse_symlink) { # Maybe /$image_dest is on a dos system? + warn "mv -f $realimageloc$image_name $kimage" if $DEBUG; + my $ret = system("mv -f " . $realimageloc . "$image_name " + . $image_dest . "$kimage"); + if ($ret) { + if (-e "$kimage.$$") { + rename("$kimage.$$", "$kimage"); + warn "mv $kimage.$$ $kimage" if $DEBUG; + } + die("Failed to move " . $realimageloc . "$image_name to " + . $image_dest . "$kimage .\n"); + } + my $Old = $image_dest; + if (test_relative ('Old Dir' => $Old, 'New Dir' => $realimageloc, + 'Test File' => "$kimage")) { + $Old =~ s|^/*||o; + } + # Special case is they are in the same dir + my $rel_path = spath('Old' => "$Old", 'New' => "$realimageloc" ); + $Old ="" if $rel_path =~ m/^\s*$/o; + + if ($use_hard_links =~ m/YES/i) { + warn "ln " . $Old . "$kimage " . $realimageloc . "$image_name" if $DEBUG; + if (! link($Old . "$kimage", $realimageloc . "$image_name")) { + warn "Could not link " . $image_dest . + "$kimage to $image_name :$!"; + } + } + else { + warn "ln -s " . $Old . "$kimage " . $realimageloc . "$image_name" if $DEBUG; + if (! symlink($Old . "$kimage", $realimageloc . "$image_name")) { + warn "Could not symlink " . $image_dest . + "$kimage to $image_name :$!"; + } + } + } + ##,#### + # case Three + #`#### + elsif ($use_hard_links =~ m/YES/i ) { + # Ok then. this ought to be a hard link, and hence fair game + # don't clobber $kimage.old quite yet + my $Old = $realimageloc; + my $cwd; + chomp($cwd=`pwd`); + if (test_relative ('Old Dir' => $Old, 'New Dir' => $cwd, + 'Test File' => "$image_name")) { + $Old =~ s|^/*||o; + } + # Special case is they are in the same dir + my $rel_path = spath('Old' => "$Old", 'New' => "$cwd" ); + $Old ="" if $rel_path =~ m/^\s*$/o; + + warn "ln " . $Old . "$image_name " . "$kimage" if $DEBUG; + if (! link($Old . "$image_name", "$kimage")) { + warn "mv $kimage.$$ $kimage" if $DEBUG; + rename("$kimage.$$", "$kimage"); + die("Failed to link " . $realimageloc . "$image_name to " + . $image_dest . "$kimage .\n"); + } + } + ##,#### + # case Four + #`#### + else { + # We just use cp + warn "cp -a --backup=t $realimageloc$image_name $kimage" if $DEBUG; + my $ret = system("cp -a --backup=t " . $realimageloc + . "$image_name " . "$kimage"); + if ($ret) { + if (-e "$kimage.$$") { + warn "mv $kimage.$$ $kimage" if $DEBUG; + rename("$kimage.$$", "$kimage"); + } + die("Failed to copy " . $realimageloc . "$image_name to " + . $image_dest . "$kimage .\n"); + } + } + # Ok, now we may clobber the previous .old file + warn "mv $kimage.$$ $kimage.old if -e $kimage.$$" if $DEBUG; + rename("$kimage.$$", "$kimage.old") if -e "$kimage.$$"; +} + +# This routine is responsible for setting up the symbolic links +# So, the actual kernel image lives in +# $realimageloc/$image_name (/boot/vmlinuz-2.6.12). +# This routine creates symbolic links in $image_dest/$kimage (/vmlinuz) +sub image_magic { + my $kimage = $_[0]; # Name of the symbolic link + my $image_dest = $_[1]; # The directory the links goes into + my $image_name = "$kimage-$version"; + my $src_dir = $realimageloc; + warn "image_magic: kimage=$kimage, image_dest=$image_dest\n" . + "\t image_name=$image_name, src_dir=$src_dir" if $DEBUG; + + # Well, in any case, if the destination (the symlink we are trying + # to create) is a directory, we should do nothing, except throw a + # diagnostic. + if (-d "$kimage" ) { + die ("Hmm. $kimage is a directory, which I did not expect. I am\n" . + "trying to create a symbolic link with that name linked to \n" . + "$image_dest . Since a directory exists here, my assumptions \n" . + "are way off, and I am aborting.\n" ); + exit (3); + } + + if ($move_image) { # Maybe $image_dest is in on dos, or something? + # source dir, link name, dest dir + really_move_image( $realimageloc, $image_name, $image_dest); + really_reverse_link($realimageloc, $image_name, $image_dest) + if $reverse_symlink; + return; + } + + if (-l "$kimage") { # There is a symbolic link + warn "DEBUG: There is a symlink for $kimage\n" if $DEBUG; + my $force_move = move_p($kimage, $image_dest, $image_name, $src_dir); + + if ($force_move) { + really_move_link($kimage, $image_dest, $image_name, $src_dir); + } + } + elsif (! -e "$kimage") { + # Hmm. Pristine system? How can that be? Installing from scratch? + # Or maybe the user does not want a symbolic link here. + # Possibly they do not want a link here. (we should be in / + # here[$image_dest, really] + handle_missing_link($kimage, $image_dest, $image_name, $src_dir); + } + elsif (-e "$kimage" ) { + # OK, $kimage exists -- but is not a link + handle_non_symlinks($kimage, $image_dest, $image_name, $src_dir); + } +} + +###################################################################### +###################################################################### +###################################################################### +###################################################################### + +# We may not have any modules installed +if ( -d "$modules_base/$version" ) { + print STDERR "Running depmod.\n"; + my $ret = system("depmod -a -F $realimageloc/System.map-$version $version"); + if ($ret) { + print STDERR "Failed to run depmod\n"; + exit(1); + } +} + + + +sub find_initrd_tool { + my $hostversion = shift; + my $version = shift; + print STDERR "Finding valid ramdisk creators.\n"; + my @ramdisks = + grep { + my $args = + "$_ " . + "--supported-host-version=$hostversion " . + "--supported-target-version=$version " . + "1>/dev/null 2>&1" + ; + system($args) == 0; + } + split (/[:,\s]+/, $ramdisk); +} + +# The initrd symlink should probably be in the same dir that the +# symlinks are in +if ($initrd) { + my $success = 0; + + # Update-initramfs is called slightly different than mkinitrd and + # mkinitramfs. XXX It should really be made compatible with this stuff + # some how. + my $upgrading = 1; + if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m//og) { + $upgrading = 0; + } + my $ret = system("$ramdisk " . ($upgrading ? "-u" : "-c") . " -k " . $version . " >&2"); + $success = 1 unless $ret; + die "Failed to create initrd image.\n" unless $success; + if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m//og) { + image_magic("initrd.img", $image_dest); + } + else { + if (! -e "initrd.img") { + handle_missing_link("initrd.img", $image_dest, "initrd.img-$version", + $realimageloc); + } + else { + print STDERR + "Not updating initrd symbolic links since we are being updated/reinstalled \n"; + print STDERR + "($ARGV[1] was configured last, according to dpkg)\n"; + } + } + + if ($initrd && -l "initrd" ) { + unlink "initrd"; + } + + if ($initrd && -l "$image_dir/initrd" && ! $link_in_boot) { + unlink "$image_dir/initrd"; + } +} +else { # Not making an initrd emage + if (-l "initrd.img") { + # Ooh, last image was an initrd image? in any case, we should move it. + my $target = readlink "initrd.img"; + my $real_target = ''; + $real_target = abs_path($target) if defined ($target); + + if (!defined($target) || ! -f "$real_target") { + # Eh. dangling link. can safely be removed. + unlink("initrd.img"); + } else { + if (-l "initrd.img.old" || ! -e "initrd.img.old" ) { + rename("initrd.img", "initrd.img.old"); + } else { + warn "initrd.img.old is not a symlink, not clobbering\n"; + unlink("initrd.img"); + } + } + } +} + +# Warn of a reboot +if (-x $notifier) { + system($notifier); +} + +# Let programs know not to hibernate if the kernel that would be used for +# resume-from-hibernate is likely to differ from the currently running kernel. +system("mountpoint -q /var/run"); +if ($? eq 0) { + system("touch /var/run/do-not-hibernate"); +} + +# Only change the symlinks if we are not being upgraded +if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m//og) { + image_magic($kimage, $image_dest); +} +else { + if (! -e "$kimage") { + handle_missing_link($kimage, $image_dest, "$kimage-$version", + $realimageloc); + } + else { + print STDERR + "Not updating image symbolic links since we are being updated/reinstalled \n"; + print STDERR + "($ARGV[1] was configured last, according to dpkg)\n"; + } +} + +# We used to have System.* files in / +if (-e "/System.map" || -e "/System.old") { + unlink '/System.map' if -e '/System.map'; + unlink '/System.old' if -e '/System.old'; +} + +# creating some info about kernel and initrd +if ($DEBUG) { + my $ksize=sprintf("%.0f",(stat($realimageloc . + "$kimage-$version"))[7]/1024)."kB"; + my $initrdsize=''; + if ($initrd) { + $initrdsize=sprintf("%.0f",(stat($realimageloc . + "initrd.img-$version"))[7]/1024)."kB"; + } + + print STDERR <<"EOMSG"; +A new kernel image has been installed at $realimageloc$kimage-$version + (Size: $ksize) + +Symbolic links, unless otherwise specified, can be found in $image_dest + +EOMSG + ; + + if ($initrd) { + print STDERR <<"EOMSGA"; + + Initial rootdisk image: ${realimageloc}initrd.img-$version (Size: $initrdsize) +EOMSGA + ; + } +} + +# set the env var stem +$ENV{'STEM'} = "linux"; +sub exec_script { + my $type = shift; + my $script = shift; + print STDERR "Running $type hook script $script.\n"; + system ("$script $version $realimageloc$kimage-$version") && + print STDERR "User $type hook script [$script] "; + if ($?) { + if ($? == -1) { + print STDERR "failed to execute: $!\n"; + } + elsif ($? & 127) { + printf STDERR "died with signal %d, %s coredump\n", + ($? & 127), ($? & 128) ? 'with' : 'without'; + } + else { + printf STDERR "exited with value %d\n", $? >> 8; + } + exit $? >> 8; + } +} +sub run_hook { + my $type = shift; + my $script = shift; + if ($script =~ m,^/,) { + # Full path provided for the hook script + if (-x "$script") { + &exec_script($type,$script); + } + else { + die "The provided $type hook script [$script] could not be run.\n"; + } + } + else { + # Look for it in a safe path + for my $path ('/bin', '/sbin', '/usr/bin', '/usr/sbin') { + if (-x "$path/$script") { + &exec_script($type, "$path/$script"); + return 0; + } + } + # No luck + print STDERR "Could not find $type hook script [$script].\n"; + die "Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'\n"; + } +} + +## Run user hook script here, if any +if ($postinst_hook) { + &run_hook("postinst", $postinst_hook); +} + +if (-d "/etc/kernel/postinst.d") { + print STDERR "Examining /etc/kernel/postinst.d.\n"; + system ("run-parts --verbose --exit-on-error --arg=$version " . + "--arg=$realimageloc$kimage-$version " . + "/etc/kernel/postinst.d") && + die "Failed to process /etc/kernel/postinst.d"; +} + +if (-d "/etc/kernel/postinst.d/$version") { + print STDERR "Examining /etc/kernel/postinst.d/$version.\n"; + system ("run-parts --verbose --exit-on-error --arg=$version " . + "--arg=$realimageloc$kimage-$version " . + "/etc/kernel/postinst.d/$version") && + die "Failed to process /etc/kernel/postinst.d/$version"; +} + +LOADER: { + last unless $do_boot_enable; # Exit if explicitly asked to + + last if $loader =~ /silo/i; # SILO does not have to be executed. + last if $loader =~ /yaboot/i; # yaboot does not have to be executed. + last if $loader =~ /milo/i; # MILO does not have to be executed. + last if $loader =~ /nettrom/i; # NETTROM does not have to be executed. + last if $loader =~ /arcboot/i; # ARCBOOT does not have to be executed. + last if $loader =~ /delo/i; # DELO does not have to be executed. + last if $loader =~ /quik/i; # maintainer asked quik invocation to be ignored + + last unless $loaderloc; + last unless -x $loaderloc; + last unless $do_bootloader; + + if (-T "/etc/$loader.conf") { + # Trust and use the existing lilo.conf. + print STDERR "You already have a $Loader configuration in /etc/$loader.conf\n"; + my $ret = &run_lilo(); + exit $ret if $ret; + } +} + + +sub run_lilo (){ + my $ret; + # Try and figure out if the user really wants lilo to be run -- + # since the default is to run the boot laoder, which is ! grub -- but + # the user may be using grub now, and not changed the default. + + # So, if the user has explicitly asked for the loader to be run, or + # if there is no postinst hook, or if there is no grub installed -- + # we are OK. Or else, we ask. + if ($explicit_do_loader || (! ($postinst_hook && -x '/usr/sbin/grub'))) { + print STDERR "Running boot loader as requested\n"; + } else { + print STDERR "Ok, not running $loader\n"; + } + if ($loader =~ /^lilo/io or $loader =~ /vmelilo/io) { + print STDERR "Testing $loader.conf ... \n"; + unlink $temp_file_name; # security + $ret = system("$loaderloc -t >$temp_file_name 2>&1"); + if ($ret) { + print STDERR "Boot loader test failed\n"; + return $ret; + } + unlink "$temp_file_name"; + print STDERR "Testing successful.\n"; + print STDERR "Installing the "; + print STDERR "partition " if $loader =~ /^lilo/io; + print STDERR "boot sector... \n"; + } + + print STDERR "Running $loaderloc ... \n"; + if ($loader =~ /^elilo/io) { + $ret = system("$loaderloc 2>&1 | tee $temp_file_name"); + } else { + $ret = system("$loaderloc >$temp_file_name 2>&1"); + } + if ($ret) { + print STDERR "Boot loader failed to run\n"; + return $ret; + } + unlink $temp_file_name; + print STDERR "Installation successful.\n"; + return 0; +} + +exit 0; + +__END__ + --- linux-2.6.24.orig/debian/control-scripts/prerm +++ linux-2.6.24/debian/control-scripts/prerm @@ -0,0 +1,294 @@ +#! /usr/bin/perl +# -*- Mode: Perl -*- +# image.prerm --- +# Author : root ( root@melkor.pilgrim.umass.edu ) +# Created On : Fri May 17 03:28:59 1996 +# Created On Node : melkor.pilgrim.umass.edu +# Last Modified By : Manoj Srivastava +# Last Modified On : Sat Aug 5 13:14:17 2006 +# Last Machine Used: glaurung.internal.golden-gryphon.com +# Update Count : 85 +# Status : Unknown, Use with caution! +# HISTORY : +# Description : +# +# +# $Id: image.prerm,v 1.22 2003/10/07 16:24:20 srivasta Exp $ +# +# +#use strict; + +$|=1; +# Predefined values: +my $version = "=V"; +my $link_in_boot = ""; # Should be empty, mostly +my $no_symlink = ""; # Should be empty, mostly +my $reverse_symlink = ""; # Should be empty, mostly +my $do_symlinks = "Yes"; # target machine defined +my $do_boot_enable = "Yes"; # target machine defined +my $do_bootfloppy = "Yes"; # target machine defined +my $do_bootloader = "Yes"; # target machine defined +my $move_image = ''; # target machine defined +my $kimage = "=K"; # Should be empty, mostly +my $loader = "=L"; # lilo, silo, quik, palo, vmelilo, or nettrom +my $image_dir = "/boot"; # where the image is located +my $clobber_modules = ''; # target machine defined +my $initrd = "YES"; # initrd kernel +my $use_hard_links = ''; # hardlinks do not wirk across fs boundaries +my $postinst_hook = ''; #Normally we do not +my $postrm_hook = ''; #Normally we do not +my $preinst_hook = ''; #Normally we do not +my $prerm_hook = ''; #Normally we do not +my $minimal_swap = ''; # Do not swap symlinks +my $ignore_depmod_err = ''; # normally we do not +my $relink_build_link = 'YES'; # There is no harm in checking the link +my $force_build_link = ''; # There is no harm in checking the link +my $kernel_arch = "=B"; +my $ramdisk = "/usr/sbin/update-initramfs"; +my $package_name = "linux-image-$version"; + +my $Loader = "NoLOADER"; # +$Loader = "LILO" if $loader =~ /^lilo/io; +$Loader = "SILO" if $loader =~ /^silo/io; +$Loader = "QUIK" if $loader =~ /^quik/io; +$Loader = "yaboot" if $loader =~ /^yaboot/io; +$Loader = "PALO" if $loader =~ /^palo/io; +$Loader = "NETTROM" if $loader =~ /^nettrom/io; +$Loader = "VMELILO" if $loader =~ /^vmelilo/io; +$Loader = "ZIPL" if $loader =~ /^zipl/io; +$Loader = "ELILO" if $loader =~ /^elilo/io; + + +# This should not point to /tmp, because of security risks. +my $temp_file_name = "/var/log/$loader" . "_log.$$"; + +#known variables +my $image_dest = "/"; +my $realimageloc = "/$image_dir/"; +my $have_conffile = ""; +my $CONF_LOC = '/etc/kernel-img.conf'; +my $relative_links = ''; +my $silent_loader = ''; +my $warn_reboot = 'Yes'; # Warn that we are installing a version of + # the kernel we are running + +# remove multiple leading slashes; make sure there is at least one. +$realimageloc =~ s|^/*|/|o; +$realimageloc =~ s|/+|/|o; + +my $DEBUG = 0; + +# Variables used +my $image=''; +my $ret=0; +my $seen=''; +my $answer=''; +my $running = ''; +my $WouldInvalidate = 0; + +if ($ARGV[0] && ($ARGV[0] =~ /remove/ || $ARGV[0] =~ /upgrade/)) { + if (-l "/usr/doc/linux-image-$version") { + unlink "/usr/doc/linux-image-$version"; + } +} + +# Ignore all invocations uxcept when called on to remove +exit 0 unless ($ARGV[0] && $ARGV[0] =~ /remove/) ; + +# Paranoid check to make sure that the correct value is put in there +if (! $kimage) { $kimage = "vmlinuz";} # Hmm. empty +elsif ($kimage =~ m/^b?zImage$/o) { $kimage = "vmlinuz";} # these produce vmlinuz +elsif ($kimage =~ m/^[iI]mage$/o) { my $nop = $kimage; } +elsif ($kimage =~ m/^vmlinux$/o) { my $nop = $kimage; } +else { $kimage = "vmlinuz";} # Default + +if (-r "$CONF_LOC" && -f "$CONF_LOC" ) { + if (open(CONF, "$CONF_LOC")) { + while () { + chomp; + s/\#.*$//g; + next if /^\s*$/; + + $do_symlink = "" if /^\s*do_symlinks\s*=\s*(no|false|0)\s*$/ig; + $no_symlink = "" if /^\s*no_symlinks\s*=\s*(no|false|0)\s*$/ig; + $reverse_symlink = "" if /^\s*reverse_symlinks\s*=\s*(no|false|0)\s*$/ig; + $link_in_boot = "" if /^\s*image_in_boot\s*=\s*(no|false|0)\s*$/ig; + $link_in_boot = "" if /^\s*link_in_boot\s*=\s*(no|false|0)\s*$/ig; + $move_image = "" if /^\s*move_image\s*=\s*(no|false|0)\s*$/ig; + $clobber_modules = '' if /^\s*clobber_modules\s*=\s*(no|false|0)\s*$/ig; + $do_boot_enable = '' if /^\s*do_boot_enable\s*=\s*(no|false|0)\s*$/ig; + $do_bootfloppy = '' if /^\s*do_bootfloppy\s*=\s*(no|false|0)\s*$/ig; + $relative_links = '' if /^\s*relative_links \s*=\s*(no|false|0)\s*$/ig; + $do_bootloader = '' if /^\s*do_bootloader\s*=\s*(no|false|0)\s*$/ig; + $do_initrd = '' if /^\s*do_initrd\s*=\s*(no|false|0)\s*$/ig; + $use_hard_links = '' if /^\s*use_hard_links\s*=\s*(no|false|0)\s*$/ig; + $silent_loader = '' if /^\s*silent_loader\s*=\s*(no|false|0)\s*$/ig; + $warn_reboot = '' if /^\s*warn_reboot\s*=\s*(no|false|0)\s*$/ig; + $minimal_swap = '' if /^\s*minimal_swap\s*=\s*(no|false|0)\s*$/ig; + $ignore_depmod_err = '' if /^\s*ignore_depmod_err\s*=\s*(no|false|0)\s*$/ig; + $relink_build_link = '' if /^\s*relink_build_link\s*=\s*(no|false|0)\s*$/ig; + $force_build_link = '' if /^\s*force_build_link\s*=\s*(no|false|0)\s*$/ig; + + + $do_symlink = "Yes" if /^\s*do_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $no_symlink = "Yes" if /^\s*no_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $reverse_symlink = "Yes" if /^\s*reverse_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $link_in_boot = "Yes" if /^\s*image_in_boot\s*=\s*(yes|true|1)\s*$/ig; + $link_in_boot = "Yes" if /^\s*link_in_boot\s*=\s*(yes|true|1)\s*$/ig; + $move_image = "Yes" if /^\s*move_image\s*=\s*(yes|true|1)\s*$/ig; + $clobber_modules = "Yes" if /^\s*clobber_modules\s*=\s*(yes|true|1)\s*$/ig; + $do_boot_enable = "Yes" if /^\s*do_boot_enable\s*=\s*(yes|true|1)\s*$/ig; + $do_bootfloppy = "Yes" if /^\s*do_bootfloppy\s*=\s*(yes|true|1)\s*$/ig; + $do_bootloader = "Yes" if /^\s*do_bootloader\s*=\s*(yes|true|1)\s*$/ig; + $relative_links = "Yes" if /^\s*relative_links\s*=\s*(yes|true|1)\s*$/ig; + $do_initrd = "Yes" if /^\s*do_initrd\s*=\s*(yes|true|1)\s*$/ig; + $use_hard_links = "Yes" if /^\s*use_hard_links\s*=\s*(yes|true|1)\s*$/ig; + $silent_loader = 'Yes' if /^\s*silent_loader\s*=\s*(yes|true|1)\s*$/ig; + $warn_reboot = 'Yes' if /^\s*warn_reboot\s*=\s*(yes|true|1)\s*$/ig; + $minimal_swap = 'Yes' if /^\s*minimal_swap\s*=\s*(yes|true|1)\s*$/ig; + $ignore_depmod_err = 'Yes' if /^\s*ignore_depmod_err\s*=\s*(yes|true|1)\s*$/ig; + $relink_build_link = 'Yes' if /^\s*relink_build_link\s*=\s*(yes|true|1)\s*$/ig; + $force_build_link = 'Yes' if /^\s*force_build_link\s*=\s*(yes|true|1)\s*$/ig; + + $image_dest = "$1" if /^\s*image_dest\s*=\s*(\S+)/ig; + $postinst_hook = "$1" if /^\s*postinst_hook\s*=\s*(\S+)/ig; + $postrm_hook = "$1" if /^\s*postrm_hook\s*=\s*(\S+)/ig; + $preinst_hook = "$1" if /^\s*preinst_hook\s*=\s*(\S+)/ig; + $prerm_hook = "$1" if /^\s*prerm_hook\s*=\s*(\S+)/ig; + $ramdisk = "$1" if /^\s*ramdisk\s*=\s*(.+)$/ig; + } + close CONF; + $have_conffile = "Yes"; + } +} + + +$ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch; + +#check to see if we are trying to remove a running kernel +# if so we abort right now. +chop($running=`uname -r`); +if ($running eq $version) { + print STDERR "WARN: Proceeding with removing running kernel image.\n"; +} + +#Now, they have an alternate kernel which they are currently running + +# This is just us being nice to lilo users. + +chdir("/") or die "could not chdir to /:$!\n"; + +if (-f "/etc/$loader.conf") { #I know, could be a link, but .. + open (LILO, "/etc/$loader.conf") || &success(); # this is not critical + while () { + chop; + s/\#.*//; # nix the comments + next unless /^\s*image\s*=\s(\S+)/o; + $image = $1; + if ($image && -e $image) { + while (defined($image) && -l $image) { + $image = readlink ($image); + } + if (defined($image) && -e $image) { + $WouldInvalidate |= $image =~ /$kimage-$version/; + } + else { + &success(); # invalid $loader.conf file + } + } + else { + &success(); # invalid $loader.conf file + } + } + close (LILO); + if ($WouldInvalidate) { + print STFERR "WARN: Proceeding with removing running kernel image.\n"; + &success(); + } +} + + +# set the env var stem +$ENV{'STEM'} = "linux"; + +sub exec_script { + my $type = shift; + my $script = shift; + print STDERR "Running $type hook script $script.\n"; + system ("$script $version $realimageloc$kimage-$version") && + print STDERR "User $type hook script [$script] "; + if ($?) { + if ($? == -1) { + print STDERR "failed to execute: $!\n"; + } + elsif ($? & 127) { + printf STDERR "died with signal %d, %s coredump\n", + ($? & 127), ($? & 128) ? 'with' : 'without'; + } + else { + printf STDERR "exited with value %d\n", $? >> 8; + } + exit $? >> 8; + } +} +sub run_hook { + my $type = shift; + my $script = shift; + if ($script =~ m,^/,) { + # Full path provided for the hook script + if (-x "$script") { + &exec_script($type,$script); + } + else { + die "The provided $type hook script [$script] could not be run.\n"; + } + } + else { + # Look for it in a safe path + for my $path ('/bin', '/sbin', '/usr/bin', '/usr/sbin') { + if (-x "$path/$script") { + &exec_script($type, "$path/$script"); + return 0; + } + } + # No luck + print STDERR "Could not find $type hook script [$script].\n"; + die "Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'\n"; + } +} + + +## Run user hook script here, if any +if (-x "$prerm_hook") { + &run_hook("prerm", $prerm_hook); +} +if (-d "/etc/kernel/prerm.d") { + print STDERR "Examining /etc/kernel/prerm.d.\n"; + system ("run-parts --verbose --exit-on-error --arg=$version " . + "--arg=$realimageloc$kimage-$version /etc/kernel/prerm.d") && + die "Failed to process /etc/kernel/prerm.d"; +} +if (-d "/etc/kernel/prerm.d/$version") { + print STDERR "Examining /etc/kernel/prerm.d/$version.\n"; + system ("run-parts --verbose --exit-on-error --arg=$version" . + " --arg=$realimageloc$kimage-$version " . + "/etc/kernel/prerm.d/$version") && + die "Failed to process /etc/kernel/prerm.d/$version"; +} + +sub success () { + -f "/lib/modules/$version/modules.dep" && + unlink "/lib/modules/$version/modules.dep"; + exit 0; +} + + + +&success(); +exit 0; +__END__ + + + + + --- linux-2.6.24.orig/debian/control-scripts/headers-postinst +++ linux-2.6.24/debian/control-scripts/headers-postinst @@ -0,0 +1,126 @@ +#!/usr/bin/perl +# -*- Mode: Cperl -*- +# debian.postinst --- +# Author : Manoj Srivastava ( srivasta@pilgrim.umass.edu ) +# Created On : Sat Apr 27 05:42:43 1996 +# Created On Node : melkor.pilgrim.umass.edu +# Last Modified By : Manoj Srivastava +# Last Modified On : Sat Aug 5 13:20:22 2006 +# Last Machine Used: glaurung.internal.golden-gryphon.com +# Update Count : 45 +# Status : Unknown, Use with caution! +# HISTORY : +# Description : +# +# +# +# arch-tag: 1c716174-2f0a-476d-a626-a1322e62503a +# + + +$|=1; + +# Predefined values: +my $version = "=V"; +my $kimage = "=K"; +my $package_name = "linux-image-$version"; + + +# Ignore all invocations uxcept when called on to configure. +exit 0 unless ($ARGV[0] && $ARGV[0] =~ /configure/); + +#known variables +my $image_dest = "/"; +my $realimageloc = "/boot/"; +my $silent_modules = ''; +my $modules_base = '/lib/modules'; +my $CONF_LOC = '/etc/kernel-img.conf'; +# remove multiple leading slashes; make sure there is at least one. +$realimageloc =~ s|^/*|/|o; +$realimageloc =~ s|/+|/|o; + +chdir '/usr/src' or die "Could not chdir to /usr/src:$!"; + +if (-r "$CONF_LOC" && -f "$CONF_LOC" ) { + if (open(CONF, "$CONF_LOC")) { + while () { + chomp; + s/\#.*$//g; + next if /^\s*$/; + + $header_postinst_hook = "$1" if /^\s*header_postinst_hook\s*=\s*(\S+)/ig; + } + close CONF; + } +} + +sub exec_script { + my $type = shift; + my $script = shift; + print STDERR "Running $type hook script $script.\n"; + system ("$script $version $realimageloc$kimage-$version") && + print STDERR "User $type hook script [$script] "; + if ($?) { + if ($? == -1) { + print STDERR "failed to execute: $!\n"; + } + elsif ($? & 127) { + printf STDERR "died with signal %d, %s coredump\n", + ($? & 127), ($? & 128) ? 'with' : 'without'; + } + else { + printf STDERR "exited with value %d\n", $? >> 8; + } + exit $? >> 8; + } +} +sub run_hook { + my $type = shift; + my $script = shift; + if ($script =~ m,^/,) { + # Full path provided for the hook script + if (-x "$script") { + &exec_script($type,$script); + } + else { + die "The provided $type hook script [$script] could not be run.\n"; + } + } + else { + # Look for it in a safe path + for my $path ('/bin', '/sbin', '/usr/bin', '/usr/sbin') { + if (-x "$path/$script") { + &exec_script($type, "$path/$script"); + return 0; + } + } + # No luck + print STDERR "Could not find $type hook script [$script].\n"; + die "Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'\n"; + } +} + +## Run user hook script here, if any +if (-x "$header_postinst_hook") { + &run_hook("postinst", $header_postinst_hook); +} + +if (-d "/etc/kernel/header_postinst.d") { + print STDERR "Examining /etc/kernel/header_postinst.d.\n"; + system ("run-parts --verbose --exit-on-error --arg=$version " . + "--arg=$realimageloc$kimage-$version " . + "/etc/kernel/header_postinst.d") && + die "Failed to process /etc/kernel/header_postinst.d"; +} + +if (-d "/etc/kernel/header_postinst.d/$version") { + print STDERR "Examining /etc/kernel/header_postinst.d/$version.\n"; + system ("run-parts --verbose --exit-on-error --arg=$version " . + "--arg=$realimageloc$kimage-$version " . + "/etc/kernel/header_postinst.d/$version") && + die "Failed to process /etc/kernel/header_postinst.d/$version"; +} + +exit 0; + +__END__ --- linux-2.6.24.orig/debian/control-scripts/preinst +++ linux-2.6.24/debian/control-scripts/preinst @@ -0,0 +1,299 @@ +#! /usr/bin/perl +# -*- Mode: Cperl -*- +# image.preinst --- +# Author : Manoj Srivastava ( srivasta@tiamat.datasync.com ) +# Created On : Sun Jun 14 03:38:02 1998 +# Created On Node : tiamat.datasync.com +# Last Modified By : Manoj Srivastava +# Last Modified On : Sun Sep 24 14:04:42 2006 +# Last Machine Used: glaurung.internal.golden-gryphon.com +# Update Count : 99 +# Status : Unknown, Use with caution! +# HISTORY : +# Description : +# +# + +# +#use strict; #for debugging + +use Debconf::Client::ConfModule qw(:all); +version('2.0'); +my $capb=capb("backup"); + +$|=1; + +# Predefined values: +my $version = "=V"; +my $link_in_boot = ""; # Should be empty, mostly +my $no_symlink = ""; # Should be empty, mostly +my $reverse_symlink = ""; # Should be empty, mostly +my $do_symlink = "Yes"; # target machine defined +my $do_boot_enable = "Yes"; # target machine defined +my $do_bootfloppy = "Yes"; # target machine defined +my $do_bootloader = "Yes"; # target machine defined +my $move_image = ''; # target machine defined +my $kimage = "=K"; # Should be empty, mostly +my $loader = "=L"; # lilo, silo, quik, palo, vmelilo, nettrom + # or elilo +my $image_dir = "/boot"; # where the image is located +my $initrd = "YES"; # initrd kernel +my $use_hard_links = ''; # hardlinks do not wirk across fs boundaries +my $postinst_hook = ''; #Normally we do not +my $postrm_hook = ''; #Normally we do not +my $preinst_hook = ''; #Normally we do not +my $prerm_hook = ''; #Normally we do not +my $minimal_swap = ''; # Do not swap symlinks +my $ignore_depmod_err = ''; # normally we do not +my $relink_src_link = 'YES'; # There is no harm in checking the link +my $relink_build_link = 'YES'; # There is no harm in checking the link +my $force_build_link = ''; # There is no harm in checking the link +my $kernel_arch = "=B"; +my $ramdisk = "/usr/sbin/update-initramfs"; # List of tools to create initial ram fs. +my $package_name = "linux-image-$version"; + +my $Loader = "NoLOADER"; # +$Loader = "LILO" if $loader =~ /^lilo/io; +$Loader = "SILO" if $loader =~ /^silo/io; +$Loader = "QUIK" if $loader =~ /^quik/io; +$Loader = "yaboot" if $loader =~ /^yaboot/io; +$Loader = "PALO" if $loader =~ /^palo/io; +$Loader = "NETTROM" if $loader =~ /^nettrom/io; +$Loader = "VMELILO" if $loader =~ /^vmelilo/io; +$Loader = "ZIPL" if $loader =~ /^zipl/io; +$Loader = "ELILO" if $loader =~ /^elilo/io; + + +#known variables +my @boilerplate = (); +my @silotemplate = (); +my @quiktemplate = (); +my @palotemplate = (); +my @vmelilotemplate = (); +my $bootdevice = ''; +my $rootdevice = ''; +my $rootdisk = ''; +my $rootpartition = ''; +my $image_dest = "/"; +my $realimageloc = "/$image_dir/"; +my $have_conffile = ""; +my $CONF_LOC = '/etc/kernel-img.conf'; +my $relative_links = ''; +my $silent_loader = ''; +my $warn_reboot = ''; # Warn that we are installing a version of + # the kernel we are running + +my $modules_base = '/lib/modules'; + +die "Pre inst Internal error. Aborting." unless $version; + +exit 0 if $ARGV[0] =~ /abort-upgrade/; +exit 1 unless $ARGV[0] =~ /(install|upgrade)/; + +# remove multiple leading slashes; make sure there is at least one. +$realimageloc =~ s|^/*|/|o; +$realimageloc =~ s|/+|/|o; + +if (-r "$CONF_LOC" && -f "$CONF_LOC" ) { + if (open(CONF, "$CONF_LOC")) { + while () { + chomp; + s/\#.*$//g; + next if /^\s*$/; + + $do_symlink = "" if /^\s*do_symlinks\s*=\s*(no|false|0)\s*$/ig; + $no_symlink = "" if /^\s*no_symlinks\s*=\s*(no|false|0)\s*$/ig; + $reverse_symlink = "" if /^\s*reverse_symlinks\s*=\s*(no|false|0)\s*$/ig; + $link_in_boot = "" if /^\s*image_in_boot\s*=\s*(no|false|0)\s*$/ig; + $link_in_boot = "" if /^\s*link_in_boot\s*=\s*(no|false|0)\s*$/ig; + $move_image = "" if /^\s*move_image\s*=\s*(no|false|0)\s*$/ig; + $do_boot_enable = '' if /^\s*do_boot_enable\s*=\s*(no|false|0)\s*$/ig; + $do_bootfloppy = '' if /^\s*do_bootfloppy\s*=\s*(no|false|0)\s*$/ig; + $do_bootloader = '' if /^\s*do_bootloader\s*=\s*(no|false|0)\s*$/ig; + $relative_links = '' if /^\s*relative_links \s*=\s*(no|false|0)\s*$/ig; + $use_hard_links = '' if /^\s*use_hard_links\s*=\s*(no|false|0)\s*$/ig; + $silent_loader = '' if /^\s*silent_loader\s*=\s*(no|false|0)\s*$/ig; + $warn_reboot = '' if /^\s*warn_reboot\s*=\s*(no|false|0)\s*$/ig; + $minimal_swap = '' if /^\s*minimal_swap\s*=\s*(no|false|0)\s*$/ig; + $ignore_depmod_err = '' if /^\s*ignore_depmod_err\s*=\s*(no|false|0)\s*$/ig; + $relink_src_link = '' if /^\s*relink_src_link\s*=\s*(no|false|0)\s*$/ig; + $relink_build_link = '' if /^\s*relink_build_link\s*=\s*(no|false|0)\s*$/ig; + $force_build_link = '' if /^\s*force_build_link\s*=\s*(no|false|0)\s*$/ig; + + $do_symlink = "Yes" if /^\s*do_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $no_symlink = "Yes" if /^\s*no_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $reverse_symlink = "Yes" if /^\s*reverse_symlinks\s*=\s*(yes|true|1)\s*$/ig; + $link_in_boot = "Yes" if /^\s*image_in_boot\s*=\s*(yes|true|1)\s*$/ig; + $link_in_boot = "Yes" if /^\s*link_in_boot\s*=\s*(yes|true|1)\s*$/ig; + $move_image = "Yes" if /^\s*move_image\s*=\s*(yes|true|1)\s*$/ig; + $do_boot_enable = "Yes" if /^\s*do_boot_enable\s*=\s*(yes|true|1)\s*$/ig; + $do_bootfloppy = "Yes" if /^\s*do_bootfloppy\s*=\s*(yes|true|1)\s*$/ig; + $do_bootloader = "Yes" if /^\s*do_bootloader\s*=\s*(yes|true|1)\s*$/ig; + $relative_links = "Yes" if /^\s*relative_links\s*=\s*(yes|true|1)\s*$/ig; + $use_hard_links = "Yes" if /^\s*use_hard_links\s*=\s*(yes|true|1)\s*$/ig; + $silent_loader = 'Yes' if /^\s*silent_loader\s*=\s*(yes|true|1)\s*$/ig; + $warn_reboot = 'Yes' if /^\s*warn_reboot\s*=\s*(yes|true|1)\s*$/ig; + $minimal_swap = 'Yes' if /^\s*minimal_swap\s*=\s*(yes|true|1)\s*$/ig; + $ignore_depmod_err = 'Yes' if /^\s*ignore_depmod_err\s*=\s*(yes|true|1)\s*$/ig; + $relink_src_link = 'Yes' if /^\s*relink_src_link\s*=\s*(yes|true|1)\s*$/ig; + $relink_build_link = 'Yes' if /^\s*relink_build_link\s*=\s*(yes|true|1)\s*$/ig; + $force_build_link = 'Yes' if /^\s*force_build_link\s*=\s*(yes|true|1)\s*$/ig; + + $image_dest = "$1" if /^\s*image_dest\s*=\s*(\S+)/ig; + $postinst_hook = "$1" if /^\s*postinst_hook\s*=\s*(\S+)/ig; + $postrm_hook = "$1" if /^\s*postrm_hook\s*=\s*(\S+)/ig; + $preinst_hook = "$1" if /^\s*preinst_hook\s*=\s*(\S+)/ig; + $prerm_hook = "$1" if /^\s*prerm_hook\s*=\s*(\S+)/ig; + $ramdisk = "$1" if /^\s*ramdisk\s*=\s*(.+)$/ig; + } + close CONF; + $have_conffile = "Yes"; + $have_conffile = "Yes"; # stop perl complaining + } +} + +$ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch; + +# About to upgrade this package from version $2 TO THIS VERSION. +# "prerm upgrade" has already been called for the old version of +# this package. + +sub find_initrd_tool { + my $hostversion = shift; + my $version = shift; + my @ramdisks = + grep { + my $args = + "$_ " . + "--supported-host-version=$hostversion " . + "--supported-target-version=$version " . + "1>/dev/null 2>&1" + ; + system($args) == 0; + } + split (/[:,\s]+/, $ramdisk); +} + +sub check { + my $version = shift; + my $lib_modules="$modules_base/$version"; + my $message = ''; + + if (-d "$lib_modules") { + opendir(DIR, $lib_modules) || die "can’t opendir $lib_modules: $!"; + my @children = readdir(DIR); + if ($#children > 1) { + my @dirs = grep { -d "$lib_modules/$_" } @children; + if ($#dirs > 1) { # we have subdirs + my $dir_message=''; + for my $dir (@dirs) { + if ($dir =~/kernel$/) { + $dir_message="An older install was detected.\n"; + } + else { + $dir_message="Module sub-directories were detected.\n" + unless $dir_message; + } + } + $message += $dir_message if $dir_message; + } + + my @links = grep { -l "$lib_modules/$_" } @children; + if ($#links > -1) { + my $links_message = ''; + for my $link (@links) { + next if ($link =~ /^build$/); + next if ($link =~ /^source$/); + $links_message = "Symbolic links were detected in $modules_base/$version.\n"; + } + $message += $links_message if $links_message; + } + my @files = grep { -f "$lib_modules/$_" } @children; + $message += "Additional files also exist in $modules_base/$version.\n" + if ($#files > -1); + } + } + else { $message .= "$lib_modules does not exist. ";} + return $message; +} + +if (-d "$modules_base/$version") { + my $errors=check($version); + warn "Info:\n$errors\n" if $errors; +} + +# set the env var stem +$ENV{'STEM'} = "linux"; + +sub exec_script { + my $type = shift; + my $script = shift; + print STDERR "Running $type hook script $script.\n"; + system ("$script $version $realimageloc$kimage-$version") && + print STDERR "User $type hook script [$script] "; + if ($?) { + if ($? == -1) { + print STDERR "failed to execute: $!\n"; + } + elsif ($? & 127) { + printf STDERR "died with signal %d, %s coredump\n", + ($? & 127), ($? & 128) ? 'with' : 'without'; + } + else { + printf STDERR "exited with value %d\n", $? >> 8; + } + exit $? >> 8; + } +} +sub run_hook { + my $type = shift; + my $script = shift; + if ($script =~ m,^/,) { + # Full path provided for the hook script + if (-x "$script") { + &exec_script($type,$script); + } + else { + die "The provided $type hook script [$script] could not be run.\n"; + } + } + else { + # Look for it in a safe path + for my $path ('/bin', '/sbin', '/usr/bin', '/usr/sbin') { + if (-x "$path/$script") { + &exec_script($type, "$path/$script"); + return 0; + } + } + # No luck + print STDERR "Could not find $type hook script [$script].\n"; + die "Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'\n"; + } +} + + +## Run user hook script here, if any +if (-x "$preinst_hook") { + &run_hook("preinst", $preinst_hook); +} +if (-d "/etc/kernel/preinst.d") { + print STDERR "Examining /etc/kernel/preinst.d/\n"; + system ("run-parts --verbose --exit-on-error --arg=$version" . + " --arg=$realimageloc$kimage-$version" . + " /etc/kernel/preinst.d") && + die "Failed to process /etc/kernel/preinst.d"; +} +if (-d "/etc/kernel/preinst.d/$version") { + print STDERR "Examining /etc/kernel/preinst.d/$version.\n"; + system ("run-parts --verbose --exit-on-error --arg=$version" . + " --arg=$realimageloc$kimage-$version" . + " /etc/kernel/preinst.d/$version") && + die "Failed to process /etc/kernel/preinst.d/$version"; +} +print STDERR "Done.\n"; + +exit 0; + +__END__ + + --- linux-2.6.24.orig/debian/tests/check-aliases +++ linux-2.6.24/debian/tests/check-aliases @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +%map = []; + +print "Checking for dupe aliases in $ENV{'FLAVOUR'}...\n"; + +$aliases = + "$ENV{'INSTALL_DIR'}/lib/modules/$ENV{'VERSION'}-$ENV{'FLAVOUR'}/modules.alias"; + +open(ALIASES, "< $aliases") or die "Could not open $aliases"; + +while () { + chomp; + ($junk, $alias, $module) = split; + + if (defined($map{$alias})) { + print " $map{$alias}/$module : $alias\n"; + } + $map{$alias} = $module; +} + +exit(0); --- linux-2.6.24.orig/debian/tests/README +++ linux-2.6.24/debian/tests/README @@ -0,0 +1,21 @@ +Scripts placed in this directory get called one at a time by run-parts(8). +The scripts are expected to perform some sort of sanity checks on the +finished build. Scripts will be called once for each flavour. + +Some environment variables are exported to make life a little easier: + +DPKG_ARCH : The dpkg architecture (e.g. "amd64") +KERN_ARCH : The kernel architecture (e.g. "x86_64") +FLAVOUR : The specific flavour for this run (e.g. "generic") +VERSION : The full version of this build (e.g. 2.6.22-1) +REVISION : The exact revision of this build (e.g. 1.3) +PREV_REVISION : The revision prior to this one +ABI_NUM : The specific ABI number for this build (e.g. 2) +PREV_ABI_NUM : The previous ABI number. Can be the same as ABI_NUM. +BUILD_DIR : The directory where this build too place +INSTALL_DIR : The directory where the package is prepared +SOURCE_DIR : Where the main kernel source is + +Scripts are expected to have a zero exit status when no problems occur, +and non-zero when an error occurs that should stop the build. Scripts +should print whatever info they deem needed to deduce the problem. --- linux-2.6.24.orig/debian/config/powerpc/config.powerpc-smp +++ linux-2.6.24/debian/config/powerpc/config.powerpc-smp @@ -0,0 +1,206 @@ +# +# Config options for config.powerpc-smp automatically generated by splitconfig.pl +# +# CONFIG_40x is not set +# CONFIG_44x is not set +CONFIG_6xx=y +CONFIG_ADB=y +CONFIG_ADB_CUDA=y +CONFIG_ADB_MACIO=y +CONFIG_ADB_PMU_LED=y +# CONFIG_ADB_PMU_LED_IDE is not set +# CONFIG_ADVANCED_OPTIONS is not set +CONFIG_AEDSP16_MSS=y +# CONFIG_AEDSP16_SBPRO is not set +CONFIG_ANSLCD=m +CONFIG_APM_EMULATION=m +CONFIG_APM_POWER=m +CONFIG_ARCH_FLATMEM_ENABLE=y +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_IA=m +# CONFIG_ATM_IA_DEBUG is not set +CONFIG_ATM_NICSTAR=m +# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set +# CONFIG_ATM_NICSTAR_USE_SUNI is not set +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_BATTERY_PMU=m +CONFIG_BAYCOM_EPP=m +# CONFIG_BDI_SWITCH is not set +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_DEV_IDECS=m +CONFIG_BMAC=m +CONFIG_BOOT_LOAD=0x00800000 +CONFIG_BRIQ_PANEL=m +CONFIG_CLASSIC32=y +CONFIG_CPUSETS=y +CONFIG_CPU_FREQ_DEBUG=y +CONFIG_CPU_FREQ_PMAC=y +# CONFIG_DEBUG_HIGHMEM is not set +# CONFIG_DEBUG_PAGEALLOC is not set +CONFIG_DEVICE_TREE="" +# CONFIG_E200 is not set +CONFIG_FB_CONTROL=y +CONFIG_FB_CT65550=y +CONFIG_FB_IMSTT=y +CONFIG_FB_PLATINUM=y +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +CONFIG_FB_VALKYRIE=y +CONFIG_FEC_MPC52xx=m +CONFIG_FEC_MPC52xx_MDIO=y +CONFIG_FLATMEM=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_FSL_SOC=y +# CONFIG_GENERIC_IOMAP is not set +CONFIG_GENERIC_NVRAM=y +CONFIG_GENERIC_TBSYNC=y +CONFIG_HIGHMEM=y +CONFIG_HIGHMEM_START=0xfe000000 +CONFIG_HOTPLUG_CPU=y +# CONFIG_HUGETLB_PAGE is not set +CONFIG_I2C_HYDRA=m +CONFIG_I2C_MPC=m +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_IBMLS=m +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +CONFIG_INPUT_ADBHID=y +# CONFIG_IRQ_ALL_CPUS is not set +# CONFIG_ISA is not set +CONFIG_KERNEL_START=0xc0000000 +CONFIG_LANMEDIA=m +# CONFIG_LBD is not set +CONFIG_LEDS_CLASS=y +CONFIG_LOCK_KERNEL=y +CONFIG_LOWMEM_SIZE=0x30000000 +# CONFIG_LSF is not set +CONFIG_MACE=m +# CONFIG_MACE_AAUI_PORT is not set +CONFIG_MAC_FLOPPY=m +# CONFIG_MMIO_NVRAM is not set +CONFIG_MPC5200_WDT=m +CONFIG_MV643XX_ETH=m +CONFIG_NR_CPUS=4 +CONFIG_NVRAM=y +CONFIG_PARIDE_BPCK6=m +CONFIG_PATA_MPC52xx=m +CONFIG_PCMCIA_AHA152X=m +CONFIG_PCMCIA_IBMTR=m +CONFIG_PCMCIA_NINJA_SCSI=m +CONFIG_PMAC_APM_EMU=m +CONFIG_PMAC_BACKLIGHT=y +CONFIG_PMAC_BACKLIGHT_LEGACY=y +CONFIG_PMAC_MEDIABAY=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PPC32=y +# CONFIG_PPC601_SYNC_FIX is not set +# CONFIG_PPC64 is not set +# CONFIG_PPC_85xx is not set +# CONFIG_PPC_8xx is not set +# CONFIG_PPC_970_NAP is not set +CONFIG_PPC_BESTCOMM=m +CONFIG_PPC_BESTCOMM_ATA=m +CONFIG_PPC_BESTCOMM_FEC=m +# CONFIG_PPC_BESTCOMM_GEN_BD is not set +# CONFIG_PPC_CELL is not set +# CONFIG_PPC_CELL_NATIVE is not set +CONFIG_PPC_CHRP=y +CONFIG_PPC_CLOCK=y +# CONFIG_PPC_DCR_MMIO is not set +CONFIG_PPC_EFIKA=y +# CONFIG_PPC_INDIRECT_IO is not set +CONFIG_PPC_INDIRECT_PCI=y +CONFIG_PPC_LIB_RHEAP=y +CONFIG_PPC_LITE5200=y +# CONFIG_PPC_MM_SLICES is not set +CONFIG_PPC_MPC106=y +CONFIG_PPC_MPC5200=y +# CONFIG_PPC_MPC5200_BUGFIX is not set +CONFIG_PPC_MPC52xx=y +CONFIG_PPC_STD_MMU_32=y +CONFIG_PREEMPT_BKL=y +CONFIG_PROC_PID_CPUSET=y +CONFIG_PSS_MIXER=y +# CONFIG_RTAS_ERROR_LOGGING is not set +CONFIG_SC6600=y +CONFIG_SC6600_CDROM=4 +CONFIG_SC6600_CDROMBASE=0 +CONFIG_SC6600_JOY=y +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_BUSLOGIC=m +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_DPT_I2O=m +CONFIG_SCSI_MAC53C94=m +CONFIG_SCSI_MESH=m +CONFIG_SCSI_MESH_RESET_DELAY_MS=4000 +CONFIG_SCSI_MESH_SYNC_RATE=5 +CONFIG_SCSI_NSP32=m +# CONFIG_SCSI_OMIT_FLASHPOINT is not set +CONFIG_SENSORS_AMS=m +CONFIG_SENSORS_AMS_I2C=y +CONFIG_SENSORS_AMS_PMU=y +CONFIG_SENSORS_M41T00=m +CONFIG_SERIAL_MPC52xx=m +CONFIG_SERIAL_PMACZILOG=m +# CONFIG_SERIAL_PMACZILOG_TTYS is not set +CONFIG_SERIAL_UARTLITE=m +CONFIG_SERIO_I8042=y +CONFIG_SMP=y +CONFIG_SOUND_AEDSP16=m +CONFIG_SOUND_DMAP=y +CONFIG_SOUND_KAHLUA=m +CONFIG_SOUND_MPU401=m +CONFIG_SOUND_MSS=m +CONFIG_SOUND_OSS=m +CONFIG_SOUND_PAS=m +CONFIG_SOUND_PSS=m +CONFIG_SOUND_SB=m +CONFIG_SOUND_SSCAPE=m +# CONFIG_SOUND_TRACEINIT is not set +CONFIG_SOUND_TRIX=m +CONFIG_SOUND_UART6850=m +CONFIG_SOUND_VMIDI=m +CONFIG_SOUND_YM3812=m +# CONFIG_SPARSEMEM_MANUAL is not set +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +CONFIG_SPI_MPC52xx_PSC=m +CONFIG_STOP_MACHINE=y +CONFIG_SUSPEND_SMP_POSSIBLE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TASK_SIZE=0xc0000000 +CONFIG_TAU=y +# CONFIG_TAU_AVERAGE is not set +# CONFIG_TAU_INT is not set +CONFIG_THERM_ADT746X=m +CONFIG_THERM_WINDTUNNEL=m +CONFIG_TLAN=m +CONFIG_TOSHIBA_FIR=m +# CONFIG_UDBG_RTAS_CONSOLE is not set +# CONFIG_USB_OHCI_HCD_PPC_SOC is not set +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-6.10-powerpc-smp" +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VIRT_TO_BUS=y +CONFIG_WANT_DEVICE_TREE=y +CONFIG_WORD_SIZE=32 --- linux-2.6.24.orig/debian/config/powerpc/config.powerpc +++ linux-2.6.24/debian/config/powerpc/config.powerpc @@ -0,0 +1,216 @@ +# +# Config options for config.powerpc automatically generated by splitconfig.pl +# +# CONFIG_40x is not set +# CONFIG_44x is not set +CONFIG_6xx=y +CONFIG_ACT200L_DONGLE_OLD=m +CONFIG_ACTISYS_DONGLE_OLD=m +CONFIG_ADB=y +CONFIG_ADB_CUDA=y +CONFIG_ADB_MACIO=y +CONFIG_ADB_PMU_LED=y +# CONFIG_ADB_PMU_LED_IDE is not set +# CONFIG_ADVANCED_OPTIONS is not set +CONFIG_AEDSP16_MSS=y +# CONFIG_AEDSP16_SBPRO is not set +CONFIG_ANSLCD=m +CONFIG_APM_EMULATION=m +CONFIG_APM_POWER=m +CONFIG_ARCH_FLATMEM_ENABLE=y +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_IA=m +# CONFIG_ATM_IA_DEBUG is not set +CONFIG_ATM_NICSTAR=m +# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set +# CONFIG_ATM_NICSTAR_USE_SUNI is not set +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_BATTERY_PMU=m +CONFIG_BAYCOM_EPP=m +# CONFIG_BDI_SWITCH is not set +CONFIG_BLK_CPQ_DA=m +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BMAC=m +CONFIG_BOOT_LOAD=0x00800000 +CONFIG_BRIQ_PANEL=m +CONFIG_BROKEN_ON_SMP=y +CONFIG_CLASSIC32=y +CONFIG_CPU_FREQ_DEBUG=y +CONFIG_CPU_FREQ_PMAC=y +# CONFIG_DEBUG_HIGHMEM is not set +CONFIG_DEVICE_TREE="" +CONFIG_DONGLE_OLD=y +# CONFIG_E200 is not set +# CONFIG_EMBEDDED6xx is not set +CONFIG_ESI_DONGLE_OLD=m +CONFIG_FB_CONTROL=y +CONFIG_FB_CT65550=y +CONFIG_FB_IMSTT=y +CONFIG_FB_PLATINUM=y +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +CONFIG_FB_VALKYRIE=y +CONFIG_FEC_MPC52xx=m +CONFIG_FEC_MPC52xx_MDIO=y +CONFIG_FLATMEM=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_FSL_SOC=y +# CONFIG_GENERIC_IOMAP is not set +CONFIG_GENERIC_NVRAM=y +# CONFIG_GENERIC_TBSYNC is not set +CONFIG_GIRBIL_DONGLE_OLD=m +CONFIG_HIBERNATION=y +CONFIG_HIBERNATION_UP_POSSIBLE=y +CONFIG_HIGHMEM=y +CONFIG_HIGHMEM_START=0xfe000000 +# CONFIG_HUGETLB_PAGE is not set +CONFIG_I2C_HYDRA=m +CONFIG_I2C_MPC=m +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_IBMLS=m +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +CONFIG_INPUT_ADBHID=y +CONFIG_IRPORT_SIR=m +# CONFIG_ISA is not set +CONFIG_ISTALLION=m +CONFIG_KERNEL_START=0xc0000000 +CONFIG_LANMEDIA=m +# CONFIG_LBD is not set +CONFIG_LEDS_CLASS=y +CONFIG_LITELINK_DONGLE_OLD=m +CONFIG_LOWMEM_SIZE=0x30000000 +# CONFIG_LSF is not set +CONFIG_MA600_DONGLE_OLD=m +CONFIG_MACE=m +# CONFIG_MACE_AAUI_PORT is not set +CONFIG_MAC_FLOPPY=m +CONFIG_MCP2120_DONGLE_OLD=m +# CONFIG_MMIO_NVRAM is not set +CONFIG_MPC5200_WDT=m +CONFIG_MV643XX_ETH=m +CONFIG_NVRAM=y +CONFIG_OLD_BELKIN_DONGLE_OLD=m +CONFIG_PARIDE_BPCK6=m +CONFIG_PATA_MPC52xx=m +CONFIG_PCMCIA_AHA152X=m +CONFIG_PCMCIA_IBMTR=m +CONFIG_PCMCIA_NINJA_SCSI=m +CONFIG_PCMCIA_XIRTULIP=m +CONFIG_PMAC_APM_EMU=m +CONFIG_PMAC_BACKLIGHT=y +CONFIG_PMAC_BACKLIGHT_LEGACY=y +CONFIG_PMAC_MEDIABAY=y +CONFIG_PM_STD_PARTITION="" +CONFIG_PPC32=y +# CONFIG_PPC601_SYNC_FIX is not set +# CONFIG_PPC64 is not set +# CONFIG_PPC_85xx is not set +# CONFIG_PPC_8xx is not set +# CONFIG_PPC_970_NAP is not set +CONFIG_PPC_BESTCOMM=m +CONFIG_PPC_BESTCOMM_ATA=m +CONFIG_PPC_BESTCOMM_FEC=m +CONFIG_PPC_BESTCOMM_GEN_BD=m +# CONFIG_PPC_CELL is not set +# CONFIG_PPC_CELL_NATIVE is not set +CONFIG_PPC_CHRP=y +CONFIG_PPC_CLOCK=y +# CONFIG_PPC_DCR_MMIO is not set +CONFIG_PPC_EFIKA=y +# CONFIG_PPC_INDIRECT_IO is not set +CONFIG_PPC_INDIRECT_PCI=y +CONFIG_PPC_LIB_RHEAP=y +CONFIG_PPC_LITE5200=y +# CONFIG_PPC_MM_SLICES is not set +CONFIG_PPC_MPC106=y +CONFIG_PPC_MPC5200=y +# CONFIG_PPC_MPC5200_BUGFIX is not set +CONFIG_PPC_MPC52xx=y +CONFIG_PPC_STD_MMU_32=y +CONFIG_PSS_MIXER=y +CONFIG_RISCOM8=m +# CONFIG_RTAS_ERROR_LOGGING is not set +CONFIG_SC6600=y +CONFIG_SC6600_CDROM=4 +CONFIG_SC6600_CDROMBASE=0 +CONFIG_SC6600_JOY=y +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_BUSLOGIC=m +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_DPT_I2O=m +CONFIG_SCSI_MAC53C94=m +CONFIG_SCSI_MESH=m +CONFIG_SCSI_MESH_RESET_DELAY_MS=4000 +CONFIG_SCSI_MESH_SYNC_RATE=5 +CONFIG_SCSI_NSP32=m +# CONFIG_SCSI_OMIT_FLASHPOINT is not set +CONFIG_SENSORS_AMS=m +CONFIG_SENSORS_AMS_I2C=y +CONFIG_SENSORS_AMS_PMU=y +CONFIG_SENSORS_M41T00=m +CONFIG_SERIAL_MPC52xx=m +CONFIG_SERIAL_PMACZILOG=m +# CONFIG_SERIAL_PMACZILOG_TTYS is not set +CONFIG_SERIAL_UARTLITE=m +CONFIG_SERIO_I8042=y +# CONFIG_SMP is not set +CONFIG_SOUND_AEDSP16=m +CONFIG_SOUND_DMAP=y +CONFIG_SOUND_KAHLUA=m +CONFIG_SOUND_MPU401=m +CONFIG_SOUND_MSS=m +CONFIG_SOUND_OSS=m +CONFIG_SOUND_PAS=m +CONFIG_SOUND_PSS=m +CONFIG_SOUND_SB=m +CONFIG_SOUND_SSCAPE=m +# CONFIG_SOUND_TRACEINIT is not set +CONFIG_SOUND_TRIX=m +CONFIG_SOUND_UART6850=m +CONFIG_SOUND_VMIDI=m +CONFIG_SOUND_YM3812=m +# CONFIG_SPARSEMEM_MANUAL is not set +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +CONFIG_SPI_MPC52xx_PSC=m +CONFIG_STALLION=m +CONFIG_SUSPEND_UP_POSSIBLE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TASK_SIZE=0xc0000000 +CONFIG_TAU=y +# CONFIG_TAU_AVERAGE is not set +# CONFIG_TAU_INT is not set +CONFIG_TEKRAM_DONGLE_OLD=m +CONFIG_THERM_ADT746X=m +CONFIG_THERM_WINDTUNNEL=m +CONFIG_TLAN=m +CONFIG_TOSHIBA_FIR=m +# CONFIG_UDBG_RTAS_CONSOLE is not set +# CONFIG_USB_OHCI_HCD_PPC_SOC is not set +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-6.10-powerpc" +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VIRT_TO_BUS=y +CONFIG_WANT_DEVICE_TREE=y +CONFIG_WORD_SIZE=32 --- linux-2.6.24.orig/debian/config/powerpc/config.powerpc64-smp +++ linux-2.6.24/debian/config/powerpc/config.powerpc64-smp @@ -0,0 +1,182 @@ +# +# Config options for config.powerpc64-smp automatically generated by splitconfig.pl +# +CONFIG_64BIT=y +# CONFIG_ADB_PMU_LED is not set +CONFIG_ARCH_HAS_ILOG2_U64=y +CONFIG_ARCH_MEMORY_PROBE=y +CONFIG_ARCH_NO_VIRT_TO_BUS=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ATA_NONSTANDARD=y +CONFIG_AXON_RAM=m +CONFIG_BLK_DEV_IDECS=m +CONFIG_BLOCK_COMPAT=y +# CONFIG_CBE_CPUFREQ is not set +CONFIG_CBE_RAS=y +CONFIG_CBE_THERM=m +CONFIG_COMPAT=y +CONFIG_CPUSETS=y +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_PMAC64=y +# CONFIG_CRASH_DUMP is not set +CONFIG_EDAC_PASEMI=m +CONFIG_EEH=y +CONFIG_EHEA=m +CONFIG_ELECTRA_CF=m +CONFIG_ELECTRA_IDE=m +# CONFIG_FB_IMSTT is not set +CONFIG_FB_PS3=y +CONFIG_FB_PS3_DEFAULT_SIZE_M=18 +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_SYS_IMAGEBLIT=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_FORCE_MAX_ZONEORDER=13 +CONFIG_GELIC_NET=m +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_TBSYNC=y +CONFIG_HANGCHECK_TIMER=m +CONFIG_HAVE_MEMORY_PRESENT=y +# CONFIG_HCALL_STATS is not set +CONFIG_HIBERNATION=y +CONFIG_HIBERNATION_SMP_POSSIBLE=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y +CONFIG_HVCS=m +CONFIG_HVC_CONSOLE=y +CONFIG_HVC_DRIVER=y +CONFIG_HW_RANDOM_PASEMI=m +CONFIG_I2C_PASEMI=m +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +CONFIG_IBMEBUS=y +CONFIG_IBMVETH=m +CONFIG_IBMVIO=y +CONFIG_IBM_NEW_EMAC=m +# CONFIG_IBM_NEW_EMAC_DEBUG is not set +CONFIG_IBM_NEW_EMAC_EMAC4=y +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32 +CONFIG_IBM_NEW_EMAC_RGMII=y +CONFIG_IBM_NEW_EMAC_RXB=128 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0 +CONFIG_IBM_NEW_EMAC_TAH=y +CONFIG_IBM_NEW_EMAC_TXB=64 +CONFIG_IBM_NEW_EMAC_ZMII=y +CONFIG_INFINIBAND_EHCA=m +CONFIG_INFINIBAND_IPATH=m +# CONFIG_IOMMU_VMERGE is not set +# CONFIG_IRQSTACKS is not set +CONFIG_IRQ_ALL_CPUS=y +CONFIG_KERNEL_START=0xc000000000000000 +CONFIG_KEYS_COMPAT=y +CONFIG_LEDS_CLASS=m +CONFIG_LOCK_KERNEL=y +CONFIG_LPARCFG=y +CONFIG_MEMORY_HOTPLUG=y +CONFIG_MEMORY_HOTPLUG_SPARSE=y +CONFIG_MIGRATION=y +CONFIG_MMC_SPI=m +CONFIG_MMIO_NVRAM=y +CONFIG_MPIC_BROKEN_REGREAD=y +CONFIG_MPIC_U3_HT_IRQS=y +CONFIG_NEED_MULTIPLE_NODES=y +CONFIG_NODES_SHIFT=4 +CONFIG_NODES_SPAN_OTHER_NODES=y +CONFIG_NR_CPUS=32 +CONFIG_NUMA=y +CONFIG_OPROFILE_CELL=y +CONFIG_PASEMI_MAC=m +CONFIG_PATA_PLATFORM=m +CONFIG_PMAC_SMU=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PM_STD_PARTITION="" +CONFIG_POWER3=y +CONFIG_POWER4=y +# CONFIG_POWER4_ONLY is not set +CONFIG_PPC64=y +CONFIG_PPC64_SWSUSP=y +# CONFIG_PPC_64K_PAGES is not set +CONFIG_PPC_970_NAP=y +CONFIG_PPC_CELL=y +# CONFIG_PPC_CELLEB is not set +CONFIG_PPC_CELL_NATIVE=y +# CONFIG_PPC_CLOCK is not set +CONFIG_PPC_DCR=y +CONFIG_PPC_DCR_MMIO=y +CONFIG_PPC_HAS_HASH_64K=y +CONFIG_PPC_IBM_CELL_BLADE=y +CONFIG_PPC_INDIRECT_IO=y +# CONFIG_PPC_INDIRECT_PCI is not set +# CONFIG_PPC_ISERIES is not set +CONFIG_PPC_MAPLE=y +CONFIG_PPC_MM_SLICES=y +# CONFIG_PPC_MPC106 is not set +# CONFIG_PPC_MPC5200 is not set +# CONFIG_PPC_MPC52xx is not set +CONFIG_PPC_OF_PLATFORM_PCI=y +CONFIG_PPC_PASEMI=y +CONFIG_PPC_PASEMI_CPUFREQ=y +CONFIG_PPC_PASEMI_IOMMU=y +# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set +CONFIG_PPC_PASEMI_MDIO=m +CONFIG_PPC_PMAC64=y +CONFIG_PPC_PMI=m +CONFIG_PPC_PS3=y +CONFIG_PPC_PSERIES=y +CONFIG_PPC_SPLPAR=y +CONFIG_PREEMPT_BKL=y +CONFIG_PROC_PID_CPUSET=y +# CONFIG_PS3_ADVANCED is not set +CONFIG_PS3_DISK=m +# CONFIG_PS3_DYNAMIC_DMA is not set +CONFIG_PS3_FLASH=m +CONFIG_PS3_HTAB_SIZE=20 +CONFIG_PS3_PS3AV=y +CONFIG_PS3_ROM=m +CONFIG_PS3_STORAGE=m +CONFIG_PS3_SYS_MANAGER=y +CONFIG_PS3_USE_LPAR_ADDR=y +CONFIG_PS3_VUART=y +CONFIG_RTAS_ERROR_LOGGING=y +CONFIG_RTAS_FLASH=m +CONFIG_SCANLOG=m +CONFIG_SCHED_SMT=y +# CONFIG_SCSI_DC390T is not set +CONFIG_SCSI_IBMVSCSI=m +CONFIG_SCSI_IBMVSCSIS=m +CONFIG_SERIAL_ICOM=m +# CONFIG_SERIAL_PMACZILOG is not set +# CONFIG_SERIO_I8042 is not set +CONFIG_SMP=y +CONFIG_SND_PS3=m +CONFIG_SND_PS3_DEFAULT_START_DELAY=2000 +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPIDER_NET=m +CONFIG_SPU_BASE=y +CONFIG_SPU_FS=m +CONFIG_SPU_FS_64K_LS=y +CONFIG_STOP_MACHINE=y +CONFIG_SUSPEND_SMP_POSSIBLE=y +CONFIG_SYSVIPC_COMPAT=y +CONFIG_THERM_PM72=m +# CONFIG_TUNE_CELL is not set +CONFIG_U3_DART=y +CONFIG_UDBG_RTAS_CONSOLE=y +CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-6.10-powerpc64-smp" +CONFIG_VIRT_CPU_ACCOUNTING=y +# CONFIG_WANT_DEVICE_TREE is not set +CONFIG_WINDFARM_PM112=m +CONFIG_WINDFARM_PM81=m +CONFIG_WINDFARM_PM91=m +CONFIG_WORD_SIZE=64 +CONFIG_XICS=y --- linux-2.6.24.orig/debian/config/powerpc/config +++ linux-2.6.24/debian/config/powerpc/config @@ -0,0 +1,2715 @@ +# +# Common config options automatically generated by splitconfig.pl +# +CONFIG_3C359=m +CONFIG_6PACK=m +CONFIG_8139CP=m +CONFIG_8139TOO=m +CONFIG_8139TOO_8129=y +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_9P_FS=m +CONFIG_ABYSS=m +CONFIG_AC97_BUS=m +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_ACORN_PARTITION=y +# CONFIG_ACORN_PARTITION_ADFS is not set +# CONFIG_ACORN_PARTITION_CUMANA is not set +# CONFIG_ACORN_PARTITION_EESOX is not set +CONFIG_ACORN_PARTITION_ICS=y +# CONFIG_ACORN_PARTITION_POWERTEC is not set +CONFIG_ACORN_PARTITION_RISCIX=y +CONFIG_ACT200L_DONGLE=m +CONFIG_ACTISYS_DONGLE=m +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_ADB_PMU=y +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_ADM8211=m +CONFIG_AFFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_AFS_FS=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_AGP=m +CONFIG_AGP_UNINORTH=m +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +CONFIG_AIC79XX_DEBUG_ENABLE=y +CONFIG_AIC79XX_DEBUG_MASK=0 +CONFIG_AIC79XX_REG_PRETTY_PRINT=y +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_DEBUG_ENABLE=y +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_AIRO=m +CONFIG_AIRO_CS=m +CONFIG_ALI_FIR=m +CONFIG_ALTIVEC=y +# CONFIG_AMD8111E_NAPI is not set +CONFIG_AMD8111_ETH=m +CONFIG_AMIGA_PARTITION=y +CONFIG_ANON_INODES=y +CONFIG_APPLE_AIRPORT=m +CONFIG_APPLICOM=m +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_ARCH_HAS_ILOG2_U32=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_ARCH_SUPPORTS_MSI=y +CONFIG_ARCNET=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_ARCNET_COM20020_PCI=m +CONFIG_ARCNET_COM90xx=m +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RAW=m +CONFIG_ARCNET_RIM_I=m +# CONFIG_ARPD is not set +CONFIG_ASK_IP_FIB_HASH=y +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_ATA=m +CONFIG_ATALK=m +CONFIG_ATARI_PARTITION=y +CONFIG_ATA_GENERIC=m +CONFIG_ATA_OVER_ETH=m +CONFIG_ATA_PIIX=m +CONFIG_ATL1=m +CONFIG_ATM=y +CONFIG_ATMEL=m +CONFIG_ATM_BR2684=m +# CONFIG_ATM_BR2684_IPFILTER is not set +CONFIG_ATM_CLIP=y +# CONFIG_ATM_CLIP_NO_ICMP is not set +CONFIG_ATM_DRIVERS=y +# CONFIG_ATM_DUMMY is not set +CONFIG_ATM_ENI=m +# CONFIG_ATM_ENI_DEBUG is not set +# CONFIG_ATM_ENI_TUNE_BURST is not set +CONFIG_ATM_FORE200E=m +CONFIG_ATM_FORE200E_DEBUG=0 +CONFIG_ATM_FORE200E_MAYBE=m +CONFIG_ATM_FORE200E_PCA=y +CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y +CONFIG_ATM_FORE200E_TX_RETRY=16 +# CONFIG_ATM_FORE200E_USE_TASKLET is not set +CONFIG_ATM_HE=m +CONFIG_ATM_HE_USE_SUNI=y +CONFIG_ATM_IDT77252=m +# CONFIG_ATM_IDT77252_DEBUG is not set +# CONFIG_ATM_IDT77252_RCV_ALL is not set +CONFIG_ATM_IDT77252_USE_SUNI=y +CONFIG_ATM_LANAI=m +CONFIG_ATM_LANE=m +CONFIG_ATM_MPOA=m +CONFIG_ATM_TCP=m +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_ARCH=y +CONFIG_AUDIT_TREE=y +CONFIG_AUTOFS4_FS=m +CONFIG_AUTOFS_FS=m +CONFIG_AUXDISPLAY=y +CONFIG_AX25=m +CONFIG_AX25_DAMA_SLAVE=y +CONFIG_B43=m +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PIO=y +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_B43_DEBUG=y +CONFIG_B43_DMA=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +CONFIG_B43_LEDS=y +CONFIG_B43_PCICORE_AUTOSELECT=y +CONFIG_B43_PCI_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_PIO=y +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43_RFKILL=y +CONFIG_B44=m +CONFIG_B44_PCI=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BASE_FULL=y +CONFIG_BASE_SMALL=0 +CONFIG_BATTERY_DS2760=m +CONFIG_BAYCOM_PAR=m +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +CONFIG_BCM43XX_PIO=y +# CONFIG_BCM43XX_PIO_MODE is not set +# CONFIG_BEFS_DEBUG is not set +CONFIG_BEFS_FS=m +CONFIG_BFS_FS=m +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m +CONFIG_BITREVERSE=y +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_BLK_DEV=y +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI15X3=m +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_BSG is not set +CONFIG_BLK_DEV_CMD64X=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_CRYPTOLOOP=m +# CONFIG_BLK_DEV_CS5520 is not set +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_CY82C693=m +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_DM=m +CONFIG_BLK_DEV_FD=m +CONFIG_BLK_DEV_GENERIC=m +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_HPT34X=m +CONFIG_BLK_DEV_HPT366=m +CONFIG_BLK_DEV_IDE=y +CONFIG_BLK_DEV_IDECD=m +CONFIG_BLK_DEV_IDEDISK=m +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_IDEDMA_PMAC=y +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDETAPE=m +CONFIG_BLK_DEV_IDE_PMAC=y +CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_BLK_DEV_IT8213=m +CONFIG_BLK_DEV_IT821X=m +CONFIG_BLK_DEV_JMICRON=m +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_MD=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_NS87415=m +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_OPTI621 is not set +CONFIG_BLK_DEV_PDC202XX_NEW=m +CONFIG_BLK_DEV_PDC202XX_OLD=m +CONFIG_BLK_DEV_PIIX=m +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_BLK_DEV_SC1200=m +CONFIG_BLK_DEV_SD=m +CONFIG_BLK_DEV_SIIMAGE=m +CONFIG_BLK_DEV_SL82C105=m +CONFIG_BLK_DEV_SLC90E66=m +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_BLK_DEV_SVWKS=m +CONFIG_BLK_DEV_SX8=m +CONFIG_BLK_DEV_TC86C001=m +CONFIG_BLK_DEV_TRIFLEX=m +CONFIG_BLK_DEV_TRM290=m +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_UMEM=m +# CONFIG_BLK_DEV_VIA82CXXX is not set +CONFIG_BLOCK=y +CONFIG_BNX2=m +CONFIG_BONDING=m +# CONFIG_BOOTX_TEXT is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_BOUNCE=y +CONFIG_BPQETHER=m +CONFIG_BRIDGE=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_NETFILTER=y +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BROADCOM_PHY=m +CONFIG_BSD_DISKLABEL=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_BT=m +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +CONFIG_BT_HCIVHCI=m +CONFIG_BT_HIDP=m +CONFIG_BT_L2CAP=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_SCO=m +CONFIG_BUG=y +CONFIG_CARDBUS=y +# CONFIG_CARDMAN_4000 is not set +# CONFIG_CARDMAN_4040 is not set +CONFIG_CASSINI=m +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_CFG80211=m +CONFIG_CGROUPS=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_CGROUP_DEBUG is not set +CONFIG_CGROUP_NS=y +CONFIG_CHECK_SIGNATURE=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_CHR_DEV_OSST=m +CONFIG_CHR_DEV_SCH=m +CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_ST=m +CONFIG_CICADA_PHY=m +CONFIG_CIFS=m +# CONFIG_CIFS_DEBUG2 is not set +CONFIG_CIFS_EXPERIMENTAL=y +# CONFIG_CIFS_STATS is not set +CONFIG_CIFS_UPCALL=y +CONFIG_CIFS_WEAK_PW_HASH=y +# CONFIG_CIFS_XATTR is not set +CONFIG_CISS_SCSI_TAPE=y +CONFIG_CLS_U32_MARK=y +# CONFIG_CLS_U32_PERF is not set +# CONFIG_CMDLINE_BOOL is not set +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set +CONFIG_COMPUTONE=m +CONFIG_CONFIGFS_FS=m +CONFIG_CONNECTOR=m +# CONFIG_CPM2 is not set +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_FREQ_TABLE=y +CONFIG_CRAMFS=y +CONFIG_CRC16=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_CRC_CCITT=m +CONFIG_CRC_ITU_T=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_XTS=m +CONFIG_CYCLADES=m +CONFIG_CYCLADES_SYNC=m +CONFIG_CYCLOMX_X25=y +# CONFIG_CYZ_INTR is not set +CONFIG_DAB=y +CONFIG_DAVICOM_PHY=m +CONFIG_DE2104X=m +CONFIG_DE4X5=m +CONFIG_DE600=m +CONFIG_DE620=m +# CONFIG_DEBUGGER is not set +CONFIG_DEBUG_BUGVERBOSE=y +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_FS=y +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_VM is not set +CONFIG_DECNET=m +CONFIG_DECNET_NF_GRABULATOR=m +# CONFIG_DECNET_ROUTER is not set +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_BIC is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_CUBIC is not set +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_HTCP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 +CONFIG_DEFAULT_RENO=y +CONFIG_DEFAULT_TCP_CONG="reno" +# CONFIG_DEFAULT_UIMAGE is not set +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_DEVPORT=y +CONFIG_DEV_APPLETALK=m +# CONFIG_DEV_KMEM is not set +CONFIG_DIGIEPCA=m +# CONFIG_DISCONTIGMEM_MANUAL is not set +CONFIG_DISPLAY_SUPPORT=m +CONFIG_DL2K=m +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +CONFIG_DM9102=m +CONFIG_DM_CRYPT=m +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_DELAY is not set +CONFIG_DM_MIRROR=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_MULTIPATH_HP=m +CONFIG_DM_MULTIPATH_RDAC=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_UEVENT=y +CONFIG_DM_ZERO=m +CONFIG_DNOTIFY=y +CONFIG_DONGLE=y +CONFIG_DRM=m +CONFIG_DRM_MGA=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_SAVAGE=m +CONFIG_DRM_SIS=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_VIA=m +# CONFIG_DRM_VIA_CHROME9 is not set +CONFIG_DS1682=m +CONFIG_DSCC4=m +CONFIG_DSCC4_PCISYNC=y +CONFIG_DSCC4_PCI_RST=y +CONFIG_DUMMY=m +CONFIG_DUMMY_CONSOLE=y +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_BT8XX=m +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_PATCH=m +CONFIG_DVB_CAPTURE_DRIVERS=y +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +# CONFIG_DVB_FE_CUSTOMISE is not set +CONFIG_DVB_ISL6421=m +CONFIG_DVB_L64781=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LNBP21=m +CONFIG_DVB_MT312=m +CONFIG_DVB_MT352=m +CONFIG_DVB_NXT200X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_PLL=m +CONFIG_DVB_PLUTO2=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_STV0297=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_USB=m +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_CXUSB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_VES1820=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_ZL10353=m +CONFIG_E100=m +CONFIG_E1000=m +CONFIG_E1000E=m +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000_NAPI=y +CONFIG_EARLY_PRINTK=y +CONFIG_ECONET=m +CONFIG_ECONET_AUNUDP=y +CONFIG_ECONET_NATIVE=y +CONFIG_ECRYPT_FS=m +CONFIG_EDAC=y +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_MM_EDAC=m +CONFIG_EEPRO100=m +CONFIG_EEPROM_93CX6=m +# CONFIG_EFI_PARTITION is not set +CONFIG_EFS_FS=m +CONFIG_ELF_CORE=y +# CONFIG_EMBEDDED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +# CONFIG_ENABLE_WARN_DEPRECATED is not set +CONFIG_EPIC100=m +CONFIG_EPOLL=y +CONFIG_EQUALIZER=m +CONFIG_ESI_DONGLE=m +CONFIG_EVENTFD=y +CONFIG_EXPERIMENTAL=y +CONFIG_EXPORTFS=m +CONFIG_EXT2_FS=m +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_FAIR_CGROUP_SCHED=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_FAIR_USER_SCHED is not set +CONFIG_FARSYNC=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_FAT_FS=m +# CONFIG_FAULT_INJECTION is not set +CONFIG_FB=y +CONFIG_FB_3DFX=y +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_ARK=m +CONFIG_FB_ASILIANT=y +CONFIG_FB_ATY=y +CONFIG_FB_ATY128=y +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +CONFIG_FB_CIRRUS=m +CONFIG_FB_CYBER2000=m +CONFIG_FB_DDC=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_IBM_GXT4500=m +CONFIG_FB_KYRO=m +CONFIG_FB_MACMODES=y +CONFIG_FB_MATROX=y +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_BACKLIGHT=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_I2C=y +CONFIG_FB_OF=y +CONFIG_FB_PM2=m +CONFIG_FB_PM2_FIFO_DISCONNECT=y +CONFIG_FB_PM3=m +CONFIG_FB_RADEON=y +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_BACKLIGHT=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_I2C=y +CONFIG_FB_S1D13XXX=m +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_SM501=m +CONFIG_FB_SVGALIB=m +CONFIG_FB_TILEBLITTING=y +CONFIG_FB_TRIDENT=m +CONFIG_FB_TRIDENT_ACCEL=y +CONFIG_FB_UVESA=m +# CONFIG_FB_VGA16 is not set +# CONFIG_FB_VIRTUAL is not set +CONFIG_FB_VOODOO1=y +CONFIG_FB_VT8623=m +CONFIG_FDDI=y +CONFIG_FEALNX=m +CONFIG_FIB_RULES=y +# CONFIG_FIREWIRE is not set +CONFIG_FIRMWARE_EDID=y +CONFIG_FIXED_MII_1000_FDX=y +# CONFIG_FIXED_MII_100_FDX is not set +# CONFIG_FIXED_MII_10_FDX is not set +CONFIG_FIXED_MII_AMNT=1 +CONFIG_FIXED_PHY=m +# CONFIG_FONTS is not set +CONFIG_FONT_8x16=y +CONFIG_FONT_8x8=y +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +# CONFIG_FORCED_INLINING is not set +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FSL_ULI1575 is not set +CONFIG_FS_MBCACHE=m +CONFIG_FS_POSIX_ACL=y +CONFIG_FTL=m +CONFIG_FUSE_FS=m +CONFIG_FUSION=y +CONFIG_FUSION_CTL=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_SAS=m +CONFIG_FUSION_SPI=m +CONFIG_FUTEX=y +CONFIG_FW_LOADER=y +CONFIG_GACT_PROB=y +CONFIG_GAMEPORT=m +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GENERIC_ACL=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GEN_RTC=y +# CONFIG_GEN_RTC_X is not set +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_GIRBIL_DONGLE=m +CONFIG_HAMACHI=m +CONFIG_HAMRADIO=y +CONFIG_HAPPYMEAL=m +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HDLC=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +CONFIG_HDLC_X25=m +# CONFIG_HEADERS_CHECK is not set +CONFIG_HERMES=m +CONFIG_HFSPLUS_FS=m +CONFIG_HFS_FS=m +CONFIG_HID=m +CONFIG_HIDRAW=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HID_FF is not set +CONFIG_HID_SUPPORT=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_HIPPI=y +CONFIG_HOSTAP=m +CONFIG_HOSTAP_CS=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_PLX=m +CONFIG_HOTPLUG=y +# CONFIG_HOTPLUG_PCI is not set +CONFIG_HP100=m +CONFIG_HPFS_FS=m +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_HVC_RTAS is not set +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_HWMON_VID=m +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +# CONFIG_HZ_1000 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_300 is not set +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_ALGOPCA=m +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set +# CONFIG_I2C_DEBUG_CORE is not set +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PIIX4=m +CONFIG_I2C_POWERMAC=y +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TAOS_EVM=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m +CONFIG_I2O=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_BUS=m +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_PROC=m +CONFIG_I2O_SCSI=m +CONFIG_I82092=m +CONFIG_IBMOL=m +CONFIG_ICPLUS_PHY=m +CONFIG_IDE=y +# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_IDEPCI_PCIBUS_ORDER=y +CONFIG_IDEPCI_SHARE_IRQ=y +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_IDE_ARM is not set +CONFIG_IDE_GENERIC=m +CONFIG_IDE_PROC_FS=y +# CONFIG_IDE_TASK_IOCTL is not set +CONFIG_IEEE1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_OHCI1394=m +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_VERBOSEDEBUG is not set +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE80211=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_CRYPT_WEP=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_IFB=m +# CONFIG_IKCONFIG is not set +CONFIG_INET=y +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET_AH=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_INET_DIAG=y +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_LRO=m +CONFIG_INET_TCP_DIAG=y +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_ISER=m +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFTL=m +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_INPUT=y +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_EVBUG=m +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_MISC=y +CONFIG_INPUT_MOUSE=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_PCSPKR=m +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_TABLET=y +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_INPUT_UINPUT=m +CONFIG_INPUT_YEALINK=m +CONFIG_INSTRUMENTATION=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_CFQ=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_NOOP=y +CONFIG_IP1000=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_RAW=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IPDDP=m +CONFIG_IPDDP_DECAP=y +CONFIG_IPDDP_ENCAP=y +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_HANDLER=m +# CONFIG_IPMI_PANIC_EVENT is not set +CONFIG_IPMI_POWEROFF=m +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m +CONFIG_IPV6=m +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +CONFIG_IPW2100=m +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +CONFIG_IPW2200=m +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IPX=m +# CONFIG_IPX_INTERN is not set +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_DCCP=m +CONFIG_IP_DCCP_ACKVEC=y +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_IP_DCCP_TFRC_LIB=m +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_MROUTE=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARP_MANGLE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +# CONFIG_IP_PNP is not set +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +CONFIG_IP_SCTP=m +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_FTP=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_NQ=m +CONFIG_IP_VS_PROTO_AH=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_TAB_BITS=12 +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_WRR=m +CONFIG_IRCOMM=m +CONFIG_IRDA=m +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_DEBUG=y +CONFIG_IRDA_FAST_RR=y +CONFIG_IRDA_ULTRA=y +CONFIG_IRLAN=m +CONFIG_IRNET=m +CONFIG_IRQ_PER_CPU=y +CONFIG_IRTTY_SIR=m +CONFIG_ISA_DMA_API=y +CONFIG_ISCSI_TCP=m +# CONFIG_ISDN is not set +# CONFIG_ISI is not set +CONFIG_ISO9660_FS=m +# CONFIG_IWLWIFI is not set +CONFIG_IXGB=m +CONFIG_IXGBE=m +# CONFIG_IXGB_NAPI is not set +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_SUMMARY is not set +CONFIG_JFFS2_ZLIB=y +# CONFIG_JFS_DEBUG is not set +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +CONFIG_JFS_STATISTICS=y +CONFIG_JOLIET=y +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_IFORCE=m +CONFIG_JOYSTICK_IFORCE_232=y +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_KARMA_PARTITION=y +CONFIG_KEXEC=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +CONFIG_KINGSUN_DONGLE=m +CONFIG_KMOD=y +CONFIG_KPROBES=y +CONFIG_KS0108=m +CONFIG_KS0108_DELAY=2 +CONFIG_KS0108_PORT=0x378 +CONFIG_KS959_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +CONFIG_LAPB=m +CONFIG_LAPBETHER=m +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +# CONFIG_LDM_DEBUG is not set +CONFIG_LDM_PARTITION=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBCRC32C=m +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_CS=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_LIBERTAS_SDIO=m +CONFIG_LIBERTAS_USB=m +CONFIG_LITELINK_DONGLE=m +# CONFIG_LKDTM is not set +CONFIG_LLC=y +CONFIG_LLC2=m +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +# CONFIG_LOGO is not set +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_LP_CONSOLE is not set +CONFIG_LSM_MMAP_MIN_ADDR=0 +CONFIG_LXT_PHY=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +CONFIG_MA600_DONGLE=m +CONFIG_MAC80211=m +# CONFIG_MAC80211_DEBUG is not set +CONFIG_MAC80211_DEBUGFS=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MACVLAN=m +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_MAC_PARTITION=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_MARKERS is not set +CONFIG_MARVELL_PHY=m +CONFIG_MAX_RAW_DEVS=256 +CONFIG_MCP2120_DONGLE=m +CONFIG_MCS_FIR=m +CONFIG_MD=y +CONFIG_MDIO_BITBANG=m +CONFIG_MD_FAULTY=m +CONFIG_MD_LINEAR=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_SAS=m +CONFIG_MFD_SM501=m +CONFIG_MII=m +CONFIG_MINIX_FS=m +CONFIG_MINIX_SUBPARTITION=y +CONFIG_MISC_DEVICES=y +CONFIG_MKISS=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_MLX4_INFINIBAND=m +CONFIG_MMC=m +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_SDHCI=m +CONFIG_MMC_TIFM_SD=m +# CONFIG_MMC_UNSAFE_RESUME is not set +CONFIG_MMC_WBSD=m +CONFIG_MMU=y +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MOUSE_APPLETOUCH=m +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_PS2_TRACKPOINT=y +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_VSXXXAA=m +CONFIG_MOXA_INTELLIO=m +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +CONFIG_MPIC=y +# CONFIG_MPIC_WEIRD is not set +CONFIG_MSDOS_FS=m +CONFIG_MSDOS_PARTITION=y +CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin" +CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin" +CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin" +CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin" +# CONFIG_MSS is not set +CONFIG_MTD=m +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTD_ABSENT=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK2MTD=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_MTD_CFI=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_CHAR=m +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_CONCAT=m +CONFIG_MTD_DATAFLASH=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCECC=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCPROBE_ADDRESS=0 +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_GEN_PROBE=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_MAP_BANK_WIDTH_1=y +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +CONFIG_MTD_MAP_BANK_WIDTH_2=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTD_NAND=m +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND_IDS=m +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_2X_PROGRAM=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_SIM=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_OOPS=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_PCI=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_OF=m +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PLATRAM=m +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_RAM=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +CONFIG_MTD_REDBOOT_PARTS=m +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +CONFIG_MTD_ROM=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_MTD_UBI_GLUEBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MYRI10GE=m +CONFIG_NATSEMI=m +CONFIG_NCPFS_EXTRAS=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_OS2_NS=y +CONFIG_NCPFS_PACKET_SIGNING=y +# CONFIG_NCPFS_SMALLDOS is not set +CONFIG_NCPFS_STRONG=y +CONFIG_NCP_FS=m +CONFIG_NE2K_PCI=m +CONFIG_NET=y +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETDEVICES=y +CONFIG_NETDEVICES_MULTIQUEUE=y +CONFIG_NETDEV_1000=y +CONFIG_NETDEV_10000=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +# CONFIG_NETLABEL is not set +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NETROM=m +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NETWORK_SECMARK=y +CONFIG_NETXEN_NIC=m +CONFIG_NET_9P=m +# CONFIG_NET_9P_DEBUG is not set +CONFIG_NET_9P_FD=m +CONFIG_NET_ACT_GACT=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SIMP=m +CONFIG_NET_CLS=y +CONFIG_NET_CLS_ACT=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_FW=m +# CONFIG_NET_CLS_IND is not set +# CONFIG_NET_CLS_POLICE is not set +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_U32=m +CONFIG_NET_DCCPPROBE=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_ETHERNET=y +CONFIG_NET_FC=y +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_NET_IPIP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_NET_PCI=y +CONFIG_NET_PCMCIA=y +CONFIG_NET_PKTGEN=m +CONFIG_NET_POCKET=y +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_ATM=m +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_FIFO=y +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_TCPPROBE=m +CONFIG_NET_TULIP=y +CONFIG_NET_VENDOR_3COM=y +CONFIG_NEW_LEDS=y +CONFIG_NFSD=m +CONFIG_NFSD_TCP=y +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CT_NETLINK=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_TFTP=m +# CONFIG_NIU is not set +CONFIG_NL80211=y +CONFIG_NLS=y +CONFIG_NLS_ASCII=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m +# CONFIG_NORTEL_HERMES is not set +CONFIG_NO_HZ=y +CONFIG_NS83820=m +CONFIG_NSC_FIR=m +# CONFIG_NTFS_DEBUG is not set +CONFIG_NTFS_FS=m +# CONFIG_NTFS_RW is not set +CONFIG_N_HDLC=m +# CONFIG_OCFS2_DEBUG_FS is not set +CONFIG_OCFS2_DEBUG_MASKLOG=y +CONFIG_OCFS2_FS=m +CONFIG_OF=y +CONFIG_OF_DEVICE=y +CONFIG_OLD_BELKIN_DONGLE=m +CONFIG_OPROFILE=m +CONFIG_OSF_PARTITION=y +CONFIG_P54_COMMON=m +CONFIG_P54_PCI=m +CONFIG_P54_USB=m +CONFIG_PACKET=m +CONFIG_PACKET_MMAP=y +CONFIG_PARIDE=m +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PG=m +CONFIG_PARIDE_PT=m +CONFIG_PARPORT=m +CONFIG_PARPORT_1284=y +CONFIG_PARPORT_AX88796=m +# CONFIG_PARPORT_GSC is not set +CONFIG_PARPORT_NOT_PC=y +CONFIG_PARPORT_PC=m +CONFIG_PARPORT_PC_FIFO=y +CONFIG_PARPORT_PC_PCMCIA=m +# CONFIG_PARPORT_PC_SUPERIO is not set +CONFIG_PARPORT_SERIAL=m +CONFIG_PARTITION_ADVANCED=y +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_CMD64X is not set +CONFIG_PATA_CS5520=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_EFAR=m +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +CONFIG_PATA_IT8213=m +CONFIG_PATA_IT821X=m +CONFIG_PATA_JMICRON=m +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_NETCELL=m +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +CONFIG_PATA_OLDPIIX=m +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +CONFIG_PATA_PCMCIA=m +CONFIG_PATA_PDC2027X=m +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +CONFIG_PATA_RZ1000=m +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_VIA=m +CONFIG_PATA_WINBOND=m +CONFIG_PC300=m +# CONFIG_PC300TOO is not set +CONFIG_PC300_MLPPP=y +CONFIG_PCCARD=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_PCI=y +CONFIG_PCI200SYN=m +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIPCWATCHDOG=m +CONFIG_PCI_ATMEL=m +# CONFIG_PCI_DEBUG is not set +CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_HERMES is not set +CONFIG_PCI_LEGACY=y +CONFIG_PCI_MSI=y +CONFIG_PCI_SYSCALL=y +CONFIG_PCMCIA=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_PCMCIA_AXNET=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_IOCTL=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_NETWAVE=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_RAYCS=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_PD6729=m +CONFIG_PDA_POWER=m +# CONFIG_PDC202XX_BURST is not set +CONFIG_PDC_ADMA=m +CONFIG_PHANTOM=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m +CONFIG_PHYLIB=m +# CONFIG_PID_NS is not set +CONFIG_PLIP=m +CONFIG_PLIST=y +# CONFIG_PLX_HERMES is not set +CONFIG_PM=y +CONFIG_PMAC_RACKMETER=m +# CONFIG_PM_DEBUG is not set +CONFIG_PM_DISABLE_CONSOLE=y +CONFIG_PM_LEGACY=y +CONFIG_PM_SLEEP=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POWER_SUPPLY=m +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_PPC=y +# CONFIG_PPC_82xx is not set +# CONFIG_PPC_83xx is not set +# CONFIG_PPC_86xx is not set +# CONFIG_PPC_DCR_NATIVE is not set +# CONFIG_PPC_EARLY_DEBUG is not set +CONFIG_PPC_FPU=y +CONFIG_PPC_I8259=y +CONFIG_PPC_MERGE=y +CONFIG_PPC_MULTIPLATFORM=y +CONFIG_PPC_NATIVE=y +CONFIG_PPC_OF=y +CONFIG_PPC_PMAC=y +CONFIG_PPC_RTAS=y +CONFIG_PPC_STD_MMU=y +CONFIG_PPC_UDBG_16550=y +CONFIG_PPDEV=m +CONFIG_PPP=m +CONFIG_PPPOATM=m +CONFIG_PPPOE=m +CONFIG_PPPOL2TP=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_SYNC_TTY=m +# CONFIG_PQ2ADS is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_PRINTER=m +CONFIG_PRINTK=y +CONFIG_PRINTK_TIME=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_PRISM54=m +CONFIG_PROC_DEVICETREE=y +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROFILING=y +CONFIG_QFMT_V1=m +CONFIG_QFMT_V2=m +CONFIG_QLA3XXX=m +CONFIG_QNX4FS_FS=m +CONFIG_QSEMI_PHY=m +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +CONFIG_R3964=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAESTRO=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RAID_ATTRS=m +CONFIG_RAW_DRIVER=m +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +# CONFIG_REISERFS_CHECK is not set +CONFIG_REISERFS_FS=m +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_REISERFS_FS_XATTR=y +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_RELAY=y +CONFIG_RESOURCES_64BIT=y +CONFIG_RFD_FTL=m +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +# CONFIG_RIO is not set +CONFIG_ROADRUNNER=m +# CONFIG_ROADRUNNER_LARGE_RINGS is not set +CONFIG_ROCKETPORT=m +CONFIG_ROMFS_FS=m +CONFIG_ROSE=m +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT2X00=m +# CONFIG_RT2X00_DEBUG is not set +CONFIG_RT2X00_LIB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT73USB=m +CONFIG_RTAS_PROC=y +CONFIG_RTC_CLASS=m +CONFIG_RTC_DRV_CMOS=m +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_TEST=m +CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=m +CONFIG_RTL8187=m +CONFIG_RT_MUTEXES=y +# CONFIG_RT_MUTEX_TESTER is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_RXKAD=m +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +# CONFIG_SAMPLES is not set +CONFIG_SATA_AHCI=m +CONFIG_SATA_INIC162X=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_SVW=m +CONFIG_SATA_SX4=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SC92031=m +# CONFIG_SCHEDSTATS is not set +CONFIG_SCHED_DEBUG=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_SCSI=m +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_AIC79XX=m +CONFIG_SCSI_AIC7XXX=m +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_AIC94XX=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_DC395x=m +CONFIG_SCSI_DEBUG=m +CONFIG_SCSI_DMA=y +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_EATA=m +CONFIG_SCSI_EATA_LINKED_COMMANDS=y +CONFIG_SCSI_EATA_MAX_TAGS=16 +CONFIG_SCSI_EATA_TAGGED_QUEUE=y +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_FC_TGT_ATTRS=y +CONFIG_SCSI_FUTURE_DOMAIN=m +CONFIG_SCSI_GDTH=m +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_IMM=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_DUMP is not set +# CONFIG_SCSI_IPR_TRACE is not set +CONFIG_SCSI_IPS=m +CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_LOWLEVEL=y +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_NETLINK=y +CONFIG_SCSI_PPA=m +CONFIG_SCSI_PROC_FS=y +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_QLOGIC_1280=m +CONFIG_SCSI_SAS_ATA=y +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_TGT=m +CONFIG_SCSI_WAIT_SCAN=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +CONFIG_SCTP_HMAC_MD5=y +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SDIO_UART=m +CONFIG_SECCOMP=y +CONFIG_SECURITY=y +CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 +# CONFIG_SECURITY_APPARMOR_DISABLE is not set +CONFIG_SECURITY_CAPABILITIES=y +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_SECURITY_NETWORK=y +# CONFIG_SECURITY_NETWORK_XFRM is not set +CONFIG_SECURITY_SELINUX=y +CONFIG_SECURITY_SELINUX_AVC_STATS=y +CONFIG_SECURITY_SELINUX_BOOTPARAM=y +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 +CONFIG_SECURITY_SELINUX_DEVELOP=y +CONFIG_SECURITY_SELINUX_DISABLE=y +# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set +# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_TSL2550=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SERIAL_8250=m +CONFIG_SERIAL_8250_CS=m +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_NR_UARTS=48 +CONFIG_SERIAL_8250_PCI=m +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_CORE=m +CONFIG_SERIAL_JSM=m +CONFIG_SERIAL_NONSTANDARD=y +CONFIG_SERIAL_OF_PLATFORM=m +CONFIG_SERIO=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SERIO_RAW=m +CONFIG_SERIO_SERPORT=m +CONFIG_SGI_IOC4=m +CONFIG_SGI_PARTITION=y +CONFIG_SHAPER=m +CONFIG_SHMEM=y +CONFIG_SIGMATEL_FIR=m +CONFIG_SIGNALFD=y +CONFIG_SIS190=m +CONFIG_SIS900=m +# CONFIG_SK98LIN is not set +CONFIG_SKFP=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SLAB is not set +CONFIG_SLABINFO=y +CONFIG_SLHC=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +CONFIG_SLIP_MODE_SLIP6=y +CONFIG_SLIP_SMART=y +# CONFIG_SLOB is not set +CONFIG_SLUB=y +CONFIG_SLUB_DEBUG=y +# CONFIG_SLUB_DEBUG_ON is not set +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +CONFIG_SMC_IRCC_FIR=m +CONFIG_SMSC_PHY=m +CONFIG_SND=m +CONFIG_SND_AC97_CODEC=m +CONFIG_SND_AC97_POWER_SAVE=y +CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0 +CONFIG_SND_AD1889=m +CONFIG_SND_ALI5451=m +CONFIG_SND_ALS300=m +CONFIG_SND_ALS4000=m +CONFIG_SND_AOA=m +CONFIG_SND_AOA_FABRIC_LAYOUT=m +CONFIG_SND_AOA_ONYX=m +CONFIG_SND_AOA_SOUNDBUS=m +CONFIG_SND_AOA_SOUNDBUS_I2S=m +CONFIG_SND_AOA_TAS=m +CONFIG_SND_AOA_TOONIE=m +CONFIG_SND_ATIIXP=m +CONFIG_SND_ATIIXP_MODEM=m +CONFIG_SND_AU8810=m +CONFIG_SND_AU8820=m +CONFIG_SND_AU8830=m +CONFIG_SND_AZT3328=m +CONFIG_SND_BT87X=m +CONFIG_SND_BT87X_OVERCLOCK=y +CONFIG_SND_CA0106=m +CONFIG_SND_CMIPCI=m +CONFIG_SND_CS4281=m +CONFIG_SND_CS46XX=m +CONFIG_SND_CS46XX_NEW_DSP=y +CONFIG_SND_CS5530=m +CONFIG_SND_DARLA20=m +CONFIG_SND_DARLA24=m +# CONFIG_SND_DEBUG is not set +CONFIG_SND_DUMMY=m +CONFIG_SND_DYNAMIC_MINORS=y +CONFIG_SND_ECHO3G=m +CONFIG_SND_EMU10K1=m +CONFIG_SND_EMU10K1X=m +CONFIG_SND_ENS1370=m +CONFIG_SND_ENS1371=m +CONFIG_SND_ES1938=m +CONFIG_SND_ES1968=m +CONFIG_SND_FM801=m +CONFIG_SND_FM801_TEA575X=m +CONFIG_SND_FM801_TEA575X_BOOL=y +CONFIG_SND_GINA20=m +CONFIG_SND_GINA24=m +CONFIG_SND_HDA_CODEC_ANALOG=y +CONFIG_SND_HDA_CODEC_ATIHDMI=y +CONFIG_SND_HDA_CODEC_CMEDIA=y +CONFIG_SND_HDA_CODEC_CONEXANT=y +CONFIG_SND_HDA_CODEC_REALTEK=y +CONFIG_SND_HDA_CODEC_SI3054=y +CONFIG_SND_HDA_CODEC_SIGMATEL=y +CONFIG_SND_HDA_CODEC_VIA=y +CONFIG_SND_HDA_GENERIC=y +CONFIG_SND_HDA_HWDEP=y +CONFIG_SND_HDA_INTEL=m +CONFIG_SND_HDA_POWER_SAVE=y +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDSP=m +CONFIG_SND_HDSPM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_ICE1712=m +CONFIG_SND_ICE1724=m +CONFIG_SND_INDIGO=m +CONFIG_SND_INDIGODJ=m +CONFIG_SND_INDIGOIO=m +CONFIG_SND_INTEL8X0=m +CONFIG_SND_INTEL8X0M=m +CONFIG_SND_KORG1212=m +CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL=y +CONFIG_SND_LAYLA20=m +CONFIG_SND_LAYLA24=m +CONFIG_SND_MAESTRO3=m +CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MIA=m +CONFIG_SND_MIXART=m +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_MONA=m +CONFIG_SND_MPU401=m +CONFIG_SND_MPU401_UART=m +CONFIG_SND_MTPAV=m +CONFIG_SND_MTS64=m +CONFIG_SND_NM256=m +CONFIG_SND_OPL3_LIB=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_PCM=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +CONFIG_SND_PCXHR=m +CONFIG_SND_PDAUDIOCF=m +CONFIG_SND_PORTMAN2X4=m +CONFIG_SND_POWERMAC=m +CONFIG_SND_POWERMAC_AUTO_DRC=y +CONFIG_SND_RAWMIDI=m +CONFIG_SND_RIPTIDE=m +CONFIG_SND_RME32=m +CONFIG_SND_RME96=m +CONFIG_SND_RME9652=m +CONFIG_SND_SB16_DSP=m +CONFIG_SND_SB_COMMON=m +CONFIG_SND_SEQUENCER=m +CONFIG_SND_SEQUENCER_OSS=y +CONFIG_SND_SEQ_DUMMY=m +CONFIG_SND_SERIAL_U16550=m +CONFIG_SND_SOC=m +CONFIG_SND_SONICVIBES=m +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_TIMER=m +CONFIG_SND_TRIDENT=m +CONFIG_SND_USB_AUDIO=m +CONFIG_SND_USB_CAIAQ=m +CONFIG_SND_USB_CAIAQ_INPUT=y +CONFIG_SND_USB_USX2Y=m +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_VERBOSE_PROCFS is not set +CONFIG_SND_VIA82XX=m +CONFIG_SND_VIA82XX_MODEM=m +CONFIG_SND_VIRMIDI=m +CONFIG_SND_VX222=m +CONFIG_SND_VXPOCKET=m +CONFIG_SND_VX_LIB=m +CONFIG_SND_YMFPCI=m +CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y +CONFIG_SOFT_WATCHDOG=m +CONFIG_SOLARIS_X86_PARTITION=y +CONFIG_SOUND=m +CONFIG_SOUND_MSNDCLAS=m +CONFIG_SOUND_MSNDPIN=m +CONFIG_SOUND_PRIME=m +CONFIG_SOUND_TRIDENT=m +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPECIALIX=m +# CONFIG_SPECIALIX_RTSCTS is not set +CONFIG_SPI=y +CONFIG_SPI_AT25=m +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_LM70_LLP=m +CONFIG_SPI_MASTER=y +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_SSB=m +CONFIG_SSB_DEBUG=y +CONFIG_SSB_DRIVER_PCICORE=y +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCIHOST_POSSIBLE=y +# CONFIG_SSB_PCMCIAHOST is not set +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +CONFIG_SSB_POSSIBLE=y +CONFIG_SSFDC=m +CONFIG_STALDRV=y +CONFIG_STANDALONE=y +CONFIG_STRIP=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_SUNGEM=m +CONFIG_SUNRPC=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_XPRT_RDMA=m +CONFIG_SUN_PARTITION=y +CONFIG_SUSPEND=y +CONFIG_SWAP=y +CONFIG_SX=m +CONFIG_SYNCLINK=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_CS=m +CONFIG_SYNCLINK_GT=m +CONFIG_SYN_COOKIES=y +CONFIG_SYSCTL=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_SYSFS=y +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_SYSV68_PARTITION=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_SYSV_FS=m +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_TASK_XACCT=y +CONFIG_TCG_ATMEL=m +CONFIG_TCG_TPM=m +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=m +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_ILLINOIS=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_MD5SIG=y +CONFIG_TEHUTI=m +CONFIG_TEKRAM_DONGLE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TICK_ONESHOT=y +CONFIG_TIFM_7XX1=m +CONFIG_TIFM_CORE=m +CONFIG_TIGON3=m +CONFIG_TIMER_STATS=y +# CONFIG_TINY_SHMEM is not set +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +# CONFIG_TMD_HERMES is not set +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TMS380TR=m +CONFIG_TMSPCI=m +# CONFIG_TOIM3232_DONGLE is not set +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_ELO=m +CONFIG_TOUCHSCREEN_FUJITSU=m +CONFIG_TOUCHSCREEN_GUNZE=m +CONFIG_TOUCHSCREEN_MK712=m +CONFIG_TOUCHSCREEN_MTOUCH=m +CONFIG_TOUCHSCREEN_PENMOUNT=m +CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +CONFIG_TOUCHSCREEN_TOUCHWIN=m +CONFIG_TOUCHSCREEN_UCB1400=m +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TR=y +CONFIG_TULIP=m +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_NAPI is not set +CONFIG_TUN=m +CONFIG_TUNER_3036=m +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_SIMPLE=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TYPHOON=m +# CONFIG_UCC_SLOW is not set +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_UFS_DEBUG is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +CONFIG_UIO=m +CONFIG_UIO_CIF=m +CONFIG_ULI526X=m +CONFIG_ULTRIX_PARTITION=y +CONFIG_UNIX=y +CONFIG_UNIX98_PTYS=y +CONFIG_UNIXWARE_DISKLABEL=y +CONFIG_UNUSED_SYMBOLS=y +CONFIG_USB=m +CONFIG_USBPCWATCHDOG=m +CONFIG_USB_ACM=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_ATM=m +CONFIG_USB_AUERSWALD=m +CONFIG_USB_BELKIN=y +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_CATC=m +CONFIG_USB_CXACRU=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_DABUSB=m +# CONFIG_USB_DEBUG is not set +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +CONFIG_USB_DSBR=m +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EMI26=m +CONFIG_USB_EMI62=m +CONFIG_USB_EPSON2888=y +CONFIG_USB_ET61X251=m +CONFIG_USB_ETH=m +CONFIG_USB_ETH_RNDIS=y +CONFIG_USB_EZUSB=y +CONFIG_USB_FILE_STORAGE=m +# CONFIG_USB_FILE_STORAGE_TEST is not set +CONFIG_USB_FTDI_ELAN=m +CONFIG_USB_GADGET=m +CONFIG_USB_GADGETFS=m +# CONFIG_USB_GADGET_AMD5536UDC is not set +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_DUALSPEED=y +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_M66592 is not set +CONFIG_USB_GADGET_NET2280=y +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_S3C2410 is not set +CONFIG_USB_GADGET_SELECTED=y +CONFIG_USB_G_SERIAL=m +CONFIG_USB_HID=m +CONFIG_USB_HIDDEV=y +CONFIG_USB_HIDINPUT_POWERBOOK=y +CONFIG_USB_IBMCAM=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_IOWARRIOR=m +CONFIG_USB_IRDA=m +CONFIG_USB_ISP116X_HCD=m +CONFIG_USB_KAWETH=m +CONFIG_USB_KBD=m +CONFIG_USB_KC2190=y +CONFIG_USB_KONICAWC=m +CONFIG_USB_LCD=m +CONFIG_USB_LD=m +CONFIG_USB_LED=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LIBUSUAL=y +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +# CONFIG_USB_MIDI_GADGET is not set +CONFIG_USB_MON=y +CONFIG_USB_MOUSE=m +CONFIG_USB_NET2280=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_RNDIS_HOST=m +# CONFIG_USB_NET_ZAURUS is not set +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_OHCI_HCD=m +CONFIG_USB_OHCI_HCD_PCI=y +CONFIG_USB_OHCI_HCD_PPC_OF=y +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y +# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OTG is not set +# CONFIG_USB_OV511 is not set +CONFIG_USB_PEGASUS=m +CONFIG_USB_PERSIST=y +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_PRINTER=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_R8A66597_HCD=m +CONFIG_USB_RIO500=m +CONFIG_USB_RTL8150=m +CONFIG_USB_SE401=m +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IPW=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_SL811_CS=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SN9C102=m +CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_STORAGE=m +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_DATAFAB=y +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STV680=m +CONFIG_USB_SUPPORT=y +CONFIG_USB_SUSPEND=y +# CONFIG_USB_TEST is not set +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_UEAGLEATM=m +CONFIG_USB_UHCI_HCD=m +CONFIG_USB_USBNET=m +CONFIG_USB_USS720=m +CONFIG_USB_VICAM=m +CONFIG_USB_W9968CF=m +CONFIG_USB_XUSBATM=m +CONFIG_USB_ZC0301=m +CONFIG_USB_ZD1201=m +CONFIG_USB_ZERO=m +CONFIG_USB_ZR364XX=m +# CONFIG_USER_NS is not set +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VETH=m +CONFIG_VFAT_FS=m +CONFIG_VGASTATE=m +# CONFIG_VGA_CONSOLE is not set +CONFIG_VIA_FIR=m +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_VIA_VELOCITY=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m +# CONFIG_VIDEO_ADV_DEBUG is not set +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_CX2341X=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_CX25840=m +CONFIG_VIDEO_CX88=m +CONFIG_VIDEO_CX88_ALSA=m +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_DEV=m +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_FB_IVTV=m +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_MSP3400=m +# CONFIG_VIDEO_MXB is not set +CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_29XXX=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_ALSA=m +CONFIG_VIDEO_SAA7134_DVB=m +CONFIG_VIDEO_SAA7134_OSS=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_USBVIDEO=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_VP27SMPX=m +CONFIG_VIDEO_VPX3220=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_WM8775=m +# CONFIG_VIRQ_DEBUG is not set +CONFIG_VITESSE_PHY=m +CONFIG_VLAN_8021Q=m +CONFIG_VLSI_FIR=m +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VORTEX=m +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_VXFS_FS=m +CONFIG_W1=m +CONFIG_W1_CON=y +CONFIG_W1_MASTER_DS2482=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2760=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_THERM=m +CONFIG_WAN=y +CONFIG_WANXL=m +CONFIG_WAN_ROUTER=m +CONFIG_WAN_ROUTER_DRIVERS=m +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set +CONFIG_WATCHDOG_RTAS=m +# CONFIG_WDC_ALI15X3 is not set +CONFIG_WDTPCI=m +CONFIG_WDT_501_PCI=y +CONFIG_WINBOND_840=m +CONFIG_WINBOND_FIR=m +CONFIG_WINDFARM=m +CONFIG_WIRELESS_EXT=y +CONFIG_WLAN_80211=y +CONFIG_WLAN_PRE80211=y +CONFIG_X25=m +CONFIG_X25_ASY=m +CONFIG_XFRM=y +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_SUB_POLICY is not set +CONFIG_XFRM_USER=m +CONFIG_XFS_FS=m +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_QUOTA=y +CONFIG_XFS_RT=y +CONFIG_XFS_SECURITY=y +CONFIG_XOR_BLOCKS=m +CONFIG_YAM=m +CONFIG_YELLOWFIN=m +CONFIG_YENTA=m +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_ZISOFS=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZONE_DMA=y +CONFIG_ZONE_DMA_FLAG=1 --- linux-2.6.24.orig/debian/config/sparc/config.sparc64-smp +++ linux-2.6.24/debian/config/sparc/config.sparc64-smp @@ -0,0 +1,16 @@ +# +# Config options for config.sparc64-smp automatically generated by splitconfig.pl +# +CONFIG_CPUSETS=y +CONFIG_HOTPLUG_CPU=y +CONFIG_LOCK_KERNEL=y +CONFIG_NR_CPUS=256 +CONFIG_PATA_CMD640_PCI=m +# CONFIG_PREEMPT_BKL is not set +CONFIG_PROC_PID_CPUSET=y +CONFIG_RIO=m +CONFIG_RIO_OLDPCI=y +CONFIG_SCHED_MC=y +CONFIG_SCHED_SMT=y +CONFIG_SMP=y +CONFIG_STOP_MACHINE=y --- linux-2.6.24.orig/debian/config/sparc/config.sparc64 +++ linux-2.6.24/debian/config/sparc/config.sparc64 @@ -0,0 +1,10 @@ +# +# Config options for config.sparc64 automatically generated by splitconfig.pl +# +CONFIG_BROKEN_ON_SMP=y +CONFIG_ISTALLION=m +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_RIO is not set +CONFIG_RISCOM8=m +# CONFIG_SMP is not set +CONFIG_STALLION=m --- linux-2.6.24.orig/debian/config/sparc/config +++ linux-2.6.24/debian/config/sparc/config @@ -0,0 +1,2120 @@ +# +# Common config options automatically generated by splitconfig.pl +# +CONFIG_64BIT=y +CONFIG_8139CP=m +CONFIG_8139TOO=m +CONFIG_8139TOO_8129=y +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_9P_FS=m +CONFIG_AC97_BUS=m +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +# CONFIG_ACORN_PARTITION is not set +CONFIG_ADAPTEC_STARFIRE=m +CONFIG_ADAPTEC_STARFIRE_NAPI=y +# CONFIG_ADFS_FS is not set +CONFIG_ADM8211=m +CONFIG_AFFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_AFS_FS=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +# CONFIG_AIC79XX_DEBUG_ENABLE is not set +CONFIG_AIC79XX_DEBUG_MASK=0 +# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +# CONFIG_AIC94XX_DEBUG is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_AMIGA_PARTITION is not set +CONFIG_ANON_INODES=y +CONFIG_APPLICOM=m +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_NO_VIRT_TO_BUS=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUPPORTS_MSI=y +# CONFIG_ARCNET is not set +CONFIG_ARPD=y +CONFIG_ASK_IP_FIB_HASH=y +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_ATA=m +CONFIG_ATALK=m +# CONFIG_ATARI_PARTITION is not set +CONFIG_ATA_GENERIC=m +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_OVER_ETH=m +CONFIG_ATA_PIIX=m +CONFIG_ATL1=m +# CONFIG_ATM is not set +CONFIG_ATMEL=m +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_ARCH=y +CONFIG_AUDIT_TREE=y +CONFIG_AUTOFS4_FS=m +CONFIG_AUTOFS_FS=m +CONFIG_AUXDISPLAY=y +CONFIG_B43=m +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PIO=y +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_B43_DEBUG=y +CONFIG_B43_DMA=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +CONFIG_B43_LEDS=y +CONFIG_B43_PCICORE_AUTOSELECT=y +CONFIG_B43_PCI_AUTOSELECT=y +CONFIG_B43_PIO=y +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43_RFKILL=y +# CONFIG_B44 is not set +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BASE_FULL=y +CONFIG_BASE_SMALL=0 +CONFIG_BATTERY_DS2760=m +CONFIG_BBC_I2C=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +CONFIG_BCM43XX_PIO=y +# CONFIG_BCM43XX_PIO_MODE is not set +# CONFIG_BEFS_DEBUG is not set +CONFIG_BEFS_FS=m +CONFIG_BFS_FS=m +# CONFIG_BINFMT_AOUT32 is not set +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_ELF32=y +CONFIG_BINFMT_MISC=m +CONFIG_BITREVERSE=y +# CONFIG_BLK_CPQ_CISS_DA is not set +CONFIG_BLK_DEV=y +CONFIG_BLK_DEV_3W_XXXX_RAID=m +# CONFIG_BLK_DEV_AEC62XX is not set +CONFIG_BLK_DEV_ALI15X3=m +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_BSG is not set +CONFIG_BLK_DEV_CMD64X=m +# CONFIG_BLK_DEV_COW_COMMON is not set +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_CS5520 is not set +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_CY82C693=m +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_DM=m +CONFIG_BLK_DEV_FD=y +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +CONFIG_BLK_DEV_IDE=m +CONFIG_BLK_DEV_IDECD=m +CONFIG_BLK_DEV_IDEDISK=m +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_BLK_DEV_IDESCSI is not set +CONFIG_BLK_DEV_IDETAPE=m +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_DEV_IO_TRACE=y +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_JMICRON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_MD=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_NS87415=m +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +CONFIG_BLK_DEV_PDC202XX_OLD=m +# CONFIG_BLK_DEV_PIIX is not set +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +# CONFIG_BLK_DEV_SC1200 is not set +CONFIG_BLK_DEV_SD=m +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +CONFIG_BLK_DEV_SR=m +CONFIG_BLK_DEV_SR_VENDOR=y +# CONFIG_BLK_DEV_SVWKS is not set +CONFIG_BLK_DEV_SX8=m +CONFIG_BLK_DEV_TC86C001=m +# CONFIG_BLK_DEV_TRIFLEX is not set +CONFIG_BLK_DEV_TRM290=m +# CONFIG_BLK_DEV_UB is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +CONFIG_BLOCK=y +CONFIG_BLOCK_COMPAT=y +CONFIG_BNX2=m +CONFIG_BONDING=m +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_BRIDGE=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_NETFILTER=y +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BROADCOM_PHY=m +# CONFIG_BSD_DISKLABEL is not set +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +# CONFIG_BT is not set +CONFIG_BUG=y +CONFIG_CASSINI=m +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_CFG80211=m +CONFIG_CGROUPS=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_CGROUP_DEBUG is not set +CONFIG_CGROUP_NS=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_CHR_DEV_OSST=m +# CONFIG_CHR_DEV_SCH is not set +CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_ST=m +CONFIG_CICADA_PHY=m +CONFIG_CIFS=m +# CONFIG_CIFS_DEBUG2 is not set +CONFIG_CIFS_EXPERIMENTAL=y +# CONFIG_CIFS_STATS is not set +CONFIG_CIFS_UPCALL=y +CONFIG_CIFS_WEAK_PW_HASH=y +# CONFIG_CIFS_XATTR is not set +CONFIG_CLS_U32_MARK=y +# CONFIG_CLS_U32_PERF is not set +# CONFIG_CMDLINE_BOOL is not set +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set +CONFIG_COMPAT=y +CONFIG_COMPUTONE=m +CONFIG_CONFIGFS_FS=m +CONFIG_CONNECTOR=m +# CONFIG_CPU_FREQ is not set +CONFIG_CRAMFS=y +CONFIG_CRC16=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_CRC_CCITT=m +CONFIG_CRC_ITU_T=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TEA=m +# CONFIG_CRYPTO_TEST is not set +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_XTS=m +CONFIG_CYCLADES=m +# CONFIG_CYZ_INTR is not set +CONFIG_DAB=y +CONFIG_DAVICOM_PHY=m +# CONFIG_DE2104X is not set +# CONFIG_DE4X5 is not set +CONFIG_DE600=m +CONFIG_DE620=m +# CONFIG_DEBUG_BOOTMEM is not set +CONFIG_DEBUG_BUGVERBOSE=y +# CONFIG_DEBUG_DCFLUSH is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_FS=y +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_VM is not set +CONFIG_DECNET=m +CONFIG_DECNET_NF_GRABULATOR=m +CONFIG_DECNET_ROUTER=y +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_BIC is not set +CONFIG_DEFAULT_CFQ=y +CONFIG_DEFAULT_CUBIC=y +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_HTCP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 +# CONFIG_DEFAULT_RENO is not set +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +# CONFIG_DEFXX is not set +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_DEVPORT=y +# CONFIG_DEV_APPLETALK is not set +# CONFIG_DEV_KMEM is not set +CONFIG_DIGIEPCA=m +# CONFIG_DISCONTIGMEM_MANUAL is not set +CONFIG_DISPLAY7SEG=m +CONFIG_DISPLAY_SUPPORT=m +CONFIG_DL2K=m +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +# CONFIG_DM9102 is not set +CONFIG_DM_CRYPT=m +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_DELAY is not set +CONFIG_DM_MIRROR=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_MULTIPATH_HP=m +CONFIG_DM_MULTIPATH_RDAC=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_UEVENT=y +CONFIG_DM_ZERO=m +CONFIG_DNOTIFY=y +CONFIG_DRM=y +CONFIG_DRM_MGA=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_SAVAGE=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_VIA=m +# CONFIG_DRM_VIA_CHROME9 is not set +CONFIG_DS1682=m +CONFIG_DUMMY=m +CONFIG_DUMMY_CONSOLE=y +# CONFIG_DVB_CORE is not set +CONFIG_E100=m +CONFIG_E1000=m +CONFIG_E1000E=m +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000_NAPI=y +# CONFIG_ECONET is not set +CONFIG_ECRYPT_FS=m +# CONFIG_EEPRO100 is not set +CONFIG_EEPROM_93CX6=m +# CONFIG_EFI_PARTITION is not set +CONFIG_EFS_FS=m +CONFIG_ELF_CORE=y +# CONFIG_EMBEDDED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +# CONFIG_ENABLE_WARN_DEPRECATED is not set +CONFIG_ENVCTRL=m +CONFIG_EPIC100=m +CONFIG_EPOLL=y +CONFIG_EQUALIZER=m +CONFIG_EVENTFD=y +CONFIG_EXPERIMENTAL=y +CONFIG_EXPORTFS=m +CONFIG_EXT2_FS=m +CONFIG_EXT2_FS_POSIX_ACL=y +# CONFIG_EXT2_FS_SECURITY is not set +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +CONFIG_EXT3_FS_POSIX_ACL=y +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_FAIR_CGROUP_SCHED=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_FAIR_USER_SCHED is not set +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_FAT_FS=m +# CONFIG_FAULT_INJECTION is not set +CONFIG_FB=y +# CONFIG_FB_3DFX is not set +CONFIG_FB_ARK=m +# CONFIG_FB_ASILIANT is not set +CONFIG_FB_ATY=y +CONFIG_FB_ATY128=y +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_BACKLIGHT=y +# CONFIG_FB_BW2 is not set +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_CG14 is not set +# CONFIG_FB_CG3 is not set +CONFIG_FB_CG6=y +# CONFIG_FB_CIRRUS is not set +CONFIG_FB_DDC=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_FFB=y +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_LEO is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_MATROX is not set +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_NEOMAGIC is not set +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_BACKLIGHT=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_I2C=y +# CONFIG_FB_P9100 is not set +CONFIG_FB_PM2=y +# CONFIG_FB_PM2_FIFO_DISCONNECT is not set +CONFIG_FB_PM3=m +CONFIG_FB_RADEON=y +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_RADEON_I2C=y +# CONFIG_FB_RIVA is not set +CONFIG_FB_S1D13XXX=m +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SBUS=y +# CONFIG_FB_SIS is not set +CONFIG_FB_SM501=m +CONFIG_FB_SVGALIB=m +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_TCX is not set +CONFIG_FB_TILEBLITTING=y +# CONFIG_FB_TRIDENT is not set +CONFIG_FB_UVESA=m +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_VOODOO1 is not set +CONFIG_FB_VT8623=m +CONFIG_FB_XVR2500=y +CONFIG_FB_XVR500=y +CONFIG_FDDI=y +CONFIG_FEALNX=m +CONFIG_FIB_RULES=y +# CONFIG_FIREWIRE is not set +CONFIG_FIRMWARE_EDID=y +CONFIG_FIXED_MII_1000_FDX=y +# CONFIG_FIXED_MII_100_FDX is not set +# CONFIG_FIXED_MII_10_FDX is not set +CONFIG_FIXED_MII_AMNT=1 +CONFIG_FIXED_PHY=m +# CONFIG_FLATMEM_MANUAL is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x16=y +# CONFIG_FONT_SUN12x22 is not set +CONFIG_FONT_SUN8x16=y +# CONFIG_FORCEDETH is not set +# CONFIG_FORCED_INLINING is not set +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FS_MBCACHE=m +CONFIG_FS_POSIX_ACL=y +CONFIG_FUSE_FS=m +CONFIG_FUSION=y +CONFIG_FUSION_CTL=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y +CONFIG_FUSION_MAX_SGE=40 +CONFIG_FUSION_SAS=m +CONFIG_FUSION_SPI=m +CONFIG_FUTEX=y +CONFIG_FW_LOADER=y +CONFIG_GACT_PROB=y +# CONFIG_GAMEPORT is not set +CONFIG_GENERIC_ACL=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_TIME=y +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +# CONFIG_HAMACHI is not set +# CONFIG_HAMRADIO is not set +CONFIG_HAPPYMEAL=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAVE_MEMORY_PRESENT=y +# CONFIG_HEADERS_CHECK is not set +CONFIG_HERMES=m +CONFIG_HFSPLUS_FS=m +CONFIG_HFS_FS=m +CONFIG_HID=m +CONFIG_HIDRAW=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HID_FF is not set +CONFIG_HID_SUPPORT=y +CONFIG_HIGH_RES_TIMERS=y +# CONFIG_HIPPI is not set +CONFIG_HOSTAP=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_PLX=m +CONFIG_HOTPLUG=y +# CONFIG_HP100 is not set +CONFIG_HPFS_FS=m +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_HUGETLB_PAGE_SIZE_4MB=y +# CONFIG_HUGETLB_PAGE_SIZE_512K is not set +# CONFIG_HUGETLB_PAGE_SIZE_64K is not set +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_HWMON_VID=m +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +# CONFIG_HZ_1000 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_300 is not set +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_ALGOPCA=m +CONFIG_I2C_ALGOPCF=m +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_NFORCE2 is not set +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PIIX4=m +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +CONFIG_I2C_SIMTEC=m +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +CONFIG_I2C_STUB=m +CONFIG_I2C_TAOS_EVM=m +CONFIG_I2C_TINY_USB=m +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +CONFIG_I2O=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_BUS=m +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_PROC=m +CONFIG_I2O_SCSI=m +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +CONFIG_ICPLUS_PHY=m +CONFIG_IDE=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEPCI_PCIBUS_ORDER is not set +# CONFIG_IDEPCI_SHARE_IRQ is not set +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_IDE_ARM is not set +CONFIG_IDE_GENERIC=m +CONFIG_IDE_PROC_FS=y +# CONFIG_IDE_TASK_IOCTL is not set +CONFIG_IEEE1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_OHCI1394=m +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_VERBOSEDEBUG is not set +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE80211=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_CRYPT_WEP=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_IFB=m +# CONFIG_IKCONFIG is not set +CONFIG_INET=y +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET_AH=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_INET_DIAG=y +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_LRO=m +CONFIG_INET_TCP_DIAG=y +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_ISER=m +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_INPUT=y +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +# CONFIG_INPUT_EVBUG is not set +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_FF_MEMLESS=m +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_JOYSTICK is not set +CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_MISC=y +CONFIG_INPUT_MOUSE=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_SPARCSPKR=y +CONFIG_INPUT_TABLET=y +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_UINPUT is not set +CONFIG_INPUT_YEALINK=m +CONFIG_INSTRUMENTATION=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_CFQ=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_NOOP=y +CONFIG_IP1000=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_RAW=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_HANDLER=m +# CONFIG_IPMI_PANIC_EVENT is not set +# CONFIG_IPMI_POWEROFF is not set +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m +CONFIG_IPV6=m +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +CONFIG_IPW2100=m +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +CONFIG_IPW2200=m +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IPX=m +# CONFIG_IPX_INTERN is not set +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_DCCP=m +CONFIG_IP_DCCP_ACKVEC=y +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_IP_DCCP_TFRC_LIB=m +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_MROUTE=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARP_MANGLE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +CONFIG_IP_PNP=y +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_DHCP is not set +CONFIG_IP_PNP_RARP=y +# CONFIG_IP_ROUTE_MULTIPATH is not set +# CONFIG_IP_ROUTE_VERBOSE is not set +CONFIG_IP_SCTP=m +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_FTP=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_NQ=m +CONFIG_IP_VS_PROTO_AH=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_TAB_BITS=12 +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_WRR=m +# CONFIG_IRDA is not set +CONFIG_ISCSI_TCP=m +# CONFIG_ISDN is not set +# CONFIG_ISI is not set +CONFIG_ISO9660_FS=m +# CONFIG_IWLWIFI is not set +CONFIG_IXGB=m +CONFIG_IXGBE=m +CONFIG_IXGB_NAPI=y +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +# CONFIG_JFS_FS is not set +CONFIG_JOLIET=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_KARMA_PARTITION=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_LKKBD=m +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_KEYBOARD_SUNKBD=y +# CONFIG_KEYBOARD_XTKBD is not set +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +CONFIG_KMOD=y +CONFIG_KPROBES=y +CONFIG_KS0108=m +CONFIG_KS0108_DELAY=2 +CONFIG_KS0108_PORT=0x378 +# CONFIG_LAPB is not set +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +# CONFIG_LDM_PARTITION is not set +CONFIG_LEDS_CLASS=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBCRC32C=m +CONFIG_LIBERTAS=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_LIBERTAS_SDIO=m +CONFIG_LIBERTAS_USB=m +# CONFIG_LKDTM is not set +CONFIG_LLC=m +CONFIG_LLC2=m +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_LOCKD=m +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_LOCKD_V4=y +# CONFIG_LOCK_STAT is not set +# CONFIG_LOGO is not set +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_LP_CONSOLE is not set +CONFIG_LSM_MMAP_MIN_ADDR=0 +CONFIG_LXT_PHY=m +CONFIG_MAC80211=m +# CONFIG_MAC80211_DEBUG is not set +CONFIG_MAC80211_DEBUGFS=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MACVLAN=m +# CONFIG_MAC_PARTITION is not set +CONFIG_MAGIC_SYSRQ=y +# CONFIG_MARKERS is not set +CONFIG_MARVELL_PHY=m +CONFIG_MAX_RAW_DEVS=256 +CONFIG_MD=y +CONFIG_MDIO_BITBANG=m +CONFIG_MD_FAULTY=m +CONFIG_MD_LINEAR=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_SAS=m +CONFIG_MFD_SM501=m +CONFIG_MII=m +CONFIG_MINIX_FS=m +# CONFIG_MINIX_SUBPARTITION is not set +CONFIG_MISC_DEVICES=y +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_MLX4_INFINIBAND=m +CONFIG_MMC=m +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_SDHCI=m +CONFIG_MMC_SPI=m +CONFIG_MMC_TIFM_SD=m +# CONFIG_MMC_UNSAFE_RESUME is not set +CONFIG_MMU=y +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MOUSE_APPLETOUCH=m +CONFIG_MOUSE_PS2=y +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_PS2_TRACKPOINT=y +CONFIG_MOUSE_SERIAL=y +# CONFIG_MOUSE_VSXXXAA is not set +CONFIG_MOXA_INTELLIO=m +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +CONFIG_MSDOS_FS=m +CONFIG_MSDOS_PARTITION=y +CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin" +CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin" +CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin" +CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin" +# CONFIG_MSS is not set +# CONFIG_MTD is not set +CONFIG_MYRI10GE=m +CONFIG_MYRI_SBUS=m +CONFIG_NATSEMI=m +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +CONFIG_NCPFS_NFS_NS=y +# CONFIG_NCPFS_NLS is not set +CONFIG_NCPFS_OS2_NS=y +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_STRONG is not set +CONFIG_NCP_FS=m +CONFIG_NE2K_PCI=m +CONFIG_NET=y +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETDEVICES=y +CONFIG_NETDEVICES_MULTIQUEUE=y +CONFIG_NETDEV_1000=y +CONFIG_NETDEV_10000=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +# CONFIG_NETLABEL is not set +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NETWORK_SECMARK=y +CONFIG_NETXEN_NIC=m +CONFIG_NET_9P=m +# CONFIG_NET_9P_DEBUG is not set +CONFIG_NET_9P_FD=m +CONFIG_NET_ACT_GACT=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SIMP=m +CONFIG_NET_CLS=y +CONFIG_NET_CLS_ACT=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_FW=m +# CONFIG_NET_CLS_IND is not set +# CONFIG_NET_CLS_POLICE is not set +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_U32=m +CONFIG_NET_DCCPPROBE=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_ETHERNET=y +CONFIG_NET_FC=y +# CONFIG_NET_IPGRE is not set +CONFIG_NET_IPIP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_NET_PCI=y +# CONFIG_NET_PKTGEN is not set +CONFIG_NET_POCKET=y +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_FIFO=y +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_TCPPROBE=m +CONFIG_NET_TULIP=y +CONFIG_NET_VENDOR_3COM=y +CONFIG_NEW_LEDS=y +CONFIG_NFSD=m +CONFIG_NFSD_TCP=y +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +# CONFIG_NFS_DIRECTIO is not set +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CT_NETLINK=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NIU=m +CONFIG_NL80211=y +CONFIG_NLS=y +CONFIG_NLS_ASCII=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m +# CONFIG_NORTEL_HERMES is not set +CONFIG_NO_HZ=y +CONFIG_NR_QUICK=1 +CONFIG_NS83820=m +# CONFIG_NTFS_FS is not set +CONFIG_N_HDLC=m +CONFIG_OBP_FLASH=m +# CONFIG_OCFS2_DEBUG_FS is not set +CONFIG_OCFS2_DEBUG_MASKLOG=y +CONFIG_OCFS2_FS=m +CONFIG_OF=y +CONFIG_OF_DEVICE=y +# CONFIG_OSF_PARTITION is not set +CONFIG_P54_COMMON=m +CONFIG_P54_PCI=m +CONFIG_P54_USB=m +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_PARIDE is not set +CONFIG_PARPORT=m +CONFIG_PARPORT_1284=y +CONFIG_PARPORT_AX88796=m +# CONFIG_PARPORT_GSC is not set +CONFIG_PARPORT_NOT_PC=y +CONFIG_PARPORT_PC=m +CONFIG_PARPORT_PC_FIFO=y +# CONFIG_PARPORT_PC_SUPERIO is not set +CONFIG_PARPORT_SUNBPP=m +CONFIG_PARTITION_ADVANCED=y +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_CMD64X is not set +CONFIG_PATA_CS5520=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_EFAR=m +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +CONFIG_PATA_IT8213=m +CONFIG_PATA_IT821X=m +CONFIG_PATA_JMICRON=m +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_NETCELL=m +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +CONFIG_PATA_OLDPIIX=m +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +CONFIG_PATA_PDC2027X=m +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +CONFIG_PATA_RZ1000=m +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_VIA=m +CONFIG_PATA_WINBOND=m +CONFIG_PCI=y +CONFIG_PCI_ATMEL=m +# CONFIG_PCI_DEBUG is not set +CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_HERMES is not set +CONFIG_PCI_LEGACY=y +# CONFIG_PCI_MSI is not set +CONFIG_PCI_SYSCALL=y +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_PDA_POWER=m +# CONFIG_PDC202XX_BURST is not set +CONFIG_PDC_ADMA=m +CONFIG_PHANTOM=m +# CONFIG_PHONE is not set +CONFIG_PHYLIB=m +# CONFIG_PID_NS is not set +CONFIG_PLIP=m +CONFIG_PLIST=y +# CONFIG_PLX_HERMES is not set +CONFIG_POSIX_MQUEUE=y +CONFIG_POWER_SUPPLY=m +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_PPDEV=m +CONFIG_PPP=m +CONFIG_PPPOE=m +CONFIG_PPPOL2TP=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_SYNC_TTY=m +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_PRINTER=m +CONFIG_PRINTK=y +CONFIG_PRINTK_TIME=y +CONFIG_PRINT_QUOTA_WARNING=y +# CONFIG_PRISM54 is not set +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +# CONFIG_PROFILING is not set +CONFIG_PROM_CONSOLE=y +# CONFIG_PROVE_LOCKING is not set +# CONFIG_QFMT_V1 is not set +CONFIG_QFMT_V2=m +CONFIG_QLA3XXX=m +# CONFIG_QNX4FS_FS is not set +CONFIG_QSEMI_PHY=m +CONFIG_QUICKLIST=y +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +CONFIG_R3964=m +# CONFIG_R8169 is not set +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAESTRO=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RAID_ATTRS=m +CONFIG_RAW_DRIVER=m +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_REISERFS_CHECK is not set +CONFIG_REISERFS_FS=m +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_REISERFS_FS_XATTR=y +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_RELAY=y +CONFIG_RESOURCES_64BIT=y +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +CONFIG_ROCKETPORT=m +CONFIG_ROMFS_FS=m +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT2X00=m +# CONFIG_RT2X00_DEBUG is not set +CONFIG_RT2X00_LIB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT73USB=m +CONFIG_RTC_CLASS=m +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_TEST=m +CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=m +CONFIG_RTL8187=m +CONFIG_RT_MUTEXES=y +# CONFIG_RT_MUTEX_TESTER is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_RXKAD=m +CONFIG_S2IO=m +CONFIG_S2IO_NAPI=y +# CONFIG_SAMPLES is not set +CONFIG_SATA_AHCI=m +CONFIG_SATA_INIC162X=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_SVW=m +CONFIG_SATA_SX4=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SBUS=y +CONFIG_SBUSCHAR=y +CONFIG_SC92031=m +# CONFIG_SCHEDSTATS is not set +CONFIG_SCHED_DEBUG=y +CONFIG_SCSI=m +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_AIC79XX=m +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_AIC94XX=m +CONFIG_SCSI_ARCMSR=m +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_DC390T is not set +CONFIG_SCSI_DC395x=m +# CONFIG_SCSI_DEBUG is not set +CONFIG_SCSI_DMA=y +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_FC_TGT_ATTRS=y +# CONFIG_SCSI_FUTURE_DOMAIN is not set +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_IMM=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_DUMP is not set +# CONFIG_SCSI_IPR_TRACE is not set +# CONFIG_SCSI_IPS is not set +CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_LOWLEVEL=y +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_NETLINK=y +CONFIG_SCSI_PPA=m +CONFIG_SCSI_PROC_FS=y +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_QLOGICPTI=m +CONFIG_SCSI_QLOGIC_1280=m +CONFIG_SCSI_SAS_ATA=y +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SUNESP=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_TGT=m +CONFIG_SCSI_WAIT_SCAN=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +CONFIG_SCTP_HMAC_MD5=y +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SDIO_UART=m +CONFIG_SECCOMP=y +CONFIG_SECURITY=y +CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 +# CONFIG_SECURITY_APPARMOR_DISABLE is not set +CONFIG_SECURITY_CAPABILITIES=y +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_SECURITY_NETWORK=y +# CONFIG_SECURITY_NETWORK_XFRM is not set +# CONFIG_SECURITY_ROOTPLUG is not set +CONFIG_SECURITY_SELINUX=y +CONFIG_SECURITY_SELINUX_AVC_STATS=y +CONFIG_SECURITY_SELINUX_BOOTPARAM=y +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 +CONFIG_SECURITY_SELINUX_DEVELOP=y +CONFIG_SECURITY_SELINUX_DISABLE=y +# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set +# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_SENSORS_AD7418=m +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +# CONFIG_SENSORS_ADM1031 is not set +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_EEPROM is not set +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +# CONFIG_SENSORS_GL518SM is not set +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_IBMPEX=m +# CONFIG_SENSORS_IT87 is not set +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +CONFIG_SENSORS_LM87=m +# CONFIG_SENSORS_LM90 is not set +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +# CONFIG_SENSORS_MAX1619 is not set +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_PCA9539=m +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCF8591 is not set +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_TSL2550=m +# CONFIG_SENSORS_VIA686A is not set +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83627EHF=m +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83781D is not set +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +# CONFIG_SENSORS_W83L785TS is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_JSM=m +CONFIG_SERIAL_NONSTANDARD=y +CONFIG_SERIAL_SUNCORE=y +CONFIG_SERIAL_SUNHV=y +CONFIG_SERIAL_SUNSAB=y +CONFIG_SERIAL_SUNSAB_CONSOLE=y +CONFIG_SERIAL_SUNSU=y +CONFIG_SERIAL_SUNSU_CONSOLE=y +CONFIG_SERIAL_SUNZILOG=y +CONFIG_SERIAL_SUNZILOG_CONSOLE=y +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_PARKBD is not set +CONFIG_SERIO_PCIPS2=y +CONFIG_SERIO_RAW=m +CONFIG_SERIO_SERPORT=m +CONFIG_SGI_IOC4=m +# CONFIG_SGI_PARTITION is not set +CONFIG_SHAPER=m +CONFIG_SHMEM=y +CONFIG_SIGNALFD=y +CONFIG_SIS190=m +CONFIG_SIS900=m +# CONFIG_SK98LIN is not set +CONFIG_SKFP=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SLAB is not set +CONFIG_SLABINFO=y +CONFIG_SLHC=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +# CONFIG_SLIP_MODE_SLIP6 is not set +CONFIG_SLIP_SMART=y +# CONFIG_SLOB is not set +CONFIG_SLUB=y +CONFIG_SLUB_DEBUG=y +# CONFIG_SLUB_DEBUG_ON is not set +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +CONFIG_SMSC_PHY=m +CONFIG_SND=m +CONFIG_SND_AC97_CODEC=m +CONFIG_SND_AC97_POWER_SAVE=y +CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0 +CONFIG_SND_AD1889=m +CONFIG_SND_ALI5451=m +CONFIG_SND_ALS300=m +CONFIG_SND_ATIIXP=m +CONFIG_SND_ATIIXP_MODEM=m +CONFIG_SND_AU8810=m +CONFIG_SND_AU8820=m +CONFIG_SND_AU8830=m +CONFIG_SND_AZT3328=m +CONFIG_SND_BT87X=m +CONFIG_SND_BT87X_OVERCLOCK=y +CONFIG_SND_CA0106=m +CONFIG_SND_CMIPCI=m +CONFIG_SND_CS4281=m +CONFIG_SND_CS46XX=m +CONFIG_SND_CS46XX_NEW_DSP=y +CONFIG_SND_DARLA20=m +CONFIG_SND_DARLA24=m +# CONFIG_SND_DEBUG is not set +CONFIG_SND_DUMMY=m +CONFIG_SND_DYNAMIC_MINORS=y +CONFIG_SND_ECHO3G=m +CONFIG_SND_EMU10K1=m +CONFIG_SND_EMU10K1X=m +CONFIG_SND_ENS1370=m +CONFIG_SND_ENS1371=m +CONFIG_SND_ES1938=m +CONFIG_SND_ES1968=m +CONFIG_SND_FM801=m +CONFIG_SND_FM801_TEA575X=m +CONFIG_SND_FM801_TEA575X_BOOL=y +CONFIG_SND_GINA20=m +CONFIG_SND_GINA24=m +CONFIG_SND_HDA_CODEC_ANALOG=y +CONFIG_SND_HDA_CODEC_ATIHDMI=y +CONFIG_SND_HDA_CODEC_CMEDIA=y +CONFIG_SND_HDA_CODEC_CONEXANT=y +CONFIG_SND_HDA_CODEC_REALTEK=y +CONFIG_SND_HDA_CODEC_SI3054=y +CONFIG_SND_HDA_CODEC_SIGMATEL=y +CONFIG_SND_HDA_CODEC_VIA=y +CONFIG_SND_HDA_GENERIC=y +CONFIG_SND_HDA_HWDEP=y +CONFIG_SND_HDA_INTEL=m +CONFIG_SND_HDA_POWER_SAVE=y +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDSP=m +CONFIG_SND_HDSPM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_ICE1712=m +CONFIG_SND_ICE1724=m +CONFIG_SND_INDIGO=m +CONFIG_SND_INDIGODJ=m +CONFIG_SND_INDIGOIO=m +CONFIG_SND_INTEL8X0=m +CONFIG_SND_INTEL8X0M=m +CONFIG_SND_KORG1212=m +CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL=y +CONFIG_SND_LAYLA20=m +CONFIG_SND_LAYLA24=m +CONFIG_SND_MAESTRO3=m +CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MIA=m +CONFIG_SND_MIXART=m +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_MONA=m +CONFIG_SND_MPU401=m +CONFIG_SND_MPU401_UART=m +CONFIG_SND_MTPAV=m +CONFIG_SND_MTS64=m +CONFIG_SND_NM256=m +CONFIG_SND_OPL3_LIB=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_PCM=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +CONFIG_SND_PCXHR=m +CONFIG_SND_PORTMAN2X4=m +CONFIG_SND_RAWMIDI=m +CONFIG_SND_RIPTIDE=m +CONFIG_SND_RME32=m +CONFIG_SND_RME96=m +CONFIG_SND_RME9652=m +CONFIG_SND_SEQUENCER=m +CONFIG_SND_SEQUENCER_OSS=y +CONFIG_SND_SEQ_DUMMY=m +CONFIG_SND_SERIAL_U16550=m +CONFIG_SND_SOC=m +CONFIG_SND_SONICVIBES=m +CONFIG_SND_SUN_AMD7930=m +CONFIG_SND_SUN_CS4231=m +CONFIG_SND_SUN_DBRI=m +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_TIMER=m +CONFIG_SND_TRIDENT=m +CONFIG_SND_USB_AUDIO=m +CONFIG_SND_USB_CAIAQ=m +CONFIG_SND_USB_CAIAQ_INPUT=y +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_VERBOSE_PROCFS is not set +CONFIG_SND_VIA82XX=m +CONFIG_SND_VIA82XX_MODEM=m +CONFIG_SND_VIRMIDI=m +CONFIG_SND_VX222=m +CONFIG_SND_VX_LIB=m +CONFIG_SND_YMFPCI=m +CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y +CONFIG_SOLARIS_EMUL=m +# CONFIG_SOLARIS_X86_PARTITION is not set +CONFIG_SOUND=m +CONFIG_SOUND_MSNDCLAS=m +CONFIG_SOUND_MSNDPIN=m +CONFIG_SOUND_PRIME=m +CONFIG_SOUND_TRIDENT=m +CONFIG_SPARC=y +CONFIG_SPARC32_COMPAT=y +CONFIG_SPARC64=y +# CONFIG_SPARC64_PAGE_SIZE_4MB is not set +# CONFIG_SPARC64_PAGE_SIZE_512KB is not set +# CONFIG_SPARC64_PAGE_SIZE_64KB is not set +CONFIG_SPARC64_PAGE_SIZE_8KB=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_MANUAL=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +# CONFIG_SPECIALIX is not set +CONFIG_SPI=y +CONFIG_SPI_AT25=m +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_LM70_LLP=m +CONFIG_SPI_MASTER=y +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_SSB=m +CONFIG_SSB_DEBUG=y +CONFIG_SSB_DRIVER_PCICORE=y +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCIHOST_POSSIBLE=y +CONFIG_SSB_POSSIBLE=y +CONFIG_STACKTRACE_SUPPORT=y +# CONFIG_STACK_DEBUG is not set +CONFIG_STALDRV=y +CONFIG_STANDALONE=y +CONFIG_STRIP=m +CONFIG_SUNBMAC=m +CONFIG_SUNDANCE=m +CONFIG_SUNDANCE_MMIO=y +CONFIG_SUNGEM=y +CONFIG_SUNLANCE=m +CONFIG_SUNQE=m +CONFIG_SUNRPC=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_XPRT_RDMA=m +CONFIG_SUNVDC=m +CONFIG_SUNVNET=m +CONFIG_SUN_AUXIO=y +# CONFIG_SUN_BPP is not set +CONFIG_SUN_IO=y +CONFIG_SUN_LDOMS=y +CONFIG_SUN_OPENPROMFS=m +CONFIG_SUN_OPENPROMIO=y +CONFIG_SUN_PARTITION=y +CONFIG_SWAP=y +CONFIG_SX=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_GT=m +CONFIG_SYN_COOKIES=y +CONFIG_SYSCTL=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_SYSFS=y +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_SYSV68_PARTITION=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_COMPAT=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_SYSV_FS=m +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_TASK_XACCT=y +CONFIG_TCG_ATMEL=m +CONFIG_TCG_TPM=m +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=y +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_ILLINOIS=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_MD5SIG=y +CONFIG_TEHUTI=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TICK_ONESHOT=y +CONFIG_TIFM_7XX1=m +CONFIG_TIFM_CORE=m +CONFIG_TIGON3=m +CONFIG_TIMER_STATS=y +# CONFIG_TINY_SHMEM is not set +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +# CONFIG_TMD_HERMES is not set +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +# CONFIG_TR is not set +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_TULIP=m +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_MWI is not set +CONFIG_TULIP_NAPI=y +CONFIG_TULIP_NAPI_HW_MITIGATION=y +CONFIG_TUN=m +# CONFIG_TUNER_3036 is not set +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_SIMPLE=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TYPHOON=m +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_UFS_DEBUG is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +CONFIG_UID16=y +CONFIG_UIO=m +CONFIG_UIO_CIF=m +CONFIG_ULI526X=m +# CONFIG_ULTRIX_PARTITION is not set +CONFIG_UNIX=y +CONFIG_UNIX98_PTYS=y +# CONFIG_UNIXWARE_DISKLABEL is not set +CONFIG_UNUSED_SYMBOLS=y +CONFIG_USB=y +# CONFIG_USB_ACM is not set +CONFIG_USB_ADUTUX=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARMLINUX=y +# CONFIG_USB_AUERSWALD is not set +CONFIG_USB_BELKIN=y +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_CATC=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_DABUSB=m +# CONFIG_USB_DEBUG is not set +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +CONFIG_USB_DSBR=m +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EMI26=m +CONFIG_USB_EMI62=m +CONFIG_USB_EPSON2888=y +CONFIG_USB_ET61X251=m +CONFIG_USB_FTDI_ELAN=m +# CONFIG_USB_GADGET is not set +CONFIG_USB_HID=m +# CONFIG_USB_HIDDEV is not set +CONFIG_USB_HIDINPUT_POWERBOOK=y +# CONFIG_USB_IBMCAM is not set +CONFIG_USB_IDMOUSE=m +CONFIG_USB_IOWARRIOR=m +# CONFIG_USB_ISP116X_HCD is not set +CONFIG_USB_KAWETH=m +CONFIG_USB_KBD=m +CONFIG_USB_KC2190=y +# CONFIG_USB_KONICAWC is not set +CONFIG_USB_LCD=m +CONFIG_USB_LD=m +CONFIG_USB_LED=m +# CONFIG_USB_LEGOTOWER is not set +CONFIG_USB_LIBUSUAL=y +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +CONFIG_USB_MON=y +CONFIG_USB_MOUSE=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_RNDIS_HOST=m +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_HCD=m +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OTG is not set +# CONFIG_USB_OV511 is not set +CONFIG_USB_PEGASUS=m +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +# CONFIG_USB_PHIDGETSERVO is not set +CONFIG_USB_PRINTER=m +# CONFIG_USB_PWC is not set +# CONFIG_USB_QUICKCAM_MESSENGER is not set +CONFIG_USB_R8A66597_HCD=m +CONFIG_USB_RIO500=m +CONFIG_USB_RTL8150=m +# CONFIG_USB_SE401 is not set +CONFIG_USB_SERIAL=m +# CONFIG_USB_SERIAL_AIRCABLE is not set +CONFIG_USB_SERIAL_AIRPRIME=m +# CONFIG_USB_SERIAL_ARK3116 is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_CH341 is not set +# CONFIG_USB_SERIAL_CP2101 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set +# CONFIG_USB_SERIAL_DEBUG is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_FUNSOFT is not set +# CONFIG_USB_SERIAL_GARMIN is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_HP4X is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IPW is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_MOS7720 is not set +# CONFIG_USB_SERIAL_MOS7840 is not set +# CONFIG_USB_SERIAL_NAVMAN is not set +# CONFIG_USB_SERIAL_OMNINET is not set +CONFIG_USB_SERIAL_OPTION=m +# CONFIG_USB_SERIAL_OTI6858 is not set +CONFIG_USB_SERIAL_PL2303=m +# CONFIG_USB_SERIAL_SAFE is not set +# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set +# CONFIG_USB_SERIAL_TI is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SN9C102=m +CONFIG_USB_STORAGE=m +CONFIG_USB_STORAGE_ALAUDA=y +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +# CONFIG_USB_STORAGE_JUMPSHOT is not set +CONFIG_USB_STORAGE_KARMA=y +# CONFIG_USB_STORAGE_ONETOUCH is not set +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_USBAT=y +# CONFIG_USB_STV680 is not set +CONFIG_USB_SUPPORT=y +# CONFIG_USB_TEST is not set +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_UHCI_HCD=m +CONFIG_USB_USBNET=m +# CONFIG_USB_USS720 is not set +# CONFIG_USB_VICAM is not set +# CONFIG_USB_W9968CF is not set +CONFIG_USB_ZC0301=m +CONFIG_USB_ZD1201=m +CONFIG_USB_ZR364XX=m +# CONFIG_USER_NS is not set +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VERSION_SIGNATURE="Unofficial" +CONFIG_VETH=m +CONFIG_VFAT_FS=m +CONFIG_VGASTATE=m +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_VIA_VELOCITY=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_GEN=m +# CONFIG_VIDEO_ADV7170 is not set +# CONFIG_VIDEO_ADV7175 is not set +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_BT819 is not set +# CONFIG_VIDEO_BT848 is not set +# CONFIG_VIDEO_BT856 is not set +# CONFIG_VIDEO_BT866 is not set +# CONFIG_VIDEO_BWQCAM is not set +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_CPIA is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_VIDEO_CQCAM is not set +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_CX2341X=m +CONFIG_VIDEO_CX25840=m +# CONFIG_VIDEO_CX88 is not set +CONFIG_VIDEO_DEV=m +# CONFIG_VIDEO_DPC is not set +# CONFIG_VIDEO_EM28XX is not set +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_IR_I2C=m +# CONFIG_VIDEO_IVTV is not set +# CONFIG_VIDEO_KS0127 is not set +CONFIG_VIDEO_MSP3400=m +# CONFIG_VIDEO_MXB is not set +CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_VIDEO_OV7670=m +# CONFIG_VIDEO_OVCAMCHIP is not set +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_29XXX=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_SAA5246A=m +# CONFIG_VIDEO_SAA5249 is not set +# CONFIG_VIDEO_SAA7110 is not set +# CONFIG_VIDEO_SAA7111 is not set +# CONFIG_VIDEO_SAA7114 is not set +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_ALSA=m +CONFIG_VIDEO_SAA7134_OSS=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +# CONFIG_VIDEO_SAA7185 is not set +# CONFIG_VIDEO_SAA7191 is not set +CONFIG_VIDEO_TCM825X=m +# CONFIG_VIDEO_TDA7432 is not set +CONFIG_VIDEO_TDA9840=m +# CONFIG_VIDEO_TDA9875 is not set +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +# CONFIG_VIDEO_TVAUDIO is not set +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_VP27SMPX=m +# CONFIG_VIDEO_VPX3220 is not set +# CONFIG_VIDEO_W9966 is not set +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_WM8775=m +CONFIG_VITESSE_PHY=m +CONFIG_VLAN_8021Q=m +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VORTEX=m +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_VXFS_FS is not set +CONFIG_W1=m +CONFIG_W1_CON=y +CONFIG_W1_MASTER_DS2482=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2760=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_THERM=m +# CONFIG_WAN is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_WATCHDOG is not set +# CONFIG_WDC_ALI15X3 is not set +CONFIG_WINBOND_840=m +CONFIG_WIRELESS_EXT=y +CONFIG_WLAN_80211=y +CONFIG_WLAN_PRE80211=y +# CONFIG_X25 is not set +CONFIG_XFRM=y +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_SUB_POLICY is not set +CONFIG_XFRM_USER=m +CONFIG_XFS_FS=m +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_QUOTA=y +# CONFIG_XFS_RT is not set +# CONFIG_XFS_SECURITY is not set +CONFIG_XOR_BLOCKS=m +CONFIG_YELLOWFIN=m +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +# CONFIG_ZISOFS is not set +CONFIG_ZLIB_DEFLATE=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZONE_DMA_FLAG=0 --- linux-2.6.24.orig/debian/config/hppa/config.hppa32 +++ linux-2.6.24/debian/config/hppa/config.hppa32 @@ -0,0 +1,386 @@ +# +# Config options for config.hppa32 automatically generated by splitconfig.pl +# +CONFIG_8139CP=m +CONFIG_8139TOO=m +CONFIG_8139TOO_8129=y +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_9P_FS=m +CONFIG_AC3200=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_AGP=m +CONFIG_AIRO_CS=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_AMD8111_ETH=m +CONFIG_APRICOT=m +# CONFIG_ARLAN is not set +CONFIG_AT1700=m +CONFIG_ATL1=m +CONFIG_AUTOFS4_FS=m +CONFIG_AUTOFS_FS=m +CONFIG_B43_LEDS=y +CONFIG_B44=m +CONFIG_B44_PCI=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +CONFIG_BCM43XX_PIO=y +# CONFIG_BCM43XX_PIO_MODE is not set +CONFIG_BNX2=m +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_CPUSETS=y +CONFIG_CRAMFS=y +CONFIG_CRC16=m +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_CBC=y +CONFIG_CRYPTO_DES=y +CONFIG_CS89x0=m +# CONFIG_DE2104X is not set +CONFIG_DEBUG_FS=y +# CONFIG_DEBUG_RWLOCK is not set +CONFIG_DEPCA=m +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +CONFIG_DISPLAY_SUPPORT=m +CONFIG_DL2K=m +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +CONFIG_E2100=m +CONFIG_ECRYPT_FS=m +CONFIG_EEPRO100=m +CONFIG_EEXPRESS=m +CONFIG_EEXPRESS_PRO=m +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_EPIC100=m +CONFIG_ES3210=m +CONFIG_ETH16I=m +CONFIG_EWRK3=m +CONFIG_EXT2_FS=m +CONFIG_EXT3_FS=m +CONFIG_FB=y +# CONFIG_FB_3DFX is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_BACKLIGHT is not set +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_DDC is not set +CONFIG_FB_DEFERRED_IO=y +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_MATROX is not set +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_PM2 is not set +CONFIG_FB_PM3=m +# CONFIG_FB_RADEON is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +CONFIG_FB_SM501=m +CONFIG_FB_STI=y +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +CONFIG_FB_TILEBLITTING=y +# CONFIG_FB_TRIDENT is not set +CONFIG_FB_UVESA=m +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +CONFIG_FEALNX=m +CONFIG_FIRMWARE_EDID=y +CONFIG_FLATMEM=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x16=y +CONFIG_FONT_8x8=y +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FS_MBCACHE=m +CONFIG_FUSE_FS=m +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_HAMACHI=m +CONFIG_HID=m +CONFIG_HIL_MLC=m +CONFIG_HOSTAP=m +CONFIG_HOSTAP_CS=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_PLX=m +CONFIG_HOTPLUG_CPU=y +CONFIG_HPLAN=m +CONFIG_HPLAN_PLUS=m +# CONFIG_HPUX is not set +CONFIG_HP_SDC=m +CONFIG_HP_SDC_RTC=m +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_HWMON_VID=m +CONFIG_HW_RANDOM=y +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_MISC=y +CONFIG_INPUT_MOUSE=y +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_TABLET=y +# CONFIG_INPUT_UINPUT is not set +CONFIG_INPUT_YEALINK=m +CONFIG_ISO9660_FS=m +CONFIG_IXGB=m +# CONFIG_IXGB_NAPI is not set +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_ATKBD_HP_KEYCODES is not set +CONFIG_KEYBOARD_HIL=m +CONFIG_KEYBOARD_HIL_OLD=m +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_KEYBOARD_STOWAWAY=m +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +CONFIG_KS0108=m +CONFIG_KS0108_DELAY=2 +CONFIG_KS0108_PORT=0x378 +# CONFIG_LBD is not set +CONFIG_LCD_LTV350QV=m +CONFIG_LEDS_CLASS=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LNE390=m +CONFIG_LOCKD=y +CONFIG_LOCK_KERNEL=y +# CONFIG_LOGO is not set +CONFIG_LP486E=m +# CONFIG_LP_CONSOLE is not set +# CONFIG_LSF is not set +CONFIG_MAC80211_DEBUGFS=y +CONFIG_MAC80211_LEDS=y +CONFIG_MFD_SM501=m +CONFIG_MOUSE_APPLETOUCH=m +CONFIG_MOUSE_HIL=m +# CONFIG_MOUSE_INPORT is not set +# CONFIG_MOUSE_LOGIBM is not set +# CONFIG_MOUSE_PC110PAD is not set +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +CONFIG_MYRI10GE=m +CONFIG_NATSEMI=m +CONFIG_NE2000=m +CONFIG_NE2K_PCI=m +CONFIG_NE3210=m +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NETXEN_NIC=m +CONFIG_NET_ISA=y +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_NEW_LEDS=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_FS=y +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_ISO8859_15 is not set +CONFIG_NR_CPUS=32 +CONFIG_NS83820=m +# CONFIG_NTFS_DEBUG is not set +CONFIG_NTFS_FS=m +# CONFIG_NTFS_RW is not set +CONFIG_PA11=y +CONFIG_PA7000=y +# CONFIG_PA8X00 is not set +CONFIG_PCMCIA_AHA152X=m +CONFIG_PCMCIA_AXNET=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_NETWAVE=m +CONFIG_PCMCIA_NINJA_SCSI=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PDC_CONSOLE=y +CONFIG_PPPOE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PREEMPT_BKL=y +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +CONFIG_PRINTER=m +CONFIG_PRINTK_TIME=y +CONFIG_PROC_PID_CPUSET=y +CONFIG_QLA3XXX=m +CONFIG_QUOTACTL=y +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +# CONFIG_RAW_DRIVER is not set +# CONFIG_REISERFS_CHECK is not set +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_FS_XATTR is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_RFKILL_LEDS=y +CONFIG_ROOT_NFS=y +CONFIG_RPCSEC_GSS_KRB5=y +# CONFIG_RT2X00_LIB_DEBUGFS is not set +CONFIG_RTC_CLASS=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_TEST=m +CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=m +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +CONFIG_SC92031=m +# CONFIG_SCSI_AHA152X is not set +CONFIG_SCSI_DPT_I2O=m +CONFIG_SCSI_NSP32=m +CONFIG_SEEQ8005=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SERIAL_8250_ACCENT=m +CONFIG_SERIAL_8250_BOCA=m +CONFIG_SERIAL_8250_EXAR_ST16C554=m +CONFIG_SERIAL_8250_FOURPORT=m +CONFIG_SERIAL_8250_HUB6=m +CONFIG_SERIAL_8250_NR_UARTS=48 +# CONFIG_SERIAL_MUX is not set +CONFIG_SERIO=y +CONFIG_SERIO_GSCPS2=y +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_PARKBD is not set +# CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_RAW=m +# CONFIG_SERIO_SERPORT is not set +CONFIG_SHAPER=m +CONFIG_SIS190=m +CONFIG_SIS900=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SLAB is not set +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +# CONFIG_SLIP_MODE_SLIP6 is not set +CONFIG_SLIP_SMART=y +CONFIG_SLUB=y +CONFIG_SLUB_DEBUG=y +# CONFIG_SLUB_DEBUG_ON is not set +CONFIG_SMP=y +CONFIG_SPI=y +CONFIG_SPI_AT25=m +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_LM70_LLP=m +CONFIG_SPI_MASTER=y +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_SPLIT_PTLOCK_CPUS=4096 +CONFIG_STI_CONSOLE=y +CONFIG_STOP_MACHINE=y +# CONFIG_STRIP is not set +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_SYNCLINK_CS=m +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_TIMER_STATS=y +CONFIG_TIME_LOW_RES=y +CONFIG_TLAN=m +CONFIG_TULIP=m +# CONFIG_TULIP_MMIO is not set +# CONFIG_UFS_FS is not set +CONFIG_ULI526X=m +CONFIG_UNUSED_SYMBOLS=y +# CONFIG_USB_STORAGE_ONETOUCH is not set +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_VIA_VELOCITY=m +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_VXFS_FS=m +# CONFIG_WAVELAN is not set +CONFIG_WLAN_PRE80211=y +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_QUOTA=y +CONFIG_YELLOWFIN=m +CONFIG_ZISOFS=y +CONFIG_ZLIB_INFLATE=y --- linux-2.6.24.orig/debian/config/hppa/config +++ linux-2.6.24/debian/config/hppa/config @@ -0,0 +1,1366 @@ +# +# Common config options automatically generated by splitconfig.pl +# +CONFIG_53C700_LE_ON_BE=y +CONFIG_ACENIC=m +# CONFIG_ADFS_FS is not set +CONFIG_ADM8211=m +# CONFIG_AFFS_FS is not set +# CONFIG_AFS_FS is not set +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_ANON_INODES=y +# CONFIG_APPLICOM is not set +CONFIG_ARCH_FLATMEM_ENABLE=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_ARCNET is not set +# CONFIG_ARPD is not set +CONFIG_ASK_IP_FIB_HASH=y +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_ATA=m +# CONFIG_ATALK is not set +CONFIG_ATA_GENERIC=m +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_OVER_ETH=m +CONFIG_ATA_PIIX=m +# CONFIG_ATM is not set +# CONFIG_ATMEL is not set +CONFIG_AUDIT=y +CONFIG_AUDIT_GENERIC=y +CONFIG_AUXDISPLAY=y +CONFIG_B43=m +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PIO=y +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_B43_DEBUG=y +CONFIG_B43_DMA=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +CONFIG_B43_PCICORE_AUTOSELECT=y +CONFIG_B43_PCI_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_PIO=y +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43_RFKILL=y +CONFIG_BACKLIGHT_CLASS_DEVICE=m +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BASE_FULL=y +CONFIG_BASE_SMALL=0 +CONFIG_BATTERY_DS2760=m +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m +CONFIG_BITREVERSE=y +# CONFIG_BLK_CPQ_CISS_DA is not set +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +CONFIG_BLK_DEV_4DRIVES=y +# CONFIG_BLK_DEV_AEC62XX is not set +CONFIG_BLK_DEV_ALI14XX=m +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_CRYPTOLOOP=m +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_DM=m +CONFIG_BLK_DEV_DTC2278=m +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +CONFIG_BLK_DEV_HT6560B=m +CONFIG_BLK_DEV_IDE=m +CONFIG_BLK_DEV_IDECD=m +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDEDISK=m +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +# CONFIG_BLK_DEV_IDEFLOPPY is not set +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_BLK_DEV_IDESCSI=m +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_JMICRON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_MD=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_NS87415=m +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PIIX is not set +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_QD65XX=m +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +# CONFIG_BLK_DEV_SC1200 is not set +CONFIG_BLK_DEV_SD=m +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_TC86C001=m +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_UMC8672=m +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +CONFIG_BLOCK=y +# CONFIG_BONDING is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_BRIDGE=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_NETFILTER=y +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BROADCOM_PHY=m +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +# CONFIG_BT is not set +CONFIG_BUG=y +CONFIG_CARDBUS=y +CONFIG_CASSINI=m +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_CFG80211=m +CONFIG_CGROUPS=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_CGROUP_DEBUG is not set +CONFIG_CGROUP_NS=y +CONFIG_CHASSIS_LCD_LED=y +CONFIG_CHR_DEV_OSST=m +CONFIG_CHR_DEV_SCH=m +CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_ST=m +CONFIG_CICADA_PHY=m +CONFIG_CIFS=m +# CONFIG_CIFS_DEBUG2 is not set +CONFIG_CIFS_EXPERIMENTAL=y +# CONFIG_CIFS_STATS is not set +CONFIG_CIFS_UPCALL=y +CONFIG_CIFS_WEAK_PW_HASH=y +# CONFIG_CIFS_XATTR is not set +CONFIG_CLS_U32_MARK=y +CONFIG_CLS_U32_PERF=y +# CONFIG_CODA_FS is not set +CONFIG_CONFIGFS_FS=m +CONFIG_CONNECTOR=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_CRC_CCITT=m +CONFIG_CRC_ITU_T=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_XTS=m +CONFIG_DAB=y +CONFIG_DAVICOM_PHY=m +# CONFIG_DE4X5 is not set +CONFIG_DEBUG_BUGVERBOSE=y +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_MUTEXES is not set +CONFIG_DEBUG_RODATA=y +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DECNET is not set +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_BIC is not set +CONFIG_DEFAULT_CFQ=y +CONFIG_DEFAULT_CUBIC=y +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_HTCP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 +# CONFIG_DEFAULT_RENO is not set +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_DEVPORT=y +# CONFIG_DEV_KMEM is not set +# CONFIG_DM9102 is not set +CONFIG_DM_CRYPT=m +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_DELAY is not set +CONFIG_DM_MIRROR=m +# CONFIG_DM_MULTIPATH is not set +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_UEVENT=y +CONFIG_DM_ZERO=m +CONFIG_DNOTIFY=y +# CONFIG_DRM is not set +# CONFIG_DTLK is not set +CONFIG_DUMMY=m +CONFIG_DUMMY_CONSOLE=y +CONFIG_DUMMY_CONSOLE_COLUMNS=160 +CONFIG_DUMMY_CONSOLE_ROWS=64 +# CONFIG_DVB_CORE is not set +CONFIG_E100=m +CONFIG_E1000=m +CONFIG_E1000E=m +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000_NAPI=y +# CONFIG_ECONET is not set +CONFIG_EEPROM_93CX6=m +# CONFIG_EFS_FS is not set +CONFIG_EISA=y +CONFIG_EISA_NAMES=y +CONFIG_EL1=m +CONFIG_EL16=m +CONFIG_EL2=m +CONFIG_EL3=m +CONFIG_ELF_CORE=y +# CONFIG_EMBEDDED is not set +# CONFIG_ENABLE_WARN_DEPRECATED is not set +CONFIG_EPOLL=y +# CONFIG_EQUALIZER is not set +CONFIG_EVENTFD=y +CONFIG_EXPERIMENTAL=y +CONFIG_EXPORTFS=m +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_FAIR_CGROUP_SCHED=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_FAIR_USER_SCHED is not set +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_FAT_FS=m +# CONFIG_FAULT_INJECTION is not set +# CONFIG_FDDI is not set +CONFIG_FIB_RULES=y +# CONFIG_FIREWIRE is not set +CONFIG_FIXED_MII_1000_FDX=y +# CONFIG_FIXED_MII_100_FDX is not set +# CONFIG_FIXED_MII_10_FDX is not set +CONFIG_FIXED_MII_AMNT=1 +CONFIG_FIXED_PHY=m +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_FORCED_INLINING=y +CONFIG_FS_POSIX_ACL=y +CONFIG_FUSION=y +CONFIG_FUSION_CTL=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_LOGGING=y +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_SAS=m +CONFIG_FUSION_SPI=m +CONFIG_FUTEX=y +CONFIG_FW_LOADER=y +CONFIG_GACT_PROB=y +# CONFIG_GAMEPORT is not set +CONFIG_GENERIC_ACL=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_TIME=y +CONFIG_GEN_RTC=y +CONFIG_GEN_RTC_X=y +CONFIG_GSC=y +CONFIG_GSC_DINO=y +CONFIG_GSC_LASI=y +CONFIG_GSC_WAX=y +# CONFIG_HAMRADIO is not set +CONFIG_HAPPYMEAL=m +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +# CONFIG_HEADERS_CHECK is not set +CONFIG_HERMES=m +# CONFIG_HFSPLUS_FS is not set +# CONFIG_HFS_FS is not set +CONFIG_HIDRAW=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HID_FF is not set +CONFIG_HID_SUPPORT=y +# CONFIG_HIPPI is not set +CONFIG_HOTPLUG=y +# CONFIG_HOTPLUG_PCI is not set +CONFIG_HP100=m +# CONFIG_HPFS_FS is not set +CONFIG_HPPB=y +# CONFIG_HUGETLB_PAGE is not set +CONFIG_HW_CONSOLE=y +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +# CONFIG_HZ_1000 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_300 is not set +# CONFIG_I2C is not set +CONFIG_I2O=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_BUS=m +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_PROC=m +CONFIG_I2O_SCSI=m +CONFIG_I82092=m +CONFIG_I82365=m +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +CONFIG_ICPLUS_PHY=m +CONFIG_IDE=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEPCI_PCIBUS_ORDER is not set +CONFIG_IDEPCI_SHARE_IRQ=y +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_IDE_ARM is not set +CONFIG_IDE_GENERIC=m +CONFIG_IDE_PROC_FS=y +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_IEEE1394 is not set +CONFIG_IEEE80211=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_CRYPT_WEP=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_IFB=m +CONFIG_IKCONFIG=y +# CONFIG_IKCONFIG_PROC is not set +CONFIG_INET=y +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET_AH=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_INET_DIAG=y +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_LRO=m +CONFIG_INET_TCP_DIAG=y +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_TUNNEL=m +# CONFIG_INFINIBAND is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_INPUT=y +# CONFIG_INPUT_EVBUG is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_JOYSTICK is not set +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_POLLDEV=m +# CONFIG_INPUT_TOUCHSCREEN is not set +CONFIG_INSTRUMENTATION=y +CONFIG_IOMMU_CCIO=y +CONFIG_IOMMU_SBA=y +CONFIG_IOSAPIC=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_CFQ=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_NOOP=y +CONFIG_IP1000=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_RAW=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +# CONFIG_IPMI_HANDLER is not set +CONFIG_IPV6=m +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +CONFIG_IPW2100=m +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +CONFIG_IPW2200=m +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +CONFIG_IPW2200_RADIOTAP=y +# CONFIG_IPX is not set +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_DCCP=m +CONFIG_IP_DCCP_ACKVEC=y +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_IP_DCCP_TFRC_LIB=m +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_MROUTE=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARP_MANGLE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_DHCP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_IP_ROUTE_MULTIPATH is not set +# CONFIG_IP_ROUTE_VERBOSE is not set +CONFIG_IP_SCTP=m +# CONFIG_IP_VS is not set +# CONFIG_IRDA is not set +CONFIG_IRQ_PER_CPU=y +CONFIG_ISA=y +CONFIG_ISCSI_TCP=m +# CONFIG_ISDN is not set +# CONFIG_IWLWIFI is not set +CONFIG_IXGBE=m +# CONFIG_JFS_DEBUG is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_POSIX_ACL is not set +# CONFIG_JFS_SECURITY is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_JOLIET=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_KEYS=y +CONFIG_KMOD=y +# CONFIG_LAPB is not set +CONFIG_LASI_82596=m +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LIBCRC32C=m +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_CS=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_LIBERTAS_USB=m +CONFIG_LLC=m +# CONFIG_LLC2 is not set +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_LOCKD_V4=y +CONFIG_LOG_BUF_SHIFT=17 +CONFIG_LXT_PHY=m +CONFIG_MAC80211=m +# CONFIG_MAC80211_DEBUG is not set +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MACVLAN=m +CONFIG_MAGIC_SYSRQ=y +# CONFIG_MARKERS is not set +CONFIG_MARVELL_PHY=m +CONFIG_MD=y +CONFIG_MDIO_BITBANG=m +CONFIG_MD_FAULTY=m +CONFIG_MD_LINEAR=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_SAS=m +CONFIG_MII=m +# CONFIG_MINIX_FS is not set +CONFIG_MISC_DEVICES=y +# CONFIG_MLX4_CORE is not set +# CONFIG_MMC is not set +CONFIG_MMU=y +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MSDOS_FS=m +CONFIG_MSDOS_PARTITION=y +# CONFIG_MSS is not set +# CONFIG_MTD is not set +# CONFIG_NCP_FS is not set +CONFIG_NET=y +CONFIG_NETDEVICES=y +CONFIG_NETDEVICES_MULTIQUEUE=y +CONFIG_NETDEV_1000=y +CONFIG_NETDEV_10000=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +# CONFIG_NETLABEL is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NETWORK_SECMARK=y +CONFIG_NET_9P=m +# CONFIG_NET_9P_DEBUG is not set +CONFIG_NET_9P_FD=m +CONFIG_NET_ACT_GACT=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SIMP=m +CONFIG_NET_CLS=y +CONFIG_NET_CLS_ACT=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_IND=y +# CONFIG_NET_CLS_POLICE is not set +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_U32=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_ETHERNET=y +# CONFIG_NET_FC is not set +CONFIG_NET_IPGRE=m +# CONFIG_NET_IPGRE_BROADCAST is not set +CONFIG_NET_IPIP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_NET_PCI=y +CONFIG_NET_PCMCIA=y +# CONFIG_NET_PKTGEN is not set +# CONFIG_NET_POCKET is not set +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_FIFO=y +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_TULIP=y +CONFIG_NET_VENDOR_3COM=y +CONFIG_NET_VENDOR_RACAL=y +CONFIG_NET_VENDOR_SMC=y +CONFIG_NFSD=m +CONFIG_NFSD_TCP=y +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CT_NETLINK=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_TFTP=m +# CONFIG_NI52 is not set +# CONFIG_NIU is not set +CONFIG_NL80211=y +CONFIG_NLS=y +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_CODEPAGE_437=m +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_ISO8859_1=m +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +CONFIG_NLS_UTF8=m +# CONFIG_NORTEL_HERMES is not set +# CONFIG_OCFS2_FS is not set +CONFIG_OPROFILE=m +CONFIG_P54_COMMON=m +CONFIG_P54_PCI=m +CONFIG_P54_USB=m +# CONFIG_PA7100LC is not set +# CONFIG_PA7200 is not set +# CONFIG_PA7300LC is not set +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_PARIDE is not set +CONFIG_PARISC=y +# CONFIG_PARISC_PAGE_SIZE_16KB is not set +CONFIG_PARISC_PAGE_SIZE_4KB=y +# CONFIG_PARISC_PAGE_SIZE_64KB is not set +CONFIG_PARPORT=m +# CONFIG_PARPORT_1284 is not set +CONFIG_PARPORT_AX88796=m +CONFIG_PARPORT_GSC=y +CONFIG_PARPORT_NOT_PC=y +CONFIG_PARPORT_PC=m +# CONFIG_PARPORT_PC_FIFO is not set +CONFIG_PARPORT_PC_PCMCIA=m +# CONFIG_PARPORT_PC_SUPERIO is not set +# CONFIG_PARPORT_SERIAL is not set +# CONFIG_PARTITION_ADVANCED is not set +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_CMD64X is not set +CONFIG_PATA_CS5520=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_EFAR=m +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +CONFIG_PATA_IT8213=m +CONFIG_PATA_IT821X=m +CONFIG_PATA_JMICRON=m +# CONFIG_PATA_LEGACY is not set +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_NETCELL=m +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +CONFIG_PATA_OLDPIIX=m +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +CONFIG_PATA_PCMCIA=m +CONFIG_PATA_PDC2027X=m +# CONFIG_PATA_PDC_OLD is not set +CONFIG_PATA_QDI=m +# CONFIG_PATA_RADISYS is not set +CONFIG_PATA_RZ1000=m +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_VIA=m +CONFIG_PATA_WINBOND=m +# CONFIG_PATA_WINBOND_VLB is not set +CONFIG_PCCARD=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_PCI=y +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_HERMES is not set +CONFIG_PCI_LBA=y +CONFIG_PCI_LEGACY=y +CONFIG_PCMCIA=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_3C589=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_IOCTL=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_RAYCS=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_PD6729=m +CONFIG_PDA_POWER=m +CONFIG_PDC_ADMA=m +CONFIG_PDC_CHASSIS=y +CONFIG_PDC_CHASSIS_WARN=y +CONFIG_PDC_STABLE=y +CONFIG_PHANTOM=m +# CONFIG_PHONE is not set +CONFIG_PHYLIB=m +# CONFIG_PID_NS is not set +CONFIG_PLIP=m +CONFIG_PLIST=y +# CONFIG_PLX_HERMES is not set +# CONFIG_PNP is not set +CONFIG_POSIX_MQUEUE=y +CONFIG_POWER_SUPPLY=m +# CONFIG_POWER_SUPPLY_DEBUG is not set +# CONFIG_PPDEV is not set +CONFIG_PPP=m +CONFIG_PPPOL2TP=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_SYNC_TTY=m +# CONFIG_PREEMPT is not set +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_PRINTK=y +# CONFIG_PRISM54 is not set +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROFILING=y +# CONFIG_QNX4FS_FS is not set +CONFIG_QSEMI_PHY=m +# CONFIG_QUOTA is not set +# CONFIG_R3964 is not set +CONFIG_RADIO_ADAPTERS=y +# CONFIG_RADIO_AZTECH is not set +# CONFIG_RADIO_CADET is not set +# CONFIG_RADIO_GEMTEK is not set +# CONFIG_RADIO_GEMTEK_PCI is not set +# CONFIG_RADIO_MAESTRO is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_RADIO_RTRACK is not set +# CONFIG_RADIO_RTRACK2 is not set +# CONFIG_RADIO_SF16FMI is not set +# CONFIG_RADIO_SF16FMR2 is not set +# CONFIG_RADIO_TERRATEC is not set +# CONFIG_RADIO_TRUST is not set +# CONFIG_RADIO_TYPHOON is not set +# CONFIG_RADIO_ZOLTRIX is not set +CONFIG_RAID_ATTRS=m +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RELAY=y +CONFIG_RESOURCES_64BIT=y +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +# CONFIG_ROMFS_FS is not set +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT2X00=m +# CONFIG_RT2X00_DEBUG is not set +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT73USB=m +CONFIG_RTL8187=m +CONFIG_RT_MUTEXES=y +# CONFIG_RT_MUTEX_TESTER is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_RXKAD=m +# CONFIG_SAMPLES is not set +CONFIG_SATA_AHCI=m +CONFIG_SATA_INIC162X=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_SVW=m +CONFIG_SATA_SX4=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +# CONFIG_SCHEDSTATS is not set +CONFIG_SCHED_DEBUG=y +CONFIG_SCSI=y +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_ACARD is not set +CONFIG_SCSI_ADVANSYS=m +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_AIC94XX=m +CONFIG_SCSI_ARCMSR=m +# CONFIG_SCSI_CONSTANTS is not set +CONFIG_SCSI_DC390T=m +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DEBUG is not set +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_FC_TGT_ATTRS=y +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set +CONFIG_SCSI_HPTIOP=m +# CONFIG_SCSI_IMM is not set +# CONFIG_SCSI_IN2000 is not set +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_INITIO=m +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_IPS is not set +CONFIG_SCSI_ISCSI_ATTRS=m +CONFIG_SCSI_LASI700=m +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_LOWLEVEL=y +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_SCSI_LPFC=m +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_NCR53C406A is not set +CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8 +CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32 +CONFIG_SCSI_NCR53C8XX_SYNC=20 +CONFIG_SCSI_NETLINK=y +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PPA is not set +CONFIG_SCSI_PROC_FS=y +# CONFIG_SCSI_PSI240I is not set +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_QLOGIC_1280=m +# CONFIG_SCSI_QLOGIC_FAS is not set +CONFIG_SCSI_SAS_ATA=y +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SCAN_ASYNC=y +# CONFIG_SCSI_SIM710 is not set +CONFIG_SCSI_SPI_ATTRS=y +CONFIG_SCSI_SRP=m +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_STEX=m +# CONFIG_SCSI_SYM53C416 is not set +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +# CONFIG_SCSI_T128 is not set +CONFIG_SCSI_TGT=m +CONFIG_SCSI_WAIT_SCAN=m +CONFIG_SCSI_ZALON=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +CONFIG_SCTP_HMAC_MD5=y +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SECURITY=y +CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 +# CONFIG_SECURITY_APPARMOR_DISABLE is not set +CONFIG_SECURITY_CAPABILITIES=y +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_SECURITY_NETWORK=y +# CONFIG_SECURITY_NETWORK_XFRM is not set +# CONFIG_SECURITY_SELINUX is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_CS=m +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_GSC=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_PCI=y +# CONFIG_SERIAL_8250_RSA is not set +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_SGI_IOC4=m +CONFIG_SHMEM=y +CONFIG_SIGNALFD=y +# CONFIG_SK98LIN is not set +CONFIG_SLABINFO=y +CONFIG_SLHC=m +# CONFIG_SLOB is not set +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_SMC9194=m +CONFIG_SMSC_PHY=m +# CONFIG_SOUND is not set +# CONFIG_SPARSEMEM_MANUAL is not set +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +CONFIG_SSB=m +CONFIG_SSB_DEBUG=y +CONFIG_SSB_DRIVER_PCICORE=y +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCIHOST_POSSIBLE=y +# CONFIG_SSB_PCMCIAHOST is not set +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +CONFIG_SSB_POSSIBLE=y +CONFIG_STACK_GROWSUP=y +CONFIG_STANDALONE=y +CONFIG_SUNGEM=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_SUPERIO=y +CONFIG_SWAP=y +# CONFIG_SYN_COOKIES is not set +CONFIG_SYSCTL=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_SYSFS=y +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_SYSV_FS is not set +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_TASK_XACCT=y +# CONFIG_TCG_TPM is not set +CONFIG_TCIC=m +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=y +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_ILLINOIS=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_MD5SIG=y +CONFIG_TEHUTI=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TIFM_7XX1=m +CONFIG_TIFM_CORE=m +CONFIG_TIGON3=m +# CONFIG_TINY_SHMEM is not set +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +# CONFIG_TMD_HERMES is not set +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +# CONFIG_TR is not set +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_NAPI is not set +CONFIG_TUN=m +CONFIG_TYPHOON=m +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_UIO=m +CONFIG_UIO_CIF=m +CONFIG_ULTRA=m +CONFIG_ULTRA32=m +CONFIG_UNIX=y +CONFIG_UNIX98_PTYS=y +CONFIG_USB=m +# CONFIG_USB_ACM is not set +CONFIG_USB_ADUTUX=m +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_USB_AUERSWALD is not set +CONFIG_USB_BERRY_CHARGE=m +# CONFIG_USB_CATC is not set +CONFIG_USB_CYPRESS_CY7C63=m +# CONFIG_USB_CYTHERM is not set +CONFIG_USB_DABUSB=m +CONFIG_USB_DEBUG=y +# CONFIG_USB_DEVICEFS is not set +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DSBR is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EMI26=m +CONFIG_USB_EMI62=m +# CONFIG_USB_ET61X251 is not set +CONFIG_USB_FTDI_ELAN=m +# CONFIG_USB_GADGET is not set +CONFIG_USB_HID=m +CONFIG_USB_HIDDEV=y +CONFIG_USB_HIDINPUT_POWERBOOK=y +# CONFIG_USB_IBMCAM is not set +# CONFIG_USB_IDMOUSE is not set +CONFIG_USB_IOWARRIOR=m +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_KAWETH is not set +CONFIG_USB_KBD=m +# CONFIG_USB_KONICAWC is not set +# CONFIG_USB_LCD is not set +CONFIG_USB_LD=m +# CONFIG_USB_LED is not set +# CONFIG_USB_LEGOTOWER is not set +CONFIG_USB_LIBUSUAL=y +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set +CONFIG_USB_MON=y +CONFIG_USB_MOUSE=m +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_HCD=m +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OTG is not set +# CONFIG_USB_OV511 is not set +# CONFIG_USB_PEGASUS is not set +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +# CONFIG_USB_PHIDGETSERVO is not set +# CONFIG_USB_PRINTER is not set +# CONFIG_USB_PWC is not set +# CONFIG_USB_QUICKCAM_MESSENGER is not set +CONFIG_USB_R8A66597_HCD=m +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_SE401 is not set +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SISUSBVGA is not set +CONFIG_USB_SL811_CS=m +CONFIG_USB_SL811_HCD=m +# CONFIG_USB_SN9C102 is not set +CONFIG_USB_STORAGE=m +CONFIG_USB_STORAGE_ALAUDA=y +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +CONFIG_USB_STORAGE_KARMA=y +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +CONFIG_USB_STORAGE_USBAT=y +# CONFIG_USB_STV680 is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_U132_HCD=m +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_USS720 is not set +# CONFIG_USB_VICAM is not set +# CONFIG_USB_ZC0301 is not set +# CONFIG_USB_ZD1201 is not set +# CONFIG_USB_ZR364XX is not set +# CONFIG_USER_NS is not set +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VERSION_SIGNATURE="Unofficial" +CONFIG_VETH=m +CONFIG_VFAT_FS=m +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_BWQCAM is not set +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_CPIA is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_VIDEO_CQCAM is not set +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_HELPER_CHIPS_AUTO=y +CONFIG_VIDEO_OUTPUT_CONTROL=m +# CONFIG_VIDEO_PMS is not set +# CONFIG_VIDEO_STRADIS is not set +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +# CONFIG_VIDEO_VIVI is not set +CONFIG_VIRT_TO_BUS=y +CONFIG_VITESSE_PHY=m +CONFIG_VLAN_8021Q=m +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VORTEX=m +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_W1=m +CONFIG_W1_CON=y +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2760=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_THERM=m +# CONFIG_WAN is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_WATCHDOG is not set +CONFIG_WD80x3=m +# CONFIG_WINBOND_840 is not set +CONFIG_WIRELESS_EXT=y +CONFIG_WLAN_80211=y +# CONFIG_X25 is not set +CONFIG_XFRM=y +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_SUB_POLICY is not set +CONFIG_XFRM_USER=m +CONFIG_XFS_FS=m +# CONFIG_XFS_RT is not set +# CONFIG_XFS_SECURITY is not set +CONFIG_XOR_BLOCKS=m +CONFIG_YENTA=m +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_ZLIB_DEFLATE=m +CONFIG_ZONE_DMA_FLAG=0 --- linux-2.6.24.orig/debian/config/hppa/config.hppa64 +++ linux-2.6.24/debian/config/hppa/config.hppa64 @@ -0,0 +1,173 @@ +# +# Config options for config.hppa64 automatically generated by splitconfig.pl +# +CONFIG_64BIT=y +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_9P_FS is not set +# CONFIG_AC3200 is not set +CONFIG_ACENIC_OMIT_TIGON_I=y +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_AGP is not set +# CONFIG_AIRO_CS is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_APRICOT is not set +CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y +CONFIG_ARCH_DISCONTIGMEM_ENABLE=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +# CONFIG_AT1700 is not set +# CONFIG_ATL1 is not set +CONFIG_AUTOFS4_FS=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_B44 is not set +# CONFIG_BCM43XX is not set +CONFIG_BLOCK_COMPAT=y +# CONFIG_BNX2 is not set +CONFIG_BROKEN_ON_SMP=y +# CONFIG_CARDMAN_4000 is not set +# CONFIG_CARDMAN_4040 is not set +# CONFIG_CHELSIO_T1 is not set +# CONFIG_CHELSIO_T3 is not set +CONFIG_COMPAT=y +# CONFIG_CRAMFS is not set +# CONFIG_CRC16 is not set +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_DES=m +# CONFIG_CS89x0 is not set +CONFIG_DE2104X=m +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEPCA is not set +# CONFIG_DETECT_SOFTLOCKUP is not set +CONFIG_DISCONTIGMEM=y +CONFIG_DISCONTIGMEM_MANUAL=y +# CONFIG_DISPLAY_SUPPORT is not set +# CONFIG_DL2K is not set +# CONFIG_DLM is not set +# CONFIG_ECRYPT_FS is not set +# CONFIG_EEPRO100 is not set +CONFIG_ENABLE_MUST_CHECK=y +# CONFIG_EPIC100 is not set +# CONFIG_ES3210 is not set +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +# CONFIG_FB is not set +# CONFIG_FEALNX is not set +# CONFIG_FLATMEM_MANUAL is not set +# CONFIG_FORCEDETH is not set +CONFIG_FS_MBCACHE=y +# CONFIG_FUSE_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_HAMACHI is not set +CONFIG_HID=y +# CONFIG_HOSTAP is not set +# CONFIG_HWMON is not set +CONFIG_HW_RANDOM=m +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MISC is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_TABLET is not set +CONFIG_ISO9660_FS=y +# CONFIG_IXGB is not set +CONFIG_JBD=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y +# CONFIG_KS0108 is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_LNE390 is not set +CONFIG_LOCKD=m +CONFIG_MAX_RAW_DEVS=256 +# CONFIG_MFD_SM501 is not set +# CONFIG_MYRI10GE is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_NE3210 is not set +CONFIG_NEED_MULTIPLE_NODES=y +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NETXEN_NIC is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_NEW_LEDS is not set +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_FS=m +# CONFIG_NI5010 is not set +CONFIG_NLS_ASCII=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NODES_SHIFT=3 +# CONFIG_NS83820 is not set +# CONFIG_NTFS_FS is not set +CONFIG_PA20=y +# CONFIG_PA7000 is not set +CONFIG_PA8X00=y +# CONFIG_PCMCIA_AXNET is not set +# CONFIG_PCMCIA_FMVJ18X is not set +# CONFIG_PCMCIA_NMCLAN is not set +# CONFIG_PCMCIA_PCNET is not set +# CONFIG_PCMCIA_WL3501 is not set +# CONFIG_PCMCIA_XIRTULIP is not set +# CONFIG_PPPOE is not set +# CONFIG_PPP_FILTER is not set +# CONFIG_PPP_MPPE is not set +# CONFIG_PPP_MULTILINK is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PREFETCH=y +# CONFIG_PRINTER is not set +# CONFIG_PRINTK_TIME is not set +# CONFIG_QLA3XXX is not set +# CONFIG_R8169 is not set +CONFIG_RAW_DRIVER=y +# CONFIG_REISERFS_FS is not set +CONFIG_RPCSEC_GSS_KRB5=m +# CONFIG_RTC_CLASS is not set +# CONFIG_S2IO is not set +# CONFIG_SC92031 is not set +# CONFIG_SERIAL_8250_ACCENT is not set +# CONFIG_SERIAL_8250_BOCA is not set +# CONFIG_SERIAL_8250_EXAR_ST16C554 is not set +# CONFIG_SERIAL_8250_FOURPORT is not set +# CONFIG_SERIAL_8250_HUB6 is not set +CONFIG_SERIAL_8250_NR_UARTS=17 +CONFIG_SERIAL_MUX=y +CONFIG_SERIAL_MUX_CONSOLE=y +# CONFIG_SERIO is not set +# CONFIG_SHAPER is not set +# CONFIG_SIS190 is not set +# CONFIG_SIS900 is not set +# CONFIG_SKGE is not set +# CONFIG_SKY2 is not set +CONFIG_SLAB=y +# CONFIG_SLIP is not set +# CONFIG_SLUB is not set +# CONFIG_SMP is not set +# CONFIG_SPI is not set +# CONFIG_SPI_MASTER is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_STI_CONSOLE is not set +# CONFIG_SUNDANCE is not set +CONFIG_SUNRPC=m +CONFIG_SUNRPC_GSS=m +# CONFIG_SYNCLINK_CS is not set +# CONFIG_TIMER_STATS is not set +CONFIG_TULIP=y +CONFIG_TULIP_MMIO=y +# CONFIG_UFS_DEBUG is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_ULI526X is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_VIA_VELOCITY is not set +# CONFIG_VT_HW_CONSOLE_BINDING is not set +# CONFIG_VXFS_FS is not set +# CONFIG_WLAN_PRE80211 is not set +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_QUOTA is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_ZISOFS is not set +CONFIG_ZLIB_INFLATE=m --- linux-2.6.24.orig/debian/config/amd64/config.server +++ linux-2.6.24/debian/config/amd64/config.server @@ -0,0 +1,21 @@ +# +# Config options for config.server automatically generated by splitconfig.pl +# +# CONFIG_DEFAULT_CFQ is not set +CONFIG_DEFAULT_DEADLINE=y +CONFIG_DEFAULT_IOSCHED="deadline" +# CONFIG_EDD_OFF is not set +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_HZ=100 +CONFIG_HZ_100=y +# CONFIG_HZ_250 is not set +CONFIG_IPV6_MULTIPLE_TABLES=y +# CONFIG_IPV6_SUBTREES is not set +CONFIG_NETLABEL=y +CONFIG_NR_CPUS=64 +# CONFIG_PREEMPT_BKL is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_SCHED_SMT=y +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-server" --- linux-2.6.24.orig/debian/config/amd64/config +++ linux-2.6.24/debian/config/amd64/config @@ -0,0 +1,2988 @@ +# +# Common config options automatically generated by splitconfig.pl +# +CONFIG_3C359=m +CONFIG_60XX_WDT=m +CONFIG_64BIT=y +CONFIG_6PACK=m +CONFIG_8139CP=m +CONFIG_8139TOO=m +CONFIG_8139TOO_8129=y +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_9P_FS=m +CONFIG_ABYSS=m +CONFIG_AC97_BUS=m +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_ACORN_PARTITION=y +# CONFIG_ACORN_PARTITION_ADFS is not set +# CONFIG_ACORN_PARTITION_CUMANA is not set +# CONFIG_ACORN_PARTITION_EESOX is not set +CONFIG_ACORN_PARTITION_ICS=y +# CONFIG_ACORN_PARTITION_POWERTEC is not set +CONFIG_ACORN_PARTITION_RISCIX=y +CONFIG_ACPI=y +CONFIG_ACPI_AC=m +CONFIG_ACPI_ASUS=m +CONFIG_ACPI_BATTERY=m +CONFIG_ACPI_BAY=m +CONFIG_ACPI_BLACKLIST_YEAR=0 +CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_CUSTOM_DSDT_INITRD=y +# CONFIG_ACPI_DEBUG is not set +CONFIG_ACPI_DOCK=m +CONFIG_ACPI_EC=y +CONFIG_ACPI_FAN=m +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_NUMA=y +CONFIG_ACPI_POWER=y +CONFIG_ACPI_PROCESSOR=m +CONFIG_ACPI_PROCFS=y +CONFIG_ACPI_PROCFS_POWER=y +CONFIG_ACPI_PROC_EVENT=y +CONFIG_ACPI_SBS=m +CONFIG_ACPI_SLEEP=y +CONFIG_ACPI_SYSFS_POWER=y +CONFIG_ACPI_SYSTEM=y +CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_TOSHIBA=m +CONFIG_ACPI_VIDEO=m +CONFIG_ACQUIRE_WDT=m +CONFIG_ACT200L_DONGLE=m +CONFIG_ACTISYS_DONGLE=m +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_ADM8211=m +CONFIG_ADVANTECH_WDT=m +CONFIG_AFFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_AFS_FS=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_AGP=y +CONFIG_AGP_AMD64=y +CONFIG_AGP_INTEL=m +CONFIG_AGP_SIS=m +CONFIG_AGP_VIA=m +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +CONFIG_AIC79XX_DEBUG_ENABLE=y +CONFIG_AIC79XX_DEBUG_MASK=0 +CONFIG_AIC79XX_REG_PRETTY_PRINT=y +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_DEBUG_ENABLE=y +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_AIRO=m +CONFIG_AIRO_CS=m +CONFIG_ALIM1535_WDT=m +CONFIG_ALIM7101_WDT=m +CONFIG_ALI_FIR=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_AMD8111_ETH=m +CONFIG_AMIGA_PARTITION=y +CONFIG_ANON_INODES=y +CONFIG_APPLICOM=m +CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y +CONFIG_ARCH_DISCONTIGMEM_ENABLE=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_HIBERNATION_HEADER=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUPPORTS_MSI=y +CONFIG_ARCH_SUPPORTS_OPROFILE=y +CONFIG_ARCNET=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_ARCNET_COM20020_PCI=m +CONFIG_ARCNET_COM90xx=m +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RAW=m +CONFIG_ARCNET_RIM_I=m +# CONFIG_ARPD is not set +CONFIG_ASK_IP_FIB_HASH=y +CONFIG_ASUS_LAPTOP=m +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_ATA=m +CONFIG_ATALK=m +CONFIG_ATARI_PARTITION=y +CONFIG_ATA_ACPI=y +CONFIG_ATA_GENERIC=m +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_OVER_ETH=m +CONFIG_ATA_PIIX=m +CONFIG_ATL1=m +CONFIG_ATM=y +CONFIG_ATMEL=m +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_BR2684=m +# CONFIG_ATM_BR2684_IPFILTER is not set +CONFIG_ATM_CLIP=y +# CONFIG_ATM_CLIP_NO_ICMP is not set +CONFIG_ATM_DRIVERS=y +# CONFIG_ATM_DUMMY is not set +CONFIG_ATM_ENI=m +# CONFIG_ATM_ENI_DEBUG is not set +# CONFIG_ATM_ENI_TUNE_BURST is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_FORE200E=m +CONFIG_ATM_FORE200E_DEBUG=0 +CONFIG_ATM_FORE200E_MAYBE=m +CONFIG_ATM_FORE200E_PCA=y +CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y +CONFIG_ATM_FORE200E_TX_RETRY=16 +# CONFIG_ATM_FORE200E_USE_TASKLET is not set +CONFIG_ATM_HE=m +CONFIG_ATM_HE_USE_SUNI=y +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_IDT77252=m +# CONFIG_ATM_IDT77252_DEBUG is not set +# CONFIG_ATM_IDT77252_RCV_ALL is not set +CONFIG_ATM_IDT77252_USE_SUNI=y +CONFIG_ATM_LANAI=m +CONFIG_ATM_LANE=m +CONFIG_ATM_MPOA=m +CONFIG_ATM_TCP=m +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_ATP=m +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_ARCH=y +CONFIG_AUDIT_TREE=y +CONFIG_AUTOFS4_FS=m +CONFIG_AUTOFS_FS=m +CONFIG_AUXDISPLAY=y +CONFIG_AX25=m +CONFIG_AX25_DAMA_SLAVE=y +CONFIG_B43=m +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PIO=y +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_B43_DEBUG=y +CONFIG_B43_DMA=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +CONFIG_B43_LEDS=y +CONFIG_B43_PCICORE_AUTOSELECT=y +CONFIG_B43_PCI_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_PIO=y +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43_RFKILL=y +CONFIG_B44=m +CONFIG_B44_PCI=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_BACKLIGHT_CARILLO_RANCH=m +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_PROGEAR=m +CONFIG_BASE_FULL=y +CONFIG_BASE_SMALL=0 +CONFIG_BATTERY_DS2760=m +CONFIG_BAYCOM_PAR=m +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +CONFIG_BCM43XX_PIO=y +# CONFIG_BCM43XX_PIO_MODE is not set +# CONFIG_BEFS_DEBUG is not set +CONFIG_BEFS_FS=m +CONFIG_BFS_FS=m +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m +CONFIG_BITREVERSE=y +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_DEV=y +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI15X3=m +# CONFIG_BLK_DEV_AMD74XX is not set +CONFIG_BLK_DEV_ATIIXP=m +# CONFIG_BLK_DEV_BSG is not set +CONFIG_BLK_DEV_CMD640=y +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +CONFIG_BLK_DEV_CMD64X=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_CRYPTOLOOP=m +# CONFIG_BLK_DEV_CS5520 is not set +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_CY82C693=m +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_DM=m +CONFIG_BLK_DEV_FD=m +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_HD_IDE is not set +CONFIG_BLK_DEV_HPT34X=m +CONFIG_BLK_DEV_HPT366=m +CONFIG_BLK_DEV_IDE=m +CONFIG_BLK_DEV_IDEACPI=y +CONFIG_BLK_DEV_IDECD=m +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDEDISK=m +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_BLK_DEV_IDEPNP=y +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDETAPE=m +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_DEV_IO_TRACE=y +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_JMICRON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_MD=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_NS87415=m +# CONFIG_BLK_DEV_OFFBOARD is not set +CONFIG_BLK_DEV_OPTI621=m +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +CONFIG_BLK_DEV_PDC202XX_OLD=m +# CONFIG_BLK_DEV_PIIX is not set +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_SC1200=m +CONFIG_BLK_DEV_SD=m +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +# CONFIG_BLK_DEV_SVWKS is not set +CONFIG_BLK_DEV_SX8=m +CONFIG_BLK_DEV_TC86C001=m +# CONFIG_BLK_DEV_TRIFLEX is not set +CONFIG_BLK_DEV_TRM290=m +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_UMEM=m +# CONFIG_BLK_DEV_VIA82CXXX is not set +CONFIG_BLOCK=y +CONFIG_BLOCK_COMPAT=y +CONFIG_BNX2=m +CONFIG_BONDING=m +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_BOUNCE=y +CONFIG_BPQETHER=m +CONFIG_BRIDGE=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_NETFILTER=y +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BROADCOM_PHY=m +CONFIG_BSD_DISKLABEL=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_BT=m +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_CMTP=m +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +CONFIG_BT_HCIVHCI=m +CONFIG_BT_HIDP=m +CONFIG_BT_L2CAP=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_SCO=m +CONFIG_BUG=y +CONFIG_CALGARY_IOMMU=y +CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y +CONFIG_CAPI_AVM=y +CONFIG_CAPI_EICON=y +CONFIG_CAPI_TRACE=y +CONFIG_CARDBUS=y +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_CASSINI=m +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CC_STACKPROTECTOR=y +# CONFIG_CC_STACKPROTECTOR_ALL is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_CFAG12864B=m +CONFIG_CFAG12864B_RATE=20 +CONFIG_CFG80211=m +CONFIG_CGROUPS=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_CGROUP_DEBUG is not set +CONFIG_CGROUP_NS=y +CONFIG_CHECK_SIGNATURE=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_CHR_DEV_OSST=m +CONFIG_CHR_DEV_SCH=m +CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_ST=m +CONFIG_CICADA_PHY=m +CONFIG_CIFS=m +# CONFIG_CIFS_DEBUG2 is not set +CONFIG_CIFS_EXPERIMENTAL=y +# CONFIG_CIFS_STATS is not set +CONFIG_CIFS_UPCALL=y +CONFIG_CIFS_WEAK_PW_HASH=y +# CONFIG_CIFS_XATTR is not set +CONFIG_CISS_SCSI_TAPE=y +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_CLS_U32_MARK=y +# CONFIG_CLS_U32_PERF is not set +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set +CONFIG_COMPAT=y +CONFIG_COMPAT_FOR_U64_ALIGNMENT=y +CONFIG_COMPUTONE=m +CONFIG_CONFIGFS_FS=m +CONFIG_CONNECTOR=m +CONFIG_CPU5_WDT=m +CONFIG_CPUSETS=y +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_DEBUG is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_FREQ_TABLE=m +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CRAMFS=y +CONFIG_CRASH_DUMP=y +CONFIG_CRC16=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_CRC_CCITT=m +CONFIG_CRC_ITU_T=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_AES_X86_64=m +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_TWOFISH_X86_64=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_XTS=m +CONFIG_CYCLADES=m +CONFIG_CYCLADES_SYNC=m +CONFIG_CYCLOMX_X25=y +# CONFIG_CYZ_INTR is not set +CONFIG_DAB=y +CONFIG_DAVICOM_PHY=m +CONFIG_DCA=m +CONFIG_DCDBAS=m +CONFIG_DE2104X=m +CONFIG_DE4X5=m +CONFIG_DE600=m +CONFIG_DE620=m +CONFIG_DEBUG_BUGVERBOSE=y +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_DEBUG_MUTEXES is not set +CONFIG_DEBUG_RODATA=y +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_VM is not set +CONFIG_DECNET=m +CONFIG_DECNET_NF_GRABULATOR=m +# CONFIG_DECNET_ROUTER is not set +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_BIC is not set +# CONFIG_DEFAULT_CUBIC is not set +# CONFIG_DEFAULT_HTCP is not set +CONFIG_DEFAULT_IO_DELAY_TYPE=1 +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 +CONFIG_DEFAULT_RENO=y +CONFIG_DEFAULT_TCP_CONG="reno" +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_DELL_RBU=m +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_DEVPORT=y +CONFIG_DEV_APPLETALK=m +# CONFIG_DEV_KMEM is not set +CONFIG_DE_AOC=y +CONFIG_DIGIEPCA=m +CONFIG_DISCONTIGMEM=y +CONFIG_DISCONTIGMEM_MANUAL=y +CONFIG_DISPLAY_SUPPORT=m +CONFIG_DL2K=m +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +CONFIG_DM9102=m +CONFIG_DMADEVICES=y +# CONFIG_DMAR is not set +CONFIG_DMA_ENGINE=y +CONFIG_DMI=y +CONFIG_DMIID=y +CONFIG_DM_CRYPT=m +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_DELAY is not set +CONFIG_DM_MIRROR=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_MULTIPATH_HP=m +CONFIG_DM_MULTIPATH_RDAC=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_UEVENT=y +CONFIG_DM_ZERO=m +CONFIG_DNOTIFY=y +CONFIG_DONGLE=y +CONFIG_DRM=m +CONFIG_DRM_I810=m +CONFIG_DRM_I830=m +CONFIG_DRM_I915=m +CONFIG_DRM_MGA=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_SAVAGE=m +CONFIG_DRM_SIS=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_VIA=m +CONFIG_DRM_VIA_CHROME9=m +CONFIG_DS1682=m +CONFIG_DSCC4=m +CONFIG_DSCC4_PCISYNC=y +CONFIG_DSCC4_PCI_RST=y +CONFIG_DUMMY=m +CONFIG_DUMMY_CONSOLE=y +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_BT8XX=m +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_PATCH=m +CONFIG_DVB_CAPTURE_DRIVERS=y +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +# CONFIG_DVB_FE_CUSTOMISE is not set +CONFIG_DVB_ISL6421=m +CONFIG_DVB_L64781=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LNBP21=m +CONFIG_DVB_MT312=m +CONFIG_DVB_MT352=m +CONFIG_DVB_NXT200X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_PLL=m +CONFIG_DVB_PLUTO2=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_STV0297=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_USB=m +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_CXUSB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_VES1820=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_ZL10353=m +CONFIG_E100=m +CONFIG_E1000=m +CONFIG_E1000E=m +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000_NAPI=y +CONFIG_EARLY_PRINTK=y +CONFIG_ECONET=m +CONFIG_ECONET_AUNUDP=y +CONFIG_ECONET_NATIVE=y +CONFIG_ECRYPT_FS=m +CONFIG_EDAC=y +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_E752X=m +CONFIG_EDAC_I5000=m +CONFIG_EDAC_I82975X=m +CONFIG_EDAC_MM_EDAC=m +CONFIG_EDD=y +CONFIG_EEPRO100=m +CONFIG_EEPROM_93CX6=m +CONFIG_EFI_PARTITION=y +CONFIG_EFS_FS=m +CONFIG_ELF_CORE=y +CONFIG_EMBEDDED=y +# CONFIG_ENABLE_MUST_CHECK is not set +# CONFIG_ENABLE_WARN_DEPRECATED is not set +CONFIG_EPIC100=m +CONFIG_EPOLL=y +CONFIG_EQUALIZER=m +CONFIG_ESI_DONGLE=m +CONFIG_EUROTECH_WDT=m +CONFIG_EVENTFD=y +CONFIG_EXPERIMENTAL=y +CONFIG_EXPORTFS=m +CONFIG_EXT2_FS=m +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_FAIR_CGROUP_SCHED=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_FAIR_USER_SCHED is not set +CONFIG_FARSYNC=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_FAT_FS=m +# CONFIG_FAULT_INJECTION is not set +CONFIG_FB=y +CONFIG_FB_3DFX=m +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_ARC=m +CONFIG_FB_ARK=m +CONFIG_FB_ASILIANT=y +CONFIG_FB_ATY=m +CONFIG_FB_ATY128=m +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_CARILLO_RANCH=m +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +CONFIG_FB_CIRRUS=m +CONFIG_FB_CYBER2000=m +CONFIG_FB_DDC=m +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_EFI=y +CONFIG_FB_GEODE=y +CONFIG_FB_GEODE_GX=m +CONFIG_FB_GEODE_GX1=m +# CONFIG_FB_GEODE_GX_SET_FBSIZE is not set +CONFIG_FB_GEODE_LX=m +CONFIG_FB_HECUBA=m +CONFIG_FB_HGA=m +# CONFIG_FB_HGA_ACCEL is not set +CONFIG_FB_IMSTT=y +CONFIG_FB_INTEL=m +# CONFIG_FB_INTEL_DEBUG is not set +CONFIG_FB_INTEL_I2C=y +CONFIG_FB_KYRO=m +CONFIG_FB_LE80578=m +# CONFIG_FB_MACMODES is not set +CONFIG_FB_MATROX=m +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_BACKLIGHT=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_I2C=y +CONFIG_FB_PM2=m +CONFIG_FB_PM2_FIFO_DISCONNECT=y +CONFIG_FB_PM3=m +CONFIG_FB_RADEON=m +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_BACKLIGHT=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_I2C=y +CONFIG_FB_S1D13XXX=m +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_SM501=m +CONFIG_FB_SVGALIB=m +CONFIG_FB_SYS_COPYAREA=m +CONFIG_FB_SYS_FILLRECT=m +CONFIG_FB_SYS_FOPS=m +CONFIG_FB_SYS_IMAGEBLIT=m +CONFIG_FB_TILEBLITTING=y +CONFIG_FB_TRIDENT=m +# CONFIG_FB_TRIDENT_ACCEL is not set +CONFIG_FB_UVESA=m +CONFIG_FB_VESA=m +CONFIG_FB_VGA16=m +# CONFIG_FB_VIRTUAL is not set +CONFIG_FB_VOODOO1=m +CONFIG_FB_VT8623=m +CONFIG_FDDI=y +CONFIG_FEALNX=m +CONFIG_FIB_RULES=y +# CONFIG_FIREWIRE is not set +CONFIG_FIRMWARE_EDID=y +CONFIG_FIXED_MII_1000_FDX=y +# CONFIG_FIXED_MII_100_FDX is not set +# CONFIG_FIXED_MII_10_FDX is not set +CONFIG_FIXED_MII_AMNT=1 +CONFIG_FIXED_PHY=m +CONFIG_FIX_EARLYCON_MEM=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x16=y +CONFIG_FONT_8x8=y +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +# CONFIG_FORCED_INLINING is not set +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FRAME_POINTER is not set +CONFIG_FS_MBCACHE=m +CONFIG_FS_POSIX_ACL=y +CONFIG_FTL=m +CONFIG_FUJITSU_LAPTOP=m +CONFIG_FUSE_FS=m +CONFIG_FUSION=y +CONFIG_FUSION_CTL=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_SAS=m +CONFIG_FUSION_SPI=m +CONFIG_FUTEX=y +CONFIG_FW_LOADER=y +CONFIG_GACT_PROB=y +CONFIG_GAMEPORT=m +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GART_IOMMU=y +CONFIG_GENERIC_ACL=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_CPU=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_GIGASET_BASE=m +# CONFIG_GIGASET_DEBUG is not set +CONFIG_GIGASET_M101=m +CONFIG_GIGASET_M105=m +# CONFIG_GIGASET_UNDOCREQ is not set +CONFIG_GIRBIL_DONGLE=m +CONFIG_HAMACHI=m +CONFIG_HAMRADIO=y +CONFIG_HANGCHECK_TIMER=m +CONFIG_HAPPYMEAL=m +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y +CONFIG_HAVE_KVM=y +CONFIG_HDLC=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +CONFIG_HDLC_X25=m +# CONFIG_HEADERS_CHECK is not set +CONFIG_HERMES=m +CONFIG_HFSPLUS_FS=m +CONFIG_HFS_FS=m +CONFIG_HIBERNATION=y +CONFIG_HIBERNATION_SMP_POSSIBLE=y +CONFIG_HID=m +CONFIG_HIDRAW=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HID_FF is not set +CONFIG_HID_SUPPORT=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_HIPPI=y +CONFIG_HISAX_16_3=y +CONFIG_HISAX_1TR6=y +CONFIG_HISAX_AVM_A1_CS=m +CONFIG_HISAX_AVM_A1_PCMCIA=y +CONFIG_HISAX_BKM_A4T=y +# CONFIG_HISAX_DEBUG is not set +CONFIG_HISAX_DIEHLDIVA=y +CONFIG_HISAX_ELSA=y +CONFIG_HISAX_ELSA_CS=m +CONFIG_HISAX_ENTERNOW_PCI=y +CONFIG_HISAX_EURO=y +CONFIG_HISAX_FRITZPCI=y +CONFIG_HISAX_FRITZ_PCIPNP=m +CONFIG_HISAX_GAZEL=y +CONFIG_HISAX_HDLC=y +CONFIG_HISAX_HFC4S8S=m +CONFIG_HISAX_HFCUSB=m +CONFIG_HISAX_HFC_PCI=y +CONFIG_HISAX_HFC_SX=y +CONFIG_HISAX_MAX_CARDS=8 +CONFIG_HISAX_NETJET=y +CONFIG_HISAX_NETJET_U=y +CONFIG_HISAX_NI1=y +CONFIG_HISAX_NICCY=y +# CONFIG_HISAX_NO_KEYPAD is not set +# CONFIG_HISAX_NO_LLC is not set +# CONFIG_HISAX_NO_SENDCOMPLETE is not set +CONFIG_HISAX_S0BOX=y +CONFIG_HISAX_SCT_QUADRO=y +CONFIG_HISAX_SEDLBAUER=y +CONFIG_HISAX_SEDLBAUER_CS=m +CONFIG_HISAX_ST5481=m +CONFIG_HISAX_TELESPCI=y +CONFIG_HISAX_TELES_CS=m +CONFIG_HISAX_W6692=y +CONFIG_HOSTAP=m +CONFIG_HOSTAP_CS=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_PLX=m +CONFIG_HOTPLUG=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HOTPLUG_PCI=m +CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m +CONFIG_HOTPLUG_PCI_CPCI=y +CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m +CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m +CONFIG_HOTPLUG_PCI_FAKE=m +CONFIG_HOTPLUG_PCI_PCIE=m +CONFIG_HOTPLUG_PCI_SHPC=m +CONFIG_HP100=m +CONFIG_HPET=y +CONFIG_HPET_EMULATE_RTC=y +CONFIG_HPET_MMAP=y +# CONFIG_HPET_RTC_IRQ is not set +CONFIG_HPET_TIMER=y +CONFIG_HPFS_FS=m +# CONFIG_HPT34X_AUTODMA is not set +CONFIG_HT_IRQ=y +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_HWMON_VID=m +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_AMD=m +CONFIG_HW_RANDOM_INTEL=m +# CONFIG_HZ_1000 is not set +# CONFIG_HZ_300 is not set +CONFIG_I2C=m +CONFIG_I2C_ALGOBIT=m +CONFIG_I2C_ALGOPCA=m +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set +# CONFIG_I2C_DEBUG_CORE is not set +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PIIX4=m +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TAOS_EVM=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m +CONFIG_I2O=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_BUS=m +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_PROC=m +CONFIG_I2O_SCSI=m +CONFIG_I6300ESB_WDT=m +CONFIG_I82092=m +# CONFIG_IA32_AOUT is not set +CONFIG_IA32_EMULATION=y +CONFIG_IB700_WDT=m +CONFIG_IBMASR=m +CONFIG_IBMOL=m +CONFIG_IBM_ASM=m +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +CONFIG_ICPLUS_PHY=m +CONFIG_IDE=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEPCI_PCIBUS_ORDER is not set +CONFIG_IDEPCI_SHARE_IRQ=y +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_IDE_ARM is not set +CONFIG_IDE_GENERIC=m +CONFIG_IDE_MAX_HWIFS=4 +CONFIG_IDE_PROC_FS=y +# CONFIG_IDE_TASK_IOCTL is not set +CONFIG_IEEE1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_OHCI1394=m +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +# CONFIG_IEEE1394_VERBOSEDEBUG is not set +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE80211=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_CRYPT_WEP=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_IFB=m +# CONFIG_IKCONFIG is not set +CONFIG_INET=y +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET_AH=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_INET_DIAG=y +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_LRO=m +CONFIG_INET_TCP_DIAG=y +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_INFINIBAND_IPATH=m +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_ISER=m +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFTL=m +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_INPUT=y +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_ATLAS_BTNS=m +CONFIG_INPUT_EVBUG=m +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_MISC=y +CONFIG_INPUT_MOUSE=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_PCSPKR=m +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_TABLET=y +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_INPUT_UINPUT=m +CONFIG_INPUT_YEALINK=m +CONFIG_INSTRUMENTATION=y +CONFIG_INTEL_IOATDMA=m +# CONFIG_IOMMU_DEBUG is not set +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_CFQ=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_NOOP=y +# CONFIG_IO_DELAY_0X80 is not set +CONFIG_IO_DELAY_0XED=y +# CONFIG_IO_DELAY_NONE is not set +CONFIG_IO_DELAY_TYPE_0X80=0 +CONFIG_IO_DELAY_TYPE_0XED=1 +CONFIG_IO_DELAY_TYPE_NONE=3 +CONFIG_IO_DELAY_TYPE_UDELAY=2 +# CONFIG_IO_DELAY_UDELAY is not set +CONFIG_IP1000=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_RAW=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IPDDP=m +CONFIG_IPDDP_DECAP=y +CONFIG_IPDDP_ENCAP=y +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_HANDLER=m +# CONFIG_IPMI_PANIC_EVENT is not set +CONFIG_IPMI_POWEROFF=m +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m +CONFIG_IPPP_FILTER=y +CONFIG_IPV6=m +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +CONFIG_IPW2100=m +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +CONFIG_IPW2200=m +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IPX=m +# CONFIG_IPX_INTERN is not set +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_DCCP=m +CONFIG_IP_DCCP_ACKVEC=y +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_IP_DCCP_TFRC_LIB=m +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_MROUTE=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARP_MANGLE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +# CONFIG_IP_PNP is not set +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +CONFIG_IP_SCTP=m +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_FTP=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_NQ=m +CONFIG_IP_VS_PROTO_AH=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_TAB_BITS=12 +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_WRR=m +CONFIG_IRCOMM=m +CONFIG_IRDA=m +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_DEBUG=y +CONFIG_IRDA_FAST_RR=y +CONFIG_IRDA_ULTRA=y +CONFIG_IRLAN=m +CONFIG_IRNET=m +CONFIG_IRTTY_SIR=m +CONFIG_ISA_DMA_API=y +CONFIG_ISCSI_TCP=m +CONFIG_ISDN=m +CONFIG_ISDN_AUDIO=y +CONFIG_ISDN_CAPI=m +CONFIG_ISDN_CAPI_CAPI20=m +CONFIG_ISDN_CAPI_CAPIDRV=m +CONFIG_ISDN_CAPI_CAPIFS=m +CONFIG_ISDN_CAPI_CAPIFS_BOOL=y +CONFIG_ISDN_CAPI_MIDDLEWARE=y +CONFIG_ISDN_DIVAS=m +CONFIG_ISDN_DIVAS_BRIPCI=y +CONFIG_ISDN_DIVAS_DIVACAPI=m +CONFIG_ISDN_DIVAS_MAINT=m +CONFIG_ISDN_DIVAS_PRIPCI=y +CONFIG_ISDN_DIVAS_USERIDI=m +CONFIG_ISDN_DIVERSION=m +CONFIG_ISDN_DRV_AVMB1_AVM_CS=m +CONFIG_ISDN_DRV_AVMB1_B1PCI=m +CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m +CONFIG_ISDN_DRV_AVMB1_C4=m +CONFIG_ISDN_DRV_AVMB1_T1PCI=m +CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y +CONFIG_ISDN_DRV_GIGASET=m +CONFIG_ISDN_DRV_HISAX=m +CONFIG_ISDN_I4L=m +CONFIG_ISDN_MPP=y +CONFIG_ISDN_PPP=y +CONFIG_ISDN_PPP_BSDCOMP=m +CONFIG_ISDN_PPP_VJ=y +CONFIG_ISDN_TTY_FAX=y +CONFIG_ISDN_X25=y +# CONFIG_ISI is not set +CONFIG_ISO9660_FS=m +CONFIG_IT8712F_WDT=m +CONFIG_ITCO_VENDOR_SUPPORT=y +CONFIG_ITCO_WDT=m +# CONFIG_IWLWIFI is not set +CONFIG_IXGB=m +CONFIG_IXGBE=m +# CONFIG_IXGB_NAPI is not set +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_SUMMARY is not set +CONFIG_JFFS2_ZLIB=y +# CONFIG_JFS_DEBUG is not set +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +CONFIG_JFS_STATISTICS=y +CONFIG_JOLIET=y +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_IFORCE=m +CONFIG_JOYSTICK_IFORCE_232=y +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_K8_NB=y +CONFIG_K8_NUMA=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_KARMA_PARTITION=y +CONFIG_KEXEC=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +CONFIG_KINGSUN_DONGLE=m +CONFIG_KMOD=y +CONFIG_KPROBES=y +CONFIG_KS0108=m +CONFIG_KS0108_DELAY=2 +CONFIG_KS0108_PORT=0x378 +CONFIG_KS959_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +# CONFIG_KTIME_SCALAR is not set +CONFIG_KVM=m +CONFIG_KVM_AMD=m +CONFIG_KVM_INTEL=m +CONFIG_LANMEDIA=m +CONFIG_LAPB=m +CONFIG_LAPBETHER=m +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +# CONFIG_LDM_DEBUG is not set +CONFIG_LDM_PARTITION=y +CONFIG_LEDS_CLASS=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBCRC32C=m +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_CS=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_LIBERTAS_SDIO=m +CONFIG_LIBERTAS_USB=m +CONFIG_LITELINK_DONGLE=m +# CONFIG_LKDTM is not set +CONFIG_LLC=y +CONFIG_LLC2=m +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_LOCKD=m +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_LOCKD_V4=y +CONFIG_LOCK_KERNEL=y +# CONFIG_LOCK_STAT is not set +# CONFIG_LOGO is not set +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_LP_CONSOLE is not set +CONFIG_LSM_MMAP_MIN_ADDR=0 +CONFIG_LXT_PHY=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +# CONFIG_M386 is not set +# CONFIG_M486 is not set +# CONFIG_M586 is not set +# CONFIG_M586MMX is not set +# CONFIG_M586TSC is not set +# CONFIG_M686 is not set +CONFIG_MA600_DONGLE=m +CONFIG_MAC80211=m +# CONFIG_MAC80211_DEBUG is not set +CONFIG_MAC80211_DEBUGFS=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MACHZ_WDT=m +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MACVLAN=m +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_MAC_PARTITION=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_MARKERS is not set +CONFIG_MARVELL_PHY=m +CONFIG_MAX_RAW_DEVS=256 +# CONFIG_MCORE2 is not set +CONFIG_MCP2120_DONGLE=m +# CONFIG_MCRUSOE is not set +CONFIG_MCS_FIR=m +# CONFIG_MCYRIXIII is not set +CONFIG_MD=y +CONFIG_MDIO_BITBANG=m +CONFIG_MD_FAULTY=m +CONFIG_MD_LINEAR=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +# CONFIG_MEFFICEON is not set +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_SAS=m +CONFIG_MFD_SM501=m +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +CONFIG_MICROCODE=m +CONFIG_MICROCODE_OLD_INTERFACE=y +CONFIG_MIGRATION=y +CONFIG_MII=m +CONFIG_MINIX_FS=m +CONFIG_MINIX_SUBPARTITION=y +CONFIG_MISC_DEVICES=y +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +CONFIG_MKISS=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_MLX4_INFINIBAND=m +CONFIG_MMC=m +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_SDHCI=m +CONFIG_MMC_SPI=m +CONFIG_MMC_TIFM_SD=m +# CONFIG_MMC_UNSAFE_RESUME is not set +CONFIG_MMC_WBSD=m +CONFIG_MMU=y +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MOUSE_APPLETOUCH=m +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_PS2_TRACKPOINT=y +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_VSXXXAA=m +CONFIG_MOXA_INTELLIO=m +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +# CONFIG_MPENTIUM4 is not set +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MPSC is not set +CONFIG_MSDOS_FS=m +CONFIG_MSDOS_PARTITION=y +CONFIG_MSI_LAPTOP=m +# CONFIG_MSS is not set +CONFIG_MTD=m +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTD_ABSENT=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_AMD76XROM=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK2MTD=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_MTD_CFI=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_CHAR=m +CONFIG_MTD_CK804XROM=m +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_CONCAT=m +CONFIG_MTD_DATAFLASH=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_DILNETPC=m +CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000 +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCECC=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCPROBE_ADDRESS=0 +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_ESB2ROM=m +CONFIG_MTD_GEN_PROBE=m +CONFIG_MTD_ICHXROM=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_L440GX=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_MAP_BANK_WIDTH_1=y +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +CONFIG_MTD_MAP_BANK_WIDTH_2=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTD_NAND=m +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND_IDS=m +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +CONFIG_MTD_NETSC520=m +CONFIG_MTD_NETtel=m +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_2X_PROGRAM=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_SIM=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_OOPS=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_PCI=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PLATRAM=m +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_PNC2000=m +CONFIG_MTD_RAM=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +CONFIG_MTD_REDBOOT_PARTS=m +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +CONFIG_MTD_ROM=m +CONFIG_MTD_SBC_GXX=m +CONFIG_MTD_SC520CDP=m +CONFIG_MTD_SCB2_FLASH=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_TS5500=m +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_MTD_UBI_GLUEBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTRR=y +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set +CONFIG_MWAVE=m +# CONFIG_MWINCHIP2 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MWINCHIPC6 is not set +CONFIG_MYRI10GE=m +CONFIG_NATSEMI=m +CONFIG_NCPFS_EXTRAS=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_OS2_NS=y +CONFIG_NCPFS_PACKET_SIGNING=y +# CONFIG_NCPFS_SMALLDOS is not set +CONFIG_NCPFS_STRONG=y +CONFIG_NCP_FS=m +CONFIG_NE2K_PCI=m +CONFIG_NEED_MULTIPLE_NODES=y +CONFIG_NET=y +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETDEVICES=y +CONFIG_NETDEVICES_MULTIQUEUE=y +CONFIG_NETDEV_1000=y +CONFIG_NETDEV_10000=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NETROM=m +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NETWORK_SECMARK=y +CONFIG_NETXEN_NIC=m +CONFIG_NET_9P=m +# CONFIG_NET_9P_DEBUG is not set +CONFIG_NET_9P_FD=m +CONFIG_NET_9P_VIRTIO=m +CONFIG_NET_ACT_GACT=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SIMP=m +CONFIG_NET_CLS=y +CONFIG_NET_CLS_ACT=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_FW=m +# CONFIG_NET_CLS_IND is not set +# CONFIG_NET_CLS_POLICE is not set +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_U32=m +CONFIG_NET_DCCPPROBE=m +CONFIG_NET_DMA=y +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_ETHERNET=y +CONFIG_NET_FC=y +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_NET_IPIP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_NET_PCI=y +CONFIG_NET_PCMCIA=y +CONFIG_NET_PKTGEN=m +CONFIG_NET_POCKET=y +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_NET_SB1000=m +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_ATM=m +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_FIFO=y +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_TCPPROBE=m +CONFIG_NET_TULIP=y +CONFIG_NET_VENDOR_3COM=y +CONFIG_NEW_LEDS=y +CONFIG_NFSD=m +CONFIG_NFSD_TCP=y +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CT_NETLINK=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NIU=m +CONFIG_NL80211=y +CONFIG_NLS=y +CONFIG_NLS_ASCII=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m +CONFIG_NODES_SHIFT=6 +CONFIG_NONPROMISC_DEVMEM=y +# CONFIG_NORTEL_HERMES is not set +CONFIG_NO_HZ=y +CONFIG_NS83820=m +CONFIG_NSC_FIR=m +CONFIG_NSC_GPIO=m +# CONFIG_NTFS_DEBUG is not set +CONFIG_NTFS_FS=m +# CONFIG_NTFS_RW is not set +CONFIG_NUMA=y +# CONFIG_NUMA_EMU is not set +CONFIG_NVRAM=m +CONFIG_N_HDLC=m +# CONFIG_OCFS2_DEBUG_FS is not set +CONFIG_OCFS2_DEBUG_MASKLOG=y +CONFIG_OCFS2_FS=m +CONFIG_OLD_BELKIN_DONGLE=m +CONFIG_OPROFILE=m +CONFIG_OSF_PARTITION=y +CONFIG_OUT_OF_LINE_PFN_TO_PAGE=y +CONFIG_P54_COMMON=m +CONFIG_P54_PCI=m +CONFIG_P54_USB=m +CONFIG_PACKET=m +CONFIG_PACKET_MMAP=y +CONFIG_PARIDE=m +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PG=m +CONFIG_PARIDE_PT=m +CONFIG_PARPORT=m +CONFIG_PARPORT_1284=y +CONFIG_PARPORT_AX88796=m +# CONFIG_PARPORT_GSC is not set +CONFIG_PARPORT_NOT_PC=y +CONFIG_PARPORT_PC=m +CONFIG_PARPORT_PC_FIFO=y +CONFIG_PARPORT_PC_PCMCIA=m +# CONFIG_PARPORT_PC_SUPERIO is not set +CONFIG_PARPORT_SERIAL=m +CONFIG_PARTITION_ADVANCED=y +CONFIG_PATA_ACPI=m +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +CONFIG_PATA_ARTOP=m +CONFIG_PATA_ATIIXP=m +# CONFIG_PATA_CMD640_PCI is not set +CONFIG_PATA_CMD64X=m +CONFIG_PATA_CS5520=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_EFAR=m +CONFIG_PATA_HPT366=m +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +CONFIG_PATA_HPT3X3=m +# CONFIG_PATA_HPT3X3_DMA is not set +CONFIG_PATA_IT8213=m +CONFIG_PATA_IT821X=m +CONFIG_PATA_JMICRON=m +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_NETCELL=m +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +CONFIG_PATA_OLDPIIX=m +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +CONFIG_PATA_PCMCIA=m +CONFIG_PATA_PDC2027X=m +# CONFIG_PATA_PDC_OLD is not set +CONFIG_PATA_PLATFORM=m +# CONFIG_PATA_RADISYS is not set +CONFIG_PATA_RZ1000=m +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_VIA=m +CONFIG_PATA_WINBOND=m +CONFIG_PC300=m +# CONFIG_PC300TOO is not set +CONFIG_PC300_MLPPP=y +CONFIG_PC8736x_GPIO=m +CONFIG_PC87413_WDT=m +CONFIG_PCCARD=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_PCI=y +CONFIG_PCI200SYN=m +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIPCWATCHDOG=m +CONFIG_PCI_ATMEL=m +# CONFIG_PCI_DEBUG is not set +CONFIG_PCI_DIRECT=y +CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_HERMES is not set +CONFIG_PCI_LEGACY=y +CONFIG_PCI_MMCONFIG=y +CONFIG_PCI_MSI=y +CONFIG_PCMCIA=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_PCMCIA_AXNET=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_IOCTL=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_NETWAVE=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_RAYCS=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_PD6729=m +CONFIG_PDA_POWER=m +CONFIG_PDC202XX_BURST=y +CONFIG_PDC_ADMA=m +CONFIG_PHANTOM=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m +CONFIG_PHYLIB=m +CONFIG_PHYSICAL_ALIGN=0x200000 +CONFIG_PHYSICAL_START=0x200000 +# CONFIG_PID_NS is not set +CONFIG_PLIP=m +CONFIG_PLIST=y +# CONFIG_PLX_HERMES is not set +CONFIG_PM=y +CONFIG_PM_DEBUG=y +CONFIG_PM_DISABLE_CONSOLE=y +CONFIG_PM_LEGACY=y +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PM_STD_PARTITION="" +CONFIG_PM_TRACE=y +# CONFIG_PM_VERBOSE is not set +CONFIG_PNP=y +CONFIG_PNPACPI=y +# CONFIG_PNP_DEBUG is not set +CONFIG_POSIX_MQUEUE=y +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_PPDEV=m +CONFIG_PPP=m +CONFIG_PPPOATM=m +CONFIG_PPPOE=m +CONFIG_PPPOL2TP=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_SYNC_TTY=m +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_NOTIFIERS=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_PRINTER=m +CONFIG_PRINTK=y +CONFIG_PRINTK_TIME=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_PRISM54=m +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_PID_CPUSET=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_VMCORE=y +CONFIG_PROFILING=y +# CONFIG_PROVE_LOCKING is not set +CONFIG_QFMT_V1=m +CONFIG_QFMT_V2=m +CONFIG_QLA3XXX=m +CONFIG_QNX4FS_FS=m +CONFIG_QSEMI_PHY=m +# CONFIG_QUICKLIST is not set +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +CONFIG_R3964=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAESTRO=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RAID_ATTRS=m +CONFIG_RAW_DRIVER=m +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +# CONFIG_REISERFS_CHECK is not set +CONFIG_REISERFS_FS=m +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_REISERFS_FS_XATTR=y +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_RELAY=y +CONFIG_RELOCATABLE=y +CONFIG_RESOURCES_64BIT=y +CONFIG_RFD_FTL=m +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +CONFIG_RIO=m +# CONFIG_RIO_OLDPCI is not set +CONFIG_ROADRUNNER=m +# CONFIG_ROADRUNNER_LARGE_RINGS is not set +CONFIG_ROCKETPORT=m +CONFIG_ROMFS_FS=m +CONFIG_ROSE=m +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT2X00=m +# CONFIG_RT2X00_DEBUG is not set +CONFIG_RT2X00_LIB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT73USB=m +CONFIG_RTC=y +CONFIG_RTC_CLASS=y +# CONFIG_RTC_DEBUG is not set +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_TEST=m +CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=y +CONFIG_RTL8187=m +CONFIG_RT_MUTEXES=y +# CONFIG_RT_MUTEX_TESTER is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_RXKAD=m +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +# CONFIG_SAMPLES is not set +CONFIG_SATA_AHCI=m +CONFIG_SATA_INIC162X=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_SVW=m +CONFIG_SATA_SX4=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SBC8360_WDT=m +CONFIG_SBC_EPX_C3_WATCHDOG=m +CONFIG_SBNI=m +# CONFIG_SBNI_MULTILINE is not set +CONFIG_SC1200_WDT=m +CONFIG_SC520_WDT=m +CONFIG_SC92031=m +# CONFIG_SCHEDSTATS is not set +CONFIG_SCHED_DEBUG=y +CONFIG_SCHED_MC=y +CONFIG_SCSI=m +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_AIC79XX=m +CONFIG_SCSI_AIC7XXX=m +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_AIC94XX=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_SCSI_BUSLOGIC=m +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_DC395x=m +CONFIG_SCSI_DEBUG=m +CONFIG_SCSI_DMA=y +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_EATA=m +CONFIG_SCSI_EATA_LINKED_COMMANDS=y +CONFIG_SCSI_EATA_MAX_TAGS=16 +CONFIG_SCSI_EATA_TAGGED_QUEUE=y +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_FC_TGT_ATTRS=y +CONFIG_SCSI_FUTURE_DOMAIN=m +CONFIG_SCSI_GDTH=m +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_IMM=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_DUMP is not set +# CONFIG_SCSI_IPR_TRACE is not set +CONFIG_SCSI_IPS=m +CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_LOWLEVEL=y +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_NETLINK=y +# CONFIG_SCSI_OMIT_FLASHPOINT is not set +CONFIG_SCSI_PPA=m +CONFIG_SCSI_PROC_FS=y +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_QLOGIC_1280=m +CONFIG_SCSI_SAS_ATA=y +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_TGT=m +CONFIG_SCSI_WAIT_SCAN=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +CONFIG_SCTP_HMAC_MD5=y +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SDIO_UART=m +CONFIG_SECCOMP=y +CONFIG_SECURITY=y +CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 +# CONFIG_SECURITY_APPARMOR_DISABLE is not set +CONFIG_SECURITY_CAPABILITIES=y +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_SECURITY_NETWORK=y +# CONFIG_SECURITY_NETWORK_XFRM is not set +CONFIG_SECURITY_SELINUX=y +CONFIG_SECURITY_SELINUX_AVC_STATS=y +CONFIG_SECURITY_SELINUX_BOOTPARAM=y +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 +CONFIG_SECURITY_SELINUX_DEVELOP=y +CONFIG_SECURITY_SELINUX_DISABLE=y +# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set +# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_SEMAPHORE_SLEEPERS=y +CONFIG_SENSORS_ABITUGURU=m +CONFIG_SENSORS_ABITUGURU3=m +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_APPLESMC=m +CONFIG_SENSORS_ASB100=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_CORETEMP=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_FSCHER=m +CONFIG_SENSORS_FSCHMD=m +CONFIG_SENSORS_FSCPOS=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_HDAPS=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_K8TEMP=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_TSL2550=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_CS=m +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_NR_UARTS=48 +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_PNP=y +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_JSM=m +CONFIG_SERIAL_NONSTANDARD=y +CONFIG_SERIO=y +CONFIG_SERIO_CT82C710=m +CONFIG_SERIO_I8042=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SERIO_RAW=m +CONFIG_SERIO_SERPORT=m +CONFIG_SGI_IOC4=m +CONFIG_SGI_PARTITION=y +CONFIG_SHAPER=m +CONFIG_SHMEM=y +CONFIG_SIGMATEL_FIR=m +CONFIG_SIGNALFD=y +CONFIG_SIS190=m +CONFIG_SIS900=m +# CONFIG_SK98LIN is not set +CONFIG_SKFP=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SLAB is not set +CONFIG_SLABINFO=y +CONFIG_SLHC=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +CONFIG_SLIP_MODE_SLIP6=y +CONFIG_SLIP_SMART=y +# CONFIG_SLOB is not set +CONFIG_SLUB=y +CONFIG_SLUB_DEBUG=y +# CONFIG_SLUB_DEBUG_ON is not set +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +CONFIG_SMC_IRCC_FIR=m +CONFIG_SMP=y +CONFIG_SMSC37B787_WDT=m +CONFIG_SMSC_PHY=m +# CONFIG_SND is not set +CONFIG_SOFT_WATCHDOG=m +CONFIG_SOLARIS_X86_PARTITION=y +CONFIG_SONYPI_COMPAT=y +CONFIG_SONY_LAPTOP=m +CONFIG_SOUND=m +# CONFIG_SOUND_PRIME is not set +# CONFIG_SPARSEMEM_MANUAL is not set +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPECIALIX=m +# CONFIG_SPECIALIX_RTSCTS is not set +CONFIG_SPI=y +CONFIG_SPI_AT25=m +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_LM70_LLP=m +CONFIG_SPI_MASTER=y +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_SSB=m +CONFIG_SSB_DEBUG=y +CONFIG_SSB_DRIVER_PCICORE=y +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCIHOST_POSSIBLE=y +# CONFIG_SSB_PCMCIAHOST is not set +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +CONFIG_SSB_POSSIBLE=y +# CONFIG_SSB_SILENT is not set +CONFIG_SSFDC=m +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_STALDRV=y +CONFIG_STANDALONE=y +CONFIG_STOP_MACHINE=y +CONFIG_STRIP=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_SUNGEM=m +CONFIG_SUNRPC=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_XPRT_RDMA=m +CONFIG_SUN_PARTITION=y +CONFIG_SUSPEND=y +CONFIG_SUSPEND_SMP_POSSIBLE=y +CONFIG_SWAP=y +CONFIG_SWIOTLB=y +CONFIG_SX=m +CONFIG_SYNCLINK=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_CS=m +CONFIG_SYNCLINK_GT=m +CONFIG_SYN_COOKIES=y +CONFIG_SYSCTL=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_SYSFS=y +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_SYSV68_PARTITION=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_COMPAT=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_SYSV_FS=m +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_TASK_XACCT=y +CONFIG_TCG_ATMEL=m +CONFIG_TCG_INFINEON=m +CONFIG_TCG_NSC=m +CONFIG_TCG_TIS=m +CONFIG_TCG_TPM=m +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=m +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_ILLINOIS=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_MD5SIG=y +CONFIG_TEHUTI=m +CONFIG_TEKRAM_DONGLE=m +CONFIG_TELCLOCK=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_TEXTSEARCH_KMP=m +CONFIG_THINKPAD_ACPI=m +CONFIG_THINKPAD_ACPI_BAY=y +# CONFIG_THINKPAD_ACPI_DEBUG is not set +CONFIG_TICK_ONESHOT=y +CONFIG_TIFM_7XX1=m +CONFIG_TIFM_CORE=m +CONFIG_TIGON3=m +CONFIG_TIMER_STATS=y +# CONFIG_TINY_SHMEM is not set +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +# CONFIG_TMD_HERMES is not set +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TMS380TR=m +CONFIG_TMSPCI=m +# CONFIG_TOIM3232_DONGLE is not set +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_ELO=m +CONFIG_TOUCHSCREEN_FUJITSU=m +CONFIG_TOUCHSCREEN_GUNZE=m +CONFIG_TOUCHSCREEN_MK712=m +CONFIG_TOUCHSCREEN_MTOUCH=m +CONFIG_TOUCHSCREEN_PENMOUNT=m +CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +CONFIG_TOUCHSCREEN_TOUCHWIN=m +CONFIG_TOUCHSCREEN_UCB1400=m +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TR=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_TULIP=m +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_NAPI is not set +CONFIG_TUN=m +CONFIG_TUNER_3036=m +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_SIMPLE=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TYPHOON=m +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_UFS_DEBUG is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +CONFIG_UID16=y +CONFIG_UIO=m +CONFIG_UIO_CIF=m +CONFIG_ULI526X=m +CONFIG_ULTRIX_PARTITION=y +CONFIG_UNIX=y +CONFIG_UNIX98_PTYS=y +CONFIG_UNIXWARE_DISKLABEL=y +CONFIG_UNUSED_SYMBOLS=y +CONFIG_USB=m +CONFIG_USBPCWATCHDOG=m +CONFIG_USB_ACM=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AMD5536UDC=m +CONFIG_USB_AN2720=y +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_ATM=m +CONFIG_USB_AUERSWALD=m +CONFIG_USB_BELKIN=y +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_CATC=m +CONFIG_USB_CXACRU=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_DABUSB=m +# CONFIG_USB_DEBUG is not set +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +CONFIG_USB_DSBR=m +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EMI26=m +CONFIG_USB_EMI62=m +CONFIG_USB_EPSON2888=y +CONFIG_USB_ET61X251=m +CONFIG_USB_ETH=m +CONFIG_USB_ETH_RNDIS=y +CONFIG_USB_EZUSB=y +CONFIG_USB_FILE_STORAGE=m +# CONFIG_USB_FILE_STORAGE_TEST is not set +CONFIG_USB_FTDI_ELAN=m +CONFIG_USB_GADGET=m +CONFIG_USB_GADGETFS=m +CONFIG_USB_GADGET_AMD5536UDC=y +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_DUALSPEED=y +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_M66592 is not set +# CONFIG_USB_GADGET_NET2280 is not set +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_S3C2410 is not set +CONFIG_USB_GADGET_SELECTED=y +CONFIG_USB_G_SERIAL=m +CONFIG_USB_HID=m +CONFIG_USB_HIDDEV=y +CONFIG_USB_HIDINPUT_POWERBOOK=y +CONFIG_USB_IBMCAM=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_IOWARRIOR=m +CONFIG_USB_IRDA=m +CONFIG_USB_ISP116X_HCD=m +CONFIG_USB_KAWETH=m +CONFIG_USB_KBD=m +CONFIG_USB_KC2190=y +CONFIG_USB_KONICAWC=m +CONFIG_USB_LCD=m +CONFIG_USB_LD=m +CONFIG_USB_LED=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LIBUSUAL=y +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +# CONFIG_USB_MIDI_GADGET is not set +CONFIG_USB_MON=y +CONFIG_USB_MOUSE=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_RNDIS_HOST=m +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_HCD=m +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OTG is not set +# CONFIG_USB_OV511 is not set +CONFIG_USB_PEGASUS=m +CONFIG_USB_PERSIST=y +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_PRINTER=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_R8A66597_HCD=m +CONFIG_USB_RIO500=m +CONFIG_USB_RTL8150=m +CONFIG_USB_SE401=m +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IPW=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_SL811_CS=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SN9C102=m +CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_STORAGE=m +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_DATAFAB=y +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STV680=m +CONFIG_USB_SUPPORT=y +CONFIG_USB_SUSPEND=y +# CONFIG_USB_TEST is not set +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_UEAGLEATM=m +CONFIG_USB_UHCI_HCD=m +CONFIG_USB_USBNET=m +CONFIG_USB_USS720=m +CONFIG_USB_VICAM=m +CONFIG_USB_W9968CF=m +CONFIG_USB_XUSBATM=m +CONFIG_USB_ZC0301=m +CONFIG_USB_ZD1201=m +CONFIG_USB_ZERO=m +CONFIG_USB_ZR364XX=m +# CONFIG_USER_NS is not set +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VETH=m +CONFIG_VFAT_FS=m +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +CONFIG_VGASTATE=m +CONFIG_VGA_CONSOLE=y +CONFIG_VIA_FIR=m +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_VIA_VELOCITY=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m +# CONFIG_VIDEO_ADV_DEBUG is not set +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_CX2341X=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_CX25840=m +CONFIG_VIDEO_CX88=m +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_DEV=m +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_FB_IVTV=m +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_MEYE=m +CONFIG_VIDEO_MSP3400=m +# CONFIG_VIDEO_MXB is not set +CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_29XXX=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_DVB=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_SELECT=y +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_USBVIDEO=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_VP27SMPX=m +CONFIG_VIDEO_VPX3220=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_WM8775=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VIRTIO=m +CONFIG_VIRTIO_BALLOON=m +CONFIG_VIRTIO_BLK=m +CONFIG_VIRTIO_NET=m +CONFIG_VIRTIO_PCI=m +CONFIG_VIRTIO_RING=m +CONFIG_VIRTUALIZATION=y +CONFIG_VIRT_TO_BUS=y +CONFIG_VITESSE_PHY=m +CONFIG_VLAN_8021Q=m +CONFIG_VLSI_FIR=m +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VORTEX=m +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_VXFS_FS=m +CONFIG_W1=m +CONFIG_W1_CON=y +CONFIG_W1_MASTER_DS2482=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2760=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_THERM=m +CONFIG_W83627HF_WDT=m +CONFIG_W83697HF_WDT=m +CONFIG_W83877F_WDT=m +CONFIG_W83977F_WDT=m +CONFIG_WAFER_WDT=m +CONFIG_WAN=y +CONFIG_WANXL=m +CONFIG_WAN_ROUTER=m +CONFIG_WAN_ROUTER_DRIVERS=m +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set +# CONFIG_WDC_ALI15X3 is not set +CONFIG_WDTPCI=m +CONFIG_WDT_501_PCI=y +CONFIG_WINBOND_840=m +CONFIG_WINBOND_FIR=m +CONFIG_WIRELESS_EXT=y +CONFIG_WLAN_80211=y +CONFIG_WLAN_PRE80211=y +# CONFIG_WRAPPER_PRINT is not set +CONFIG_X25=m +CONFIG_X25_ASY=m +CONFIG_X86=y +# CONFIG_X86_32 is not set +CONFIG_X86_64=y +CONFIG_X86_64_ACPI_NUMA=y +CONFIG_X86_ACPI_CPUFREQ=m +# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set +# CONFIG_X86_BIGSMP is not set +CONFIG_X86_CMPXCHG=y +CONFIG_X86_CPUID=m +# CONFIG_X86_ELAN is not set +# CONFIG_X86_ES7000 is not set +# CONFIG_X86_GENERICARCH is not set +CONFIG_X86_GOOD_APIC=y +CONFIG_X86_HT=y +CONFIG_X86_INTERNODE_CACHE_BYTES=128 +CONFIG_X86_IO_APIC=y +CONFIG_X86_L1_CACHE_BYTES=128 +CONFIG_X86_L1_CACHE_SHIFT=7 +CONFIG_X86_LOCAL_APIC=y +CONFIG_X86_MCE=y +CONFIG_X86_MCE_AMD=y +CONFIG_X86_MCE_INTEL=y +CONFIG_X86_MINIMUM_CPU_FAMILY=64 +CONFIG_X86_MSR=m +# CONFIG_X86_NUMAQ is not set +# CONFIG_X86_P4_CLOCKMOD is not set +CONFIG_X86_PC=y +CONFIG_X86_PM_TIMER=y +CONFIG_X86_POWERNOW_K8=m +CONFIG_X86_POWERNOW_K8_ACPI=y +# CONFIG_X86_SPEEDSTEP_CENTRINO is not set +# CONFIG_X86_SPEEDSTEP_LIB is not set +# CONFIG_X86_SUMMIT is not set +CONFIG_X86_TSC=y +# CONFIG_X86_VISWS is not set +# CONFIG_X86_VOYAGER is not set +# CONFIG_X86_VSMP is not set +CONFIG_XFRM=y +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_SUB_POLICY is not set +CONFIG_XFRM_USER=m +CONFIG_XFS_FS=m +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_QUOTA=y +CONFIG_XFS_RT=y +CONFIG_XFS_SECURITY=y +CONFIG_XOR_BLOCKS=m +CONFIG_YAM=m +CONFIG_YELLOWFIN=m +CONFIG_YENTA=m +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_ZISOFS=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZONE_DMA=y +CONFIG_ZONE_DMA32=y +CONFIG_ZONE_DMA_FLAG=1 --- linux-2.6.24.orig/debian/config/amd64/config.generic +++ linux-2.6.24/debian/config/amd64/config.generic @@ -0,0 +1,20 @@ +# +# Config options for config.generic automatically generated by splitconfig.pl +# +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_EDD_OFF=y +# CONFIG_HUGETLBFS is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_NETLABEL is not set +CONFIG_NR_CPUS=8 +CONFIG_PREEMPT_BKL=y +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +# CONFIG_SCHED_SMT is not set +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-generic" --- linux-2.6.24.orig/debian/config/i386/config.server +++ linux-2.6.24/debian/config/i386/config.server @@ -0,0 +1,1957 @@ +# +# Config options for config.server automatically generated by splitconfig.pl +# +CONFIG_3C359=m +CONFIG_3C515=m +CONFIG_60XX_WDT=m +CONFIG_6PACK=m +CONFIG_8139CP=m +CONFIG_8139TOO_8129=y +CONFIG_9P_FS=m +CONFIG_ABYSS=m +CONFIG_AC3200=m +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_ACPI_ASUS=m +CONFIG_ACPI_BATTERY=m +CONFIG_ACPI_BAY=m +CONFIG_ACPI_DOCK=m +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_SBS=m +CONFIG_ACPI_TOSHIBA=m +CONFIG_ACPI_VIDEO=m +CONFIG_ACQUIRE_WDT=m +CONFIG_ACT200L_DONGLE=m +CONFIG_ACTISYS_DONGLE=m +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_ADM8211=m +CONFIG_ADVANTECH_WDT=m +CONFIG_AFFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_AFS_FS=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_AGP_ALI=m +CONFIG_AGP_AMD=m +CONFIG_AGP_AMD64=m +CONFIG_AGP_ATI=m +CONFIG_AGP_EFFICEON=m +CONFIG_AGP_NVIDIA=m +CONFIG_AGP_SIS=m +CONFIG_AGP_SWORKS=m +CONFIG_AGP_VIA=m +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +CONFIG_AIC79XX_DEBUG_ENABLE=y +CONFIG_AIC79XX_DEBUG_MASK=0 +CONFIG_AIC79XX_REG_PRETTY_PRINT=y +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_DEBUG_ENABLE=y +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_AIRO=m +CONFIG_AIRO_CS=m +CONFIG_ALIM1535_WDT=m +CONFIG_ALIM7101_WDT=m +CONFIG_ALI_FIR=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_AMD8111_ETH=m +CONFIG_APM=m +# CONFIG_APM_ALLOW_INTS is not set +# CONFIG_APM_CPU_IDLE is not set +# CONFIG_APM_DISPLAY_BLANK is not set +# CONFIG_APM_DO_ENABLE is not set +# CONFIG_APM_IGNORE_USER_SUSPEND is not set +# CONFIG_APM_REAL_MODE_POWER_OFF is not set +CONFIG_APPLICOM=m +CONFIG_APRICOT=m +CONFIG_ARCNET=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_ARCNET_COM20020_ISA=m +CONFIG_ARCNET_COM20020_PCI=m +CONFIG_ARCNET_COM90xx=m +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RAW=m +CONFIG_ARCNET_RIM_I=m +CONFIG_ARLAN=m +CONFIG_ASUS_LAPTOP=m +CONFIG_AT1700=m +CONFIG_ATA_OVER_ETH=m +CONFIG_ATL1=m +CONFIG_ATM=y +CONFIG_ATMEL=m +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_BR2684=m +# CONFIG_ATM_BR2684_IPFILTER is not set +CONFIG_ATM_CLIP=y +# CONFIG_ATM_CLIP_NO_ICMP is not set +CONFIG_ATM_DRIVERS=y +# CONFIG_ATM_DUMMY is not set +CONFIG_ATM_ENI=m +# CONFIG_ATM_ENI_DEBUG is not set +# CONFIG_ATM_ENI_TUNE_BURST is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_FORE200E=m +CONFIG_ATM_FORE200E_DEBUG=0 +CONFIG_ATM_FORE200E_MAYBE=m +CONFIG_ATM_FORE200E_PCA=y +CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y +CONFIG_ATM_FORE200E_TX_RETRY=16 +# CONFIG_ATM_FORE200E_USE_TASKLET is not set +CONFIG_ATM_HE=m +CONFIG_ATM_HE_USE_SUNI=y +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_IA=m +# CONFIG_ATM_IA_DEBUG is not set +CONFIG_ATM_IDT77252=m +# CONFIG_ATM_IDT77252_DEBUG is not set +# CONFIG_ATM_IDT77252_RCV_ALL is not set +CONFIG_ATM_IDT77252_USE_SUNI=y +CONFIG_ATM_LANAI=m +CONFIG_ATM_LANE=m +CONFIG_ATM_MPOA=m +CONFIG_ATM_NICSTAR=m +# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set +# CONFIG_ATM_NICSTAR_USE_SUNI is not set +CONFIG_ATM_TCP=m +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_ATP=m +CONFIG_AX25=m +CONFIG_AX25_DAMA_SLAVE=y +CONFIG_B43=m +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PIO=y +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_B43_DEBUG=y +CONFIG_B43_DMA=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +CONFIG_B43_LEDS=y +CONFIG_B43_PCICORE_AUTOSELECT=y +CONFIG_B43_PCI_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_PIO=y +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43_RFKILL=y +CONFIG_B44=m +CONFIG_B44_PCI=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_BACKLIGHT_CARILLO_RANCH=m +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_PROGEAR=m +CONFIG_BAYCOM_EPP=m +CONFIG_BAYCOM_PAR=m +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +CONFIG_BCM43XX_PIO=y +# CONFIG_BCM43XX_PIO_MODE is not set +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_BLK_DEV_4DRIVES=y +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI14XX=m +CONFIG_BLK_DEV_ALI15X3=m +CONFIG_BLK_DEV_ATIIXP=m +CONFIG_BLK_DEV_CMD640=y +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +CONFIG_BLK_DEV_CMD64X=m +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_CS5535=m +CONFIG_BLK_DEV_CY82C693=m +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_DTC2278=m +CONFIG_BLK_DEV_HPT34X=m +CONFIG_BLK_DEV_HPT366=m +CONFIG_BLK_DEV_HT6560B=m +CONFIG_BLK_DEV_IDE=m +CONFIG_BLK_DEV_IDEACPI=y +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_BLK_DEV_IDEPNP=y +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDETAPE=m +CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_BLK_DEV_NS87415=m +# CONFIG_BLK_DEV_OFFBOARD is not set +CONFIG_BLK_DEV_OPTI621=m +CONFIG_BLK_DEV_PDC202XX_OLD=m +CONFIG_BLK_DEV_QD65XX=m +CONFIG_BLK_DEV_SC1200=m +CONFIG_BLK_DEV_SX8=m +CONFIG_BLK_DEV_TC86C001=m +CONFIG_BLK_DEV_TRM290=m +CONFIG_BLK_DEV_UMC8672=m +CONFIG_BLK_DEV_UMEM=m +CONFIG_BLK_DEV_XD=m +CONFIG_BNX2=m +CONFIG_BPQETHER=m +CONFIG_BROADCOM_PHY=m +CONFIG_BT=m +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_CMTP=m +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +CONFIG_BT_HCIVHCI=m +CONFIG_BT_HIDP=m +CONFIG_BT_L2CAP=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_SCO=m +CONFIG_C101=m +CONFIG_CAPI_AVM=y +CONFIG_CAPI_EICON=y +CONFIG_CAPI_TRACE=y +CONFIG_CARDBUS=y +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_CASSINI=m +CONFIG_CFAG12864B=m +CONFIG_CFAG12864B_RATE=20 +CONFIG_CFG80211=m +CONFIG_CHECK_SIGNATURE=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_CHR_DEV_OSST=m +CONFIG_CHR_DEV_SCH=m +CONFIG_CHR_DEV_ST=m +CONFIG_CICADA_PHY=m +CONFIG_CISS_SCSI_TAPE=y +# CONFIG_COMPUTONE is not set +CONFIG_COPS=m +CONFIG_COPS_DAYNA=y +CONFIG_COPS_TANGENT=y +CONFIG_COSA=m +CONFIG_CPU5_WDT=m +CONFIG_CPUSETS=y +CONFIG_CPU_FREQ_TABLE=m +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DEV_PADLOCK=y +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CS5535_GPIO=m +CONFIG_CS89x0=m +CONFIG_CYCLADES=m +CONFIG_CYCLADES_SYNC=m +CONFIG_CYCLOMX_X25=y +# CONFIG_CYZ_INTR is not set +CONFIG_DAB=y +CONFIG_DAVICOM_PHY=m +CONFIG_DE2104X=m +CONFIG_DE4X5=m +CONFIG_DE600=m +CONFIG_DE620=m +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DECNET_NF_GRABULATOR=m +# CONFIG_DEFAULT_CFQ is not set +CONFIG_DEFAULT_DEADLINE=y +CONFIG_DEFAULT_IOSCHED="deadline" +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_DEPCA=m +CONFIG_DE_AOC=y +CONFIG_DIGIEPCA=m +CONFIG_DISPLAY_SUPPORT=m +CONFIG_DL2K=m +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_DM9102=m +CONFIG_DONGLE=y +CONFIG_DRM=m +CONFIG_DRM_I810=m +CONFIG_DRM_I830=m +CONFIG_DRM_I915=m +CONFIG_DRM_MGA=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_SAVAGE=m +CONFIG_DRM_SIS=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_VIA=m +CONFIG_DRM_VIA_CHROME9=m +CONFIG_DSCC4=m +CONFIG_DSCC4_PCISYNC=y +CONFIG_DSCC4_PCI_RST=y +CONFIG_DTLK=m +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_BT8XX=m +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_PATCH=m +CONFIG_DVB_CAPTURE_DRIVERS=y +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +# CONFIG_DVB_FE_CUSTOMISE is not set +CONFIG_DVB_ISL6421=m +CONFIG_DVB_L64781=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LNBP21=m +CONFIG_DVB_MT312=m +CONFIG_DVB_MT352=m +CONFIG_DVB_NXT200X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_PLL=m +CONFIG_DVB_PLUTO2=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_STV0297=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_USB=m +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_CXUSB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_VES1820=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_ZL10353=m +CONFIG_E100=m +CONFIG_E2100=m +CONFIG_ECONET=m +CONFIG_ECONET_AUNUDP=y +CONFIG_ECONET_NATIVE=y +CONFIG_EDAC=y +# CONFIG_EDAC_AMD76X is not set +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_E752X=m +CONFIG_EDAC_E7XXX=m +CONFIG_EDAC_I3000=m +CONFIG_EDAC_I5000=m +CONFIG_EDAC_I82860=m +CONFIG_EDAC_I82875P=m +CONFIG_EDAC_I82975X=m +CONFIG_EDAC_MM_EDAC=m +CONFIG_EDAC_R82600=m +CONFIG_EDD=y +# CONFIG_EDD_OFF is not set +CONFIG_EEPRO100=m +CONFIG_EEXPRESS=m +CONFIG_EEXPRESS_PRO=m +CONFIG_EISA=y +CONFIG_EISA_NAMES=y +CONFIG_EISA_PCI_EISA=y +CONFIG_EISA_VIRTUAL_ROOT=y +CONFIG_EISA_VLB_PRIMING=y +CONFIG_EL1=m +CONFIG_EL16=m +CONFIG_EL2=m +CONFIG_EL3=m +CONFIG_ELMC=m +CONFIG_ELMC_II=m +CONFIG_ELPLUS=m +CONFIG_EPIC100=m +CONFIG_ES3210=m +CONFIG_ESI_DONGLE=m +# CONFIG_ESPSERIAL is not set +CONFIG_ETH16I=m +CONFIG_EUROTECH_WDT=m +CONFIG_EWRK3=m +CONFIG_FARSYNC=m +CONFIG_FB_3DFX=m +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_ARK=m +CONFIG_FB_ATY=m +CONFIG_FB_ATY128=m +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_CARILLO_RANCH=m +CONFIG_FB_CYBER2000=m +CONFIG_FB_CYBLA=m +CONFIG_FB_DDC=m +CONFIG_FB_GEODE=y +CONFIG_FB_GEODE_GX=m +CONFIG_FB_GEODE_GX1=m +# CONFIG_FB_GEODE_GX_SET_FBSIZE is not set +CONFIG_FB_GEODE_LX=m +CONFIG_FB_HECUBA=m +CONFIG_FB_HGA=m +# CONFIG_FB_HGA_ACCEL is not set +CONFIG_FB_I810=m +# CONFIG_FB_I810_GTF is not set +CONFIG_FB_IMAC=y +CONFIG_FB_INTEL=m +# CONFIG_FB_INTEL_DEBUG is not set +CONFIG_FB_INTEL_I2C=y +CONFIG_FB_KYRO=m +CONFIG_FB_LE80578=m +CONFIG_FB_MATROX=m +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_BACKLIGHT=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_I2C=y +CONFIG_FB_PM2=m +CONFIG_FB_PM2_FIFO_DISCONNECT=y +CONFIG_FB_PM3=m +CONFIG_FB_RADEON=m +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_BACKLIGHT=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_I2C=y +CONFIG_FB_S1D13XXX=m +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_SM501=m +CONFIG_FB_SVGALIB=m +CONFIG_FB_TRIDENT=m +# CONFIG_FB_TRIDENT_ACCEL is not set +CONFIG_FB_VOODOO1=m +CONFIG_FB_VT8623=m +CONFIG_FDDI=y +CONFIG_FEALNX=m +CONFIG_FIXED_MII_1000_FDX=y +# CONFIG_FIXED_MII_100_FDX is not set +# CONFIG_FIXED_MII_10_FDX is not set +CONFIG_FIXED_MII_AMNT=1 +CONFIG_FIXED_PHY=m +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +CONFIG_FTL=m +CONFIG_FUJITSU_LAPTOP=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GIGASET_BASE=m +# CONFIG_GIGASET_DEBUG is not set +CONFIG_GIGASET_M101=m +CONFIG_GIGASET_M105=m +# CONFIG_GIGASET_UNDOCREQ is not set +CONFIG_GIRBIL_DONGLE=m +CONFIG_HAMACHI=m +CONFIG_HAMRADIO=y +CONFIG_HAPPYMEAL=m +CONFIG_HDLC=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +CONFIG_HDLC_X25=m +CONFIG_HERMES=m +CONFIG_HIBERNATION_SMP_POSSIBLE=y +CONFIG_HID=m +CONFIG_HIDRAW=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HID_FF is not set +# CONFIG_HIGHMEM4G is not set +CONFIG_HIGHMEM64G=y +CONFIG_HIPPI=y +CONFIG_HISAX_16_0=y +CONFIG_HISAX_16_3=y +CONFIG_HISAX_1TR6=y +CONFIG_HISAX_ASUSCOM=y +CONFIG_HISAX_AVM_A1=y +CONFIG_HISAX_AVM_A1_CS=m +CONFIG_HISAX_AVM_A1_PCMCIA=y +CONFIG_HISAX_BKM_A4T=y +# CONFIG_HISAX_DEBUG is not set +CONFIG_HISAX_DIEHLDIVA=y +CONFIG_HISAX_ELSA=y +CONFIG_HISAX_ELSA_CS=m +CONFIG_HISAX_ENTERNOW_PCI=y +CONFIG_HISAX_EURO=y +CONFIG_HISAX_FRITZPCI=y +CONFIG_HISAX_FRITZ_PCIPNP=m +CONFIG_HISAX_GAZEL=y +CONFIG_HISAX_HDLC=y +CONFIG_HISAX_HFC4S8S=m +CONFIG_HISAX_HFCS=y +CONFIG_HISAX_HFCUSB=m +CONFIG_HISAX_HFC_PCI=y +CONFIG_HISAX_HFC_SX=y +CONFIG_HISAX_HSTSAPHIR=y +CONFIG_HISAX_ISURF=y +CONFIG_HISAX_IX1MICROR2=y +CONFIG_HISAX_MAX_CARDS=8 +CONFIG_HISAX_MIC=y +CONFIG_HISAX_NETJET=y +CONFIG_HISAX_NETJET_U=y +CONFIG_HISAX_NI1=y +CONFIG_HISAX_NICCY=y +# CONFIG_HISAX_NO_KEYPAD is not set +# CONFIG_HISAX_NO_LLC is not set +# CONFIG_HISAX_NO_SENDCOMPLETE is not set +CONFIG_HISAX_S0BOX=y +CONFIG_HISAX_SCT_QUADRO=y +CONFIG_HISAX_SEDLBAUER=y +CONFIG_HISAX_SEDLBAUER_CS=m +CONFIG_HISAX_SPORTSTER=y +CONFIG_HISAX_ST5481=m +CONFIG_HISAX_TELEINT=y +CONFIG_HISAX_TELESPCI=y +CONFIG_HISAX_TELES_CS=m +CONFIG_HISAX_W6692=y +CONFIG_HOSTAP=m +CONFIG_HOSTAP_CS=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_PLX=m +CONFIG_HOSTESS_SV11=m +CONFIG_HOTPLUG_CPU=y +CONFIG_HOTPLUG_PCI=m +CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m +CONFIG_HOTPLUG_PCI_COMPAQ=m +CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y +CONFIG_HOTPLUG_PCI_CPCI=y +CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m +CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m +CONFIG_HOTPLUG_PCI_FAKE=m +CONFIG_HOTPLUG_PCI_IBM=m +CONFIG_HOTPLUG_PCI_PCIE=m +CONFIG_HOTPLUG_PCI_SHPC=m +CONFIG_HP100=m +CONFIG_HPET_EMULATE_RTC=y +CONFIG_HPLAN=m +CONFIG_HPLAN_PLUS=m +# CONFIG_HPT34X_AUTODMA is not set +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_HVC_XEN=y +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_HWMON_VID=m +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_AMD=m +CONFIG_HW_RANDOM_GEODE=m +CONFIG_HW_RANDOM_VIA=m +CONFIG_HZ=100 +CONFIG_HZ_100=y +# CONFIG_HZ_250 is not set +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PCA_ISA=m +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m +CONFIG_I2O=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_BUS=m +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_PROC=m +CONFIG_I2O_SCSI=m +CONFIG_I6300ESB_WDT=m +CONFIG_I82092=m +CONFIG_I82365=m +CONFIG_I8K=m +CONFIG_IB700_WDT=m +CONFIG_IBMASR=m +CONFIG_IBMLANA=m +CONFIG_IBMLS=m +# CONFIG_IBMMCA_SCSI_DEV_RESET is not set +CONFIG_IBMMCA_SCSI_ORDER_STANDARD=y +CONFIG_IBMOL=m +CONFIG_IBMTR=m +CONFIG_IBM_ASM=m +CONFIG_IDEPCI_SHARE_IRQ=y +CONFIG_IDE_PROC_FS=y +CONFIG_IEEE1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_OHCI1394=m +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +# CONFIG_IEEE1394_VERBOSEDEBUG is not set +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE80211=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_CRYPT_WEP=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_ISER=m +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFTL=m +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_ATLAS_BTNS=m +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_TABLET=y +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_INPUT_UINPUT=m +CONFIG_INPUT_WISTRON_BTNS=m +CONFIG_INPUT_YEALINK=m +CONFIG_IPPP_FILTER=y +CONFIG_IPV6_MULTIPLE_TABLES=y +# CONFIG_IPV6_SUBTREES is not set +CONFIG_IPW2100=m +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +CONFIG_IPW2200=m +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IRCOMM=m +CONFIG_IRDA=m +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_DEBUG=y +CONFIG_IRDA_FAST_RR=y +CONFIG_IRDA_ULTRA=y +CONFIG_IRLAN=m +CONFIG_IRNET=m +# CONFIG_IRQBALANCE is not set +CONFIG_IRTTY_SIR=m +CONFIG_ISA=y +CONFIG_ISAPNP=y +CONFIG_ISDN=m +CONFIG_ISDN_AUDIO=y +CONFIG_ISDN_CAPI=m +CONFIG_ISDN_CAPI_CAPI20=m +CONFIG_ISDN_CAPI_CAPIDRV=m +CONFIG_ISDN_CAPI_CAPIFS=m +CONFIG_ISDN_CAPI_CAPIFS_BOOL=y +CONFIG_ISDN_CAPI_MIDDLEWARE=y +CONFIG_ISDN_DIVAS=m +CONFIG_ISDN_DIVAS_BRIPCI=y +CONFIG_ISDN_DIVAS_DIVACAPI=m +CONFIG_ISDN_DIVAS_MAINT=m +CONFIG_ISDN_DIVAS_PRIPCI=y +CONFIG_ISDN_DIVAS_USERIDI=m +CONFIG_ISDN_DIVERSION=m +CONFIG_ISDN_DRV_ACT2000=m +CONFIG_ISDN_DRV_AVMB1_AVM_CS=m +CONFIG_ISDN_DRV_AVMB1_B1ISA=m +CONFIG_ISDN_DRV_AVMB1_B1PCI=m +CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m +CONFIG_ISDN_DRV_AVMB1_C4=m +CONFIG_ISDN_DRV_AVMB1_T1ISA=m +CONFIG_ISDN_DRV_AVMB1_T1PCI=m +CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y +CONFIG_ISDN_DRV_GIGASET=m +CONFIG_ISDN_DRV_HISAX=m +CONFIG_ISDN_DRV_ICN=m +CONFIG_ISDN_DRV_PCBIT=m +CONFIG_ISDN_DRV_SC=m +CONFIG_ISDN_I4L=m +CONFIG_ISDN_MPP=y +CONFIG_ISDN_PPP=y +CONFIG_ISDN_PPP_BSDCOMP=m +CONFIG_ISDN_PPP_VJ=y +CONFIG_ISDN_TTY_FAX=y +CONFIG_ISDN_X25=y +# CONFIG_ISI is not set +# CONFIG_IWLWIFI is not set +CONFIG_IXGB=m +# CONFIG_IXGB_NAPI is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_SUMMARY is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_IFORCE=m +CONFIG_JOYSTICK_IFORCE_232=y +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_K8_NB=y +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KINGSUN_DONGLE=m +CONFIG_KS0108=m +CONFIG_KS0108_DELAY=2 +CONFIG_KS0108_PORT=0x378 +CONFIG_KS959_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +CONFIG_KVM=m +CONFIG_KVM_AMD=m +CONFIG_KVM_INTEL=m +CONFIG_LANCE=m +CONFIG_LANMEDIA=m +CONFIG_LAPB=m +CONFIG_LAPBETHER=m +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +CONFIG_LEDS_CLASS=m +CONFIG_LEDS_NET48XX=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_WRAP=m +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_CS=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_LIBERTAS_SDIO=m +CONFIG_LIBERTAS_USB=m +CONFIG_LITELINK_DONGLE=m +CONFIG_LLC=y +CONFIG_LNE390=m +CONFIG_LOCK_KERNEL=y +CONFIG_LP486E=m +CONFIG_LTPC=m +CONFIG_LXT_PHY=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +# CONFIG_M486 is not set +# CONFIG_M586 is not set +CONFIG_M686=y +CONFIG_MA600_DONGLE=m +CONFIG_MAC80211=m +# CONFIG_MAC80211_DEBUG is not set +CONFIG_MAC80211_DEBUGFS=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MACHZ_WDT=m +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_MADGEMC=m +CONFIG_MARVELL_PHY=m +# CONFIG_MATH_EMULATION is not set +CONFIG_MCA=y +CONFIG_MCA_LEGACY=y +# CONFIG_MCA_PROC_FS is not set +CONFIG_MCP2120_DONGLE=m +CONFIG_MCS_FIR=m +CONFIG_MDA_CONSOLE=m +CONFIG_MD_RAID10=m +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_SAS=m +CONFIG_MFD_SM501=m +CONFIG_MINIX_FS=m +CONFIG_MIXCOMWD=m +CONFIG_MKISS=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_MLX4_INFINIBAND=m +CONFIG_MMC=m +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_SDHCI=m +CONFIG_MMC_TIFM_SD=m +# CONFIG_MMC_UNSAFE_RESUME is not set +CONFIG_MMC_WBSD=m +CONFIG_MOUSE_APPLETOUCH=m +# CONFIG_MOUSE_ATIXL is not set +CONFIG_MOUSE_INPORT=m +CONFIG_MOUSE_LOGIBM=m +CONFIG_MOUSE_PC110PAD=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_VSXXXAA=m +# CONFIG_MOXA_INTELLIO is not set +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +CONFIG_MSI_LAPTOP=m +CONFIG_MTD=m +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTD_ABSENT=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_AMD76XROM=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK2MTD=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_MTD_CFI=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_CHAR=m +CONFIG_MTD_CK804XROM=m +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_CONCAT=m +CONFIG_MTD_DATAFLASH=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_DILNETPC=m +CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000 +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCECC=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCPROBE_ADDRESS=0 +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_ESB2ROM=m +CONFIG_MTD_GEN_PROBE=m +CONFIG_MTD_ICHXROM=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_L440GX=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_MAP_BANK_WIDTH_1=y +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +CONFIG_MTD_MAP_BANK_WIDTH_2=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTD_NAND=m +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_CS553X=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND_IDS=m +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +CONFIG_MTD_NETSC520=m +CONFIG_MTD_NETtel=m +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_2X_PROGRAM=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_SIM=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_OOPS=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_PCI=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PLATRAM=m +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_PNC2000=m +CONFIG_MTD_RAM=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +CONFIG_MTD_REDBOOT_PARTS=m +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +CONFIG_MTD_ROM=m +CONFIG_MTD_SBC_GXX=m +CONFIG_MTD_SC520CDP=m +CONFIG_MTD_SCB2_FLASH=m +CONFIG_MTD_SCx200_DOCFLASH=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_TS5500=m +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_MTD_UBI_GLUEBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MWAVE=m +CONFIG_MYRI10GE=m +CONFIG_N2=m +CONFIG_NATSEMI=m +CONFIG_NCPFS_EXTRAS=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_OS2_NS=y +CONFIG_NCPFS_PACKET_SIGNING=y +# CONFIG_NCPFS_SMALLDOS is not set +CONFIG_NCPFS_STRONG=y +CONFIG_NCP_FS=m +CONFIG_NE2000=m +CONFIG_NE2_MCA=m +CONFIG_NE3210=m +CONFIG_NETLABEL=y +CONFIG_NETROM=m +CONFIG_NETXEN_NIC=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SIMP=m +# CONFIG_NET_CLS_POLICE is not set +CONFIG_NET_DCCPPROBE=m +CONFIG_NET_FC=y +CONFIG_NET_ISA=y +CONFIG_NET_PCMCIA=y +CONFIG_NET_POCKET=y +CONFIG_NET_SCH_ATM=m +CONFIG_NET_TCPPROBE=m +CONFIG_NET_VENDOR_3COM=y +CONFIG_NET_VENDOR_RACAL=y +CONFIG_NET_VENDOR_SMC=y +CONFIG_NEW_LEDS=y +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NI52=m +CONFIG_NI65=m +CONFIG_NL80211=y +# CONFIG_NORTEL_HERMES is not set +CONFIG_NO_HZ=y +CONFIG_NR_CPUS=8 +CONFIG_NS83820=m +CONFIG_NSC_FIR=m +CONFIG_NSC_GPIO=m +# CONFIG_NTFS_RW is not set +CONFIG_N_HDLC=m +CONFIG_OLD_BELKIN_DONGLE=m +CONFIG_P54_COMMON=m +CONFIG_P54_PCI=m +CONFIG_P54_USB=m +CONFIG_PARIDE=m +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_BPCK6=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PG=m +CONFIG_PARIDE_PT=m +CONFIG_PARPORT_AX88796=m +CONFIG_PARPORT_NOT_PC=y +CONFIG_PARPORT_PC_FIFO=y +CONFIG_PARPORT_PC_PCMCIA=m +CONFIG_PARPORT_SERIAL=m +CONFIG_PATA_CS5520=m +CONFIG_PATA_EFAR=m +# CONFIG_PATA_ISAPNP is not set +CONFIG_PATA_IT8213=m +CONFIG_PATA_IT821X=m +CONFIG_PATA_JMICRON=m +# CONFIG_PATA_LEGACY is not set +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_NETCELL=m +CONFIG_PATA_OLDPIIX=m +CONFIG_PATA_PCMCIA=m +CONFIG_PATA_PDC2027X=m +CONFIG_PATA_QDI=m +CONFIG_PATA_RZ1000=m +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_WINBOND=m +# CONFIG_PATA_WINBOND_VLB is not set +CONFIG_PC300=m +# CONFIG_PC300TOO is not set +CONFIG_PC300_MLPPP=y +CONFIG_PC8736x_GPIO=m +CONFIG_PC87413_WDT=m +CONFIG_PCCARD=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_PCI200SYN=m +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIPCWATCHDOG=m +CONFIG_PCI_ATMEL=m +# CONFIG_PCI_HERMES is not set +CONFIG_PCMCIA=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_AHA152X=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_PCMCIA_AXNET=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_IBMTR=m +CONFIG_PCMCIA_IOCTL=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_NETWAVE=m +CONFIG_PCMCIA_NINJA_SCSI=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_PROBE=y +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_RAYCS=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_PCWATCHDOG=m +CONFIG_PD6729=m +CONFIG_PDC202XX_BURST=y +CONFIG_PDC_ADMA=m +CONFIG_PHANTOM=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m +CONFIG_PLIP=m +# CONFIG_PLX_HERMES is not set +CONFIG_PM_SLEEP_SMP=y +CONFIG_PNPBIOS=y +CONFIG_PNPBIOS_PROC_FS=y +CONFIG_PPPOATM=m +# CONFIG_PREEMPT_BKL is not set +CONFIG_PREEMPT_NONE=y +CONFIG_PREEMPT_NOTIFIERS=y +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PRISM54=m +CONFIG_PROC_PID_CPUSET=y +CONFIG_PROTEON=m +CONFIG_QLA3XXX=m +CONFIG_QSEMI_PHY=m +CONFIG_R3964=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_AZTECH=m +CONFIG_RADIO_CADET=m +CONFIG_RADIO_GEMTEK=m +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAESTRO=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RADIO_RTRACK=m +CONFIG_RADIO_RTRACK2=m +CONFIG_RADIO_SF16FMI=m +CONFIG_RADIO_SF16FMR2=m +CONFIG_RADIO_TERRATEC=m +CONFIG_RADIO_TRUST=m +CONFIG_RADIO_TYPHOON=m +# CONFIG_RADIO_TYPHOON_PROC_FS is not set +CONFIG_RADIO_ZOLTRIX=m +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +CONFIG_RESOURCES_64BIT=y +CONFIG_RFD_FTL=m +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +# CONFIG_RIO is not set +CONFIG_ROADRUNNER=m +# CONFIG_ROADRUNNER_LARGE_RINGS is not set +CONFIG_ROCKETPORT=m +CONFIG_ROMFS_FS=m +CONFIG_ROSE=m +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT2X00=m +# CONFIG_RT2X00_DEBUG is not set +CONFIG_RT2X00_LIB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT73USB=m +CONFIG_RTC=y +CONFIG_RTC_CLASS=m +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_TEST=m +CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=m +CONFIG_RTL8187=m +CONFIG_RXKAD=m +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +CONFIG_SATA_AHCI=m +CONFIG_SATA_INIC162X=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_SVW=m +CONFIG_SATA_SX4=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SBC8360_WDT=m +CONFIG_SBC_EPX_C3_WATCHDOG=m +CONFIG_SBNI=m +# CONFIG_SBNI_MULTILINE is not set +CONFIG_SC1200_WDT=m +CONFIG_SC520_WDT=m +CONFIG_SC92031=m +CONFIG_SCC=m +# CONFIG_SCC_DELAY is not set +# CONFIG_SCC_TRXECHO is not set +CONFIG_SCHED_MC=y +CONFIG_SCHED_SMT=y +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_7000FASST=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_AHA152X=m +CONFIG_SCSI_AHA1542=m +CONFIG_SCSI_AHA1740=m +CONFIG_SCSI_AIC79XX=m +CONFIG_SCSI_AIC7XXX=m +CONFIG_SCSI_AIC94XX=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_DC395x=m +CONFIG_SCSI_DEBUG=m +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_DPT_I2O=m +CONFIG_SCSI_DTC3280=m +CONFIG_SCSI_EATA=m +CONFIG_SCSI_EATA_LINKED_COMMANDS=y +CONFIG_SCSI_EATA_MAX_TAGS=16 +CONFIG_SCSI_EATA_TAGGED_QUEUE=y +CONFIG_SCSI_FC_TGT_ATTRS=y +CONFIG_SCSI_FD_MCS=m +CONFIG_SCSI_FUTURE_DOMAIN=m +CONFIG_SCSI_GDTH=m +CONFIG_SCSI_GENERIC_NCR5380=m +CONFIG_SCSI_GENERIC_NCR5380_MMIO=m +CONFIG_SCSI_GENERIC_NCR53C400=y +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_IBMMCA=m +CONFIG_SCSI_IMM=m +CONFIG_SCSI_IN2000=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_DUMP is not set +# CONFIG_SCSI_IPR_TRACE is not set +CONFIG_SCSI_IPS=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_NCR53C406A=m +CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8 +CONFIG_SCSI_NCR53C8XX_MAX_TAGS=4 +CONFIG_SCSI_NCR53C8XX_SYNC=5 +CONFIG_SCSI_NCR_D700=m +CONFIG_SCSI_NCR_Q720=m +CONFIG_SCSI_NSP32=m +CONFIG_SCSI_PAS16=m +CONFIG_SCSI_PPA=m +CONFIG_SCSI_PSI240I=m +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_QLOGIC_FAS=m +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_SEAGATE=m +CONFIG_SCSI_SIM710=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C416=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_T128=m +CONFIG_SCSI_TGT=m +CONFIG_SCSI_U14_34F=m +CONFIG_SCSI_U14_34F_LINKED_COMMANDS=y +CONFIG_SCSI_U14_34F_MAX_TAGS=8 +CONFIG_SCSI_U14_34F_TAGGED_QUEUE=y +CONFIG_SCSI_ULTRASTOR=m +CONFIG_SCx200=m +CONFIG_SCx200HR_TIMER=m +CONFIG_SCx200_ACB=m +CONFIG_SCx200_GPIO=m +CONFIG_SCx200_I2C=m +CONFIG_SCx200_I2C_SCL=12 +CONFIG_SCx200_I2C_SDA=13 +CONFIG_SCx200_WDT=m +CONFIG_SDIO_UART=m +CONFIG_SDLA=m +CONFIG_SEALEVEL_4021=m +CONFIG_SEEQ8005=m +CONFIG_SENSORS_ABITUGURU=m +CONFIG_SENSORS_ABITUGURU3=m +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_APPLESMC=m +CONFIG_SENSORS_ASB100=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_CORETEMP=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_FSCHER=m +CONFIG_SENSORS_FSCHMD=m +CONFIG_SENSORS_FSCPOS=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_HDAPS=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_K8TEMP=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SERIAL_8250_ACCENT=m +CONFIG_SERIAL_8250_BOCA=m +CONFIG_SERIAL_8250_CS=m +CONFIG_SERIAL_8250_EXAR_ST16C554=m +CONFIG_SERIAL_8250_FOURPORT=m +CONFIG_SERIAL_8250_HUB6=m +CONFIG_SERIAL_8250_MCA=m +CONFIG_SERIAL_JSM=m +CONFIG_SERIAL_NONSTANDARD=y +CONFIG_SERIO_CT82C710=m +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SGI_IOC4=m +CONFIG_SIGMATEL_FIR=m +CONFIG_SIS190=m +CONFIG_SIS900=m +CONFIG_SKFP=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKISA=m +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +CONFIG_SMC9194=m +CONFIG_SMCTR=m +CONFIG_SMC_IRCC_FIR=m +CONFIG_SMP=y +CONFIG_SMSC37B787_WDT=m +CONFIG_SMSC_PHY=m +# CONFIG_SND is not set +CONFIG_SONYPI=m +CONFIG_SONYPI_COMPAT=y +CONFIG_SONY_LAPTOP=m +# CONFIG_SOUND_PRIME is not set +CONFIG_SPECIALIX=m +# CONFIG_SPECIALIX_RTSCTS is not set +CONFIG_SPI=y +CONFIG_SPI_AT25=m +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_LM70_LLP=m +CONFIG_SPI_MASTER=y +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_SSB_DRIVER_PCICORE=y +# CONFIG_SSB_PCMCIAHOST is not set +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +CONFIG_SSFDC=m +CONFIG_STALDRV=y +CONFIG_STOP_MACHINE=y +CONFIG_STRIP=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_SUNGEM=m +CONFIG_SUNRPC_XPRT_RDMA=m +CONFIG_SUSPEND_SMP_POSSIBLE=y +CONFIG_SX=m +CONFIG_SYNCLINK=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_CS=m +CONFIG_SYNCLINK_GT=m +CONFIG_SYSV68_PARTITION=y +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_TCG_ATMEL=m +CONFIG_TCG_INFINEON=m +CONFIG_TCG_NSC=m +CONFIG_TCG_TIS=m +CONFIG_TCG_TPM=m +CONFIG_TCIC=m +CONFIG_TEKRAM_DONGLE=m +CONFIG_TELCLOCK=m +CONFIG_THINKPAD_ACPI=m +CONFIG_THINKPAD_ACPI_BAY=y +# CONFIG_THINKPAD_ACPI_DEBUG is not set +CONFIG_TIFM_7XX1=m +CONFIG_TIFM_CORE=m +CONFIG_TIGON3=m +CONFIG_TLAN=m +# CONFIG_TMD_HERMES is not set +CONFIG_TMS380TR=m +CONFIG_TMSPCI=m +# CONFIG_TOIM3232_DONGLE is not set +CONFIG_TOSHIBA=m +CONFIG_TOSHIBA_FIR=m +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_ELO=m +CONFIG_TOUCHSCREEN_FUJITSU=m +CONFIG_TOUCHSCREEN_GUNZE=m +CONFIG_TOUCHSCREEN_MK712=m +CONFIG_TOUCHSCREEN_MTOUCH=m +CONFIG_TOUCHSCREEN_PENMOUNT=m +CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +CONFIG_TOUCHSCREEN_TOUCHWIN=m +CONFIG_TOUCHSCREEN_UCB1400=m +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TR=y +CONFIG_TUNER_3036=m +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_SIMPLE=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TYPHOON=m +CONFIG_ULI526X=m +CONFIG_ULTRA=m +CONFIG_ULTRA32=m +CONFIG_ULTRAMCA=m +CONFIG_USBPCWATCHDOG=m +CONFIG_USB_ACM=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_ARMLINUX=y +CONFIG_USB_ATM=m +CONFIG_USB_AUERSWALD=m +CONFIG_USB_BELKIN=y +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_CATC=m +CONFIG_USB_CXACRU=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_DABUSB=m +CONFIG_USB_DSBR=m +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EMI26=m +CONFIG_USB_EMI62=m +CONFIG_USB_EPSON2888=y +CONFIG_USB_ET61X251=m +CONFIG_USB_ETH=m +CONFIG_USB_ETH_RNDIS=y +CONFIG_USB_EZUSB=y +CONFIG_USB_FILE_STORAGE=m +# CONFIG_USB_FILE_STORAGE_TEST is not set +CONFIG_USB_FTDI_ELAN=m +CONFIG_USB_GADGET=m +CONFIG_USB_GADGETFS=m +# CONFIG_USB_GADGET_AMD5536UDC is not set +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_DUALSPEED=y +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_M66592 is not set +CONFIG_USB_GADGET_NET2280=y +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_S3C2410 is not set +CONFIG_USB_GADGET_SELECTED=y +CONFIG_USB_G_SERIAL=m +CONFIG_USB_HID=m +CONFIG_USB_HIDDEV=y +CONFIG_USB_HIDINPUT_POWERBOOK=y +CONFIG_USB_IBMCAM=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_IOWARRIOR=m +CONFIG_USB_IRDA=m +CONFIG_USB_KAWETH=m +CONFIG_USB_KBD=m +CONFIG_USB_KC2190=y +CONFIG_USB_KONICAWC=m +CONFIG_USB_LCD=m +CONFIG_USB_LD=m +CONFIG_USB_LED=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LIBUSUAL=y +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +# CONFIG_USB_MIDI_GADGET is not set +CONFIG_USB_MON=y +CONFIG_USB_MOUSE=m +CONFIG_USB_NET2280=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_RNDIS_HOST=m +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_HCD=m +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OV511 is not set +CONFIG_USB_PEGASUS=m +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_PRINTER=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_RIO500=m +CONFIG_USB_RTL8150=m +CONFIG_USB_SE401=m +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IPW=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_SL811_CS=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SN9C102=m +CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STV680=m +CONFIG_USB_SUSPEND=y +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_UEAGLEATM=m +CONFIG_USB_USBNET=m +CONFIG_USB_USS720=m +CONFIG_USB_VICAM=m +CONFIG_USB_W9968CF=m +CONFIG_USB_XUSBATM=m +CONFIG_USB_ZC0301=m +CONFIG_USB_ZD1201=m +CONFIG_USB_ZERO=m +CONFIG_USB_ZR364XX=m +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-server" +CONFIG_VIA_FIR=m +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_VIA_VELOCITY=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m +# CONFIG_VIDEO_ADV_DEBUG is not set +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_CX2341X=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_CX25840=m +CONFIG_VIDEO_CX88=m +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_DEV=m +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_FB_IVTV=m +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_MEYE=m +CONFIG_VIDEO_MSP3400=m +# CONFIG_VIDEO_MXB is not set +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_VIDEO_PMS=m +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_29XXX=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_DVB=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_USBVIDEO=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_VP27SMPX=m +CONFIG_VIDEO_VPX3220=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_WM8775=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VITESSE_PHY=m +CONFIG_VLSI_FIR=m +CONFIG_VORTEX=m +CONFIG_W1_MASTER_DS2482=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_THERM=m +CONFIG_W83627HF_WDT=m +CONFIG_W83697HF_WDT=m +CONFIG_W83877F_WDT=m +CONFIG_W83977F_WDT=m +CONFIG_WAFER_WDT=m +CONFIG_WAN=y +CONFIG_WANXL=m +CONFIG_WAN_ROUTER=m +CONFIG_WAN_ROUTER_DRIVERS=m +CONFIG_WAVELAN=m +CONFIG_WD80x3=m +# CONFIG_WDC_ALI15X3 is not set +CONFIG_WDT=m +CONFIG_WDTPCI=m +CONFIG_WDT_501=y +CONFIG_WDT_501_PCI=y +CONFIG_WINBOND_840=m +CONFIG_WINBOND_FIR=m +CONFIG_WIRELESS_EXT=y +CONFIG_WLAN_80211=y +CONFIG_WLAN_PRE80211=y +CONFIG_X25=m +CONFIG_X25_ASY=m +CONFIG_X86_CMOV=y +CONFIG_X86_CPUFREQ_NFORCE2=m +CONFIG_X86_GOOD_APIC=y +CONFIG_X86_HT=y +CONFIG_X86_PAE=y +CONFIG_X86_SMP=y +CONFIG_X86_SPEEDSTEP_LIB=m +CONFIG_X86_SPEEDSTEP_SMI=m +CONFIG_X86_TRAMPOLINE=y +CONFIG_X86_TSC=y +CONFIG_X86_USE_PPRO_CHECKSUM=y +CONFIG_XEN=y +CONFIG_XEN_BLKDEV_FRONTEND=m +CONFIG_XEN_NETDEV_FRONTEND=m +CONFIG_YAM=m +CONFIG_YELLOWFIN=m +CONFIG_YENTA=m +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_ZNET=m --- linux-2.6.24.orig/debian/config/i386/config +++ linux-2.6.24/debian/config/i386/config @@ -0,0 +1,1319 @@ +# +# Common config options automatically generated by splitconfig.pl +# +# CONFIG_4KSTACKS is not set +# CONFIG_64BIT is not set +CONFIG_8139TOO=m +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_AC97_BUS=m +CONFIG_ACORN_PARTITION=y +# CONFIG_ACORN_PARTITION_ADFS is not set +# CONFIG_ACORN_PARTITION_CUMANA is not set +# CONFIG_ACORN_PARTITION_EESOX is not set +CONFIG_ACORN_PARTITION_ICS=y +# CONFIG_ACORN_PARTITION_POWERTEC is not set +CONFIG_ACORN_PARTITION_RISCIX=y +CONFIG_ACPI=y +CONFIG_ACPI_AC=m +CONFIG_ACPI_BLACKLIST_YEAR=2000 +CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_CUSTOM_DSDT_INITRD=y +# CONFIG_ACPI_DEBUG is not set +CONFIG_ACPI_EC=y +CONFIG_ACPI_FAN=m +CONFIG_ACPI_POWER=y +CONFIG_ACPI_PROCESSOR=m +CONFIG_ACPI_PROCFS=y +CONFIG_ACPI_PROCFS_POWER=y +CONFIG_ACPI_PROC_EVENT=y +CONFIG_ACPI_SLEEP=y +CONFIG_ACPI_SYSFS_POWER=y +CONFIG_ACPI_SYSTEM=y +CONFIG_ACPI_THERMAL=m +CONFIG_AGP=m +CONFIG_AGP_INTEL=m +CONFIG_AMIGA_PARTITION=y +CONFIG_ANON_INODES=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_ARCH_FLATMEM_ENABLE=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUPPORTS_MSI=y +CONFIG_ARCH_SUPPORTS_OPROFILE=y +# CONFIG_ARPD is not set +CONFIG_ASK_IP_FIB_HASH=y +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_ATA=m +CONFIG_ATALK=m +CONFIG_ATARI_PARTITION=y +CONFIG_ATA_ACPI=y +CONFIG_ATA_GENERIC=m +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_PIIX=m +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +# CONFIG_AUDIT_ARCH is not set +CONFIG_AUDIT_GENERIC=y +CONFIG_AUDIT_TREE=y +CONFIG_AUTOFS4_FS=m +CONFIG_AUTOFS_FS=m +CONFIG_AUXDISPLAY=y +CONFIG_BASE_FULL=y +CONFIG_BASE_SMALL=0 +CONFIG_BATTERY_DS2760=m +# CONFIG_BEFS_DEBUG is not set +CONFIG_BEFS_FS=m +CONFIG_BFS_FS=m +CONFIG_BINFMT_AOUT=m +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m +CONFIG_BITREVERSE=y +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_CRYPTOLOOP=m +# CONFIG_BLK_DEV_CS5520 is not set +CONFIG_BLK_DEV_DM=m +CONFIG_BLK_DEV_FD=m +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_HD_IDE is not set +CONFIG_BLK_DEV_IDECD=m +CONFIG_BLK_DEV_IDEDISK=m +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_JMICRON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_MD=m +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_PIIX is not set +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_SD=m +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_UB is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +CONFIG_BLOCK=y +CONFIG_BONDING=m +CONFIG_BOOT_IOREMAP=y +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_BOUNCE=y +CONFIG_BRIDGE=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_NETFILTER=y +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BSD_DISKLABEL=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_BUG=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_CGROUPS=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_CGROUP_DEBUG is not set +CONFIG_CGROUP_NS=y +CONFIG_CHR_DEV_SG=m +CONFIG_CIFS=m +# CONFIG_CIFS_DEBUG2 is not set +CONFIG_CIFS_EXPERIMENTAL=y +# CONFIG_CIFS_STATS is not set +CONFIG_CIFS_UPCALL=y +CONFIG_CIFS_WEAK_PW_HASH=y +# CONFIG_CIFS_XATTR is not set +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_CLS_U32_MARK=y +# CONFIG_CLS_U32_PERF is not set +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set +# CONFIG_COMPAT_VDSO is not set +CONFIG_CONFIGFS_FS=m +CONFIG_CONNECTOR=m +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_DEBUG is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CRAMFS=y +CONFIG_CRASH_DUMP=y +CONFIG_CRC16=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_CRC_CCITT=m +CONFIG_CRC_ITU_T=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_AES_586=m +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_DEV_GEODE=m +CONFIG_CRYPTO_DEV_PADLOCK_AES=m +CONFIG_CRYPTO_DEV_PADLOCK_SHA=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_586=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_XTS=m +CONFIG_DCA=m +CONFIG_DCDBAS=m +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_FS=y +# CONFIG_DEBUG_HIGHMEM is not set +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_DEBUG_MUTEXES is not set +CONFIG_DEBUG_RODATA=y +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_VM is not set +CONFIG_DECNET=m +# CONFIG_DECNET_ROUTER is not set +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_BIC is not set +# CONFIG_DEFAULT_CUBIC is not set +# CONFIG_DEFAULT_HTCP is not set +CONFIG_DEFAULT_IO_DELAY_TYPE=1 +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 +CONFIG_DEFAULT_RENO=y +CONFIG_DEFAULT_TCP_CONG="reno" +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_DELL_RBU=m +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_DEVPORT=y +CONFIG_DEV_APPLETALK=m +# CONFIG_DEV_KMEM is not set +# CONFIG_DISCONTIGMEM_MANUAL is not set +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_ENGINE=y +CONFIG_DMI=y +CONFIG_DMIID=y +CONFIG_DM_CRYPT=m +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_DELAY is not set +CONFIG_DM_MIRROR=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_MULTIPATH_HP=m +CONFIG_DM_MULTIPATH_RDAC=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_UEVENT=y +CONFIG_DM_ZERO=m +CONFIG_DNOTIFY=y +CONFIG_DOUBLEFAULT=y +CONFIG_DS1682=m +CONFIG_DUMMY=m +CONFIG_DUMMY_CONSOLE=y +CONFIG_E1000=m +CONFIG_E1000E=m +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000_NAPI=y +CONFIG_EARLY_PRINTK=y +CONFIG_ECRYPT_FS=m +CONFIG_EEPROM_93CX6=m +CONFIG_EFI=y +CONFIG_EFI_PARTITION=y +CONFIG_EFI_VARS=y +CONFIG_EFS_FS=m +CONFIG_ELF_CORE=y +CONFIG_EMBEDDED=y +# CONFIG_ENABLE_MUST_CHECK is not set +# CONFIG_ENABLE_WARN_DEPRECATED is not set +CONFIG_EPOLL=y +CONFIG_EQUALIZER=m +CONFIG_EVENTFD=y +CONFIG_EXPERIMENTAL=y +CONFIG_EXPORTFS=m +CONFIG_EXT2_FS=m +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_FAIR_CGROUP_SCHED=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_FAIR_USER_SCHED is not set +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_FAT_FS=m +# CONFIG_FAULT_INJECTION is not set +CONFIG_FB=y +CONFIG_FB_ARC=m +CONFIG_FB_ASILIANT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +CONFIG_FB_CIRRUS=m +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_EFI=y +CONFIG_FB_IMSTT=y +# CONFIG_FB_MACMODES is not set +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_SYS_COPYAREA=m +CONFIG_FB_SYS_FILLRECT=m +CONFIG_FB_SYS_FOPS=m +CONFIG_FB_SYS_IMAGEBLIT=m +CONFIG_FB_TILEBLITTING=y +CONFIG_FB_UVESA=m +CONFIG_FB_VESA=m +CONFIG_FB_VGA16=m +# CONFIG_FB_VIRTUAL is not set +CONFIG_FIB_RULES=y +# CONFIG_FIREWIRE is not set +CONFIG_FIRMWARE_EDID=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FLATMEM=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x16=y +CONFIG_FONT_8x8=y +# CONFIG_FORCED_INLINING is not set +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FRAME_POINTER is not set +CONFIG_FS_MBCACHE=m +CONFIG_FS_POSIX_ACL=y +CONFIG_FUSE_FS=m +CONFIG_FUSION=y +CONFIG_FUSION_CTL=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_SAS=m +CONFIG_FUSION_SPI=m +CONFIG_FUTEX=y +CONFIG_FW_LOADER=y +CONFIG_GACT_PROB=y +CONFIG_GAMEPORT=m +CONFIG_GENERIC_ACL=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CMOS_UPDATE=y +# CONFIG_GENERIC_CPU is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_TIME=y +# CONFIG_GENERIC_TIME_VSYSCALL is not set +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_HANGCHECK_TIMER=m +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAVE_KVM=y +# CONFIG_HEADERS_CHECK is not set +CONFIG_HFSPLUS_FS=m +CONFIG_HFS_FS=m +CONFIG_HIBERNATION=y +CONFIG_HID_SUPPORT=y +CONFIG_HIGHMEM=y +CONFIG_HIGHPTE=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_HOTPLUG=y +CONFIG_HPET=y +CONFIG_HPET_MMAP=y +# CONFIG_HPET_RTC_IRQ is not set +CONFIG_HPET_TIMER=y +CONFIG_HPFS_FS=m +CONFIG_HT_IRQ=y +CONFIG_HVC_DRIVER=y +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM_INTEL=m +# CONFIG_HZ_1000 is not set +# CONFIG_HZ_300 is not set +CONFIG_I2C=m +CONFIG_I2C_ALGOBIT=m +CONFIG_I2C_ALGOPCA=m +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set +# CONFIG_I2C_DEBUG_CORE is not set +CONFIG_I2C_PIIX4=m +CONFIG_I2C_TAOS_EVM=m +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +CONFIG_ICPLUS_PHY=m +CONFIG_IDE=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEPCI_PCIBUS_ORDER is not set +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_IDE_ARM is not set +CONFIG_IDE_GENERIC=m +CONFIG_IDE_MAX_HWIFS=4 +# CONFIG_IDE_TASK_IOCTL is not set +CONFIG_IFB=m +# CONFIG_IKCONFIG is not set +CONFIG_INET=y +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET_AH=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_INET_DIAG=y +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_LRO=m +CONFIG_INET_TCP_DIAG=y +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_INPUT=y +CONFIG_INPUT_EVBUG=m +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_MISC=y +CONFIG_INPUT_MOUSE=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_PCSPKR=m +CONFIG_INSTRUMENTATION=y +CONFIG_INTEL_IOATDMA=m +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_CFQ=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_NOOP=y +# CONFIG_IO_DELAY_0X80 is not set +CONFIG_IO_DELAY_0XED=y +# CONFIG_IO_DELAY_NONE is not set +CONFIG_IO_DELAY_TYPE_0X80=0 +CONFIG_IO_DELAY_TYPE_0XED=1 +CONFIG_IO_DELAY_TYPE_NONE=3 +CONFIG_IO_DELAY_TYPE_UDELAY=2 +# CONFIG_IO_DELAY_UDELAY is not set +CONFIG_IP1000=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_RAW=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IPDDP=m +CONFIG_IPDDP_DECAP=y +CONFIG_IPDDP_ENCAP=y +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_HANDLER=m +# CONFIG_IPMI_PANIC_EVENT is not set +CONFIG_IPMI_POWEROFF=m +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m +CONFIG_IPV6=m +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +CONFIG_IPX=m +# CONFIG_IPX_INTERN is not set +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_DCCP=m +CONFIG_IP_DCCP_ACKVEC=y +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_IP_DCCP_TFRC_LIB=m +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_MROUTE=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARP_MANGLE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +# CONFIG_IP_PNP is not set +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +CONFIG_IP_SCTP=m +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_FTP=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_NQ=m +CONFIG_IP_VS_PROTO_AH=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_TAB_BITS=12 +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_WRR=m +CONFIG_ISA_DMA_API=y +CONFIG_ISCSI_TCP=m +CONFIG_ISO9660_FS=m +CONFIG_IT8712F_WDT=m +CONFIG_ITCO_VENDOR_SUPPORT=y +CONFIG_ITCO_WDT=m +CONFIG_IXGBE=m +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +# CONFIG_JFS_DEBUG is not set +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +CONFIG_JFS_STATISTICS=y +CONFIG_JOLIET=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_KARMA_PARTITION=y +CONFIG_KEXEC=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +CONFIG_KMOD=y +CONFIG_KPROBES=y +CONFIG_KTIME_SCALAR=y +CONFIG_LBD=y +# CONFIG_LDM_DEBUG is not set +CONFIG_LDM_PARTITION=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBCRC32C=m +# CONFIG_LKDTM is not set +CONFIG_LLC2=m +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_LOCKD=m +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_LOCKD_V4=y +# CONFIG_LOCK_STAT is not set +# CONFIG_LOGO is not set +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_LP_CONSOLE is not set +# CONFIG_LSF is not set +CONFIG_LSM_MMAP_MIN_ADDR=0 +# CONFIG_M386 is not set +# CONFIG_M586MMX is not set +# CONFIG_M586TSC is not set +CONFIG_MACVLAN=m +CONFIG_MAC_PARTITION=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_MARKERS is not set +CONFIG_MAX_RAW_DEVS=256 +# CONFIG_MCORE2 is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MCYRIXIII is not set +CONFIG_MD=y +CONFIG_MDIO_BITBANG=m +CONFIG_MD_FAULTY=m +CONFIG_MD_LINEAR=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +# CONFIG_MEFFICEON is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +CONFIG_MICROCODE=m +CONFIG_MICROCODE_OLD_INTERFACE=y +CONFIG_MII=m +CONFIG_MINIX_SUBPARTITION=y +CONFIG_MISC_DEVICES=y +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +CONFIG_MMU=y +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MOUSE_PS2=m +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +# CONFIG_MPENTIUM4 is not set +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MPSC is not set +CONFIG_MSDOS_FS=m +CONFIG_MSDOS_PARTITION=y +# CONFIG_MSS is not set +CONFIG_MTRR=y +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set +# CONFIG_MWINCHIP2 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MWINCHIPC6 is not set +CONFIG_NE2K_PCI=m +CONFIG_NET=y +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETDEVICES=y +CONFIG_NETDEVICES_MULTIQUEUE=y +CONFIG_NETDEV_1000=y +CONFIG_NETDEV_10000=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NETWORK_SECMARK=y +CONFIG_NET_9P=m +# CONFIG_NET_9P_DEBUG is not set +CONFIG_NET_9P_FD=m +CONFIG_NET_9P_VIRTIO=m +CONFIG_NET_ACT_GACT=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_CLS=y +CONFIG_NET_CLS_ACT=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_FW=m +# CONFIG_NET_CLS_IND is not set +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_U32=m +CONFIG_NET_DMA=y +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_ETHERNET=y +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_NET_IPIP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_NET_PCI=y +CONFIG_NET_PKTGEN=m +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_NET_SB1000=m +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_FIFO=y +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_TULIP=y +CONFIG_NFSD=m +CONFIG_NFSD_TCP=y +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CT_NETLINK=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NIU=m +CONFIG_NLS=y +CONFIG_NLS_ASCII=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m +# CONFIG_NOHIGHMEM is not set +CONFIG_NONPROMISC_DEVMEM=y +CONFIG_NR_QUICK=1 +# CONFIG_NTFS_DEBUG is not set +CONFIG_NTFS_FS=m +CONFIG_NVRAM=m +# CONFIG_OCFS2_DEBUG_FS is not set +CONFIG_OCFS2_DEBUG_MASKLOG=y +CONFIG_OCFS2_FS=m +CONFIG_OPROFILE=m +CONFIG_OSF_PARTITION=y +CONFIG_PACKET=m +CONFIG_PACKET_MMAP=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PARAVIRT=y +CONFIG_PARAVIRT_GUEST=y +CONFIG_PARPORT=m +CONFIG_PARPORT_1284=y +# CONFIG_PARPORT_GSC is not set +CONFIG_PARPORT_PC=m +# CONFIG_PARPORT_PC_SUPERIO is not set +CONFIG_PARTITION_ADVANCED=y +CONFIG_PATA_ACPI=m +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +CONFIG_PATA_ARTOP=m +CONFIG_PATA_ATIIXP=m +# CONFIG_PATA_CMD640_PCI is not set +CONFIG_PATA_CMD64X=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5535 is not set +CONFIG_PATA_CS5536=m +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_HPT366=m +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +CONFIG_PATA_HPT3X3=m +# CONFIG_PATA_HPT3X3_DMA is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC_OLD is not set +CONFIG_PATA_PLATFORM=m +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_VIA=m +CONFIG_PCI=y +CONFIG_PCI_BIOS=y +# CONFIG_PCI_DEBUG is not set +CONFIG_PCI_DIRECT=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_GOANY=y +# CONFIG_PCI_GOBIOS is not set +# CONFIG_PCI_GODIRECT is not set +# CONFIG_PCI_GOMMCONFIG is not set +CONFIG_PCI_LEGACY=y +CONFIG_PCI_MMCONFIG=y +CONFIG_PCI_MSI=y +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_PDA_POWER=m +CONFIG_PHYLIB=m +CONFIG_PHYSICAL_ALIGN=0x100000 +CONFIG_PHYSICAL_START=0x100000 +# CONFIG_PID_NS is not set +CONFIG_PLIST=y +CONFIG_PM=y +CONFIG_PM_DEBUG=y +CONFIG_PM_DISABLE_CONSOLE=y +CONFIG_PM_LEGACY=y +CONFIG_PM_SLEEP=y +CONFIG_PM_STD_PARTITION="" +CONFIG_PM_TRACE=y +# CONFIG_PM_VERBOSE is not set +CONFIG_PNP=y +CONFIG_PNPACPI=y +# CONFIG_PNP_DEBUG is not set +CONFIG_POSIX_MQUEUE=y +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_PPDEV=m +CONFIG_PPP=m +CONFIG_PPPOE=m +CONFIG_PPPOL2TP=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_SYNC_TTY=m +# CONFIG_PREEMPT is not set +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_PRINTER=m +CONFIG_PRINTK=y +CONFIG_PRINTK_TIME=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_VMCORE=y +CONFIG_PROFILING=y +# CONFIG_PROVE_LOCKING is not set +CONFIG_QFMT_V1=m +CONFIG_QFMT_V2=m +CONFIG_QNX4FS_FS=m +CONFIG_QUICKLIST=y +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +CONFIG_RAID_ATTRS=m +CONFIG_RAW_DRIVER=m +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_REISERFS_CHECK is not set +CONFIG_REISERFS_FS=m +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_REISERFS_FS_XATTR=y +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_RELAY=y +CONFIG_RELOCATABLE=y +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_RT_MUTEXES=y +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SAMPLES is not set +CONFIG_SBC7240_WDT=m +# CONFIG_SCHEDSTATS is not set +CONFIG_SCHED_DEBUG=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_SCSI=m +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_BUSLOGIC=m +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_DMA=y +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_ISCSI_ATTRS=m +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_LOWLEVEL=y +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_NETLINK=y +# CONFIG_SCSI_OMIT_FLASHPOINT is not set +CONFIG_SCSI_PROC_FS=y +CONFIG_SCSI_QLOGIC_1280=m +CONFIG_SCSI_SAS_ATA=y +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_WAIT_SCAN=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +CONFIG_SCTP_HMAC_MD5=y +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SECCOMP=y +CONFIG_SECURITY=y +CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 +# CONFIG_SECURITY_APPARMOR_DISABLE is not set +CONFIG_SECURITY_CAPABILITIES=y +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_SECURITY_NETWORK=y +# CONFIG_SECURITY_NETWORK_XFRM is not set +CONFIG_SECURITY_SELINUX=y +CONFIG_SECURITY_SELINUX_AVC_STATS=y +CONFIG_SECURITY_SELINUX_BOOTPARAM=y +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 +CONFIG_SECURITY_SELINUX_DEVELOP=y +CONFIG_SECURITY_SELINUX_DISABLE=y +# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set +# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_SEMAPHORE_SLEEPERS=y +CONFIG_SENSORS_TSL2550=m +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_NR_UARTS=48 +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_PNP=y +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=m +CONFIG_SERIO_SERPORT=m +CONFIG_SGI_PARTITION=y +CONFIG_SHAPER=m +CONFIG_SHMEM=y +CONFIG_SIGNALFD=y +# CONFIG_SK98LIN is not set +# CONFIG_SLAB is not set +CONFIG_SLABINFO=y +CONFIG_SLHC=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +CONFIG_SLIP_MODE_SLIP6=y +CONFIG_SLIP_SMART=y +# CONFIG_SLOB is not set +CONFIG_SLUB=y +CONFIG_SLUB_DEBUG=y +# CONFIG_SLUB_DEBUG_ON is not set +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +CONFIG_SOFT_WATCHDOG=m +CONFIG_SOLARIS_X86_PARTITION=y +CONFIG_SOUND=m +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_SPARSEMEM_STATIC=y +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_SSB=m +CONFIG_SSB_DEBUG=y +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCIHOST_POSSIBLE=y +CONFIG_SSB_POSSIBLE=y +# CONFIG_SSB_SILENT is not set +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_STANDALONE=y +CONFIG_SUNRPC=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_SUNRPC_GSS=m +CONFIG_SUN_PARTITION=y +CONFIG_SUSPEND=y +CONFIG_SWAP=y +CONFIG_SYN_COOKIES=y +CONFIG_SYSCTL=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_SYSFS=y +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_SYSV_FS=m +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_TASK_XACCT=y +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=m +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_ILLINOIS=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_MD5SIG=y +CONFIG_TEHUTI=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TICK_ONESHOT=y +CONFIG_TIMER_STATS=y +# CONFIG_TINY_SHMEM is not set +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_TULIP=m +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_NAPI is not set +CONFIG_TUN=m +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_UFS_DEBUG is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +CONFIG_UID16=y +CONFIG_UIO=m +CONFIG_UIO_CIF=m +CONFIG_ULTRIX_PARTITION=y +CONFIG_UNIX=y +CONFIG_UNIX98_PTYS=y +CONFIG_UNIXWARE_DISKLABEL=y +CONFIG_UNUSED_SYMBOLS=y +CONFIG_USB=m +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_USB_DEBUG is not set +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_ISP116X_HCD=m +# CONFIG_USB_OTG is not set +CONFIG_USB_PERSIST=y +CONFIG_USB_R8A66597_HCD=m +CONFIG_USB_STORAGE=m +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_SUPPORT=y +# CONFIG_USB_TEST is not set +CONFIG_USB_UHCI_HCD=m +# CONFIG_USER_NS is not set +CONFIG_VETH=m +CONFIG_VFAT_FS=m +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +CONFIG_VGASTATE=m +CONFIG_VGA_CONSOLE=y +CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_VIDEO_SELECT=y +CONFIG_VIRTIO=m +CONFIG_VIRTIO_BALLOON=m +CONFIG_VIRTIO_BLK=m +CONFIG_VIRTIO_NET=m +CONFIG_VIRTIO_PCI=m +CONFIG_VIRTIO_RING=m +CONFIG_VIRTUALIZATION=y +CONFIG_VIRT_TO_BUS=y +CONFIG_VLAN_8021Q=m +CONFIG_VM86=y +CONFIG_VMI=y +# CONFIG_VMSPLIT_1G is not set +# CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_2G_OPT is not set +CONFIG_VMSPLIT_3G=y +# CONFIG_VMSPLIT_3G_OPT is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_VXFS_FS=m +CONFIG_W1=m +CONFIG_W1_CON=y +CONFIG_W1_SLAVE_DS2760=m +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set +# CONFIG_WRAPPER_PRINT is not set +CONFIG_X86=y +CONFIG_X86_32=y +# CONFIG_X86_64 is not set +CONFIG_X86_ACPI_CPUFREQ=m +# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set +# CONFIG_X86_BIGSMP is not set +CONFIG_X86_BIOS_REBOOT=y +CONFIG_X86_BSWAP=y +CONFIG_X86_CMPXCHG=y +CONFIG_X86_CPUID=m +# CONFIG_X86_ELAN is not set +# CONFIG_X86_ES7000 is not set +# CONFIG_X86_E_POWERSAVER is not set +CONFIG_X86_FIND_SMP_CONFIG=y +CONFIG_X86_GENERIC=y +# CONFIG_X86_GENERICARCH is not set +CONFIG_X86_GX_SUSPMOD=m +CONFIG_X86_INTEL_USERCOPY=y +CONFIG_X86_INVLPG=y +CONFIG_X86_IO_APIC=y +CONFIG_X86_L1_CACHE_SHIFT=7 +CONFIG_X86_LOCAL_APIC=y +CONFIG_X86_LONGHAUL=m +CONFIG_X86_LONGRUN=m +# CONFIG_X86_MCE is not set +CONFIG_X86_MINIMUM_CPU_FAMILY=4 +CONFIG_X86_MPPARSE=y +CONFIG_X86_MSR=m +# CONFIG_X86_NUMAQ is not set +CONFIG_X86_P4_CLOCKMOD=m +CONFIG_X86_PC=y +CONFIG_X86_PM_TIMER=y +CONFIG_X86_POPAD_OK=y +CONFIG_X86_POWERNOW_K6=m +CONFIG_X86_POWERNOW_K7=m +CONFIG_X86_POWERNOW_K7_ACPI=y +CONFIG_X86_POWERNOW_K8=m +CONFIG_X86_POWERNOW_K8_ACPI=y +CONFIG_X86_PPRO_FENCE=y +CONFIG_X86_REBOOTFIXUPS=y +CONFIG_X86_SPEEDSTEP_CENTRINO=m +CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y +CONFIG_X86_SPEEDSTEP_ICH=m +CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK=y +# CONFIG_X86_SUMMIT is not set +# CONFIG_X86_VISWS is not set +# CONFIG_X86_VOYAGER is not set +# CONFIG_X86_VSMP is not set +CONFIG_X86_WP_WORKS_OK=y +CONFIG_X86_XADD=y +CONFIG_XFRM=y +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_SUB_POLICY is not set +CONFIG_XFRM_USER=m +CONFIG_XFS_FS=m +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_QUOTA=y +CONFIG_XFS_RT=y +CONFIG_XFS_SECURITY=y +CONFIG_XOR_BLOCKS=m +CONFIG_ZISOFS=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZONE_DMA=y +# CONFIG_ZONE_DMA32 is not set +CONFIG_ZONE_DMA_FLAG=1 --- linux-2.6.24.orig/debian/config/i386/config.virtual +++ linux-2.6.24/debian/config/i386/config.virtual @@ -0,0 +1,665 @@ +# +# Config options for config.virtual automatically generated by splitconfig.pl +# +# CONFIG_60XX_WDT is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO_8129 is not set +# CONFIG_9P_FS is not set +# CONFIG_ACENIC is not set +# CONFIG_ACPI_ASUS is not set +# CONFIG_ACPI_BATTERY is not set +# CONFIG_ACPI_DOCK is not set +CONFIG_ACPI_HOTPLUG_CPU=y +# CONFIG_ACPI_SBS is not set +# CONFIG_ACPI_TOSHIBA is not set +# CONFIG_ACQUIRE_WDT is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADVANTECH_WDT is not set +CONFIG_AEDSP16_MSS=y +# CONFIG_AEDSP16_SBPRO is not set +# CONFIG_AFFS_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_AF_RXRPC is not set +# CONFIG_AGP_ALI is not set +# CONFIG_AGP_AMD is not set +# CONFIG_AGP_AMD64 is not set +# CONFIG_AGP_ATI is not set +# CONFIG_AGP_EFFICEON is not set +# CONFIG_AGP_NVIDIA is not set +# CONFIG_AGP_SIS is not set +# CONFIG_AGP_SWORKS is not set +# CONFIG_AGP_VIA is not set +# CONFIG_ALIM1535_WDT is not set +# CONFIG_ALIM7101_WDT is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_APM is not set +# CONFIG_APPLICOM is not set +# CONFIG_ARCNET is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_ATL1 is not set +# CONFIG_ATM is not set +# CONFIG_B44 is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_ATIIXP is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_CS5535 is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +CONFIG_BLK_DEV_IDE=y +# CONFIG_BLK_DEV_IDEACPI is not set +# CONFIG_BLK_DEV_IDEDMA is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDEPNP is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_TC86C001 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BNX2 is not set +# CONFIG_BROADCOM_PHY is not set +# CONFIG_BT is not set +# CONFIG_CASSINI is not set +# CONFIG_CFG80211 is not set +# CONFIG_CHELSIO_T1 is not set +# CONFIG_CHELSIO_T3 is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_CPU5_WDT is not set +CONFIG_CPUSETS=y +CONFIG_CPU_FREQ_TABLE=y +CONFIG_CPU_IDLE_GOV_MENU=y +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CRYPTD is not set +CONFIG_CRYPTO_DEV_PADLOCK=m +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CS5535_GPIO is not set +# CONFIG_DAB is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_DE2104X is not set +# CONFIG_DE4X5 is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DECNET_NF_GRABULATOR is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_DISPLAY_SUPPORT is not set +# CONFIG_DL2K is not set +# CONFIG_DM9102 is not set +# CONFIG_DRM is not set +# CONFIG_DVB_CORE is not set +# CONFIG_E100 is not set +# CONFIG_ECONET is not set +# CONFIG_EDAC is not set +# CONFIG_EDD is not set +# CONFIG_EEPRO100 is not set +# CONFIG_EPIC100 is not set +# CONFIG_EUROTECH_WDT is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_CYBLA is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_GEODE is not set +# CONFIG_FB_HECUBA is not set +# CONFIG_FB_HGA is not set +# CONFIG_FB_I810 is not set +# CONFIG_FB_IMAC is not set +# CONFIG_FB_INTEL is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_LE80578 is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FDDI is not set +# CONFIG_FEALNX is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_FORCEDETH is not set +# CONFIG_FUSION_LOGGING is not set +# CONFIG_GAMEPORT_EMU10K1 is not set +# CONFIG_GAMEPORT_FM801 is not set +# CONFIG_GAMEPORT_L4 is not set +# CONFIG_GAMEPORT_NS558 is not set +CONFIG_GENERIC_PENDING_IRQ=y +# CONFIG_HAMACHI is not set +# CONFIG_HAMRADIO is not set +# CONFIG_HAPPYMEAL is not set +CONFIG_HIBERNATION_SMP_POSSIBLE=y +# CONFIG_HID is not set +CONFIG_HIGHMEM4G=y +# CONFIG_HIGHMEM64G is not set +# CONFIG_HIPPI is not set +CONFIG_HOTPLUG_CPU=y +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_HP100 is not set +CONFIG_HPET_EMULATE_RTC=y +# CONFIG_HUGETLBFS is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_HWMON is not set +CONFIG_HW_RANDOM=m +# CONFIG_HW_RANDOM_AMD is not set +# CONFIG_HW_RANDOM_GEODE is not set +# CONFIG_HW_RANDOM_VIA is not set +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PARPORT is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_TINY_USB is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2O is not set +# CONFIG_I6300ESB_WDT is not set +# CONFIG_I8K is not set +# CONFIG_IB700_WDT is not set +# CONFIG_IBMASR is not set +# CONFIG_IBM_ASM is not set +# CONFIG_IDE_PROC_FS is not set +# CONFIG_IEEE1394 is not set +# CONFIG_IEEE80211 is not set +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +# CONFIG_INFINIBAND is not set +# CONFIG_INPUT_ATI_REMOTE is not set +# CONFIG_INPUT_ATI_REMOTE2 is not set +# CONFIG_INPUT_ATLAS_BTNS is not set +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_KEYSPAN_REMOTE is not set +# CONFIG_INPUT_POLLDEV is not set +# CONFIG_INPUT_POWERMATE is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_UINPUT is not set +# CONFIG_INPUT_WISTRON_BTNS is not set +# CONFIG_INPUT_YEALINK is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IP_NF_TARGET_CLUSTERIP is not set +# CONFIG_IRDA is not set +# CONFIG_IRQBALANCE is not set +# CONFIG_ISA is not set +# CONFIG_ISDN is not set +# CONFIG_IXGB is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KS0108 is not set +# CONFIG_KVM is not set +# CONFIG_LAPB is not set +CONFIG_LGUEST=m +# CONFIG_LGUEST_GUEST is not set +CONFIG_LLC=m +CONFIG_LOCK_KERNEL=y +# CONFIG_LXT_PHY is not set +# CONFIG_M486 is not set +CONFIG_M586=y +# CONFIG_M686 is not set +# CONFIG_MAC80211 is not set +# CONFIG_MACHZ_WDT is not set +# CONFIG_MACINTOSH_DRIVERS is not set +# CONFIG_MARVELL_PHY is not set +# CONFIG_MATH_EMULATION is not set +# CONFIG_MCA is not set +# CONFIG_MD_RAID10 is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_MINIX_FS is not set +# CONFIG_MLX4_CORE is not set +# CONFIG_MMC is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_PS2_ALPS is not set +# CONFIG_MOUSE_PS2_LIFEBOOK is not set +# CONFIG_MOUSE_PS2_LOGIPS2PP is not set +# CONFIG_MOUSE_PS2_SYNAPTICS is not set +# CONFIG_MOUSE_PS2_TRACKPOINT is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin" +CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin" +CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin" +CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin" +# CONFIG_MTD is not set +# CONFIG_MWAVE is not set +# CONFIG_MYRI10GE is not set +# CONFIG_NATSEMI is not set +# CONFIG_NCP_FS is not set +# CONFIG_NETLABEL is not set +# CONFIG_NETXEN_NIC is not set +CONFIG_NET_ACT_POLICE=y +# CONFIG_NET_ACT_SIMP is not set +CONFIG_NET_CLS_POLICE=y +# CONFIG_NET_DCCPPROBE is not set +# CONFIG_NET_FC is not set +# CONFIG_NET_POCKET is not set +# CONFIG_NET_TCPPROBE is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NEW_LEDS is not set +# CONFIG_NF_CONNTRACK_H323 is not set +# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set +# CONFIG_NF_CONNTRACK_SIP is not set +# CONFIG_NF_CT_PROTO_SCTP is not set +# CONFIG_NF_NAT_H323 is not set +# CONFIG_NF_NAT_SIP is not set +# CONFIG_NF_NAT_SNMP_BASIC is not set +CONFIG_NO_HZ=y +CONFIG_NR_CPUS=8 +# CONFIG_NS83820 is not set +# CONFIG_NSC_GPIO is not set +CONFIG_NTFS_RW=y +# CONFIG_PARIDE is not set +# CONFIG_PARPORT_AX88796 is not set +# CONFIG_PARPORT_PC_FIFO is not set +# CONFIG_PARPORT_SERIAL is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_RZ1000 is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_WINBOND is not set +# CONFIG_PC8736x_GPIO is not set +# CONFIG_PC87413_WDT is not set +# CONFIG_PCCARD is not set +# CONFIG_PCIEPORTBUS is not set +# CONFIG_PCIPCWATCHDOG is not set +# CONFIG_PDC_ADMA is not set +# CONFIG_PHANTOM is not set +# CONFIG_PHONE is not set +# CONFIG_PLIP is not set +CONFIG_PM_SLEEP_SMP=y +CONFIG_PREEMPT_BKL=y +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +CONFIG_PROC_PID_CPUSET=y +CONFIG_PSS_MIXER=y +# CONFIG_QLA3XXX is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_R3964 is not set +# CONFIG_R8169 is not set +# CONFIG_RESOURCES_64BIT is not set +# CONFIG_RFKILL is not set +# CONFIG_ROMFS_FS is not set +CONFIG_RTC=y +# CONFIG_RTC_CLASS is not set +# CONFIG_S2IO is not set +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIL24 is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_SX4 is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set +# CONFIG_SBC8360_WDT is not set +# CONFIG_SBC_EPX_C3_WATCHDOG is not set +# CONFIG_SC1200_WDT is not set +# CONFIG_SC520_WDT is not set +CONFIG_SC6600=y +CONFIG_SC6600_CDROM=4 +CONFIG_SC6600_CDROMBASE=0 +CONFIG_SC6600_JOY=y +# CONFIG_SC92031 is not set +CONFIG_SCHED_MC=y +CONFIG_SCHED_SMT=y +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_ARCMSR is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_HPTIOP is not set +# CONFIG_SCSI_IMM is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_LPFC is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_PPA is not set +# CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set +# CONFIG_SCSI_SCAN_ASYNC is not set +# CONFIG_SCSI_SRP is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# CONFIG_SCSI_STEX is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_TGT is not set +# CONFIG_SCx200 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_PARKBD is not set +# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_SIS190 is not set +# CONFIG_SIS900 is not set +# CONFIG_SKGE is not set +# CONFIG_SKY2 is not set +CONFIG_SMP=y +# CONFIG_SMSC37B787_WDT is not set +# CONFIG_SMSC_PHY is not set +CONFIG_SND=m +CONFIG_SND_AC97_CODEC=m +CONFIG_SND_AC97_POWER_SAVE=y +CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0 +CONFIG_SND_AD1889=m +CONFIG_SND_ALI5451=m +CONFIG_SND_ALS300=m +CONFIG_SND_ALS4000=m +CONFIG_SND_ATIIXP=m +CONFIG_SND_ATIIXP_MODEM=m +CONFIG_SND_AU8810=m +CONFIG_SND_AU8820=m +CONFIG_SND_AU8830=m +CONFIG_SND_AZT3328=m +CONFIG_SND_BT87X=m +# CONFIG_SND_BT87X_OVERCLOCK is not set +CONFIG_SND_CA0106=m +CONFIG_SND_CMIPCI=m +CONFIG_SND_CS4281=m +CONFIG_SND_CS46XX=m +CONFIG_SND_CS46XX_NEW_DSP=y +CONFIG_SND_CS5530=m +CONFIG_SND_CS5535AUDIO=m +CONFIG_SND_DARLA20=m +CONFIG_SND_DARLA24=m +# CONFIG_SND_DEBUG is not set +CONFIG_SND_DUMMY=m +CONFIG_SND_DYNAMIC_MINORS=y +CONFIG_SND_ECHO3G=m +CONFIG_SND_EMU10K1=m +CONFIG_SND_EMU10K1X=m +CONFIG_SND_ENS1370=m +CONFIG_SND_ENS1371=m +CONFIG_SND_ES1938=m +CONFIG_SND_ES1968=m +CONFIG_SND_FM801=m +# CONFIG_SND_FM801_TEA575X_BOOL is not set +CONFIG_SND_GINA20=m +CONFIG_SND_GINA24=m +CONFIG_SND_HDA_CODEC_ANALOG=y +CONFIG_SND_HDA_CODEC_ATIHDMI=y +CONFIG_SND_HDA_CODEC_CMEDIA=y +CONFIG_SND_HDA_CODEC_CONEXANT=y +CONFIG_SND_HDA_CODEC_REALTEK=y +CONFIG_SND_HDA_CODEC_SI3054=y +CONFIG_SND_HDA_CODEC_SIGMATEL=y +CONFIG_SND_HDA_CODEC_VIA=y +CONFIG_SND_HDA_GENERIC=y +# CONFIG_SND_HDA_HWDEP is not set +CONFIG_SND_HDA_INTEL=m +CONFIG_SND_HDA_POWER_SAVE=y +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDSP=m +CONFIG_SND_HDSPM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_ICE1712=m +CONFIG_SND_ICE1724=m +CONFIG_SND_INDIGO=m +CONFIG_SND_INDIGODJ=m +CONFIG_SND_INDIGOIO=m +CONFIG_SND_INTEL8X0=m +CONFIG_SND_INTEL8X0M=m +CONFIG_SND_KORG1212=m +CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL=y +CONFIG_SND_LAYLA20=m +CONFIG_SND_LAYLA24=m +CONFIG_SND_MAESTRO3=m +CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MIA=m +CONFIG_SND_MIXART=m +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_MONA=m +CONFIG_SND_MPU401=m +CONFIG_SND_MPU401_UART=m +CONFIG_SND_MTPAV=m +CONFIG_SND_MTS64=m +CONFIG_SND_NM256=m +CONFIG_SND_OPL3_LIB=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_PCM=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +CONFIG_SND_PCXHR=m +CONFIG_SND_PORTMAN2X4=m +CONFIG_SND_RAWMIDI=m +CONFIG_SND_RIPTIDE=m +CONFIG_SND_RME32=m +CONFIG_SND_RME96=m +CONFIG_SND_RME9652=m +CONFIG_SND_RTCTIMER=m +CONFIG_SND_SB16_DSP=m +CONFIG_SND_SB_COMMON=m +CONFIG_SND_SEQUENCER=m +CONFIG_SND_SEQUENCER_OSS=y +CONFIG_SND_SEQ_DUMMY=m +CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y +CONFIG_SND_SERIAL_U16550=m +CONFIG_SND_SOC=m +CONFIG_SND_SONICVIBES=m +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_TIMER=m +CONFIG_SND_TRIDENT=m +CONFIG_SND_USB_AUDIO=m +CONFIG_SND_USB_CAIAQ=m +CONFIG_SND_USB_CAIAQ_INPUT=y +CONFIG_SND_USB_USX2Y=m +# CONFIG_SND_VERBOSE_PRINTK is not set +CONFIG_SND_VERBOSE_PROCFS=y +CONFIG_SND_VIA82XX=m +CONFIG_SND_VIA82XX_MODEM=m +CONFIG_SND_VIRMIDI=m +CONFIG_SND_VX222=m +CONFIG_SND_VX_LIB=m +CONFIG_SND_YMFPCI=m +CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y +# CONFIG_SONYPI is not set +# CONFIG_SONY_LAPTOP is not set +CONFIG_SOUND_AEDSP16=m +CONFIG_SOUND_DMAP=y +CONFIG_SOUND_KAHLUA=m +CONFIG_SOUND_MPU401=m +CONFIG_SOUND_MSNDCLAS=m +CONFIG_SOUND_MSNDPIN=m +CONFIG_SOUND_MSS=m +CONFIG_SOUND_OSS=m +CONFIG_SOUND_PAS=m +CONFIG_SOUND_PRIME=m +CONFIG_SOUND_PSS=m +CONFIG_SOUND_SB=m +CONFIG_SOUND_SSCAPE=m +# CONFIG_SOUND_TRACEINIT is not set +CONFIG_SOUND_TRIDENT=m +CONFIG_SOUND_TRIX=m +CONFIG_SOUND_UART6850=m +CONFIG_SOUND_VMIDI=m +CONFIG_SOUND_YM3812=m +# CONFIG_SPI is not set +# CONFIG_SPI_MASTER is not set +# CONFIG_SSB_DRIVER_PCICORE is not set +CONFIG_STOP_MACHINE=y +# CONFIG_SUNDANCE is not set +# CONFIG_SUNGEM is not set +CONFIG_SUSPEND_SMP_POSSIBLE=y +# CONFIG_SYSV68_PARTITION is not set +# CONFIG_TCG_TPM is not set +# CONFIG_TELCLOCK is not set +# CONFIG_THINKPAD_ACPI is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_TIGON3 is not set +# CONFIG_TLAN is not set +# CONFIG_TOSHIBA is not set +# CONFIG_TR is not set +# CONFIG_ULI526X is not set +# CONFIG_USBPCWATCHDOG is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_BERRY_CHARGE is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set +# CONFIG_USB_EHCI_SPLIT_ISO is not set +# CONFIG_USB_EHCI_TT_NEWSCHED is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_GADGET is not set +# CONFIG_USB_HID is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_KBD is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LIBUSUAL is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_PHIDGET is not set +# CONFIG_USB_PRINTER is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_SUSPEND is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_USS720 is not set +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-virtual" +# CONFIG_VIA_RHINE is not set +# CONFIG_VIA_VELOCITY is not set +# CONFIG_VIDEO_DEV is not set +# CONFIG_VITESSE_PHY is not set +# CONFIG_W1_MASTER_DS2482 is not set +# CONFIG_W1_MASTER_DS2490 is not set +# CONFIG_W1_MASTER_MATROX is not set +# CONFIG_W1_SLAVE_DS2433 is not set +# CONFIG_W1_SLAVE_SMEM is not set +# CONFIG_W1_SLAVE_THERM is not set +# CONFIG_W83627HF_WDT is not set +# CONFIG_W83697HF_WDT is not set +# CONFIG_W83877F_WDT is not set +# CONFIG_W83977F_WDT is not set +# CONFIG_WAFER_WDT is not set +# CONFIG_WAN is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_WDTPCI is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_WIRELESS_EXT is not set +# CONFIG_WLAN_80211 is not set +# CONFIG_WLAN_PRE80211 is not set +# CONFIG_X25 is not set +CONFIG_X86_ALIGNMENT_16=y +# CONFIG_X86_CPUFREQ_NFORCE2 is not set +CONFIG_X86_F00F_BUG=y +CONFIG_X86_HT=y +CONFIG_X86_SMP=y +CONFIG_X86_SPEEDSTEP_LIB=y +CONFIG_X86_SPEEDSTEP_SMI=y +CONFIG_X86_TRAMPOLINE=y +# CONFIG_YELLOWFIN is not set --- linux-2.6.24.orig/debian/config/i386/config.generic +++ linux-2.6.24/debian/config/i386/config.generic @@ -0,0 +1,1950 @@ +# +# Config options for config.generic automatically generated by splitconfig.pl +# +CONFIG_3C359=m +CONFIG_3C515=m +CONFIG_60XX_WDT=m +CONFIG_6PACK=m +CONFIG_8139CP=m +CONFIG_8139TOO_8129=y +CONFIG_9P_FS=m +CONFIG_ABYSS=m +CONFIG_AC3200=m +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_ACPI_ASUS=m +CONFIG_ACPI_BATTERY=m +CONFIG_ACPI_BAY=m +CONFIG_ACPI_DOCK=m +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_SBS=m +CONFIG_ACPI_TOSHIBA=m +CONFIG_ACPI_VIDEO=m +CONFIG_ACQUIRE_WDT=m +CONFIG_ACT200L_DONGLE=m +CONFIG_ACTISYS_DONGLE=m +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_ADM8211=m +CONFIG_ADVANTECH_WDT=m +CONFIG_AFFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_AFS_FS=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_AGP_ALI=m +CONFIG_AGP_AMD=m +CONFIG_AGP_AMD64=m +CONFIG_AGP_ATI=m +CONFIG_AGP_EFFICEON=m +CONFIG_AGP_NVIDIA=m +CONFIG_AGP_SIS=m +CONFIG_AGP_SWORKS=m +CONFIG_AGP_VIA=m +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +CONFIG_AIC79XX_DEBUG_ENABLE=y +CONFIG_AIC79XX_DEBUG_MASK=0 +CONFIG_AIC79XX_REG_PRETTY_PRINT=y +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_DEBUG_ENABLE=y +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_AIRO=m +CONFIG_AIRO_CS=m +CONFIG_ALIM1535_WDT=m +CONFIG_ALIM7101_WDT=m +CONFIG_ALI_FIR=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_AMD8111_ETH=m +CONFIG_APM=m +# CONFIG_APM_ALLOW_INTS is not set +# CONFIG_APM_CPU_IDLE is not set +# CONFIG_APM_DISPLAY_BLANK is not set +# CONFIG_APM_DO_ENABLE is not set +# CONFIG_APM_IGNORE_USER_SUSPEND is not set +# CONFIG_APM_REAL_MODE_POWER_OFF is not set +CONFIG_APPLICOM=m +CONFIG_APRICOT=m +CONFIG_ARCNET=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_ARCNET_COM20020_ISA=m +CONFIG_ARCNET_COM20020_PCI=m +CONFIG_ARCNET_COM90xx=m +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RAW=m +CONFIG_ARCNET_RIM_I=m +CONFIG_ARLAN=m +CONFIG_ASUS_LAPTOP=m +CONFIG_AT1700=m +CONFIG_ATA_OVER_ETH=m +CONFIG_ATL1=m +CONFIG_ATM=y +CONFIG_ATMEL=m +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_BR2684=m +# CONFIG_ATM_BR2684_IPFILTER is not set +CONFIG_ATM_CLIP=y +# CONFIG_ATM_CLIP_NO_ICMP is not set +CONFIG_ATM_DRIVERS=y +# CONFIG_ATM_DUMMY is not set +CONFIG_ATM_ENI=m +# CONFIG_ATM_ENI_DEBUG is not set +# CONFIG_ATM_ENI_TUNE_BURST is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_FORE200E=m +CONFIG_ATM_FORE200E_DEBUG=0 +CONFIG_ATM_FORE200E_MAYBE=m +CONFIG_ATM_FORE200E_PCA=y +CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y +CONFIG_ATM_FORE200E_TX_RETRY=16 +# CONFIG_ATM_FORE200E_USE_TASKLET is not set +CONFIG_ATM_HE=m +CONFIG_ATM_HE_USE_SUNI=y +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_IA=m +# CONFIG_ATM_IA_DEBUG is not set +CONFIG_ATM_IDT77252=m +# CONFIG_ATM_IDT77252_DEBUG is not set +# CONFIG_ATM_IDT77252_RCV_ALL is not set +CONFIG_ATM_IDT77252_USE_SUNI=y +CONFIG_ATM_LANAI=m +CONFIG_ATM_LANE=m +CONFIG_ATM_MPOA=m +CONFIG_ATM_NICSTAR=m +# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set +# CONFIG_ATM_NICSTAR_USE_SUNI is not set +CONFIG_ATM_TCP=m +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_ATP=m +CONFIG_AX25=m +CONFIG_AX25_DAMA_SLAVE=y +CONFIG_B43=m +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PIO=y +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_B43_DEBUG=y +CONFIG_B43_DMA=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +CONFIG_B43_LEDS=y +CONFIG_B43_PCICORE_AUTOSELECT=y +CONFIG_B43_PCI_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_PIO=y +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43_RFKILL=y +CONFIG_B44=m +CONFIG_B44_PCI=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_BACKLIGHT_CARILLO_RANCH=m +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_PROGEAR=m +CONFIG_BAYCOM_EPP=m +CONFIG_BAYCOM_PAR=m +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +CONFIG_BCM43XX_PIO=y +# CONFIG_BCM43XX_PIO_MODE is not set +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_BLK_DEV_4DRIVES=y +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI14XX=m +CONFIG_BLK_DEV_ALI15X3=m +CONFIG_BLK_DEV_ATIIXP=m +CONFIG_BLK_DEV_CMD640=y +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +CONFIG_BLK_DEV_CMD64X=m +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_CS5535=m +CONFIG_BLK_DEV_CY82C693=m +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_DTC2278=m +CONFIG_BLK_DEV_HPT34X=m +CONFIG_BLK_DEV_HPT366=m +CONFIG_BLK_DEV_HT6560B=m +CONFIG_BLK_DEV_IDE=m +CONFIG_BLK_DEV_IDEACPI=y +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_BLK_DEV_IDEPNP=y +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDETAPE=m +CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_BLK_DEV_NS87415=m +# CONFIG_BLK_DEV_OFFBOARD is not set +CONFIG_BLK_DEV_OPTI621=m +CONFIG_BLK_DEV_PDC202XX_OLD=m +CONFIG_BLK_DEV_QD65XX=m +CONFIG_BLK_DEV_SC1200=m +CONFIG_BLK_DEV_SX8=m +CONFIG_BLK_DEV_TC86C001=m +CONFIG_BLK_DEV_TRM290=m +CONFIG_BLK_DEV_UMC8672=m +CONFIG_BLK_DEV_UMEM=m +CONFIG_BLK_DEV_XD=m +CONFIG_BNX2=m +CONFIG_BPQETHER=m +CONFIG_BROADCOM_PHY=m +CONFIG_BT=m +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_CMTP=m +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +CONFIG_BT_HCIVHCI=m +CONFIG_BT_HIDP=m +CONFIG_BT_L2CAP=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_SCO=m +CONFIG_C101=m +CONFIG_CAPI_AVM=y +CONFIG_CAPI_EICON=y +CONFIG_CAPI_TRACE=y +CONFIG_CARDBUS=y +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_CASSINI=m +CONFIG_CFAG12864B=m +CONFIG_CFAG12864B_RATE=20 +CONFIG_CFG80211=m +CONFIG_CHECK_SIGNATURE=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_CHR_DEV_OSST=m +CONFIG_CHR_DEV_SCH=m +CONFIG_CHR_DEV_ST=m +CONFIG_CICADA_PHY=m +CONFIG_CISS_SCSI_TAPE=y +# CONFIG_COMPUTONE is not set +CONFIG_COPS=m +CONFIG_COPS_DAYNA=y +CONFIG_COPS_TANGENT=y +CONFIG_COSA=m +CONFIG_CPU5_WDT=m +CONFIG_CPUSETS=y +CONFIG_CPU_FREQ_TABLE=m +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DEV_PADLOCK=y +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CS5535_GPIO=m +CONFIG_CS89x0=m +CONFIG_CYCLADES=m +CONFIG_CYCLADES_SYNC=m +CONFIG_CYCLOMX_X25=y +# CONFIG_CYZ_INTR is not set +CONFIG_DAB=y +CONFIG_DAVICOM_PHY=m +CONFIG_DE2104X=m +CONFIG_DE4X5=m +CONFIG_DE600=m +CONFIG_DE620=m +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DECNET_NF_GRABULATOR=m +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_DEPCA=m +CONFIG_DE_AOC=y +CONFIG_DIGIEPCA=m +CONFIG_DISPLAY_SUPPORT=m +CONFIG_DL2K=m +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_DM9102=m +CONFIG_DONGLE=y +CONFIG_DRM=m +CONFIG_DRM_I810=m +CONFIG_DRM_I830=m +CONFIG_DRM_I915=m +CONFIG_DRM_MGA=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_SAVAGE=m +CONFIG_DRM_SIS=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_VIA=m +CONFIG_DRM_VIA_CHROME9=m +CONFIG_DSCC4=m +CONFIG_DSCC4_PCISYNC=y +CONFIG_DSCC4_PCI_RST=y +CONFIG_DTLK=m +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_BT8XX=m +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_PATCH=m +CONFIG_DVB_CAPTURE_DRIVERS=y +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +# CONFIG_DVB_FE_CUSTOMISE is not set +CONFIG_DVB_ISL6421=m +CONFIG_DVB_L64781=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LNBP21=m +CONFIG_DVB_MT312=m +CONFIG_DVB_MT352=m +CONFIG_DVB_NXT200X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_PLL=m +CONFIG_DVB_PLUTO2=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_STV0297=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_USB=m +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_CXUSB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_VES1820=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_ZL10353=m +CONFIG_E100=m +CONFIG_E2100=m +CONFIG_ECONET=m +CONFIG_ECONET_AUNUDP=y +CONFIG_ECONET_NATIVE=y +CONFIG_EDAC=y +# CONFIG_EDAC_AMD76X is not set +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_E752X=m +CONFIG_EDAC_E7XXX=m +CONFIG_EDAC_I3000=m +CONFIG_EDAC_I5000=m +CONFIG_EDAC_I82860=m +CONFIG_EDAC_I82875P=m +CONFIG_EDAC_I82975X=m +CONFIG_EDAC_MM_EDAC=m +CONFIG_EDAC_R82600=m +CONFIG_EDD=y +CONFIG_EDD_OFF=y +CONFIG_EEPRO100=m +CONFIG_EEXPRESS=m +CONFIG_EEXPRESS_PRO=m +CONFIG_EISA=y +CONFIG_EISA_NAMES=y +CONFIG_EISA_PCI_EISA=y +CONFIG_EISA_VIRTUAL_ROOT=y +CONFIG_EISA_VLB_PRIMING=y +CONFIG_EL1=m +CONFIG_EL16=m +CONFIG_EL2=m +CONFIG_EL3=m +CONFIG_ELMC=m +CONFIG_ELMC_II=m +CONFIG_ELPLUS=m +CONFIG_EPIC100=m +CONFIG_ES3210=m +CONFIG_ESI_DONGLE=m +# CONFIG_ESPSERIAL is not set +CONFIG_ETH16I=m +CONFIG_EUROTECH_WDT=m +CONFIG_EWRK3=m +CONFIG_FARSYNC=m +CONFIG_FB_3DFX=m +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_ARK=m +CONFIG_FB_ATY=m +CONFIG_FB_ATY128=m +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_CARILLO_RANCH=m +CONFIG_FB_CYBER2000=m +CONFIG_FB_CYBLA=m +CONFIG_FB_DDC=m +CONFIG_FB_GEODE=y +CONFIG_FB_GEODE_GX=m +CONFIG_FB_GEODE_GX1=m +# CONFIG_FB_GEODE_GX_SET_FBSIZE is not set +CONFIG_FB_GEODE_LX=m +CONFIG_FB_HECUBA=m +CONFIG_FB_HGA=m +# CONFIG_FB_HGA_ACCEL is not set +CONFIG_FB_I810=m +# CONFIG_FB_I810_GTF is not set +CONFIG_FB_IMAC=y +CONFIG_FB_INTEL=m +# CONFIG_FB_INTEL_DEBUG is not set +CONFIG_FB_INTEL_I2C=y +CONFIG_FB_KYRO=m +CONFIG_FB_LE80578=m +CONFIG_FB_MATROX=m +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_BACKLIGHT=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_I2C=y +CONFIG_FB_PM2=m +CONFIG_FB_PM2_FIFO_DISCONNECT=y +CONFIG_FB_PM3=m +CONFIG_FB_RADEON=m +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_BACKLIGHT=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_I2C=y +CONFIG_FB_S1D13XXX=m +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_SM501=m +CONFIG_FB_SVGALIB=m +CONFIG_FB_TRIDENT=m +# CONFIG_FB_TRIDENT_ACCEL is not set +CONFIG_FB_VOODOO1=m +CONFIG_FB_VT8623=m +CONFIG_FDDI=y +CONFIG_FEALNX=m +CONFIG_FIXED_MII_1000_FDX=y +# CONFIG_FIXED_MII_100_FDX is not set +# CONFIG_FIXED_MII_10_FDX is not set +CONFIG_FIXED_MII_AMNT=1 +CONFIG_FIXED_PHY=m +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +CONFIG_FTL=m +CONFIG_FUJITSU_LAPTOP=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GIGASET_BASE=m +# CONFIG_GIGASET_DEBUG is not set +CONFIG_GIGASET_M101=m +CONFIG_GIGASET_M105=m +# CONFIG_GIGASET_UNDOCREQ is not set +CONFIG_GIRBIL_DONGLE=m +CONFIG_HAMACHI=m +CONFIG_HAMRADIO=y +CONFIG_HAPPYMEAL=m +CONFIG_HDLC=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +CONFIG_HDLC_X25=m +CONFIG_HERMES=m +CONFIG_HIBERNATION_SMP_POSSIBLE=y +CONFIG_HID=m +CONFIG_HIDRAW=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HID_FF is not set +CONFIG_HIGHMEM4G=y +# CONFIG_HIGHMEM64G is not set +CONFIG_HIPPI=y +CONFIG_HISAX_16_0=y +CONFIG_HISAX_16_3=y +CONFIG_HISAX_1TR6=y +CONFIG_HISAX_ASUSCOM=y +CONFIG_HISAX_AVM_A1=y +CONFIG_HISAX_AVM_A1_CS=m +CONFIG_HISAX_AVM_A1_PCMCIA=y +CONFIG_HISAX_BKM_A4T=y +# CONFIG_HISAX_DEBUG is not set +CONFIG_HISAX_DIEHLDIVA=y +CONFIG_HISAX_ELSA=y +CONFIG_HISAX_ELSA_CS=m +CONFIG_HISAX_ENTERNOW_PCI=y +CONFIG_HISAX_EURO=y +CONFIG_HISAX_FRITZPCI=y +CONFIG_HISAX_FRITZ_PCIPNP=m +CONFIG_HISAX_GAZEL=y +CONFIG_HISAX_HDLC=y +CONFIG_HISAX_HFC4S8S=m +CONFIG_HISAX_HFCS=y +CONFIG_HISAX_HFCUSB=m +CONFIG_HISAX_HFC_PCI=y +CONFIG_HISAX_HFC_SX=y +CONFIG_HISAX_HSTSAPHIR=y +CONFIG_HISAX_ISURF=y +CONFIG_HISAX_IX1MICROR2=y +CONFIG_HISAX_MAX_CARDS=8 +CONFIG_HISAX_MIC=y +CONFIG_HISAX_NETJET=y +CONFIG_HISAX_NETJET_U=y +CONFIG_HISAX_NI1=y +CONFIG_HISAX_NICCY=y +# CONFIG_HISAX_NO_KEYPAD is not set +# CONFIG_HISAX_NO_LLC is not set +# CONFIG_HISAX_NO_SENDCOMPLETE is not set +CONFIG_HISAX_S0BOX=y +CONFIG_HISAX_SCT_QUADRO=y +CONFIG_HISAX_SEDLBAUER=y +CONFIG_HISAX_SEDLBAUER_CS=m +CONFIG_HISAX_SPORTSTER=y +CONFIG_HISAX_ST5481=m +CONFIG_HISAX_TELEINT=y +CONFIG_HISAX_TELESPCI=y +CONFIG_HISAX_TELES_CS=m +CONFIG_HISAX_W6692=y +CONFIG_HOSTAP=m +CONFIG_HOSTAP_CS=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_PLX=m +CONFIG_HOSTESS_SV11=m +CONFIG_HOTPLUG_CPU=y +CONFIG_HOTPLUG_PCI=m +CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m +CONFIG_HOTPLUG_PCI_COMPAQ=m +CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y +CONFIG_HOTPLUG_PCI_CPCI=y +CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m +CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m +CONFIG_HOTPLUG_PCI_FAKE=m +CONFIG_HOTPLUG_PCI_IBM=m +CONFIG_HOTPLUG_PCI_PCIE=m +CONFIG_HOTPLUG_PCI_SHPC=m +CONFIG_HP100=m +CONFIG_HPET_EMULATE_RTC=y +CONFIG_HPLAN=m +CONFIG_HPLAN_PLUS=m +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_HUGETLBFS is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_HWMON_VID=m +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_AMD=m +CONFIG_HW_RANDOM_GEODE=m +CONFIG_HW_RANDOM_VIA=m +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PCA_ISA=m +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m +CONFIG_I2O=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_BUS=m +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_PROC=m +CONFIG_I2O_SCSI=m +CONFIG_I6300ESB_WDT=m +CONFIG_I82092=m +CONFIG_I82365=m +CONFIG_I8K=m +CONFIG_IB700_WDT=m +CONFIG_IBMASR=m +CONFIG_IBMLANA=m +CONFIG_IBMLS=m +# CONFIG_IBMMCA_SCSI_DEV_RESET is not set +CONFIG_IBMMCA_SCSI_ORDER_STANDARD=y +CONFIG_IBMOL=m +CONFIG_IBMTR=m +CONFIG_IBM_ASM=m +CONFIG_IDEPCI_SHARE_IRQ=y +CONFIG_IDE_PROC_FS=y +CONFIG_IEEE1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_OHCI1394=m +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +# CONFIG_IEEE1394_VERBOSEDEBUG is not set +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE80211=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_CRYPT_WEP=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_ISER=m +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFTL=m +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_ATLAS_BTNS=m +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_TABLET=y +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_INPUT_UINPUT=m +CONFIG_INPUT_WISTRON_BTNS=m +CONFIG_INPUT_YEALINK=m +CONFIG_IPPP_FILTER=y +# CONFIG_IPV6_MULTIPLE_TABLES is not set +CONFIG_IPW2100=m +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +CONFIG_IPW2200=m +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IRCOMM=m +CONFIG_IRDA=m +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_DEBUG=y +CONFIG_IRDA_FAST_RR=y +CONFIG_IRDA_ULTRA=y +CONFIG_IRLAN=m +CONFIG_IRNET=m +# CONFIG_IRQBALANCE is not set +CONFIG_IRTTY_SIR=m +CONFIG_ISA=y +CONFIG_ISAPNP=y +CONFIG_ISDN=m +CONFIG_ISDN_AUDIO=y +CONFIG_ISDN_CAPI=m +CONFIG_ISDN_CAPI_CAPI20=m +CONFIG_ISDN_CAPI_CAPIDRV=m +CONFIG_ISDN_CAPI_CAPIFS=m +CONFIG_ISDN_CAPI_CAPIFS_BOOL=y +CONFIG_ISDN_CAPI_MIDDLEWARE=y +CONFIG_ISDN_DIVAS=m +CONFIG_ISDN_DIVAS_BRIPCI=y +CONFIG_ISDN_DIVAS_DIVACAPI=m +CONFIG_ISDN_DIVAS_MAINT=m +CONFIG_ISDN_DIVAS_PRIPCI=y +CONFIG_ISDN_DIVAS_USERIDI=m +CONFIG_ISDN_DIVERSION=m +CONFIG_ISDN_DRV_ACT2000=m +CONFIG_ISDN_DRV_AVMB1_AVM_CS=m +CONFIG_ISDN_DRV_AVMB1_B1ISA=m +CONFIG_ISDN_DRV_AVMB1_B1PCI=m +CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m +CONFIG_ISDN_DRV_AVMB1_C4=m +CONFIG_ISDN_DRV_AVMB1_T1ISA=m +CONFIG_ISDN_DRV_AVMB1_T1PCI=m +CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y +CONFIG_ISDN_DRV_GIGASET=m +CONFIG_ISDN_DRV_HISAX=m +CONFIG_ISDN_DRV_ICN=m +CONFIG_ISDN_DRV_PCBIT=m +CONFIG_ISDN_DRV_SC=m +CONFIG_ISDN_I4L=m +CONFIG_ISDN_MPP=y +CONFIG_ISDN_PPP=y +CONFIG_ISDN_PPP_BSDCOMP=m +CONFIG_ISDN_PPP_VJ=y +CONFIG_ISDN_TTY_FAX=y +CONFIG_ISDN_X25=y +# CONFIG_ISI is not set +# CONFIG_IWLWIFI is not set +CONFIG_IXGB=m +# CONFIG_IXGB_NAPI is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_SUMMARY is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_IFORCE=m +CONFIG_JOYSTICK_IFORCE_232=y +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_K8_NB=y +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KINGSUN_DONGLE=m +CONFIG_KS0108=m +CONFIG_KS0108_DELAY=2 +CONFIG_KS0108_PORT=0x378 +CONFIG_KS959_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +CONFIG_KVM=m +CONFIG_KVM_AMD=m +CONFIG_KVM_INTEL=m +CONFIG_LANCE=m +CONFIG_LANMEDIA=m +CONFIG_LAPB=m +CONFIG_LAPBETHER=m +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +CONFIG_LEDS_CLASS=m +CONFIG_LEDS_NET48XX=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_WRAP=m +CONFIG_LGUEST=m +# CONFIG_LGUEST_GUEST is not set +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_CS=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_LIBERTAS_SDIO=m +CONFIG_LIBERTAS_USB=m +CONFIG_LITELINK_DONGLE=m +CONFIG_LLC=y +CONFIG_LNE390=m +CONFIG_LOCK_KERNEL=y +CONFIG_LP486E=m +CONFIG_LTPC=m +CONFIG_LXT_PHY=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +# CONFIG_M486 is not set +CONFIG_M586=y +# CONFIG_M686 is not set +CONFIG_MA600_DONGLE=m +CONFIG_MAC80211=m +# CONFIG_MAC80211_DEBUG is not set +CONFIG_MAC80211_DEBUGFS=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MACHZ_WDT=m +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_MADGEMC=m +CONFIG_MARVELL_PHY=m +# CONFIG_MATH_EMULATION is not set +CONFIG_MCA=y +CONFIG_MCA_LEGACY=y +# CONFIG_MCA_PROC_FS is not set +CONFIG_MCP2120_DONGLE=m +CONFIG_MCS_FIR=m +CONFIG_MDA_CONSOLE=m +CONFIG_MD_RAID10=m +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_SAS=m +CONFIG_MFD_SM501=m +CONFIG_MINIX_FS=m +CONFIG_MIXCOMWD=m +CONFIG_MKISS=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_MLX4_INFINIBAND=m +CONFIG_MMC=m +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_SDHCI=m +CONFIG_MMC_TIFM_SD=m +# CONFIG_MMC_UNSAFE_RESUME is not set +CONFIG_MMC_WBSD=m +CONFIG_MOUSE_APPLETOUCH=m +# CONFIG_MOUSE_ATIXL is not set +CONFIG_MOUSE_INPORT=m +CONFIG_MOUSE_LOGIBM=m +CONFIG_MOUSE_PC110PAD=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_VSXXXAA=m +# CONFIG_MOXA_INTELLIO is not set +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +CONFIG_MSI_LAPTOP=m +CONFIG_MTD=m +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTD_ABSENT=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_AMD76XROM=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK2MTD=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_MTD_CFI=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_CHAR=m +CONFIG_MTD_CK804XROM=m +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_CONCAT=m +CONFIG_MTD_DATAFLASH=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_DILNETPC=m +CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000 +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCECC=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCPROBE_ADDRESS=0 +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_ESB2ROM=m +CONFIG_MTD_GEN_PROBE=m +CONFIG_MTD_ICHXROM=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_L440GX=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_MAP_BANK_WIDTH_1=y +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +CONFIG_MTD_MAP_BANK_WIDTH_2=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTD_NAND=m +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_CS553X=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND_IDS=m +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +CONFIG_MTD_NETSC520=m +CONFIG_MTD_NETtel=m +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_2X_PROGRAM=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_SIM=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_OOPS=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_PCI=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PLATRAM=m +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_PNC2000=m +CONFIG_MTD_RAM=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +CONFIG_MTD_REDBOOT_PARTS=m +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +CONFIG_MTD_ROM=m +CONFIG_MTD_SBC_GXX=m +CONFIG_MTD_SC520CDP=m +CONFIG_MTD_SCB2_FLASH=m +CONFIG_MTD_SCx200_DOCFLASH=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_TS5500=m +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_MTD_UBI_GLUEBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MWAVE=m +CONFIG_MYRI10GE=m +CONFIG_N2=m +CONFIG_NATSEMI=m +CONFIG_NCPFS_EXTRAS=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_OS2_NS=y +CONFIG_NCPFS_PACKET_SIGNING=y +# CONFIG_NCPFS_SMALLDOS is not set +CONFIG_NCPFS_STRONG=y +CONFIG_NCP_FS=m +CONFIG_NE2000=m +CONFIG_NE2_MCA=m +CONFIG_NE3210=m +# CONFIG_NETLABEL is not set +CONFIG_NETROM=m +CONFIG_NETXEN_NIC=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SIMP=m +# CONFIG_NET_CLS_POLICE is not set +CONFIG_NET_DCCPPROBE=m +CONFIG_NET_FC=y +CONFIG_NET_ISA=y +CONFIG_NET_PCMCIA=y +CONFIG_NET_POCKET=y +CONFIG_NET_SCH_ATM=m +CONFIG_NET_TCPPROBE=m +CONFIG_NET_VENDOR_3COM=y +CONFIG_NET_VENDOR_RACAL=y +CONFIG_NET_VENDOR_SMC=y +CONFIG_NEW_LEDS=y +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NI52=m +CONFIG_NI65=m +CONFIG_NL80211=y +# CONFIG_NORTEL_HERMES is not set +CONFIG_NO_HZ=y +CONFIG_NR_CPUS=8 +CONFIG_NS83820=m +CONFIG_NSC_FIR=m +CONFIG_NSC_GPIO=m +# CONFIG_NTFS_RW is not set +CONFIG_N_HDLC=m +CONFIG_OLD_BELKIN_DONGLE=m +CONFIG_P54_COMMON=m +CONFIG_P54_PCI=m +CONFIG_P54_USB=m +CONFIG_PARIDE=m +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_BPCK6=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PG=m +CONFIG_PARIDE_PT=m +CONFIG_PARPORT_AX88796=m +CONFIG_PARPORT_NOT_PC=y +CONFIG_PARPORT_PC_FIFO=y +CONFIG_PARPORT_PC_PCMCIA=m +CONFIG_PARPORT_SERIAL=m +CONFIG_PATA_CS5520=m +CONFIG_PATA_EFAR=m +# CONFIG_PATA_ISAPNP is not set +CONFIG_PATA_IT8213=m +CONFIG_PATA_IT821X=m +CONFIG_PATA_JMICRON=m +# CONFIG_PATA_LEGACY is not set +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_NETCELL=m +CONFIG_PATA_OLDPIIX=m +CONFIG_PATA_PCMCIA=m +CONFIG_PATA_PDC2027X=m +CONFIG_PATA_QDI=m +CONFIG_PATA_RZ1000=m +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_WINBOND=m +# CONFIG_PATA_WINBOND_VLB is not set +CONFIG_PC300=m +# CONFIG_PC300TOO is not set +CONFIG_PC300_MLPPP=y +CONFIG_PC8736x_GPIO=m +CONFIG_PC87413_WDT=m +CONFIG_PCCARD=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_PCI200SYN=m +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIPCWATCHDOG=m +CONFIG_PCI_ATMEL=m +# CONFIG_PCI_HERMES is not set +CONFIG_PCMCIA=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_AHA152X=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_PCMCIA_AXNET=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_IBMTR=m +CONFIG_PCMCIA_IOCTL=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_NETWAVE=m +CONFIG_PCMCIA_NINJA_SCSI=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_PROBE=y +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_RAYCS=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_PCWATCHDOG=m +CONFIG_PD6729=m +CONFIG_PDC202XX_BURST=y +CONFIG_PDC_ADMA=m +CONFIG_PHANTOM=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m +CONFIG_PLIP=m +# CONFIG_PLX_HERMES is not set +CONFIG_PM_SLEEP_SMP=y +CONFIG_PNPBIOS=y +CONFIG_PNPBIOS_PROC_FS=y +CONFIG_PPPOATM=m +CONFIG_PREEMPT_BKL=y +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_NOTIFIERS=y +CONFIG_PREEMPT_VOLUNTARY=y +CONFIG_PRISM54=m +CONFIG_PROC_PID_CPUSET=y +CONFIG_PROTEON=m +CONFIG_QLA3XXX=m +CONFIG_QSEMI_PHY=m +CONFIG_R3964=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_AZTECH=m +CONFIG_RADIO_CADET=m +CONFIG_RADIO_GEMTEK=m +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAESTRO=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RADIO_RTRACK=m +CONFIG_RADIO_RTRACK2=m +CONFIG_RADIO_SF16FMI=m +CONFIG_RADIO_SF16FMR2=m +CONFIG_RADIO_TERRATEC=m +CONFIG_RADIO_TRUST=m +CONFIG_RADIO_TYPHOON=m +# CONFIG_RADIO_TYPHOON_PROC_FS is not set +CONFIG_RADIO_ZOLTRIX=m +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +# CONFIG_RESOURCES_64BIT is not set +CONFIG_RFD_FTL=m +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +# CONFIG_RIO is not set +CONFIG_ROADRUNNER=m +# CONFIG_ROADRUNNER_LARGE_RINGS is not set +CONFIG_ROCKETPORT=m +CONFIG_ROMFS_FS=m +CONFIG_ROSE=m +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT2X00=m +# CONFIG_RT2X00_DEBUG is not set +CONFIG_RT2X00_LIB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT73USB=m +CONFIG_RTC=y +CONFIG_RTC_CLASS=m +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_TEST=m +CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=m +CONFIG_RTL8187=m +CONFIG_RXKAD=m +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +CONFIG_SATA_AHCI=m +CONFIG_SATA_INIC162X=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_SVW=m +CONFIG_SATA_SX4=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SBC8360_WDT=m +CONFIG_SBC_EPX_C3_WATCHDOG=m +CONFIG_SBNI=m +# CONFIG_SBNI_MULTILINE is not set +CONFIG_SC1200_WDT=m +CONFIG_SC520_WDT=m +CONFIG_SC92031=m +CONFIG_SCC=m +# CONFIG_SCC_DELAY is not set +# CONFIG_SCC_TRXECHO is not set +CONFIG_SCHED_MC=y +CONFIG_SCHED_SMT=y +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_7000FASST=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_AHA152X=m +CONFIG_SCSI_AHA1542=m +CONFIG_SCSI_AHA1740=m +CONFIG_SCSI_AIC79XX=m +CONFIG_SCSI_AIC7XXX=m +CONFIG_SCSI_AIC94XX=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_DC395x=m +CONFIG_SCSI_DEBUG=m +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_DPT_I2O=m +CONFIG_SCSI_DTC3280=m +CONFIG_SCSI_EATA=m +CONFIG_SCSI_EATA_LINKED_COMMANDS=y +CONFIG_SCSI_EATA_MAX_TAGS=16 +CONFIG_SCSI_EATA_TAGGED_QUEUE=y +CONFIG_SCSI_FC_TGT_ATTRS=y +CONFIG_SCSI_FD_MCS=m +CONFIG_SCSI_FUTURE_DOMAIN=m +CONFIG_SCSI_GDTH=m +CONFIG_SCSI_GENERIC_NCR5380=m +CONFIG_SCSI_GENERIC_NCR5380_MMIO=m +CONFIG_SCSI_GENERIC_NCR53C400=y +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_IBMMCA=m +CONFIG_SCSI_IMM=m +CONFIG_SCSI_IN2000=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_DUMP is not set +# CONFIG_SCSI_IPR_TRACE is not set +CONFIG_SCSI_IPS=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_NCR53C406A=m +CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8 +CONFIG_SCSI_NCR53C8XX_MAX_TAGS=4 +CONFIG_SCSI_NCR53C8XX_SYNC=5 +CONFIG_SCSI_NCR_D700=m +CONFIG_SCSI_NCR_Q720=m +CONFIG_SCSI_NSP32=m +CONFIG_SCSI_PAS16=m +CONFIG_SCSI_PPA=m +CONFIG_SCSI_PSI240I=m +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_QLOGIC_FAS=m +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_SEAGATE=m +CONFIG_SCSI_SIM710=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C416=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_T128=m +CONFIG_SCSI_TGT=m +CONFIG_SCSI_U14_34F=m +CONFIG_SCSI_U14_34F_LINKED_COMMANDS=y +CONFIG_SCSI_U14_34F_MAX_TAGS=8 +CONFIG_SCSI_U14_34F_TAGGED_QUEUE=y +CONFIG_SCSI_ULTRASTOR=m +CONFIG_SCx200=m +CONFIG_SCx200HR_TIMER=m +CONFIG_SCx200_ACB=m +CONFIG_SCx200_GPIO=m +CONFIG_SCx200_I2C=m +CONFIG_SCx200_I2C_SCL=12 +CONFIG_SCx200_I2C_SDA=13 +CONFIG_SCx200_WDT=m +CONFIG_SDIO_UART=m +CONFIG_SDLA=m +CONFIG_SEALEVEL_4021=m +CONFIG_SEEQ8005=m +CONFIG_SENSORS_ABITUGURU=m +CONFIG_SENSORS_ABITUGURU3=m +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_APPLESMC=m +CONFIG_SENSORS_ASB100=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_CORETEMP=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_FSCHER=m +CONFIG_SENSORS_FSCHMD=m +CONFIG_SENSORS_FSCPOS=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_HDAPS=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_K8TEMP=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SERIAL_8250_ACCENT=m +CONFIG_SERIAL_8250_BOCA=m +CONFIG_SERIAL_8250_CS=m +CONFIG_SERIAL_8250_EXAR_ST16C554=m +CONFIG_SERIAL_8250_FOURPORT=m +CONFIG_SERIAL_8250_HUB6=m +CONFIG_SERIAL_8250_MCA=m +CONFIG_SERIAL_JSM=m +CONFIG_SERIAL_NONSTANDARD=y +CONFIG_SERIO_CT82C710=m +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SGI_IOC4=m +CONFIG_SIGMATEL_FIR=m +CONFIG_SIS190=m +CONFIG_SIS900=m +CONFIG_SKFP=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKISA=m +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +CONFIG_SMC9194=m +CONFIG_SMCTR=m +CONFIG_SMC_IRCC_FIR=m +CONFIG_SMP=y +CONFIG_SMSC37B787_WDT=m +CONFIG_SMSC_PHY=m +# CONFIG_SND is not set +CONFIG_SONYPI=m +CONFIG_SONYPI_COMPAT=y +CONFIG_SONY_LAPTOP=m +# CONFIG_SOUND_PRIME is not set +CONFIG_SPECIALIX=m +# CONFIG_SPECIALIX_RTSCTS is not set +CONFIG_SPI=y +CONFIG_SPI_AT25=m +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_LM70_LLP=m +CONFIG_SPI_MASTER=y +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_SSB_DRIVER_PCICORE=y +# CONFIG_SSB_PCMCIAHOST is not set +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +CONFIG_SSFDC=m +CONFIG_STALDRV=y +CONFIG_STOP_MACHINE=y +CONFIG_STRIP=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_SUNGEM=m +CONFIG_SUNRPC_XPRT_RDMA=m +CONFIG_SUSPEND_SMP_POSSIBLE=y +CONFIG_SX=m +CONFIG_SYNCLINK=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_CS=m +CONFIG_SYNCLINK_GT=m +CONFIG_SYSV68_PARTITION=y +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_TCG_ATMEL=m +CONFIG_TCG_INFINEON=m +CONFIG_TCG_NSC=m +CONFIG_TCG_TIS=m +CONFIG_TCG_TPM=m +CONFIG_TCIC=m +CONFIG_TEKRAM_DONGLE=m +CONFIG_TELCLOCK=m +CONFIG_THINKPAD_ACPI=m +CONFIG_THINKPAD_ACPI_BAY=y +# CONFIG_THINKPAD_ACPI_DEBUG is not set +CONFIG_TIFM_7XX1=m +CONFIG_TIFM_CORE=m +CONFIG_TIGON3=m +CONFIG_TLAN=m +# CONFIG_TMD_HERMES is not set +CONFIG_TMS380TR=m +CONFIG_TMSPCI=m +# CONFIG_TOIM3232_DONGLE is not set +CONFIG_TOSHIBA=m +CONFIG_TOSHIBA_FIR=m +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_ELO=m +CONFIG_TOUCHSCREEN_FUJITSU=m +CONFIG_TOUCHSCREEN_GUNZE=m +CONFIG_TOUCHSCREEN_MK712=m +CONFIG_TOUCHSCREEN_MTOUCH=m +CONFIG_TOUCHSCREEN_PENMOUNT=m +CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +CONFIG_TOUCHSCREEN_TOUCHWIN=m +CONFIG_TOUCHSCREEN_UCB1400=m +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TR=y +CONFIG_TUNER_3036=m +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_SIMPLE=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TYPHOON=m +CONFIG_ULI526X=m +CONFIG_ULTRA=m +CONFIG_ULTRA32=m +CONFIG_ULTRAMCA=m +CONFIG_USBPCWATCHDOG=m +CONFIG_USB_ACM=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_ARMLINUX=y +CONFIG_USB_ATM=m +CONFIG_USB_AUERSWALD=m +CONFIG_USB_BELKIN=y +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_CATC=m +CONFIG_USB_CXACRU=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_DABUSB=m +CONFIG_USB_DSBR=m +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EMI26=m +CONFIG_USB_EMI62=m +CONFIG_USB_EPSON2888=y +CONFIG_USB_ET61X251=m +CONFIG_USB_ETH=m +CONFIG_USB_ETH_RNDIS=y +CONFIG_USB_EZUSB=y +CONFIG_USB_FILE_STORAGE=m +# CONFIG_USB_FILE_STORAGE_TEST is not set +CONFIG_USB_FTDI_ELAN=m +CONFIG_USB_GADGET=m +CONFIG_USB_GADGETFS=m +# CONFIG_USB_GADGET_AMD5536UDC is not set +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_DUALSPEED=y +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_M66592 is not set +CONFIG_USB_GADGET_NET2280=y +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_S3C2410 is not set +CONFIG_USB_GADGET_SELECTED=y +CONFIG_USB_G_SERIAL=m +CONFIG_USB_HID=m +CONFIG_USB_HIDDEV=y +CONFIG_USB_HIDINPUT_POWERBOOK=y +CONFIG_USB_IBMCAM=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_IOWARRIOR=m +CONFIG_USB_IRDA=m +CONFIG_USB_KAWETH=m +CONFIG_USB_KBD=m +CONFIG_USB_KC2190=y +CONFIG_USB_KONICAWC=m +CONFIG_USB_LCD=m +CONFIG_USB_LD=m +CONFIG_USB_LED=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LIBUSUAL=y +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +# CONFIG_USB_MIDI_GADGET is not set +CONFIG_USB_MON=y +CONFIG_USB_MOUSE=m +CONFIG_USB_NET2280=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_RNDIS_HOST=m +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_HCD=m +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OV511 is not set +CONFIG_USB_PEGASUS=m +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_PRINTER=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_RIO500=m +CONFIG_USB_RTL8150=m +CONFIG_USB_SE401=m +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IPW=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_SL811_CS=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SN9C102=m +CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STV680=m +CONFIG_USB_SUSPEND=y +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_UEAGLEATM=m +CONFIG_USB_USBNET=m +CONFIG_USB_USS720=m +CONFIG_USB_VICAM=m +CONFIG_USB_W9968CF=m +CONFIG_USB_XUSBATM=m +CONFIG_USB_ZC0301=m +CONFIG_USB_ZD1201=m +CONFIG_USB_ZERO=m +CONFIG_USB_ZR364XX=m +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-generic" +CONFIG_VIA_FIR=m +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_VIA_VELOCITY=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m +# CONFIG_VIDEO_ADV_DEBUG is not set +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_CX2341X=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_CX25840=m +CONFIG_VIDEO_CX88=m +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_DEV=m +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_FB_IVTV=m +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_MEYE=m +CONFIG_VIDEO_MSP3400=m +# CONFIG_VIDEO_MXB is not set +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_VIDEO_PMS=m +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_29XXX=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_DVB=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_USBVIDEO=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_VP27SMPX=m +CONFIG_VIDEO_VPX3220=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_WM8775=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VITESSE_PHY=m +CONFIG_VLSI_FIR=m +CONFIG_VORTEX=m +CONFIG_W1_MASTER_DS2482=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_THERM=m +CONFIG_W83627HF_WDT=m +CONFIG_W83697HF_WDT=m +CONFIG_W83877F_WDT=m +CONFIG_W83977F_WDT=m +CONFIG_WAFER_WDT=m +CONFIG_WAN=y +CONFIG_WANXL=m +CONFIG_WAN_ROUTER=m +CONFIG_WAN_ROUTER_DRIVERS=m +CONFIG_WAVELAN=m +CONFIG_WD80x3=m +# CONFIG_WDC_ALI15X3 is not set +CONFIG_WDT=m +CONFIG_WDTPCI=m +CONFIG_WDT_501=y +CONFIG_WDT_501_PCI=y +CONFIG_WINBOND_840=m +CONFIG_WINBOND_FIR=m +CONFIG_WIRELESS_EXT=y +CONFIG_WLAN_80211=y +CONFIG_WLAN_PRE80211=y +CONFIG_X25=m +CONFIG_X25_ASY=m +CONFIG_X86_ALIGNMENT_16=y +CONFIG_X86_CPUFREQ_NFORCE2=m +CONFIG_X86_F00F_BUG=y +CONFIG_X86_HT=y +CONFIG_X86_SMP=y +CONFIG_X86_SPEEDSTEP_LIB=m +CONFIG_X86_SPEEDSTEP_SMI=m +CONFIG_X86_TRAMPOLINE=y +CONFIG_YAM=m +CONFIG_YELLOWFIN=m +CONFIG_YENTA=m +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_ZNET=m --- linux-2.6.24.orig/debian/config/i386/config.386 +++ linux-2.6.24/debian/config/i386/config.386 @@ -0,0 +1,1951 @@ +# +# Config options for config.386 automatically generated by splitconfig.pl +# +CONFIG_3C359=m +CONFIG_3C515=m +CONFIG_60XX_WDT=m +CONFIG_6PACK=m +CONFIG_8139CP=m +CONFIG_8139TOO_8129=y +CONFIG_9P_FS=m +CONFIG_ABYSS=m +CONFIG_AC3200=m +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_ACPI_ASUS=m +CONFIG_ACPI_BATTERY=m +CONFIG_ACPI_BAY=m +CONFIG_ACPI_DOCK=m +CONFIG_ACPI_SBS=m +CONFIG_ACPI_TOSHIBA=m +CONFIG_ACPI_VIDEO=m +CONFIG_ACQUIRE_WDT=m +CONFIG_ACT200L_DONGLE=m +CONFIG_ACTISYS_DONGLE=m +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_ADM8211=m +CONFIG_ADVANTECH_WDT=m +CONFIG_AFFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_AFS_FS=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_AGP_ALI=m +CONFIG_AGP_AMD=m +CONFIG_AGP_AMD64=m +CONFIG_AGP_ATI=m +CONFIG_AGP_EFFICEON=m +CONFIG_AGP_NVIDIA=m +CONFIG_AGP_SIS=m +CONFIG_AGP_SWORKS=m +CONFIG_AGP_VIA=m +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +CONFIG_AIC79XX_DEBUG_ENABLE=y +CONFIG_AIC79XX_DEBUG_MASK=0 +CONFIG_AIC79XX_REG_PRETTY_PRINT=y +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_DEBUG_ENABLE=y +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_AIRO=m +CONFIG_AIRO_CS=m +CONFIG_ALIM1535_WDT=m +CONFIG_ALIM7101_WDT=m +CONFIG_ALI_FIR=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_AMD8111_ETH=m +CONFIG_APM=m +# CONFIG_APM_ALLOW_INTS is not set +# CONFIG_APM_CPU_IDLE is not set +# CONFIG_APM_DISPLAY_BLANK is not set +# CONFIG_APM_DO_ENABLE is not set +# CONFIG_APM_IGNORE_USER_SUSPEND is not set +# CONFIG_APM_REAL_MODE_POWER_OFF is not set +CONFIG_APPLICOM=m +CONFIG_APRICOT=m +CONFIG_ARCNET=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_ARCNET_COM20020_ISA=m +CONFIG_ARCNET_COM20020_PCI=m +CONFIG_ARCNET_COM90xx=m +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RAW=m +CONFIG_ARCNET_RIM_I=m +CONFIG_ARLAN=m +CONFIG_ASUS_LAPTOP=m +CONFIG_AT1700=m +CONFIG_ATA_OVER_ETH=m +CONFIG_ATL1=m +CONFIG_ATM=y +CONFIG_ATMEL=m +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_BR2684=m +# CONFIG_ATM_BR2684_IPFILTER is not set +CONFIG_ATM_CLIP=y +# CONFIG_ATM_CLIP_NO_ICMP is not set +CONFIG_ATM_DRIVERS=y +# CONFIG_ATM_DUMMY is not set +CONFIG_ATM_ENI=m +# CONFIG_ATM_ENI_DEBUG is not set +# CONFIG_ATM_ENI_TUNE_BURST is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_FORE200E=m +CONFIG_ATM_FORE200E_DEBUG=0 +CONFIG_ATM_FORE200E_MAYBE=m +CONFIG_ATM_FORE200E_PCA=y +CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y +CONFIG_ATM_FORE200E_TX_RETRY=16 +# CONFIG_ATM_FORE200E_USE_TASKLET is not set +CONFIG_ATM_HE=m +CONFIG_ATM_HE_USE_SUNI=y +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_IA=m +# CONFIG_ATM_IA_DEBUG is not set +CONFIG_ATM_IDT77252=m +# CONFIG_ATM_IDT77252_DEBUG is not set +# CONFIG_ATM_IDT77252_RCV_ALL is not set +CONFIG_ATM_IDT77252_USE_SUNI=y +CONFIG_ATM_LANAI=m +CONFIG_ATM_LANE=m +CONFIG_ATM_MPOA=m +CONFIG_ATM_NICSTAR=m +# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set +# CONFIG_ATM_NICSTAR_USE_SUNI is not set +CONFIG_ATM_TCP=m +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_ATP=m +CONFIG_AX25=m +CONFIG_AX25_DAMA_SLAVE=y +CONFIG_B43=m +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PIO=y +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_B43_DEBUG=y +CONFIG_B43_DMA=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +CONFIG_B43_LEDS=y +CONFIG_B43_PCICORE_AUTOSELECT=y +CONFIG_B43_PCI_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_PIO=y +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43_RFKILL=y +CONFIG_B44=m +CONFIG_B44_PCI=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_BACKLIGHT_CARILLO_RANCH=m +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_PROGEAR=m +CONFIG_BAYCOM_EPP=m +CONFIG_BAYCOM_PAR=m +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +CONFIG_BCM43XX_PIO=y +# CONFIG_BCM43XX_PIO_MODE is not set +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_BLK_DEV_4DRIVES=y +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI14XX=m +CONFIG_BLK_DEV_ALI15X3=m +CONFIG_BLK_DEV_ATIIXP=m +CONFIG_BLK_DEV_CMD640=y +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +CONFIG_BLK_DEV_CMD64X=m +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_CS5535=m +CONFIG_BLK_DEV_CY82C693=m +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_DTC2278=m +CONFIG_BLK_DEV_HPT34X=m +CONFIG_BLK_DEV_HPT366=m +CONFIG_BLK_DEV_HT6560B=m +CONFIG_BLK_DEV_IDE=m +CONFIG_BLK_DEV_IDEACPI=y +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_BLK_DEV_IDEPNP=y +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDETAPE=m +CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_BLK_DEV_NS87415=m +# CONFIG_BLK_DEV_OFFBOARD is not set +CONFIG_BLK_DEV_OPTI621=m +CONFIG_BLK_DEV_PDC202XX_OLD=m +CONFIG_BLK_DEV_QD65XX=m +CONFIG_BLK_DEV_SC1200=m +CONFIG_BLK_DEV_SX8=m +CONFIG_BLK_DEV_TC86C001=m +CONFIG_BLK_DEV_TRM290=m +CONFIG_BLK_DEV_UMC8672=m +CONFIG_BLK_DEV_UMEM=m +CONFIG_BLK_DEV_XD=m +CONFIG_BNX2=m +CONFIG_BPQETHER=m +CONFIG_BROADCOM_PHY=m +CONFIG_BROKEN_ON_SMP=y +CONFIG_BT=m +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_CMTP=m +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +CONFIG_BT_HCIVHCI=m +CONFIG_BT_HIDP=m +CONFIG_BT_L2CAP=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_SCO=m +CONFIG_C101=m +CONFIG_CAPI_AVM=y +CONFIG_CAPI_EICON=y +CONFIG_CAPI_TRACE=y +CONFIG_CARDBUS=y +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_CASSINI=m +CONFIG_CFAG12864B=m +CONFIG_CFAG12864B_RATE=20 +CONFIG_CFG80211=m +CONFIG_CHECK_SIGNATURE=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_CHR_DEV_OSST=m +CONFIG_CHR_DEV_SCH=m +CONFIG_CHR_DEV_ST=m +CONFIG_CICADA_PHY=m +CONFIG_CISS_SCSI_TAPE=y +CONFIG_COMPUTONE=m +CONFIG_COPS=m +CONFIG_COPS_DAYNA=y +CONFIG_COPS_TANGENT=y +CONFIG_COSA=m +CONFIG_CPU5_WDT=m +CONFIG_CPU_FREQ_TABLE=m +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DEV_PADLOCK=y +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CS5535_GPIO=m +CONFIG_CS89x0=m +CONFIG_CYCLADES=m +CONFIG_CYCLADES_SYNC=m +CONFIG_CYCLOMX_X25=y +# CONFIG_CYZ_INTR is not set +CONFIG_DAB=y +CONFIG_DAVICOM_PHY=m +CONFIG_DE2104X=m +CONFIG_DE4X5=m +CONFIG_DE600=m +CONFIG_DE620=m +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DECNET_NF_GRABULATOR=m +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_DEPCA=m +CONFIG_DE_AOC=y +CONFIG_DIGIEPCA=m +CONFIG_DISPLAY_SUPPORT=m +CONFIG_DL2K=m +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_DM9102=m +CONFIG_DMASCC=m +CONFIG_DONGLE=y +# CONFIG_DONGLE_OLD is not set +CONFIG_DRM=m +CONFIG_DRM_I810=m +CONFIG_DRM_I830=m +CONFIG_DRM_I915=m +CONFIG_DRM_MGA=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_SAVAGE=m +CONFIG_DRM_SIS=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_VIA=m +CONFIG_DRM_VIA_CHROME9=m +CONFIG_DSCC4=m +CONFIG_DSCC4_PCISYNC=y +CONFIG_DSCC4_PCI_RST=y +CONFIG_DTLK=m +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_BT8XX=m +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_PATCH=m +CONFIG_DVB_CAPTURE_DRIVERS=y +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +# CONFIG_DVB_FE_CUSTOMISE is not set +CONFIG_DVB_ISL6421=m +CONFIG_DVB_L64781=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LNBP21=m +CONFIG_DVB_MT312=m +CONFIG_DVB_MT352=m +CONFIG_DVB_NXT200X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_PLL=m +CONFIG_DVB_PLUTO2=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_STV0297=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_USB=m +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_CXUSB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_VES1820=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_ZL10353=m +CONFIG_E100=m +CONFIG_E2100=m +CONFIG_ECONET=m +CONFIG_ECONET_AUNUDP=y +CONFIG_ECONET_NATIVE=y +CONFIG_EDAC=y +# CONFIG_EDAC_AMD76X is not set +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_E752X=m +CONFIG_EDAC_E7XXX=m +CONFIG_EDAC_I3000=m +CONFIG_EDAC_I5000=m +CONFIG_EDAC_I82860=m +CONFIG_EDAC_I82875P=m +CONFIG_EDAC_I82975X=m +CONFIG_EDAC_MM_EDAC=m +CONFIG_EDAC_R82600=m +CONFIG_EDD=y +CONFIG_EDD_OFF=y +CONFIG_EEPRO100=m +CONFIG_EEXPRESS=m +CONFIG_EEXPRESS_PRO=m +CONFIG_EISA=y +CONFIG_EISA_NAMES=y +CONFIG_EISA_PCI_EISA=y +CONFIG_EISA_VIRTUAL_ROOT=y +CONFIG_EISA_VLB_PRIMING=y +CONFIG_EL1=m +CONFIG_EL16=m +CONFIG_EL2=m +CONFIG_EL3=m +CONFIG_ELMC=m +CONFIG_ELMC_II=m +CONFIG_ELPLUS=m +CONFIG_EPIC100=m +CONFIG_ES3210=m +CONFIG_ESI_DONGLE=m +# CONFIG_ESPSERIAL is not set +CONFIG_ETH16I=m +CONFIG_EUROTECH_WDT=m +CONFIG_EWRK3=m +CONFIG_FARSYNC=m +CONFIG_FB_3DFX=m +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_ARK=m +CONFIG_FB_ATY=m +CONFIG_FB_ATY128=m +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_CARILLO_RANCH=m +CONFIG_FB_CYBER2000=m +CONFIG_FB_CYBLA=m +CONFIG_FB_DDC=m +CONFIG_FB_GEODE=y +CONFIG_FB_GEODE_GX=m +CONFIG_FB_GEODE_GX1=m +# CONFIG_FB_GEODE_GX_SET_FBSIZE is not set +CONFIG_FB_GEODE_LX=m +CONFIG_FB_HECUBA=m +CONFIG_FB_HGA=m +# CONFIG_FB_HGA_ACCEL is not set +CONFIG_FB_I810=m +# CONFIG_FB_I810_GTF is not set +CONFIG_FB_IMAC=y +CONFIG_FB_INTEL=m +# CONFIG_FB_INTEL_DEBUG is not set +CONFIG_FB_INTEL_I2C=y +CONFIG_FB_KYRO=m +CONFIG_FB_LE80578=m +CONFIG_FB_MATROX=m +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_BACKLIGHT=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_I2C=y +CONFIG_FB_PM2=m +CONFIG_FB_PM2_FIFO_DISCONNECT=y +CONFIG_FB_PM3=m +CONFIG_FB_RADEON=m +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_BACKLIGHT=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_I2C=y +CONFIG_FB_S1D13XXX=m +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_SM501=m +CONFIG_FB_SVGALIB=m +CONFIG_FB_TRIDENT=m +# CONFIG_FB_TRIDENT_ACCEL is not set +CONFIG_FB_VOODOO1=m +CONFIG_FB_VT8623=m +CONFIG_FDDI=y +CONFIG_FEALNX=m +CONFIG_FIXED_MII_1000_FDX=y +# CONFIG_FIXED_MII_100_FDX is not set +# CONFIG_FIXED_MII_10_FDX is not set +CONFIG_FIXED_MII_AMNT=1 +CONFIG_FIXED_PHY=m +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +CONFIG_FTL=m +CONFIG_FUJITSU_LAPTOP=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GEN_RTC=m +CONFIG_GEN_RTC_X=y +CONFIG_GIGASET_BASE=m +# CONFIG_GIGASET_DEBUG is not set +CONFIG_GIGASET_M101=m +CONFIG_GIGASET_M105=m +# CONFIG_GIGASET_UNDOCREQ is not set +CONFIG_GIRBIL_DONGLE=m +CONFIG_HAMACHI=m +CONFIG_HAMRADIO=y +CONFIG_HAPPYMEAL=m +CONFIG_HDLC=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +CONFIG_HDLC_X25=m +CONFIG_HERMES=m +CONFIG_HIBERNATION_UP_POSSIBLE=y +CONFIG_HID=m +CONFIG_HIDRAW=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HID_FF is not set +CONFIG_HIGHMEM4G=y +# CONFIG_HIGHMEM64G is not set +CONFIG_HIPPI=y +CONFIG_HISAX_16_0=y +CONFIG_HISAX_16_3=y +CONFIG_HISAX_1TR6=y +CONFIG_HISAX_ASUSCOM=y +CONFIG_HISAX_AVM_A1=y +CONFIG_HISAX_AVM_A1_CS=m +CONFIG_HISAX_AVM_A1_PCMCIA=y +CONFIG_HISAX_BKM_A4T=y +# CONFIG_HISAX_DEBUG is not set +CONFIG_HISAX_DIEHLDIVA=y +CONFIG_HISAX_ELSA=y +CONFIG_HISAX_ELSA_CS=m +CONFIG_HISAX_ENTERNOW_PCI=y +CONFIG_HISAX_EURO=y +CONFIG_HISAX_FRITZPCI=y +CONFIG_HISAX_FRITZ_PCIPNP=m +CONFIG_HISAX_GAZEL=y +CONFIG_HISAX_HDLC=y +CONFIG_HISAX_HFC4S8S=m +CONFIG_HISAX_HFCS=y +CONFIG_HISAX_HFCUSB=m +CONFIG_HISAX_HFC_PCI=y +CONFIG_HISAX_HFC_SX=y +CONFIG_HISAX_HSTSAPHIR=y +CONFIG_HISAX_ISURF=y +CONFIG_HISAX_IX1MICROR2=y +CONFIG_HISAX_MAX_CARDS=8 +CONFIG_HISAX_MIC=y +CONFIG_HISAX_NETJET=y +CONFIG_HISAX_NETJET_U=y +CONFIG_HISAX_NI1=y +CONFIG_HISAX_NICCY=y +# CONFIG_HISAX_NO_KEYPAD is not set +# CONFIG_HISAX_NO_LLC is not set +# CONFIG_HISAX_NO_SENDCOMPLETE is not set +CONFIG_HISAX_S0BOX=y +CONFIG_HISAX_SCT_QUADRO=y +CONFIG_HISAX_SEDLBAUER=y +CONFIG_HISAX_SEDLBAUER_CS=m +CONFIG_HISAX_SPORTSTER=y +CONFIG_HISAX_ST5481=m +CONFIG_HISAX_TELEINT=y +CONFIG_HISAX_TELESPCI=y +CONFIG_HISAX_TELES_CS=m +CONFIG_HISAX_W6692=y +CONFIG_HOSTAP=m +CONFIG_HOSTAP_CS=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_PLX=m +CONFIG_HOSTESS_SV11=m +CONFIG_HOTPLUG_PCI=m +CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m +CONFIG_HOTPLUG_PCI_COMPAQ=m +CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y +CONFIG_HOTPLUG_PCI_CPCI=y +CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m +CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m +CONFIG_HOTPLUG_PCI_FAKE=m +CONFIG_HOTPLUG_PCI_IBM=m +CONFIG_HOTPLUG_PCI_PCIE=m +CONFIG_HOTPLUG_PCI_SHPC=m +CONFIG_HP100=m +CONFIG_HPLAN=m +CONFIG_HPLAN_PLUS=m +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_HUGETLBFS is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_HWMON_VID=m +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_AMD=m +CONFIG_HW_RANDOM_GEODE=m +CONFIG_HW_RANDOM_VIA=m +CONFIG_HYSDN=m +CONFIG_HYSDN_CAPI=y +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_ELEKTOR=m +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PCA_ISA=m +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m +CONFIG_I2O=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_BUS=m +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_PROC=m +CONFIG_I2O_SCSI=m +CONFIG_I6300ESB_WDT=m +CONFIG_I82092=m +CONFIG_I82365=m +CONFIG_I8K=m +CONFIG_IB700_WDT=m +CONFIG_IBMASR=m +CONFIG_IBMLANA=m +CONFIG_IBMLS=m +# CONFIG_IBMMCA_SCSI_DEV_RESET is not set +CONFIG_IBMMCA_SCSI_ORDER_STANDARD=y +CONFIG_IBMOL=m +CONFIG_IBMTR=m +CONFIG_IBM_ASM=m +CONFIG_IDEPCI_SHARE_IRQ=y +CONFIG_IDE_PROC_FS=y +CONFIG_IEEE1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_OHCI1394=m +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +# CONFIG_IEEE1394_VERBOSEDEBUG is not set +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE80211=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_CRYPT_WEP=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_ISER=m +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFTL=m +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_ATLAS_BTNS=m +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_TABLET=y +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_INPUT_UINPUT=m +CONFIG_INPUT_WISTRON_BTNS=m +# CONFIG_INPUT_YEALINK is not set +CONFIG_IPPP_FILTER=y +# CONFIG_IPV6_MULTIPLE_TABLES is not set +CONFIG_IPW2100=m +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +CONFIG_IPW2200=m +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IRCOMM=m +CONFIG_IRDA=m +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_DEBUG=y +CONFIG_IRDA_FAST_RR=y +CONFIG_IRDA_ULTRA=y +CONFIG_IRLAN=m +CONFIG_IRNET=m +CONFIG_IRPORT_SIR=m +CONFIG_IRTTY_SIR=m +CONFIG_ISA=y +CONFIG_ISAPNP=y +CONFIG_ISDN=m +CONFIG_ISDN_AUDIO=y +CONFIG_ISDN_CAPI=m +CONFIG_ISDN_CAPI_CAPI20=m +CONFIG_ISDN_CAPI_CAPIDRV=m +CONFIG_ISDN_CAPI_CAPIFS=m +CONFIG_ISDN_CAPI_CAPIFS_BOOL=y +CONFIG_ISDN_CAPI_MIDDLEWARE=y +CONFIG_ISDN_DIVAS=m +CONFIG_ISDN_DIVAS_BRIPCI=y +CONFIG_ISDN_DIVAS_DIVACAPI=m +CONFIG_ISDN_DIVAS_MAINT=m +CONFIG_ISDN_DIVAS_PRIPCI=y +CONFIG_ISDN_DIVAS_USERIDI=m +CONFIG_ISDN_DIVERSION=m +CONFIG_ISDN_DRV_ACT2000=m +CONFIG_ISDN_DRV_AVMB1_AVM_CS=m +CONFIG_ISDN_DRV_AVMB1_B1ISA=m +CONFIG_ISDN_DRV_AVMB1_B1PCI=m +CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m +CONFIG_ISDN_DRV_AVMB1_C4=m +CONFIG_ISDN_DRV_AVMB1_T1ISA=m +CONFIG_ISDN_DRV_AVMB1_T1PCI=m +CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y +CONFIG_ISDN_DRV_GIGASET=m +CONFIG_ISDN_DRV_HISAX=m +CONFIG_ISDN_DRV_ICN=m +CONFIG_ISDN_DRV_LOOP=m +CONFIG_ISDN_DRV_PCBIT=m +CONFIG_ISDN_DRV_SC=m +CONFIG_ISDN_I4L=m +CONFIG_ISDN_MPP=y +CONFIG_ISDN_PPP=y +CONFIG_ISDN_PPP_BSDCOMP=m +CONFIG_ISDN_PPP_VJ=y +CONFIG_ISDN_TTY_FAX=y +CONFIG_ISDN_X25=y +# CONFIG_ISI is not set +CONFIG_ISTALLION=m +# CONFIG_IWLWIFI is not set +CONFIG_IXGB=m +# CONFIG_IXGB_NAPI is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_SUMMARY is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_IFORCE=m +CONFIG_JOYSTICK_IFORCE_232=y +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_K8_NB=y +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KINGSUN_DONGLE=m +CONFIG_KS0108=m +CONFIG_KS0108_DELAY=2 +CONFIG_KS0108_PORT=0x378 +CONFIG_KS959_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +CONFIG_KVM=m +CONFIG_KVM_AMD=m +CONFIG_KVM_INTEL=m +CONFIG_LANCE=m +CONFIG_LANMEDIA=m +CONFIG_LAPB=m +CONFIG_LAPBETHER=m +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +CONFIG_LEDS_CLASS=m +CONFIG_LEDS_NET48XX=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_WRAP=m +CONFIG_LGUEST=m +# CONFIG_LGUEST_GUEST is not set +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_CS=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_LIBERTAS_SDIO=m +CONFIG_LIBERTAS_USB=m +CONFIG_LITELINK_DONGLE=m +CONFIG_LLC=y +CONFIG_LNE390=m +CONFIG_LP486E=m +CONFIG_LTPC=m +CONFIG_LXT_PHY=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +CONFIG_M486=y +# CONFIG_M586 is not set +# CONFIG_M686 is not set +CONFIG_MA600_DONGLE=m +CONFIG_MAC80211=m +# CONFIG_MAC80211_DEBUG is not set +CONFIG_MAC80211_DEBUGFS=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MACHZ_WDT=m +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_MADGEMC=m +CONFIG_MARVELL_PHY=m +CONFIG_MATH_EMULATION=y +CONFIG_MCA=y +CONFIG_MCA_LEGACY=y +# CONFIG_MCA_PROC_FS is not set +CONFIG_MCP2120_DONGLE=m +CONFIG_MCS_FIR=m +CONFIG_MDA_CONSOLE=m +CONFIG_MD_RAID10=m +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_SAS=m +CONFIG_MFD_SM501=m +CONFIG_MINIX_FS=m +CONFIG_MIXCOMWD=m +CONFIG_MKISS=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_MLX4_INFINIBAND=m +CONFIG_MMC=m +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_SDHCI=m +CONFIG_MMC_TIFM_SD=m +# CONFIG_MMC_UNSAFE_RESUME is not set +CONFIG_MMC_WBSD=m +CONFIG_MOUSE_APPLETOUCH=m +# CONFIG_MOUSE_ATIXL is not set +CONFIG_MOUSE_INPORT=m +CONFIG_MOUSE_LOGIBM=m +CONFIG_MOUSE_PC110PAD=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_VSXXXAA=m +CONFIG_MOXA_INTELLIO=m +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +CONFIG_MSI_LAPTOP=m +CONFIG_MTD=m +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTD_ABSENT=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_AMD76XROM=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK2MTD=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_MTD_CFI=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_CHAR=m +CONFIG_MTD_CK804XROM=m +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_CONCAT=m +CONFIG_MTD_DATAFLASH=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_DILNETPC=m +CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000 +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCECC=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCPROBE_ADDRESS=0 +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_ESB2ROM=m +CONFIG_MTD_GEN_PROBE=m +CONFIG_MTD_ICHXROM=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_L440GX=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_MAP_BANK_WIDTH_1=y +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +CONFIG_MTD_MAP_BANK_WIDTH_2=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTD_NAND=m +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_CS553X=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND_IDS=m +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +CONFIG_MTD_NETSC520=m +CONFIG_MTD_NETtel=m +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_2X_PROGRAM=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_SIM=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_OOPS=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_PCI=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PLATRAM=m +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_PNC2000=m +CONFIG_MTD_RAM=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +CONFIG_MTD_REDBOOT_PARTS=m +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +CONFIG_MTD_ROM=m +CONFIG_MTD_SBC_GXX=m +CONFIG_MTD_SC520CDP=m +CONFIG_MTD_SCB2_FLASH=m +CONFIG_MTD_SCx200_DOCFLASH=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_TS5500=m +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_MTD_UBI_GLUEBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MWAVE=m +CONFIG_MYRI10GE=m +CONFIG_N2=m +CONFIG_NATSEMI=m +CONFIG_NCPFS_EXTRAS=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_OS2_NS=y +CONFIG_NCPFS_PACKET_SIGNING=y +# CONFIG_NCPFS_SMALLDOS is not set +CONFIG_NCPFS_STRONG=y +CONFIG_NCP_FS=m +CONFIG_NE2000=m +CONFIG_NE2_MCA=m +CONFIG_NE3210=m +# CONFIG_NETLABEL is not set +CONFIG_NETROM=m +CONFIG_NETXEN_NIC=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SIMP=m +# CONFIG_NET_CLS_POLICE is not set +CONFIG_NET_DCCPPROBE=m +CONFIG_NET_FC=y +CONFIG_NET_ISA=y +CONFIG_NET_PCMCIA=y +CONFIG_NET_POCKET=y +CONFIG_NET_SCH_ATM=m +CONFIG_NET_TCPPROBE=m +CONFIG_NET_VENDOR_3COM=y +CONFIG_NET_VENDOR_RACAL=y +CONFIG_NET_VENDOR_SMC=y +CONFIG_NEW_LEDS=y +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NI5010=m +CONFIG_NI52=m +CONFIG_NI65=m +CONFIG_NL80211=y +# CONFIG_NORTEL_HERMES is not set +# CONFIG_NO_HZ is not set +CONFIG_NS83820=m +CONFIG_NSC_FIR=m +CONFIG_NSC_GPIO=m +# CONFIG_NTFS_RW is not set +CONFIG_N_HDLC=m +CONFIG_OLD_BELKIN_DONGLE=m +CONFIG_P54_COMMON=m +CONFIG_P54_PCI=m +CONFIG_P54_USB=m +CONFIG_PARIDE=m +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_BPCK6=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PG=m +CONFIG_PARIDE_PT=m +CONFIG_PARPORT_AX88796=m +CONFIG_PARPORT_NOT_PC=y +CONFIG_PARPORT_PC_FIFO=y +CONFIG_PARPORT_PC_PCMCIA=m +CONFIG_PARPORT_SERIAL=m +CONFIG_PATA_CS5520=m +CONFIG_PATA_EFAR=m +# CONFIG_PATA_ISAPNP is not set +CONFIG_PATA_IT8213=m +CONFIG_PATA_IT821X=m +CONFIG_PATA_JMICRON=m +# CONFIG_PATA_LEGACY is not set +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_NETCELL=m +CONFIG_PATA_OLDPIIX=m +CONFIG_PATA_PCMCIA=m +CONFIG_PATA_PDC2027X=m +CONFIG_PATA_QDI=m +CONFIG_PATA_RZ1000=m +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_WINBOND=m +# CONFIG_PATA_WINBOND_VLB is not set +CONFIG_PC300=m +# CONFIG_PC300TOO is not set +CONFIG_PC300_MLPPP=y +CONFIG_PC8736x_GPIO=m +CONFIG_PC87413_WDT=m +CONFIG_PCCARD=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_PCI200SYN=m +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIPCWATCHDOG=m +CONFIG_PCI_ATMEL=m +# CONFIG_PCI_HERMES is not set +CONFIG_PCMCIA=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_AHA152X=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_PCMCIA_AXNET=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_IBMTR=m +CONFIG_PCMCIA_IOCTL=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_NETWAVE=m +CONFIG_PCMCIA_NINJA_SCSI=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_PROBE=y +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_RAYCS=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_PCMCIA_XIRTULIP=m +CONFIG_PCWATCHDOG=m +CONFIG_PD6729=m +CONFIG_PDC202XX_BURST=y +CONFIG_PDC_ADMA=m +CONFIG_PHANTOM=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m +CONFIG_PLIP=m +# CONFIG_PLX_HERMES is not set +CONFIG_PNPBIOS=y +CONFIG_PNPBIOS_PROC_FS=y +CONFIG_PPPOATM=m +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_NOTIFIERS=y +CONFIG_PREEMPT_VOLUNTARY=y +CONFIG_PRISM54=m +CONFIG_PROTEON=m +CONFIG_QLA3XXX=m +CONFIG_QSEMI_PHY=m +CONFIG_R3964=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_AZTECH=m +CONFIG_RADIO_CADET=m +CONFIG_RADIO_GEMTEK=m +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAESTRO=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RADIO_RTRACK=m +CONFIG_RADIO_RTRACK2=m +CONFIG_RADIO_SF16FMI=m +CONFIG_RADIO_SF16FMR2=m +CONFIG_RADIO_TERRATEC=m +CONFIG_RADIO_TRUST=m +CONFIG_RADIO_TYPHOON=m +# CONFIG_RADIO_TYPHOON_PROC_FS is not set +CONFIG_RADIO_ZOLTRIX=m +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +# CONFIG_RESOURCES_64BIT is not set +CONFIG_RFD_FTL=m +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +CONFIG_RIO=m +CONFIG_RIO_OLDPCI=y +CONFIG_RISCOM8=m +CONFIG_ROADRUNNER=m +# CONFIG_ROADRUNNER_LARGE_RINGS is not set +CONFIG_ROCKETPORT=m +CONFIG_ROMFS_FS=m +CONFIG_ROSE=m +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT2X00=m +# CONFIG_RT2X00_DEBUG is not set +CONFIG_RT2X00_LIB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT73USB=m +CONFIG_RTC=m +CONFIG_RTC_CLASS=m +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_TEST=m +CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=m +CONFIG_RTL8187=m +CONFIG_RXKAD=m +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +CONFIG_SATA_AHCI=m +CONFIG_SATA_INIC162X=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_SVW=m +CONFIG_SATA_SX4=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SBC8360_WDT=m +CONFIG_SBC_EPX_C3_WATCHDOG=m +CONFIG_SBNI=m +# CONFIG_SBNI_MULTILINE is not set +CONFIG_SC1200_WDT=m +CONFIG_SC520_WDT=m +CONFIG_SC92031=m +CONFIG_SCC=m +# CONFIG_SCC_DELAY is not set +# CONFIG_SCC_TRXECHO is not set +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_7000FASST=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_AHA152X=m +CONFIG_SCSI_AHA1542=m +CONFIG_SCSI_AHA1740=m +CONFIG_SCSI_AIC79XX=m +CONFIG_SCSI_AIC7XXX=m +CONFIG_SCSI_AIC94XX=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_DC395x=m +CONFIG_SCSI_DEBUG=m +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_DPT_I2O=m +CONFIG_SCSI_DTC3280=m +CONFIG_SCSI_EATA=m +CONFIG_SCSI_EATA_LINKED_COMMANDS=y +CONFIG_SCSI_EATA_MAX_TAGS=16 +CONFIG_SCSI_EATA_TAGGED_QUEUE=y +CONFIG_SCSI_FC_TGT_ATTRS=y +CONFIG_SCSI_FD_MCS=m +CONFIG_SCSI_FUTURE_DOMAIN=m +CONFIG_SCSI_GDTH=m +CONFIG_SCSI_GENERIC_NCR5380=m +CONFIG_SCSI_GENERIC_NCR5380_MMIO=m +CONFIG_SCSI_GENERIC_NCR53C400=y +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_IBMMCA=m +CONFIG_SCSI_IMM=m +CONFIG_SCSI_IN2000=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_DUMP is not set +# CONFIG_SCSI_IPR_TRACE is not set +CONFIG_SCSI_IPS=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_MCA_53C9X=m +CONFIG_SCSI_NCR53C406A=m +CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8 +CONFIG_SCSI_NCR53C8XX_MAX_TAGS=4 +CONFIG_SCSI_NCR53C8XX_SYNC=5 +CONFIG_SCSI_NCR_D700=m +CONFIG_SCSI_NCR_Q720=m +CONFIG_SCSI_NSP32=m +CONFIG_SCSI_PAS16=m +CONFIG_SCSI_PPA=m +CONFIG_SCSI_PSI240I=m +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_QLOGIC_FAS=m +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_SEAGATE=m +CONFIG_SCSI_SIM710=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C416=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_T128=m +CONFIG_SCSI_TGT=m +CONFIG_SCSI_U14_34F=m +CONFIG_SCSI_U14_34F_LINKED_COMMANDS=y +CONFIG_SCSI_U14_34F_MAX_TAGS=8 +CONFIG_SCSI_U14_34F_TAGGED_QUEUE=y +CONFIG_SCSI_ULTRASTOR=m +CONFIG_SCx200=m +CONFIG_SCx200HR_TIMER=m +CONFIG_SCx200_ACB=m +CONFIG_SCx200_GPIO=m +CONFIG_SCx200_I2C=m +CONFIG_SCx200_I2C_SCL=12 +CONFIG_SCx200_I2C_SDA=13 +CONFIG_SCx200_WDT=m +CONFIG_SDIO_UART=m +CONFIG_SDLA=m +CONFIG_SEALEVEL_4021=m +CONFIG_SEEQ8005=m +CONFIG_SENSORS_ABITUGURU=m +CONFIG_SENSORS_ABITUGURU3=m +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_APPLESMC=m +CONFIG_SENSORS_ASB100=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_CORETEMP=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_FSCHER=m +CONFIG_SENSORS_FSCHMD=m +CONFIG_SENSORS_FSCPOS=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_HDAPS=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_K8TEMP=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SERIAL_8250_ACCENT=m +CONFIG_SERIAL_8250_BOCA=m +CONFIG_SERIAL_8250_CS=m +CONFIG_SERIAL_8250_EXAR_ST16C554=m +CONFIG_SERIAL_8250_FOURPORT=m +CONFIG_SERIAL_8250_HUB6=m +CONFIG_SERIAL_8250_MCA=m +CONFIG_SERIAL_JSM=m +CONFIG_SERIAL_NONSTANDARD=y +CONFIG_SERIO_CT82C710=m +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SGI_IOC4=m +CONFIG_SIGMATEL_FIR=m +CONFIG_SIS190=m +CONFIG_SIS900=m +CONFIG_SKFP=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKISA=m +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +CONFIG_SMC9194=m +CONFIG_SMCTR=m +CONFIG_SMC_IRCC_FIR=m +# CONFIG_SMP is not set +CONFIG_SMSC37B787_WDT=m +CONFIG_SMSC_PHY=m +# CONFIG_SND is not set +CONFIG_SONYPI=m +CONFIG_SONYPI_COMPAT=y +CONFIG_SONY_LAPTOP=m +# CONFIG_SOUND_PRIME is not set +CONFIG_SPECIALIX=m +# CONFIG_SPECIALIX_RTSCTS is not set +CONFIG_SPI=y +CONFIG_SPI_AT25=m +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_LM70_LLP=m +CONFIG_SPI_MASTER=y +# CONFIG_SPI_SPIDEV is not set +CONFIG_SPI_TLE62X0=m +CONFIG_SSB_DRIVER_PCICORE=y +# CONFIG_SSB_PCMCIAHOST is not set +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +CONFIG_SSFDC=m +CONFIG_STALDRV=y +CONFIG_STALLION=m +CONFIG_STRIP=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_SUNGEM=m +CONFIG_SUNRPC_XPRT_RDMA=m +CONFIG_SUSPEND_UP_POSSIBLE=y +CONFIG_SX=m +CONFIG_SYNCLINK=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_CS=m +CONFIG_SYNCLINK_GT=m +CONFIG_SYSV68_PARTITION=y +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_TCG_ATMEL=m +CONFIG_TCG_INFINEON=m +CONFIG_TCG_NSC=m +CONFIG_TCG_TIS=m +CONFIG_TCG_TPM=m +CONFIG_TCIC=m +CONFIG_TEKRAM_DONGLE=m +CONFIG_TELCLOCK=m +CONFIG_THINKPAD_ACPI=m +CONFIG_THINKPAD_ACPI_BAY=y +# CONFIG_THINKPAD_ACPI_DEBUG is not set +CONFIG_TIFM_7XX1=m +CONFIG_TIFM_CORE=m +CONFIG_TIGON3=m +CONFIG_TLAN=m +# CONFIG_TMD_HERMES is not set +CONFIG_TMS380TR=m +CONFIG_TMSPCI=m +# CONFIG_TOIM3232_DONGLE is not set +CONFIG_TOSHIBA=m +CONFIG_TOSHIBA_FIR=m +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_ELO=m +CONFIG_TOUCHSCREEN_FUJITSU=m +CONFIG_TOUCHSCREEN_GUNZE=m +CONFIG_TOUCHSCREEN_MK712=m +CONFIG_TOUCHSCREEN_MTOUCH=m +CONFIG_TOUCHSCREEN_PENMOUNT=m +CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +CONFIG_TOUCHSCREEN_TOUCHWIN=m +CONFIG_TOUCHSCREEN_UCB1400=m +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TR=y +CONFIG_TUNER_3036=m +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_SIMPLE=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TYPHOON=m +CONFIG_ULI526X=m +CONFIG_ULTRA=m +CONFIG_ULTRA32=m +CONFIG_ULTRAMCA=m +CONFIG_USBPCWATCHDOG=m +CONFIG_USB_ACM=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_ARMLINUX=y +CONFIG_USB_ATM=m +CONFIG_USB_AUERSWALD=m +CONFIG_USB_BELKIN=y +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_CATC=m +CONFIG_USB_CXACRU=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_DABUSB=m +CONFIG_USB_DSBR=m +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EMI26=m +CONFIG_USB_EMI62=m +CONFIG_USB_EPSON2888=y +CONFIG_USB_ET61X251=m +CONFIG_USB_ETH=m +CONFIG_USB_ETH_RNDIS=y +CONFIG_USB_EZUSB=y +CONFIG_USB_FILE_STORAGE=m +# CONFIG_USB_FILE_STORAGE_TEST is not set +CONFIG_USB_FTDI_ELAN=m +CONFIG_USB_GADGET=m +CONFIG_USB_GADGETFS=m +# CONFIG_USB_GADGET_AMD5536UDC is not set +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_DUALSPEED=y +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_M66592 is not set +CONFIG_USB_GADGET_NET2280=y +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_S3C2410 is not set +CONFIG_USB_GADGET_SELECTED=y +CONFIG_USB_G_SERIAL=m +CONFIG_USB_HID=m +CONFIG_USB_HIDDEV=y +CONFIG_USB_HIDINPUT_POWERBOOK=y +CONFIG_USB_IBMCAM=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_IOWARRIOR=m +CONFIG_USB_IRDA=m +CONFIG_USB_KAWETH=m +CONFIG_USB_KBD=m +CONFIG_USB_KC2190=y +CONFIG_USB_KONICAWC=m +CONFIG_USB_LCD=m +CONFIG_USB_LD=m +CONFIG_USB_LED=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LIBUSUAL=y +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +# CONFIG_USB_MIDI_GADGET is not set +CONFIG_USB_MON=y +CONFIG_USB_MOUSE=m +CONFIG_USB_NET2280=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_RNDIS_HOST=m +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_HCD=m +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OV511 is not set +CONFIG_USB_PEGASUS=m +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_PRINTER=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_RIO500=m +CONFIG_USB_RTL8150=m +CONFIG_USB_SE401=m +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IPW=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_SL811_CS=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SN9C102=m +CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STV680=m +CONFIG_USB_SUSPEND=y +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_UEAGLEATM=m +CONFIG_USB_USBNET=m +CONFIG_USB_USS720=m +CONFIG_USB_VICAM=m +CONFIG_USB_W9968CF=m +CONFIG_USB_XUSBATM=m +CONFIG_USB_ZC0301=m +CONFIG_USB_ZD1201=m +CONFIG_USB_ZERO=m +CONFIG_USB_ZR364XX=m +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-386" +CONFIG_VIA_FIR=m +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_VIA_VELOCITY=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m +# CONFIG_VIDEO_ADV_DEBUG is not set +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_CX2341X=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_CX25840=m +CONFIG_VIDEO_CX88=m +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_DEV=m +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_FB_IVTV=m +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_MEYE=m +CONFIG_VIDEO_MSP3400=m +# CONFIG_VIDEO_MXB is not set +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_VIDEO_PMS=m +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_29XXX=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_DVB=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_USBVIDEO=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_VP27SMPX=m +CONFIG_VIDEO_VPX3220=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_WM8775=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VITESSE_PHY=m +CONFIG_VLSI_FIR=m +CONFIG_VORTEX=m +CONFIG_W1_MASTER_DS2482=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_THERM=m +CONFIG_W83627HF_WDT=m +CONFIG_W83697HF_WDT=m +CONFIG_W83877F_WDT=m +CONFIG_W83977F_WDT=m +CONFIG_WAFER_WDT=m +CONFIG_WAN=y +CONFIG_WANXL=m +CONFIG_WAN_ROUTER=m +CONFIG_WAN_ROUTER_DRIVERS=m +CONFIG_WAVELAN=m +CONFIG_WD80x3=m +# CONFIG_WDC_ALI15X3 is not set +CONFIG_WDT=m +CONFIG_WDTPCI=m +CONFIG_WDT_501=y +CONFIG_WDT_501_PCI=y +CONFIG_WINBOND_840=m +CONFIG_WINBOND_FIR=m +CONFIG_WIRELESS_EXT=y +CONFIG_WLAN_80211=y +CONFIG_WLAN_PRE80211=y +CONFIG_X25=m +CONFIG_X25_ASY=m +CONFIG_X86_ALIGNMENT_16=y +CONFIG_X86_CPUFREQ_NFORCE2=m +CONFIG_X86_F00F_BUG=y +CONFIG_X86_SPEEDSTEP_LIB=m +CONFIG_X86_SPEEDSTEP_SMI=m +CONFIG_X86_UP_APIC=y +CONFIG_X86_UP_IOAPIC=y +CONFIG_YAM=m +CONFIG_YELLOWFIN=m +CONFIG_YENTA=m +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_ZNET=m --- linux-2.6.24.orig/debian/config/ia64/config +++ linux-2.6.24/debian/config/ia64/config @@ -0,0 +1,2540 @@ +# +# Common config options automatically generated by splitconfig.pl +# +CONFIG_3C359=m +CONFIG_64BIT=y +# CONFIG_6PACK is not set +CONFIG_8139CP=m +CONFIG_8139TOO=m +CONFIG_8139TOO_8129=y +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_9P_FS=m +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_ACORN_PARTITION=y +CONFIG_ACORN_PARTITION_ADFS=y +# CONFIG_ACORN_PARTITION_CUMANA is not set +CONFIG_ACORN_PARTITION_EESOX=y +CONFIG_ACORN_PARTITION_ICS=y +CONFIG_ACORN_PARTITION_POWERTEC=y +CONFIG_ACORN_PARTITION_RISCIX=y +CONFIG_ACPI=y +CONFIG_ACPI_BAY=m +CONFIG_ACPI_BLACKLIST_YEAR=0 +CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_CUSTOM_DSDT_INITRD=y +# CONFIG_ACPI_DEBUG is not set +CONFIG_ACPI_DOCK=m +CONFIG_ACPI_EC=y +CONFIG_ACPI_FAN=m +CONFIG_ACPI_NUMA=y +CONFIG_ACPI_POWER=y +CONFIG_ACPI_PROCESSOR=m +CONFIG_ACPI_PROCFS=y +CONFIG_ACPI_PROCFS_POWER=y +CONFIG_ACPI_PROC_EVENT=y +CONFIG_ACPI_SYSFS_POWER=y +CONFIG_ACPI_SYSTEM=y +CONFIG_ACPI_THERMAL=m +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_ADM8211=m +CONFIG_AFFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_AFS_FS=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_AGP=m +CONFIG_AGP_HP_ZX1=m +CONFIG_AGP_I460=m +# CONFIG_AGP_SGI_TIOCA is not set +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +# CONFIG_AIC79XX_DEBUG_ENABLE is not set +CONFIG_AIC79XX_DEBUG_MASK=0 +# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=253 +# CONFIG_AIC7XXX_DEBUG_ENABLE is not set +CONFIG_AIC7XXX_DEBUG_MASK=0 +# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_AIRO_CS=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_AMD8111_ETH=m +CONFIG_AMIGA_PARTITION=y +CONFIG_ANON_INODES=y +CONFIG_APPLICOM=m +CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y +CONFIG_ARCH_DISCONTIGMEM_ENABLE=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y +CONFIG_ARCH_FLATMEM_ENABLE=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUPPORTS_MSI=y +CONFIG_ARCNET=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_ARCNET_COM20020_PCI=m +# CONFIG_ARCNET_COM90xx is not set +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RAW=m +# CONFIG_ARCNET_RIM_I is not set +# CONFIG_ARPD is not set +CONFIG_ASK_IP_FIB_HASH=y +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_ATA=m +CONFIG_ATALK=m +CONFIG_ATARI_PARTITION=y +CONFIG_ATA_ACPI=y +CONFIG_ATA_GENERIC=m +CONFIG_ATA_NONSTANDARD=y +CONFIG_ATA_OVER_ETH=m +CONFIG_ATA_PIIX=m +CONFIG_ATL1=m +# CONFIG_ATM is not set +CONFIG_ATMEL=m +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_ARCH=y +CONFIG_AUDIT_TREE=y +CONFIG_AUTOFS4_FS=m +CONFIG_AUTOFS_FS=m +CONFIG_AUXDISPLAY=y +CONFIG_AX25=m +CONFIG_AX25_DAMA_SLAVE=y +CONFIG_B43=m +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PIO=y +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_B43_DEBUG=y +CONFIG_B43_DMA=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +CONFIG_B43_LEDS=y +CONFIG_B43_PCICORE_AUTOSELECT=y +CONFIG_B43_PCI_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_PIO=y +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43_RFKILL=y +CONFIG_B44=m +CONFIG_B44_PCI=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BASE_FULL=y +CONFIG_BASE_SMALL=0 +CONFIG_BATTERY_DS2760=m +CONFIG_BAYCOM_PAR=m +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +CONFIG_BCM43XX_PIO=y +# CONFIG_BCM43XX_PIO_MODE is not set +# CONFIG_BEFS_DEBUG is not set +CONFIG_BEFS_FS=m +CONFIG_BFS_FS=m +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m +CONFIG_BITREVERSE=y +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_DEV=y +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI15X3=m +CONFIG_BLK_DEV_AMD74XX=m +# CONFIG_BLK_DEV_BSG is not set +CONFIG_BLK_DEV_CMD64X=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_CRYPTOLOOP=m +# CONFIG_BLK_DEV_CS5520 is not set +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_CY82C693=m +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_DM=m +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_HPT34X=m +CONFIG_BLK_DEV_HPT366=m +CONFIG_BLK_DEV_IDE=m +CONFIG_BLK_DEV_IDEACPI=y +CONFIG_BLK_DEV_IDECD=m +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDEDISK=m +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_BLK_DEV_IDEPNP=y +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDETAPE=m +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_DEV_IO_TRACE=y +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_JMICRON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_MD=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_NS87415=m +# CONFIG_BLK_DEV_OFFBOARD is not set +CONFIG_BLK_DEV_OPTI621=m +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +CONFIG_BLK_DEV_PDC202XX_OLD=m +# CONFIG_BLK_DEV_PIIX is not set +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_BLK_DEV_SC1200=m +CONFIG_BLK_DEV_SD=m +CONFIG_BLK_DEV_SGIIOC4=m +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +CONFIG_BLK_DEV_SR=m +CONFIG_BLK_DEV_SR_VENDOR=y +# CONFIG_BLK_DEV_SVWKS is not set +CONFIG_BLK_DEV_SX8=m +CONFIG_BLK_DEV_TC86C001=m +# CONFIG_BLK_DEV_TRIFLEX is not set +CONFIG_BLK_DEV_TRM290=m +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_UMEM=m +# CONFIG_BLK_DEV_VIA82CXXX is not set +CONFIG_BLOCK=y +CONFIG_BLOCK_COMPAT=y +CONFIG_BNX2=m +CONFIG_BONDING=m +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_BOUNCE=y +CONFIG_BPQETHER=m +CONFIG_BRIDGE=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_NETFILTER=y +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BROADCOM_PHY=m +CONFIG_BSD_DISKLABEL=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_BT=m +CONFIG_BT_BNEP=m +# CONFIG_BT_BNEP_MC_FILTER is not set +# CONFIG_BT_BNEP_PROTO_FILTER is not set +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIUART=m +# CONFIG_BT_HCIUART_BCSP is not set +# CONFIG_BT_HCIUART_H4 is not set +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUSB=m +# CONFIG_BT_HCIUSB_SCO is not set +CONFIG_BT_HCIVHCI=m +CONFIG_BT_HIDP=m +CONFIG_BT_L2CAP=m +CONFIG_BT_RFCOMM=m +# CONFIG_BT_RFCOMM_TTY is not set +CONFIG_BT_SCO=m +CONFIG_BUG=y +CONFIG_CARDBUS=y +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_CASSINI=m +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_CFG80211=m +CONFIG_CGROUPS=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_CGROUP_DEBUG is not set +CONFIG_CGROUP_NS=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_CHR_DEV_OSST=m +CONFIG_CHR_DEV_SCH=m +CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_ST=m +CONFIG_CICADA_PHY=m +CONFIG_CIFS=m +# CONFIG_CIFS_DEBUG2 is not set +CONFIG_CIFS_EXPERIMENTAL=y +# CONFIG_CIFS_STATS is not set +CONFIG_CIFS_UPCALL=y +CONFIG_CIFS_WEAK_PW_HASH=y +# CONFIG_CIFS_XATTR is not set +CONFIG_CISS_SCSI_TAPE=y +CONFIG_CLS_U32_MARK=y +# CONFIG_CLS_U32_PERF is not set +CONFIG_CODA_FS=m +CONFIG_CODA_FS_OLD_API=y +CONFIG_COMPAT=y +CONFIG_COMPAT_FOR_U64_ALIGNMENT=y +CONFIG_COMPUTONE=m +CONFIG_CONFIGFS_FS=m +CONFIG_CONNECTOR=m +CONFIG_CPUSETS=y +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_DEBUG is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_FREQ_TABLE=m +CONFIG_CRAMFS=y +CONFIG_CRC16=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_CRC_CCITT=m +CONFIG_CRC_ITU_T=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_XTS=m +# CONFIG_CYCLADES is not set +# CONFIG_CYCLADES_SYNC is not set +CONFIG_DAB=y +CONFIG_DAVICOM_PHY=m +CONFIG_DE2104X=m +CONFIG_DE4X5=m +CONFIG_DE600=m +CONFIG_DE620=m +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_FS=y +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_VM is not set +CONFIG_DECNET=m +CONFIG_DECNET_NF_GRABULATOR=m +# CONFIG_DECNET_ROUTER is not set +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_BIC is not set +CONFIG_DEFAULT_CFQ=y +CONFIG_DEFAULT_CUBIC=y +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_HTCP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 +# CONFIG_DEFAULT_RENO is not set +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_DEVPORT=y +CONFIG_DEV_APPLETALK=m +# CONFIG_DEV_KMEM is not set +# CONFIG_DIGIEPCA is not set +# CONFIG_DISABLE_VHPT is not set +CONFIG_DISCONTIGMEM=y +CONFIG_DISCONTIGMEM_MANUAL=y +CONFIG_DISPLAY_SUPPORT=m +CONFIG_DL2K=m +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +CONFIG_DM9102=m +CONFIG_DMI=y +CONFIG_DMIID=y +CONFIG_DM_CRYPT=m +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_DELAY is not set +CONFIG_DM_MIRROR=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_MULTIPATH_HP=m +CONFIG_DM_MULTIPATH_RDAC=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_UEVENT=y +CONFIG_DM_ZERO=m +CONFIG_DNOTIFY=y +# CONFIG_DONGLE is not set +CONFIG_DRM=m +CONFIG_DRM_MGA=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_SAVAGE=m +CONFIG_DRM_SIS=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_VIA=m +# CONFIG_DRM_VIA_CHROME9 is not set +CONFIG_DS1682=m +CONFIG_DSCC4=m +# CONFIG_DSCC4_PCISYNC is not set +# CONFIG_DSCC4_PCI_RST is not set +CONFIG_DUMMY=m +CONFIG_DUMMY_CONSOLE=y +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_BT8XX=m +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_PATCH=m +CONFIG_DVB_CAPTURE_DRIVERS=y +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +# CONFIG_DVB_FE_CUSTOMISE is not set +CONFIG_DVB_ISL6421=m +CONFIG_DVB_L64781=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LNBP21=m +CONFIG_DVB_MT312=m +CONFIG_DVB_MT352=m +CONFIG_DVB_NXT200X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_PLL=m +CONFIG_DVB_PLUTO2=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_STV0297=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_USB=m +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_CXUSB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_VES1820=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_ZL10353=m +CONFIG_E100=m +CONFIG_E1000=m +CONFIG_E1000E=m +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000_NAPI=y +# CONFIG_ECONET is not set +CONFIG_ECRYPT_FS=m +CONFIG_EEPRO100=m +CONFIG_EEPROM_93CX6=m +CONFIG_EFI=y +CONFIG_EFI_PARTITION=y +CONFIG_EFI_PCDP=y +CONFIG_EFI_RTC=y +CONFIG_EFI_VARS=m +CONFIG_EFS_FS=m +CONFIG_ELF_CORE=y +# CONFIG_EMBEDDED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +# CONFIG_ENABLE_WARN_DEPRECATED is not set +CONFIG_EPIC100=m +CONFIG_EPOLL=y +CONFIG_EQUALIZER=m +CONFIG_EVENTFD=y +CONFIG_EXPERIMENTAL=y +CONFIG_EXPORTFS=m +CONFIG_EXT2_FS=m +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_FAIR_CGROUP_SCHED=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_FAIR_USER_SCHED is not set +CONFIG_FARSYNC=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_FAT_FS=m +# CONFIG_FAULT_INJECTION is not set +CONFIG_FB=y +CONFIG_FB_3DFX=m +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_ARK=m +CONFIG_FB_ASILIANT=y +CONFIG_FB_ATY=m +CONFIG_FB_ATY128=m +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +CONFIG_FB_CIRRUS=m +CONFIG_FB_CYBER2000=m +CONFIG_FB_DDC=m +CONFIG_FB_DEFERRED_IO=y +# CONFIG_FB_IMSTT is not set +CONFIG_FB_KYRO=m +# CONFIG_FB_MACMODES is not set +CONFIG_FB_MATROX=m +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_BACKLIGHT=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_I2C=y +CONFIG_FB_PM2=m +# CONFIG_FB_PM2_FIFO_DISCONNECT is not set +CONFIG_FB_PM3=m +CONFIG_FB_RADEON=m +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_BACKLIGHT=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_I2C=y +CONFIG_FB_S1D13XXX=m +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_SM501=m +CONFIG_FB_SVGALIB=m +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +CONFIG_FB_TILEBLITTING=y +CONFIG_FB_TRIDENT=m +# CONFIG_FB_TRIDENT_ACCEL is not set +CONFIG_FB_UVESA=m +# CONFIG_FB_VIRTUAL is not set +CONFIG_FB_VOODOO1=m +CONFIG_FB_VT8623=m +CONFIG_FDDI=y +CONFIG_FEALNX=m +CONFIG_FIB_RULES=y +# CONFIG_FIREWIRE is not set +CONFIG_FIRMWARE_EDID=y +CONFIG_FIXED_MII_1000_FDX=y +# CONFIG_FIXED_MII_100_FDX is not set +# CONFIG_FIXED_MII_10_FDX is not set +CONFIG_FIXED_MII_AMNT=1 +CONFIG_FIXED_PHY=m +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x16=y +CONFIG_FONT_8x8=y +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +# CONFIG_FORCED_INLINING is not set +CONFIG_FORCE_MAX_ZONEORDER=17 +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FS_MBCACHE=m +CONFIG_FS_POSIX_ACL=y +CONFIG_FTL=m +CONFIG_FUSE_FS=m +CONFIG_FUSION=y +CONFIG_FUSION_CTL=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y +CONFIG_FUSION_MAX_SGE=40 +CONFIG_FUSION_SAS=m +CONFIG_FUSION_SPI=m +CONFIG_FUTEX=y +CONFIG_FW_LOADER=y +CONFIG_GACT_PROB=y +CONFIG_GAMEPORT=m +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GENERIC_ACL=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_HAMACHI=m +CONFIG_HAMRADIO=y +CONFIG_HANGCHECK_TIMER=m +# CONFIG_HAPPYMEAL is not set +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y +CONFIG_HAVE_ARCH_NODEDATA_EXTENSION=y +CONFIG_HDLC=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +# CONFIG_HEADERS_CHECK is not set +CONFIG_HERMES=m +CONFIG_HFSPLUS_FS=m +CONFIG_HFS_FS=m +CONFIG_HID=m +CONFIG_HIDRAW=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HID_FF is not set +CONFIG_HID_SUPPORT=y +# CONFIG_HIPPI is not set +CONFIG_HOLES_IN_ZONE=y +CONFIG_HOSTAP=m +CONFIG_HOSTAP_CS=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_PLX=m +CONFIG_HOTPLUG=y +# CONFIG_HOTPLUG_CPU is not set +CONFIG_HOTPLUG_PCI=m +CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m +CONFIG_HOTPLUG_PCI_CPCI=y +CONFIG_HOTPLUG_PCI_FAKE=m +CONFIG_HOTPLUG_PCI_PCIE=m +# CONFIG_HOTPLUG_PCI_SGI is not set +CONFIG_HOTPLUG_PCI_SHPC=m +# CONFIG_HP100 is not set +# CONFIG_HPET is not set +CONFIG_HPFS_FS=m +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_HP_SIMETH is not set +# CONFIG_HP_SIMSERIAL is not set +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_HWMON_VID=m +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_INTEL=m +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +# CONFIG_HZ_1000 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_300 is not set +CONFIG_I2C=m +CONFIG_I2C_ALGOBIT=m +CONFIG_I2C_ALGOPCA=m +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set +# CONFIG_I2C_DEBUG_CORE is not set +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PIIX4=m +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TAOS_EVM=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m +CONFIG_I2O=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_BUS=m +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_PROC=m +CONFIG_I2O_SCSI=m +CONFIG_I82092=m +CONFIG_IA32_SUPPORT=y +CONFIG_IA64=y +# CONFIG_IA64_ACPI_CPUFREQ is not set +# CONFIG_IA64_CYCLONE is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_ESI is not set +CONFIG_IA64_GENERIC=y +CONFIG_IA64_GRANULE_16MB=y +# CONFIG_IA64_GRANULE_64MB is not set +CONFIG_IA64_HP_AML_NFW=y +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_HP_ZX1 is not set +# CONFIG_IA64_HP_ZX1_SWIOTLB is not set +CONFIG_IA64_MCA_RECOVERY=m +CONFIG_IA64_MC_ERR_INJECT=m +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_64KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PALINFO=m +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_IA64_SGI_SN2 is not set +CONFIG_IA64_SGI_SN_XP=m +CONFIG_IA64_UNCACHED_ALLOCATOR=y +CONFIG_IBMOL=m +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +CONFIG_ICPLUS_PHY=m +CONFIG_IDE=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEPCI_PCIBUS_ORDER is not set +CONFIG_IDEPCI_SHARE_IRQ=y +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_IDE_ARM is not set +CONFIG_IDE_GENERIC=m +CONFIG_IDE_MAX_HWIFS=4 +CONFIG_IDE_PROC_FS=y +CONFIG_IDE_TASK_IOCTL=y +CONFIG_IEEE1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_OHCI1394=m +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +# CONFIG_IEEE1394_VERBOSEDEBUG is not set +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE80211=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_CRYPT_WEP=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_IFB=m +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INET=y +# CONFIG_INET6_AH is not set +# CONFIG_INET6_ESP is not set +CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_TUNNEL=m +# CONFIG_INET_AH is not set +CONFIG_INET_DCCP_DIAG=m +CONFIG_INET_DIAG=y +# CONFIG_INET_ESP is not set +CONFIG_INET_IPCOMP=m +CONFIG_INET_LRO=m +CONFIG_INET_TCP_DIAG=y +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_ISER=m +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFTL=m +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_INPUT=y +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_EVBUG=m +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_MISC=y +CONFIG_INPUT_MOUSE=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_TABLET=y +# CONFIG_INPUT_TOUCHSCREEN is not set +CONFIG_INPUT_UINPUT=m +CONFIG_INPUT_YEALINK=m +CONFIG_INSTRUMENTATION=y +CONFIG_IOSAPIC=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_CFQ=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_NOOP=y +CONFIG_IP1000=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_RT=m +# CONFIG_IP6_NF_QUEUE is not set +CONFIG_IP6_NF_RAW=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IPDDP=m +CONFIG_IPDDP_DECAP=y +CONFIG_IPDDP_ENCAP=y +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_HANDLER=m +# CONFIG_IPMI_PANIC_EVENT is not set +CONFIG_IPMI_POWEROFF=m +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m +CONFIG_IPV6=m +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +# CONFIG_IPV6_PRIVACY is not set +# CONFIG_IPV6_ROUTER_PREF is not set +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +CONFIG_IPW2100=m +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +CONFIG_IPW2200=m +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IPX=m +# CONFIG_IPX_INTERN is not set +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_DCCP=m +CONFIG_IP_DCCP_ACKVEC=y +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_IP_DCCP_TFRC_LIB=m +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_MROUTE=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARP_MANGLE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +# CONFIG_IP_PNP is not set +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +CONFIG_IP_SCTP=m +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_FTP=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_NQ=m +CONFIG_IP_VS_PROTO_AH=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_TAB_BITS=12 +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_WRR=m +CONFIG_IRCOMM=m +CONFIG_IRDA=m +# CONFIG_IRDA_CACHE_LAST_LSAP is not set +# CONFIG_IRDA_DEBUG is not set +# CONFIG_IRDA_FAST_RR is not set +# CONFIG_IRDA_ULTRA is not set +CONFIG_IRLAN=m +CONFIG_IRNET=m +CONFIG_IRQ_PER_CPU=y +CONFIG_IRTTY_SIR=m +CONFIG_ISCSI_TCP=m +# CONFIG_ISDN is not set +# CONFIG_ISI is not set +CONFIG_ISO9660_FS=m +# CONFIG_IWLWIFI is not set +CONFIG_IXGB=m +CONFIG_IXGBE=m +# CONFIG_IXGB_NAPI is not set +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_SUMMARY is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFS_DEBUG=y +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +CONFIG_JFS_STATISTICS=y +CONFIG_JOLIET=y +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_IFORCE=m +# CONFIG_JOYSTICK_IFORCE_232 is not set +# CONFIG_JOYSTICK_IFORCE_USB is not set +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_KARMA_PARTITION=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +CONFIG_KINGSUN_DONGLE=m +CONFIG_KMOD=y +CONFIG_KPROBES=y +CONFIG_KS0108=m +CONFIG_KS0108_DELAY=2 +CONFIG_KS0108_PORT=0x378 +CONFIG_KS959_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +CONFIG_LANMEDIA=m +# CONFIG_LAPB is not set +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +CONFIG_LDM_DEBUG=y +CONFIG_LDM_PARTITION=y +CONFIG_LEDS_CLASS=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBCRC32C=m +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_CS=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_LIBERTAS_USB=m +# CONFIG_LKDTM is not set +CONFIG_LLC=y +CONFIG_LLC2=m +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_LOCK_KERNEL=y +# CONFIG_LOGO is not set +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_LP_CONSOLE is not set +CONFIG_LSM_MMAP_MIN_ADDR=0 +CONFIG_LXT_PHY=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +CONFIG_MAC80211=m +# CONFIG_MAC80211_DEBUG is not set +CONFIG_MAC80211_DEBUGFS=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MACVLAN=m +CONFIG_MAC_PARTITION=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_MARKERS is not set +CONFIG_MARVELL_PHY=m +CONFIG_MAX_RAW_DEVS=256 +CONFIG_MCS_FIR=m +CONFIG_MD=y +CONFIG_MDIO_BITBANG=m +CONFIG_MD_FAULTY=m +CONFIG_MD_LINEAR=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_SAS=m +CONFIG_MFD_SM501=m +CONFIG_MIGRATION=y +CONFIG_MII=m +CONFIG_MINIX_FS=m +CONFIG_MINIX_SUBPARTITION=y +CONFIG_MISC_DEVICES=y +# CONFIG_MKISS is not set +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_MLX4_INFINIBAND=m +# CONFIG_MMC is not set +# CONFIG_MMTIMER is not set +CONFIG_MMU=y +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MOUSE_APPLETOUCH=m +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_PS2_TRACKPOINT=y +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_VSXXXAA=m +CONFIG_MOXA_INTELLIO=m +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +CONFIG_MSDOS_FS=m +CONFIG_MSDOS_PARTITION=y +CONFIG_MSPEC=m +# CONFIG_MSS is not set +CONFIG_MTD=m +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTD_ABSENT=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK2MTD=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_MTD_CFI=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_CHAR=m +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_CONCAT=m +CONFIG_MTD_DATAFLASH=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCECC=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCPROBE_ADDRESS=0 +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_GEN_PROBE=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_MAP_BANK_WIDTH_1=y +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +CONFIG_MTD_MAP_BANK_WIDTH_2=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTD_NAND=m +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND_IDS=m +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_2X_PROGRAM=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_SIM=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_OOPS=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_PCI=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PLATRAM=m +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_RAM=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +CONFIG_MTD_REDBOOT_PARTS=m +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +CONFIG_MTD_ROM=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_MTD_UBI_GLUEBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MYRI10GE=m +CONFIG_NATSEMI=m +CONFIG_NCPFS_EXTRAS=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_OS2_NS=y +CONFIG_NCPFS_PACKET_SIGNING=y +CONFIG_NCPFS_SMALLDOS=y +CONFIG_NCPFS_STRONG=y +CONFIG_NCP_FS=m +CONFIG_NE2K_PCI=m +CONFIG_NEED_MULTIPLE_NODES=y +CONFIG_NET=y +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETDEVICES=y +CONFIG_NETDEVICES_MULTIQUEUE=y +CONFIG_NETDEV_1000=y +CONFIG_NETDEV_10000=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +# CONFIG_NETLABEL is not set +CONFIG_NETPOLL=y +CONFIG_NETPOLL_TRAP=y +CONFIG_NETROM=m +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NETWORK_SECMARK=y +CONFIG_NETXEN_NIC=m +CONFIG_NET_9P=m +# CONFIG_NET_9P_DEBUG is not set +CONFIG_NET_9P_FD=m +CONFIG_NET_ACT_GACT=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SIMP=m +CONFIG_NET_CLS=y +CONFIG_NET_CLS_ACT=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_FW=m +# CONFIG_NET_CLS_IND is not set +# CONFIG_NET_CLS_POLICE is not set +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_U32=m +CONFIG_NET_DCCPPROBE=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_ETHERNET=y +CONFIG_NET_FC=y +# CONFIG_NET_IPGRE is not set +CONFIG_NET_IPIP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_NET_PCI=y +CONFIG_NET_PCMCIA=y +CONFIG_NET_PKTGEN=m +CONFIG_NET_POCKET=y +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_NET_SB1000=m +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_FIFO=y +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_TCPPROBE=m +CONFIG_NET_TULIP=y +CONFIG_NET_VENDOR_3COM=y +CONFIG_NEW_LEDS=y +CONFIG_NFSD=m +CONFIG_NFSD_TCP=y +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CT_NETLINK=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_TFTP=m +# CONFIG_NIU is not set +CONFIG_NL80211=y +CONFIG_NLS=y +CONFIG_NLS_ASCII=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m +CONFIG_NODES_SHIFT=8 +# CONFIG_NORTEL_HERMES is not set +CONFIG_NR_CPUS=64 +CONFIG_NR_QUICK=1 +CONFIG_NS83820=m +# CONFIG_NTFS_DEBUG is not set +CONFIG_NTFS_FS=m +# CONFIG_NTFS_RW is not set +CONFIG_NUMA=y +CONFIG_N_HDLC=m +# CONFIG_OCFS2_DEBUG_FS is not set +CONFIG_OCFS2_DEBUG_MASKLOG=y +CONFIG_OCFS2_FS=m +CONFIG_OPROFILE=m +CONFIG_OSF_PARTITION=y +CONFIG_P54_COMMON=m +CONFIG_P54_PCI=m +CONFIG_P54_USB=m +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_PARIDE=m +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_EPAT=m +CONFIG_PARIDE_EPATC8=y +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PG=m +CONFIG_PARIDE_PT=m +CONFIG_PARPORT=m +CONFIG_PARPORT_1284=y +CONFIG_PARPORT_AX88796=m +# CONFIG_PARPORT_GSC is not set +CONFIG_PARPORT_NOT_PC=y +CONFIG_PARPORT_PC=m +# CONFIG_PARPORT_PC_FIFO is not set +CONFIG_PARPORT_PC_PCMCIA=m +# CONFIG_PARPORT_PC_SUPERIO is not set +CONFIG_PARPORT_SERIAL=m +CONFIG_PARTITION_ADVANCED=y +CONFIG_PATA_ACPI=m +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_CMD64X is not set +CONFIG_PATA_CS5520=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_EFAR=m +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +CONFIG_PATA_IT8213=m +CONFIG_PATA_IT821X=m +CONFIG_PATA_JMICRON=m +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_NETCELL=m +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +CONFIG_PATA_OLDPIIX=m +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +CONFIG_PATA_PCMCIA=m +CONFIG_PATA_PDC2027X=m +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +CONFIG_PATA_RZ1000=m +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_VIA=m +CONFIG_PATA_WINBOND=m +CONFIG_PC300=m +# CONFIG_PC300TOO is not set +CONFIG_PC300_MLPPP=y +CONFIG_PCCARD=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_PCI=y +CONFIG_PCI200SYN=m +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCI_ATMEL=m +# CONFIG_PCI_DEBUG is not set +CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_HERMES is not set +CONFIG_PCI_LEGACY=y +# CONFIG_PCI_MSI is not set +CONFIG_PCI_SYSCALL=y +CONFIG_PCMCIA=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_PCMCIA_AXNET=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_IOCTL=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_NETWAVE=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_RAYCS=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_PD6729=m +CONFIG_PDA_POWER=m +# CONFIG_PDC202XX_BURST is not set +CONFIG_PDC_ADMA=m +CONFIG_PERFMON=y +CONFIG_PGTABLE_3=y +# CONFIG_PGTABLE_4 is not set +CONFIG_PHANTOM=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m +CONFIG_PHYLIB=m +# CONFIG_PID_NS is not set +CONFIG_PLIP=m +CONFIG_PLIST=y +# CONFIG_PLX_HERMES is not set +CONFIG_PM=y +# CONFIG_PM_DEBUG is not set +CONFIG_PM_DISABLE_CONSOLE=y +CONFIG_PM_LEGACY=y +CONFIG_PNP=y +CONFIG_PNPACPI=y +# CONFIG_PNP_DEBUG is not set +CONFIG_POSIX_MQUEUE=y +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_PPDEV=m +CONFIG_PPP=m +CONFIG_PPPOE=m +CONFIG_PPPOL2TP=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_SYNC_TTY=m +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_BKL=y +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_PRINTER=m +CONFIG_PRINTK=y +CONFIG_PRINTK_TIME=y +CONFIG_PRINT_QUOTA_WARNING=y +# CONFIG_PRISM54 is not set +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_PID_CPUSET=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROFILING=y +CONFIG_QFMT_V1=m +CONFIG_QFMT_V2=m +CONFIG_QLA3XXX=m +CONFIG_QNX4FS_FS=m +CONFIG_QSEMI_PHY=m +CONFIG_QUICKLIST=y +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +CONFIG_R3964=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAESTRO=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RAID_ATTRS=m +CONFIG_RAW_DRIVER=m +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +# CONFIG_REISERFS_CHECK is not set +CONFIG_REISERFS_FS=m +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_REISERFS_FS_XATTR=y +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_RELAY=y +CONFIG_RESOURCES_64BIT=y +CONFIG_RFD_FTL=m +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +CONFIG_RIO=m +CONFIG_RIO_OLDPCI=y +CONFIG_ROCKETPORT=m +CONFIG_ROMFS_FS=m +CONFIG_ROSE=m +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT2X00=m +# CONFIG_RT2X00_DEBUG is not set +CONFIG_RT2X00_LIB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT73USB=m +CONFIG_RTC_CLASS=m +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_TEST=m +CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=m +CONFIG_RTL8187=m +CONFIG_RT_MUTEXES=y +# CONFIG_RT_MUTEX_TESTER is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_RXKAD=m +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +# CONFIG_SAMPLES is not set +CONFIG_SATA_AHCI=m +CONFIG_SATA_INIC162X=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_SVW=m +CONFIG_SATA_SX4=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SC92031=m +# CONFIG_SCHEDSTATS is not set +CONFIG_SCHED_DEBUG=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +# CONFIG_SCHED_SMT is not set +CONFIG_SCSI=m +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_AIC79XX=m +CONFIG_SCSI_AIC7XXX=m +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_AIC94XX=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_DC395x=m +# CONFIG_SCSI_DEBUG is not set +CONFIG_SCSI_DMA=y +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_FC_TGT_ATTRS=y +# CONFIG_SCSI_FUTURE_DOMAIN is not set +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_IMM=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_DUMP is not set +# CONFIG_SCSI_IPR_TRACE is not set +CONFIG_SCSI_IPS=m +CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_LOWLEVEL=y +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_NETLINK=y +CONFIG_SCSI_PPA=m +CONFIG_SCSI_PROC_FS=y +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_QLOGIC_1280=m +CONFIG_SCSI_SAS_ATA=y +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_TGT=m +CONFIG_SCSI_WAIT_SCAN=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_MD5 is not set +CONFIG_SCTP_HMAC_NONE=y +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SECURITY=y +CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 +# CONFIG_SECURITY_APPARMOR_DISABLE is not set +CONFIG_SECURITY_CAPABILITIES=y +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_SECURITY_NETWORK=y +# CONFIG_SECURITY_NETWORK_XFRM is not set +CONFIG_SECURITY_SELINUX=y +CONFIG_SECURITY_SELINUX_AVC_STATS=y +CONFIG_SECURITY_SELINUX_BOOTPARAM=y +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 +CONFIG_SECURITY_SELINUX_DEVELOP=y +CONFIG_SECURITY_SELINUX_DISABLE=y +# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set +# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_TSL2550=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_CS=m +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_NR_UARTS=48 +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_PNP=y +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_JSM=m +CONFIG_SERIAL_NONSTANDARD=y +CONFIG_SERIAL_SGI_IOC3=m +CONFIG_SERIAL_SGI_IOC4=m +CONFIG_SERIAL_SGI_L1_CONSOLE=y +CONFIG_SERIO=y +CONFIG_SERIO_I8042=m +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SERIO_RAW=m +CONFIG_SERIO_SERPORT=m +CONFIG_SGI_IOC3=m +CONFIG_SGI_IOC4=m +CONFIG_SGI_MBCS=m +CONFIG_SGI_PARTITION=y +CONFIG_SGI_SN=y +CONFIG_SGI_SNSC=y +CONFIG_SGI_TIOCX=y +CONFIG_SHAPER=m +CONFIG_SHMEM=y +CONFIG_SIGMATEL_FIR=m +CONFIG_SIGNALFD=y +CONFIG_SIS190=m +CONFIG_SIS900=m +# CONFIG_SK98LIN is not set +CONFIG_SKFP=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SLAB is not set +CONFIG_SLABINFO=y +CONFIG_SLHC=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +CONFIG_SLIP_MODE_SLIP6=y +CONFIG_SLIP_SMART=y +# CONFIG_SLOB is not set +CONFIG_SLUB=y +CONFIG_SLUB_DEBUG=y +# CONFIG_SLUB_DEBUG_ON is not set +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_SMP=y +CONFIG_SMSC_PHY=m +CONFIG_SOLARIS_X86_PARTITION=y +# CONFIG_SOUND is not set +# CONFIG_SPARSEMEM_MANUAL is not set +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +# CONFIG_SPECIALIX is not set +CONFIG_SPI=y +CONFIG_SPI_AT25=m +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_LM70_LLP=m +CONFIG_SPI_MASTER=y +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_SSB=m +CONFIG_SSB_DEBUG=y +CONFIG_SSB_DRIVER_PCICORE=y +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCIHOST_POSSIBLE=y +# CONFIG_SSB_PCMCIAHOST is not set +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +CONFIG_SSB_POSSIBLE=y +CONFIG_SSFDC=m +CONFIG_STALDRV=y +CONFIG_STANDALONE=y +CONFIG_STOP_MACHINE=y +CONFIG_STRIP=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +# CONFIG_SUNGEM is not set +CONFIG_SUNRPC=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_XPRT_RDMA=m +CONFIG_SUN_PARTITION=y +CONFIG_SWAP=y +CONFIG_SWIOTLB=y +# CONFIG_SX is not set +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_CS=m +CONFIG_SYNCLINK_GT=m +CONFIG_SYN_COOKIES=y +CONFIG_SYSCTL=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_SYSFS=y +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_SYSV68_PARTITION=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_COMPAT=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_SYSV_FS=m +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_TASK_XACCT=y +CONFIG_TCG_ATMEL=m +CONFIG_TCG_INFINEON=m +CONFIG_TCG_NSC=m +CONFIG_TCG_TIS=m +CONFIG_TCG_TPM=m +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=y +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_ILLINOIS=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_MD5SIG=y +CONFIG_TEHUTI=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TIFM_7XX1=m +CONFIG_TIFM_CORE=m +CONFIG_TIGON3=m +CONFIG_TIMER_STATS=y +# CONFIG_TINY_SHMEM is not set +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +# CONFIG_TMD_HERMES is not set +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +# CONFIG_TMS380TR is not set +CONFIG_TR=y +CONFIG_TULIP=m +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_NAPI is not set +CONFIG_TUN=m +CONFIG_TUNER_3036=m +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_SIMPLE=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TYPHOON=m +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_UFS_DEBUG is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +CONFIG_UIO=m +CONFIG_UIO_CIF=m +CONFIG_ULI526X=m +CONFIG_ULTRIX_PARTITION=y +CONFIG_UNIX=y +CONFIG_UNIX98_PTYS=y +CONFIG_UNIXWARE_DISKLABEL=y +CONFIG_UNUSED_SYMBOLS=y +CONFIG_USB=m +CONFIG_USB_ACM=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_AUERSWALD=m +CONFIG_USB_BELKIN=y +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_CATC=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_DABUSB=m +# CONFIG_USB_DEBUG is not set +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +CONFIG_USB_DSBR=m +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EMI26=m +CONFIG_USB_EMI62=m +CONFIG_USB_EPSON2888=y +CONFIG_USB_ET61X251=m +CONFIG_USB_EZUSB=y +CONFIG_USB_FTDI_ELAN=m +# CONFIG_USB_GADGET is not set +CONFIG_USB_HID=m +CONFIG_USB_HIDDEV=y +CONFIG_USB_HIDINPUT_POWERBOOK=y +CONFIG_USB_IBMCAM=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_IOWARRIOR=m +CONFIG_USB_IRDA=m +# CONFIG_USB_ISP116X_HCD is not set +CONFIG_USB_KAWETH=m +CONFIG_USB_KBD=m +CONFIG_USB_KC2190=y +CONFIG_USB_KONICAWC=m +CONFIG_USB_LCD=m +CONFIG_USB_LD=m +CONFIG_USB_LED=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LIBUSUAL=y +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +CONFIG_USB_MON=y +CONFIG_USB_MOUSE=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_RNDIS_HOST=m +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_HCD=m +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OTG is not set +# CONFIG_USB_OV511 is not set +CONFIG_USB_PEGASUS=m +# CONFIG_USB_PERSIST is not set +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_PRINTER=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_R8A66597_HCD=m +CONFIG_USB_RIO500=m +CONFIG_USB_RTL8150=m +CONFIG_USB_SE401=m +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IPW=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_SL811_CS=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SN9C102=m +CONFIG_USB_STORAGE=m +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_DATAFAB=y +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STV680=m +CONFIG_USB_SUPPORT=y +CONFIG_USB_SUSPEND=y +# CONFIG_USB_TEST is not set +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_UHCI_HCD=m +CONFIG_USB_USBNET=m +CONFIG_USB_USS720=m +CONFIG_USB_VICAM=m +CONFIG_USB_W9968CF=m +CONFIG_USB_ZC0301=m +CONFIG_USB_ZD1201=m +CONFIG_USB_ZR364XX=m +# CONFIG_USER_NS is not set +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VERSION_SIGNATURE="Unofficial" +CONFIG_VETH=m +CONFIG_VFAT_FS=m +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +CONFIG_VGASTATE=m +CONFIG_VGA_CONSOLE=y +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_VIA_VELOCITY=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m +# CONFIG_VIDEO_ADV_DEBUG is not set +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_CX2341X=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_CX25840=m +CONFIG_VIDEO_CX88=m +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_DEV=m +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_FB_IVTV=m +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_MSP3400=m +# CONFIG_VIDEO_MXB is not set +CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_29XXX=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_DVB=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_USBVIDEO=m +# CONFIG_VIDEO_USBVISION is not set +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_VP27SMPX=m +CONFIG_VIDEO_VPX3220=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_WM8775=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VIRTUAL_MEM_MAP=y +CONFIG_VIRT_TO_BUS=y +CONFIG_VITESSE_PHY=m +CONFIG_VLAN_8021Q=m +# CONFIG_VLSI_FIR is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VORTEX=m +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_VXFS_FS=m +CONFIG_W1=m +CONFIG_W1_CON=y +CONFIG_W1_MASTER_DS2482=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2760=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_THERM=m +CONFIG_WAN=y +CONFIG_WANXL=m +CONFIG_WAN_ROUTER=m +CONFIG_WAN_ROUTER_DRIVERS=m +# CONFIG_WATCHDOG is not set +CONFIG_WDC_ALI15X3=y +CONFIG_WINBOND_840=m +CONFIG_WIRELESS_EXT=y +CONFIG_WLAN_80211=y +CONFIG_WLAN_PRE80211=y +# CONFIG_X25 is not set +CONFIG_XFRM=y +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_SUB_POLICY is not set +CONFIG_XFRM_USER=m +CONFIG_XFS_FS=m +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_QUOTA=y +# CONFIG_XFS_RT is not set +CONFIG_XFS_SECURITY=y +CONFIG_XOR_BLOCKS=m +CONFIG_YAM=m +CONFIG_YELLOWFIN=m +CONFIG_YENTA=m +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_ZISOFS=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZONE_DMA=y +CONFIG_ZONE_DMA_FLAG=1 --- linux-2.6.24.orig/debian/config/ia64/config.mckinley +++ linux-2.6.24/debian/config/ia64/config.mckinley @@ -0,0 +1,6 @@ +# +# Config options for config.mckinley automatically generated by splitconfig.pl +# +CONFIG_IA64_L1_CACHE_SHIFT=7 +# CONFIG_ITANIUM is not set +CONFIG_MCKINLEY=y --- linux-2.6.24.orig/debian/config/ia64/config.itanium +++ linux-2.6.24/debian/config/ia64/config.itanium @@ -0,0 +1,7 @@ +# +# Config options for config.itanium automatically generated by splitconfig.pl +# +CONFIG_IA64_BRL_EMU=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set --- linux-2.6.24.orig/debian/control.d/vars.powerpc +++ linux-2.6.24/debian/control.d/vars.powerpc @@ -0,0 +1,9 @@ +supported="32-bit PowerPC" +target="Geared toward desktop or server systems." +desc="32-bit PowerPC" +bootloader="yaboot" +provides="redhat-cluster-modules, ivtv-modules" +arch="powerpc" + +# Keep in sync with debian/control.stub.in Build-Depends. +header_depends="gcc-4.1," --- linux-2.6.24.orig/debian/control.d/vars.386 +++ linux-2.6.24/debian/control.d/vars.386 @@ -0,0 +1,7 @@ +supported="Alternate x86 (486 and better)" +target="Geared toward desktop systems." +desc="i386" +bootloader="lilo (>= 19.1) | grub" +provides="kvm-api-4, ivtv-modules" +arch=i386 +do_debug="Yes" --- linux-2.6.24.orig/debian/control.d/flavour-control-debug.stub +++ linux-2.6.24/debian/control.d/flavour-control-debug.stub @@ -0,0 +1,26 @@ +# Items that get replaced: +# FLAVOUR +# DESC +# ARCH +# SUPPORTED +# TARGET +# BOOTLOADER +# =PROVIDES= +# +# Items marked with =FOO= are optional +# +# XXX: Leave the blank line before the first package!! + +Package: linux-image-debug-PKGVER-ABINUM-FLAVOUR +Architecture: ARCH +Section: devel +Priority: optional +Provides: linux-debug +Description: Linux kernel debug image for version PKGVER on DESC + This package provides a kernel debug image for version PKGVER on + DESC. + . + This is for sites that wish to debug the kernel. + . + The kernel image contained in this package is NOT meant to boot from. It + is uncompressed, and unstripped. --- linux-2.6.24.orig/debian/control.d/vars.generic +++ linux-2.6.24/debian/control.d/vars.generic @@ -0,0 +1,7 @@ +arch="i386 amd64" +supported="Generic" +target="Geared toward desktop systems." +desc="x86/x86_64" +bootloader="lilo (>= 19.1) | grub" +provides="kvm-api-4, redhat-cluster-modules, ivtv-modules" +do_debug="Yes" --- linux-2.6.24.orig/debian/control.d/vars.sparc64-smp +++ linux-2.6.24/debian/control.d/vars.sparc64-smp @@ -0,0 +1,6 @@ +supported="64-bit UltraSPARC SMP" +target="Geared toward desktop or server systems." +desc="64-bit UltraSPARC SMP" +bootloader="silo" +provides="redhat-cluster-modules, ivtv-modules" +arch="sparc" --- linux-2.6.24.orig/debian/control.d/vars.hppa32 +++ linux-2.6.24/debian/control.d/vars.hppa32 @@ -0,0 +1,9 @@ +supported="32-bit HP PA-RISC SMP" +target="Geared toward desktop or server systems." +desc="32-bit HP PA-RISC SMP" +bootloader="palo" +provides="redhat-cluster-modules" +arch="hppa" + +# Keep in sync with debian/control.stub.in Build-Depends. +header_depends="gcc-4.1," --- linux-2.6.24.orig/debian/control.d/flavour-control.stub +++ linux-2.6.24/debian/control.d/flavour-control.stub @@ -0,0 +1,52 @@ +# Items that get replaced: +# FLAVOUR +# DESC +# ARCH +# SUPPORTED +# TARGET +# BOOTLOADER +# =PROVIDES= +# =HEADER_DEPENDS= +# +# Items marked with =FOO= are optional +# +# XXX: Leave the blank line before the first package!! + +Package: linux-image-PKGVER-ABINUM-FLAVOUR +Architecture: ARCH +Section: SECTION_IMAGE +Priority: optional +Pre-Depends: dpkg (>= 1.10.24) +Provides: linux-image, linux-image-2.6, fuse-module, =PROVIDES= +Depends: initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3) +Conflicts: hotplug (<< 0.0.20040105-1) +Recommends: BOOTLOADER +Suggests: fdutils, linux-doc-PKGVER | linux-source-PKGVER +Description: Linux kernel image for version PKGVER on DESC + This package contains the Linux kernel image for version PKGVER on + DESC. + . + Also includes the corresponding System.map file, the modules built by the + packager, and scripts that try to ensure that the system is not left in an + unbootable state after an update. + . + Supports SUPPORTED processors. + . + TARGET + . + You likely do not want to install this package directly. Instead, install + the linux-FLAVOUR meta-package, which will ensure that upgrades work + correctly, and that supporting packages are also installed. + +Package: linux-headers-PKGVER-ABINUM-FLAVOUR +Architecture: ARCH +Section: SECTION_HEADERS +Priority: optional +Depends: coreutils | fileutils (>= 4.0), linux-headers-PKGVER-ABINUM, =HEADER_DEPENDS= ${shlibs:Depends} +Provides: linux-headers, linux-headers-2.6 +Description: Linux kernel headers for version PKGVER on DESC + This package provides kernel header files for version PKGVER on + DESC. + . + This is for sites that want the latest kernel headers. Please read + /usr/share/doc/linux-headers-PKGVER-ABINUM/debian.README.gz for details. --- linux-2.6.24.orig/debian/control.d/vars.mckinley +++ linux-2.6.24/debian/control.d/vars.mckinley @@ -0,0 +1,9 @@ +supported="Itanium II SMP" +target="Geared toward desktop or server systems." +desc="Itanium II SMP" +bootloader="elilo (>= 3.6-1)" +provides="redhat-cluster-modules, ivtv-modules" +arch="ia64" + +# Keep in sync with debian/control.stub.in Build-Depends. +header_depends="gcc-4.1," --- linux-2.6.24.orig/debian/control.d/vars.sparc64 +++ linux-2.6.24/debian/control.d/vars.sparc64 @@ -0,0 +1,6 @@ +supported="64-bit UltraSPARC" +target="Geared toward desktop or server systems." +desc="64-bit UltraSPARC" +bootloader="silo" +provides="redhat-cluster-modules, ivtv-modules" +arch="sparc" --- linux-2.6.24.orig/debian/control.d/vars.powerpc-smp +++ linux-2.6.24/debian/control.d/vars.powerpc-smp @@ -0,0 +1,9 @@ +supported="32-bit PowerPC SMP" +target="Geared toward desktop or server systems." +desc="32-bit PowerPC SMP" +bootloader="yaboot" +provides="redhat-cluster-modules, ivtv-modules" +arch="powerpc" + +# Keep in sync with debian/control.stub.in Build-Depends. +header_depends="gcc-4.1," --- linux-2.6.24.orig/debian/control.d/vars.hppa64 +++ linux-2.6.24/debian/control.d/vars.hppa64 @@ -0,0 +1,9 @@ +supported="64-bit HP PA-RISC SMP" +target="Geared toward desktop or server systems." +desc="64-bit HP PA-RISC SMP" +bootloader="palo" +provides="redhat-cluster-modules" +arch="hppa" + +# Keep in sync with debian/control.stub.in Build-Depends. +header_depends="gcc-4.1-hppa64, binutils-hppa64," --- linux-2.6.24.orig/debian/control.d/vars.powerpc64-smp +++ linux-2.6.24/debian/control.d/vars.powerpc64-smp @@ -0,0 +1,9 @@ +supported="64-bit PowerPC SMP" +target="Geared toward desktop or server systems." +desc="64-bit PowerPC SMP" +bootloader="yaboot" +provides="redhat-cluster-modules, ivtv-modules" +arch="powerpc" + +# Keep in sync with debian/control.stub.in Build-Depends. +header_depends="gcc-4.1," --- linux-2.6.24.orig/debian/control.d/vars.server +++ linux-2.6.24/debian/control.d/vars.server @@ -0,0 +1,7 @@ +arch="i386 amd64" +supported="Server" +target="Geared toward server systems." +desc="x86/x86_64" +bootloader="lilo (>= 19.1) | grub" +provides="redhat-cluster-modules, kvm-api-4, ivtv-modules" +do_debug="Yes" --- linux-2.6.24.orig/debian/control.d/vars.itanium +++ linux-2.6.24/debian/control.d/vars.itanium @@ -0,0 +1,9 @@ +supported="Itanium SMP" +target="Geared toward desktop or server systems." +desc="Itanium SMP" +bootloader="elilo (>= 3.6-1)" +provides="redhat-cluster-modules, ivtv-modules" +arch="ia64" + +# Keep in sync with debian/control.stub.in Build-Depends. +header_depends="gcc-4.1," --- linux-2.6.24.orig/debian/control.d/vars.virtual +++ linux-2.6.24/debian/control.d/vars.virtual @@ -0,0 +1,7 @@ +arch="i386" +supported="Virtual" +target="Geared toward virtualised hardware." +desc="x86" +bootloader="lilo (>= 19.1) | grub" +provides="kvm-api-4, redhat-cluster-modules" +do_debug="Yes" --- linux-2.6.24.orig/debian/scripts/control-create +++ linux-2.6.24/debian/scripts/control-create @@ -0,0 +1,33 @@ +#!/bin/bash + +stub=debian/control.d/flavour-control.stub +dstub=debian/control.d/flavour-control-debug.stub +vars=$1 + +# Defaults +section_image=base +section_headers=devel + +. $vars + +flavour=$(basename $vars | sed 's/.*\.//') +# Custom is a little different +if [ "$flavour" = "vars" ]; then + flavour=$(basename `dirname $vars`) +fi + +if [ -n "$do_debug" ]; then + stub="$stub $dstub" +fi + +cat $stub | grep -v '^#' | sed \ + -e "s#FLAVOUR#$flavour#g" \ + -e "s#DESC#$desc#g" \ + -e "s#ARCH#$arch#g" \ + -e "s#SUPPORTED#$supported#g" \ + -e "s#TARGET#$target#g" \ + -e "s#BOOTLOADER#$bootloader#g" \ + -e "s#=PROVIDES=#$provides#g" \ + -e "s#SECTION_IMAGE#$section_image#g" \ + -e "s#SECTION_HEADERS#$section_headers#g" \ + -e "s#=HEADER_DEPENDS=#$header_depends#g" --- linux-2.6.24.orig/debian/scripts/abi-check +++ linux-2.6.24/debian/scripts/abi-check @@ -0,0 +1,44 @@ +#!/bin/bash -e + +flavour="$1" +prev_abinum="$2" +abinum="$3" +prev_abidir="$4" +abidir="$5" +skipabi="$6" + +echo -n "Checking ABI for $flavour..." + +if [ -f "$prev_abidir/ignore" -o -f "$prev_abidir/$flavour.ignore" -o -n "$skipabi" ]; then + echo "explicitly asked to ignore ABI (probably not good)" + exit +fi + +if [ "$prev_abinum" = "0" -o "$prev_abinum" != "$abinum" ]; then + echo "different ABI numbers, no check needed." + exit +fi + +if [ ! -f "$abidir/$flavour" -o ! -f "$prev_abidir/$flavour" ]; then + echo "previous or current ABI file missing!" + echo " $abidir/$flavour" + echo " $prev_abidir/$flavour" + exit 1 +fi + +if [ "`diff -u $prev_abidir/$flavour $abidir/$flavour | grep ^-[^-] | wc -l`" != "0" ] +then + echo "check FAILED (nice one Tonto, go get the Lone Ranger)" + diff -u $prev_abidir/$flavour $abidir/$flavour + exit 1 +fi + +if [ "`diff -u $prev_abidir/$flavour $abidir/$flavour | grep ^+[^+] | wc -l`" != "0" ] +then + echo "new symbols in ABI (continuing reluctantly)" + diff -u $prev_abidir/$flavour $abidir/$flavour || true + exit +fi + +echo "check PASSED (good job, you saved yourself some work)" +exit --- linux-2.6.24.orig/debian/scripts/module-check +++ linux-2.6.24/debian/scripts/module-check @@ -0,0 +1,119 @@ +#!/usr/bin/perl -w + +$flavour = shift; +$prev_abidir = shift; +$abidir = shift; +$skipmodule = shift; + +print "II: Checking modules for $flavour..."; + +if (-f "$prev_abidir/ignore.modules" + or -f "$prev_abidir/$flavour.ignore.modules") { + print "explicitly ignoring modules\n"; + exit(0); +} + +if (not -f "$abidir/$flavour.modules" or not -f + "$prev_abidir/$flavour.modules") { + print "previous or current modules file missing!\n"; + print " $abidir/$flavour.modules\n"; + print " $prev_abidir/$flavour.modules\n"; + if (defined($skipmodule)) { + exit(0); + } else { + exit(1); + } +} + +print "\n"; + +my %modules; +my %modules_ignore; +my $missing = 0; +my $new = 0; +my $errors = 0; + +# See if we have any ignores +if (-f "$prev_abidir/../modules.ignore") { + my $ignore = 0; + open(IGNORE, "< $prev_abidir/../modules.ignore") or + die "Could not open $prev_abidir/../modules.ignore"; + print " reading modules to ignore..."; + while () { + chomp; + $modules_ignore{$_} = 1; + $ignore++; + } + close(IGNORE); + print "read $ignore modules.\n"; +} + +# Read new modules first +print " reading new modules..."; +$new_count = 0; +open(NEW, "< $abidir/$flavour.modules") or + die "Could not open $abidir/$flavour.modules"; +while () { + chomp; + $modules{$_} = 1; + $new_count++; +} +close(NEW); +print "read $new_count modules.\n"; + +# Now the old modules, checking for missing ones +print " reading old modules..."; +$old_count = 0; +open(OLD, "< $prev_abidir/$flavour.modules") or + die "Could not open $prev_abidir/$flavour.modules"; +while () { + chomp; + if (not defined($modules{$_})) { + print "\n" if not $missing; + $missing++; + if (not defined($modules_ignore{$_})) { + print " MISS: $_\n"; + $errors++; + } else { + print " MISS: $_ (ignored)\n"; + } + } else { + $modules{$_}++; + } + $old_count++; +} +close(OLD); +# Check for new modules +foreach $mod (keys(%modules)) { + if ($modules{$mod} < 2) { + print "\n" if not $missing and not $new; + print " NEW : $mod\n"; + $new++; + } +} +if ($new or $missing) { + print " read $old_count modules : new($new) missing($missing)\n"; +} else { + print "read $old_count modules.\n"; +} + + +# Let's see where we stand... +if ($errors) { + if (defined($skipmodule)) { + print "WW: Explicitly asked to ignore failures (probably not good)\n"; + } else { + print "EE: Missing modules (start begging for mercy)\n"; + exit 1 + } +} + +if ($new) { + print "II: New modules (you've been busy, wipe the poop off your nose)\n"; +} else { + print "II: No new modules (hope you're happy, slacker)\n"; +} + +print "II: Done\n"; + +exit(0); --- linux-2.6.24.orig/debian/scripts/link-headers +++ linux-2.6.24/debian/scripts/link-headers @@ -0,0 +1,79 @@ +#!/bin/bash -e + +hdrdir="$1" +symdir="$2" +srcdir="$3" +build_arch="$4" +flavour="$5" + +echo "Symlinking and copying headers for $flavour..." + +# XXX Special case for ppc +if [ "$build_arch" = "powerpc" ]; then + install -d -m755 $hdrdir/arch/powerpc/include + ln -fsn ../../../include/asm-ppc $hdrdir/arch/powerpc/include/asm +fi + +excludes='( -path ./debian -prune -o -path ./.git ) -prune -o' + +# For custom builds, we have to take care of a few things. First, we want +# to check for files to symlink and copy in the srcdir, not the stock src. +# We compare against stock source, copying for files that aren't the same, +# and later symlinking for same files. +if [ -n "$srcdir" ]; then + ( + cd $srcdir + find . $excludes -type f \ + \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \ + -name '*.sh' -o -name '*.pl' -o -name '*.lds' \) -print + find ./include ./scripts -name .gitignore -prune -o -type f -print + ) | ( + while read file; do + if [ -e "$hdrdir/$file" ]; then + continue + fi + + # If the files are not the same, copy it + if ! cmp -s "$file" "$srcdir/$file"; then + echo $file + fi + done + ) | ( + cd $srcdir + cpio -pd --preserve-modification-time "$hdrdir" + ) +else + srcdir="." +fi + +( +cd $srcdir +find . $excludes -type f \ + \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \ + -name '*.sh' -o -name '*.pl' -o -name '*.lds' \) -print +find ./include ./scripts -name .gitignore -prune -o -type f -print +find ./include -mindepth 1 -maxdepth 1 $excludes -type d -print +) | ( +while read file; do + dir=$file + lastdir=$file + + if [ -f "$hdrdir/$file" ]; then + continue + fi + + while [ ! -e "$hdrdir/$dir" -a ! -L "$hdrdir/$dir" ]; do + lastdir=$dir + dir=`dirname $dir` + done + # If the last item to exist is a symlink we assume all is good + if [ ! -L "$hdrdir/$dir" ]; then + # Turns things like "./foo" into "../" + deref="`echo -n $lastdir | sed -e 's/^\.//' -e's,/[^/]*,../,g'`" + item="`echo -n $lastdir | sed -e 's/^\.\///'`" + ln -s $deref$symdir/$item $hdrdir/$item + fi +done +) + +exit --- linux-2.6.24.orig/debian/scripts/misc/ppa-cron-job +++ linux-2.6.24/debian/scripts/misc/ppa-cron-job @@ -0,0 +1,47 @@ +#!/bin/sh + +# +# Use this script as a template for the daily kernel build cron job. +# You should copy it somewhere outside of the git tree 'cause the whole +# git tree gets removed and recreated. +# +KNAME=hardy +DAILY_BUILD_DIR=${KBDIR:=${HOME}/${KNAME}} +KERNEL_GIT_REPO=${KREPO:=/srv/kernel.ubuntu.com/git/ubuntu/ubuntu-${KNAME}.git} + +# +# Nothing works unless there is a dput configuration. +# +if [ ! -f ${HOME}/.dput.cf ] +then + echo No dput configuration. + exit 1 +fi + +if [ ! -d ${DAILY_BUILD_DIR} ] +then + rm -rf ${DAILY_BUILD_DIR} + mkdir -p ${DAILY_BUILD_DIR} +fi + +# +# Start with a fresh repo. +# +cd ${DAILY_BUILD_DIR} +rm -rf ubuntu-${KNAME} +git clone ${KERNEL_GIT_REPO} + +# +# Remember that the success of prepare-ppa depends on +# this user account having an un-passworded GPG key. +# Otherwise it requires user intervention, e.g., a +# user must enter the GPG key password. +# +rm -f *.changes +(cd ubuntu-${KNAME}; debian/scripts/misc/prepare-ppa-source) + +find . -maxdepth 1 -type f -name "*.changes" | while read f +do + echo dput my-ppa $f +done + --- linux-2.6.24.orig/debian/scripts/misc/getabis +++ linux-2.6.24/debian/scripts/misc/getabis @@ -0,0 +1,86 @@ +#!/bin/bash + +if [ "$#" != "2" ]; then + echo "Usage: $0 " 1>&2 + exit 1 +fi + +ver=$1 +revision=$2 +abi=$(echo $revision | awk -F. '{print $1}') + +verabi=$ver-$abi +verfull=$ver-$revision + +repo="http://archive.ubuntu.com/ubuntu/pool/main/l" +repo_ports="http://ports.ubuntu.com/ubuntu-ports/pool/main/l" +repo_uni="http://archive.ubuntu.com/ubuntu/pool/universe/l" + +WGET="wget --quiet -c" + +abidir="`pwd`/debian/abi/$verfull" +tmpdir="`pwd`/abi-tmp-$verfull" +origdir="`pwd`" + +test -d $tmpdir || mkdir $tmpdir + +getall() { + arch=$1 + shift + + mkdir -p $abidir/$arch + + for sub in $@; do + if [ -f $abidir/$arch/$sub ]; then + echo "Exists: $sub" + continue + fi + echo -n "Fetching $sub..." + filename=linux-image-${verabi}-${sub}_${verfull}_${arch}.deb + cd $tmpdir + if ! [ -f $filename ]; then + $WGET $repo/linux/$filename + fi + if ! [ -f $filename ]; then + $WGET $repo_ports/linux/$filename + fi + if ! [ -f $filename ]; then + $WGET $repo_uni/linux/$filename + fi + if [ "$?" = "0" ]; then + echo -n "extracting..." + dpkg-deb --extract $filename tmp + if [ -f tmp/boot/abi-* ]; then + mv tmp/boot/abi-* $abidir/$arch/$sub + else + echo -n "NO ABI FILE..." + fi + (cd tmp; find lib/modules/$verabi-$sub/kernel -name '*.ko') | \ + sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > \ + $abidir/$arch/$sub.modules + rm -rf tmp $filename + echo "done." + else + echo "FAILED." + fi + cd $origdir + done +} + +# MAIN + +# Setup abi directory +mkdir -p $abidir +echo $abi > $abidir/abiname + +# NOTE: The flavours are hardcoded, because they may have changed from the +# current build. + +getall powerpc powerpc{,-smp,64-smp} +getall amd64 generic server +getall i386 386 generic server virtual +getall sparc sparc64{,-smp} +getall ia64 itanium mckinley +getall hppa hppa32 hppa64 + +rmdir $tmpdir --- linux-2.6.24.orig/debian/scripts/misc/insert-changes.pl +++ linux-2.6.24/debian/scripts/misc/insert-changes.pl @@ -0,0 +1,30 @@ +#!/usr/bin/perl -w + +system("make -s -f debian/rules printchanges > debian/changes"); + +open(CHANGELOG, "< debian/changelog") or die "Cannot open changelog"; +open(CHANGES, "< debian/changes") or die "Cannot open new changes"; +open(NEW, "> debian/changelog.new") or die "Cannot open new changelog"; + +$printed = 0; + +while () { + if (/^ CHANGELOG: /) { + next if $printed; + + while () { + print NEW; + } + + $printed = 1; + } else { + print NEW; + } +} + +close(NEW); +close(CHANGES); +close(CHANGELOG); + +rename("debian/changelog.new", "debian/changelog"); +unlink("debian/changes"); --- linux-2.6.24.orig/debian/scripts/misc/apply-patch-to-binary-custom +++ linux-2.6.24/debian/scripts/misc/apply-patch-to-binary-custom @@ -0,0 +1,22 @@ +#!/bin/bash + +# Given an input file name, apply as a patch +# to all of the flattened custom binary source trees. +# +# Ex: debian/scripts/misc/apply-patch-to-binary-custom 0001-sound-oss-remove-offset-from-load_patch-callbacks.patch +# + +if [ -z "$1" ] ; then + echo usage: $0 PATCH_FILE + exit 1 +fi +if [ ! -f $1 ] ; then + echo $1 does not exit. + exit 1 +fi + +for i in debian/binary-custom.d/*/src +do + patch -p1 -d $i < $1 +done + --- linux-2.6.24.orig/debian/scripts/misc/oldconfig +++ linux-2.6.24/debian/scripts/misc/oldconfig @@ -0,0 +1,66 @@ +#!/bin/bash + +# We have to be in the top level kernel source directory +if [ ! -f MAINTAINERS ] || [ ! -f Makefile ]; then + echo "This does not appear to be the kernel source directory." 1>&2 + exit 1 +fi + + +# One arg, and that's it. Just pass an architecture +if [ $# -ne 1 ]; then + echo "Usage: $0 " 1>&2 + exit 1 +fi + +arch="$1" + +case "$arch" in + sparc) kernarch="sparc64" ;; + amd64) kernarch="x86_64" ;; + hppa) kernarch="parisc" ;; + lpia) kernarch="i386" ;; + *) kernarch="$arch" ;; +esac + +confdir="`pwd`/debian/config/$arch" +bindir="`pwd`/debian/scripts/misc" + +# Make sure the architecture exists +if [ ! -d $confdir ]; then + echo "Could not find config directory for $arch" 1>&2 + exit 1 +fi + +echo "Processing $arch ($kernarch) ... " + +configs=$(cd $confdir && ls config.*) + +if [ -f $confdir/config ]; then + for config in $configs; do + case $config in + *) + cat $confdir/config >> $confdir/$config + ;; + esac + done + rm -f $confdir/config +fi + +test -d build || mkdir build +cd build +for config in $configs; do + echo "Running silentoldconfig for $config ... " + + cat $confdir/$config > .config + + make -C ../ O=`pwd` silentoldconfig ARCH=$kernarch + + cat .config > $confdir/$config +done +cd .. + +echo "Running splitconfig.pl ... " +echo + +(cd $confdir ; $bindir/splitconfig.pl) --- linux-2.6.24.orig/debian/scripts/misc/splitconfig.pl +++ linux-2.6.24/debian/scripts/misc/splitconfig.pl @@ -0,0 +1,110 @@ +#!/usr/bin/perl -w + +%configs = (); +%common = (); + +print "Reading config's ...\n"; + +opendir(DIR, "."); + +while (defined($config = readdir(DIR))) { + # Only config.* + next if $config !~ /^config\..*/; + # Nothing that is disabled, or remnant + next if $config =~ /.*\.(default|disabled|stub)$/; + # Server config's are standalone + #next if $config =~ /config.server-.*/; + + %{$configs{$config}} = (); + + print " processing $config ... "; + + open(CONFIG, "< $config"); + + while () { + /^#*\s*CONFIG_(\w+)[\s=](.*)$/ or next; + + ${$configs{$config}}{$1} = $2; + + $common{$1} = $2; + } + + close(CONFIG); + + print "done.\n"; +} + +closedir(DIR); + +print "\n"; + +print "Merging lists ... \n"; + +for $config (keys(%configs)) { + my %options = %{$configs{$config}}; + + print " processing $config ... "; + + for $key (keys(%common)) { + next if not defined $common{$key}; + + # If we don't have the common option, then it isn't + # common. If we do have that option, it must have the same + # value (this is where the old split.py was broken). It + # also did the common check while it was parsing files, so + # that there were cases where a non-common option was in + # common anyway (ordering). + if (not defined($options{$key})) { + undef $common{$key}; + } elsif ($common{$key} ne $options{$key}) { + undef $common{$key}; + } + } + + print "done.\n"; +} + +print "\n"; + +print "Creating common config ... "; + +open(COMMON, "> config"); +print COMMON "#\n# Common config options automatically generated by splitconfig.pl\n#\n"; + +for $key (sort(keys(%common))) { + next if not defined $common{$key}; + + if ($common{$key} eq "is not set") { + print COMMON "# CONFIG_$key is not set\n"; + } else { + print COMMON "CONFIG_$key=$common{$key}\n"; + } +} +close(COMMON); + +print "done.\n\n"; + +print "Creating stub configs ...\n"; + +for $config (keys(%configs)) { + my %options = %{$configs{$config}}; + + print " processing $config ... "; + + open(STUB, "> $config"); + print STUB "#\n# Config options for $config automatically generated by splitconfig.pl\n#\n"; + + for $key (sort(keys(%options))) { + next if defined $common{$key}; + + if ($options{$key} eq "is not set") { + print STUB "# CONFIG_$key is not set\n"; + } else { + print STUB "CONFIG_$key=$options{$key}\n"; + } + } + + close(STUB); + + print "done.\n"; +} --- linux-2.6.24.orig/debian/scripts/misc/git-ubuntu-log +++ linux-2.6.24/debian/scripts/misc/git-ubuntu-log @@ -0,0 +1,243 @@ +#!/usr/bin/perl -w + +use strict; +use Text::Wrap; + +my $kernel_auth = "Upstream Kernel Changes"; + +my (%map, @reverts); +my $pstate = 1; +my $no_kern_log = 0; +my $print_shas = 0; +my $first_print = 1; + +while (@ARGV) { + my $opt = $ARGV[0]; + shift; + if ($opt eq "--no-kern-log") { + $no_kern_log = 1; + } elsif ($opt eq "--print-shas") { + $print_shas = 1; + } else { + print STDERR "Unknown options: $opt\n"; + exit(1); + } +} + +sub check_reverts($) { + my ($entry) = @_; + my ($check); + + foreach $check (reverse @reverts) { + my $desc = "Revert \"" . $entry->{'desc'} . "\""; + if ($check->{'desc'} eq $desc) { + @reverts = grep($_->{'desc'} ne $desc, @reverts); + return 1; + } + } + + return 0; +} + +sub add_entry($) { + my ($entry) = @_; + my $key = $entry->{'author'}; + + # store description in array, in email->{desc list} map + if (exists $map{$key}) { + # grab ref + my $obj = $map{$key}; + + # add desc to array + push(@$obj, $entry); + } else { + # create new array, containing 1 item + my @arr = ($entry); + + # store ref to array + $map{$key} = \@arr; + } +} + +sub shortlog_entry($$$$$) { + my ($name, $desc, $bug, $cve, $commit) = @_; + my $entry; + + $desc =~ s#/pub/scm/linux/kernel/git/#/.../#g; + $desc =~ s#\[PATCH\] ##g; + + $desc =~ s#^\s*##g; + $desc =~ s# *UBUNTU: ##g; + + $entry->{'desc'} = $desc; + if ($bug ne '') { + $entry->{'bugno'} = $bug; + } + $entry->{'cve'} = $cve; + $entry->{'commit'} = $commit; + $entry->{'author'} = $name; + + if ($desc =~ /^Revert "/) { + push(@reverts, $entry); + return; + } + + return if check_reverts($entry); + + add_entry($entry); +} + +# sort comparison function +sub by_name($$) { + my ($a, $b) = @_; + + uc($a) cmp uc($b); +} + +sub shortlog_output { + my ($obj, $key, $entry); + + foreach $key (sort by_name keys %map) { + next if $key eq $kernel_auth and $no_kern_log; + + print "\n" unless $first_print; + $first_print = 0; + + # output author + printf " [%s]\n\n", $key; + + # output author's 1-line summaries + $obj = $map{$key}; + foreach $entry (reverse @$obj) { + print wrap(" * ", " ", $entry->{'desc'}) . "\n"; + # For non upstream changes, add other info. + if ($key ne $kernel_auth) { + if ($print_shas) { + print " - GIT-SHA " . $entry->{'commit'} . + "\n"; + } + } + if (defined($entry->{'bugno'})) { + print " - LP: #" . $entry->{'bugno'} . "\n"; + } + if (defined($entry->{'cve'})) { + print " - " . $entry->{'cve'} . "\n"; + } + } + } +} + +sub changelog_input { + my ($author, $desc, $commit, $entry, $cve); + + while () { + # get commit + if ($pstate == 1) { + next unless /^commit (.*)/; + + $commit = $1; + + $pstate++; + } + + # get author and email + elsif ($pstate == 2) { + my ($email); + + next unless /^[Aa]uthor:?\s*(.*?)\s*<(.*)>/; + + $author = $1; + $email = $2; + $desc = undef; + $cve = undef; + + # cset author fixups + if (!$author) { + $author = $email; + } + $pstate++; + } + + # skip to blank line + elsif ($pstate == 3) { + next unless /^\s*$/; + $pstate++; + } + + # skip to non-blank line + elsif ($pstate == 4) { + next unless /^\s*?(.*)/; + my $ignore = 0; + my $bug = undef; + my %bugz = (); + my $k; + + # skip lines that are obviously not + # a 1-line cset description + next if /^\s*From: /; + + chomp; + $desc = $1; + + if ($desc =~ /^ *(Revert "|)UBUNTU:/) { + while () { + $ignore = 1 if /^ *Ignore: yes/i; + if (/^ *Bug: *(#|)(.*)/i) { + foreach $k (split('(,|)*\s*#', $2)) { + $bugz{$k} = 1 if (($k ne '') and ($k =~ /[0-9]+/)); + } + } + elsif (/^ *BugLink: *http.*:\/\/.*\/([0-9]+)/i) { + $bugz{$1} = 1; + } + elsif (/^ *(CVE-.*)/) { + $cve = $1 + } + last if /^commit /; + } + } else { + $author = $kernel_auth; + $ignore = 1 if $desc =~ /Merge /; + while () { + if (/^ *Bug: *(#|)(.*)/i) { + foreach $k (split('(,|)*\s*#', $2)) { + $bugz{$k} = 1 if (($k ne '') and ($k =~ /[0-9]+/)); + } + } + elsif (/^ *BugLink: *http.*:\/\/.*\/([0-9]+)/i) { + $bugz{$1} = 1; + } + elsif (/^ *(CVE-.*)/) { + $cve = $1 + } + last if /^commit /; + } + } + + $bug = join(", #", keys(%bugz)); + if (!$ignore) { + &shortlog_entry($author, $desc, $bug, + $cve, $commit, 0); + } + + $pstate = 1; + if ($_ && /^commit (.*)/) { + $commit = $1; + $pstate++; + } + } + + else { + die "invalid parse state $pstate"; + } + } + + foreach $entry (@reverts) { + add_entry($entry); + } +} + +&changelog_input; +&shortlog_output; + +exit(0); --- linux-2.6.24.orig/debian/scripts/misc/validate-patch-range +++ linux-2.6.24/debian/scripts/misc/validate-patch-range @@ -0,0 +1,70 @@ +#!/usr/bin/perl +# +# Check that all patches applied to the main sources have +# also been applied to the binary-custom sources. This is +# run at insertchanges time in order to ensure that +# none of the bianry-custom flavours got missed. If a patch +# simply isn't relevant to a binary-custom file, then just touch +# that file and commit it so that it _looks_ like +# it was patched. +# + +use strict; + +my ($from, $to) = @ARGV; + +my $custom = "^debian/binary-custom.d/([^/]*)/src"; + +my @ports = ('openvz', 'xen'); + +my ($commit, $file, %where, $ignore); +my $err = 0; + +sub report { + my $port; + + # If this patch is affecting the source, then confirm it also is + # affecting all of the ports. + if ($ignore == 0 && $where{'main'}) { + for my $port (@ports) { + if (!exists $where{$port}) { + warn "$commit: not ported to $port\n"; + $err++; + } + } + } +} + +open(LOG, "git log --raw $from..$to|") || + die "$0: git log failed - $!\n"; +while () { + chomp; + if ($_ =~ /^commit\s([0-9a-f]+)/) { + report() if ($commit); + $commit = $1; + #print "COMMIT: $commit\n"; + %where = (); + $ignore = 0; + + } elsif ($_ =~ /^ Ignore:\s+yes/) { + $ignore = 1; + + } elsif ($_ =~ /^:/) { + $file = (split(' ', $_, 6))[5]; + #print "FILE: $file\n"; + if ($file =~ /$custom/) { + #print "CUSTOM: $1\n"; + $where{$1}++; + + } elsif ($file =~ /^debian/) { + $where{'debian'}++; + + } else { + $where{'main'}++; + } + } +} +close(LOG); +report() if ($commit); + +exit($err); --- linux-2.6.24.orig/debian/scripts/misc/doconfig +++ linux-2.6.24/debian/scripts/misc/doconfig @@ -0,0 +1,67 @@ +#!/bin/bash + +# We have to be in the top level kernel source directory +if [ ! -f MAINTAINERS ] || [ ! -f Makefile ]; then + echo "This does not appear to be the kernel source directory." 1>&2 + exit 1 +fi + + +# One arg, and that's it. Just pass an architecture +if [ $# -ne 1 ]; then + echo "Usage: $0 " 1>&2 + exit 1 +fi + +arch="$1" + +case "$arch" in + sparc) kernarch="sparc64" ;; + amd64) kernarch="x86_64" ;; + hppa) kernarch="parisc" ;; + lpia) kernarch="i386" ;; + *) kernarch="$arch" ;; +esac + +confdir="`pwd`/debian/config/$arch" +bindir="`pwd`/debian/scripts/misc" + +# Make sure the architecture exists +if [ ! -d $confdir ]; then + echo "Could not find config directory for $arch" 1>&2 + exit 1 +fi + +echo "Processing $arch ($kernarch) ... " + +configs=$(cd $confdir && ls config.*) + +if [ -f $confdir/config ]; then + for config in $configs; do + case $config in + *) + cat $confdir/config >> $confdir/$config + ;; + esac + done + rm -f $confdir/config +fi + +test -d build || mkdir build +cd build +for config in $configs; do + + cat $confdir/$config > .config + + echo About to configure $arch $config + read + make -C ../ O=`pwd` ARCH=$kernarch menuconfig + + cat .config > $confdir/$config +done +cd .. + +echo "Running splitconfig.pl ... " +echo + +(cd $confdir ; $bindir/splitconfig.pl) --- linux-2.6.24.orig/debian/stamps/keep-dir +++ linux-2.6.24/debian/stamps/keep-dir @@ -0,0 +1 @@ +Place holder --- linux-2.6.24.orig/debian/binary-custom.d/README +++ linux-2.6.24/debian/binary-custom.d/README @@ -0,0 +1,46 @@ +Welcome to the answer to all your requests. + +The binary-custom target for the kernel allows easy building of special +kernels that would otherwise not be allowed in our tree. The way this is +achieved is to disaccociate the normal build process and patches required +for these kernels. + +In this directory, you will need to create 4 files for your custom +kernel. All files are placed in a subdirectory. This subdirectory is the +name of your flavour (IOW, what will be appended to 2.6.X-ABI- to get the +package name). So the subdirectory name should be package name safe (e.g., +no underscores). There are currently at least three files and one directory +required in each subdirectory: + + FLAV/config.ARCH : The kernel .config used to build the kernel + (one for each architecture this flavour will + build on). + + FLAV/patchset : The directory containing the patchset for this + flavour, to be applied with -p1. + + FLAV/rules : A make file snippet for any target overrides + (usually empty). See below for what can be here. + + FLAV/vars : Template for control file generation. + +The rules file can contain overrides for some variables used during the +build. Here is a list of what can be defined in this make file snippet: + + build_image_FLAV : The image make target (e.g. bzImage). + + kernel_file_FLAV : The resulting kernel image from the build. + +The patchset directory contains a series of patches, named using a convention +such as -.patch. e.g. 0001-foo.patch, 0002-bar.patch. The +patches will then be applied in increasing order by number. + +To add your custom kernel to the normal build, add it to the +custom_flavours var for each architecture it will build on in the +debian/rules.d/ARCH.mk file. + +Once done, you can specifically build the custom image using: + + fakeroot debian/rules custom-binary-FLAV + +That's it! --- linux-2.6.24.orig/debian/binary-custom.d/openvz/vars +++ linux-2.6.24/debian/binary-custom.d/openvz/vars @@ -0,0 +1,7 @@ +arch="i386 amd64" +supported="Generic" +target="OpenVZ kernel" +desc="OpenVZ Virtualization enabled kernel" +bootloader="lilo (>= 19.1) | grub" +provides="kvm-api-4, redhat-cluster-modules" +section_image="universe/base" --- linux-2.6.24.orig/debian/binary-custom.d/openvz/rules +++ linux-2.6.24/debian/binary-custom.d/openvz/rules @@ -0,0 +1 @@ +# Nothing special here --- linux-2.6.24.orig/debian/binary-custom.d/openvz/config.amd64 +++ linux-2.6.24/debian/binary-custom.d/openvz/config.amd64 @@ -0,0 +1,3868 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.24-16-openvz +# Wed Apr 9 21:10:26 2008 +# +CONFIG_64BIT=y +# CONFIG_X86_32 is not set +CONFIG_X86_64=y +CONFIG_X86=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_SEMAPHORE_SLEEPERS=y +CONFIG_MMU=y +CONFIG_ZONE_DMA=y +# CONFIG_QUICKLIST is not set +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_DMI=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_ARCH_SUPPORTS_OPROFILE=y +CONFIG_ZONE_DMA32=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_AUDIT_ARCH=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_X86_HT=y +# CONFIG_KTIME_SCALAR is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-server" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_USER_NS=y +CONFIG_PID_NS=y +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_TREE=y +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=17 +CONFIG_CGROUPS=y +# CONFIG_CGROUP_DEBUG is not set +CONFIG_CGROUP_NS=y +CONFIG_CPUSETS=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_FAIR_USER_SCHED is not set +# CONFIG_FAIR_CGROUP_SCHED is not set +CONFIG_VZ_FAIRSCHED=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_PROC_PID_CPUSET=y +CONFIG_RELAY=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLUB_DEBUG=y +# CONFIG_SLAB is not set +CONFIG_SLUB=y +# CONFIG_SLOB is not set +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_BLK_DEV_IO_TRACE=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_BLOCK_COMPAT=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +CONFIG_LSM_MMAP_MIN_ADDR=0 + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_PREEMPT_NOTIFIERS=y + +# +# Processor type and features +# +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_SMP=y +CONFIG_X86_PC=y +# CONFIG_X86_ELAN is not set +# CONFIG_X86_VOYAGER is not set +# CONFIG_X86_NUMAQ is not set +# CONFIG_X86_SUMMIT is not set +# CONFIG_X86_BIGSMP is not set +# CONFIG_X86_VISWS is not set +# CONFIG_X86_GENERICARCH is not set +# CONFIG_X86_ES7000 is not set +# CONFIG_X86_VSMP is not set +# CONFIG_M386 is not set +# CONFIG_M486 is not set +# CONFIG_M586 is not set +# CONFIG_M586TSC is not set +# CONFIG_M586MMX is not set +# CONFIG_M686 is not set +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MPENTIUM4 is not set +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MEFFICEON is not set +# CONFIG_MWINCHIPC6 is not set +# CONFIG_MWINCHIP2 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +# CONFIG_MCYRIXIII is not set +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set +# CONFIG_MPSC is not set +# CONFIG_MCORE2 is not set +CONFIG_GENERIC_CPU=y +CONFIG_X86_L1_CACHE_BYTES=128 +CONFIG_X86_INTERNODE_CACHE_BYTES=128 +CONFIG_X86_CMPXCHG=y +CONFIG_X86_L1_CACHE_SHIFT=7 +CONFIG_X86_GOOD_APIC=y +CONFIG_X86_TSC=y +CONFIG_X86_MINIMUM_CPU_FAMILY=64 +CONFIG_HPET_TIMER=y +CONFIG_HPET_EMULATE_RTC=y +CONFIG_GART_IOMMU=y +CONFIG_CALGARY_IOMMU=y +CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y +CONFIG_SWIOTLB=y +CONFIG_NR_CPUS=64 +CONFIG_SCHED_SMT=y +CONFIG_SCHED_MC=y +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +CONFIG_X86_LOCAL_APIC=y +CONFIG_X86_IO_APIC=y +# CONFIG_NMI_WATCHDOG is not set +CONFIG_X86_MCE=y +CONFIG_X86_MCE_INTEL=y +CONFIG_X86_MCE_AMD=y +CONFIG_MICROCODE=m +CONFIG_MICROCODE_OLD_INTERFACE=y +CONFIG_X86_MSR=m +CONFIG_X86_CPUID=m +CONFIG_NUMA=y +CONFIG_K8_NUMA=y +CONFIG_X86_64_ACPI_NUMA=y +# CONFIG_NUMA_EMU is not set +CONFIG_NODES_SHIFT=6 +CONFIG_ARCH_DISCONTIGMEM_ENABLE=y +CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_DISCONTIGMEM_MANUAL=y +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_DISCONTIGMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_NEED_MULTIPLE_NODES=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_MIGRATION=y +CONFIG_RESOURCES_64BIT=y +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_BOUNCE=y +CONFIG_VIRT_TO_BUS=y +CONFIG_MTRR=y +CONFIG_SECCOMP=y +CONFIG_CC_STACKPROTECTOR=y +# CONFIG_CC_STACKPROTECTOR_ALL is not set +CONFIG_HZ_100=y +# CONFIG_HZ_250 is not set +# CONFIG_HZ_300 is not set +# CONFIG_HZ_1000 is not set +CONFIG_HZ=100 +CONFIG_KEXEC=y +CONFIG_CRASH_DUMP=y +CONFIG_PHYSICAL_START=0x200000 +CONFIG_RELOCATABLE=y +CONFIG_PHYSICAL_ALIGN=0x200000 +CONFIG_HOTPLUG_CPU=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y +CONFIG_OUT_OF_LINE_PFN_TO_PAGE=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_HEADER=y +CONFIG_PM=y +CONFIG_PM_LEGACY=y +CONFIG_PM_DEBUG=y +# CONFIG_PM_VERBOSE is not set +CONFIG_PM_TRACE=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PM_SLEEP=y +CONFIG_SUSPEND_SMP_POSSIBLE=y +CONFIG_SUSPEND=y +CONFIG_PM_DISABLE_CONSOLE=y +CONFIG_HIBERNATION_SMP_POSSIBLE=y +CONFIG_HIBERNATION=y +CONFIG_PM_STD_PARTITION="" +CONFIG_ACPI=y +CONFIG_ACPI_SLEEP=y +CONFIG_ACPI_PROCFS=y +CONFIG_ACPI_PROCFS_POWER=y +CONFIG_ACPI_SYSFS_POWER=y +CONFIG_ACPI_PROC_EVENT=y +CONFIG_ACPI_AC=m +CONFIG_ACPI_BATTERY=m +CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_VIDEO=m +CONFIG_ACPI_FAN=m +CONFIG_ACPI_DOCK=m +CONFIG_ACPI_BAY=m +CONFIG_ACPI_PROCESSOR=m +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_NUMA=y +CONFIG_ACPI_ASUS=m +CONFIG_ACPI_TOSHIBA=m +CONFIG_ACPI_CUSTOM_DSDT_INITRD=y +CONFIG_ACPI_BLACKLIST_YEAR=0 +# CONFIG_ACPI_DEBUG is not set +CONFIG_ACPI_EC=y +CONFIG_ACPI_POWER=y +CONFIG_ACPI_SYSTEM=y +CONFIG_X86_PM_TIMER=y +CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_SBS=m + +# +# CPU Frequency scaling +# +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_TABLE=m +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m + +# +# CPUFreq processor drivers +# +CONFIG_X86_ACPI_CPUFREQ=m +CONFIG_X86_POWERNOW_K8=m +CONFIG_X86_POWERNOW_K8_ACPI=y +# CONFIG_X86_SPEEDSTEP_CENTRINO is not set +# CONFIG_X86_P4_CLOCKMOD is not set + +# +# shared options +# +# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set +# CONFIG_X86_SPEEDSTEP_LIB is not set +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y + +# +# Bus options (PCI etc.) +# +CONFIG_PCI=y +CONFIG_PCI_DIRECT=y +CONFIG_PCI_MMCONFIG=y +CONFIG_PCI_DOMAINS=y +# CONFIG_DMAR is not set +CONFIG_PCIEPORTBUS=y +CONFIG_HOTPLUG_PCI_PCIE=m +CONFIG_PCIEAER=y +CONFIG_ARCH_SUPPORTS_MSI=y +CONFIG_PCI_MSI=y +CONFIG_PCI_LEGACY=y +# CONFIG_PCI_DEBUG is not set +CONFIG_HT_IRQ=y +CONFIG_ISA_DMA_API=y +CONFIG_K8_NB=y +CONFIG_PCCARD=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_IOCTL=y +CONFIG_CARDBUS=y + +# +# PC-card bridges +# +CONFIG_YENTA=m +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_PD6729=m +CONFIG_I82092=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_HOTPLUG_PCI=m +CONFIG_HOTPLUG_PCI_FAKE=m +CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m +CONFIG_HOTPLUG_PCI_CPCI=y +CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m +CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m +CONFIG_HOTPLUG_PCI_SHPC=m + +# +# Executable file formats / Emulations +# +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m +CONFIG_IA32_EMULATION=y +# CONFIG_IA32_AOUT is not set +CONFIG_COMPAT=y +CONFIG_COMPAT_FOR_U64_ALIGNMENT=y +CONFIG_SYSVIPC_COMPAT=y + +# +# OpenVZ +# +CONFIG_VE=y +CONFIG_VE_CALLS=m +CONFIG_VZ_GENCALLS=y +CONFIG_VE_NETDEV=m +CONFIG_VE_ETHDEV=m +CONFIG_VZ_DEV=m +CONFIG_VE_IPTABLES=y +CONFIG_VZ_WDOG=m +CONFIG_VZ_CHECKPOINT=m + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_NET_NS=y +CONFIG_PACKET=m +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_ASK_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +# CONFIG_IP_PNP is not set +CONFIG_NET_IPIP=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_IP_MROUTE=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_LRO=m +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_CONG_ILLINOIS=m +# CONFIG_DEFAULT_BIC is not set +# CONFIG_DEFAULT_CUBIC is not set +# CONFIG_DEFAULT_HTCP is not set +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFAULT_RENO=y +CONFIG_DEFAULT_TCP_CONG="reno" +CONFIG_TCP_MD5SIG=y +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_TAB_BITS=12 + +# +# IPVS transport protocol load balancing support +# +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_AH=y + +# +# IPVS scheduler +# +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_WRR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_NQ=m + +# +# IPVS application helper +# +CONFIG_IP_VS_FTP=m +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +CONFIG_IPV6_MULTIPLE_TABLES=y +# CONFIG_IPV6_SUBTREES is not set +CONFIG_NETWORK_SECMARK=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_BRIDGE_NETFILTER=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_NETLINK=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m + +# +# IP: Netfilter Configuration +# +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration (EXPERIMENTAL) +# +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_RAW=m + +# +# DECnet: Netfilter Configuration +# +CONFIG_DECNET_NF_GRABULATOR=m + +# +# Bridge: Netfilter Configuration +# +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_IP_DCCP=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_IP_DCCP_ACKVEC=y + +# +# DCCP CCIDs Configuration (EXPERIMENTAL) +# +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +CONFIG_IP_DCCP_TFRC_LIB=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 + +# +# DCCP Kernel Hacking +# +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_NET_DCCPPROBE=m +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +CONFIG_ATM=y +CONFIG_ATM_CLIP=y +# CONFIG_ATM_CLIP_NO_ICMP is not set +CONFIG_ATM_LANE=m +CONFIG_ATM_MPOA=m +CONFIG_ATM_BR2684=m +# CONFIG_ATM_BR2684_IPFILTER is not set +CONFIG_BRIDGE=m +CONFIG_VLAN_8021Q=m +CONFIG_DECNET=m +# CONFIG_DECNET_ROUTER is not set +CONFIG_LLC=y +CONFIG_LLC2=m +CONFIG_IPX=m +# CONFIG_IPX_INTERN is not set +CONFIG_ATALK=m +CONFIG_DEV_APPLETALK=m +CONFIG_IPDDP=m +CONFIG_IPDDP_ENCAP=y +CONFIG_IPDDP_DECAP=y +CONFIG_X25=m +CONFIG_LAPB=m +CONFIG_ECONET=m +CONFIG_ECONET_AUNUDP=y +CONFIG_ECONET_NATIVE=y +CONFIG_WAN_ROUTER=m +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_ATM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_INGRESS=m + +# +# Classification +# +CONFIG_NET_CLS=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_U32=m +# CONFIG_CLS_U32_PERF is not set +CONFIG_CLS_U32_MARK=y +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_CLS_ACT=y +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_GACT=m +CONFIG_GACT_PROB=y +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_SIMP=m +# CONFIG_NET_CLS_POLICE is not set +# CONFIG_NET_CLS_IND is not set +CONFIG_NET_SCH_FIFO=y + +# +# Network testing +# +CONFIG_NET_PKTGEN=m +CONFIG_NET_TCPPROBE=m +CONFIG_HAMRADIO=y + +# +# Packet Radio protocols +# +CONFIG_AX25=m +# CONFIG_AX25_DAMA_SLAVE is not set +CONFIG_NETROM=m +CONFIG_ROSE=m + +# +# AX.25 network device drivers +# +CONFIG_MKISS=m +CONFIG_6PACK=m +CONFIG_BPQETHER=m +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BAYCOM_PAR=m +CONFIG_YAM=m +CONFIG_IRDA=m + +# +# IrDA protocols +# +CONFIG_IRLAN=m +CONFIG_IRNET=m +CONFIG_IRCOMM=m +CONFIG_IRDA_ULTRA=y + +# +# IrDA options +# +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_FAST_RR=y +CONFIG_IRDA_DEBUG=y + +# +# Infrared-port device drivers +# + +# +# SIR device drivers +# +CONFIG_IRTTY_SIR=m + +# +# Dongle support +# +CONFIG_DONGLE=y +CONFIG_ESI_DONGLE=m +CONFIG_ACTISYS_DONGLE=m +CONFIG_TEKRAM_DONGLE=m +# CONFIG_TOIM3232_DONGLE is not set +CONFIG_LITELINK_DONGLE=m +CONFIG_MA600_DONGLE=m +CONFIG_GIRBIL_DONGLE=m +CONFIG_MCP2120_DONGLE=m +CONFIG_OLD_BELKIN_DONGLE=m +CONFIG_ACT200L_DONGLE=m +CONFIG_KINGSUN_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +CONFIG_KS959_DONGLE=m + +# +# Old SIR device drivers +# + +# +# Old Serial dongle support +# + +# +# FIR device drivers +# +CONFIG_USB_IRDA=m +CONFIG_SIGMATEL_FIR=m +CONFIG_NSC_FIR=m +CONFIG_WINBOND_FIR=m +CONFIG_SMC_IRCC_FIR=m +CONFIG_ALI_FIR=m +CONFIG_VLSI_FIR=m +CONFIG_VIA_FIR=m +CONFIG_MCS_FIR=m +CONFIG_BT=m +CONFIG_BT_L2CAP=m +CONFIG_BT_SCO=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_CMTP=m +CONFIG_BT_HIDP=m + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIVHCI=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_RXKAD=m +CONFIG_FIB_RULES=y + +# +# Wireless +# +CONFIG_CFG80211=m +CONFIG_NL80211=y +CONFIG_WIRELESS_EXT=y +CONFIG_MAC80211=m +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_DEBUGFS=y +# CONFIG_MAC80211_DEBUG is not set +CONFIG_IEEE80211=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_CRYPT_WEP=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +CONFIG_NET_9P=m +CONFIG_NET_9P_FD=m +CONFIG_NET_9P_VIRTIO=m +# CONFIG_NET_9P_DEBUG is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_CONNECTOR=m +CONFIG_MTD=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_CONCAT=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_REDBOOT_PARTS=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_FTL=m +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_INFTL=m +CONFIG_RFD_FTL=m +CONFIG_SSFDC=m +CONFIG_MTD_OOPS=m + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_GEN_PROBE=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_RAM=m +CONFIG_MTD_ROM=m +CONFIG_MTD_ABSENT=m + +# +# Mapping drivers for chip access +# +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PNC2000=m +CONFIG_MTD_SC520CDP=m +CONFIG_MTD_NETSC520=m +CONFIG_MTD_TS5500=m +CONFIG_MTD_SBC_GXX=m +CONFIG_MTD_AMD76XROM=m +CONFIG_MTD_ICHXROM=m +CONFIG_MTD_ESB2ROM=m +CONFIG_MTD_CK804XROM=m +CONFIG_MTD_SCB2_FLASH=m +CONFIG_MTD_NETtel=m +CONFIG_MTD_DILNETPC=m +CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000 +CONFIG_MTD_L440GX=m +CONFIG_MTD_PCI=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_PLATRAM=m + +# +# Self-contained MTD device drivers +# +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_DATAFLASH=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_MTDRAM=m +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTD_BLOCK2MTD=m + +# +# Disk-On-Chip Device Drivers +# +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCECC=m +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_DOCPROBE_ADDRESS=0 +CONFIG_MTD_NAND=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_IDS=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_2X_PROGRAM=y +CONFIG_MTD_ONENAND_SIM=m + +# +# UBI - Unsorted block images +# +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +CONFIG_MTD_UBI_GLUEBI=y + +# +# UBI debugging options +# +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_PARPORT=m +CONFIG_PARPORT_PC=m +CONFIG_PARPORT_SERIAL=m +CONFIG_PARPORT_PC_FIFO=y +# CONFIG_PARPORT_PC_SUPERIO is not set +CONFIG_PARPORT_PC_PCMCIA=m +# CONFIG_PARPORT_GSC is not set +CONFIG_PARPORT_AX88796=m +CONFIG_PARPORT_1284=y +CONFIG_PARPORT_NOT_PC=y +CONFIG_PNP=y +# CONFIG_PNP_DEBUG is not set + +# +# Protocols +# +CONFIG_PNPACPI=y +CONFIG_BLK_DEV=y +CONFIG_BLK_DEV_FD=m +CONFIG_PARIDE=m + +# +# Parallel IDE high-level drivers +# +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PT=m +CONFIG_PARIDE_PG=m + +# +# Parallel IDE protocol modules +# +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_CISS_SCSI_TAPE=y +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_UMEM=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_SX8=m +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_ATA_OVER_ETH=m +CONFIG_VIRTIO_BLK=m +CONFIG_MISC_DEVICES=y +CONFIG_IBM_ASM=m +CONFIG_PHANTOM=m +CONFIG_EEPROM_93CX6=m +CONFIG_SGI_IOC4=m +CONFIG_TIFM_CORE=m +CONFIG_TIFM_7XX1=m +CONFIG_ASUS_LAPTOP=m +CONFIG_FUJITSU_LAPTOP=m +CONFIG_MSI_LAPTOP=m +CONFIG_SONY_LAPTOP=m +CONFIG_SONYPI_COMPAT=y +CONFIG_THINKPAD_ACPI=m +# CONFIG_THINKPAD_ACPI_DEBUG is not set +CONFIG_THINKPAD_ACPI_BAY=y +CONFIG_IDE=y +CONFIG_IDE_MAX_HWIFS=4 +CONFIG_BLK_DEV_IDE=m + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +# CONFIG_BLK_DEV_HD_IDE is not set +CONFIG_BLK_DEV_IDEDISK=m +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_IDECD=m +CONFIG_BLK_DEV_IDETAPE=m +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDEACPI=y +# CONFIG_IDE_TASK_IOCTL is not set +CONFIG_IDE_PROC_FS=y + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=m +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_CMD640=y +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +CONFIG_BLK_DEV_IDEPNP=y + +# +# PCI IDE chipsets support +# +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_IDEPCI_SHARE_IRQ=y +# CONFIG_IDEPCI_PCIBUS_ORDER is not set +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_GENERIC is not set +CONFIG_BLK_DEV_OPTI621=m +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI15X3=m +# CONFIG_WDC_ALI15X3 is not set +CONFIG_BLK_DEV_AMD74XX=m +CONFIG_BLK_DEV_ATIIXP=m +CONFIG_BLK_DEV_CMD64X=m +# CONFIG_BLK_DEV_TRIFLEX is not set +CONFIG_BLK_DEV_CY82C693=m +# CONFIG_BLK_DEV_CS5520 is not set +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_HPT34X=m +# CONFIG_HPT34X_AUTODMA is not set +CONFIG_BLK_DEV_HPT366=m +# CONFIG_BLK_DEV_JMICRON is not set +CONFIG_BLK_DEV_SC1200=m +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +CONFIG_BLK_DEV_NS87415=m +CONFIG_BLK_DEV_PDC202XX_OLD=m +CONFIG_PDC202XX_BURST=y +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +CONFIG_BLK_DEV_TRM290=m +CONFIG_BLK_DEV_VIA82CXXX=m +CONFIG_BLK_DEV_TC86C001=m +# CONFIG_IDE_ARM is not set +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI device support +# +CONFIG_RAID_ATTRS=m +CONFIG_SCSI=m +CONFIG_SCSI_DMA=y +CONFIG_SCSI_TGT=m +CONFIG_SCSI_NETLINK=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=m +CONFIG_CHR_DEV_ST=m +CONFIG_CHR_DEV_OSST=m +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_SCH=m + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_FC_TGT_ATTRS=y +CONFIG_SCSI_ISCSI_ATTRS=m +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +CONFIG_SCSI_SAS_ATA=y +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_LOWLEVEL=y +CONFIG_ISCSI_TCP=m +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_AIC7XXX=m +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_DEBUG_ENABLE=y +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_AIC79XX=m +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC79XX_DEBUG_ENABLE=y +CONFIG_AIC79XX_DEBUG_MASK=0 +CONFIG_AIC79XX_REG_PRETTY_PRINT=y +CONFIG_SCSI_AIC94XX=m +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_SAS=m +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_BUSLOGIC=m +# CONFIG_SCSI_OMIT_FLASHPOINT is not set +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_EATA=m +CONFIG_SCSI_EATA_TAGGED_QUEUE=y +CONFIG_SCSI_EATA_LINKED_COMMANDS=y +CONFIG_SCSI_EATA_MAX_TAGS=16 +CONFIG_SCSI_FUTURE_DOMAIN=m +CONFIG_SCSI_GDTH=m +CONFIG_SCSI_IPS=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_PPA=m +CONFIG_SCSI_IMM=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_TRACE is not set +# CONFIG_SCSI_IPR_DUMP is not set +CONFIG_SCSI_QLOGIC_1280=m +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_DC395x=m +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_DEBUG=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_ATA=m +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_ACPI=y +CONFIG_SATA_AHCI=m +CONFIG_SATA_SVW=m +CONFIG_ATA_PIIX=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_PDC_ADMA=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_SX4=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SATA_INIC162X=m +CONFIG_PATA_ACPI=m +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +CONFIG_PATA_ARTOP=m +CONFIG_PATA_ATIIXP=m +# CONFIG_PATA_CMD640_PCI is not set +CONFIG_PATA_CMD64X=m +CONFIG_PATA_CS5520=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_EFAR=m +CONFIG_ATA_GENERIC=m +CONFIG_PATA_HPT366=m +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +CONFIG_PATA_HPT3X3=m +# CONFIG_PATA_HPT3X3_DMA is not set +CONFIG_PATA_IT821X=m +CONFIG_PATA_IT8213=m +CONFIG_PATA_JMICRON=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_OLDPIIX=m +CONFIG_PATA_NETCELL=m +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +CONFIG_PATA_PCMCIA=m +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +CONFIG_PATA_RZ1000=m +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_PDC2027X=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_VIA=m +CONFIG_PATA_WINBOND=m +CONFIG_PATA_PLATFORM=m +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_MULTIPATH_RDAC=m +CONFIG_DM_MULTIPATH_HP=m +# CONFIG_DM_DELAY is not set +CONFIG_DM_UEVENT=y +CONFIG_FUSION=y +CONFIG_FUSION_SPI=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_SAS=m +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_CTL=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +CONFIG_IEEE1394=m + +# +# Subsystem Options +# +# CONFIG_IEEE1394_VERBOSEDEBUG is not set + +# +# Controllers +# +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_OHCI1394=m + +# +# Protocols +# +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_I2O=m +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_BUS=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_SCSI=m +CONFIG_I2O_PROC=m +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_NETDEVICES=y +# CONFIG_NETDEVICES_MULTIQUEUE is not set +CONFIG_IFB=m +CONFIG_DUMMY=m +CONFIG_BONDING=m +CONFIG_MACVLAN=m +CONFIG_EQUALIZER=m +CONFIG_TUN=m +CONFIG_VETH=m +CONFIG_NET_SB1000=m +CONFIG_ARCNET=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_RAW=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM90xx=m +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RIM_I=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_PCI=m +CONFIG_PHYLIB=m + +# +# MII PHY device drivers +# +CONFIG_MARVELL_PHY=m +CONFIG_DAVICOM_PHY=m +CONFIG_QSEMI_PHY=m +CONFIG_LXT_PHY=m +CONFIG_CICADA_PHY=m +CONFIG_VITESSE_PHY=m +CONFIG_SMSC_PHY=m +CONFIG_BROADCOM_PHY=m +CONFIG_ICPLUS_PHY=m +CONFIG_FIXED_PHY=m +# CONFIG_FIXED_MII_10_FDX is not set +# CONFIG_FIXED_MII_100_FDX is not set +CONFIG_FIXED_MII_1000_FDX=y +CONFIG_FIXED_MII_AMNT=1 +CONFIG_MDIO_BITBANG=m +CONFIG_NET_ETHERNET=y +CONFIG_MII=m +CONFIG_HAPPYMEAL=m +CONFIG_SUNGEM=m +CONFIG_CASSINI=m +CONFIG_NET_VENDOR_3COM=y +CONFIG_VORTEX=m +CONFIG_TYPHOON=m +CONFIG_NET_TULIP=y +CONFIG_DE2104X=m +CONFIG_TULIP=m +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_NAPI is not set +CONFIG_DE4X5=m +CONFIG_WINBOND_840=m +CONFIG_DM9102=m +CONFIG_ULI526X=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_HP100=m +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +CONFIG_NET_PCI=y +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_AMD8111_ETH=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_B44=m +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI=y +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +CONFIG_EEPRO100=m +CONFIG_E100=m +CONFIG_FEALNX=m +CONFIG_NATSEMI=m +CONFIG_NE2K_PCI=m +CONFIG_8139CP=m +CONFIG_8139TOO=m +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +CONFIG_8139TOO_8129=y +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_SIS900=m +CONFIG_EPIC100=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_SC92031=m +CONFIG_NET_POCKET=y +CONFIG_ATP=m +CONFIG_DE600=m +CONFIG_DE620=m +CONFIG_NETDEV_1000=y +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_DL2K=m +CONFIG_E1000=m +CONFIG_E1000_NAPI=y +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000E=m +CONFIG_IP1000=m +CONFIG_NS83820=m +CONFIG_HAMACHI=m +CONFIG_YELLOWFIN=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_SIS190=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SK98LIN is not set +CONFIG_VIA_VELOCITY=m +CONFIG_TIGON3=m +CONFIG_BNX2=m +CONFIG_QLA3XXX=m +CONFIG_ATL1=m +CONFIG_NETDEV_10000=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_IXGBE=m +CONFIG_IXGB=m +# CONFIG_IXGB_NAPI is not set +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +CONFIG_MYRI10GE=m +CONFIG_NETXEN_NIC=m +CONFIG_NIU=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_TEHUTI=m +CONFIG_TR=y +CONFIG_IBMOL=m +CONFIG_3C359=m +CONFIG_TMS380TR=m +CONFIG_TMSPCI=m +CONFIG_ABYSS=m + +# +# Wireless LAN +# +CONFIG_WLAN_PRE80211=y +CONFIG_STRIP=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_NETWAVE=m +CONFIG_WLAN_80211=y +CONFIG_PCMCIA_RAYCS=m +CONFIG_IPW2100=m +CONFIG_IPW2100_MONITOR=y +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2200=m +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +# CONFIG_IPW2200_DEBUG is not set +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_USB=m +CONFIG_LIBERTAS_CS=m +CONFIG_LIBERTAS_SDIO=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_AIRO=m +CONFIG_HERMES=m +# CONFIG_PLX_HERMES is not set +# CONFIG_TMD_HERMES is not set +# CONFIG_NORTEL_HERMES is not set +# CONFIG_PCI_HERMES is not set +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_ATMEL=m +CONFIG_PCI_ATMEL=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_AIRO_CS=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PRISM54=m +CONFIG_USB_ZD1201=m +CONFIG_RTL8187=m +CONFIG_ADM8211=m +CONFIG_P54_COMMON=m +CONFIG_P54_USB=m +CONFIG_P54_PCI=m +# CONFIG_IWLWIFI is not set +CONFIG_HOSTAP=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PLX=m +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_CS=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_PIO=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +# CONFIG_BCM43XX_PIO_MODE is not set +CONFIG_B43=m +CONFIG_B43_PCI_AUTOSELECT=y +CONFIG_B43_PCICORE_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_LEDS=y +CONFIG_B43_RFKILL=y +# CONFIG_B43_DEBUG is not set +CONFIG_B43_DMA=y +CONFIG_B43_PIO=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_PIO=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_RT2X00=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +# CONFIG_RT2X00_DEBUG is not set + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_BELKIN=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +# CONFIG_USB_NET_ZAURUS is not set +CONFIG_NET_PCMCIA=y +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_AXNET=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_WAN=y +CONFIG_LANMEDIA=m +CONFIG_HDLC=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_X25=m +CONFIG_PCI200SYN=m +CONFIG_WANXL=m +CONFIG_PC300=m +CONFIG_PC300_MLPPP=y + +# +# Cyclades-PC300 MLPPP support is disabled. +# + +# +# Refer to the file README.mlppp, provided by PC300 package. +# +# CONFIG_PC300TOO is not set +CONFIG_FARSYNC=m +CONFIG_DSCC4=m +CONFIG_DSCC4_PCISYNC=y +CONFIG_DSCC4_PCI_RST=y +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_WAN_ROUTER_DRIVERS=m +CONFIG_CYCLADES_SYNC=m +CONFIG_CYCLOMX_X25=y +CONFIG_LAPBETHER=m +CONFIG_X25_ASY=m +CONFIG_SBNI=m +# CONFIG_SBNI_MULTILINE is not set +CONFIG_ATM_DRIVERS=y +# CONFIG_ATM_DUMMY is not set +CONFIG_ATM_TCP=m +CONFIG_ATM_LANAI=m +CONFIG_ATM_ENI=m +# CONFIG_ATM_ENI_DEBUG is not set +# CONFIG_ATM_ENI_TUNE_BURST is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_ATM_IDT77252=m +# CONFIG_ATM_IDT77252_DEBUG is not set +# CONFIG_ATM_IDT77252_RCV_ALL is not set +CONFIG_ATM_IDT77252_USE_SUNI=y +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_FORE200E_MAYBE=m +CONFIG_ATM_FORE200E_PCA=y +CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y +# CONFIG_ATM_FORE200E_USE_TASKLET is not set +CONFIG_ATM_FORE200E_TX_RETRY=16 +CONFIG_ATM_FORE200E_DEBUG=0 +CONFIG_ATM_FORE200E=m +CONFIG_ATM_HE=m +CONFIG_ATM_HE_USE_SUNI=y +CONFIG_FDDI=y +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_SKFP=m +CONFIG_HIPPI=y +CONFIG_ROADRUNNER=m +# CONFIG_ROADRUNNER_LARGE_RINGS is not set +CONFIG_PLIP=m +CONFIG_PPP=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_FILTER=y +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_MPPE=m +CONFIG_PPPOE=m +CONFIG_PPPOATM=m +CONFIG_PPPOL2TP=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +CONFIG_SLHC=m +CONFIG_SLIP_SMART=y +CONFIG_SLIP_MODE_SLIP6=y +CONFIG_NET_FC=y +CONFIG_SHAPER=m +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_VIRTIO_NET=m +CONFIG_ISDN=m +CONFIG_ISDN_I4L=m +CONFIG_ISDN_PPP=y +CONFIG_ISDN_PPP_VJ=y +CONFIG_ISDN_MPP=y +CONFIG_IPPP_FILTER=y +CONFIG_ISDN_PPP_BSDCOMP=m +CONFIG_ISDN_AUDIO=y +CONFIG_ISDN_TTY_FAX=y +CONFIG_ISDN_X25=y + +# +# ISDN feature submodules +# +CONFIG_ISDN_DIVERSION=m + +# +# ISDN4Linux hardware drivers +# + +# +# Passive cards +# +CONFIG_ISDN_DRV_HISAX=m + +# +# D-channel protocol features +# +CONFIG_HISAX_EURO=y +CONFIG_DE_AOC=y +# CONFIG_HISAX_NO_SENDCOMPLETE is not set +# CONFIG_HISAX_NO_LLC is not set +# CONFIG_HISAX_NO_KEYPAD is not set +CONFIG_HISAX_1TR6=y +CONFIG_HISAX_NI1=y +CONFIG_HISAX_MAX_CARDS=8 + +# +# HiSax supported cards +# +CONFIG_HISAX_16_3=y +CONFIG_HISAX_TELESPCI=y +CONFIG_HISAX_S0BOX=y +CONFIG_HISAX_FRITZPCI=y +CONFIG_HISAX_AVM_A1_PCMCIA=y +CONFIG_HISAX_ELSA=y +CONFIG_HISAX_DIEHLDIVA=y +CONFIG_HISAX_SEDLBAUER=y +CONFIG_HISAX_NETJET=y +CONFIG_HISAX_NETJET_U=y +CONFIG_HISAX_NICCY=y +CONFIG_HISAX_BKM_A4T=y +CONFIG_HISAX_SCT_QUADRO=y +CONFIG_HISAX_GAZEL=y +CONFIG_HISAX_HFC_PCI=y +CONFIG_HISAX_W6692=y +CONFIG_HISAX_HFC_SX=y +CONFIG_HISAX_ENTERNOW_PCI=y +# CONFIG_HISAX_DEBUG is not set + +# +# HiSax PCMCIA card service modules +# +CONFIG_HISAX_SEDLBAUER_CS=m +CONFIG_HISAX_ELSA_CS=m +CONFIG_HISAX_AVM_A1_CS=m +CONFIG_HISAX_TELES_CS=m + +# +# HiSax sub driver modules +# +CONFIG_HISAX_ST5481=m +CONFIG_HISAX_HFCUSB=m +CONFIG_HISAX_HFC4S8S=m +CONFIG_HISAX_FRITZ_PCIPNP=m +CONFIG_HISAX_HDLC=y + +# +# Active cards +# +CONFIG_ISDN_DRV_GIGASET=m +CONFIG_GIGASET_BASE=m +CONFIG_GIGASET_M105=m +CONFIG_GIGASET_M101=m +# CONFIG_GIGASET_DEBUG is not set +# CONFIG_GIGASET_UNDOCREQ is not set +CONFIG_ISDN_CAPI=m +CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y +CONFIG_CAPI_TRACE=y +CONFIG_ISDN_CAPI_MIDDLEWARE=y +CONFIG_ISDN_CAPI_CAPI20=m +CONFIG_ISDN_CAPI_CAPIFS_BOOL=y +CONFIG_ISDN_CAPI_CAPIFS=m +CONFIG_ISDN_CAPI_CAPIDRV=m + +# +# CAPI hardware drivers +# +CONFIG_CAPI_AVM=y +CONFIG_ISDN_DRV_AVMB1_B1PCI=m +CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m +CONFIG_ISDN_DRV_AVMB1_AVM_CS=m +CONFIG_ISDN_DRV_AVMB1_T1PCI=m +CONFIG_ISDN_DRV_AVMB1_C4=m +CONFIG_CAPI_EICON=y +CONFIG_ISDN_DIVAS=m +CONFIG_ISDN_DIVAS_BRIPCI=y +CONFIG_ISDN_DIVAS_PRIPCI=y +CONFIG_ISDN_DIVAS_DIVACAPI=m +CONFIG_ISDN_DIVAS_USERIDI=m +CONFIG_ISDN_DIVAS_MAINT=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_POLLDEV=m + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_EVBUG=m + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_APPLETOUCH=m +CONFIG_MOUSE_VSXXXAA=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_IFORCE=m +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_IFORCE_232=y +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_INPUT_TABLET=y +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_FUJITSU=m +CONFIG_TOUCHSCREEN_GUNZE=m +CONFIG_TOUCHSCREEN_ELO=m +CONFIG_TOUCHSCREEN_MTOUCH=m +CONFIG_TOUCHSCREEN_MK712=m +CONFIG_TOUCHSCREEN_PENMOUNT=m +CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +CONFIG_TOUCHSCREEN_TOUCHWIN=m +CONFIG_TOUCHSCREEN_UCB1400=m +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_INPUT_MISC=y +CONFIG_INPUT_PCSPKR=m +CONFIG_INPUT_ATLAS_BTNS=m +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_YEALINK=m +CONFIG_INPUT_UINPUT=m + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_SERPORT=m +CONFIG_SERIO_CT82C710=m +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=m +CONFIG_GAMEPORT=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_DEV_KMEM is not set +CONFIG_SERIAL_NONSTANDARD=y +CONFIG_COMPUTONE=m +CONFIG_ROCKETPORT=m +CONFIG_CYCLADES=m +# CONFIG_CYZ_INTR is not set +CONFIG_DIGIEPCA=m +CONFIG_MOXA_INTELLIO=m +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +# CONFIG_ISI is not set +CONFIG_SYNCLINK=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_GT=m +CONFIG_N_HDLC=m +CONFIG_SPECIALIX=m +# CONFIG_SPECIALIX_RTSCTS is not set +CONFIG_SX=m +CONFIG_RIO=m +# CONFIG_RIO_OLDPCI is not set +CONFIG_STALDRV=y + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_PNP=y +CONFIG_SERIAL_8250_CS=m +CONFIG_SERIAL_8250_NR_UARTS=48 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_RSA=y + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_JSM=m +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_PRINTER=m +# CONFIG_LP_CONSOLE is not set +CONFIG_PPDEV=m +CONFIG_IPMI_HANDLER=m +# CONFIG_IPMI_PANIC_EVENT is not set +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m +CONFIG_IPMI_POWEROFF=m +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_INTEL=m +CONFIG_HW_RANDOM_AMD=m +CONFIG_NVRAM=m +CONFIG_RTC=y +CONFIG_R3964=m +CONFIG_APPLICOM=m + +# +# PCMCIA character devices +# +CONFIG_SYNCLINK_CS=m +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_MWAVE=m +CONFIG_PC8736x_GPIO=m +CONFIG_NSC_GPIO=m +CONFIG_RAW_DRIVER=m +CONFIG_MAX_RAW_DEVS=256 +CONFIG_HPET=y +# CONFIG_HPET_RTC_IRQ is not set +CONFIG_HPET_MMAP=y +CONFIG_HANGCHECK_TIMER=m +CONFIG_TCG_TPM=m +CONFIG_TCG_TIS=m +CONFIG_TCG_NSC=m +CONFIG_TCG_ATMEL=m +CONFIG_TCG_INFINEON=m +CONFIG_TELCLOCK=m +CONFIG_DEVPORT=y +CONFIG_I2C=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=m +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_ALGOPCA=m + +# +# I2C Hardware Bus support +# +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_PIIX4=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_TAOS_EVM=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m + +# +# Miscellaneous I2C Chip support +# +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_DS1682=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_TSL2550=m +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# SPI support +# +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +CONFIG_SPI_LM70_LLP=m + +# +# SPI Protocol Masters +# +CONFIG_SPI_AT25=m +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_W1=m +CONFIG_W1_CON=y + +# +# 1-wire Bus Masters +# +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_DS2482=m + +# +# 1-wire Slaves +# +CONFIG_W1_SLAVE_THERM=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2760=m +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_PDA_POWER=m +CONFIG_BATTERY_DS2760=m +CONFIG_HWMON=y +CONFIG_HWMON_VID=m +CONFIG_SENSORS_ABITUGURU=m +CONFIG_SENSORS_ABITUGURU3=m +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_K8TEMP=m +CONFIG_SENSORS_ASB100=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_FSCHER=m +CONFIG_SENSORS_FSCPOS=m +CONFIG_SENSORS_FSCHMD=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_CORETEMP=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_HDAPS=m +CONFIG_SENSORS_APPLESMC=m +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +CONFIG_SOFT_WATCHDOG=m +CONFIG_ACQUIRE_WDT=m +CONFIG_ADVANTECH_WDT=m +CONFIG_ALIM1535_WDT=m +CONFIG_ALIM7101_WDT=m +CONFIG_SC520_WDT=m +CONFIG_EUROTECH_WDT=m +CONFIG_IB700_WDT=m +CONFIG_IBMASR=m +CONFIG_WAFER_WDT=m +CONFIG_I6300ESB_WDT=m +CONFIG_ITCO_WDT=m +CONFIG_ITCO_VENDOR_SUPPORT=y +CONFIG_IT8712F_WDT=m +CONFIG_SC1200_WDT=m +CONFIG_PC87413_WDT=m +CONFIG_60XX_WDT=m +CONFIG_SBC8360_WDT=m +CONFIG_CPU5_WDT=m +CONFIG_SMSC37B787_WDT=m +CONFIG_W83627HF_WDT=m +CONFIG_W83697HF_WDT=m +CONFIG_W83877F_WDT=m +CONFIG_W83977F_WDT=m +CONFIG_MACHZ_WDT=m +CONFIG_SBC_EPX_C3_WATCHDOG=m + +# +# PCI-based Watchdog Cards +# +CONFIG_PCIPCWATCHDOG=m +CONFIG_WDTPCI=m +CONFIG_WDT_501_PCI=y + +# +# USB-based Watchdog Cards +# +CONFIG_USBPCWATCHDOG=m + +# +# Sonics Silicon Backplane +# +CONFIG_SSB_POSSIBLE=y +CONFIG_SSB=m +CONFIG_SSB_PCIHOST_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +# CONFIG_SSB_PCMCIAHOST is not set +# CONFIG_SSB_SILENT is not set +# CONFIG_SSB_DEBUG is not set +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_DRIVER_PCICORE=y + +# +# Multifunction device drivers +# +CONFIG_MFD_SM501=m + +# +# Multimedia devices +# +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set + +# +# Encoders/decoders and other helper chips +# + +# +# Audio decoders +# +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_MSP3400=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_WM8775=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_VP27SMPX=m + +# +# Video decoders +# +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_VPX3220=m + +# +# Video and audio decoders +# +CONFIG_VIDEO_CX25840=m + +# +# MPEG video encoders +# +CONFIG_VIDEO_CX2341X=m + +# +# Video encoders +# +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m + +# +# Video improvement chips +# +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_TUNER_3036=m +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_MEYE=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_ALSA=m +CONFIG_VIDEO_SAA7134_OSS=m +CONFIG_VIDEO_SAA7134_DVB=m +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_CX88=m +CONFIG_VIDEO_CX88_ALSA=m +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_FB_IVTV=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_29XXX=y +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_SYSFS=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_USBVIDEO=m +CONFIG_USB_VICAM=m +CONFIG_USB_IBMCAM=m +CONFIG_USB_KONICAWC=m +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_ET61X251=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_USB_W9968CF=m +# CONFIG_USB_OV511 is not set +CONFIG_USB_SE401=m +CONFIG_USB_SN9C102=m +CONFIG_USB_STV680=m +CONFIG_USB_ZC0301=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_ZR364XX=m +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RADIO_MAESTRO=m +CONFIG_USB_DSBR=m +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_PATCH=m + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 + +# +# Supported FlexCopII (B2C2) Adapters +# +CONFIG_DVB_B2C2_FLEXCOP=m +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set + +# +# Supported BT878 Adapters +# +CONFIG_DVB_BT8XX=m + +# +# Supported Pluto2 Adapters +# +CONFIG_DVB_PLUTO2=m + +# +# Supported DVB Frontends +# + +# +# Customise DVB Frontends +# +# CONFIG_DVB_FE_CUSTOMISE is not set + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_STV0299=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_MT312=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_TDA10086=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_S5H1409=m + +# +# Tuners/PLL support +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_DIB0070=m + +# +# Miscellaneous devices +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_TUA6100=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TUNER_SIMPLE=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_DAB=y +CONFIG_USB_DABUSB=m + +# +# Graphics support +# +CONFIG_AGP=y +CONFIG_AGP_AMD64=y +CONFIG_AGP_INTEL=m +CONFIG_AGP_SIS=m +CONFIG_AGP_VIA=m +CONFIG_DRM=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_I810=m +CONFIG_DRM_I830=m +CONFIG_DRM_I915=m +CONFIG_DRM_MGA=m +CONFIG_DRM_SIS=m +CONFIG_DRM_VIA=m +CONFIG_DRM_SAVAGE=m +CONFIG_VGASTATE=m +CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_FB=y +CONFIG_FIRMWARE_EDID=y +CONFIG_FB_DDC=m +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +CONFIG_FB_SYS_FILLRECT=m +CONFIG_FB_SYS_COPYAREA=m +CONFIG_FB_SYS_IMAGEBLIT=m +CONFIG_FB_SYS_FOPS=m +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_SVGALIB=m +# CONFIG_FB_MACMODES is not set +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y + +# +# Frame buffer hardware drivers +# +CONFIG_FB_CIRRUS=m +CONFIG_FB_PM2=m +CONFIG_FB_PM2_FIFO_DISCONNECT=y +CONFIG_FB_CYBER2000=m +CONFIG_FB_ARC=m +CONFIG_FB_ASILIANT=y +CONFIG_FB_IMSTT=y +CONFIG_FB_VGA16=m +CONFIG_FB_UVESA=m +CONFIG_FB_VESA=m +CONFIG_FB_EFI=y +CONFIG_FB_HECUBA=m +CONFIG_FB_HGA=m +# CONFIG_FB_HGA_ACCEL is not set +CONFIG_FB_S1D13XXX=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_I2C=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_BACKLIGHT=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_I2C=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_BACKLIGHT=y +CONFIG_FB_LE80578=m +CONFIG_FB_CARILLO_RANCH=m +CONFIG_FB_INTEL=m +# CONFIG_FB_INTEL_DEBUG is not set +CONFIG_FB_INTEL_I2C=y +CONFIG_FB_MATROX=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_RADEON=m +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_ATY128=m +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY=m +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_KYRO=m +CONFIG_FB_3DFX=m +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_VOODOO1=m +CONFIG_FB_VT8623=m +CONFIG_FB_TRIDENT=m +# CONFIG_FB_TRIDENT_ACCEL is not set +CONFIG_FB_ARK=m +CONFIG_FB_PM3=m +CONFIG_FB_GEODE=y +CONFIG_FB_GEODE_LX=m +CONFIG_FB_GEODE_GX=m +# CONFIG_FB_GEODE_GX_SET_FBSIZE is not set +CONFIG_FB_GEODE_GX1=m +CONFIG_FB_SM501=m +# CONFIG_FB_VIRTUAL is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_PROGEAR=m +CONFIG_BACKLIGHT_CARILLO_RANCH=m + +# +# Display device support +# +CONFIG_DISPLAY_SUPPORT=m + +# +# Display hardware drivers +# + +# +# Console display driver support +# +CONFIG_VGA_CONSOLE=y +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +CONFIG_VIDEO_SELECT=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +# CONFIG_LOGO is not set + +# +# Sound +# +CONFIG_SOUND=m + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=m +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m +CONFIG_SND_SEQUENCER=m +CONFIG_SND_SEQ_DUMMY=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +CONFIG_SND_SEQUENCER_OSS=y +CONFIG_SND_RTCTIMER=m +CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y +CONFIG_SND_DYNAMIC_MINORS=y +CONFIG_SND_SUPPORT_OLD_API=y +# CONFIG_SND_VERBOSE_PROCFS is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set + +# +# Generic devices +# +CONFIG_SND_MPU401_UART=m +CONFIG_SND_OPL3_LIB=m +CONFIG_SND_VX_LIB=m +CONFIG_SND_AC97_CODEC=m +CONFIG_SND_DUMMY=m +CONFIG_SND_VIRMIDI=m +CONFIG_SND_MTPAV=m +CONFIG_SND_MTS64=m +CONFIG_SND_SERIAL_U16550=m +CONFIG_SND_MPU401=m +CONFIG_SND_PORTMAN2X4=m +CONFIG_SND_SB_COMMON=m +CONFIG_SND_SB16_DSP=m + +# +# PCI devices +# +CONFIG_SND_AD1889=m +CONFIG_SND_ALS300=m +CONFIG_SND_ALS4000=m +CONFIG_SND_ALI5451=m +CONFIG_SND_ATIIXP=m +CONFIG_SND_ATIIXP_MODEM=m +CONFIG_SND_AU8810=m +CONFIG_SND_AU8820=m +CONFIG_SND_AU8830=m +CONFIG_SND_AZT3328=m +CONFIG_SND_BT87X=m +CONFIG_SND_BT87X_OVERCLOCK=y +CONFIG_SND_CA0106=m +CONFIG_SND_CMIPCI=m +CONFIG_SND_CS4281=m +CONFIG_SND_CS46XX=m +CONFIG_SND_CS46XX_NEW_DSP=y +CONFIG_SND_CS5530=m +CONFIG_SND_DARLA20=m +CONFIG_SND_GINA20=m +CONFIG_SND_LAYLA20=m +CONFIG_SND_DARLA24=m +CONFIG_SND_GINA24=m +CONFIG_SND_LAYLA24=m +CONFIG_SND_MONA=m +CONFIG_SND_MIA=m +CONFIG_SND_ECHO3G=m +CONFIG_SND_INDIGO=m +CONFIG_SND_INDIGOIO=m +CONFIG_SND_INDIGODJ=m +CONFIG_SND_EMU10K1=m +CONFIG_SND_EMU10K1X=m +CONFIG_SND_ENS1370=m +CONFIG_SND_ENS1371=m +CONFIG_SND_ES1938=m +CONFIG_SND_ES1968=m +CONFIG_SND_FM801=m +CONFIG_SND_FM801_TEA575X_BOOL=y +CONFIG_SND_FM801_TEA575X=m +CONFIG_SND_HDA_INTEL=m +CONFIG_SND_HDA_HWDEP=y +CONFIG_SND_HDA_CODEC_REALTEK=y +CONFIG_SND_HDA_CODEC_ANALOG=y +CONFIG_SND_HDA_CODEC_SIGMATEL=y +CONFIG_SND_HDA_CODEC_VIA=y +CONFIG_SND_HDA_CODEC_ATIHDMI=y +CONFIG_SND_HDA_CODEC_CONEXANT=y +CONFIG_SND_HDA_CODEC_CMEDIA=y +CONFIG_SND_HDA_CODEC_SI3054=y +CONFIG_SND_HDA_GENERIC=y +CONFIG_SND_HDA_POWER_SAVE=y +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDSP=m +CONFIG_SND_HDSPM=m +CONFIG_SND_ICE1712=m +CONFIG_SND_ICE1724=m +CONFIG_SND_INTEL8X0=m +CONFIG_SND_INTEL8X0M=m +CONFIG_SND_KORG1212=m +CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MAESTRO3=m +CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MIXART=m +CONFIG_SND_NM256=m +CONFIG_SND_PCXHR=m +CONFIG_SND_RIPTIDE=m +CONFIG_SND_RME32=m +CONFIG_SND_RME96=m +CONFIG_SND_RME9652=m +CONFIG_SND_SONICVIBES=m +CONFIG_SND_TRIDENT=m +CONFIG_SND_VIA82XX=m +CONFIG_SND_VIA82XX_MODEM=m +CONFIG_SND_VX222=m +CONFIG_SND_YMFPCI=m +CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y +CONFIG_SND_AC97_POWER_SAVE=y +CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0 + +# +# SPI devices +# + +# +# USB devices +# +CONFIG_SND_USB_AUDIO=m +CONFIG_SND_USB_USX2Y=m +CONFIG_SND_USB_CAIAQ=m +CONFIG_SND_USB_CAIAQ_INPUT=y + +# +# PCMCIA devices +# +CONFIG_SND_VXPOCKET=m +CONFIG_SND_PDAUDIOCF=m + +# +# System on Chip audio support +# +CONFIG_SND_SOC=m + +# +# SoC Audio support for SuperH +# + +# +# Open Sound System +# +CONFIG_SOUND_PRIME=m +CONFIG_SOUND_TRIDENT=m +CONFIG_SOUND_MSNDCLAS=m +CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin" +CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin" +CONFIG_SOUND_MSNDPIN=m +CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin" +CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin" +CONFIG_SOUND_OSS=m +# CONFIG_SOUND_TRACEINIT is not set +CONFIG_SOUND_DMAP=y +CONFIG_SOUND_SSCAPE=m +CONFIG_SOUND_VMIDI=m +CONFIG_SOUND_TRIX=m +CONFIG_SOUND_MSS=m +CONFIG_SOUND_MPU401=m +CONFIG_SOUND_PAS=m +CONFIG_SOUND_PSS=m +CONFIG_PSS_MIXER=y +CONFIG_SOUND_SB=m +CONFIG_SOUND_YM3812=m +CONFIG_SOUND_UART6850=m +CONFIG_SOUND_AEDSP16=m +CONFIG_SC6600=y +CONFIG_SC6600_JOY=y +CONFIG_SC6600_CDROM=4 +CONFIG_SC6600_CDROMBASE=0 +CONFIG_AEDSP16_MSS=y +# CONFIG_AEDSP16_SBPRO is not set +CONFIG_SOUND_KAHLUA=m +CONFIG_AC97_BUS=m +CONFIG_HID_SUPPORT=y +CONFIG_HID=m +# CONFIG_HID_DEBUG is not set +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=m +CONFIG_USB_HIDINPUT_POWERBOOK=y +# CONFIG_HID_FF is not set +CONFIG_USB_HIDDEV=y + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m +CONFIG_USB_SUPPORT=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB=m +# CONFIG_USB_DEBUG is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_SUSPEND=y +# CONFIG_USB_PERSIST is not set +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_ISP116X_HCD=m +CONFIG_USB_OHCI_HCD=m +CONFIG_USB_OHCI_HCD_SSB=y +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +CONFIG_USB_UHCI_HCD=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SL811_CS=m +CONFIG_USB_R8A66597_HCD=m + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# +# may also be needed; see USB_STORAGE Help for more information +# +CONFIG_USB_STORAGE=m +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_LIBUSUAL=y + +# +# USB Imaging devices +# +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +CONFIG_USB_MON=y + +# +# USB port drivers +# +CONFIG_USB_USS720=m + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_EZUSB=y + +# +# USB Miscellaneous drivers +# +CONFIG_USB_EMI62=m +CONFIG_USB_EMI26=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_AUERSWALD=m +CONFIG_USB_RIO500=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LCD=m +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_LED=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_FTDI_ELAN=m +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_LD=m +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_IOWARRIOR=m +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# +CONFIG_USB_ATM=m +CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_CXACRU=m +CONFIG_USB_UEAGLEATM=m +CONFIG_USB_XUSBATM=m + +# +# USB Gadget Support +# +CONFIG_USB_GADGET=m +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_SELECTED=y +CONFIG_USB_GADGET_AMD5536UDC=y +CONFIG_USB_AMD5536UDC=m +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +# CONFIG_USB_GADGET_NET2280 is not set +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_M66592 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_S3C2410 is not set +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_DUMMY_HCD is not set +CONFIG_USB_GADGET_DUALSPEED=y +CONFIG_USB_ZERO=m +CONFIG_USB_ETH=m +CONFIG_USB_ETH_RNDIS=y +CONFIG_USB_GADGETFS=m +CONFIG_USB_FILE_STORAGE=m +# CONFIG_USB_FILE_STORAGE_TEST is not set +CONFIG_USB_G_SERIAL=m +# CONFIG_USB_MIDI_GADGET is not set + +# +# MMC/SD/SDIO support, can only select one arch from MMC and MSS +# +CONFIG_MMC=m +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_UNSAFE_RESUME is not set + +# +# MMC/SD Card Drivers +# +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +CONFIG_SDIO_UART=m + +# +# MMC/SD Host Controller Drivers +# +CONFIG_MMC_SDHCI=m +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_WBSD=m +CONFIG_MMC_TIFM_SD=m +CONFIG_MMC_SPI=m +# CONFIG_MSS is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=m + +# +# LED drivers +# + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_IPATH=m +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_MLX4_INFINIBAND=m +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_ISER=m +CONFIG_EDAC=y + +# +# Reporting subsystems +# +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_MM_EDAC=m +CONFIG_EDAC_E752X=m +CONFIG_EDAC_I82975X=m +CONFIG_EDAC_I5000=m +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +# CONFIG_RTC_DEBUG is not set + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_DRV_TEST=m + +# +# I2C RTC drivers +# +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y + +# +# SPI RTC drivers +# +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_MAX6902=m + +# +# Platform RTC drivers +# +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_V3020=m + +# +# on-CPU RTC drivers +# +CONFIG_DMADEVICES=y + +# +# DMA Devices +# +CONFIG_INTEL_IOATDMA=m +CONFIG_DMA_ENGINE=y + +# +# DMA Clients +# +CONFIG_NET_DMA=y +CONFIG_DCA=m +CONFIG_AUXDISPLAY=y +CONFIG_KS0108=m +CONFIG_KS0108_PORT=0x378 +CONFIG_KS0108_DELAY=2 +CONFIG_CFAG12864B=m +CONFIG_CFAG12864B_RATE=20 + +# +# Userspace I/O +# +CONFIG_UIO=m +CONFIG_UIO_CIF=m + +# +# Firmware Drivers +# +CONFIG_EDD=y +# CONFIG_EDD_OFF is not set +CONFIG_DELL_RBU=m +CONFIG_DCDBAS=m +CONFIG_DMIID=y + +# +# File systems +# +CONFIG_EXT2_FS=m +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +CONFIG_EXT3_FS_XATTR=y +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=m +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +# CONFIG_JFS_DEBUG is not set +CONFIG_JFS_STATISTICS=y +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_RT=y +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_OCFS2_FS=m +CONFIG_OCFS2_DEBUG_MASKLOG=y +# CONFIG_OCFS2_DEBUG_FS is not set +CONFIG_MINIX_FS=m +CONFIG_ROMFS_FS=m +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_QUOTA=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_QUOTA_COMPAT=y +CONFIG_QFMT_V1=m +CONFIG_QFMT_V2=m +CONFIG_SIM_FS=m +CONFIG_VZ_QUOTA=m +# CONFIG_VZ_QUOTA_UNLOAD is not set +CONFIG_VZ_QUOTA_UGID=y +CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m +CONFIG_GENERIC_ACL=y + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_VMCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_CONFIGFS_FS=m + +# +# Miscellaneous filesystems +# +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_AFFS_FS=m +CONFIG_ECRYPT_FS=m +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +CONFIG_BEFS_FS=m +# CONFIG_BEFS_DEBUG is not set +CONFIG_BFS_FS=m +CONFIG_EFS_FS=m +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +CONFIG_CRAMFS=y +CONFIG_VXFS_FS=m +CONFIG_HPFS_FS=m +CONFIG_QNX4FS_FS=m +CONFIG_SYSV_FS=m +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_UFS_DEBUG is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFSD=m +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=m +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=m +CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_XPRT_RDMA=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_EXPERIMENTAL is not set +CONFIG_NCP_FS=m +CONFIG_NCPFS_PACKET_SIGNING=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_STRONG=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_OS2_NS=y +# CONFIG_NCPFS_SMALLDOS is not set +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_EXTRAS=y +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set +CONFIG_AFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_9P_FS=m +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +CONFIG_ACORN_PARTITION=y +# CONFIG_ACORN_PARTITION_CUMANA is not set +# CONFIG_ACORN_PARTITION_EESOX is not set +CONFIG_ACORN_PARTITION_ICS=y +# CONFIG_ACORN_PARTITION_ADFS is not set +# CONFIG_ACORN_PARTITION_POWERTEC is not set +CONFIG_ACORN_PARTITION_RISCIX=y +CONFIG_OSF_PARTITION=y +CONFIG_AMIGA_PARTITION=y +CONFIG_ATARI_PARTITION=y +CONFIG_MAC_PARTITION=y +CONFIG_MSDOS_PARTITION=y +CONFIG_BSD_DISKLABEL=y +CONFIG_MINIX_SUBPARTITION=y +CONFIG_SOLARIS_X86_PARTITION=y +CONFIG_UNIXWARE_DISKLABEL=y +CONFIG_LDM_PARTITION=y +# CONFIG_LDM_DEBUG is not set +CONFIG_SGI_PARTITION=y +CONFIG_ULTRIX_PARTITION=y +CONFIG_SUN_PARTITION=y +CONFIG_KARMA_PARTITION=y +CONFIG_EFI_PARTITION=y +CONFIG_SYSV68_PARTITION=y +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +CONFIG_INSTRUMENTATION=y +CONFIG_PROFILING=y +CONFIG_OPROFILE=m +CONFIG_KPROBES=y +# CONFIG_MARKERS is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_UNUSED_SYMBOLS=y +CONFIG_DEBUG_FS=y +# CONFIG_HEADERS_CHECK is not set +CONFIG_SYSRQ_DEBUG=y +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_SCHED_DEBUG=y +# CONFIG_SCHEDSTATS is not set +CONFIG_TIMER_STATS=y +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_FORCED_INLINING is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_LKDTM is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SAMPLES is not set +CONFIG_NONPROMISC_DEVMEM=y +CONFIG_EARLY_PRINTK=y +# CONFIG_WRAPPER_PRINT is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_RODATA is not set +# CONFIG_IOMMU_DEBUG is not set +CONFIG_IO_DELAY_TYPE_0X80=0 +CONFIG_IO_DELAY_TYPE_0XED=1 +CONFIG_IO_DELAY_TYPE_UDELAY=2 +CONFIG_IO_DELAY_TYPE_NONE=3 +CONFIG_IO_DELAY_0X80=y +# CONFIG_IO_DELAY_0XED is not set +# CONFIG_IO_DELAY_UDELAY is not set +# CONFIG_IO_DELAY_NONE is not set +CONFIG_DEFAULT_IO_DELAY_TYPE=0 + +# +# Security options +# + +# +# Grsecurity +# +CONFIG_GRKERNSEC=y + +# +# Executable Protections +# +CONFIG_GRKERNSEC_TPE=y +CONFIG_GRKERNSEC_TPE_ALL=y +# CONFIG_GRKERNSEC_TPE_INVERT is not set +CONFIG_GRKERNSEC_TPE_GID=1005 + +# +# Sysctl support +# +CONFIG_GRKERNSEC_SYSCTL=y +# CONFIG_GRKERNSEC_SYSCTL_ON is not set + +# +# Logging Options +# +CONFIG_GRKERNSEC_FLOODTIME=10 +CONFIG_GRKERNSEC_FLOODBURST=4 +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_XOR_BLOCKS=m +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_XTS=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_TWOFISH_X86_64=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_AES_X86_64=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_HW=y +CONFIG_HAVE_KVM=y +CONFIG_VIRTUALIZATION=y +CONFIG_KVM=m +CONFIG_KVM_INTEL=m +CONFIG_KVM_AMD=m +CONFIG_VIRTIO=m +CONFIG_VIRTIO_RING=m +CONFIG_VIRTIO_PCI=m +CONFIG_VIRTIO_BALLOON=m + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +CONFIG_CRC16=m +CONFIG_CRC_ITU_T=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_PLIST=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CHECK_SIGNATURE=y + +# +# User resources +# +CONFIG_BEANCOUNTERS=y +CONFIG_BC_RSS_ACCOUNTING=y +CONFIG_BC_IO_ACCOUNTING=y +CONFIG_BC_IO_SCHED=y +CONFIG_BC_SWAP_ACCOUNTING=y +CONFIG_BC_PROC=y +# CONFIG_BC_DEBUG is not set +CONFIG_DRM_VIA_CHROME9=m --- linux-2.6.24.orig/debian/binary-custom.d/openvz/config.i386 +++ linux-2.6.24/debian/binary-custom.d/openvz/config.i386 @@ -0,0 +1,4194 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.24-16-openvz +# Thu Apr 10 06:21:17 2008 +# +# CONFIG_64BIT is not set +CONFIG_X86_32=y +# CONFIG_X86_64 is not set +CONFIG_X86=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_SEMAPHORE_SLEEPERS=y +CONFIG_MMU=y +CONFIG_ZONE_DMA=y +CONFIG_QUICKLIST=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_DMI=y +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y +# CONFIG_GENERIC_TIME_VSYSCALL is not set +CONFIG_ARCH_SUPPORTS_OPROFILE=y +# CONFIG_ZONE_DMA32 is not set +CONFIG_ARCH_POPULATES_NODE_MAP=y +# CONFIG_AUDIT_ARCH is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_X86_SMP=y +CONFIG_X86_HT=y +CONFIG_X86_BIOS_REBOOT=y +CONFIG_X86_TRAMPOLINE=y +CONFIG_KTIME_SCALAR=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-server" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_USER_NS=y +CONFIG_PID_NS=y +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_TREE=y +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=17 +CONFIG_CGROUPS=y +# CONFIG_CGROUP_DEBUG is not set +CONFIG_CGROUP_NS=y +CONFIG_CPUSETS=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_FAIR_USER_SCHED is not set +# CONFIG_FAIR_CGROUP_SCHED is not set +CONFIG_VZ_FAIRSCHED=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_PROC_PID_CPUSET=y +CONFIG_RELAY=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLUB_DEBUG=y +# CONFIG_SLAB is not set +CONFIG_SLUB=y +# CONFIG_SLOB is not set +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_LBD=y +CONFIG_BLK_DEV_IO_TRACE=y +# CONFIG_LSF is not set +# CONFIG_BLK_DEV_BSG is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +CONFIG_LSM_MMAP_MIN_ADDR=0 + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_PREEMPT_NOTIFIERS=y + +# +# Processor type and features +# +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_SMP=y +CONFIG_X86_PC=y +# CONFIG_X86_ELAN is not set +# CONFIG_X86_VOYAGER is not set +# CONFIG_X86_NUMAQ is not set +# CONFIG_X86_SUMMIT is not set +# CONFIG_X86_BIGSMP is not set +# CONFIG_X86_VISWS is not set +# CONFIG_X86_GENERICARCH is not set +# CONFIG_X86_ES7000 is not set +# CONFIG_X86_VSMP is not set +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_PARAVIRT=y +CONFIG_PARAVIRT_GUEST=y +CONFIG_XEN=y +CONFIG_VMI=y +# CONFIG_M386 is not set +# CONFIG_M486 is not set +# CONFIG_M586 is not set +# CONFIG_M586TSC is not set +# CONFIG_M586MMX is not set +CONFIG_M686=y +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MPENTIUM4 is not set +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MEFFICEON is not set +# CONFIG_MWINCHIPC6 is not set +# CONFIG_MWINCHIP2 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +# CONFIG_MCYRIXIII is not set +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set +# CONFIG_MPSC is not set +# CONFIG_MCORE2 is not set +# CONFIG_GENERIC_CPU is not set +CONFIG_X86_GENERIC=y +CONFIG_X86_CMPXCHG=y +CONFIG_X86_L1_CACHE_SHIFT=7 +CONFIG_X86_XADD=y +CONFIG_X86_PPRO_FENCE=y +CONFIG_X86_WP_WORKS_OK=y +CONFIG_X86_INVLPG=y +CONFIG_X86_BSWAP=y +CONFIG_X86_POPAD_OK=y +CONFIG_X86_GOOD_APIC=y +CONFIG_X86_INTEL_USERCOPY=y +CONFIG_X86_USE_PPRO_CHECKSUM=y +CONFIG_X86_TSC=y +CONFIG_X86_CMOV=y +CONFIG_X86_MINIMUM_CPU_FAMILY=4 +CONFIG_HPET_TIMER=y +CONFIG_HPET_EMULATE_RTC=y +CONFIG_NR_CPUS=8 +CONFIG_SCHED_SMT=y +CONFIG_SCHED_MC=y +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +CONFIG_X86_LOCAL_APIC=y +CONFIG_X86_IO_APIC=y +# CONFIG_NMI_WATCHDOG is not set +# CONFIG_X86_MCE is not set +CONFIG_VM86=y +CONFIG_TOSHIBA=m +CONFIG_I8K=m +CONFIG_X86_REBOOTFIXUPS=y +CONFIG_MICROCODE=m +CONFIG_MICROCODE_OLD_INTERFACE=y +CONFIG_X86_MSR=m +CONFIG_X86_CPUID=m +# CONFIG_NOHIGHMEM is not set +# CONFIG_HIGHMEM4G is not set +CONFIG_HIGHMEM64G=y +CONFIG_VMSPLIT_3G=y +# CONFIG_VMSPLIT_3G_OPT is not set +# CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_2G_OPT is not set +# CONFIG_VMSPLIT_1G is not set +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_HIGHMEM=y +CONFIG_X86_PAE=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_SPARSEMEM_STATIC=y +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_RESOURCES_64BIT=y +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_BOUNCE=y +CONFIG_NR_QUICK=1 +CONFIG_VIRT_TO_BUS=y +CONFIG_HIGHPTE=y +# CONFIG_MATH_EMULATION is not set +CONFIG_MTRR=y +CONFIG_EFI=y +# CONFIG_IRQBALANCE is not set +CONFIG_BOOT_IOREMAP=y +CONFIG_SECCOMP=y +CONFIG_HZ_100=y +# CONFIG_HZ_250 is not set +# CONFIG_HZ_300 is not set +# CONFIG_HZ_1000 is not set +CONFIG_HZ=100 +CONFIG_KEXEC=y +CONFIG_CRASH_DUMP=y +CONFIG_PHYSICAL_START=0x100000 +CONFIG_RELOCATABLE=y +CONFIG_PHYSICAL_ALIGN=0x100000 +CONFIG_HOTPLUG_CPU=y +# CONFIG_COMPAT_VDSO is not set +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y + +# +# Power management options +# +CONFIG_PM=y +CONFIG_PM_LEGACY=y +CONFIG_PM_DEBUG=y +# CONFIG_PM_VERBOSE is not set +CONFIG_PM_TRACE=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PM_SLEEP=y +CONFIG_SUSPEND_SMP_POSSIBLE=y +CONFIG_SUSPEND=y +CONFIG_PM_DISABLE_CONSOLE=y +CONFIG_HIBERNATION_SMP_POSSIBLE=y +CONFIG_HIBERNATION=y +CONFIG_PM_STD_PARTITION="" +CONFIG_ACPI=y +CONFIG_ACPI_SLEEP=y +CONFIG_ACPI_PROCFS=y +CONFIG_ACPI_PROCFS_POWER=y +CONFIG_ACPI_SYSFS_POWER=y +CONFIG_ACPI_PROC_EVENT=y +CONFIG_ACPI_AC=m +CONFIG_ACPI_BATTERY=m +CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_VIDEO=m +CONFIG_ACPI_FAN=m +CONFIG_ACPI_DOCK=m +CONFIG_ACPI_BAY=m +CONFIG_ACPI_PROCESSOR=m +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_ASUS=m +CONFIG_ACPI_TOSHIBA=m +CONFIG_ACPI_CUSTOM_DSDT_INITRD=y +CONFIG_ACPI_BLACKLIST_YEAR=2000 +# CONFIG_ACPI_DEBUG is not set +CONFIG_ACPI_EC=y +CONFIG_ACPI_POWER=y +CONFIG_ACPI_SYSTEM=y +CONFIG_X86_PM_TIMER=y +CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_SBS=m +CONFIG_APM=m +# CONFIG_APM_IGNORE_USER_SUSPEND is not set +# CONFIG_APM_DO_ENABLE is not set +# CONFIG_APM_CPU_IDLE is not set +# CONFIG_APM_DISPLAY_BLANK is not set +# CONFIG_APM_ALLOW_INTS is not set +# CONFIG_APM_REAL_MODE_POWER_OFF is not set + +# +# CPU Frequency scaling +# +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_TABLE=m +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m + +# +# CPUFreq processor drivers +# +CONFIG_X86_ACPI_CPUFREQ=m +CONFIG_X86_POWERNOW_K6=m +CONFIG_X86_POWERNOW_K7=m +CONFIG_X86_POWERNOW_K7_ACPI=y +CONFIG_X86_POWERNOW_K8=m +CONFIG_X86_POWERNOW_K8_ACPI=y +CONFIG_X86_GX_SUSPMOD=m +CONFIG_X86_SPEEDSTEP_CENTRINO=m +CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y +CONFIG_X86_SPEEDSTEP_ICH=m +CONFIG_X86_SPEEDSTEP_SMI=m +CONFIG_X86_P4_CLOCKMOD=m +CONFIG_X86_CPUFREQ_NFORCE2=m +CONFIG_X86_LONGRUN=m +CONFIG_X86_LONGHAUL=m +# CONFIG_X86_E_POWERSAVER is not set + +# +# shared options +# +# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set +CONFIG_X86_SPEEDSTEP_LIB=m +CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y + +# +# Bus options (PCI etc.) +# +CONFIG_PCI=y +# CONFIG_PCI_GOBIOS is not set +# CONFIG_PCI_GOMMCONFIG is not set +# CONFIG_PCI_GODIRECT is not set +CONFIG_PCI_GOANY=y +CONFIG_PCI_BIOS=y +CONFIG_PCI_DIRECT=y +CONFIG_PCI_MMCONFIG=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCIEPORTBUS=y +CONFIG_HOTPLUG_PCI_PCIE=m +CONFIG_PCIEAER=y +CONFIG_ARCH_SUPPORTS_MSI=y +CONFIG_PCI_MSI=y +CONFIG_PCI_LEGACY=y +# CONFIG_PCI_DEBUG is not set +CONFIG_HT_IRQ=y +CONFIG_ISA_DMA_API=y +CONFIG_ISA=y +CONFIG_EISA=y +CONFIG_EISA_VLB_PRIMING=y +CONFIG_EISA_PCI_EISA=y +CONFIG_EISA_VIRTUAL_ROOT=y +CONFIG_EISA_NAMES=y +CONFIG_MCA=y +CONFIG_MCA_LEGACY=y +# CONFIG_MCA_PROC_FS is not set +CONFIG_SCx200=m +CONFIG_SCx200HR_TIMER=m +CONFIG_K8_NB=y +CONFIG_PCCARD=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_IOCTL=y +CONFIG_CARDBUS=y + +# +# PC-card bridges +# +CONFIG_YENTA=m +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_PD6729=m +CONFIG_I82092=m +CONFIG_I82365=m +CONFIG_TCIC=m +CONFIG_PCMCIA_PROBE=y +CONFIG_PCCARD_NONSTATIC=m +CONFIG_HOTPLUG_PCI=m +CONFIG_HOTPLUG_PCI_FAKE=m +CONFIG_HOTPLUG_PCI_COMPAQ=m +CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y +CONFIG_HOTPLUG_PCI_IBM=m +CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m +CONFIG_HOTPLUG_PCI_CPCI=y +CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m +CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m +CONFIG_HOTPLUG_PCI_SHPC=m + +# +# Executable file formats / Emulations +# +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_AOUT=m +CONFIG_BINFMT_MISC=m + +# +# OpenVZ +# +CONFIG_VE=y +CONFIG_VE_CALLS=m +CONFIG_VZ_GENCALLS=y +CONFIG_VE_NETDEV=m +CONFIG_VE_ETHDEV=m +CONFIG_VZ_DEV=m +CONFIG_VE_IPTABLES=y +CONFIG_VZ_WDOG=m +CONFIG_VZ_CHECKPOINT=m + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_NET_NS=y +CONFIG_PACKET=m +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_ASK_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +# CONFIG_IP_PNP is not set +CONFIG_NET_IPIP=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_IP_MROUTE=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_LRO=m +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_CONG_ILLINOIS=m +# CONFIG_DEFAULT_BIC is not set +# CONFIG_DEFAULT_CUBIC is not set +# CONFIG_DEFAULT_HTCP is not set +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFAULT_RENO=y +CONFIG_DEFAULT_TCP_CONG="reno" +CONFIG_TCP_MD5SIG=y +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_TAB_BITS=12 + +# +# IPVS transport protocol load balancing support +# +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_AH=y + +# +# IPVS scheduler +# +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_WRR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_NQ=m + +# +# IPVS application helper +# +CONFIG_IP_VS_FTP=m +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +CONFIG_IPV6_MULTIPLE_TABLES=y +# CONFIG_IPV6_SUBTREES is not set +CONFIG_NETWORK_SECMARK=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_BRIDGE_NETFILTER=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_NETLINK=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m + +# +# IP: Netfilter Configuration +# +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration (EXPERIMENTAL) +# +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_RAW=m + +# +# DECnet: Netfilter Configuration +# +CONFIG_DECNET_NF_GRABULATOR=m + +# +# Bridge: Netfilter Configuration +# +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_IP_DCCP=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_IP_DCCP_ACKVEC=y + +# +# DCCP CCIDs Configuration (EXPERIMENTAL) +# +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +CONFIG_IP_DCCP_TFRC_LIB=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 + +# +# DCCP Kernel Hacking +# +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_NET_DCCPPROBE=m +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +CONFIG_ATM=y +CONFIG_ATM_CLIP=y +# CONFIG_ATM_CLIP_NO_ICMP is not set +CONFIG_ATM_LANE=m +CONFIG_ATM_MPOA=m +CONFIG_ATM_BR2684=m +# CONFIG_ATM_BR2684_IPFILTER is not set +CONFIG_BRIDGE=m +CONFIG_VLAN_8021Q=m +CONFIG_DECNET=m +# CONFIG_DECNET_ROUTER is not set +CONFIG_LLC=y +CONFIG_LLC2=m +CONFIG_IPX=m +# CONFIG_IPX_INTERN is not set +CONFIG_ATALK=m +CONFIG_DEV_APPLETALK=m +CONFIG_LTPC=m +CONFIG_COPS=m +CONFIG_COPS_DAYNA=y +CONFIG_COPS_TANGENT=y +CONFIG_IPDDP=m +CONFIG_IPDDP_ENCAP=y +CONFIG_IPDDP_DECAP=y +CONFIG_X25=m +CONFIG_LAPB=m +CONFIG_ECONET=m +CONFIG_ECONET_AUNUDP=y +CONFIG_ECONET_NATIVE=y +CONFIG_WAN_ROUTER=m +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_ATM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_INGRESS=m + +# +# Classification +# +CONFIG_NET_CLS=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_U32=m +# CONFIG_CLS_U32_PERF is not set +CONFIG_CLS_U32_MARK=y +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_CLS_ACT=y +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_GACT=m +CONFIG_GACT_PROB=y +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_SIMP=m +# CONFIG_NET_CLS_POLICE is not set +# CONFIG_NET_CLS_IND is not set +CONFIG_NET_SCH_FIFO=y + +# +# Network testing +# +CONFIG_NET_PKTGEN=m +CONFIG_NET_TCPPROBE=m +CONFIG_HAMRADIO=y + +# +# Packet Radio protocols +# +CONFIG_AX25=m +# CONFIG_AX25_DAMA_SLAVE is not set +CONFIG_NETROM=m +CONFIG_ROSE=m + +# +# AX.25 network device drivers +# +CONFIG_MKISS=m +CONFIG_6PACK=m +CONFIG_BPQETHER=m +CONFIG_SCC=m +# CONFIG_SCC_DELAY is not set +# CONFIG_SCC_TRXECHO is not set +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BAYCOM_PAR=m +CONFIG_BAYCOM_EPP=m +CONFIG_YAM=m +CONFIG_IRDA=m + +# +# IrDA protocols +# +CONFIG_IRLAN=m +CONFIG_IRNET=m +CONFIG_IRCOMM=m +CONFIG_IRDA_ULTRA=y + +# +# IrDA options +# +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_FAST_RR=y +CONFIG_IRDA_DEBUG=y + +# +# Infrared-port device drivers +# + +# +# SIR device drivers +# +CONFIG_IRTTY_SIR=m + +# +# Dongle support +# +CONFIG_DONGLE=y +CONFIG_ESI_DONGLE=m +CONFIG_ACTISYS_DONGLE=m +CONFIG_TEKRAM_DONGLE=m +# CONFIG_TOIM3232_DONGLE is not set +CONFIG_LITELINK_DONGLE=m +CONFIG_MA600_DONGLE=m +CONFIG_GIRBIL_DONGLE=m +CONFIG_MCP2120_DONGLE=m +CONFIG_OLD_BELKIN_DONGLE=m +CONFIG_ACT200L_DONGLE=m +CONFIG_KINGSUN_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +CONFIG_KS959_DONGLE=m + +# +# Old SIR device drivers +# + +# +# Old Serial dongle support +# + +# +# FIR device drivers +# +CONFIG_USB_IRDA=m +CONFIG_SIGMATEL_FIR=m +CONFIG_NSC_FIR=m +CONFIG_WINBOND_FIR=m +CONFIG_TOSHIBA_FIR=m +CONFIG_SMC_IRCC_FIR=m +CONFIG_ALI_FIR=m +CONFIG_VLSI_FIR=m +CONFIG_VIA_FIR=m +CONFIG_MCS_FIR=m +CONFIG_BT=m +CONFIG_BT_L2CAP=m +CONFIG_BT_SCO=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_CMTP=m +CONFIG_BT_HIDP=m + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIVHCI=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_RXKAD=m +CONFIG_FIB_RULES=y + +# +# Wireless +# +CONFIG_CFG80211=m +CONFIG_NL80211=y +CONFIG_WIRELESS_EXT=y +CONFIG_MAC80211=m +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_DEBUGFS=y +# CONFIG_MAC80211_DEBUG is not set +CONFIG_IEEE80211=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_CRYPT_WEP=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +CONFIG_NET_9P=m +CONFIG_NET_9P_FD=m +CONFIG_NET_9P_VIRTIO=m +# CONFIG_NET_9P_DEBUG is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_CONNECTOR=m +CONFIG_MTD=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_CONCAT=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_REDBOOT_PARTS=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_FTL=m +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_INFTL=m +CONFIG_RFD_FTL=m +CONFIG_SSFDC=m +CONFIG_MTD_OOPS=m + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_GEN_PROBE=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_RAM=m +CONFIG_MTD_ROM=m +CONFIG_MTD_ABSENT=m + +# +# Mapping drivers for chip access +# +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PNC2000=m +CONFIG_MTD_SC520CDP=m +CONFIG_MTD_NETSC520=m +CONFIG_MTD_TS5500=m +CONFIG_MTD_SBC_GXX=m +CONFIG_MTD_SCx200_DOCFLASH=m +CONFIG_MTD_AMD76XROM=m +CONFIG_MTD_ICHXROM=m +CONFIG_MTD_ESB2ROM=m +CONFIG_MTD_CK804XROM=m +CONFIG_MTD_SCB2_FLASH=m +CONFIG_MTD_NETtel=m +CONFIG_MTD_DILNETPC=m +CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000 +CONFIG_MTD_L440GX=m +CONFIG_MTD_PCI=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_PLATRAM=m + +# +# Self-contained MTD device drivers +# +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_DATAFLASH=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_MTDRAM=m +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTD_BLOCK2MTD=m + +# +# Disk-On-Chip Device Drivers +# +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCECC=m +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_DOCPROBE_ADDRESS=0 +CONFIG_MTD_NAND=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_IDS=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_CS553X=m +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_2X_PROGRAM=y +CONFIG_MTD_ONENAND_SIM=m + +# +# UBI - Unsorted block images +# +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +CONFIG_MTD_UBI_GLUEBI=y + +# +# UBI debugging options +# +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_PARPORT=m +CONFIG_PARPORT_PC=m +CONFIG_PARPORT_SERIAL=m +CONFIG_PARPORT_PC_FIFO=y +# CONFIG_PARPORT_PC_SUPERIO is not set +CONFIG_PARPORT_PC_PCMCIA=m +# CONFIG_PARPORT_GSC is not set +CONFIG_PARPORT_AX88796=m +CONFIG_PARPORT_1284=y +CONFIG_PARPORT_NOT_PC=y +CONFIG_PNP=y +# CONFIG_PNP_DEBUG is not set + +# +# Protocols +# +CONFIG_ISAPNP=y +CONFIG_PNPBIOS=y +CONFIG_PNPBIOS_PROC_FS=y +CONFIG_PNPACPI=y +CONFIG_BLK_DEV=y +CONFIG_BLK_DEV_FD=m +CONFIG_BLK_DEV_XD=m +CONFIG_PARIDE=m + +# +# Parallel IDE high-level drivers +# +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PT=m +CONFIG_PARIDE_PG=m + +# +# Parallel IDE protocol modules +# +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_BPCK6=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_CISS_SCSI_TAPE=y +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_UMEM=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_SX8=m +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_ATA_OVER_ETH=m +CONFIG_XEN_BLKDEV_FRONTEND=m +CONFIG_VIRTIO_BLK=m +CONFIG_MISC_DEVICES=y +CONFIG_IBM_ASM=m +CONFIG_PHANTOM=m +CONFIG_EEPROM_93CX6=m +CONFIG_SGI_IOC4=m +CONFIG_TIFM_CORE=m +CONFIG_TIFM_7XX1=m +CONFIG_ASUS_LAPTOP=m +CONFIG_FUJITSU_LAPTOP=m +CONFIG_MSI_LAPTOP=m +CONFIG_SONY_LAPTOP=m +CONFIG_SONYPI_COMPAT=y +CONFIG_THINKPAD_ACPI=m +# CONFIG_THINKPAD_ACPI_DEBUG is not set +CONFIG_THINKPAD_ACPI_BAY=y +CONFIG_IDE=y +CONFIG_IDE_MAX_HWIFS=4 +CONFIG_BLK_DEV_IDE=m + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +# CONFIG_BLK_DEV_HD_IDE is not set +CONFIG_BLK_DEV_IDEDISK=m +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_IDECD=m +CONFIG_BLK_DEV_IDETAPE=m +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDEACPI=y +# CONFIG_IDE_TASK_IOCTL is not set +CONFIG_IDE_PROC_FS=y + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=m +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_CMD640=y +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +CONFIG_BLK_DEV_IDEPNP=y + +# +# PCI IDE chipsets support +# +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_IDEPCI_SHARE_IRQ=y +# CONFIG_IDEPCI_PCIBUS_ORDER is not set +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_GENERIC is not set +CONFIG_BLK_DEV_OPTI621=m +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI15X3=m +# CONFIG_WDC_ALI15X3 is not set +CONFIG_BLK_DEV_AMD74XX=m +CONFIG_BLK_DEV_ATIIXP=m +CONFIG_BLK_DEV_CMD64X=m +# CONFIG_BLK_DEV_TRIFLEX is not set +CONFIG_BLK_DEV_CY82C693=m +# CONFIG_BLK_DEV_CS5520 is not set +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_CS5535=m +CONFIG_BLK_DEV_HPT34X=m +# CONFIG_HPT34X_AUTODMA is not set +CONFIG_BLK_DEV_HPT366=m +# CONFIG_BLK_DEV_JMICRON is not set +CONFIG_BLK_DEV_SC1200=m +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +CONFIG_BLK_DEV_NS87415=m +CONFIG_BLK_DEV_PDC202XX_OLD=m +CONFIG_PDC202XX_BURST=y +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +CONFIG_BLK_DEV_TRM290=m +CONFIG_BLK_DEV_VIA82CXXX=m +CONFIG_BLK_DEV_TC86C001=m +# CONFIG_IDE_ARM is not set + +# +# Other IDE chipsets support +# + +# +# Note: most of these also require special kernel boot parameters +# +CONFIG_BLK_DEV_4DRIVES=y +CONFIG_BLK_DEV_ALI14XX=m +CONFIG_BLK_DEV_DTC2278=m +CONFIG_BLK_DEV_HT6560B=m +CONFIG_BLK_DEV_QD65XX=m +CONFIG_BLK_DEV_UMC8672=m +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI device support +# +CONFIG_RAID_ATTRS=m +CONFIG_SCSI=m +CONFIG_SCSI_DMA=y +CONFIG_SCSI_TGT=m +CONFIG_SCSI_NETLINK=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=m +CONFIG_CHR_DEV_ST=m +CONFIG_CHR_DEV_OSST=m +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_SCH=m + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_FC_TGT_ATTRS=y +CONFIG_SCSI_ISCSI_ATTRS=m +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +CONFIG_SCSI_SAS_ATA=y +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_LOWLEVEL=y +CONFIG_ISCSI_TCP=m +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_7000FASST=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_AHA152X=m +CONFIG_SCSI_AHA1542=m +CONFIG_SCSI_AHA1740=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_AIC7XXX=m +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_DEBUG_ENABLE=y +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_AIC79XX=m +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC79XX_DEBUG_ENABLE=y +CONFIG_AIC79XX_DEBUG_MASK=0 +CONFIG_AIC79XX_REG_PRETTY_PRINT=y +CONFIG_SCSI_AIC94XX=m +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_SCSI_DPT_I2O=m +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_IN2000=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_SAS=m +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_BUSLOGIC=m +# CONFIG_SCSI_OMIT_FLASHPOINT is not set +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_DTC3280=m +CONFIG_SCSI_EATA=m +CONFIG_SCSI_EATA_TAGGED_QUEUE=y +CONFIG_SCSI_EATA_LINKED_COMMANDS=y +CONFIG_SCSI_EATA_MAX_TAGS=16 +CONFIG_SCSI_FUTURE_DOMAIN=m +CONFIG_SCSI_FD_MCS=m +CONFIG_SCSI_GDTH=m +CONFIG_SCSI_GENERIC_NCR5380=m +CONFIG_SCSI_GENERIC_NCR5380_MMIO=m +CONFIG_SCSI_GENERIC_NCR53C400=y +CONFIG_SCSI_IBMMCA=m +CONFIG_IBMMCA_SCSI_ORDER_STANDARD=y +# CONFIG_IBMMCA_SCSI_DEV_RESET is not set +CONFIG_SCSI_IPS=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_PPA=m +CONFIG_SCSI_IMM=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_NCR53C406A=m +CONFIG_SCSI_NCR_D700=m +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_TRACE is not set +# CONFIG_SCSI_IPR_DUMP is not set +CONFIG_SCSI_NCR_Q720=m +CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8 +CONFIG_SCSI_NCR53C8XX_MAX_TAGS=4 +CONFIG_SCSI_NCR53C8XX_SYNC=5 +CONFIG_SCSI_PAS16=m +CONFIG_SCSI_PSI240I=m +CONFIG_SCSI_QLOGIC_FAS=m +CONFIG_SCSI_QLOGIC_1280=m +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_SEAGATE=m +CONFIG_SCSI_SIM710=m +CONFIG_SCSI_SYM53C416=m +CONFIG_SCSI_DC395x=m +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_T128=m +CONFIG_SCSI_U14_34F=m +CONFIG_SCSI_U14_34F_TAGGED_QUEUE=y +CONFIG_SCSI_U14_34F_LINKED_COMMANDS=y +CONFIG_SCSI_U14_34F_MAX_TAGS=8 +CONFIG_SCSI_ULTRASTOR=m +CONFIG_SCSI_NSP32=m +CONFIG_SCSI_DEBUG=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_PCMCIA_AHA152X=m +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_NINJA_SCSI=m +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_ATA=m +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_ACPI=y +CONFIG_SATA_AHCI=m +CONFIG_SATA_SVW=m +CONFIG_ATA_PIIX=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_PDC_ADMA=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_SX4=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SATA_INIC162X=m +CONFIG_PATA_ACPI=m +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +CONFIG_PATA_ARTOP=m +CONFIG_PATA_ATIIXP=m +# CONFIG_PATA_CMD640_PCI is not set +CONFIG_PATA_CMD64X=m +CONFIG_PATA_CS5520=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5535 is not set +CONFIG_PATA_CS5536=m +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_EFAR=m +CONFIG_ATA_GENERIC=m +CONFIG_PATA_HPT366=m +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +CONFIG_PATA_HPT3X3=m +# CONFIG_PATA_HPT3X3_DMA is not set +# CONFIG_PATA_ISAPNP is not set +CONFIG_PATA_IT821X=m +CONFIG_PATA_IT8213=m +CONFIG_PATA_JMICRON=m +# CONFIG_PATA_LEGACY is not set +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_OLDPIIX=m +CONFIG_PATA_NETCELL=m +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +CONFIG_PATA_PCMCIA=m +# CONFIG_PATA_PDC_OLD is not set +CONFIG_PATA_QDI=m +# CONFIG_PATA_RADISYS is not set +CONFIG_PATA_RZ1000=m +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_PDC2027X=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_VIA=m +CONFIG_PATA_WINBOND=m +# CONFIG_PATA_WINBOND_VLB is not set +CONFIG_PATA_PLATFORM=m +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_MULTIPATH_RDAC=m +CONFIG_DM_MULTIPATH_HP=m +# CONFIG_DM_DELAY is not set +CONFIG_DM_UEVENT=y +CONFIG_FUSION=y +CONFIG_FUSION_SPI=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_SAS=m +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_CTL=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +CONFIG_IEEE1394=m + +# +# Subsystem Options +# +# CONFIG_IEEE1394_VERBOSEDEBUG is not set + +# +# Controllers +# +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_OHCI1394=m + +# +# Protocols +# +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_I2O=m +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_BUS=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_SCSI=m +CONFIG_I2O_PROC=m +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_NETDEVICES=y +# CONFIG_NETDEVICES_MULTIQUEUE is not set +CONFIG_IFB=m +CONFIG_DUMMY=m +CONFIG_BONDING=m +CONFIG_MACVLAN=m +CONFIG_EQUALIZER=m +CONFIG_TUN=m +CONFIG_VETH=m +CONFIG_NET_SB1000=m +CONFIG_ARCNET=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_RAW=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM90xx=m +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RIM_I=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_ISA=m +CONFIG_ARCNET_COM20020_PCI=m +CONFIG_PHYLIB=m + +# +# MII PHY device drivers +# +CONFIG_MARVELL_PHY=m +CONFIG_DAVICOM_PHY=m +CONFIG_QSEMI_PHY=m +CONFIG_LXT_PHY=m +CONFIG_CICADA_PHY=m +CONFIG_VITESSE_PHY=m +CONFIG_SMSC_PHY=m +CONFIG_BROADCOM_PHY=m +CONFIG_ICPLUS_PHY=m +CONFIG_FIXED_PHY=m +# CONFIG_FIXED_MII_10_FDX is not set +# CONFIG_FIXED_MII_100_FDX is not set +CONFIG_FIXED_MII_1000_FDX=y +CONFIG_FIXED_MII_AMNT=1 +CONFIG_MDIO_BITBANG=m +CONFIG_NET_ETHERNET=y +CONFIG_MII=m +CONFIG_HAPPYMEAL=m +CONFIG_SUNGEM=m +CONFIG_CASSINI=m +CONFIG_NET_VENDOR_3COM=y +CONFIG_EL1=m +CONFIG_EL2=m +CONFIG_ELPLUS=m +CONFIG_EL16=m +CONFIG_EL3=m +CONFIG_3C515=m +CONFIG_ELMC=m +CONFIG_ELMC_II=m +CONFIG_VORTEX=m +CONFIG_TYPHOON=m +CONFIG_LANCE=m +CONFIG_NET_VENDOR_SMC=y +CONFIG_WD80x3=m +CONFIG_ULTRAMCA=m +CONFIG_ULTRA=m +CONFIG_ULTRA32=m +CONFIG_SMC9194=m +CONFIG_NET_VENDOR_RACAL=y +CONFIG_NI52=m +CONFIG_NI65=m +CONFIG_NET_TULIP=y +CONFIG_DE2104X=m +CONFIG_TULIP=m +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_NAPI is not set +CONFIG_DE4X5=m +CONFIG_WINBOND_840=m +CONFIG_DM9102=m +CONFIG_ULI526X=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_AT1700=m +CONFIG_DEPCA=m +CONFIG_HP100=m +CONFIG_NET_ISA=y +CONFIG_E2100=m +CONFIG_EWRK3=m +CONFIG_EEXPRESS=m +CONFIG_EEXPRESS_PRO=m +CONFIG_HPLAN_PLUS=m +CONFIG_HPLAN=m +CONFIG_LP486E=m +CONFIG_ETH16I=m +CONFIG_NE2000=m +CONFIG_ZNET=m +CONFIG_SEEQ8005=m +CONFIG_NE2_MCA=m +CONFIG_IBMLANA=m +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +CONFIG_NET_PCI=y +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_AMD8111_ETH=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_AC3200=m +CONFIG_APRICOT=m +CONFIG_B44=m +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI=y +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +CONFIG_CS89x0=m +CONFIG_EEPRO100=m +CONFIG_E100=m +CONFIG_LNE390=m +CONFIG_FEALNX=m +CONFIG_NATSEMI=m +CONFIG_NE2K_PCI=m +CONFIG_NE3210=m +CONFIG_ES3210=m +CONFIG_8139CP=m +CONFIG_8139TOO=m +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +CONFIG_8139TOO_8129=y +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_SIS900=m +CONFIG_EPIC100=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_TLAN=m +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_SC92031=m +CONFIG_NET_POCKET=y +CONFIG_ATP=m +CONFIG_DE600=m +CONFIG_DE620=m +CONFIG_NETDEV_1000=y +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_DL2K=m +CONFIG_E1000=m +CONFIG_E1000_NAPI=y +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000E=m +CONFIG_IP1000=m +CONFIG_NS83820=m +CONFIG_HAMACHI=m +CONFIG_YELLOWFIN=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_SIS190=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SK98LIN is not set +CONFIG_VIA_VELOCITY=m +CONFIG_TIGON3=m +CONFIG_BNX2=m +CONFIG_QLA3XXX=m +CONFIG_ATL1=m +CONFIG_NETDEV_10000=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_IXGBE=m +CONFIG_IXGB=m +# CONFIG_IXGB_NAPI is not set +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +CONFIG_MYRI10GE=m +CONFIG_NETXEN_NIC=m +CONFIG_NIU=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_TEHUTI=m +CONFIG_TR=y +CONFIG_IBMTR=m +CONFIG_IBMOL=m +CONFIG_IBMLS=m +CONFIG_3C359=m +CONFIG_TMS380TR=m +CONFIG_TMSPCI=m +CONFIG_SKISA=m +CONFIG_PROTEON=m +CONFIG_ABYSS=m +CONFIG_MADGEMC=m +CONFIG_SMCTR=m + +# +# Wireless LAN +# +CONFIG_WLAN_PRE80211=y +CONFIG_STRIP=m +CONFIG_ARLAN=m +CONFIG_WAVELAN=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_NETWAVE=m +CONFIG_WLAN_80211=y +CONFIG_PCMCIA_RAYCS=m +CONFIG_IPW2100=m +CONFIG_IPW2100_MONITOR=y +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2200=m +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +# CONFIG_IPW2200_DEBUG is not set +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_USB=m +CONFIG_LIBERTAS_CS=m +CONFIG_LIBERTAS_SDIO=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_AIRO=m +CONFIG_HERMES=m +# CONFIG_PLX_HERMES is not set +# CONFIG_TMD_HERMES is not set +# CONFIG_NORTEL_HERMES is not set +# CONFIG_PCI_HERMES is not set +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_ATMEL=m +CONFIG_PCI_ATMEL=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_AIRO_CS=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PRISM54=m +CONFIG_USB_ZD1201=m +CONFIG_RTL8187=m +CONFIG_ADM8211=m +CONFIG_P54_COMMON=m +CONFIG_P54_USB=m +CONFIG_P54_PCI=m +# CONFIG_IWLWIFI is not set +CONFIG_HOSTAP=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PLX=m +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_CS=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_PIO=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +# CONFIG_BCM43XX_PIO_MODE is not set +CONFIG_B43=m +CONFIG_B43_PCI_AUTOSELECT=y +CONFIG_B43_PCICORE_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_LEDS=y +CONFIG_B43_RFKILL=y +# CONFIG_B43_DEBUG is not set +CONFIG_B43_DMA=y +CONFIG_B43_PIO=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_PIO=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_RT2X00=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +# CONFIG_RT2X00_DEBUG is not set + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_BELKIN=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +# CONFIG_USB_NET_ZAURUS is not set +CONFIG_NET_PCMCIA=y +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_AXNET=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_PCMCIA_IBMTR=m +CONFIG_WAN=y +CONFIG_HOSTESS_SV11=m +CONFIG_COSA=m +CONFIG_LANMEDIA=m +CONFIG_SEALEVEL_4021=m +CONFIG_HDLC=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_X25=m +CONFIG_PCI200SYN=m +CONFIG_WANXL=m +CONFIG_PC300=m +CONFIG_PC300_MLPPP=y + +# +# Cyclades-PC300 MLPPP support is disabled. +# + +# +# Refer to the file README.mlppp, provided by PC300 package. +# +# CONFIG_PC300TOO is not set +CONFIG_N2=m +CONFIG_C101=m +CONFIG_FARSYNC=m +CONFIG_DSCC4=m +CONFIG_DSCC4_PCISYNC=y +CONFIG_DSCC4_PCI_RST=y +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_SDLA=m +CONFIG_WAN_ROUTER_DRIVERS=m +CONFIG_CYCLADES_SYNC=m +CONFIG_CYCLOMX_X25=y +CONFIG_LAPBETHER=m +CONFIG_X25_ASY=m +CONFIG_SBNI=m +# CONFIG_SBNI_MULTILINE is not set +CONFIG_ATM_DRIVERS=y +# CONFIG_ATM_DUMMY is not set +CONFIG_ATM_TCP=m +CONFIG_ATM_LANAI=m +CONFIG_ATM_ENI=m +# CONFIG_ATM_ENI_DEBUG is not set +# CONFIG_ATM_ENI_TUNE_BURST is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_ATM_NICSTAR=m +# CONFIG_ATM_NICSTAR_USE_SUNI is not set +# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set +CONFIG_ATM_IDT77252=m +# CONFIG_ATM_IDT77252_DEBUG is not set +# CONFIG_ATM_IDT77252_RCV_ALL is not set +CONFIG_ATM_IDT77252_USE_SUNI=y +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_IA=m +# CONFIG_ATM_IA_DEBUG is not set +CONFIG_ATM_FORE200E_MAYBE=m +CONFIG_ATM_FORE200E_PCA=y +CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y +# CONFIG_ATM_FORE200E_USE_TASKLET is not set +CONFIG_ATM_FORE200E_TX_RETRY=16 +CONFIG_ATM_FORE200E_DEBUG=0 +CONFIG_ATM_FORE200E=m +CONFIG_ATM_HE=m +CONFIG_ATM_HE_USE_SUNI=y +CONFIG_XEN_NETDEV_FRONTEND=m +CONFIG_FDDI=y +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_SKFP=m +CONFIG_HIPPI=y +CONFIG_ROADRUNNER=m +# CONFIG_ROADRUNNER_LARGE_RINGS is not set +CONFIG_PLIP=m +CONFIG_PPP=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_FILTER=y +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_MPPE=m +CONFIG_PPPOE=m +CONFIG_PPPOATM=m +CONFIG_PPPOL2TP=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +CONFIG_SLHC=m +CONFIG_SLIP_SMART=y +CONFIG_SLIP_MODE_SLIP6=y +CONFIG_NET_FC=y +CONFIG_SHAPER=m +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_VIRTIO_NET=m +CONFIG_ISDN=m +CONFIG_ISDN_I4L=m +CONFIG_ISDN_PPP=y +CONFIG_ISDN_PPP_VJ=y +CONFIG_ISDN_MPP=y +CONFIG_IPPP_FILTER=y +CONFIG_ISDN_PPP_BSDCOMP=m +CONFIG_ISDN_AUDIO=y +CONFIG_ISDN_TTY_FAX=y +CONFIG_ISDN_X25=y + +# +# ISDN feature submodules +# +CONFIG_ISDN_DIVERSION=m + +# +# ISDN4Linux hardware drivers +# + +# +# Passive cards +# +CONFIG_ISDN_DRV_HISAX=m + +# +# D-channel protocol features +# +CONFIG_HISAX_EURO=y +CONFIG_DE_AOC=y +# CONFIG_HISAX_NO_SENDCOMPLETE is not set +# CONFIG_HISAX_NO_LLC is not set +# CONFIG_HISAX_NO_KEYPAD is not set +CONFIG_HISAX_1TR6=y +CONFIG_HISAX_NI1=y +CONFIG_HISAX_MAX_CARDS=8 + +# +# HiSax supported cards +# +CONFIG_HISAX_16_0=y +CONFIG_HISAX_16_3=y +CONFIG_HISAX_TELESPCI=y +CONFIG_HISAX_S0BOX=y +CONFIG_HISAX_AVM_A1=y +CONFIG_HISAX_FRITZPCI=y +CONFIG_HISAX_AVM_A1_PCMCIA=y +CONFIG_HISAX_ELSA=y +CONFIG_HISAX_IX1MICROR2=y +CONFIG_HISAX_DIEHLDIVA=y +CONFIG_HISAX_ASUSCOM=y +CONFIG_HISAX_TELEINT=y +CONFIG_HISAX_HFCS=y +CONFIG_HISAX_SEDLBAUER=y +CONFIG_HISAX_SPORTSTER=y +CONFIG_HISAX_MIC=y +CONFIG_HISAX_NETJET=y +CONFIG_HISAX_NETJET_U=y +CONFIG_HISAX_NICCY=y +CONFIG_HISAX_ISURF=y +CONFIG_HISAX_HSTSAPHIR=y +CONFIG_HISAX_BKM_A4T=y +CONFIG_HISAX_SCT_QUADRO=y +CONFIG_HISAX_GAZEL=y +CONFIG_HISAX_HFC_PCI=y +CONFIG_HISAX_W6692=y +CONFIG_HISAX_HFC_SX=y +CONFIG_HISAX_ENTERNOW_PCI=y +# CONFIG_HISAX_DEBUG is not set + +# +# HiSax PCMCIA card service modules +# +CONFIG_HISAX_SEDLBAUER_CS=m +CONFIG_HISAX_ELSA_CS=m +CONFIG_HISAX_AVM_A1_CS=m +CONFIG_HISAX_TELES_CS=m + +# +# HiSax sub driver modules +# +CONFIG_HISAX_ST5481=m +CONFIG_HISAX_HFCUSB=m +CONFIG_HISAX_HFC4S8S=m +CONFIG_HISAX_FRITZ_PCIPNP=m +CONFIG_HISAX_HDLC=y + +# +# Active cards +# +CONFIG_ISDN_DRV_ICN=m +CONFIG_ISDN_DRV_PCBIT=m +CONFIG_ISDN_DRV_SC=m +CONFIG_ISDN_DRV_ACT2000=m +CONFIG_ISDN_DRV_GIGASET=m +CONFIG_GIGASET_BASE=m +CONFIG_GIGASET_M105=m +CONFIG_GIGASET_M101=m +# CONFIG_GIGASET_DEBUG is not set +# CONFIG_GIGASET_UNDOCREQ is not set +CONFIG_ISDN_CAPI=m +CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y +CONFIG_CAPI_TRACE=y +CONFIG_ISDN_CAPI_MIDDLEWARE=y +CONFIG_ISDN_CAPI_CAPI20=m +CONFIG_ISDN_CAPI_CAPIFS_BOOL=y +CONFIG_ISDN_CAPI_CAPIFS=m +CONFIG_ISDN_CAPI_CAPIDRV=m + +# +# CAPI hardware drivers +# +CONFIG_CAPI_AVM=y +CONFIG_ISDN_DRV_AVMB1_B1ISA=m +CONFIG_ISDN_DRV_AVMB1_B1PCI=m +CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y +CONFIG_ISDN_DRV_AVMB1_T1ISA=m +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m +CONFIG_ISDN_DRV_AVMB1_AVM_CS=m +CONFIG_ISDN_DRV_AVMB1_T1PCI=m +CONFIG_ISDN_DRV_AVMB1_C4=m +CONFIG_CAPI_EICON=y +CONFIG_ISDN_DIVAS=m +CONFIG_ISDN_DIVAS_BRIPCI=y +CONFIG_ISDN_DIVAS_PRIPCI=y +CONFIG_ISDN_DIVAS_DIVACAPI=m +CONFIG_ISDN_DIVAS_USERIDI=m +CONFIG_ISDN_DIVAS_MAINT=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_POLLDEV=m + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_EVBUG=m + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_APPLETOUCH=m +CONFIG_MOUSE_INPORT=m +# CONFIG_MOUSE_ATIXL is not set +CONFIG_MOUSE_LOGIBM=m +CONFIG_MOUSE_PC110PAD=m +CONFIG_MOUSE_VSXXXAA=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_IFORCE=m +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_IFORCE_232=y +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_INPUT_TABLET=y +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_FUJITSU=m +CONFIG_TOUCHSCREEN_GUNZE=m +CONFIG_TOUCHSCREEN_ELO=m +CONFIG_TOUCHSCREEN_MTOUCH=m +CONFIG_TOUCHSCREEN_MK712=m +CONFIG_TOUCHSCREEN_PENMOUNT=m +CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +CONFIG_TOUCHSCREEN_TOUCHWIN=m +CONFIG_TOUCHSCREEN_UCB1400=m +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_INPUT_MISC=y +CONFIG_INPUT_PCSPKR=m +CONFIG_INPUT_WISTRON_BTNS=m +CONFIG_INPUT_ATLAS_BTNS=m +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_YEALINK=m +CONFIG_INPUT_UINPUT=m + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_SERPORT=m +CONFIG_SERIO_CT82C710=m +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=m +CONFIG_GAMEPORT=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_DEV_KMEM is not set +CONFIG_SERIAL_NONSTANDARD=y +# CONFIG_COMPUTONE is not set +CONFIG_ROCKETPORT=m +CONFIG_CYCLADES=m +# CONFIG_CYZ_INTR is not set +CONFIG_DIGIEPCA=m +# CONFIG_ESPSERIAL is not set +# CONFIG_MOXA_INTELLIO is not set +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +# CONFIG_ISI is not set +CONFIG_SYNCLINK=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_GT=m +CONFIG_N_HDLC=m +CONFIG_SPECIALIX=m +# CONFIG_SPECIALIX_RTSCTS is not set +CONFIG_SX=m +# CONFIG_RIO is not set +CONFIG_STALDRV=y + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_PNP=y +CONFIG_SERIAL_8250_CS=m +CONFIG_SERIAL_8250_NR_UARTS=48 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_FOURPORT=m +CONFIG_SERIAL_8250_ACCENT=m +CONFIG_SERIAL_8250_BOCA=m +CONFIG_SERIAL_8250_EXAR_ST16C554=m +CONFIG_SERIAL_8250_HUB6=m +CONFIG_SERIAL_8250_SHARE_IRQ=y +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_MCA=m + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_JSM=m +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_PRINTER=m +# CONFIG_LP_CONSOLE is not set +CONFIG_PPDEV=m +CONFIG_HVC_DRIVER=y +CONFIG_HVC_XEN=y +CONFIG_IPMI_HANDLER=m +# CONFIG_IPMI_PANIC_EVENT is not set +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m +CONFIG_IPMI_POWEROFF=m +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_INTEL=m +CONFIG_HW_RANDOM_AMD=m +CONFIG_HW_RANDOM_GEODE=m +CONFIG_HW_RANDOM_VIA=m +CONFIG_NVRAM=m +CONFIG_RTC=y +CONFIG_DTLK=m +CONFIG_R3964=m +CONFIG_APPLICOM=m +CONFIG_SONYPI=m + +# +# PCMCIA character devices +# +CONFIG_SYNCLINK_CS=m +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_MWAVE=m +CONFIG_SCx200_GPIO=m +CONFIG_PC8736x_GPIO=m +CONFIG_NSC_GPIO=m +CONFIG_CS5535_GPIO=m +CONFIG_RAW_DRIVER=m +CONFIG_MAX_RAW_DEVS=256 +CONFIG_HPET=y +# CONFIG_HPET_RTC_IRQ is not set +CONFIG_HPET_MMAP=y +CONFIG_HANGCHECK_TIMER=m +CONFIG_TCG_TPM=m +CONFIG_TCG_TIS=m +CONFIG_TCG_NSC=m +CONFIG_TCG_ATMEL=m +CONFIG_TCG_INFINEON=m +CONFIG_TELCLOCK=m +CONFIG_DEVPORT=y +CONFIG_I2C=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=m +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_ALGOPCA=m + +# +# I2C Hardware Bus support +# +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_PIIX4=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_SCx200_I2C=m +CONFIG_SCx200_I2C_SCL=12 +CONFIG_SCx200_I2C_SDA=13 +CONFIG_SCx200_ACB=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_TAOS_EVM=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m +CONFIG_I2C_PCA_ISA=m + +# +# Miscellaneous I2C Chip support +# +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_DS1682=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_TSL2550=m +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# SPI support +# +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +CONFIG_SPI_LM70_LLP=m + +# +# SPI Protocol Masters +# +CONFIG_SPI_AT25=m +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_W1=m +CONFIG_W1_CON=y + +# +# 1-wire Bus Masters +# +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_DS2482=m + +# +# 1-wire Slaves +# +CONFIG_W1_SLAVE_THERM=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2760=m +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_PDA_POWER=m +CONFIG_BATTERY_DS2760=m +CONFIG_HWMON=y +CONFIG_HWMON_VID=m +CONFIG_SENSORS_ABITUGURU=m +CONFIG_SENSORS_ABITUGURU3=m +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_K8TEMP=m +CONFIG_SENSORS_ASB100=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_FSCHER=m +CONFIG_SENSORS_FSCPOS=m +CONFIG_SENSORS_FSCHMD=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_CORETEMP=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_HDAPS=m +CONFIG_SENSORS_APPLESMC=m +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +CONFIG_SOFT_WATCHDOG=m +CONFIG_ACQUIRE_WDT=m +CONFIG_ADVANTECH_WDT=m +CONFIG_ALIM1535_WDT=m +CONFIG_ALIM7101_WDT=m +CONFIG_SC520_WDT=m +CONFIG_EUROTECH_WDT=m +CONFIG_IB700_WDT=m +CONFIG_IBMASR=m +CONFIG_WAFER_WDT=m +CONFIG_I6300ESB_WDT=m +CONFIG_ITCO_WDT=m +CONFIG_ITCO_VENDOR_SUPPORT=y +CONFIG_IT8712F_WDT=m +CONFIG_SC1200_WDT=m +CONFIG_SCx200_WDT=m +CONFIG_PC87413_WDT=m +CONFIG_60XX_WDT=m +CONFIG_SBC8360_WDT=m +CONFIG_SBC7240_WDT=m +CONFIG_CPU5_WDT=m +CONFIG_SMSC37B787_WDT=m +CONFIG_W83627HF_WDT=m +CONFIG_W83697HF_WDT=m +CONFIG_W83877F_WDT=m +CONFIG_W83977F_WDT=m +CONFIG_MACHZ_WDT=m +CONFIG_SBC_EPX_C3_WATCHDOG=m + +# +# ISA-based Watchdog Cards +# +CONFIG_PCWATCHDOG=m +CONFIG_MIXCOMWD=m +CONFIG_WDT=m +CONFIG_WDT_501=y + +# +# PCI-based Watchdog Cards +# +CONFIG_PCIPCWATCHDOG=m +CONFIG_WDTPCI=m +CONFIG_WDT_501_PCI=y + +# +# USB-based Watchdog Cards +# +CONFIG_USBPCWATCHDOG=m + +# +# Sonics Silicon Backplane +# +CONFIG_SSB_POSSIBLE=y +CONFIG_SSB=m +CONFIG_SSB_PCIHOST_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +# CONFIG_SSB_PCMCIAHOST is not set +# CONFIG_SSB_SILENT is not set +# CONFIG_SSB_DEBUG is not set +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_DRIVER_PCICORE=y + +# +# Multifunction device drivers +# +CONFIG_MFD_SM501=m + +# +# Multimedia devices +# +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set + +# +# Encoders/decoders and other helper chips +# + +# +# Audio decoders +# +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_MSP3400=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_WM8775=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_VP27SMPX=m + +# +# Video decoders +# +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_VPX3220=m + +# +# Video and audio decoders +# +CONFIG_VIDEO_CX25840=m + +# +# MPEG video encoders +# +CONFIG_VIDEO_CX2341X=m + +# +# Video encoders +# +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m + +# +# Video improvement chips +# +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_PMS=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_TUNER_3036=m +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_MEYE=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_ALSA=m +CONFIG_VIDEO_SAA7134_OSS=m +CONFIG_VIDEO_SAA7134_DVB=m +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_CX88=m +CONFIG_VIDEO_CX88_ALSA=m +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_FB_IVTV=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_29XXX=y +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_SYSFS=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_USBVIDEO=m +CONFIG_USB_VICAM=m +CONFIG_USB_IBMCAM=m +CONFIG_USB_KONICAWC=m +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_ET61X251=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_USB_W9968CF=m +# CONFIG_USB_OV511 is not set +CONFIG_USB_SE401=m +CONFIG_USB_SN9C102=m +CONFIG_USB_STV680=m +CONFIG_USB_ZC0301=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_ZR364XX=m +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_CADET=m +CONFIG_RADIO_RTRACK=m +CONFIG_RADIO_RTRACK2=m +CONFIG_RADIO_AZTECH=m +CONFIG_RADIO_GEMTEK=m +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RADIO_MAESTRO=m +CONFIG_RADIO_SF16FMI=m +CONFIG_RADIO_SF16FMR2=m +CONFIG_RADIO_TERRATEC=m +CONFIG_RADIO_TRUST=m +CONFIG_RADIO_TYPHOON=m +# CONFIG_RADIO_TYPHOON_PROC_FS is not set +CONFIG_RADIO_ZOLTRIX=m +CONFIG_USB_DSBR=m +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_PATCH=m + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 + +# +# Supported FlexCopII (B2C2) Adapters +# +CONFIG_DVB_B2C2_FLEXCOP=m +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set + +# +# Supported BT878 Adapters +# +CONFIG_DVB_BT8XX=m + +# +# Supported Pluto2 Adapters +# +CONFIG_DVB_PLUTO2=m + +# +# Supported DVB Frontends +# + +# +# Customise DVB Frontends +# +# CONFIG_DVB_FE_CUSTOMISE is not set + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_STV0299=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_MT312=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_TDA10086=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_S5H1409=m + +# +# Tuners/PLL support +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_DIB0070=m + +# +# Miscellaneous devices +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_TUA6100=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TUNER_SIMPLE=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_DAB=y +CONFIG_USB_DABUSB=m + +# +# Graphics support +# +CONFIG_AGP=m +CONFIG_AGP_ALI=m +CONFIG_AGP_ATI=m +CONFIG_AGP_AMD=m +CONFIG_AGP_AMD64=m +CONFIG_AGP_INTEL=m +CONFIG_AGP_NVIDIA=m +CONFIG_AGP_SIS=m +CONFIG_AGP_SWORKS=m +CONFIG_AGP_VIA=m +CONFIG_AGP_EFFICEON=m +CONFIG_DRM=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_I810=m +CONFIG_DRM_I830=m +CONFIG_DRM_I915=m +CONFIG_DRM_MGA=m +CONFIG_DRM_SIS=m +CONFIG_DRM_VIA=m +CONFIG_DRM_SAVAGE=m +CONFIG_VGASTATE=m +CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_FB=y +CONFIG_FIRMWARE_EDID=y +CONFIG_FB_DDC=m +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +CONFIG_FB_SYS_FILLRECT=m +CONFIG_FB_SYS_COPYAREA=m +CONFIG_FB_SYS_IMAGEBLIT=m +CONFIG_FB_SYS_FOPS=m +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_SVGALIB=m +# CONFIG_FB_MACMODES is not set +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y + +# +# Frame buffer hardware drivers +# +CONFIG_FB_CIRRUS=m +CONFIG_FB_PM2=m +CONFIG_FB_PM2_FIFO_DISCONNECT=y +CONFIG_FB_CYBER2000=m +CONFIG_FB_ARC=m +CONFIG_FB_ASILIANT=y +CONFIG_FB_IMSTT=y +CONFIG_FB_VGA16=m +CONFIG_FB_UVESA=m +CONFIG_FB_VESA=m +CONFIG_FB_EFI=y +CONFIG_FB_IMAC=y +CONFIG_FB_HECUBA=m +CONFIG_FB_HGA=m +# CONFIG_FB_HGA_ACCEL is not set +CONFIG_FB_S1D13XXX=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_I2C=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_BACKLIGHT=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_I2C=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_BACKLIGHT=y +CONFIG_FB_I810=m +# CONFIG_FB_I810_GTF is not set +CONFIG_FB_LE80578=m +CONFIG_FB_CARILLO_RANCH=m +CONFIG_FB_INTEL=m +# CONFIG_FB_INTEL_DEBUG is not set +CONFIG_FB_INTEL_I2C=y +CONFIG_FB_MATROX=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_RADEON=m +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_ATY128=m +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY=m +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_KYRO=m +CONFIG_FB_3DFX=m +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_VOODOO1=m +CONFIG_FB_VT8623=m +CONFIG_FB_CYBLA=m +CONFIG_FB_TRIDENT=m +# CONFIG_FB_TRIDENT_ACCEL is not set +CONFIG_FB_ARK=m +CONFIG_FB_PM3=m +CONFIG_FB_GEODE=y +CONFIG_FB_GEODE_LX=m +CONFIG_FB_GEODE_GX=m +# CONFIG_FB_GEODE_GX_SET_FBSIZE is not set +CONFIG_FB_GEODE_GX1=m +CONFIG_FB_SM501=m +# CONFIG_FB_VIRTUAL is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_PROGEAR=m +CONFIG_BACKLIGHT_CARILLO_RANCH=m + +# +# Display device support +# +CONFIG_DISPLAY_SUPPORT=m + +# +# Display hardware drivers +# + +# +# Console display driver support +# +CONFIG_VGA_CONSOLE=y +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +CONFIG_VIDEO_SELECT=y +CONFIG_MDA_CONSOLE=m +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +# CONFIG_LOGO is not set + +# +# Sound +# +CONFIG_SOUND=m + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=m +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m +CONFIG_SND_SEQUENCER=m +CONFIG_SND_SEQ_DUMMY=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +CONFIG_SND_SEQUENCER_OSS=y +CONFIG_SND_RTCTIMER=m +CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y +CONFIG_SND_DYNAMIC_MINORS=y +CONFIG_SND_SUPPORT_OLD_API=y +# CONFIG_SND_VERBOSE_PROCFS is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set + +# +# Generic devices +# +CONFIG_SND_MPU401_UART=m +CONFIG_SND_OPL3_LIB=m +CONFIG_SND_OPL4_LIB=m +CONFIG_SND_VX_LIB=m +CONFIG_SND_AC97_CODEC=m +CONFIG_SND_DUMMY=m +CONFIG_SND_VIRMIDI=m +CONFIG_SND_MTPAV=m +CONFIG_SND_MTS64=m +CONFIG_SND_SERIAL_U16550=m +CONFIG_SND_MPU401=m +CONFIG_SND_PORTMAN2X4=m +CONFIG_SND_AD1848_LIB=m +CONFIG_SND_CS4231_LIB=m +CONFIG_SND_SB_COMMON=m +CONFIG_SND_SB8_DSP=m +CONFIG_SND_SB16_DSP=m + +# +# ISA devices +# +CONFIG_SND_ADLIB=m +CONFIG_SND_AD1816A=m +CONFIG_SND_AD1848=m +CONFIG_SND_ALS100=m +CONFIG_SND_AZT2320=m +CONFIG_SND_CMI8330=m +CONFIG_SND_CS4231=m +CONFIG_SND_CS4232=m +CONFIG_SND_CS4236=m +CONFIG_SND_DT019X=m +CONFIG_SND_ES968=m +CONFIG_SND_ES1688=m +CONFIG_SND_ES18XX=m +CONFIG_SND_SC6000=m +CONFIG_SND_GUS_SYNTH=m +CONFIG_SND_GUSCLASSIC=m +CONFIG_SND_GUSEXTREME=m +CONFIG_SND_GUSMAX=m +CONFIG_SND_INTERWAVE=m +CONFIG_SND_INTERWAVE_STB=m +CONFIG_SND_OPL3SA2=m +CONFIG_SND_OPTI92X_AD1848=m +CONFIG_SND_OPTI92X_CS4231=m +CONFIG_SND_OPTI93X=m +CONFIG_SND_MIRO=m +CONFIG_SND_SB8=m +CONFIG_SND_SB16=m +CONFIG_SND_SBAWE=m +CONFIG_SND_SB16_CSP=y +CONFIG_SND_SB16_CSP_FIRMWARE_IN_KERNEL=y +CONFIG_SND_SGALAXY=m +CONFIG_SND_SSCAPE=m +CONFIG_SND_WAVEFRONT=m +CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL=y + +# +# PCI devices +# +CONFIG_SND_AD1889=m +CONFIG_SND_ALS300=m +CONFIG_SND_ALS4000=m +CONFIG_SND_ALI5451=m +CONFIG_SND_ATIIXP=m +CONFIG_SND_ATIIXP_MODEM=m +CONFIG_SND_AU8810=m +CONFIG_SND_AU8820=m +CONFIG_SND_AU8830=m +CONFIG_SND_AZT3328=m +CONFIG_SND_BT87X=m +CONFIG_SND_BT87X_OVERCLOCK=y +CONFIG_SND_CA0106=m +CONFIG_SND_CMIPCI=m +CONFIG_SND_CS4281=m +CONFIG_SND_CS46XX=m +CONFIG_SND_CS46XX_NEW_DSP=y +CONFIG_SND_CS5530=m +CONFIG_SND_CS5535AUDIO=m +CONFIG_SND_DARLA20=m +CONFIG_SND_GINA20=m +CONFIG_SND_LAYLA20=m +CONFIG_SND_DARLA24=m +CONFIG_SND_GINA24=m +CONFIG_SND_LAYLA24=m +CONFIG_SND_MONA=m +CONFIG_SND_MIA=m +CONFIG_SND_ECHO3G=m +CONFIG_SND_INDIGO=m +CONFIG_SND_INDIGOIO=m +CONFIG_SND_INDIGODJ=m +CONFIG_SND_EMU10K1=m +CONFIG_SND_EMU10K1X=m +CONFIG_SND_ENS1370=m +CONFIG_SND_ENS1371=m +CONFIG_SND_ES1938=m +CONFIG_SND_ES1968=m +CONFIG_SND_FM801=m +CONFIG_SND_FM801_TEA575X_BOOL=y +CONFIG_SND_FM801_TEA575X=m +CONFIG_SND_HDA_INTEL=m +CONFIG_SND_HDA_HWDEP=y +CONFIG_SND_HDA_CODEC_REALTEK=y +CONFIG_SND_HDA_CODEC_ANALOG=y +CONFIG_SND_HDA_CODEC_SIGMATEL=y +CONFIG_SND_HDA_CODEC_VIA=y +CONFIG_SND_HDA_CODEC_ATIHDMI=y +CONFIG_SND_HDA_CODEC_CONEXANT=y +CONFIG_SND_HDA_CODEC_CMEDIA=y +CONFIG_SND_HDA_CODEC_SI3054=y +CONFIG_SND_HDA_GENERIC=y +CONFIG_SND_HDA_POWER_SAVE=y +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDSP=m +CONFIG_SND_HDSPM=m +CONFIG_SND_ICE1712=m +CONFIG_SND_ICE1724=m +CONFIG_SND_INTEL8X0=m +CONFIG_SND_INTEL8X0M=m +CONFIG_SND_KORG1212=m +CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MAESTRO3=m +CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MIXART=m +CONFIG_SND_NM256=m +CONFIG_SND_PCXHR=m +CONFIG_SND_RIPTIDE=m +CONFIG_SND_RME32=m +CONFIG_SND_RME96=m +CONFIG_SND_RME9652=m +CONFIG_SND_SONICVIBES=m +CONFIG_SND_TRIDENT=m +CONFIG_SND_VIA82XX=m +CONFIG_SND_VIA82XX_MODEM=m +CONFIG_SND_VX222=m +CONFIG_SND_YMFPCI=m +CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y +CONFIG_SND_AC97_POWER_SAVE=y +CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0 + +# +# SPI devices +# + +# +# USB devices +# +CONFIG_SND_USB_AUDIO=m +CONFIG_SND_USB_USX2Y=m +CONFIG_SND_USB_CAIAQ=m +CONFIG_SND_USB_CAIAQ_INPUT=y + +# +# PCMCIA devices +# +CONFIG_SND_VXPOCKET=m +CONFIG_SND_PDAUDIOCF=m + +# +# System on Chip audio support +# +CONFIG_SND_SOC=m + +# +# SoC Audio support for SuperH +# + +# +# Open Sound System +# +CONFIG_SOUND_PRIME=m +CONFIG_SOUND_TRIDENT=m +CONFIG_SOUND_MSNDCLAS=m +CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin" +CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin" +CONFIG_SOUND_MSNDPIN=m +CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin" +CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin" +CONFIG_SOUND_OSS=m +# CONFIG_SOUND_TRACEINIT is not set +CONFIG_SOUND_DMAP=y +CONFIG_SOUND_SSCAPE=m +CONFIG_SOUND_VMIDI=m +CONFIG_SOUND_TRIX=m +CONFIG_SOUND_MSS=m +CONFIG_SOUND_MPU401=m +CONFIG_SOUND_PAS=m +CONFIG_SOUND_PSS=m +CONFIG_PSS_MIXER=y +CONFIG_SOUND_SB=m +CONFIG_SOUND_YM3812=m +CONFIG_SOUND_UART6850=m +CONFIG_SOUND_AEDSP16=m +CONFIG_SC6600=y +CONFIG_SC6600_JOY=y +CONFIG_SC6600_CDROM=4 +CONFIG_SC6600_CDROMBASE=0 +CONFIG_AEDSP16_MSS=y +# CONFIG_AEDSP16_SBPRO is not set +CONFIG_SOUND_KAHLUA=m +CONFIG_AC97_BUS=m +CONFIG_HID_SUPPORT=y +CONFIG_HID=m +# CONFIG_HID_DEBUG is not set +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=m +CONFIG_USB_HIDINPUT_POWERBOOK=y +# CONFIG_HID_FF is not set +CONFIG_USB_HIDDEV=y + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m +CONFIG_USB_SUPPORT=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB=m +# CONFIG_USB_DEBUG is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_SUSPEND=y +# CONFIG_USB_PERSIST is not set +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_ISP116X_HCD=m +CONFIG_USB_OHCI_HCD=m +CONFIG_USB_OHCI_HCD_SSB=y +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +CONFIG_USB_UHCI_HCD=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SL811_CS=m +CONFIG_USB_R8A66597_HCD=m + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# +# may also be needed; see USB_STORAGE Help for more information +# +CONFIG_USB_STORAGE=m +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_LIBUSUAL=y + +# +# USB Imaging devices +# +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +CONFIG_USB_MON=y + +# +# USB port drivers +# +CONFIG_USB_USS720=m + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_EZUSB=y + +# +# USB Miscellaneous drivers +# +CONFIG_USB_EMI62=m +CONFIG_USB_EMI26=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_AUERSWALD=m +CONFIG_USB_RIO500=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LCD=m +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_LED=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_FTDI_ELAN=m +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_LD=m +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_IOWARRIOR=m +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# +CONFIG_USB_ATM=m +CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_CXACRU=m +CONFIG_USB_UEAGLEATM=m +CONFIG_USB_XUSBATM=m + +# +# USB Gadget Support +# +CONFIG_USB_GADGET=m +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_SELECTED=y +# CONFIG_USB_GADGET_AMD5536UDC is not set +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +CONFIG_USB_GADGET_NET2280=y +CONFIG_USB_NET2280=m +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_M66592 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_S3C2410 is not set +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_DUMMY_HCD is not set +CONFIG_USB_GADGET_DUALSPEED=y +CONFIG_USB_ZERO=m +CONFIG_USB_ETH=m +CONFIG_USB_ETH_RNDIS=y +CONFIG_USB_GADGETFS=m +CONFIG_USB_FILE_STORAGE=m +# CONFIG_USB_FILE_STORAGE_TEST is not set +CONFIG_USB_G_SERIAL=m +# CONFIG_USB_MIDI_GADGET is not set + +# +# MMC/SD/SDIO support, can only select one arch from MMC and MSS +# +CONFIG_MMC=m +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_UNSAFE_RESUME is not set + +# +# MMC/SD Card Drivers +# +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +CONFIG_SDIO_UART=m + +# +# MMC/SD Host Controller Drivers +# +CONFIG_MMC_SDHCI=m +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_WBSD=m +CONFIG_MMC_TIFM_SD=m +# CONFIG_MSS is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=m + +# +# LED drivers +# +CONFIG_LEDS_NET48XX=m +CONFIG_LEDS_WRAP=m + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_MLX4_INFINIBAND=m +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_ISER=m +CONFIG_EDAC=y + +# +# Reporting subsystems +# +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_MM_EDAC=m +# CONFIG_EDAC_AMD76X is not set +CONFIG_EDAC_E7XXX=m +CONFIG_EDAC_E752X=m +CONFIG_EDAC_I82875P=m +CONFIG_EDAC_I82975X=m +CONFIG_EDAC_I3000=m +CONFIG_EDAC_I82860=m +CONFIG_EDAC_R82600=m +CONFIG_EDAC_I5000=m +CONFIG_RTC_LIB=m +CONFIG_RTC_CLASS=m + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_DRV_TEST=m + +# +# I2C RTC drivers +# +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y + +# +# SPI RTC drivers +# +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_MAX6902=m + +# +# Platform RTC drivers +# +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_V3020=m + +# +# on-CPU RTC drivers +# +CONFIG_DMADEVICES=y + +# +# DMA Devices +# +CONFIG_INTEL_IOATDMA=m +CONFIG_DMA_ENGINE=y + +# +# DMA Clients +# +CONFIG_NET_DMA=y +CONFIG_DCA=m +CONFIG_AUXDISPLAY=y +CONFIG_KS0108=m +CONFIG_KS0108_PORT=0x378 +CONFIG_KS0108_DELAY=2 +CONFIG_CFAG12864B=m +CONFIG_CFAG12864B_RATE=20 + +# +# Userspace I/O +# +CONFIG_UIO=m +CONFIG_UIO_CIF=m + +# +# Firmware Drivers +# +CONFIG_EDD=y +# CONFIG_EDD_OFF is not set +CONFIG_EFI_VARS=y +CONFIG_DELL_RBU=m +CONFIG_DCDBAS=m +CONFIG_DMIID=y + +# +# File systems +# +CONFIG_EXT2_FS=m +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +CONFIG_EXT3_FS_XATTR=y +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=m +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +# CONFIG_JFS_DEBUG is not set +CONFIG_JFS_STATISTICS=y +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_RT=y +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_OCFS2_FS=m +CONFIG_OCFS2_DEBUG_MASKLOG=y +# CONFIG_OCFS2_DEBUG_FS is not set +CONFIG_MINIX_FS=m +CONFIG_ROMFS_FS=m +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_QUOTA=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_QUOTA_COMPAT=y +CONFIG_QFMT_V1=m +CONFIG_QFMT_V2=m +CONFIG_SIM_FS=m +CONFIG_VZ_QUOTA=m +# CONFIG_VZ_QUOTA_UNLOAD is not set +CONFIG_VZ_QUOTA_UGID=y +CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m +CONFIG_GENERIC_ACL=y + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_VMCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_CONFIGFS_FS=m + +# +# Miscellaneous filesystems +# +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_AFFS_FS=m +CONFIG_ECRYPT_FS=m +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +CONFIG_BEFS_FS=m +# CONFIG_BEFS_DEBUG is not set +CONFIG_BFS_FS=m +CONFIG_EFS_FS=m +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +CONFIG_CRAMFS=y +CONFIG_VXFS_FS=m +CONFIG_HPFS_FS=m +CONFIG_QNX4FS_FS=m +CONFIG_SYSV_FS=m +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_UFS_DEBUG is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFSD=m +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=m +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=m +CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_XPRT_RDMA=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_EXPERIMENTAL is not set +CONFIG_NCP_FS=m +CONFIG_NCPFS_PACKET_SIGNING=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_STRONG=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_OS2_NS=y +# CONFIG_NCPFS_SMALLDOS is not set +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_EXTRAS=y +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set +CONFIG_AFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_9P_FS=m +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +CONFIG_ACORN_PARTITION=y +# CONFIG_ACORN_PARTITION_CUMANA is not set +# CONFIG_ACORN_PARTITION_EESOX is not set +CONFIG_ACORN_PARTITION_ICS=y +# CONFIG_ACORN_PARTITION_ADFS is not set +# CONFIG_ACORN_PARTITION_POWERTEC is not set +CONFIG_ACORN_PARTITION_RISCIX=y +CONFIG_OSF_PARTITION=y +CONFIG_AMIGA_PARTITION=y +CONFIG_ATARI_PARTITION=y +CONFIG_MAC_PARTITION=y +CONFIG_MSDOS_PARTITION=y +CONFIG_BSD_DISKLABEL=y +CONFIG_MINIX_SUBPARTITION=y +CONFIG_SOLARIS_X86_PARTITION=y +CONFIG_UNIXWARE_DISKLABEL=y +CONFIG_LDM_PARTITION=y +# CONFIG_LDM_DEBUG is not set +CONFIG_SGI_PARTITION=y +CONFIG_ULTRIX_PARTITION=y +CONFIG_SUN_PARTITION=y +CONFIG_KARMA_PARTITION=y +CONFIG_EFI_PARTITION=y +CONFIG_SYSV68_PARTITION=y +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +CONFIG_INSTRUMENTATION=y +CONFIG_PROFILING=y +CONFIG_OPROFILE=m +CONFIG_KPROBES=y +# CONFIG_MARKERS is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_UNUSED_SYMBOLS=y +CONFIG_DEBUG_FS=y +# CONFIG_HEADERS_CHECK is not set +CONFIG_SYSRQ_DEBUG=y +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_SCHED_DEBUG=y +# CONFIG_SCHEDSTATS is not set +CONFIG_TIMER_STATS=y +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_HIGHMEM is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_FORCED_INLINING is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_LKDTM is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SAMPLES is not set +CONFIG_NONPROMISC_DEVMEM=y +CONFIG_EARLY_PRINTK=y +# CONFIG_WRAPPER_PRINT is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set + +# +# Page alloc debug is incompatible with Software Suspend on i386 +# +# CONFIG_DEBUG_RODATA is not set +# CONFIG_4KSTACKS is not set +CONFIG_X86_FIND_SMP_CONFIG=y +CONFIG_X86_MPPARSE=y +CONFIG_DOUBLEFAULT=y +CONFIG_IO_DELAY_TYPE_0X80=0 +CONFIG_IO_DELAY_TYPE_0XED=1 +CONFIG_IO_DELAY_TYPE_UDELAY=2 +CONFIG_IO_DELAY_TYPE_NONE=3 +CONFIG_IO_DELAY_0X80=y +# CONFIG_IO_DELAY_0XED is not set +# CONFIG_IO_DELAY_UDELAY is not set +# CONFIG_IO_DELAY_NONE is not set +CONFIG_DEFAULT_IO_DELAY_TYPE=0 + +# +# Security options +# + +# +# Grsecurity +# +CONFIG_GRKERNSEC=y + +# +# Executable Protections +# +CONFIG_GRKERNSEC_TPE=y +CONFIG_GRKERNSEC_TPE_ALL=y +# CONFIG_GRKERNSEC_TPE_INVERT is not set +CONFIG_GRKERNSEC_TPE_GID=1005 + +# +# Sysctl support +# +CONFIG_GRKERNSEC_SYSCTL=y +# CONFIG_GRKERNSEC_SYSCTL_ON is not set + +# +# Logging Options +# +CONFIG_GRKERNSEC_FLOODTIME=10 +CONFIG_GRKERNSEC_FLOODBURST=4 +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_XOR_BLOCKS=m +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_XTS=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_TWOFISH_586=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_AES_586=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_DEV_PADLOCK=y +CONFIG_CRYPTO_DEV_PADLOCK_AES=m +CONFIG_CRYPTO_DEV_PADLOCK_SHA=m +CONFIG_CRYPTO_DEV_GEODE=m +CONFIG_HAVE_KVM=y +CONFIG_VIRTUALIZATION=y +CONFIG_KVM=m +CONFIG_KVM_INTEL=m +CONFIG_KVM_AMD=m +CONFIG_VIRTIO=m +CONFIG_VIRTIO_RING=m +CONFIG_VIRTIO_PCI=m +CONFIG_VIRTIO_BALLOON=m + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +CONFIG_CRC16=m +CONFIG_CRC_ITU_T=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_LIBCRC32C=m +CONFIG_AUDIT_GENERIC=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_PLIST=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CHECK_SIGNATURE=y + +# +# User resources +# +CONFIG_BEANCOUNTERS=y +CONFIG_BC_RSS_ACCOUNTING=y +CONFIG_BC_IO_ACCOUNTING=y +CONFIG_BC_IO_SCHED=y +CONFIG_BC_SWAP_ACCOUNTING=y +CONFIG_BC_PROC=y +# CONFIG_BC_DEBUG is not set +CONFIG_DRM_VIA_CHROME9=m --- linux-2.6.24.orig/debian/binary-custom.d/openvz/patchset/000.patch +++ linux-2.6.24/debian/binary-custom.d/openvz/patchset/000.patch @@ -0,0 +1,94913 @@ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./COPYING.SWsoft debian/binary-custom.d/openvz/src/COPYING.SWsoft +--- ./COPYING.SWsoft 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/COPYING.SWsoft 2012-11-13 15:20:09.876569260 +0000 +@@ -0,0 +1,350 @@ ++ ++Nothing in this license should be construed as a grant by SWsoft of any rights ++beyond the rights specified in the GNU General Public License, and nothing in ++this license should be construed as a waiver by SWsoft of its patent, copyright ++and/or trademark rights, beyond the waiver required by the GNU General Public ++License. This license is expressly inapplicable to any product that is not ++within the scope of the GNU General Public License ++ ++---------------------------------------- ++ ++ GNU GENERAL PUBLIC LICENSE ++ Version 2, June 1991 ++ ++ Copyright (C) 1989, 1991 Free Software Foundation, Inc. ++ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++License is intended to guarantee your freedom to share and change free ++software--to make sure the software is free for all its users. This ++General Public License applies to most of the Free Software ++Foundation's software and to any other program whose authors commit to ++using it. (Some other Free Software Foundation software is covered by ++the GNU Library General Public License instead.) You can apply it to ++your programs, too. ++ ++ When we speak of free software, we are referring to freedom, not ++price. Our General Public Licenses are designed to make sure that you ++have the freedom to distribute copies of free software (and charge for ++this service if you wish), that you receive source code or can get it ++if you want it, that you can change the software or use pieces of it ++in new free programs; and that you know you can do these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++anyone to deny you these rights or to ask you to surrender the rights. ++These restrictions translate to certain responsibilities for you if you ++distribute copies of the software, or if you modify it. ++ ++ For example, if you distribute copies of such a program, whether ++gratis or for a fee, you must give the recipients all the rights that ++you have. You must make sure that they, too, receive or can get the ++source code. And you must show them these terms so they know their ++rights. ++ ++ We protect your rights with two steps: (1) copyright the software, and ++(2) offer you this license which gives you legal permission to copy, ++distribute and/or modify the software. ++ ++ Also, for each author's protection and ours, we want to make certain ++that everyone understands that there is no warranty for this free ++software. If the software is modified by someone else and passed on, we ++want its recipients to know that what they have is not the original, so ++that any problems introduced by others will not reflect on the original ++authors' reputations. ++ ++ Finally, any free program is threatened constantly by software ++patents. We wish to avoid the danger that redistributors of a free ++program will individually obtain patent licenses, in effect making the ++program proprietary. To prevent this, we have made it clear that any ++patent must be licensed for everyone's free use or not licensed at all. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. ++ ++ GNU GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License applies to any program or other work which contains ++a notice placed by the copyright holder saying it may be distributed ++under the terms of this General Public License. The "Program", below, ++refers to any such program or work, and a "work based on the Program" ++means either the Program or any derivative work under copyright law: ++that is to say, a work containing the Program or a portion of it, ++either verbatim or with modifications and/or translated into another ++language. (Hereinafter, translation is included without limitation in ++the term "modification".) Each licensee is addressed as "you". ++ ++Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running the Program is not restricted, and the output from the Program ++is covered only if its contents constitute a work based on the ++Program (independent of having been made by running the Program). ++Whether that is true depends on what the Program does. ++ ++ 1. You may copy and distribute verbatim copies of the Program's ++source code as you receive it, in any medium, provided that you ++conspicuously and appropriately publish on each copy an appropriate ++copyright notice and disclaimer of warranty; keep intact all the ++notices that refer to this License and to the absence of any warranty; ++and give any other recipients of the Program a copy of this License ++along with the Program. ++ ++You may charge a fee for the physical act of transferring a copy, and ++you may at your option offer warranty protection in exchange for a fee. ++ ++ 2. You may modify your copy or copies of the Program or any portion ++of it, thus forming a work based on the Program, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) You must cause the modified files to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ b) You must cause any work that you distribute or publish, that in ++ whole or in part contains or is derived from the Program or any ++ part thereof, to be licensed as a whole at no charge to all third ++ parties under the terms of this License. ++ ++ c) If the modified program normally reads commands interactively ++ when run, you must cause it, when started running for such ++ interactive use in the most ordinary way, to print or display an ++ announcement including an appropriate copyright notice and a ++ notice that there is no warranty (or else, saying that you provide ++ a warranty) and that users may redistribute the program under ++ these conditions, and telling the user how to view a copy of this ++ License. (Exception: if the Program itself is interactive but ++ does not normally print such an announcement, your work based on ++ the Program is not required to print an announcement.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Program, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Program, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Program. ++ ++In addition, mere aggregation of another work not based on the Program ++with the Program (or with a work based on the Program) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may copy and distribute the Program (or a work based on it, ++under Section 2) in object code or executable form under the terms of ++Sections 1 and 2 above provided that you also do one of the following: ++ ++ a) Accompany it with the complete corresponding machine-readable ++ source code, which must be distributed under the terms of Sections ++ 1 and 2 above on a medium customarily used for software interchange; or, ++ ++ b) Accompany it with a written offer, valid for at least three ++ years, to give any third party, for a charge no more than your ++ cost of physically performing source distribution, a complete ++ machine-readable copy of the corresponding source code, to be ++ distributed under the terms of Sections 1 and 2 above on a medium ++ customarily used for software interchange; or, ++ ++ c) Accompany it with the information you received as to the offer ++ to distribute corresponding source code. (This alternative is ++ allowed only for noncommercial distribution and only if you ++ received the program in object code or executable form with such ++ an offer, in accord with Subsection b above.) ++ ++The source code for a work means the preferred form of the work for ++making modifications to it. For an executable work, complete source ++code means all the source code for all modules it contains, plus any ++associated interface definition files, plus the scripts used to ++control compilation and installation of the executable. However, as a ++special exception, the source code distributed need not include ++anything that is normally distributed (in either source or binary ++form) with the major components (compiler, kernel, and so on) of the ++operating system on which the executable runs, unless that component ++itself accompanies the executable. ++ ++If distribution of executable or object code is made by offering ++access to copy from a designated place, then offering equivalent ++access to copy the source code from the same place counts as ++distribution of the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 4. You may not copy, modify, sublicense, or distribute the Program ++except as expressly provided under this License. Any attempt ++otherwise to copy, modify, sublicense or distribute the Program is ++void, and will automatically terminate your rights under this License. ++However, parties who have received copies, or rights, from you under ++this License will not have their licenses terminated so long as such ++parties remain in full compliance. ++ ++ 5. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Program or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Program (or any work based on the ++Program), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Program or works based on it. ++ ++ 6. Each time you redistribute the Program (or any work based on the ++Program), the recipient automatically receives a license from the ++original licensor to copy, distribute or modify the Program subject to ++these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties to ++this License. ++ ++ 7. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Program at all. For example, if a patent ++license would not permit royalty-free redistribution of the Program by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Program. ++ ++If any portion of this section is held invalid or unenforceable under ++any particular circumstance, the balance of the section is intended to ++apply and the section as a whole is intended to apply in other ++circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system, which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 8. If the distribution and/or use of the Program is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Program under this License ++may add an explicit geographical distribution limitation excluding ++those countries, so that distribution is permitted only in or among ++countries not thus excluded. In such case, this License incorporates ++the limitation as if written in the body of this License. ++ ++ 9. The Free Software Foundation may publish revised and/or new versions ++of the General Public License from time to time. Such new versions will ++be similar in spirit to the present version, but may differ in detail to ++address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Program ++specifies a version number of this License which applies to it and "any ++later version", you have the option of following the terms and conditions ++either of that version or of any later version published by the Free ++Software Foundation. If the Program does not specify a version number of ++this License, you may choose any version ever published by the Free Software ++Foundation. ++ ++ 10. If you wish to incorporate parts of the Program into other free ++programs whose distribution conditions are different, write to the author ++to ask for permission. For software which is copyrighted by the Free ++Software Foundation, write to the Free Software Foundation; we sometimes ++make exceptions for this. Our decision will be guided by the two goals ++of preserving the free status of all derivatives of our free software and ++of promoting the sharing and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY ++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN ++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES ++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED ++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS ++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE ++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, ++REPAIR OR CORRECTION. ++ ++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING ++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR ++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, ++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING ++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED ++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY ++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER ++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE ++POSSIBILITY OF SUCH DAMAGES. ++ ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Programs ++ ++ If you develop a new program, and you want it to be of the greatest ++possible use to the public, the best way to achieve this is to make it ++free software which everyone can redistribute and change under these terms. ++ ++ To do so, attach the following notices to the program. It is safest ++to attach them to the start of each source file to most effectively ++convey the exclusion of warranty; and each file should have at least ++the "copyright" line and a pointer to where the full notice is found. ++ ++ ++ Copyright (C) ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ ++ ++Also add information on how to contact you by electronic and paper mail. ++ ++If the program is interactive, make it output a short notice like this ++when it starts in an interactive mode: ++ ++ Gnomovision version 69, Copyright (C) year name of author ++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. ++ This is free software, and you are welcome to redistribute it ++ under certain conditions; type `show c' for details. ++ ++The hypothetical commands `show w' and `show c' should show the appropriate ++parts of the General Public License. Of course, the commands you use may ++be called something other than `show w' and `show c'; they could even be ++mouse-clicks or menu items--whatever suits your program. ++ ++You should also get your employer (if you work as a programmer) or your ++school, if any, to sign a "copyright disclaimer" for the program, if ++necessary. Here is a sample; alter the names: ++ ++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program ++ `Gnomovision' (which makes passes at compilers) written by James Hacker. ++ ++ , 1 April 1989 ++ Ty Coon, President of Vice ++ ++This General Public License does not permit incorporating your program into ++proprietary programs. If your program is a subroutine library, you may ++consider it more useful to permit linking proprietary applications with the ++library. If this is what you want to do, use the GNU Library General ++Public License instead of this License. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./Makefile debian/binary-custom.d/openvz/src/Makefile +--- ./Makefile 2012-06-12 16:25:10.610312967 +0100 ++++ debian/binary-custom.d/openvz/src/Makefile 2012-11-13 15:20:10.072569254 +0000 +@@ -3,6 +3,7 @@ + SUBLEVEL = 24 + EXTRAVERSION = .6 + NAME = Err Metey! A Heury Beelge-a Ret! ++VZVERSION = ovz005 + + # *DOCUMENTATION* + # To see a list of typical targets execute "make help" +@@ -356,7 +357,7 @@ + KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) + KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) + +-export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION ++export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION VZVERSION + export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC + export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE + export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS +@@ -614,7 +615,7 @@ + + + ifeq ($(KBUILD_EXTMOD),) +-core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ ++core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ grsecurity/ + + vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ + $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ +@@ -974,7 +975,8 @@ + echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ + exit 1; \ + fi; \ +- (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";) ++ (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \ ++ echo \#define VZVERSION \"$(VZVERSION)\";) + endef + + define filechk_version.h +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/arm/kernel/smp.c debian/binary-custom.d/openvz/src/arch/arm/kernel/smp.c +--- ./arch/arm/kernel/smp.c 2012-06-12 16:25:10.686312965 +0100 ++++ debian/binary-custom.d/openvz/src/arch/arm/kernel/smp.c 2012-11-13 15:20:10.140569251 +0000 +@@ -201,7 +201,7 @@ + local_flush_tlb_all(); + + read_lock(&tasklist_lock); +- for_each_process(p) { ++ for_each_process_all(p) { + if (p->mm) + cpu_clear(cpu, p->mm->cpu_vm_mask); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/Kconfig debian/binary-custom.d/openvz/src/arch/ia64/Kconfig +--- ./arch/ia64/Kconfig 2012-06-12 16:25:10.878312958 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/Kconfig 2012-11-13 15:20:10.332569245 +0000 +@@ -570,6 +570,7 @@ + + source "lib/Kconfig" + ++source "kernel/bc/Kconfig" + # + # Use the generic interrupt handling code in kernel/irq/: + # +@@ -596,6 +597,8 @@ + + source "arch/ia64/Kconfig.debug" + ++source "kernel/Kconfig.openvz" ++ + source "security/Kconfig" + + source "crypto/Kconfig" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/ia32/binfmt_elf32.c debian/binary-custom.d/openvz/src/arch/ia64/ia32/binfmt_elf32.c +--- ./arch/ia64/ia32/binfmt_elf32.c 2012-06-12 16:25:10.890312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/ia32/binfmt_elf32.c 2012-11-13 15:20:10.344569241 +0000 +@@ -17,6 +17,8 @@ + #include + #include + ++#include ++ + #include "ia32priv.h" + #include "elfcore32.h" + +@@ -132,6 +134,12 @@ + up_write(¤t->mm->mmap_sem); + } + ++ if (ub_memory_charge(current->mm, PAGE_ALIGN(IA32_LDT_ENTRIES * ++ IA32_LDT_ENTRY_SIZE), ++ VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE, ++ NULL, UB_SOFT)) ++ goto skip; ++ + /* + * Install LDT as anonymous memory. This gives us all-zero segment descriptors + * until a task modifies them via modify_ldt(). +@@ -152,7 +160,12 @@ + } + } + up_write(¤t->mm->mmap_sem); +- } ++ } else ++ ub_memory_uncharge(current->mm, PAGE_ALIGN(IA32_LDT_ENTRIES * ++ IA32_LDT_ENTRY_SIZE), ++ VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE, NULL); ++ ++skip: + + ia64_psr(regs)->ac = 0; /* turn off alignment checking */ + regs->loadrs = 0; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/asm-offsets.c debian/binary-custom.d/openvz/src/arch/ia64/kernel/asm-offsets.c +--- ./arch/ia64/kernel/asm-offsets.c 2012-06-12 16:25:10.890312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/asm-offsets.c 2012-11-13 15:20:10.348569242 +0000 +@@ -46,11 +46,9 @@ + DEFINE(IA64_TASK_CLEAR_CHILD_TID_OFFSET,offsetof (struct task_struct, clear_child_tid)); + DEFINE(IA64_TASK_GROUP_LEADER_OFFSET, offsetof (struct task_struct, group_leader)); + DEFINE(IA64_TASK_PENDING_OFFSET,offsetof (struct task_struct, pending)); +- DEFINE(IA64_TASK_PID_OFFSET, offsetof (struct task_struct, pid)); + DEFINE(IA64_TASK_REAL_PARENT_OFFSET, offsetof (struct task_struct, real_parent)); + DEFINE(IA64_TASK_SIGHAND_OFFSET,offsetof (struct task_struct, sighand)); + DEFINE(IA64_TASK_SIGNAL_OFFSET,offsetof (struct task_struct, signal)); +- DEFINE(IA64_TASK_TGID_OFFSET, offsetof (struct task_struct, tgid)); + DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct task_struct, thread.ksp)); + DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct task_struct, thread.on_ustack)); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/entry.S debian/binary-custom.d/openvz/src/arch/ia64/kernel/entry.S +--- ./arch/ia64/kernel/entry.S 2012-06-12 16:25:10.894312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/entry.S 2012-11-13 15:20:10.352569244 +0000 +@@ -504,6 +504,74 @@ + br.ret.sptk.many rp + END(clone) + ++GLOBAL_ENTRY(ia64_ret_from_resume) ++ PT_REGS_UNWIND_INFO(0) ++{ /* ++ * Some versions of gas generate bad unwind info if the first instruction of a ++ * procedure doesn't go into the first slot of a bundle. This is a workaround. ++ */ ++ nop.m 0 ++ nop.i 0 ++ /* ++ * We need to call schedule_tail() to complete the scheduling process. ++ * Called by ia64_switch_to() after do_fork()->copy_thread(). r8 contains the ++ * address of the previously executing task. ++ */ ++ br.call.sptk.many rp=ia64_invoke_schedule_tail ++} ++ br.call.sptk.many rp=ia64_invoke_resume ++ ;; ++ adds sp=256,sp ++ ;; ++ /* Return from interrupt, we are all right. */ ++(pNonSys) br ia64_leave_kernel ++ ;; ++ /* Tricky part follows. We must restore correct syscall ++ * register frame before doing normal syscall exit job. ++ * It would the most natural to keep sw->ar_pfs correct, ++ * then we would be here with correct register frame. ++ * Unfortunately, IA64 has a feature. Registers were in backstore ++ * after context switch, and the first br.ret does _NOT_ fetch ++ * output registers. ++ * It is quite natural: look, if caller has output regs in his ++ * frame, they should be consumed. If callee does not have (enough of) ++ * input/local registers (1 in this case), the situation is unusual. ++ * Practical evidence: they are filled with something random crap. ++ * The only case, when this is essential in mainstream kernel ++ * is sys_clone(). The result is that new process gets some kernel ++ * information in its register frame. Which is a security problem, btw. ++ * ++ * So, we set sw->ar_pfs to pretend the whole frame is of local ++ * regs. And we have to repartition the frame it manually, using ++ * information from pt->cr_ifs (the register is invalid in this ++ * case, but it holds correct pfm). ++ */ ++ adds r3=PT(CR_IFS)+16,sp ++ ;; ++ ld8 r2=[r3],-(PT(CR_IFS)-PT(R8)) ++ ;; ++ extr.u r2=r2,0,37 ++ mov r8=ar.ec ++ ;; ++ extr.u r8=r8,0,5 ++ ;; ++ shl r8=r8,52 ++ ;; ++ or r2=r2,r8 ++ ;; ++ mov ar.pfs=r2 ++ ;; ++ movl r2=ia64_leave_syscall ++ ;; ++ mov rp=r2 ++ /* Plus, we should fetch r8 and r10 from pt_regs. Something else? */ ++ ld8 r8=[r3],PT(R10)-PT(R8) ++ ;; ++ ld8 r10=[r3] ++ ;; ++ br.ret.sptk.many rp ++END(ia64_ret_from_resume) ++ + /* + * Invoke a system call, but do some tracing before and after the call. + * We MUST preserve the current register frame throughout this routine +@@ -1167,6 +1235,34 @@ + br.ret.sptk.many rp + END(ia64_invoke_schedule_tail) + ++GLOBAL_ENTRY(ia64_invoke_resume) ++ alloc loc1=ar.pfs,0,3,1,0 ++ mov loc0=rp ++ adds out0=16,sp ++ ;; ++ ld8 r8=[out0] ++ ;; ++ cmp.eq p6,p0=r8,r0 ++ ;; ++(p6) br.cond.sptk 1f ++ ;; ++ mov loc2=gp ++ ;; ++ ld8 r10=[r8],8 ++ ;; ++ ld8 gp=[r8] ++ ;; ++ mov b7=r10 ++ ;; ++ br.call.sptk.many rp=b7 ++ ;; ++ mov gp=loc2 ++1: ++ mov ar.pfs=loc1 ++ mov rp=loc0 ++ br.ret.sptk.many rp ++END(ia64_invoke_resume) ++ + /* + * Setup stack and call do_notify_resume_user(). Note that pSys and pNonSys need to + * be set up by the caller. We declare 8 input registers so the system call +@@ -1588,5 +1684,20 @@ + data8 sys_signalfd + data8 sys_timerfd + data8 sys_eventfd ++.rept 1499-1310 ++ data8 sys_ni_syscall ++.endr ++ data8 sys_fairsched_vcpus ++ data8 sys_fairsched_mknod // 1500 ++ data8 sys_fairsched_rmnod ++ data8 sys_fairsched_chwt ++ data8 sys_fairsched_mvpr ++ data8 sys_fairsched_rate ++ data8 sys_getluid // 1505 ++ data8 sys_setluid ++ data8 sys_setublimit ++ data8 sys_ubstat ++ data8 sys_lchmod ++ data8 sys_lutime // 1510 + + .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/fsys.S debian/binary-custom.d/openvz/src/arch/ia64/kernel/fsys.S +--- ./arch/ia64/kernel/fsys.S 2012-06-12 16:25:10.894312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/fsys.S 2012-11-13 15:20:10.352569244 +0000 +@@ -57,96 +57,6 @@ + FSYS_RETURN + END(fsys_ni_syscall) + +-ENTRY(fsys_getpid) +- .prologue +- .altrp b6 +- .body +- add r9=TI_FLAGS+IA64_TASK_SIZE,r16 +- ;; +- ld4 r9=[r9] +- add r8=IA64_TASK_TGID_OFFSET,r16 +- ;; +- and r9=TIF_ALLWORK_MASK,r9 +- ld4 r8=[r8] // r8 = current->tgid +- ;; +- cmp.ne p8,p0=0,r9 +-(p8) br.spnt.many fsys_fallback_syscall +- FSYS_RETURN +-END(fsys_getpid) +- +-ENTRY(fsys_getppid) +- .prologue +- .altrp b6 +- .body +- add r17=IA64_TASK_GROUP_LEADER_OFFSET,r16 +- ;; +- ld8 r17=[r17] // r17 = current->group_leader +- add r9=TI_FLAGS+IA64_TASK_SIZE,r16 +- ;; +- +- ld4 r9=[r9] +- add r17=IA64_TASK_REAL_PARENT_OFFSET,r17 // r17 = ¤t->group_leader->real_parent +- ;; +- and r9=TIF_ALLWORK_MASK,r9 +- +-1: ld8 r18=[r17] // r18 = current->group_leader->real_parent +- ;; +- cmp.ne p8,p0=0,r9 +- add r8=IA64_TASK_TGID_OFFSET,r18 // r8 = ¤t->group_leader->real_parent->tgid +- ;; +- +- /* +- * The .acq is needed to ensure that the read of tgid has returned its data before +- * we re-check "real_parent". +- */ +- ld4.acq r8=[r8] // r8 = current->group_leader->real_parent->tgid +-#ifdef CONFIG_SMP +- /* +- * Re-read current->group_leader->real_parent. +- */ +- ld8 r19=[r17] // r19 = current->group_leader->real_parent +-(p8) br.spnt.many fsys_fallback_syscall +- ;; +- cmp.ne p6,p0=r18,r19 // did real_parent change? +- mov r19=0 // i must not leak kernel bits... +-(p6) br.cond.spnt.few 1b // yes -> redo the read of tgid and the check +- ;; +- mov r17=0 // i must not leak kernel bits... +- mov r18=0 // i must not leak kernel bits... +-#else +- mov r17=0 // i must not leak kernel bits... +- mov r18=0 // i must not leak kernel bits... +- mov r19=0 // i must not leak kernel bits... +-#endif +- FSYS_RETURN +-END(fsys_getppid) +- +-ENTRY(fsys_set_tid_address) +- .prologue +- .altrp b6 +- .body +- add r9=TI_FLAGS+IA64_TASK_SIZE,r16 +- ;; +- ld4 r9=[r9] +- tnat.z p6,p7=r32 // check argument register for being NaT +- ;; +- and r9=TIF_ALLWORK_MASK,r9 +- add r8=IA64_TASK_PID_OFFSET,r16 +- add r18=IA64_TASK_CLEAR_CHILD_TID_OFFSET,r16 +- ;; +- ld4 r8=[r8] +- cmp.ne p8,p0=0,r9 +- mov r17=-1 +- ;; +-(p6) st8 [r18]=r32 +-(p7) st8 [r18]=r17 +-(p8) br.spnt.many fsys_fallback_syscall +- ;; +- mov r17=0 // i must not leak kernel bits... +- mov r18=0 // i must not leak kernel bits... +- FSYS_RETURN +-END(fsys_set_tid_address) +- + #if IA64_GTOD_LOCK_OFFSET !=0 + #error fsys_gettimeofday incompatible with changes to struct fsyscall_gtod_data_t + #endif +@@ -718,8 +628,8 @@ + data8 0 // chmod + data8 0 // chown + data8 0 // lseek // 1040 +- data8 fsys_getpid // getpid +- data8 fsys_getppid // getppid ++ data8 0 // getpid ++ data8 0 // getppid + data8 0 // mount + data8 0 // umount + data8 0 // setuid // 1045 +@@ -910,7 +820,7 @@ + data8 0 // futex // 1230 + data8 0 // sched_setaffinity + data8 0 // sched_getaffinity +- data8 fsys_set_tid_address // set_tid_address ++ data8 0 // set_tid_address + data8 0 // fadvise64_64 + data8 0 // tgkill // 1235 + data8 0 // exit_group +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/head.S debian/binary-custom.d/openvz/src/arch/ia64/kernel/head.S +--- ./arch/ia64/kernel/head.S 2012-06-12 16:25:10.894312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/head.S 2012-11-13 15:20:10.352569244 +0000 +@@ -1011,7 +1011,7 @@ + mov out1 = r11;; + br.call.sptk.many rp = kernel_thread_helper;; + mov out0 = r8 +- br.call.sptk.many rp = sys_exit;; ++ br.call.sptk.many rp = do_exit;; + 1: br.sptk.few 1b // not reached + END(start_kernel_thread) + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/ia64_ksyms.c debian/binary-custom.d/openvz/src/arch/ia64/kernel/ia64_ksyms.c +--- ./arch/ia64/kernel/ia64_ksyms.c 2012-06-12 16:25:10.894312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/ia64_ksyms.c 2012-11-13 15:20:10.352569244 +0000 +@@ -78,6 +78,8 @@ + EXPORT_SYMBOL(xor_ia64_5); + #endif + ++EXPORT_SYMBOL(empty_zero_page); ++ + #include + EXPORT_SYMBOL(ia64_pal_call_phys_stacked); + EXPORT_SYMBOL(ia64_pal_call_phys_static); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/mca.c debian/binary-custom.d/openvz/src/arch/ia64/kernel/mca.c +--- ./arch/ia64/kernel/mca.c 2012-06-12 16:25:10.898312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/mca.c 2012-11-13 15:20:10.356569245 +0000 +@@ -1551,10 +1551,10 @@ + } + printk("\n\n"); + if (read_trylock(&tasklist_lock)) { +- do_each_thread (g, t) { ++ do_each_thread_all (g, t) { + printk("\nBacktrace of pid %d (%s)\n", t->pid, t->comm); + show_stack(t, NULL); +- } while_each_thread (g, t); ++ } while_each_thread_all (g, t); + read_unlock(&tasklist_lock); + } + /* FIXME: This will not restore zapped printk locks. */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/perfmon.c debian/binary-custom.d/openvz/src/arch/ia64/kernel/perfmon.c +--- ./arch/ia64/kernel/perfmon.c 2012-06-12 16:25:10.902312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/perfmon.c 2012-11-13 15:20:10.360569244 +0000 +@@ -4216,12 +4216,12 @@ + + read_lock(&tasklist_lock); + +- do_each_thread (g, t) { ++ do_each_thread_ve (g, t) { + if (t->thread.pfm_context == ctx) { + ret = 0; + break; + } +- } while_each_thread (g, t); ++ } while_each_thread_ve (g, t); + + read_unlock(&tasklist_lock); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/process.c debian/binary-custom.d/openvz/src/arch/ia64/kernel/process.c +--- ./arch/ia64/kernel/process.c 2012-06-12 16:25:10.902312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/process.c 2012-11-13 15:20:10.360569244 +0000 +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -369,6 +370,9 @@ + #endif + } + ++extern char ia64_ret_from_resume; ++EXPORT_SYMBOL(ia64_ret_from_resume); ++ + /* + * Copy the state of an ia-64 thread. + * +@@ -442,7 +446,6 @@ + child_ptregs->r12 = user_stack_base + user_stack_size - 16; + child_ptregs->ar_bspstore = user_stack_base; + child_ptregs->ar_rnat = 0; +- child_ptregs->loadrs = 0; + } + } else { + /* +@@ -684,16 +687,25 @@ + return error; + } + ++extern void start_kernel_thread (void); ++EXPORT_SYMBOL(start_kernel_thread); ++ + pid_t + kernel_thread (int (*fn)(void *), void *arg, unsigned long flags) + { +- extern void start_kernel_thread (void); + unsigned long *helper_fptr = (unsigned long *) &start_kernel_thread; + struct { + struct switch_stack sw; + struct pt_regs pt; + } regs; + ++ /* Don't allow kernel_thread() inside VE */ ++ if (!ve_allow_kthreads && !ve_is_super(get_exec_env())) { ++ printk("kernel_thread call inside container\n"); ++ dump_stack(); ++ return -EPERM; ++ } ++ + memset(®s, 0, sizeof(regs)); + regs.pt.cr_iip = helper_fptr[0]; /* set entry point (IP) */ + regs.pt.r1 = helper_fptr[1]; /* set GP */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/ptrace.c debian/binary-custom.d/openvz/src/arch/ia64/kernel/ptrace.c +--- ./arch/ia64/kernel/ptrace.c 2012-06-12 16:25:10.902312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/ptrace.c 2012-11-13 15:20:10.360569244 +0000 +@@ -7,6 +7,7 @@ + * Derived from the x86 and Alpha versions. + */ + #include ++#include + #include + #include + #include +@@ -100,6 +101,8 @@ + + # undef GET_BITS + } ++EXPORT_SYMBOL(ia64_get_scratch_nat_bits); ++EXPORT_SYMBOL(__ia64_save_fpu); + + /* + * Set the NaT bits for the scratch registers according to NAT and +@@ -456,6 +459,7 @@ + *val = ret; + return 0; + } ++EXPORT_SYMBOL(ia64_peek); + + long + ia64_poke (struct task_struct *child, struct switch_stack *child_stack, +@@ -520,6 +524,7 @@ + *cfmp = cfm; + return (unsigned long) ia64_rse_skip_regs(bspstore, ndirty); + } ++EXPORT_SYMBOL(ia64_get_user_rbs_end); + + /* + * Synchronize (i.e, write) the RSE backing store living in kernel +@@ -757,20 +762,20 @@ + if (write_access) { + nat_bits = *data; + scratch_unat = ia64_put_scratch_nat_bits(pt, nat_bits); +- if (unw_set_ar(info, UNW_AR_UNAT, scratch_unat) < 0) { +- dprintk("ptrace: failed to set ar.unat\n"); +- return -1; +- } ++ if (info->pri_unat_loc) ++ *info->pri_unat_loc = scratch_unat; ++ else ++ info->sw->caller_unat = scratch_unat; + for (regnum = 4; regnum <= 7; ++regnum) { + unw_get_gr(info, regnum, &dummy, &nat); + unw_set_gr(info, regnum, dummy, + (nat_bits >> regnum) & 1); + } + } else { +- if (unw_get_ar(info, UNW_AR_UNAT, &scratch_unat) < 0) { +- dprintk("ptrace: failed to read ar.unat\n"); +- return -1; +- } ++ if (info->pri_unat_loc) ++ scratch_unat = *info->pri_unat_loc; ++ else ++ scratch_unat = info->sw->caller_unat; + nat_bits = ia64_get_scratch_nat_bits(pt, scratch_unat); + for (regnum = 4; regnum <= 7; ++regnum) { + unw_get_gr(info, regnum, &dummy, &nat); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/signal.c debian/binary-custom.d/openvz/src/arch/ia64/kernel/signal.c +--- ./arch/ia64/kernel/signal.c 2012-06-12 16:25:10.906312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/signal.c 2012-11-13 15:20:10.364569243 +0000 +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -446,6 +447,12 @@ + if (!user_mode(&scr->pt)) + return; + ++ if (try_to_freeze() && !signal_pending(current)) { ++ if ((long) scr->pt.r10 != -1) ++ restart = 0; ++ goto no_signal; ++ } ++ + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + oldset = ¤t->saved_sigmask; + else +@@ -501,8 +508,10 @@ + if (IS_IA32_PROCESS(&scr->pt)) { + scr->pt.r8 = scr->pt.r1; + scr->pt.cr_iip -= 2; +- } else ++ } else { + ia64_decrement_ip(&scr->pt); ++ scr->pt.r10 = 0; ++ } + restart = 0; /* don't restart twice if handle_signal() fails... */ + } + } +@@ -523,6 +532,7 @@ + } + + /* Did we come from a system call? */ ++no_signal: + if (restart) { + /* Restart the system call - no handlers present */ + if (errno == ERESTARTNOHAND || errno == ERESTARTSYS || errno == ERESTARTNOINTR +@@ -542,6 +552,7 @@ + ia64_decrement_ip(&scr->pt); + if (errno == ERESTART_RESTARTBLOCK) + scr->pt.r15 = __NR_restart_syscall; ++ scr->pt.r10 = 0; + } + } + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/kernel/unaligned.c debian/binary-custom.d/openvz/src/arch/ia64/kernel/unaligned.c +--- ./arch/ia64/kernel/unaligned.c 2012-06-12 16:25:10.906312957 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/kernel/unaligned.c 2012-11-13 15:20:10.364569243 +0000 +@@ -1289,7 +1289,7 @@ + { + static unsigned long count, last_time; + +- if (jiffies - last_time > 5*HZ) ++ if (jiffies - last_time > 60 * HZ) + count = 0; + if (count < 5) { + last_time = jiffies; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/mm/contig.c debian/binary-custom.d/openvz/src/arch/ia64/mm/contig.c +--- ./arch/ia64/mm/contig.c 2012-06-12 16:25:10.918312956 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/mm/contig.c 2012-11-13 15:20:10.368569241 +0000 +@@ -94,6 +94,7 @@ + quicklist_total_size()); + printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); + } ++EXPORT_SYMBOL(show_mem); + + + /* physical address where the bootmem map is located */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/mm/discontig.c debian/binary-custom.d/openvz/src/arch/ia64/mm/discontig.c +--- ./arch/ia64/mm/discontig.c 2012-06-12 16:25:10.918312956 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/mm/discontig.c 2012-11-13 15:20:10.368569241 +0000 +@@ -49,6 +49,7 @@ + static nodemask_t memory_less_mask __initdata; + + pg_data_t *pgdat_list[MAX_NUMNODES]; ++EXPORT_SYMBOL(pgdat_list); + + /* + * To prevent cache aliasing effects, align per-node structures so that they +@@ -567,6 +568,7 @@ + quicklist_total_size()); + printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); + } ++EXPORT_SYMBOL(show_mem); + + /** + * call_pernode_memory - use SRAT to call callback functions with node info +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/mm/fault.c debian/binary-custom.d/openvz/src/arch/ia64/mm/fault.c +--- ./arch/ia64/mm/fault.c 2012-06-12 16:25:10.918312956 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/mm/fault.c 2012-11-13 15:20:10.368569241 +0000 +@@ -148,7 +148,6 @@ + if ((vma->vm_flags & mask) != mask) + goto bad_area; + +- survive: + /* + * If for any reason at all we couldn't handle the fault, make + * sure we exit gracefully rather than endlessly redo the +@@ -274,13 +273,13 @@ + + out_of_memory: + up_read(&mm->mmap_sem); +- if (is_global_init(current)) { +- yield(); +- down_read(&mm->mmap_sem); +- goto survive; +- } +- printk(KERN_CRIT "VM: killing process %s\n", current->comm); +- if (user_mode(regs)) +- do_group_exit(SIGKILL); ++ if (user_mode(regs)) { ++ /* ++ * 0-order allocation always success if something really ++ * fatal not happen: beancounter overdraft or OOM. ++ */ ++ force_sig(SIGKILL, current); ++ return; ++ } + goto no_context; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ia64/mm/init.c debian/binary-custom.d/openvz/src/arch/ia64/mm/init.c +--- ./arch/ia64/mm/init.c 2012-06-12 16:25:10.918312956 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ia64/mm/init.c 2012-11-13 15:20:10.372569240 +0000 +@@ -37,6 +37,8 @@ + #include + #include + ++#include ++ + DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); + + extern void ia64_tlb_init (void); +@@ -117,6 +119,10 @@ + + ia64_set_rbs_bot(); + ++ if (ub_memory_charge(current->mm, PAGE_SIZE, VM_DATA_DEFAULT_FLAGS, ++ NULL, UB_SOFT)) ++ goto skip; ++ + /* + * If we're out of memory and kmem_cache_alloc() returns NULL, we simply ignore + * the problem. When the process attempts to write to the register backing store +@@ -133,11 +139,16 @@ + if (insert_vm_struct(current->mm, vma)) { + up_write(¤t->mm->mmap_sem); + kmem_cache_free(vm_area_cachep, vma); ++ ub_memory_uncharge(current->mm, PAGE_SIZE, ++ VM_DATA_DEFAULT_FLAGS, NULL); + return; + } + up_write(¤t->mm->mmap_sem); +- } ++ } else ++ ub_memory_uncharge(current->mm, PAGE_SIZE, ++ VM_DATA_DEFAULT_FLAGS, NULL); + ++skip: + /* map NaT-page at address zero to speed up speculative dereferencing of NULL: */ + if (!(current->personality & MMAP_PAGE_ZERO)) { + vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/Kconfig debian/binary-custom.d/openvz/src/arch/powerpc/Kconfig +--- ./arch/powerpc/Kconfig 2012-06-12 16:25:11.134312949 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/Kconfig 2012-11-13 15:20:10.604569232 +0000 +@@ -674,10 +674,14 @@ + + source "lib/Kconfig" + ++source "kernel/bc/Kconfig" ++ + source "kernel/Kconfig.instrumentation" + + source "arch/powerpc/Kconfig.debug" + ++source "kernel/Kconfig.openvz" ++ + source "security/Kconfig" + + config KEYS_COMPAT +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/kernel/misc_32.S debian/binary-custom.d/openvz/src/arch/powerpc/kernel/misc_32.S +--- ./arch/powerpc/kernel/misc_32.S 2012-06-12 16:25:11.182312947 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/kernel/misc_32.S 2012-11-13 15:20:10.664569231 +0000 +@@ -787,7 +787,7 @@ + * Create a kernel thread + * kernel_thread(fn, arg, flags) + */ +-_GLOBAL(kernel_thread) ++_GLOBAL(ppc_kernel_thread) + stwu r1,-16(r1) + stw r30,8(r1) + stw r31,12(r1) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/kernel/misc_64.S debian/binary-custom.d/openvz/src/arch/powerpc/kernel/misc_64.S +--- ./arch/powerpc/kernel/misc_64.S 2012-06-12 16:25:11.182312947 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/kernel/misc_64.S 2012-11-13 15:20:10.664569231 +0000 +@@ -427,7 +427,7 @@ + * Create a kernel thread + * kernel_thread(fn, arg, flags) + */ +-_GLOBAL(kernel_thread) ++_GLOBAL(ppc_kernel_thread) + std r29,-24(r1) + std r30,-16(r1) + stdu r1,-STACK_FRAME_OVERHEAD(r1) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/kernel/process.c debian/binary-custom.d/openvz/src/arch/powerpc/kernel/process.c +--- ./arch/powerpc/kernel/process.c 2012-06-12 16:25:11.190312947 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/kernel/process.c 2012-11-13 15:20:10.668569233 +0000 +@@ -48,6 +48,8 @@ + #include + #endif + ++#include ++ + extern unsigned long _get_SP(void); + + #ifndef CONFIG_SMP +@@ -446,8 +448,9 @@ + + printk("NIP: "REG" LR: "REG" CTR: "REG"\n", + regs->nip, regs->link, regs->ctr); +- printk("REGS: %p TRAP: %04lx %s (%s)\n", +- regs, regs->trap, print_tainted(), init_utsname()->release); ++ printk("REGS: %p TRAP: %04lx %s (%s %s)\n", ++ regs, regs->trap, print_tainted(), init_utsname()->release, ++ VZVERSION); + printk("MSR: "REG" ", regs->msr); + printbits(regs->msr, msr_bits); + printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer); +@@ -1003,6 +1006,20 @@ + } + EXPORT_SYMBOL(dump_stack); + ++long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) ++{ ++ extern long ppc_kernel_thread(int (*fn)(void *), void *arg, ++ unsigned long flags); ++ ++ if (!ve_is_super(get_exec_env())) { ++ printk("kernel_thread call inside container\n"); ++ dump_stack(); ++ return -EPERM; ++ } ++ ++ return ppc_kernel_thread(fn, arg, flags); ++} ++ + #ifdef CONFIG_PPC64 + void ppc64_runlatch_on(void) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/kernel/systbl.S debian/binary-custom.d/openvz/src/arch/powerpc/kernel/systbl.S +--- ./arch/powerpc/kernel/systbl.S 2012-06-12 16:25:11.198312947 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/kernel/systbl.S 2012-11-13 15:20:10.676569234 +0000 +@@ -43,5 +43,9 @@ + .p2align 3 + #endif + ++#define SYS_SKIP(from, to) .rept to - from \ ++ SYSCALL(sys_ni_syscall) \ ++ .endr ++ + _GLOBAL(sys_call_table) + #include +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/kernel/vdso.c debian/binary-custom.d/openvz/src/arch/powerpc/kernel/vdso.c +--- ./arch/powerpc/kernel/vdso.c 2012-06-12 16:25:11.198312947 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/kernel/vdso.c 2012-11-13 15:20:10.680569232 +0000 +@@ -184,7 +184,7 @@ + * vDSO and insert it into the mm struct tree + */ + int arch_setup_additional_pages(struct linux_binprm *bprm, +- int executable_stack) ++ int executable_stack, unsigned long map_adress) + { + struct mm_struct *mm = current->mm; + struct page **vdso_pagelist; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/mm/fault.c debian/binary-custom.d/openvz/src/arch/powerpc/mm/fault.c +--- ./arch/powerpc/mm/fault.c 2012-06-12 16:25:11.210312946 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/mm/fault.c 2012-11-13 15:20:10.688569229 +0000 +@@ -335,7 +335,6 @@ + * make sure we exit gracefully rather than endlessly redo + * the fault. + */ +- survive: + ret = handle_mm_fault(mm, vma, address, is_write); + if (unlikely(ret & VM_FAULT_ERROR)) { + if (ret & VM_FAULT_OOM) +@@ -375,14 +374,12 @@ + */ + out_of_memory: + up_read(&mm->mmap_sem); +- if (is_global_init(current)) { +- yield(); +- down_read(&mm->mmap_sem); +- goto survive; +- } +- printk("VM: killing process %s\n", current->comm); + if (user_mode(regs)) +- do_group_exit(SIGKILL); ++ /* ++ * 0-order allocation always success if something really ++ * fatal not happen: beancounter overdraft or OOM. Den ++ */ ++ force_sig(SIGKILL, current); + return SIGKILL; + + do_sigbus: +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/mm/init_64.c debian/binary-custom.d/openvz/src/arch/powerpc/mm/init_64.c +--- ./arch/powerpc/mm/init_64.c 2012-06-12 16:25:11.210312946 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/mm/init_64.c 2012-11-13 15:20:10.692569230 +0000 +@@ -171,7 +171,7 @@ + "for size: %08x...\n", name, i, size); + pgtable_cache[i] = kmem_cache_create(name, + size, size, +- SLAB_PANIC, ++ SLAB_PANIC|SLAB_UBC|SLAB_NO_CHARGE, + zero_ctor); + } + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/mm/mem.c debian/binary-custom.d/openvz/src/arch/powerpc/mm/mem.c +--- ./arch/powerpc/mm/mem.c 2012-06-12 16:25:11.210312946 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/mm/mem.c 2012-11-13 15:20:10.692569230 +0000 +@@ -170,6 +170,7 @@ + printk("%ld pages shared\n", shared); + printk("%ld pages swap cached\n", cached); + } ++EXPORT_SYMBOL(show_mem); + + /* + * Initialize the bootmem system and give it all the memory we +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/mm/pgtable_32.c debian/binary-custom.d/openvz/src/arch/powerpc/mm/pgtable_32.c +--- ./arch/powerpc/mm/pgtable_32.c 2012-06-12 16:25:11.214312946 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/mm/pgtable_32.c 2012-11-13 15:20:10.692569230 +0000 +@@ -82,7 +82,8 @@ + { + pgd_t *ret; + +- ret = (pgd_t *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, PGDIR_ORDER); ++ ret = (pgd_t *)__get_free_pages(GFP_KERNEL_UBC | __GFP_SOFT_UBC | ++ __GFP_ZERO, PGDIR_ORDER); + return ret; + } + +@@ -116,6 +117,7 @@ + #else + gfp_t flags = GFP_KERNEL | __GFP_REPEAT; + #endif ++ flags |= (__GFP_UBC | __GFP_SOFT_UBC); + + ptepage = alloc_pages(flags, 0); + if (ptepage) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/powerpc/platforms/cell/spu_callbacks.c debian/binary-custom.d/openvz/src/arch/powerpc/platforms/cell/spu_callbacks.c +--- ./arch/powerpc/platforms/cell/spu_callbacks.c 2012-06-12 16:25:11.234312945 +0100 ++++ debian/binary-custom.d/openvz/src/arch/powerpc/platforms/cell/spu_callbacks.c 2012-11-13 15:20:10.708569231 +0000 +@@ -46,6 +46,8 @@ + #define PPC_SYS_SPU(func) ppc_##func, + #define SYSX_SPU(f, f3264, f32) f, + ++#define SYS_SKIP(from, to) [from ... to] = sys_ni_syscall, ++ + #include + }; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ppc/Kconfig debian/binary-custom.d/openvz/src/arch/ppc/Kconfig +--- ./arch/ppc/Kconfig 2012-06-12 16:25:11.290312943 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ppc/Kconfig 2012-11-13 15:20:10.756569231 +0000 +@@ -1321,6 +1321,10 @@ + + source "arch/ppc/Kconfig.debug" + ++source "kernel/Kconfig.openvz" ++ + source "security/Kconfig" + ++source "kernel/bc/Kconfig" ++ + source "crypto/Kconfig" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ppc/kernel/misc.S debian/binary-custom.d/openvz/src/arch/ppc/kernel/misc.S +--- ./arch/ppc/kernel/misc.S 2012-06-12 16:25:11.326312942 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ppc/kernel/misc.S 2012-11-13 15:20:10.796569226 +0000 +@@ -868,7 +868,7 @@ + * Create a kernel thread + * kernel_thread(fn, arg, flags) + */ +-_GLOBAL(kernel_thread) ++_GLOBAL(ppc_kernel_thread) + stwu r1,-16(r1) + stw r30,8(r1) + stw r31,12(r1) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ppc/mm/fault.c debian/binary-custom.d/openvz/src/arch/ppc/mm/fault.c +--- ./arch/ppc/mm/fault.c 2012-06-12 16:25:11.334312942 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ppc/mm/fault.c 2012-11-13 15:20:10.804569226 +0000 +@@ -249,7 +249,6 @@ + * make sure we exit gracefully rather than endlessly redo + * the fault. + */ +- survive: + fault = handle_mm_fault(mm, vma, address, is_write); + if (unlikely(fault & VM_FAULT_ERROR)) { + if (fault & VM_FAULT_OOM) +@@ -290,14 +289,12 @@ + */ + out_of_memory: + up_read(&mm->mmap_sem); +- if (is_global_init(current)) { +- yield(); +- down_read(&mm->mmap_sem); +- goto survive; +- } +- printk("VM: killing process %s\n", current->comm); + if (user_mode(regs)) +- do_group_exit(SIGKILL); ++ /* ++ * 0-order allocation always success if something really ++ * fatal not happen: beancounter overdraft or OOM. Den ++ */ ++ force_sig(SIGKILL, current); + return SIGKILL; + + do_sigbus: +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ppc/mm/init.c debian/binary-custom.d/openvz/src/arch/ppc/mm/init.c +--- ./arch/ppc/mm/init.c 2012-06-12 16:25:11.334312942 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ppc/mm/init.c 2012-11-13 15:20:10.804569226 +0000 +@@ -131,6 +131,7 @@ + printk("%d pages shared\n",shared); + printk("%d pages swap cached\n",cached); + } ++EXPORT_SYMBOL(show_mem); + + /* Free up now-unused memory */ + static void free_sec(unsigned long start, unsigned long end, const char *name) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/ppc/mm/pgtable.c debian/binary-custom.d/openvz/src/arch/ppc/mm/pgtable.c +--- ./arch/ppc/mm/pgtable.c 2012-06-12 16:25:11.334312942 +0100 ++++ debian/binary-custom.d/openvz/src/arch/ppc/mm/pgtable.c 2012-11-13 15:20:10.804569226 +0000 +@@ -83,7 +83,8 @@ + { + pgd_t *ret; + +- ret = (pgd_t *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, PGDIR_ORDER); ++ ret = (pgd_t *)__get_free_pages(GFP_KERNEL_UBC | __GFP_SOFT_UBC | ++ __GFP_ZERO, PGDIR_ORDER); + return ret; + } + +@@ -117,6 +118,7 @@ + #else + gfp_t flags = GFP_KERNEL | __GFP_REPEAT; + #endif ++ flags |= (__GFP_UBC | __GFP_SOFT_UBC); + + ptepage = alloc_pages(flags, 0); + if (ptepage) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/s390/Kconfig debian/binary-custom.d/openvz/src/arch/s390/Kconfig +--- ./arch/s390/Kconfig 2012-06-12 16:25:11.370312940 +0100 ++++ debian/binary-custom.d/openvz/src/arch/s390/Kconfig 2012-11-13 15:20:10.836569227 +0000 +@@ -533,8 +533,12 @@ + + source "arch/s390/Kconfig.debug" + ++source "kernel/Kconfig.openvz" ++ + source "security/Kconfig" + + source "crypto/Kconfig" + + source "lib/Kconfig" ++ ++source "kernel/bc/Kconfig" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/s390/kernel/smp.c debian/binary-custom.d/openvz/src/arch/s390/kernel/smp.c +--- ./arch/s390/kernel/smp.c 2012-06-12 16:25:11.382312940 +0100 ++++ debian/binary-custom.d/openvz/src/arch/s390/kernel/smp.c 2012-11-13 15:20:10.852569224 +0000 +@@ -430,8 +430,19 @@ + */ + int __cpuinit start_secondary(void *cpuvoid) + { +- /* Setup the cpu */ +- cpu_init(); ++ /* Setup the cpu */ ++ cpu_init(); ++ ++#ifdef CONFIG_VE ++ /* TSC reset. kill whatever might rely on old values */ ++ VE_TASK_INFO(current)->wakeup_stamp = 0; ++ /* ++ * Cosmetic: sleep_time won't be changed afterwards for the idle ++ * thread; keep it 0 rather than -cycles. ++ */ ++ VE_TASK_INFO(idle)->sleep_time = 0; ++#endif ++ + preempt_disable(); + /* Enable TOD clock interrupts on the secondary cpu. */ + init_cpu_timer(); +@@ -677,6 +688,11 @@ + for_each_possible_cpu(cpu) + if (cpu != smp_processor_id()) + smp_create_idle(cpu); ++ ++#ifdef CONFIG_VE ++ /* TSC reset. kill whatever might rely on old values */ ++ VE_TASK_INFO(current)->wakeup_stamp = 0; ++#endif + } + + void __init smp_prepare_boot_cpu(void) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/s390/mm/init.c debian/binary-custom.d/openvz/src/arch/s390/mm/init.c +--- ./arch/s390/mm/init.c 2012-06-12 16:25:11.386312940 +0100 ++++ debian/binary-custom.d/openvz/src/arch/s390/mm/init.c 2012-11-13 15:20:10.856569223 +0000 +@@ -77,6 +77,7 @@ + global_page_state(NR_SLAB_UNRECLAIMABLE)); + printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE)); + } ++EXPORT_SYMBOL(show_mem); + + static void __init setup_ro_region(void) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/sh64/kernel/process.c debian/binary-custom.d/openvz/src/arch/sh64/kernel/process.c +--- ./arch/sh64/kernel/process.c 2012-06-12 16:25:11.454312938 +0100 ++++ debian/binary-custom.d/openvz/src/arch/sh64/kernel/process.c 2012-11-13 15:20:10.916569222 +0000 +@@ -663,7 +663,7 @@ + int len=0; + struct task_struct *p; + read_lock(&tasklist_lock); +- for_each_process(p) { ++ for_each_process_ve(p) { + int pid = p->pid; + struct mm_struct *mm; + if (!pid) continue; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/sparc64/Kconfig debian/binary-custom.d/openvz/src/arch/sparc64/Kconfig +--- ./arch/sparc64/Kconfig 2012-06-12 16:25:11.486312936 +0100 ++++ debian/binary-custom.d/openvz/src/arch/sparc64/Kconfig 2012-11-13 15:20:10.944569221 +0000 +@@ -175,6 +175,8 @@ + depends on SMP + default "64" + ++source "kernel/Kconfig.fairsched" ++ + source "drivers/cpufreq/Kconfig" + + config US3_FREQ +@@ -466,8 +468,12 @@ + + source "arch/sparc64/Kconfig.debug" + ++source "kernel/Kconfig.openvz" ++ + source "security/Kconfig" + + source "crypto/Kconfig" + + source "lib/Kconfig" ++ ++source "kernel/bc/Kconfig" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/sparc64/kernel/process.c debian/binary-custom.d/openvz/src/arch/sparc64/kernel/process.c +--- ./arch/sparc64/kernel/process.c 2012-06-12 16:25:11.498312936 +0100 ++++ debian/binary-custom.d/openvz/src/arch/sparc64/kernel/process.c 2012-11-13 15:20:10.960569222 +0000 +@@ -691,6 +691,13 @@ + { + long retval; + ++ /* Don't allow kernel_thread() inside VE */ ++ if (!ve_is_super(get_exec_env())) { ++ printk("kernel_thread call inside container\n"); ++ dump_stack(); ++ return -EPERM; ++ } ++ + /* If the parent runs before fn(arg) is called by the child, + * the input registers of this function can be clobbered. + * So we stash 'fn' and 'arg' into global registers which +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/sparc64/kernel/sparc64_ksyms.c debian/binary-custom.d/openvz/src/arch/sparc64/kernel/sparc64_ksyms.c +--- ./arch/sparc64/kernel/sparc64_ksyms.c 2012-06-12 16:25:11.506312936 +0100 ++++ debian/binary-custom.d/openvz/src/arch/sparc64/kernel/sparc64_ksyms.c 2012-11-13 15:20:10.964569220 +0000 +@@ -310,6 +310,7 @@ + EXPORT_SYMBOL(copy_in_user_fixup); + EXPORT_SYMBOL(__strncpy_from_user); + EXPORT_SYMBOL(__clear_user); ++EXPORT_SYMBOL(mem_map_zero); + + /* Various address conversion macros use this. */ + EXPORT_SYMBOL(sparc64_valid_addr_bitmap); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/sparc64/kernel/systbls.S debian/binary-custom.d/openvz/src/arch/sparc64/kernel/systbls.S +--- ./arch/sparc64/kernel/systbls.S 2012-06-12 16:25:11.510312936 +0100 ++++ debian/binary-custom.d/openvz/src/arch/sparc64/kernel/systbls.S 2012-11-13 15:20:10.964569220 +0000 +@@ -82,6 +82,24 @@ + .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait + /*310*/ .word compat_sys_utimensat, compat_sys_signalfd, compat_sys_timerfd, sys_eventfd, compat_sys_fallocate + ++ .rept 500-315 ++ .word sys_nis_syscall ++ .endr ++ .word sys_fairsched_mknod /* 500 */ ++ .word sys_fairsched_rmnod ++ .word sys_fairsched_chwt ++ .word sys_fairsched_mvpr ++ .word sys_fairsched_rate ++ .word sys_nis_syscall /* 505 */ ++ .word sys_nis_syscall ++ .word sys_nis_syscall ++ .word sys_nis_syscall ++ .word sys_nis_syscall ++ .word sys_getluid /* 510 */ ++ .word sys_setluid ++ .word compat_sys_setublimit ++ .word compat_sys_ubstat ++ + #endif /* CONFIG_COMPAT */ + + /* Now the 64-bit native Linux syscall table. */ +@@ -154,6 +172,25 @@ + .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait + /*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd, sys_eventfd, sys_fallocate + ++ .rept 500-315 ++ .word sys_nis_syscall ++ .endr ++ .word sys_fairsched_mknod /* 500 */ ++ .word sys_fairsched_rmnod ++ .word sys_fairsched_chwt ++ .word sys_fairsched_mvpr ++ .word sys_fairsched_rate ++ .word sys_nis_syscall /* 505 */ ++ .word sys_nis_syscall ++ .word sys_nis_syscall ++ .word sys_nis_syscall ++ .word sys_nis_syscall ++ .word sys_getluid /* 510 */ ++ .word sys_setluid ++ .word sys_setublimit ++ .word sys_ubstat ++ ++ + #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ + defined(CONFIG_SOLARIS_EMUL_MODULE) + /* Now the 32-bit SunOS syscall table. */ +@@ -272,5 +309,8 @@ + .word sunos_nosys + /*310*/ .word sunos_nosys, sunos_nosys, sunos_nosys + .word sunos_nosys, sunos_nosys ++ .rept 520-315 ++ .word sunos_nosys ++ .endr + + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/sparc64/kernel/traps.c debian/binary-custom.d/openvz/src/arch/sparc64/kernel/traps.c +--- ./arch/sparc64/kernel/traps.c 2012-06-12 16:25:11.510312936 +0100 ++++ debian/binary-custom.d/openvz/src/arch/sparc64/kernel/traps.c 2012-11-13 15:20:10.968569219 +0000 +@@ -2229,6 +2229,10 @@ + " \\__U_/\n"); + + printk("%s(%d): %s [#%d]\n", current->comm, task_pid_nr(current), str, ++die_counter); ++ printk("VE:EXCVE %d:%d, CPU %d, VCPU %d:%d\n", ++ VEID(VE_TASK_INFO(current)->owner_env), VEID(get_exec_env()), ++ smp_processor_id(), ++ task_vsched_id(current), task_cpu(current)); + notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV); + __asm__ __volatile__("flushw"); + __show_regs(regs); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/sparc64/mm/init.c debian/binary-custom.d/openvz/src/arch/sparc64/mm/init.c +--- ./arch/sparc64/mm/init.c 2012-06-12 16:25:11.518312935 +0100 ++++ debian/binary-custom.d/openvz/src/arch/sparc64/mm/init.c 2012-11-13 15:20:10.972569220 +0000 +@@ -434,6 +434,7 @@ + printk(KERN_INFO "%lu pages pagetables\n", + global_page_state(NR_PAGETABLE)); + } ++EXPORT_SYMBOL(show_mem); + + void mmu_info(struct seq_file *m) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/Kconfig debian/binary-custom.d/openvz/src/arch/x86/Kconfig +--- ./arch/x86/Kconfig 2012-06-12 16:25:11.562312934 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/Kconfig 2012-11-13 15:20:11.020569219 +0000 +@@ -537,6 +537,14 @@ + depends on X86_32 && X86_VISWS + default y + ++config NMI_WATCHDOG ++ bool "NMI Watchdog" ++ default y ++ help ++ If you say Y here the kernel will activate NMI watchdog by default ++ on boot. You can still activate NMI watchdog via nmi_watchdog ++ command line option even if you say N here. ++ + config X86_MCE + bool "Machine Check Exception" + depends on !X86_VOYAGER +@@ -1603,6 +1611,7 @@ + + endmenu + ++source "kernel/Kconfig.openvz" + + source "net/Kconfig" + +@@ -1623,3 +1632,5 @@ + source "arch/x86/kvm/Kconfig" + + source "lib/Kconfig" ++ ++source "kernel/bc/Kconfig" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/ia32_binfmt.c debian/binary-custom.d/openvz/src/arch/x86/ia32/ia32_binfmt.c +--- ./arch/x86/ia32/ia32_binfmt.c 2012-06-12 16:25:11.574312933 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/ia32/ia32_binfmt.c 2012-11-13 15:20:11.044569219 +0000 +@@ -47,7 +47,7 @@ + #define AT_SYSINFO 32 + #define AT_SYSINFO_EHDR 33 + +-int sysctl_vsyscall32 = 1; ++int sysctl_vsyscall32 = 0; + + #undef ARCH_DLINFO + #define ARCH_DLINFO do { \ +@@ -214,9 +214,7 @@ + + static void elf32_init(struct pt_regs *); + +-#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 +-#define arch_setup_additional_pages syscall32_setup_pages +-extern int syscall32_setup_pages(struct linux_binprm *, int exstack); ++extern int arch_setup_additional_pages(struct linux_binprm *, int exstack, unsigned long map_address); + + #include "../../../fs/binfmt_elf.c" + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/ia32entry.S debian/binary-custom.d/openvz/src/arch/x86/ia32/ia32entry.S +--- ./arch/x86/ia32/ia32entry.S 2012-06-12 16:25:11.578312933 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/ia32/ia32entry.S 2012-11-13 15:20:11.044569219 +0000 +@@ -109,7 +109,8 @@ + pushfq + CFI_ADJUST_CFA_OFFSET 8 + /*CFI_REL_OFFSET rflags,0*/ +- movl $VSYSCALL32_SYSEXIT, %r10d ++ GET_THREAD_INFO(%r10) ++ movl threadinfo_sysenter_return(%r10), %r10d + CFI_REGISTER rip,r10 + pushq $__USER32_CS + CFI_ADJUST_CFA_OFFSET 8 +@@ -158,7 +159,7 @@ + popq %rcx /* User %esp */ + CFI_ADJUST_CFA_OFFSET -8 + CFI_REGISTER rsp,rcx +- movl $VSYSCALL32_SYSEXIT,%edx /* User %eip */ ++ movl threadinfo_sysenter_return(%r10),%edx /* User %eip */ + CFI_REGISTER rip,rdx + TRACE_IRQS_ON + swapgs +@@ -528,7 +529,7 @@ + .quad stub32_iopl /* 110 */ + .quad sys_vhangup + .quad quiet_ni_syscall /* old "idle" system call */ +- .quad sys32_vm86_warning /* vm86old */ ++ .quad quiet_ni_syscall /* vm86old */ + .quad compat_sys_wait4 + .quad sys_swapoff /* 115 */ + .quad compat_sys_sysinfo +@@ -581,7 +582,7 @@ + .quad sys_mremap + .quad sys_setresuid16 + .quad sys_getresuid16 /* 165 */ +- .quad sys32_vm86_warning /* vm86 */ ++ .quad quiet_ni_syscall /* vm86 */ + .quad quiet_ni_syscall /* query_module */ + .quad sys_poll + .quad compat_sys_nfsservctl +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/sys_ia32.c debian/binary-custom.d/openvz/src/arch/x86/ia32/sys_ia32.c +--- ./arch/x86/ia32/sys_ia32.c 2012-06-12 16:25:11.578312933 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/ia32/sys_ia32.c 2012-11-13 15:20:11.044569219 +0000 +@@ -802,18 +802,6 @@ + advice); + } + +-long sys32_vm86_warning(void) +-{ +- struct task_struct *me = current; +- static char lastcomm[sizeof(me->comm)]; +- if (strncmp(lastcomm, me->comm, sizeof(lastcomm))) { +- compat_printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n", +- me->comm); +- strncpy(lastcomm, me->comm, sizeof(lastcomm)); +- } +- return -ENOSYS; +-} +- + long sys32_lookup_dcookie(u32 addr_low, u32 addr_high, + char __user * buf, size_t len) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/syscall32.c debian/binary-custom.d/openvz/src/arch/x86/ia32/syscall32.c +--- ./arch/x86/ia32/syscall32.c 2012-06-12 16:25:11.578312933 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/ia32/syscall32.c 2012-11-13 15:20:11.044569219 +0000 +@@ -10,27 +10,54 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + ++#include ++ + extern unsigned char syscall32_syscall[], syscall32_syscall_end[]; + extern unsigned char syscall32_sysenter[], syscall32_sysenter_end[]; + extern int sysctl_vsyscall32; + +-static struct page *syscall32_pages[1]; ++char *syscall32_page; ++EXPORT_SYMBOL_GPL(syscall32_page); ++struct page *syscall32_pages[1]; ++EXPORT_SYMBOL_GPL(syscall32_pages); + static int use_sysenter = -1; + + struct linux_binprm; + + /* Setup a VMA at program startup for the vsyscall page */ +-int syscall32_setup_pages(struct linux_binprm *bprm, int exstack) ++int syscall32_setup_pages(struct linux_binprm *bprm, int exstack, ++ unsigned long map_address) + { ++ int npages = (__VSYSCALL32_END - __VSYSCALL32_BASE) >> PAGE_SHIFT; + struct mm_struct *mm = current->mm; ++ unsigned long flags; ++ unsigned long addr = map_address ? : __VSYSCALL32_BASE; + int ret; + ++ if (sysctl_vsyscall32 == 0 && map_address == 0) ++ return 0; ++ ++ flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYEXEC | VM_MAYWRITE | ++ mm->def_flags; ++ ++ ret = -ENOMEM; ++ if (ub_memory_charge(mm, __VSYSCALL32_END - __VSYSCALL32_BASE, ++ flags, NULL, UB_SOFT)) ++ goto err_charge; ++ + down_write(&mm->mmap_sem); ++ addr = get_unmapped_area(NULL, addr, PAGE_SIZE * npages, 0, ++ MAP_PRIVATE | MAP_FIXED); ++ if (unlikely(addr & ~PAGE_MASK)) { ++ ret = addr; ++ goto err_ins; ++ } + /* + * MAYWRITE to allow gdb to COW and set breakpoints + * +@@ -40,18 +67,27 @@ + * what PC values meant. + */ + /* Could randomize here */ +- ret = install_special_mapping(mm, VSYSCALL32_BASE, PAGE_SIZE, ++ ret = install_special_mapping(mm, addr, PAGE_SIZE * npages, + VM_READ|VM_EXEC| + VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| + VM_ALWAYSDUMP, + syscall32_pages); ++ if (ret == 0) { ++ mm->context.vdso = (void *)addr; ++ current_thread_info()->sysenter_return = VSYSCALL32_SYSEXIT; ++ } + up_write(&mm->mmap_sem); ++ if (ret < 0) ++err_ins: ++ ub_memory_uncharge(mm, __VSYSCALL32_END - __VSYSCALL32_BASE, flags, NULL); ++err_charge: + return ret; + } ++EXPORT_SYMBOL_GPL(syscall32_setup_pages); + + static int __init init_syscall32(void) + { +- char *syscall32_page = (void *)get_zeroed_page(GFP_KERNEL); ++ syscall32_page = (void *)get_zeroed_page(GFP_KERNEL); + if (!syscall32_page) + panic("Cannot allocate syscall32 page"); + syscall32_pages[0] = virt_to_page(syscall32_page); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/vsyscall-sysenter.S debian/binary-custom.d/openvz/src/arch/x86/ia32/vsyscall-sysenter.S +--- ./arch/x86/ia32/vsyscall-sysenter.S 2012-06-12 16:25:11.578312933 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/ia32/vsyscall-sysenter.S 2012-11-13 15:20:11.044569219 +0000 +@@ -20,9 +20,9 @@ + .Lenter_kernel: + movl %esp,%ebp + sysenter +- .space 7,0x90 ++ .space 23,0x90 + jmp .Lenter_kernel +- /* 16: System call normal return point is here! */ ++ /* 32: System call normal return point is here! */ + pop %ebp + .Lpop_ebp: + pop %edx +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/vsyscall.lds debian/binary-custom.d/openvz/src/arch/x86/ia32/vsyscall.lds +--- ./arch/x86/ia32/vsyscall.lds 2012-06-12 16:25:11.578312933 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/ia32/vsyscall.lds 2012-11-13 15:20:11.044569219 +0000 +@@ -4,11 +4,11 @@ + */ + + /* This must match . */ +-VSYSCALL_BASE = 0xffffe000; ++__VSYSCALL_BASE = 0xffffe000; + + SECTIONS + { +- . = VSYSCALL_BASE + SIZEOF_HEADERS; ++ . = __VSYSCALL_BASE + SIZEOF_HEADERS; + + .hash : { *(.hash) } :text + .gnu.hash : { *(.gnu.hash) } +@@ -22,18 +22,18 @@ + For the layouts to match, we need to skip more than enough + space for the dynamic symbol table et al. If this amount + is insufficient, ld -shared will barf. Just increase it here. */ +- . = VSYSCALL_BASE + 0x400; ++ . = __VSYSCALL_BASE + 0x400; + + .text.vsyscall : { *(.text.vsyscall) } :text =0x90909090 + + /* This is an 32bit object and we cannot easily get the offsets + into the 64bit kernel. Just hardcode them here. This assumes + that all the stubs don't need more than 0x100 bytes. */ +- . = VSYSCALL_BASE + 0x500; ++ . = __VSYSCALL_BASE + 0x500; + + .text.sigreturn : { *(.text.sigreturn) } :text =0x90909090 + +- . = VSYSCALL_BASE + 0x600; ++ . = __VSYSCALL_BASE + 0x600; + + .text.rtsigreturn : { *(.text.rtsigreturn) } :text =0x90909090 + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/asm-offsets_64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/asm-offsets_64.c +--- ./arch/x86/kernel/asm-offsets_64.c 2012-06-12 16:25:11.582312933 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/asm-offsets_64.c 2012-11-13 15:20:11.056569217 +0000 +@@ -47,6 +47,7 @@ + ENTRY(addr_limit); + ENTRY(preempt_count); + ENTRY(status); ++ ENTRY(sysenter_return); + BLANK(); + #undef ENTRY + #define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry)) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/cpu/mtrr/if.c debian/binary-custom.d/openvz/src/arch/x86/kernel/cpu/mtrr/if.c +--- ./arch/x86/kernel/cpu/mtrr/if.c 2012-06-12 16:25:11.598312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/cpu/mtrr/if.c 2012-11-13 15:20:11.068569219 +0000 +@@ -427,7 +427,7 @@ + return -ENODEV; + + proc_root_mtrr = +- create_proc_entry("mtrr", S_IWUSR | S_IRUGO, &proc_root); ++ create_proc_entry("mtrr", S_IWUSR | S_IRUGO, NULL); + if (proc_root_mtrr) { + proc_root_mtrr->owner = THIS_MODULE; + proc_root_mtrr->proc_fops = &mtrr_fops; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/entry_32.S debian/binary-custom.d/openvz/src/arch/x86/kernel/entry_32.S +--- ./arch/x86/kernel/entry_32.S 2012-06-12 16:25:11.602312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/entry_32.S 2012-11-13 15:20:11.076569220 +0000 +@@ -221,6 +221,7 @@ + GET_THREAD_INFO(%ebp) + popl %eax + CFI_ADJUST_CFA_OFFSET -4 ++ret_from_fork_tail: + pushl $0x0202 # Reset kernel eflags + CFI_ADJUST_CFA_OFFSET 4 + popfl +@@ -229,6 +230,25 @@ + CFI_ENDPROC + END(ret_from_fork) + ++ENTRY(i386_ret_from_resume) ++ CFI_STARTPROC ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ call schedule_tail ++ GET_THREAD_INFO(%ebp) ++ popl %eax ++ CFI_ADJUST_CFA_OFFSET -4 ++ movl (%esp),%eax ++ testl %eax,%eax ++ jz 1f ++ pushl %esp ++ call *%eax ++ addl $4,%esp ++1: ++ addl $256,%esp ++ jmp ret_from_fork_tail ++ CFI_ENDPROC ++ + /* + * Return to user mode is not as complex as all this looks, + * but we want the default path for a system call return to +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/entry_64.S debian/binary-custom.d/openvz/src/arch/x86/kernel/entry_64.S +--- ./arch/x86/kernel/entry_64.S 2012-06-12 16:25:11.602312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/entry_64.S 2012-11-13 15:20:11.076569220 +0000 +@@ -160,7 +160,12 @@ + popf # reset kernel eflags + CFI_ADJUST_CFA_OFFSET -4 + call schedule_tail ++ret_from_fork_tail: + GET_THREAD_INFO(%rcx) ++ btr $TIF_RESUME,threadinfo_flags(%rcx) ++ jc x86_64_ret_from_resume ++ ++ret_from_fork_check: + testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),threadinfo_flags(%rcx) + jnz rff_trace + rff_action: +@@ -176,6 +181,19 @@ + call syscall_trace_leave + GET_THREAD_INFO(%rcx) + jmp rff_action ++ ++x86_64_ret_from_resume: ++ movq (%rsp),%rax ++ testq %rax,%rax ++ jz 1f ++ movq %rsp,%rdi ++ call *%rax ++1: ++ addq $256,%rsp ++ cmpq $0,ORIG_RAX(%rsp) ++ jge ret_from_fork_tail ++ RESTORE_REST ++ jmp int_ret_from_sys_call + CFI_ENDPROC + END(ret_from_fork) + +@@ -283,7 +301,7 @@ + sysret_signal: + TRACE_IRQS_ON + sti +- testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx ++ testl $(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx + jz 1f + + /* Really a signal */ +@@ -377,7 +395,7 @@ + jmp int_restore_rest + + int_signal: +- testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx ++ testl $(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx + jz 1f + movq %rsp,%rdi # &ptregs -> arg1 + xorl %esi,%esi # oldset -> arg2 +@@ -603,7 +621,7 @@ + jmp retint_check + + retint_signal: +- testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx ++ testl $(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx + jz retint_swapgs + TRACE_IRQS_ON + sti +@@ -960,7 +978,7 @@ + xorl %r9d,%r9d + + # clone now +- call do_fork ++ call do_fork_kthread + movq %rax,RAX(%rsp) + xorl %edi,%edi + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/ldt_32.c debian/binary-custom.d/openvz/src/arch/x86/kernel/ldt_32.c +--- ./arch/x86/kernel/ldt_32.c 2012-06-12 16:25:11.606312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/ldt_32.c 2012-11-13 15:20:11.088569215 +0000 +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -17,6 +18,8 @@ + #include + #include + ++#include ++ + #ifdef CONFIG_SMP /* avoids "defined but not used" warnig */ + static void flush_ldt(void *null) + { +@@ -36,9 +39,9 @@ + oldsize = pc->size; + mincount = (mincount+511)&(~511); + if (mincount*LDT_ENTRY_SIZE > PAGE_SIZE) +- newldt = vmalloc(mincount*LDT_ENTRY_SIZE); ++ newldt = ub_vmalloc(mincount*LDT_ENTRY_SIZE); + else +- newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL); ++ newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL_UBC); + + if (!newldt) + return -ENOMEM; +@@ -102,6 +105,7 @@ + } + return retval; + } ++EXPORT_SYMBOL_GPL(init_new_context); + + /* + * No need to lock the MM as we are the last user +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/ldt_64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/ldt_64.c +--- ./arch/x86/kernel/ldt_64.c 2012-06-12 16:25:11.606312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/ldt_64.c 2012-11-13 15:20:11.088569215 +0000 +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -20,6 +21,8 @@ + #include + #include + ++#include ++ + #ifdef CONFIG_SMP /* avoids "defined but not used" warnig */ + static void flush_ldt(void *null) + { +@@ -39,9 +42,9 @@ + oldsize = pc->size; + mincount = (mincount+511)&(~511); + if (mincount*LDT_ENTRY_SIZE > PAGE_SIZE) +- newldt = vmalloc(mincount*LDT_ENTRY_SIZE); ++ newldt = ub_vmalloc(mincount*LDT_ENTRY_SIZE); + else +- newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL); ++ newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL_UBC); + + if (!newldt) + return -ENOMEM; +@@ -106,6 +109,7 @@ + } + return retval; + } ++EXPORT_SYMBOL_GPL(init_new_context); + + /* + * +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/nmi_32.c debian/binary-custom.d/openvz/src/arch/x86/kernel/nmi_32.c +--- ./arch/x86/kernel/nmi_32.c 2012-06-12 16:25:11.610312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/nmi_32.c 2012-11-13 15:20:11.088569215 +0000 +@@ -318,6 +318,21 @@ + + extern void die_nmi(struct pt_regs *, const char *msg); + ++void smp_show_regs(struct pt_regs *regs, void *info) ++{ ++ static DEFINE_SPINLOCK(show_regs_lock); ++ ++ if (regs == NULL) ++ return; ++ ++ spin_lock(&show_regs_lock); ++ bust_spinlocks(1); ++ printk("----------- IPI show regs -----------"); ++ show_regs(regs); ++ bust_spinlocks(0); ++ spin_unlock(&show_regs_lock); ++} ++ + __kprobes int nmi_watchdog_tick(struct pt_regs * regs, unsigned reason) + { + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/nmi_64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/nmi_64.c +--- ./arch/x86/kernel/nmi_64.c 2012-06-12 16:25:11.610312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/nmi_64.c 2012-11-13 15:20:11.088569215 +0000 +@@ -41,7 +41,12 @@ + atomic_t nmi_active = ATOMIC_INIT(0); /* oprofile uses this */ + int panic_on_timeout; + ++#ifdef CONFIG_NMI_WATCHDOG + unsigned int nmi_watchdog = NMI_DEFAULT; ++#else ++unsigned int nmi_watchdog = NMI_NONE; ++#endif ++ + static unsigned int nmi_hz = HZ; + + static DEFINE_PER_CPU(short, wd_enabled); +@@ -354,10 +359,10 @@ + if (!touched && __get_cpu_var(last_irq_sum) == sum) { + /* + * Ayiee, looks like this CPU is stuck ... +- * wait a few IRQs (5 seconds) before doing the oops ... ++ * wait a few IRQs (30 seconds) before doing the oops ... + */ + local_inc(&__get_cpu_var(alert_counter)); +- if (local_read(&__get_cpu_var(alert_counter)) == 5*nmi_hz) ++ if (local_read(&__get_cpu_var(alert_counter)) == 30*nmi_hz) + die_nmi("NMI Watchdog detected LOCKUP on CPU %d\n", regs, + panic_on_timeout); + } else { +@@ -385,15 +390,34 @@ + + static unsigned ignore_nmis; + ++static int dummy_nmi_callback(struct pt_regs * regs, int cpu) ++{ ++ return 0; ++} ++ ++static nmi_callback_t nmi_ipi_callback = dummy_nmi_callback; ++ + asmlinkage __kprobes void do_nmi(struct pt_regs * regs, long error_code) + { + nmi_enter(); + add_pda(__nmi_count,1); +- if (!ignore_nmis) ++ if (!ignore_nmis) { + default_do_nmi(regs); ++ nmi_ipi_callback(regs, smp_processor_id()); ++ } + nmi_exit(); + } + ++void set_nmi_ipi_callback(nmi_callback_t callback) ++{ ++ nmi_ipi_callback = callback; ++} ++ ++void unset_nmi_ipi_callback(void) ++{ ++ nmi_ipi_callback = dummy_nmi_callback; ++} ++ + int do_nmi_callback(struct pt_regs * regs, int cpu) + { + #ifdef CONFIG_SYSCTL +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/process_32.c debian/binary-custom.d/openvz/src/arch/x86/kernel/process_32.c +--- ./arch/x86/kernel/process_32.c 2012-06-12 16:25:11.614312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/process_32.c 2012-11-13 15:20:11.092569216 +0000 +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -52,11 +53,15 @@ + #endif + + #include ++#include + + #include + #include + + asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); ++EXPORT_SYMBOL(ret_from_fork); ++asmlinkage void i386_ret_from_resume(void) __asm__("i386_ret_from_resume"); ++EXPORT_SYMBOL_GPL(i386_ret_from_resume); + + static int hlt_counter; + +@@ -324,16 +329,17 @@ + } + + printk("\n"); +- printk("Pid: %d, comm: %s %s (%s %.*s)\n", ++ printk("Pid: %d, comm: %s %s (%s %.*s %s)\n", + task_pid_nr(current), current->comm, + print_tainted(), init_utsname()->release, + (int)strcspn(init_utsname()->version, " "), +- init_utsname()->version); ++ init_utsname()->version, VZVERSION); + + printk("EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n", + 0xffff & regs->xcs, regs->eip, regs->eflags, + smp_processor_id()); +- print_symbol("EIP is at %s\n", regs->eip); ++ if (decode_call_traces) ++ print_symbol("EIP is at %s\n", regs->eip); + + printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", + regs->eax, regs->ebx, regs->ecx, regs->edx); +@@ -370,6 +376,8 @@ + { + __show_registers(regs, 1); + show_trace(NULL, regs, ®s->esp); ++ if (!decode_call_traces) ++ printk(" EIP: [<%08lx>]\n",regs->eip); + } + + /* +@@ -378,6 +386,7 @@ + * the "args". + */ + extern void kernel_thread_helper(void); ++EXPORT_SYMBOL_GPL(kernel_thread_helper); + + /* + * Create a kernel thread +@@ -386,6 +395,13 @@ + { + struct pt_regs regs; + ++ /* Don't allow kernel_thread() inside VE */ ++ if (!ve_allow_kthreads && !ve_is_super(get_exec_env())) { ++ printk("kernel_thread call inside container\n"); ++ dump_stack(); ++ return -EPERM; ++ } ++ + memset(®s, 0, sizeof(regs)); + + regs.ebx = (unsigned long) fn; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/process_64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/process_64.c +--- ./arch/x86/kernel/process_64.c 2012-06-12 16:25:11.614312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/process_64.c 2012-11-13 15:20:11.092569216 +0000 +@@ -26,12 +26,14 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + #include + #include ++#include + #include + #include + #include +@@ -52,8 +54,6 @@ + #include + #include + +-asmlinkage extern void ret_from_fork(void); +- + unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; + + unsigned long boot_option_idle_override = 0; +@@ -326,13 +326,14 @@ + + printk("\n"); + print_modules(); +- printk("Pid: %d, comm: %.20s %s %s %.*s\n", ++ printk("Pid: %d, comm: %.20s %s %s %.*s %s\n", + current->pid, current->comm, print_tainted(), + init_utsname()->release, + (int)strcspn(init_utsname()->version, " "), +- init_utsname()->version); ++ init_utsname()->version, VZVERSION); + printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip); +- printk_address(regs->rip); ++ if (decode_call_traces) ++ printk_address(regs->rip); + printk("RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->rsp, + regs->eflags); + printk("RAX: %016lx RBX: %016lx RCX: %016lx\n", +@@ -380,7 +381,22 @@ + { + printk("CPU %d:", smp_processor_id()); + __show_regs(regs); +- show_trace(NULL, regs, (void *)(regs + 1)); ++ show_trace(NULL, regs, ®s->rsp); ++} ++ ++void smp_show_regs(struct pt_regs *regs, void *data) ++{ ++ static DEFINE_SPINLOCK(show_regs_lock); ++ ++ if (regs == NULL) ++ return; ++ ++ spin_lock(&show_regs_lock); ++ bust_spinlocks(1); ++ printk("----------- IPI show regs -----------\n"); ++ show_regs(regs); ++ bust_spinlocks(0); ++ spin_unlock(&show_regs_lock); + } + + /* +@@ -918,3 +934,20 @@ + sp -= get_random_int() % 8192; + return sp & ~0xf; + } ++ ++long do_fork_kthread(unsigned long clone_flags, ++ unsigned long stack_start, ++ struct pt_regs *regs, ++ unsigned long stack_size, ++ int __user *parent_tidptr, ++ int __user *child_tidptr) ++{ ++ if (ve_allow_kthreads || ve_is_super(get_exec_env())) ++ return do_fork(clone_flags, stack_start, regs, stack_size, ++ parent_tidptr, child_tidptr); ++ ++ /* Don't allow kernel_thread() inside VE */ ++ printk("kernel_thread call inside container\n"); ++ dump_stack(); ++ return -EPERM; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/ptrace_32.c debian/binary-custom.d/openvz/src/arch/x86/kernel/ptrace_32.c +--- ./arch/x86/kernel/ptrace_32.c 2012-06-12 16:25:11.614312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/ptrace_32.c 2012-11-13 15:20:11.092569216 +0000 +@@ -682,8 +682,11 @@ + return 0; + + /* Fake a debug trap */ +- if (is_singlestep) ++ if (is_singlestep) { ++ set_pn_state(current, entryexit ? PN_STOP_LEAVE : PN_STOP_ENTRY); + send_sigtrap(current, regs, 0); ++ clear_pn_state(current); ++ } + + if (!test_thread_flag(TIF_SYSCALL_TRACE) && !is_sysemu) + goto out; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/ptrace_64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/ptrace_64.c +--- ./arch/x86/kernel/ptrace_64.c 2012-06-12 16:25:11.614312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/ptrace_64.c 2012-11-13 15:20:11.092569216 +0000 +@@ -622,6 +622,10 @@ + + if ((test_thread_flag(TIF_SYSCALL_TRACE) + || test_thread_flag(TIF_SINGLESTEP)) +- && (current->ptrace & PT_PTRACED)) ++ && (current->ptrace & PT_PTRACED)) { ++ set_pn_state(current, (regs->rax != -ENOSYS) ? ++ PN_STOP_LEAVE : PN_STOP_ENTRY); + syscall_trace(regs); ++ clear_pn_state(current); ++ } + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/setup64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/setup64.c +--- ./arch/x86/kernel/setup64.c 2012-06-12 16:25:11.614312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/setup64.c 2012-11-13 15:20:11.100569219 +0000 +@@ -293,3 +293,5 @@ + + raw_local_save_flags(kernel_eflags); + } ++ ++EXPORT_SYMBOL_GPL(cpu_gdt_descr); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/signal_32.c debian/binary-custom.d/openvz/src/arch/x86/kernel/signal_32.c +--- ./arch/x86/kernel/signal_32.c 2012-06-12 16:25:11.618312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/signal_32.c 2012-11-13 15:20:11.100569219 +0000 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -587,6 +588,9 @@ + if (!user_mode(regs)) + return; + ++ if (try_to_freeze() && !signal_pending(current)) ++ goto no_signal; ++ + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + oldset = ¤t->saved_sigmask; + else +@@ -615,6 +619,7 @@ + return; + } + ++no_signal: + /* Did we come from a system call? */ + if (regs->orig_eax >= 0) { + /* Restart the system call - no handlers present */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/signal_64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/signal_64.c +--- ./arch/x86/kernel/signal_64.c 2012-06-12 16:25:11.618312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/signal_64.c 2012-11-13 15:20:11.100569219 +0000 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -403,6 +404,9 @@ + if (!user_mode(regs)) + return; + ++ if (try_to_freeze() && !signal_pending(current)) ++ goto no_signal; ++ + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + oldset = ¤t->saved_sigmask; + else +@@ -429,6 +433,7 @@ + return; + } + ++no_signal: + /* Did we come from a system call? */ + if ((long)regs->orig_rax >= 0) { + /* Restart the system call - no handlers present */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/smp_32.c debian/binary-custom.d/openvz/src/arch/x86/kernel/smp_32.c +--- ./arch/x86/kernel/smp_32.c 2012-06-12 16:25:11.618312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/smp_32.c 2012-11-13 15:20:11.100569219 +0000 +@@ -20,6 +20,7 @@ + #include + #include + ++#include + #include + #include + #include +@@ -427,6 +428,8 @@ + preempt_enable(); + } + ++EXPORT_SYMBOL(flush_tlb_mm); ++ + void flush_tlb_page(struct vm_area_struct * vma, unsigned long va) + { + struct mm_struct *mm = vma->vm_mm; +@@ -601,6 +604,89 @@ + + return 0; + } ++ ++static DEFINE_SPINLOCK(nmi_call_lock); ++static struct nmi_call_data_struct { ++ smp_nmi_function func; ++ void *info; ++ atomic_t started; ++ atomic_t finished; ++ cpumask_t cpus_called; ++ int wait; ++} *nmi_call_data; ++ ++static int smp_nmi_callback(struct pt_regs * regs, int cpu) ++{ ++ smp_nmi_function func; ++ void *info; ++ int wait; ++ ++ func = nmi_call_data->func; ++ info = nmi_call_data->info; ++ wait = nmi_call_data->wait; ++ ack_APIC_irq(); ++ /* prevent from calling func() multiple times */ ++ if (cpu_test_and_set(cpu, nmi_call_data->cpus_called)) ++ return 0; ++ /* ++ * notify initiating CPU that I've grabbed the data and am ++ * about to execute the function ++ */ ++ mb(); ++ atomic_inc(&nmi_call_data->started); ++ /* at this point the nmi_call_data structure is out of scope */ ++ irq_enter(); ++ func(regs, info); ++ irq_exit(); ++ if (wait) ++ atomic_inc(&nmi_call_data->finished); ++ ++ return 0; ++} ++ ++/* ++ * This function tries to call func(regs, info) on each cpu. ++ * Func must be fast and non-blocking. ++ * May be called with disabled interrupts and from any context. ++ */ ++int smp_nmi_call_function(smp_nmi_function func, void *info, int wait) ++{ ++ struct nmi_call_data_struct data; ++ int cpus; ++ ++ cpus = num_online_cpus() - 1; ++ if (!cpus) ++ return 0; ++ ++ data.func = func; ++ data.info = info; ++ data.wait = wait; ++ atomic_set(&data.started, 0); ++ atomic_set(&data.finished, 0); ++ cpus_clear(data.cpus_called); ++ /* prevent this cpu from calling func if NMI happens */ ++ cpu_set(smp_processor_id(), data.cpus_called); ++ ++ if (!spin_trylock(&nmi_call_lock)) ++ return -1; ++ ++ nmi_call_data = &data; ++ set_nmi_ipi_callback(smp_nmi_callback); ++ mb(); ++ ++ /* Send a message to all other CPUs and wait for them to respond */ ++ send_IPI_allbutself(APIC_DM_NMI); ++ while (atomic_read(&data.started) != cpus) ++ barrier(); ++ ++ unset_nmi_ipi_callback(); ++ if (wait) ++ while (atomic_read(&data.finished) != cpus) ++ barrier(); ++ spin_unlock(&nmi_call_lock); ++ ++ return 0; ++} + + static void stop_this_cpu (void * dummy) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/smp_64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/smp_64.c +--- ./arch/x86/kernel/smp_64.c 2012-06-12 16:25:11.618312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/smp_64.c 2012-11-13 15:20:11.100569219 +0000 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* + * Smarter SMP flushing macros. +@@ -463,6 +464,84 @@ + } + EXPORT_SYMBOL(smp_call_function); + ++static DEFINE_SPINLOCK(nmi_call_lock); ++static struct nmi_call_data_struct { ++ smp_nmi_function func; ++ void *info; ++ atomic_t started; ++ atomic_t finished; ++ cpumask_t cpus_called; ++ int wait; ++} *nmi_call_data; ++ ++static int smp_nmi_callback(struct pt_regs * regs, int cpu) ++{ ++ smp_nmi_function func; ++ void *info; ++ int wait; ++ ++ func = nmi_call_data->func; ++ info = nmi_call_data->info; ++ wait = nmi_call_data->wait; ++ ack_APIC_irq(); ++ /* prevent from calling func() multiple times */ ++ if (cpu_test_and_set(cpu, nmi_call_data->cpus_called)) ++ return 0; ++ /* ++ * notify initiating CPU that I've grabbed the data and am ++ * about to execute the function ++ */ ++ mb(); ++ atomic_inc(&nmi_call_data->started); ++ /* at this point the nmi_call_data structure is out of scope */ ++ irq_enter(); ++ func(regs, info); ++ irq_exit(); ++ if (wait) ++ atomic_inc(&nmi_call_data->finished); ++ ++ return 0; ++} ++ ++int smp_nmi_call_function(smp_nmi_function func, void *info, int wait) ++{ ++ struct nmi_call_data_struct data; ++ int cpus; ++ ++ cpus = num_online_cpus() - 1; ++ if (!cpus) ++ return 0; ++ ++ data.func = func; ++ data.info = info; ++ data.wait = wait; ++ atomic_set(&data.started, 0); ++ atomic_set(&data.finished, 0); ++ cpus_clear(data.cpus_called); ++ /* prevent this cpu from calling func if NMI happens */ ++ cpu_set(smp_processor_id(), data.cpus_called); ++ ++ if (!spin_trylock(&nmi_call_lock)) ++ return -1; ++ ++ nmi_call_data = &data; ++ set_nmi_ipi_callback(smp_nmi_callback); ++ mb(); ++ ++ /* Send a message to all other CPUs and wait for them to respond */ ++ send_IPI_allbutself(APIC_DM_NMI); ++ while (atomic_read(&data.started) != cpus) ++ barrier(); ++ ++ unset_nmi_ipi_callback(); ++ if (wait) ++ while (atomic_read(&data.finished) != cpus) ++ barrier(); ++ spin_unlock(&nmi_call_lock); ++ ++ return 0; ++} ++ + static void stop_this_cpu(void *dummy) + { + local_irq_disable(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/smpboot_32.c debian/binary-custom.d/openvz/src/arch/x86/kernel/smpboot_32.c +--- ./arch/x86/kernel/smpboot_32.c 2012-06-12 16:25:11.618312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/smpboot_32.c 2012-11-13 15:20:11.100569219 +0000 +@@ -800,6 +800,13 @@ + early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); + + idle->thread.eip = (unsigned long) start_secondary; ++ ++#ifdef CONFIG_VE ++ /* Cosmetic: sleep_time won't be changed afterwards for the idle ++ * thread; keep it 0 rather than -cycles. */ ++ VE_TASK_INFO(idle)->sleep_time = 0; ++#endif ++ + /* start_eip had better be page-aligned! */ + start_eip = setup_trampoline(); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/syscall_table_32.S debian/binary-custom.d/openvz/src/arch/x86/kernel/syscall_table_32.S +--- ./arch/x86/kernel/syscall_table_32.S 2012-06-12 16:25:11.618312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/syscall_table_32.S 2012-11-13 15:20:11.104569219 +0000 +@@ -324,3 +324,24 @@ + .long sys_timerfd + .long sys_eventfd + .long sys_fallocate ++ .rept 500-(.-sys_call_table)/4 ++ .long sys_ni_syscall ++ .endr ++ .long sys_fairsched_mknod /* 500 */ ++ .long sys_fairsched_rmnod ++ .long sys_fairsched_chwt ++ .long sys_fairsched_mvpr ++ .long sys_fairsched_rate ++ .long sys_fairsched_vcpus /* 505 */ ++ .long sys_ni_syscall ++ .long sys_ni_syscall ++ .long sys_ni_syscall ++ .long sys_ni_syscall ++ .long sys_getluid /* 510 */ ++ .long sys_setluid ++ .long sys_setublimit ++ .long sys_ubstat ++ .long sys_ni_syscall ++ .long sys_ni_syscall ++ .long sys_lchmod /* 516 */ ++ .long sys_lutime +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/sysenter_32.c debian/binary-custom.d/openvz/src/arch/x86/kernel/sysenter_32.c +--- ./arch/x86/kernel/sysenter_32.c 2012-06-12 16:25:11.618312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/sysenter_32.c 2012-11-13 15:20:11.104569219 +0000 +@@ -215,7 +215,10 @@ + */ + extern const char vsyscall_int80_start, vsyscall_int80_end; + extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; +-static struct page *syscall_pages[1]; ++void *syscall_page; ++EXPORT_SYMBOL(syscall_page); ++struct page *syscall_pages[1]; ++EXPORT_SYMBOL_GPL(syscall_pages); + + static void map_compat_vdso(int map) + { +@@ -235,10 +238,10 @@ + + int __init sysenter_setup(void) + { +- void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC); + const void *vsyscall; + size_t vsyscall_len; + ++ syscall_page = (void *)get_zeroed_page(GFP_ATOMIC); + syscall_pages[0] = virt_to_page(syscall_page); + + gate_vma_init(); +@@ -261,15 +264,22 @@ + + /* Defined in vsyscall-sysenter.S */ + extern void SYSENTER_RETURN; ++EXPORT_SYMBOL_GPL(SYSENTER_RETURN); + + /* Setup a VMA at program startup for the vsyscall page */ +-int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack) ++int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack, ++ unsigned long map_address) + { + struct mm_struct *mm = current->mm; + unsigned long addr; + int ret = 0; + bool compat; + ++ if (unlikely(!vdso_enabled) && map_address == 0) { ++ current->mm->context.vdso = NULL; ++ return 0; ++ } ++ + down_write(&mm->mmap_sem); + + /* Test compat mode once here, in case someone +@@ -281,7 +291,7 @@ + if (compat) + addr = VDSO_HIGH_BASE; + else { +- addr = get_unmapped_area(NULL, 0, PAGE_SIZE, 0, 0); ++ addr = get_unmapped_area(NULL, map_address, PAGE_SIZE, 0, 0); + if (IS_ERR_VALUE(addr)) { + ret = addr; + goto up_fail; +@@ -315,6 +325,7 @@ + + return ret; + } ++EXPORT_SYMBOL(arch_setup_additional_pages); + + const char *arch_vma_name(struct vm_area_struct *vma) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/traps_32.c debian/binary-custom.d/openvz/src/arch/x86/kernel/traps_32.c +--- ./arch/x86/kernel/traps_32.c 2012-06-12 16:25:11.622312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/traps_32.c 2012-11-13 15:20:11.104569219 +0000 +@@ -58,6 +58,7 @@ + #include + + #include ++#include + + #include "mach_traps.h" + +@@ -220,7 +221,8 @@ + static void print_trace_address(void *data, unsigned long addr) + { + printk("%s [<%08lx>] ", (char *)data, addr); +- print_symbol("%s\n", addr); ++ if (decode_call_traces) ++ print_symbol("%s\n", addr); + touch_nmi_watchdog(); + } + +@@ -236,7 +238,10 @@ + unsigned long * stack, char *log_lvl) + { + dump_trace(task, regs, stack, &print_trace_ops, log_lvl); +- printk("%s =======================\n", log_lvl); ++ if (decode_call_traces) ++ printk("%s =======================\n", log_lvl); ++ else ++ printk("%s ==", log_lvl); + } + + void show_trace(struct task_struct *task, struct pt_regs *regs, +@@ -266,8 +271,13 @@ + printk("\n%s ", log_lvl); + printk("%08lx ", *stack++); + } +- printk("\n%sCall Trace:\n", log_lvl); ++ if (decode_call_traces) ++ printk("\n%s Call Trace:\n", log_lvl); ++ else ++ printk("\n%s Call Trace: ", log_lvl); + show_trace_log_lvl(task, regs, esp, log_lvl); ++ if (!decode_call_traces) ++ printk("\n"); + } + + void show_stack(struct task_struct *task, unsigned long *esp) +@@ -289,6 +299,8 @@ + (int)strcspn(init_utsname()->version, " "), + init_utsname()->version); + show_trace(current, NULL, &stack); ++ if (!decode_call_traces) ++ printk("\n"); + } + + EXPORT_SYMBOL(dump_stack); +@@ -299,8 +311,9 @@ + + print_modules(); + __show_registers(regs, 0); +- printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)", ++ printk(KERN_EMERG "Process %.*s (pid: %d, veid: %d, ti=%p task=%p task.ti=%p)", + TASK_COMM_LEN, current->comm, task_pid_nr(current), ++ VEID(current->ve_task_info.owner_env), + current_thread_info(), current, task_thread_info(current)); + /* + * When in-kernel, we also print out the stack and code at the +@@ -351,6 +364,13 @@ + return ud2 == 0x0b0f; + } + ++static void inline check_kernel_csum_bug(void) ++{ ++ if (kernel_text_csum_broken) ++ printk("Kernel code checksum mismatch detected %d times\n", ++ kernel_text_csum_broken); ++} ++ + /* + * This is gone through when something in the kernel has done something bad and + * is about to be terminated. +@@ -420,6 +440,7 @@ + } else + printk(KERN_EMERG "Recursive die() failure, output suppressed\n"); + ++ check_kernel_csum_bug(); + bust_spinlocks(0); + die.lock_owner = -1; + add_taint(TAINT_DIE); +@@ -690,12 +711,27 @@ + printk(KERN_EMERG "Dazed and confused, but trying to continue\n"); + } + +-static DEFINE_SPINLOCK(nmi_print_lock); ++/* ++ * Voyager doesn't implement these ++ */ ++void __attribute__((weak)) smp_show_regs(struct pt_regs *regs, void *info) ++{ ++} + ++#ifdef CONFIG_SMP ++int __attribute__((weak)) ++smp_nmi_call_function(smp_nmi_function func, void *info, int wait) ++{ ++ return 0; ++} ++#endif ++ + void __kprobes die_nmi(struct pt_regs *regs, const char *msg) + { ++ static DEFINE_SPINLOCK(nmi_print_lock); ++ + if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 2, SIGINT) == +- NOTIFY_STOP) ++ NOTIFY_STOP) + return; + + spin_lock(&nmi_print_lock); +@@ -708,6 +744,10 @@ + printk(" on CPU%d, eip %08lx, registers:\n", + smp_processor_id(), regs->eip); + show_registers(regs); ++ smp_nmi_call_function(smp_show_regs, NULL, 1); ++ bust_spinlocks(1); ++ if (!decode_call_traces) ++ show_registers(regs); + console_silent(); + spin_unlock(&nmi_print_lock); + bust_spinlocks(0); +@@ -723,6 +763,13 @@ + do_exit(SIGSEGV); + } + ++static int dummy_nmi_callback(struct pt_regs * regs, int cpu) ++{ ++ return 0; ++} ++ ++static nmi_callback_t nmi_ipi_callback = dummy_nmi_callback; ++ + static __kprobes void default_do_nmi(struct pt_regs * regs) + { + unsigned char reason = 0; +@@ -742,10 +789,15 @@ + */ + if (nmi_watchdog_tick(regs, reason)) + return; +- if (!do_nmi_callback(regs, smp_processor_id())) +-#endif ++ if (!do_nmi_callback(regs, smp_processor_id())) { + unknown_nmi_error(reason, regs); ++ return; ++ } ++#endif ++ if (nmi_ipi_callback != dummy_nmi_callback) ++ return; + ++ unknown_nmi_error(reason, regs); + return; + } + if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP) +@@ -773,12 +825,24 @@ + + ++nmi_count(cpu); + +- if (!ignore_nmis) ++ if (!ignore_nmis) { + default_do_nmi(regs); ++ nmi_ipi_callback(regs, cpu); ++ } + + nmi_exit(); + } + ++void set_nmi_ipi_callback(nmi_callback_t callback) ++{ ++ nmi_ipi_callback = callback; ++} ++ ++void unset_nmi_ipi_callback(void) ++{ ++ nmi_ipi_callback = dummy_nmi_callback; ++} ++ + void stop_nmi(void) + { + acpi_nmi_disable(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/traps_64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/traps_64.c +--- ./arch/x86/kernel/traps_64.c 2012-06-12 16:25:11.622312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/traps_64.c 2012-11-13 15:20:11.104569219 +0000 +@@ -107,6 +107,11 @@ + char *delim = ":"; + char namebuf[128]; + ++ if (!decode_call_traces) { ++ printk("[<%016lx>]", address); ++ return; ++ } ++ + symname = kallsyms_lookup(address, &symsize, &offset, + &modname, namebuf); + if (!symname) { +@@ -382,7 +387,7 @@ + if (((long) stack & (THREAD_SIZE-1)) == 0) + break; + } +- if (i && ((i % 4) == 0)) ++ if (i && ((i % 4) == 0) && decode_call_traces) + printk("\n"); + printk(" %016lx", *stack++); + touch_nmi_watchdog(); +@@ -421,10 +426,12 @@ + struct task_struct *cur = cpu_pda(cpu)->pcurrent; + + rsp = regs->rsp; +- printk("CPU %d ", cpu); ++ printk("CPU: %d ", cpu); + __show_regs(regs); +- printk("Process %s (pid: %d, threadinfo %p, task %p)\n", +- cur->comm, cur->pid, task_thread_info(cur), cur); ++ printk("Process %s (pid: %d, veid=%d, threadinfo %p, task %p)\n", ++ cur->comm, cur->pid, ++ VEID(VE_TASK_INFO(current)->owner_env), ++ task_thread_info(cur), cur); + + /* + * When in-kernel, we also print out the stack and code at the +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/tsc_sync.c debian/binary-custom.d/openvz/src/arch/x86/kernel/tsc_sync.c +--- ./arch/x86/kernel/tsc_sync.c 2012-06-12 16:25:11.622312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/tsc_sync.c 2012-11-13 15:20:11.104569219 +0000 +@@ -151,7 +151,10 @@ + } else { + printk(" passed.\n"); + } +- ++#ifdef CONFIG_VE ++ /* TSC reset. kill whatever might rely on old values */ ++ VE_TASK_INFO(current)->wakeup_stamp = 0; ++#endif + /* + * Let the target continue with the bootup: + */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/vsyscall-sigreturn_32.S debian/binary-custom.d/openvz/src/arch/x86/kernel/vsyscall-sigreturn_32.S +--- ./arch/x86/kernel/vsyscall-sigreturn_32.S 2012-06-12 16:25:11.622312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/vsyscall-sigreturn_32.S 2012-11-13 15:20:11.112569215 +0000 +@@ -15,7 +15,7 @@ + */ + + .text +- .org __kernel_vsyscall+32,0x90 ++ .org __kernel_vsyscall+0x100,0x90 + .globl __kernel_sigreturn + .type __kernel_sigreturn,@function + __kernel_sigreturn: +@@ -27,6 +27,7 @@ + .size __kernel_sigreturn,.-.LSTART_sigreturn + + .balign 32 ++ .org __kernel_vsyscall+0x200,0x90 + .globl __kernel_rt_sigreturn + .type __kernel_rt_sigreturn,@function + __kernel_rt_sigreturn: +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/vsyscall-sysenter_32.S debian/binary-custom.d/openvz/src/arch/x86/kernel/vsyscall-sysenter_32.S +--- ./arch/x86/kernel/vsyscall-sysenter_32.S 2012-06-12 16:25:11.622312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/vsyscall-sysenter_32.S 2012-11-13 15:20:11.112569215 +0000 +@@ -39,12 +39,12 @@ + movl %esp,%ebp + sysenter + +- /* 7: align return point with nop's to make disassembly easier */ +- .space 7,0x90 ++ /* 17: align return point with nop's to make disassembly easier */ ++ .space 13,0x90 + +- /* 14: System call restart point is here! (SYSENTER_RETURN-2) */ ++ /* 30: System call restart point is here! (SYSENTER_RETURN-2) */ + jmp .Lenter_kernel +- /* 16: System call normal return point is here! */ ++ /* 32: System call normal return point is here! */ + .globl SYSENTER_RETURN /* Symbol used by sysenter.c */ + SYSENTER_RETURN: + pop %ebp +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/x8664_ksyms_64.c debian/binary-custom.d/openvz/src/arch/x86/kernel/x8664_ksyms_64.c +--- ./arch/x86/kernel/x8664_ksyms_64.c 2012-06-12 16:25:11.622312932 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/kernel/x8664_ksyms_64.c 2012-11-13 15:20:11.112569215 +0000 +@@ -3,12 +3,14 @@ + + #include + #include ++#include + + #include + #include + #include + #include + ++EXPORT_SYMBOL(kernel_execve); + EXPORT_SYMBOL(kernel_thread); + + EXPORT_SYMBOL(__down_failed); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/mm/fault_32.c debian/binary-custom.d/openvz/src/arch/x86/mm/fault_32.c +--- ./arch/x86/mm/fault_32.c 2012-06-12 16:25:11.642312931 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/mm/fault_32.c 2012-11-13 15:20:11.132569218 +0000 +@@ -279,7 +279,7 @@ + return 0; + } + +-int show_unhandled_signals = 1; ++int show_unhandled_signals = 0; + + /* + * This routine handles page faults. It determines the address, +@@ -421,7 +421,6 @@ + goto bad_area; + } + +- survive: + /* + * If for any reason at all we couldn't handle the fault, + * make sure we exit gracefully rather than endlessly redo +@@ -597,14 +596,14 @@ + */ + out_of_memory: + up_read(&mm->mmap_sem); +- if (is_global_init(tsk)) { +- yield(); +- down_read(&mm->mmap_sem); +- goto survive; ++ if (error_code & 4) { ++ /* ++ * 0-order allocation always success if something really ++ * fatal not happen: beancounter overdraft or OOM. ++ */ ++ force_sig(SIGKILL, tsk); ++ return; + } +- printk("VM: killing process %s\n", tsk->comm); +- if (error_code & 4) +- do_group_exit(SIGKILL); + goto no_context; + + do_sigbus: +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/mm/fault_64.c debian/binary-custom.d/openvz/src/arch/x86/mm/fault_64.c +--- ./arch/x86/mm/fault_64.c 2012-06-12 16:25:11.642312931 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/mm/fault_64.c 2012-11-13 15:20:11.132569218 +0000 +@@ -285,7 +285,7 @@ + return 0; + } + +-int show_unhandled_signals = 1; ++int show_unhandled_signals = 0; + + /* + * This routine handles page faults. It determines the address, +@@ -376,7 +376,6 @@ + if (user_mode_vm(regs)) + error_code |= PF_USER; + +- again: + /* When running in the kernel we expect faults to occur only to + * addresses in user space. All other faults represent errors in the + * kernel and should generate an OOPS. Unfortunately, in the case of an +@@ -488,7 +487,7 @@ + + if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) && + printk_ratelimit()) { +- printk( ++ ve_printk(VE_LOG, + "%s%s[%d]: segfault at %lx rip %lx rsp %lx error %lx\n", + tsk->pid > 1 ? KERN_INFO : KERN_EMERG, + tsk->comm, tsk->pid, address, regs->rip, +@@ -538,7 +537,8 @@ + else + printk(KERN_ALERT "Unable to handle kernel paging request"); + printk(" at %016lx RIP: \n" KERN_ALERT,address); +- printk_address(regs->rip); ++ if (decode_call_traces) ++ printk_address(regs->rip); + dump_pagetable(address); + tsk->thread.cr2 = address; + tsk->thread.trap_no = 14; +@@ -558,13 +558,14 @@ + */ + out_of_memory: + up_read(&mm->mmap_sem); +- if (is_global_init(current)) { +- yield(); +- goto again; ++ if (error_code & 4) { ++ /* ++ * 0-order allocation always success if something really ++ * fatal not happen: beancounter overdraft or OOM. ++ */ ++ force_sig(SIGKILL, tsk); ++ return; + } +- printk("VM: killing process %s\n", tsk->comm); +- if (error_code & 4) +- do_group_exit(SIGKILL); + goto no_context; + + do_sigbus: +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/mm/hugetlbpage.c debian/binary-custom.d/openvz/src/arch/x86/mm/hugetlbpage.c +--- ./arch/x86/mm/hugetlbpage.c 2012-06-12 16:25:11.646312931 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/mm/hugetlbpage.c 2012-11-13 15:20:11.136569216 +0000 +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -206,6 +207,7 @@ + { + return !!(pmd_val(pmd) & _PAGE_PSE); + } ++EXPORT_SYMBOL(pmd_huge); + + struct page * + follow_huge_pmd(struct mm_struct *mm, unsigned long address, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/mm/init_32.c debian/binary-custom.d/openvz/src/arch/x86/mm/init_32.c +--- ./arch/x86/mm/init_32.c 2012-06-12 16:25:11.646312931 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/mm/init_32.c 2012-11-13 15:20:11.136569216 +0000 +@@ -785,7 +785,7 @@ + pmd_cache = kmem_cache_create("pmd", + PTRS_PER_PMD*sizeof(pmd_t), + PTRS_PER_PMD*sizeof(pmd_t), +- SLAB_PANIC, ++ SLAB_PANIC|SLAB_UBC, + pmd_ctor); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/mm/init_64.c debian/binary-custom.d/openvz/src/arch/x86/mm/init_64.c +--- ./arch/x86/mm/init_64.c 2012-06-12 16:25:11.646312931 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/mm/init_64.c 2012-11-13 15:20:11.136569216 +0000 +@@ -97,6 +97,7 @@ + printk(KERN_INFO "%lu pages shared\n",shared); + printk(KERN_INFO "%lu pages swap cached\n",cached); + } ++EXPORT_SYMBOL(show_mem); + + int after_bootmem; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/mm/pgtable_32.c debian/binary-custom.d/openvz/src/arch/x86/mm/pgtable_32.c +--- ./arch/x86/mm/pgtable_32.c 2012-06-12 16:25:11.646312931 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/mm/pgtable_32.c 2012-11-13 15:20:11.136569216 +0000 +@@ -4,9 +4,11 @@ + + #include + #include ++#include + #include + #include + #include ++#include + #include + #include + #include +@@ -71,6 +73,7 @@ + printk(KERN_INFO "%lu pages pagetables\n", + global_page_state(NR_PAGETABLE)); + } ++EXPORT_SYMBOL(show_mem); + + /* + * Associate a virtual page frame with a given physical page frame +@@ -188,9 +191,11 @@ + struct page *pte; + + #ifdef CONFIG_HIGHPTE +- pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT|__GFP_ZERO, 0); ++ pte = alloc_pages(GFP_KERNEL_UBC|__GFP_SOFT_UBC|__GFP_HIGHMEM| ++ __GFP_REPEAT|__GFP_ZERO, 0); + #else +- pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); ++ pte = alloc_pages(GFP_KERNEL_UBC|__GFP_SOFT_UBC| ++ __GFP_REPEAT|__GFP_ZERO, 0); + #endif + return pte; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/vdso/vma.c debian/binary-custom.d/openvz/src/arch/x86/vdso/vma.c +--- ./arch/x86/vdso/vma.c 2012-06-12 16:25:11.658312930 +0100 ++++ debian/binary-custom.d/openvz/src/arch/x86/vdso/vma.c 2012-11-13 15:20:11.148569214 +0000 +@@ -4,6 +4,7 @@ + * Subject to the GPL, v.2 + */ + #include ++#include + #include + #include + #include +@@ -100,18 +101,24 @@ + + /* Setup a VMA at program startup for the vsyscall page. + Not called for compat tasks */ +-int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack) ++int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack, ++ unsigned long map_address) + { + struct mm_struct *mm = current->mm; + unsigned long addr; + int ret; + unsigned len = round_up(vdso_end - vdso_start, PAGE_SIZE); + +- if (!vdso_enabled) ++ if (!vdso_enabled && map_address == 0) { ++ current->mm->context.vdso = NULL; + return 0; ++ } + + down_write(&mm->mmap_sem); +- addr = vdso_addr(mm->start_stack, len); ++ if (map_address) ++ addr = map_address; ++ else ++ addr = vdso_addr(mm->start_stack, len); + addr = get_unmapped_area(NULL, addr, len, 0, 0); + if (IS_ERR_VALUE(addr)) { + ret = addr; +@@ -131,6 +138,7 @@ + up_write(&mm->mmap_sem); + return ret; + } ++EXPORT_SYMBOL_GPL(arch_setup_additional_pages); + + static __init int vdso_setup(char *s) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./block/cfq-iosched.c debian/binary-custom.d/openvz/src/block/cfq-iosched.c +--- ./block/cfq-iosched.c 2012-06-12 16:25:11.682312929 +0100 ++++ debian/binary-custom.d/openvz/src/block/cfq-iosched.c 2012-11-13 15:20:11.172569212 +0000 +@@ -11,6 +11,11 @@ + #include + #include + #include ++#include ++#include ++#include ++#include ++#include + + /* + * tunables +@@ -24,6 +29,7 @@ + static int cfq_slice_async = HZ / 25; + static const int cfq_slice_async_rq = 2; + static int cfq_slice_idle = HZ / 125; ++static int cfq_ub_slice = HZ / 2; + + /* + * grace period before allowing idle class to get disk access +@@ -40,13 +46,11 @@ + #define RQ_CIC(rq) ((struct cfq_io_context*)(rq)->elevator_private) + #define RQ_CFQQ(rq) ((rq)->elevator_private2) + +-static struct kmem_cache *cfq_pool; + static struct kmem_cache *cfq_ioc_pool; + + static DEFINE_PER_CPU(unsigned long, ioc_count); + static struct completion *ioc_gone; + +-#define CFQ_PRIO_LISTS IOPRIO_BE_NR + #define cfq_class_idle(cfqq) ((cfqq)->ioprio_class == IOPRIO_CLASS_IDLE) + #define cfq_class_rt(cfqq) ((cfqq)->ioprio_class == IOPRIO_CLASS_RT) + +@@ -55,107 +59,6 @@ + + #define sample_valid(samples) ((samples) > 80) + +-/* +- * Most of our rbtree usage is for sorting with min extraction, so +- * if we cache the leftmost node we don't have to walk down the tree +- * to find it. Idea borrowed from Ingo Molnars CFS scheduler. We should +- * move this into the elevator for the rq sorting as well. +- */ +-struct cfq_rb_root { +- struct rb_root rb; +- struct rb_node *left; +-}; +-#define CFQ_RB_ROOT (struct cfq_rb_root) { RB_ROOT, NULL, } +- +-/* +- * Per block device queue structure +- */ +-struct cfq_data { +- struct request_queue *queue; +- +- /* +- * rr list of queues with requests and the count of them +- */ +- struct cfq_rb_root service_tree; +- unsigned int busy_queues; +- +- int rq_in_driver; +- int sync_flight; +- int hw_tag; +- +- /* +- * idle window management +- */ +- struct timer_list idle_slice_timer; +- struct work_struct unplug_work; +- +- struct cfq_queue *active_queue; +- struct cfq_io_context *active_cic; +- +- /* +- * async queue for each priority case +- */ +- struct cfq_queue *async_cfqq[2][IOPRIO_BE_NR]; +- struct cfq_queue *async_idle_cfqq; +- +- struct timer_list idle_class_timer; +- +- sector_t last_position; +- unsigned long last_end_request; +- +- /* +- * tunables, see top of file +- */ +- unsigned int cfq_quantum; +- unsigned int cfq_fifo_expire[2]; +- unsigned int cfq_back_penalty; +- unsigned int cfq_back_max; +- unsigned int cfq_slice[2]; +- unsigned int cfq_slice_async_rq; +- unsigned int cfq_slice_idle; +- +- struct list_head cic_list; +-}; +- +-/* +- * Per process-grouping structure +- */ +-struct cfq_queue { +- /* reference count */ +- atomic_t ref; +- /* parent cfq_data */ +- struct cfq_data *cfqd; +- /* service_tree member */ +- struct rb_node rb_node; +- /* service_tree key */ +- unsigned long rb_key; +- /* sorted list of pending requests */ +- struct rb_root sort_list; +- /* if fifo isn't expired, next request to serve */ +- struct request *next_rq; +- /* requests queued in sort_list */ +- int queued[2]; +- /* currently allocated requests */ +- int allocated[2]; +- /* pending metadata requests */ +- int meta_pending; +- /* fifo list of requests in sort_list */ +- struct list_head fifo; +- +- unsigned long slice_end; +- long slice_resid; +- +- /* number of requests that are on the dispatch list or inside driver */ +- int dispatched; +- +- /* io prio of this group */ +- unsigned short ioprio, org_ioprio; +- unsigned short ioprio_class, org_ioprio_class; +- +- /* various state flags, see below */ +- unsigned int flags; +-}; +- + enum cfqq_state_flags { + CFQ_CFQQ_FLAG_on_rr = 0, /* on round-robin busy list */ + CFQ_CFQQ_FLAG_wait_request, /* waiting for a request */ +@@ -200,6 +103,67 @@ + static void cfq_dispatch_insert(struct request_queue *, struct request *); + static struct cfq_queue *cfq_get_queue(struct cfq_data *, int, + struct task_struct *, gfp_t); ++static void cfq_put_queue(struct cfq_queue *cfqq); ++ ++static void __cfq_put_async_queues(struct cfq_bc_data *cfq_bc) ++{ ++ int i; ++ ++ for (i = 0; i < CFQ_PRIO_LISTS; i++) { ++ if (cfq_bc->async_cfqq[0][i]) { ++ cfq_put_queue(cfq_bc->async_cfqq[0][i]); ++ cfq_bc->async_cfqq[0][i] = NULL; ++ } ++ if (cfq_bc->async_cfqq[1][i]) { ++ cfq_put_queue(cfq_bc->async_cfqq[1][i]); ++ cfq_bc->async_cfqq[1][i] = NULL; ++ } ++ } ++ if (cfq_bc->async_idle_cfqq) { ++ cfq_put_queue(cfq_bc->async_idle_cfqq); ++ cfq_bc->async_idle_cfqq = NULL; ++ } ++} ++ ++#ifdef CONFIG_BC_IO_SCHED ++static inline struct ub_iopriv *cfqq_ub_iopriv(struct cfq_data *cfqd, int sync) ++{ ++ int mode; ++ ++ mode = sync ? cfqd->virt_mode : cfqd->write_virt_mode; ++ return mode ? &get_io_ub()->iopriv : &get_ub0()->iopriv; ++} ++ ++static inline void cfq_put_async_queues(struct cfq_data *cfqd) ++{ ++ struct user_beancounter *ub; ++ struct cfq_bc_data *cfq_bc; ++ ++ rcu_read_lock(); ++ for_each_beancounter(ub) { ++ write_lock(&ub->iopriv.cfq_bc_list_lock); ++ cfq_bc = __find_cfq_bc(&ub->iopriv, cfqd); ++ if (!cfq_bc) { ++ write_unlock(&ub->iopriv.cfq_bc_list_lock); ++ continue; ++ } ++ __cfq_put_async_queues(cfq_bc); ++ write_unlock(&ub->iopriv.cfq_bc_list_lock); ++ } ++ rcu_read_unlock(); ++} ++#else ++static inline struct ub_iopriv *cfqq_ub_iopriv(struct cfq_data *cfqd, int sync) ++{ ++ return NULL; ++} ++ ++static inline void cfq_put_async_queues(struct cfq_data *cfqd) ++{ ++ __cfq_put_async_queues(&cfqd->cfq_bc); ++} ++#endif ++ + static struct cfq_io_context *cfq_cic_rb_lookup(struct cfq_data *, + struct io_context *); + +@@ -286,6 +250,11 @@ + return 1; + } + ++static inline struct user_beancounter *ub_by_iopriv(struct ub_iopriv *iopriv) ++{ ++ return container_of(iopriv, struct user_beancounter, iopriv); ++} ++ + /* + * Lifted from AS - choose which of rq1 and rq2 that is best served now. + * We choose the request that is closest to the head right now. Distance +@@ -446,11 +415,15 @@ + static void cfq_service_tree_add(struct cfq_data *cfqd, + struct cfq_queue *cfqq, int add_front) + { +- struct rb_node **p = &cfqd->service_tree.rb.rb_node; ++ struct cfq_bc_data *cfq_bc; ++ struct rb_node **p; + struct rb_node *parent = NULL; + unsigned long rb_key; + int left; + ++ cfq_bc = cfqq->cfq_bc; ++ ++ p = &cfq_bc->service_tree.rb.rb_node; + if (!add_front) { + rb_key = cfq_slice_offset(cfqd, cfqq) + jiffies; + rb_key += cfqq->slice_resid; +@@ -465,7 +438,7 @@ + if (rb_key == cfqq->rb_key) + return; + +- cfq_rb_erase(&cfqq->rb_node, &cfqd->service_tree); ++ cfq_rb_erase(&cfqq->rb_node, &cfq_bc->service_tree); + } + + left = 1; +@@ -501,11 +474,11 @@ + } + + if (left) +- cfqd->service_tree.left = &cfqq->rb_node; ++ cfq_bc->service_tree.left = &cfqq->rb_node; + + cfqq->rb_key = rb_key; + rb_link_node(&cfqq->rb_node, parent, p); +- rb_insert_color(&cfqq->rb_node, &cfqd->service_tree.rb); ++ rb_insert_color(&cfqq->rb_node, &cfq_bc->service_tree.rb); + } + + /* +@@ -530,6 +503,7 @@ + BUG_ON(cfq_cfqq_on_rr(cfqq)); + cfq_mark_cfqq_on_rr(cfqq); + cfqd->busy_queues++; ++ bc_inc_rqnum(cfqq); + + cfq_resort_rr_list(cfqd, cfqq); + } +@@ -541,14 +515,19 @@ + static inline void + cfq_del_cfqq_rr(struct cfq_data *cfqd, struct cfq_queue *cfqq) + { ++ struct cfq_bc_data *cfq_bc; ++ + BUG_ON(!cfq_cfqq_on_rr(cfqq)); + cfq_clear_cfqq_on_rr(cfqq); + ++ cfq_bc = cfqq->cfq_bc; ++ + if (!RB_EMPTY_NODE(&cfqq->rb_node)) +- cfq_rb_erase(&cfqq->rb_node, &cfqd->service_tree); ++ cfq_rb_erase(&cfqq->rb_node, &cfq_bc->service_tree); + + BUG_ON(!cfqd->busy_queues); + cfqd->busy_queues--; ++ bc_dec_rqnum(cfqq); + } + + /* +@@ -665,8 +644,7 @@ + } + } + +-static int cfq_merge(struct request_queue *q, struct request **req, +- struct bio *bio) ++static int cfq_merge(struct request_queue *q, struct request **req, struct bio *bio) + { + struct cfq_data *cfqd = q->elevator->elevator_data; + struct request *__rq; +@@ -795,7 +773,7 @@ + unsigned long now = jiffies; + + if (time_before(now, end) && +- time_after_eq(now, cfqd->last_end_request)) { ++ time_after_eq(now, cfqd->last_end_request)) { + mod_timer(&cfqd->idle_class_timer, end); + return 1; + } +@@ -809,13 +787,18 @@ + */ + static struct cfq_queue *cfq_get_next_queue(struct cfq_data *cfqd) + { ++ struct cfq_bc_data *cfq_bc; + struct cfq_queue *cfqq; + struct rb_node *n; + +- if (RB_EMPTY_ROOT(&cfqd->service_tree.rb)) ++ cfq_bc = cfqd->active_cfq_bc; ++ if (!cfq_bc) + return NULL; + +- n = cfq_rb_first(&cfqd->service_tree); ++ if (RB_EMPTY_ROOT(&cfq_bc->service_tree.rb)) ++ return NULL; ++ ++ n = cfq_rb_first(&cfq_bc->service_tree); + cfqq = rb_entry(n, struct cfq_queue, rb_node); + + if (cfq_class_idle(cfqq)) { +@@ -837,9 +820,17 @@ + */ + static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd) + { +- struct cfq_queue *cfqq; ++ struct cfq_queue *cfqq = NULL; ++ struct cfq_bc_data *cfq_bc; ++ ++ bc_schedule_active(cfqd); ++ ++ cfq_bc = cfqd->active_cfq_bc; ++ if (!cfq_bc) ++ goto out; + + cfqq = cfq_get_next_queue(cfqd); ++out: + __cfq_set_active_queue(cfqd, cfqq); + return cfqq; + } +@@ -930,6 +921,7 @@ + + cfq_remove_request(rq); + cfqq->dispatched++; ++ cfqq->cfq_bc->on_dispatch++; + elv_dispatch_sort(q, rq); + + if (cfq_cfqq_sync(cfqq)) +@@ -987,7 +979,7 @@ + /* + * The active queue has run out of time, expire it and select new. + */ +- if (cfq_slice_used(cfqq)) ++ if (cfq_slice_used(cfqq) || bc_expired(cfqd)) + goto expire; + + /* +@@ -1085,17 +1077,38 @@ + * Drain our current requests. Used for barriers and when switching + * io schedulers on-the-fly. + */ +-static int cfq_forced_dispatch(struct cfq_data *cfqd) ++static int __cfq_forced_dispatch(struct cfq_bc_data *cfq_bc) + { + int dispatched = 0; + struct rb_node *n; + +- while ((n = cfq_rb_first(&cfqd->service_tree)) != NULL) { ++ while ((n = cfq_rb_first(&cfq_bc->service_tree)) != NULL) { + struct cfq_queue *cfqq = rb_entry(n, struct cfq_queue, rb_node); + + dispatched += __cfq_forced_dispatch_cfqq(cfqq); + } + ++ return dispatched; ++} ++ ++static int cfq_forced_dispatch(struct cfq_data *cfqd) ++{ ++ struct rb_node *node; ++ struct cfq_bc_data *cfq_bc; ++ int dispatched; ++ ++ dispatched = 0; ++ /* ++ * We use here _safe iterating, because ++ * __cfq_forced_dispatch() remove bc from tree implicitly ++ */ ++ node = rb_first(&cfqd->cfq_bc_queue); ++ while (node) { ++ cfq_bc = rb_entry(node, struct cfq_bc_data, cfq_bc_node); ++ node = rb_next(node); ++ dispatched += __cfq_forced_dispatch(cfq_bc); ++ } ++ + cfq_slice_expired(cfqd, 0); + + BUG_ON(cfqd->busy_queues); +@@ -1208,6 +1221,10 @@ + smp_wmb(); + cic->key = NULL; + ++ /* ++ * cic->cfqq[ASYNC] is always NULL and the put of async queues ++ * happens on appropriate bc death or device unplug ++ */ + if (cic->cfqq[ASYNC]) { + cfq_exit_cfqq(cfqd, cic->cfqq[ASYNC]); + cic->cfqq[ASYNC] = NULL; +@@ -1327,6 +1344,10 @@ + + spin_lock_irqsave(cfqd->queue->queue_lock, flags); + ++ /* ++ * cic->cfqq[ASYNC] is always NULL, ioprio change ++ * for async queues happens automatically ++ */ + cfqq = cic->cfqq[ASYNC]; + if (cfqq) { + struct cfq_queue *new_cfqq; +@@ -1367,8 +1388,11 @@ + { + struct cfq_queue *cfqq, *new_cfqq = NULL; + struct cfq_io_context *cic; ++ struct ub_iopriv *iopriv; ++ struct cfq_bc_data *cfq_bc = NULL; + + retry: ++ iopriv = cfqq_ub_iopriv(cfqd, is_sync); + cic = cfq_cic_rb_lookup(cfqd, tsk->io_context); + /* cic always exists here */ + cfqq = cic_to_cfqq(cic, is_sync); +@@ -1386,18 +1410,32 @@ + */ + spin_unlock_irq(cfqd->queue->queue_lock); + new_cfqq = kmem_cache_alloc_node(cfq_pool, +- gfp_mask | __GFP_NOFAIL | __GFP_ZERO, ++ gfp_mask|__GFP_NOFAIL|__GFP_ZERO, + cfqd->queue->node); ++ if (new_cfqq) { ++ cfq_bc = bc_findcreate_cfq_bc(iopriv, ++ cfqd, gfp_mask); ++ if (!cfq_bc) { ++ kmem_cache_free(cfq_pool, new_cfqq); ++ new_cfqq = NULL; ++ } ++ } + spin_lock_irq(cfqd->queue->queue_lock); + goto retry; + } else { + cfqq = kmem_cache_alloc_node(cfq_pool, +- gfp_mask | __GFP_ZERO, +- cfqd->queue->node); ++ gfp_mask|__GFP_ZERO, cfqd->queue->node); + if (!cfqq) + goto out; ++ cfq_bc = bc_findcreate_cfq_bc(iopriv, cfqd, gfp_mask); ++ if (!cfq_bc) { ++ kmem_cache_free(cfq_pool, cfqq); ++ cfqq = NULL; ++ goto out; ++ } + } + ++ cfqq->cfq_bc = cfq_bc; + RB_CLEAR_NODE(&cfqq->rb_node); + INIT_LIST_HEAD(&cfqq->fifo); + +@@ -1424,15 +1462,15 @@ + } + + static struct cfq_queue ** +-cfq_async_queue_prio(struct cfq_data *cfqd, int ioprio_class, int ioprio) ++cfq_async_queue_prio(struct cfq_bc_data *cfq_bc, int ioprio_class, int ioprio) + { + switch(ioprio_class) { + case IOPRIO_CLASS_RT: +- return &cfqd->async_cfqq[0][ioprio]; ++ return &cfq_bc->async_cfqq[0][ioprio]; + case IOPRIO_CLASS_BE: +- return &cfqd->async_cfqq[1][ioprio]; ++ return &cfq_bc->async_cfqq[1][ioprio]; + case IOPRIO_CLASS_IDLE: +- return &cfqd->async_idle_cfqq; ++ return &cfq_bc->async_idle_cfqq; + default: + BUG(); + } +@@ -1446,12 +1484,18 @@ + const int ioprio_class = task_ioprio_class(tsk); + struct cfq_queue **async_cfqq = NULL; + struct cfq_queue *cfqq = NULL; ++ struct cfq_bc_data *cfq_bc; ++ struct ub_iopriv *iopriv; ++ ++ iopriv = cfqq_ub_iopriv(cfqd, is_sync); + + if (!is_sync) { +- async_cfqq = cfq_async_queue_prio(cfqd, ioprio_class, ioprio); ++ cfq_bc = bc_findcreate_cfq_bc(iopriv, cfqd, gfp_mask); ++ if (!cfq_bc) ++ return NULL; ++ async_cfqq = cfq_async_queue_prio(cfq_bc, ioprio_class, ioprio); + cfqq = *async_cfqq; + } +- + if (!cfqq) { + cfqq = cfq_find_alloc_queue(cfqd, is_sync, tsk, gfp_mask); + if (!cfqq) +@@ -1815,6 +1859,7 @@ + WARN_ON(!cfqq->dispatched); + cfqd->rq_in_driver--; + cfqq->dispatched--; ++ cfqq->cfq_bc->on_dispatch--; + + if (cfq_cfqq_sync(cfqq)) + cfqd->sync_flight--; +@@ -1927,6 +1972,7 @@ + rq->elevator_private = NULL; + rq->elevator_private2 = NULL; + ++ put_beancounter(ub_by_iopriv(cfqq->cfq_bc->ub_iopriv)); + cfq_put_queue(cfqq); + } + } +@@ -1944,14 +1990,19 @@ + const int is_sync = rq_is_sync(rq); + struct cfq_queue *cfqq; + unsigned long flags; ++ struct ub_iopriv *iopriv; ++ struct cfq_bc_data *cfq_bc = NULL; + + might_sleep_if(gfp_mask & __GFP_WAIT); + + cic = cfq_get_io_context(cfqd, gfp_mask); ++ iopriv = cfqq_ub_iopriv(cfqd, is_sync); ++ if (!is_sync) ++ cfq_bc = bc_findcreate_cfq_bc(iopriv, cfqd, gfp_mask); + + spin_lock_irqsave(q->queue_lock, flags); + +- if (!cic) ++ if (!cic || (!is_sync && cfq_bc == NULL)) + goto queue_fail; + + cfqq = cic_to_cfqq(cic, is_sync); +@@ -1972,6 +2023,7 @@ + + rq->elevator_private = cic; + rq->elevator_private2 = cfqq; ++ get_beancounter(ub_by_iopriv(cfqq->cfq_bc->ub_iopriv)); + return 0; + + queue_fail: +@@ -2065,21 +2117,6 @@ + kblockd_flush_work(&cfqd->unplug_work); + } + +-static void cfq_put_async_queues(struct cfq_data *cfqd) +-{ +- int i; +- +- for (i = 0; i < IOPRIO_BE_NR; i++) { +- if (cfqd->async_cfqq[0][i]) +- cfq_put_queue(cfqd->async_cfqq[0][i]); +- if (cfqd->async_cfqq[1][i]) +- cfq_put_queue(cfqd->async_cfqq[1][i]); +- } +- +- if (cfqd->async_idle_cfqq) +- cfq_put_queue(cfqd->async_idle_cfqq); +-} +- + static void cfq_exit_queue(elevator_t *e) + { + struct cfq_data *cfqd = e->elevator_data; +@@ -2106,6 +2143,8 @@ + + cfq_shutdown_timer_wq(cfqd); + ++ bc_cfq_exit_queue(cfqd); ++ + kfree(cfqd); + } + +@@ -2113,11 +2152,19 @@ + { + struct cfq_data *cfqd; + +- cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL | __GFP_ZERO, q->node); ++ cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL|__GFP_ZERO, q->node); + if (!cfqd) + return NULL; + +- cfqd->service_tree = CFQ_RB_ROOT; ++ cfqd->cfq_bc_queue = RB_ROOT; ++#ifndef CONFIG_BC_IO_SCHED ++ cfq_init_cfq_bc(&cfqd->cfq_bc); ++ /* ++ * Adding ub0 to active list in order to serve force dispatching ++ * case uniformally. Note, that nobody removes ub0 from this list. ++ */ ++ list_add_tail(&cfqd->cfq_bc.act_cfq_bc_list, &cfqd->act_cfq_bc_head); ++#endif + INIT_LIST_HEAD(&cfqd->cic_list); + + cfqd->queue = q; +@@ -2142,6 +2189,9 @@ + cfqd->cfq_slice[1] = cfq_slice_sync; + cfqd->cfq_slice_async_rq = cfq_slice_async_rq; + cfqd->cfq_slice_idle = cfq_slice_idle; ++ cfqd->cfq_ub_slice = cfq_ub_slice; ++ cfqd->virt_mode = 1; ++ cfqd->write_virt_mode = 1; + + return cfqd; + } +@@ -2206,6 +2256,9 @@ + SHOW_FUNCTION(cfq_slice_sync_show, cfqd->cfq_slice[1], 1); + SHOW_FUNCTION(cfq_slice_async_show, cfqd->cfq_slice[0], 1); + SHOW_FUNCTION(cfq_slice_async_rq_show, cfqd->cfq_slice_async_rq, 0); ++SHOW_FUNCTION(cfq_ub_slice_show, cfqd->cfq_ub_slice, 1); ++SHOW_FUNCTION(cfq_virt_mode_show, cfqd->virt_mode, 0); ++SHOW_FUNCTION(cfq_write_virt_mode_show, cfqd->write_virt_mode, 0); + #undef SHOW_FUNCTION + + #define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \ +@@ -2233,7 +2286,9 @@ + STORE_FUNCTION(cfq_slice_sync_store, &cfqd->cfq_slice[1], 1, UINT_MAX, 1); + STORE_FUNCTION(cfq_slice_async_store, &cfqd->cfq_slice[0], 1, UINT_MAX, 1); + STORE_FUNCTION(cfq_slice_async_rq_store, &cfqd->cfq_slice_async_rq, 1, UINT_MAX, 0); +-#undef STORE_FUNCTION ++STORE_FUNCTION(cfq_ub_slice_store, &cfqd->cfq_ub_slice, 1, UINT_MAX, 1); ++STORE_FUNCTION(cfq_virt_mode_store, &cfqd->virt_mode, 0, 1, 0); ++STORE_FUNCTION(cfq_write_virt_mode_store, &cfqd->write_virt_mode, 0, 1, 0); + + #define CFQ_ATTR(name) \ + __ATTR(name, S_IRUGO|S_IWUSR, cfq_##name##_show, cfq_##name##_store) +@@ -2248,6 +2303,9 @@ + CFQ_ATTR(slice_async), + CFQ_ATTR(slice_async_rq), + CFQ_ATTR(slice_idle), ++ CFQ_ATTR(ub_slice), ++ CFQ_ATTR(virt_mode), ++ CFQ_ATTR(write_virt_mode), + __ATTR_NULL + }; + +@@ -2271,6 +2329,7 @@ + .elevator_init_fn = cfq_init_queue, + .elevator_exit_fn = cfq_exit_queue, + .trim = cfq_free_io_context, ++ .put_queue = cfq_put_queue, + }, + .elevator_attrs = cfq_attrs, + .elevator_name = "cfq", +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./block/elevator.c debian/binary-custom.d/openvz/src/block/elevator.c +--- ./block/elevator.c 2012-06-12 16:25:11.686312929 +0100 ++++ debian/binary-custom.d/openvz/src/block/elevator.c 2012-11-13 15:20:11.172569212 +0000 +@@ -40,6 +40,9 @@ + static DEFINE_SPINLOCK(elv_list_lock); + static LIST_HEAD(elv_list); + ++struct kmem_cache *cfq_pool; ++EXPORT_SYMBOL_GPL(cfq_pool); ++ + /* + * Merge hash stuff. + */ +@@ -987,12 +990,12 @@ + */ + if (e->ops.trim) { + read_lock(&tasklist_lock); +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + task_lock(p); + if (p->io_context) + e->ops.trim(p->io_context); + task_unlock(p); +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + read_unlock(&tasklist_lock); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./block/genhd.c debian/binary-custom.d/openvz/src/block/genhd.c +--- ./block/genhd.c 2012-06-12 16:25:11.686312929 +0100 ++++ debian/binary-custom.d/openvz/src/block/genhd.c 2012-11-13 15:20:11.172569212 +0000 +@@ -18,6 +18,7 @@ + #include + + struct kset block_subsys; ++EXPORT_SYMBOL(block_subsys); + static DEFINE_MUTEX(block_subsys_lock); + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/base/class.c debian/binary-custom.d/openvz/src/drivers/base/class.c +--- ./drivers/base/class.c 2012-06-12 16:25:21.570312582 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/base/class.c 2012-11-13 15:20:11.296569212 +0000 +@@ -17,6 +17,8 @@ + #include + #include + #include ++#include ++#include + #include "base.h" + + #define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr) +@@ -71,8 +73,13 @@ + }; + + /* Hotplug events for classes go to the class_obj subsys */ +-static decl_subsys(class, &class_ktype, NULL); ++decl_subsys(class, &class_ktype, NULL); + ++#ifndef CONFIG_VE ++#define visible_class_subsys class_subsys ++#else ++#define visible_class_subsys (*get_exec_env()->class_subsys) ++#endif + + int class_create_file(struct class * cls, const struct class_attribute * attr) + { +@@ -149,7 +156,7 @@ + if (error) + return error; + +- cls->subsys.kobj.kset = &class_subsys; ++ cls->subsys.kobj.kset = &visible_class_subsys; + + error = subsystem_register(&cls->subsys); + if (!error) { +@@ -452,8 +459,13 @@ + .uevent = class_uevent, + }; + +-static decl_subsys(class_obj, &class_device_ktype, &class_uevent_ops); ++decl_subsys(class_obj, &class_device_ktype, &class_uevent_ops); + ++#ifndef CONFIG_VE ++#define visible_class_obj_subsys class_obj_subsys ++#else ++#define visible_class_obj_subsys (*get_exec_env()->class_obj_subsys) ++#endif + + static int class_device_add_attrs(struct class_device * cd) + { +@@ -537,7 +549,7 @@ + + void class_device_initialize(struct class_device *class_dev) + { +- kobj_set_kset_s(class_dev, class_obj_subsys); ++ kobj_set_kset_s(class_dev, visible_class_obj_subsys); + kobject_init(&class_dev->kobj); + INIT_LIST_HEAD(&class_dev->node); + } +@@ -851,10 +863,19 @@ + class_put(parent); + } + ++void prepare_sysfs_classes(void) ++{ ++#ifdef CONFIG_VE ++ get_ve0()->class_subsys = &class_subsys; ++ get_ve0()->class_obj_subsys = &class_obj_subsys; ++#endif ++} ++ + int __init classes_init(void) + { + int retval; + ++ prepare_sysfs_classes(); + retval = subsystem_register(&class_subsys); + if (retval) + return retval; +@@ -890,3 +911,6 @@ + + EXPORT_SYMBOL_GPL(class_interface_register); + EXPORT_SYMBOL_GPL(class_interface_unregister); ++ ++EXPORT_SYMBOL(class_subsys); ++EXPORT_SYMBOL(class_obj_subsys); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/base/core.c debian/binary-custom.d/openvz/src/drivers/base/core.c +--- ./drivers/base/core.c 2012-06-12 16:25:21.570312582 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/base/core.c 2012-11-13 15:20:11.296569212 +0000 +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -406,7 +407,12 @@ + */ + + decl_subsys(devices, &device_ktype, &device_uevent_ops); +- ++EXPORT_SYMBOL_GPL(devices_subsys); ++#ifdef CONFIG_VE ++#define ve_devices_subsys (get_exec_env()->devices_subsys) ++#else ++#define ve_devices_subsys (&devices_subsys) ++#endif + + /** + * device_create_file - create sysfs attribute file for device. +@@ -525,7 +531,7 @@ + + void device_initialize(struct device *dev) + { +- kobj_set_kset_s(dev, devices_subsys); ++ dev->kobj.kset = ve_devices_subsys; + kobject_init(&dev->kobj); + klist_init(&dev->klist_children, klist_children_get, + klist_children_put); +@@ -556,12 +562,17 @@ + return NULL; + } + #else ++#ifdef CONFIG_VE ++#include ++#define virtual_dir (get_exec_env()->_virtual_dir) ++#else ++static struct kobject *virtual_dir = NULL; ++#endif ++ + static struct kobject *virtual_device_parent(struct device *dev) + { +- static struct kobject *virtual_dir = NULL; +- + if (!virtual_dir) +- virtual_dir = kobject_add_dir(&devices_subsys.kobj, "virtual"); ++ virtual_dir = kobject_add_dir(&get_exec_env()->devices_subsys->kobj, "virtual"); + + return virtual_dir; + } +@@ -1073,6 +1084,9 @@ + + int __init devices_init(void) + { ++#ifdef CONFIG_VE ++ ve0.devices_subsys = &devices_subsys; ++#endif + return subsystem_register(&devices_subsys); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/char/pty.c debian/binary-custom.d/openvz/src/drivers/char/pty.c +--- ./drivers/char/pty.c 2012-06-12 16:25:21.678312578 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/char/pty.c 2012-11-13 15:20:11.572569199 +0000 +@@ -29,16 +29,30 @@ + #include + #include + ++#include ++ + /* These are global because they are accessed in tty_io.c */ + #ifdef CONFIG_UNIX98_PTYS + struct tty_driver *ptm_driver; +-static struct tty_driver *pts_driver; ++struct tty_driver *pts_driver; ++EXPORT_SYMBOL(ptm_driver); ++EXPORT_SYMBOL(pts_driver); ++ ++void prepare_pty(void) ++{ ++#ifdef CONFIG_VE ++ get_ve0()->ptm_driver = ptm_driver; ++ /* don't clean ptm_driver and co. here, they are used in vecalls.c */ ++#endif ++} + #endif + + static void pty_close(struct tty_struct * tty, struct file * filp) + { + if (!tty) + return; ++ ++ ub_pty_uncharge(tty); + if (tty->driver->subtype == PTY_TYPE_MASTER) { + if (tty->count > 1) + printk("master pty_close: count = %d!!\n", tty->count); +@@ -58,8 +72,12 @@ + if (tty->driver->subtype == PTY_TYPE_MASTER) { + set_bit(TTY_OTHER_CLOSED, &tty->flags); + #ifdef CONFIG_UNIX98_PTYS +- if (tty->driver == ptm_driver) ++ if (tty->driver->flags & TTY_DRIVER_DEVPTS_MEM) { ++ struct ve_struct *old_env; ++ old_env = set_exec_env(tty->owner_env); + devpts_pty_kill(tty->index); ++ (void)set_exec_env(old_env); ++ } + #endif + tty_vhangup(tty->link); + } +@@ -209,6 +227,10 @@ + if (tty->link->count != 1) + goto out; + ++ retval = -ENOMEM; ++ if (ub_pty_charge(tty)) ++ goto out; ++ + clear_bit(TTY_OTHER_CLOSED, &tty->link->flags); + set_bit(TTY_THROTTLED, &tty->flags); + set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); +@@ -236,7 +258,9 @@ + + /* Traditional BSD devices */ + #ifdef CONFIG_LEGACY_PTYS +-static struct tty_driver *pty_driver, *pty_slave_driver; ++struct tty_driver *pty_driver, *pty_slave_driver; ++EXPORT_SYMBOL(pty_driver); ++EXPORT_SYMBOL(pty_slave_driver); + + static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file, + unsigned int cmd, unsigned long arg) +@@ -426,6 +450,7 @@ + + pty_table[1].data = &ptm_driver->refcount; + register_sysctl_table(pty_root_table); ++ prepare_pty(); + } + #else + static inline void unix98_pty_init(void) { } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/char/sysrq.c debian/binary-custom.d/openvz/src/drivers/char/sysrq.c +--- ./drivers/char/sysrq.c 2012-06-12 16:25:21.702312577 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/char/sysrq.c 2012-11-13 15:20:11.616569201 +0000 +@@ -36,6 +36,8 @@ + #include + #include + #include ++#include ++#include + #include + + #include +@@ -199,8 +201,14 @@ + static void sysrq_handle_showregs(int key, struct tty_struct *tty) + { + struct pt_regs *regs = get_irq_regs(); ++ ++ bust_spinlocks(1); + if (regs) + show_regs(regs); ++ bust_spinlocks(0); ++#if defined(__i386__) || defined(__x86_64__) ++ smp_nmi_call_function(smp_show_regs, NULL, 1); ++#endif + } + static struct sysrq_key_op sysrq_showregs_op = { + .handler = sysrq_handle_showregs, +@@ -235,6 +243,7 @@ + static void sysrq_handle_showmem(int key, struct tty_struct *tty) + { + show_mem(); ++ show_slab_info(); + } + static struct sysrq_key_op sysrq_showmem_op = { + .handler = sysrq_handle_showmem, +@@ -250,7 +259,7 @@ + { + struct task_struct *p; + +- for_each_process(p) { ++ for_each_process_all(p) { + if (p->mm && !is_global_init(p)) + /* Not swapper, init nor kernel thread */ + force_sig(sig, p); +@@ -313,7 +322,267 @@ + /* Key Operations table and lock */ + static DEFINE_SPINLOCK(sysrq_key_table_lock); + +-static struct sysrq_key_op *sysrq_key_table[36] = { ++#define SYSRQ_KEY_TABLE_LENGTH 37 ++static struct sysrq_key_op **sysrq_key_table; ++static struct sysrq_key_op *sysrq_default_key_table[]; ++ ++#ifdef CONFIG_SYSRQ_DEBUG ++#define SYSRQ_NAMELEN_MAX 64 ++#define SYSRQ_DUMP_LINES 32 ++ ++static struct sysrq_key_op *sysrq_debug_key_table[]; ++static struct sysrq_key_op *sysrq_input_key_table[]; ++static unsigned long *dump_address; ++static int orig_console_loglevel; ++static void (*sysrq_input_return)(char *) = NULL; ++ ++static void dump_mem(void) ++{ ++ unsigned long value[4]; ++ mm_segment_t old_fs; ++ int line, err; ++ ++ old_fs = get_fs(); ++ set_fs(KERNEL_DS); ++ err = 0; ++ ++ for (line = 0; line < SYSRQ_DUMP_LINES; line++) { ++ err |= __get_user(value[0], dump_address++); ++ err |= __get_user(value[1], dump_address++); ++ err |= __get_user(value[2], dump_address++); ++ err |= __get_user(value[3], dump_address++); ++ if (err) { ++ printk("Invalid address %p\n", dump_address - 4); ++ break; ++ } ++#if BITS_PER_LONG == 32 ++ printk("0x%p: %08lx %08lx %08lx %08lx\n", ++ dump_address - 4, ++ value[0], value[1], value[2], value[3]); ++#else ++ printk("0x%p: %016lx %016lx %016lx %016lx\n", ++ dump_address - 4, ++ value[0], value[1], value[2], value[3]); ++#endif ++ } ++ set_fs(old_fs); ++} ++ ++static void write_mem(unsigned long val) ++{ ++ mm_segment_t old_fs; ++ unsigned long old_val; ++ ++ old_fs = get_fs(); ++ set_fs(KERNEL_DS); ++ if (__get_user(old_val, dump_address)) { ++ printk("Invalid address %p\n", dump_address); ++ goto out; ++ } ++ ++#if BITS_PER_LONG == 32 ++ printk("Changing [%p] from %08lx to %08lx\n", ++ dump_address, old_val, val); ++#else ++ printk("Changing [%p] from %016lx to %016lx\n", ++ dump_address, old_val, val); ++#endif ++ __put_user(val, dump_address); ++out: ++ set_fs(old_fs); ++} ++ ++static void handle_read(int key, struct tty_struct *tty) ++{ ++ static int pos; ++ static int upper_case; ++ static char str[SYSRQ_NAMELEN_MAX]; ++ ++ if (key == 0) { ++ /* actually 0 is not shift only... */ ++ upper_case = 1; ++ return; ++ } ++ ++ if (key == 0x0d || pos == SYSRQ_NAMELEN_MAX - 1) { ++ /* enter */ ++ sysrq_key_table = sysrq_debug_key_table; ++ str[pos] = '\0'; ++ pos = upper_case = 0; ++ printk("\n"); ++ if (sysrq_input_return == NULL) ++ printk("No return handler!!!\n"); ++ else ++ sysrq_input_return(str); ++ return; ++ }; ++ ++ /* check for alowed symbols */ ++ if (key == '-') { ++ if (upper_case) ++ key = '_'; ++ goto correct; ++ }; ++ if (key >= 'a' && key <= 'z') { ++ if (upper_case) ++ key = key - 'a' + 'A'; ++ goto correct; ++ }; ++ if (key >= '0' && key <= '9') ++ goto correct; ++ ++ upper_case = 0; ++ return; ++ ++correct: ++ str[pos] = key; ++ printk("%c", (char)key); ++ pos++; ++ upper_case = 0; ++} ++ ++static struct sysrq_key_op input_read = { ++ .handler = handle_read, ++ .help_msg = "", ++ .action_msg = NULL, ++}; ++ ++static struct sysrq_key_op *sysrq_input_key_table[SYSRQ_KEY_TABLE_LENGTH] = { ++ [0 ... SYSRQ_KEY_TABLE_LENGTH - 1] = &input_read, ++}; ++ ++static void return_dump_mem(char *str) ++{ ++ unsigned long address; ++ char *end; ++ ++ address = simple_strtoul(str, &end, 0); ++ if (*end != '\0') { ++ printk("Bad address [%s]\n", str); ++ return; ++ } ++ ++ dump_address = (unsigned long *)address; ++ dump_mem(); ++} ++ ++static void handle_dump_mem(int key, struct tty_struct *tty) ++{ ++ sysrq_input_return = return_dump_mem; ++ sysrq_key_table = sysrq_input_key_table; ++} ++ ++static struct sysrq_key_op debug_dump_mem = { ++ .handler = handle_dump_mem, ++ .help_msg = "Dump", ++ .action_msg = "Enter address:", ++}; ++ ++static void return_resolve(char *str) ++{ ++ unsigned long address; ++ ++ address = kallsyms_lookup_name(str); ++ printk("%s : %lx\n", str, address); ++ if (address) { ++ dump_address = (unsigned long *)address; ++ printk("Now you can dump it via X\n"); ++ } ++} ++ ++static void handle_resolve(int key, struct tty_struct *tty) ++{ ++ sysrq_input_return = return_resolve; ++ sysrq_key_table = sysrq_input_key_table; ++} ++ ++static struct sysrq_key_op debug_resolve = { ++ .handler = handle_resolve, ++ .help_msg = "Resolve", ++ .action_msg = "Enter symbol name:", ++}; ++ ++static void return_write_mem(char *str) ++{ ++ unsigned long address; ++ unsigned long value; ++ char *end; ++ ++ address = simple_strtoul(str, &end, 0); ++ if (*end != '-') { ++ printk("Bad address in %s\n", str); ++ return; ++ } ++ value = simple_strtoul(end + 1, &end, 0); ++ if (*end != '\0') { ++ printk("Bad value in %s\n", str); ++ return; ++ } ++ ++ dump_address = (unsigned long *)address; ++ write_mem(value); ++} ++ ++static void handle_write_mem(int key, struct tty_struct *tty) ++{ ++ sysrq_input_return = return_write_mem; ++ sysrq_key_table = sysrq_input_key_table; ++} ++ ++static struct sysrq_key_op debug_write_mem = { ++ .handler = handle_write_mem, ++ .help_msg = "Writemem", ++ .action_msg = "Enter address-value:", ++}; ++ ++static void handle_next(int key, struct tty_struct *tty) ++{ ++ dump_mem(); ++} ++ ++static struct sysrq_key_op debug_next = { ++ .handler = handle_next, ++ .help_msg = "neXt", ++ .action_msg = "continuing", ++}; ++ ++static void handle_quit(int key, struct tty_struct *tty) ++{ ++ sysrq_key_table = sysrq_default_key_table; ++ console_loglevel = orig_console_loglevel; ++} ++ ++static struct sysrq_key_op debug_quit = { ++ .handler = handle_quit, ++ .help_msg = "Quit", ++ .action_msg = "Tnahk you for using debugger", ++}; ++ ++static struct sysrq_key_op *sysrq_debug_key_table[SYSRQ_KEY_TABLE_LENGTH] = { ++ [13] = &debug_dump_mem, /* d */ ++ [26] = &debug_quit, /* q */ ++ [27] = &debug_resolve, /* r */ ++ [32] = &debug_write_mem, /* w */ ++ [33] = &debug_next, /* x */ ++}; ++ ++static void sysrq_handle_debug(int key, struct tty_struct *tty) ++{ ++ orig_console_loglevel = console_loglevel; ++ console_loglevel = 8; ++ sysrq_key_table = sysrq_debug_key_table; ++ printk("Welcome sysrq debugging mode\n" ++ "Press H for help\n"); ++} ++ ++static struct sysrq_key_op sysrq_debug_op = { ++ .handler = sysrq_handle_debug, ++ .help_msg = "debuG", ++ .action_msg = "Select desired action", ++}; ++#endif ++ ++static struct sysrq_key_op *sysrq_default_key_table[SYSRQ_KEY_TABLE_LENGTH] = { + &sysrq_loglevel_op, /* 0 */ + &sysrq_loglevel_op, /* 1 */ + &sysrq_loglevel_op, /* 2 */ +@@ -336,7 +605,11 @@ + &sysrq_term_op, /* e */ + &sysrq_moom_op, /* f */ + /* g: May be registered by ppc for kgdb */ ++#ifdef CONFIG_SYSRQ_DEBUG ++ &sysrq_debug_op, /* g */ ++#else + NULL, /* g */ ++#endif + NULL, /* h */ + &sysrq_kill_op, /* i */ + NULL, /* j */ +@@ -358,9 +631,12 @@ + /* x: May be registered on ppc/powerpc for xmon */ + NULL, /* x */ + NULL, /* y */ +- NULL /* z */ ++ NULL, /* z */ ++ NULL, /* for debugger */ + }; + ++static struct sysrq_key_op **sysrq_key_table = sysrq_default_key_table; ++ + /* key2index calculation, -1 on invalid index */ + static int sysrq_key_table_key2index(int key) + { +@@ -370,6 +646,10 @@ + retval = key - '0'; + else if ((key >= 'a') && (key <= 'z')) + retval = key + 10 - 'a'; ++#ifdef CONFIG_SYSRQ_DEBUG ++ else if (key == 0 || key == 0x0d || key == '-') ++ retval = SYSRQ_KEY_TABLE_LENGTH - 1; ++#endif + else + retval = -1; + return retval; +@@ -411,7 +691,6 @@ + spin_lock_irqsave(&sysrq_key_table_lock, flags); + orig_log_level = console_loglevel; + console_loglevel = 7; +- printk(KERN_INFO "SysRq : "); + + op_p = __sysrq_get_key_op(key); + if (op_p) { +@@ -420,16 +699,17 @@ + * should not) and is the invoked operation enabled? + */ + if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { +- printk("%s\n", op_p->action_msg); ++ if (op_p->action_msg) ++ printk("%s\n", op_p->action_msg); + console_loglevel = orig_log_level; + op_p->handler(key, tty); + } else { + printk("This sysrq operation is disabled.\n"); + } + } else { +- printk("HELP : "); ++ printk("SysRq HELP : "); + /* Only print the help msg once per handler */ +- for (i = 0; i < ARRAY_SIZE(sysrq_key_table); i++) { ++ for (i = 0; i < SYSRQ_KEY_TABLE_LENGTH; i++) { + if (sysrq_key_table[i]) { + int j; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/char/tty_io.c debian/binary-custom.d/openvz/src/drivers/char/tty_io.c +--- ./drivers/char/tty_io.c 2012-06-12 16:25:21.706312577 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/char/tty_io.c 2012-11-13 15:20:11.620569201 +0000 +@@ -94,6 +94,8 @@ + #include + #include + #include ++#include ++#include + #include + + #include +@@ -105,6 +107,7 @@ + + #include + #include ++#include + + #undef TTY_DEBUG_HANGUP + +@@ -129,6 +132,7 @@ + into this file */ + + LIST_HEAD(tty_drivers); /* linked list of tty drivers */ ++EXPORT_SYMBOL(tty_drivers); + + /* Mutex to protect creating and releasing a tty. This is shared with + vt.c for deeply disgusting hack reasons */ +@@ -139,6 +143,15 @@ + extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */ + extern int pty_limit; /* Config limit on Unix98 ptys */ + static DEFINE_IDR(allocated_ptys); ++#ifdef CONFIG_VE ++#define __ve_allocated_ptys(ve) (*((ve)->allocated_ptys)) ++#define ve_allocated_ptys __ve_allocated_ptys(get_exec_env()) ++#define ve_ptm_driver (get_exec_env()->ptm_driver) ++#else ++#define __ve_allocated_ptys(ve) allocated_ptys ++#define ve_allocated_ptys allocated_ptys ++#define ve_ptm_driver ptm_driver ++#endif + static DECLARE_MUTEX(allocated_ptys_lock); + static int ptmx_open(struct inode *, struct file *); + #endif +@@ -173,9 +186,20 @@ + * Locking: none + */ + ++void prepare_tty(void) ++{ ++#ifdef CONFIG_VE ++ get_ve0()->allocated_ptys = &allocated_ptys; ++ /* ++ * in this case, tty_register_driver() setups ++ * owner_env correctly right from the bootup ++ */ ++#endif ++} ++ + static struct tty_struct *alloc_tty_struct(void) + { +- return kzalloc(sizeof(struct tty_struct), GFP_KERNEL); ++ return kzalloc(sizeof(struct tty_struct), GFP_KERNEL_UBC); + } + + static void tty_buffer_free_all(struct tty_struct *); +@@ -1149,9 +1173,29 @@ + if (device < base || device >= base + p->num) + continue; + *index = device - base; +- return p; ++#ifdef CONFIG_VE ++ if (in_interrupt()) ++ goto found; ++ if (p->major!=PTY_MASTER_MAJOR && p->major!=PTY_SLAVE_MAJOR ++#ifdef CONFIG_UNIX98_PTYS ++ && (p->majormajor>UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT-1) && ++ (p->majormajor>UNIX98_PTY_SLAVE_MAJOR+UNIX98_PTY_MAJOR_COUNT-1) ++#endif ++ ) ++ goto found; ++ if (ve_is_super(p->owner_env) && ve_is_super(get_exec_env())) ++ goto found; ++ if (!ve_accessible_strict(p->owner_env, get_exec_env())) ++ continue; ++#endif ++ goto found; + } + return NULL; ++ ++found: ++ return p; + } + + /** +@@ -2000,13 +2044,21 @@ + */ + + static int init_dev(struct tty_driver *driver, int idx, +- struct tty_struct **ret_tty) ++ struct tty_struct *i_tty, struct tty_struct **ret_tty) + { + struct tty_struct *tty, *o_tty; + struct ktermios *tp, **tp_loc, *o_tp, **o_tp_loc; + struct ktermios *ltp, **ltp_loc, *o_ltp, **o_ltp_loc; ++ struct ve_struct * owner; + int retval = 0; + ++ owner = driver->owner_env; ++ ++ if (i_tty) { ++ tty = i_tty; ++ goto fast_track; ++ } ++ + /* check whether we're reopening an existing tty */ + if (driver->flags & TTY_DRIVER_DEVPTS_MEM) { + tty = devpts_get_tty(idx); +@@ -2055,6 +2107,7 @@ + tty->driver = driver; + tty->index = idx; + tty_line_name(driver, idx, tty->name); ++ tty->owner_env = owner; + + if (driver->flags & TTY_DRIVER_DEVPTS_MEM) { + tp_loc = &tty->termios; +@@ -2065,14 +2118,14 @@ + } + + if (!*tp_loc) { +- tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL); ++ tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL_UBC); + if (!tp) + goto free_mem_out; + *tp = driver->init_termios; + } + + if (!*ltp_loc) { +- ltp = kzalloc(sizeof(struct ktermios), GFP_KERNEL); ++ ltp = kzalloc(sizeof(struct ktermios), GFP_KERNEL_UBC); + if (!ltp) + goto free_mem_out; + } +@@ -2085,6 +2138,7 @@ + o_tty->driver = driver->other; + o_tty->index = idx; + tty_line_name(driver->other, idx, o_tty->name); ++ o_tty->owner_env = owner; + + if (driver->flags & TTY_DRIVER_DEVPTS_MEM) { + o_tp_loc = &o_tty->termios; +@@ -2095,14 +2149,14 @@ + } + + if (!*o_tp_loc) { +- o_tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL); ++ o_tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL_UBC); + if (!o_tp) + goto free_mem_out; + *o_tp = driver->other->init_termios; + } + + if (!*o_ltp_loc) { +- o_ltp = kzalloc(sizeof(struct ktermios), GFP_KERNEL); ++ o_ltp = kzalloc(sizeof(struct ktermios), GFP_KERNEL_UBC); + if (!o_ltp) + goto free_mem_out; + } +@@ -2119,6 +2173,10 @@ + *o_ltp_loc = o_ltp; + o_tty->termios = *o_tp_loc; + o_tty->termios_locked = *o_ltp_loc; ++#ifdef CONFIG_VE ++ if (driver->other->refcount == 0) ++ (void)get_ve(owner); ++#endif + driver->other->refcount++; + if (driver->subtype == PTY_TYPE_MASTER) + o_tty->count++; +@@ -2143,6 +2201,10 @@ + *ltp_loc = ltp; + tty->termios = *tp_loc; + tty->termios_locked = *ltp_loc; ++#ifdef CONFIG_VE ++ if (driver->refcount == 0) ++ (void)get_ve(owner); ++#endif + /* Compatibility until drivers always set this */ + tty->termios->c_ispeed = tty_termios_input_baud_rate(tty->termios); + tty->termios->c_ospeed = tty_termios_baud_rate(tty->termios); +@@ -2267,7 +2329,8 @@ + + tty->magic = 0; + tty->driver->refcount--; +- ++ if (tty->driver->refcount == 0) ++ put_ve(tty->owner_env); + file_list_lock(); + list_del_init(&tty->tty_files); + file_list_unlock(); +@@ -2315,7 +2378,10 @@ + int idx; + char buf[64]; + unsigned long flags; +- ++#ifdef CONFIG_UNIX98_PTYS ++ struct idr *idr_alloced; ++#endif ++ + tty = (struct tty_struct *)filp->private_data; + if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "release_dev")) + return; +@@ -2329,6 +2395,9 @@ + tty->driver->subtype == PTY_TYPE_MASTER); + devpts = (tty->driver->flags & TTY_DRIVER_DEVPTS_MEM) != 0; + o_tty = tty->link; ++#ifdef CONFIG_UNIX98_PTYS ++ idr_alloced = &__ve_allocated_ptys(tty->owner_env); ++#endif + + #ifdef TTY_PARANOIA_CHECK + if (idx < 0 || idx >= tty->driver->num) { +@@ -2575,7 +2644,7 @@ + /* Make this pty number available for reallocation */ + if (devpts) { + down(&allocated_ptys_lock); +- idr_remove(&allocated_ptys, idx); ++ idr_remove(idr_alloced, idx); + up(&allocated_ptys_lock); + } + #endif +@@ -2605,7 +2674,7 @@ + + static int tty_open(struct inode * inode, struct file * filp) + { +- struct tty_struct *tty; ++ struct tty_struct *tty, *c_tty; + int noctty, retval; + struct tty_driver *driver; + int index; +@@ -2618,6 +2687,7 @@ + noctty = filp->f_flags & O_NOCTTY; + index = -1; + retval = 0; ++ c_tty = NULL; + + mutex_lock(&tty_mutex); + +@@ -2629,6 +2699,7 @@ + } + driver = tty->driver; + index = tty->index; ++ c_tty = tty; + filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */ + /* noctty = 1; */ + goto got_driver; +@@ -2636,6 +2707,12 @@ + #ifdef CONFIG_VT + if (device == MKDEV(TTY_MAJOR,0)) { + extern struct tty_driver *console_driver; ++#ifdef CONFIG_VE ++ if (!ve_is_super(get_exec_env())) { ++ mutex_unlock(&tty_mutex); ++ return -ENODEV; ++ } ++#endif + driver = console_driver; + index = fg_console; + noctty = 1; +@@ -2643,6 +2720,12 @@ + } + #endif + if (device == MKDEV(TTYAUX_MAJOR,1)) { ++#ifdef CONFIG_VE ++ if (!ve_is_super(get_exec_env())) { ++ mutex_unlock(&tty_mutex); ++ return -ENODEV; ++ } ++#endif + driver = console_device(&index); + if (driver) { + /* Don't let /dev/console block */ +@@ -2660,7 +2743,7 @@ + return -ENODEV; + } + got_driver: +- retval = init_dev(driver, index, &tty); ++ retval = init_dev(driver, index, c_tty, &tty); + mutex_unlock(&tty_mutex); + if (retval) + return retval; +@@ -2741,11 +2824,11 @@ + + /* find a device that is not in use. */ + down(&allocated_ptys_lock); +- if (!idr_pre_get(&allocated_ptys, GFP_KERNEL)) { ++ if (!idr_pre_get(&ve_allocated_ptys, GFP_KERNEL)) { + up(&allocated_ptys_lock); + return -ENOMEM; + } +- idr_ret = idr_get_new(&allocated_ptys, NULL, &index); ++ idr_ret = idr_get_new(&ve_allocated_ptys, NULL, &index); + if (idr_ret < 0) { + up(&allocated_ptys_lock); + if (idr_ret == -EAGAIN) +@@ -2753,14 +2836,14 @@ + return -EIO; + } + if (index >= pty_limit) { +- idr_remove(&allocated_ptys, index); ++ idr_remove(&ve_allocated_ptys, index); + up(&allocated_ptys_lock); + return -EIO; + } + up(&allocated_ptys_lock); + + mutex_lock(&tty_mutex); +- retval = init_dev(ptm_driver, index, &tty); ++ retval = init_dev(ve_ptm_driver, index, NULL, &tty); + mutex_unlock(&tty_mutex); + + if (retval) +@@ -2775,7 +2858,7 @@ + goto out1; + + check_tty_count(tty, "tty_open"); +- retval = ptm_driver->open(tty, filp); ++ retval = ve_ptm_driver->open(tty, filp); + if (!retval) { + tty_audit_opening(); + return 0; +@@ -2785,7 +2868,7 @@ + return retval; + out: + down(&allocated_ptys_lock); +- idr_remove(&allocated_ptys, index); ++ idr_remove(&ve_allocated_ptys, index); + up(&allocated_ptys_lock); + return retval; + } +@@ -2991,6 +3074,8 @@ + { + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; ++ if (!ve_is_super(get_exec_env())) ++ return -EACCES; + if (file->f_op->write == redirected_tty_write) { + struct file *f; + spin_lock(&redirect_lock); +@@ -3559,7 +3644,7 @@ + /* Now kill any processes that happen to have the + * tty open. + */ +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + if (p->signal->tty == tty) { + printk(KERN_NOTICE "SAK: killed process %d" + " (%s): task_session_nr(p)==tty->session\n", +@@ -3591,7 +3676,7 @@ + spin_unlock(&p->files->file_lock); + } + task_unlock(p); +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + read_unlock(&tasklist_lock); + #endif + } +@@ -3938,6 +4023,7 @@ + driver->put_char = tty_default_put_char; + + mutex_lock(&tty_mutex); ++ driver->owner_env = get_exec_env(); + list_add(&driver->tty_drivers, &tty_drivers); + mutex_unlock(&tty_mutex); + +@@ -4131,6 +4217,44 @@ + + vty_init(); + #endif ++ prepare_tty(); + return 0; + } + module_init(tty_init); ++ ++#ifdef CONFIG_UNIX98_PTYS ++struct class *init_ve_tty_class(void) ++{ ++ struct class * ve_tty_class; ++ struct class_device * ve_ptmx_dev_class; ++ ++ ve_tty_class = class_create(THIS_MODULE, "tty"); ++ if (IS_ERR(ve_tty_class)) ++ return ve_tty_class; ++ ++ ve_ptmx_dev_class = class_device_create(ve_tty_class, NULL, ++ MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); ++ if (IS_ERR(ve_ptmx_dev_class)) { ++ class_destroy(ve_tty_class); ++ return (struct class *)ve_ptmx_dev_class; ++ } ++ ++ return ve_tty_class; ++} ++ ++void fini_ve_tty_class(struct class *ve_tty_class) ++{ ++ class_device_destroy(ve_tty_class, MKDEV(TTYAUX_MAJOR, 2)); ++ class_destroy(ve_tty_class); ++} ++#else ++struct class *init_ve_tty_class(void) ++{ ++ return NULL; ++} ++void fini_ve_tty_class(struct class *ve_tty_class) ++{ ++} ++#endif ++EXPORT_SYMBOL(init_ve_tty_class); ++EXPORT_SYMBOL(fini_ve_tty_class); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/connector/connector.c debian/binary-custom.d/openvz/src/drivers/connector/connector.c +--- ./drivers/connector/connector.c 2012-06-12 16:25:21.714312577 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/connector/connector.c 2012-11-13 15:20:11.628569197 +0000 +@@ -276,8 +276,7 @@ + + dev->cbdev = cn_queue_alloc_dev("cqueue", dev->nls); + if (!dev->cbdev) { +- if (dev->nls->sk_socket) +- sock_release(dev->nls->sk_socket); ++ netlink_kernel_release(dev->nls); + return -EINVAL; + } + +@@ -293,8 +292,7 @@ + cn_already_initialized = 0; + + cn_queue_free_dev(dev->cbdev); +- if (dev->nls->sk_socket) +- sock_release(dev->nls->sk_socket); ++ netlink_kernel_release(dev->nls); + } + + subsys_initcall(cn_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/net/Makefile debian/binary-custom.d/openvz/src/drivers/net/Makefile +--- ./drivers/net/Makefile 2012-06-12 16:25:22.234312559 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/net/Makefile 2012-11-13 15:20:12.396569170 +0000 +@@ -25,6 +25,10 @@ + obj-$(CONFIG_UCC_GETH) += ucc_geth_driver.o + ucc_geth_driver-objs := ucc_geth.o ucc_geth_mii.o ucc_geth_ethtool.o + ++obj-$(CONFIG_VE_NETDEV) += vznetdev.o ++vznetdev-objs := open_vznet.o venet_core.o ++obj-$(CONFIG_VE_ETHDEV) += vzethdev.o ++ + # + # link order important here + # +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/net/loopback.c debian/binary-custom.d/openvz/src/drivers/net/loopback.c +--- ./drivers/net/loopback.c 2012-06-12 16:25:22.378312554 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/net/loopback.c 2012-11-13 15:20:12.620569161 +0000 +@@ -136,6 +136,12 @@ + { + struct pcpu_lstats *pcpu_lstats, *lb_stats; + ++#ifdef CONFIG_VE ++ if (unlikely(get_exec_env()->disable_net)) { ++ kfree_skb(skb); ++ return 0; ++ } ++#endif + skb_orphan(skb); + + skb->protocol = eth_type_trans(skb,dev); +@@ -242,7 +248,8 @@ + | NETIF_F_NO_CSUM + | NETIF_F_HIGHDMA + | NETIF_F_LLTX +- | NETIF_F_NETNS_LOCAL; ++ | NETIF_F_NETNS_LOCAL ++ | NETIF_F_VIRTUAL; + dev->ethtool_ops = &loopback_ethtool_ops; + dev->header_ops = ð_header_ops; + dev->init = loopback_dev_init; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/net/open_vznet.c debian/binary-custom.d/openvz/src/drivers/net/open_vznet.c +--- ./drivers/net/open_vznet.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/net/open_vznet.c 2012-11-13 15:20:12.652569161 +0000 +@@ -0,0 +1,244 @@ ++/* ++ * open_vznet.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++/* ++ * Virtual Networking device used to change VE ownership on packets ++ */ ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++void veip_stop(struct ve_struct *ve) ++{ ++ struct list_head *p, *tmp; ++ ++ write_lock_irq(&veip_hash_lock); ++ if (ve->veip == NULL) ++ goto unlock; ++ list_for_each_safe(p, tmp, &ve->veip->ip_lh) { ++ struct ip_entry_struct *ptr; ++ ptr = list_entry(p, struct ip_entry_struct, ve_list); ++ ptr->active_env = NULL; ++ list_del(&ptr->ve_list); ++ list_del(&ptr->ip_hash); ++ kfree(ptr); ++ } ++ veip_put(ve->veip); ++ ve->veip = NULL; ++ if (!ve_is_super(ve)) ++ module_put(THIS_MODULE); ++unlock: ++ write_unlock_irq(&veip_hash_lock); ++} ++ ++int veip_start(struct ve_struct *ve) ++{ ++ int err, get; ++ ++ err = 0; ++ write_lock_irq(&veip_hash_lock); ++ get = ve->veip == NULL; ++ ve->veip = veip_findcreate(ve->veid); ++ if (ve->veip == NULL) ++ err = -ENOMEM; ++ write_unlock_irq(&veip_hash_lock); ++ if (err == 0 && get && !ve_is_super(ve)) ++ __module_get(THIS_MODULE); ++ return err; ++} ++ ++int veip_entry_add(struct ve_struct *ve, struct ve_addr_struct *addr) ++{ ++ struct ip_entry_struct *entry, *found; ++ int err; ++ ++ entry = kzalloc(sizeof(struct ip_entry_struct), GFP_KERNEL); ++ if (entry == NULL) ++ return -ENOMEM; ++ ++ if (ve->veip == NULL) { ++ /* This can happen if we load venet AFTER ve was started */ ++ err = veip_start(ve); ++ if (err < 0) ++ goto out; ++ } ++ ++ write_lock_irq(&veip_hash_lock); ++ err = -EADDRINUSE; ++ found = venet_entry_lookup(addr); ++ if (found != NULL) ++ goto out_unlock; ++ ++ entry->active_env = ve; ++ entry->addr = *addr; ++ ip_entry_hash(entry, ve->veip); ++ ++ err = 0; ++ entry = NULL; ++out_unlock: ++ write_unlock_irq(&veip_hash_lock); ++out: ++ if (entry != NULL) ++ kfree(entry); ++ return err; ++} ++ ++int veip_entry_del(envid_t veid, struct ve_addr_struct *addr) ++{ ++ struct ip_entry_struct *found; ++ int err; ++ ++ err = -EADDRNOTAVAIL; ++ write_lock_irq(&veip_hash_lock); ++ found = venet_entry_lookup(addr); ++ if (found == NULL) ++ goto out; ++ if (found->active_env->veid != veid) ++ goto out; ++ ++ err = 0; ++ found->active_env = NULL; ++ ++ list_del(&found->ip_hash); ++ list_del(&found->ve_list); ++ kfree(found); ++out: ++ write_unlock_irq(&veip_hash_lock); ++ return err; ++} ++ ++static int skb_extract_addr(struct sk_buff *skb, ++ struct ve_addr_struct *addr, int dir) ++{ ++ switch (skb->protocol) { ++ case __constant_htons(ETH_P_IP): ++ addr->family = AF_INET; ++ addr->key[0] = 0; ++ addr->key[1] = 0; ++ addr->key[2] = 0; ++ addr->key[3] = (dir ? ip_hdr(skb)->daddr : ip_hdr(skb)->saddr); ++ return 0; ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++ case __constant_htons(ETH_P_IPV6): ++ addr->family = AF_INET6; ++ memcpy(&addr->key, dir ? ++ ipv6_hdr(skb)->daddr.s6_addr32 : ++ ipv6_hdr(skb)->saddr.s6_addr32, ++ sizeof(addr->key)); ++ return 0; ++#endif ++ } ++ ++ return -EAFNOSUPPORT; ++} ++ ++static struct ve_struct *venet_find_ve(struct sk_buff *skb, int dir) ++{ ++ struct ip_entry_struct *entry; ++ struct ve_addr_struct addr; ++ ++ if (skb_extract_addr(skb, &addr, dir) < 0) ++ return NULL; ++ ++ entry = venet_entry_lookup(&addr); ++ if (entry == NULL) ++ return NULL; ++ ++ return entry->active_env; ++} ++ ++int venet_change_skb_owner(struct sk_buff *skb) ++{ ++ struct ve_struct *ve, *ve_old; ++ ++ ve_old = skb->owner_env; ++ ++ read_lock(&veip_hash_lock); ++ if (!ve_is_super(ve_old)) { ++ /* from VE to host */ ++ ve = venet_find_ve(skb, 0); ++ if (ve == NULL) ++ goto out_drop; ++ if (!ve_accessible_strict(ve, ve_old)) ++ goto out_source; ++ skb->owner_env = get_ve0(); ++ } else { ++ /* from host to VE */ ++ ve = venet_find_ve(skb, 1); ++ if (ve == NULL) ++ goto out_drop; ++ skb->owner_env = ve; ++ } ++ read_unlock(&veip_hash_lock); ++ ++ return 0; ++ ++out_drop: ++ read_unlock(&veip_hash_lock); ++ return -ESRCH; ++ ++out_source: ++ read_unlock(&veip_hash_lock); ++ if (net_ratelimit() && skb->protocol == __constant_htons(ETH_P_IP)) { ++ printk(KERN_WARNING "Dropped packet, source wrong " ++ "veid=%u src-IP=%u.%u.%u.%u " ++ "dst-IP=%u.%u.%u.%u\n", ++ skb->owner_env->veid, ++ NIPQUAD(ip_hdr(skb)->saddr), ++ NIPQUAD(ip_hdr(skb)->daddr)); ++ } ++ return -EACCES; ++} ++ ++#ifdef CONFIG_PROC_FS ++int veip_seq_show(struct seq_file *m, void *v) ++{ ++ struct list_head *p; ++ struct ip_entry_struct *entry; ++ char s[40]; ++ ++ p = (struct list_head *)v; ++ if (p == ip_entry_hash_table) { ++ seq_puts(m, "Version: 2.5\n"); ++ return 0; ++ } ++ entry = list_entry(p, struct ip_entry_struct, ip_hash); ++ veaddr_print(s, sizeof(s), &entry->addr); ++ seq_printf(m, "%39s %10u\n", s, 0); ++ return 0; ++} ++#endif ++ ++__exit void veip_cleanup(void) ++{ ++ int i; ++ ++ write_lock_irq(&veip_hash_lock); ++ for (i = 0; i < VEIP_HASH_SZ; i++) ++ while (!list_empty(ip_entry_hash_table + i)) { ++ struct ip_entry_struct *entry; ++ ++ entry = list_first_entry(ip_entry_hash_table + i, ++ struct ip_entry_struct, ip_hash); ++ list_del(&entry->ip_hash); ++ kfree(entry); ++ } ++ write_unlock_irq(&veip_hash_lock); ++} ++ ++MODULE_AUTHOR("SWsoft "); ++MODULE_DESCRIPTION("Virtuozzo Virtual Network Device"); ++MODULE_LICENSE("GPL v2"); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/net/tun.c debian/binary-custom.d/openvz/src/drivers/net/tun.c +--- ./drivers/net/tun.c 2012-06-12 16:25:22.514312549 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/net/tun.c 2012-11-13 15:20:12.796569157 +0000 +@@ -53,6 +53,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -66,6 +67,7 @@ + + #include + #include ++#include + + #ifdef TUN_DEBUG + static int debug; +@@ -73,15 +75,18 @@ + + /* Network device part of the driver */ + +-static LIST_HEAD(tun_dev_list); ++LIST_HEAD(tun_dev_list); ++EXPORT_SYMBOL(tun_dev_list); ++ + static const struct ethtool_ops tun_ethtool_ops; + + /* Net device open. */ +-static int tun_net_open(struct net_device *dev) ++int tun_net_open(struct net_device *dev) + { + netif_start_queue(dev); + return 0; + } ++EXPORT_SYMBOL(tun_net_open); + + /* Net device close. */ + static int tun_net_close(struct net_device *dev) +@@ -94,6 +99,9 @@ + static int tun_net_xmit(struct sk_buff *skb, struct net_device *dev) + { + struct tun_struct *tun = netdev_priv(dev); ++#if 0 ++ struct user_beancounter *ub; ++#endif + + DBG(KERN_INFO "%s: tun_net_xmit %d\n", tun->dev->name, skb->len); + +@@ -118,6 +126,24 @@ + } + } + ++ /* ++ * XXX this code is broken: ++ * See comment in dev_queue_xmit ++ */ ++#if 0 ++ ub = netdev_bc(dev)->exec_ub; ++ if (ub && (skb_bc(skb)->charged == 0)) { ++ unsigned long charge; ++ charge = skb_charge_fullsize(skb); ++ if (charge_beancounter(ub, UB_OTHERSOCKBUF, charge, 1)) ++ goto drop; ++ get_beancounter(ub); ++ skb_bc(skb)->ub = ub; ++ skb_bc(skb)->charged = charge; ++ skb_bc(skb)->resource = UB_OTHERSOCKBUF; ++ } ++#endif ++ + /* Queue packet */ + skb_queue_tail(&tun->readq, skb); + dev->trans_start = jiffies; +@@ -184,7 +210,7 @@ + } + + /* Initialize net device. */ +-static void tun_net_init(struct net_device *dev) ++void tun_net_init(struct net_device *dev) + { + struct tun_struct *tun = netdev_priv(dev); + +@@ -216,6 +242,7 @@ + break; + } + } ++EXPORT_SYMBOL(tun_net_init); + + /* Character device part */ + +@@ -415,11 +442,13 @@ + DBG(KERN_DEBUG "%s: tun_chr_readv: accepted: %s\n", + tun->dev->name, print_mac(mac, addr)); + ret = tun_put_user(tun, skb, (struct iovec *) iv, len); ++ /* skb will be uncharged in kfree_skb() */ + kfree_skb(skb); + break; + } else { + DBG(KERN_DEBUG "%s: tun_chr_readv: rejected: %s\n", + tun->dev->name, print_mac(mac, addr)); ++ /* skb will be uncharged in kfree_skb() */ + kfree_skb(skb); + continue; + } +@@ -431,7 +460,7 @@ + return ret; + } + +-static void tun_setup(struct net_device *dev) ++void tun_setup(struct net_device *dev) + { + struct tun_struct *tun = netdev_priv(dev); + +@@ -446,7 +475,9 @@ + dev->stop = tun_net_close; + dev->ethtool_ops = &tun_ethtool_ops; + dev->destructor = free_netdev; ++ dev->features |= NETIF_F_VIRTUAL; + } ++EXPORT_SYMBOL(tun_setup); + + static struct tun_struct *tun_get_by_name(const char *name) + { +@@ -454,8 +485,9 @@ + + ASSERT_RTNL(); + list_for_each_entry(tun, &tun_dev_list, list) { +- if (!strncmp(tun->dev->name, name, IFNAMSIZ)) +- return tun; ++ if (ve_accessible_strict(tun->dev->owner_env, get_exec_env()) && ++ !strncmp(tun->dev->name, name, IFNAMSIZ)) ++ return tun; + } + + return NULL; +@@ -463,6 +495,7 @@ + + static int tun_set_iff(struct file *file, struct ifreq *ifr) + { ++ struct net *net = get_exec_env()->ve_netns; + struct tun_struct *tun; + struct net_device *dev; + int err; +@@ -477,10 +510,11 @@ + current->euid != tun->owner) || + (tun->group != -1 && + current->egid != tun->group)) && +- !capable(CAP_NET_ADMIN)) ++ !capable(CAP_NET_ADMIN) && ++ !capable(CAP_VE_NET_ADMIN)) + return -EPERM; + } +- else if (__dev_get_by_name(&init_net, ifr->ifr_name)) ++ else if (__dev_get_by_name(net, ifr->ifr_name)) + return -EINVAL; + else { + char *name; +@@ -488,7 +522,7 @@ + + err = -EINVAL; + +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) + return -EPERM; + + /* Set dev type */ +@@ -510,6 +544,7 @@ + tun_setup); + if (!dev) + return -ENOMEM; ++ dev->nd_net = net; + + tun = netdev_priv(dev); + tun->dev = dev; +@@ -546,6 +581,7 @@ + + file->private_data = tun; + tun->attached = 1; ++ tun->bind_file = file; + + strcpy(ifr->ifr_name, tun->dev->name); + return 0; +@@ -603,6 +639,9 @@ + break; + + case TUNSETPERSIST: ++ /* prohibit persist mode inside VE */ ++ if (!ve_is_super(get_exec_env())) ++ return -EPERM; + /* Disable/Enable persist mode */ + if (arg) + tun->flags |= TUN_PERSIST; +@@ -734,12 +773,13 @@ + return 0; + } + +-static int tun_chr_open(struct inode *inode, struct file * file) ++int tun_chr_open(struct inode *inode, struct file * file) + { + DBG1(KERN_INFO "tunX: tun_chr_open\n"); + file->private_data = NULL; + return 0; + } ++EXPORT_SYMBOL(tun_chr_open); + + static int tun_chr_close(struct inode *inode, struct file *file) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/net/venet_core.c debian/binary-custom.d/openvz/src/drivers/net/venet_core.c +--- ./drivers/net/venet_core.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/net/venet_core.c 2012-11-13 15:20:12.816569157 +0000 +@@ -0,0 +1,740 @@ ++/* ++ * venet_core.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++/* ++ * Common part for Virtuozzo virtual network devices ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include /* For the statistics structure. */ ++#include /* For ARPHRD_ETHER */ ++#include ++#include ++#include ++#include ++#include ++ ++struct list_head ip_entry_hash_table[VEIP_HASH_SZ]; ++rwlock_t veip_hash_lock = RW_LOCK_UNLOCKED; ++LIST_HEAD(veip_lh); ++ ++#define ip_entry_hash_function(ip) (ntohl(ip) & (VEIP_HASH_SZ - 1)) ++ ++void ip_entry_hash(struct ip_entry_struct *entry, struct veip_struct *veip) ++{ ++ list_add(&entry->ip_hash, ++ ip_entry_hash_table + ++ ip_entry_hash_function(entry->addr.key[3])); ++ list_add(&entry->ve_list, &veip->ip_lh); ++} ++ ++void veip_put(struct veip_struct *veip) ++{ ++ if (!list_empty(&veip->ip_lh)) ++ return; ++ if (!list_empty(&veip->src_lh)) ++ return; ++ if (!list_empty(&veip->dst_lh)) ++ return; ++ ++ list_del(&veip->list); ++ kfree(veip); ++} ++ ++struct ip_entry_struct *venet_entry_lookup(struct ve_addr_struct *addr) ++{ ++ struct ip_entry_struct *entry; ++ ++ list_for_each_entry (entry, ip_entry_hash_table + ++ ip_entry_hash_function(addr->key[3]), ip_hash) ++ if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) ++ return entry; ++ return NULL; ++} ++ ++struct veip_struct *veip_find(envid_t veid) ++{ ++ struct veip_struct *ptr; ++ ++ list_for_each_entry(ptr, &veip_lh, list) { ++ if (ptr->veid != veid) ++ continue; ++ return ptr; ++ } ++ return NULL; ++} ++ ++struct veip_struct *veip_findcreate(envid_t veid) ++{ ++ struct veip_struct *ptr; ++ ++ ptr = veip_find(veid); ++ if (ptr != NULL) ++ return ptr; ++ ++ ptr = kmalloc(sizeof(struct veip_struct), GFP_ATOMIC); ++ if (ptr == NULL) ++ return NULL; ++ memset(ptr, 0, sizeof(struct veip_struct)); ++ INIT_LIST_HEAD(&ptr->ip_lh); ++ INIT_LIST_HEAD(&ptr->src_lh); ++ INIT_LIST_HEAD(&ptr->dst_lh); ++ ptr->veid = veid; ++ list_add(&ptr->list, &veip_lh); ++ return ptr; ++} ++ ++static int convert_sockaddr(struct sockaddr *addr, int addrlen, ++ struct ve_addr_struct *veaddr) ++{ ++ int err; ++ ++ switch (addr->sa_family) { ++ case AF_INET: { ++ struct sockaddr_in *sin; ++ ++ err = -EINVAL; ++ if (addrlen != sizeof(struct sockaddr_in)) ++ break; ++ ++ err = 0; ++ sin = (struct sockaddr_in *)addr; ++ veaddr->family = AF_INET; ++ veaddr->key[0] = 0; ++ veaddr->key[1] = 0; ++ veaddr->key[2] = 0; ++ veaddr->key[3] = sin->sin_addr.s_addr; ++ break; ++ } ++ case AF_INET6: { ++ struct sockaddr_in6 *sin; ++ ++ err = -EINVAL; ++ if (addrlen != sizeof(struct sockaddr_in6)) ++ break; ++ ++ err = 0; ++ sin = (struct sockaddr_in6 *)addr; ++ veaddr->family = AF_INET6; ++ memcpy(veaddr->key, &sin->sin6_addr, sizeof(veaddr->key)); ++ break; ++ } ++ default: ++ err = -EAFNOSUPPORT; ++ } ++ return err; ++} ++ ++int sockaddr_to_veaddr(struct sockaddr __user *uaddr, int addrlen, ++ struct ve_addr_struct *veaddr) ++{ ++ int err; ++ char addr[MAX_SOCK_ADDR]; ++ ++ err = move_addr_to_kernel(uaddr, addrlen, &addr); ++ if (err < 0) ++ goto out; ++ ++ err = convert_sockaddr((struct sockaddr *)&addr, addrlen, veaddr); ++out: ++ return err; ++} ++ ++void veaddr_print(char *str, int len, struct ve_addr_struct *a) ++{ ++ if (a->family == AF_INET) ++ snprintf(str, len, "%u.%u.%u.%u", NIPQUAD(a->key[3])); ++ else ++ snprintf(str, len, "%x:%x:%x:%x:%x:%x:%x:%x", ++ ntohl(a->key[0])>>16, ntohl(a->key[0])&0xFFFF, ++ ntohl(a->key[1])>>16, ntohl(a->key[1])&0xFFFF, ++ ntohl(a->key[2])>>16, ntohl(a->key[2])&0xFFFF, ++ ntohl(a->key[3])>>16, ntohl(a->key[3])&0xFFFF ++ ); ++} ++ ++/* ++ * Device functions ++ */ ++ ++static int venet_open(struct net_device *dev) ++{ ++ if (!ve_is_super(get_exec_env()) && !try_module_get(THIS_MODULE)) ++ return -EBUSY; ++ return 0; ++} ++ ++static int venet_close(struct net_device *master) ++{ ++ if (!ve_is_super(get_exec_env())) ++ module_put(THIS_MODULE); ++ return 0; ++} ++ ++static void venet_destructor(struct net_device *dev) ++{ ++ struct venet_stats *stats = (struct venet_stats *)dev->priv; ++ if (stats == NULL) ++ return; ++ free_percpu(stats->real_stats); ++ kfree(stats); ++ dev->priv = NULL; ++} ++ ++/* ++ * The higher levels take care of making this non-reentrant (it's ++ * called with bh's disabled). ++ */ ++static int venet_xmit(struct sk_buff *skb, struct net_device *dev) ++{ ++ struct net_device_stats *stats; ++ struct net_device *rcv = NULL; ++ int length; ++ ++ stats = venet_stats(dev, smp_processor_id()); ++ if (unlikely(get_exec_env()->disable_net)) ++ goto outf; ++ ++ if (skb->protocol == __constant_htons(ETH_P_IP)) { ++ struct iphdr *iph; ++ iph = ip_hdr(skb); ++ if (MULTICAST(iph->daddr)) ++ goto outf; ++ } else if (skb->protocol == __constant_htons(ETH_P_IPV6)) { ++ struct ipv6hdr *ip6h; ++ ip6h = ipv6_hdr(skb); ++ if (ipv6_addr_is_multicast(&ip6h->daddr)) ++ goto outf; ++ skb_orphan(skb); ++ } else { ++ goto outf; ++ } ++ ++ if (venet_change_skb_owner(skb) < 0) ++ goto outf; ++ ++ if (unlikely(skb->owner_env->disable_net)) ++ goto outf; ++ ++ rcv = skb->owner_env->_venet_dev; ++ if (!rcv) ++ /* VE going down */ ++ goto outf; ++ ++ dev_hold(rcv); ++ ++ if (!(rcv->flags & IFF_UP)) { ++ /* Target VE does not want to receive packets */ ++ dev_put(rcv); ++ goto outf; ++ } ++ ++ skb->pkt_type = PACKET_HOST; ++ skb->dev = rcv; ++ ++ skb_reset_mac_header(skb); ++ memset(skb->data - dev->hard_header_len, 0, dev->hard_header_len); ++ ++ dst_release(skb->dst); ++ skb->dst = NULL; ++#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) ++ nf_conntrack_put(skb->nfct); ++ skb->nfct = NULL; ++#endif ++ length = skb->len; ++ ++ netif_rx(skb); ++ ++ stats->tx_bytes += length; ++ stats->tx_packets++; ++ if (rcv) { ++ struct net_device_stats *rcv_stats; ++ ++ rcv_stats = venet_stats(rcv, smp_processor_id()); ++ rcv_stats->rx_bytes += length; ++ rcv_stats->rx_packets++; ++ dev_put(rcv); ++ } ++ ++ return 0; ++ ++outf: ++ kfree_skb(skb); ++ ++stats->tx_dropped; ++ return 0; ++} ++ ++static struct net_device_stats *get_stats(struct net_device *dev) ++{ ++ int i; ++ struct venet_stats *stats; ++ ++ stats = (struct venet_stats *)dev->priv; ++ memset(&stats->stats, 0, sizeof(struct net_device_stats)); ++ for (i=0; i < NR_CPUS; i++) { ++ struct net_device_stats *dev_stats; ++ ++ if (!cpu_possible(i)) ++ continue; ++ dev_stats = venet_stats(dev, i); ++ stats->stats.rx_bytes += dev_stats->rx_bytes; ++ stats->stats.tx_bytes += dev_stats->tx_bytes; ++ stats->stats.rx_packets += dev_stats->rx_packets; ++ stats->stats.tx_packets += dev_stats->tx_packets; ++ } ++ ++ return &stats->stats; ++} ++ ++/* Initialize the rest of the LOOPBACK device. */ ++int venet_init_dev(struct net_device *dev) ++{ ++ struct venet_stats *stats; ++ ++ dev->hard_start_xmit = venet_xmit; ++ stats = kzalloc(sizeof(struct venet_stats), GFP_KERNEL); ++ if (stats == NULL) ++ goto fail; ++ stats->real_stats = alloc_percpu(struct net_device_stats); ++ if (stats->real_stats == NULL) ++ goto fail_free; ++ dev->priv = stats; ++ ++ dev->get_stats = get_stats; ++ dev->open = venet_open; ++ dev->stop = venet_close; ++ dev->destructor = venet_destructor; ++ ++ /* ++ * Fill in the generic fields of the device structure. ++ */ ++ dev->type = ARPHRD_VOID; ++ dev->hard_header_len = ETH_HLEN; ++ dev->mtu = 1500; /* eth_mtu */ ++ dev->tx_queue_len = 0; ++ ++ memset(dev->broadcast, 0xFF, ETH_ALEN); ++ ++ /* New-style flags. */ ++ dev->flags = IFF_BROADCAST|IFF_NOARP|IFF_POINTOPOINT; ++ return 0; ++ ++fail_free: ++ kfree(stats); ++fail: ++ return -ENOMEM; ++} ++ ++static int ++venet_set_op(struct net_device *dev, u32 data, ++ int (*fop)(struct net_device *, u32)) ++{ ++ ++ struct ve_struct *ve; ++ int ret = 0; ++ ++ read_lock(&ve_list_lock); ++ for_each_ve(ve) { ++ struct ve_struct *ve_old; ++ ++ ve_old = set_exec_env(ve); ++ read_lock(&dev_base_lock); ++ for_each_netdev(ve->ve_netns, dev) { ++ if (dev->hard_start_xmit == venet_xmit) ++ ret = fop(dev, data); ++ } ++ read_unlock(&dev_base_lock); ++ set_exec_env(ve_old); ++ ++ if (ret < 0) ++ break; ++ } ++ read_unlock(&ve_list_lock); ++ return ret; ++} ++ ++static unsigned long common_features; ++ ++static int venet_op_set_sg(struct net_device *dev, u32 data) ++{ ++ if (!ve_is_super(get_exec_env())) ++ return -EPERM; ++ ++ if (data) ++ common_features |= NETIF_F_SG; ++ else ++ common_features &= ~NETIF_F_SG; ++ ++ return venet_set_op(dev, data, ethtool_op_set_sg); ++} ++ ++static int venet_op_set_tx_csum(struct net_device *dev, u32 data) ++{ ++ if (!ve_is_super(get_exec_env())) ++ return -EPERM; ++ ++ if (data) ++ common_features |= NETIF_F_IP_CSUM; ++ else ++ common_features &= ~NETIF_F_IP_CSUM; ++ ++ return venet_set_op(dev, data, ethtool_op_set_tx_csum); ++} ++ ++#define venet_op_set_rx_csum venet_op_set_tx_csum ++ ++static struct ethtool_ops venet_ethtool_ops = { ++ .get_sg = ethtool_op_get_sg, ++ .set_sg = venet_op_set_sg, ++ .get_tx_csum = ethtool_op_get_tx_csum, ++ .set_tx_csum = venet_op_set_tx_csum, ++ .get_rx_csum = ethtool_op_get_tx_csum, ++ .set_rx_csum = venet_op_set_rx_csum, ++ .get_tso = ethtool_op_get_tso, ++}; ++ ++static void venet_setup(struct net_device *dev) ++{ ++ dev->init = venet_init_dev; ++ /* ++ * No other features, as they are: ++ * - checksumming is required, and nobody else will done our job ++ */ ++ dev->features |= NETIF_F_VENET | NETIF_F_VIRTUAL | NETIF_F_LLTX | ++ NETIF_F_HIGHDMA | NETIF_F_VLAN_CHALLENGED; ++ ++ dev->features |= common_features; ++ ++ SET_ETHTOOL_OPS(dev, &venet_ethtool_ops); ++} ++ ++#ifdef CONFIG_PROC_FS ++static void veaddr_seq_print(struct seq_file *m, struct ve_struct *ve) ++{ ++ struct ip_entry_struct *entry; ++ ++ read_lock(&veip_hash_lock); ++ if (ve->veip == NULL) ++ goto unlock; ++ list_for_each_entry (entry, &ve->veip->ip_lh, ve_list) { ++ char addr[40]; ++ ++ if (entry->active_env == NULL) ++ continue; ++ ++ veaddr_print(addr, sizeof(addr), &entry->addr); ++ if (entry->addr.family == AF_INET) ++ seq_printf(m, " %15s", addr); ++ else ++ seq_printf(m, " %39s", addr); ++ } ++unlock: ++ read_unlock(&veip_hash_lock); ++} ++ ++static void *veip_seq_start(struct seq_file *m, loff_t *pos) ++{ ++ loff_t l; ++ struct list_head *p; ++ int i; ++ ++ l = *pos; ++ write_lock_irq(&veip_hash_lock); ++ if (l == 0) ++ return ip_entry_hash_table; ++ for (i = 0; i < VEIP_HASH_SZ; i++) { ++ list_for_each(p, ip_entry_hash_table + i) { ++ if (--l == 0) ++ return p; ++ } ++ } ++ return NULL; ++} ++ ++static void *veip_seq_next(struct seq_file *m, void *v, loff_t *pos) ++{ ++ struct list_head *p; ++ ++ p = (struct list_head *)v; ++ while (1) { ++ p = p->next; ++ if (p < ip_entry_hash_table || ++ p >= ip_entry_hash_table + VEIP_HASH_SZ) { ++ (*pos)++; ++ return p; ++ } ++ if (++p >= ip_entry_hash_table + VEIP_HASH_SZ) ++ return NULL; ++ } ++ return NULL; ++} ++ ++static void veip_seq_stop(struct seq_file *m, void *v) ++{ ++ write_unlock_irq(&veip_hash_lock); ++} ++ ++static struct seq_operations veip_seq_op = { ++ .start = veip_seq_start, ++ .next = veip_seq_next, ++ .stop = veip_seq_stop, ++ .show = veip_seq_show, ++}; ++ ++static int veip_open(struct inode *inode, struct file *file) ++{ ++ return seq_open(file, &veip_seq_op); ++} ++ ++static struct file_operations proc_veip_operations = { ++ .open = veip_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = seq_release, ++}; ++#endif ++ ++static int real_ve_ip_map(envid_t veid, int op, struct sockaddr __user *uaddr, ++ int addrlen) ++{ ++ int err; ++ struct ve_struct *ve; ++ struct ve_addr_struct addr; ++ ++ err = -EPERM; ++ if (!capable(CAP_SETVEID)) ++ goto out; ++ ++ err = sockaddr_to_veaddr(uaddr, addrlen, &addr); ++ if (err < 0) ++ goto out; ++ ++ switch (op) ++ { ++ case VE_IP_ADD: ++ ve = get_ve_by_id(veid); ++ err = -ESRCH; ++ if (!ve) ++ goto out; ++ ++ down_read(&ve->op_sem); ++ if (ve->is_running) ++ err = veip_entry_add(ve, &addr); ++ up_read(&ve->op_sem); ++ put_ve(ve); ++ break; ++ ++ case VE_IP_DEL: ++ err = veip_entry_del(veid, &addr); ++ break; ++ default: ++ err = -EINVAL; ++ } ++ ++out: ++ return err; ++} ++ ++int venet_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ int err; ++ ++ err = -ENOTTY; ++ switch(cmd) { ++ case VENETCTL_VE_IP_MAP: { ++ struct vzctl_ve_ip_map s; ++ err = -EFAULT; ++ if (copy_from_user(&s, (void __user *)arg, sizeof(s))) ++ break; ++ err = real_ve_ip_map(s.veid, s.op, s.addr, s.addrlen); ++ break; ++ } ++ } ++ return err; ++} ++ ++#ifdef CONFIG_COMPAT ++int compat_venet_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ int err; ++ ++ switch(cmd) { ++ case VENETCTL_COMPAT_VE_IP_MAP: { ++ struct compat_vzctl_ve_ip_map cs; ++ ++ err = -EFAULT; ++ if (copy_from_user(&cs, (void *)arg, sizeof(cs))) ++ break; ++ ++ err = real_ve_ip_map(cs.veid, cs.op, compat_ptr(cs.addr), ++ cs.addrlen); ++ break; ++ } ++ default: ++ err = venet_ioctl(file, cmd, arg); ++ break; ++ } ++ return err; ++} ++#endif ++ ++static struct vzioctlinfo venetcalls = { ++ .type = VENETCTLTYPE, ++ .ioctl = venet_ioctl, ++#ifdef CONFIG_COMPAT ++ .compat_ioctl = compat_venet_ioctl, ++#endif ++ .owner = THIS_MODULE, ++}; ++ ++int venet_dev_start(struct ve_struct *ve) ++{ ++ struct net_device *dev_venet; ++ int err; ++ ++ dev_venet = alloc_netdev(0, "venet%d", venet_setup); ++ if (!dev_venet) ++ return -ENOMEM; ++ dev_venet->nd_net = ve->ve_netns; ++ err = dev_alloc_name(dev_venet, dev_venet->name); ++ if (err<0) ++ goto err; ++ if ((err = register_netdev(dev_venet)) != 0) ++ goto err; ++ ve->_venet_dev = dev_venet; ++ return 0; ++err: ++ free_netdev(dev_venet); ++ printk(KERN_ERR "VENET initialization error err=%d\n", err); ++ return err; ++} ++ ++static int venet_start(void *data) ++{ ++ struct ve_struct *env; ++ int err; ++ ++ env = (struct ve_struct *)data; ++ if (env->veip) ++ return -EEXIST; ++ ++ err = veip_start(env); ++ if (err != 0) ++ return err; ++ ++ err = venet_dev_start(env); ++ if (err) ++ goto err_free; ++ return 0; ++ ++err_free: ++ veip_stop(env); ++ return err; ++} ++ ++static void venet_stop(void *data) ++{ ++ struct ve_struct *env; ++ struct net_device *dev; ++ ++ env = (struct ve_struct *)data; ++ veip_stop(env); ++ ++ dev = env->_venet_dev; ++ if (dev == NULL) ++ return; ++ ++ unregister_netdev(dev); ++ env->_venet_dev = NULL; ++ free_netdev(dev); ++} ++ ++static struct ve_hook venet_ve_hook = { ++ .init = venet_start, ++ .fini = venet_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_NET, ++}; ++ ++__init int venet_init(void) ++{ ++#ifdef CONFIG_PROC_FS ++ struct proc_dir_entry *de; ++#endif ++ int i, err; ++ ++ if (get_ve0()->_venet_dev != NULL) ++ return -EEXIST; ++ ++ for (i = 0; i < VEIP_HASH_SZ; i++) ++ INIT_LIST_HEAD(ip_entry_hash_table + i); ++ ++ err = venet_start(get_ve0()); ++ if (err) ++ return err; ++ ++#ifdef CONFIG_PROC_FS ++ de = create_proc_entry_mod("vz/veip", ++ S_IFREG|S_IRUSR, NULL, THIS_MODULE); ++ if (de) ++ de->proc_fops = &proc_veip_operations; ++ else ++ printk(KERN_WARNING "venet: can't make veip proc entry\n"); ++#endif ++ ++ ve_hook_register(VE_SS_CHAIN, &venet_ve_hook); ++ vzioctl_register(&venetcalls); ++ vzmon_register_veaddr_print_cb(veaddr_seq_print); ++ return 0; ++} ++ ++__exit void venet_exit(void) ++{ ++ vzmon_unregister_veaddr_print_cb(veaddr_seq_print); ++ vzioctl_unregister(&venetcalls); ++ ve_hook_unregister(&venet_ve_hook); ++ ++#ifdef CONFIG_PROC_FS ++ remove_proc_entry("vz/veip", NULL); ++#endif ++ venet_stop(get_ve0()); ++ veip_cleanup(); ++} ++ ++module_init(venet_init); ++module_exit(venet_exit); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/net/vzethdev.c debian/binary-custom.d/openvz/src/drivers/net/vzethdev.c +--- ./drivers/net/vzethdev.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/net/vzethdev.c 2012-11-13 15:20:12.820569155 +0000 +@@ -0,0 +1,708 @@ ++/* ++ * veth.c ++ * ++ * Copyright (C) 2006 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++/* ++ * Virtual ethernet device used to change VE ownership on packets ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include /* For the statistics structure. */ ++#include /* For ARPHRD_ETHER */ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++static LIST_HEAD(veth_hwaddr_list); ++static DEFINE_RWLOCK(ve_hwaddr_lock); ++static DECLARE_MUTEX(hwaddr_sem); ++ ++struct net_device * veth_dev_start(char *dev_addr, char *name); ++ ++struct veth_struct *hwaddr_entry_lookup(char *name) ++{ ++ struct veth_struct *entry; ++ ++ list_for_each_entry(entry, &veth_hwaddr_list, hwaddr_list) { ++ BUG_ON(entry->pair == NULL); ++ if (strncmp(name, entry->pair->name, IFNAMSIZ) == 0) ++ return entry; ++ } ++ return NULL; ++} ++ ++int veth_entry_add(struct ve_struct *ve, char *dev_addr, char *name, ++ char *dev_addr_ve, char *name_ve) ++{ ++ struct net_device *dev_ve; ++ struct net_device *dev_ve0; ++ struct ve_struct *old_env; ++ char dev_name[IFNAMSIZ]; ++ int err; ++ ++ down(&hwaddr_sem); ++ ++ if (name[0] == '\0') ++ snprintf(dev_name, sizeof(dev_name), "vz%d.%%d", ve->veid); ++ else { ++ memcpy(dev_name, name, IFNAMSIZ - 1); ++ dev_name[IFNAMSIZ - 1] = '\0'; ++ } ++ dev_ve0 = veth_dev_start(dev_addr, dev_name); ++ if (IS_ERR(dev_ve0)) { ++ err = PTR_ERR(dev_ve0); ++ goto err; ++ } ++ ++ old_env = set_exec_env(ve); ++ if (name_ve[0] == '\0') ++ sprintf(dev_name, "eth%%d"); ++ else { ++ memcpy(dev_name, name_ve, IFNAMSIZ - 1); ++ dev_name[IFNAMSIZ - 1] = '\0'; ++ } ++ dev_ve = veth_dev_start(dev_addr_ve, dev_name); ++ if (IS_ERR(dev_ve)) { ++ err = PTR_ERR(dev_ve); ++ goto err_ve; ++ } ++ set_exec_env(old_env); ++ veth_from_netdev(dev_ve)->pair = dev_ve0; ++ veth_from_netdev(dev_ve0)->pair = dev_ve; ++ ++ write_lock(&ve_hwaddr_lock); ++ list_add(&(veth_from_netdev(dev_ve)->hwaddr_list), &veth_hwaddr_list); ++ write_unlock(&ve_hwaddr_lock); ++ ++ up(&hwaddr_sem); ++ return 0; ++ ++err_ve: ++ set_exec_env(old_env); ++ unregister_netdev(dev_ve0); ++err: ++ up(&hwaddr_sem); ++ return err; ++} ++ ++void veth_pair_del(struct ve_struct *env, struct veth_struct *entry) ++{ ++ struct net_device *dev; ++ struct ve_struct *old_env; ++ ++ write_lock(&ve_hwaddr_lock); ++ list_del(&entry->hwaddr_list); ++ write_unlock(&ve_hwaddr_lock); ++ ++ dev = entry->pair; ++ BUG_ON(entry->pair == NULL); ++ ++ veth_from_netdev(dev)->pair = NULL; ++ entry->pair = NULL; ++ rtnl_lock(); ++ old_env = set_exec_env(dev->owner_env); ++ dev_close(dev); ++ ++ /* ++ * Now device from VE0 does not send or receive anything, ++ * i.e. dev->hard_start_xmit won't be called. ++ */ ++ set_exec_env(env); ++ unregister_netdevice(veth_to_netdev(entry)); ++ set_exec_env(dev->owner_env); ++ unregister_netdevice(dev); ++ set_exec_env(old_env); ++ rtnl_unlock(); ++} ++ ++int veth_entry_del(struct ve_struct *ve, char *name) ++{ ++ struct veth_struct *found; ++ int err; ++ ++ err = -ENODEV; ++ down(&hwaddr_sem); ++ found = hwaddr_entry_lookup(name); ++ if (found == NULL) ++ goto out; ++ if (veth_to_netdev(found)->owner_env != ve) ++ goto out; ++ ++ err = 0; ++ veth_pair_del(ve, found); ++ ++out: ++ up(&hwaddr_sem); ++ return err; ++} ++ ++int veth_allow_change_mac(envid_t veid, char *name, int allow) ++{ ++ struct ve_struct *ve; ++ struct veth_struct *found; ++ int err; ++ ++ err = -ESRCH; ++ ve = get_ve_by_id(veid); ++ if (!ve) ++ return err; ++ ++ down_read(&ve->op_sem); ++ if (!ve->is_running) ++ goto out_ve; ++ err = -ENODEV; ++ down(&hwaddr_sem); ++ found = hwaddr_entry_lookup(name); ++ if (found == NULL) ++ goto out_sem; ++ if (veth_to_netdev(found)->owner_env != ve) ++ goto out_sem; ++ ++ err = 0; ++ found->allow_mac_change = allow; ++ ++out_sem: ++ up(&hwaddr_sem); ++out_ve: ++ up_read(&ve->op_sem); ++ put_ve(ve); ++ return err; ++} ++ ++/* ++ * Device functions ++ */ ++ ++static int veth_open(struct net_device *dev) ++{ ++ return 0; ++} ++ ++static int veth_close(struct net_device *master) ++{ ++ return 0; ++} ++ ++static void veth_destructor(struct net_device *dev) ++{ ++ free_percpu(veth_from_netdev(dev)->real_stats); ++ free_netdev(dev); ++} ++ ++static struct net_device_stats *get_stats(struct net_device *dev) ++{ ++ int i; ++ struct net_device_stats *stats; ++ ++ stats = &veth_from_netdev(dev)->stats; ++ memset(stats, 0, sizeof(struct net_device_stats)); ++ for (i = 0; i < NR_CPUS; i++) { ++ struct net_device_stats *dev_stats; ++ ++ if (!cpu_possible(i)) ++ continue; ++ dev_stats = veth_stats(dev, i); ++ stats->rx_bytes += dev_stats->rx_bytes; ++ stats->tx_bytes += dev_stats->tx_bytes; ++ stats->rx_packets += dev_stats->rx_packets; ++ stats->tx_packets += dev_stats->tx_packets; ++ } ++ ++ return stats; ++} ++ ++/* ++ * The higher levels take care of making this non-reentrant (it's ++ * called with bh's disabled). ++ */ ++static int veth_xmit(struct sk_buff *skb, struct net_device *dev) ++{ ++ struct net_device_stats *stats; ++ struct net_device *rcv = NULL; ++ struct veth_struct *entry; ++ int length; ++ ++ stats = veth_stats(dev, smp_processor_id()); ++ if (unlikely(get_exec_env()->disable_net)) ++ goto outf; ++ ++ entry = veth_from_netdev(dev); ++ rcv = entry->pair; ++ if (!rcv) ++ /* VE going down */ ++ goto outf; ++ ++ if (!(rcv->flags & IFF_UP)) { ++ /* Target VE does not want to receive packets */ ++ goto outf; ++ } ++ ++ if (unlikely(rcv->owner_env->disable_net)) ++ goto outf; ++ /* Filtering */ ++ if (ve_is_super(dev->owner_env) && ++ !veth_from_netdev(rcv)->allow_mac_change) { ++ /* from VE0 to VEX */ ++ if (ve_is_super(rcv->owner_env)) ++ goto out; ++ if (is_multicast_ether_addr( ++ ((struct ethhdr *)skb->data)->h_dest)) ++ goto out; ++ if (compare_ether_addr(((struct ethhdr *)skb->data)->h_dest, ++ rcv->dev_addr)) ++ goto outf; ++ } else if (!ve_is_super(dev->owner_env) && ++ !entry->allow_mac_change) { ++ /* from VE to VE0 */ ++ if (compare_ether_addr(((struct ethhdr *)skb->data)->h_source, ++ dev->dev_addr)) ++ goto outf; ++ } ++ ++out: ++ skb->owner_env = rcv->owner_env; ++ ++ skb->dev = rcv; ++ skb->pkt_type = PACKET_HOST; ++ skb->protocol = eth_type_trans(skb, rcv); ++ ++ if (skb->protocol != __constant_htons(ETH_P_IP)) ++ skb_orphan(skb); ++ ++ dst_release(skb->dst); ++ skb->dst = NULL; ++#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) ++ nf_conntrack_put(skb->nfct); ++ skb->nfct = NULL; ++#endif ++ length = skb->len; ++ ++ netif_rx(skb); ++ ++ stats->tx_bytes += length; ++ stats->tx_packets++; ++ if (rcv) { ++ struct net_device_stats *rcv_stats; ++ rcv_stats = veth_stats(rcv, smp_processor_id()); ++ rcv_stats->rx_bytes += length; ++ rcv_stats->rx_packets++; ++ } ++ ++ return 0; ++ ++outf: ++ kfree_skb(skb); ++ stats->tx_dropped++; ++ return 0; ++} ++ ++static int veth_set_mac(struct net_device *dev, void *p) ++{ ++ struct sockaddr *addr = p; ++ ++ if (!ve_is_super(dev->owner_env) && ++ !veth_from_netdev(dev)->allow_mac_change) ++ return -EPERM; ++ if (netif_running(dev)) ++ return -EBUSY; ++ if (!is_valid_ether_addr(addr->sa_data)) ++ return -EADDRNOTAVAIL; ++ ++ memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); ++ ++ return 0; ++} ++ ++int veth_init_dev(struct net_device *dev) ++{ ++ dev->hard_start_xmit = veth_xmit; ++ dev->get_stats = get_stats; ++ dev->open = veth_open; ++ dev->stop = veth_close; ++ dev->destructor = veth_destructor; ++ ++ ether_setup(dev); ++ dev->set_mac_address = veth_set_mac; ++ ++ /* remove setted by ether_setup() handler */ ++ dev->change_mtu = NULL; ++ ++ dev->tx_queue_len = 0; ++ ++ veth_from_netdev(dev)->real_stats = ++ alloc_percpu(struct net_device_stats); ++ if (veth_from_netdev(dev)->real_stats == NULL) ++ return -ENOMEM; ++ ++ return 0; ++} ++ ++static int ++veth_set_op(struct net_device *dev, u32 data, ++ int (*fop)(struct net_device *, u32)) ++{ ++ struct net_device *pair; ++ int ret = 0; ++ ++ ret = fop(dev, data); ++ if (ret < 0) ++ goto out; ++ ++ pair = veth_from_netdev(dev)->pair; ++ if (pair) ++ ret = fop(pair, data); ++out: ++ return ret; ++} ++ ++static int veth_op_set_sg(struct net_device *dev, u32 data) ++{ ++ return veth_set_op(dev, data, ethtool_op_set_sg); ++} ++ ++static int veth_op_set_tx_csum(struct net_device *dev, u32 data) ++{ ++ return veth_set_op(dev, data, ethtool_op_set_tx_csum); ++} ++ ++#define veth_op_set_rx_csum veth_op_set_tx_csum ++ ++static struct ethtool_ops veth_ethtool_ops = { ++ .get_sg = ethtool_op_get_sg, ++ .set_sg = veth_op_set_sg, ++ .get_tx_csum = ethtool_op_get_tx_csum, ++ .set_tx_csum = veth_op_set_tx_csum, ++ .get_rx_csum = ethtool_op_get_tx_csum, ++ .set_rx_csum = veth_op_set_rx_csum, ++ .get_tso = ethtool_op_get_tso, ++}; ++ ++static void veth_setup(struct net_device *dev) ++{ ++ dev->init = veth_init_dev; ++ /* ++ * No other features, as they are: ++ * - checksumming is required, and nobody else will done our job ++ */ ++ dev->features |= NETIF_F_VENET | NETIF_F_VIRTUAL | NETIF_F_LLTX | ++ NETIF_F_HIGHDMA; ++ ++ SET_ETHTOOL_OPS(dev, &veth_ethtool_ops); ++} ++ ++#ifdef CONFIG_PROC_FS ++#define ADDR_FMT "%02x:%02x:%02x:%02x:%02x:%02x" ++#define ADDR_ARG(x) (x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5] ++static int vehwaddr_seq_show(struct seq_file *m, void *v) ++{ ++ struct list_head *p; ++ struct veth_struct *entry; ++ ++ p = (struct list_head *)v; ++ if (p == &veth_hwaddr_list) { ++ seq_puts(m, "Version: 1.0\n"); ++ return 0; ++ } ++ entry = list_entry(p, struct veth_struct, hwaddr_list); ++ seq_printf(m, ADDR_FMT " %16s ", ++ ADDR_ARG(entry->pair->dev_addr), entry->pair->name); ++ seq_printf(m, ADDR_FMT " %16s %10u %5s\n", ++ ADDR_ARG(veth_to_netdev(entry)->dev_addr), ++ veth_to_netdev(entry)->name, ++ VEID(veth_to_netdev(entry)->owner_env), ++ entry->allow_mac_change ? "allow" : "deny"); ++ return 0; ++} ++ ++static void *vehwaddr_seq_start(struct seq_file *m, loff_t *pos) ++{ ++ loff_t l; ++ struct list_head *p; ++ ++ l = *pos; ++ read_lock(&ve_hwaddr_lock); ++ if (l == 0) ++ return &veth_hwaddr_list; ++ list_for_each(p, &veth_hwaddr_list) { ++ if (--l == 0) ++ return p; ++ } ++ return NULL; ++} ++ ++static void *vehwaddr_seq_next(struct seq_file *m, void *v, loff_t *pos) ++{ ++ struct list_head *p; ++ ++ p = (struct list_head *)v; ++ (*pos)++; ++ return p->next == &veth_hwaddr_list ? NULL : p->next; ++} ++ ++static void vehwaddr_seq_stop(struct seq_file *m, void *v) ++{ ++ read_unlock(&ve_hwaddr_lock); ++} ++ ++static struct seq_operations vehwaddr_seq_op = { ++ .start = vehwaddr_seq_start, ++ .next = vehwaddr_seq_next, ++ .stop = vehwaddr_seq_stop, ++ .show = vehwaddr_seq_show, ++}; ++ ++static int vehwaddr_open(struct inode *inode, struct file *file) ++{ ++ return seq_open(file, &vehwaddr_seq_op); ++} ++ ++static struct file_operations proc_vehwaddr_operations = { ++ .open = vehwaddr_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = seq_release, ++}; ++#endif ++ ++int real_ve_hwaddr(envid_t veid, int op, ++ unsigned char *dev_addr, int addrlen, char *name, ++ unsigned char *dev_addr_ve, int addrlen_ve, char *name_ve) ++{ ++ int err; ++ struct ve_struct *ve; ++ char ve_addr[ETH_ALEN]; ++ ++ err = -EPERM; ++ if (!capable(CAP_NET_ADMIN)) ++ goto out; ++ ++ err = -EINVAL; ++ switch (op) { ++ case VE_ETH_ADD: ++ if (addrlen != ETH_ALEN) ++ goto out; ++ if (addrlen_ve != ETH_ALEN && addrlen_ve != 0) ++ goto out; ++ /* If ve addr is not set then we use dev_addr[3] & 0x80 for it */ ++ if (addrlen_ve == 0 && (dev_addr[3] & 0x80)) ++ goto out; ++ if (addrlen_ve == 0) { ++ memcpy(ve_addr, dev_addr, ETH_ALEN); ++ ve_addr[3] |= 0x80; ++ } else { ++ memcpy(ve_addr, dev_addr_ve, ETH_ALEN); ++ } ++ ++ ve = get_ve_by_id(veid); ++ err = -ESRCH; ++ if (!ve) ++ goto out; ++ ++ down_read(&ve->op_sem); ++ if (ve->is_running) ++ err = veth_entry_add(ve, dev_addr, name, ve_addr, name_ve); ++ up_read(&ve->op_sem); ++ put_ve(ve); ++ break; ++ ++ case VE_ETH_DEL: ++ if (name[0] == '\0') ++ goto out; ++ ve = get_ve_by_id(veid); ++ err = -ESRCH; ++ if (!ve) ++ goto out; ++ ++ down_read(&ve->op_sem); ++ if (ve->is_running) ++ err = veth_entry_del(ve, name); ++ up_read(&ve->op_sem); ++ put_ve(ve); ++ break; ++ case VE_ETH_ALLOW_MAC_CHANGE: ++ case VE_ETH_DENY_MAC_CHANGE: ++ err = veth_allow_change_mac(veid, name, ++ op == VE_ETH_ALLOW_MAC_CHANGE); ++ break; ++ } ++ ++out: ++ return err; ++} ++ ++int veth_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ int err; ++ ++ err = -ENOTTY; ++ switch(cmd) { ++ case VETHCTL_VE_HWADDR: { ++ struct vzctl_ve_hwaddr s; ++ ++ err = -EFAULT; ++ if (copy_from_user(&s, (void __user *)arg, sizeof(s))) ++ break; ++ err = real_ve_hwaddr(s.veid, s.op, s.dev_addr, s.addrlen, ++ s.dev_name, s.dev_addr_ve, s.addrlen_ve, ++ s.dev_name_ve); ++ } ++ break; ++ } ++ return err; ++} ++ ++static struct vzioctlinfo vethcalls = { ++ .type = VETHCTLTYPE, ++ .ioctl = veth_ioctl, ++ .compat_ioctl = veth_ioctl, ++ .owner = THIS_MODULE, ++}; ++ ++struct net_device * veth_dev_start(char *dev_addr, char *name) ++{ ++ struct net_device *dev; ++ int err; ++ ++ if (!is_valid_ether_addr(dev_addr)) ++ return ERR_PTR(-EADDRNOTAVAIL); ++ ++ dev = alloc_netdev(sizeof(struct veth_struct), name, veth_setup); ++ if (!dev) ++ return ERR_PTR(-ENOMEM); ++ dev->nd_net = get_exec_env()->ve_netns; ++ if (strchr(dev->name, '%')) { ++ err = dev_alloc_name(dev, dev->name); ++ if (err < 0) ++ goto err; ++ } ++ if ((err = register_netdev(dev)) != 0) ++ goto err; ++ ++ memcpy(dev->dev_addr, dev_addr, ETH_ALEN); ++ dev->addr_len = ETH_ALEN; ++ ++ return dev; ++err: ++ free_netdev(dev); ++ printk(KERN_ERR "%s initialization error err=%d\n", name, err); ++ return ERR_PTR(err); ++} ++ ++static int veth_start(void *data) ++{ ++ return 0; ++} ++ ++static void veth_stop(void *data) ++{ ++ struct ve_struct *env; ++ struct veth_struct *entry, *tmp; ++ ++ env = (struct ve_struct *)data; ++ down(&hwaddr_sem); ++ list_for_each_entry_safe(entry, tmp, &veth_hwaddr_list, hwaddr_list) ++ if (VEID(env) == VEID(veth_to_netdev(entry)->owner_env)) ++ veth_pair_del(env, entry); ++ up(&hwaddr_sem); ++} ++ ++static struct ve_hook veth_ve_hook = { ++ .init = veth_start, ++ .fini = veth_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_NET, ++}; ++ ++__init int veth_init(void) ++{ ++#ifdef CONFIG_PROC_FS ++ struct proc_dir_entry *de; ++ ++ de = create_proc_entry_mod("vz/veth", ++ S_IFREG|S_IRUSR, NULL, THIS_MODULE); ++ if (de) ++ de->proc_fops = &proc_vehwaddr_operations; ++ else ++ printk(KERN_WARNING "veth: can't make vehwaddr proc entry\n"); ++#endif ++ ++ ve_hook_register(VE_SS_CHAIN, &veth_ve_hook); ++ vzioctl_register(&vethcalls); ++ KSYMRESOLVE(veth_open); ++ KSYMMODRESOLVE(vzethdev); ++ return 0; ++} ++ ++__exit void veth_exit(void) ++{ ++ struct veth_struct *entry; ++ struct list_head *tmp, *n; ++ struct ve_struct *ve; ++ ++ KSYMMODUNRESOLVE(vzethdev); ++ KSYMUNRESOLVE(veth_open); ++ vzioctl_unregister(&vethcalls); ++ ve_hook_unregister(&veth_ve_hook); ++#ifdef CONFIG_PROC_FS ++ remove_proc_entry("vz/veth", NULL); ++#endif ++ ++ down(&hwaddr_sem); ++ list_for_each_safe(tmp, n, &veth_hwaddr_list) { ++ entry = list_entry(tmp, struct veth_struct, hwaddr_list); ++ ve = get_ve(veth_to_netdev(entry)->owner_env); ++ ++ veth_pair_del(ve, entry); ++ ++ put_ve(ve); ++ } ++ up(&hwaddr_sem); ++} ++ ++module_init(veth_init); ++module_exit(veth_exit); ++ ++MODULE_AUTHOR("Andrey Mirkin "); ++MODULE_DESCRIPTION("Virtuozzo Virtual Ethernet Device"); ++MODULE_LICENSE("GPL v2"); ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/pci/probe.c debian/binary-custom.d/openvz/src/drivers/pci/probe.c +--- ./drivers/pci/probe.c 2012-06-12 16:25:22.690312543 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/pci/probe.c 2012-11-13 15:20:13.044569147 +0000 +@@ -21,6 +21,7 @@ + EXPORT_SYMBOL(pci_root_buses); + + LIST_HEAD(pci_devices); ++EXPORT_SYMBOL(pci_devices); + + /* + * Some device drivers need know if pci is initiated. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/sbus/char/bbc_envctrl.c debian/binary-custom.d/openvz/src/drivers/sbus/char/bbc_envctrl.c +--- ./drivers/sbus/char/bbc_envctrl.c 2012-06-12 16:25:22.766312540 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/sbus/char/bbc_envctrl.c 2012-11-13 15:20:13.160569142 +0000 +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include "bbc_i2c.h" + #include "max1617.h" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/sbus/char/envctrl.c debian/binary-custom.d/openvz/src/drivers/sbus/char/envctrl.c +--- ./drivers/sbus/char/envctrl.c 2012-06-12 16:25:22.770312540 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/sbus/char/envctrl.c 2012-11-13 15:20:13.164569143 +0000 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + #define ENVCTRL_MINOR 162 + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/scsi/scsi_netlink.c debian/binary-custom.d/openvz/src/drivers/scsi/scsi_netlink.c +--- ./drivers/scsi/scsi_netlink.c 2012-06-12 16:25:22.950312533 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/scsi/scsi_netlink.c 2012-11-13 15:20:13.404569137 +0000 +@@ -169,7 +169,7 @@ + scsi_netlink_exit(void) + { + if (scsi_nl_sock) { +- sock_release(scsi_nl_sock->sk_socket); ++ netlink_kernel_release(scsi_nl_sock); + netlink_unregister_notifier(&scsi_netlink_notifier); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./drivers/scsi/scsi_transport_iscsi.c debian/binary-custom.d/openvz/src/drivers/scsi/scsi_transport_iscsi.c +--- ./drivers/scsi/scsi_transport_iscsi.c 2012-06-12 16:25:22.954312533 +0100 ++++ debian/binary-custom.d/openvz/src/drivers/scsi/scsi_transport_iscsi.c 2012-11-13 15:20:13.416569136 +0000 +@@ -1533,7 +1533,7 @@ + + static void __exit iscsi_transport_exit(void) + { +- sock_release(nls->sk_socket); ++ netlink_kernel_release(nls); + transport_class_unregister(&iscsi_connection_class); + transport_class_unregister(&iscsi_session_class); + transport_class_unregister(&iscsi_host_class); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/Kconfig debian/binary-custom.d/openvz/src/fs/Kconfig +--- ./fs/Kconfig 2012-06-12 16:25:23.234312524 +0100 ++++ debian/binary-custom.d/openvz/src/fs/Kconfig 2012-11-13 15:20:13.856569122 +0000 +@@ -562,6 +562,15 @@ + Note that this behavior is currently deprecated and may go away in + future. Please use notification via netlink socket instead. + ++config QUOTA_COMPAT ++ bool "Compatibility with older quotactl interface" ++ depends on QUOTA ++ help ++ This option enables compatibility layer for older version ++ of quotactl interface with byte granularity (QUOTAON at 0x0100, ++ GETQUOTA at 0x0D00). Interface versions older than that one and ++ with block granularity are still not supported. ++ + config QFMT_V1 + tristate "Old quota format support" + depends on QUOTA +@@ -577,6 +586,39 @@ + This quota format allows using quotas with 32-bit UIDs/GIDs. If you + need this functionality say Y here. + ++config SIM_FS ++ tristate "VPS filesystem" ++ depends on VZ_QUOTA ++ default m ++ help ++ This file system is a part of Virtuozzo. It intoduces a fake ++ superblock and blockdev to VE to hide real device and show ++ statfs results taken from quota. ++ ++config VZ_QUOTA ++ tristate "Virtuozzo Disk Quota support" ++ depends on QUOTA ++ select VZ_DEV ++ default m ++ help ++ Virtuozzo Disk Quota imposes disk quota on directories with their ++ files and subdirectories in total. Such disk quota is used to ++ account and limit disk usage by Virtuozzo VPS, but also may be used ++ separately. ++ ++config VZ_QUOTA_UNLOAD ++ bool "Unloadable Virtuozzo Disk Quota module" ++ depends on VZ_QUOTA=m ++ default n ++ help ++ Make Virtuozzo Disk Quota module unloadable. ++ Doesn't work reliably now. ++ ++config VZ_QUOTA_UGID ++ bool "Per-user and per-group quota in Virtuozzo quota partitions" ++ depends on VZ_QUOTA!=n ++ default y ++ + config QUOTACTL + bool + depends on XFS_QUOTA || QUOTA +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/Makefile debian/binary-custom.d/openvz/src/fs/Makefile +--- ./fs/Makefile 2012-06-12 16:25:23.234312524 +0100 ++++ debian/binary-custom.d/openvz/src/fs/Makefile 2012-11-13 15:20:13.856569122 +0000 +@@ -52,9 +52,15 @@ + obj-$(CONFIG_QFMT_V1) += quota_v1.o + obj-$(CONFIG_QFMT_V2) += quota_v2.o + obj-$(CONFIG_QUOTACTL) += quota.o ++obj-$(CONFIG_VZ_QUOTA) += vzdquota.o ++vzdquota-y += vzdquot.o vzdq_mgmt.o vzdq_ops.o vzdq_tree.o ++vzdquota-$(CONFIG_VZ_QUOTA_UGID) += vzdq_ugid.o ++vzdquota-$(CONFIG_VZ_QUOTA_UGID) += vzdq_file.o + + obj-$(CONFIG_DNOTIFY) += dnotify.o + ++obj-$(CONFIG_SIM_FS) += simfs.o ++ + obj-$(CONFIG_PROC_FS) += proc/ + obj-y += partitions/ + obj-$(CONFIG_SYSFS) += sysfs/ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/aio.c debian/binary-custom.d/openvz/src/fs/aio.c +--- ./fs/aio.c 2012-06-12 16:25:23.246312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/aio.c 2012-11-13 15:20:13.868569118 +0000 +@@ -43,13 +43,16 @@ + #endif + + /*------ sysctl variables----*/ +-static DEFINE_SPINLOCK(aio_nr_lock); ++DEFINE_SPINLOCK(aio_nr_lock); ++EXPORT_SYMBOL_GPL(aio_nr_lock); + unsigned long aio_nr; /* current system wide number of aio requests */ ++EXPORT_SYMBOL_GPL(aio_nr); + unsigned long aio_max_nr = 0x10000; /* system wide maximum number of aio requests */ + /*----end sysctl variables---*/ + + static struct kmem_cache *kiocb_cachep; +-static struct kmem_cache *kioctx_cachep; ++struct kmem_cache *kioctx_cachep; ++EXPORT_SYMBOL_GPL(kioctx_cachep); + + static struct workqueue_struct *aio_wq; + +@@ -60,7 +63,7 @@ + static DEFINE_SPINLOCK(fput_lock); + static LIST_HEAD(fput_head); + +-static void aio_kick_handler(struct work_struct *); ++void aio_kick_handler(struct work_struct *); + static void aio_queue_work(struct kioctx *); + + /* aio_setup +@@ -290,7 +293,7 @@ + spin_unlock_irq(&ctx->ctx_lock); + } + +-static void wait_for_all_aios(struct kioctx *ctx) ++void wait_for_all_aios(struct kioctx *ctx) + { + struct task_struct *tsk = current; + DECLARE_WAITQUEUE(wait, tsk); +@@ -313,6 +316,7 @@ + out: + spin_unlock_irq(&ctx->ctx_lock); + } ++EXPORT_SYMBOL_GPL(wait_for_all_aios); + + /* wait_on_sync_kiocb: + * Waits on the given sync kiocb to complete. +@@ -835,7 +839,7 @@ + * space. + * Run on aiod's context. + */ +-static void aio_kick_handler(struct work_struct *work) ++void aio_kick_handler(struct work_struct *work) + { + struct kioctx *ctx = container_of(work, struct kioctx, wq.work); + mm_segment_t oldfs = get_fs(); +@@ -856,7 +860,7 @@ + if (requeue) + queue_delayed_work(aio_wq, &ctx->wq, 0); + } +- ++EXPORT_SYMBOL_GPL(aio_kick_handler); + + /* + * Called by kick_iocb to queue the kiocb for retry +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/autofs/init.c debian/binary-custom.d/openvz/src/fs/autofs/init.c +--- ./fs/autofs/init.c 2012-06-12 16:25:23.246312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/autofs/init.c 2012-11-13 15:20:13.872569117 +0000 +@@ -25,6 +25,7 @@ + .name = "autofs", + .get_sb = autofs_get_sb, + .kill_sb = autofs_kill_sb, ++ .fs_flags = FS_VIRTUALIZED, + }; + + static int __init init_autofs_fs(void) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/autofs/inode.c debian/binary-custom.d/openvz/src/fs/autofs/inode.c +--- ./fs/autofs/inode.c 2012-06-12 16:25:23.246312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/autofs/inode.c 2012-11-13 15:20:13.872569117 +0000 +@@ -80,7 +80,7 @@ + + *uid = current->uid; + *gid = current->gid; +- *pgrp = task_pgrp_nr(current); ++ *pgrp = task_pgrp_vnr(current); + + *minproto = *maxproto = AUTOFS_PROTO_VERSION; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/autofs/root.c debian/binary-custom.d/openvz/src/fs/autofs/root.c +--- ./fs/autofs/root.c 2012-06-12 16:25:23.246312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/autofs/root.c 2012-11-13 15:20:13.872569117 +0000 +@@ -356,7 +356,7 @@ + + /* This allows root to remove symlinks */ + lock_kernel(); +- if (!autofs_oz_mode(sbi) && !capable(CAP_SYS_ADMIN)) { ++ if (!autofs_oz_mode(sbi) && !capable(CAP_SYS_ADMIN) && !capable(CAP_VE_SYS_ADMIN)) { + unlock_kernel(); + return -EACCES; + } +@@ -542,7 +542,7 @@ + _IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT) + return -ENOTTY; + +- if (!autofs_oz_mode(sbi) && !capable(CAP_SYS_ADMIN)) ++ if (!autofs_oz_mode(sbi) && !capable(CAP_SYS_ADMIN) && !capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + + switch(cmd) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/autofs4/autofs_i.h debian/binary-custom.d/openvz/src/fs/autofs4/autofs_i.h +--- ./fs/autofs4/autofs_i.h 2012-06-12 16:25:23.246312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/autofs4/autofs_i.h 2012-11-13 15:20:13.872569117 +0000 +@@ -98,7 +98,7 @@ + u32 magic; + int pipefd; + struct file *pipe; +- pid_t oz_pgrp; ++ struct pid *oz_pgrp; + int catatonic; + int version; + int sub_version; +@@ -131,7 +131,7 @@ + filesystem without "magic".) */ + + static inline int autofs4_oz_mode(struct autofs_sb_info *sbi) { +- return sbi->catatonic || task_pgrp_nr(current) == sbi->oz_pgrp; ++ return sbi->catatonic || task_pgrp(current) == sbi->oz_pgrp; + } + + /* Does a dentry have some pending activity? */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/autofs4/init.c debian/binary-custom.d/openvz/src/fs/autofs4/init.c +--- ./fs/autofs4/init.c 2012-06-12 16:25:23.246312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/autofs4/init.c 2012-11-13 15:20:13.872569117 +0000 +@@ -25,6 +25,7 @@ + .name = "autofs", + .get_sb = autofs_get_sb, + .kill_sb = autofs4_kill_sb, ++ .fs_flags = FS_VIRTUALIZED, + }; + + static int __init init_autofs4_fs(void) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/autofs4/inode.c debian/binary-custom.d/openvz/src/fs/autofs4/inode.c +--- ./fs/autofs4/inode.c 2012-06-12 16:25:23.246312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/autofs4/inode.c 2012-11-13 15:20:13.872569117 +0000 +@@ -165,6 +165,8 @@ + /* Clean up and release dangling references */ + autofs4_force_release(sbi); + ++ put_pid(sbi->oz_pgrp); ++ + sb->s_fs_info = NULL; + kfree(sbi); + +@@ -181,7 +183,7 @@ + return 0; + + seq_printf(m, ",fd=%d", sbi->pipefd); +- seq_printf(m, ",pgrp=%d", sbi->oz_pgrp); ++ seq_printf(m, ",pgrp=%d", pid_vnr(sbi->oz_pgrp)); + seq_printf(m, ",timeout=%lu", sbi->exp_timeout/HZ); + seq_printf(m, ",minproto=%d", sbi->min_proto); + seq_printf(m, ",maxproto=%d", sbi->max_proto); +@@ -226,7 +228,7 @@ + + *uid = current->uid; + *gid = current->gid; +- *pgrp = task_pgrp_nr(current); ++ *pgrp = task_pgrp_vnr(current); + + *minproto = AUTOFS_MIN_PROTO_VERSION; + *maxproto = AUTOFS_MAX_PROTO_VERSION; +@@ -311,6 +313,7 @@ + int pipefd; + struct autofs_sb_info *sbi; + struct autofs_info *ino; ++ pid_t pgrp; + + sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + if (!sbi) +@@ -323,7 +326,6 @@ + sbi->pipe = NULL; + sbi->catatonic = 1; + sbi->exp_timeout = 0; +- sbi->oz_pgrp = task_pgrp_nr(current); + sbi->sb = s; + sbi->version = 0; + sbi->sub_version = 0; +@@ -361,7 +363,7 @@ + + /* Can this call block? */ + if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid, +- &sbi->oz_pgrp, &sbi->type, &sbi->min_proto, ++ &pgrp, &sbi->type, &sbi->min_proto, + &sbi->max_proto)) { + printk("autofs: called with bogus options\n"); + goto fail_dput; +@@ -389,12 +391,20 @@ + sbi->version = sbi->max_proto; + sbi->sub_version = AUTOFS_PROTO_SUBVERSION; + +- DPRINTK("pipe fd = %d, pgrp = %u", pipefd, sbi->oz_pgrp); ++ DPRINTK("pipe fd = %d, pgrp = %u", pipefd, pgrp); ++ ++ sbi->oz_pgrp = find_get_pid(pgrp); ++ ++ if (!sbi->oz_pgrp) { ++ printk("autofs: could not find process group %d\n", pgrp); ++ goto fail_dput; ++ } ++ + pipe = fget(pipefd); + + if (!pipe) { + printk("autofs: could not open pipe file descriptor\n"); +- goto fail_dput; ++ goto fail_put_pid; + } + if (!pipe->f_op || !pipe->f_op->write) + goto fail_fput; +@@ -415,6 +425,8 @@ + printk("autofs: pipe file descriptor does not contain proper ops\n"); + fput(pipe); + /* fall through */ ++fail_put_pid: ++ put_pid(sbi->oz_pgrp); + fail_dput: + dput(root); + goto fail_free; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/autofs4/root.c debian/binary-custom.d/openvz/src/fs/autofs4/root.c +--- ./fs/autofs4/root.c 2012-06-12 16:25:23.246312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/autofs4/root.c 2012-11-13 15:20:13.872569117 +0000 +@@ -762,7 +762,7 @@ + struct autofs_info *p_ino; + + /* This allows root to remove symlinks */ +- if (!autofs4_oz_mode(sbi) && !capable(CAP_SYS_ADMIN)) ++ if (!autofs4_oz_mode(sbi) && !capable(CAP_SYS_ADMIN) && !capable(CAP_VE_SYS_ADMIN)) + return -EACCES; + + if (atomic_dec_and_test(&ino->count)) { +@@ -982,7 +982,7 @@ + _IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT) + return -ENOTTY; + +- if (!autofs4_oz_mode(sbi) && !capable(CAP_SYS_ADMIN)) ++ if (!autofs4_oz_mode(sbi) && !capable(CAP_SYS_ADMIN) && !capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + + switch(cmd) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/autofs4/waitq.c debian/binary-custom.d/openvz/src/fs/autofs4/waitq.c +--- ./fs/autofs4/waitq.c 2012-06-12 16:25:23.246312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/autofs4/waitq.c 2012-11-13 15:20:13.876569118 +0000 +@@ -136,6 +136,14 @@ + struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet; + + pktsz = sizeof(*packet); ++#if defined(CONFIG_X86_64) && defined(CONFIG_IA32_EMULATION) ++ /* ++ * On x86_64 autofs_v5_packet struct is padded with 4 bytes ++ * which breaks 32-bit autofs daemon. ++ */ ++ if (test_thread_flag(TIF_IA32)) ++ pktsz -= 4; ++#endif + + packet->wait_queue_token = wq->wait_queue_token; + packet->len = wq->len; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/binfmt_aout.c debian/binary-custom.d/openvz/src/fs/binfmt_aout.c +--- ./fs/binfmt_aout.c 2012-06-12 16:25:23.250312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/binfmt_aout.c 2012-11-13 15:20:13.876569118 +0000 +@@ -376,14 +376,14 @@ + if ((ex.a_text & 0xfff || ex.a_data & 0xfff) && + (N_MAGIC(ex) != NMAGIC) && (jiffies-error_time2) > 5*HZ) + { +- printk(KERN_NOTICE "executable not page aligned\n"); ++ ve_printk(VE_LOG, KERN_NOTICE "executable not page aligned\n"); + error_time2 = jiffies; + } + + if ((fd_offset & ~PAGE_MASK) != 0 && + (jiffies-error_time) > 5*HZ) + { +- printk(KERN_WARNING ++ ve_printk(VE_LOG, KERN_WARNING + "fd_offset is not page aligned. Please convert program: %s\n", + bprm->file->f_path.dentry->d_name.name); + error_time = jiffies; +@@ -500,7 +500,7 @@ + + if ((jiffies-error_time) > 5*HZ) + { +- printk(KERN_WARNING ++ ve_printk(VE_LOG, KERN_WARNING + "N_TXTOFF is not page aligned. Please convert library: %s\n", + file->f_path.dentry->d_name.name); + error_time = jiffies; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/binfmt_elf.c debian/binary-custom.d/openvz/src/fs/binfmt_elf.c +--- ./fs/binfmt_elf.c 2012-06-12 16:25:23.250312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/binfmt_elf.c 2012-11-13 15:20:13.880569120 +0000 +@@ -417,7 +417,7 @@ + eppnt = elf_phdata; + for (i = 0; i < interp_elf_ex->e_phnum; i++, eppnt++) { + if (eppnt->p_type == PT_LOAD) { +- int elf_type = MAP_PRIVATE | MAP_DENYWRITE; ++ int elf_type = MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECPRIO; + int elf_prot = 0; + unsigned long vaddr = 0; + unsigned long k, map_addr; +@@ -895,7 +895,8 @@ + if (elf_ppnt->p_flags & PF_X) + elf_prot |= PROT_EXEC; + +- elf_flags = MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE; ++ elf_flags = MAP_PRIVATE | MAP_DENYWRITE | ++ MAP_EXECUTABLE | MAP_EXECPRIO; + + vaddr = elf_ppnt->p_vaddr; + if (loc->elf_ex.e_type == ET_EXEC || load_addr_set) { +@@ -1036,7 +1037,7 @@ + set_binfmt(&elf_format); + + #ifdef ARCH_HAS_SETUP_ADDITIONAL_PAGES +- retval = arch_setup_additional_pages(bprm, executable_stack); ++ retval = arch_setup_additional_pages(bprm, executable_stack, 0); + if (retval < 0) { + send_sig(SIGKILL, current, 0); + goto out; +@@ -1635,7 +1636,7 @@ + if (signr) { + struct elf_thread_status *tmp; + rcu_read_lock(); +- do_each_thread(g,p) ++ do_each_thread_ve(g,p) + if (current->mm == p->mm && current != p) { + tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC); + if (!tmp) { +@@ -1645,7 +1646,7 @@ + tmp->thread = p; + list_add(&tmp->list, &thread_list); + } +- while_each_thread(g,p); ++ while_each_thread_ve(g,p); + rcu_read_unlock(); + list_for_each(t, &thread_list) { + struct elf_thread_status *tmp; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/binfmt_misc.c debian/binary-custom.d/openvz/src/fs/binfmt_misc.c +--- ./fs/binfmt_misc.c 2012-06-12 16:25:23.250312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/binfmt_misc.c 2012-11-13 15:20:13.880569120 +0000 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + #include + +@@ -34,8 +35,15 @@ + VERBOSE_STATUS = 1 /* make it zero to save 400 bytes kernel memory */ + }; + ++#ifdef CONFIG_VE ++#define bm_entries(ve) ((ve)->bm_entries) ++#define bm_enabled(ve) ((ve)->bm_enabled) ++#else + static LIST_HEAD(entries); + static int enabled = 1; ++#define bm_entries(ve) (entries) ++#define bm_enabled(ve) (enabled) ++#endif + + enum {Enabled, Magic}; + #define MISC_FMT_PRESERVE_ARGV0 (1<<31) +@@ -55,21 +63,30 @@ + } Node; + + static DEFINE_RWLOCK(entries_lock); ++#ifdef CONFIG_VE ++#define bm_fs_type(ve) (*(ve)->bm_fs_type) ++#define bm_mnt(ve) ((ve)->bm_mnt) ++#define bm_entry_count(ve) ((ve)->bm_entry_count) ++#else + static struct file_system_type bm_fs_type; + static struct vfsmount *bm_mnt; + static int entry_count; ++#define bm_fs_type(ve) (bm_fs_type) ++#define bm_mnt(ve) (bm_mnt) ++#define bm_entry_count(ve) (bm_entry_count) ++#endif + + /* + * Check if we support the binfmt + * if we do, return the node, else NULL + * locking is done in load_misc_binary + */ +-static Node *check_file(struct linux_binprm *bprm) ++static Node *check_file(struct ve_struct *ve, struct linux_binprm *bprm) + { + char *p = strrchr(bprm->interp, '.'); + struct list_head *l; + +- list_for_each(l, &entries) { ++ list_for_each(l, &bm_entries(ve)) { + Node *e = list_entry(l, Node, list); + char *s; + int j; +@@ -111,14 +128,15 @@ + int retval; + int fd_binary = -1; + struct files_struct *files = NULL; ++ struct ve_struct *ve = get_exec_env(); + + retval = -ENOEXEC; +- if (!enabled) ++ if (!bm_enabled(ve)) + goto _ret; + + /* to keep locking time low, we copy the interpreter string */ + read_lock(&entries_lock); +- fmt = check_file(bprm); ++ fmt = check_file(ve, bprm); + if (fmt) + strlcpy(iname, fmt->interpreter, BINPRM_BUF_SIZE); + read_unlock(&entries_lock); +@@ -519,7 +537,7 @@ + kfree(inode->i_private); + } + +-static void kill_node(Node *e) ++static void kill_node(struct ve_struct *ve, Node *e) + { + struct dentry *dentry; + +@@ -535,7 +553,7 @@ + dentry->d_inode->i_nlink--; + d_drop(dentry); + dput(dentry); +- simple_release_fs(&bm_mnt, &entry_count); ++ simple_release_fs(&bm_mnt(ve), &bm_entry_count(ve)); + } + } + +@@ -589,7 +607,7 @@ + case 3: root = dget(file->f_path.mnt->mnt_sb->s_root); + mutex_lock(&root->d_inode->i_mutex); + +- kill_node(e); ++ kill_node(get_exec_env(), e); + + mutex_unlock(&root->d_inode->i_mutex); + dput(root); +@@ -614,6 +632,7 @@ + struct dentry *root, *dentry; + struct super_block *sb = file->f_path.mnt->mnt_sb; + int err = 0; ++ struct ve_struct *ve = get_exec_env(); + + e = create_entry(buffer, count); + +@@ -637,7 +656,7 @@ + if (!inode) + goto out2; + +- err = simple_pin_fs(&bm_fs_type, &bm_mnt, &entry_count); ++ err = simple_pin_fs(&bm_fs_type(ve), &bm_mnt(ve), &bm_entry_count(ve)); + if (err) { + iput(inode); + inode = NULL; +@@ -650,7 +669,7 @@ + + d_instantiate(dentry, inode); + write_lock(&entries_lock); +- list_add(&e->list, &entries); ++ list_add(&e->list, &bm_entries(ve)); + write_unlock(&entries_lock); + + err = 0; +@@ -676,26 +695,30 @@ + static ssize_t + bm_status_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) + { +- char *s = enabled ? "enabled" : "disabled"; ++ char *s = bm_enabled(get_exec_env()) ? "enabled" : "disabled"; + + return simple_read_from_buffer(buf, nbytes, ppos, s, strlen(s)); + } + ++static void dm_genocide(struct ve_struct *ve) ++{ ++ while (!list_empty(&bm_entries(ve))) ++ kill_node(ve, list_entry(bm_entries(ve).next, Node, list)); ++} ++ + static ssize_t bm_status_write(struct file * file, const char __user * buffer, + size_t count, loff_t *ppos) + { ++ struct ve_struct *ve = get_exec_env(); + int res = parse_command(buffer, count); + struct dentry *root; + + switch (res) { +- case 1: enabled = 0; break; +- case 2: enabled = 1; break; ++ case 1: bm_enabled(ve) = 0; break; ++ case 2: bm_enabled(ve) = 1; break; + case 3: root = dget(file->f_path.mnt->mnt_sb->s_root); + mutex_lock(&root->d_inode->i_mutex); +- +- while (!list_empty(&entries)) +- kill_node(list_entry(entries.next, Node, list)); +- ++ dm_genocide(ve); + mutex_unlock(&root->d_inode->i_mutex); + dput(root); + default: return res; +@@ -746,6 +769,51 @@ + .kill_sb = kill_litter_super, + }; + ++#ifdef CONFIG_VE ++static void __ve_binfmt_init(struct ve_struct *ve, struct file_system_type *fs) ++{ ++ ve->bm_fs_type = fs; ++ INIT_LIST_HEAD(&ve->bm_entries); ++ ve->bm_enabled = 1; ++ ve->bm_mnt = NULL; ++ ve->bm_entry_count = 0; ++} ++ ++static int ve_binfmt_init(void *x) ++{ ++ struct ve_struct *ve = x; ++ struct file_system_type *fs_type; ++ int err; ++ ++ err = register_ve_fs_type(ve, &bm_fs_type, &fs_type, NULL); ++ if (err == 0) ++ __ve_binfmt_init(ve, fs_type); ++ ++ return err; ++} ++ ++static void ve_binfmt_fini(void *x) ++{ ++ struct ve_struct *ve = x; ++ ++ /* ++ * no locks since exec_ve is dead and noone will ++ * mess with bm_xxx fields any longer ++ */ ++ if (!ve->bm_fs_type) ++ return; ++ dm_genocide(ve); ++ unregister_ve_fs_type(ve->bm_fs_type, NULL); ++} ++ ++static struct ve_hook ve_binfmt_hook = { ++ .init = ve_binfmt_init, ++ .fini = ve_binfmt_fini, ++ .priority = HOOK_PRIO_FS, ++ .owner = THIS_MODULE, ++}; ++#endif ++ + static int __init init_misc_binfmt(void) + { + int err = register_filesystem(&bm_fs_type); +@@ -754,11 +822,17 @@ + if (err) + unregister_filesystem(&bm_fs_type); + } ++ ++ if (!err) { ++ __ve_binfmt_init(get_ve0(), &bm_fs_type); ++ ve_hook_register(VE_SS_CHAIN, &ve_binfmt_hook); ++ } + return err; + } + + static void __exit exit_misc_binfmt(void) + { ++ ve_hook_unregister(&ve_binfmt_hook); + unregister_binfmt(&misc_format); + unregister_filesystem(&bm_fs_type); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/block_dev.c debian/binary-custom.d/openvz/src/fs/block_dev.c +--- ./fs/block_dev.c 2012-06-12 16:25:23.254312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/block_dev.c 2012-11-13 15:20:13.884569121 +0000 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include "internal.h" + +@@ -1124,9 +1125,21 @@ + { + struct module *owner = NULL; + struct gendisk *disk; +- int ret = -ENXIO; ++ int ret; + int part; + ++ /* ++ * We don't check permissions if we already have checked them ++ * and come here from __blkdev_get which is called below ++ */ ++ if (!for_part) { ++ ret = get_device_perms_ve(S_IFBLK, bdev->bd_dev, ++ file->f_mode & (FMODE_READ | FMODE_WRITE)); ++ if (ret) ++ return ret; ++ } ++ ++ ret = -ENXIO; + file->f_mapping = bdev->bd_inode->i_mapping; + lock_kernel(); + disk = get_gendisk(bdev->bd_dev, &part); +@@ -1384,7 +1397,7 @@ + * namespace if possible and return it. Return ERR_PTR(error) + * otherwise. + */ +-struct block_device *lookup_bdev(const char *path) ++struct block_device *lookup_bdev(const char *path, int mode) + { + struct block_device *bdev; + struct inode *inode; +@@ -1402,6 +1415,11 @@ + error = -ENOTBLK; + if (!S_ISBLK(inode->i_mode)) + goto fail; ++ ++ error = get_device_perms_ve(S_IFBLK, inode->i_rdev, mode); ++ if (error) ++ goto fail; ++ + error = -EACCES; + if (nd.mnt->mnt_flags & MNT_NODEV) + goto fail; +@@ -1433,12 +1451,13 @@ + mode_t mode = FMODE_READ; + int error = 0; + +- bdev = lookup_bdev(path); ++ if (!(flags & MS_RDONLY)) ++ mode |= FMODE_WRITE; ++ ++ bdev = lookup_bdev(path, mode); + if (IS_ERR(bdev)) + return bdev; + +- if (!(flags & MS_RDONLY)) +- mode |= FMODE_WRITE; + error = blkdev_get(bdev, mode, 0); + if (error) + return ERR_PTR(error); +@@ -1486,7 +1505,7 @@ + * hold). + */ + shrink_dcache_sb(sb); +- res = invalidate_inodes(sb); ++ res = invalidate_inodes_check(sb, 1); + drop_super(sb); + } + invalidate_bdev(bdev); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/buffer.c debian/binary-custom.d/openvz/src/fs/buffer.c +--- ./fs/buffer.c 2012-06-12 16:25:23.254312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/buffer.c 2012-11-13 15:20:13.884569121 +0000 +@@ -698,6 +698,8 @@ + static int __set_page_dirty(struct page *page, + struct address_space *mapping, int warn) + { ++ int acct = 0; ++ + if (unlikely(!mapping)) + return !TestSetPageDirty(page); + +@@ -712,12 +714,14 @@ + __inc_zone_page_state(page, NR_FILE_DIRTY); + __inc_bdi_stat(mapping->backing_dev_info, + BDI_RECLAIMABLE); +- task_io_account_write(PAGE_CACHE_SIZE); ++ acct = 1; + } + radix_tree_tag_set(&mapping->page_tree, + page_index(page), PAGECACHE_TAG_DIRTY); + } + write_unlock_irq(&mapping->tree_lock); ++ if (acct) ++ task_io_account_write(page, PAGE_CACHE_SIZE, 0); + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); + + return 1; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/char_dev.c debian/binary-custom.d/openvz/src/fs/char_dev.c +--- ./fs/char_dev.c 2012-06-12 16:25:23.254312523 +0100 ++++ debian/binary-custom.d/openvz/src/fs/char_dev.c 2012-11-13 15:20:13.884569121 +0000 +@@ -22,6 +22,8 @@ + #include + #include + ++#include ++ + #ifdef CONFIG_KMOD + #include + #endif +@@ -363,6 +365,11 @@ + struct cdev *new = NULL; + int ret = 0; + ++ ret = get_device_perms_ve(S_IFCHR, inode->i_rdev, ++ filp->f_mode & (FMODE_READ | FMODE_WRITE)); ++ if (ret) ++ return ret; ++ + spin_lock(&cdev_lock); + p = inode->i_cdev; + if (!p) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/compat.c debian/binary-custom.d/openvz/src/fs/compat.c +--- ./fs/compat.c 2012-06-12 16:25:23.274312522 +0100 ++++ debian/binary-custom.d/openvz/src/fs/compat.c 2012-11-13 15:20:13.928569118 +0000 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -50,6 +51,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -72,6 +74,18 @@ + + #include "read_write.h" + ++int ve_compat_printk(int dst, const char *fmt, ...) ++{ ++ va_list ap; ++ int ret; ++ if (!compat_log) ++ return 0; ++ va_start(ap, fmt); ++ ret = ve_vprintk(dst, fmt, ap); ++ va_end(ap); ++ return ret; ++} ++ + /* + * Not all architectures have sys_utime, so implement this in terms + * of sys_utimes. +@@ -243,6 +257,8 @@ + struct kstatfs tmp; + error = vfs_statfs(nd.dentry, &tmp); + if (!error) ++ error = faudit_statfs(nd.mnt->mnt_sb, &tmp); ++ if (!error) + error = put_compat_statfs(buf, &tmp); + path_release(&nd); + } +@@ -261,6 +277,8 @@ + goto out; + error = vfs_statfs(file->f_path.dentry, &tmp); + if (!error) ++ error = faudit_statfs(file->f_vfsmnt->mnt_sb, &tmp); ++ if (!error) + error = put_compat_statfs(buf, &tmp); + fput(file); + out: +@@ -311,6 +329,8 @@ + struct kstatfs tmp; + error = vfs_statfs(nd.dentry, &tmp); + if (!error) ++ error = faudit_statfs(nd.mnt->mnt_sb, &tmp); ++ if (!error) + error = put_compat_statfs64(buf, &tmp); + path_release(&nd); + } +@@ -332,6 +352,8 @@ + goto out; + error = vfs_statfs(file->f_path.dentry, &tmp); + if (!error) ++ error = faudit_statfs(file->f_vfsmnt->mnt_sb, &tmp); ++ if (!error) + error = put_compat_statfs64(buf, &tmp); + fput(file); + out: +@@ -1357,6 +1379,10 @@ + struct file *file; + int retval; + ++ retval = virtinfo_gencall(VIRTINFO_DOEXECVE, NULL); ++ if (retval) ++ return retval; ++ + retval = -ENOMEM; + bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); + if (!bprm) +@@ -1406,6 +1432,11 @@ + if (retval < 0) + goto out; + ++ if (!gr_tpe_allow(file)) { ++ retval = -EACCES; ++ goto out; ++ } ++ + retval = search_binary_handler(bprm, regs); + if (retval >= 0) { + /* execve success */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/dcache.c debian/binary-custom.d/openvz/src/fs/dcache.c +--- ./fs/dcache.c 2012-06-12 16:25:23.278312522 +0100 ++++ debian/binary-custom.d/openvz/src/fs/dcache.c 2012-11-13 15:20:13.932569116 +0000 +@@ -26,13 +26,19 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + #include ++#include ++#include ++#include + #include "internal.h" + ++#include ++#include + + int sysctl_vfs_cache_pressure __read_mostly = 100; + EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure); +@@ -42,7 +48,7 @@ + + EXPORT_SYMBOL(dcache_lock); + +-static struct kmem_cache *dentry_cache __read_mostly; ++struct kmem_cache *dentry_cache __read_mostly; + + #define DNAME_INLINE_LEN (sizeof(struct dentry)-offsetof(struct dentry,d_iname)) + +@@ -135,6 +141,7 @@ + + list_del(&dentry->d_u.d_child); + dentry_stat.nr_dentry--; /* For d_free, below */ ++ preempt_enable_no_resched(); + /*drops the locks, at that point nobody can reach this dentry */ + dentry_iput(dentry); + parent = dentry->d_parent; +@@ -169,25 +176,27 @@ + * they too may now get deleted. + * + * no dcache lock, please. ++ * preemption is disabled by the caller. + */ + +-void dput(struct dentry *dentry) ++static void dput_recursive(struct dentry *dentry) + { +- if (!dentry) +- return; +- + repeat: +- if (atomic_read(&dentry->d_count) == 1) +- might_sleep(); +- if (!atomic_dec_and_lock(&dentry->d_count, &dcache_lock)) +- return; ++ if (unlikely(ub_dentry_on)) { ++ spin_lock(&dcache_lock); ++ if (!atomic_dec_and_test(&dentry->d_count)) { ++ ub_dentry_uncharge_locked(dentry); ++ spin_unlock(&dcache_lock); ++ goto out_preempt; ++ } ++ } else { ++ if (!atomic_dec_and_lock(&dentry->d_count, &dcache_lock)) ++ goto out_preempt; ++ } + + spin_lock(&dentry->d_lock); +- if (atomic_read(&dentry->d_count)) { +- spin_unlock(&dentry->d_lock); +- spin_unlock(&dcache_lock); +- return; +- } ++ if (atomic_read(&dentry->d_count)) ++ goto out_unlock; + + /* + * AV: ->d_delete() is _NOT_ allowed to block now. +@@ -204,8 +213,12 @@ + list_add(&dentry->d_lru, &dentry_unused); + dentry_stat.nr_unused++; + } ++out_unlock: + spin_unlock(&dentry->d_lock); ++ ub_dentry_uncharge_locked(dentry); + spin_unlock(&dcache_lock); ++out_preempt: ++ preempt_enable(); + return; + + unhash_it: +@@ -218,9 +231,31 @@ + list_del(&dentry->d_lru); + dentry_stat.nr_unused--; + } ++ if (unlikely(ub_dentry_on)) { ++ struct user_beancounter *ub; ++ ++ ub = dentry->dentry_bc.d_ub; ++ BUG_ON(!ub_dput_testzero(dentry)); ++ uncharge_dcache(ub, dentry->dentry_bc.d_ubsize); ++ put_beancounter(ub); ++ } + dentry = d_kill(dentry); +- if (dentry) ++ preempt_disable(); ++ if (dentry) + goto repeat; ++ preempt_enable(); ++} ++ ++void dput(struct dentry *dentry) ++{ ++ if (!dentry) ++ return; ++ ++ if (atomic_read(&dentry->d_count) == 1) ++ might_sleep(); ++ ++ preempt_disable(); ++ dput_recursive(dentry); + } + + /** +@@ -289,6 +324,8 @@ + dentry_stat.nr_unused--; + list_del_init(&dentry->d_lru); + } ++ ++ ub_dentry_charge_nofail(dentry); + return dentry; + } + +@@ -391,6 +428,7 @@ + static void prune_one_dentry(struct dentry * dentry) + { + __d_drop(dentry); ++ preempt_disable(); + dentry = d_kill(dentry); + + /* +@@ -409,6 +447,7 @@ + dentry_stat.nr_unused--; + } + __d_drop(dentry); ++ preempt_disable(); + dentry = d_kill(dentry); + spin_lock(&dcache_lock); + } +@@ -709,6 +748,8 @@ + + dentry = sb->s_root; + sb->s_root = NULL; ++ /* "/" was also charged in d_alloc_root() */ ++ ub_dentry_uncharge(dentry); + atomic_dec(&dentry->d_count); + shrink_dcache_for_umount_subtree(dentry); + +@@ -871,12 +912,18 @@ + */ + static int shrink_dcache_memory(int nr, gfp_t gfp_mask) + { ++ int res = -1; ++ ++ KSTAT_PERF_ENTER(shrink_dcache) + if (nr) { + if (!(gfp_mask & __GFP_FS)) +- return -1; ++ goto out; + prune_dcache(nr, NULL); + } +- return (dentry_stat.nr_unused / 100) * sysctl_vfs_cache_pressure; ++ res = (dentry_stat.nr_unused / 100) * sysctl_vfs_cache_pressure; ++out: ++ KSTAT_PERF_LEAVE(shrink_dcache) ++ return res; + } + + static struct shrinker dcache_shrinker = { +@@ -899,21 +946,27 @@ + struct dentry *dentry; + char *dname; + ++ dname = NULL; ++ if (name->len > DNAME_INLINE_LEN-1) { ++ dname = kmalloc(name->len + 1, GFP_KERNEL); ++ if (!dname) ++ goto err_name; ++ } ++ ++ ub_dentry_alloc_start(); ++ + dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL); + if (!dentry) +- return NULL; ++ goto err_alloc; + +- if (name->len > DNAME_INLINE_LEN-1) { +- dname = kmalloc(name->len + 1, GFP_KERNEL); +- if (!dname) { +- kmem_cache_free(dentry_cache, dentry); +- return NULL; +- } +- } else { ++ preempt_disable(); ++ if (dname == NULL) + dname = dentry->d_iname; +- } + dentry->d_name.name = dname; + ++ if (ub_dentry_alloc(dentry)) ++ goto err_charge; ++ + dentry->d_name.len = name->len; + dentry->d_name.hash = name->hash; + memcpy(dname, name->name, name->len); +@@ -944,12 +997,27 @@ + } + + spin_lock(&dcache_lock); +- if (parent) ++ if (parent) { + list_add(&dentry->d_u.d_child, &parent->d_subdirs); ++ if (parent->d_flags & DCACHE_VIRTUAL) ++ dentry->d_flags |= DCACHE_VIRTUAL; ++ } + dentry_stat.nr_dentry++; + spin_unlock(&dcache_lock); ++ preempt_enable(); ++ ub_dentry_alloc_end(); + + return dentry; ++ ++err_charge: ++ preempt_enable(); ++ kmem_cache_free(dentry_cache, dentry); ++err_alloc: ++ if (name->len > DNAME_INLINE_LEN - 1) ++ kfree(dname); ++ ub_dentry_alloc_end(); ++err_name: ++ return NULL; + } + + struct dentry *d_alloc_name(struct dentry *parent, const char *name) +@@ -1255,12 +1323,12 @@ + unsigned int hash = name->hash; + const unsigned char *str = name->name; + struct hlist_head *head = d_hash(parent,hash); +- struct dentry *found = NULL; + struct hlist_node *node; +- struct dentry *dentry; ++ struct dentry *dentry, *found; + + rcu_read_lock(); + ++ found = NULL; + hlist_for_each_entry_rcu(dentry, node, head, d_hash) { + struct qstr *qstr; + +@@ -1297,6 +1365,8 @@ + if (!d_unhashed(dentry)) { + atomic_inc(&dentry->d_count); + found = dentry; ++ if (ub_dentry_charge(found)) ++ goto charge_failure; + } + spin_unlock(&dentry->d_lock); + break; +@@ -1306,6 +1376,14 @@ + rcu_read_unlock(); + + return found; ++ ++charge_failure: ++ spin_unlock(&found->d_lock); ++ rcu_read_unlock(); ++ /* dentry is now unhashed, just kill it */ ++ dput(found); ++ /* ... and fail lookup */ ++ return NULL; + } + + /** +@@ -1761,132 +1839,143 @@ + } + + /** +- * __d_path - return the path of a dentry ++ * __d_path_add_deleted - prepend "(deleted) " text ++ * @end: a pointer to the character after free space at the beginning of the ++ * buffer ++ * @buflen: remaining free space ++ */ ++static inline char * __d_path_add_deleted(char * end, int buflen) ++{ ++ buflen -= 10; ++ if (buflen < 0) ++ return ERR_PTR(-ENAMETOOLONG); ++ end -= 10; ++ memcpy(end, "(deleted) ", 10); ++ return end; ++} ++ ++/** ++ * d_root_check - checks if dentry is accessible from current's fs root ++ * @dentry: dentry to be verified ++ * @vfsmnt: vfsmnt to which the dentry belongs ++ */ ++int d_root_check(struct dentry *dentry, struct vfsmount *vfsmnt) ++{ ++ return PTR_ERR(d_path(dentry, vfsmnt, NULL, 0)); ++} ++ ++/** ++ * d_path - return the path of a dentry + * @dentry: dentry to report + * @vfsmnt: vfsmnt to which the dentry belongs + * @root: root dentry + * @rootmnt: vfsmnt to which the root dentry belongs + * @buffer: buffer to return value in + * @buflen: buffer length +- * @fail_deleted: what to return for deleted files + * +- * Convert a dentry into an ASCII path name. If the entry has been deleted, +- * then if @fail_deleted is true, ERR_PTR(-ENOENT) is returned. Otherwise, ++ * Convert a dentry into an ASCII path name. If the entry has been deleted + * the string " (deleted)" is appended. Note that this is ambiguous. + * +- * If @dentry is not connected to @root, the path returned will be relative +- * (i.e., it will not start with a slash). ++ * Returns the buffer or an error code if the path was too long. + * +- * Returns the buffer or an error code. ++ * "buflen" should be positive. Caller holds the dcache_lock. + */ +-char *__d_path(struct dentry *dentry, struct vfsmount *vfsmnt, +- struct dentry *root, struct vfsmount *rootmnt, +- char *buffer, int buflen, int fail_deleted) +-{ +- int namelen, is_slash, vfsmount_locked = 0; +- +- if (buflen < 2) +- return ERR_PTR(-ENAMETOOLONG); +- buffer += --buflen; +- *buffer = '\0'; ++char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt, ++ struct dentry *root, struct vfsmount *rootmnt, ++ char *buffer, int buflen) ++{ ++ char * end = buffer+buflen; ++ char * retval = NULL; ++ int namelen; ++ int deleted; ++ struct vfsmount *oldvfsmnt; ++ ++ oldvfsmnt = vfsmnt; ++ deleted = (!IS_ROOT(dentry) && d_unhashed(dentry)); ++ if (buffer != NULL) { ++ *--end = '\0'; ++ buflen--; + +- spin_lock(&dcache_lock); +- if (!IS_ROOT(dentry) && d_unhashed(dentry)) { +- if (fail_deleted) { +- buffer = ERR_PTR(-ENOENT); +- goto out; +- } +- if (buflen < 10) ++ if (buflen < 1) + goto Elong; +- buflen -= 10; +- buffer -= 10; +- memcpy(buffer, " (deleted)", 10); ++ /* Get '/' right */ ++ retval = end-1; ++ *retval = '/'; + } +- while (dentry != root || vfsmnt != rootmnt) { ++ ++ for (;;) { + struct dentry * parent; + ++ if (dentry == root && vfsmnt == rootmnt) ++ break; + if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) { +- if (!vfsmount_locked) { +- spin_lock(&vfsmount_lock); +- vfsmount_locked = 1; ++ /* root of a tree? */ ++ spin_lock(&vfsmount_lock); ++ if (vfsmnt->mnt_parent == vfsmnt) { ++ spin_unlock(&vfsmount_lock); ++ goto other_root; + } +- if (vfsmnt->mnt_parent == vfsmnt) +- goto global_root; + dentry = vfsmnt->mnt_mountpoint; + vfsmnt = vfsmnt->mnt_parent; ++ spin_unlock(&vfsmount_lock); + continue; + } + parent = dentry->d_parent; + prefetch(parent); +- namelen = dentry->d_name.len; +- if (buflen < namelen + 1) +- goto Elong; +- buflen -= namelen + 1; +- buffer -= namelen; +- memcpy(buffer, dentry->d_name.name, namelen); +- *--buffer = '/'; ++ if (buffer != NULL) { ++ namelen = dentry->d_name.len; ++ buflen -= namelen + 1; ++ if (buflen < 0) ++ goto Elong; ++ end -= namelen; ++ memcpy(end, dentry->d_name.name, namelen); ++ *--end = '/'; ++ retval = end; ++ } + dentry = parent; + } +- /* Get '/' right. */ +- if (*buffer != '/') +- *--buffer = '/'; ++ /* the given root point is reached */ ++finish: ++ if (buffer != NULL && deleted) ++ retval = __d_path_add_deleted(end, buflen); ++ return retval; + +-out: +- if (vfsmount_locked) +- spin_unlock(&vfsmount_lock); +- spin_unlock(&dcache_lock); +- return buffer; +- +-global_root: ++other_root: + /* +- * We went past the (vfsmount, dentry) we were looking for and have +- * either hit a root dentry, a lazily unmounted dentry, an +- * unconnected dentry, or the file is on a pseudo filesystem. ++ * We traversed the tree upward and reached a root, but the given ++ * lookup terminal point wasn't encountered. It means either that the ++ * dentry is out of our scope or belongs to an abstract space like ++ * sock_mnt or pipe_mnt. Check for it. ++ * ++ * There are different options to check it. ++ * We may assume that any dentry tree is unreachable unless it's ++ * connected to `root' (defined as fs root of init aka child reaper) ++ * and expose all paths that are not connected to it. ++ * The other option is to allow exposing of known abstract spaces ++ * explicitly and hide the path information for other cases. ++ * This approach is more safe, let's take it. 2001/04/22 SAW + */ +- namelen = dentry->d_name.len; +- is_slash = (namelen == 1 && *dentry->d_name.name == '/'); +- if (is_slash || (dentry->d_sb->s_flags & MS_NOUSER)) { +- /* +- * Make sure we won't return a pathname starting with '/'. +- * +- * Historically, we also glue together the root dentry and +- * remaining name for pseudo filesystems like pipefs, which +- * have the MS_NOUSER flag set. This results in pathnames +- * like "pipe:[439336]". +- */ +- if (*buffer == '/') { +- buffer++; +- buflen++; +- } +- if (is_slash) +- goto out; ++ if (!(oldvfsmnt->mnt_sb->s_flags & MS_NOUSER)) ++ return ERR_PTR(-EINVAL); ++ if (buffer != NULL) { ++ namelen = dentry->d_name.len; ++ buflen -= namelen; ++ if (buflen < 0) ++ goto Elong; ++ retval -= namelen-1; /* hit the slash */ ++ memcpy(retval, dentry->d_name.name, namelen); + } +- if (buflen < namelen) +- goto Elong; +- buffer -= namelen; +- memcpy(buffer, dentry->d_name.name, namelen); +- goto out; ++ goto finish; + + Elong: +- buffer = ERR_PTR(-ENAMETOOLONG); +- goto out; ++ return ERR_PTR(-ENAMETOOLONG); + } + +-static char *__connect_d_path(char *path, char *buffer) +-{ +- if (!IS_ERR(path) && *path != '/') { +- /* Pretend that disconnected paths are hanging off the root. */ +- if (path == buffer) +- path = ERR_PTR(-ENAMETOOLONG); +- else +- *--path = '/'; +- } +- return path; +-} ++EXPORT_SYMBOL(__d_path); + + /* write full pathname into buffer and return start of pathname */ +-char *d_path(struct dentry *dentry, struct vfsmount *vfsmnt, char *buf, +- int buflen) ++char * d_path(struct dentry *dentry, struct vfsmount *vfsmnt, ++ char *buf, int buflen) + { + char *res; + struct vfsmount *rootmnt; +@@ -1898,21 +1987,248 @@ + * thus don't need to be hashed. They also don't need a name until a + * user wants to identify the object in /proc/pid/fd/. The little hack + * below allows us to generate a name for these objects on demand: ++ * ++ * pipefs and socketfs methods assume valid buffer, d_root_check() ++ * supplies NULL one for access checks. + */ +- if (dentry->d_op && dentry->d_op->d_dname) ++ if (buf && dentry->d_op && dentry->d_op->d_dname) + return dentry->d_op->d_dname(dentry, buf, buflen); + + read_lock(¤t->fs->lock); + rootmnt = mntget(current->fs->rootmnt); + root = dget(current->fs->root); + read_unlock(¤t->fs->lock); +- res = __d_path(dentry, vfsmnt, root, rootmnt, buf, buflen, 0); +- res = __connect_d_path(res, buf); ++ spin_lock(&dcache_lock); ++ res = __d_path(dentry, vfsmnt, root, rootmnt, buf, buflen); ++ spin_unlock(&dcache_lock); + dput(root); + mntput(rootmnt); + return res; + } + ++#ifdef CONFIG_VE ++#include ++#include ++#include ++#include ++#include ++ ++static void mark_sub_tree_virtual(struct dentry *d) ++{ ++ struct dentry *orig_root; ++ ++ orig_root = d; ++ while (1) { ++ spin_lock(&d->d_lock); ++ d->d_flags |= DCACHE_VIRTUAL; ++ spin_unlock(&d->d_lock); ++ ++ if (!list_empty(&d->d_subdirs)) { ++ d = list_entry(d->d_subdirs.next, ++ struct dentry, d_u.d_child); ++ continue; ++ } ++ if (d == orig_root) ++ break; ++ while (d == list_entry(d->d_parent->d_subdirs.prev, ++ struct dentry, d_u.d_child)) { ++ d = d->d_parent; ++ if (d == orig_root) ++ goto out; ++ } ++ d = list_entry(d->d_u.d_child.next, ++ struct dentry, d_u.d_child); ++ } ++out: ++ return; ++} ++ ++void mark_tree_virtual(struct vfsmount *m, struct dentry *d) ++{ ++ struct vfsmount *orig_rootmnt; ++ ++ spin_lock(&dcache_lock); ++ spin_lock(&vfsmount_lock); ++ orig_rootmnt = m; ++ while (1) { ++ mark_sub_tree_virtual(d); ++ if (!list_empty(&m->mnt_mounts)) { ++ m = list_entry(m->mnt_mounts.next, ++ struct vfsmount, mnt_child); ++ d = m->mnt_root; ++ continue; ++ } ++ if (m == orig_rootmnt) ++ break; ++ while (m == list_entry(m->mnt_parent->mnt_mounts.prev, ++ struct vfsmount, mnt_child)) { ++ m = m->mnt_parent; ++ if (m == orig_rootmnt) ++ goto out; ++ } ++ m = list_entry(m->mnt_child.next, ++ struct vfsmount, mnt_child); ++ d = m->mnt_root; ++ } ++out: ++ spin_unlock(&vfsmount_lock); ++ spin_unlock(&dcache_lock); ++} ++EXPORT_SYMBOL(mark_tree_virtual); ++ ++static struct vz_rate_info area_ri = { 20, 10*HZ }; ++#define VE_AREA_ACC_CHECK 0x0001 ++#define VE_AREA_ACC_DENY 0x0002 ++#define VE_AREA_EXEC_CHECK 0x0010 ++#define VE_AREA_EXEC_DENY 0x0020 ++#define VE0_AREA_ACC_CHECK 0x0100 ++#define VE0_AREA_ACC_DENY 0x0200 ++#define VE0_AREA_EXEC_CHECK 0x1000 ++#define VE0_AREA_EXEC_DENY 0x2000 ++int ve_area_access_check = 0; ++ ++static void print_connection_info(struct task_struct *tsk) ++{ ++ struct files_struct *files; ++ struct fdtable *fdt; ++ int fd; ++ ++ files = get_files_struct(tsk); ++ if (!files) ++ return; ++ ++ spin_lock(&files->file_lock); ++ fdt = files_fdtable(files); ++ for (fd = 0; fd < fdt->max_fds; fd++) { ++ struct file *file; ++ struct inode *inode; ++ struct socket *socket; ++ struct sock *sk; ++ struct inet_sock *inet; ++ ++ file = fdt->fd[fd]; ++ if (file == NULL) ++ continue; ++ ++ inode = file->f_dentry->d_inode; ++ if (!S_ISSOCK(inode->i_mode)) ++ continue; ++ ++ socket = SOCKET_I(inode); ++ if (socket == NULL) ++ continue; ++ ++ sk = socket->sk; ++ if ((sk->sk_family != PF_INET && sk->sk_family != PF_INET6) ++ || sk->sk_type != SOCK_STREAM) ++ continue; ++ ++ inet = inet_sk(sk); ++ printk(KERN_ALERT "connection from %u.%u.%u.%u:%u to port %u\n", ++ NIPQUAD(inet->daddr), ntohs(inet->dport), ++ inet->num); ++ } ++ spin_unlock(&files->file_lock); ++ put_files_struct(files); ++} ++ ++static void check_alert(struct vfsmount *vfsmnt, struct dentry *dentry, ++ char *str) ++{ ++ struct task_struct *tsk; ++ unsigned long page; ++ struct super_block *sb; ++ char *p; ++ ++ if (!vz_ratelimit(&area_ri)) ++ return; ++ ++ tsk = current; ++ p = ERR_PTR(-ENOMEM); ++ page = __get_free_page(GFP_KERNEL); ++ if (page) { ++ spin_lock(&dcache_lock); ++ p = __d_path(dentry, vfsmnt, tsk->fs->root, tsk->fs->rootmnt, ++ (char *)page, PAGE_SIZE); ++ spin_unlock(&dcache_lock); ++ } ++ if (IS_ERR(p)) ++ p = "(undefined)"; ++ ++ sb = dentry->d_sb; ++ printk(KERN_ALERT "%s check alert! file:[%s] from %d/%s, dev%x\n" ++ "Task %d/%d[%s] from VE%d, execenv %d\n", ++ str, p, sb->s_type->owner_env->veid, ++ sb->s_type->name, sb->s_dev, ++ tsk->pid, task_pid_vnr(tsk), tsk->comm, ++ VE_TASK_INFO(tsk)->owner_env->veid, ++ get_exec_env()->veid); ++ ++ free_page(page); ++ ++ print_connection_info(tsk); ++ ++ read_lock(&tasklist_lock); ++ tsk = tsk->parent; ++ get_task_struct(tsk); ++ read_unlock(&tasklist_lock); ++ ++ printk(KERN_ALERT "Parent %d/%d[%s] from VE%d\n", ++ tsk->pid, task_pid_vnr(tsk), tsk->comm, ++ VE_TASK_INFO(tsk)->owner_env->veid); ++ ++ print_connection_info(tsk); ++ put_task_struct(tsk); ++ dump_stack(); ++} ++#endif ++ ++int check_area_access_ve(struct dentry *dentry, struct vfsmount *mnt) ++{ ++#ifdef CONFIG_VE ++ int check, alert, deny; ++ ++ if (ve_is_super(get_exec_env())) { ++ check = ve_area_access_check & VE0_AREA_ACC_CHECK; ++ alert = dentry->d_flags & DCACHE_VIRTUAL; ++ deny = ve_area_access_check & VE0_AREA_ACC_DENY; ++ } else { ++ check = ve_area_access_check & VE_AREA_ACC_CHECK; ++ alert = !(dentry->d_flags & DCACHE_VIRTUAL); ++ deny = ve_area_access_check & VE_AREA_ACC_DENY; ++ } ++ ++ if (check && alert) ++ check_alert(mnt, dentry, "Access"); ++ if (deny && alert) ++ return -EACCES; ++#endif ++ return 0; ++} ++ ++int check_area_execute_ve(struct dentry *dentry, struct vfsmount *mnt) ++{ ++#ifdef CONFIG_VE ++ int check, alert, deny; ++ ++ if (ve_is_super(get_exec_env())) { ++ check = ve_area_access_check & VE0_AREA_EXEC_CHECK; ++ alert = dentry->d_flags & DCACHE_VIRTUAL; ++ deny = ve_area_access_check & VE0_AREA_EXEC_DENY; ++ } else { ++ check = ve_area_access_check & VE_AREA_EXEC_CHECK; ++ alert = !(dentry->d_flags & DCACHE_VIRTUAL); ++ deny = ve_area_access_check & VE_AREA_EXEC_DENY; ++ } ++ ++ if (check && alert) ++ check_alert(mnt, dentry, "Exec"); ++ if (deny && alert) ++ return -EACCES; ++#endif ++ return 0; ++} ++ + /* + * Helper function for dentry_operations.d_dname() members + */ +@@ -1954,10 +2270,10 @@ + */ + asmlinkage long sys_getcwd(char __user *buf, unsigned long size) + { +- int error, len; ++ int error; + struct vfsmount *pwdmnt, *rootmnt; + struct dentry *pwd, *root; +- char *page = (char *) __get_free_page(GFP_USER), *cwd; ++ char *page = (char *) __get_free_page(GFP_USER); + + if (!page) + return -ENOMEM; +@@ -1969,19 +2285,29 @@ + root = dget(current->fs->root); + read_unlock(¤t->fs->lock); + +- cwd = __d_path(pwd, pwdmnt, root, rootmnt, page, PAGE_SIZE, 1); +- cwd = __connect_d_path(cwd, page); +- error = PTR_ERR(cwd); +- if (IS_ERR(cwd)) +- goto out; ++ error = -ENOENT; ++ /* Has the current directory has been unlinked? */ ++ spin_lock(&dcache_lock); ++ if (pwd->d_parent == pwd || !d_unhashed(pwd)) { ++ unsigned long len; ++ char * cwd; + +- error = -ERANGE; +- len = PAGE_SIZE + page - cwd; +- if (len <= size) { +- error = len; +- if (copy_to_user(buf, cwd, len)) +- error = -EFAULT; +- } ++ cwd = __d_path(pwd, pwdmnt, root, rootmnt, page, PAGE_SIZE); ++ spin_unlock(&dcache_lock); ++ ++ error = PTR_ERR(cwd); ++ if (IS_ERR(cwd)) ++ goto out; ++ ++ error = -ERANGE; ++ len = PAGE_SIZE + page - cwd; ++ if (len <= size) { ++ error = len; ++ if (copy_to_user(buf, cwd, len)) ++ error = -EFAULT; ++ } ++ } else ++ spin_unlock(&dcache_lock); + + out: + dput(pwd); +@@ -2060,10 +2386,12 @@ + goto repeat; + } + atomic_dec(&dentry->d_count); ++ ub_dentry_uncharge_locked(dentry); + } + if (this_parent != root) { + next = this_parent->d_u.d_child.next; + atomic_dec(&this_parent->d_count); ++ ub_dentry_uncharge_locked(this_parent); + this_parent = this_parent->d_parent; + goto resume; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/devpts/inode.c debian/binary-custom.d/openvz/src/fs/devpts/inode.c +--- ./fs/devpts/inode.c 2012-06-12 16:25:23.278312522 +0100 ++++ debian/binary-custom.d/openvz/src/fs/devpts/inode.c 2012-11-13 15:20:13.932569116 +0000 +@@ -20,19 +20,21 @@ + #include + #include + #include ++#include + + #define DEVPTS_SUPER_MAGIC 0x1cd1 + ++struct devpts_config devpts_config = {.mode = 0600}; ++ ++#ifndef CONFIG_VE + static struct vfsmount *devpts_mnt; + static struct dentry *devpts_root; +- +-static struct { +- int setuid; +- int setgid; +- uid_t uid; +- gid_t gid; +- umode_t mode; +-} config = {.mode = 0600}; ++#define config devpts_config ++#else ++#define devpts_mnt (get_exec_env()->devpts_mnt) ++#define devpts_root (get_exec_env()->devpts_root) ++#define config (*(get_exec_env()->devpts_config)) ++#endif + + enum { + Opt_uid, Opt_gid, Opt_mode, +@@ -84,7 +86,8 @@ + config.mode = option & ~S_IFMT; + break; + default: +- printk(KERN_ERR "devpts: called with bogus options\n"); ++ ve_printk(VE_LOG, KERN_ERR ++ "devpts: called with bogus options\n"); + return -EINVAL; + } + } +@@ -136,13 +139,15 @@ + return get_sb_single(fs_type, flags, data, devpts_fill_super, mnt); + } + +-static struct file_system_type devpts_fs_type = { ++struct file_system_type devpts_fs_type = { + .owner = THIS_MODULE, + .name = "devpts", + .get_sb = devpts_get_sb, + .kill_sb = kill_anon_super, + }; + ++EXPORT_SYMBOL(devpts_fs_type); ++ + /* + * The normal naming convention is simply /dev/pts/; this conforms + * to the System V naming convention +@@ -235,6 +240,7 @@ + + static void __exit exit_devpts_fs(void) + { ++ /* the code is never called, the argument is irrelevant */ + unregister_filesystem(&devpts_fs_type); + mntput(devpts_mnt); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/direct-io.c debian/binary-custom.d/openvz/src/fs/direct-io.c +--- ./fs/direct-io.c 2012-06-12 16:25:23.278312522 +0100 ++++ debian/binary-custom.d/openvz/src/fs/direct-io.c 2012-11-13 15:20:13.932569116 +0000 +@@ -666,7 +666,7 @@ + /* + * Read accounting is performed in submit_bio() + */ +- task_io_account_write(len); ++ task_io_account_write(page, len, 1); + } + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/dquot.c debian/binary-custom.d/openvz/src/fs/dquot.c +--- ./fs/dquot.c 2012-06-12 16:25:23.294312522 +0100 ++++ debian/binary-custom.d/openvz/src/fs/dquot.c 2012-11-13 15:20:13.956569117 +0000 +@@ -162,7 +162,9 @@ + struct quota_format_type *actqf; + + spin_lock(&dq_list_lock); +- for (actqf = quota_formats; actqf && actqf->qf_fmt_id != id; actqf = actqf->qf_next); ++ for (actqf = quota_formats; ++ actqf && (actqf->qf_fmt_id != id || actqf->qf_ops == NULL); ++ actqf = actqf->qf_next); + if (!actqf || !try_module_get(actqf->qf_owner)) { + int qm; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/ecryptfs/netlink.c debian/binary-custom.d/openvz/src/fs/ecryptfs/netlink.c +--- ./fs/ecryptfs/netlink.c 2012-06-12 16:25:23.298312521 +0100 ++++ debian/binary-custom.d/openvz/src/fs/ecryptfs/netlink.c 2012-11-13 15:20:13.968569115 +0000 +@@ -237,7 +237,6 @@ + */ + void ecryptfs_release_netlink(void) + { +- if (ecryptfs_nl_sock && ecryptfs_nl_sock->sk_socket) +- sock_release(ecryptfs_nl_sock->sk_socket); ++ netlink_kernel_release(ecryptfs_nl_sock); + ecryptfs_nl_sock = NULL; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/eventpoll.c debian/binary-custom.d/openvz/src/fs/eventpoll.c +--- ./fs/eventpoll.c 2012-06-12 16:25:23.298312521 +0100 ++++ debian/binary-custom.d/openvz/src/fs/eventpoll.c 2012-11-13 15:20:13.968569115 +0000 +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -102,11 +103,6 @@ + + #define EP_UNACTIVE_PTR ((void *) -1L) + +-struct epoll_filefd { +- struct file *file; +- int fd; +-}; +- + /* + * Node that is linked into the "wake_task_list" member of the "struct poll_safewake". + * It is used to keep track on all tasks that are currently inside the wake_up() code +@@ -129,79 +125,6 @@ + spinlock_t lock; + }; + +-/* +- * Each file descriptor added to the eventpoll interface will +- * have an entry of this type linked to the "rbr" RB tree. +- */ +-struct epitem { +- /* RB tree node used to link this structure to the eventpoll RB tree */ +- struct rb_node rbn; +- +- /* List header used to link this structure to the eventpoll ready list */ +- struct list_head rdllink; +- +- /* +- * Works together "struct eventpoll"->ovflist in keeping the +- * single linked chain of items. +- */ +- struct epitem *next; +- +- /* The file descriptor information this item refers to */ +- struct epoll_filefd ffd; +- +- /* Number of active wait queue attached to poll operations */ +- int nwait; +- +- /* List containing poll wait queues */ +- struct list_head pwqlist; +- +- /* The "container" of this item */ +- struct eventpoll *ep; +- +- /* List header used to link this item to the "struct file" items list */ +- struct list_head fllink; +- +- /* The structure that describe the interested events and the source fd */ +- struct epoll_event event; +-}; +- +-/* +- * This structure is stored inside the "private_data" member of the file +- * structure and rapresent the main data sructure for the eventpoll +- * interface. +- */ +-struct eventpoll { +- /* Protect the this structure access */ +- spinlock_t lock; +- +- /* +- * This mutex is used to ensure that files are not removed +- * while epoll is using them. This is held during the event +- * collection loop, the file cleanup path, the epoll file exit +- * code and the ctl operations. +- */ +- struct mutex mtx; +- +- /* Wait queue used by sys_epoll_wait() */ +- wait_queue_head_t wq; +- +- /* Wait queue used by file->poll() */ +- wait_queue_head_t poll_wait; +- +- /* List of ready file descriptors */ +- struct list_head rdllist; +- +- /* RB tree root used to store monitored fd structs */ +- struct rb_root rbr; +- +- /* +- * This is a single linked list that chains all the "struct epitem" that +- * happened while transfering ready events to userspace w/out +- * holding ->lock. +- */ +- struct epitem *ovflist; +-}; +- + /* Wait structure used by the poll hooks */ + struct eppoll_entry { + /* List header used to link this structure to the "struct epitem" */ +@@ -229,7 +152,8 @@ + /* + * This mutex is used to serialize ep_free() and eventpoll_release_file(). + */ +-static struct mutex epmutex; ++struct mutex epmutex; ++EXPORT_SYMBOL_GPL(epmutex); + + /* Safe wake up implementation */ + static struct poll_safewake psw; +@@ -502,10 +426,11 @@ + } + + /* File callbacks that implement the eventpoll file behaviour */ +-static const struct file_operations eventpoll_fops = { ++const struct file_operations eventpoll_fops = { + .release = ep_eventpoll_release, + .poll = ep_eventpoll_poll + }; ++EXPORT_SYMBOL(eventpoll_fops); + + /* Fast test to see if the file is an evenpoll file */ + static inline int is_file_epoll(struct file *f) +@@ -577,7 +502,7 @@ + * are protected by the "mtx" mutex, and ep_find() must be called with + * "mtx" held. + */ +-static struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd) ++struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd) + { + int kcmp; + struct rb_node *rbp; +@@ -603,6 +528,7 @@ + + return epir; + } ++EXPORT_SYMBOL_GPL(ep_find); + + /* + * This is the callback that is passed to the wait queue wakeup +@@ -716,7 +642,7 @@ + /* + * Must be called with "mtx" held. + */ +-static int ep_insert(struct eventpoll *ep, struct epoll_event *event, ++int ep_insert(struct eventpoll *ep, struct epoll_event *event, + struct file *tfile, int fd) + { + int error, revents, pwake = 0; +@@ -814,6 +740,7 @@ + error_return: + return error; + } ++EXPORT_SYMBOL(ep_insert); + + /* + * Modify the interest event mask by dropping an event if the new mask +@@ -1109,6 +1036,7 @@ + current, size, error)); + return error; + } ++EXPORT_SYMBOL(sys_epoll_create); + + /* + * The following function implements the controller interface for +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/exec.c debian/binary-custom.d/openvz/src/fs/exec.c +--- ./fs/exec.c 2012-06-12 16:25:23.298312521 +0100 ++++ debian/binary-custom.d/openvz/src/fs/exec.c 2012-11-13 15:20:13.968569115 +0000 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -51,11 +52,14 @@ + #include + #include + #include ++#include + + #include + #include + #include + ++#include ++ + #ifdef CONFIG_KMOD + #include + #endif +@@ -66,6 +70,8 @@ + + /* The maximal length of core_pattern is also specified in sysctl.c */ + ++int sysctl_at_vsyscall; ++ + static LIST_HEAD(formats); + static DEFINE_RWLOCK(binfmt_lock); + +@@ -217,9 +223,13 @@ + struct vm_area_struct *vma = NULL; + struct mm_struct *mm = bprm->mm; + +- bprm->vma = vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); ++ if (ub_memory_charge(mm, PAGE_SIZE, VM_STACK_FLAGS | mm->def_flags, ++ NULL, UB_SOFT)) ++ goto fail_charge; ++ ++ bprm->vma = vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL_UBC); + if (!vma) +- goto err; ++ goto fail_alloc; + + down_write(&mm->mmap_sem); + vma->vm_mm = mm; +@@ -258,7 +268,9 @@ + bprm->vma = NULL; + kmem_cache_free(vm_area_cachep, vma); + } +- ++fail_alloc: ++ ub_memory_uncharge(mm, PAGE_SIZE, VM_STACK_FLAGS | mm->def_flags, NULL); ++fail_charge: + return err; + } + +@@ -705,10 +717,11 @@ + + EXPORT_SYMBOL(kernel_read); + +-static int exec_mmap(struct mm_struct *mm) ++static int exec_mmap(struct linux_binprm *bprm) + { + struct task_struct *tsk; +- struct mm_struct * old_mm, *active_mm; ++ struct mm_struct *old_mm, *active_mm, *mm; ++ int ret; + + /* Notify parent that we're no longer interested in the old VM */ + tsk = current; +@@ -730,6 +743,10 @@ + return -EINTR; + } + } ++ ++ ret = 0; ++ mm = bprm->mm; ++ mm->vps_dumpable = 1; + task_lock(tsk); + active_mm = tsk->active_mm; + tsk->mm = mm; +@@ -737,14 +754,24 @@ + activate_mm(active_mm, mm); + task_unlock(tsk); + arch_pick_mmap_layout(mm); ++ bprm->mm = NULL; /* We're using it now */ ++ ++#ifdef CONFIG_VZ_GENCALLS ++ if (virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_EXECMMAP, ++ bprm) & NOTIFY_FAIL) { ++ /* similar to binfmt_elf */ ++ send_sig(SIGKILL, current, 0); ++ ret = -ENOMEM; ++ } ++#endif + if (old_mm) { + up_read(&old_mm->mmap_sem); + BUG_ON(active_mm != old_mm); + mmput(old_mm); +- return 0; ++ return ret; + } + mmdrop(active_mm); +- return 0; ++ return ret; + } + + /* +@@ -871,6 +898,10 @@ + transfer_pid(leader, tsk, PIDTYPE_PGID); + transfer_pid(leader, tsk, PIDTYPE_SID); + list_replace_rcu(&leader->tasks, &tsk->tasks); ++#ifdef CONFIG_VE ++ list_replace_rcu(&leader->ve_task_info.vetask_list, ++ &tsk->ve_task_info.vetask_list); ++#endif + + tsk->group_leader = tsk; + leader->group_leader = tsk; +@@ -997,11 +1028,10 @@ + /* + * Release all of the old mmap stuff + */ +- retval = exec_mmap(bprm->mm); ++ retval = exec_mmap(bprm); + if (retval) + goto mmap_failed; + +- bprm->mm = NULL; /* We're using it now */ + put_files_struct(files); + + current->flags &= ~PF_RANDOMIZE; +@@ -1314,6 +1344,10 @@ + unsigned long env_p; + int retval; + ++ retval = virtinfo_gencall(VIRTINFO_DOEXECVE, NULL); ++ if (retval) ++ return retval; ++ + retval = -ENOMEM; + bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); + if (!bprm) +@@ -1365,6 +1399,11 @@ + goto out; + bprm->argv_len = env_p - bprm->p; + ++ if (!gr_tpe_allow(file)) { ++ retval = -EACCES; ++ goto out; ++ } ++ + retval = search_binary_handler(bprm,regs); + if (retval >= 0) { + /* execve success */ +@@ -1577,7 +1616,7 @@ + goto done; + + rcu_read_lock(); +- for_each_process(g) { ++ for_each_process_ve(g) { + if (g == tsk->group_leader) + continue; + +@@ -1711,7 +1750,7 @@ + /* + * If another thread got here first, or we are not dumpable, bail out. + */ +- if (mm->core_waiters || !get_dumpable(mm)) { ++ if (mm->core_waiters || !get_dumpable(mm) || mm->vps_dumpable != 1) { + up_write(&mm->mmap_sem); + goto fail; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/ext2/namei.c debian/binary-custom.d/openvz/src/fs/ext2/namei.c +--- ./fs/ext2/namei.c 2012-06-12 16:25:23.306312521 +0100 ++++ debian/binary-custom.d/openvz/src/fs/ext2/namei.c 2012-11-13 15:20:13.976569118 +0000 +@@ -31,6 +31,7 @@ + */ + + #include ++#include + #include "ext2.h" + #include "xattr.h" + #include "acl.h" +@@ -257,6 +258,8 @@ + struct page * page; + int err = -ENOENT; + ++ DQUOT_INIT(inode); ++ + de = ext2_find_entry (dir, dentry, &page); + if (!de) + goto out; +@@ -299,6 +302,9 @@ + struct ext2_dir_entry_2 * old_de; + int err = -ENOENT; + ++ if (new_inode) ++ DQUOT_INIT(new_inode); ++ + old_de = ext2_find_entry (old_dir, old_dentry, &old_page); + if (!old_de) + goto out; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/ext2/super.c debian/binary-custom.d/openvz/src/fs/ext2/super.c +--- ./fs/ext2/super.c 2012-06-12 16:25:23.306312521 +0100 ++++ debian/binary-custom.d/openvz/src/fs/ext2/super.c 2012-11-13 15:20:13.976569118 +0000 +@@ -1377,7 +1377,7 @@ + .name = "ext2", + .get_sb = ext2_get_sb, + .kill_sb = kill_block_super, +- .fs_flags = FS_REQUIRES_DEV, ++ .fs_flags = FS_REQUIRES_DEV | FS_VIRTUALIZED, + }; + + static int __init init_ext2_fs(void) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/ext3/ioctl.c debian/binary-custom.d/openvz/src/fs/ext3/ioctl.c +--- ./fs/ext3/ioctl.c 2012-06-12 16:25:23.310312521 +0100 ++++ debian/binary-custom.d/openvz/src/fs/ext3/ioctl.c 2012-11-13 15:20:13.984569116 +0000 +@@ -79,7 +79,7 @@ + * the relevant capability. + */ + if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) { +- if (!capable(CAP_SYS_RESOURCE)) { ++ if (!capable(CAP_SYS_ADMIN)) { + mutex_unlock(&inode->i_mutex); + return -EPERM; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/ext3/namei.c debian/binary-custom.d/openvz/src/fs/ext3/namei.c +--- ./fs/ext3/namei.c 2012-06-12 16:25:23.314312521 +0100 ++++ debian/binary-custom.d/openvz/src/fs/ext3/namei.c 2012-11-13 15:20:13.984569116 +0000 +@@ -1355,7 +1355,7 @@ + if (err) + ext3_std_error(dir->i_sb, err); + brelse(bh); +- return 0; ++ return err; + } + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/ext3/super.c debian/binary-custom.d/openvz/src/fs/ext3/super.c +--- ./fs/ext3/super.c 2012-06-12 16:25:23.318312521 +0100 ++++ debian/binary-custom.d/openvz/src/fs/ext3/super.c 2012-11-13 15:20:13.984569116 +0000 +@@ -2869,7 +2869,7 @@ + .name = "ext3", + .get_sb = ext3_get_sb, + .kill_sb = kill_block_super, +- .fs_flags = FS_REQUIRES_DEV, ++ .fs_flags = FS_REQUIRES_DEV | FS_VIRTUALIZED, + }; + + static int __init init_ext3_fs(void) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/ext4/ioctl.c debian/binary-custom.d/openvz/src/fs/ext4/ioctl.c +--- ./fs/ext4/ioctl.c 2012-06-12 16:25:23.322312520 +0100 ++++ debian/binary-custom.d/openvz/src/fs/ext4/ioctl.c 2012-11-13 15:20:13.996569114 +0000 +@@ -79,7 +79,7 @@ + * the relevant capability. + */ + if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) { +- if (!capable(CAP_SYS_RESOURCE)) { ++ if (!capable(CAP_SYS_ADMIN)) { + mutex_unlock(&inode->i_mutex); + return -EPERM; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/fcntl.c debian/binary-custom.d/openvz/src/fs/fcntl.c +--- ./fs/fcntl.c 2012-06-12 16:25:23.330312520 +0100 ++++ debian/binary-custom.d/openvz/src/fs/fcntl.c 2012-11-13 15:20:14.000569116 +0000 +@@ -192,6 +192,7 @@ + fput(file); + goto out; + } ++EXPORT_SYMBOL_GPL(sys_dup2); + + asmlinkage long sys_dup(unsigned int fildes) + { +@@ -210,6 +211,9 @@ + struct inode * inode = filp->f_path.dentry->d_inode; + int error = 0; + ++ if (!capable(CAP_SYS_RAWIO) && !odirect_enable) ++ arg &= ~O_DIRECT; ++ + /* + * O_APPEND cannot be cleared if the file is marked as append-only + * and the file is open for write. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/file.c debian/binary-custom.d/openvz/src/fs/file.c +--- ./fs/file.c 2012-06-12 16:25:23.330312520 +0100 ++++ debian/binary-custom.d/openvz/src/fs/file.c 2012-11-13 15:20:14.000569116 +0000 +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -18,6 +19,8 @@ + #include + #include + ++#include ++ + struct fdtable_defer { + spinlock_t lock; + struct work_struct wq; +@@ -35,9 +38,9 @@ + static inline void * alloc_fdmem(unsigned int size) + { + if (size <= PAGE_SIZE) +- return kmalloc(size, GFP_KERNEL); ++ return kmalloc(size, GFP_KERNEL_UBC); + else +- return vmalloc(size); ++ return ub_vmalloc(size); + } + + static inline void free_fdarr(struct fdtable *fdt) +@@ -150,7 +153,7 @@ + if (nr > NR_OPEN) + nr = NR_OPEN; + +- fdt = kmalloc(sizeof(struct fdtable), GFP_KERNEL); ++ fdt = kmalloc(sizeof(struct fdtable), GFP_KERNEL_UBC); + if (!fdt) + goto out; + fdt->max_fds = nr; +@@ -185,7 +188,7 @@ + * Return <0 error code on error; 1 on successful completion. + * The files->file_lock should be held on entry, and will be held on exit. + */ +-static int expand_fdtable(struct files_struct *files, int nr) ++int expand_fdtable(struct files_struct *files, int nr) + __releases(files->file_lock) + __acquires(files->file_lock) + { +@@ -215,6 +218,7 @@ + } + return 1; + } ++EXPORT_SYMBOL_GPL(expand_fdtable); + + /* + * Expand files. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/file_table.c debian/binary-custom.d/openvz/src/fs/file_table.c +--- ./fs/file_table.c 2012-06-12 16:25:23.330312520 +0100 ++++ debian/binary-custom.d/openvz/src/fs/file_table.c 2012-11-13 15:20:14.000569116 +0000 +@@ -20,9 +20,14 @@ + #include + #include + #include ++#include + + #include + ++#include ++#include ++#include ++ + /* sysctl tunables... */ + struct files_stat_struct files_stat = { + .max_files = NR_FILE +@@ -36,12 +41,15 @@ + static inline void file_free_rcu(struct rcu_head *head) + { + struct file *f = container_of(head, struct file, f_u.fu_rcuhead); ++ put_ve(f->owner_env); + kmem_cache_free(filp_cachep, f); + } + + static inline void file_free(struct file *f) + { +- percpu_counter_dec(&nr_files); ++ if (f->f_ub == get_ub0()) ++ percpu_counter_dec(&nr_files); ++ ub_file_uncharge(f); + call_rcu(&f->f_u.fu_rcuhead, file_free_rcu); + } + +@@ -89,11 +97,14 @@ + struct task_struct *tsk; + static int old_max; + struct file * f; ++ int acct; + ++ acct = (get_exec_ub() == get_ub0()); + /* + * Privileged users can go above max_files + */ +- if (get_nr_files() >= files_stat.max_files && !capable(CAP_SYS_ADMIN)) { ++ if (acct && get_nr_files() >= files_stat.max_files && ++ !capable(CAP_SYS_ADMIN)) { + /* + * percpu_counters are inaccurate. Do an expensive check before + * we go and fail. +@@ -106,7 +117,13 @@ + if (f == NULL) + goto fail; + +- percpu_counter_inc(&nr_files); ++ if (ub_file_charge(f)) ++ goto fail_ch; ++ if (acct) ++ percpu_counter_inc(&nr_files); ++ ++ f->owner_env = get_ve(get_exec_env()); ++ + if (security_file_alloc(f)) + goto fail_sec; + +@@ -133,6 +150,10 @@ + file_free(f); + fail: + return NULL; ++ ++fail_ch: ++ kmem_cache_free(filp_cachep, f); ++ return NULL; + } + + EXPORT_SYMBOL(get_empty_filp); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/filesystems.c debian/binary-custom.d/openvz/src/fs/filesystems.c +--- ./fs/filesystems.c 2012-06-12 16:25:23.330312520 +0100 ++++ debian/binary-custom.d/openvz/src/fs/filesystems.c 2012-11-13 15:20:14.000569116 +0000 +@@ -12,6 +12,9 @@ + #include + #include + #include ++#include /* for 'current' */ ++#include ++#include + #include + + /* +@@ -21,8 +24,8 @@ + * During the unload module must call unregister_filesystem(). + * We can access the fields of list element if: + * 1) spinlock is held or +- * 2) we hold the reference to the module. +- * The latter can be guaranteed by call of try_module_get(); if it ++ * 2) we hold the reference to the element. ++ * The latter can be guaranteed by call of try_filesystem(); if it + * returned 0 we must skip the element, otherwise we got the reference. + * Once the reference is obtained we can drop the spinlock. + */ +@@ -30,24 +33,46 @@ + static struct file_system_type *file_systems; + static DEFINE_RWLOCK(file_systems_lock); + ++int try_get_filesystem(struct file_system_type *fs) ++{ ++ if (try_module_get(fs->owner)) { ++ (void)get_ve(fs->owner_env); ++ return 1; ++ } ++ return 0; ++} ++ + /* WARNING: This can be used only if we _already_ own a reference */ + void get_filesystem(struct file_system_type *fs) + { ++ (void)get_ve(fs->owner_env); + __module_get(fs->owner); + } + + void put_filesystem(struct file_system_type *fs) + { + module_put(fs->owner); ++ put_ve(fs->owner_env); ++} ++ ++static inline int check_ve_fstype(struct file_system_type *p, ++ struct ve_struct *env) ++{ ++ return ((p->fs_flags & FS_VIRTUALIZED) || ++ ve_accessible_strict(p->owner_env, env)); + } + +-static struct file_system_type **find_filesystem(const char *name, unsigned len) ++static struct file_system_type **find_filesystem(const char *name, unsigned len, ++ struct ve_struct *env) + { + struct file_system_type **p; +- for (p=&file_systems; *p; p=&(*p)->next) ++ for (p=&file_systems; *p; p=&(*p)->next) { ++ if (!check_ve_fstype(*p, env)) ++ continue; + if (strlen((*p)->name) == len && + strncmp((*p)->name, name, len) == 0) + break; ++ } + return p; + } + +@@ -73,8 +98,12 @@ + if (fs->next) + return -EBUSY; + INIT_LIST_HEAD(&fs->fs_supers); ++ if (fs->owner_env == NULL) ++ fs->owner_env = get_ve0(); ++ if (fs->proto == NULL) ++ fs->proto = fs; + write_lock(&file_systems_lock); +- p = find_filesystem(fs->name, strlen(fs->name)); ++ p = find_filesystem(fs->name, strlen(fs->name), fs->owner_env); + if (*p) + res = -EBUSY; + else +@@ -118,6 +147,75 @@ + + EXPORT_SYMBOL(unregister_filesystem); + ++#ifdef CONFIG_VE ++int register_ve_fs_type(struct ve_struct *ve, struct file_system_type *template, ++ struct file_system_type **p_fs_type, struct vfsmount **p_mnt) ++{ ++ struct vfsmount *mnt; ++ struct file_system_type *local_fs_type; ++ int ret; ++ ++ local_fs_type = kzalloc(sizeof(*local_fs_type) + sizeof(void *), ++ GFP_KERNEL); ++ if (local_fs_type == NULL) ++ return -ENOMEM; ++ ++ local_fs_type->name = template->name; ++ local_fs_type->fs_flags = template->fs_flags; ++ local_fs_type->get_sb = template->get_sb; ++ local_fs_type->kill_sb = template->kill_sb; ++ local_fs_type->owner = template->owner; ++ local_fs_type->owner_env = ve; ++ local_fs_type->proto = template; ++ ++ get_filesystem(local_fs_type); /* get_ve() inside */ ++ ++ ret = register_filesystem(local_fs_type); ++ if (ret) ++ goto reg_err; ++ ++ if (p_mnt == NULL) ++ goto done; ++ ++ mnt = vfs_kern_mount(local_fs_type, 0, local_fs_type->name, NULL); ++ if (IS_ERR(mnt)) ++ goto mnt_err; ++ ++ *p_mnt = mnt; ++done: ++ *p_fs_type = local_fs_type; ++ return 0; ++ ++mnt_err: ++ ret = PTR_ERR(mnt); ++ unregister_filesystem(local_fs_type); /* does not put */ ++ ++reg_err: ++ put_filesystem(local_fs_type); ++ kfree(local_fs_type); ++ printk(KERN_DEBUG ++ "register_ve_fs_type(\"%s\") err=%d\n", template->name, ret); ++ return ret; ++} ++ ++EXPORT_SYMBOL(register_ve_fs_type); ++ ++void unregister_ve_fs_type(struct file_system_type *local_fs_type, ++ struct vfsmount *local_fs_mount) ++{ ++ if (local_fs_mount == NULL && local_fs_type == NULL) ++ return; ++ ++ unregister_filesystem(local_fs_type); ++ umount_ve_fs_type(local_fs_type); ++ if (local_fs_mount) ++ kern_umount(local_fs_mount); /* alias to mntput, drop our ref */ ++ put_filesystem(local_fs_type); ++} ++ ++EXPORT_SYMBOL(unregister_ve_fs_type); ++#endif ++ + static int fs_index(const char __user * __name) + { + struct file_system_type * tmp; +@@ -131,11 +229,14 @@ + + err = -EINVAL; + read_lock(&file_systems_lock); +- for (tmp=file_systems, index=0 ; tmp ; tmp=tmp->next, index++) { ++ for (tmp=file_systems, index=0 ; tmp ; tmp=tmp->next) { ++ if (!check_ve_fstype(tmp, get_exec_env())) ++ continue; + if (strcmp(tmp->name,name) == 0) { + err = index; + break; + } ++ index++; + } + read_unlock(&file_systems_lock); + putname(name); +@@ -148,9 +249,15 @@ + int len, res; + + read_lock(&file_systems_lock); +- for (tmp = file_systems; tmp; tmp = tmp->next, index--) +- if (index <= 0 && try_module_get(tmp->owner)) +- break; ++ for (tmp = file_systems; tmp; tmp = tmp->next) { ++ if (!check_ve_fstype(tmp, get_exec_env())) ++ continue; ++ if (!index) { ++ if (try_get_filesystem(tmp)) ++ break; ++ } else ++ index--; ++ } + read_unlock(&file_systems_lock); + if (!tmp) + return -EINVAL; +@@ -168,8 +275,9 @@ + int index; + + read_lock(&file_systems_lock); +- for (tmp = file_systems, index = 0 ; tmp ; tmp = tmp->next, index++) +- ; ++ for (tmp = file_systems, index = 0 ; tmp ; tmp = tmp->next) ++ if (check_ve_fstype(tmp, get_exec_env())) ++ index++; + read_unlock(&file_systems_lock); + return index; + } +@@ -205,9 +313,10 @@ + read_lock(&file_systems_lock); + tmp = file_systems; + while (tmp && len < PAGE_SIZE - 80) { +- len += sprintf(buf+len, "%s\t%s\n", +- (tmp->fs_flags & FS_REQUIRES_DEV) ? "" : "nodev", +- tmp->name); ++ if (check_ve_fstype(tmp, get_exec_env())) ++ len += sprintf(buf+len, "%s\t%s\n", ++ (tmp->fs_flags & FS_REQUIRES_DEV) ? "" : "nodev", ++ tmp->name); + tmp = tmp->next; + } + read_unlock(&file_systems_lock); +@@ -221,14 +330,14 @@ + unsigned len = dot ? dot - name : strlen(name); + + read_lock(&file_systems_lock); +- fs = *(find_filesystem(name, len)); +- if (fs && !try_module_get(fs->owner)) ++ fs = *(find_filesystem(name, len, get_exec_env())); ++ if (fs && !try_get_filesystem(fs)) + fs = NULL; + read_unlock(&file_systems_lock); + if (!fs && (request_module("%.*s", len, name) == 0)) { + read_lock(&file_systems_lock); +- fs = *(find_filesystem(name, len)); +- if (fs && !try_module_get(fs->owner)) ++ fs = *(find_filesystem(name, len, get_exec_env())); ++ if (fs && !try_get_filesystem(fs)) + fs = NULL; + read_unlock(&file_systems_lock); + } +@@ -241,3 +350,5 @@ + } + + EXPORT_SYMBOL(get_fs_type); ++EXPORT_SYMBOL(get_filesystem); ++EXPORT_SYMBOL(put_filesystem); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/fuse/control.c debian/binary-custom.d/openvz/src/fs/fuse/control.c +--- ./fs/fuse/control.c 2012-06-12 16:25:23.334312520 +0100 ++++ debian/binary-custom.d/openvz/src/fs/fuse/control.c 2012-11-13 15:20:14.004569117 +0000 +@@ -10,6 +10,8 @@ + + #include + #include ++#include ++#include + + #define FUSE_CTL_SUPER_MAGIC 0x65735543 + +@@ -17,7 +19,11 @@ + * This is non-NULL when the single instance of the control filesystem + * exists. Protected by fuse_mutex + */ ++#ifdef CONFIG_VE ++#define fuse_control_sb (get_exec_env()->_fuse_control_sb) ++#else + static struct super_block *fuse_control_sb; ++#endif + + static struct fuse_conn *fuse_ctl_file_conn_get(struct file *file) + { +@@ -211,12 +217,51 @@ + .kill_sb = fuse_ctl_kill_sb, + }; + ++#ifdef CONFIG_VE ++static int fuse_ctl_start(void *data) ++{ ++ struct ve_struct *ve; ++ ++ ve = (struct ve_struct *)data; ++ if (ve->fuse_ctl_fs_type != NULL) ++ return -EBUSY; ++ ++ return register_ve_fs_type(ve, &fuse_ctl_fs_type, ++ &ve->fuse_ctl_fs_type, NULL); ++} ++ ++static void fuse_ctl_stop(void *data) ++{ ++ struct ve_struct *ve; ++ ++ ve = (struct ve_struct *)data; ++ if (ve->fuse_ctl_fs_type == NULL) ++ return; ++ ++ unregister_ve_fs_type(ve->fuse_ctl_fs_type, NULL); ++ ve->fuse_ctl_fs_type = NULL; ++} ++ ++static struct ve_hook fuse_ctl_ve_hook = { ++ .init = fuse_ctl_start, ++ .fini = fuse_ctl_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_FS, ++}; ++#endif ++ + int __init fuse_ctl_init(void) + { +- return register_filesystem(&fuse_ctl_fs_type); ++ int err; ++ ++ err = register_filesystem(&fuse_ctl_fs_type); ++ if (err == 0) ++ ve_hook_register(VE_SS_CHAIN, &fuse_ctl_ve_hook); ++ return err; + } + + void fuse_ctl_cleanup(void) + { ++ ve_hook_unregister(&fuse_ctl_ve_hook); + unregister_filesystem(&fuse_ctl_fs_type); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/fuse/fuse_i.h debian/binary-custom.d/openvz/src/fs/fuse/fuse_i.h +--- ./fs/fuse/fuse_i.h 2012-06-12 16:25:23.334312520 +0100 ++++ debian/binary-custom.d/openvz/src/fs/fuse/fuse_i.h 2012-11-13 15:20:14.012569115 +0000 +@@ -41,7 +41,11 @@ + #define FUSE_ALLOW_OTHER (1 << 1) + + /** List of active connections */ ++#ifdef CONFIG_VE ++#define fuse_conn_list (get_exec_env()->_fuse_conn_list) ++#else + extern struct list_head fuse_conn_list; ++#endif + + /** Global mutex protecting fuse_conn_list and the control filesystem */ + extern struct mutex fuse_mutex; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/fuse/inode.c debian/binary-custom.d/openvz/src/fs/fuse/inode.c +--- ./fs/fuse/inode.c 2012-06-12 16:25:23.334312520 +0100 ++++ debian/binary-custom.d/openvz/src/fs/fuse/inode.c 2012-11-13 15:20:14.012569115 +0000 +@@ -18,13 +18,16 @@ + #include + #include + #include ++#include + + MODULE_AUTHOR("Miklos Szeredi "); + MODULE_DESCRIPTION("Filesystem in Userspace"); + MODULE_LICENSE("GPL"); + + static struct kmem_cache *fuse_inode_cachep; ++#ifndef CONFIG_VE + struct list_head fuse_conn_list; ++#endif + DEFINE_MUTEX(fuse_mutex); + + #define FUSE_SUPER_MAGIC 0x65735546 +@@ -819,6 +822,41 @@ + subsystem_unregister(&fuse_subsys); + } + ++#ifdef CONFIG_VE ++static int fuse_start(void *data) ++{ ++ struct ve_struct *ve; ++ ++ ve = (struct ve_struct *)data; ++ if (ve->fuse_fs_type != NULL) ++ return -EBUSY; ++ ++ INIT_LIST_HEAD(&ve->_fuse_conn_list); ++ return register_ve_fs_type(ve, &fuse_fs_type, &ve->fuse_fs_type, NULL); ++} ++ ++static void fuse_stop(void *data) ++{ ++ struct ve_struct *ve; ++ ++ ve = (struct ve_struct *)data; ++ if (ve->fuse_fs_type == NULL) ++ return; ++ ++ unregister_ve_fs_type(ve->fuse_fs_type, NULL); ++ kfree(ve->fuse_fs_type); ++ ve->fuse_fs_type = NULL; ++ BUG_ON(!list_empty(&ve->_fuse_conn_list)); ++} ++ ++static struct ve_hook fuse_ve_hook = { ++ .init = fuse_start, ++ .fini = fuse_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_FS, ++}; ++#endif ++ + static int __init fuse_init(void) + { + int res; +@@ -843,6 +881,7 @@ + if (res) + goto err_sysfs_cleanup; + ++ ve_hook_register(VE_SS_CHAIN, &fuse_ve_hook); + return 0; + + err_sysfs_cleanup: +@@ -859,6 +898,7 @@ + { + printk(KERN_DEBUG "fuse exit\n"); + ++ ve_hook_unregister(&fuse_ve_hook); + fuse_ctl_cleanup(); + fuse_sysfs_cleanup(); + fuse_fs_cleanup(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/gfs2/glock.c debian/binary-custom.d/openvz/src/fs/gfs2/glock.c +--- ./fs/gfs2/glock.c 2012-06-12 16:25:23.338312520 +0100 ++++ debian/binary-custom.d/openvz/src/fs/gfs2/glock.c 2012-11-13 15:20:14.016569113 +0000 +@@ -8,6 +8,7 @@ + */ + + #include ++#include + #include + #include + #include +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/hfsplus/catalog.c debian/binary-custom.d/openvz/src/fs/hfsplus/catalog.c +--- ./fs/hfsplus/catalog.c 2012-06-12 18:12:32.378086571 +0100 ++++ debian/binary-custom.d/openvz/src/fs/hfsplus/catalog.c 2012-11-13 15:20:14.040569114 +0000 +@@ -329,10 +329,10 @@ + err = hfs_brec_find(&src_fd); + if (err) + goto out; +- if (src_fd.entrylength > sizeof(entry) || src_fd.entrylength < 0) { +- err = -EIO; +- goto out; +- } ++ if (src_fd.entrylength > sizeof(entry) || src_fd.entrylength < 0) { ++ err = -EIO; ++ goto out; ++ } + + hfs_bnode_read(src_fd.bnode, &entry, src_fd.entryoffset, + src_fd.entrylength); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/inode.c debian/binary-custom.d/openvz/src/fs/inode.c +--- ./fs/inode.c 2012-06-12 16:25:23.362312519 +0100 ++++ debian/binary-custom.d/openvz/src/fs/inode.c 2012-11-13 15:20:14.056569114 +0000 +@@ -8,10 +8,13 @@ + #include + #include + #include ++#include + #include + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -22,6 +25,7 @@ + #include + #include + #include ++#include + + /* + * This is needed for the following functions: +@@ -97,7 +101,8 @@ + */ + struct inodes_stat_t inodes_stat; + +-static struct kmem_cache * inode_cachep __read_mostly; ++struct kmem_cache * inode_cachep __read_mostly; ++ + + static void wake_up_inode(struct inode *inode) + { +@@ -108,11 +113,13 @@ + wake_up_bit(&inode->i_state, __I_LOCK); + } + ++static struct address_space_operations vfs_empty_aops; ++struct inode_operations vfs_empty_iops; ++static struct file_operations vfs_empty_fops; ++EXPORT_SYMBOL(vfs_empty_iops); ++ + static struct inode *alloc_inode(struct super_block *sb) + { +- static const struct address_space_operations empty_aops; +- static struct inode_operations empty_iops; +- static const struct file_operations empty_fops; + struct inode *inode; + + if (sb->s_op->alloc_inode) +@@ -127,8 +134,8 @@ + inode->i_blkbits = sb->s_blocksize_bits; + inode->i_flags = 0; + atomic_set(&inode->i_count, 1); +- inode->i_op = &empty_iops; +- inode->i_fop = &empty_fops; ++ inode->i_op = &vfs_empty_iops; ++ inode->i_fop = &vfs_empty_fops; + inode->i_nlink = 1; + atomic_set(&inode->i_writecount, 0); + inode->i_size = 0; +@@ -152,15 +159,15 @@ + } + + spin_lock_init(&inode->i_lock); +- lockdep_set_class(&inode->i_lock, &sb->s_type->i_lock_key); ++ lockdep_set_class(&inode->i_lock, &sb->s_type->proto->i_lock_key); + + mutex_init(&inode->i_mutex); +- lockdep_set_class(&inode->i_mutex, &sb->s_type->i_mutex_key); ++ lockdep_set_class(&inode->i_mutex, &sb->s_type->proto->i_mutex_key); + + init_rwsem(&inode->i_alloc_sem); +- lockdep_set_class(&inode->i_alloc_sem, &sb->s_type->i_alloc_sem_key); ++ lockdep_set_class(&inode->i_alloc_sem, &sb->s_type->proto->i_alloc_sem_key); + +- mapping->a_ops = &empty_aops; ++ mapping->a_ops = &vfs_empty_aops; + mapping->host = inode; + mapping->flags = 0; + mapping_set_gfp_mask(mapping, GFP_HIGHUSER_PAGECACHE); +@@ -310,13 +317,76 @@ + spin_unlock(&inode_lock); + } + ++static void show_header(struct inode *inode) ++{ ++ struct super_block *sb = inode->i_sb; ++ ++ printk("VFS: Busy inodes after unmount. " ++ "sb = %p, fs type = %s, sb count = %d, " ++ "sb->s_root = %s\n", sb, ++ (sb->s_type != NULL) ? sb->s_type->name : "", ++ sb->s_count, ++ (sb->s_root != NULL) ? ++ (char *)sb->s_root->d_name.name : ""); ++} ++ ++static void show_inode(struct inode *inode) ++{ ++ struct dentry *d; ++ struct vfsmount *mnt; ++ int i; ++ ++ printk("inode = %p, inode->i_count = %d, " ++ "inode->i_nlink = %d, " ++ "inode->i_mode = %d, " ++ "inode->i_state = %ld, " ++ "inode->i_flags = %d, " ++ "inode->i_devices.next = %p, " ++ "inode->i_devices.prev = %p, " ++ "inode->i_ino = %ld\n", ++ inode, ++ atomic_read(&inode->i_count), ++ inode->i_nlink, ++ inode->i_mode, ++ inode->i_state, ++ inode->i_flags, ++ inode->i_devices.next, ++ inode->i_devices.prev, ++ inode->i_ino); ++ printk("inode dump: "); ++ for (i = 0; i < sizeof(*inode); i++) ++ printk("%2.2x ", *((u_char *)inode + i)); ++ printk("\n"); ++ list_for_each_entry(d, &inode->i_dentry, d_alias) { ++ printk(" d_alias %s d_count=%d d_flags=%x\n", ++ d->d_name.name, atomic_read(&d->d_count), d->d_flags); ++ for (i = 0; i < sizeof(*d); i++) ++ printk("%2.2x ", *((u_char *)d + i)); ++ printk("\n"); ++ } ++ ++ spin_lock(&vfsmount_lock); ++ list_for_each_entry(mnt, &get_task_mnt_ns(current)->list, mnt_list) { ++ if (mnt->mnt_sb != inode->i_sb) ++ continue; ++ printk("mnt=%p count=%d flags=%x exp_mask=%x\n", ++ mnt, atomic_read(&mnt->mnt_count), ++ mnt->mnt_flags, ++ mnt->mnt_expiry_mark); ++ for (i = 0; i < sizeof(*mnt); i++) ++ printk("%2.2x ", *((u_char *)mnt + i)); ++ printk("\n"); ++ } ++ spin_unlock(&vfsmount_lock); ++} ++ + /* + * Invalidate all inodes for a device. + */ +-static int invalidate_list(struct list_head *head, struct list_head *dispose) ++static int invalidate_list(struct list_head *head, struct list_head *dispose, int check) + { + struct list_head *next; +- int busy = 0, count = 0; ++ int busy = 0, count = 0, once = 1; + + next = head->next; + for (;;) { +@@ -343,6 +413,14 @@ + continue; + } + busy = 1; ++ ++ if (check) { ++ if (once) { ++ once = 0; ++ show_header(inode); ++ } ++ show_inode(inode); ++ } + } + /* only unused inodes may be cached with i_count zero */ + inodes_stat.nr_unused -= count; +@@ -357,7 +435,7 @@ + * fails because there are busy inodes then a non zero value is returned. + * If the discard is successful all the inodes have been discarded. + */ +-int invalidate_inodes(struct super_block * sb) ++int invalidate_inodes_check(struct super_block * sb, int check) + { + int busy; + LIST_HEAD(throw_away); +@@ -365,7 +443,7 @@ + mutex_lock(&iprune_mutex); + spin_lock(&inode_lock); + inotify_unmount_inodes(&sb->s_inodes); +- busy = invalidate_list(&sb->s_inodes, &throw_away); ++ busy = invalidate_list(&sb->s_inodes, &throw_away, check); + spin_unlock(&inode_lock); + + dispose_list(&throw_away); +@@ -374,7 +452,7 @@ + return busy; + } + +-EXPORT_SYMBOL(invalidate_inodes); ++EXPORT_SYMBOL(invalidate_inodes_check); + + static int can_unuse(struct inode *inode) + { +@@ -464,6 +542,7 @@ + */ + static int shrink_icache_memory(int nr, gfp_t gfp_mask) + { ++ KSTAT_PERF_ENTER(shrink_icache) + if (nr) { + /* + * Nasty deadlock avoidance. We may hold various FS locks, +@@ -474,6 +553,7 @@ + return -1; + prune_icache(nr); + } ++ KSTAT_PERF_LEAVE(shrink_icache) + return (inodes_stat.nr_unused / 100) * sysctl_vfs_cache_pressure; + } + +@@ -585,7 +665,7 @@ + */ + mutex_destroy(&inode->i_mutex); + mutex_init(&inode->i_mutex); +- lockdep_set_class(&inode->i_mutex, &type->i_mutex_dir_key); ++ lockdep_set_class(&inode->i_mutex, &type->proto->i_mutex_dir_key); + } + #endif + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/inotify.c debian/binary-custom.d/openvz/src/fs/inotify.c +--- ./fs/inotify.c 2012-06-12 16:25:23.362312519 +0100 ++++ debian/binary-custom.d/openvz/src/fs/inotify.c 2012-11-13 15:20:14.056569114 +0000 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + static atomic_t inotify_cookie; + +@@ -69,19 +70,6 @@ + * inotify_add_watch() to the final put_inotify_watch(). + */ + +-/* +- * struct inotify_handle - represents an inotify instance +- * +- * This structure is protected by the mutex 'mutex'. +- */ +-struct inotify_handle { +- struct idr idr; /* idr mapping wd -> watch */ +- struct mutex mutex; /* protects this bad boy */ +- struct list_head watches; /* list of watches */ +- atomic_t count; /* reference count */ +- u32 last_wd; /* the last wd allocated */ +- const struct inotify_operations *in_ops; /* inotify caller operations */ +-}; + + static inline void get_inotify_handle(struct inotify_handle *ih) + { +@@ -132,6 +120,10 @@ + struct inotify_handle *ih = watch->ih; + + iput(watch->inode); ++ dput(watch->dentry); ++ mntput(watch->mnt); ++ watch->dentry = NULL; ++ watch->mnt = NULL; + ih->in_ops->destroy_watch(watch); + put_inotify_handle(ih); + } +@@ -497,6 +489,8 @@ + INIT_LIST_HEAD(&watch->i_list); + atomic_set(&watch->count, 0); + get_inotify_watch(watch); /* initial get */ ++ watch->dentry = NULL; ++ watch->mnt = NULL; + } + EXPORT_SYMBOL_GPL(inotify_init_watch); + +@@ -749,8 +743,10 @@ + * Caller must ensure it only calls inotify_add_watch() once per watch. + * Calls inotify_handle_get_wd() so may sleep. + */ +-s32 inotify_add_watch(struct inotify_handle *ih, struct inotify_watch *watch, +- struct inode *inode, u32 mask) ++s32 __inotify_add_watch(struct inotify_handle *ih, ++ struct inotify_watch *watch, ++ struct dentry *d, struct vfsmount *mnt, ++ struct inode * inode, u32 mask) + { + int ret = 0; + int newly_watched; +@@ -778,6 +774,10 @@ + * Save a reference to the inode and bump the ref count to make it + * official. We hold a reference to nameidata, which makes this safe. + */ ++ if (d) { ++ watch->dentry = dget(d); ++ watch->mnt = mntget(mnt); ++ } + watch->inode = igrab(inode); + + /* Add the watch to the handle's and the inode's list */ +@@ -799,6 +799,19 @@ + } + EXPORT_SYMBOL_GPL(inotify_add_watch); + ++s32 inotify_add_watch(struct inotify_handle *ih, struct inotify_watch *watch, ++ struct inode *inode, u32 mask) ++{ ++ return __inotify_add_watch(ih, watch, NULL, NULL, inode, mask); ++} ++ ++s32 inotify_add_watch_dget(struct inotify_handle *ih, ++ struct inotify_watch *watch, struct dentry *d, ++ struct vfsmount *mnt, u32 mask) ++{ ++ return __inotify_add_watch(ih, watch, d, mnt, d->d_inode, mask); ++} ++ + /** + * inotify_clone_watch - put the watch next to existing one + * @old: already installed watch +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/inotify_user.c debian/binary-custom.d/openvz/src/fs/inotify_user.c +--- ./fs/inotify_user.c 2012-06-12 16:25:23.362312519 +0100 ++++ debian/binary-custom.d/openvz/src/fs/inotify_user.c 2012-11-13 15:20:14.056569114 +0000 +@@ -20,6 +20,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -66,46 +67,6 @@ + * first event, or to inotify_destroy(). + */ + +-/* +- * struct inotify_device - represents an inotify instance +- * +- * This structure is protected by the mutex 'mutex'. +- */ +-struct inotify_device { +- wait_queue_head_t wq; /* wait queue for i/o */ +- struct mutex ev_mutex; /* protects event queue */ +- struct mutex up_mutex; /* synchronizes watch updates */ +- struct list_head events; /* list of queued events */ +- atomic_t count; /* reference count */ +- struct user_struct *user; /* user who opened this dev */ +- struct inotify_handle *ih; /* inotify handle */ +- unsigned int queue_size; /* size of the queue (bytes) */ +- unsigned int event_count; /* number of pending events */ +- unsigned int max_events; /* maximum number of events */ +-}; +- +-/* +- * struct inotify_kernel_event - An inotify event, originating from a watch and +- * queued for user-space. A list of these is attached to each instance of the +- * device. In read(), this list is walked and all events that can fit in the +- * buffer are returned. +- * +- * Protected by dev->ev_mutex of the device in which we are queued. +- */ +-struct inotify_kernel_event { +- struct inotify_event event; /* the user-space event */ +- struct list_head list; /* entry in inotify_device's list */ +- char *name; /* filename, if any */ +-}; +- +-/* +- * struct inotify_user_watch - our version of an inotify_watch, we add +- * a reference to the associated inotify_device. +- */ +-struct inotify_user_watch { +- struct inotify_device *dev; /* associated device */ +- struct inotify_watch wdata; /* inotify watch data */ +-}; + + #ifdef CONFIG_SYSCTL + +@@ -361,8 +322,8 @@ + * + * Callers must hold dev->up_mutex. + */ +-static int create_watch(struct inotify_device *dev, struct inode *inode, +- u32 mask) ++int inotify_create_watch(struct inotify_device *dev, struct dentry *d, ++ struct vfsmount *mnt, u32 mask) + { + struct inotify_user_watch *watch; + int ret; +@@ -382,12 +343,13 @@ + atomic_inc(&dev->user->inotify_watches); + + inotify_init_watch(&watch->wdata); +- ret = inotify_add_watch(dev->ih, &watch->wdata, inode, mask); ++ ret = inotify_add_watch_dget(dev->ih, &watch->wdata, d, mnt, mask); + if (ret < 0) + free_inotify_user_watch(&watch->wdata); + + return ret; + } ++EXPORT_SYMBOL(inotify_create_watch); + + /* Device Interface */ + +@@ -527,13 +489,14 @@ + return ret; + } + +-static const struct file_operations inotify_fops = { ++const struct file_operations inotify_fops = { + .poll = inotify_poll, + .read = inotify_read, + .release = inotify_release, + .unlocked_ioctl = inotify_ioctl, + .compat_ioctl = inotify_ioctl, + }; ++EXPORT_SYMBOL(inotify_fops); + + static const struct inotify_operations inotify_user_ops = { + .handle_event = inotify_dev_queue_event, +@@ -610,6 +573,7 @@ + put_unused_fd(fd); + return ret; + } ++EXPORT_SYMBOL(sys_inotify_init); + + asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask) + { +@@ -646,7 +610,7 @@ + mutex_lock(&dev->up_mutex); + ret = inotify_find_update_watch(dev->ih, inode, mask); + if (ret == -ENOENT) +- ret = create_watch(dev, inode, mask); ++ ret = inotify_create_watch(dev, nd.dentry, nd.mnt, mask); + mutex_unlock(&dev->up_mutex); + + path_release(&nd); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/ioprio.c debian/binary-custom.d/openvz/src/fs/ioprio.c +--- ./fs/ioprio.c 2012-06-12 16:25:23.362312519 +0100 ++++ debian/binary-custom.d/openvz/src/fs/ioprio.c 2012-11-13 15:20:14.060569115 +0000 +@@ -26,6 +26,8 @@ + #include + #include + #include ++#include ++#include + + static int set_task_ioprio(struct task_struct *task, int ioprio) + { +@@ -61,8 +63,11 @@ + int data = IOPRIO_PRIO_DATA(ioprio); + struct task_struct *p, *g; + struct user_struct *user; +- struct pid *pgrp; + int ret; ++ struct pid *pgrp; ++ ++ if (!ve_is_super(get_exec_env())) ++ return -EPERM; + + switch (class) { + case IOPRIO_CLASS_RT: +@@ -122,17 +127,23 @@ + if (!user) + break; + +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + if (p->uid != who) + continue; + ret = set_task_ioprio(p, ioprio); + if (ret) + goto free_uid; +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + free_uid: + if (who) + free_uid(user); + break; ++ case IOPRIO_WHO_UBC: ++ if (class != IOPRIO_CLASS_BE) ++ return -ERANGE; ++ ++ ret = bc_set_ioprio(who, data); ++ break; + default: + ret = -EINVAL; + } +@@ -175,9 +186,9 @@ + { + struct task_struct *g, *p; + struct user_struct *user; +- struct pid *pgrp; + int ret = -ESRCH; + int tmpio; ++ struct pid *pgrp; + + read_lock(&tasklist_lock); + switch (which) { +@@ -213,7 +224,7 @@ + if (!user) + break; + +- do_each_thread(g, p) { ++ do_each_thread_ve(g, p) { + if (p->uid != user->uid) + continue; + tmpio = get_task_ioprio(p); +@@ -223,7 +234,7 @@ + ret = tmpio; + else + ret = ioprio_best(ret, tmpio); +- } while_each_thread(g, p); ++ } while_each_thread_ve(g, p); + + if (who) + free_uid(user); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/lockd/clntproc.c debian/binary-custom.d/openvz/src/fs/lockd/clntproc.c +--- ./fs/lockd/clntproc.c 2012-06-12 16:25:23.390312518 +0100 ++++ debian/binary-custom.d/openvz/src/fs/lockd/clntproc.c 2012-11-13 15:20:14.100569112 +0000 +@@ -159,6 +159,7 @@ + sigset_t oldset; + unsigned long flags; + int status, vers; ++ struct ve_struct *ve; + + vers = (NFS_PROTO(inode)->version == 3) ? 4 : 1; + if (NFS_PROTO(inode)->version > 3) { +@@ -166,16 +167,19 @@ + return -ENOLCK; + } + ++ ve = set_exec_env(NFS_CLIENT(inode)->cl_xprt->owner_env); + rpc_peeraddr(client, (struct sockaddr *) &addr, sizeof(addr)); + host = nlmclnt_lookup_host(&addr, client->cl_xprt->prot, vers, + nfssrv->nfs_client->cl_hostname, + strlen(nfssrv->nfs_client->cl_hostname)); ++ status = -ENOLCK; + if (host == NULL) +- return -ENOLCK; ++ goto fail; + + call = nlm_alloc_call(host); ++ status = -ENOMEM; + if (call == NULL) +- return -ENOMEM; ++ goto fail; + + nlmclnt_locks_init_private(fl, host); + /* Set up the argument struct */ +@@ -217,6 +221,8 @@ + spin_unlock_irqrestore(¤t->sighand->siglock, flags); + + dprintk("lockd: clnt proc returns %d\n", status); ++fail: ++ (void)set_exec_env(ve); + return status; + } + EXPORT_SYMBOL(nlmclnt_proc); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/lockd/host.c debian/binary-custom.d/openvz/src/fs/lockd/host.c +--- ./fs/lockd/host.c 2012-06-12 16:25:23.390312518 +0100 ++++ debian/binary-custom.d/openvz/src/fs/lockd/host.c 2012-11-13 15:20:14.100569112 +0000 +@@ -52,6 +52,7 @@ + struct nlm_host *host; + struct nsm_handle *nsm = NULL; + int hash; ++ struct ve_struct *ve; + + dprintk("lockd: nlm_lookup_host("NIPQUAD_FMT"->"NIPQUAD_FMT + ", p=%d, v=%d, my role=%s, name=%.*s)\n", +@@ -77,10 +78,14 @@ + * different NLM rpc_clients into one single nlm_host object. + * This would allow us to have one nlm_host per address. + */ ++ ++ ve = get_exec_env(); + chain = &nlm_hosts[hash]; + hlist_for_each_entry(host, pos, chain, h_hash) { + if (!nlm_cmp_addr(&host->h_addr, sin)) + continue; ++ if (!ve_accessible_strict(host->owner_env, ve)) ++ continue; + + /* See if we have an NSM handle for this client */ + if (!nsm) +@@ -140,6 +145,7 @@ + spin_lock_init(&host->h_lock); + INIT_LIST_HEAD(&host->h_granted); + INIT_LIST_HEAD(&host->h_reclaim); ++ host->owner_env = ve; + + if (++nrhosts > NLM_HOST_MAX) + next_gc = 0; +@@ -440,6 +446,52 @@ + next_gc = jiffies + NLM_HOST_COLLECT; + } + ++#ifdef CONFIG_VE ++void ve_nlm_shutdown_hosts(struct ve_struct *ve) ++{ ++ envid_t veid = ve->veid; ++ int i; ++ ++ dprintk("lockd: shutting down host module for ve %d\n", veid); ++ mutex_lock(&nlm_host_mutex); ++ ++ /* Perform a garbage collection pass */ ++ for (i = 0; i < NLM_HOST_NRHASH; i++) { ++ struct nlm_host *host; ++ struct hlist_node *pos; ++ ++ hlist_for_each_entry(host, pos, &nlm_hosts[i], h_hash) { ++ struct rpc_clnt *clnt; ++ ++ if (ve != host->owner_env) ++ continue; ++ ++ hlist_del(&host->h_hash); ++ if (host->h_nsmhandle) ++ host->h_nsmhandle->sm_monitored = 0; ++ dprintk("lockd: delete host %s ve %d\n", host->h_name, ++ veid); ++ if ((clnt = host->h_rpcclnt) != NULL) { ++ if (!list_empty(&clnt->cl_tasks)) { ++ struct rpc_xprt *xprt; ++ ++ printk(KERN_WARNING ++ "lockd: active RPC handle\n"); ++ rpc_killall_tasks(clnt); ++ xprt = clnt->cl_xprt; ++ xprt_disconnect(xprt); ++ xprt->ops->close(xprt); ++ } else ++ rpc_shutdown_client(clnt); ++ } ++ kfree(host); ++ nrhosts--; ++ } ++ } ++ ++ mutex_unlock(&nlm_host_mutex); ++} ++#endif + + /* + * Manage NSM handles +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/lockd/svc.c debian/binary-custom.d/openvz/src/fs/lockd/svc.c +--- ./fs/lockd/svc.c 2012-06-12 16:25:23.390312518 +0100 ++++ debian/binary-custom.d/openvz/src/fs/lockd/svc.c 2012-11-13 15:20:14.100569112 +0000 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -47,11 +48,12 @@ + EXPORT_SYMBOL(nlmsvc_ops); + + static DEFINE_MUTEX(nlmsvc_mutex); +-static unsigned int nlmsvc_users; +-static pid_t nlmsvc_pid; ++static unsigned int _nlmsvc_users; ++static pid_t _nlmsvc_pid; + static struct svc_serv *nlmsvc_serv; +-int nlmsvc_grace_period; +-unsigned long nlmsvc_timeout; ++int _nlmsvc_grace_period; ++unsigned long _nlmsvc_timeout; ++ + + static DECLARE_COMPLETION(lockd_start_done); + static DECLARE_WAIT_QUEUE_HEAD(lockd_exit); +@@ -179,8 +181,13 @@ + * recvfrom routine. + */ + err = svc_recv(rqstp, timeout); +- if (err == -EAGAIN || err == -EINTR) ++ if (err == -EAGAIN || err == -EINTR) { ++#ifdef CONFIG_VE ++ if (!get_exec_env()->is_running) ++ break; ++#endif + continue; ++ } + if (err < 0) { + printk(KERN_WARNING + "lockd: terminating on error %d\n", +@@ -494,6 +501,29 @@ + return SVC_DENIED; + } + ++#ifdef CONFIG_VE ++extern void ve_nlm_shutdown_hosts(struct ve_struct *ve); ++ ++static int ve_lockd_start(void *data) ++{ ++ return 0; ++} ++ ++static void ve_lockd_stop(void *data) ++{ ++ struct ve_struct *ve = (struct ve_struct *)data; ++ ++ ve_nlm_shutdown_hosts(ve); ++ flush_scheduled_work(); ++} ++ ++static struct ve_hook lockd_hook = { ++ .init = ve_lockd_start, ++ .fini = ve_lockd_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_FS, ++}; ++#endif + + param_set_min_max(port, int, simple_strtol, 0, 65535) + param_set_min_max(grace_period, unsigned long, simple_strtoul, +@@ -522,12 +552,14 @@ + static int __init init_nlm(void) + { + nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root); ++ ve_hook_register(VE_SS_CHAIN, &lockd_hook); + return nlm_sysctl_table ? 0 : -ENOMEM; + } + + static void __exit exit_nlm(void) + { + /* FIXME: delete all NLM clients */ ++ ve_hook_unregister(&lockd_hook); + nlm_shutdown_hosts(); + unregister_sysctl_table(nlm_sysctl_table); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/lockd/svcsubs.c debian/binary-custom.d/openvz/src/fs/lockd/svcsubs.c +--- ./fs/lockd/svcsubs.c 2012-06-12 16:25:23.390312518 +0100 ++++ debian/binary-custom.d/openvz/src/fs/lockd/svcsubs.c 2012-11-13 15:20:14.100569112 +0000 +@@ -318,6 +318,9 @@ + static int + nlmsvc_is_client(struct nlm_host *host, struct nlm_host *dummy) + { ++ if (!ve_accessible_strict(host->owner_env, get_exec_env())) ++ return 0; ++ + if (host->h_server) { + /* we are destroying locks even though the client + * hasn't asked us too, so don't unmonitor the +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/locks.c debian/binary-custom.d/openvz/src/fs/locks.c +--- ./fs/locks.c 2012-06-12 16:25:23.394312518 +0100 ++++ debian/binary-custom.d/openvz/src/fs/locks.c 2012-11-13 15:20:14.100569112 +0000 +@@ -129,6 +129,8 @@ + #include + #include + ++#include ++ + #define IS_POSIX(fl) (fl->fl_flags & FL_POSIX) + #define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK) + #define IS_LEASE(fl) (fl->fl_flags & FL_LEASE) +@@ -145,9 +147,25 @@ + static struct kmem_cache *filelock_cache __read_mostly; + + /* Allocate an empty lock structure. */ +-static struct file_lock *locks_alloc_lock(void) ++static struct file_lock *locks_alloc_lock(int charge) + { +- return kmem_cache_alloc(filelock_cache, GFP_KERNEL); ++ struct file_lock *fl; ++ ++ fl = kmem_cache_alloc(filelock_cache, GFP_KERNEL); ++#ifdef CONFIG_BEANCOUNTERS ++ if (fl == NULL) ++ goto out; ++ fl->fl_charged = 0; ++ if (!charge) ++ goto out; ++ if (!ub_flock_charge(fl, 1)) ++ goto out; ++ ++ kmem_cache_free(filelock_cache, fl); ++ fl = NULL; ++out: ++#endif ++ return fl; + } + + static void locks_release_private(struct file_lock *fl) +@@ -172,6 +190,7 @@ + BUG_ON(!list_empty(&fl->fl_block)); + BUG_ON(!list_empty(&fl->fl_link)); + ++ ub_flock_uncharge(fl); + locks_release_private(fl); + kmem_cache_free(filelock_cache, fl); + } +@@ -273,7 +292,7 @@ + if (type < 0) + return type; + +- fl = locks_alloc_lock(); ++ fl = locks_alloc_lock(type != F_UNLCK); + if (fl == NULL) + return -ENOMEM; + +@@ -460,7 +479,7 @@ + /* Allocate a file_lock initialised to this type of lease */ + static struct file_lock *lease_alloc(struct file *filp, int type) + { +- struct file_lock *fl = locks_alloc_lock(); ++ struct file_lock *fl = locks_alloc_lock(1); + int error = -ENOMEM; + + if (fl == NULL) +@@ -746,8 +765,13 @@ + goto find_conflict; + + if (request->fl_type != F_UNLCK) { ++ /* ++ * Nont F_UNLCK request must be already charged in ++ * flock_make_lock(). Actually new_fl must be charged not the ++ * request, but we try to fail earlier. ++ */ + error = -ENOMEM; +- new_fl = locks_alloc_lock(); ++ new_fl = locks_alloc_lock(0); + if (new_fl == NULL) + goto out; + error = 0; +@@ -797,6 +821,10 @@ + } + if (request->fl_flags & FL_ACCESS) + goto out; ++ ++ set_flock_charged(new_fl); ++ unset_flock_charged(request); ++ + locks_copy_lock(new_fl, request); + locks_insert_lock(before, new_fl); + new_fl = NULL; +@@ -828,8 +856,11 @@ + if (!(request->fl_flags & FL_ACCESS) && + (request->fl_type != F_UNLCK || + request->fl_start != 0 || request->fl_end != OFFSET_MAX)) { +- new_fl = locks_alloc_lock(); +- new_fl2 = locks_alloc_lock(); ++ if (request->fl_type != F_UNLCK) ++ new_fl = locks_alloc_lock(1); ++ else ++ new_fl = NULL; ++ new_fl2 = locks_alloc_lock(0); + } + + lock_kernel(); +@@ -963,7 +994,7 @@ + * bail out. + */ + error = -ENOLCK; /* "no luck" */ +- if (right && left == right && !new_fl2) ++ if (right && left == right && !(request->fl_type == F_UNLCK || new_fl2)) + goto out; + + error = 0; +@@ -974,23 +1005,32 @@ + goto out; + } + +- if (!new_fl) { +- error = -ENOLCK; ++ error = -ENOLCK; ++ if (!new_fl) ++ goto out; ++ if (right && (left == right) && ub_flock_charge(new_fl, 1)) + goto out; +- } + locks_copy_lock(new_fl, request); + locks_insert_lock(before, new_fl); + new_fl = NULL; ++ error = 0; + } + if (right) { + if (left == right) { + /* The new lock breaks the old one in two pieces, + * so we have to use the second new lock. + */ ++ error = -ENOLCK; ++ if (added && ub_flock_charge(new_fl2, ++ request->fl_type != F_UNLCK)) ++ goto out; ++ /* FIXME move all fl_charged manipulations in ub code */ ++ set_flock_charged(new_fl2); + left = new_fl2; + new_fl2 = NULL; + locks_copy_lock(left, right); + locks_insert_lock(before, left); ++ error = 0; + } + right->fl_start = request->fl_end + 1; + locks_wake_up_blocks(right); +@@ -1381,7 +1421,7 @@ + goto out; + + error = -ENOMEM; +- new_fl = locks_alloc_lock(); ++ new_fl = locks_alloc_lock(1); + if (new_fl == NULL) + goto out; + +@@ -1615,6 +1655,7 @@ + out: + return error; + } ++EXPORT_SYMBOL_GPL(sys_flock); + + /** + * vfs_test_lock - test file byte range lock +@@ -1635,7 +1676,7 @@ + + static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) + { +- flock->l_pid = fl->fl_pid; ++ flock->l_pid = pid_to_vpid(fl->fl_pid); + #if BITS_PER_LONG == 32 + /* + * Make sure we can represent the posix lock via +@@ -1657,7 +1698,7 @@ + #if BITS_PER_LONG == 32 + static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) + { +- flock->l_pid = fl->fl_pid; ++ flock->l_pid = pid_to_vpid(fl->fl_pid); + flock->l_start = fl->fl_start; + flock->l_len = fl->fl_end == OFFSET_MAX ? 0 : + fl->fl_end - fl->fl_start + 1; +@@ -1751,7 +1792,7 @@ + int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, + struct flock __user *l) + { +- struct file_lock *file_lock = locks_alloc_lock(); ++ struct file_lock *file_lock = locks_alloc_lock(0); + struct flock flock; + struct inode *inode; + struct file *f; +@@ -1888,7 +1929,7 @@ + int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd, + struct flock64 __user *l) + { +- struct file_lock *file_lock = locks_alloc_lock(); ++ struct file_lock *file_lock = locks_alloc_lock(0); + struct flock64 flock; + struct inode *inode; + struct file *f; +@@ -2105,7 +2146,9 @@ + int id, char *pfx) + { + struct inode *inode = NULL; ++ unsigned int fl_pid; + ++ fl_pid = pid_to_vpid(fl->fl_pid); + if (fl->fl_file != NULL) + inode = fl->fl_file->f_path.dentry->d_inode; + +@@ -2145,16 +2188,16 @@ + } + if (inode) { + #ifdef WE_CAN_BREAK_LSLK_NOW +- seq_printf(f, "%d %s:%ld ", fl->fl_pid, ++ seq_printf(f, "%d %s:%ld ", fl_pid, + inode->i_sb->s_id, inode->i_ino); + #else + /* userspace relies on this representation of dev_t ;-( */ +- seq_printf(f, "%d %02x:%02x:%ld ", fl->fl_pid, ++ seq_printf(f, "%d %02x:%02x:%ld ", fl_pid, + MAJOR(inode->i_sb->s_dev), + MINOR(inode->i_sb->s_dev), inode->i_ino); + #endif + } else { +- seq_printf(f, "%d :0 ", fl->fl_pid); ++ seq_printf(f, "%d :0 ", fl_pid); + } + if (IS_POSIX(fl)) { + if (fl->fl_end == OFFSET_MAX) +@@ -2171,6 +2214,8 @@ + struct file_lock *fl, *bfl; + + fl = list_entry(v, struct file_lock, fl_link); ++ if (!ve_accessible(fl->fl_file->owner_env, get_exec_env())) ++ goto out; + + lock_get_status(f, fl, (long)f->private, ""); + +@@ -2178,6 +2223,7 @@ + lock_get_status(f, bfl, (long)f->private, " ->"); + + f->private++; ++out: + return 0; + } + +@@ -2287,7 +2333,7 @@ + static int __init filelock_init(void) + { + filelock_cache = kmem_cache_create("file_lock_cache", +- sizeof(struct file_lock), 0, SLAB_PANIC, ++ sizeof(struct file_lock), 0, SLAB_PANIC|SLAB_UBC, + init_once); + return 0; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/mpage.c debian/binary-custom.d/openvz/src/fs/mpage.c +--- ./fs/mpage.c 2012-06-12 16:25:23.394312518 +0100 ++++ debian/binary-custom.d/openvz/src/fs/mpage.c 2012-11-13 15:20:14.104569110 +0000 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + /* + * I/O completion handler for multipage BIOs. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/namei.c debian/binary-custom.d/openvz/src/fs/namei.c +--- ./fs/namei.c 2012-06-12 16:25:23.394312518 +0100 ++++ debian/binary-custom.d/openvz/src/fs/namei.c 2012-11-13 15:20:14.104569110 +0000 +@@ -141,6 +141,7 @@ + { + char *tmp, *result; + ++ /*ub_dentry_checkup();*/ + result = ERR_PTR(-ENOMEM); + tmp = __getname(); + if (tmp) { +@@ -434,6 +435,21 @@ + if (!dentry) + dentry = d_lookup(parent, name); + ++ /* ++ * The revalidation rules are simple: ++ * d_revalidate operation is called when we're about to use a cached ++ * dentry rather than call d_lookup. ++ * d_revalidate method may unhash the dentry itself or return FALSE, in ++ * which case if the dentry can be released d_lookup will be called. ++ * ++ * Additionally, by request of NFS people ++ * (http://linux.bkbits.net:8080/linux-2.4/cset@1.181?nav=index.html|src/|src/fs|related/fs/namei.c) ++ * d_revalidate is called when `/', `.' or `..' are looked up. ++ * Since re-lookup is impossible on them, we introduce a hack and ++ * return an error in this case. ++ * ++ * 2003/02/19 SAW ++ */ + if (dentry && dentry->d_op && dentry->d_op->d_revalidate) + dentry = do_revalidate(dentry, nd); + +@@ -493,6 +509,7 @@ + struct dentry * result; + struct inode *dir = parent->d_inode; + ++repeat: + mutex_lock(&dir->i_mutex); + /* + * First re-do the cached lookup just in case it was created +@@ -539,7 +556,7 @@ + if (result->d_op && result->d_op->d_revalidate) { + result = do_revalidate(result, nd); + if (!result) +- result = ERR_PTR(-ENOENT); ++ goto repeat; + } + return result; + } +@@ -765,6 +782,13 @@ + read_unlock(&fs->lock); + break; + } ++#ifdef CONFIG_VE ++ if (nd->dentry == get_exec_env()->fs_root && ++ nd->mnt == get_exec_env()->fs_rootmnt) { ++ read_unlock(¤t->fs->lock); ++ break; ++ } ++#endif + read_unlock(&fs->lock); + spin_lock(&dcache_lock); + if (nd->dentry != nd->mnt->mnt_root) { +@@ -806,6 +830,10 @@ + if (dentry->d_op && dentry->d_op->d_revalidate) + goto need_revalidate; + done: ++ if ((nd->flags & LOOKUP_STRICT) && d_mountpoint(dentry)) { ++ dput(dentry); ++ return -ENOENT; ++ } + path->mnt = mnt; + path->dentry = dentry; + __follow_mount(path); +@@ -854,6 +882,7 @@ + struct inode *inode; + int err; + unsigned int lookup_flags = nd->flags; ++ int real_components = 0; + + while (*name=='/') + name++; +@@ -923,6 +952,7 @@ + break; + } + /* This does the actual lookups.. */ ++ real_components++; + err = do_lookup(nd, &this, &next); + if (err) + break; +@@ -936,6 +966,9 @@ + goto out_dput; + + if (inode->i_op->follow_link) { ++ err = -ENOENT; ++ if (lookup_flags & LOOKUP_STRICT) ++ goto out_dput; + err = do_follow_link(&next, nd); + if (err) + goto return_err; +@@ -982,7 +1015,8 @@ + if (err) + break; + inode = next.dentry->d_inode; +- if (follow_on_final(inode, lookup_flags)) { ++ if (follow_on_final(inode, lookup_flags) ++ && !(lookup_flags & LOOKUP_STRICT)) { + err = do_follow_link(&next, nd); + if (err) + goto return_err; +@@ -1003,26 +1037,40 @@ + nd->last_type = LAST_NORM; + if (this.name[0] != '.') + goto return_base; +- if (this.len == 1) ++ if (this.len == 1) { + nd->last_type = LAST_DOT; +- else if (this.len == 2 && this.name[1] == '.') ++ goto return_reval; ++ } else if (this.len == 2 && this.name[1] == '.') { + nd->last_type = LAST_DOTDOT; +- else +- goto return_base; ++ goto return_reval; ++ } ++return_base: ++ if (!(nd->flags & LOOKUP_NOAREACHECK)) { ++ err = check_area_access_ve(nd->dentry, nd->mnt); ++ if (err) ++ break; ++ } ++ return 0; + return_reval: + /* + * We bypassed the ordinary revalidation routines. + * We may need to check the cached dentry for staleness. + */ +- if (nd->dentry && nd->dentry->d_sb && ++ if (!real_components && nd->dentry && nd->dentry->d_sb && + (nd->dentry->d_sb->s_type->fs_flags & FS_REVAL_DOT)) { + err = -ESTALE; + /* Note: we do not d_invalidate() */ + if (!nd->dentry->d_op->d_revalidate(nd->dentry, nd)) ++ /* ++ * This lookup is for `/' or `.' or `..'. ++ * The filesystem unhashed the dentry itself ++ * inside d_revalidate (otherwise, d_invalidate ++ * wouldn't succeed). As a special courtesy to ++ * NFS we return an error. 2003/02/19 SAW ++ */ + break; + } +-return_base: +- return 0; ++ goto return_base; + out_dput: + dput_path(&next, nd); + break; +@@ -2029,6 +2077,7 @@ + { + return sys_mknodat(AT_FDCWD, filename, mode, dev); + } ++EXPORT_SYMBOL_GPL(sys_mknod); + + int vfs_mkdir(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt, + int mode) +@@ -2090,6 +2139,7 @@ + { + return sys_mkdirat(AT_FDCWD, pathname, mode); + } ++EXPORT_SYMBOL_GPL(sys_mkdir); + + /* + * We try to drop the dentry early: we should have +@@ -2117,6 +2167,7 @@ + spin_unlock(&dentry->d_lock); + spin_unlock(&dcache_lock); + } ++EXPORT_SYMBOL(sys_symlink); + + int vfs_rmdir(struct inode *dir, struct dentry *dentry,struct vfsmount *mnt) + { +@@ -2198,6 +2249,7 @@ + { + return do_rmdir(AT_FDCWD, pathname); + } ++EXPORT_SYMBOL_GPL(sys_rmdir); + + int vfs_unlink(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt) + { +@@ -2297,6 +2349,7 @@ + { + return do_unlinkat(AT_FDCWD, pathname); + } ++EXPORT_SYMBOL_GPL(sys_unlink); + + int vfs_symlink(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt, + const char *oldname, int mode) +@@ -2461,6 +2514,7 @@ + { + return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0); + } ++EXPORT_SYMBOL(sys_rename); + + /* + * The worst of all namespace operations - renaming directory. "Perverted" +@@ -2577,6 +2631,9 @@ + int is_dir = S_ISDIR(old_dentry->d_inode->i_mode); + const char *old_name; + ++ if (DQUOT_RENAME(old_dentry->d_inode, old_dir, new_dir)) ++ return -EXDEV; ++ + if (old_dentry->d_inode == new_dentry->d_inode) + return 0; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/namespace.c debian/binary-custom.d/openvz/src/fs/namespace.c +--- ./fs/namespace.c 2012-06-12 16:25:23.394312518 +0100 ++++ debian/binary-custom.d/openvz/src/fs/namespace.c 2012-11-13 15:20:14.104569110 +0000 +@@ -32,6 +32,7 @@ + + /* spinlock for vfsmount related operations, inplace of dcache_lock */ + __cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock); ++EXPORT_SYMBOL(vfsmount_lock); + + static int event; + +@@ -57,6 +58,7 @@ + { + struct vfsmount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL); + if (mnt) { ++ mnt->owner = VEID(get_exec_env()); + atomic_set(&mnt->mnt_count, 1); + INIT_LIST_HEAD(&mnt->mnt_hash); + INIT_LIST_HEAD(&mnt->mnt_child); +@@ -68,7 +70,7 @@ + INIT_LIST_HEAD(&mnt->mnt_slave); + if (name) { + int size = strlen(name) + 1; +- char *newname = kmalloc(size, GFP_KERNEL); ++ char *newname = kmalloc(size, GFP_KERNEL_UBC); + if (newname) { + memcpy(newname, name, size); + mnt->mnt_devname = newname; +@@ -344,10 +346,33 @@ + seq_escape(m, s, " \t\n\\"); + } + ++static int prepare_mnt_root_mangle(struct vfsmount *mnt, ++ char **path_buf, char **path) ++{ ++ /* skip FS_NOMOUNT mounts (rootfs) */ ++ if (mnt->mnt_sb->s_flags & MS_NOUSER) ++ return -EACCES; ++ ++ *path_buf = (char *)__get_free_page(GFP_KERNEL); ++ if (!*path_buf) ++ return -ENOMEM; ++ ++ *path = d_path(mnt->mnt_root, mnt, *path_buf, PAGE_SIZE); ++ if (IS_ERR(*path)) { ++ free_page((unsigned long)*path_buf); ++ /* ++ * This means that the file position will be incremented, i.e. ++ * the total number of "invisible" vfsmnt will leak. ++ */ ++ return -EACCES; ++ } ++ return 0; ++} ++ + static int show_vfsmnt(struct seq_file *m, void *v) + { + struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list); +- int err = 0; ++ int err; + static struct proc_fs_info { + int flag; + char *str; +@@ -367,10 +392,20 @@ + { 0, NULL } + }; + struct proc_fs_info *fs_infop; ++ char *path_buf, *path; + +- mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); ++ err = prepare_mnt_root_mangle(mnt, &path_buf, &path); ++ if (err < 0) ++ return (err == -EACCES ? 0 : err); ++ ++ if (ve_is_super(get_exec_env()) || ++ !(mnt->mnt_sb->s_type->fs_flags & FS_MANGLE_PROC)) ++ mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); ++ else ++ mangle(m, mnt->mnt_sb->s_type->name); + seq_putc(m, ' '); +- seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); ++ mangle(m, path); ++ free_page((unsigned long) path_buf); + seq_putc(m, ' '); + mangle(m, mnt->mnt_sb->s_type->name); + if (mnt->mnt_sb->s_subtype && mnt->mnt_sb->s_subtype[0]) { +@@ -402,18 +437,27 @@ + static int show_vfsstat(struct seq_file *m, void *v) + { + struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list); +- int err = 0; ++ char *path_buf, *path; ++ int err; ++ ++ err = prepare_mnt_root_mangle(mnt, &path_buf, &path); ++ if (err < 0) ++ return (err == -EACCES ? 0 : err); + + /* device */ + if (mnt->mnt_devname) { + seq_puts(m, "device "); +- mangle(m, mnt->mnt_devname); ++ if (ve_is_super(get_exec_env())) ++ mangle(m, mnt->mnt_devname); ++ else ++ mangle(m, mnt->mnt_sb->s_type->name); + } else + seq_puts(m, "no device"); + + /* mount point */ + seq_puts(m, " mounted on "); +- seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); ++ mangle(m, path); ++ free_page((unsigned long)path_buf); + seq_putc(m, ' '); + + /* file system type */ +@@ -512,6 +556,7 @@ + mntput(mnt); + } + } ++EXPORT_SYMBOL(release_mounts); + + void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill) + { +@@ -534,6 +579,7 @@ + change_mnt_propagation(p, MS_PRIVATE); + } + } ++EXPORT_SYMBOL(umount_tree); + + static int do_umount(struct vfsmount *mnt, int flags) + { +@@ -621,6 +667,34 @@ + return retval; + } + ++#ifdef CONFIG_VE ++void umount_ve_fs_type(struct file_system_type *local_fs_type) ++{ ++ struct vfsmount *mnt; ++ struct list_head *p, *q; ++ LIST_HEAD(kill); ++ LIST_HEAD(umount_list); ++ ++ down_write(&namespace_sem); ++ spin_lock(&vfsmount_lock); ++ list_for_each_safe(p, q, ¤t->nsproxy->mnt_ns->list) { ++ mnt = list_entry(p, struct vfsmount, mnt_list); ++ if (mnt->mnt_sb->s_type != local_fs_type) ++ continue; ++ list_del(p); ++ list_add(p, &kill); ++ } ++ ++ while (!list_empty(&kill)) { ++ mnt = list_entry(kill.next, struct vfsmount, mnt_list); ++ umount_tree(mnt, 1, &umount_list); ++ } ++ spin_unlock(&vfsmount_lock); ++ up_write(&namespace_sem); ++ release_mounts(&umount_list); ++} ++#endif ++ + /* + * Now umount can handle mount points as well as block devices. + * This is important for filesystems which use unnamed block devices. +@@ -644,7 +718,7 @@ + goto dput_and_out; + + retval = -EPERM; +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_VE_SYS_ADMIN)) + goto dput_and_out; + + retval = do_umount(nd.mnt, flags); +@@ -668,7 +742,7 @@ + + static int mount_is_safe(struct nameidata *nd) + { +- if (capable(CAP_SYS_ADMIN)) ++ if (capable(CAP_VE_SYS_ADMIN)) + return 0; + return -EPERM; + #ifdef notyet +@@ -907,6 +981,8 @@ + + if (nd->dentry != nd->mnt->mnt_root) + return -EINVAL; ++ if (!ve_accessible_veid(nd->mnt->owner, get_exec_env()->veid)) ++ return -EPERM; + + down_write(&namespace_sem); + spin_lock(&vfsmount_lock); +@@ -920,7 +996,8 @@ + /* + * do loopback mount. + */ +-static int do_loopback(struct nameidata *nd, char *old_name, int recurse) ++static int do_loopback(struct nameidata *nd, char *old_name, int recurse, ++ int mnt_flags) + { + struct nameidata old_nd; + struct vfsmount *mnt = NULL; +@@ -950,6 +1027,7 @@ + if (!mnt) + goto out; + ++ mnt->mnt_flags |= mnt_flags; + err = graft_tree(mnt, nd); + if (err) { + LIST_HEAD(umount_list); +@@ -975,8 +1053,9 @@ + { + int err; + struct super_block *sb = nd->mnt->mnt_sb; ++ int bind; + +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + + if (!check_mnt(nd->mnt)) +@@ -985,12 +1064,23 @@ + if (nd->dentry != nd->mnt->mnt_root) + return -EINVAL; + ++ if (!ve_accessible_veid(nd->mnt->owner, get_exec_env()->veid)) ++ return -EPERM; ++ ++ /* do not allow to remount bind-mounts with another mountpoint flags */ ++ bind = 0; ++ if (nd->dentry != sb->s_root) { ++ if ((flags & ~(MS_BIND|MS_POSIXACL|MS_NOUSER)) != 0) ++ return -EINVAL; ++ bind = 1; ++ } ++ + down_write(&sb->s_umount); +- err = do_remount_sb(sb, flags, data, 0); ++ err = bind ? 0 : do_remount_sb(sb, flags, data, 0); + if (!err) + nd->mnt->mnt_flags = mnt_flags; + up_write(&sb->s_umount); +- if (!err) ++ if (!err && !bind) + security_sb_post_remount(nd->mnt, flags, data); + return err; + } +@@ -1010,7 +1100,7 @@ + struct nameidata old_nd, parent_nd; + struct vfsmount *p; + int err = 0; +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + if (!old_name || !*old_name) + return -EINVAL; +@@ -1018,6 +1108,10 @@ + if (err) + return err; + ++ err = -EPERM; ++ if (!ve_accessible_veid(old_nd.mnt->owner, get_exec_env()->veid)) ++ goto out_nosem; ++ + down_write(&namespace_sem); + while (d_mountpoint(nd->dentry) && follow_down(&nd->mnt, &nd->dentry)) + ; +@@ -1073,6 +1167,7 @@ + up_write(&namespace_sem); + if (!err) + path_release(&parent_nd); ++out_nosem: + path_release(&old_nd); + return err; + } +@@ -1090,7 +1185,7 @@ + return -EINVAL; + + /* we need capabilities... */ +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + + mnt = do_kern_mount(type, flags, name, data); +@@ -1129,6 +1224,10 @@ + + newmnt->mnt_flags = mnt_flags; + ++ /* make this before graft_tree reveals mnt_root to the world... */ ++ if (nd->dentry->d_flags & DCACHE_VIRTUAL) ++ newmnt->mnt_root->d_flags |= DCACHE_VIRTUAL; ++ + if ((err = graft_tree(newmnt, nd))) + goto unlock; + +@@ -1471,7 +1570,7 @@ + retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, + data_page); + else if (flags & MS_BIND) +- retval = do_loopback(&nd, dev_name, flags & MS_REC); ++ retval = do_loopback(&nd, dev_name, flags & MS_REC, mnt_flags); + else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) + retval = do_change_type(&nd, flags); + else if (flags & MS_MOVE) +@@ -1613,6 +1712,7 @@ + free_page(type_page); + return retval; + } ++EXPORT_SYMBOL_GPL(sys_mount); + + /* + * Replace the fs->{rootmnt,root} with {mnt,dentry}. Put the old values. +@@ -1664,7 +1764,7 @@ + struct fs_struct *fs; + + read_lock(&tasklist_lock); +- do_each_thread(g, p) { ++ do_each_thread_ve(g, p) { + task_lock(p); + fs = p->fs; + if (fs) { +@@ -1679,7 +1779,7 @@ + put_fs_struct(fs); + } else + task_unlock(p); +- } while_each_thread(g, p); ++ } while_each_thread_ve(g, p); + read_unlock(&tasklist_lock); + } + +@@ -1846,7 +1946,7 @@ + init_rwsem(&namespace_sem); + + mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct vfsmount), +- 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); ++ 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_UBC, NULL); + + mount_hashtable = (struct list_head *)__get_free_page(GFP_ATOMIC); + +@@ -1908,6 +2008,7 @@ + release_mounts(&umount_list); + kfree(ns); + } ++EXPORT_SYMBOL_GPL(__put_mnt_ns); + + char *d_namespace_path(struct dentry *dentry, struct vfsmount *vfsmnt, + char *buf, int buflen) +@@ -1926,7 +2027,7 @@ + mntput(rootmnt); + if (nsrootmnt) + root = dget(nsrootmnt->mnt_root); +- res = __d_path(dentry, vfsmnt, root, nsrootmnt, buf, buflen, 1); ++ res = __d_path(dentry, vfsmnt, root, nsrootmnt, buf, buflen); + dput(root); + mntput(nsrootmnt); + /* Prevent empty path for lazily unmounted filesystems. */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/nfs/client.c debian/binary-custom.d/openvz/src/fs/nfs/client.c +--- ./fs/nfs/client.c 2012-06-12 16:25:23.402312518 +0100 ++++ debian/binary-custom.d/openvz/src/fs/nfs/client.c 2012-11-13 15:20:14.116569112 +0000 +@@ -116,6 +116,7 @@ + + atomic_set(&clp->cl_count, 1); + clp->cl_cons_state = NFS_CS_INITING; ++ clp->owner_env = get_exec_env(); + + clp->cl_nfsversion = nfsversion; + memcpy(&clp->cl_addr, addr, sizeof(clp->cl_addr)); +@@ -210,7 +211,9 @@ + static struct nfs_client *__nfs_find_client(const struct sockaddr_in *addr, int nfsversion, int match_port) + { + struct nfs_client *clp; ++ struct ve_struct *ve; + ++ ve = get_exec_env(); + list_for_each_entry(clp, &nfs_client_list, cl_share_link) { + /* Don't match clients that failed to initialise properly */ + if (clp->cl_cons_state < 0) +@@ -220,6 +223,9 @@ + if (clp->cl_nfsversion != nfsversion) + continue; + ++ if (!ve_accessible_strict(clp->owner_env, ve)) ++ continue; ++ + if (memcmp(&clp->cl_addr.sin_addr, &addr->sin_addr, + sizeof(clp->cl_addr.sin_addr)) != 0) + continue; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/nfs/super.c debian/binary-custom.d/openvz/src/fs/nfs/super.c +--- ./fs/nfs/super.c 2012-06-12 16:25:23.414312517 +0100 ++++ debian/binary-custom.d/openvz/src/fs/nfs/super.c 2012-11-13 15:20:14.144569112 +0000 +@@ -48,6 +48,9 @@ + #include + #include + #include ++#include ++#include ++#include + + #include + #include +@@ -208,7 +211,8 @@ + .name = "nfs", + .get_sb = nfs_get_sb, + .kill_sb = nfs_kill_super, +- .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, ++ .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT| ++ FS_BINARY_MOUNTDATA|FS_VIRTUALIZED, + }; + + struct file_system_type nfs_xdev_fs_type = { +@@ -216,7 +220,8 @@ + .name = "nfs", + .get_sb = nfs_xdev_get_sb, + .kill_sb = nfs_kill_super, +- .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, ++ .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT| ++ FS_BINARY_MOUNTDATA|FS_VIRTUALIZED, + }; + + static const struct super_operations nfs_sops = { +@@ -280,6 +285,55 @@ + .seeks = DEFAULT_SEEKS, + }; + ++#ifdef CONFIG_VE ++static int ve_nfs_start(void *data) ++{ ++ return 0; ++} ++ ++static void ve_nfs_stop(void *data) ++{ ++ struct ve_struct *ve; ++ struct super_block *sb; ++ ++ flush_scheduled_work(); ++ ++ ve = (struct ve_struct *)data; ++ /* Basically, on a valid stop we can be here iff NFS was mounted ++ read-only. In such a case client force-stop is not a problem. ++ If we are here and NFS is read-write, we are in a FORCE stop, so ++ force the client to stop. ++ Lock daemon is already dead. ++ Only superblock client remains. Den */ ++ spin_lock(&sb_lock); ++ list_for_each_entry(sb, &super_blocks, s_list) { ++ struct rpc_clnt *clnt; ++ struct rpc_xprt *xprt; ++ if (sb->s_type != &nfs_fs_type) ++ continue; ++ clnt = NFS_SB(sb)->client; ++ if (!ve_accessible_strict(clnt->cl_xprt->owner_env, ve)) ++ continue; ++ clnt->cl_broken = 1; ++ rpc_killall_tasks(clnt); ++ ++ xprt = clnt->cl_xprt; ++ xprt_disconnect(xprt); ++ xprt->ops->close(xprt); ++ } ++ spin_unlock(&sb_lock); ++ ++ flush_scheduled_work(); ++} ++ ++static struct ve_hook nfs_hook = { ++ .init = ve_nfs_start, ++ .fini = ve_nfs_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_NET_POST, ++}; ++#endif ++ + /* + * Register the NFS filesystems + */ +@@ -300,6 +354,7 @@ + goto error_2; + #endif + register_shrinker(&acl_shrinker); ++ ve_hook_register(VE_SS_CHAIN, &nfs_hook); + return 0; + + #ifdef CONFIG_NFS_V4 +@@ -318,6 +373,7 @@ + void __exit unregister_nfs_fs(void) + { + unregister_shrinker(&acl_shrinker); ++ ve_hook_unregister(&nfs_hook); + #ifdef CONFIG_NFS_V4 + unregister_filesystem(&nfs4_fs_type); + #endif +@@ -561,6 +617,9 @@ + struct nfs_server *server = NFS_SB(vfsmnt->mnt_sb); + struct rpc_clnt *rpc; + ++ /* ++ * FIXME - think over wether this is OK ++ */ + shrink_submounts(vfsmnt, &nfs_automount_list); + + if (!(flags & MNT_FORCE)) +@@ -1328,6 +1387,9 @@ + struct nfs_server *server = sb_mntdata->server, *old = NFS_SB(sb); + int mntflags = sb_mntdata->mntflags; + ++ if (!ve_accessible_strict(old->client->cl_xprt->owner_env, ++ get_exec_env())) ++ return 0; + if (memcmp(&old->nfs_client->cl_addr, + &server->nfs_client->cl_addr, + sizeof(old->nfs_client->cl_addr)) != 0) +@@ -1353,6 +1415,11 @@ + .mntflags = flags, + }; + int error; ++ struct ve_struct *ve; ++ ++ ve = get_exec_env(); ++ if (!ve_is_super(ve) && !(get_exec_env()->features & VE_FEATURE_NFS)) ++ return -ENODEV; + + /* Validate the mount data */ + error = nfs_validate_mount_data(raw_data, &data, &mntfh, dev_name); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/open.c debian/binary-custom.d/openvz/src/fs/open.c +--- ./fs/open.c 2012-06-12 16:25:23.486312515 +0100 ++++ debian/binary-custom.d/openvz/src/fs/open.c 2012-11-13 15:20:14.228569110 +0000 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -49,7 +50,21 @@ + + EXPORT_SYMBOL(vfs_statfs); + +-static int vfs_statfs_native(struct dentry *dentry, struct statfs *buf) ++int faudit_statfs(struct super_block *sb, struct kstatfs *buf) ++{ ++ struct faudit_statfs_arg arg; ++ ++ arg.sb = sb; ++ arg.stat = buf; ++ ++ if (virtinfo_notifier_call(VITYPE_FAUDIT, VIRTINFO_FAUDIT_STATFS, &arg) ++ != NOTIFY_DONE) ++ return arg.err; ++ return 0; ++} ++ ++static int vfs_statfs_native(struct dentry *dentry, struct vfsmount *mnt, ++ struct statfs *buf) + { + struct kstatfs st; + int retval; +@@ -58,6 +73,10 @@ + if (retval) + return retval; + ++ retval = faudit_statfs(mnt->mnt_sb, &st); ++ if (retval) ++ return retval; ++ + if (sizeof(*buf) == sizeof(st)) + memcpy(buf, &st, sizeof(st)); + else { +@@ -92,7 +111,8 @@ + return 0; + } + +-static int vfs_statfs64(struct dentry *dentry, struct statfs64 *buf) ++static int vfs_statfs64(struct dentry *dentry, struct vfsmount *mnt, ++ struct statfs64 *buf) + { + struct kstatfs st; + int retval; +@@ -101,6 +121,10 @@ + if (retval) + return retval; + ++ retval = faudit_statfs(mnt->mnt_sb, &st); ++ if (retval) ++ return retval; ++ + if (sizeof(*buf) == sizeof(st)) + memcpy(buf, &st, sizeof(st)); + else { +@@ -127,7 +151,7 @@ + error = user_path_walk(path, &nd); + if (!error) { + struct statfs tmp; +- error = vfs_statfs_native(nd.dentry, &tmp); ++ error = vfs_statfs_native(nd.dentry, nd.mnt, &tmp); + if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) + error = -EFAULT; + path_release(&nd); +@@ -146,7 +170,7 @@ + error = user_path_walk(path, &nd); + if (!error) { + struct statfs64 tmp; +- error = vfs_statfs64(nd.dentry, &tmp); ++ error = vfs_statfs64(nd.dentry, nd.mnt, &tmp); + if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) + error = -EFAULT; + path_release(&nd); +@@ -165,7 +189,7 @@ + file = fget(fd); + if (!file) + goto out; +- error = vfs_statfs_native(file->f_path.dentry, &tmp); ++ error = vfs_statfs_native(file->f_path.dentry, file->f_path.mnt, &tmp); + if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) + error = -EFAULT; + fput(file); +@@ -186,7 +210,7 @@ + file = fget(fd); + if (!file) + goto out; +- error = vfs_statfs64(file->f_path.dentry, &tmp); ++ error = vfs_statfs64(file->f_path.dentry, file->f_path.mnt, &tmp); + if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) + error = -EFAULT; + fput(file); +@@ -589,15 +613,20 @@ + return err; + } + +-asmlinkage long sys_fchmodat(int dfd, const char __user *filename, +- mode_t mode) ++static long do_fchmodat(int dfd, const char __user *filename, mode_t mode, ++ int flags) + { + struct nameidata nd; + struct inode * inode; +- int error; ++ int error = -EINVAL; + struct iattr newattrs; ++ int follow; ++ ++ if ((flags & ~AT_SYMLINK_NOFOLLOW) != 0) ++ goto out; + +- error = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW, &nd); ++ follow = (flags & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW; ++ error = __user_walk_fd(dfd, filename, follow, &nd); + if (error) + goto out; + inode = nd.dentry->d_inode; +@@ -624,6 +653,12 @@ + return error; + } + ++asmlinkage long sys_fchmodat(int dfd, const char __user *filename, ++ mode_t mode) ++{ ++ return do_fchmodat(dfd, filename, mode, 0); ++} ++ + asmlinkage long sys_chmod(const char __user *filename, mode_t mode) + { + return sys_fchmodat(AT_FDCWD, filename, mode); +@@ -681,6 +716,7 @@ + out: + return error; + } ++EXPORT_SYMBOL_GPL(sys_chown); + + asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, + gid_t group, int flag) +@@ -898,6 +934,7 @@ + return filp; + } + ++int odirect_enable = 0; + /* + * dentry_open() will have done dput(dentry) and mntput(mnt) if it returns an + * error. +@@ -907,6 +944,9 @@ + int error; + struct file *f; + ++ if (!capable(CAP_SYS_RAWIO) && !odirect_enable) ++ flags &= ~O_DIRECT; ++ + error = -ENFILE; + f = get_empty_filp(); + if (f == NULL) { +@@ -1062,7 +1102,7 @@ + prevent_tail_call(ret); + return ret; + } +-EXPORT_UNUSED_SYMBOL_GPL(sys_open); /* To be deleted for 2.6.25 */ ++EXPORT_SYMBOL_GPL(sys_open); + + asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, + int mode) +@@ -1196,3 +1236,8 @@ + } + + EXPORT_SYMBOL(nonseekable_open); ++ ++asmlinkage long sys_lchmod(char __user * filename, mode_t mode) ++{ ++ return do_fchmodat(AT_FDCWD, filename, mode, AT_SYMLINK_NOFOLLOW); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/partitions/check.c debian/binary-custom.d/openvz/src/fs/partitions/check.c +--- ./fs/partitions/check.c 2012-06-12 16:25:23.490312515 +0100 ++++ debian/binary-custom.d/openvz/src/fs/partitions/check.c 2012-11-13 15:20:14.228569110 +0000 +@@ -130,6 +130,7 @@ + + return buf; + } ++EXPORT_SYMBOL(disk_name); + + const char *bdevname(struct block_device *bdev, char *buf) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/pipe.c debian/binary-custom.d/openvz/src/fs/pipe.c +--- ./fs/pipe.c 2012-06-12 16:25:23.490312515 +0100 ++++ debian/binary-custom.d/openvz/src/fs/pipe.c 2012-11-13 15:20:14.232569106 +0000 +@@ -21,6 +21,8 @@ + #include + #include + ++#include ++ + /* + * We use a start+len construction, which provides full use of the + * allocated memory. +@@ -477,7 +479,7 @@ + int error, atomic = 1; + + if (!page) { +- page = alloc_page(GFP_HIGHUSER); ++ page = alloc_page(GFP_HIGHUSER | __GFP_UBC); + if (unlikely(!page)) { + ret = ret ? : -ENOMEM; + break; +@@ -876,7 +878,7 @@ + { + struct pipe_inode_info *pipe; + +- pipe = kzalloc(sizeof(struct pipe_inode_info), GFP_KERNEL); ++ pipe = kzalloc(sizeof(struct pipe_inode_info), GFP_KERNEL_UBC); + if (pipe) { + init_waitqueue_head(&pipe->wait); + pipe->r_counter = pipe->w_counter = 1; +@@ -1094,6 +1096,8 @@ + return error; + } + ++EXPORT_SYMBOL_GPL(do_pipe); ++ + /* + * pipefs should _never_ be mounted by userland - too much of security hassle, + * no real gain from having the whole whorehouse mounted. So we don't need +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/array.c debian/binary-custom.d/openvz/src/fs/proc/array.c +--- ./fs/proc/array.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/array.c 2012-11-13 15:20:14.232569106 +0000 +@@ -80,6 +80,9 @@ + #include + #include + ++#include ++ ++#include + #include + #include + #include "internal.h" +@@ -204,6 +207,18 @@ + put_group_info(group_info); + + buffer += sprintf(buffer, "\n"); ++ ++#ifdef CONFIG_VE ++ buffer += sprintf(buffer, ++ "envID:\t%d\n" ++ "VPid:\t%d\n" ++ "PNState:\t%u\n" ++ "StopState:\t%u\n", ++ p->ve_task_info.owner_env->veid, ++ task_pid_vnr(p), ++ p->pn_state, ++ p->stopped_state); ++#endif + return buffer; + } + +@@ -247,10 +262,10 @@ + } + } + +-static inline char *task_sig(struct task_struct *p, char *buffer) ++char *task_sig(struct task_struct *p, char *buffer) + { + unsigned long flags; +- sigset_t pending, shpending, blocked, ignored, caught; ++ sigset_t pending, shpending, blocked, ignored, caught, saved; + int num_threads = 0; + unsigned long qsize = 0; + unsigned long qlim = 0; +@@ -260,12 +275,14 @@ + sigemptyset(&blocked); + sigemptyset(&ignored); + sigemptyset(&caught); ++ sigemptyset(&saved); + + rcu_read_lock(); + if (lock_task_sighand(p, &flags)) { + pending = p->pending.signal; + shpending = p->signal->shared_pending.signal; + blocked = p->blocked; ++ saved = p->saved_sigmask; + collect_sigign_sigcatch(p, &ignored, &caught); + num_threads = atomic_read(&p->signal->count); + qsize = atomic_read(&p->user->sigpending); +@@ -283,6 +300,7 @@ + buffer = render_sigset_t("SigBlk:\t", &blocked, buffer); + buffer = render_sigset_t("SigIgn:\t", &ignored, buffer); + buffer = render_sigset_t("SigCgt:\t", &caught, buffer); ++ buffer = render_sigset_t("SigSvd:\t", &saved, buffer); + + return buffer; + } +@@ -297,6 +315,20 @@ + cap_t(p->cap_effective)); + } + ++#ifdef CONFIG_BEANCOUNTERS ++static inline void ub_dump_task_info(struct task_struct *tsk, ++ char *stsk, int ltsk, char *smm, int lmm) ++{ ++ print_ub_uid(tsk->task_bc.task_ub, stsk, ltsk); ++ task_lock(tsk); ++ if (tsk->mm) ++ print_ub_uid(tsk->mm->mm_ub, smm, lmm); ++ else ++ strncpy(smm, "N/A", lmm); ++ task_unlock(tsk); ++} ++#endif ++ + static inline char *task_context_switch_counts(struct task_struct *p, + char *buffer) + { +@@ -310,6 +342,9 @@ + { + char *orig = buffer; + struct mm_struct *mm = get_task_mm(task); ++#ifdef CONFIG_BEANCOUNTERS ++ char tsk_ub_info[64], mm_ub_info[64]; ++#endif + + buffer = task_name(task, buffer); + buffer = task_state(task, buffer); +@@ -325,6 +360,14 @@ + buffer = task_show_regs(task, buffer); + #endif + buffer = task_context_switch_counts(task, buffer); ++#ifdef CONFIG_BEANCOUNTERS ++ ub_dump_task_info(task, ++ tsk_ub_info, sizeof(tsk_ub_info), ++ mm_ub_info, sizeof(mm_ub_info)); ++ ++ buffer += sprintf(buffer, "TaskUB:\t%s\n", tsk_ub_info); ++ buffer += sprintf(buffer, "MMUB:\t%s\n", mm_ub_info); ++#endif + return buffer - orig; + } + +@@ -408,6 +451,10 @@ + char tcomm[sizeof(task->comm)]; + unsigned long flags; + struct pid_namespace *ns; ++#ifdef CONFIG_BEANCOUNTERS ++ char ub_task_info[64]; ++ char ub_mm_info[64]; ++#endif + + ns = current->nsproxy->pid_ns; + +@@ -491,6 +538,7 @@ + priority = task_prio(task); + nice = task_nice(task); + ++#ifndef CONFIG_VE + /* Temporary variable needed for gcc-2.96 */ + /* convert timespec -> nsec*/ + start_time = +@@ -498,10 +546,25 @@ + + task->real_start_time.tv_nsec; + /* convert nsec -> ticks */ + start_time = nsec_to_clock_t(start_time); ++#else ++ start_time = ve_relative_clock(&task->start_time); ++#endif ++ ++#ifdef CONFIG_BEANCOUNTERS ++ ub_dump_task_info(task, ub_task_info, sizeof(ub_task_info), ++ ub_mm_info, sizeof(ub_mm_info)); ++#endif + + res = sprintf(buffer, "%d (%s) %c %d %d %d %d %d %u %lu \ + %lu %lu %lu %lu %lu %ld %ld %ld %ld %d 0 %llu %lu %ld %lu %lu %lu %lu %lu \ +-%lu %lu %lu %lu %lu %lu %lu %lu %d %d %u %u %llu %lu %ld\n", ++%lu %lu %lu %lu %lu %lu %lu %lu %d %d %u %u %llu %lu %ld" ++#ifdef CONFIG_VE ++ " 0 0 0 0 0 0 0 %d %u" ++#endif ++#ifdef CONFIG_BEANCOUNTERS ++ " %s %s" ++#endif ++ "\n", + task_pid_nr_ns(task, ns), + tcomm, + state, +@@ -548,7 +611,16 @@ + task->policy, + (unsigned long long)delayacct_blkio_ticks(task), + cputime_to_clock_t(gtime), +- cputime_to_clock_t(cgtime)); ++ cputime_to_clock_t(cgtime) ++#ifdef CONFIG_VE ++ , task_pid_vnr(task), ++ VEID(VE_TASK_INFO(task)->owner_env) ++#endif ++#ifdef CONFIG_BEANCOUNTERS ++ , ub_task_info, ++ ub_mm_info ++#endif ++ ); + if (mm) + mmput(mm); + return res; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/base.c debian/binary-custom.d/openvz/src/fs/proc/base.c +--- ./fs/proc/base.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/base.c 2012-11-13 15:20:14.236569104 +0000 +@@ -165,10 +165,12 @@ + } + if (fs) { + read_lock(&fs->lock); +- *mnt = mntget(fs->pwdmnt); +- *dentry = dget(fs->pwd); ++ result = d_root_check(fs->pwd, fs->pwdmnt); ++ if (result == 0) { ++ *mnt = mntget(fs->pwdmnt); ++ *dentry = dget(fs->pwd); ++ } + read_unlock(&fs->lock); +- result = 0; + put_fs_struct(fs); + } + return result; +@@ -498,17 +500,19 @@ + static int proc_fd_access_allowed(struct inode *inode) + { + struct task_struct *task; +- int allowed = 0; ++ int err; ++ + /* Allow access to a task's file descriptors if it is us or we + * may use ptrace attach to the process and find out that + * information. + */ ++ err = -ENOENT; + task = get_proc_task(inode); + if (task) { +- allowed = ptrace_may_attach(task); ++ err = (ptrace_may_attach(task) ? 0 : -EACCES); + put_task_struct(task); + } +- return allowed; ++ return err; + } + + static int proc_setattr(struct dentry *dentry, struct iattr *attr) +@@ -934,6 +938,8 @@ + if ((oom_adjust < OOM_ADJUST_MIN || oom_adjust > OOM_ADJUST_MAX) && + oom_adjust != OOM_DISABLE) + return -EINVAL; ++ if (oom_adjust == OOM_DISABLE && !ve_is_super(get_exec_env())) ++ return -EPERM; + if (*end == '\n') + end++; + task = get_proc_task(file->f_path.dentry->d_inode); +@@ -1177,13 +1183,14 @@ + static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) + { + struct inode *inode = dentry->d_inode; +- int error = -EACCES; ++ int error; + + /* We don't need a base pointer in the /proc filesystem */ + path_release(nd); + + /* Are we allowed to snoop on the tasks file descriptors? */ +- if (!proc_fd_access_allowed(inode)) ++ error = proc_fd_access_allowed(inode); ++ if (error < 0) + goto out; + + error = PROC_I(inode)->op.proc_get_link(inode, &nd->dentry, &nd->mnt); +@@ -1221,13 +1228,14 @@ + + static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int buflen) + { +- int error = -EACCES; ++ int error; + struct inode *inode = dentry->d_inode; + struct dentry *de; + struct vfsmount *mnt = NULL; + + /* Are we allowed to snoop on the tasks file descriptors? */ +- if (!proc_fd_access_allowed(inode)) ++ error = proc_fd_access_allowed(inode); ++ if (error < 0) + goto out; + + error = PROC_I(inode)->op.proc_get_link(inode, &de, &mnt); +@@ -1271,6 +1279,10 @@ + struct inode * inode; + struct proc_inode *ei; + ++ if (!ve_accessible(task->ve_task_info.owner_env, ++ sb->s_type->owner_env)) ++ return NULL; ++ + /* We need a new inode */ + + inode = new_inode(sb); +@@ -1470,6 +1482,9 @@ + struct files_struct *files = NULL; + struct file *file; + int fd = proc_fd(inode); ++ int err; ++ ++ err = -ENOENT; + + if (task) { + files = get_files_struct(task); +@@ -1482,7 +1497,9 @@ + */ + spin_lock(&files->file_lock); + file = fcheck_files(files, fd); +- if (file) { ++ err = -EACCES; ++ if (file && !d_root_check(file->f_path.dentry, ++ file->f_path.mnt)) { + if (mnt) + *mnt = mntget(file->f_path.mnt); + if (dentry) +@@ -1500,7 +1517,7 @@ + spin_unlock(&files->file_lock); + put_files_struct(files); + } +- return -ENOENT; ++ return err; + } + + static int proc_fd_link(struct inode *inode, struct dentry **dentry, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/generic.c debian/binary-custom.d/openvz/src/fs/proc/generic.c +--- ./fs/proc/generic.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/generic.c 2012-11-13 15:20:14.236569104 +0000 +@@ -10,6 +10,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -21,6 +22,7 @@ + #include + #include + #include ++#include + #include + + #include "internal.h" +@@ -33,7 +35,7 @@ + + DEFINE_SPINLOCK(proc_subdir_lock); + +-static int proc_match(int len, const char *name, struct proc_dir_entry *de) ++int proc_match(int len, const char *name, struct proc_dir_entry *de) + { + if (de->namelen != len) + return 0; +@@ -239,6 +241,10 @@ + struct proc_dir_entry *de = PDE(inode); + int error; + ++ if ((iattr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) && ++ LPDE(inode) == GPDE(inode)) ++ return -EPERM; ++ + error = inode_change_ok(inode, iattr); + if (error) + goto out; +@@ -247,9 +253,12 @@ + if (error) + goto out; + +- de->uid = inode->i_uid; +- de->gid = inode->i_gid; +- de->mode = inode->i_mode; ++ if (iattr->ia_valid & ATTR_UID) ++ de->uid = inode->i_uid; ++ if (iattr->ia_valid & ATTR_GID) ++ de->gid = inode->i_gid; ++ if (iattr->ia_valid & ATTR_MODE) ++ de->mode = inode->i_mode; + out: + return error; + } +@@ -259,10 +268,21 @@ + { + struct inode *inode = dentry->d_inode; + struct proc_dir_entry *de = PROC_I(inode)->pde; +- if (de && de->nlink) +- inode->i_nlink = de->nlink; ++ struct proc_dir_entry *gde = GPDE(inode); + + generic_fillattr(inode, stat); ++ ++ if (de && de->nlink) ++ stat->nlink = de->nlink; ++ /* if dentry is found in both trees and it is a directory ++ * then inode's nlink count must be altered, because local ++ * and global subtrees may differ. ++ * on the other hand, they may intersect, so actual nlink ++ * value is difficult to calculate - upper estimate is used ++ * instead of it. ++ */ ++ if (de && gde && de != gde && gde->nlink > 1) ++ stat->nlink += gde->nlink - 2; + return 0; + } + +@@ -275,7 +295,7 @@ + * returns the struct proc_dir_entry for "/proc/tty/driver", and + * returns "serial" in residual. + */ +-static int xlate_proc_name(const char *name, ++static int __xlate_proc_name(struct proc_dir_entry *root, const char *name, + struct proc_dir_entry **ret, const char **residual) + { + const char *cp = name, *next; +@@ -283,8 +303,13 @@ + int len; + int rtn = 0; + ++ if (*ret) { ++ de_get(*ret); ++ return 0; ++ } ++ + spin_lock(&proc_subdir_lock); +- de = &proc_root; ++ de = root; + while (1) { + next = strchr(cp, '/'); + if (!next) +@@ -302,12 +327,29 @@ + cp += len + 1; + } + *residual = cp; +- *ret = de; ++ *ret = de_get(de); + out: + spin_unlock(&proc_subdir_lock); + return rtn; + } + ++#ifndef CONFIG_VE ++#define xlate_proc_loc_name xlate_proc_name ++#else ++static int xlate_proc_loc_name(const char *name, ++ struct proc_dir_entry **ret, const char **residual) ++{ ++ return __xlate_proc_name(get_exec_env()->proc_root, ++ name, ret, residual); ++} ++#endif ++ ++static int xlate_proc_name(const char *name, ++ struct proc_dir_entry **ret, const char **residual) ++{ ++ return __xlate_proc_name(&proc_root, name, ret, residual); ++} ++ + static DEFINE_IDR(proc_inum_idr); + static DEFINE_SPINLOCK(proc_inum_lock); /* protects the above */ + +@@ -379,6 +421,22 @@ + .d_delete = proc_delete_dentry, + }; + ++static struct proc_dir_entry *__proc_lookup(struct proc_dir_entry *dir, ++ struct dentry *d) ++{ ++ struct proc_dir_entry *de; ++ ++ for (de = dir->subdir; de; de = de->next) { ++ if (de->namelen != d->d_name.len) ++ continue; ++ if (!memcmp(d->d_name.name, de->name, de->namelen)) ++ break; ++ } ++ if (de && de->shadow_proc) ++ de = de->shadow_proc(current, de); ++ return de_get(de); ++} ++ + /* + * Don't create negative dentries here, return -ENOENT by hand + * instead. +@@ -386,41 +444,113 @@ + struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) + { + struct inode *inode = NULL; +- struct proc_dir_entry * de; ++ struct proc_dir_entry *lde, *gde; + int error = -ENOENT; + + lock_kernel(); + spin_lock(&proc_subdir_lock); +- de = PDE(dir); +- if (de) { +- for (de = de->subdir; de ; de = de->next) { +- if (de->namelen != dentry->d_name.len) +- continue; +- if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { +- unsigned int ino; +- +- if (de->shadow_proc) +- de = de->shadow_proc(current, de); +- ino = de->low_ino; +- de_get(de); +- spin_unlock(&proc_subdir_lock); +- error = -EINVAL; +- inode = proc_get_inode(dir->i_sb, ino, de); +- spin_lock(&proc_subdir_lock); +- break; +- } +- } +- } ++ lde = LPDE(dir); ++ if (lde) ++ lde = __proc_lookup(lde, dentry); ++ if (lde && !try_module_get(lde->owner)) { ++ de_put(lde); ++ lde = NULL; ++ } ++#ifdef CONFIG_VE ++ gde = GPDE(dir); ++ if (gde) ++ gde = __proc_lookup(gde, dentry); ++ if (!lde && gde && !try_module_get(gde->owner)) { ++ de_put(gde); ++ gde = NULL; ++ } ++#else ++ gde = NULL; ++#endif + spin_unlock(&proc_subdir_lock); ++ ++ /* ++ * There are following possible cases after lookup: ++ * ++ * lde gde ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ * NULL NULL ENOENT ++ * loc NULL found in local tree ++ * loc glob found in both trees ++ * NULL glob found in global tree ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ * ++ * We initialized inode as follows after lookup: ++ * ++ * inode->lde inode->gde ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ * loc NULL in local tree ++ * loc glob both trees ++ * glob glob global tree ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ * i.e. inode->lde is always initialized ++ */ ++ ++ if (lde == NULL && gde == NULL) ++ goto out; ++ ++ if (lde != NULL) { ++ de_get(lde); ++ inode = proc_get_inode(dir->i_sb, lde->low_ino, lde); ++ } else { ++ de_get(gde); ++ inode = proc_get_inode(dir->i_sb, gde->low_ino, gde); ++ } ++ ++ /* ++ * We can sleep in proc_get_inode(), but since we have i_sem ++ * being taken, no one can setup GPDE/LPDE on this inode. ++ */ ++ if (!inode) ++ goto out_put; ++ ++#ifdef CONFIG_VE ++ GPDE(inode) = de_get(gde); ++ if (gde) ++ __module_get(gde->owner); ++ ++ /* dentry found in global tree only must not be writable ++ * in non-super ve. ++ */ ++ if (lde == NULL && !ve_is_super(dir->i_sb->s_type->owner_env)) ++ inode->i_mode &= ~S_IWUGO; ++#endif ++ unlock_kernel(); ++ dentry->d_op = &proc_dentry_operations; ++ d_add(dentry, inode); ++ de_put(lde); ++ de_put(gde); ++ return NULL; ++ ++out_put: ++ if (lde) ++ module_put(lde->owner); ++ else ++ module_put(gde->owner); ++ de_put(lde); ++ de_put(gde); ++out: + unlock_kernel(); ++ return ERR_PTR(error); ++} + +- if (inode) { +- dentry->d_op = &proc_dentry_operations; +- d_add(dentry, inode); +- return NULL; ++static inline int in_tree(struct proc_dir_entry *de, struct proc_dir_entry *dir) ++{ ++ struct proc_dir_entry *gde; ++ ++ for (gde = dir->subdir; gde; gde = gde->next) { ++ if (de->namelen != gde->namelen) ++ continue; ++ if (memcmp(de->name, gde->name, gde->namelen)) ++ continue; ++ return 1; + } +- de_put(de); +- return ERR_PTR(error); ++ return 0; + } + + /* +@@ -470,11 +600,8 @@ + de = de->subdir; + i -= 2; + for (;;) { +- if (!de) { +- ret = 1; +- spin_unlock(&proc_subdir_lock); +- goto out; +- } ++ if (!de) ++ goto chk_global; + if (!i) + break; + de = de->next; +@@ -487,8 +614,9 @@ + /* filldir passes info to user space */ + de_get(de); + spin_unlock(&proc_subdir_lock); +- if (filldir(dirent, de->name, de->namelen, filp->f_pos, +- de->low_ino, de->mode >> 12) < 0) { ++ if (filldir(dirent, de->name, de->namelen, ++ filp->f_pos, de->low_ino, ++ de->mode >> 12) < 0) { + de_put(de); + goto out; + } +@@ -498,6 +626,44 @@ + de_put(de); + de = next; + } while (de); ++chk_global: ++#ifdef CONFIG_VE ++ de = GPDE(inode); ++ if (de == NULL) ++ goto done; ++ ++ de = de->subdir; ++ while (de) { ++ struct proc_dir_entry *tmp; ++ ++ /* skip local names */ ++ if (in_tree(de, LPDE(inode))) { ++ de = de->next; ++ continue; ++ } ++ ++ if (i > 0) { ++ i--; ++ de = de->next; ++ continue; ++ } ++ ++ de_get(de); ++ spin_unlock(&proc_subdir_lock); ++ if (filldir(dirent, de->name, de->namelen, ++ filp->f_pos, de->low_ino, ++ de->mode >> 12) < 0) { ++ de_put(de); ++ goto out; ++ } ++ spin_lock(&proc_subdir_lock); ++ tmp = de->next; ++ de_put(de); ++ filp->f_pos++; ++ de = tmp; ++ } ++done: ++#endif + spin_unlock(&proc_subdir_lock); + } + ret = 1; +@@ -551,7 +717,7 @@ + + spin_lock(&proc_subdir_lock); + dp->next = dir->subdir; +- dp->parent = dir; ++ dp->parent = de_get(dir); + dir->subdir = dp; + spin_unlock(&proc_subdir_lock); + +@@ -570,17 +736,18 @@ + /* make sure name is valid */ + if (!name || !strlen(name)) goto out; + +- if (!(*parent) && xlate_proc_name(name, parent, &fn) != 0) ++ if (xlate_proc_loc_name(name, parent, &fn) != 0) + goto out; + + /* At this point there must not be any '/' characters beyond *fn */ + if (strchr(fn, '/')) +- goto out; ++ goto out_put; + + len = strlen(fn); + + ent = kmalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL); +- if (!ent) goto out; ++ if (!ent) ++ goto out_put; + + memset(ent, 0, sizeof(struct proc_dir_entry)); + memcpy(((char *) ent) + sizeof(struct proc_dir_entry), fn, len + 1); +@@ -592,8 +759,12 @@ + ent->pde_users = 0; + spin_lock_init(&ent->pde_unload_lock); + ent->pde_unload_completion = NULL; +- out: + return ent; ++ ++out_put: ++ de_put(*parent); ++out: ++ return NULL; + } + + struct proc_dir_entry *proc_symlink(const char *name, +@@ -617,6 +788,7 @@ + kfree(ent); + ent = NULL; + } ++ de_put(parent); + } + return ent; + } +@@ -632,6 +804,7 @@ + kfree(ent); + ent = NULL; + } ++ de_put(parent); + } + return ent; + } +@@ -666,9 +839,28 @@ + kfree(ent); + ent = NULL; + } ++ de_put(parent); + } + return ent; + } ++EXPORT_SYMBOL(remove_proc_glob_entry); ++ ++struct proc_dir_entry *create_proc_glob_entry(const char *name, mode_t mode, ++ struct proc_dir_entry *parent) ++{ ++ const char *path; ++ struct proc_dir_entry *ent; ++ ++ path = name; ++ if (xlate_proc_name(path, &parent, &name) != 0) ++ return NULL; ++ ++ ent = create_proc_entry(name, mode, parent); ++ de_put(parent); ++ return ent; ++} ++ ++EXPORT_SYMBOL(create_proc_glob_entry); + + void free_proc_entry(struct proc_dir_entry *de) + { +@@ -687,15 +879,13 @@ + /* + * Remove a /proc entry and free it if it's not currently in use. + */ +-void remove_proc_entry(const char *name, struct proc_dir_entry *parent) ++static void __remove_proc_entry(const char *name, struct proc_dir_entry *parent) + { + struct proc_dir_entry **p; + struct proc_dir_entry *de; + const char *fn = name; + int len; + +- if (!parent && xlate_proc_name(name, &parent, &fn) != 0) +- goto out; + len = strlen(fn); + + spin_lock(&proc_subdir_lock); +@@ -734,11 +924,42 @@ + parent->nlink--; + de->nlink = 0; + WARN_ON(de->subdir); +- if (atomic_dec_and_test(&de->count)) +- free_proc_entry(de); ++ de_put(parent); ++ de_put(de); + break; + } + spin_unlock(&proc_subdir_lock); +-out: +- return; ++} ++ ++void remove_proc_loc_entry(const char *name, struct proc_dir_entry *parent) ++{ ++ const char *path; ++ ++ path = name; ++ if (xlate_proc_loc_name(path, &parent, &name) != 0) ++ return; ++ ++ __remove_proc_entry(name, parent); ++ de_put(parent); ++} ++ ++void remove_proc_glob_entry(const char *name, struct proc_dir_entry *parent) ++{ ++ const char *path; ++ ++ path = name; ++ if (xlate_proc_name(path, &parent, &name) != 0) ++ return; ++ ++ __remove_proc_entry(name, parent); ++ de_put(parent); ++} ++ ++void remove_proc_entry(const char *name, struct proc_dir_entry *parent) ++{ ++ remove_proc_loc_entry(name, parent); ++#ifdef CONFIG_VE ++ if (ve_is_super(get_exec_env())) ++ remove_proc_glob_entry(name, parent); ++#endif + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/inode.c debian/binary-custom.d/openvz/src/fs/proc/inode.c +--- ./fs/proc/inode.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/inode.c 2012-11-13 15:20:14.236569104 +0000 +@@ -36,16 +36,13 @@ + void de_put(struct proc_dir_entry *de) + { + if (de) { +- lock_kernel(); + if (!atomic_read(&de->count)) { + printk("de_put: entry %s already free!\n", de->name); +- unlock_kernel(); + return; + } + + if (atomic_dec_and_test(&de->count)) + free_proc_entry(de); +- unlock_kernel(); + } + } + +@@ -62,16 +59,25 @@ + put_pid(PROC_I(inode)->pid); + + /* Let go of any associated proc directory entry */ +- de = PROC_I(inode)->pde; ++ de = LPDE(inode); + if (de) { + if (de->owner) + module_put(de->owner); + de_put(de); + } ++#ifdef CONFIG_VE ++ de = GPDE(inode); ++ if (de) { ++ module_put(de->owner); ++ de_put(de); ++ } ++#endif + clear_inode(inode); + } + ++#ifndef CONFIG_VE + struct vfsmount *proc_mnt; ++#endif + + static void proc_read_inode(struct inode * inode) + { +@@ -94,6 +100,9 @@ + ei->pde = NULL; + inode = &ei->vfs_inode; + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; ++#ifdef CONFIG_VE ++ GPDE(inode) = NULL; ++#endif + return inode; + } + +@@ -398,12 +407,9 @@ + { + struct inode * inode; + +- if (de != NULL && !try_module_get(de->owner)) +- goto out_mod; +- + inode = iget(sb, ino); + if (!inode) +- goto out_ino; ++ goto out_mod; + + PROC_I(inode)->fd = 0; + PROC_I(inode)->pde = de; +@@ -436,9 +442,6 @@ + + return inode; + +-out_ino: +- if (de != NULL) +- module_put(de->owner); + out_mod: + return NULL; + } +@@ -463,6 +466,12 @@ + s->s_root = d_alloc_root(root_inode); + if (!s->s_root) + goto out_no_root; ++#ifdef CONFIG_VE ++ LPDE(root_inode) = de_get(get_exec_env()->proc_root); ++ GPDE(root_inode) = &proc_root; ++#else ++ LPDE(root_inode) = &proc_root; ++#endif + return 0; + + out_no_root: +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/kmsg.c debian/binary-custom.d/openvz/src/fs/proc/kmsg.c +--- ./fs/proc/kmsg.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/kmsg.c 2012-11-13 15:20:14.236569104 +0000 +@@ -11,6 +11,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include +@@ -40,7 +42,7 @@ + + static unsigned int kmsg_poll(struct file *file, poll_table *wait) + { +- poll_wait(file, &log_wait, wait); ++ poll_wait(file, &ve_log_wait, wait); + if (do_syslog(9, NULL, 0)) + return POLLIN | POLLRDNORM; + return 0; +@@ -53,3 +55,4 @@ + .open = kmsg_open, + .release = kmsg_release, + }; ++EXPORT_SYMBOL(proc_kmsg_operations); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/proc_misc.c debian/binary-custom.d/openvz/src/fs/proc/proc_misc.c +--- ./fs/proc/proc_misc.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/proc_misc.c 2012-11-13 15:20:14.236569104 +0000 +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -46,6 +47,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -53,8 +55,10 @@ + #include + #include "internal.h" + +-#define LOAD_INT(x) ((x) >> FSHIFT) +-#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100) ++#ifdef CONFIG_FAIRSCHED ++#include ++#endif ++ + /* + * Warning: stuff below (imported functions) assumes that its output will fit + * into one page. For some of those functions it may be wrong. Moreover, we +@@ -83,15 +87,30 @@ + { + int a, b, c; + int len; ++ long running, threads; ++ struct ve_struct *ve; + +- a = avenrun[0] + (FIXED_1/200); +- b = avenrun[1] + (FIXED_1/200); +- c = avenrun[2] + (FIXED_1/200); +- len = sprintf(page,"%d.%02d %d.%02d %d.%02d %ld/%d %d\n", ++ ve = get_exec_env(); ++ if (ve_is_super(ve)) { ++ a = avenrun[0] + (FIXED_1/200); ++ b = avenrun[1] + (FIXED_1/200); ++ c = avenrun[2] + (FIXED_1/200); ++ running = nr_running(); ++ threads = nr_threads; ++#ifdef CONFIG_VE ++ } else { ++ a = ve->avenrun[0] + (FIXED_1/200); ++ b = ve->avenrun[1] + (FIXED_1/200); ++ c = ve->avenrun[2] + (FIXED_1/200); ++ running = nr_running_ve(ve); ++ threads = atomic_read(&ve->pcounter); ++#endif ++ } ++ len = sprintf(page,"%d.%02d %d.%02d %d.%02d %ld/%ld %d\n", + LOAD_INT(a), LOAD_FRAC(a), + LOAD_INT(b), LOAD_FRAC(b), + LOAD_INT(c), LOAD_FRAC(c), +- nr_running(), nr_threads, ++ running, threads, + task_active_pid_ns(current)->last_pid); + return proc_calc_metrics(page, start, off, count, eof, len); + } +@@ -106,6 +125,13 @@ + + do_posix_clock_monotonic_gettime(&uptime); + monotonic_to_bootbased(&uptime); ++#ifdef CONFIG_VE ++ if (!ve_is_super(get_exec_env())) { ++ set_normalized_timespec(&uptime, ++ uptime.tv_sec - get_exec_env()->start_timespec.tv_sec, ++ uptime.tv_nsec - get_exec_env()->start_timespec.tv_nsec); ++ } ++#endif + cputime_to_timespec(idletime, &idle); + len = sprintf(page,"%lu.%02lu %lu.%02lu\n", + (unsigned long) uptime.tv_sec, +@@ -119,29 +145,49 @@ + static int meminfo_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) + { +- struct sysinfo i; ++ struct meminfo mi; + int len; +- unsigned long committed; +- unsigned long allowed; ++ unsigned long dummy; + struct vmalloc_info vmi; +- long cached; ++ ++ get_zone_counts(&mi.active, &mi.inactive, &dummy); + + /* + * display in kilobytes. + */ + #define K(x) ((x) << (PAGE_SHIFT - 10)) +- si_meminfo(&i); +- si_swapinfo(&i); +- committed = atomic_read(&vm_committed_space); +- allowed = ((totalram_pages - hugetlb_total_pages()) ++ si_meminfo(&mi.si); ++ si_swapinfo(&mi.si); ++ mi.committed_space = atomic_read(&vm_committed_space); ++ mi.swapcache = total_swapcache_pages; ++ mi.allowed = ((totalram_pages - hugetlb_total_pages()) + * sysctl_overcommit_ratio / 100) + total_swap_pages; + +- cached = global_page_state(NR_FILE_PAGES) - +- total_swapcache_pages - i.bufferram; +- if (cached < 0) +- cached = 0; ++ mi.cache = global_page_state(NR_FILE_PAGES) - ++ total_swapcache_pages - mi.si.bufferram; ++ if (mi.cache < 0) ++ mi.cache = 0; + + get_vmalloc_info(&vmi); ++ mi.vmalloc_used = vmi.used >> PAGE_SHIFT; ++ mi.vmalloc_largest = vmi.largest_chunk >> PAGE_SHIFT; ++ mi.vmalloc_total = VMALLOC_TOTAL >> PAGE_SHIFT; ++ ++ mi.pi.nr_file_dirty = global_page_state(NR_FILE_DIRTY); ++ mi.pi.nr_writeback = global_page_state(NR_WRITEBACK); ++ mi.pi.nr_anon_pages = global_page_state(NR_ANON_PAGES); ++ mi.pi.nr_file_mapped = global_page_state(NR_FILE_MAPPED); ++ mi.pi.nr_slab_rec = global_page_state(NR_SLAB_RECLAIMABLE); ++ mi.pi.nr_slab_unrec = global_page_state(NR_SLAB_UNRECLAIMABLE); ++ mi.pi.nr_pagetable = global_page_state(NR_PAGETABLE); ++ mi.pi.nr_unstable_nfs = global_page_state(NR_UNSTABLE_NFS); ++ mi.pi.nr_bounce = global_page_state(NR_BOUNCE); ++ ++#ifdef CONFIG_BEANCOUNTERS ++ if (virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_MEMINFO, &mi) ++ & NOTIFY_FAIL) ++ return -ENOMSG; ++#endif + + /* + * Tagged format, for easy grepping and expansion. +@@ -177,37 +223,37 @@ + "VmallocTotal: %8lu kB\n" + "VmallocUsed: %8lu kB\n" + "VmallocChunk: %8lu kB\n", +- K(i.totalram), +- K(i.freeram), +- K(i.bufferram), +- K(cached), +- K(total_swapcache_pages), +- K(global_page_state(NR_ACTIVE)), +- K(global_page_state(NR_INACTIVE)), ++ K(mi.si.totalram), ++ K(mi.si.freeram), ++ K(mi.si.bufferram), ++ K(mi.cache), ++ K(mi.swapcache), ++ K(mi.active), ++ K(mi.inactive), + #ifdef CONFIG_HIGHMEM +- K(i.totalhigh), +- K(i.freehigh), +- K(i.totalram-i.totalhigh), +- K(i.freeram-i.freehigh), +-#endif +- K(i.totalswap), +- K(i.freeswap), +- K(global_page_state(NR_FILE_DIRTY)), +- K(global_page_state(NR_WRITEBACK)), +- K(global_page_state(NR_ANON_PAGES)), +- K(global_page_state(NR_FILE_MAPPED)), +- K(global_page_state(NR_SLAB_RECLAIMABLE) + +- global_page_state(NR_SLAB_UNRECLAIMABLE)), +- K(global_page_state(NR_SLAB_RECLAIMABLE)), +- K(global_page_state(NR_SLAB_UNRECLAIMABLE)), +- K(global_page_state(NR_PAGETABLE)), +- K(global_page_state(NR_UNSTABLE_NFS)), +- K(global_page_state(NR_BOUNCE)), +- K(allowed), +- K(committed), +- (unsigned long)VMALLOC_TOTAL >> 10, +- vmi.used >> 10, +- vmi.largest_chunk >> 10 ++ K(mi.si.totalhigh), ++ K(mi.si.freehigh), ++ K(mi.si.totalram-mi.si.totalhigh), ++ K(mi.si.freeram-mi.si.freehigh), ++#endif ++ K(mi.si.totalswap), ++ K(mi.si.freeswap), ++ K(mi.pi.nr_file_dirty), ++ K(mi.pi.nr_writeback), ++ K(mi.pi.nr_anon_pages), ++ K(mi.pi.nr_file_mapped), ++ K(mi.pi.nr_slab_rec + ++ mi.pi.nr_slab_unrec), ++ K(mi.pi.nr_slab_rec), ++ K(mi.pi.nr_slab_unrec), ++ K(mi.pi.nr_pagetable), ++ K(mi.pi.nr_unstable_nfs), ++ K(mi.pi.nr_bounce), ++ K(mi.allowed), ++ K(mi.committed_space), ++ K(mi.vmalloc_total), ++ K(mi.vmalloc_used), ++ K(mi.vmalloc_largest) + ); + + len += hugetlb_report_meminfo(page + len); +@@ -303,6 +349,9 @@ + + static void *devinfo_start(struct seq_file *f, loff_t *pos) + { ++ if (!ve_is_super(get_exec_env())) ++ return NULL; ++ + if (*pos < (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE)) + return pos; + return NULL; +@@ -451,25 +500,21 @@ + #endif + #endif + +-static int show_stat(struct seq_file *p, void *v) ++static void show_stat_ve0(struct seq_file *p) + { + int i; +- unsigned long jif; + cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; + cputime64_t guest; + u64 sum = 0; +- struct timespec boottime; + unsigned int *per_irq_sum; + + per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL); + if (!per_irq_sum) +- return -ENOMEM; ++ return; + + user = nice = system = idle = iowait = + irq = softirq = steal = cputime64_zero; + guest = cputime64_zero; +- getboottime(&boottime); +- jif = boottime.tv_sec; + + for_each_possible_cpu(i) { + int j; +@@ -529,9 +574,90 @@ + + for (i = 0; i < NR_IRQS; i++) + seq_printf(p, " %u", per_irq_sum[i]); ++ kfree(per_irq_sum); ++#ifdef CONFIG_VM_EVENT_COUNTERS ++ seq_printf(p, "\nswap %lu %lu\n", ++ vm_events(PSWPIN), vm_events(PSWPOUT)); ++#else ++ seq_printf(p, "\nswap 0 0\n"); ++#endif ++} ++ ++#ifdef CONFIG_VE ++static void show_stat_ve(struct seq_file *p, struct ve_struct *ve) ++{ ++ int i; ++ u64 user, nice, system; ++ cycles_t idle, iowait; ++ cpumask_t ve_cpus; ++ ++ ve_cpu_online_map(ve, &ve_cpus); ++ ++ user = nice = system = idle = iowait = 0; ++ for_each_cpu_mask(i, ve_cpus) { ++ user += VE_CPU_STATS(ve, i)->user; ++ nice += VE_CPU_STATS(ve, i)->nice; ++ system += VE_CPU_STATS(ve, i)->system; ++ idle += ve_sched_get_idle_time(ve, i); ++ iowait += ve_sched_get_iowait_time(ve, i); ++ } ++ ++ seq_printf(p, "cpu %llu %llu %llu %llu %llu 0 0 0\n", ++ (unsigned long long)cputime64_to_clock_t(user), ++ (unsigned long long)cputime64_to_clock_t(nice), ++ (unsigned long long)cputime64_to_clock_t(system), ++ (unsigned long long)cycles_to_clocks(idle), ++ (unsigned long long)cycles_to_clocks(iowait)); ++ ++ for_each_cpu_mask(i, ve_cpus) { ++ user = VE_CPU_STATS(ve, i)->user; ++ nice = VE_CPU_STATS(ve, i)->nice; ++ system = VE_CPU_STATS(ve, i)->system; ++ idle = ve_sched_get_idle_time(ve, i); ++ iowait = ve_sched_get_iowait_time(ve, i); ++ seq_printf(p, "cpu%d %llu %llu %llu %llu %llu 0 0 0\n", ++ i, ++ (unsigned long long)cputime64_to_clock_t(user), ++ (unsigned long long)cputime64_to_clock_t(nice), ++ (unsigned long long)cputime64_to_clock_t(system), ++ (unsigned long long)cycles_to_clocks(idle), ++ (unsigned long long)cycles_to_clocks(iowait)); ++ } ++ seq_printf(p, "intr 0\nswap 0 0\n"); ++} ++#endif ++ ++int show_stat(struct seq_file *p, void *v) ++{ ++ extern unsigned long total_forks; ++ unsigned long seq, jif; ++ struct ve_struct *env; ++ unsigned long __nr_running, __nr_iowait; ++ ++ do { ++ seq = read_seqbegin(&xtime_lock); ++ jif = - wall_to_monotonic.tv_sec; ++ if (wall_to_monotonic.tv_nsec) ++ --jif; ++ } while (read_seqretry(&xtime_lock, seq)); ++ ++ env = get_exec_env(); ++ if (ve_is_super(env)) { ++ show_stat_ve0(p); ++ __nr_running = nr_running(); ++ __nr_iowait = nr_iowait(); ++ } ++#ifdef CONFIG_VE ++ else { ++ show_stat_ve(p, env); ++ __nr_running = nr_running_ve(env); ++ __nr_iowait = nr_iowait_ve(env); ++ jif += env->start_timespec.tv_sec; ++ } ++#endif + + seq_printf(p, +- "\nctxt %llu\n" ++ "ctxt %llu\n" + "btime %lu\n" + "processes %lu\n" + "procs_running %lu\n" +@@ -539,10 +665,9 @@ + nr_context_switches(), + (unsigned long)jif, + total_forks, +- nr_running(), +- nr_iowait()); ++ __nr_running, ++ __nr_iowait); + +- kfree(per_irq_sum); + return 0; + } + +@@ -630,7 +755,8 @@ + { + int len; + +- len = sprintf(page, "%s\n", saved_command_line); ++ len = sprintf(page, "%s\n", ++ ve_is_super(get_exec_env()) ? saved_command_line : "quiet"); + return proc_calc_metrics(page, start, off, count, eof, len); + } + +@@ -674,11 +800,16 @@ + size_t count, loff_t *ppos) + { + if (count) { +- char c; ++ int i, cnt; ++ char c[32]; + +- if (get_user(c, buf)) ++ cnt = min(count, sizeof(c)); ++ if (copy_from_user(c, buf, cnt)) + return -EFAULT; +- __handle_sysrq(c, NULL, 0); ++ ++ ++ for (i = 0; i < cnt && c[i] != '\n'; i++) ++ __handle_sysrq(c[i], NULL, 0); + } + return count; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/proc_net.c debian/binary-custom.d/openvz/src/fs/proc/proc_net.c +--- ./fs/proc/proc_net.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/proc_net.c 2012-11-13 15:20:14.236569104 +0000 +@@ -31,7 +31,7 @@ + { + struct proc_dir_entry *res; + +- res = create_proc_entry(name, mode, net->proc_net); ++ res = create_proc_entry(name, mode, get_exec_env()->_proc_net); + if (res) + res->proc_fops = fops; + return res; +@@ -40,7 +40,7 @@ + + void proc_net_remove(struct net *net, const char *name) + { +- remove_proc_entry(name, net->proc_net); ++ remove_proc_entry(name, get_exec_env()->_proc_net); + } + EXPORT_SYMBOL_GPL(proc_net_remove); + +@@ -50,68 +50,26 @@ + } + EXPORT_SYMBOL_GPL(get_proc_net); + +-static struct proc_dir_entry *shadow_pde; +- + static struct proc_dir_entry *proc_net_shadow(struct task_struct *task, + struct proc_dir_entry *de) + { + return task->nsproxy->net_ns->proc_net; + } + +-static __net_init int proc_net_ns_init(struct net *net) +-{ +- struct proc_dir_entry *root, *netd, *net_statd; +- int err; +- +- err = -ENOMEM; +- root = kzalloc(sizeof(*root), GFP_KERNEL); +- if (!root) +- goto out; +- +- err = -EEXIST; +- netd = proc_mkdir("net", root); +- if (!netd) +- goto free_root; +- +- err = -EEXIST; +- net_statd = proc_mkdir("stat", netd); +- if (!net_statd) +- goto free_net; +- +- root->data = net; +- netd->data = net; +- net_statd->data = net; +- +- net->proc_net_root = root; +- net->proc_net = netd; +- net->proc_net_stat = net_statd; +- err = 0; +- +-out: +- return err; +-free_net: +- remove_proc_entry("net", root); +-free_root: +- kfree(root); +- goto out; +-} +- +-static __net_exit void proc_net_ns_exit(struct net *net) +-{ +- remove_proc_entry("stat", net->proc_net); +- remove_proc_entry("net", net->proc_net_root); +- kfree(net->proc_net_root); +-} +- +-static struct pernet_operations __net_initdata proc_net_ns_ops = { +- .init = proc_net_ns_init, +- .exit = proc_net_ns_exit, +-}; +- + int __init proc_net_init(void) + { +- shadow_pde = proc_mkdir("net", NULL); +- shadow_pde->shadow_proc = proc_net_shadow; ++ struct proc_dir_entry *pde; ++ ++ pde = proc_mkdir("net", NULL); ++ pde->shadow_proc = proc_net_shadow; ++ init_net.proc_net = pde; ++ ve0._proc_net = pde; ++ pde->data = &init_net; ++ ++ pde = proc_mkdir("stat", pde); ++ init_net.proc_net_stat = pde; ++ ve0._proc_net_stat = pde; ++ pde->data = &init_net; + +- return register_pernet_subsys(&proc_net_ns_ops); ++ return 0; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/proc_sysctl.c debian/binary-custom.d/openvz/src/fs/proc/proc_sysctl.c +--- ./fs/proc/proc_sysctl.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/proc_sysctl.c 2012-11-13 15:20:14.236569104 +0000 +@@ -1,15 +1,15 @@ + /* + * /proc/sys support + */ +- ++#include + #include + #include + #include + #include "internal.h" + + static struct dentry_operations proc_sys_dentry_operations; +-static const struct file_operations proc_sys_file_operations; +-static struct inode_operations proc_sys_inode_operations; ++extern const struct file_operations proc_sys_file_operations; ++extern struct inode_operations proc_sys_inode_operations; + + static void proc_sys_refresh_inode(struct inode *inode, struct ctl_table *table) + { +@@ -440,17 +440,19 @@ + /* I'm lazy and don't distinguish between files and directories, + * until access time. + */ +-static const struct file_operations proc_sys_file_operations = { ++const struct file_operations proc_sys_file_operations = { + .read = proc_sys_read, + .write = proc_sys_write, + .readdir = proc_sys_readdir, + }; ++EXPORT_SYMBOL_GPL(proc_sys_file_operations); + +-static struct inode_operations proc_sys_inode_operations = { ++struct inode_operations proc_sys_inode_operations = { + .lookup = proc_sys_lookup, + .permission = proc_sys_permission, + .setattr = proc_sys_setattr, + }; ++EXPORT_SYMBOL_GPL(proc_sys_inode_operations); + + static int proc_sys_revalidate(struct dentry *dentry, struct nameidata *nd) + { +@@ -466,13 +468,11 @@ + .d_revalidate = proc_sys_revalidate, + }; + +-static struct proc_dir_entry *proc_sys_root; +- + int proc_sys_init(void) + { +- proc_sys_root = proc_mkdir("sys", NULL); +- proc_sys_root->proc_iops = &proc_sys_inode_operations; +- proc_sys_root->proc_fops = &proc_sys_file_operations; +- proc_sys_root->nlink = 0; ++ ve0.proc_sys_root = proc_mkdir("sys", NULL); ++ ve0.proc_sys_root->proc_iops = &proc_sys_inode_operations; ++ ve0.proc_sys_root->proc_fops = &proc_sys_file_operations; ++ ve0.proc_sys_root->nlink = 0; + return 0; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/proc_tty.c debian/binary-custom.d/openvz/src/fs/proc/proc_tty.c +--- ./fs/proc/proc_tty.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/proc_tty.c 2012-11-13 15:20:14.236569104 +0000 +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + + static int tty_ldiscs_read_proc(char *page, char **start, off_t off, +@@ -73,6 +74,9 @@ + dev_t from = MKDEV(p->major, p->minor_start); + dev_t to = from + p->num; + ++ if (!ve_accessible_strict(p->owner_env, get_exec_env())) ++ goto out; ++ + if (&p->tty_drivers == tty_drivers.next) { + /* pseudo-drivers first */ + seq_printf(m, "%-20s /dev/%-8s ", "/dev/tty", "tty"); +@@ -100,6 +104,7 @@ + } + if (from != to) + show_tty_range(m, p, from, to - from); ++out: + return 0; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/root.c debian/binary-custom.d/openvz/src/fs/proc/root.c +--- ./fs/proc/root.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/root.c 2012-11-13 15:20:14.236569104 +0000 +@@ -45,7 +45,9 @@ + struct super_block *sb; + struct pid_namespace *ns; + struct proc_inode *ei; ++ struct vfsmount *proc_mnt; + ++ proc_mnt = proc_mnt(fs_type->owner_env); + if (proc_mnt) { + /* Seed the root directory with a pid so it doesn't need + * to be special in base.c. I would do this earlier but +@@ -98,12 +100,14 @@ + put_pid_ns(ns); + } + +-static struct file_system_type proc_fs_type = { ++struct file_system_type proc_fs_type = { + .name = "proc", + .get_sb = proc_get_sb, + .kill_sb = proc_kill_sb, + }; + ++EXPORT_SYMBOL(proc_fs_type); ++ + void __init proc_root_init(void) + { + int err = proc_init_inodecache(); +@@ -112,9 +116,9 @@ + err = register_filesystem(&proc_fs_type); + if (err) + return; +- proc_mnt = kern_mount_data(&proc_fs_type, &init_pid_ns); +- err = PTR_ERR(proc_mnt); +- if (IS_ERR(proc_mnt)) { ++ proc_mnt(get_ve0()) = kern_mount_data(&proc_fs_type, &init_pid_ns); ++ err = PTR_ERR(proc_mnt(get_ve0())); ++ if (IS_ERR(proc_mnt(get_ve0()))) { + unregister_filesystem(&proc_fs_type); + return; + } +@@ -144,8 +148,19 @@ + static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat + ) + { ++ struct ve_struct *ve = get_exec_env(); ++ + generic_fillattr(dentry->d_inode, stat); +- stat->nlink = proc_root.nlink + nr_processes(); ++ stat->nlink = proc_root.nlink; ++ if (ve_is_super(ve)) ++ stat->nlink += nr_processes(); ++#ifdef CONFIG_VE ++ else ++ /* not really processes count, it's not right, but it's ok */ ++ stat->nlink += atomic_read(&ve->pcounter); ++ /* the same logic as in the proc_getattr */ ++ stat->nlink += ve->proc_root->nlink - 2; ++#endif + return 0; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/task_mmu.c debian/binary-custom.d/openvz/src/fs/proc/task_mmu.c +--- ./fs/proc/task_mmu.c 2012-06-12 16:25:23.494312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/task_mmu.c 2012-11-13 15:20:14.236569104 +0000 +@@ -95,9 +95,12 @@ + } + + if (vma) { +- *mnt = mntget(vma->vm_file->f_path.mnt); +- *dentry = dget(vma->vm_file->f_path.dentry); +- result = 0; ++ result = d_root_check(vma->vm_file->f_path.dentry, ++ vma->vm_file->f_path.mnt); ++ if (!result) { ++ *mnt = mntget(vma->vm_file->f_path.mnt); ++ *dentry = dget(vma->vm_file->f_path.dentry); ++ } + } + + up_read(&mm->mmap_sem); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/proc/task_nommu.c debian/binary-custom.d/openvz/src/fs/proc/task_nommu.c +--- ./fs/proc/task_nommu.c 2012-06-12 16:25:23.498312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/proc/task_nommu.c 2012-11-13 15:20:14.236569104 +0000 +@@ -127,9 +127,12 @@ + } + + if (vma) { +- *mnt = mntget(vma->vm_file->f_path.mnt); +- *dentry = dget(vma->vm_file->f_path.dentry); +- result = 0; ++ result = d_root_check(vma->vm_file->f_path.dentry, ++ vma->vm_file->f_path.mnt); ++ if (!result) { ++ *mnt = mntget(vma->vm_file->f_path.mnt); ++ *dentry = dget(vma->vm_file->f_path.dentry); ++ } + } + + up_read(&mm->mmap_sem); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/quota.c debian/binary-custom.d/openvz/src/fs/quota.c +--- ./fs/quota.c 2012-06-12 16:25:23.498312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/quota.c 2012-11-13 15:20:14.240569105 +0000 +@@ -82,11 +82,11 @@ + if (cmd == Q_GETQUOTA) { + if (((type == USRQUOTA && current->euid != id) || + (type == GRPQUOTA && !in_egroup_p(id))) && +- !capable(CAP_SYS_ADMIN)) ++ !capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + } + else if (cmd != Q_GETFMT && cmd != Q_SYNC && cmd != Q_GETINFO) +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + + return 0; +@@ -133,10 +133,10 @@ + if (cmd == Q_XGETQUOTA) { + if (((type == XQM_USRQUOTA && current->euid != id) || + (type == XQM_GRPQUOTA && !in_egroup_p(id))) && +- !capable(CAP_SYS_ADMIN)) ++ !capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + } else if (cmd != Q_XGETQSTAT && cmd != Q_XQUOTASYNC) { +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + } + +@@ -178,6 +178,8 @@ + continue; + if (!sb_has_quota_enabled(sb, cnt)) + continue; ++ if (!sb_dqopt(sb)->files[cnt]) ++ continue; + mutex_lock_nested(&sb_dqopt(sb)->files[cnt]->i_mutex, I_MUTEX_QUOTA); + truncate_inode_pages(&sb_dqopt(sb)->files[cnt]->i_data, 0); + mutex_unlock(&sb_dqopt(sb)->files[cnt]->i_mutex); +@@ -208,7 +210,7 @@ + sb->s_count++; + spin_unlock(&sb_lock); + down_read(&sb->s_umount); +- if (sb->s_root && sb->s_qcop->quota_sync) ++ if (sb->s_root && sb->s_qcop && sb->s_qcop->quota_sync) + quota_sync_sb(sb, type); + up_read(&sb->s_umount); + spin_lock(&sb_lock); +@@ -342,7 +344,7 @@ + + if (IS_ERR(tmp)) + return ERR_PTR(PTR_ERR(tmp)); +- bdev = lookup_bdev(tmp); ++ bdev = lookup_bdev(tmp, FMODE_QUOTACTL); + putname(tmp); + if (IS_ERR(bdev)) + return ERR_PTR(PTR_ERR(bdev)); +@@ -357,6 +359,215 @@ + #endif + } + ++#ifdef CONFIG_QUOTA_COMPAT ++ ++#define QC_QUOTAON 0x0100 /* enable quotas */ ++#define QC_QUOTAOFF 0x0200 /* disable quotas */ ++/* GETQUOTA, SETQUOTA and SETUSE which were at 0x0300-0x0500 has now other parameteres */ ++#define QC_SYNC 0x0600 /* sync disk copy of a filesystems quotas */ ++#define QC_SETQLIM 0x0700 /* set limits */ ++/* GETSTATS at 0x0800 is now longer... */ ++#define QC_GETINFO 0x0900 /* get info about quotas - graces, flags... */ ++#define QC_SETINFO 0x0A00 /* set info about quotas */ ++#define QC_SETGRACE 0x0B00 /* set inode and block grace */ ++#define QC_SETFLAGS 0x0C00 /* set flags for quota */ ++#define QC_GETQUOTA 0x0D00 /* get limits and usage */ ++#define QC_SETQUOTA 0x0E00 /* set limits and usage */ ++#define QC_SETUSE 0x0F00 /* set usage */ ++/* 0x1000 used by old RSQUASH */ ++#define QC_GETSTATS 0x1100 /* get collected stats */ ++ ++struct compat_dqblk { ++ unsigned int dqb_ihardlimit; ++ unsigned int dqb_isoftlimit; ++ unsigned int dqb_curinodes; ++ unsigned int dqb_bhardlimit; ++ unsigned int dqb_bsoftlimit; ++ qsize_t dqb_curspace; ++ __kernel_time_t dqb_btime; ++ __kernel_time_t dqb_itime; ++}; ++ ++struct compat_dqinfo { ++ unsigned int dqi_bgrace; ++ unsigned int dqi_igrace; ++ unsigned int dqi_flags; ++ unsigned int dqi_blocks; ++ unsigned int dqi_free_blk; ++ unsigned int dqi_free_entry; ++}; ++ ++struct compat_dqstats { ++ __u32 lookups; ++ __u32 drops; ++ __u32 reads; ++ __u32 writes; ++ __u32 cache_hits; ++ __u32 allocated_dquots; ++ __u32 free_dquots; ++ __u32 syncs; ++ __u32 version; ++}; ++ ++asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t id, void __user *addr); ++static long compat_quotactl(unsigned int cmds, unsigned int type, ++ const char __user *special, qid_t id, ++ void __user *addr) ++{ ++ struct super_block *sb; ++ long ret; ++ ++ sb = NULL; ++ switch (cmds) { ++ case QC_QUOTAON: ++ return sys_quotactl(QCMD(Q_QUOTAON, type), ++ special, id, addr); ++ ++ case QC_QUOTAOFF: ++ return sys_quotactl(QCMD(Q_QUOTAOFF, type), ++ special, id, addr); ++ ++ case QC_SYNC: ++ return sys_quotactl(QCMD(Q_SYNC, type), ++ special, id, addr); ++ ++ case QC_GETQUOTA: { ++ struct if_dqblk idq; ++ struct compat_dqblk cdq; ++ ++ sb = quotactl_block(special); ++ ret = PTR_ERR(sb); ++ if (IS_ERR(sb)) ++ break; ++ ret = check_quotactl_valid(sb, type, Q_GETQUOTA, id); ++ if (ret) ++ break; ++ ret = sb->s_qcop->get_dqblk(sb, type, id, &idq); ++ if (ret) ++ break; ++ cdq.dqb_ihardlimit = idq.dqb_ihardlimit; ++ cdq.dqb_isoftlimit = idq.dqb_isoftlimit; ++ cdq.dqb_curinodes = idq.dqb_curinodes; ++ cdq.dqb_bhardlimit = idq.dqb_bhardlimit; ++ cdq.dqb_bsoftlimit = idq.dqb_bsoftlimit; ++ cdq.dqb_curspace = idq.dqb_curspace; ++ cdq.dqb_btime = idq.dqb_btime; ++ cdq.dqb_itime = idq.dqb_itime; ++ ret = 0; ++ if (copy_to_user(addr, &cdq, sizeof(cdq))) ++ ret = -EFAULT; ++ break; ++ } ++ ++ case QC_SETQUOTA: ++ case QC_SETUSE: ++ case QC_SETQLIM: { ++ struct if_dqblk idq; ++ struct compat_dqblk cdq; ++ ++ sb = quotactl_block(special); ++ ret = PTR_ERR(sb); ++ if (IS_ERR(sb)) ++ break; ++ ret = check_quotactl_valid(sb, type, Q_SETQUOTA, id); ++ if (ret) ++ break; ++ ret = -EFAULT; ++ if (copy_from_user(&cdq, addr, sizeof(cdq))) ++ break; ++ idq.dqb_ihardlimit = cdq.dqb_ihardlimit; ++ idq.dqb_isoftlimit = cdq.dqb_isoftlimit; ++ idq.dqb_curinodes = cdq.dqb_curinodes; ++ idq.dqb_bhardlimit = cdq.dqb_bhardlimit; ++ idq.dqb_bsoftlimit = cdq.dqb_bsoftlimit; ++ idq.dqb_curspace = cdq.dqb_curspace; ++ idq.dqb_valid = 0; ++ if (cmds == QC_SETQUOTA || cmds == QC_SETQLIM) ++ idq.dqb_valid |= QIF_LIMITS; ++ if (cmds == QC_SETQUOTA || cmds == QC_SETUSE) ++ idq.dqb_valid |= QIF_USAGE; ++ ret = sb->s_qcop->set_dqblk(sb, type, id, &idq); ++ break; ++ } ++ ++ case QC_GETINFO: { ++ struct if_dqinfo iinf; ++ struct compat_dqinfo cinf; ++ ++ sb = quotactl_block(special); ++ ret = PTR_ERR(sb); ++ if (IS_ERR(sb)) ++ break; ++ ret = check_quotactl_valid(sb, type, Q_GETQUOTA, id); ++ if (ret) ++ break; ++ ret = sb->s_qcop->get_info(sb, type, &iinf); ++ if (ret) ++ break; ++ cinf.dqi_bgrace = iinf.dqi_bgrace; ++ cinf.dqi_igrace = iinf.dqi_igrace; ++ cinf.dqi_flags = 0; ++ if (iinf.dqi_flags & DQF_INFO_DIRTY) ++ cinf.dqi_flags |= 0x0010; ++ cinf.dqi_blocks = 0; ++ cinf.dqi_free_blk = 0; ++ cinf.dqi_free_entry = 0; ++ ret = 0; ++ if (copy_to_user(addr, &cinf, sizeof(cinf))) ++ ret = -EFAULT; ++ break; ++ } ++ ++ case QC_SETINFO: ++ case QC_SETGRACE: ++ case QC_SETFLAGS: { ++ struct if_dqinfo iinf; ++ struct compat_dqinfo cinf; ++ ++ sb = quotactl_block(special); ++ ret = PTR_ERR(sb); ++ if (IS_ERR(sb)) ++ break; ++ ret = check_quotactl_valid(sb, type, Q_SETINFO, id); ++ if (ret) ++ break; ++ ret = -EFAULT; ++ if (copy_from_user(&cinf, addr, sizeof(cinf))) ++ break; ++ iinf.dqi_bgrace = cinf.dqi_bgrace; ++ iinf.dqi_igrace = cinf.dqi_igrace; ++ iinf.dqi_flags = cinf.dqi_flags; ++ iinf.dqi_valid = 0; ++ if (cmds == QC_SETINFO || cmds == QC_SETGRACE) ++ iinf.dqi_valid |= IIF_BGRACE | IIF_IGRACE; ++ if (cmds == QC_SETINFO || cmds == QC_SETFLAGS) ++ iinf.dqi_valid |= IIF_FLAGS; ++ ret = sb->s_qcop->set_info(sb, type, &iinf); ++ break; ++ } ++ ++ case QC_GETSTATS: { ++ struct compat_dqstats stat; ++ ++ memset(&stat, 0, sizeof(stat)); ++ stat.version = 6*10000+5*100+0; ++ ret = 0; ++ if (copy_to_user(addr, &stat, sizeof(stat))) ++ ret = -EFAULT; ++ break; ++ } ++ ++ default: ++ ret = -ENOSYS; ++ break; ++ } ++ if (sb && !IS_ERR(sb)) ++ drop_super(sb); ++ return ret; ++} ++ ++#endif ++ + /* + * This is the system call interface. This communicates with + * the user-level programs. Currently this only supports diskquota +@@ -372,6 +583,11 @@ + cmds = cmd >> SUBCMDSHIFT; + type = cmd & SUBCMDMASK; + ++#ifdef CONFIG_QUOTA_COMPAT ++ if (cmds >= 0x0100 && cmds < 0x3000) ++ return compat_quotactl(cmds, type, special, id, addr); ++#endif ++ + if (cmds != Q_SYNC || special) { + sb = quotactl_block(special); + if (IS_ERR(sb)) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/read_write.c debian/binary-custom.d/openvz/src/fs/read_write.c +--- ./fs/read_write.c 2012-06-12 16:25:23.498312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/read_write.c 2012-11-13 15:20:14.240569105 +0000 +@@ -21,6 +21,8 @@ + #include + #include + ++#include ++ + const struct file_operations generic_ro_fops = { + .llseek = generic_file_llseek, + .read = do_sync_read, +@@ -354,6 +356,29 @@ + file->f_pos = pos; + } + ++static inline void bc_acct_write(size_t bytes) ++{ ++ struct user_beancounter *ub; ++ ++ if (bytes > 0) { ++ ub = get_exec_ub(); ++ ub_percpu_inc(ub, write); ++ ub_percpu_add(ub, wchar, bytes); ++ } ++} ++ ++static inline void bc_acct_read(size_t bytes) ++{ ++ struct user_beancounter *ub; ++ ++ if (bytes > 0) { ++ ub = get_exec_ub(); ++ ub_percpu_inc(ub, read); ++ ub_percpu_add(ub, rchar, bytes); ++ } ++} ++ ++ + asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) + { + struct file *file; +@@ -366,6 +391,8 @@ + ret = vfs_read(file, buf, count, &pos); + file_pos_write(file, pos); + fput_light(file, fput_needed); ++ ++ bc_acct_read(ret); + } + + return ret; +@@ -384,6 +411,8 @@ + ret = vfs_write(file, buf, count, &pos); + file_pos_write(file, pos); + fput_light(file, fput_needed); ++ ++ bc_acct_write(ret); + } + + return ret; +@@ -405,6 +434,8 @@ + if (file->f_mode & FMODE_PREAD) + ret = vfs_read(file, buf, count, &pos); + fput_light(file, fput_needed); ++ ++ bc_acct_read(ret); + } + + return ret; +@@ -426,6 +457,8 @@ + if (file->f_mode & FMODE_PWRITE) + ret = vfs_write(file, buf, count, &pos); + fput_light(file, fput_needed); ++ ++ bc_acct_write(ret); + } + + return ret; +@@ -673,6 +706,8 @@ + ret = vfs_readv(file, vec, vlen, &pos); + file_pos_write(file, pos); + fput_light(file, fput_needed); ++ ++ bc_acct_read(ret); + } + + if (ret > 0) +@@ -694,6 +729,8 @@ + ret = vfs_writev(file, vec, vlen, &pos); + file_pos_write(file, pos); + fput_light(file, fput_needed); ++ ++ bc_acct_write(ret); + } + + if (ret > 0) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/reiserfs/namei.c debian/binary-custom.d/openvz/src/fs/reiserfs/namei.c +--- ./fs/reiserfs/namei.c 2012-06-12 16:25:23.506312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/reiserfs/namei.c 2012-11-13 15:20:14.264569105 +0000 +@@ -859,6 +859,9 @@ + INITIALIZE_PATH(path); + struct reiserfs_dir_entry de; + ++ inode = dentry->d_inode; ++ DQUOT_INIT(inode); ++ + /* we will be doing 2 balancings and update 2 stat data, we change quotas + * of the owner of the directory and of the owner of the parent directory. + * The quota structure is possibly deleted only on last iput => outside +@@ -883,8 +886,6 @@ + goto end_rmdir; + } + +- inode = dentry->d_inode; +- + reiserfs_update_inode_transaction(inode); + reiserfs_update_inode_transaction(dir); + +@@ -947,6 +948,7 @@ + unsigned long savelink; + + inode = dentry->d_inode; ++ DQUOT_INIT(inode); + + /* in this transaction we can be doing at max two balancings and update + * two stat datas, we change quotas of the owner of the directory and of +@@ -1254,6 +1256,8 @@ + + old_inode = old_dentry->d_inode; + new_dentry_inode = new_dentry->d_inode; ++ if (new_dentry_inode) ++ DQUOT_INIT(new_dentry_inode); + + // make sure, that oldname still exists and points to an object we + // are going to rename +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/select.c debian/binary-custom.d/openvz/src/fs/select.c +--- ./fs/select.c 2012-06-12 16:25:23.514312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/select.c 2012-11-13 15:20:14.268569107 +0000 +@@ -26,6 +26,8 @@ + + #include + ++#include ++ + struct poll_table_page { + struct poll_table_page * next; + struct poll_table_entry * entry; +@@ -331,7 +333,8 @@ + if (size > sizeof(stack_fds) / 6) { + /* Not enough space in on-stack array; must use kmalloc */ + ret = -ENOMEM; +- bits = kmalloc(6 * size, GFP_KERNEL); ++ bits = kmalloc(6 * size, size > PAGE_SIZE / 6 ? ++ GFP_KERNEL_UBC : GFP_KERNEL); + if (!bits) + goto out_nofds; + } +@@ -677,7 +680,7 @@ + + len = min(todo, POLLFD_PER_PAGE); + size = sizeof(struct poll_list) + sizeof(struct pollfd) * len; +- walk = walk->next = kmalloc(size, GFP_KERNEL); ++ walk = walk->next = kmalloc(size, GFP_KERNEL_UBC); + if (!walk) { + err = -ENOMEM; + goto out_fds; +@@ -709,7 +712,7 @@ + return err; + } + +-static long do_restart_poll(struct restart_block *restart_block) ++long do_restart_poll(struct restart_block *restart_block) + { + struct pollfd __user *ufds = (struct pollfd __user*)restart_block->arg0; + int nfds = restart_block->arg1; +@@ -725,6 +728,7 @@ + } + return ret; + } ++EXPORT_SYMBOL_GPL(do_restart_poll); + + asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, + long timeout_msecs) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/seq_file.c debian/binary-custom.d/openvz/src/fs/seq_file.c +--- ./fs/seq_file.c 2012-06-12 16:25:23.514312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/seq_file.c 2012-11-13 15:20:14.268569107 +0000 +@@ -31,7 +31,7 @@ + struct seq_file *p = file->private_data; + + if (!p) { +- p = kmalloc(sizeof(*p), GFP_KERNEL); ++ p = kmalloc(sizeof(*p), GFP_KERNEL_UBC); + if (!p) + return -ENOMEM; + file->private_data = p; +@@ -86,7 +86,7 @@ + m->version = file->f_version; + /* grab buffer if we didn't have one */ + if (!m->buf) { +- m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL); ++ m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL_UBC); + if (!m->buf) + goto Enomem; + } +@@ -120,7 +120,7 @@ + goto Fill; + m->op->stop(m, p); + kfree(m->buf); +- m->buf = kmalloc(m->size <<= 1, GFP_KERNEL); ++ m->buf = kmalloc(m->size <<= 1, GFP_KERNEL_UBC); + if (!m->buf) + goto Enomem; + m->count = 0; +@@ -189,7 +189,7 @@ + return 0; + } + if (!m->buf) { +- m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL); ++ m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL_UBC); + if (!m->buf) + return -ENOMEM; + } +@@ -224,7 +224,7 @@ + Eoverflow: + m->op->stop(m, p); + kfree(m->buf); +- m->buf = kmalloc(m->size <<= 1, GFP_KERNEL); ++ m->buf = kmalloc(m->size <<= 1, GFP_KERNEL_UBC); + return !m->buf ? -ENOMEM : -EAGAIN; + } + +@@ -349,6 +349,8 @@ + if (m->count < m->size) { + char *s = m->buf + m->count; + char *p = d_path(dentry, mnt, s, m->size - m->count); ++ if (IS_ERR(p) && PTR_ERR(p) != -ENAMETOOLONG) ++ return 0; + if (!IS_ERR(p)) { + while (s <= p) { + char c = *p++; +@@ -392,7 +394,7 @@ + int single_open(struct file *file, int (*show)(struct seq_file *, void *), + void *data) + { +- struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL); ++ struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL_UBC); + int res = -ENOMEM; + + if (op) { +@@ -436,7 +438,7 @@ + void *private; + struct seq_file *seq; + +- private = kzalloc(psize, GFP_KERNEL); ++ private = kzalloc(psize, GFP_KERNEL_UBC); + if (private == NULL) + goto out; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/simfs.c debian/binary-custom.d/openvz/src/fs/simfs.c +--- ./fs/simfs.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/fs/simfs.c 2012-11-13 15:20:14.272569108 +0000 +@@ -0,0 +1,332 @@ ++/* ++ * fs/simfs.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#define SIMFS_GET_LOWER_FS_SB(sb) sb->s_root->d_sb ++ ++static struct super_operations sim_super_ops; ++ ++static int sim_getattr(struct vfsmount *mnt, struct dentry *dentry, ++ struct kstat *stat) ++{ ++ struct super_block *sb; ++ struct inode *inode; ++ ++ inode = dentry->d_inode; ++ if (!inode->i_op->getattr) { ++ generic_fillattr(inode, stat); ++ if (!stat->blksize) { ++ unsigned blocks; ++ ++ sb = inode->i_sb; ++ blocks = (stat->size + sb->s_blocksize-1) >> ++ sb->s_blocksize_bits; ++ stat->blocks = (sb->s_blocksize / 512) * blocks; ++ stat->blksize = sb->s_blocksize; ++ } ++ } else { ++ int err; ++ ++ err = inode->i_op->getattr(mnt, dentry, stat); ++ if (err) ++ return err; ++ } ++ ++ sb = mnt->mnt_sb; ++ if (sb->s_op == &sim_super_ops) ++ stat->dev = sb->s_dev; ++ return 0; ++} ++ ++static void quota_get_stat(struct super_block *sb, struct kstatfs *buf) ++{ ++ int err; ++ struct dq_stat qstat; ++ struct virt_info_quota q; ++ long free_file, adj_file; ++ s64 blk, free_blk, adj_blk; ++ int bsize_bits; ++ ++ q.super = sb; ++ q.qstat = &qstat; ++ err = virtinfo_notifier_call(VITYPE_QUOTA, VIRTINFO_QUOTA_GETSTAT, &q); ++ if (err != NOTIFY_OK) ++ return; ++ ++ bsize_bits = ffs(buf->f_bsize) - 1; ++ ++ if (qstat.bsoftlimit > qstat.bcurrent) ++ free_blk = (qstat.bsoftlimit - qstat.bcurrent) >> bsize_bits; ++ else ++ free_blk = 0; ++ /* ++ * In the regular case, we always set buf->f_bfree and buf->f_blocks to ++ * the values reported by quota. In case of real disk space shortage, ++ * we adjust the values. We want this adjustment to look as if the ++ * total disk space were reduced, not as if the usage were increased. ++ * -- SAW ++ */ ++ adj_blk = 0; ++ if (buf->f_bfree < free_blk) ++ adj_blk = free_blk - buf->f_bfree; ++ buf->f_bfree = free_blk - adj_blk; ++ ++ if (free_blk < buf->f_bavail) ++ buf->f_bavail = free_blk; ++ ++ blk = (qstat.bsoftlimit >> bsize_bits) - adj_blk; ++ buf->f_blocks = blk > LONG_MAX ? LONG_MAX : blk; ++ ++ free_file = qstat.isoftlimit - qstat.icurrent; ++ if (free_file < 0) ++ free_file = 0; ++ if (buf->f_type == REISERFS_SUPER_MAGIC) ++ /* ++ * reiserfs doesn't initialize f_ffree and f_files values of ++ * kstatfs because it doesn't have an inode limit. ++ */ ++ buf->f_ffree = free_file; ++ adj_file = 0; ++ if (buf->f_ffree < free_file) ++ adj_file = free_file - buf->f_ffree; ++ buf->f_ffree = free_file - adj_file; ++ buf->f_files = qstat.isoftlimit - adj_file; ++} ++ ++static int sim_statfs(struct super_block *sb, struct kstatfs *buf) ++{ ++ int err; ++ struct super_block *lsb; ++ struct kstatfs statbuf; ++ ++ err = 0; ++ if (sb->s_op != &sim_super_ops) ++ return 0; ++ ++ memset(&statbuf, 0, sizeof(statbuf)); ++ lsb = SIMFS_GET_LOWER_FS_SB(sb); ++ ++ err = -ENOSYS; ++ if (lsb && lsb->s_op && lsb->s_op->statfs) ++ err = lsb->s_op->statfs(sb->s_root, &statbuf); ++ if (err) ++ return err; ++ ++ quota_get_stat(sb, &statbuf); ++ ++ buf->f_files = statbuf.f_files; ++ buf->f_ffree = statbuf.f_ffree; ++ buf->f_blocks = statbuf.f_blocks; ++ buf->f_bfree = statbuf.f_bfree; ++ buf->f_bavail = statbuf.f_bavail; ++ return 0; ++} ++ ++static int sim_systemcall(struct vnotifier_block *me, unsigned long n, ++ void *d, int old_ret) ++{ ++ int err; ++ ++ switch (n) { ++ case VIRTINFO_FAUDIT_STAT: { ++ struct faudit_stat_arg *arg; ++ ++ arg = (struct faudit_stat_arg *)d; ++ err = sim_getattr(arg->mnt, arg->dentry, arg->stat); ++ arg->err = err; ++ } ++ break; ++ case VIRTINFO_FAUDIT_STATFS: { ++ struct faudit_statfs_arg *arg; ++ ++ arg = (struct faudit_statfs_arg *)d; ++ err = sim_statfs(arg->sb, arg->stat); ++ arg->err = err; ++ } ++ break; ++ default: ++ return old_ret; ++ } ++ return (err ? NOTIFY_BAD : NOTIFY_OK); ++} ++ ++static struct inode *sim_quota_root(struct super_block *sb) ++{ ++ return sb->s_root->d_inode; ++} ++ ++/* ++ * NOTE: We need to setup s_bdev field on super block, since sys_quotactl() ++ * does lookup_bdev() and get_super() which are comparing sb->s_bdev. ++ * so this is a MUST if we want unmodified sys_quotactl ++ * to work correctly on /dev/simfs inside VE ++ */ ++static int sim_init_blkdev(struct super_block *sb) ++{ ++ static struct hd_struct fake_hd; ++ struct block_device *blkdev; ++ ++ blkdev = bdget(sb->s_dev); ++ if (blkdev == NULL) ++ return -ENOMEM; ++ ++ blkdev->bd_part = &fake_hd; /* required for bdev_read_only() */ ++ sb->s_bdev = blkdev; ++ ++ return 0; ++} ++ ++static void sim_free_blkdev(struct super_block *sb) ++{ ++ /* set bd_part back to NULL */ ++ sb->s_bdev->bd_part = NULL; ++ bdput(sb->s_bdev); ++} ++ ++static void sim_quota_init(struct super_block *sb) ++{ ++ struct virt_info_quota viq; ++ ++ viq.super = sb; ++ virtinfo_notifier_call(VITYPE_QUOTA, VIRTINFO_QUOTA_ON, &viq); ++} ++ ++static void sim_quota_free(struct super_block *sb) ++{ ++ struct virt_info_quota viq; ++ ++ viq.super = sb; ++ virtinfo_notifier_call(VITYPE_QUOTA, VIRTINFO_QUOTA_OFF, &viq); ++} ++ ++static struct super_operations sim_super_ops = { ++ .get_quota_root = sim_quota_root, ++}; ++ ++static int sim_fill_super(struct super_block *s, void *data) ++{ ++ int err; ++ struct nameidata *nd; ++ ++ err = set_anon_super(s, NULL); ++ if (err) ++ goto out; ++ ++ err = 0; ++ nd = (struct nameidata *)data; ++ s->s_fs_info = mntget(nd->mnt); ++ s->s_root = dget(nd->dentry); ++ s->s_op = &sim_super_ops; ++out: ++ return err; ++} ++ ++static int sim_get_sb(struct file_system_type *type, int flags, ++ const char *dev_name, void *opt, struct vfsmount *mnt) ++{ ++ int err; ++ struct nameidata nd; ++ struct super_block *sb; ++ ++ err = -EINVAL; ++ if (opt == NULL) ++ goto out; ++ ++ err = path_lookup(opt, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd); ++ if (err) ++ goto out; ++ ++ sb = sget(type, NULL, sim_fill_super, &nd); ++ err = PTR_ERR(sb); ++ if (IS_ERR(sb)) ++ goto out_path; ++ ++ err = sim_init_blkdev(sb); ++ if (err) ++ goto out_killsb; ++ ++ sim_quota_init(sb); ++ ++ path_release(&nd); ++ return simple_set_mnt(mnt, sb); ++ ++out_killsb: ++ up_write(&sb->s_umount); ++ deactivate_super(sb); ++out_path: ++ path_release(&nd); ++out: ++ return err; ++} ++ ++static void sim_kill_sb(struct super_block *sb) ++{ ++ dput(sb->s_root); ++ sb->s_root = NULL; ++ mntput((struct vfsmount *)(sb->s_fs_info)); ++ ++ sim_quota_free(sb); ++ sim_free_blkdev(sb); ++ ++ kill_anon_super(sb); ++} ++ ++static struct file_system_type sim_fs_type = { ++ .owner = THIS_MODULE, ++ .name = "simfs", ++ .get_sb = sim_get_sb, ++ .kill_sb = sim_kill_sb, ++ .fs_flags = FS_MANGLE_PROC, ++}; ++ ++static struct vnotifier_block sim_syscalls = { ++ .notifier_call = sim_systemcall, ++}; ++ ++static int __init init_simfs(void) ++{ ++ int err; ++ ++ err = register_filesystem(&sim_fs_type); ++ if (err) ++ return err; ++ ++ virtinfo_notifier_register(VITYPE_FAUDIT, &sim_syscalls); ++ return 0; ++} ++ ++static void __exit exit_simfs(void) ++{ ++ virtinfo_notifier_unregister(VITYPE_FAUDIT, &sim_syscalls); ++ unregister_filesystem(&sim_fs_type); ++} ++ ++MODULE_AUTHOR("SWsoft "); ++MODULE_DESCRIPTION("Open Virtuozzo Simulation of File System"); ++MODULE_LICENSE("GPL v2"); ++ ++module_init(init_simfs); ++module_exit(exit_simfs); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/smbfs/sock.c debian/binary-custom.d/openvz/src/fs/smbfs/sock.c +--- ./fs/smbfs/sock.c 2012-06-12 16:25:23.514312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/smbfs/sock.c 2012-11-13 15:20:14.272569108 +0000 +@@ -99,6 +99,7 @@ + + VERBOSE("closing socket %p\n", sock); + sock->sk->sk_data_ready = server->data_ready; ++ sock->sk->sk_user_data = NULL; + server->sock_file = NULL; + fput(file); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/stat.c debian/binary-custom.d/openvz/src/fs/stat.c +--- ./fs/stat.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/stat.c 2012-11-13 15:20:14.280569106 +0000 +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -41,11 +42,19 @@ + { + struct inode *inode = dentry->d_inode; + int retval; ++ struct faudit_stat_arg arg; + + retval = security_inode_getattr(mnt, dentry); + if (retval) + return retval; + ++ arg.mnt = mnt; ++ arg.dentry = dentry; ++ arg.stat = stat; ++ if (virtinfo_notifier_call(VITYPE_FAUDIT, VIRTINFO_FAUDIT_STAT, &arg) ++ != NOTIFY_DONE) ++ return arg.err; ++ + if (inode->i_op->getattr) + return inode->i_op->getattr(mnt, dentry, stat); + +@@ -67,11 +76,19 @@ + struct dentry *dentry = file->f_path.dentry; + struct inode *inode = dentry->d_inode; + int retval; ++ struct faudit_stat_arg arg; + + retval = security_inode_getattr(mnt, dentry); + if (retval) + return retval; + ++ arg.mnt = mnt; ++ arg.dentry = dentry; ++ arg.stat = stat; ++ if (virtinfo_notifier_call(VITYPE_FAUDIT, VIRTINFO_FAUDIT_STAT, &arg) ++ != NOTIFY_DONE) ++ return arg.err; ++ + if (file->f_op && file->f_op->fgetattr) { + return file->f_op->fgetattr(file, stat); + } else if (inode->i_op->getattr) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/super.c debian/binary-custom.d/openvz/src/fs/super.c +--- ./fs/super.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/super.c 2012-11-13 15:20:14.280569106 +0000 +@@ -37,11 +37,14 @@ + #include + #include + #include ++#include + #include + + + LIST_HEAD(super_blocks); ++EXPORT_SYMBOL_GPL(super_blocks); + DEFINE_SPINLOCK(sb_lock); ++EXPORT_SYMBOL_GPL(sb_lock); + + /** + * alloc_super - create new superblock +@@ -70,13 +73,15 @@ + INIT_LIST_HEAD(&s->s_inodes); + init_rwsem(&s->s_umount); + mutex_init(&s->s_lock); +- lockdep_set_class(&s->s_umount, &type->s_umount_key); ++ lockdep_set_class(&s->s_umount, ++ &type->proto->s_umount_key); + /* + * The locking rules for s_lock are up to the + * filesystem. For example ext3fs has different + * lock ordering than usbfs: + */ +- lockdep_set_class(&s->s_lock, &type->s_lock_key); ++ lockdep_set_class(&s->s_lock, ++ &type->proto->s_lock_key); + down_write(&s->s_umount); + s->s_count = S_BIAS; + atomic_set(&s->s_active, 1); +@@ -300,7 +305,7 @@ + sop->put_super(sb); + + /* Forget any remaining inodes */ +- if (invalidate_inodes(sb)) { ++ if (invalidate_inodes_check(sb, 1)) { + printk("VFS: Busy inodes after unmount of %s. " + "Self-destruct in 5 seconds. Have a nice day...\n", + sb->s_id); +@@ -529,17 +534,26 @@ + spin_unlock(&sb_lock); + return NULL; + } ++EXPORT_SYMBOL(user_get_super); + + asmlinkage long sys_ustat(unsigned dev, struct ustat __user * ubuf) + { ++ dev_t kdev; + struct super_block *s; + struct ustat tmp; + struct kstatfs sbuf; +- int err = -EINVAL; ++ int err; ++ ++ kdev = new_decode_dev(dev); ++ err = get_device_perms_ve(S_IFBLK, kdev, FMODE_READ); ++ if (err) ++ goto out; ++ ++ err = -EINVAL; ++ s = user_get_super(kdev); ++ if (s == NULL) ++ goto out; + +- s = user_get_super(new_decode_dev(dev)); +- if (s == NULL) +- goto out; + err = vfs_statfs(s->s_root, &sbuf); + drop_super(s); + if (err) +@@ -655,6 +669,13 @@ + static struct idr unnamed_dev_idr; + static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */ + ++/* for compatibility with coreutils still unaware of new minor sizes */ ++int unnamed_dev_majors[] = { ++ 0, 144, 145, 146, 242, 243, 244, 245, ++ 246, 247, 248, 249, 250, 251, 252, 253 ++}; ++EXPORT_SYMBOL(unnamed_dev_majors); ++ + int set_anon_super(struct super_block *s, void *data) + { + int dev; +@@ -672,13 +693,13 @@ + else if (error) + return -EAGAIN; + +- if ((dev & MAX_ID_MASK) == (1 << MINORBITS)) { ++ if ((dev & MAX_ID_MASK) >= (1 << MINORBITS)) { + spin_lock(&unnamed_dev_lock); + idr_remove(&unnamed_dev_idr, dev); + spin_unlock(&unnamed_dev_lock); + return -EMFILE; + } +- s->s_dev = MKDEV(0, dev & MINORMASK); ++ s->s_dev = make_unnamed_dev(dev); + return 0; + } + +@@ -686,8 +707,9 @@ + + void kill_anon_super(struct super_block *sb) + { +- int slot = MINOR(sb->s_dev); ++ int slot; + ++ slot = unnamed_dev_idx(sb->s_dev); + generic_shutdown_super(sb); + spin_lock(&unnamed_dev_lock); + idr_remove(&unnamed_dev_idr, slot); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/sync.c debian/binary-custom.d/openvz/src/fs/sync.c +--- ./fs/sync.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/sync.c 2012-11-13 15:20:14.280569106 +0000 +@@ -14,6 +14,10 @@ + #include + #include + ++#include ++ ++#include ++ + #define VALID_FLAGS (SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| \ + SYNC_FILE_RANGE_WAIT_AFTER) + +@@ -38,7 +42,14 @@ + + asmlinkage long sys_sync(void) + { ++ struct user_beancounter *ub; ++ ++ ub = get_exec_ub(); ++ ub_percpu_inc(ub, sync); ++ + do_sync(1); ++ ++ ub_percpu_inc(ub, sync_done); + return 0; + } + +@@ -80,6 +91,7 @@ + int ret; + int err; + struct address_space *mapping = file->f_mapping; ++ struct user_beancounter *ub; + + if (!file->f_op || !file->f_op->fsync) { + /* Why? We can still call filemap_fdatawrite */ +@@ -87,6 +99,12 @@ + goto out; + } + ++ ub = get_exec_ub(); ++ if (datasync) ++ ub_percpu_inc(ub, fdsync); ++ else ++ ub_percpu_inc(ub, fsync); ++ + ret = filemap_fdatawrite(mapping); + + /* +@@ -101,6 +119,11 @@ + err = filemap_fdatawait(mapping); + if (!ret) + ret = err; ++ ++ if (datasync) ++ ub_percpu_inc(ub, fdsync_done); ++ else ++ ub_percpu_inc(ub, fsync_done); + out: + return ret; + } +@@ -251,12 +274,16 @@ + loff_t endbyte, unsigned int flags) + { + int ret; ++ struct user_beancounter *ub; + + if (!mapping) { + ret = -EINVAL; +- goto out; ++ goto out_noacct; + } + ++ ub = get_exec_ub(); ++ ub_percpu_inc(ub, frsync); ++ + ret = 0; + if (flags & SYNC_FILE_RANGE_WAIT_BEFORE) { + ret = wait_on_page_writeback_range(mapping, +@@ -279,6 +306,8 @@ + endbyte >> PAGE_CACHE_SHIFT); + } + out: ++ ub_percpu_inc(ub, frsync_done); ++out_noacct: + return ret; + } + EXPORT_SYMBOL_GPL(do_sync_mapping_range); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/sysfs/bin.c debian/binary-custom.d/openvz/src/fs/sysfs/bin.c +--- ./fs/sysfs/bin.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/sysfs/bin.c 2012-11-13 15:20:14.284569104 +0000 +@@ -177,6 +177,9 @@ + struct bin_buffer *bb = NULL; + int error; + ++ if (!ve_sysfs_alowed()) ++ return 0; ++ + /* binary file operations requires both @sd and its parent */ + if (!sysfs_get_active_two(attr_sd)) + return -ENODEV; +@@ -238,6 +241,9 @@ + + int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr) + { ++ if (!ve_sysfs_alowed()) ++ return 0; ++ + BUG_ON(!kobj || !kobj->sd || !attr); + + return sysfs_add_file(kobj->sd, &attr->attr, SYSFS_KOBJ_BIN_ATTR); +@@ -252,6 +258,8 @@ + + void sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr) + { ++ if (!ve_sysfs_alowed()) ++ return; + sysfs_hash_and_remove(kobj->sd, attr->attr.name); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/sysfs/dir.c debian/binary-custom.d/openvz/src/fs/sysfs/dir.c +--- ./fs/sysfs/dir.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/sysfs/dir.c 2012-11-13 15:20:14.284569104 +0000 +@@ -481,6 +481,9 @@ + struct inode *inode; + struct dentry *dentry; + ++ if (!ve_sysfs_alowed()) ++ return; ++ + inode = ilookup(sysfs_sb, sd->s_ino); + if (!inode) + return; +@@ -652,12 +655,15 @@ + struct sysfs_dirent *parent_sd, *sd; + int error = 0; + ++ if (!ve_sysfs_alowed()) ++ return 0; ++ + BUG_ON(!kobj); + + if (kobj->parent) + parent_sd = kobj->parent->sd; + else +- parent_sd = &sysfs_root; ++ parent_sd = ve_sysfs_root; + + error = create_dir(kobj, parent_sd, kobject_name(kobj), &sd); + if (!error) +@@ -758,6 +764,9 @@ + { + struct sysfs_dirent *sd = kobj->sd; + ++ if (!ve_sysfs_alowed()) ++ return; ++ + spin_lock(&sysfs_assoc_lock); + kobj->sd = NULL; + spin_unlock(&sysfs_assoc_lock); +@@ -773,6 +782,9 @@ + const char *dup_name = NULL; + int error; + ++ if (!ve_sysfs_alowed()) ++ return 0; ++ + mutex_lock(&sysfs_rename_mutex); + + error = 0; +@@ -841,7 +853,7 @@ + + mutex_lock(&sysfs_rename_mutex); + BUG_ON(!sd->s_parent); +- new_parent_sd = new_parent_kobj->sd ? new_parent_kobj->sd : &sysfs_root; ++ new_parent_sd = new_parent_kobj->sd ? new_parent_kobj->sd : ve_sysfs_root; + + error = 0; + if (sd->s_parent == new_parent_sd) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/sysfs/file.c debian/binary-custom.d/openvz/src/fs/sysfs/file.c +--- ./fs/sysfs/file.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/sysfs/file.c 2012-11-13 15:20:14.284569104 +0000 +@@ -549,6 +549,8 @@ + + int sysfs_create_file(struct kobject * kobj, const struct attribute * attr) + { ++ if (!ve_sysfs_alowed()) ++ return 0; + BUG_ON(!kobj || !kobj->sd || !attr); + + return sysfs_add_file(kobj->sd, attr, SYSFS_KOBJ_ATTR); +@@ -641,16 +643,18 @@ + + void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr) + { ++ if (!ve_sysfs_alowed()) ++ return; + sysfs_hash_and_remove(kobj->sd, attr->name); + } + +- + /** + * sysfs_remove_file_from_group - remove an attribute file from a group. + * @kobj: object we're acting for. + * @attr: attribute descriptor. + * @group: group name. + */ ++ + void sysfs_remove_file_from_group(struct kobject *kobj, + const struct attribute *attr, const char *group) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/sysfs/group.c debian/binary-custom.d/openvz/src/fs/sysfs/group.c +--- ./fs/sysfs/group.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/sysfs/group.c 2012-11-13 15:20:14.284569104 +0000 +@@ -45,6 +45,8 @@ + struct sysfs_dirent *sd; + int error; + ++ if (!ve_sysfs_alowed()) ++ return 0; + BUG_ON(!kobj || !kobj->sd); + + if (grp->name) { +@@ -69,6 +71,9 @@ + struct sysfs_dirent *dir_sd = kobj->sd; + struct sysfs_dirent *sd; + ++ if (!ve_sysfs_alowed()) ++ return; ++ + if (grp->name) { + sd = sysfs_get_dirent(dir_sd, grp->name); + BUG_ON(!sd); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/sysfs/inode.c debian/binary-custom.d/openvz/src/fs/sysfs/inode.c +--- ./fs/sysfs/inode.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/sysfs/inode.c 2012-11-13 15:20:14.284569104 +0000 +@@ -20,8 +20,6 @@ + #include + #include "sysfs.h" + +-extern struct super_block * sysfs_sb; +- + static const struct address_space_operations sysfs_aops = { + .readpage = simple_readpage, + .write_begin = simple_write_begin, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/sysfs/mount.c debian/binary-custom.d/openvz/src/fs/sysfs/mount.c +--- ./fs/sysfs/mount.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/sysfs/mount.c 2012-11-13 15:20:14.284569104 +0000 +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + + #include "sysfs.h" +@@ -22,8 +23,11 @@ + /* Random magic number */ + #define SYSFS_MAGIC 0x62656572 + +-static struct vfsmount *sysfs_mount; ++#ifndef CONFIG_VE ++struct vfsmount *sysfs_mount; + struct super_block * sysfs_sb = NULL; ++#endif ++ + struct kmem_cache *sysfs_dir_cachep; + + static const struct super_operations sysfs_ops = { +@@ -39,6 +43,13 @@ + .s_ino = 1, + }; + ++static void init_ve0_sysfs_root(void) ++{ ++#ifdef CONFIG_VE ++ get_ve0()->_sysfs_root = &sysfs_root; ++#endif ++} ++ + static int sysfs_fill_super(struct super_block *sb, void *data, int silent) + { + struct inode *inode; +@@ -52,7 +63,7 @@ + sysfs_sb = sb; + + /* get root inode, initialize and unlock it */ +- inode = sysfs_get_inode(&sysfs_root); ++ inode = sysfs_get_inode(ve_sysfs_root); + if (!inode) { + pr_debug("sysfs: could not get root inode\n"); + return -ENOMEM; +@@ -65,7 +76,7 @@ + iput(inode); + return -ENOMEM; + } +- root->d_fsdata = &sysfs_root; ++ root->d_fsdata = ve_sysfs_root; + sb->s_root = root; + return 0; + } +@@ -76,16 +87,19 @@ + return get_sb_single(fs_type, flags, data, sysfs_fill_super, mnt); + } + +-static struct file_system_type sysfs_fs_type = { ++struct file_system_type sysfs_fs_type = { + .name = "sysfs", + .get_sb = sysfs_get_sb, + .kill_sb = kill_anon_super, + }; + ++EXPORT_SYMBOL(sysfs_fs_type); ++ + int __init sysfs_init(void) + { + int err = -ENOMEM; + ++ init_ve0_sysfs_root(); + sysfs_dir_cachep = kmem_cache_create("sysfs_dir_cache", + sizeof(struct sysfs_dirent), + 0, 0, NULL); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/sysfs/symlink.c debian/binary-custom.d/openvz/src/fs/sysfs/symlink.c +--- ./fs/sysfs/symlink.c 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/sysfs/symlink.c 2012-11-13 15:20:14.284569104 +0000 +@@ -66,10 +66,13 @@ + struct sysfs_addrm_cxt acxt; + int error; + ++ if (!ve_sysfs_alowed()) ++ return 0; ++ + BUG_ON(!name); + + if (!kobj) +- parent_sd = &sysfs_root; ++ parent_sd = ve_sysfs_root; + else + parent_sd = kobj->sd; + +@@ -121,6 +124,8 @@ + + void sysfs_remove_link(struct kobject * kobj, const char * name) + { ++ if(!ve_sysfs_alowed()) ++ return; + sysfs_hash_and_remove(kobj->sd, name); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/sysfs/sysfs.h debian/binary-custom.d/openvz/src/fs/sysfs/sysfs.h +--- ./fs/sysfs/sysfs.h 2012-06-12 16:25:23.518312514 +0100 ++++ debian/binary-custom.d/openvz/src/fs/sysfs/sysfs.h 2012-11-13 15:20:14.284569104 +0000 +@@ -8,67 +8,17 @@ + * This file is released under the GPLv2. + */ + +-struct sysfs_open_dirent; +- +-/* type-specific structures for sysfs_dirent->s_* union members */ +-struct sysfs_elem_dir { +- struct kobject *kobj; +- /* children list starts here and goes through sd->s_sibling */ +- struct sysfs_dirent *children; +-}; +- +-struct sysfs_elem_symlink { +- struct sysfs_dirent *target_sd; +-}; +- +-struct sysfs_elem_attr { +- struct attribute *attr; +- struct sysfs_open_dirent *open; +-}; +- +-struct sysfs_elem_bin_attr { +- struct bin_attribute *bin_attr; +-}; +- +-/* +- * sysfs_dirent - the building block of sysfs hierarchy. Each and +- * every sysfs node is represented by single sysfs_dirent. +- * +- * As long as s_count reference is held, the sysfs_dirent itself is +- * accessible. Dereferencing s_elem or any other outer entity +- * requires s_active reference. +- */ +-struct sysfs_dirent { +- atomic_t s_count; +- atomic_t s_active; +- struct sysfs_dirent *s_parent; +- struct sysfs_dirent *s_sibling; +- const char *s_name; +- +- union { +- struct sysfs_elem_dir s_dir; +- struct sysfs_elem_symlink s_symlink; +- struct sysfs_elem_attr s_attr; +- struct sysfs_elem_bin_attr s_bin_attr; +- }; +- +- unsigned int s_flags; +- ino_t s_ino; +- umode_t s_mode; +- struct iattr *s_iattr; +-}; +- +-#define SD_DEACTIVATED_BIAS INT_MIN +- +-#define SYSFS_TYPE_MASK 0x00ff +-#define SYSFS_DIR 0x0001 +-#define SYSFS_KOBJ_ATTR 0x0002 +-#define SYSFS_KOBJ_BIN_ATTR 0x0004 +-#define SYSFS_KOBJ_LINK 0x0008 +-#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) +- +-#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK +-#define SYSFS_FLAG_REMOVED 0x0200 ++#ifndef CONFIG_VE ++extern struct vfsmount *sysfs_mount; ++extern struct super_block *sysfs_sb; ++#define ve_sysfs_alowed() 1 ++#else ++#include ++#include ++#define sysfs_mount (get_exec_env()->sysfs_mnt) ++#define sysfs_sb (get_exec_env()->sysfs_sb) ++#define ve_sysfs_alowed() (sysfs_sb != NULL) ++#endif + + static inline unsigned int sysfs_type(struct sysfs_dirent *sd) + { +@@ -88,8 +38,12 @@ + /* + * mount.c + */ ++#ifdef CONFIG_VE ++#define ve_sysfs_root (get_exec_env()->_sysfs_root) ++#else + extern struct sysfs_dirent sysfs_root; +-extern struct super_block *sysfs_sb; ++#define ve_sysfs_root (&sysfs_root) ++#endif + extern struct kmem_cache *sysfs_dir_cachep; + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/utimes.c debian/binary-custom.d/openvz/src/fs/utimes.c +--- ./fs/utimes.c 2012-06-12 16:25:23.530312513 +0100 ++++ debian/binary-custom.d/openvz/src/fs/utimes.c 2012-11-13 15:20:14.296569106 +0000 +@@ -57,7 +57,7 @@ + */ + long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags) + { +- int error; ++ int error = -EINVAL; + struct nameidata nd; + struct path path; + struct inode *inode; +@@ -212,3 +212,18 @@ + { + return sys_futimesat(AT_FDCWD, filename, utimes); + } ++ ++asmlinkage long sys_lutime(char __user *filename, struct utimbuf __user *times) ++{ ++ struct timespec tv[2]; ++ ++ if (times) { ++ if (get_user(tv[0].tv_sec, ×->actime) || ++ get_user(tv[1].tv_sec, ×->modtime)) ++ return -EFAULT; ++ tv[0].tv_nsec = 0; ++ tv[1].tv_nsec = 0; ++ } ++ ++ return do_utimes(AT_FDCWD, filename, times ? tv : NULL, AT_SYMLINK_NOFOLLOW); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/vzdq_file.c debian/binary-custom.d/openvz/src/fs/vzdq_file.c +--- ./fs/vzdq_file.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/fs/vzdq_file.c 2012-11-13 15:20:14.296569106 +0000 +@@ -0,0 +1,951 @@ ++/* ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * This file contains Virtuozzo quota files as proc entry implementation. ++ * It is required for std quota tools to work correctly as they are expecting ++ * aquota.user and aquota.group files. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++/* ---------------------------------------------------------------------- ++ * ++ * File read operation ++ * ++ * FIXME: functions in this section (as well as many functions in vzdq_ugid.c, ++ * perhaps) abuse vz_quota_sem. ++ * Taking a global semaphore for lengthy and user-controlled operations inside ++ * VPSs is not a good idea in general. ++ * In this case, the reasons for taking this semaphore are completely unclear, ++ * especially taking into account that the only function that has comments ++ * about the necessity to be called under this semaphore ++ * (create_proc_quotafile) is actually called OUTSIDE it. ++ * ++ * --------------------------------------------------------------------- */ ++ ++#define DQBLOCK_SIZE 1024 ++#define DQUOTBLKNUM 21U ++#define DQTREE_DEPTH 4 ++#define TREENUM_2_BLKNUM(num) (((num) + 1) << 1) ++#define ISINDBLOCK(num) ((num)%2 != 0) ++#define FIRST_DATABLK 2 /* first even number */ ++#define LAST_IND_LEVEL (DQTREE_DEPTH - 1) ++#define CONVERT_LEVEL(level) ((level) * (QUOTAID_EBITS/QUOTAID_BBITS)) ++#define GETLEVINDX(ind, lev) (((ind) >> QUOTAID_BBITS*(lev)) \ ++ & QUOTATREE_BMASK) ++ ++#if (QUOTAID_EBITS / QUOTAID_BBITS) != (QUOTATREE_DEPTH / DQTREE_DEPTH) ++#error xBITS and DQTREE_DEPTH does not correspond ++#endif ++ ++#define BLOCK_NOT_FOUND 1 ++ ++/* data for quota file -- one per proc entry */ ++struct quotatree_data { ++ struct list_head list; ++ struct vz_quota_master *qmblk; ++ int type; /* type of the tree */ ++}; ++ ++/* serialized by vz_quota_sem */ ++static LIST_HEAD(qf_data_head); ++ ++static const u_int32_t vzquota_magics[] = V2_INITQMAGICS; ++static const u_int32_t vzquota_versions[] = V2_INITQVERSIONS; ++static const char aquota_user[] = "aquota.user"; ++static const char aquota_group[] = "aquota.group"; ++ ++ ++static inline loff_t get_depoff(int depth) ++{ ++ loff_t res = 1; ++ while (depth) { ++ res += (1 << ((depth - 1)*QUOTAID_EBITS + 1)); ++ depth--; ++ } ++ return res; ++} ++ ++static inline loff_t get_blknum(loff_t num, int depth) ++{ ++ loff_t res; ++ res = (num << 1) + get_depoff(depth); ++ return res; ++} ++ ++static int get_depth(loff_t num) ++{ ++ int i; ++ for (i = 0; i < DQTREE_DEPTH; i++) { ++ if (num >= get_depoff(i) && (i == DQTREE_DEPTH - 1 ++ || num < get_depoff(i + 1))) ++ return i; ++ } ++ return -1; ++} ++ ++static inline loff_t get_offset(loff_t num) ++{ ++ loff_t res, tmp; ++ ++ tmp = get_depth(num); ++ if (tmp < 0) ++ return -1; ++ num -= get_depoff(tmp); ++ BUG_ON(num < 0); ++ res = num >> 1; ++ ++ return res; ++} ++ ++static inline loff_t get_quot_blk_num(struct quotatree_tree *tree, int level) ++{ ++ /* return maximum available block num */ ++ return tree->levels[level].freenum; ++} ++ ++static inline loff_t get_block_num(struct quotatree_tree *tree) ++{ ++ loff_t ind_blk_num, quot_blk_num, max_ind, max_quot; ++ ++ quot_blk_num = get_quot_blk_num(tree, CONVERT_LEVEL(DQTREE_DEPTH) - 1); ++ max_quot = TREENUM_2_BLKNUM(quot_blk_num); ++ ind_blk_num = get_quot_blk_num(tree, CONVERT_LEVEL(DQTREE_DEPTH - 1)); ++ max_ind = (quot_blk_num) ? get_blknum(ind_blk_num, LAST_IND_LEVEL) ++ : get_blknum(ind_blk_num, 0); ++ ++ return (max_ind > max_quot) ? max_ind + 1 : max_quot + 1; ++} ++ ++/* Write quota file header */ ++static int read_header(void *buf, struct quotatree_tree *tree, ++ struct dq_info *dq_ugid_info, int type) ++{ ++ struct v2_disk_dqheader *dqh; ++ struct v2_disk_dqinfo *dq_disk_info; ++ ++ dqh = buf; ++ dq_disk_info = buf + sizeof(struct v2_disk_dqheader); ++ ++ dqh->dqh_magic = vzquota_magics[type]; ++ dqh->dqh_version = vzquota_versions[type]; ++ ++ dq_disk_info->dqi_bgrace = dq_ugid_info[type].bexpire; ++ dq_disk_info->dqi_igrace = dq_ugid_info[type].iexpire; ++ dq_disk_info->dqi_flags = 0; /* no flags */ ++ dq_disk_info->dqi_blocks = get_block_num(tree); ++ dq_disk_info->dqi_free_blk = 0; /* first block in the file */ ++ dq_disk_info->dqi_free_entry = FIRST_DATABLK; ++ ++ return 0; ++} ++ ++static int get_block_child(int depth, struct quotatree_node *p, u_int32_t *buf) ++{ ++ int i, j, lev_num; ++ ++ lev_num = QUOTATREE_DEPTH/DQTREE_DEPTH - 1; ++ for (i = 0; i < BLOCK_SIZE/sizeof(u_int32_t); i++) { ++ struct quotatree_node *next, *parent; ++ ++ parent = p; ++ next = p; ++ for (j = lev_num; j >= 0; j--) { ++ if (!next->blocks[GETLEVINDX(i,j)]) { ++ buf[i] = 0; ++ goto bad_branch; ++ } ++ parent = next; ++ next = next->blocks[GETLEVINDX(i,j)]; ++ } ++ buf[i] = (depth == DQTREE_DEPTH - 1) ? ++ TREENUM_2_BLKNUM(parent->num) ++ : get_blknum(next->num, depth + 1); ++ ++ bad_branch: ++ ; ++ } ++ ++ return 0; ++} ++ ++/* ++ * Write index block to disk (or buffer) ++ * @buf has length 256*sizeof(u_int32_t) bytes ++ */ ++static int read_index_block(int num, u_int32_t *buf, ++ struct quotatree_tree *tree) ++{ ++ struct quotatree_node *p; ++ u_int32_t index; ++ loff_t off; ++ int depth, res; ++ ++ res = BLOCK_NOT_FOUND; ++ index = 0; ++ depth = get_depth(num); ++ off = get_offset(num); ++ if (depth < 0 || off < 0) ++ return -EINVAL; ++ ++ list_for_each_entry(p, &tree->levels[CONVERT_LEVEL(depth)].usedlh, ++ list) { ++ if (p->num >= off) ++ res = 0; ++ if (p->num != off) ++ continue; ++ get_block_child(depth, p, buf); ++ break; ++ } ++ ++ return res; ++} ++ ++static inline void convert_quot_format(struct v2_disk_dqblk *dq, ++ struct vz_quota_ugid *vzq) ++{ ++ dq->dqb_id = vzq->qugid_id; ++ dq->dqb_ihardlimit = vzq->qugid_stat.ihardlimit; ++ dq->dqb_isoftlimit = vzq->qugid_stat.isoftlimit; ++ dq->dqb_curinodes = vzq->qugid_stat.icurrent; ++ dq->dqb_bhardlimit = vzq->qugid_stat.bhardlimit / QUOTABLOCK_SIZE; ++ dq->dqb_bsoftlimit = vzq->qugid_stat.bsoftlimit / QUOTABLOCK_SIZE; ++ dq->dqb_curspace = vzq->qugid_stat.bcurrent; ++ dq->dqb_btime = vzq->qugid_stat.btime; ++ dq->dqb_itime = vzq->qugid_stat.itime; ++} ++ ++static int read_dquot(loff_t num, void *buf, struct quotatree_tree *tree) ++{ ++ int res, i, entries = 0; ++ struct v2_disk_dqdbheader *dq_header; ++ struct quotatree_node *p; ++ struct v2_disk_dqblk *blk = buf + sizeof(struct v2_disk_dqdbheader); ++ ++ res = BLOCK_NOT_FOUND; ++ dq_header = buf; ++ memset(dq_header, 0, sizeof(*dq_header)); ++ ++ list_for_each_entry(p, &(tree->levels[QUOTATREE_DEPTH - 1].usedlh), ++ list) { ++ if (TREENUM_2_BLKNUM(p->num) >= num) ++ res = 0; ++ if (TREENUM_2_BLKNUM(p->num) != num) ++ continue; ++ ++ for (i = 0; i < QUOTATREE_BSIZE; i++) { ++ if (!p->blocks[i]) ++ continue; ++ convert_quot_format(blk + entries, ++ (struct vz_quota_ugid *)p->blocks[i]); ++ entries++; ++ res = 0; ++ } ++ break; ++ } ++ dq_header->dqdh_entries = entries; ++ ++ return res; ++} ++ ++static int read_block(int num, void *buf, struct quotatree_tree *tree, ++ struct dq_info *dq_ugid_info, int magic) ++{ ++ int res; ++ ++ memset(buf, 0, DQBLOCK_SIZE); ++ if (!num) ++ res = read_header(buf, tree, dq_ugid_info, magic); ++ else if (ISINDBLOCK(num)) ++ res = read_index_block(num, (u_int32_t*)buf, tree); ++ else ++ res = read_dquot(num, buf, tree); ++ ++ return res; ++} ++ ++/* ++ * FIXME: this function can handle quota files up to 2GB only. ++ */ ++static int read_proc_quotafile(char *page, char **start, off_t off, int count, ++ int *eof, void *data) ++{ ++ off_t blk_num, blk_off, buf_off; ++ char *tmp; ++ size_t buf_size; ++ struct quotatree_data *qtd; ++ struct quotatree_tree *tree; ++ struct dq_info *dqi; ++ int res; ++ ++ *start = NULL; ++ tmp = kmalloc(DQBLOCK_SIZE, GFP_KERNEL); ++ if (!tmp) ++ return -ENOMEM; ++ ++ qtd = data; ++ down(&vz_quota_sem); ++ down(&qtd->qmblk->dq_sem); ++ ++ res = 0; ++ tree = QUGID_TREE(qtd->qmblk, qtd->type); ++ if (!tree) { ++ *eof = 1; ++ goto out_dq; ++ } ++ ++ dqi = &qtd->qmblk->dq_ugid_info[qtd->type]; ++ ++ buf_off = 0; ++ buf_size = count; ++ blk_num = off / DQBLOCK_SIZE; ++ blk_off = off % DQBLOCK_SIZE; ++ ++ while (buf_size > 0) { ++ off_t len; ++ ++ len = min((size_t)(DQBLOCK_SIZE-blk_off), buf_size); ++ res = read_block(blk_num, tmp, tree, dqi, qtd->type); ++ if (res < 0) ++ goto out_err; ++ if (res == BLOCK_NOT_FOUND) { ++ *eof = 1; ++ break; ++ } ++ memcpy(page + buf_off, tmp + blk_off, len); ++ ++ blk_num++; ++ buf_size -= len; ++ blk_off = 0; ++ buf_off += len; ++ } ++ res = buf_off; ++ ++out_err: ++ *start += count; ++out_dq: ++ up(&qtd->qmblk->dq_sem); ++ up(&vz_quota_sem); ++ kfree(tmp); ++ ++ return res; ++} ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * /proc/vz/vzaquota/QID/aquota.* files ++ * ++ * FIXME: this code lacks serialization of read/readdir/lseek. ++ * However, this problem should be fixed after the mainstream issue of what ++ * appears to be non-atomic read and update of file position in sys_read. ++ * ++ * --------------------------------------------------------------------- */ ++ ++static inline unsigned long vzdq_aquot_getino(dev_t dev) ++{ ++ return 0xec000000UL + dev; ++} ++ ++static inline dev_t vzdq_aquot_getidev(struct inode *inode) ++{ ++ return (dev_t)(unsigned long)PROC_I(inode)->op.proc_get_link; ++} ++ ++static inline void vzdq_aquot_setidev(struct inode *inode, dev_t dev) ++{ ++ PROC_I(inode)->op.proc_get_link = (void *)(unsigned long)dev; ++} ++ ++static ssize_t vzdq_aquotf_read(struct file *file, ++ char __user *buf, size_t size, loff_t *ppos) ++{ ++ char *page; ++ size_t bufsize; ++ ssize_t l, l2, copied; ++ char *start; ++ struct inode *inode; ++ struct block_device *bdev; ++ struct super_block *sb; ++ struct quotatree_data data; ++ int eof, err; ++ ++ err = -ENOMEM; ++ page = (char *)__get_free_page(GFP_KERNEL); ++ if (page == NULL) ++ goto out_err; ++ ++ err = -ENODEV; ++ inode = file->f_dentry->d_inode; ++ bdev = bdget(vzdq_aquot_getidev(inode)); ++ if (bdev == NULL) ++ goto out_err; ++ sb = get_super(bdev); ++ bdput(bdev); ++ if (sb == NULL) ++ goto out_err; ++ data.qmblk = vzquota_find_qmblk(sb); ++ data.type = PROC_I(inode)->fd - 1; ++ drop_super(sb); ++ if (data.qmblk == NULL || data.qmblk == VZ_QUOTA_BAD) ++ goto out_err; ++ ++ copied = 0; ++ l = l2 = 0; ++ while (1) { ++ bufsize = min(size, (size_t)PAGE_SIZE); ++ if (bufsize <= 0) ++ break; ++ ++ l = read_proc_quotafile(page, &start, *ppos, bufsize, ++ &eof, &data); ++ if (l <= 0) ++ break; ++ ++ l2 = copy_to_user(buf, page, l); ++ copied += l - l2; ++ if (l2) ++ break; ++ ++ buf += l; ++ size -= l; ++ *ppos += (unsigned long)start; ++ l = l2 = 0; ++ } ++ ++ qmblk_put(data.qmblk); ++ free_page((unsigned long)page); ++ if (copied) ++ return copied; ++ else if (l2) /* last copy_to_user failed */ ++ return -EFAULT; ++ else /* read error or EOF */ ++ return l; ++ ++out_err: ++ if (page != NULL) ++ free_page((unsigned long)page); ++ return err; ++} ++ ++static struct file_operations vzdq_aquotf_file_operations = { ++ .read = &vzdq_aquotf_read, ++}; ++ ++static struct inode_operations vzdq_aquotf_inode_operations = { ++}; ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * /proc/vz/vzaquota/QID directory ++ * ++ * --------------------------------------------------------------------- */ ++ ++static int vzdq_aquotq_readdir(struct file *file, void *data, filldir_t filler) ++{ ++ loff_t n; ++ int err; ++ ++ n = file->f_pos; ++ for (err = 0; !err; n++) { ++ /* ppc32 can't cmp 2 long long's in switch, calls __cmpdi2() */ ++ switch ((unsigned long)n) { ++ case 0: ++ err = (*filler)(data, ".", 1, n, ++ file->f_dentry->d_inode->i_ino, ++ DT_DIR); ++ break; ++ case 1: ++ err = (*filler)(data, "..", 2, n, ++ parent_ino(file->f_dentry), DT_DIR); ++ break; ++ case 2: ++ err = (*filler)(data, aquota_user, ++ sizeof(aquota_user)-1, n, ++ file->f_dentry->d_inode->i_ino ++ + USRQUOTA + 1, ++ DT_REG); ++ break; ++ case 3: ++ err = (*filler)(data, aquota_group, ++ sizeof(aquota_group)-1, n, ++ file->f_dentry->d_inode->i_ino ++ + GRPQUOTA + 1, ++ DT_REG); ++ break; ++ default: ++ goto out; ++ } ++ } ++out: ++ file->f_pos = n; ++ return err; ++} ++ ++struct vzdq_aquotq_lookdata { ++ dev_t dev; ++ int type; ++ struct vz_quota_master *qmblk; ++}; ++ ++static int vzdq_aquotq_looktest(struct inode *inode, void *data) ++{ ++ struct vzdq_aquotq_lookdata *d; ++ ++ d = data; ++ return inode->i_op == &vzdq_aquotf_inode_operations && ++ vzdq_aquot_getidev(inode) == d->dev && ++ PROC_I(inode)->fd == d->type + 1; ++} ++ ++static int vzdq_aquotq_lookset(struct inode *inode, void *data) ++{ ++ struct vzdq_aquotq_lookdata *d; ++ struct super_block *sb; ++ struct quotatree_data qtd; ++ struct quotatree_tree *tree; ++ ++ d = data; ++ inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; ++ inode->i_ino = vzdq_aquot_getino(d->dev) + d->type + 1; ++ inode->i_mode = S_IFREG | S_IRUSR; ++ inode->i_uid = 0; ++ inode->i_gid = 0; ++ inode->i_nlink = 1; ++ inode->i_op = &vzdq_aquotf_inode_operations; ++ inode->i_fop = &vzdq_aquotf_file_operations; ++ PROC_I(inode)->fd = d->type + 1; ++ vzdq_aquot_setidev(inode, d->dev); ++ ++ /* Setting size */ ++ sb = user_get_super(d->dev); ++ if (sb == NULL) ++ return -ENODEV; ++ qtd.qmblk = vzquota_find_qmblk(sb); ++ drop_super(sb); ++ ++ if (qtd.qmblk == NULL) ++ return -ESRCH; ++ if (qtd.qmblk == VZ_QUOTA_BAD) ++ return -EIO; ++ ++ qtd.type = PROC_I(inode)->fd - 1; ++ tree = QUGID_TREE(qtd.qmblk, qtd.type); ++ inode->i_size = get_block_num(tree) * 1024; ++ return 0; ++} ++ ++static int vzdq_aquotq_revalidate(struct dentry *vdentry, struct nameidata *nd) ++{ ++ return 0; ++} ++ ++static struct dentry_operations vzdq_aquotq_dentry_operations = { ++ .d_revalidate = &vzdq_aquotq_revalidate, ++}; ++ ++static struct vz_quota_master *find_qmblk_by_dev(dev_t dev) ++{ ++ struct super_block *sb; ++ struct vz_quota_master *qmblk; ++ ++ qmblk = NULL; ++ sb = user_get_super(dev); ++ if (sb != NULL) { ++ qmblk = vzquota_find_qmblk(sb); ++ drop_super(sb); ++ ++ if (qmblk == VZ_QUOTA_BAD) ++ qmblk = NULL; ++ } ++ ++ return qmblk; ++} ++ ++static struct dentry *vzdq_aquotq_lookup(struct inode *dir, ++ struct dentry *dentry, ++ struct nameidata *nd) ++{ ++ struct inode *inode; ++ struct vzdq_aquotq_lookdata d; ++ int k; ++ ++ if (dentry->d_name.len == sizeof(aquota_user)-1) { ++ if (memcmp(dentry->d_name.name, aquota_user, ++ sizeof(aquota_user)-1)) ++ goto out; ++ k = USRQUOTA; ++ } else if (dentry->d_name.len == sizeof(aquota_group)-1) { ++ if (memcmp(dentry->d_name.name, aquota_group, ++ sizeof(aquota_group)-1)) ++ goto out; ++ k = GRPQUOTA; ++ } else ++ goto out; ++ d.dev = vzdq_aquot_getidev(dir); ++ d.type = k; ++ d.qmblk = find_qmblk_by_dev(d.dev); ++ if (d.qmblk == NULL) ++ goto out; ++ ++ inode = iget5_locked(dir->i_sb, dir->i_ino + k + 1, ++ vzdq_aquotq_looktest, vzdq_aquotq_lookset, &d); ++ if (inode == NULL) ++ goto out; ++ unlock_new_inode(inode); ++ dentry->d_op = &vzdq_aquotq_dentry_operations; ++ d_add(dentry, inode); ++ return NULL; ++ ++out: ++ return ERR_PTR(-ENOENT); ++} ++ ++static struct file_operations vzdq_aquotq_file_operations = { ++ .read = &generic_read_dir, ++ .readdir = &vzdq_aquotq_readdir, ++}; ++ ++static struct inode_operations vzdq_aquotq_inode_operations = { ++ .lookup = &vzdq_aquotq_lookup, ++}; ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * /proc/vz/vzaquota directory ++ * ++ * --------------------------------------------------------------------- */ ++ ++struct vzdq_aquot_de { ++ struct list_head list; ++ struct vfsmount *mnt; ++}; ++ ++static int vzdq_aquot_buildmntlist(struct ve_struct *ve, ++ struct list_head *head) ++{ ++ struct vfsmount *rmnt, *mnt; ++ struct vzdq_aquot_de *p; ++ int err; ++ ++#ifdef CONFIG_VE ++ rmnt = mntget(ve->fs_rootmnt); ++#else ++ read_lock(¤t->fs->lock); ++ rmnt = mntget(current->fs->rootmnt); ++ read_unlock(¤t->fs->lock); ++#endif ++ mnt = rmnt; ++ spin_lock(&vfsmount_lock); ++ while (1) { ++ list_for_each_entry(p, head, list) { ++ if (p->mnt->mnt_sb == mnt->mnt_sb) ++ goto skip; ++ } ++ ++ err = -ENOMEM; ++ p = kmalloc(sizeof(*p), GFP_ATOMIC); ++ if (p == NULL) ++ goto out; ++ p->mnt = mntget(mnt); ++ list_add_tail(&p->list, head); ++ ++skip: ++ err = 0; ++ if (list_empty(&mnt->mnt_mounts)) { ++ while (1) { ++ if (mnt == rmnt) ++ goto out; ++ if (mnt->mnt_child.next != ++ &mnt->mnt_parent->mnt_mounts) ++ break; ++ mnt = mnt->mnt_parent; ++ } ++ mnt = list_entry(mnt->mnt_child.next, ++ struct vfsmount, mnt_child); ++ } else ++ mnt = list_entry(mnt->mnt_mounts.next, ++ struct vfsmount, mnt_child); ++ } ++out: ++ spin_unlock(&vfsmount_lock); ++ mntput(rmnt); ++ return err; ++} ++ ++static void vzdq_aquot_releasemntlist(struct ve_struct *ve, ++ struct list_head *head) ++{ ++ struct vzdq_aquot_de *p; ++ ++ while (!list_empty(head)) { ++ p = list_entry(head->next, typeof(*p), list); ++ mntput(p->mnt); ++ list_del(&p->list); ++ kfree(p); ++ } ++} ++ ++static int vzdq_aquotd_readdir(struct file *file, void *data, filldir_t filler) ++{ ++ struct ve_struct *ve, *old_ve; ++ struct list_head mntlist; ++ struct vzdq_aquot_de *de; ++ struct super_block *sb; ++ struct vz_quota_master *qmblk; ++ loff_t i, n; ++ char buf[24]; ++ int l, err; ++ ++ i = 0; ++ n = file->f_pos; ++ ve = file->f_dentry->d_sb->s_type->owner_env; ++ old_ve = set_exec_env(ve); ++ ++ INIT_LIST_HEAD(&mntlist); ++#ifdef CONFIG_VE ++ /* ++ * The only reason of disabling readdir for the host system is that ++ * this readdir can be slow and CPU consuming with large number of VPSs ++ * (or just mount points). ++ */ ++ err = ve_is_super(ve); ++#else ++ err = 0; ++#endif ++ if (!err) { ++ err = vzdq_aquot_buildmntlist(ve, &mntlist); ++ if (err) ++ goto out_err; ++ } ++ ++ if (i >= n) { ++ if ((*filler)(data, ".", 1, i, ++ file->f_dentry->d_inode->i_ino, DT_DIR)) ++ goto out_fill; ++ } ++ i++; ++ ++ if (i >= n) { ++ if ((*filler)(data, "..", 2, i, ++ parent_ino(file->f_dentry), DT_DIR)) ++ goto out_fill; ++ } ++ i++; ++ ++ list_for_each_entry (de, &mntlist, list) { ++ sb = de->mnt->mnt_sb; ++ if (get_device_perms_ve(S_IFBLK, sb->s_dev, FMODE_QUOTACTL)) ++ continue; ++ ++ qmblk = vzquota_find_qmblk(sb); ++ if (qmblk == NULL || qmblk == VZ_QUOTA_BAD) ++ continue; ++ ++ qmblk_put(qmblk); ++ i++; ++ if (i <= n) ++ continue; ++ ++ l = sprintf(buf, "%08x", new_encode_dev(sb->s_dev)); ++ if ((*filler)(data, buf, l, i - 1, ++ vzdq_aquot_getino(sb->s_dev), DT_DIR)) ++ break; ++ } ++ ++out_fill: ++ err = 0; ++ file->f_pos = i; ++out_err: ++ vzdq_aquot_releasemntlist(ve, &mntlist); ++ (void)set_exec_env(old_ve); ++ return err; ++} ++ ++static int vzdq_aquotd_looktest(struct inode *inode, void *data) ++{ ++ return inode->i_op == &vzdq_aquotq_inode_operations && ++ vzdq_aquot_getidev(inode) == (dev_t)(unsigned long)data; ++} ++ ++static int vzdq_aquotd_lookset(struct inode *inode, void *data) ++{ ++ dev_t dev; ++ ++ dev = (dev_t)(unsigned long)data; ++ inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; ++ inode->i_ino = vzdq_aquot_getino(dev); ++ inode->i_mode = S_IFDIR | S_IRUSR | S_IXUSR; ++ inode->i_uid = 0; ++ inode->i_gid = 0; ++ inode->i_nlink = 2; ++ inode->i_op = &vzdq_aquotq_inode_operations; ++ inode->i_fop = &vzdq_aquotq_file_operations; ++ vzdq_aquot_setidev(inode, dev); ++ return 0; ++} ++ ++static struct dentry *vzdq_aquotd_lookup(struct inode *dir, ++ struct dentry *dentry, ++ struct nameidata *nd) ++{ ++ struct ve_struct *ve, *old_ve; ++ const unsigned char *s; ++ int l; ++ dev_t dev; ++ struct inode *inode; ++ ++ ve = dir->i_sb->s_type->owner_env; ++ old_ve = set_exec_env(ve); ++#ifdef CONFIG_VE ++ /* ++ * Lookup is much lighter than readdir, so it can be allowed for the ++ * host system. But it would be strange to be able to do lookup only ++ * without readdir... ++ */ ++ if (ve_is_super(ve)) ++ goto out; ++#endif ++ ++ dev = 0; ++ l = dentry->d_name.len; ++ if (l <= 0) ++ goto out; ++ for (s = dentry->d_name.name; l > 0; s++, l--) { ++ if (!isxdigit(*s)) ++ goto out; ++ if (dev & ~(~0UL >> 4)) ++ goto out; ++ dev <<= 4; ++ if (isdigit(*s)) ++ dev += *s - '0'; ++ else if (islower(*s)) ++ dev += *s - 'a' + 10; ++ else ++ dev += *s - 'A' + 10; ++ } ++ dev = new_decode_dev(dev); ++ ++ if (get_device_perms_ve(S_IFBLK, dev, FMODE_QUOTACTL)) ++ goto out; ++ ++ inode = iget5_locked(dir->i_sb, vzdq_aquot_getino(dev), ++ vzdq_aquotd_looktest, vzdq_aquotd_lookset, ++ (void *)(unsigned long)dev); ++ if (inode == NULL) ++ goto out; ++ unlock_new_inode(inode); ++ ++ d_add(dentry, inode); ++ (void)set_exec_env(old_ve); ++ return NULL; ++ ++out: ++ (void)set_exec_env(old_ve); ++ return ERR_PTR(-ENOENT); ++} ++ ++static int vzdq_aquotd_getattr(struct vfsmount *mnt, struct dentry *dentry, ++ struct kstat *stat) ++{ ++ struct ve_struct *ve, *old_ve; ++ struct list_head mntlist, *pos; ++ ++ generic_fillattr(dentry->d_inode, stat); ++ ve = dentry->d_sb->s_type->owner_env; ++#ifdef CONFIG_VE ++ /* ++ * The only reason of disabling getattr for the host system is that ++ * this getattr can be slow and CPU consuming with large number of VPSs ++ * (or just mount points). ++ */ ++ if (ve_is_super(ve)) ++ return 0; ++#endif ++ INIT_LIST_HEAD(&mntlist); ++ old_ve = set_exec_env(ve); ++ if (!vzdq_aquot_buildmntlist(ve, &mntlist)) ++ list_for_each(pos, &mntlist) ++ stat->nlink++; ++ vzdq_aquot_releasemntlist(ve, &mntlist); ++ (void)set_exec_env(old_ve); ++ return 0; ++} ++ ++static struct file_operations vzdq_aquotd_file_operations = { ++ .read = &generic_read_dir, ++ .readdir = &vzdq_aquotd_readdir, ++}; ++ ++static struct inode_operations vzdq_aquotd_inode_operations = { ++ .lookup = &vzdq_aquotd_lookup, ++ .getattr = &vzdq_aquotd_getattr, ++}; ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * Initialization and deinitialization ++ * ++ * --------------------------------------------------------------------- */ ++static ctl_table fs_table[] = { ++ { ++ .ctl_name = FS_DQSTATS, ++ .procname = "quota", ++ .mode = 0555, ++ }, ++ {}, ++}; ++ ++static ctl_table sys_table[] = { ++ { ++ .ctl_name = CTL_FS, ++ .procname = "fs", ++ .mode = 0555, ++ .child = fs_table, ++ }, ++ {}, ++}; ++ ++/* ++ * FIXME: creation of proc entries here is unsafe with respect to module ++ * unloading. ++ */ ++void vzaquota_init(void) ++{ ++ struct proc_dir_entry *de; ++ ++ de = create_proc_glob_entry("vz/vzaquota", ++ S_IFDIR | S_IRUSR | S_IXUSR, NULL); ++ if (de != NULL) { ++ de->proc_iops = &vzdq_aquotd_inode_operations; ++ de->proc_fops = &vzdq_aquotd_file_operations; ++ } else ++ printk("VZDQ: vz/vzaquota creation failed\n"); ++ register_glob_sysctl_table(sys_table); ++} ++ ++void vzaquota_fini(void) ++{ ++ remove_proc_entry("vz/vzaquota", NULL); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/vzdq_mgmt.c debian/binary-custom.d/openvz/src/fs/vzdq_mgmt.c +--- ./fs/vzdq_mgmt.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/fs/vzdq_mgmt.c 2012-11-13 15:20:14.296569106 +0000 +@@ -0,0 +1,769 @@ ++/* ++ * Copyright (C) 2001, 2002, 2004, 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++/* ---------------------------------------------------------------------- ++ * Switching quota on. ++ * --------------------------------------------------------------------- */ ++ ++/* ++ * check limits copied from user ++ */ ++int vzquota_check_sane_limits(struct dq_stat *qstat) ++{ ++ int err; ++ ++ err = -EINVAL; ++ ++ /* softlimit must be less then hardlimit */ ++ if (qstat->bsoftlimit > qstat->bhardlimit) ++ goto out; ++ ++ if (qstat->isoftlimit > qstat->ihardlimit) ++ goto out; ++ ++ err = 0; ++out: ++ return err; ++} ++ ++/* ++ * check usage values copied from user ++ */ ++int vzquota_check_sane_values(struct dq_stat *qstat) ++{ ++ int err; ++ ++ err = -EINVAL; ++ ++ /* expiration time must not be set if softlimit was not exceeded */ ++ if (qstat->bcurrent < qstat->bsoftlimit && qstat->btime != 0) ++ goto out; ++ ++ if (qstat->icurrent < qstat->isoftlimit && qstat->itime != 0) ++ goto out; ++ ++ err = vzquota_check_sane_limits(qstat); ++out: ++ return err; ++} ++ ++/* ++ * create new quota master block ++ * this function should: ++ * - copy limits and usage parameters from user buffer; ++ * - allock, initialize quota block and insert it to hash; ++ */ ++static int vzquota_create(unsigned int quota_id, ++ struct vz_quota_stat __user *u_qstat, int compat) ++{ ++ int err; ++ struct vz_quota_stat qstat; ++ struct vz_quota_master *qmblk; ++ ++ down(&vz_quota_sem); ++ ++ err = -EFAULT; ++ if (!compat) { ++ if (copy_from_user(&qstat, u_qstat, sizeof(qstat))) ++ goto out; ++ } else { ++#ifdef CONFIG_COMPAT ++ struct compat_vz_quota_stat cqstat; ++ if (copy_from_user(&cqstat, u_qstat, sizeof(cqstat))) ++ goto out; ++ compat_dqstat2dqstat(&cqstat.dq_stat, &qstat.dq_stat); ++ compat_dqinfo2dqinfo(&cqstat.dq_info, &qstat.dq_info); ++#endif ++ } ++ ++ err = -EINVAL; ++ if (quota_id == 0) ++ goto out; ++ ++ if (vzquota_check_sane_values(&qstat.dq_stat)) ++ goto out; ++ err = 0; ++ qmblk = vzquota_alloc_master(quota_id, &qstat); ++ ++ if (IS_ERR(qmblk)) /* ENOMEM or EEXIST */ ++ err = PTR_ERR(qmblk); ++out: ++ up(&vz_quota_sem); ++ ++ return err; ++} ++ ++/** ++ * vzquota_on - turn quota on ++ * ++ * This function should: ++ * - find and get refcnt of directory entry for quota root and corresponding ++ * mountpoint; ++ * - find corresponding quota block and mark it with given path; ++ * - check quota tree; ++ * - initialize quota for the tree root. ++ */ ++static int vzquota_on(unsigned int quota_id, const char __user *quota_root, ++ char __user *buf) ++{ ++ int err; ++ struct nameidata nd; ++ struct vz_quota_master *qmblk; ++ struct super_block *dqsb; ++ ++ dqsb = NULL; ++ down(&vz_quota_sem); ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = -EBUSY; ++ if (qmblk->dq_state != VZDQ_STARTING) ++ goto out; ++ ++ err = user_path_walk(quota_root, &nd); ++ if (err) ++ goto out; ++ /* init path must be a directory */ ++ err = -ENOTDIR; ++ if (!S_ISDIR(nd.dentry->d_inode->i_mode)) ++ goto out_path; ++ ++ qmblk->dq_root_dentry = nd.dentry; ++ qmblk->dq_root_mnt = nd.mnt; ++ qmblk->dq_sb = nd.dentry->d_inode->i_sb; ++ err = vzquota_get_super(qmblk->dq_sb); ++ if (err) ++ goto out_super; ++ ++ /* ++ * Serialization with quota initialization and operations is performed ++ * through generation check: generation is memorized before qmblk is ++ * found and compared under inode_qmblk_lock with assignment. ++ * ++ * Note that the dentry tree is shrunk only for high-level logical ++ * serialization, purely as a courtesy to the user: to have consistent ++ * quota statistics, files should be closed etc. on quota on. ++ */ ++ err = vzquota_on_qmblk(qmblk->dq_sb, qmblk->dq_root_dentry->d_inode, ++ qmblk, buf); ++ if (err) ++ goto out_init; ++ qmblk->dq_state = VZDQ_WORKING; ++ ++ up(&vz_quota_sem); ++ return 0; ++ ++out_init: ++ dqsb = qmblk->dq_sb; ++out_super: ++ /* clear for qmblk_put/quota_free_master */ ++ qmblk->dq_sb = NULL; ++ qmblk->dq_root_dentry = NULL; ++ qmblk->dq_root_mnt = NULL; ++out_path: ++ path_release(&nd); ++out: ++ if (dqsb) ++ vzquota_put_super(dqsb); ++ up(&vz_quota_sem); ++ return err; ++} ++ ++ ++/* ---------------------------------------------------------------------- ++ * Switching quota off. ++ * --------------------------------------------------------------------- */ ++ ++/* ++ * destroy quota block by ID ++ */ ++static int vzquota_destroy(unsigned int quota_id) ++{ ++ int err; ++ struct vz_quota_master *qmblk; ++ struct dentry *dentry; ++ struct vfsmount *mnt; ++ ++ down(&vz_quota_sem); ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = -EBUSY; ++ if (qmblk->dq_state == VZDQ_WORKING) ++ goto out; /* quota_off first */ ++ ++ list_del_init(&qmblk->dq_hash); ++ dentry = qmblk->dq_root_dentry; ++ qmblk->dq_root_dentry = NULL; ++ mnt = qmblk->dq_root_mnt; ++ qmblk->dq_root_mnt = NULL; ++ ++ if (qmblk->dq_sb) ++ vzquota_put_super(qmblk->dq_sb); ++ up(&vz_quota_sem); ++ ++ qmblk_put(qmblk); ++ dput(dentry); ++ mntput(mnt); ++ return 0; ++ ++out: ++ up(&vz_quota_sem); ++ return err; ++} ++ ++/** ++ * vzquota_off - turn quota off ++ */ ++ ++static int __vzquota_sync_list(struct list_head *lh, ++ struct vz_quota_master *qmblk, ++ enum writeback_sync_modes sync_mode) ++{ ++ struct writeback_control wbc; ++ LIST_HEAD(list); ++ struct vz_quota_ilink *qlnk; ++ struct inode *inode; ++ int err, ret; ++ ++ memset(&wbc, 0, sizeof(wbc)); ++ wbc.sync_mode = sync_mode; ++ ++ err = ret = 0; ++ while (!list_empty(lh)) { ++ if (need_resched()) { ++ inode_qmblk_unlock(qmblk->dq_sb); ++ schedule(); ++ inode_qmblk_lock(qmblk->dq_sb); ++ continue; ++ } ++ ++ qlnk = list_first_entry(lh, struct vz_quota_ilink, list); ++ list_move(&qlnk->list, &list); ++ ++ inode = igrab(QLNK_INODE(qlnk)); ++ if (!inode) ++ continue; ++ ++ inode_qmblk_unlock(qmblk->dq_sb); ++ ++ wbc.nr_to_write = LONG_MAX; ++ ret = sync_inode(inode, &wbc); ++ if (ret) ++ err = ret; ++ iput(inode); ++ ++ inode_qmblk_lock(qmblk->dq_sb); ++ } ++ ++ list_splice(&list, lh); ++ return err; ++} ++ ++static int vzquota_sync_list(struct list_head *lh, ++ struct vz_quota_master *qmblk) ++{ ++ (void)__vzquota_sync_list(lh, qmblk, WB_SYNC_NONE); ++ return __vzquota_sync_list(lh, qmblk, WB_SYNC_ALL); ++} ++ ++static int vzquota_sync_inodes(struct vz_quota_master *qmblk) ++{ ++ int err; ++ LIST_HEAD(qlnk_list); ++ ++ list_splice_init(&qmblk->dq_ilink_list, &qlnk_list); ++ err = vzquota_sync_list(&qlnk_list, qmblk); ++ if (!err && !list_empty(&qmblk->dq_ilink_list)) ++ err = -EBUSY; ++ list_splice(&qlnk_list, &qmblk->dq_ilink_list); ++ ++ return err; ++} ++ ++static int vzquota_off(unsigned int quota_id, char __user *buf, int force) ++{ ++ int err, ret; ++ struct vz_quota_master *qmblk; ++ ++ down(&vz_quota_sem); ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = -EALREADY; ++ if (qmblk->dq_state != VZDQ_WORKING) ++ goto out; ++ ++ inode_qmblk_lock(qmblk->dq_sb); /* protects dq_ilink_list also */ ++ ret = vzquota_sync_inodes(qmblk); ++ inode_qmblk_unlock(qmblk->dq_sb); ++ ++ err = vzquota_off_qmblk(qmblk->dq_sb, qmblk, buf, force); ++ if (err) ++ goto out; ++ ++ err = ret; ++ /* vzquota_destroy will free resources */ ++ qmblk->dq_state = VZDQ_STOPING; ++out: ++ up(&vz_quota_sem); ++ ++ return err; ++} ++ ++ ++/* ---------------------------------------------------------------------- ++ * Other VZQUOTA ioctl's. ++ * --------------------------------------------------------------------- */ ++ ++/* ++ * this function should: ++ * - set new limits/buffer under quota master block lock ++ * - if new softlimit less then usage, then set expiration time ++ * - no need to alloc ugid hash table - we'll do that on demand ++ */ ++int vzquota_update_limit(struct dq_stat *_qstat, ++ struct dq_stat *qstat) ++{ ++ int err; ++ ++ err = -EINVAL; ++ if (vzquota_check_sane_limits(qstat)) ++ goto out; ++ ++ err = 0; ++ ++ /* limits */ ++ _qstat->bsoftlimit = qstat->bsoftlimit; ++ _qstat->bhardlimit = qstat->bhardlimit; ++ /* ++ * If the soft limit is exceeded, administrator can override the moment ++ * when the grace period for limit exceeding ends. ++ * Specifying the moment may be useful if the soft limit is set to be ++ * lower than the current usage. In the latter case, if the grace ++ * period end isn't specified, the grace period will start from the ++ * moment of the first write operation. ++ * There is a race with the user level. Soft limit may be already ++ * exceeded before the limit change, and grace period end calculated by ++ * the kernel will be overriden. User level may check if the limit is ++ * already exceeded, but check and set calls are not atomic. ++ * This race isn't dangerous. Under normal cicrumstances, the ++ * difference between the grace period end calculated by the kernel and ++ * the user level should be not greater than as the difference between ++ * the moments of check and set calls, i.e. not bigger than the quota ++ * timer resolution - 1 sec. ++ */ ++ if (qstat->btime != (time_t)0 && ++ _qstat->bcurrent >= _qstat->bsoftlimit) ++ _qstat->btime = qstat->btime; ++ ++ _qstat->isoftlimit = qstat->isoftlimit; ++ _qstat->ihardlimit = qstat->ihardlimit; ++ if (qstat->itime != (time_t)0 && ++ _qstat->icurrent >= _qstat->isoftlimit) ++ _qstat->itime = qstat->itime; ++ ++out: ++ return err; ++} ++ ++/* ++ * set new quota limits. ++ * this function should: ++ * copy new limits from user level ++ * - find quota block ++ * - set new limits and flags. ++ */ ++static int vzquota_setlimit(unsigned int quota_id, ++ struct vz_quota_stat __user *u_qstat, int compat) ++{ ++ int err; ++ struct vz_quota_stat qstat; ++ struct vz_quota_master *qmblk; ++ ++ down(&vz_quota_sem); /* for hash list protection */ ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = -EFAULT; ++ if (!compat) { ++ if (copy_from_user(&qstat, u_qstat, sizeof(qstat))) ++ goto out; ++ } else { ++#ifdef CONFIG_COMPAT ++ struct compat_vz_quota_stat cqstat; ++ if (copy_from_user(&cqstat, u_qstat, sizeof(cqstat))) ++ goto out; ++ compat_dqstat2dqstat(&cqstat.dq_stat, &qstat.dq_stat); ++ compat_dqinfo2dqinfo(&cqstat.dq_info, &qstat.dq_info); ++#endif ++ } ++ ++ qmblk_data_write_lock(qmblk); ++ err = vzquota_update_limit(&qmblk->dq_stat, &qstat.dq_stat); ++ if (err == 0) ++ qmblk->dq_info = qstat.dq_info; ++ qmblk_data_write_unlock(qmblk); ++ ++out: ++ up(&vz_quota_sem); ++ return err; ++} ++ ++/* ++ * get quota limits. ++ * very simple - just return stat buffer to user ++ */ ++static int vzquota_getstat(unsigned int quota_id, ++ struct vz_quota_stat __user *u_qstat, int compat) ++{ ++ int err; ++ struct vz_quota_stat qstat; ++ struct vz_quota_master *qmblk; ++ ++ down(&vz_quota_sem); ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ qmblk_data_read_lock(qmblk); ++ /* copy whole buffer under lock */ ++ memcpy(&qstat.dq_stat, &qmblk->dq_stat, sizeof(qstat.dq_stat)); ++ memcpy(&qstat.dq_info, &qmblk->dq_info, sizeof(qstat.dq_info)); ++ qmblk_data_read_unlock(qmblk); ++ ++ if (!compat) ++ err = copy_to_user(u_qstat, &qstat, sizeof(qstat)); ++ else { ++#ifdef CONFIG_COMPAT ++ struct compat_vz_quota_stat cqstat; ++ dqstat2compat_dqstat(&qstat.dq_stat, &cqstat.dq_stat); ++ dqinfo2compat_dqinfo(&qstat.dq_info, &cqstat.dq_info); ++ err = copy_to_user(u_qstat, &cqstat, sizeof(cqstat)); ++#endif ++ } ++ if (err) ++ err = -EFAULT; ++ ++out: ++ up(&vz_quota_sem); ++ return err; ++} ++ ++/* ++ * This is a system call to turn per-VE disk quota on. ++ * Note this call is allowed to run ONLY from VE0 ++ */ ++long do_vzquotactl(int cmd, unsigned int quota_id, ++ struct vz_quota_stat __user *qstat, const char __user *ve_root, ++ int compat) ++{ ++ int ret; ++ int force = 0; ++ ++ ret = -EPERM; ++ /* access allowed only from root of VE0 */ ++ if (!capable(CAP_SYS_RESOURCE) || ++ !capable(CAP_SYS_ADMIN)) ++ goto out; ++ ++ switch (cmd) { ++ case VZ_DQ_CREATE: ++ ret = vzquota_create(quota_id, qstat, compat); ++ break; ++ case VZ_DQ_DESTROY: ++ ret = vzquota_destroy(quota_id); ++ break; ++ case VZ_DQ_ON: ++ /* ++ * qstat is just a pointer to userspace buffer to ++ * store busy files path in case of vzquota_on fail ++ */ ++ ret = vzquota_on(quota_id, ve_root, (char *)qstat); ++ break; ++ case VZ_DQ_OFF_FORCED: ++ force = 1; ++ case VZ_DQ_OFF: ++ /* ++ * ve_root is just a pointer to userspace buffer to ++ * store busy files path in case of vzquota_off fail ++ */ ++ ret = vzquota_off(quota_id, (char *)ve_root, force); ++ break; ++ case VZ_DQ_SETLIMIT: ++ ret = vzquota_setlimit(quota_id, qstat, compat); ++ break; ++ case VZ_DQ_GETSTAT: ++ ret = vzquota_getstat(quota_id, qstat, compat); ++ break; ++ ++ default: ++ ret = -EINVAL; ++ goto out; ++ } ++ ++out: ++ return ret; ++} ++ ++ ++/* ---------------------------------------------------------------------- ++ * Proc filesystem routines ++ * ---------------------------------------------------------------------*/ ++ ++#if defined(CONFIG_PROC_FS) ++ ++#define QUOTA_UINT_LEN 15 ++#define QUOTA_TIME_LEN_FMT_UINT "%11u" ++#define QUOTA_NUM_LEN_FMT_UINT "%15u" ++#define QUOTA_NUM_LEN_FMT_ULL "%15Lu" ++#define QUOTA_TIME_LEN_FMT_STR "%11s" ++#define QUOTA_NUM_LEN_FMT_STR "%15s" ++#define QUOTA_PROC_MAX_LINE_LEN 2048 ++ ++/* ++ * prints /proc/ve_dq header line ++ */ ++static int print_proc_header(char * buffer) ++{ ++ return sprintf(buffer, ++ "%-11s" ++ QUOTA_NUM_LEN_FMT_STR ++ QUOTA_NUM_LEN_FMT_STR ++ QUOTA_NUM_LEN_FMT_STR ++ QUOTA_TIME_LEN_FMT_STR ++ QUOTA_TIME_LEN_FMT_STR ++ "\n", ++ "qid: path", ++ "usage", "softlimit", "hardlimit", "time", "expire"); ++} ++ ++/* ++ * prints proc master record id, dentry path ++ */ ++static int print_proc_master_id(char * buffer, char * path_buf, ++ struct vz_quota_master * qp) ++{ ++ char *path; ++ int over; ++ ++ path = NULL; ++ switch (qp->dq_state) { ++ case VZDQ_WORKING: ++ if (!path_buf) { ++ path = ""; ++ break; ++ } ++ path = d_path(qp->dq_root_dentry, ++ qp->dq_root_mnt, path_buf, PAGE_SIZE); ++ if (IS_ERR(path)) { ++ path = ""; ++ break; ++ } ++ /* do not print large path, truncate it */ ++ over = strlen(path) - ++ (QUOTA_PROC_MAX_LINE_LEN - 3 - 3 - ++ QUOTA_UINT_LEN); ++ if (over > 0) { ++ path += over - 3; ++ path[0] = path[1] = path[3] = '.'; ++ } ++ break; ++ case VZDQ_STARTING: ++ path = "-- started --"; ++ break; ++ case VZDQ_STOPING: ++ path = "-- stopped --"; ++ break; ++ } ++ ++ return sprintf(buffer, "%u: %s\n", qp->dq_id, path); ++} ++ ++/* ++ * prints struct vz_quota_stat data ++ */ ++static int print_proc_stat(char * buffer, struct dq_stat *qs, ++ struct dq_info *qi) ++{ ++ return sprintf(buffer, ++ "%11s" ++ QUOTA_NUM_LEN_FMT_ULL ++ QUOTA_NUM_LEN_FMT_ULL ++ QUOTA_NUM_LEN_FMT_ULL ++ QUOTA_TIME_LEN_FMT_UINT ++ QUOTA_TIME_LEN_FMT_UINT ++ "\n" ++ "%11s" ++ QUOTA_NUM_LEN_FMT_UINT ++ QUOTA_NUM_LEN_FMT_UINT ++ QUOTA_NUM_LEN_FMT_UINT ++ QUOTA_TIME_LEN_FMT_UINT ++ QUOTA_TIME_LEN_FMT_UINT ++ "\n", ++ "1k-blocks", ++ (unsigned long long)qs->bcurrent >> 10, ++ (unsigned long long)qs->bsoftlimit >> 10, ++ (unsigned long long)qs->bhardlimit >> 10, ++ (unsigned int)qs->btime, ++ (unsigned int)qi->bexpire, ++ "inodes", ++ qs->icurrent, ++ qs->isoftlimit, ++ qs->ihardlimit, ++ (unsigned int)qs->itime, ++ (unsigned int)qi->iexpire); ++} ++ ++ ++/* ++ * for /proc filesystem output ++ */ ++static int vzquota_read_proc(char *page, char **start, off_t off, int count, ++ int *eof, void *data) ++{ ++ int len, i; ++ off_t printed = 0; ++ char *p = page; ++ struct vz_quota_master *qp; ++ struct vz_quota_ilink *ql2; ++ struct list_head *listp; ++ char *path_buf; ++ ++ path_buf = (char*)__get_free_page(GFP_KERNEL); ++ if (path_buf == NULL) ++ return -ENOMEM; ++ ++ len = print_proc_header(p); ++ printed += len; ++ if (off < printed) /* keep header in output */ { ++ *start = p + off; ++ p += len; ++ } ++ ++ down(&vz_quota_sem); ++ ++ /* traverse master hash table for all records */ ++ for (i = 0; i < vzquota_hash_size; i++) { ++ list_for_each(listp, &vzquota_hash_table[i]) { ++ qp = list_entry(listp, ++ struct vz_quota_master, dq_hash); ++ ++ /* Skip other VE's information if not root of VE0 */ ++ if ((!capable(CAP_SYS_ADMIN) || ++ !capable(CAP_SYS_RESOURCE))) { ++ ql2 = INODE_QLNK(current->fs->root->d_inode); ++ if (ql2 == NULL || qp != ql2->qmblk) ++ continue; ++ } ++ /* ++ * Now print the next record ++ */ ++ len = 0; ++ /* we print quotaid and path only in VE0 */ ++ if (capable(CAP_SYS_ADMIN)) ++ len += print_proc_master_id(p+len,path_buf, qp); ++ len += print_proc_stat(p+len, &qp->dq_stat, ++ &qp->dq_info); ++ printed += len; ++ /* skip unnecessary lines */ ++ if (printed <= off) ++ continue; ++ p += len; ++ /* provide start offset */ ++ if (*start == NULL) ++ *start = p + (off - printed); ++ /* have we printed all requested size? */ ++ if (PAGE_SIZE - (p - page) < QUOTA_PROC_MAX_LINE_LEN || ++ (p - *start) >= count) ++ goto out; ++ } ++ } ++ ++ *eof = 1; /* checked all hash */ ++out: ++ up(&vz_quota_sem); ++ ++ len = 0; ++ if (*start != NULL) { ++ len = (p - *start); ++ if (len > count) ++ len = count; ++ } ++ ++ if (path_buf) ++ free_page((unsigned long) path_buf); ++ ++ return len; ++} ++ ++/* ++ * Register procfs read callback ++ */ ++int vzquota_proc_init(void) ++{ ++ struct proc_dir_entry *de; ++ ++ de = create_proc_entry_mod("vz/vzquota", S_IFREG|S_IRUSR, NULL, ++ THIS_MODULE); ++ if (de == NULL) { ++ /* create "vz" subdirectory, if not exist */ ++ de = create_proc_entry("vz", S_IFDIR|S_IRUGO|S_IXUGO, NULL); ++ if (de == NULL) ++ goto out_err; ++ de = create_proc_entry_mod("vzquota", S_IFREG|S_IRUSR, de, ++ THIS_MODULE); ++ if (de == NULL) ++ goto out_err; ++ } ++ de->read_proc = vzquota_read_proc; ++ de->data = NULL; ++ return 0; ++out_err: ++ return -EBUSY; ++} ++ ++void vzquota_proc_release(void) ++{ ++ /* Unregister procfs read callback */ ++ remove_proc_entry("vz/vzquota", NULL); ++} ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/vzdq_ops.c debian/binary-custom.d/openvz/src/fs/vzdq_ops.c +--- ./fs/vzdq_ops.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/fs/vzdq_ops.c 2012-11-13 15:20:14.296569106 +0000 +@@ -0,0 +1,633 @@ ++/* ++ * Copyright (C) 2001, 2002, 2004, 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++/* ---------------------------------------------------------------------- ++ * Quota superblock operations - helper functions. ++ * --------------------------------------------------------------------- */ ++ ++static inline void vzquota_incr_inodes(struct dq_stat *dqstat, ++ unsigned long number) ++{ ++ dqstat->icurrent += number; ++} ++ ++static inline void vzquota_incr_space(struct dq_stat *dqstat, ++ __u64 number) ++{ ++ dqstat->bcurrent += number; ++} ++ ++static inline void vzquota_decr_inodes(struct dq_stat *dqstat, ++ unsigned long number) ++{ ++ if (dqstat->icurrent > number) ++ dqstat->icurrent -= number; ++ else ++ dqstat->icurrent = 0; ++ if (dqstat->icurrent < dqstat->isoftlimit) ++ dqstat->itime = (time_t) 0; ++} ++ ++static inline void vzquota_decr_space(struct dq_stat *dqstat, ++ __u64 number) ++{ ++ if (dqstat->bcurrent > number) ++ dqstat->bcurrent -= number; ++ else ++ dqstat->bcurrent = 0; ++ if (dqstat->bcurrent < dqstat->bsoftlimit) ++ dqstat->btime = (time_t) 0; ++} ++ ++/* ++ * better printk() message or use /proc/vzquotamsg interface ++ * similar to /proc/kmsg ++ */ ++static inline void vzquota_warn(struct dq_info *dq_info, int dq_id, int flag, ++ const char *fmt) ++{ ++ if (dq_info->flags & flag) /* warning already printed for this ++ masterblock */ ++ return; ++ printk(fmt, dq_id); ++ dq_info->flags |= flag; ++} ++ ++/* ++ * ignore_hardlimit - ++ * ++ * Intended to allow superuser of VE0 to overwrite hardlimits. ++ * ++ * ignore_hardlimit() has a very bad feature: ++ * ++ * writepage() operation for writable mapping of a file with holes ++ * may trigger get_block() with wrong current and as a consequence, ++ * opens a possibility to overcommit hardlimits ++ */ ++/* for the reason above, it is disabled now */ ++static inline int ignore_hardlimit(struct dq_info *dqstat) ++{ ++#if 0 ++ return ve_is_super(get_exec_env()) && ++ capable(CAP_SYS_RESOURCE) && ++ (dqstat->options & VZ_QUOTA_OPT_RSQUASH); ++#else ++ return 0; ++#endif ++} ++ ++static int vzquota_check_inodes(struct dq_info *dq_info, ++ struct dq_stat *dqstat, ++ unsigned long number, int dq_id) ++{ ++ if (number == 0) ++ return QUOTA_OK; ++ ++ if (dqstat->icurrent + number > dqstat->ihardlimit && ++ !ignore_hardlimit(dq_info)) { ++ vzquota_warn(dq_info, dq_id, VZ_QUOTA_INODES, ++ "VZ QUOTA: file hardlimit reached for id=%d\n"); ++ return NO_QUOTA; ++ } ++ ++ if (dqstat->icurrent + number > dqstat->isoftlimit) { ++ if (dqstat->itime == (time_t)0) { ++ vzquota_warn(dq_info, dq_id, 0, ++ "VZ QUOTA: file softlimit exceeded " ++ "for id=%d\n"); ++ dqstat->itime = CURRENT_TIME_SECONDS + ++ dq_info->iexpire; ++ } else if (CURRENT_TIME_SECONDS >= dqstat->itime && ++ !ignore_hardlimit(dq_info)) { ++ vzquota_warn(dq_info, dq_id, VZ_QUOTA_INODES, ++ "VZ QUOTA: file softlimit expired " ++ "for id=%d\n"); ++ return NO_QUOTA; ++ } ++ } ++ ++ return QUOTA_OK; ++} ++ ++static int vzquota_check_space(struct dq_info *dq_info, ++ struct dq_stat *dqstat, ++ __u64 number, int dq_id, char prealloc) ++{ ++ if (number == 0) ++ return QUOTA_OK; ++ ++ if (prealloc == DQUOT_CMD_FORCE) ++ return QUOTA_OK; ++ ++ if (dqstat->bcurrent + number > dqstat->bhardlimit && ++ !ignore_hardlimit(dq_info)) { ++ if (!prealloc) ++ vzquota_warn(dq_info, dq_id, VZ_QUOTA_SPACE, ++ "VZ QUOTA: disk hardlimit reached " ++ "for id=%d\n"); ++ return NO_QUOTA; ++ } ++ ++ if (dqstat->bcurrent + number > dqstat->bsoftlimit) { ++ if (dqstat->btime == (time_t)0) { ++ if (!prealloc) { ++ vzquota_warn(dq_info, dq_id, 0, ++ "VZ QUOTA: disk softlimit exceeded " ++ "for id=%d\n"); ++ dqstat->btime = CURRENT_TIME_SECONDS ++ + dq_info->bexpire; ++ } else { ++ /* ++ * Original Linux quota doesn't allow ++ * preallocation to exceed softlimit so ++ * exceeding will be always printed ++ */ ++ return NO_QUOTA; ++ } ++ } else if (CURRENT_TIME_SECONDS >= dqstat->btime && ++ !ignore_hardlimit(dq_info)) { ++ if (!prealloc) ++ vzquota_warn(dq_info, dq_id, VZ_QUOTA_SPACE, ++ "VZ QUOTA: disk quota " ++ "softlimit expired " ++ "for id=%d\n"); ++ return NO_QUOTA; ++ } ++ } ++ ++ return QUOTA_OK; ++} ++ ++#ifdef CONFIG_VZ_QUOTA_UGID ++static int vzquota_check_ugid_inodes(struct vz_quota_master *qmblk, ++ struct vz_quota_ugid *qugid[], ++ int type, unsigned long number) ++{ ++ struct dq_info *dqinfo; ++ struct dq_stat *dqstat; ++ ++ if (qugid[type] == NULL) ++ return QUOTA_OK; ++ if (qugid[type] == VZ_QUOTA_UGBAD) ++ return NO_QUOTA; ++ ++ if (type == USRQUOTA && !(qmblk->dq_flags & VZDQ_USRQUOTA)) ++ return QUOTA_OK; ++ if (type == GRPQUOTA && !(qmblk->dq_flags & VZDQ_GRPQUOTA)) ++ return QUOTA_OK; ++ if (number == 0) ++ return QUOTA_OK; ++ ++ dqinfo = &qmblk->dq_ugid_info[type]; ++ dqstat = &qugid[type]->qugid_stat; ++ ++ if (dqstat->ihardlimit != 0 && ++ dqstat->icurrent + number > dqstat->ihardlimit) ++ return NO_QUOTA; ++ ++ if (dqstat->isoftlimit != 0 && ++ dqstat->icurrent + number > dqstat->isoftlimit) { ++ if (dqstat->itime == (time_t)0) ++ dqstat->itime = CURRENT_TIME_SECONDS + ++ dqinfo->iexpire; ++ else if (CURRENT_TIME_SECONDS >= dqstat->itime) ++ return NO_QUOTA; ++ } ++ ++ return QUOTA_OK; ++} ++ ++static int vzquota_check_ugid_space(struct vz_quota_master *qmblk, ++ struct vz_quota_ugid *qugid[], ++ int type, __u64 number, char prealloc) ++{ ++ struct dq_info *dqinfo; ++ struct dq_stat *dqstat; ++ ++ if (prealloc == DQUOT_CMD_FORCE) ++ return QUOTA_OK; ++ ++ if (qugid[type] == NULL) ++ return QUOTA_OK; ++ if (qugid[type] == VZ_QUOTA_UGBAD) ++ return NO_QUOTA; ++ ++ if (type == USRQUOTA && !(qmblk->dq_flags & VZDQ_USRQUOTA)) ++ return QUOTA_OK; ++ if (type == GRPQUOTA && !(qmblk->dq_flags & VZDQ_GRPQUOTA)) ++ return QUOTA_OK; ++ if (number == 0) ++ return QUOTA_OK; ++ ++ dqinfo = &qmblk->dq_ugid_info[type]; ++ dqstat = &qugid[type]->qugid_stat; ++ ++ if (dqstat->bhardlimit != 0 && ++ dqstat->bcurrent + number > dqstat->bhardlimit) ++ return NO_QUOTA; ++ ++ if (dqstat->bsoftlimit != 0 && ++ dqstat->bcurrent + number > dqstat->bsoftlimit) { ++ if (dqstat->btime == (time_t)0) { ++ if (!prealloc) ++ dqstat->btime = CURRENT_TIME_SECONDS ++ + dqinfo->bexpire; ++ else ++ /* ++ * Original Linux quota doesn't allow ++ * preallocation to exceed softlimit so ++ * exceeding will be always printed ++ */ ++ return NO_QUOTA; ++ } else if (CURRENT_TIME_SECONDS >= dqstat->btime) ++ return NO_QUOTA; ++ } ++ ++ return QUOTA_OK; ++} ++#endif ++ ++/* ---------------------------------------------------------------------- ++ * Quota superblock operations ++ * --------------------------------------------------------------------- */ ++ ++/* ++ * S_NOQUOTA note. ++ * In the current kernel (2.6.8.1), S_NOQUOTA flag is set only for ++ * - quota file (absent in our case) ++ * - after explicit DQUOT_DROP (earlier than clear_inode) in functions like ++ * filesystem-specific new_inode, before the inode gets outside links. ++ * For the latter case, the only quota operation where care about S_NOQUOTA ++ * might be required is vzquota_drop, but there S_NOQUOTA has already been ++ * checked in DQUOT_DROP(). ++ * So, S_NOQUOTA may be ignored for now in the VZDQ code. ++ * ++ * The above note is not entirely correct. ++ * Both for ext2 and ext3 filesystems, DQUOT_FREE_INODE is called from ++ * delete_inode if new_inode fails (for example, because of inode quota ++ * limits), so S_NOQUOTA check is needed in free_inode. ++ * This seems to be the dark corner of the current quota API. ++ */ ++ ++/* ++ * Initialize quota operations for the specified inode. ++ */ ++static int vzquota_initialize(struct inode *inode, int type) ++{ ++ vzquota_inode_init_call(inode); ++ return 0; /* ignored by caller */ ++} ++ ++/* ++ * Release quota for the specified inode. ++ */ ++static int vzquota_drop(struct inode *inode) ++{ ++ vzquota_inode_drop_call(inode); ++ return 0; /* ignored by caller */ ++} ++ ++/* ++ * Allocate block callback. ++ * ++ * If (prealloc) disk quota exceeding warning is not printed. ++ * See Linux quota to know why. ++ * ++ * Return: ++ * QUOTA_OK == 0 on SUCCESS ++ * NO_QUOTA == 1 if allocation should fail ++ */ ++static int vzquota_alloc_space(struct inode *inode, ++ qsize_t number, int prealloc) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_datast data; ++ int ret = QUOTA_OK; ++ ++ qmblk = vzquota_inode_data(inode, &data); ++ if (qmblk == VZ_QUOTA_BAD) ++ return NO_QUOTA; ++ if (qmblk != NULL) { ++#ifdef CONFIG_VZ_QUOTA_UGID ++ int cnt; ++ struct vz_quota_ugid * qugid[MAXQUOTAS]; ++#endif ++ ++ /* checking first */ ++ ret = vzquota_check_space(&qmblk->dq_info, &qmblk->dq_stat, ++ number, qmblk->dq_id, prealloc); ++ if (ret == NO_QUOTA) ++ goto no_quota; ++#ifdef CONFIG_VZ_QUOTA_UGID ++ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { ++ qugid[cnt] = INODE_QLNK(inode)->qugid[cnt]; ++ ret = vzquota_check_ugid_space(qmblk, qugid, ++ cnt, number, prealloc); ++ if (ret == NO_QUOTA) ++ goto no_quota; ++ } ++ /* check ok, may increment */ ++ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { ++ if (qugid[cnt] == NULL) ++ continue; ++ vzquota_incr_space(&qugid[cnt]->qugid_stat, number); ++ } ++#endif ++ vzquota_incr_space(&qmblk->dq_stat, number); ++ vzquota_data_unlock(inode, &data); ++ } ++ ++ inode_add_bytes(inode, number); ++ might_sleep(); ++ return QUOTA_OK; ++ ++no_quota: ++ vzquota_data_unlock(inode, &data); ++ return NO_QUOTA; ++} ++ ++/* ++ * Allocate inodes callback. ++ * ++ * Return: ++ * QUOTA_OK == 0 on SUCCESS ++ * NO_QUOTA == 1 if allocation should fail ++ */ ++static int vzquota_alloc_inode(const struct inode *inode, unsigned long number) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_datast data; ++ int ret = QUOTA_OK; ++ ++ qmblk = vzquota_inode_data((struct inode *)inode, &data); ++ if (qmblk == VZ_QUOTA_BAD) ++ return NO_QUOTA; ++ if (qmblk != NULL) { ++#ifdef CONFIG_VZ_QUOTA_UGID ++ int cnt; ++ struct vz_quota_ugid *qugid[MAXQUOTAS]; ++#endif ++ ++ /* checking first */ ++ ret = vzquota_check_inodes(&qmblk->dq_info, &qmblk->dq_stat, ++ number, qmblk->dq_id); ++ if (ret == NO_QUOTA) ++ goto no_quota; ++#ifdef CONFIG_VZ_QUOTA_UGID ++ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { ++ qugid[cnt] = INODE_QLNK(inode)->qugid[cnt]; ++ ret = vzquota_check_ugid_inodes(qmblk, qugid, ++ cnt, number); ++ if (ret == NO_QUOTA) ++ goto no_quota; ++ } ++ /* check ok, may increment */ ++ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { ++ if (qugid[cnt] == NULL) ++ continue; ++ vzquota_incr_inodes(&qugid[cnt]->qugid_stat, number); ++ } ++#endif ++ vzquota_incr_inodes(&qmblk->dq_stat, number); ++ vzquota_data_unlock((struct inode *)inode, &data); ++ } ++ ++ might_sleep(); ++ return QUOTA_OK; ++ ++no_quota: ++ vzquota_data_unlock((struct inode *)inode, &data); ++ return NO_QUOTA; ++} ++ ++/* ++ * Free space callback. ++ */ ++static int vzquota_free_space(struct inode *inode, qsize_t number) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_datast data; ++ ++ qmblk = vzquota_inode_data(inode, &data); ++ if (qmblk == VZ_QUOTA_BAD) ++ return NO_QUOTA; /* isn't checked by the caller */ ++ if (qmblk != NULL) { ++#ifdef CONFIG_VZ_QUOTA_UGID ++ int cnt; ++ struct vz_quota_ugid * qugid; ++#endif ++ ++ vzquota_decr_space(&qmblk->dq_stat, number); ++#ifdef CONFIG_VZ_QUOTA_UGID ++ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { ++ qugid = INODE_QLNK(inode)->qugid[cnt]; ++ if (qugid == NULL || qugid == VZ_QUOTA_UGBAD) ++ continue; ++ vzquota_decr_space(&qugid->qugid_stat, number); ++ } ++#endif ++ vzquota_data_unlock(inode, &data); ++ } ++ inode_sub_bytes(inode, number); ++ might_sleep(); ++ return QUOTA_OK; ++} ++ ++/* ++ * Free inodes callback. ++ */ ++static int vzquota_free_inode(const struct inode *inode, unsigned long number) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_datast data; ++ ++ qmblk = vzquota_inode_data((struct inode *)inode, &data); ++ if (qmblk == VZ_QUOTA_BAD) ++ return NO_QUOTA; ++ if (qmblk != NULL) { ++#ifdef CONFIG_VZ_QUOTA_UGID ++ int cnt; ++ struct vz_quota_ugid * qugid; ++#endif ++ ++ vzquota_decr_inodes(&qmblk->dq_stat, number); ++#ifdef CONFIG_VZ_QUOTA_UGID ++ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { ++ qugid = INODE_QLNK(inode)->qugid[cnt]; ++ if (qugid == NULL || qugid == VZ_QUOTA_UGBAD) ++ continue; ++ vzquota_decr_inodes(&qugid->qugid_stat, number); ++ } ++#endif ++ vzquota_data_unlock((struct inode *)inode, &data); ++ } ++ might_sleep(); ++ return QUOTA_OK; ++} ++ ++void vzquota_inode_off(struct inode * inode) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_datast data; ++ ++ /* The call is made through virtinfo, it can be an inode ++ * not controlled by vzquota. ++ */ ++ if (inode->i_sb->dq_op != &vz_quota_operations) ++ return; ++ ++ qmblk = vzquota_inode_data(inode, &data); ++ if (qmblk == VZ_QUOTA_BAD) ++ return; ++ ++ if (qmblk == NULL) { ++ /* Tricky place. If qmblk == NULL, it means that this inode ++ * is not in area controlled by vzquota (except for rare ++ * case of already set S_NOQUOTA). But we have to set ++ * S_NOQUOTA in any case because vzquota can be turned ++ * on later, when this inode is invalid from viewpoint ++ * of vzquota. ++ * ++ * To be safe, we reacquire vzquota lock. ++ */ ++ inode_qmblk_lock(inode->i_sb); ++ inode->i_flags |= S_NOQUOTA; ++ inode_qmblk_unlock(inode->i_sb); ++ return; ++ } else { ++ loff_t bytes = inode_get_bytes(inode); ++#ifdef CONFIG_VZ_QUOTA_UGID ++ int cnt; ++ struct vz_quota_ugid * qugid; ++#endif ++ ++ inode->i_flags |= S_NOQUOTA; ++ ++ vzquota_decr_space(&qmblk->dq_stat, bytes); ++ vzquota_decr_inodes(&qmblk->dq_stat, 1); ++#ifdef CONFIG_VZ_QUOTA_UGID ++ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { ++ qugid = INODE_QLNK(inode)->qugid[cnt]; ++ if (qugid == NULL || qugid == VZ_QUOTA_UGBAD) ++ continue; ++ vzquota_decr_space(&qugid->qugid_stat, bytes); ++ vzquota_decr_inodes(&qugid->qugid_stat, 1); ++ } ++#endif ++ ++ vzquota_data_unlock(inode, &data); ++ ++ vzquota_inode_drop_call(inode); ++ } ++} ++ ++ ++#ifdef CONFIG_VZ_QUOTA_UGID ++ ++/* ++ * helper function for quota_transfer ++ * check that we can add inode to this quota_id ++ */ ++static int vzquota_transfer_check(struct vz_quota_master *qmblk, ++ struct vz_quota_ugid *qugid[], ++ unsigned int type, __u64 size) ++{ ++ if (vzquota_check_ugid_space(qmblk, qugid, type, size, 0) != QUOTA_OK || ++ vzquota_check_ugid_inodes(qmblk, qugid, type, 1) != QUOTA_OK) ++ return -1; ++ return 0; ++} ++ ++int vzquota_transfer_usage(struct inode *inode, ++ int mask, ++ struct vz_quota_ilink *qlnk) ++{ ++ struct vz_quota_ugid *qugid_old; ++ __u64 space; ++ int i; ++ ++ space = inode_get_bytes(inode); ++ for (i = 0; i < MAXQUOTAS; i++) { ++ if (!(mask & (1 << i))) ++ continue; ++ /* ++ * Do not permit chown a file if its owner does not have ++ * ugid record. This might happen if we somehow exceeded ++ * the UID/GID (e.g. set uglimit less than number of users). ++ */ ++ if (INODE_QLNK(inode)->qugid[i] == VZ_QUOTA_UGBAD) ++ return -1; ++ if (vzquota_transfer_check(qlnk->qmblk, qlnk->qugid, i, space)) ++ return -1; ++ } ++ ++ for (i = 0; i < MAXQUOTAS; i++) { ++ if (!(mask & (1 << i))) ++ continue; ++ qugid_old = INODE_QLNK(inode)->qugid[i]; ++ vzquota_decr_space(&qugid_old->qugid_stat, space); ++ vzquota_decr_inodes(&qugid_old->qugid_stat, 1); ++ vzquota_incr_space(&qlnk->qugid[i]->qugid_stat, space); ++ vzquota_incr_inodes(&qlnk->qugid[i]->qugid_stat, 1); ++ } ++ return 0; ++} ++ ++/* ++ * Transfer the inode between diffent user/group quotas. ++ */ ++static int vzquota_transfer(struct inode *inode, struct iattr *iattr) ++{ ++ return vzquota_inode_transfer_call(inode, iattr) ? ++ NO_QUOTA : QUOTA_OK; ++} ++ ++#else /* CONFIG_VZ_QUOTA_UGID */ ++ ++static int vzquota_transfer(struct inode *inode, struct iattr *iattr) ++{ ++ return QUOTA_OK; ++} ++ ++#endif ++ ++/* ++ * Called under following semaphores: ++ * old_d->d_inode->i_sb->s_vfs_rename_sem ++ * old_d->d_inode->i_sem ++ * new_d->d_inode->i_sem ++ * [not verified --SAW] ++ */ ++static int vzquota_rename(struct inode *inode, ++ struct inode *old_dir, struct inode *new_dir) ++{ ++ return vzquota_rename_check(inode, old_dir, new_dir) ? ++ NO_QUOTA : QUOTA_OK; ++} ++ ++/* ++ * Structure of superblock diskquota operations. ++ */ ++struct dquot_operations vz_quota_operations = { ++ .initialize = vzquota_initialize, ++ .drop = vzquota_drop, ++ .alloc_space = vzquota_alloc_space, ++ .alloc_inode = vzquota_alloc_inode, ++ .free_space = vzquota_free_space, ++ .free_inode = vzquota_free_inode, ++ .transfer = vzquota_transfer, ++ .rename = vzquota_rename, ++}; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/vzdq_tree.c debian/binary-custom.d/openvz/src/fs/vzdq_tree.c +--- ./fs/vzdq_tree.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/fs/vzdq_tree.c 2012-11-13 15:20:14.296569106 +0000 +@@ -0,0 +1,286 @@ ++/* ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * This file contains Virtuozzo quota tree implementation ++ */ ++ ++#include ++#include ++#include ++ ++struct quotatree_tree *quotatree_alloc(void) ++{ ++ int l; ++ struct quotatree_tree *tree; ++ ++ tree = kmalloc(sizeof(struct quotatree_tree), GFP_KERNEL); ++ if (tree == NULL) ++ goto out; ++ ++ for (l = 0; l < QUOTATREE_DEPTH; l++) { ++ INIT_LIST_HEAD(&tree->levels[l].usedlh); ++ INIT_LIST_HEAD(&tree->levels[l].freelh); ++ tree->levels[l].freenum = 0; ++ } ++ tree->root = NULL; ++ tree->leaf_num = 0; ++out: ++ return tree; ++} ++ ++static struct quotatree_node * ++quotatree_follow(struct quotatree_tree *tree, quotaid_t id, int level, ++ struct quotatree_find_state *st) ++{ ++ void **block; ++ struct quotatree_node *parent; ++ int l, index; ++ ++ parent = NULL; ++ block = (void **)&tree->root; ++ l = 0; ++ while (l < level && *block != NULL) { ++ index = (id >> QUOTATREE_BSHIFT(l)) & QUOTATREE_BMASK; ++ parent = *block; ++ block = parent->blocks + index; ++ l++; ++ } ++ if (st != NULL) { ++ st->block = block; ++ st->level = l; ++ } ++ ++ return parent; ++} ++ ++void *quotatree_find(struct quotatree_tree *tree, quotaid_t id, ++ struct quotatree_find_state *st) ++{ ++ quotatree_follow(tree, id, QUOTATREE_DEPTH, st); ++ if (st->level == QUOTATREE_DEPTH) ++ return *st->block; ++ else ++ return NULL; ++} ++ ++void *quotatree_leaf_byindex(struct quotatree_tree *tree, unsigned int index) ++{ ++ int i, count; ++ struct quotatree_node *p; ++ void *leaf; ++ ++ if (QTREE_LEAFNUM(tree) <= index) ++ return NULL; ++ ++ count = 0; ++ list_for_each_entry(p, &QTREE_LEAFLVL(tree)->usedlh, list) { ++ for (i = 0; i < QUOTATREE_BSIZE; i++) { ++ leaf = p->blocks[i]; ++ if (leaf == NULL) ++ continue; ++ if (count == index) ++ return leaf; ++ count++; ++ } ++ } ++ return NULL; ++} ++ ++/* returns data leaf (vz_quota_ugid) after _existent_ ugid (@id) ++ * in the tree... */ ++void *quotatree_get_next(struct quotatree_tree *tree, quotaid_t id) ++{ ++ int off; ++ struct quotatree_node *parent, *p; ++ struct list_head *lh; ++ ++ /* get parent refering correct quota tree node of the last level */ ++ parent = quotatree_follow(tree, id, QUOTATREE_DEPTH, NULL); ++ if (!parent) ++ return NULL; ++ ++ off = (id & QUOTATREE_BMASK) + 1; /* next ugid */ ++ lh = &parent->list; ++ do { ++ p = list_entry(lh, struct quotatree_node, list); ++ for ( ; off < QUOTATREE_BSIZE; off++) ++ if (p->blocks[off]) ++ return p->blocks[off]; ++ off = 0; ++ lh = lh->next; ++ } while (lh != &QTREE_LEAFLVL(tree)->usedlh); ++ ++ return NULL; ++} ++ ++int quotatree_insert(struct quotatree_tree *tree, quotaid_t id, ++ struct quotatree_find_state *st, void *data) ++{ ++ struct quotatree_node *p; ++ int l, index; ++ ++ while (st->level < QUOTATREE_DEPTH) { ++ l = st->level; ++ if (!list_empty(&tree->levels[l].freelh)) { ++ p = list_entry(tree->levels[l].freelh.next, ++ struct quotatree_node, list); ++ list_del(&p->list); ++ } else { ++ p = kmalloc(sizeof(struct quotatree_node), GFP_NOFS | __GFP_NOFAIL); ++ if (p == NULL) ++ return -ENOMEM; ++ /* save block number in the l-level ++ * it uses for quota file generation */ ++ p->num = tree->levels[l].freenum++; ++ } ++ list_add(&p->list, &tree->levels[l].usedlh); ++ memset(p->blocks, 0, sizeof(p->blocks)); ++ *st->block = p; ++ ++ index = (id >> QUOTATREE_BSHIFT(l)) & QUOTATREE_BMASK; ++ st->block = p->blocks + index; ++ st->level++; ++ } ++ tree->leaf_num++; ++ *st->block = data; ++ ++ return 0; ++} ++ ++static struct quotatree_node * ++quotatree_remove_ptr(struct quotatree_tree *tree, quotaid_t id, ++ int level) ++{ ++ struct quotatree_node *parent; ++ struct quotatree_find_state st; ++ ++ parent = quotatree_follow(tree, id, level, &st); ++ if (st.level == QUOTATREE_DEPTH) ++ tree->leaf_num--; ++ *st.block = NULL; ++ return parent; ++} ++ ++void quotatree_remove(struct quotatree_tree *tree, quotaid_t id) ++{ ++ struct quotatree_node *p; ++ int level, i; ++ ++ p = quotatree_remove_ptr(tree, id, QUOTATREE_DEPTH); ++ for (level = QUOTATREE_DEPTH - 1; level >= QUOTATREE_CDEPTH; level--) { ++ for (i = 0; i < QUOTATREE_BSIZE; i++) ++ if (p->blocks[i] != NULL) ++ return; ++ list_move(&p->list, &tree->levels[level].freelh); ++ p = quotatree_remove_ptr(tree, id, level); ++ } ++} ++ ++#if 0 ++static void quotatree_walk(struct quotatree_tree *tree, ++ struct quotatree_node *node_start, ++ quotaid_t id_start, ++ int level_start, int level_end, ++ int (*callback)(struct quotatree_tree *, ++ quotaid_t id, ++ int level, ++ void *ptr, ++ void *data), ++ void *data) ++{ ++ struct quotatree_node *p; ++ int l, shift, index; ++ quotaid_t id; ++ struct quotatree_find_state st; ++ ++ p = node_start; ++ l = level_start; ++ shift = (QUOTATREE_DEPTH - l) * QUOTAID_BBITS; ++ id = id_start; ++ index = 0; ++ ++ /* ++ * Invariants: ++ * shift == (QUOTATREE_DEPTH - l) * QUOTAID_BBITS; ++ * id & ((1 << shift) - 1) == 0 ++ * p is l-level node corresponding to id ++ */ ++ do { ++ if (!p) ++ break; ++ ++ if (l < level_end) { ++ for (; index < QUOTATREE_BSIZE; index++) ++ if (p->blocks[index] != NULL) ++ break; ++ if (index < QUOTATREE_BSIZE) { ++ /* descend */ ++ p = p->blocks[index]; ++ l++; ++ shift -= QUOTAID_BBITS; ++ id += (quotaid_t)index << shift; ++ index = 0; ++ continue; ++ } ++ } ++ ++ if ((*callback)(tree, id, l, p, data)) ++ break; ++ ++ /* ascend and to the next node */ ++ p = quotatree_follow(tree, id, l, &st); ++ ++ index = ((id >> shift) & QUOTATREE_BMASK) + 1; ++ l--; ++ shift += QUOTAID_BBITS; ++ id &= ~(((quotaid_t)1 << shift) - 1); ++ } while (l >= level_start); ++} ++#endif ++ ++static void free_list(struct list_head *node_list) ++{ ++ struct quotatree_node *p, *tmp; ++ ++ list_for_each_entry_safe(p, tmp, node_list, list) { ++ list_del(&p->list); ++ kfree(p); ++ } ++} ++ ++static inline void quotatree_free_nodes(struct quotatree_tree *tree) ++{ ++ int i; ++ ++ for (i = 0; i < QUOTATREE_DEPTH; i++) { ++ free_list(&tree->levels[i].usedlh); ++ free_list(&tree->levels[i].freelh); ++ } ++} ++ ++static void quotatree_free_leafs(struct quotatree_tree *tree, ++ void (*dtor)(void *)) ++{ ++ int i; ++ struct quotatree_node *p; ++ ++ list_for_each_entry(p, &QTREE_LEAFLVL(tree)->usedlh, list) { ++ for (i = 0; i < QUOTATREE_BSIZE; i++) { ++ if (p->blocks[i] == NULL) ++ continue; ++ ++ dtor(p->blocks[i]); ++ } ++ } ++} ++ ++void quotatree_free(struct quotatree_tree *tree, void (*dtor)(void *)) ++{ ++ quotatree_free_leafs(tree, dtor); ++ quotatree_free_nodes(tree); ++ kfree(tree); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/vzdq_ugid.c debian/binary-custom.d/openvz/src/fs/vzdq_ugid.c +--- ./fs/vzdq_ugid.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/fs/vzdq_ugid.c 2012-11-13 15:20:14.296569106 +0000 +@@ -0,0 +1,1221 @@ ++/* ++ * Copyright (C) 2002 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * This file contains Virtuozzo UID/GID disk quota implementation ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++/* ++ * XXX ++ * may be something is needed for sb->s_dquot->info[]? ++ */ ++ ++#define USRQUOTA_MASK (1 << USRQUOTA) ++#define GRPQUOTA_MASK (1 << GRPQUOTA) ++#define QTYPE2MASK(type) (1 << (type)) ++ ++static struct kmem_cache *vz_quota_ugid_cachep; ++ ++/* guard to protect vz_quota_master from destroy in quota_on/off. Also protects ++ * list on the hash table */ ++extern struct semaphore vz_quota_sem; ++ ++inline struct vz_quota_ugid *vzquota_get_ugid(struct vz_quota_ugid *qugid) ++{ ++ if (qugid != VZ_QUOTA_UGBAD) ++ atomic_inc(&qugid->qugid_count); ++ return qugid; ++} ++ ++/* we don't limit users with zero limits */ ++static inline int vzquota_fake_stat(struct dq_stat *stat) ++{ ++ return stat->bhardlimit == 0 && stat->bsoftlimit == 0 && ++ stat->ihardlimit == 0 && stat->isoftlimit == 0; ++} ++ ++/* callback function for quotatree_free() */ ++static inline void vzquota_free_qugid(void *ptr) ++{ ++ kmem_cache_free(vz_quota_ugid_cachep, ptr); ++} ++ ++/* ++ * destroy ugid, if it have zero refcount, limits and usage ++ * must be called under qmblk->dq_sem ++ */ ++void vzquota_put_ugid(struct vz_quota_master *qmblk, ++ struct vz_quota_ugid *qugid) ++{ ++ if (qugid == VZ_QUOTA_UGBAD) ++ return; ++ qmblk_data_read_lock(qmblk); ++ if (atomic_dec_and_test(&qugid->qugid_count) && ++ (qmblk->dq_flags & VZDQUG_FIXED_SET) == 0 && ++ vzquota_fake_stat(&qugid->qugid_stat) && ++ qugid->qugid_stat.bcurrent == 0 && ++ qugid->qugid_stat.icurrent == 0) { ++ quotatree_remove(QUGID_TREE(qmblk, qugid->qugid_type), ++ qugid->qugid_id); ++ qmblk->dq_ugid_count--; ++ vzquota_free_qugid(qugid); ++ } ++ qmblk_data_read_unlock(qmblk); ++} ++ ++/* ++ * Get ugid block by its index, like it would present in array. ++ * In reality, this is not array - this is leafs chain of the tree. ++ * NULL if index is out of range. ++ * qmblk semaphore is required to protect the tree. ++ */ ++static inline struct vz_quota_ugid * ++vzquota_get_byindex(struct vz_quota_master *qmblk, unsigned int index, int type) ++{ ++ return quotatree_leaf_byindex(QUGID_TREE(qmblk, type), index); ++} ++ ++/* ++ * get next element from ugid "virtual array" ++ * ugid must be in current array and this array may not be changed between ++ * two accesses (quaranteed by "stopped" quota state and quota semaphore) ++ * qmblk semaphore is required to protect the tree ++ */ ++static inline struct vz_quota_ugid * ++vzquota_get_next(struct vz_quota_master *qmblk, struct vz_quota_ugid *qugid) ++{ ++ return quotatree_get_next(QUGID_TREE(qmblk, qugid->qugid_type), ++ qugid->qugid_id); ++} ++ ++/* ++ * requires dq_sem ++ */ ++struct vz_quota_ugid *__vzquota_find_ugid(struct vz_quota_master *qmblk, ++ unsigned int quota_id, int type, int flags) ++{ ++ struct vz_quota_ugid *qugid; ++ struct quotatree_tree *tree; ++ struct quotatree_find_state st; ++ ++ tree = QUGID_TREE(qmblk, type); ++ qugid = quotatree_find(tree, quota_id, &st); ++ if (qugid) ++ goto success; ++ ++ /* caller does not want alloc */ ++ if (flags & VZDQUG_FIND_DONT_ALLOC) ++ goto fail; ++ ++ if (flags & VZDQUG_FIND_FAKE) ++ goto doit; ++ ++ /* check limit */ ++ if (qmblk->dq_ugid_count >= qmblk->dq_ugid_max) ++ goto fail; ++ ++ /* see comment at VZDQUG_FIXED_SET define */ ++ if (qmblk->dq_flags & VZDQUG_FIXED_SET) ++ goto fail; ++ ++doit: ++ /* alloc new structure */ ++ qugid = kmem_cache_alloc(vz_quota_ugid_cachep, ++ GFP_NOFS | __GFP_NOFAIL); ++ if (qugid == NULL) ++ goto fail; ++ ++ /* initialize new structure */ ++ qugid->qugid_id = quota_id; ++ memset(&qugid->qugid_stat, 0, sizeof(qugid->qugid_stat)); ++ qugid->qugid_type = type; ++ atomic_set(&qugid->qugid_count, 0); ++ ++ /* insert in tree */ ++ if (quotatree_insert(tree, quota_id, &st, qugid) < 0) ++ goto fail_insert; ++ qmblk->dq_ugid_count++; ++ ++success: ++ vzquota_get_ugid(qugid); ++ return qugid; ++ ++fail_insert: ++ vzquota_free_qugid(qugid); ++fail: ++ return VZ_QUOTA_UGBAD; ++} ++ ++/* ++ * takes dq_sem, may schedule ++ */ ++struct vz_quota_ugid *vzquota_find_ugid(struct vz_quota_master *qmblk, ++ unsigned int quota_id, int type, int flags) ++{ ++ struct vz_quota_ugid *qugid; ++ ++ down(&qmblk->dq_sem); ++ qugid = __vzquota_find_ugid(qmblk, quota_id, type, flags); ++ up(&qmblk->dq_sem); ++ ++ return qugid; ++} ++ ++/* ++ * destroy all ugid records on given quota master ++ */ ++void vzquota_kill_ugid(struct vz_quota_master *qmblk) ++{ ++ BUG_ON((qmblk->dq_gid_tree == NULL && qmblk->dq_uid_tree != NULL) || ++ (qmblk->dq_uid_tree == NULL && qmblk->dq_gid_tree != NULL)); ++ ++ if (qmblk->dq_uid_tree != NULL) { ++ quotatree_free(qmblk->dq_uid_tree, vzquota_free_qugid); ++ quotatree_free(qmblk->dq_gid_tree, vzquota_free_qugid); ++ } ++} ++ ++ ++/* ---------------------------------------------------------------------- ++ * Management interface to ugid quota for (super)users. ++ * --------------------------------------------------------------------- */ ++ ++static int vzquota_initialize2(struct inode *inode, int type) ++{ ++ return QUOTA_OK; ++} ++ ++static int vzquota_drop2(struct inode *inode) ++{ ++ return QUOTA_OK; ++} ++ ++static int vzquota_alloc_space2(struct inode *inode, ++ qsize_t number, int prealloc) ++{ ++ inode_add_bytes(inode, number); ++ return QUOTA_OK; ++} ++ ++static int vzquota_alloc_inode2(const struct inode *inode, unsigned long number) ++{ ++ return QUOTA_OK; ++} ++ ++static int vzquota_free_space2(struct inode *inode, qsize_t number) ++{ ++ inode_sub_bytes(inode, number); ++ return QUOTA_OK; ++} ++ ++static int vzquota_free_inode2(const struct inode *inode, unsigned long number) ++{ ++ return QUOTA_OK; ++} ++ ++static int vzquota_transfer2(struct inode *inode, struct iattr *iattr) ++{ ++ return QUOTA_OK; ++} ++ ++struct dquot_operations vz_quota_operations2 = { ++ .initialize = vzquota_initialize2, ++ .drop = vzquota_drop2, ++ .alloc_space = vzquota_alloc_space2, ++ .alloc_inode = vzquota_alloc_inode2, ++ .free_space = vzquota_free_space2, ++ .free_inode = vzquota_free_inode2, ++ .transfer = vzquota_transfer2, ++}; ++ ++ ++asmlinkage long sys_unlink(const char __user * pathname); ++asmlinkage long sys_rename(const char __user * oldname, ++ const char __user * newname); ++asmlinkage long sys_symlink(const char __user * oldname, ++ const char __user * newname); ++ ++/* called under sb->s_umount semaphore */ ++static int vz_restore_symlink(struct super_block *sb, char *path, int type) ++{ ++ mm_segment_t oldfs; ++ char *newpath; ++ char dest[64]; ++ const char *names[] = { ++ [USRQUOTA] "aquota.user", ++ [GRPQUOTA] "aquota.group" ++ }; ++ int err; ++ ++ newpath = kmalloc(strlen(path) + sizeof(".new"), GFP_KERNEL); ++ if (newpath == NULL) ++ return -ENOMEM; ++ ++ strcpy(newpath, path); ++ strcat(newpath, ".new"); ++ ++ sprintf(dest, "/proc/vz/vzaquota/%08x/%s", ++ new_encode_dev(sb->s_dev), names[type]); ++ ++ /* ++ * Lockdep will learn unneeded dependency while unlink(2): ++ * ->s_umount => ->i_mutex/1 => ->i_mutex ++ * Reverse dependency is, ++ * open_namei() => ->i_mutex => lookup_hash() => __lookup_hash() ++ * => ->lookup() \eq vzdq_aquotq_lookup() => find_qmblk_by_dev() ++ * => user_get_super() => ->s_umount ++ * ++ * However, first set of ->i_mutex'es belong to /, second to /proc . ++ * Right fix is to get rid of vz_restore_symlink(), of course. ++ */ ++ up_read(&sb->s_umount); ++ ++ oldfs = get_fs(); ++ set_fs(KERNEL_DS); ++ err = sys_unlink(newpath); ++ if (err < 0 && err != -ENOENT) ++ goto out_restore; ++ err = sys_symlink(dest, newpath); ++ if (err < 0) ++ goto out_restore; ++ err = sys_rename(newpath, path); ++out_restore: ++ set_fs(oldfs); ++ ++ down_read(&sb->s_umount); ++ /* umounted meanwhile? */ ++ if (err == 0 && !sb->s_root) ++ err = -ENODEV; ++ ++ kfree(newpath); ++ return err; ++} ++ ++/* called under sb->s_umount semaphore */ ++static int vz_quota_on(struct super_block *sb, int type, ++ int format_id, char *path) ++{ ++ struct vz_quota_master *qmblk; ++ int mask, mask2; ++ int err; ++ ++ qmblk = vzquota_find_qmblk(sb); ++ err = -ESRCH; ++ if (qmblk == NULL) ++ goto out; ++ err = -EIO; ++ if (qmblk == VZ_QUOTA_BAD) ++ goto out; ++ ++ err = vz_restore_symlink(sb, path, type); ++ if (err < 0) ++ goto out_put; ++ ++ down(&vz_quota_sem); ++ mask = 0; ++ mask2 = 0; ++ sb->dq_op = &vz_quota_operations2; ++ sb->s_qcop = &vz_quotactl_operations; ++ if (type == USRQUOTA) { ++ mask = DQUOT_USR_ENABLED; ++ mask2 = VZDQ_USRQUOTA; ++ } ++ if (type == GRPQUOTA) { ++ mask = DQUOT_GRP_ENABLED; ++ mask2 = VZDQ_GRPQUOTA; ++ } ++ err = -EBUSY; ++ if (qmblk->dq_flags & mask2) ++ goto out_sem; ++ ++ err = 0; ++ qmblk->dq_flags |= mask2; ++ sb->s_dquot.flags |= mask; ++ ++out_sem: ++ up(&vz_quota_sem); ++out_put: ++ qmblk_put(qmblk); ++out: ++ return err; ++} ++ ++static int vz_quota_off(struct super_block *sb, int type) ++{ ++ struct vz_quota_master *qmblk; ++ int mask2; ++ int err; ++ ++ qmblk = vzquota_find_qmblk(sb); ++ down(&vz_quota_sem); ++ err = -ESRCH; ++ if (qmblk == NULL) ++ goto out; ++ err = -EIO; ++ if (qmblk == VZ_QUOTA_BAD) ++ goto out; ++ ++ mask2 = 0; ++ if (type == USRQUOTA) ++ mask2 = VZDQ_USRQUOTA; ++ if (type == GRPQUOTA) ++ mask2 = VZDQ_GRPQUOTA; ++ err = -EINVAL; ++ if (!(qmblk->dq_flags & mask2)) ++ goto out; ++ ++ qmblk->dq_flags &= ~mask2; ++ err = 0; ++ ++out: ++ up(&vz_quota_sem); ++ if (qmblk != NULL && qmblk != VZ_QUOTA_BAD) ++ qmblk_put(qmblk); ++ return err; ++} ++ ++static int vz_quota_sync(struct super_block *sb, int type) ++{ ++ return 0; /* vz quota is always uptodate */ ++} ++ ++static int vz_get_dqblk(struct super_block *sb, int type, ++ qid_t id, struct if_dqblk *di) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ugid *ugid; ++ int err; ++ ++ qmblk = vzquota_find_qmblk(sb); ++ down(&vz_quota_sem); ++ err = -ESRCH; ++ if (qmblk == NULL) ++ goto out; ++ err = -EIO; ++ if (qmblk == VZ_QUOTA_BAD) ++ goto out; ++ ++ err = 0; ++ ugid = vzquota_find_ugid(qmblk, id, type, VZDQUG_FIND_DONT_ALLOC); ++ if (ugid != VZ_QUOTA_UGBAD) { ++ qmblk_data_read_lock(qmblk); ++ di->dqb_bhardlimit = ugid->qugid_stat.bhardlimit >> 10; ++ di->dqb_bsoftlimit = ugid->qugid_stat.bsoftlimit >> 10; ++ di->dqb_curspace = ugid->qugid_stat.bcurrent; ++ di->dqb_ihardlimit = ugid->qugid_stat.ihardlimit; ++ di->dqb_isoftlimit = ugid->qugid_stat.isoftlimit; ++ di->dqb_curinodes = ugid->qugid_stat.icurrent; ++ di->dqb_btime = ugid->qugid_stat.btime; ++ di->dqb_itime = ugid->qugid_stat.itime; ++ qmblk_data_read_unlock(qmblk); ++ di->dqb_valid = QIF_ALL; ++ vzquota_put_ugid(qmblk, ugid); ++ } else { ++ memset(di, 0, sizeof(*di)); ++ di->dqb_valid = QIF_ALL; ++ } ++ ++out: ++ up(&vz_quota_sem); ++ if (qmblk != NULL && qmblk != VZ_QUOTA_BAD) ++ qmblk_put(qmblk); ++ return err; ++} ++ ++/* must be called under vz_quota_sem */ ++static int __vz_set_dqblk(struct vz_quota_master *qmblk, ++ int type, qid_t id, struct if_dqblk *di) ++{ ++ struct vz_quota_ugid *ugid; ++ ++ ugid = vzquota_find_ugid(qmblk, id, type, 0); ++ if (ugid == VZ_QUOTA_UGBAD) ++ return -ESRCH; ++ ++ qmblk_data_write_lock(qmblk); ++ /* ++ * Subtle compatibility breakage. ++ * ++ * Some old non-vz kernel quota didn't start grace period ++ * if the new soft limit happens to be below the usage. ++ * Non-vz kernel quota in 2.4.20 starts the grace period ++ * (if it hasn't been started). ++ * Current non-vz kernel performs even more complicated ++ * manipulations... ++ * ++ * Also, current non-vz kernels have inconsistency related to ++ * the grace time start. In regular operations the grace period ++ * is started if the usage is greater than the soft limit (and, ++ * strangely, is cancelled if the usage is less). ++ * However, set_dqblk starts the grace period if the usage is greater ++ * or equal to the soft limit. ++ * ++ * Here we try to mimic the behavior of the current non-vz kernel. ++ */ ++ if (di->dqb_valid & QIF_BLIMITS) { ++ ugid->qugid_stat.bhardlimit = ++ (__u64)di->dqb_bhardlimit << 10; ++ ugid->qugid_stat.bsoftlimit = ++ (__u64)di->dqb_bsoftlimit << 10; ++ if (di->dqb_bsoftlimit == 0 || ++ ugid->qugid_stat.bcurrent < ugid->qugid_stat.bsoftlimit) ++ ugid->qugid_stat.btime = 0; ++ else if (!(di->dqb_valid & QIF_BTIME)) ++ ugid->qugid_stat.btime = CURRENT_TIME_SECONDS ++ + qmblk->dq_ugid_info[type].bexpire; ++ else ++ ugid->qugid_stat.btime = di->dqb_btime; ++ } ++ if (di->dqb_valid & QIF_ILIMITS) { ++ ugid->qugid_stat.ihardlimit = di->dqb_ihardlimit; ++ ugid->qugid_stat.isoftlimit = di->dqb_isoftlimit; ++ if (di->dqb_isoftlimit == 0 || ++ ugid->qugid_stat.icurrent < ugid->qugid_stat.isoftlimit) ++ ugid->qugid_stat.itime = 0; ++ else if (!(di->dqb_valid & QIF_ITIME)) ++ ugid->qugid_stat.itime = CURRENT_TIME_SECONDS ++ + qmblk->dq_ugid_info[type].iexpire; ++ else ++ ugid->qugid_stat.itime = di->dqb_itime; ++ } ++ qmblk_data_write_unlock(qmblk); ++ vzquota_put_ugid(qmblk, ugid); ++ ++ return 0; ++} ++ ++static int vz_set_dqblk(struct super_block *sb, int type, ++ qid_t id, struct if_dqblk *di) ++{ ++ struct vz_quota_master *qmblk; ++ int err; ++ ++ qmblk = vzquota_find_qmblk(sb); ++ down(&vz_quota_sem); ++ err = -ESRCH; ++ if (qmblk == NULL) ++ goto out; ++ err = -EIO; ++ if (qmblk == VZ_QUOTA_BAD) ++ goto out; ++ err = __vz_set_dqblk(qmblk, type, id, di); ++out: ++ up(&vz_quota_sem); ++ if (qmblk != NULL && qmblk != VZ_QUOTA_BAD) ++ qmblk_put(qmblk); ++ return err; ++} ++ ++static int vz_get_dqinfo(struct super_block *sb, int type, ++ struct if_dqinfo *ii) ++{ ++ struct vz_quota_master *qmblk; ++ int err; ++ ++ qmblk = vzquota_find_qmblk(sb); ++ down(&vz_quota_sem); ++ err = -ESRCH; ++ if (qmblk == NULL) ++ goto out; ++ err = -EIO; ++ if (qmblk == VZ_QUOTA_BAD) ++ goto out; ++ ++ err = 0; ++ ii->dqi_bgrace = qmblk->dq_ugid_info[type].bexpire; ++ ii->dqi_igrace = qmblk->dq_ugid_info[type].iexpire; ++ ii->dqi_flags = 0; ++ ii->dqi_valid = IIF_ALL; ++ ++out: ++ up(&vz_quota_sem); ++ if (qmblk != NULL && qmblk != VZ_QUOTA_BAD) ++ qmblk_put(qmblk); ++ return err; ++} ++ ++/* must be called under vz_quota_sem */ ++static int __vz_set_dqinfo(struct vz_quota_master *qmblk, ++ int type, struct if_dqinfo *ii) ++{ ++ if (ii->dqi_valid & IIF_FLAGS) ++ if (ii->dqi_flags & DQF_MASK) ++ return -EINVAL; ++ ++ if (ii->dqi_valid & IIF_BGRACE) ++ qmblk->dq_ugid_info[type].bexpire = ii->dqi_bgrace; ++ if (ii->dqi_valid & IIF_IGRACE) ++ qmblk->dq_ugid_info[type].iexpire = ii->dqi_igrace; ++ return 0; ++} ++ ++static int vz_set_dqinfo(struct super_block *sb, int type, ++ struct if_dqinfo *ii) ++{ ++ struct vz_quota_master *qmblk; ++ int err; ++ ++ qmblk = vzquota_find_qmblk(sb); ++ down(&vz_quota_sem); ++ err = -ESRCH; ++ if (qmblk == NULL) ++ goto out; ++ err = -EIO; ++ if (qmblk == VZ_QUOTA_BAD) ++ goto out; ++ err = __vz_set_dqinfo(qmblk, type, ii); ++out: ++ up(&vz_quota_sem); ++ if (qmblk != NULL && qmblk != VZ_QUOTA_BAD) ++ qmblk_put(qmblk); ++ return err; ++} ++ ++#ifdef CONFIG_QUOTA_COMPAT ++ ++#define Q_GETQUOTI_SIZE 1024 ++ ++#define UGID2DQBLK(dst, src) \ ++ do { \ ++ (dst)->dqb_ihardlimit = (src)->qugid_stat.ihardlimit; \ ++ (dst)->dqb_isoftlimit = (src)->qugid_stat.isoftlimit; \ ++ (dst)->dqb_curinodes = (src)->qugid_stat.icurrent; \ ++ /* in 1K blocks */ \ ++ (dst)->dqb_bhardlimit = (src)->qugid_stat.bhardlimit >> 10; \ ++ /* in 1K blocks */ \ ++ (dst)->dqb_bsoftlimit = (src)->qugid_stat.bsoftlimit >> 10; \ ++ /* in bytes, 64 bit */ \ ++ (dst)->dqb_curspace = (src)->qugid_stat.bcurrent; \ ++ (dst)->dqb_btime = (src)->qugid_stat.btime; \ ++ (dst)->dqb_itime = (src)->qugid_stat.itime; \ ++ } while (0) ++ ++static int vz_get_quoti(struct super_block *sb, int type, qid_t idx, ++ struct v2_disk_dqblk __user *dqblk) ++{ ++ struct vz_quota_master *qmblk; ++ struct v2_disk_dqblk *data, *kbuf; ++ struct vz_quota_ugid *ugid; ++ int count; ++ int err; ++ ++ qmblk = vzquota_find_qmblk(sb); ++ err = -ESRCH; ++ if (qmblk == NULL) ++ goto out; ++ err = -EIO; ++ if (qmblk == VZ_QUOTA_BAD) ++ goto out; ++ ++ err = -ENOMEM; ++ kbuf = vmalloc(Q_GETQUOTI_SIZE * sizeof(*kbuf)); ++ if (!kbuf) ++ goto out; ++ ++ down(&vz_quota_sem); ++ down(&qmblk->dq_sem); ++ for (ugid = vzquota_get_byindex(qmblk, idx, type), count = 0; ++ ugid != NULL && count < Q_GETQUOTI_SIZE; ++ count++) ++ { ++ data = kbuf + count; ++ qmblk_data_read_lock(qmblk); ++ UGID2DQBLK(data, ugid); ++ qmblk_data_read_unlock(qmblk); ++ data->dqb_id = ugid->qugid_id; ++ ++ /* Find next entry */ ++ ugid = vzquota_get_next(qmblk, ugid); ++ BUG_ON(ugid != NULL && ugid->qugid_type != type); ++ } ++ up(&qmblk->dq_sem); ++ up(&vz_quota_sem); ++ ++ err = count; ++ if (copy_to_user(dqblk, kbuf, count * sizeof(*kbuf))) ++ err = -EFAULT; ++ ++ vfree(kbuf); ++out: ++ if (qmblk != NULL && qmblk != VZ_QUOTA_BAD) ++ qmblk_put(qmblk); ++ ++ return err; ++} ++ ++#endif ++ ++struct quotactl_ops vz_quotactl_operations = { ++ .quota_on = vz_quota_on, ++ .quota_off = vz_quota_off, ++ .quota_sync = vz_quota_sync, ++ .get_info = vz_get_dqinfo, ++ .set_info = vz_set_dqinfo, ++ .get_dqblk = vz_get_dqblk, ++ .set_dqblk = vz_set_dqblk, ++#ifdef CONFIG_QUOTA_COMPAT ++ .get_quoti = vz_get_quoti, ++#endif ++}; ++ ++ ++/* ---------------------------------------------------------------------- ++ * Management interface for host system admins. ++ * --------------------------------------------------------------------- */ ++ ++static int quota_ugid_addstat(unsigned int quota_id, unsigned int ugid_size, ++ struct vz_quota_iface __user *u_ugid_buf, int compat) ++{ ++ struct vz_quota_master *qmblk; ++ int ret; ++ ++ down(&vz_quota_sem); ++ ++ ret = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ ret = -EBUSY; ++ if (qmblk->dq_state != VZDQ_STARTING) ++ goto out; /* working quota doesn't accept new ugids */ ++ ++ ret = 0; ++ /* start to add ugids */ ++ for (ret = 0; ret < ugid_size; ret++) { ++ struct vz_quota_iface ugid_buf; ++ struct vz_quota_ugid *ugid; ++ ++ if (!compat) { ++ if (copy_from_user(&ugid_buf, u_ugid_buf, ++ sizeof(ugid_buf))) ++ break; ++ u_ugid_buf++; /* next user buffer */ ++ } else { ++#ifdef CONFIG_COMPAT ++ struct compat_vz_quota_iface oqif; ++ if (copy_from_user(&oqif, u_ugid_buf, ++ sizeof(oqif))) ++ break; ++ ugid_buf.qi_id = oqif.qi_id; ++ ugid_buf.qi_type = oqif.qi_type; ++ compat_dqstat2dqstat(&oqif.qi_stat, &ugid_buf.qi_stat); ++ u_ugid_buf = (struct vz_quota_iface __user *) ++ (((void *)u_ugid_buf) + sizeof(oqif)); ++#endif ++ } ++ ++ if (ugid_buf.qi_type >= MAXQUOTAS) ++ break; /* bad quota type - this is the only check */ ++ ++ ugid = vzquota_find_ugid(qmblk, ++ ugid_buf.qi_id, ugid_buf.qi_type, 0); ++ if (ugid == VZ_QUOTA_UGBAD) { ++ qmblk->dq_flags |= VZDQUG_FIXED_SET; ++ break; /* limit reached */ ++ } ++ ++ /* update usage/limits ++ * we can copy the data without the lock, because the data ++ * cannot be modified in VZDQ_STARTING state */ ++ ugid->qugid_stat = ugid_buf.qi_stat; ++ ++ vzquota_put_ugid(qmblk, ugid); ++ } ++out: ++ up(&vz_quota_sem); ++ ++ return ret; ++} ++ ++static int quota_ugid_setgrace(unsigned int quota_id, ++ struct dq_info __user u_dq_info[], int compat) ++{ ++ struct vz_quota_master *qmblk; ++ struct dq_info dq_info[MAXQUOTAS]; ++ struct dq_info *target; ++ int err, type; ++ ++ down(&vz_quota_sem); ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = -EBUSY; ++ if (qmblk->dq_state != VZDQ_STARTING) ++ goto out; /* working quota doesn't accept changing options */ ++ ++ err = -EFAULT; ++ if (!compat) { ++ if (copy_from_user(dq_info, u_dq_info, sizeof(dq_info))) ++ goto out; ++ } else { ++#ifdef CONFIG_COMPAT ++ struct compat_dq_info odqi[MAXQUOTAS]; ++ if (copy_from_user(odqi, u_dq_info, sizeof(odqi))) ++ goto out; ++ for (type = 0; type < MAXQUOTAS; type++) ++ compat_dqinfo2dqinfo(&odqi[type], &dq_info[type]); ++#endif ++ } ++ ++ err = 0; ++ ++ /* update in qmblk */ ++ for (type = 0; type < MAXQUOTAS; type++) { ++ target = &qmblk->dq_ugid_info[type]; ++ target->bexpire = dq_info[type].bexpire; ++ target->iexpire = dq_info[type].iexpire; ++ } ++out: ++ up(&vz_quota_sem); ++ ++ return err; ++} ++ ++static int do_quota_ugid_getstat(struct vz_quota_master *qmblk, int index, int size, ++ struct vz_quota_iface *u_ugid_buf) ++{ ++ int type, count; ++ struct vz_quota_ugid *ugid; ++ ++ if (QTREE_LEAFNUM(qmblk->dq_uid_tree) + ++ QTREE_LEAFNUM(qmblk->dq_gid_tree) ++ <= index) ++ return 0; ++ ++ count = 0; ++ ++ type = index < QTREE_LEAFNUM(qmblk->dq_uid_tree) ? USRQUOTA : GRPQUOTA; ++ if (type == GRPQUOTA) ++ index -= QTREE_LEAFNUM(qmblk->dq_uid_tree); ++ ++ /* loop through ugid and then qgid quota */ ++repeat: ++ for (ugid = vzquota_get_byindex(qmblk, index, type); ++ ugid != NULL && count < size; ++ ugid = vzquota_get_next(qmblk, ugid), count++) ++ { ++ struct vz_quota_iface ugid_buf; ++ ++ /* form interface buffer and send in to user-level */ ++ qmblk_data_read_lock(qmblk); ++ memcpy(&ugid_buf.qi_stat, &ugid->qugid_stat, ++ sizeof(ugid_buf.qi_stat)); ++ qmblk_data_read_unlock(qmblk); ++ ugid_buf.qi_id = ugid->qugid_id; ++ ugid_buf.qi_type = ugid->qugid_type; ++ ++ memcpy(u_ugid_buf, &ugid_buf, sizeof(ugid_buf)); ++ u_ugid_buf++; /* next portion of user buffer */ ++ } ++ ++ if (type == USRQUOTA && count < size) { ++ type = GRPQUOTA; ++ index = 0; ++ goto repeat; ++ } ++ ++ return count; ++} ++ ++static int quota_ugid_getstat(unsigned int quota_id, ++ int index, int size, struct vz_quota_iface __user *u_ugid_buf, ++ int compat) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_iface *k_ugid_buf; ++ int err; ++ ++ if (index < 0 || size < 0) ++ return -EINVAL; ++ ++ if (size > INT_MAX / sizeof(struct vz_quota_iface)) ++ return -EINVAL; ++ ++ k_ugid_buf = vmalloc(size * sizeof(struct vz_quota_iface)); ++ if (k_ugid_buf == NULL) ++ return -ENOMEM; ++ ++ down(&vz_quota_sem); ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ down(&qmblk->dq_sem); ++ err = do_quota_ugid_getstat(qmblk, index, size, k_ugid_buf); ++ up(&qmblk->dq_sem); ++ if (err < 0) ++ goto out; ++ ++ if (!compat) { ++ if (copy_to_user(u_ugid_buf, k_ugid_buf, ++ err * sizeof(struct vz_quota_iface))) ++ err = -EFAULT; ++ } else { ++#ifdef CONFIG_COMPAT ++ struct compat_vz_quota_iface oqif; ++ int i; ++ for (i = 0; i < err; i++) { ++ oqif.qi_id = k_ugid_buf[i].qi_id; ++ oqif.qi_type = k_ugid_buf[i].qi_type; ++ dqstat2compat_dqstat(&k_ugid_buf[i].qi_stat, ++ &oqif.qi_stat); ++ if (copy_to_user(u_ugid_buf, &oqif, sizeof(oqif))) ++ err = -EFAULT; ++ u_ugid_buf = (struct vz_quota_iface __user *) ++ (((void *)u_ugid_buf) + sizeof(oqif)); ++ } ++#endif ++ } ++ ++out: ++ up(&vz_quota_sem); ++ vfree(k_ugid_buf); ++ return err; ++} ++ ++static int quota_ugid_getgrace(unsigned int quota_id, ++ struct dq_info __user u_dq_info[], int compat) ++{ ++ struct vz_quota_master *qmblk; ++ struct dq_info dq_info[MAXQUOTAS]; ++ struct dq_info *target; ++ int err, type; ++ ++ down(&vz_quota_sem); ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = 0; ++ /* update from qmblk */ ++ for (type = 0; type < MAXQUOTAS; type ++) { ++ target = &qmblk->dq_ugid_info[type]; ++ dq_info[type].bexpire = target->bexpire; ++ dq_info[type].iexpire = target->iexpire; ++ dq_info[type].flags = target->flags; ++ } ++ ++ if (!compat) { ++ if (copy_to_user(u_dq_info, dq_info, sizeof(dq_info))) ++ err = -EFAULT; ++ } else { ++#ifdef CONFIG_COMPAT ++ struct compat_dq_info odqi[MAXQUOTAS]; ++ for (type = 0; type < MAXQUOTAS; type ++) ++ dqinfo2compat_dqinfo(&dq_info[type], &odqi[type]); ++ if (copy_to_user(u_dq_info, odqi, sizeof(odqi))) ++ err = -EFAULT; ++#endif ++ } ++out: ++ up(&vz_quota_sem); ++ ++ return err; ++} ++ ++static int quota_ugid_getconfig(unsigned int quota_id, ++ struct vz_quota_ugid_stat __user *info) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ugid_stat kinfo; ++ int err; ++ ++ down(&vz_quota_sem); ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = 0; ++ kinfo.limit = qmblk->dq_ugid_max; ++ kinfo.count = qmblk->dq_ugid_count; ++ kinfo.flags = qmblk->dq_flags; ++ ++ if (copy_to_user(info, &kinfo, sizeof(kinfo))) ++ err = -EFAULT; ++out: ++ up(&vz_quota_sem); ++ ++ return err; ++} ++ ++static int quota_ugid_setconfig(unsigned int quota_id, ++ struct vz_quota_ugid_stat __user *info) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ugid_stat kinfo; ++ int err; ++ ++ down(&vz_quota_sem); ++ ++ err = -ENOENT; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = -EFAULT; ++ if (copy_from_user(&kinfo, info, sizeof(kinfo))) ++ goto out; ++ ++ err = 0; ++ qmblk->dq_ugid_max = kinfo.limit; ++ if (qmblk->dq_state == VZDQ_STARTING) { ++ qmblk->dq_flags = kinfo.flags; ++ if (qmblk->dq_flags & VZDQUG_ON) ++ qmblk->dq_flags |= VZDQ_USRQUOTA | VZDQ_GRPQUOTA; ++ } ++ ++out: ++ up(&vz_quota_sem); ++ ++ return err; ++} ++ ++static int quota_ugid_setlimit(unsigned int quota_id, ++ struct vz_quota_ugid_setlimit __user *u_lim) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ugid_setlimit lim; ++ int err; ++ ++ down(&vz_quota_sem); ++ ++ err = -ESRCH; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = -EFAULT; ++ if (copy_from_user(&lim, u_lim, sizeof(lim))) ++ goto out; ++ ++ err = __vz_set_dqblk(qmblk, lim.type, lim.id, &lim.dqb); ++ ++out: ++ up(&vz_quota_sem); ++ ++ return err; ++} ++ ++static int quota_ugid_setinfo(unsigned int quota_id, ++ struct vz_quota_ugid_setinfo __user *u_info) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ugid_setinfo info; ++ int err; ++ ++ down(&vz_quota_sem); ++ ++ err = -ESRCH; ++ qmblk = vzquota_find_master(quota_id); ++ if (qmblk == NULL) ++ goto out; ++ ++ err = -EFAULT; ++ if (copy_from_user(&info, u_info, sizeof(info))) ++ goto out; ++ ++ err = __vz_set_dqinfo(qmblk, info.type, &info.dqi); ++ ++out: ++ up(&vz_quota_sem); ++ ++ return err; ++} ++ ++/* ++ * This is a system call to maintain UGID quotas ++ * Note this call is allowed to run ONLY from VE0 ++ */ ++long do_vzquotaugidctl(int cmd, unsigned int quota_id, ++ unsigned int ugid_index, unsigned int ugid_size, ++ void *addr, int compat) ++{ ++ int ret; ++ ++ ret = -EPERM; ++ /* access allowed only from root of VE0 */ ++ if (!capable(CAP_SYS_RESOURCE) || ++ !capable(CAP_SYS_ADMIN)) ++ goto out; ++ ++ switch (cmd) { ++ case VZ_DQ_UGID_GETSTAT: ++ ret = quota_ugid_getstat(quota_id, ++ ugid_index, ugid_size, ++ (struct vz_quota_iface __user *)addr, ++ compat); ++ break; ++ case VZ_DQ_UGID_ADDSTAT: ++ ret = quota_ugid_addstat(quota_id, ugid_size, ++ (struct vz_quota_iface __user *) addr, ++ compat); ++ break; ++ case VZ_DQ_UGID_GETGRACE: ++ ret = quota_ugid_getgrace(quota_id, ++ (struct dq_info __user *)addr, compat); ++ break; ++ case VZ_DQ_UGID_SETGRACE: ++ ret = quota_ugid_setgrace(quota_id, ++ (struct dq_info __user *)addr, compat); ++ break; ++ case VZ_DQ_UGID_GETCONFIG: ++ ret = quota_ugid_getconfig(quota_id, ++ (struct vz_quota_ugid_stat __user *) ++ addr); ++ break; ++ case VZ_DQ_UGID_SETCONFIG: ++ ret = quota_ugid_setconfig(quota_id, ++ (struct vz_quota_ugid_stat __user *) ++ addr); ++ break; ++ case VZ_DQ_UGID_SETLIMIT: ++ ret = quota_ugid_setlimit(quota_id, ++ (struct vz_quota_ugid_setlimit __user *) ++ addr); ++ break; ++ case VZ_DQ_UGID_SETINFO: ++ ret = quota_ugid_setinfo(quota_id, ++ (struct vz_quota_ugid_setinfo __user *) ++ addr); ++ break; ++ default: ++ ret = -EINVAL; ++ goto out; ++ } ++out: ++ return ret; ++} ++ ++static void ugid_quota_on_sb(struct super_block *sb) ++{ ++ struct super_block *real_sb; ++ struct vz_quota_master *qmblk; ++ ++ if (!sb->s_op->get_quota_root) ++ return; ++ ++ real_sb = sb->s_op->get_quota_root(sb)->i_sb; ++ if (real_sb->dq_op != &vz_quota_operations) ++ return; ++ ++ sb->dq_op = &vz_quota_operations2; ++ sb->s_qcop = &vz_quotactl_operations; ++ INIT_LIST_HEAD(&sb->s_dquot.info[USRQUOTA].dqi_dirty_list); ++ INIT_LIST_HEAD(&sb->s_dquot.info[GRPQUOTA].dqi_dirty_list); ++ sb->s_dquot.info[USRQUOTA].dqi_format = &vz_quota_empty_v2_format; ++ sb->s_dquot.info[GRPQUOTA].dqi_format = &vz_quota_empty_v2_format; ++ ++ qmblk = vzquota_find_qmblk(sb); ++ if ((qmblk == NULL) || (qmblk == VZ_QUOTA_BAD)) ++ return; ++ down(&vz_quota_sem); ++ if (qmblk->dq_flags & VZDQ_USRQUOTA) ++ sb->s_dquot.flags |= DQUOT_USR_ENABLED; ++ if (qmblk->dq_flags & VZDQ_GRPQUOTA) ++ sb->s_dquot.flags |= DQUOT_GRP_ENABLED; ++ up(&vz_quota_sem); ++ qmblk_put(qmblk); ++} ++ ++static void ugid_quota_off_sb(struct super_block *sb) ++{ ++ /* can't make quota off on mounted super block */ ++ BUG_ON(sb->s_root != NULL); ++} ++ ++static int ugid_notifier_call(struct vnotifier_block *self, ++ unsigned long n, void *data, int old_ret) ++{ ++ struct virt_info_quota *viq; ++ ++ viq = (struct virt_info_quota *)data; ++ ++ switch (n) { ++ case VIRTINFO_QUOTA_ON: ++ ugid_quota_on_sb(viq->super); ++ break; ++ case VIRTINFO_QUOTA_OFF: ++ ugid_quota_off_sb(viq->super); ++ break; ++ case VIRTINFO_QUOTA_GETSTAT: ++ break; ++ default: ++ return old_ret; ++ } ++ return NOTIFY_OK; ++} ++ ++static struct vnotifier_block ugid_notifier_block = { ++ .notifier_call = ugid_notifier_call, ++}; ++ ++/* ---------------------------------------------------------------------- ++ * Init/exit. ++ * --------------------------------------------------------------------- */ ++ ++int vzquota_ugid_init(void) ++{ ++ int err; ++ ++ vz_quota_ugid_cachep = kmem_cache_create("vz_quota_ugid", ++ sizeof(struct vz_quota_ugid), ++ 0, SLAB_HWCACHE_ALIGN, NULL); ++ if (vz_quota_ugid_cachep == NULL) ++ goto err_slab; ++ ++ err = register_quota_format(&vz_quota_empty_v2_format); ++ if (err) ++ goto err_reg; ++ ++ virtinfo_notifier_register(VITYPE_QUOTA, &ugid_notifier_block); ++ return 0; ++ ++err_reg: ++ kmem_cache_destroy(vz_quota_ugid_cachep); ++ return err; ++ ++err_slab: ++ printk(KERN_ERR "Cannot create VZ_QUOTA SLAB cache\n"); ++ return -ENOMEM; ++} ++ ++void vzquota_ugid_release(void) ++{ ++ virtinfo_notifier_unregister(VITYPE_QUOTA, &ugid_notifier_block); ++ unregister_quota_format(&vz_quota_empty_v2_format); ++ ++ kmem_cache_destroy(vz_quota_ugid_cachep); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./fs/vzdquot.c debian/binary-custom.d/openvz/src/fs/vzdquot.c +--- ./fs/vzdquot.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/fs/vzdquot.c 2012-11-13 15:20:14.296569106 +0000 +@@ -0,0 +1,1954 @@ ++/* ++ * Copyright (C) 2001, 2002, 2004, 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * This file contains the core of Virtuozzo disk quota implementation: ++ * maintenance of VZDQ information in inodes, ++ * external interfaces, ++ * module entry. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ---------------------------------------------------------------------- ++ * ++ * Locking ++ * ++ * ---------------------------------------------------------------------- */ ++ ++/* ++ * Serializes on/off and all other do_vzquotactl operations. ++ * Protects qmblk hash. ++ */ ++struct semaphore vz_quota_sem; ++ ++/* ++ * Data access locks ++ * inode_qmblk ++ * protects qmblk pointers in all inodes and qlnk content in general ++ * (but not qmblk content); ++ * also protects related qmblk invalidation procedures; ++ * can't be per-inode because of vzquota_dtree_qmblk complications ++ * and problems with serialization with quota_on, ++ * but can be per-superblock; ++ * qmblk_data ++ * protects qmblk fields (such as current usage) ++ * quota_data ++ * protects charge/uncharge operations, thus, implies ++ * qmblk_data lock and, if CONFIG_VZ_QUOTA_UGID, inode_qmblk lock ++ * (to protect ugid pointers). ++ * ++ * Lock order: ++ * inode_qmblk_lock -> dcache_lock ++ * inode_qmblk_lock -> qmblk_data ++ */ ++static DEFINE_SPINLOCK(vzdq_qmblk_lock); ++ ++inline void inode_qmblk_lock(struct super_block *sb) ++{ ++ spin_lock(&vzdq_qmblk_lock); ++} ++ ++inline void inode_qmblk_unlock(struct super_block *sb) ++{ ++ spin_unlock(&vzdq_qmblk_lock); ++} ++ ++inline void qmblk_data_read_lock(struct vz_quota_master *qmblk) ++{ ++ spin_lock(&qmblk->dq_data_lock); ++} ++ ++inline void qmblk_data_read_unlock(struct vz_quota_master *qmblk) ++{ ++ spin_unlock(&qmblk->dq_data_lock); ++} ++ ++inline void qmblk_data_write_lock(struct vz_quota_master *qmblk) ++{ ++ spin_lock(&qmblk->dq_data_lock); ++} ++ ++inline void qmblk_data_write_unlock(struct vz_quota_master *qmblk) ++{ ++ spin_unlock(&qmblk->dq_data_lock); ++} ++ ++struct quota_format_type vz_quota_empty_v2_format = { ++ .qf_fmt_id = QFMT_VFS_V0, ++ .qf_ops = NULL, ++ .qf_owner = THIS_MODULE, ++}; ++ ++/* ---------------------------------------------------------------------- ++ * ++ * Master hash table handling. ++ * ++ * SMP not safe, serialied by vz_quota_sem within quota syscalls ++ * ++ * --------------------------------------------------------------------- */ ++ ++static struct kmem_cache *vzquota_cachep; ++ ++/* ++ * Hash function. ++ */ ++#define QHASH_BITS 6 ++#define VZ_QUOTA_HASH_SIZE (1 << QHASH_BITS) ++#define QHASH_MASK (VZ_QUOTA_HASH_SIZE - 1) ++ ++struct list_head vzquota_hash_table[VZ_QUOTA_HASH_SIZE]; ++int vzquota_hash_size = VZ_QUOTA_HASH_SIZE; ++ ++static inline int vzquota_hash_func(unsigned int qid) ++{ ++ return (((qid >> QHASH_BITS) ^ qid) & QHASH_MASK); ++} ++ ++/** ++ * vzquota_alloc_master - alloc and instantiate master quota record ++ * ++ * Returns: ++ * pointer to newly created record if SUCCESS ++ * -ENOMEM if out of memory ++ * -EEXIST if record with given quota_id already exist ++ */ ++struct vz_quota_master *vzquota_alloc_master(unsigned int quota_id, ++ struct vz_quota_stat *qstat) ++{ ++ int err; ++ struct vz_quota_master *qmblk; ++ ++ err = -EEXIST; ++ if (vzquota_find_master(quota_id) != NULL) ++ goto out; ++ ++ err = -ENOMEM; ++ qmblk = kmem_cache_alloc(vzquota_cachep, GFP_KERNEL); ++ if (qmblk == NULL) ++ goto out; ++#ifdef CONFIG_VZ_QUOTA_UGID ++ qmblk->dq_uid_tree = quotatree_alloc(); ++ if (!qmblk->dq_uid_tree) ++ goto out_free; ++ ++ qmblk->dq_gid_tree = quotatree_alloc(); ++ if (!qmblk->dq_gid_tree) ++ goto out_free_tree; ++#endif ++ ++ qmblk->dq_state = VZDQ_STARTING; ++ init_MUTEX(&qmblk->dq_sem); ++ spin_lock_init(&qmblk->dq_data_lock); ++ ++ qmblk->dq_id = quota_id; ++ qmblk->dq_stat = qstat->dq_stat; ++ qmblk->dq_info = qstat->dq_info; ++ qmblk->dq_root_dentry = NULL; ++ qmblk->dq_root_mnt = NULL; ++ qmblk->dq_sb = NULL; ++ qmblk->dq_ugid_count = 0; ++ qmblk->dq_ugid_max = 0; ++ qmblk->dq_flags = 0; ++ memset(qmblk->dq_ugid_info, 0, sizeof(qmblk->dq_ugid_info)); ++ INIT_LIST_HEAD(&qmblk->dq_ilink_list); ++ ++ atomic_set(&qmblk->dq_count, 1); ++ ++ /* insert in hash chain */ ++ list_add(&qmblk->dq_hash, ++ &vzquota_hash_table[vzquota_hash_func(quota_id)]); ++ ++ /* success */ ++ return qmblk; ++ ++#ifdef CONFIG_VZ_QUOTA_UGID ++out_free_tree: ++ quotatree_free(qmblk->dq_uid_tree, NULL); ++out_free: ++ kmem_cache_free(vzquota_cachep, qmblk); ++#endif ++out: ++ return ERR_PTR(err); ++} ++ ++static struct vz_quota_master *vzquota_alloc_fake(void) ++{ ++ struct vz_quota_master *qmblk; ++ ++ qmblk = kmem_cache_alloc(vzquota_cachep, GFP_KERNEL); ++ if (qmblk == NULL) ++ return NULL; ++ memset(qmblk, 0, sizeof(*qmblk)); ++ qmblk->dq_state = VZDQ_STOPING; ++ qmblk->dq_flags = VZDQ_NOQUOT; ++ spin_lock_init(&qmblk->dq_data_lock); ++ INIT_LIST_HEAD(&qmblk->dq_ilink_list); ++ atomic_set(&qmblk->dq_count, 1); ++ return qmblk; ++} ++ ++/** ++ * vzquota_find_master - find master record with given id ++ * ++ * Returns qmblk without touching its refcounter. ++ * Called under vz_quota_sem. ++ */ ++struct vz_quota_master *vzquota_find_master(unsigned int quota_id) ++{ ++ int i; ++ struct vz_quota_master *qp; ++ ++ i = vzquota_hash_func(quota_id); ++ list_for_each_entry(qp, &vzquota_hash_table[i], dq_hash) { ++ if (qp->dq_id == quota_id) ++ return qp; ++ } ++ return NULL; ++} ++ ++/** ++ * vzquota_free_master - release resources taken by qmblk, freeing memory ++ * ++ * qmblk is assumed to be already taken out from the hash. ++ * Should be called outside vz_quota_sem. ++ */ ++void vzquota_free_master(struct vz_quota_master *qmblk) ++{ ++#ifdef CONFIG_VZ_QUOTA_UGID ++ vzquota_kill_ugid(qmblk); ++#endif ++ BUG_ON(!list_empty(&qmblk->dq_ilink_list)); ++ kmem_cache_free(vzquota_cachep, qmblk); ++} ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * Passing quota information through current ++ * ++ * Used in inode -> qmblk lookup at inode creation stage (since at that ++ * time there are no links between the inode being created and its parent ++ * directory). ++ * ++ * --------------------------------------------------------------------- */ ++ ++#define VZDQ_CUR_MAGIC 0x57d0fee2 ++ ++static inline int vzquota_cur_qmblk_check(void) ++{ ++ return current->magic == VZDQ_CUR_MAGIC; ++} ++ ++static inline struct inode *vzquota_cur_qmblk_fetch(void) ++{ ++ return current->ino; ++} ++ ++static inline void vzquota_cur_qmblk_set(struct inode *data) ++{ ++ struct task_struct *tsk; ++ ++ tsk = current; ++ tsk->magic = VZDQ_CUR_MAGIC; ++ tsk->ino = data; ++} ++ ++#if 0 ++static inline void vzquota_cur_qmblk_reset(void) ++{ ++ current->magic = 0; ++} ++#endif ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * Superblock quota operations ++ * ++ * --------------------------------------------------------------------- */ ++ ++/* ++ * Kernel structure abuse. ++ * We use files[0] pointer as an int variable: ++ * reference counter of how many quota blocks uses this superblock. ++ * files[1] is used for generations structure which helps us to track ++ * when traversing of dentries is really required. ++ */ ++#define __VZ_QUOTA_NOQUOTA(sb) sb->s_dquot.vzdq_master ++#define __VZ_QUOTA_TSTAMP(sb) ((struct timeval *)\ ++ &sb->s_dquot.dqio_mutex) ++ ++#if defined(VZ_QUOTA_UNLOAD) ++ ++#define __VZ_QUOTA_SBREF(sb) sb->s_dquot.vzdq_count ++ ++struct dquot_operations *orig_dq_op; ++struct quotactl_ops *orig_dq_cop; ++ ++/** ++ * quota_get_super - account for new a quoted tree under the superblock ++ * ++ * One superblock can have multiple directory subtrees with different VZ ++ * quotas. We keep a counter of such subtrees and set VZ quota operations or ++ * reset the default ones. ++ * ++ * Called under vz_quota_sem (from quota_on). ++ */ ++int vzquota_get_super(struct super_block *sb) ++{ ++ if (sb->dq_op != &vz_quota_operations) { ++ down(&sb->s_dquot.dqonoff_sem); ++ if (sb->s_dquot.flags & (DQUOT_USR_ENABLED|DQUOT_GRP_ENABLED)) { ++ up(&sb->s_dquot.dqonoff_sem); ++ return -EEXIST; ++ } ++ if (orig_dq_op == NULL && sb->dq_op != NULL) ++ orig_dq_op = sb->dq_op; ++ sb->dq_op = &vz_quota_operations; ++ if (orig_dq_cop == NULL && sb->s_qcop != NULL) ++ orig_dq_cop = sb->s_qcop; ++ /* XXX this may race with sys_quotactl */ ++#ifdef CONFIG_VZ_QUOTA_UGID ++ sb->s_qcop = &vz_quotactl_operations; ++#else ++ sb->s_qcop = NULL; ++#endif ++ do_gettimeofday(__VZ_QUOTA_TSTAMP(sb)); ++ memset(&sb->s_dquot.info, 0, sizeof(sb->s_dquot.info)); ++ ++ INIT_LIST_HEAD(&sb->s_dquot.info[USRQUOTA].dqi_dirty_list); ++ INIT_LIST_HEAD(&sb->s_dquot.info[GRPQUOTA].dqi_dirty_list); ++ sb->s_dquot.info[USRQUOTA].dqi_format = &vz_quota_empty_v2_format; ++ sb->s_dquot.info[GRPQUOTA].dqi_format = &vz_quota_empty_v2_format; ++ /* ++ * To get quotaops.h call us we need to mark superblock ++ * as having quota. These flags mark the moment when ++ * our dq_op start to be called. ++ * ++ * The ordering of dq_op and s_dquot.flags assignment ++ * needs to be enforced, but other CPUs do not do rmb() ++ * between s_dquot.flags and dq_op accesses. ++ */ ++ wmb(); synchronize_sched(); ++ sb->s_dquot.flags = DQUOT_USR_ENABLED|DQUOT_GRP_ENABLED; ++ __module_get(THIS_MODULE); ++ up(&sb->s_dquot.dqonoff_sem); ++ } ++ /* protected by vz_quota_sem */ ++ __VZ_QUOTA_SBREF(sb)++; ++ return 0; ++} ++ ++/** ++ * quota_put_super - release superblock when one quota tree goes away ++ * ++ * Called under vz_quota_sem. ++ */ ++void vzquota_put_super(struct super_block *sb) ++{ ++ int count; ++ ++ count = --__VZ_QUOTA_SBREF(sb); ++ if (count == 0) { ++ down(&sb->s_dquot.dqonoff_sem); ++ sb->s_dquot.flags = 0; ++ wmb(); synchronize_sched(); ++ sema_init(&sb->s_dquot.dqio_sem, 1); ++ sb->s_qcop = orig_dq_cop; ++ sb->dq_op = orig_dq_op; ++ inode_qmblk_lock(sb); ++ quota_gen_put(SB_QGEN(sb)); ++ SB_QGEN(sb) = NULL; ++ /* release qlnk's without qmblk */ ++ remove_inode_quota_links_list(&non_vzquota_inodes_lh, ++ sb, NULL); ++ /* ++ * Races with quota initialization: ++ * after this inode_qmblk_unlock all inode's generations are ++ * invalidated, quota_inode_qmblk checks superblock operations. ++ */ ++ inode_qmblk_unlock(sb); ++ /* ++ * Module refcounting: in theory, this is the best place ++ * to call module_put(THIS_MODULE). ++ * In reality, it can't be done because we can't be sure that ++ * other CPUs do not enter our code segment through dq_op ++ * cached long time ago. Quotaops interface isn't supposed to ++ * go into modules currently (that is, into unloadable ++ * modules). By omitting module_put, our module isn't ++ * unloadable. ++ */ ++ up(&sb->s_dquot.dqonoff_sem); ++ } ++} ++ ++#else ++ ++struct vzquota_new_sop { ++ struct super_operations new_op; ++ const struct super_operations *old_op; ++}; ++ ++/** ++ * vzquota_shutdown_super - callback on umount ++ */ ++void vzquota_shutdown_super(struct super_block *sb) ++{ ++ struct vz_quota_master *qmblk; ++ struct vzquota_new_sop *sop; ++ ++ qmblk = __VZ_QUOTA_NOQUOTA(sb); ++ __VZ_QUOTA_NOQUOTA(sb) = NULL; ++ if (qmblk != NULL) ++ qmblk_put(qmblk); ++ sop = container_of(sb->s_op, struct vzquota_new_sop, new_op); ++ sb->s_op = sop->old_op; ++ kfree(sop); ++ if (sb->s_op->put_super != NULL) ++ (*sb->s_op->put_super)(sb); ++} ++ ++/** ++ * vzquota_get_super - account for new a quoted tree under the superblock ++ * ++ * One superblock can have multiple directory subtrees with different VZ ++ * quotas. ++ * ++ * Called under vz_quota_sem (from vzquota_on). ++ */ ++int vzquota_get_super(struct super_block *sb) ++{ ++ struct vz_quota_master *qnew; ++ struct vzquota_new_sop *sop; ++ int err; ++ ++ mutex_lock(&sb->s_dquot.dqonoff_mutex); ++ err = -EEXIST; ++ if ((sb->s_dquot.flags & (DQUOT_USR_ENABLED|DQUOT_GRP_ENABLED)) && ++ sb->dq_op != &vz_quota_operations) ++ goto out_up; ++ ++ /* ++ * This allocation code should be under sb->dq_op check below, but ++ * it doesn't really matter... ++ */ ++ if (__VZ_QUOTA_NOQUOTA(sb) == NULL) { ++ qnew = vzquota_alloc_fake(); ++ if (qnew == NULL) ++ goto out_up; ++ __VZ_QUOTA_NOQUOTA(sb) = qnew; ++ } ++ ++ if (sb->dq_op != &vz_quota_operations) { ++ sop = kmalloc(sizeof(*sop), GFP_KERNEL); ++ if (sop == NULL) { ++ vzquota_free_master(__VZ_QUOTA_NOQUOTA(sb)); ++ __VZ_QUOTA_NOQUOTA(sb) = NULL; ++ goto out_up; ++ } ++ memcpy(&sop->new_op, sb->s_op, sizeof(sop->new_op)); ++ sop->new_op.put_super = &vzquota_shutdown_super; ++ sop->old_op = sb->s_op; ++ sb->s_op = &sop->new_op; ++ ++ sb->dq_op = &vz_quota_operations; ++#ifdef CONFIG_VZ_QUOTA_UGID ++ sb->s_qcop = &vz_quotactl_operations; ++#else ++ sb->s_qcop = NULL; ++#endif ++ do_gettimeofday(__VZ_QUOTA_TSTAMP(sb)); ++ ++ memset(&sb->s_dquot.info, 0, sizeof(sb->s_dquot.info)); ++ /* these 2 list heads are checked in sync_dquots() */ ++ INIT_LIST_HEAD(&sb->s_dquot.info[USRQUOTA].dqi_dirty_list); ++ INIT_LIST_HEAD(&sb->s_dquot.info[GRPQUOTA].dqi_dirty_list); ++ sb->s_dquot.info[USRQUOTA].dqi_format = ++ &vz_quota_empty_v2_format; ++ sb->s_dquot.info[GRPQUOTA].dqi_format = ++ &vz_quota_empty_v2_format; ++ ++ /* ++ * To get quotaops.h to call us we need to mark superblock ++ * as having quota. These flags mark the moment when ++ * our dq_op start to be called. ++ * ++ * The ordering of dq_op and s_dquot.flags assignment ++ * needs to be enforced, but other CPUs do not do rmb() ++ * between s_dquot.flags and dq_op accesses. ++ */ ++ wmb(); synchronize_sched(); ++ sb->s_dquot.flags = DQUOT_USR_ENABLED|DQUOT_GRP_ENABLED; ++ } ++ err = 0; ++ ++out_up: ++ mutex_unlock(&sb->s_dquot.dqonoff_mutex); ++ return err; ++} ++ ++/** ++ * vzquota_put_super - one quota tree less on this superblock ++ * ++ * Called under vz_quota_sem. ++ */ ++void vzquota_put_super(struct super_block *sb) ++{ ++ /* ++ * Even if this put is the last one, ++ * sb->s_dquot.flags can't be cleared, because otherwise vzquota_drop ++ * won't be called and the remaining qmblk references won't be put. ++ */ ++} ++ ++#endif ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * Helpers for inode -> qmblk link maintenance ++ * ++ * --------------------------------------------------------------------- */ ++ ++#define __VZ_QUOTA_EMPTY ((void *)0xbdbdbdbd) ++#define VZ_QUOTA_IS_NOQUOTA(qm, sb) ((qm)->dq_flags & VZDQ_NOQUOT) ++#define VZ_QUOTA_EMPTY_IOPS (&vfs_empty_iops) ++extern struct inode_operations vfs_empty_iops; ++ ++static int VZ_QUOTA_IS_ACTUAL(struct inode *inode) ++{ ++ struct vz_quota_master *qmblk; ++ ++ qmblk = INODE_QLNK(inode)->qmblk; ++ if (qmblk == VZ_QUOTA_BAD) ++ return 1; ++ if (qmblk == __VZ_QUOTA_EMPTY) ++ return 0; ++ if (qmblk->dq_flags & VZDQ_NOACT) ++ /* not actual (invalidated) qmblk */ ++ return 0; ++ return 1; ++} ++ ++static inline int vzquota_qlnk_is_empty(struct vz_quota_ilink *qlnk) ++{ ++ return qlnk->qmblk == __VZ_QUOTA_EMPTY; ++} ++ ++static inline void set_qlnk_origin(struct vz_quota_ilink *qlnk, ++ unsigned char origin) ++{ ++ qlnk->origin[0] = qlnk->origin[1]; ++ qlnk->origin[1] = origin; ++} ++ ++static inline void vzquota_qlnk_set_empty(struct vz_quota_ilink *qlnk) ++{ ++ qlnk->qmblk = __VZ_QUOTA_EMPTY; ++ set_qlnk_origin(qlnk, VZ_QUOTAO_SETE); ++} ++ ++void vzquota_qlnk_init(struct vz_quota_ilink *qlnk) ++{ ++ memset(qlnk, 0, sizeof(*qlnk)); ++ INIT_LIST_HEAD(&qlnk->list); ++ vzquota_qlnk_set_empty(qlnk); ++ set_qlnk_origin(qlnk, VZ_QUOTAO_INIT); ++} ++ ++void vzquota_qlnk_destroy(struct vz_quota_ilink *qlnk) ++{ ++ might_sleep(); ++ if (vzquota_qlnk_is_empty(qlnk)) ++ return; ++#if defined(CONFIG_VZ_QUOTA_UGID) ++ if (qlnk->qmblk != NULL && qlnk->qmblk != VZ_QUOTA_BAD) { ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ugid *quid, *qgid; ++ qmblk = qlnk->qmblk; ++ quid = qlnk->qugid[USRQUOTA]; ++ qgid = qlnk->qugid[GRPQUOTA]; ++ if (quid != NULL || qgid != NULL) { ++ down(&qmblk->dq_sem); ++ if (qgid != NULL) ++ vzquota_put_ugid(qmblk, qgid); ++ if (quid != NULL) ++ vzquota_put_ugid(qmblk, quid); ++ up(&qmblk->dq_sem); ++ } ++ } ++#endif ++ if (qlnk->qmblk != NULL && qlnk->qmblk != VZ_QUOTA_BAD) ++ qmblk_put(qlnk->qmblk); ++ set_qlnk_origin(qlnk, VZ_QUOTAO_DESTR); ++} ++ ++/** ++ * vzquota_qlnk_swap - swap inode's and temporary vz_quota_ilink contents ++ * @qlt: temporary ++ * @qli: inode's ++ * ++ * Locking is provided by the caller (depending on the context). ++ * After swap, @qli is inserted into the corresponding dq_ilink_list, ++ * @qlt list is reinitialized. ++ */ ++static void vzquota_qlnk_swap(struct vz_quota_ilink *qlt, ++ struct vz_quota_ilink *qli) ++{ ++ struct vz_quota_master *qb; ++ struct vz_quota_ugid *qu; ++ int i; ++ ++ qb = qlt->qmblk; ++ qlt->qmblk = qli->qmblk; ++ qli->qmblk = qb; ++ list_del_init(&qli->list); ++ if (qb != __VZ_QUOTA_EMPTY && qb != VZ_QUOTA_BAD) ++ list_add(&qli->list, &qb->dq_ilink_list); ++ INIT_LIST_HEAD(&qlt->list); ++ set_qlnk_origin(qli, VZ_QUOTAO_SWAP); ++ ++ for (i = 0; i < MAXQUOTAS; i++) { ++ qu = qlt->qugid[i]; ++ qlt->qugid[i] = qli->qugid[i]; ++ qli->qugid[i] = qu; ++ } ++} ++ ++/** ++ * vzquota_qlnk_reinit_locked - destroy qlnk content, called under locks ++ * ++ * Called under dcache_lock and inode_qmblk locks. ++ * Returns 1 if locks were dropped inside, 0 if atomic. ++ */ ++static int vzquota_qlnk_reinit_locked(struct vz_quota_ilink *qlnk, ++ struct inode *inode) ++{ ++ if (vzquota_qlnk_is_empty(qlnk)) ++ return 0; ++ if (qlnk->qmblk == VZ_QUOTA_BAD) { ++ vzquota_qlnk_set_empty(qlnk); ++ set_qlnk_origin(qlnk, VZ_QUOTAO_RE_LOCK); ++ return 0; ++ } ++ spin_unlock(&dcache_lock); ++ inode_qmblk_unlock(inode->i_sb); ++ vzquota_qlnk_destroy(qlnk); ++ vzquota_qlnk_init(qlnk); ++ inode_qmblk_lock(inode->i_sb); ++ spin_lock(&dcache_lock); ++ return 1; ++} ++ ++#if defined(CONFIG_VZ_QUOTA_UGID) ++/** ++ * vzquota_qlnk_reinit_attr - destroy and reinit qlnk content ++ * ++ * Similar to vzquota_qlnk_reinit_locked, called under different locks. ++ */ ++static int vzquota_qlnk_reinit_attr(struct vz_quota_ilink *qlnk, ++ struct inode *inode, ++ struct vz_quota_master *qmblk) ++{ ++ if (vzquota_qlnk_is_empty(qlnk)) ++ return 0; ++ /* may be optimized if qlnk->qugid all NULLs */ ++ qmblk_data_write_unlock(qmblk); ++ inode_qmblk_unlock(inode->i_sb); ++ vzquota_qlnk_destroy(qlnk); ++ vzquota_qlnk_init(qlnk); ++ inode_qmblk_lock(inode->i_sb); ++ qmblk_data_write_lock(qmblk); ++ return 1; ++} ++#endif ++ ++/** ++ * vzquota_qlnk_fill - fill vz_quota_ilink content ++ * @qlnk: vz_quota_ilink to fill ++ * @inode: inode for which @qlnk is filled (i_sb, i_uid, i_gid) ++ * @qmblk: qmblk to which this @qlnk will belong ++ * ++ * Called under dcache_lock and inode_qmblk locks. ++ * Returns 1 if locks were dropped inside, 0 if atomic. ++ * @qlnk is expected to be empty. ++ */ ++static int vzquota_qlnk_fill(struct vz_quota_ilink *qlnk, ++ struct inode *inode, ++ struct vz_quota_master *qmblk) ++{ ++ if (qmblk != VZ_QUOTA_BAD) ++ qmblk_get(qmblk); ++ qlnk->qmblk = qmblk; ++ ++#if defined(CONFIG_VZ_QUOTA_UGID) ++ if (qmblk != VZ_QUOTA_BAD && ++ !VZ_QUOTA_IS_NOQUOTA(qmblk, inode->i_sb) && ++ (qmblk->dq_flags & VZDQUG_ON)) { ++ struct vz_quota_ugid *quid, *qgid; ++ ++ spin_unlock(&dcache_lock); ++ inode_qmblk_unlock(inode->i_sb); ++ ++ down(&qmblk->dq_sem); ++ quid = __vzquota_find_ugid(qmblk, inode->i_uid, USRQUOTA, 0); ++ qgid = __vzquota_find_ugid(qmblk, inode->i_gid, GRPQUOTA, 0); ++ up(&qmblk->dq_sem); ++ ++ inode_qmblk_lock(inode->i_sb); ++ spin_lock(&dcache_lock); ++ qlnk->qugid[USRQUOTA] = quid; ++ qlnk->qugid[GRPQUOTA] = qgid; ++ return 1; ++ } ++#endif ++ ++ return 0; ++} ++ ++#if defined(CONFIG_VZ_QUOTA_UGID) ++/** ++ * vzquota_qlnk_fill_attr - fill vz_quota_ilink content for uid, gid ++ * ++ * This function is a helper for vzquota_transfer, and differs from ++ * vzquota_qlnk_fill only by locking. ++ */ ++static int vzquota_qlnk_fill_attr(struct vz_quota_ilink *qlnk, ++ struct inode *inode, ++ struct iattr *iattr, ++ int mask, ++ struct vz_quota_master *qmblk) ++{ ++ qmblk_get(qmblk); ++ qlnk->qmblk = qmblk; ++ ++ if (mask) { ++ struct vz_quota_ugid *quid, *qgid; ++ ++ quid = qgid = NULL; /* to make gcc happy */ ++ if (!(mask & (1 << USRQUOTA))) ++ quid = vzquota_get_ugid(INODE_QLNK(inode)-> ++ qugid[USRQUOTA]); ++ if (!(mask & (1 << GRPQUOTA))) ++ qgid = vzquota_get_ugid(INODE_QLNK(inode)-> ++ qugid[GRPQUOTA]); ++ ++ qmblk_data_write_unlock(qmblk); ++ inode_qmblk_unlock(inode->i_sb); ++ ++ down(&qmblk->dq_sem); ++ if (mask & (1 << USRQUOTA)) ++ quid = __vzquota_find_ugid(qmblk, iattr->ia_uid, ++ USRQUOTA, 0); ++ if (mask & (1 << GRPQUOTA)) ++ qgid = __vzquota_find_ugid(qmblk, iattr->ia_gid, ++ GRPQUOTA, 0); ++ up(&qmblk->dq_sem); ++ ++ inode_qmblk_lock(inode->i_sb); ++ qmblk_data_write_lock(qmblk); ++ qlnk->qugid[USRQUOTA] = quid; ++ qlnk->qugid[GRPQUOTA] = qgid; ++ return 1; ++ } ++ ++ return 0; ++} ++#endif ++ ++/** ++ * __vzquota_inode_init - make sure inode's qlnk is initialized ++ * ++ * May be called if qlnk is already initialized, detects this situation itself. ++ * Called under inode_qmblk_lock. ++ */ ++static void __vzquota_inode_init(struct inode *inode, unsigned char origin) ++{ ++ if (inode->i_dquot[USRQUOTA] == NODQUOT) { ++ vzquota_qlnk_init(INODE_QLNK(inode)); ++ inode->i_dquot[USRQUOTA] = (void *)~(unsigned long)NODQUOT; ++ } ++ set_qlnk_origin(INODE_QLNK(inode), origin); ++} ++ ++/** ++ * vzquota_inode_drop - destroy VZ quota information in the inode ++ * ++ * Inode must not be externally accessible or dirty. ++ */ ++static void vzquota_inode_drop(struct inode *inode) ++{ ++ struct vz_quota_ilink qlnk; ++ ++ vzquota_qlnk_init(&qlnk); ++ inode_qmblk_lock(inode->i_sb); ++ vzquota_qlnk_swap(&qlnk, INODE_QLNK(inode)); ++ set_qlnk_origin(INODE_QLNK(inode), VZ_QUOTAO_DRCAL); ++ inode->i_dquot[USRQUOTA] = NODQUOT; ++ inode_qmblk_unlock(inode->i_sb); ++ vzquota_qlnk_destroy(&qlnk); ++} ++ ++/** ++ * vzquota_inode_qmblk_set - initialize inode's qlnk ++ * @inode: inode to be initialized ++ * @qmblk: quota master block to which this inode should belong (may be BAD) ++ * @qlnk: placeholder to store data to resolve locking issues ++ * ++ * Returns 1 if locks were dropped and rechecks possibly needed, 0 otherwise. ++ * Called under dcache_lock and inode_qmblk locks. ++ * @qlnk will be destroyed in the caller chain. ++ * ++ * It is not mandatory to restart parent checks since quota on/off currently ++ * shrinks dentry tree and checks that there are not outside references. ++ * But if at some time that shink is removed, restarts will be required. ++ * Additionally, the restarts prevent inconsistencies if the dentry tree ++ * changes (inode is moved). This is not a big deal, but anyway... ++ */ ++static int vzquota_inode_qmblk_set(struct inode *inode, ++ struct vz_quota_master *qmblk, ++ struct vz_quota_ilink *qlnk) ++{ ++ if (qmblk == NULL) { ++ printk(KERN_ERR "VZDQ: NULL in set, orig {%u, %u}, " ++ "dev %s, inode %lu, fs %s\n", ++ INODE_QLNK(inode)->origin[0], ++ INODE_QLNK(inode)->origin[1], ++ inode->i_sb->s_id, inode->i_ino, ++ inode->i_sb->s_type->name); ++ printk(KERN_ERR "current %d (%s), VE %d\n", ++ current->pid, current->comm, ++ VEID(get_exec_env())); ++ dump_stack(); ++ qmblk = VZ_QUOTA_BAD; ++ } ++ while (1) { ++ if (vzquota_qlnk_is_empty(qlnk) && ++ vzquota_qlnk_fill(qlnk, inode, qmblk)) ++ return 1; ++ if (qlnk->qmblk == qmblk) ++ break; ++ if (vzquota_qlnk_reinit_locked(qlnk, inode)) ++ return 1; ++ } ++ vzquota_qlnk_swap(qlnk, INODE_QLNK(inode)); ++ set_qlnk_origin(INODE_QLNK(inode), VZ_QUOTAO_QSET); ++ return 0; ++} ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * vzquota_inode_qmblk (inode -> qmblk lookup) parts ++ * ++ * --------------------------------------------------------------------- */ ++ ++static int vzquota_dparents_check_attach(struct inode *inode) ++{ ++ if (!list_empty(&inode->i_dentry)) ++ return 0; ++ printk(KERN_ERR "VZDQ: no parent for " ++ "dev %s, inode %lu, fs %s\n", ++ inode->i_sb->s_id, ++ inode->i_ino, ++ inode->i_sb->s_type->name); ++ return -1; ++} ++ ++static struct inode *vzquota_dparents_check_actual(struct inode *inode) ++{ ++ struct dentry *de; ++ ++ list_for_each_entry(de, &inode->i_dentry, d_alias) { ++ if (de->d_parent == de) /* detached dentry, perhaps */ ++ continue; ++ /* first access to parent, make sure its qlnk initialized */ ++ __vzquota_inode_init(de->d_parent->d_inode, VZ_QUOTAO_ACT); ++ if (!VZ_QUOTA_IS_ACTUAL(de->d_parent->d_inode)) ++ return de->d_parent->d_inode; ++ } ++ return NULL; ++} ++ ++static struct vz_quota_master *vzquota_dparents_check_same(struct inode *inode) ++{ ++ struct dentry *de; ++ struct vz_quota_master *qmblk; ++ ++ qmblk = NULL; ++ list_for_each_entry(de, &inode->i_dentry, d_alias) { ++ if (de->d_parent == de) /* detached dentry, perhaps */ ++ continue; ++ if (qmblk == NULL) { ++ qmblk = INODE_QLNK(de->d_parent->d_inode)->qmblk; ++ continue; ++ } ++ if (INODE_QLNK(de->d_parent->d_inode)->qmblk != qmblk) { ++ printk(KERN_WARNING "VZDQ: multiple quotas for " ++ "dev %s, inode %lu, fs %s\n", ++ inode->i_sb->s_id, ++ inode->i_ino, ++ inode->i_sb->s_type->name); ++ qmblk = VZ_QUOTA_BAD; ++ break; ++ } ++ } ++ if (qmblk == NULL) { ++ printk(KERN_WARNING "VZDQ: not attached to tree, " ++ "dev %s, inode %lu, fs %s\n", ++ inode->i_sb->s_id, ++ inode->i_ino, ++ inode->i_sb->s_type->name); ++ qmblk = VZ_QUOTA_BAD; ++ } ++ return qmblk; ++} ++ ++static void vzquota_dbranch_actualize(struct inode *inode, ++ struct inode *refinode) ++{ ++ struct inode *pinode; ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ilink qlnk; ++ ++ vzquota_qlnk_init(&qlnk); ++ ++start: ++ if (inode == inode->i_sb->s_root->d_inode) { ++ /* filesystem root */ ++ atomic_inc(&inode->i_count); ++ do { ++ qmblk = __VZ_QUOTA_NOQUOTA(inode->i_sb); ++ } while (vzquota_inode_qmblk_set(inode, qmblk, &qlnk)); ++ goto out; ++ } ++ ++ if (!vzquota_dparents_check_attach(inode)) { ++ pinode = vzquota_dparents_check_actual(inode); ++ if (pinode != NULL) { ++ inode = pinode; ++ goto start; ++ } ++ } ++ ++ atomic_inc(&inode->i_count); ++ while (1) { ++ if (VZ_QUOTA_IS_ACTUAL(inode)) /* actualized without us */ ++ break; ++ /* ++ * Need to check parents again if we have slept inside ++ * vzquota_inode_qmblk_set() in the loop. ++ * If the state of parents is different, just return and repeat ++ * the actualizing process again from the inode passed to ++ * vzquota_inode_qmblk_recalc(). ++ */ ++ if (!vzquota_dparents_check_attach(inode)) { ++ if (vzquota_dparents_check_actual(inode) != NULL) ++ break; ++ qmblk = vzquota_dparents_check_same(inode); ++ } else ++ qmblk = VZ_QUOTA_BAD; ++ if (!vzquota_inode_qmblk_set(inode, qmblk, &qlnk)){/* success */ ++ set_qlnk_origin(INODE_QLNK(inode), VZ_QUOTAO_ACT); ++ break; ++ } ++ } ++ ++out: ++ spin_unlock(&dcache_lock); ++ inode_qmblk_unlock(refinode->i_sb); ++ vzquota_qlnk_destroy(&qlnk); ++ iput(inode); ++ inode_qmblk_lock(refinode->i_sb); ++ spin_lock(&dcache_lock); ++} ++ ++static void vzquota_dtree_qmblk_recalc(struct inode *inode, ++ struct vz_quota_ilink *qlnk) ++{ ++ struct inode *pinode; ++ struct vz_quota_master *qmblk; ++ ++ if (inode == inode->i_sb->s_root->d_inode) { ++ /* filesystem root */ ++ do { ++ qmblk = __VZ_QUOTA_NOQUOTA(inode->i_sb); ++ } while (vzquota_inode_qmblk_set(inode, qmblk, qlnk)); ++ return; ++ } ++ ++start: ++ if (VZ_QUOTA_IS_ACTUAL(inode)) ++ return; ++ /* ++ * Here qmblk is (re-)initialized for all ancestors. ++ * This is not a very efficient procedure, but it guarantees that ++ * the quota tree is consistent (that is, the inode doesn't have two ++ * ancestors with different qmblk). ++ */ ++ if (!vzquota_dparents_check_attach(inode)) { ++ pinode = vzquota_dparents_check_actual(inode); ++ if (pinode != NULL) { ++ vzquota_dbranch_actualize(pinode, inode); ++ goto start; ++ } ++ qmblk = vzquota_dparents_check_same(inode); ++ } else ++ qmblk = VZ_QUOTA_BAD; ++ ++ if (vzquota_inode_qmblk_set(inode, qmblk, qlnk)) ++ goto start; ++ set_qlnk_origin(INODE_QLNK(inode), VZ_QUOTAO_DTREE); ++} ++ ++static void vzquota_det_qmblk_recalc(struct inode *inode, ++ struct vz_quota_ilink *qlnk) ++{ ++ struct inode *parent; ++ struct vz_quota_master *qmblk; ++ char *msg; ++ int cnt; ++ time_t timeout; ++ ++ cnt = 0; ++ parent = NULL; ++start: ++ /* ++ * qmblk of detached inodes shouldn't be considered as not actual. ++ * They are not in any dentry tree, so quota on/off shouldn't affect ++ * them. ++ */ ++ if (!vzquota_qlnk_is_empty(INODE_QLNK(inode))) ++ return; ++ ++ timeout = 3; ++ qmblk = __VZ_QUOTA_NOQUOTA(inode->i_sb); ++ /* ++ * Scenario: ++ * open ++ * unlink ++ * quotaon ++ * generic_delete_inode ++ * ++ * This is the first time vzquota sees inode. inode is outside of ++ * vzquota area of interest, otherwise quotaon would have got -EBUSY ++ * due to shrink_dcache_parent(). ++ * inode is almost completely destroyed, so don't intervene. ++ * ++ * dev@: ++ * However, there is a small race here... ++ * dput() first removes itself from all the lists, ++ * so shrink_dcache_parent() can succeed while dentry_iput is not ++ * done yet. ++ */ ++ if (inode->i_state & I_FREEING) ++ goto set; ++ ++ msg = "detached inode not in creation"; ++ if (inode->i_op != VZ_QUOTA_EMPTY_IOPS) ++ goto fail; ++ qmblk = VZ_QUOTA_BAD; ++ msg = "unexpected creation context"; ++ if (!vzquota_cur_qmblk_check()) ++ goto fail; ++ timeout = 0; ++ parent = vzquota_cur_qmblk_fetch(); ++ msg = "uninitialized parent"; ++ if (vzquota_qlnk_is_empty(INODE_QLNK(parent))) ++ goto fail; ++ msg = "parent not in tree"; ++ if (list_empty(&parent->i_dentry)) ++ goto fail; ++ msg = "parent has 0 refcount"; ++ if (!atomic_read(&parent->i_count)) ++ goto fail; ++ msg = "parent has different sb"; ++ if (parent->i_sb != inode->i_sb) ++ goto fail; ++ if (!VZ_QUOTA_IS_ACTUAL(parent)) { ++ vzquota_dbranch_actualize(parent, inode); ++ goto start; ++ } ++ ++ qmblk = INODE_QLNK(parent)->qmblk; ++set: ++ if (vzquota_inode_qmblk_set(inode, qmblk, qlnk)) ++ goto start; ++ set_qlnk_origin(INODE_QLNK(inode), VZ_QUOTAO_DET); ++ return; ++ ++fail: ++ { ++ struct timeval tv, tvo; ++ do_gettimeofday(&tv); ++ memcpy(&tvo, __VZ_QUOTA_TSTAMP(inode->i_sb), sizeof(tvo)); ++ tv.tv_sec -= tvo.tv_sec; ++ if (tv.tv_usec < tvo.tv_usec) { ++ tv.tv_sec--; ++ tv.tv_usec += USEC_PER_SEC - tvo.tv_usec; ++ } else ++ tv.tv_usec -= tvo.tv_usec; ++ if (tv.tv_sec < timeout) ++ goto set; ++ printk(KERN_ERR "VZDQ: %s, orig {%u, %u}," ++ " dev %s, inode %lu, fs %s\n", ++ msg, ++ INODE_QLNK(inode)->origin[0], ++ INODE_QLNK(inode)->origin[1], ++ inode->i_sb->s_id, inode->i_ino, ++ inode->i_sb->s_type->name); ++ printk(KERN_ERR "i_count %u, ", atomic_read(&inode->i_count)); ++ printk(KERN_ERR "i_mode %o, ", inode->i_mode); ++ printk(KERN_ERR "i_state %lx, ", inode->i_state); ++ printk(KERN_ERR "i_flags %x\n", inode->i_flags); ++ printk(KERN_ERR "i_op %p, vfs_empty_iops %p, " ++ "i_fop %p, i_mapping %p\n", ++ inode->i_op, &vfs_empty_iops, ++ inode->i_fop, inode->i_mapping); ++ if (!cnt++) { ++ printk(KERN_ERR "current %d (%s), VE %d," ++ " time %ld.%06ld\n", ++ current->pid, current->comm, ++ VEID(get_exec_env()), ++ tv.tv_sec, (long)tv.tv_usec); ++ dump_stack(); ++ } ++ if (parent != NULL) ++ printk(KERN_ERR "VZDQ: parent of %lu is %lu\n", ++ inode->i_ino, parent->i_ino); ++ } ++ goto set; ++} ++ ++static void vzquota_inode_qmblk_recalc(struct inode *inode, ++ struct vz_quota_ilink *qlnk) ++{ ++ spin_lock(&dcache_lock); ++ if (!list_empty(&inode->i_dentry)) ++ vzquota_dtree_qmblk_recalc(inode, qlnk); ++ else ++ vzquota_det_qmblk_recalc(inode, qlnk); ++ spin_unlock(&dcache_lock); ++} ++ ++/** ++ * vzquota_inode_qmblk - obtain inode's qmblk ++ * ++ * Returns qmblk with refcounter taken, %NULL if not under ++ * VZ quota or %VZ_QUOTA_BAD. ++ * ++ * FIXME: This function should be removed when vzquota_find_qmblk / ++ * get_quota_root / vzquota_dstat code is cleaned up. ++ */ ++struct vz_quota_master *vzquota_inode_qmblk(struct inode *inode) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ilink qlnk; ++ ++ might_sleep(); ++ ++ if (inode->i_sb->dq_op != &vz_quota_operations) ++ return NULL; ++#if defined(VZ_QUOTA_UNLOAD) ++#error Make sure qmblk does not disappear ++#endif ++ ++ vzquota_qlnk_init(&qlnk); ++ inode_qmblk_lock(inode->i_sb); ++ __vzquota_inode_init(inode, VZ_QUOTAO_INICAL); ++ ++ if (vzquota_qlnk_is_empty(INODE_QLNK(inode)) || ++ !VZ_QUOTA_IS_ACTUAL(inode)) ++ vzquota_inode_qmblk_recalc(inode, &qlnk); ++ ++ qmblk = INODE_QLNK(inode)->qmblk; ++ if (qmblk != VZ_QUOTA_BAD) { ++ if (!VZ_QUOTA_IS_NOQUOTA(qmblk, inode->i_sb)) ++ qmblk_get(qmblk); ++ else ++ qmblk = NULL; ++ } ++ ++ inode_qmblk_unlock(inode->i_sb); ++ vzquota_qlnk_destroy(&qlnk); ++ return qmblk; ++} ++ ++/** ++ * vzquota_find_qmblk - helper to emulate quota on virtual filesystems ++ * ++ * This function finds a quota master block corresponding to the root of ++ * a virtual filesystem. ++ * Returns a quota master block with reference taken, or %NULL if not under ++ * quota, or %VZ_QUOTA_BAD if quota inconsistency is found (and all allocation ++ * operations will fail). ++ * ++ * Note: this function uses vzquota_inode_qmblk(). ++ * The latter is a rather confusing function: it returns qmblk that used to be ++ * on the inode some time ago (without guarantee that it still has any ++ * relations to the inode). So, vzquota_find_qmblk() leaves it up to the ++ * caller to think whether the inode could have changed its qmblk and what to ++ * do in that case. ++ * Currently, the callers appear to not care :( ++ */ ++struct vz_quota_master *vzquota_find_qmblk(struct super_block *sb) ++{ ++ struct inode *qrinode; ++ struct vz_quota_master *qmblk; ++ ++ qmblk = NULL; ++ qrinode = NULL; ++ if (sb->s_op->get_quota_root != NULL) ++ qrinode = sb->s_op->get_quota_root(sb); ++ if (qrinode != NULL) ++ qmblk = vzquota_inode_qmblk(qrinode); ++ return qmblk; ++} ++ ++/* ---------------------------------------------------------------------- ++ * ++ * Calls from quota operations ++ * ++ * --------------------------------------------------------------------- */ ++ ++/** ++ * vzquota_inode_init_call - call from DQUOT_INIT ++ */ ++void vzquota_inode_init_call(struct inode *inode) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_datast data; ++ ++ /* initializes inode's quota inside */ ++ qmblk = vzquota_inode_data(inode, &data); ++ if (qmblk != NULL && qmblk != VZ_QUOTA_BAD) ++ vzquota_data_unlock(inode, &data); ++ ++ /* ++ * The check is needed for repeated new_inode() calls from a single ++ * ext3 call like create or mkdir in case of -ENOSPC. ++ */ ++ spin_lock(&dcache_lock); ++ if (!list_empty(&inode->i_dentry)) ++ vzquota_cur_qmblk_set(inode); ++ spin_unlock(&dcache_lock); ++} ++ ++/** ++ * vzquota_inode_drop_call - call from DQUOT_DROP ++ */ ++void vzquota_inode_drop_call(struct inode *inode) ++{ ++ vzquota_inode_drop(inode); ++} ++ ++/** ++ * vzquota_inode_data - initialize (if nec.) and lock inode quota ptrs ++ * @inode: the inode ++ * @data: storage space ++ * ++ * Returns: qmblk is NULL or VZ_QUOTA_BAD or actualized qmblk. ++ * On return if qmblk is neither NULL nor VZ_QUOTA_BAD: ++ * qmblk in inode's qlnk is the same as returned, ++ * ugid pointers inside inode's qlnk are valid, ++ * some locks are taken (and should be released by vzquota_data_unlock). ++ * If qmblk is NULL or VZ_QUOTA_BAD, locks are NOT taken. ++ */ ++struct vz_quota_master *vzquota_inode_data(struct inode *inode, ++ struct vz_quota_datast *data) ++{ ++ struct vz_quota_master *qmblk; ++ ++ might_sleep(); ++ ++ vzquota_qlnk_init(&data->qlnk); ++ inode_qmblk_lock(inode->i_sb); ++ if (unlikely(inode->i_flags & S_NOQUOTA)) { ++ inode_qmblk_unlock(inode->i_sb); ++ return NULL; ++ } ++ __vzquota_inode_init(inode, VZ_QUOTAO_INICAL); ++ ++ if (vzquota_qlnk_is_empty(INODE_QLNK(inode)) || ++ !VZ_QUOTA_IS_ACTUAL(inode)) ++ vzquota_inode_qmblk_recalc(inode, &data->qlnk); ++ ++ qmblk = INODE_QLNK(inode)->qmblk; ++ if (qmblk != VZ_QUOTA_BAD) { ++ if (!VZ_QUOTA_IS_NOQUOTA(qmblk, inode->i_sb)) { ++ /* ++ * Note that in the current implementation, ++ * inode_qmblk_lock can theoretically be dropped here. ++ * This place is serialized with quota_off because ++ * quota_off fails when there are extra dentry ++ * references and syncs inodes before removing quota ++ * information from them. ++ * However, quota usage information should stop being ++ * updated immediately after vzquota_off. ++ */ ++ qmblk_data_write_lock(qmblk); ++ } else { ++ inode_qmblk_unlock(inode->i_sb); ++ qmblk = NULL; ++ } ++ } else { ++ inode_qmblk_unlock(inode->i_sb); ++ } ++ return qmblk; ++} ++ ++void vzquota_data_unlock(struct inode *inode, ++ struct vz_quota_datast *data) ++{ ++ qmblk_data_write_unlock(INODE_QLNK(inode)->qmblk); ++ inode_qmblk_unlock(inode->i_sb); ++ vzquota_qlnk_destroy(&data->qlnk); ++} ++ ++#if defined(CONFIG_VZ_QUOTA_UGID) ++/** ++ * vzquota_inode_transfer_call - call from vzquota_transfer ++ */ ++int vzquota_inode_transfer_call(struct inode *inode, struct iattr *iattr) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_datast data; ++ struct vz_quota_ilink qlnew; ++ int mask; ++ int ret; ++ ++ might_sleep(); ++ vzquota_qlnk_init(&qlnew); ++start: ++ qmblk = vzquota_inode_data(inode, &data); ++ ret = NO_QUOTA; ++ if (qmblk == VZ_QUOTA_BAD) ++ goto out_destr; ++ ret = QUOTA_OK; ++ if (qmblk == NULL) ++ goto out_destr; ++ qmblk_get(qmblk); ++ ++ ret = QUOTA_OK; ++ if (!(qmblk->dq_flags & VZDQUG_ON)) ++ /* no ugid quotas */ ++ goto out_unlock; ++ ++ mask = 0; ++ if ((iattr->ia_valid & ATTR_UID) && iattr->ia_uid != inode->i_uid) ++ mask |= 1 << USRQUOTA; ++ if ((iattr->ia_valid & ATTR_GID) && iattr->ia_gid != inode->i_gid) ++ mask |= 1 << GRPQUOTA; ++ while (1) { ++ if (vzquota_qlnk_is_empty(&qlnew) && ++ vzquota_qlnk_fill_attr(&qlnew, inode, iattr, mask, qmblk)) ++ break; ++ if (qlnew.qmblk == INODE_QLNK(inode)->qmblk && ++ qlnew.qmblk == qmblk) ++ goto finish; ++ if (vzquota_qlnk_reinit_attr(&qlnew, inode, qmblk)) ++ break; ++ } ++ ++ /* prepare for restart */ ++ vzquota_data_unlock(inode, &data); ++ qmblk_put(qmblk); ++ goto start; ++ ++finish: ++ /* all references obtained successfully */ ++ ret = vzquota_transfer_usage(inode, mask, &qlnew); ++ if (!ret) { ++ vzquota_qlnk_swap(&qlnew, INODE_QLNK(inode)); ++ set_qlnk_origin(INODE_QLNK(inode), VZ_QUOTAO_TRANS); ++ } ++out_unlock: ++ vzquota_data_unlock(inode, &data); ++ qmblk_put(qmblk); ++out_destr: ++ vzquota_qlnk_destroy(&qlnew); ++ return ret; ++} ++#endif ++ ++int vzquota_rename_check(struct inode *inode, ++ struct inode *old_dir, struct inode *new_dir) ++{ ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ilink qlnk1, qlnk2, qlnk3; ++ int c, ret; ++ ++ if (inode->i_sb != old_dir->i_sb || inode->i_sb != new_dir->i_sb) ++ return -1; ++ ++ might_sleep(); ++ ++ vzquota_qlnk_init(&qlnk1); ++ vzquota_qlnk_init(&qlnk2); ++ vzquota_qlnk_init(&qlnk3); ++ inode_qmblk_lock(inode->i_sb); ++ __vzquota_inode_init(inode, VZ_QUOTAO_INICAL); ++ __vzquota_inode_init(old_dir, VZ_QUOTAO_INICAL); ++ __vzquota_inode_init(new_dir, VZ_QUOTAO_INICAL); ++ ++ do { ++ c = 0; ++ if (vzquota_qlnk_is_empty(INODE_QLNK(inode)) || ++ !VZ_QUOTA_IS_ACTUAL(inode)) { ++ vzquota_inode_qmblk_recalc(inode, &qlnk1); ++ c++; ++ } ++ if (vzquota_qlnk_is_empty(INODE_QLNK(new_dir)) || ++ !VZ_QUOTA_IS_ACTUAL(new_dir)) { ++ vzquota_inode_qmblk_recalc(new_dir, &qlnk2); ++ c++; ++ } ++ } while (c); ++ ++ ret = 0; ++ qmblk = INODE_QLNK(inode)->qmblk; ++ if (qmblk != INODE_QLNK(new_dir)->qmblk) { ++ ret = -1; ++ while (vzquota_qlnk_is_empty(INODE_QLNK(old_dir)) || ++ !VZ_QUOTA_IS_ACTUAL(old_dir)) ++ vzquota_inode_qmblk_recalc(old_dir, &qlnk3); ++ if (qmblk != VZ_QUOTA_BAD && ++ !VZ_QUOTA_IS_NOQUOTA(qmblk, inode->i_sb) && ++ qmblk->dq_root_dentry->d_inode == inode && ++ VZ_QUOTA_IS_NOQUOTA(INODE_QLNK(new_dir)->qmblk, ++ inode->i_sb) && ++ VZ_QUOTA_IS_NOQUOTA(INODE_QLNK(old_dir)->qmblk, ++ inode->i_sb)) ++ /* quota root rename is allowed */ ++ ret = 0; ++ } ++ ++ inode_qmblk_unlock(inode->i_sb); ++ vzquota_qlnk_destroy(&qlnk3); ++ vzquota_qlnk_destroy(&qlnk2); ++ vzquota_qlnk_destroy(&qlnk1); ++ return ret; ++} ++ ++/* ++ * Scan parent subdirs and find busy dentries names/path ++ * @parent: parent dentry ++ * @buf: buffer to store path. ++ */ ++static void vzdquota_read_busy_dentries(struct dentry * parent, ++ struct vfsmount *vfsmnt, char *buf, int buflen) ++{ ++ struct dentry *this_parent = parent; ++ struct list_head *next; ++ char *res, *end, *start; ++ struct vfsmount *rootmnt; ++ struct dentry *root; ++ int len; ++ ++ if (!buf || buflen <= 0) ++ return; ++ ++ /* From d_path() ... */ ++ read_lock(¤t->fs->lock); ++ rootmnt = mntget(current->fs->rootmnt); ++ root = dget(current->fs->root); ++ read_unlock(¤t->fs->lock); ++ ++ spin_lock(&dcache_lock); ++ ++ end = buf + buflen; ++ start = buf; ++repeat: ++ next = this_parent->d_subdirs.next; ++resume: ++ while (next != &this_parent->d_subdirs) { ++ struct list_head *tmp = next; ++ struct dentry *dentry; ++ int subdirs; ++ ++ dentry = list_entry(tmp, struct dentry, d_u.d_child); ++ next = tmp->next; ++ subdirs = !list_empty(&dentry->d_subdirs); ++ ++ if (atomic_read(&dentry->d_count) && !subdirs) { ++ if (!buflen) ++ goto out; ++ /* ++ * Note: __d_path will store filename at the ++ * end of buf. ++ */ ++ res = __d_path(dentry, vfsmnt, root, rootmnt, ++ buf, buflen); ++ /* Exit if name is too long */ ++ if (IS_ERR(res)) ++ goto out; ++ ++ /* ++ * Move the string obtained by __d_path, ++ * behind the last dentry path in buf. ++ */ ++ len = end - res; ++ BUG_ON(len <= 0); ++ ++ memmove(buf, res, len); ++ ++ /* Trick: replace \0 by \n */ ++ if (buf != start) ++ *(char *)(buf - 1) = '\n'; ++ ++ buf += len; ++ buflen -= len; ++ } ++ ++ /* ++ * Descend a level if the d_subdirs list is non-empty. ++ */ ++ if (subdirs) { ++ this_parent = dentry; ++ goto repeat; ++ } ++ } ++ /* ++ * All done at this level ... ascend and resume the search. ++ */ ++ if (this_parent != parent) { ++ next = this_parent->d_u.d_child.next; ++ this_parent = this_parent->d_parent; ++ goto resume; ++ } ++out: ++ /* From d_path() ... */ ++ spin_unlock(&dcache_lock); ++ dput(root); ++ mntput(rootmnt); ++} ++ ++/* ---------------------------------------------------------------------- ++ * ++ * qmblk-related parts of on/off operations ++ * ++ * --------------------------------------------------------------------- */ ++ ++/** ++ * vzquota_check_dtree - check dentry tree if quota on/off is allowed ++ * ++ * This function doesn't allow quota to be turned on/off if some dentries in ++ * the tree have external references. ++ * In addition to technical reasons, it enforces user-space correctness: ++ * current usage (taken from or reported to the user space) can be meaningful ++ * and accurate only if the tree is not being modified. ++ * Side effect: additional vfsmount structures referencing the tree (bind ++ * mounts of tree nodes to some other places) are not allowed at on/off time. ++ * ++ * Store busy dentries path to the buf (if passed) in case of vzquota_off ++ * ioctl fail. ++ */ ++int vzquota_check_dtree(struct vz_quota_master *qmblk, int off, ++ char *buf, int buflen) ++{ ++ struct dentry *dentry; ++ int err, count; ++ ++ err = -EBUSY; ++ dentry = qmblk->dq_root_dentry; ++ ++ if (d_unhashed(dentry) && dentry != dentry->d_sb->s_root) ++ goto unhashed; ++ ++ /* attempt to shrink */ ++ if (!list_empty(&dentry->d_subdirs)) { ++ spin_unlock(&dcache_lock); ++ inode_qmblk_unlock(dentry->d_sb); ++ shrink_dcache_parent(dentry); ++ inode_qmblk_lock(dentry->d_sb); ++ spin_lock(&dcache_lock); ++ if (!list_empty(&dentry->d_subdirs)) { ++ spin_unlock(&dcache_lock); ++ vzdquota_read_busy_dentries(dentry, qmblk->dq_root_mnt, ++ buf, buflen); ++ spin_lock(&dcache_lock); ++ goto out; ++ } ++ ++ count = 1; ++ if (dentry == dentry->d_sb->s_root) ++ count += 2; /* sb and mnt refs */ ++ if (atomic_read(&dentry->d_count) < count) { ++ printk(KERN_ERR "%s: too small count %d vs %d.\n", ++ __FUNCTION__, ++ atomic_read(&dentry->d_count), count); ++ goto out; ++ } ++ if (atomic_read(&dentry->d_count) > count) ++ goto out; ++ } ++ ++ err = 0; ++out: ++ return err; ++ ++unhashed: ++ /* ++ * Quota root is removed. ++ * Allow to turn quota off, but not on. ++ */ ++ if (off) ++ err = 0; ++ goto out; ++} ++ ++int vzquota_on_qmblk(struct super_block *sb, struct inode *inode, ++ struct vz_quota_master *qmblk, char __user *ubuf) ++{ ++ struct vz_quota_ilink qlnk; ++ struct vz_quota_master *qold, *qnew; ++ int err; ++ char *buf; ++ ++ buf = (ubuf != NULL) ? (char *)__get_free_page(GFP_KERNEL) : NULL; ++ ++ might_sleep(); ++ ++ qold = NULL; ++ qnew = vzquota_alloc_fake(); ++ if (qnew == NULL) { ++ free_page((unsigned long)buf); ++ return -ENOMEM; ++ } ++ ++ vzquota_qlnk_init(&qlnk); ++ inode_qmblk_lock(sb); ++ __vzquota_inode_init(inode, VZ_QUOTAO_INICAL); ++ ++ spin_lock(&dcache_lock); ++ while (1) { ++ err = vzquota_check_dtree(qmblk, 0, buf, PAGE_SIZE); ++ if (err) ++ break; ++ if (!vzquota_inode_qmblk_set(inode, qmblk, &qlnk)) ++ break; ++ } ++ set_qlnk_origin(INODE_QLNK(inode), VZ_QUOTAO_ON); ++ spin_unlock(&dcache_lock); ++ ++ if (!err) { ++ qold = __VZ_QUOTA_NOQUOTA(sb); ++ qold->dq_flags |= VZDQ_NOACT; ++ __VZ_QUOTA_NOQUOTA(sb) = qnew; ++ } ++ ++ inode_qmblk_unlock(sb); ++ vzquota_qlnk_destroy(&qlnk); ++ if (qold != NULL) ++ qmblk_put(qold); ++ ++ if (buf) { ++ (void)copy_to_user(ubuf, buf, PAGE_SIZE); ++ free_page((unsigned long)buf); ++ } ++ return err; ++} ++ ++int vzquota_off_qmblk(struct super_block *sb, struct vz_quota_master *qmblk, ++ char __user *ubuf, int force) ++{ ++ int ret; ++ char *buf; ++ ++ buf = (ubuf != NULL) ? (char *)__get_free_page(GFP_KERNEL) : NULL; ++ ++ ret = 0; ++ inode_qmblk_lock(sb); ++ ++ spin_lock(&dcache_lock); ++ if (vzquota_check_dtree(qmblk, 1, buf, PAGE_SIZE) && !force) ++ ret = -EBUSY; ++ spin_unlock(&dcache_lock); ++ ++ if (!ret) ++ qmblk->dq_flags |= VZDQ_NOACT | VZDQ_NOQUOT; ++ inode_qmblk_unlock(sb); ++ ++ if (buf) { ++ (void)copy_to_user(ubuf, buf, PAGE_SIZE); ++ free_page((unsigned long)buf); ++ } ++ return ret; ++} ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * External interfaces ++ * ++ * ---------------------------------------------------------------------*/ ++ ++static int vzquota_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ int err; ++ ++ switch (cmd) { ++ case VZCTL_QUOTA_NEW_CTL: { ++ struct vzctl_quotactl qb; ++ ++ err = -EFAULT; ++ if (copy_from_user(&qb, (void __user *)arg, sizeof(qb))) ++ break; ++ err = do_vzquotactl(qb.cmd, qb.quota_id, ++ qb.qstat, qb.ve_root, 0); ++ break; ++ } ++#ifdef CONFIG_VZ_QUOTA_UGID ++ case VZCTL_QUOTA_UGID_CTL: { ++ struct vzctl_quotaugidctl qub; ++ ++ err = -EFAULT; ++ if (copy_from_user(&qub, (void __user *)arg, sizeof(qub))) ++ break; ++ err = do_vzquotaugidctl(qub.cmd, qub.quota_id, ++ qub.ugid_index, qub.ugid_size, qub.addr, 0); ++ break; ++ } ++#endif ++ default: ++ err = -ENOTTY; ++ } ++ return err; ++} ++ ++#ifdef CONFIG_COMPAT ++static int compat_vzquota_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ int err; ++ ++ switch (cmd) { ++ case VZCTL_COMPAT_QUOTA_CTL: { ++ struct compat_vzctl_quotactl cs; ++ ++ err = -EFAULT; ++ if (copy_from_user(&cs, (void *)arg, sizeof(cs))) ++ break; ++ err = do_vzquotactl(cs.cmd, cs.quota_id, ++ compat_ptr(cs.qstat), ++ compat_ptr(cs.ve_root), 1); ++ break; ++ } ++#ifdef CONFIG_VZ_QUOTA_UGID ++ case VZCTL_COMPAT_QUOTA_UGID_CTL: { ++ struct compat_vzctl_quotaugidctl cs; ++ ++ err = -EFAULT; ++ if (copy_from_user(&cs, (void *)arg, sizeof(cs))) ++ break; ++ ++ err = do_vzquotaugidctl(cs.cmd, cs.quota_id, cs.ugid_index, ++ cs.ugid_size, compat_ptr(cs.addr), 1); ++ break; ++ } ++#endif ++ default: ++ err = -ENOIOCTLCMD; ++ } ++ return err; ++} ++#endif ++ ++static struct vzioctlinfo vzdqcalls = { ++ .type = VZDQCTLTYPE, ++ .ioctl = vzquota_ioctl, ++#ifdef CONFIG_COMPAT ++ .compat_ioctl = compat_vzquota_ioctl, ++#endif ++ .owner = THIS_MODULE, ++}; ++ ++/** ++ * vzquota_dstat - get quota usage info for virtual superblock ++ */ ++static int vzquota_dstat(struct super_block *super, struct dq_stat *qstat) ++{ ++ struct vz_quota_master *qmblk; ++ ++ qmblk = vzquota_find_qmblk(super); ++ if (qmblk == NULL) ++ return -ENOENT; ++ if (qmblk == VZ_QUOTA_BAD) { ++ memset(qstat, 0, sizeof(*qstat)); ++ return 0; ++ } ++ ++ qmblk_data_read_lock(qmblk); ++ memcpy(qstat, &qmblk->dq_stat, sizeof(*qstat)); ++ qmblk_data_read_unlock(qmblk); ++ qmblk_put(qmblk); ++ return 0; ++} ++ ++ ++/* ---------------------------------------------------------------------- ++ * ++ * Init/exit helpers ++ * ++ * ---------------------------------------------------------------------*/ ++ ++static int vzquota_cache_init(void) ++{ ++ int i; ++ ++ vzquota_cachep = kmem_cache_create("vz_quota_master", ++ sizeof(struct vz_quota_master), ++ 0, SLAB_HWCACHE_ALIGN, NULL); ++ if (vzquota_cachep == NULL) { ++ printk(KERN_ERR "Cannot create VZ_QUOTA SLAB cache\n"); ++ goto nomem2; ++ } ++ for (i = 0; i < VZ_QUOTA_HASH_SIZE; i++) ++ INIT_LIST_HEAD(&vzquota_hash_table[i]); ++ ++ return 0; ++ ++nomem2: ++ return -ENOMEM; ++} ++ ++static void vzquota_cache_release(void) ++{ ++ int i; ++ ++ /* sanity check */ ++ for (i = 0; i < VZ_QUOTA_HASH_SIZE; i++) ++ if (!list_empty(&vzquota_hash_table[i])) ++ BUG(); ++ ++ /* release caches */ ++ kmem_cache_destroy(vzquota_cachep); ++ vzquota_cachep = NULL; ++} ++ ++static int quota_notifier_call(struct vnotifier_block *self, ++ unsigned long n, void *data, int err) ++{ ++ struct virt_info_quota *viq; ++ struct super_block *sb; ++ ++ viq = (struct virt_info_quota *)data; ++ switch (n) { ++ case VIRTINFO_QUOTA_ON: ++ err = NOTIFY_BAD; ++ if (!try_module_get(THIS_MODULE)) ++ break; ++ sb = viq->super; ++ memset(&sb->s_dquot.info, 0, sizeof(sb->s_dquot.info)); ++ INIT_LIST_HEAD(&sb->s_dquot.info[USRQUOTA].dqi_dirty_list); ++ INIT_LIST_HEAD(&sb->s_dquot.info[GRPQUOTA].dqi_dirty_list); ++ err = NOTIFY_OK; ++ break; ++ case VIRTINFO_QUOTA_OFF: ++ module_put(THIS_MODULE); ++ err = NOTIFY_OK; ++ break; ++ case VIRTINFO_QUOTA_GETSTAT: ++ err = NOTIFY_BAD; ++ if (vzquota_dstat(viq->super, viq->qstat)) ++ break; ++ err = NOTIFY_OK; ++ break; ++ case VIRTINFO_QUOTA_DISABLE: ++ err = NOTIFY_OK; ++ vzquota_inode_off((struct inode *)data); ++ break; ++ } ++ return err; ++} ++ ++struct vnotifier_block quota_notifier_block = { ++ .notifier_call = quota_notifier_call, ++ .priority = INT_MAX, ++}; ++ ++/* ---------------------------------------------------------------------- ++ * ++ * Init/exit procedures ++ * ++ * ---------------------------------------------------------------------*/ ++ ++static int __init vzquota_init(void) ++{ ++ int err; ++ ++ if ((err = vzquota_cache_init()) != 0) ++ goto out_cache; ++ ++ if ((err = vzquota_proc_init()) != 0) ++ goto out_proc; ++ ++#ifdef CONFIG_VZ_QUOTA_UGID ++ if ((err = vzquota_ugid_init()) != 0) ++ goto out_ugid; ++#endif ++ ++ init_MUTEX(&vz_quota_sem); ++ vzioctl_register(&vzdqcalls); ++ virtinfo_notifier_register(VITYPE_QUOTA, "a_notifier_block); ++#if defined(CONFIG_VZ_QUOTA_UGID) && defined(CONFIG_PROC_FS) ++ vzaquota_init(); ++#endif ++ ++ return 0; ++ ++#ifdef CONFIG_VZ_QUOTA_UGID ++out_ugid: ++ vzquota_proc_release(); ++#endif ++out_proc: ++ vzquota_cache_release(); ++out_cache: ++ return err; ++} ++ ++#if defined(VZ_QUOTA_UNLOAD) ++static void __exit vzquota_release(void) ++{ ++ virtinfo_notifier_unregister(VITYPE_QUOTA, "a_notifier_block); ++ vzioctl_unregister(&vzdqcalls); ++#ifdef CONFIG_VZ_QUOTA_UGID ++#ifdef CONFIG_PROC_FS ++ vzaquota_fini(); ++#endif ++ vzquota_ugid_release(); ++#endif ++ vzquota_proc_release(); ++ vzquota_cache_release(); ++} ++#endif ++ ++MODULE_AUTHOR("SWsoft "); ++MODULE_DESCRIPTION("Virtuozzo Disk Quota"); ++MODULE_LICENSE("GPL v2"); ++ ++module_init(vzquota_init) ++#if defined(VZ_QUOTA_UNLOAD) ++module_exit(vzquota_release) ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./grsecurity/Kconfig debian/binary-custom.d/openvz/src/grsecurity/Kconfig +--- ./grsecurity/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/grsecurity/Kconfig 2012-11-13 15:20:14.364569103 +0000 +@@ -0,0 +1,129 @@ ++# ++# grecurity configuration ++# ++ ++menu "Grsecurity" ++ ++config GRKERNSEC ++ bool "Grsecurity" ++ help ++ If you say Y here, you will be able to configure many features ++ that will enhance the security of your system. It is highly ++ recommended that you say Y here and read through the help ++ for each option so that you fully understand the features and ++ can evaluate their usefulness for your machine. ++ ++menu "Executable Protections" ++depends on GRKERNSEC ++ ++config GRKERNSEC_TPE ++ bool "Trusted Path Execution (TPE)" ++ help ++ If you say Y here, you will be able to choose a gid to add to the ++ supplementary groups of users you want to mark as "untrusted." ++ These users will not be able to execute any files that are not in ++ root-owned directories writable only by root. If the sysctl option ++ is enabled, a sysctl option with name "tpe" is created. ++ ++config GRKERNSEC_TPE_ALL ++ bool "Partially restrict non-root users" ++ depends on GRKERNSEC_TPE ++ help ++ If you say Y here, All non-root users other than the ones in the ++ group specified in the main TPE option will only be allowed to ++ execute files in directories they own that are not group or ++ world-writable, or in directories owned by root and writable only by ++ root. If the sysctl option is enabled, a sysctl option with name ++ "tpe_restrict_all" is created. ++ ++config GRKERNSEC_TPE_INVERT ++ bool "Invert GID option" ++ depends on GRKERNSEC_TPE ++ help ++ If you say Y here, the group you specify in the TPE configuration will ++ decide what group TPE restrictions will be *disabled* for. This ++ option is useful if you want TPE restrictions to be applied to most ++ users on the system. ++ ++config GRKERNSEC_TPE_GID ++ int "GID for untrusted users" ++ depends on GRKERNSEC_TPE && !GRKERNSEC_TPE_INVERT ++ default 1005 ++ help ++ If you have selected the "Invert GID option" above, setting this ++ GID determines what group TPE restrictions will be *disabled* for. ++ If you have not selected the "Invert GID option" above, setting this ++ GID determines what group TPE restrictions will be *enabled* for. ++ If the sysctl option is enabled, a sysctl option with name "tpe_gid" ++ is created. ++ ++config GRKERNSEC_TPE_GID ++ int "GID for trusted users" ++ depends on GRKERNSEC_TPE && GRKERNSEC_TPE_INVERT ++ default 1005 ++ help ++ If you have selected the "Invert GID option" above, setting this ++ GID determines what group TPE restrictions will be *disabled* for. ++ If you have not selected the "Invert GID option" above, setting this ++ GID determines what group TPE restrictions will be *enabled* for. ++ If the sysctl option is enabled, a sysctl option with name "tpe_gid" ++ is created. ++ ++endmenu ++menu "Sysctl support" ++depends on GRKERNSEC && SYSCTL ++ ++config GRKERNSEC_SYSCTL ++ bool "Sysctl support" ++ help ++ If you say Y here, you will be able to change the options that ++ grsecurity runs with at bootup, without having to recompile your ++ kernel. You can echo values to files in /proc/sys/kernel/grsecurity ++ to enable (1) or disable (0) various features. All the sysctl entries ++ are mutable until the "grsec_lock" entry is set to a non-zero value. ++ All features enabled in the kernel configuration are disabled at boot ++ if you do not say Y to the "Turn on features by default" option. ++ All options should be set at startup, and the grsec_lock entry should ++ be set to a non-zero value after all the options are set. ++ *THIS IS EXTREMELY IMPORTANT* ++ ++config GRKERNSEC_SYSCTL_ON ++ bool "Turn on features by default" ++ depends on GRKERNSEC_SYSCTL ++ help ++ If you say Y here, instead of having all features enabled in the ++ kernel configuration disabled at boot time, the features will be ++ enabled at boot time. It is recommended you say Y here unless ++ there is some reason you would want all sysctl-tunable features to ++ be disabled by default. As mentioned elsewhere, it is important ++ to enable the grsec_lock entry once you have finished modifying ++ the sysctl entries. ++ ++endmenu ++ ++menu "Logging Options" ++depends on GRKERNSEC ++ ++config GRKERNSEC_FLOODTIME ++ int "Seconds in between log messages (minimum)" ++ default 10 ++ help ++ This option allows you to enforce the number of seconds between ++ grsecurity log messages. The default should be suitable for most ++ people, however, if you choose to change it, choose a value small enough ++ to allow informative logs to be produced, but large enough to ++ prevent flooding. ++ ++config GRKERNSEC_FLOODBURST ++ int "Number of messages in a burst (maximum)" ++ default 4 ++ help ++ This option allows you to choose the maximum number of messages allowed ++ within the flood time interval you chose in a separate option. The ++ default should be suitable for most people, however if you find that ++ many of your logs are being interpreted as flooding, you may want to ++ raise this value. ++ ++endmenu ++ ++endmenu +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./grsecurity/Makefile debian/binary-custom.d/openvz/src/grsecurity/Makefile +--- ./grsecurity/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/grsecurity/Makefile 2012-11-13 15:20:14.364569103 +0000 +@@ -0,0 +1,15 @@ ++# grsecurity's ACL system was originally written in 2001 by Michael Dalton ++# during 2001-2005 it has been completely redesigned by Brad Spengler ++# into an RBAC system ++# ++# All code in this directory and various hooks inserted throughout the kernel ++# are copyright Brad Spengler, and released under the GPL v2 or higher ++ ++obj-y = grsec_tpe.o grsec_sysctl.o ++ ++obj-$(CONFIG_GRKERNSEC) += grsec_init.o gracl.o grsec_log.o ++ ++ifndef CONFIG_GRKERNSEC ++obj-y += grsec_disabled.o ++endif ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./grsecurity/gracl.c debian/binary-custom.d/openvz/src/grsecurity/gracl.c +--- ./grsecurity/gracl.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/grsecurity/gracl.c 2012-11-13 15:20:14.364569103 +0000 +@@ -0,0 +1,137 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++extern char *gr_shared_page[4]; ++ ++static char * ++gen_full_path(struct dentry *dentry, struct vfsmount *vfsmnt, ++ struct dentry *root, struct vfsmount *rootmnt, char *buf, int buflen) ++{ ++ char *end = buf + buflen; ++ char *retval; ++ int namelen = 0; ++ ++ *--end = '\0'; ++ ++ retval = end - 1; ++ *retval = '/'; ++ ++ if (dentry == root && vfsmnt == rootmnt) ++ return retval; ++ if (dentry != vfsmnt->mnt_root && !IS_ROOT(dentry)) { ++ namelen = strlen(dentry->d_name.name); ++ buflen -= namelen; ++ if (buflen < 2) ++ goto err; ++ if (dentry->d_parent != root || vfsmnt != rootmnt) ++ buflen--; ++ } ++ ++ retval = __d_path(dentry->d_parent, vfsmnt, root, rootmnt, buf, buflen); ++ if (unlikely(IS_ERR(retval))) ++err: ++ retval = strcpy(buf, ""); ++ else if (namelen != 0) { ++ end = buf + buflen - 1; // accounts for null termination ++ if (dentry->d_parent != root || vfsmnt != rootmnt) ++ *end++ = '/'; // accounted for above with buflen-- ++ memcpy(end, dentry->d_name.name, namelen); ++ } ++ ++ return retval; ++} ++ ++static char * ++d_real_path(const struct dentry *dentry, const struct vfsmount *vfsmnt, ++ char *buf, int buflen) ++{ ++ char *res; ++ struct dentry *root; ++ struct vfsmount *rootmnt; ++ ++ /* we can't use real_root, real_root_mnt, because they belong only to the RBAC system */ ++#ifdef CONFIG_VE ++ /* Don't use child_reaper, because it's VE0 process */ ++ root = dget(get_exec_env()->fs_root); ++ rootmnt = mntget(get_exec_env()->fs_rootmnt); ++#else ++ read_lock(&child_reaper->fs->lock); ++ root = dget(child_reaper->fs->root); ++ rootmnt = mntget(child_reaper->fs->rootmnt); ++ read_unlock(&child_reaper->fs->lock); ++#endif ++ ++ spin_lock(&dcache_lock); ++ res = gen_full_path((struct dentry *)dentry, (struct vfsmount *)vfsmnt, root, rootmnt, buf, buflen); ++ spin_unlock(&dcache_lock); ++ ++ dput(root); ++ mntput(rootmnt); ++ return res; ++} ++ ++char * ++gr_to_filename(const struct dentry *dentry, const struct vfsmount *mnt) ++{ ++ return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[0], smp_processor_id()), ++ PAGE_SIZE); ++} ++ ++char * ++gr_to_filename2(const struct dentry *dentry, const struct vfsmount *mnt) ++{ ++ return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[2], smp_processor_id()), ++ PAGE_SIZE); ++} ++ ++char * ++gr_to_filename3(const struct dentry *dentry, const struct vfsmount *mnt) ++{ ++ return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[3], smp_processor_id()), ++ PAGE_SIZE); ++} ++ ++int ++gr_acl_handle_mmap(const struct file *file, const unsigned long prot) ++{ ++ if (unlikely(!file || !(prot & PROT_EXEC))) ++ return 1; ++ ++ if (!gr_tpe_allow(file)) ++ return 0; ++ return 1; ++} ++ ++int ++gr_acl_handle_mprotect(const struct file *file, const unsigned long prot) ++{ ++ if (unlikely(!file || !(prot & PROT_EXEC))) ++ return 1; ++ ++ if (!gr_tpe_allow(file)) ++ return 0; ++ return 1; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./grsecurity/grsec_disabled.c debian/binary-custom.d/openvz/src/grsecurity/grsec_disabled.c +--- ./grsecurity/grsec_disabled.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/grsecurity/grsec_disabled.c 2012-11-13 15:20:14.364569103 +0000 +@@ -0,0 +1,39 @@ ++#include ++#include ++#include ++ ++void ++gr_copy_label(struct task_struct *tsk) ++{ ++ return; ++} ++ ++int ++gr_acl_handle_mmap(const struct file *file, const unsigned long prot, ++ unsigned int *vm_flags) ++{ ++ return 1; ++} ++ ++void ++grsecurity_init(void) ++{ ++ return; ++} ++ ++void ++gr_acl_handle_exit(void) ++{ ++ return; ++} ++ ++int ++gr_acl_handle_mprotect(const struct file *file, const unsigned long prot) ++{ ++ return 1; ++} ++ ++void grsecurity_setup(void) ++{ ++} ++EXPORT_SYMBOL(grsecurity_setup); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./grsecurity/grsec_init.c debian/binary-custom.d/openvz/src/grsecurity/grsec_init.c +--- ./grsecurity/grsec_init.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/grsecurity/grsec_init.c 2012-11-13 15:20:14.364569103 +0000 +@@ -0,0 +1,89 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef CONFIG_VE ++#include ++#else ++int grsec_enable_tpe; ++int grsec_tpe_gid; ++int grsec_enable_tpe_all; ++int grsec_lock; ++#endif ++ ++spinlock_t grsec_alert_lock = SPIN_LOCK_UNLOCKED; ++ ++unsigned long grsec_alert_wtime = 0; ++unsigned long grsec_alert_fyet = 0; ++ ++spinlock_t grsec_audit_lock = SPIN_LOCK_UNLOCKED; ++ ++char *gr_shared_page[4]; ++ ++char *gr_alert_log_fmt; ++char *gr_audit_log_fmt; ++ ++char *gr_alert_log_buf; ++char *gr_audit_log_buf; ++ ++void grsecurity_setup(void) ++{ ++#if !defined(CONFIG_GRKERNSEC_SYSCTL) || defined(CONFIG_GRKERNSEC_SYSCTL_ON) ++#ifndef CONFIG_GRKERNSEC_SYSCTL ++ grsec_lock = 1; ++#endif ++#ifdef CONFIG_GRKERNSEC_TPE ++ grsec_enable_tpe = 1; ++ grsec_tpe_gid = CONFIG_GRKERNSEC_TPE_GID; ++#ifdef CONFIG_GRKERNSEC_TPE_ALL ++ grsec_enable_tpe_all = 1; ++#endif ++#endif ++#endif ++} ++EXPORT_SYMBOL(grsecurity_setup); ++ ++void ++grsecurity_init(void) ++{ ++ int j; ++ /* create the per-cpu shared pages */ ++ ++ for (j = 0; j < 4; j++) { ++ gr_shared_page[j] = (char *)__alloc_percpu(PAGE_SIZE); ++ if (gr_shared_page[j] == NULL) { ++ panic("Unable to allocate grsecurity shared page"); ++ return; ++ } ++ } ++ ++ /* allocate log buffers */ ++ gr_alert_log_fmt = kmalloc(512, GFP_KERNEL); ++ if (!gr_alert_log_fmt) { ++ panic("Unable to allocate grsecurity alert log format buffer"); ++ return; ++ } ++ gr_audit_log_fmt = kmalloc(512, GFP_KERNEL); ++ if (!gr_audit_log_fmt) { ++ panic("Unable to allocate grsecurity audit log format buffer"); ++ return; ++ } ++ gr_alert_log_buf = (char *) get_zeroed_page(GFP_KERNEL); ++ if (!gr_alert_log_buf) { ++ panic("Unable to allocate grsecurity alert log buffer"); ++ return; ++ } ++ gr_audit_log_buf = (char *) get_zeroed_page(GFP_KERNEL); ++ if (!gr_audit_log_buf) { ++ panic("Unable to allocate grsecurity audit log buffer"); ++ return; ++ } ++ grsecurity_setup(); ++ ++ return; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./grsecurity/grsec_log.c debian/binary-custom.d/openvz/src/grsecurity/grsec_log.c +--- ./grsecurity/grsec_log.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/grsecurity/grsec_log.c 2012-11-13 15:20:14.364569103 +0000 +@@ -0,0 +1,122 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define BEGIN_LOCKS(x) \ ++ if (x != GR_DO_AUDIT) \ ++ spin_lock(&grsec_alert_lock); \ ++ else \ ++ spin_lock(&grsec_audit_lock) ++ ++#define END_LOCKS(x) \ ++ if (x != GR_DO_AUDIT) \ ++ spin_unlock(&grsec_alert_lock); \ ++ else \ ++ spin_unlock(&grsec_audit_lock); ++ ++enum { ++ FLOODING, ++ NO_FLOODING ++}; ++ ++extern char *gr_alert_log_fmt; ++extern char *gr_audit_log_fmt; ++extern char *gr_alert_log_buf; ++extern char *gr_audit_log_buf; ++ ++static int gr_log_start(int audit) ++{ ++ char *loglevel = (audit == GR_DO_AUDIT) ? KERN_INFO : KERN_ALERT; ++ char *fmt = (audit == GR_DO_AUDIT) ? gr_audit_log_fmt : gr_alert_log_fmt; ++ char *buf = (audit == GR_DO_AUDIT) ? gr_audit_log_buf : gr_alert_log_buf; ++ ++ if (audit == GR_DO_AUDIT) ++ goto set_fmt; ++ ++ if (!grsec_alert_wtime || jiffies - grsec_alert_wtime > CONFIG_GRKERNSEC_FLOODTIME * HZ) { ++ grsec_alert_wtime = jiffies; ++ grsec_alert_fyet = 0; ++ } else if ((jiffies - grsec_alert_wtime < CONFIG_GRKERNSEC_FLOODTIME * HZ) && (grsec_alert_fyet < CONFIG_GRKERNSEC_FLOODBURST)) { ++ grsec_alert_fyet++; ++ } else if (grsec_alert_fyet == CONFIG_GRKERNSEC_FLOODBURST) { ++ grsec_alert_wtime = jiffies; ++ grsec_alert_fyet++; ++ ve_printk(VE_LOG, KERN_ALERT "grsec: more alerts, logging disabled for %d seconds\n", CONFIG_GRKERNSEC_FLOODTIME); ++ return FLOODING; ++ } else return FLOODING; ++ ++set_fmt: ++ memset(buf, 0, PAGE_SIZE); ++ sprintf(fmt, "%s%s", loglevel, "grsec: "); ++ strcpy(buf, fmt); ++ ++ return NO_FLOODING; ++} ++ ++static void gr_log_middle(int audit, const char *msg, va_list ap) ++{ ++ char *buf = (audit == GR_DO_AUDIT) ? gr_audit_log_buf : gr_alert_log_buf; ++ unsigned int len = strlen(buf); ++ ++ vsnprintf(buf + len, PAGE_SIZE - len - 1, msg, ap); ++ ++ return; ++} ++ ++static void gr_log_middle_varargs(int audit, const char *msg, ...) ++{ ++ char *buf = (audit == GR_DO_AUDIT) ? gr_audit_log_buf : gr_alert_log_buf; ++ unsigned int len = strlen(buf); ++ va_list ap; ++ ++ va_start(ap, msg); ++ vsnprintf(buf + len, PAGE_SIZE - len - 1, msg, ap); ++ va_end(ap); ++ ++ return; ++} ++ ++static void gr_log_end(int audit) ++{ ++ char *buf = (audit == GR_DO_AUDIT) ? gr_audit_log_buf : gr_alert_log_buf; ++ unsigned int len = strlen(buf); ++ ++ snprintf(buf + len, PAGE_SIZE - len - 1, DEFAULTSECMSG, DEFAULTSECARGS(current)); ++ ve_printk(VE_LOG, "%s\n", buf); ++ ++ return; ++} ++ ++void gr_log_varargs(int audit, const char *msg, int argtypes, ...) ++{ ++ int logtype; ++ struct dentry *dentry; ++ struct vfsmount *mnt; ++ va_list ap; ++ ++ BEGIN_LOCKS(audit); ++ logtype = gr_log_start(audit); ++ if (logtype == FLOODING) { ++ END_LOCKS(audit); ++ return; ++ } ++ va_start(ap, argtypes); ++ switch (argtypes) { ++ /* ++ * Only GR_FILENAME is now supported in VZ ++ */ ++ case GR_FILENAME: ++ dentry = va_arg(ap, struct dentry *); ++ mnt = va_arg(ap, struct vfsmount *); ++ gr_log_middle_varargs(audit, msg, gr_to_filename(dentry, mnt)); ++ break; ++ default: ++ gr_log_middle(audit, msg, ap); ++ } ++ va_end(ap); ++ gr_log_end(audit); ++ END_LOCKS(audit); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./grsecurity/grsec_sysctl.c debian/binary-custom.d/openvz/src/grsecurity/grsec_sysctl.c +--- ./grsecurity/grsec_sysctl.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/grsecurity/grsec_sysctl.c 2012-11-13 15:20:14.364569103 +0000 +@@ -0,0 +1,85 @@ ++#include ++#include ++#include ++#include ++#include ++ ++int ++gr_handle_sysctl_mod(const char *dirname, const char *name, const int op) ++{ ++#ifdef CONFIG_GRKERNSEC_SYSCTL ++ if (!strcmp(dirname, "grsecurity") && grsec_lock && (op & 002)) { ++ gr_log_str(GR_DONT_AUDIT, GR_SYSCTL_MSG, name); ++ return -EACCES; ++ } ++#endif ++ return 0; ++} ++ ++#ifdef CONFIG_GRKERNSEC_SYSCTL ++static int grsec_proc_dointvec(ctl_table *ctl, int write, struct file * filp, ++ void __user *buffer, size_t *lenp, loff_t *ppos) ++{ ++ int ret; ++#ifdef CONFIG_VE ++ struct ctl_table fake_table; ++ struct ve_struct *env = get_exec_env(); ++ ++ if (!ve_is_super(env)) { ++ memcpy(&fake_table, ctl, sizeof(struct ctl_table)); ++ fake_table.data = (char *)((unsigned long)&env->grsec + ++ (unsigned long)ctl->data - ++ (unsigned long)&get_ve0()->grsec); ++ ctl = &fake_table; ++ } ++#endif ++ ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); ++ return ret; ++} ++ ++enum {GS_TPE = 1, GS_TPE_GID, GS_TPE_ALL, GS_LOCK}; ++ ++ctl_table grsecurity_table[] = { ++#ifdef CONFIG_GRKERNSEC_TPE ++ { ++ .ctl_name = GS_TPE, ++ .procname = "tpe", ++ .data = &ve0.grsec.enable_tpe, ++ .maxlen = sizeof(int), ++ .mode = 0600, ++ .proc_handler = &grsec_proc_dointvec, ++ .virt_handler = 1, ++ }, ++ { ++ .ctl_name = GS_TPE_GID, ++ .procname = "tpe_gid", ++ .data = &ve0.grsec.tpe_gid, ++ .maxlen = sizeof(int), ++ .mode = 0600, ++ .proc_handler = &grsec_proc_dointvec, ++ .virt_handler = 1, ++ }, ++#endif ++#ifdef CONFIG_GRKERNSEC_TPE_ALL ++ { ++ .ctl_name = GS_TPE_ALL, ++ .procname = "tpe_restrict_all", ++ .data = &ve0.grsec.enable_tpe_all, ++ .maxlen = sizeof(int), ++ .mode = 0600, ++ .proc_handler = &grsec_proc_dointvec, ++ .virt_handler = 1, ++ }, ++#endif ++ { ++ .ctl_name = GS_LOCK, ++ .procname = "grsec_lock", ++ .data = &ve0.grsec.lock, ++ .maxlen = sizeof(int), ++ .mode = 0600, ++ .proc_handler = &grsec_proc_dointvec, ++ .virt_handler = 1, ++ }, ++ { .ctl_name = 0 } ++}; ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./grsecurity/grsec_tpe.c debian/binary-custom.d/openvz/src/grsecurity/grsec_tpe.c +--- ./grsecurity/grsec_tpe.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/grsecurity/grsec_tpe.c 2012-11-13 15:20:14.364569103 +0000 +@@ -0,0 +1,37 @@ ++#include ++#include ++#include ++#include ++#include ++ ++extern int gr_acl_tpe_check(void); ++ ++int ++gr_tpe_allow(const struct file *file) ++{ ++#ifdef CONFIG_GRKERNSEC_TPE ++ struct inode *inode = file->f_dentry->d_parent->d_inode; ++ ++ if (current->uid && ((grsec_enable_tpe && ++#ifdef CONFIG_GRKERNSEC_TPE_INVERT ++ !in_group_p(grsec_tpe_gid) ++#else ++ in_group_p(grsec_tpe_gid) ++#endif ++ )) && ++ (inode->i_uid || (!inode->i_uid && ((inode->i_mode & S_IWGRP) || ++ (inode->i_mode & S_IWOTH))))) { ++ gr_log_fs_generic(GR_DONT_AUDIT, GR_EXEC_TPE_MSG, file->f_dentry, file->f_vfsmnt); ++ return 0; ++ } ++#ifdef CONFIG_GRKERNSEC_TPE_ALL ++ if (current->uid && grsec_enable_tpe && grsec_enable_tpe_all && ++ ((inode->i_uid && (inode->i_uid != current->uid)) || ++ (inode->i_mode & S_IWGRP) || (inode->i_mode & S_IWOTH))) { ++ gr_log_fs_generic(GR_DONT_AUDIT, GR_EXEC_TPE_MSG, file->f_dentry, file->f_vfsmnt); ++ return 0; ++ } ++#endif ++#endif ++ return 1; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-ia64/mman.h debian/binary-custom.d/openvz/src/include/asm-ia64/mman.h +--- ./include/asm-ia64/mman.h 2012-06-12 16:25:23.762312505 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-ia64/mman.h 2012-11-13 15:20:14.620569092 +0000 +@@ -18,6 +18,7 @@ + #define MAP_NORESERVE 0x04000 /* don't check for reservations */ + #define MAP_POPULATE 0x08000 /* populate (prefault) pagetables */ + #define MAP_NONBLOCK 0x10000 /* do not block on IO */ ++#define MAP_EXECPRIO 0x20000 /* soft ubc charge */ + + #define MCL_CURRENT 1 /* lock all current mappings */ + #define MCL_FUTURE 2 /* lock all future mappings */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-ia64/pgalloc.h debian/binary-custom.d/openvz/src/include/asm-ia64/pgalloc.h +--- ./include/asm-ia64/pgalloc.h 2012-06-12 16:25:23.762312505 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-ia64/pgalloc.h 2012-11-13 15:20:14.624569091 +0000 +@@ -20,11 +20,13 @@ + #include + #include + ++#include ++ + #include + + static inline pgd_t *pgd_alloc(struct mm_struct *mm) + { +- return quicklist_alloc(0, GFP_KERNEL, NULL); ++ return quicklist_alloc(0, GFP_KERNEL_UBC|__GFP_SOFT_UBC, NULL); + } + + static inline void pgd_free(pgd_t * pgd) +@@ -41,7 +43,7 @@ + + static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) + { +- return quicklist_alloc(0, GFP_KERNEL, NULL); ++ return quicklist_alloc(0, GFP_KERNEL_UBC|__GFP_SOFT_UBC, NULL); + } + + static inline void pud_free(pud_t * pud) +@@ -59,7 +61,7 @@ + + static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) + { +- return quicklist_alloc(0, GFP_KERNEL, NULL); ++ return quicklist_alloc(0, GFP_KERNEL_UBC|__GFP_SOFT_UBC, NULL); + } + + static inline void pmd_free(pmd_t * pmd) +@@ -84,7 +86,7 @@ + static inline struct page *pte_alloc_one(struct mm_struct *mm, + unsigned long addr) + { +- void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); ++ void *pg = quicklist_alloc(0, GFP_KERNEL_UBC|__GFP_SOFT_UBC, NULL); + return pg ? virt_to_page(pg) : NULL; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-ia64/processor.h debian/binary-custom.d/openvz/src/include/asm-ia64/processor.h +--- ./include/asm-ia64/processor.h 2012-06-12 16:25:23.762312505 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-ia64/processor.h 2012-11-13 15:20:14.624569091 +0000 +@@ -297,7 +297,7 @@ + regs->loadrs = 0; \ + regs->r8 = get_dumpable(current->mm); /* set "don't zap registers" flag */ \ + regs->r12 = new_sp - 16; /* allocate 16 byte scratch area */ \ +- if (unlikely(!get_dumpable(current->mm))) { \ ++ if (unlikely(!get_dumpable(current->mm) || !current->mm->vps_dumpable)) { \ + /* \ + * Zap scratch regs to avoid leaking bits between processes with different \ + * uid/privileges. \ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-ia64/unistd.h debian/binary-custom.d/openvz/src/include/asm-ia64/unistd.h +--- ./include/asm-ia64/unistd.h 2012-06-12 16:25:23.774312505 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-ia64/unistd.h 2012-11-13 15:20:14.636569095 +0000 +@@ -299,11 +299,23 @@ + #define __NR_signalfd 1307 + #define __NR_timerfd 1308 + #define __NR_eventfd 1309 ++#define __NR_fairsched_vcpus 1499 ++#define __NR_fairsched_mknod 1500 ++#define __NR_fairsched_rmnod 1501 ++#define __NR_fairsched_chwt 1502 ++#define __NR_fairsched_mvpr 1503 ++#define __NR_fairsched_rate 1504 ++#define __NR_getluid 1505 ++#define __NR_setluid 1506 ++#define __NR_setublimit 1507 ++#define __NR_ubstat 1508 ++#define __NR_lchmod 1509 ++#define __NR_lutime 1510 + + #ifdef __KERNEL__ + + +-#define NR_syscalls 286 /* length of syscall table */ ++#define NR_syscalls 487 /* length of syscall table */ + + /* + * The following defines stop scripts/checksyscalls.sh from complaining about +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-powerpc/elf.h debian/binary-custom.d/openvz/src/include/asm-powerpc/elf.h +--- ./include/asm-powerpc/elf.h 2012-06-12 16:25:23.858312502 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-powerpc/elf.h 2012-11-13 15:20:14.764569086 +0000 +@@ -276,7 +276,8 @@ + #define ARCH_HAS_SETUP_ADDITIONAL_PAGES + struct linux_binprm; + extern int arch_setup_additional_pages(struct linux_binprm *bprm, +- int executable_stack); ++ int executable_stack, ++ unsigned long map_address); + #define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b); + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-powerpc/mman.h debian/binary-custom.d/openvz/src/include/asm-powerpc/mman.h +--- ./include/asm-powerpc/mman.h 2012-06-12 16:25:23.866312501 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-powerpc/mman.h 2012-11-13 15:20:14.772569089 +0000 +@@ -23,5 +23,6 @@ + + #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ + #define MAP_NONBLOCK 0x10000 /* do not block on IO */ ++#define MAP_EXECPRIO 0x20000 /* do soft ubc charge */ + + #endif /* _ASM_POWERPC_MMAN_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-powerpc/pgalloc-64.h debian/binary-custom.d/openvz/src/include/asm-powerpc/pgalloc-64.h +--- ./include/asm-powerpc/pgalloc-64.h 2012-06-12 16:25:23.870312501 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-powerpc/pgalloc-64.h 2012-11-13 15:20:14.784569088 +0000 +@@ -22,7 +22,8 @@ + + static inline pgd_t *pgd_alloc(struct mm_struct *mm) + { +- return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL); ++ return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], ++ GFP_KERNEL_UBC | __GFP_SOFT_UBC); + } + + static inline void pgd_free(pgd_t *pgd) +@@ -37,7 +38,7 @@ + static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) + { + return kmem_cache_alloc(pgtable_cache[PUD_CACHE_NUM], +- GFP_KERNEL|__GFP_REPEAT); ++ GFP_KERNEL_UBC|__GFP_SOFT_UBC|__GFP_REPEAT); + } + + static inline void pud_free(pud_t *pud) +@@ -81,16 +82,21 @@ + kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd); + } + ++static inline pte_t *do_pte_alloc(gfp_t flags) ++{ ++ return (pte_t *)__get_free_page(flags); ++} ++ + static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, + unsigned long address) + { +- return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO); ++ return do_pte_alloc(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO); + } + + static inline struct page *pte_alloc_one(struct mm_struct *mm, + unsigned long address) + { +- pte_t *pte = pte_alloc_one_kernel(mm, address); ++ pte_t *pte = do_pte_alloc(GFP_KERNEL_UBC | __GFP_SOFT_UBC | __GFP_ZERO); + return pte ? virt_to_page(pte) : NULL; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-powerpc/systbl.h debian/binary-custom.d/openvz/src/include/asm-powerpc/systbl.h +--- ./include/asm-powerpc/systbl.h 2012-06-12 16:25:23.878312501 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-powerpc/systbl.h 2012-11-13 15:20:14.792569085 +0000 +@@ -303,7 +303,7 @@ + SYSCALL_SPU(fchmodat) + SYSCALL_SPU(faccessat) + COMPAT_SYS_SPU(get_robust_list) +-COMPAT_SYS_SPU(set_robust_list) ++COMPAT_SYS_SPU(set_robust_list) /* 300 */ + COMPAT_SYS_SPU(move_pages) + SYSCALL_SPU(getcpu) + COMPAT_SYS(epoll_pwait) +@@ -313,3 +313,19 @@ + SYSCALL_SPU(eventfd) + COMPAT_SYS_SPU(sync_file_range2) + COMPAT_SYS(fallocate) ++SYS_SKIP(310, 400) ++SYSCALL(ni_syscall) ++SYS_SKIP_END() ++SYSCALL(fairsched_mknod) /* 400 */ ++SYSCALL(fairsched_rmnod) ++SYSCALL(fairsched_chwt) ++SYSCALL(fairsched_mvpr) ++SYSCALL(fairsched_rate) ++SYSCALL(fairsched_vcpus) ++SYS_SKIP(406, 410) ++SYSCALL(ni_syscall) ++SYS_SKIP_END() ++SYSCALL(getluid) /* 410 */ ++SYSCALL(setluid) ++SYSCALL(setublimit) ++SYSCALL(ubstat) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-powerpc/unistd.h debian/binary-custom.d/openvz/src/include/asm-powerpc/unistd.h +--- ./include/asm-powerpc/unistd.h 2012-06-12 16:25:23.878312501 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-powerpc/unistd.h 2012-11-13 15:20:14.796569086 +0000 +@@ -333,9 +333,14 @@ + #define __NR_sync_file_range2 308 + #define __NR_fallocate 309 + ++#define __NR_getluid 410 ++#define __NR_setluid 411 ++#define __NR_setublimit 412 ++#define __NR_ubstat 413 ++ + #ifdef __KERNEL__ + +-#define __NR_syscalls 310 ++#define __NR_syscalls 414 + + #define __NR__exit __NR_exit + #define NR_syscalls __NR_syscalls +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-sparc64/mman.h debian/binary-custom.d/openvz/src/include/asm-sparc64/mman.h +--- ./include/asm-sparc64/mman.h 2012-06-12 16:25:23.942312499 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-sparc64/mman.h 2012-11-13 15:20:14.892569086 +0000 +@@ -21,6 +21,7 @@ + + #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ + #define MAP_NONBLOCK 0x10000 /* do not block on IO */ ++#define MAP_EXECPRIO 0x20000 /* do soft ubc charge */ + + /* XXX Need to add flags to SunOS's mctl, mlockall, and madvise system + * XXX calls. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-sparc64/pgalloc.h debian/binary-custom.d/openvz/src/include/asm-sparc64/pgalloc.h +--- ./include/asm-sparc64/pgalloc.h 2012-06-12 16:25:23.946312498 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-sparc64/pgalloc.h 2012-11-13 15:20:14.892569086 +0000 +@@ -17,7 +17,7 @@ + + static inline pgd_t *pgd_alloc(struct mm_struct *mm) + { +- return quicklist_alloc(0, GFP_KERNEL, NULL); ++ return quicklist_alloc(0, GFP_KERNEL_UBC, NULL); + } + + static inline void pgd_free(pgd_t *pgd) +@@ -29,7 +29,7 @@ + + static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) + { +- return quicklist_alloc(0, GFP_KERNEL, NULL); ++ return quicklist_alloc(0, GFP_KERNEL_UBC|__GFP_REPEAT, NULL); + } + + static inline void pmd_free(pmd_t *pmd) +@@ -46,7 +46,7 @@ + static inline struct page *pte_alloc_one(struct mm_struct *mm, + unsigned long address) + { +- void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); ++ void *pg = quicklist_alloc(0, GFP_KERNEL_UBC|__GFP_REPEAT, NULL); + return pg ? virt_to_page(pg) : NULL; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-sparc64/thread_info.h debian/binary-custom.d/openvz/src/include/asm-sparc64/thread_info.h +--- ./include/asm-sparc64/thread_info.h 2012-06-12 16:25:23.950312498 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-sparc64/thread_info.h 2012-11-13 15:20:14.900569082 +0000 +@@ -162,14 +162,14 @@ + struct thread_info *ret; \ + \ + ret = (struct thread_info *) \ +- __get_free_pages(GFP_KERNEL, __THREAD_INFO_ORDER); \ ++ __get_free_pages(GFP_KERNEL_UBC, __THREAD_INFO_ORDER);\ + if (ret) \ + memset(ret, 0, PAGE_SIZE<<__THREAD_INFO_ORDER); \ + ret; \ + }) + #else + #define alloc_thread_info(tsk) \ +- ((struct thread_info *)__get_free_pages(GFP_KERNEL, __THREAD_INFO_ORDER)) ++ ((struct thread_info *)__get_free_pages(GFP_KERNEL_UBC, __THREAD_INFO_ORDER)) + #endif + + #define free_thread_info(ti) \ +@@ -235,6 +235,7 @@ + */ + #define TIF_MEMDIE 13 + #define TIF_POLLING_NRFLAG 14 ++#define TIF_FREEZE 15 /* Freeze request (atomic PF_FREEZE) */ + + #define _TIF_SYSCALL_TRACE (1< +-# define STACK_TOP TASK_SIZE ++# define STACK_TOP (TASK_SIZE - PAGE_SIZE) /* +1 page for vdso */ + # ifdef CONFIG_X86_32 + # define STACK_TOP_MAX STACK_TOP + # else +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-x86/elf.h debian/binary-custom.d/openvz/src/include/asm-x86/elf.h +--- ./include/asm-x86/elf.h 2012-06-12 16:25:23.974312497 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-x86/elf.h 2012-11-13 15:20:14.940569080 +0000 +@@ -264,7 +264,7 @@ + /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ + + #define ARCH_DLINFO \ +-do if (vdso_enabled) { \ ++do if (vdso_enabled && sysctl_at_vsyscall) { \ + NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ + NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_CURRENT_BASE); \ + } while (0) +@@ -285,7 +285,8 @@ + + #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 + extern int arch_setup_additional_pages(struct linux_binprm *bprm, +- int executable_stack); ++ int executable_stack, ++ unsigned long map_address); + + #endif /* __KERNEL__ */ + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-x86/ia32.h debian/binary-custom.d/openvz/src/include/asm-x86/ia32.h +--- ./include/asm-x86/ia32.h 2012-06-12 16:25:23.974312497 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-x86/ia32.h 2012-11-13 15:20:14.944569081 +0000 +@@ -156,7 +156,7 @@ + char f_fpack[6]; + }; + +-#define IA32_STACK_TOP IA32_PAGE_OFFSET ++#define IA32_STACK_TOP (IA32_PAGE_OFFSET - PAGE_SIZE * 2) + + #ifdef __KERNEL__ + struct user_desc; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-x86/mman.h debian/binary-custom.d/openvz/src/include/asm-x86/mman.h +--- ./include/asm-x86/mman.h 2012-06-12 16:25:23.982312497 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-x86/mman.h 2012-11-13 15:20:14.964569080 +0000 +@@ -12,6 +12,7 @@ + #define MAP_NORESERVE 0x4000 /* don't check for reservations */ + #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ + #define MAP_NONBLOCK 0x10000 /* do not block on IO */ ++#define MAP_EXECPRIO 0x20000 /* soft ubc charge */ + + #define MCL_CURRENT 1 /* lock all current mappings */ + #define MCL_FUTURE 2 /* lock all future mappings */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-x86/nmi_32.h debian/binary-custom.d/openvz/src/include/asm-x86/nmi_32.h +--- ./include/asm-x86/nmi_32.h 2012-06-12 16:25:23.986312497 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-x86/nmi_32.h 2012-11-13 15:20:14.964569080 +0000 +@@ -25,6 +25,10 @@ + extern int reserve_evntsel_nmi(unsigned int); + extern void release_evntsel_nmi(unsigned int); + ++typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu); ++void set_nmi_ipi_callback(nmi_callback_t callback); ++void unset_nmi_ipi_callback(void); ++ + extern void setup_apic_nmi_watchdog (void *); + extern void stop_apic_nmi_watchdog (void *); + extern void disable_timer_nmi_watchdog(void); +@@ -33,7 +37,7 @@ + + extern atomic_t nmi_active; + extern unsigned int nmi_watchdog; +-#define NMI_DISABLED -1 ++#define NMI_DISABLED -1 + #define NMI_NONE 0 + #define NMI_IO_APIC 1 + #define NMI_LOCAL_APIC 2 +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-x86/nmi_64.h debian/binary-custom.d/openvz/src/include/asm-x86/nmi_64.h +--- ./include/asm-x86/nmi_64.h 2012-06-12 16:25:23.986312497 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-x86/nmi_64.h 2012-11-13 15:20:14.968569079 +0000 +@@ -35,6 +35,11 @@ + } + + #endif /* CONFIG_PM */ ++ ++typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu); ++void set_nmi_ipi_callback(nmi_callback_t callback); ++void unset_nmi_ipi_callback(void); ++ + + extern void default_do_nmi(struct pt_regs *); + extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-x86/pgalloc_64.h debian/binary-custom.d/openvz/src/include/asm-x86/pgalloc_64.h +--- ./include/asm-x86/pgalloc_64.h 2012-06-12 16:25:23.990312497 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-x86/pgalloc_64.h 2012-11-13 15:20:14.968569079 +0000 +@@ -25,12 +25,14 @@ + + static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr) + { +- return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); ++ return (pmd_t *)get_zeroed_page(GFP_KERNEL_UBC|__GFP_REPEAT| ++ __GFP_SOFT_UBC); + } + + static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) + { +- return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); ++ return (pud_t *)get_zeroed_page(GFP_KERNEL_UBC|__GFP_REPEAT| ++ __GFP_SOFT_UBC); + } + + static inline void pud_free (pud_t *pud) +@@ -60,7 +62,8 @@ + static inline pgd_t *pgd_alloc(struct mm_struct *mm) + { + unsigned boundary; +- pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); ++ pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL_UBC|__GFP_REPEAT| ++ __GFP_SOFT_UBC); + if (!pgd) + return NULL; + pgd_list_add(pgd); +@@ -91,7 +94,8 @@ + + static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) + { +- void *p = (void *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); ++ void *p = (void *)get_zeroed_page(GFP_KERNEL_UBC|__GFP_REPEAT| ++ __GFP_SOFT_UBC); + if (!p) + return NULL; + return virt_to_page(p); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-x86/processor_64.h debian/binary-custom.d/openvz/src/include/asm-x86/processor_64.h +--- ./include/asm-x86/processor_64.h 2012-06-12 16:25:23.990312497 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-x86/processor_64.h 2012-11-13 15:20:14.972569080 +0000 +@@ -147,7 +147,7 @@ + /* This decides where the kernel will search for a free chunk of vm + * space during mmap's. + */ +-#define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? 0xc0000000 : 0xFFFFe000) ++#define IA32_PAGE_OFFSET 0xc0000000 + + #define TASK_SIZE (test_thread_flag(TIF_IA32) ? IA32_PAGE_OFFSET : TASK_SIZE64) + #define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-x86/thread_info_32.h debian/binary-custom.d/openvz/src/include/asm-x86/thread_info_32.h +--- ./include/asm-x86/thread_info_32.h 2012-06-12 16:25:23.998312497 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-x86/thread_info_32.h 2012-11-13 15:20:14.980569083 +0000 +@@ -96,10 +96,10 @@ + /* thread information allocation */ + #ifdef CONFIG_DEBUG_STACK_USAGE + #define alloc_thread_info(tsk) ((struct thread_info *) \ +- __get_free_pages(GFP_KERNEL| __GFP_ZERO, get_order(THREAD_SIZE))) ++ __get_free_pages(GFP_KERNEL_UBC| __GFP_ZERO, get_order(THREAD_SIZE))) + #else + #define alloc_thread_info(tsk) ((struct thread_info *) \ +- __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE))) ++ __get_free_pages(GFP_KERNEL_UBC, get_order(THREAD_SIZE))) + #endif + + #define free_thread_info(info) free_pages((unsigned long)(info), get_order(THREAD_SIZE)) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/asm-x86/thread_info_64.h debian/binary-custom.d/openvz/src/include/asm-x86/thread_info_64.h +--- ./include/asm-x86/thread_info_64.h 2012-06-12 16:25:23.998312497 +0100 ++++ debian/binary-custom.d/openvz/src/include/asm-x86/thread_info_64.h 2012-11-13 15:20:14.980569083 +0000 +@@ -33,6 +33,7 @@ + + mm_segment_t addr_limit; + struct restart_block restart_block; ++ void *sysenter_return; + }; + #endif + +@@ -78,14 +79,15 @@ + ({ \ + struct thread_info *ret; \ + \ +- ret = ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)); \ ++ ret = ((struct thread_info *) __get_free_pages(GFP_KERNEL_UBC,\ ++ THREAD_ORDER)); \ + if (ret) \ + memset(ret, 0, THREAD_SIZE); \ + ret; \ + }) + #else + #define alloc_thread_info(tsk) \ +- ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)) ++ ((struct thread_info *) __get_free_pages(GFP_KERNEL_UBC,THREAD_ORDER)) + #endif + + #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) +@@ -122,6 +124,7 @@ + #define TIF_DEBUG 21 /* uses debug registers */ + #define TIF_IO_BITMAP 22 /* uses I/O bitmap */ + #define TIF_FREEZE 23 /* is freezing for suspend */ ++#define TIF_RESUME 24 + + #define _TIF_SYSCALL_TRACE (1<mm->context.vdso) + #define VSYSCALL32_END (VSYSCALL32_BASE + PAGE_SIZE) + #define VSYSCALL32_EHDR ((const struct elf32_hdr *) VSYSCALL32_BASE) + ++#define __VSYSCALL32_BASE ((unsigned long)(IA32_PAGE_OFFSET - PAGE_SIZE)) ++#define __VSYSCALL32_END (__VSYSCALL32_BASE + PAGE_SIZE) ++ + #define VSYSCALL32_VSYSCALL ((void *)VSYSCALL32_BASE + 0x400) +-#define VSYSCALL32_SYSEXIT ((void *)VSYSCALL32_BASE + 0x410) ++#define VSYSCALL32_SYSEXIT ((void *)VSYSCALL32_BASE + 0x420) + #define VSYSCALL32_SIGRETURN ((void __user *)VSYSCALL32_BASE + 0x500) + #define VSYSCALL32_RTSIGRETURN ((void __user *)VSYSCALL32_BASE + 0x600) + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/beancounter.h debian/binary-custom.d/openvz/src/include/bc/beancounter.h +--- ./include/bc/beancounter.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/beancounter.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,455 @@ ++/* ++ * include/bc/beancounter.h ++ * ++ * Copyright (C) 1999-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * Andrey Savochkin saw@sw-soft.com ++ * ++ */ ++ ++#ifndef _LINUX_BEANCOUNTER_H ++#define _LINUX_BEANCOUNTER_H ++ ++/* ++ * Generic ratelimiting stuff. ++ */ ++ ++struct ub_rate_info { ++ int burst; ++ int interval; /* jiffy_t per event */ ++ int bucket; /* kind of leaky bucket */ ++ unsigned long last; /* last event */ ++}; ++ ++/* Return true if rate limit permits. */ ++int ub_ratelimit(struct ub_rate_info *); ++ ++ ++/* ++ * This magic is used to distinuish user beancounter and pages beancounter ++ * in struct page. page_ub and page_bc are placed in union and MAGIC ++ * ensures us that we don't use pbc as ubc in ub_page_uncharge(). ++ */ ++#define UB_MAGIC 0x62756275 ++ ++/* ++ * Resource list. ++ */ ++ ++#define UB_KMEMSIZE 0 /* Unswappable kernel memory size including ++ * struct task, page directories, etc. ++ */ ++#define UB_LOCKEDPAGES 1 /* Mlock()ed pages. */ ++#define UB_PRIVVMPAGES 2 /* Total number of pages, counting potentially ++ * private pages as private and used. ++ */ ++#define UB_SHMPAGES 3 /* IPC SHM segment size. */ ++#define UB_DUMMY 4 /* Dummy resource (compatibility) */ ++#define UB_NUMPROC 5 /* Number of processes. */ ++#define UB_PHYSPAGES 6 /* All resident pages, for swapout guarantee. */ ++#define UB_VMGUARPAGES 7 /* Guarantee for memory allocation, ++ * checked against PRIVVMPAGES. ++ */ ++#define UB_OOMGUARPAGES 8 /* Guarantees against OOM kill. ++ * Only limit is used, no accounting. ++ */ ++#define UB_NUMTCPSOCK 9 /* Number of TCP sockets. */ ++#define UB_NUMFLOCK 10 /* Number of file locks. */ ++#define UB_NUMPTY 11 /* Number of PTYs. */ ++#define UB_NUMSIGINFO 12 /* Number of siginfos. */ ++#define UB_TCPSNDBUF 13 /* Total size of tcp send buffers. */ ++#define UB_TCPRCVBUF 14 /* Total size of tcp receive buffers. */ ++#define UB_OTHERSOCKBUF 15 /* Total size of other socket ++ * send buffers (all buffers for PF_UNIX). ++ */ ++#define UB_DGRAMRCVBUF 16 /* Total size of other socket ++ * receive buffers. ++ */ ++#define UB_NUMOTHERSOCK 17 /* Number of other sockets. */ ++#define UB_DCACHESIZE 18 /* Size of busy dentry/inode cache. */ ++#define UB_NUMFILE 19 /* Number of open files. */ ++ ++#define UB_RESOURCES_COMPAT 24 ++ ++/* Add new resources here */ ++ ++#define UB_NUMXTENT 23 ++#define UB_RESOURCES 24 ++ ++#define UB_UNUSEDPRIVVM (UB_RESOURCES + 0) ++#define UB_TMPFSPAGES (UB_RESOURCES + 1) ++#define UB_SWAPPAGES (UB_RESOURCES + 2) ++#define UB_HELDPAGES (UB_RESOURCES + 3) ++ ++struct ubparm { ++ /* ++ * A barrier over which resource allocations are failed gracefully. ++ * If the amount of consumed memory is over the barrier further sbrk() ++ * or mmap() calls fail, the existing processes are not killed. ++ */ ++ unsigned long barrier; ++ /* hard resource limit */ ++ unsigned long limit; ++ /* consumed resources */ ++ unsigned long held; ++ /* maximum amount of consumed resources through the last period */ ++ unsigned long maxheld; ++ /* minimum amount of consumed resources through the last period */ ++ unsigned long minheld; ++ /* count of failed charges */ ++ unsigned long failcnt; ++}; ++ ++/* ++ * Kernel internal part. ++ */ ++ ++#ifdef __KERNEL__ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * UB_MAXVALUE is essentially LONG_MAX declared in a cross-compiling safe form. ++ */ ++#define UB_MAXVALUE ( (1UL << (sizeof(unsigned long)*8-1)) - 1) ++ ++ ++/* ++ * Resource management structures ++ * Serialization issues: ++ * beancounter list management is protected via ub_hash_lock ++ * task pointers are set only for current task and only once ++ * refcount is managed atomically ++ * value and limit comparison and change are protected by per-ub spinlock ++ */ ++ ++struct page_beancounter; ++struct task_beancounter; ++struct sock_beancounter; ++ ++struct page_private { ++ unsigned long ubp_unused_privvmpages; ++ unsigned long ubp_tmpfs_respages; ++ unsigned long ubp_swap_pages; ++ unsigned long ubp_pbcs; ++ unsigned long long ubp_held_pages; ++}; ++ ++struct sock_private { ++ unsigned long ubp_rmem_thres; ++ unsigned long ubp_wmem_pressure; ++ unsigned long ubp_maxadvmss; ++ unsigned long ubp_rmem_pressure; ++ int ubp_tw_count; ++#define UB_RMEM_EXPAND 0 ++#define UB_RMEM_KEEP 1 ++#define UB_RMEM_SHRINK 2 ++ struct list_head ubp_other_socks; ++ struct list_head ubp_tcp_socks; ++ atomic_t ubp_orphan_count; ++}; ++ ++struct ub_percpu_struct { ++ unsigned long unmap; ++ unsigned long swapin; ++#ifdef CONFIG_BC_IO_ACCOUNTING ++ unsigned long long bytes_wrote; ++ unsigned long long bytes_read; ++ unsigned long long bytes_cancelled; ++#endif ++#ifdef CONFIG_BC_DEBUG_KMEM ++ long pages_charged; ++ long vmalloc_charged; ++#endif ++ unsigned long sync; ++ unsigned long sync_done; ++ ++ unsigned long fsync; ++ unsigned long fsync_done; ++ ++ unsigned long fdsync; ++ unsigned long fdsync_done; ++ ++ unsigned long frsync; ++ unsigned long frsync_done; ++ ++ unsigned long write; ++ unsigned long read; ++ unsigned long long wchar; ++ unsigned long long rchar; ++}; ++ ++struct user_beancounter ++{ ++ unsigned long ub_magic; ++ atomic_t ub_refcount; ++ struct list_head ub_list; ++ struct hlist_node ub_hash; ++ ++ union { ++ struct rcu_head rcu; ++ struct execute_work cleanup; ++ }; ++ ++ spinlock_t ub_lock; ++ uid_t ub_uid; ++ ++ struct ub_rate_info ub_limit_rl; ++ int ub_oom_noproc; ++ ++ struct page_private ppriv; ++#define ub_unused_privvmpages ppriv.ubp_unused_privvmpages ++#define ub_tmpfs_respages ppriv.ubp_tmpfs_respages ++#define ub_swap_pages ppriv.ubp_swap_pages ++#define ub_held_pages ppriv.ubp_held_pages ++#define ub_pbcs ppriv.ubp_pbcs ++ struct sock_private spriv; ++#define ub_rmem_thres spriv.ubp_rmem_thres ++#define ub_maxadvmss spriv.ubp_maxadvmss ++#define ub_rmem_pressure spriv.ubp_rmem_pressure ++#define ub_wmem_pressure spriv.ubp_wmem_pressure ++#define ub_tcp_sk_list spriv.ubp_tcp_socks ++#define ub_other_sk_list spriv.ubp_other_socks ++#define ub_orphan_count spriv.ubp_orphan_count ++#define ub_tw_count spriv.ubp_tw_count ++ struct ub_iopriv iopriv; ++ ++ struct user_beancounter *parent; ++ int ub_childs; ++ void *private_data; ++ unsigned long ub_aflags; ++ ++#ifdef CONFIG_PROC_FS ++ struct proc_dir_entry *proc; ++#endif ++ ++ /* resources statistic and settings */ ++ struct ubparm ub_parms[UB_RESOURCES]; ++ /* resources statistic for last interval */ ++ struct ubparm ub_store[UB_RESOURCES]; ++ ++ struct ub_percpu_struct *ub_percpu; ++#ifdef CONFIG_BC_IO_ACCOUNTING ++ /* these are protected with pb_lock */ ++ unsigned long long bytes_wrote; ++ unsigned long long bytes_dirtied; ++ unsigned long long bytes_dirty_missed; ++ unsigned long io_pb_held; ++#endif ++#ifdef CONFIG_BC_DEBUG_KMEM ++ struct list_head ub_cclist; ++#endif ++}; ++ ++extern int ub_count; ++ ++enum ub_severity { UB_HARD, UB_SOFT, UB_FORCE }; ++ ++#define UB_AFLAG_NOTIF_PAGEIN 0 ++ ++static inline ++struct user_beancounter *top_beancounter(struct user_beancounter *ub) ++{ ++ while (ub->parent != NULL) ++ ub = ub->parent; ++ return ub; ++} ++ ++static inline int ub_barrier_hit(struct user_beancounter *ub, int resource) ++{ ++ return ub->ub_parms[resource].held > ub->ub_parms[resource].barrier; ++} ++ ++static inline int ub_hfbarrier_hit(struct user_beancounter *ub, int resource) ++{ ++ return (ub->ub_parms[resource].held > ++ ((ub->ub_parms[resource].barrier) >> 1)); ++} ++ ++static inline int ub_barrier_farnr(struct user_beancounter *ub, int resource) ++{ ++ struct ubparm *p; ++ p = ub->ub_parms + resource; ++ return p->held <= (p->barrier >> 3); ++} ++ ++static inline int ub_barrier_farsz(struct user_beancounter *ub, int resource) ++{ ++ struct ubparm *p; ++ p = ub->ub_parms + resource; ++ return p->held <= (p->barrier >> 3) && p->barrier >= 1024 * 1024; ++} ++ ++#ifndef CONFIG_BEANCOUNTERS ++ ++#define ub_percpu_add(ub, f, v) do { } while (0) ++#define ub_percpu_sub(ub, f, v) do { } while (0) ++#define ub_percpu_inc(ub, f) do { } while (0) ++#define ub_percpu_dec(ub, f) do { } while (0) ++ ++#define mm_ub(mm) (NULL) ++ ++extern inline struct user_beancounter *get_beancounter_byuid ++ (uid_t uid, int create) { return NULL; } ++extern inline struct user_beancounter *get_beancounter ++ (struct user_beancounter *ub) { return NULL; } ++extern inline void put_beancounter(struct user_beancounter *ub) { } ++ ++static inline void ub_init_late(void) { }; ++static inline void ub_init_early(void) { }; ++ ++static inline int charge_beancounter(struct user_beancounter *ub, ++ int resource, unsigned long val, ++ enum ub_severity strict) { return 0; } ++static inline void uncharge_beancounter(struct user_beancounter *ub, ++ int resource, unsigned long val) { } ++ ++#else /* CONFIG_BEANCOUNTERS */ ++ ++#define ub_percpu_add(ub, field, v) do { \ ++ per_cpu_ptr(ub->ub_percpu, get_cpu())->field += (v); \ ++ put_cpu(); \ ++ } while (0) ++#define ub_percpu_inc(ub, field) ub_percpu_add(ub, field, 1) ++ ++#define ub_percpu_sub(ub, field, v) do { \ ++ per_cpu_ptr(ub->ub_percpu, get_cpu())->field -= (v); \ ++ put_cpu(); \ ++ } while (0) ++#define ub_percpu_dec(ub, field) ub_percpu_sub(ub, field, 1) ++ ++#define mm_ub(mm) ((mm)->mm_ub) ++/* ++ * Charge/uncharge operations ++ */ ++ ++extern int __charge_beancounter_locked(struct user_beancounter *ub, ++ int resource, unsigned long val, enum ub_severity strict); ++ ++extern void __uncharge_beancounter_locked(struct user_beancounter *ub, ++ int resource, unsigned long val); ++ ++extern void put_beancounter_safe(struct user_beancounter *ub); ++extern void __put_beancounter(struct user_beancounter *ub); ++ ++extern void uncharge_warn(struct user_beancounter *ub, int resource, ++ unsigned long val, unsigned long held); ++ ++extern const char *ub_rnames[]; ++/* ++ * Put a beancounter reference ++ */ ++ ++static inline void put_beancounter(struct user_beancounter *ub) ++{ ++ if (unlikely(ub == NULL)) ++ return; ++ ++ /* FIXME - optimize not to disable interrupts and make call */ ++ __put_beancounter(ub); ++} ++ ++/* fast put, refcount can't reach zero */ ++static inline void __put_beancounter_batch(struct user_beancounter *ub, int n) ++{ ++ atomic_sub(n, &ub->ub_refcount); ++} ++ ++static inline void put_beancounter_batch(struct user_beancounter *ub, int n) ++{ ++ if (n > 1) ++ __put_beancounter_batch(ub, n - 1); ++ __put_beancounter(ub); ++} ++ ++/* ++ * Create a new beancounter reference ++ */ ++extern struct user_beancounter *get_beancounter_byuid(uid_t uid, int create); ++ ++static inline ++struct user_beancounter *get_beancounter(struct user_beancounter *ub) ++{ ++ if (unlikely(ub == NULL)) ++ return NULL; ++ ++ atomic_inc(&ub->ub_refcount); ++ return ub; ++} ++ ++static inline ++struct user_beancounter *get_beancounter_rcu(struct user_beancounter *ub) ++{ ++ return atomic_inc_not_zero(&ub->ub_refcount) ? ub : NULL; ++} ++ ++static inline void get_beancounter_batch(struct user_beancounter *ub, int n) ++{ ++ atomic_add(n, &ub->ub_refcount); ++} ++ ++extern struct user_beancounter *get_subbeancounter_byid( ++ struct user_beancounter *, ++ int id, int create); ++ ++extern void ub_init_late(void); ++extern void ub_init_early(void); ++ ++extern int print_ub_uid(struct user_beancounter *ub, char *buf, int size); ++ ++/* ++ * Resource charging ++ * Change user's account and compare against limits ++ */ ++ ++static inline void ub_adjust_maxheld(struct user_beancounter *ub, int resource) ++{ ++ if (ub->ub_parms[resource].maxheld < ub->ub_parms[resource].held) ++ ub->ub_parms[resource].maxheld = ub->ub_parms[resource].held; ++ if (ub->ub_parms[resource].minheld > ub->ub_parms[resource].held) ++ ub->ub_parms[resource].minheld = ub->ub_parms[resource].held; ++} ++ ++int charge_beancounter(struct user_beancounter *ub, int resource, ++ unsigned long val, enum ub_severity strict); ++void uncharge_beancounter(struct user_beancounter *ub, int resource, ++ unsigned long val); ++void __charge_beancounter_notop(struct user_beancounter *ub, int resource, ++ unsigned long val); ++void __uncharge_beancounter_notop(struct user_beancounter *ub, int resource, ++ unsigned long val); ++ ++static inline void charge_beancounter_notop(struct user_beancounter *ub, ++ int resource, unsigned long val) ++{ ++ if (ub->parent != NULL) ++ __charge_beancounter_notop(ub, resource, val); ++} ++ ++static inline void uncharge_beancounter_notop(struct user_beancounter *ub, ++ int resource, unsigned long val) ++{ ++ if (ub->parent != NULL) ++ __uncharge_beancounter_notop(ub, resource, val); ++} ++ ++#endif /* CONFIG_BEANCOUNTERS */ ++ ++#ifndef CONFIG_BC_RSS_ACCOUNTING ++static inline void ub_ini_pbc(void) { } ++#else ++extern void ub_init_pbc(void); ++#endif ++#endif /* __KERNEL__ */ ++#endif /* _LINUX_BEANCOUNTER_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/dcache.h debian/binary-custom.d/openvz/src/include/bc/dcache.h +--- ./include/bc/dcache.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/dcache.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,47 @@ ++/* ++ * include/bc/dcache.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_DCACHE_H_ ++#define __BC_DCACHE_H_ ++ ++#include ++ ++/* ++ * UB_DCACHESIZE accounting ++ */ ++ ++struct dentry_beancounter ++{ ++ /* ++ * d_inuse = ++ * + ++ * ++ * ++ * d_inuse == -1 means that dentry is unused ++ * state change -1 => 0 causes charge ++ * state change 0 => -1 causes uncharge ++ */ ++ atomic_t d_inuse; ++ /* charged size, including name length if name is not inline */ ++ unsigned long d_ubsize; ++ struct user_beancounter *d_ub; ++}; ++ ++#ifdef CONFIG_BEANCOUNTERS ++#define ub_dget_testone(d) (atomic_inc_and_test(&(d)->dentry_bc.d_inuse)) ++#define ub_dput_testzero(d) (atomic_add_negative(-1, &(d)->dentry_bc.d_inuse)) ++#define INUSE_INIT 0 ++ ++extern int ub_dentry_on; ++#else ++#define ub_dget_testone(d) (0) ++#define ub_dput_testzero(d) (0) ++#endif ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/dcache_op.h debian/binary-custom.d/openvz/src/include/bc/dcache_op.h +--- ./include/bc/dcache_op.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/dcache_op.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,102 @@ ++/* ++ * include/bc/dcache_op.h ++ * ++ * Copyright (C) 2006 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_DCACHE_OP_H_ ++#define __BC_DCACHE_OP_H_ ++ ++struct dentry; ++ ++#ifdef CONFIG_BEANCOUNTERS ++ ++#include ++#include ++#include ++ ++extern int ub_dentry_alloc_barrier; ++extern spinlock_t dcache_lock; ++ ++static inline int ub_dentry_alloc(struct dentry *d) ++{ ++ extern int __ub_dentry_alloc(struct dentry *); ++ ++ if (!ub_dentry_on) ++ return 0; ++ return __ub_dentry_alloc(d); ++} ++ ++static inline void ub_dentry_alloc_start(void) ++{ ++ extern void __ub_dentry_alloc_start(void); ++ ++ if (ub_dentry_alloc_barrier) ++ __ub_dentry_alloc_start(); ++} ++ ++static inline void ub_dentry_alloc_end(void) ++{ ++ extern void __ub_dentry_alloc_end(void); ++ ++ if (current->task_bc.dentry_alloc) ++ __ub_dentry_alloc_end(); ++} ++ ++static inline int ub_dentry_charge(struct dentry *d) ++{ ++ extern int __ub_dentry_charge(struct dentry *); ++ ++ if (!ub_dentry_on) ++ return 0; ++ return __ub_dentry_charge(d); ++} ++ ++static inline void ub_dentry_charge_nofail(struct dentry *d) ++{ ++ extern void __ub_dentry_charge_nofail(struct dentry *); ++ ++ if (!ub_dentry_on) ++ return; ++ __ub_dentry_charge_nofail(d); ++} ++ ++static inline void ub_dentry_uncharge_locked(struct dentry *d) ++{ ++ extern void __ub_dentry_uncharge(struct dentry *); ++ ++ if (!ub_dentry_on) ++ return; ++ __ub_dentry_uncharge(d); ++} ++ ++static inline void ub_dentry_uncharge(struct dentry *d) ++{ ++ extern void __ub_dentry_uncharge(struct dentry *); ++ ++ if (!ub_dentry_on) ++ return; ++ spin_lock(&dcache_lock); ++ __ub_dentry_uncharge(d); ++ spin_unlock(&dcache_lock); ++} ++ ++void uncharge_dcache(struct user_beancounter *ub, unsigned long size); ++#else /* CONFIG_BEANCOUNTERS */ ++ ++static inline int ub_dentry_alloc(struct dentry *d) { return 0; } ++static inline void ub_dentry_alloc_start(void) { } ++static inline void ub_dentry_alloc_end(void) { } ++static inline int ub_dentry_charge(struct dentry *d) { return 0; } ++static inline void ub_dentry_charge_nofail(struct dentry *d) { } ++static inline void ub_dentry_uncharge_locked(struct dentry *d) { } ++static inline void ub_dentry_uncharge(struct dentry *d) { } ++static inline void uncharge_dcache(struct user_beancounter *ub, unsigned long size) { } ++ ++#endif /* CONFIG_BEANCOUNTERS */ ++ ++#endif /* __dcache_op.h_ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/debug.h debian/binary-custom.d/openvz/src/include/bc/debug.h +--- ./include/bc/debug.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/debug.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,103 @@ ++/* ++ * include/bc/debug.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_DEBUG_H_ ++#define __BC_DEBUG_H_ ++ ++/* ++ * general debugging ++ */ ++ ++#define UBD_ALLOC 0x1 ++#define UBD_CHARGE 0x2 ++#define UBD_LIMIT 0x4 ++#define UBD_TRACE 0x8 ++ ++/* ++ * ub_net debugging ++ */ ++ ++#define UBD_NET_SOCKET 0x10 ++#define UBD_NET_SLEEP 0x20 ++#define UBD_NET_SEND 0x40 ++#define UBD_NET_RECV 0x80 ++ ++/* ++ * Main routines ++ */ ++ ++#define UB_DEBUG (0) ++#define DEBUG_RESOURCE (0ULL) ++ ++#define ub_dbg_cond(__cond, __str, args...) \ ++ do { \ ++ if ((__cond) != 0) \ ++ printk(__str, ##args); \ ++ } while(0) ++ ++#define ub_debug(__section, __str, args...) \ ++ ub_dbg_cond(UB_DEBUG & (__section), __str, ##args) ++ ++#define ub_debug_resource(__resource, __str, args...) \ ++ ub_dbg_cond((UB_DEBUG & UBD_CHARGE) && \ ++ (DEBUG_RESOURCE & (1 << (__resource))), \ ++ __str, ##args) ++ ++#if UB_DEBUG & UBD_TRACE ++#define ub_debug_trace(__cond, __b, __r) \ ++ do { \ ++ static struct ub_rate_info ri = { __b, __r }; \ ++ if ((__cond) != 0 && ub_ratelimit(&ri)) \ ++ dump_stack(); \ ++ } while(0) ++#else ++#define ub_debug_trace(__cond, __burst, __rate) ++#endif ++ ++#ifdef CONFIG_BC_DEBUG_KMEM ++#include ++ ++struct user_beancounter; ++struct ub_cache_counter { ++ struct list_head ulist; ++ struct ub_cache_counter *next; ++ struct user_beancounter *ub; ++ struct kmem_cache *cachep; ++ unsigned long counter; ++}; ++ ++extern spinlock_t cc_lock; ++extern void init_cache_counters(void); ++extern void ub_free_counters(struct user_beancounter *); ++extern void ub_kmemcache_free(struct kmem_cache *cachep); ++ ++struct vm_struct; ++#define inc_vmalloc_charged(vm, flags) do { \ ++ if (flags & __GFP_UBC) \ ++ ub_percpu_add(get_exec_ub(), vmalloc_charged, \ ++ vm->nr_pages); \ ++ } while (0) ++#define dec_vmalloc_charged(vm) do { \ ++ struct user_beancounter *ub; \ ++ ub = page_ub(vm->pages[0]); \ ++ if (ub != NULL) \ ++ ub_percpu_sub(ub, vmalloc_charged, \ ++ vm->nr_pages); \ ++ } while (0) ++#else ++#define init_cache_counters() do { } while (0) ++#define inc_vmalloc_charged(vm, f) do { } while (0) ++#define dec_vmalloc_charged(vm) do { } while (0) ++ ++#define ub_free_counters(ub) do { } while (0) ++#define ub_kmemcache_free(cachep) do { } while (0) ++#endif ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/decl.h debian/binary-custom.d/openvz/src/include/bc/decl.h +--- ./include/bc/decl.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/decl.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,41 @@ ++/* ++ * include/bc/decl.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_DECL_H_ ++#define __BC_DECL_H_ ++ ++#ifdef __KERNEL__ ++ ++/* ++ * Naming convension: ++ * ub__ ++ */ ++ ++#ifdef CONFIG_BEANCOUNTERS ++ ++#define UB_DECLARE_FUNC(ret_type, decl) extern ret_type decl; ++#define UB_DECLARE_VOID_FUNC(decl) extern void decl; ++ ++#else /* CONFIG_BEANCOUNTERS */ ++ ++#define UB_DECLARE_FUNC(ret_type, decl) \ ++ static inline ret_type decl \ ++ { \ ++ return (ret_type)0; \ ++ } ++#define UB_DECLARE_VOID_FUNC(decl) \ ++ static inline void decl \ ++ { \ ++ } ++ ++#endif /* CONFIG_BEANCOUNTERS */ ++#endif ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/hash.h debian/binary-custom.d/openvz/src/include/bc/hash.h +--- ./include/bc/hash.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/hash.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,36 @@ ++/* ++ * include/bc/hash.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _LINUX_UBHASH_H ++#define _LINUX_UBHASH_H ++ ++#ifdef __KERNEL__ ++ ++#define UB_HASH_SIZE 256 ++ ++extern struct hlist_head ub_hash[]; ++extern spinlock_t ub_hash_lock; ++extern struct list_head ub_list_head; ++ ++#ifdef CONFIG_BEANCOUNTERS ++ ++/* ++ * Iterate over beancounters ++ * @__ubp - beancounter ptr ++ * Can use break :) ++ */ ++#define for_each_beancounter(__ubp) \ ++ list_for_each_entry_rcu(__ubp, &ub_list_head, ub_list) \ ++ ++#define bc_hash_entry(ptr) hlist_entry(ptr, struct user_beancounter, ub_hash) ++ ++#endif /* CONFIG_BEANCOUNTERS */ ++#endif /* __KERNEL__ */ ++#endif /* _LINUX_UBHASH_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/io_acct.h debian/binary-custom.d/openvz/src/include/bc/io_acct.h +--- ./include/bc/io_acct.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/io_acct.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,113 @@ ++/* ++ * include/bc/io_acct.h ++ * ++ * Copyright (C) 2006 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * Pavel Emelianov ++ * ++ */ ++ ++#ifndef __UB_IO_ACCT_H_ ++#define __UB_IO_ACCT_H_ ++ ++#ifdef CONFIG_BC_IO_ACCOUNTING ++#include ++#include ++ ++#define page_iopb(page) ({ \ ++ struct page_beancounter *pb; \ ++ pb = page_pbc(page); \ ++ rmb(); \ ++ pb; \ ++ }) ++ ++/* ++ * IO ub is required in task context only, so if exec_ub is set ++ * to NULL this means that uses doesn't need to charge some ++ * resources. nevertheless IO activity must be accounted, so we ++ * account it to current's task beancounter. ++ */ ++ ++static inline struct user_beancounter *get_io_ub(void) ++{ ++ struct user_beancounter *ub; ++ ++ ub = get_exec_ub(); ++ if (unlikely(ub == NULL)) ++ ub = get_task_ub(current); ++ ++ return top_beancounter(ub); ++} ++ ++extern struct page_beancounter **page_pblist(struct page *); ++ ++extern void ub_io_save_context(struct page *, size_t); ++extern void ub_io_release_context(struct page *pg, size_t size); ++ ++#define PAGE_IO_MARK (0x1UL) ++ ++static inline struct page_beancounter *iopb_to_pb(struct page_beancounter *pb) ++{ ++ if (!((unsigned long)pb & PAGE_IO_MARK)) ++ return NULL; ++ ++ return (struct page_beancounter *)((unsigned long)pb & ~PAGE_IO_MARK); ++} ++ ++static inline void ub_io_account_read(size_t bytes) ++{ ++ ub_percpu_add(get_io_ub(), bytes_read, bytes); ++} ++ ++static inline void ub_io_account_write(size_t bytes) ++{ ++ ub_percpu_add(get_io_ub(), bytes_wrote, bytes); ++} ++ ++static inline void ub_io_account_dirty(struct page *page, size_t bytes) ++{ ++ ub_io_save_context(page, bytes); ++} ++ ++static inline void ub_io_account_write_cancelled(size_t bytes) ++{ ++ ub_percpu_add(get_io_ub(), bytes_cancelled, bytes); ++} ++ ++void ub_init_io(struct kmem_cache *); ++#else /* BC_IO_ACCOUNTING */ ++#define page_iopb(page) (NULL) ++#define page_pblist(page) (&page_pbc(page)) ++ ++static inline void ub_io_release_context(struct page *pg, size_t bytes) ++{ ++} ++ ++static inline void ub_io_account_dirty(struct page *p, size_t bytes) ++{ ++} ++ ++static inline void ub_io_account_read(size_t bytes) ++{ ++} ++ ++static inline void ub_io_account_write(size_t bytes) ++{ ++} ++ ++static inline void ub_io_account_write_cancelled(size_t bytes) ++{ ++} ++ ++static inline void ub_init_io(struct kmem_cache *pb_cachep) { }; ++#endif ++ ++#ifdef CONFIG_BC_DEBUG_IO ++extern void ub_io_release_debug(struct page *pg); ++#else ++#define ub_io_release_debug(pg) do { } while (0) ++#endif ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/io_prio.h debian/binary-custom.d/openvz/src/include/bc/io_prio.h +--- ./include/bc/io_prio.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/io_prio.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,82 @@ ++/* ++ * include/bc/io_prio.h ++ * ++ * Copyright (C) 2007 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * Vasily Tarasov ++ * ++ */ ++ ++#ifndef _UB_IO_PRIO_H ++#define _UB_IO_PRIO_H ++ ++#include ++#include ++#include ++ ++#define UB_IOPRIO_MIN 0 ++#define UB_IOPRIO_MAX IOPRIO_BE_NR ++#define UB_IOPRIO_BASE 4 ++ ++struct ub_iopriv { ++ struct list_head cfq_bc_head; ++ rwlock_t cfq_bc_list_lock; ++ ++ unsigned int ioprio; ++}; ++ ++struct cfq_data; ++struct cfq_queue; ++ ++#ifdef CONFIG_BC_IO_SCHED ++extern void bc_init_ioprio(struct ub_iopriv *); ++extern void bc_fini_ioprio(struct ub_iopriv *); ++extern struct cfq_bc_data * bc_find_cfq_bc(struct ub_iopriv *, ++ struct cfq_data *); ++extern struct cfq_bc_data * bc_findcreate_cfq_bc(struct ub_iopriv *, ++ struct cfq_data *, gfp_t gfp_mask); ++extern void bc_cfq_exit_queue(struct cfq_data *); ++extern int bc_expired(struct cfq_data *); ++extern void bc_schedule_active(struct cfq_data *); ++extern void bc_inc_rqnum(struct cfq_queue *); ++extern void bc_dec_rqnum(struct cfq_queue *); ++extern unsigned long bc_set_ioprio(int, int); ++extern struct cfq_bc_data * ++__find_cfq_bc(struct ub_iopriv *iopriv, struct cfq_data *cfqd); ++extern struct user_beancounter *bc_io_switch_context(struct page *); ++extern void bc_io_restore_context(struct user_beancounter *); ++#else ++#include ++static inline void bc_init_ioprio(struct ub_iopriv *iopriv) { ; } ++static inline void bc_fini_ioprio(struct ub_iopriv *iopriv) { ; } ++static inline struct cfq_bc_data * ++bc_findcreate_cfq_bc(struct ub_iopriv *iopriv, ++ struct cfq_data *cfqd, gfp_t mask) ++{ ++ return &cfqd->cfq_bc; ++} ++static inline void bc_cfq_exit_queue(struct cfq_data *cfqd) { ; } ++static inline int bc_expired(struct cfq_data *cfqd) { return 0; } ++static inline void bc_schedule_active(struct cfq_data *cfqd) ++{ ++ cfqd->active_cfq_bc = &cfqd->cfq_bc; ++} ++static inline void bc_inc_rqnum(struct cfq_queue *cfqq) { ; } ++static inline void bc_dec_rqnum(struct cfq_queue *cfqq) { ; } ++static inline unsigned long bc_set_ioprio(int ubid, int ioprio) ++{ ++ return -EINVAL; ++} ++static inline struct cfq_bc_data * ++__find_cfq_bc(struct ub_iopriv *iopriv, struct cfq_data *cfqd) ++{ ++ return &cfqd->cfq_bc; ++} ++static inline struct user_beancounter * ++bc_io_switch_context(struct page *page) { return NULL; } ++static inline void bc_io_restore_context(struct user_beancounter *ub) { ; } ++#endif /* CONFIG_BC_IO_SCHED */ ++#endif /* _UB_IO_PRIO_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/kmem.h debian/binary-custom.d/openvz/src/include/bc/kmem.h +--- ./include/bc/kmem.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/kmem.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,69 @@ ++/* ++ * include/bc/kmem.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __UB_SLAB_H_ ++#define __UB_SLAB_H_ ++ ++#include ++#include ++ ++/* ++ * UB_KMEMSIZE accounting ++ */ ++ ++#ifdef CONFIG_BC_DEBUG_ITEMS ++#define CHARGE_ORDER(__o) (1 << (__o)) ++#define CHARGE_SIZE(__s) 1 ++#else ++#define CHARGE_ORDER(__o) (PAGE_SIZE << (__o)) ++#define CHARGE_SIZE(__s) (__s) ++#endif ++ ++#ifdef CONFIG_BEANCOUNTERS ++#define page_ub(__page) ((__page)->bc.page_ub) ++#else ++#define page_ub(__page) NULL ++#endif ++ ++struct mm_struct; ++struct page; ++struct kmem_cache; ++ ++UB_DECLARE_FUNC(struct user_beancounter *, vmalloc_ub(void *obj)) ++UB_DECLARE_FUNC(struct user_beancounter *, mem_ub(void *obj)) ++ ++UB_DECLARE_FUNC(int, ub_kmemsize_charge(struct user_beancounter *ub, ++ unsigned long size, enum ub_severity strict)) ++UB_DECLARE_VOID_FUNC(ub_kmemsize_uncharge(struct user_beancounter *ub, ++ unsigned long size)) ++ ++UB_DECLARE_FUNC(int, ub_page_charge(struct page *page, int order, gfp_t mask)) ++UB_DECLARE_VOID_FUNC(ub_page_uncharge(struct page *page, int order)) ++UB_DECLARE_FUNC(int, ub_slab_charge(struct kmem_cache *cachep, ++ void *objp, gfp_t flags)) ++UB_DECLARE_VOID_FUNC(ub_slab_uncharge(struct kmem_cache *cachep, void *obj)) ++ ++#ifdef CONFIG_BEANCOUNTERS ++static inline int should_charge(struct kmem_cache *cachep, gfp_t flags) ++{ ++ if (!(cachep->flags & SLAB_UBC)) ++ return 0; ++ if ((cachep->flags & SLAB_NO_CHARGE) && !(flags & __GFP_UBC)) ++ return 0; ++ return 1; ++} ++ ++#define should_uncharge(cachep) should_charge(cachep, __GFP_UBC) ++#else ++#define should_charge(cache, f) 0 ++#define should_uncharge(cache) 0 ++#endif ++ ++#endif /* __UB_SLAB_H_ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/misc.h debian/binary-custom.d/openvz/src/include/bc/misc.h +--- ./include/bc/misc.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/misc.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,55 @@ ++/* ++ * include/bc/misc.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_MISC_H_ ++#define __BC_MISC_H_ ++ ++#include ++ ++struct tty_struct; ++struct file; ++struct file_lock; ++struct sigqueue; ++ ++UB_DECLARE_FUNC(int, ub_file_charge(struct file *f)) ++UB_DECLARE_VOID_FUNC(ub_file_uncharge(struct file *f)) ++UB_DECLARE_FUNC(int, ub_flock_charge(struct file_lock *fl, int hard)) ++UB_DECLARE_VOID_FUNC(ub_flock_uncharge(struct file_lock *fl)) ++UB_DECLARE_FUNC(int, ub_siginfo_charge(struct sigqueue *q, ++ struct user_beancounter *ub)) ++UB_DECLARE_VOID_FUNC(ub_siginfo_uncharge(struct sigqueue *q)) ++UB_DECLARE_FUNC(int, ub_task_charge(struct task_struct *parent, ++ struct task_struct *task)) ++UB_DECLARE_VOID_FUNC(ub_task_uncharge(struct task_struct *task)) ++UB_DECLARE_VOID_FUNC(ub_task_put(struct task_struct *task)) ++UB_DECLARE_FUNC(int, ub_pty_charge(struct tty_struct *tty)) ++UB_DECLARE_VOID_FUNC(ub_pty_uncharge(struct tty_struct *tty)) ++ ++#ifdef CONFIG_BEANCOUNTERS ++#define set_flock_charged(fl) do { (fl)->fl_charged = 1; } while (0) ++#define unset_flock_charged(fl) do { \ ++ WARN_ON((fl)->fl_charged == 0); \ ++ (fl)->fl_charged = 0; \ ++ } while (0) ++#define set_mm_ub(mm, tsk) do { \ ++ (mm)->mm_ub = get_beancounter(tsk ? \ ++ tsk->task_bc.task_ub : get_exec_ub()); \ ++ } while (0) ++#define put_mm_ub(mm) do { \ ++ put_beancounter((mm)->mm_ub); \ ++ (mm)->mm_ub = NULL; \ ++ } while (0) ++#else ++#define set_flock_charged(fl) do { } while (0) ++#define unset_flock_charged(fl) do { } while (0) ++#define set_mm_ub(mm, tsk) do { } while (0) ++#define put_mm_ub(mm) do { } while (0) ++#endif ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/net.h debian/binary-custom.d/openvz/src/include/bc/net.h +--- ./include/bc/net.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/net.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,213 @@ ++/* ++ * include/bc/net.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_NET_H_ ++#define __BC_NET_H_ ++ ++/* ++ * UB_NUMXXXSOCK, UB_XXXBUF accounting ++ */ ++ ++#include ++#include ++#include ++ ++#define bid2sid(__bufid) \ ++ ((__bufid) == UB_TCPSNDBUF ? UB_NUMTCPSOCK : UB_NUMOTHERSOCK) ++ ++#define SOCK_MIN_UBCSPACE ((int)((2048 - sizeof(struct skb_shared_info)) & \ ++ ~(SMP_CACHE_BYTES-1))) ++#define SOCK_MIN_UBCSPACE_CH skb_charge_size(SOCK_MIN_UBCSPACE) ++ ++static inline int ub_skb_alloc_bc(struct sk_buff *skb, gfp_t gfp_mask) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ memset(skb_bc(skb), 0, sizeof(struct skb_beancounter)); ++#endif ++ return 0; ++} ++ ++static inline void ub_skb_free_bc(struct sk_buff *skb) ++{ ++} ++ ++#define IS_TCP_SOCK(__family, __type) \ ++ (((__family) == PF_INET || (__family) == PF_INET6) && (__type) == SOCK_STREAM) ++ ++/* number of sockets */ ++UB_DECLARE_FUNC(int, ub_sock_charge(struct sock *sk, int family, int type)) ++UB_DECLARE_FUNC(int, ub_tcp_sock_charge(struct sock *sk)) ++UB_DECLARE_FUNC(int, ub_other_sock_charge(struct sock *sk)) ++UB_DECLARE_VOID_FUNC(ub_sock_uncharge(struct sock *sk)) ++ ++/* management of queue for send space */ ++UB_DECLARE_FUNC(long, ub_sock_wait_for_space(struct sock *sk, long timeo, ++ unsigned long size)) ++UB_DECLARE_FUNC(int, ub_sock_snd_queue_add(struct sock *sk, int resource, ++ unsigned long size)) ++UB_DECLARE_VOID_FUNC(ub_sock_sndqueuedel(struct sock *sk)) ++ ++/* send space */ ++UB_DECLARE_FUNC(int, ub_sock_make_wreserv(struct sock *sk, int bufid, ++ unsigned long size)) ++UB_DECLARE_FUNC(int, ub_sock_get_wreserv(struct sock *sk, int bufid, ++ unsigned long size)) ++UB_DECLARE_VOID_FUNC(ub_sock_ret_wreserv(struct sock *sk, int bufid, ++ unsigned long size, unsigned long ressize)) ++UB_DECLARE_FUNC(int, ub_sock_tcp_chargesend(struct sock *sk, ++ struct sk_buff *skb, enum ub_severity strict)) ++UB_DECLARE_FUNC(int, ub_sock_tcp_chargepage(struct sock *sk)) ++UB_DECLARE_VOID_FUNC(ub_sock_tcp_detachpage(struct sock *sk)) ++ ++UB_DECLARE_FUNC(int, ub_nlrcvbuf_charge(struct sk_buff *skb, struct sock *sk)) ++ ++/* receive space */ ++UB_DECLARE_FUNC(int, ub_sockrcvbuf_charge(struct sock *sk, struct sk_buff *skb)) ++UB_DECLARE_FUNC(int, ub_sock_tcp_chargerecv(struct sock *sk, ++ struct sk_buff *skb, enum ub_severity strict)) ++ ++/* skb destructor */ ++UB_DECLARE_VOID_FUNC(ub_skb_uncharge(struct sk_buff *skb)) ++ ++static inline int ub_sock_makewres_other(struct sock *sk, unsigned long size) ++{ ++ return ub_sock_make_wreserv(sk, UB_OTHERSOCKBUF, size); ++} ++ ++static inline int ub_sock_makewres_tcp(struct sock *sk, unsigned long size) ++{ ++ return ub_sock_make_wreserv(sk, UB_TCPSNDBUF, size); ++} ++ ++UB_DECLARE_FUNC(int, ub_sock_getwres_other(struct sock *sk, ++ unsigned long size)) ++ ++static inline int ub_sock_getwres_tcp(struct sock *sk, unsigned long size) ++{ ++ return ub_sock_get_wreserv(sk, UB_TCPSNDBUF, size); ++} ++ ++UB_DECLARE_VOID_FUNC(ub_sock_retwres_other(struct sock *sk, ++ unsigned long size, unsigned long ressize)) ++ ++static inline void ub_sock_retwres_tcp(struct sock *sk, unsigned long size, ++ unsigned long ressize) ++{ ++ ub_sock_ret_wreserv(sk, UB_TCPSNDBUF, size, ressize); ++} ++ ++static inline int ub_sock_sndqueueadd_other(struct sock *sk, unsigned long sz) ++{ ++ return ub_sock_snd_queue_add(sk, UB_OTHERSOCKBUF, sz); ++} ++ ++static inline int ub_sock_sndqueueadd_tcp(struct sock *sk, unsigned long sz) ++{ ++ return ub_sock_snd_queue_add(sk, UB_TCPSNDBUF, sz); ++} ++ ++static inline int ub_tcpsndbuf_charge(struct sock *sk, ++ struct sk_buff *skb) ++{ ++ return ub_sock_tcp_chargesend(sk, skb, UB_HARD); ++} ++ ++static inline int ub_tcpsndbuf_charge_forced(struct sock *sk, ++ struct sk_buff *skb) ++{ ++ return ub_sock_tcp_chargesend(sk, skb, UB_FORCE); ++} ++ ++static inline int ub_tcprcvbuf_charge(struct sock *sk, struct sk_buff *skb) ++{ ++ return ub_sock_tcp_chargerecv(sk, skb, UB_SOFT); ++} ++ ++static inline int ub_tcprcvbuf_charge_forced(struct sock *sk, ++ struct sk_buff *skb) ++{ ++ return ub_sock_tcp_chargerecv(sk, skb, UB_FORCE); ++} ++ ++/* Charge size */ ++static inline unsigned long skb_charge_datalen(unsigned long chargesize) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ unsigned long slabsize; ++ ++ chargesize -= sizeof(struct sk_buff); ++ slabsize = 64; ++ do { ++ slabsize <<= 1; ++ } while (slabsize <= chargesize); ++ ++ slabsize >>= 1; ++ return (slabsize - sizeof(struct skb_shared_info)) & ++ ~(SMP_CACHE_BYTES-1); ++#else ++ return 0; ++#endif ++} ++ ++static inline unsigned long skb_charge_size_gen(unsigned long size) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ unsigned int slabsize; ++ ++ size = SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info); ++ slabsize = 32; /* min size is 64 because of skb_shared_info */ ++ do { ++ slabsize <<= 1; ++ } while (slabsize < size); ++ ++ return slabsize + sizeof(struct sk_buff); ++#else ++ return 0; ++#endif ++ ++} ++ ++static inline unsigned long skb_charge_size_const(unsigned long size) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ unsigned int ret; ++ if (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info) <= 64) ++ ret = 64 + sizeof(struct sk_buff); ++ else if (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info) <= 128) ++ ret = 128 + sizeof(struct sk_buff); ++ else if (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info) <= 256) ++ ret = 256 + sizeof(struct sk_buff); ++ else if (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info) <= 512) ++ ret = 512 + sizeof(struct sk_buff); ++ else if (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info) <= 1024) ++ ret = 1024 + sizeof(struct sk_buff); ++ else if (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info) <= 2048) ++ ret = 2048 + sizeof(struct sk_buff); ++ else if (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info) <= 4096) ++ ret = 4096 + sizeof(struct sk_buff); ++ else ++ ret = skb_charge_size_gen(size); ++ return ret; ++#else ++ return 0; ++#endif ++} ++ ++ ++#define skb_charge_size(__size) \ ++ (__builtin_constant_p(__size) ? \ ++ skb_charge_size_const(__size) : \ ++ skb_charge_size_gen(__size)) ++ ++UB_DECLARE_FUNC(int, skb_charge_fullsize(struct sk_buff *skb)) ++UB_DECLARE_VOID_FUNC(ub_skb_set_charge(struct sk_buff *skb, ++ struct sock *sk, unsigned long size, int res)) ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/oom_kill.h debian/binary-custom.d/openvz/src/include/bc/oom_kill.h +--- ./include/bc/oom_kill.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/oom_kill.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,26 @@ ++#include ++#include ++ ++UB_DECLARE_FUNC(int, ub_oom_lock(void)) ++UB_DECLARE_FUNC(struct user_beancounter *, ub_oom_select_worst(void)) ++UB_DECLARE_VOID_FUNC(ub_oom_mm_killed(struct user_beancounter *ub)) ++UB_DECLARE_VOID_FUNC(ub_oom_unlock(void)) ++UB_DECLARE_VOID_FUNC(ub_out_of_memory(struct user_beancounter *ub)) ++UB_DECLARE_VOID_FUNC(ub_oom_task_dead(struct task_struct *tsk)) ++UB_DECLARE_FUNC(int, ub_oom_task_skip(struct user_beancounter *ub, ++ struct task_struct *tsk)) ++ ++#ifdef CONFIG_BEANCOUNTERS ++extern int oom_generation; ++extern int oom_kill_counter; ++#define ub_oom_start() do { \ ++ current->task_bc.oom_generation = oom_generation; \ ++ } while (0) ++#define ub_oom_task_killed(p) do { \ ++ oom_kill_counter++; \ ++ wake_up_process(p); \ ++ } while (0) ++#else ++#define ub_oom_start() do { } while (0) ++#define ub_oom_task_killed(p) do { } while (0) ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/proc.h debian/binary-custom.d/openvz/src/include/bc/proc.h +--- ./include/bc/proc.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/proc.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,40 @@ ++/* ++ * include/bc/proc.h ++ * ++ * Copyright (C) 2006 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __UB_PROC_H_ ++#define __UB_PROC_H_ ++ ++#include ++ ++struct bc_proc_entry { ++ char *name; ++ union { ++ int (*show)(struct seq_file *, void *); ++ struct file_operations *fops; ++ } u; ++ struct bc_proc_entry *next; ++ int cookie; ++}; ++ ++struct user_beancounter; ++ ++void bc_register_proc_entry(struct bc_proc_entry *); ++void bc_register_proc_root_entry(struct bc_proc_entry *); ++ ++static inline struct user_beancounter *seq_beancounter(struct seq_file *f) ++{ ++ return (struct user_beancounter *)(f->private); ++} ++ ++extern const char *bc_proc_lu_fmt; ++extern const char *bc_proc_lu_lfmt; ++extern const char *bc_proc_llu_fmt; ++extern const char *bc_proc_lu_lu_fmt; ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/rss_pages.h debian/binary-custom.d/openvz/src/include/bc/rss_pages.h +--- ./include/bc/rss_pages.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/rss_pages.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,57 @@ ++/* ++ * include/bc/rss_pages.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __RSS_PAGES_H_ ++#define __RSS_PAGES_H_ ++ ++/* ++ * Page_beancounters ++ */ ++ ++struct page; ++struct user_beancounter; ++ ++#define PB_MAGIC 0x62700001UL ++ ++struct page_beancounter { ++ unsigned long pb_magic; ++ struct page *page; ++ struct user_beancounter *ub; ++ union { ++ struct page_beancounter *next_hash; ++ struct page_beancounter *page_pb_list; ++ }; ++ union { ++ unsigned refcount; ++ unsigned io_debug; ++ }; ++ union { ++ struct list_head page_list; ++ struct list_head io_list; ++ }; ++}; ++ ++#define PB_REFCOUNT_BITS 24 ++#define PB_SHIFT_GET(c) ((c) >> PB_REFCOUNT_BITS) ++#define PB_SHIFT_INC(c) ((c) += (1 << PB_REFCOUNT_BITS)) ++#define PB_SHIFT_DEC(c) ((c) -= (1 << PB_REFCOUNT_BITS)) ++#define PB_COUNT_GET(c) ((c) & ((1 << PB_REFCOUNT_BITS) - 1)) ++#define PB_COUNT_INC(c) ((c)++) ++#define PB_COUNT_DEC(c) ((c)--) ++#define PB_REFCOUNT_MAKE(s, c) (((s) << PB_REFCOUNT_BITS) + (c)) ++ ++#define page_pbc(__page) ((__page)->bc.page_pb) ++ ++extern spinlock_t pb_lock; ++ ++struct address_space; ++extern int is_shmem_mapping(struct address_space *); ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/sock.h debian/binary-custom.d/openvz/src/include/bc/sock.h +--- ./include/bc/sock.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/sock.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,47 @@ ++/* ++ * include/bc/sock.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_SOCK_H_ ++#define __BC_SOCK_H_ ++ ++#include ++ ++struct sock; ++struct sk_buff; ++ ++struct skb_beancounter { ++ struct user_beancounter *ub; ++ unsigned long charged:27, resource:5; ++}; ++ ++struct sock_beancounter { ++ struct user_beancounter *ub; ++ /* ++ * poll_reserv accounts space already charged for future sends. ++ * It is required to make poll agree with sendmsg. ++ * Additionally, it makes real charges (with taking bc spinlock) ++ * in the send path rarer, speeding networking up. ++ * For TCP (only): changes are protected by socket lock (not bc!) ++ * For all proto: may be read without serialization in poll. ++ */ ++ unsigned long poll_reserv; ++ unsigned long forw_space; ++ /* fields below are protected by bc spinlock */ ++ unsigned long ub_waitspc; /* space waiting for */ ++ unsigned long ub_wcharged; ++ struct list_head ub_sock_list; ++}; ++ ++#define sock_bc(__sk) (&(__sk)->sk_bc) ++#define skb_bc(__skb) (&(__skb)->skb_bc) ++#define skbc_sock(__skbc) (container_of(__skbc, struct sock, sk_bc)) ++#define sock_has_ubc(__sk) (sock_bc(__sk)->ub != NULL) ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/sock_orphan.h debian/binary-custom.d/openvz/src/include/bc/sock_orphan.h +--- ./include/bc/sock_orphan.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/sock_orphan.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,106 @@ ++/* ++ * include/bc/sock_orphan.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_SOCK_ORPHAN_H_ ++#define __BC_SOCK_ORPHAN_H_ ++ ++#include ++ ++#include "bc/beancounter.h" ++#include "bc/net.h" ++ ++ ++static inline atomic_t *__ub_get_orphan_count_ptr(struct sock *sk) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ if (sock_has_ubc(sk)) ++ return &sock_bc(sk)->ub->ub_orphan_count; ++#endif ++ return sk->sk_prot->orphan_count; ++} ++ ++static inline void ub_inc_orphan_count(struct sock *sk) ++{ ++ atomic_inc(__ub_get_orphan_count_ptr(sk)); ++} ++ ++static inline void ub_dec_orphan_count(struct sock *sk) ++{ ++ atomic_dec(__ub_get_orphan_count_ptr(sk)); ++} ++ ++static inline int ub_get_orphan_count(struct sock *sk) ++{ ++ return atomic_read(__ub_get_orphan_count_ptr(sk)); ++} ++ ++extern int __ub_too_many_orphans(struct sock *sk, int count); ++static inline int ub_too_many_orphans(struct sock *sk, int count) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ if (__ub_too_many_orphans(sk, count)) ++ return 1; ++#endif ++ return (ub_get_orphan_count(sk) > sysctl_tcp_max_orphans || ++ (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && ++ atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])); ++} ++ ++#include ++ ++struct inet_timewait_sock; ++ ++static inline void ub_timewait_mod(struct inet_timewait_sock *tw, int incdec) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *ub; ++ ++ ub = slab_ub(tw); ++ if (ub != NULL) ++ ub->ub_tw_count += incdec; ++#endif ++} ++ ++static inline int __ub_timewait_check(struct sock *sk) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *ub; ++ unsigned long mem_max, mem; ++ int tw_count; ++ ++ ub = sock_bc(sk)->ub; ++ if (ub == NULL) ++ return 1; ++ ++ tw_count = ub->ub_tw_count; ++ mem_max = sysctl_tcp_max_tw_kmem_fraction * ++ ((ub->ub_parms[UB_KMEMSIZE].limit >> 10) + 1); ++ mem = kmem_cache_objuse(sk->sk_prot_creator->twsk_prot->twsk_slab); ++ mem *= tw_count; ++ return tw_count < sysctl_tcp_max_tw_buckets_ub && mem < mem_max; ++#else ++ return 1; ++#endif ++} ++ ++#define ub_timewait_inc(tw, twdr) do { \ ++ if ((twdr)->ub_managed) \ ++ ub_timewait_mod(tw, 1); \ ++ } while (0) ++ ++#define ub_timewait_dec(tw, twdr) do { \ ++ if ((twdr)->ub_managed) \ ++ ub_timewait_mod(tw, -1); \ ++ } while (0) ++ ++#define ub_timewait_check(sk, twdr) ((!(twdr)->ub_managed) || \ ++ __ub_timewait_check(sk)) ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/statd.h debian/binary-custom.d/openvz/src/include/bc/statd.h +--- ./include/bc/statd.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/statd.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,70 @@ ++/* ++ * include/bc/statd.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_STATD_H_ ++#define __BC_STATD_H_ ++ ++/* sys_ubstat commands list */ ++#define UBSTAT_READ_ONE 0x010000 ++#define UBSTAT_READ_ALL 0x020000 ++#define UBSTAT_READ_FULL 0x030000 ++#define UBSTAT_UBLIST 0x040000 ++#define UBSTAT_UBPARMNUM 0x050000 ++#define UBSTAT_GETTIME 0x060000 ++ ++#define UBSTAT_CMD(func) ((func) & 0xF0000) ++#define UBSTAT_PARMID(func) ((func) & 0x0FFFF) ++ ++#define TIME_MAX_SEC (LONG_MAX / HZ) ++#define TIME_MAX_JIF (TIME_MAX_SEC * HZ) ++ ++typedef unsigned long ubstattime_t; ++ ++typedef struct { ++ ubstattime_t start_time; ++ ubstattime_t end_time; ++ ubstattime_t cur_time; ++} ubgettime_t; ++ ++typedef struct { ++ long maxinterval; ++ int signum; ++} ubnotifrq_t; ++ ++typedef struct { ++ unsigned long maxheld; ++ unsigned long failcnt; ++} ubstatparm_t; ++ ++typedef struct { ++ unsigned long barrier; ++ unsigned long limit; ++ unsigned long held; ++ unsigned long maxheld; ++ unsigned long minheld; ++ unsigned long failcnt; ++ unsigned long __unused1; ++ unsigned long __unused2; ++} ubstatparmf_t; ++ ++typedef struct { ++ ubstattime_t start_time; ++ ubstattime_t end_time; ++ ubstatparmf_t param[0]; ++} ubstatfull_t; ++ ++#ifdef __KERNEL__ ++struct ub_stat_notify { ++ struct list_head list; ++ struct task_struct *task; ++ int signum; ++}; ++#endif ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/task.h debian/binary-custom.d/openvz/src/include/bc/task.h +--- ./include/bc/task.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/task.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,69 @@ ++/* ++ * include/bc/task.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_TASK_H_ ++#define __BC_TASK_H_ ++ ++struct user_beancounter; ++ ++ ++#ifdef CONFIG_BEANCOUNTERS ++struct task_beancounter { ++ struct user_beancounter *exec_ub; ++ struct user_beancounter *saved_ub; ++ struct user_beancounter *task_ub; ++ struct user_beancounter *fork_sub; ++ unsigned long file_precharged, file_quant, file_count; ++ unsigned long kmem_precharged; ++ char dentry_alloc, pgfault_handle; ++ void *task_fnode, *task_freserv; ++ unsigned long oom_generation; ++ unsigned long task_data[4]; ++ unsigned long pgfault_allot; ++}; ++ ++#define get_task_ub(__task) ((__task)->task_bc.task_ub) ++ ++extern struct user_beancounter ub0; ++#define get_ub0() (&ub0) ++ ++#define ub_save_context(t) do { \ ++ t->task_bc.saved_ub = t->task_bc.exec_ub; \ ++ t->task_bc.exec_ub = get_ub0(); \ ++ } while (0) ++#define ub_restore_context(t) do { \ ++ t->task_bc.exec_ub = t->task_bc.saved_ub; \ ++ } while (0) ++ ++#define get_exec_ub() (current->task_bc.exec_ub) ++#define set_exec_ub(__newub) \ ++({ \ ++ struct user_beancounter *old; \ ++ struct task_beancounter *tbc; \ ++ \ ++ tbc = ¤t->task_bc; \ ++ old = tbc->exec_ub; \ ++ tbc->exec_ub = __newub; \ ++ old; \ ++}) ++ ++void ub_init_task_bc(struct task_beancounter *); ++ ++#else /* CONFIG_BEANCOUNTERS */ ++ ++#define get_ub0() (NULL) ++#define get_exec_ub() (NULL) ++#define get_task_ub(task) (NULL) ++#define set_exec_ub(__ub) (NULL) ++#define ub_save_context(t) do { } while (0) ++#define ub_restore_context(t) do { } while (0) ++ ++#endif /* CONFIG_BEANCOUNTERS */ ++#endif /* __task.h_ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/tcp.h debian/binary-custom.d/openvz/src/include/bc/tcp.h +--- ./include/bc/tcp.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/tcp.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,76 @@ ++/* ++ * include/bc/tcp.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __BC_TCP_H_ ++#define __BC_TCP_H_ ++ ++/* ++ * UB_NUMXXXSOCK, UB_XXXBUF accounting ++ */ ++ ++#include ++#include ++ ++static inline void ub_tcp_update_maxadvmss(struct sock *sk) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ if (!sock_has_ubc(sk)) ++ return; ++ if (sock_bc(sk)->ub->ub_maxadvmss >= tcp_sk(sk)->advmss) ++ return; ++ ++ sock_bc(sk)->ub->ub_maxadvmss = ++ skb_charge_size(MAX_HEADER + sizeof(struct iphdr) ++ + sizeof(struct tcphdr) + tcp_sk(sk)->advmss); ++#endif ++} ++ ++static inline int ub_tcp_rmem_allows_expand(struct sock *sk) ++{ ++ if (tcp_memory_pressure) ++ return 0; ++#ifdef CONFIG_BEANCOUNTERS ++ if (sock_has_ubc(sk)) { ++ struct user_beancounter *ub; ++ ++ ub = sock_bc(sk)->ub; ++ if (ub->ub_rmem_pressure == UB_RMEM_EXPAND) ++ return 1; ++ if (ub->ub_rmem_pressure == UB_RMEM_SHRINK) ++ return 0; ++ return sk->sk_rcvbuf <= ub->ub_rmem_thres; ++ } ++#endif ++ return 1; ++} ++ ++static inline int ub_tcp_memory_pressure(struct sock *sk) ++{ ++ if (tcp_memory_pressure) ++ return 1; ++#ifdef CONFIG_BEANCOUNTERS ++ if (sock_has_ubc(sk)) ++ return sock_bc(sk)->ub->ub_rmem_pressure != UB_RMEM_EXPAND; ++#endif ++ return 0; ++} ++ ++static inline int ub_tcp_shrink_rcvbuf(struct sock *sk) ++{ ++ if (tcp_memory_pressure) ++ return 1; ++#ifdef CONFIG_BEANCOUNTERS ++ if (sock_has_ubc(sk)) ++ return sock_bc(sk)->ub->ub_rmem_pressure == UB_RMEM_SHRINK; ++#endif ++ return 0; ++} ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/bc/vmpages.h debian/binary-custom.d/openvz/src/include/bc/vmpages.h +--- ./include/bc/vmpages.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/bc/vmpages.h 2012-11-13 15:20:14.996569078 +0000 +@@ -0,0 +1,152 @@ ++/* ++ * include/bc/vmpages.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __UB_PAGES_H_ ++#define __UB_PAGES_H_ ++ ++#include ++#include ++#include ++ ++/* ++ * Check whether vma has private or copy-on-write mapping. ++ * Should match checks in ub_protected_charge(). ++ */ ++#define VM_UB_PRIVATE(__flags, __file) \ ++ ( ((__flags) & VM_WRITE) ? \ ++ (__file) == NULL || !((__flags) & VM_SHARED) : \ ++ 0 \ ++ ) ++ ++/* Mprotect charging result */ ++#define PRIVVM_ERROR -1 ++#define PRIVVM_NO_CHARGE 0 /* UB_DECLARE_FUNC retval with ubc off */ ++#define PRIVVM_TO_PRIVATE 1 ++#define PRIVVM_TO_SHARED 2 ++ ++UB_DECLARE_FUNC(int, ub_protected_charge(struct mm_struct *mm, ++ unsigned long size, ++ unsigned long newflags, ++ struct vm_area_struct *vma)) ++ ++UB_DECLARE_VOID_FUNC(ub_unused_privvm_add(struct mm_struct *mm, ++ struct vm_area_struct *vma, ++ unsigned long num)) ++#define ub_unused_privvm_inc(mm, vma) ub_unused_privvm_add(mm, vma, 1) ++UB_DECLARE_VOID_FUNC(ub_unused_privvm_sub(struct mm_struct *mm, ++ struct vm_area_struct *vma, ++ unsigned long num)) ++#define ub_unused_privvm_dec(mm, vma) ub_unused_privvm_sub(mm, vma, 1) ++ ++UB_DECLARE_VOID_FUNC(__ub_unused_privvm_dec(struct mm_struct *mm, ++ long sz)) ++ ++UB_DECLARE_FUNC(int, ub_memory_charge(struct mm_struct *mm, ++ unsigned long size, ++ unsigned vm_flags, ++ struct file *vm_file, ++ int strict)) ++UB_DECLARE_VOID_FUNC(ub_memory_uncharge(struct mm_struct *mm, ++ unsigned long size, ++ unsigned vm_flags, ++ struct file *vm_file)) ++ ++struct shmem_inode_info; ++UB_DECLARE_FUNC(int, ub_shmpages_charge(struct shmem_inode_info *i, ++ unsigned long sz)) ++UB_DECLARE_VOID_FUNC(ub_shmpages_uncharge(struct shmem_inode_info *i, ++ unsigned long sz)) ++UB_DECLARE_VOID_FUNC(ub_tmpfs_respages_inc(struct shmem_inode_info *shi)) ++UB_DECLARE_VOID_FUNC(ub_tmpfs_respages_sub(struct shmem_inode_info *shi, ++ unsigned long size)) ++#define ub_tmpfs_respages_dec(shi) ub_tmpfs_respages_sub(shi, 1) ++ ++#ifdef CONFIG_BEANCOUNTERS ++#define shmi_ub_set(shi, ub) do { \ ++ (shi)->shmi_ub = get_beancounter(ub); \ ++ } while (0) ++#define shmi_ub_put(shi) do { \ ++ put_beancounter((shi)->shmi_ub); \ ++ (shi)->shmi_ub = NULL; \ ++ } while (0) ++#else ++#define shmi_ub_set(shi, ub) do { } while (0) ++#define shmi_ub_put(shi) do { } while (0) ++#endif ++ ++UB_DECLARE_FUNC(int, ub_locked_charge(struct mm_struct *mm, ++ unsigned long size)) ++UB_DECLARE_VOID_FUNC(ub_locked_uncharge(struct mm_struct *mm, ++ unsigned long size)) ++UB_DECLARE_FUNC(int, ub_lockedshm_charge(struct shmem_inode_info *shi, ++ unsigned long size)) ++UB_DECLARE_VOID_FUNC(ub_lockedshm_uncharge(struct shmem_inode_info *shi, ++ unsigned long size)) ++ ++UB_DECLARE_FUNC(unsigned long, pages_in_vma_range(struct vm_area_struct *vma, ++ unsigned long addr, unsigned long end)) ++#define pages_in_vma(vma) (pages_in_vma_range(vma, \ ++ vma->vm_start, vma->vm_end)) ++ ++#define UB_PAGE_WEIGHT_SHIFT 24 ++#define UB_PAGE_WEIGHT (1 << UB_PAGE_WEIGHT_SHIFT) ++ ++struct page_beancounter; ++#define PBC_COPY_SAME ((struct page_beancounter *) 1) ++ ++/* Mprotect charging result */ ++#define PRIVVM_ERROR -1 ++#define PRIVVM_NO_CHARGE 0 ++#define PRIVVM_TO_PRIVATE 1 ++#define PRIVVM_TO_SHARED 2 ++ ++extern void fastcall __ub_update_physpages(struct user_beancounter *ub); ++extern void fastcall __ub_update_oomguarpages(struct user_beancounter *ub); ++extern void fastcall __ub_update_privvm(struct user_beancounter *ub); ++ ++#ifdef CONFIG_BC_RSS_ACCOUNTING ++#define PB_DECLARE_FUNC(ret, decl) UB_DECLARE_FUNC(ret, decl) ++#define PB_DECLARE_VOID_FUNC(decl) UB_DECLARE_VOID_FUNC(decl) ++#else ++#define PB_DECLARE_FUNC(ret, decl) static inline ret decl {return (ret)0;} ++#define PB_DECLARE_VOID_FUNC(decl) static inline void decl { } ++#endif ++ ++PB_DECLARE_FUNC(int, pb_alloc(struct page_beancounter **pbc)) ++PB_DECLARE_FUNC(int, pb_alloc_list(struct page_beancounter **pbc, int num)) ++PB_DECLARE_FUNC(int, pb_alloc_all(struct page_beancounter **pbc)) ++PB_DECLARE_VOID_FUNC(pb_add_ref(struct page *page, ++ struct mm_struct *mm, ++ struct page_beancounter **pbc)) ++PB_DECLARE_VOID_FUNC(pb_dup_ref(struct page *page, ++ struct mm_struct *mm, ++ struct page_beancounter **pbc)) ++PB_DECLARE_VOID_FUNC(pb_free_list(struct page_beancounter **pb)) ++PB_DECLARE_VOID_FUNC(pb_free(struct page_beancounter **pb)) ++PB_DECLARE_VOID_FUNC(pb_remove_ref(struct page *page, ++ struct mm_struct *mm)) ++ ++PB_DECLARE_FUNC(struct user_beancounter *, pb_grab_page_ub(struct page *page)) ++#endif ++ ++#ifdef CONFIG_BC_SWAP_ACCOUNTING ++#define SWP_DECLARE_FUNC(ret, decl) UB_DECLARE_FUNC(ret, decl) ++#define SWP_DECLARE_VOID_FUNC(decl) UB_DECLARE_VOID_FUNC(decl) ++#else ++#define SWP_DECLARE_FUNC(ret, decl) static inline ret decl {return (ret)0;} ++#define SWP_DECLARE_VOID_FUNC(decl) static inline void decl { } ++#endif ++ ++struct swap_info_struct; ++SWP_DECLARE_FUNC(int, ub_swap_init(struct swap_info_struct *si, pgoff_t n)) ++SWP_DECLARE_VOID_FUNC(ub_swap_fini(struct swap_info_struct *si)) ++SWP_DECLARE_VOID_FUNC(ub_swapentry_inc(struct swap_info_struct *si, pgoff_t n, ++ struct user_beancounter *ub)) ++SWP_DECLARE_VOID_FUNC(ub_swapentry_dec(struct swap_info_struct *si, pgoff_t n)) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/aio.h debian/binary-custom.d/openvz/src/include/linux/aio.h +--- ./include/linux/aio.h 2012-06-12 16:25:24.014312496 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/aio.h 2012-11-13 15:20:15.004569081 +0000 +@@ -245,4 +245,8 @@ + extern unsigned long aio_nr; + extern unsigned long aio_max_nr; + ++void wait_for_all_aios(struct kioctx *ctx); ++extern struct kmem_cache *kioctx_cachep; ++extern void aio_kick_handler(struct work_struct *); ++ + #endif /* __LINUX__AIO_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/capability.h debian/binary-custom.d/openvz/src/include/linux/capability.h +--- ./include/linux/capability.h 2012-06-12 16:25:24.022312496 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/capability.h 2012-11-13 15:20:15.012569082 +0000 +@@ -61,6 +61,7 @@ + }; + + #ifdef __KERNEL__ ++#include + + /* #define STRICT_CAP_T_TYPECHECKS */ + +@@ -168,12 +169,9 @@ + + #define CAP_NET_BROADCAST 11 + +-/* Allow interface configuration */ + /* Allow administration of IP firewall, masquerading and accounting */ + /* Allow setting debug option on sockets */ + /* Allow modification of routing tables */ +-/* Allow setting arbitrary process / process group ownership on +- sockets */ + /* Allow binding to any address for transparent proxying */ + /* Allow setting TOS (type of service) */ + /* Allow setting promiscuous mode */ +@@ -204,6 +202,7 @@ + #define CAP_SYS_MODULE 16 + + /* Allow ioperm/iopl access */ ++/* Allow O_DIRECT access */ + /* Allow sending USB messages to any device via /proc/bus/usb */ + + #define CAP_SYS_RAWIO 17 +@@ -222,24 +221,19 @@ + + /* Allow configuration of the secure attention key */ + /* Allow administration of the random device */ +-/* Allow examination and configuration of disk quotas */ + /* Allow configuring the kernel's syslog (printk behaviour) */ + /* Allow setting the domainname */ + /* Allow setting the hostname */ + /* Allow calling bdflush() */ +-/* Allow mount() and umount(), setting up new smb connection */ ++/* Allow setting up new smb connection */ + /* Allow some autofs root ioctls */ + /* Allow nfsservctl */ + /* Allow VM86_REQUEST_IRQ */ + /* Allow to read/write pci config on alpha */ + /* Allow irix_prctl on mips (setstacksize) */ + /* Allow flushing all cache on m68k (sys_cacheflush) */ +-/* Allow removing semaphores */ +-/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores +- and shared memory */ + /* Allow locking/unlocking of shared memory segment */ + /* Allow turning swap on/off */ +-/* Allow forged pids on socket credentials passing */ + /* Allow setting readahead and flushing buffers on block devices */ + /* Allow setting geometry in floppy driver */ + /* Allow turning DMA on/off in xd driver */ +@@ -257,6 +251,8 @@ + arbitrary SCSI commands */ + /* Allow setting encryption key on loopback filesystem */ + /* Allow setting zone reclaim policy */ ++/* Modify data journaling mode on ext[34] filesystem (uses journaling ++ resources) */ + + #define CAP_SYS_ADMIN 21 + +@@ -276,7 +272,7 @@ + /* Override resource limits. Set resource limits. */ + /* Override quota limits. */ + /* Override reserved space on ext2 filesystem */ +-/* Modify data journaling mode on ext3 filesystem (uses journaling ++/* Modify data journaling mode on ext[34] filesystem (uses journaling + resources) */ + /* NOTE: ext2 honors fsuid when checking for resource overrides, so + you can override using fsuid too */ +@@ -312,8 +308,59 @@ + + #define CAP_SETFCAP 31 + ++/* ++ * Important note: VZ capabilities do intersect with CAP_AUDIT ++ * this is due to compatibility reasons. Nothing bad. ++ * Both VZ and Audit/SELinux caps are disabled in VPSs. ++ */ ++ ++/* Allow access to all information. In the other case some structures will be ++ hiding to ensure different Virtual Environment non-interaction on the same ++ node */ ++#define CAP_SETVEID 29 ++ ++#define CAP_VE_ADMIN 30 ++ + #ifdef __KERNEL__ + ++#ifdef CONFIG_VE ++ ++/* Replacement for CAP_NET_ADMIN: ++ delegated rights to the Virtual environment of its network administration. ++ For now the following rights have been delegated: ++ ++ Allow setting arbitrary process / process group ownership on sockets ++ Allow interface configuration ++ */ ++#define CAP_VE_NET_ADMIN CAP_VE_ADMIN ++ ++/* Replacement for CAP_SYS_ADMIN: ++ delegated rights to the Virtual environment of its administration. ++ For now the following rights have been delegated: ++ */ ++/* Allow mount/umount/remount */ ++/* Allow examination and configuration of disk quotas */ ++/* Allow removing semaphores */ ++/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores ++ and shared memory */ ++/* Allow locking/unlocking of shared memory segment */ ++/* Allow forged pids on socket credentials passing */ ++ ++#define CAP_VE_SYS_ADMIN CAP_VE_ADMIN ++#else ++#define CAP_VE_NET_ADMIN CAP_NET_ADMIN ++#define CAP_VE_SYS_ADMIN CAP_SYS_ADMIN ++#endif ++ ++/* ++ * Bounding set ++ */ ++#ifdef CONFIG_VE ++#define cap_bset (get_exec_env()->ve_cap_bset) ++#else ++extern kernel_cap_t cap_bset; ++#endif ++ + /* + * Internal kernel functions only + */ +@@ -372,13 +419,23 @@ + #define cap_issubset(a,set) (!(cap_t(a) & ~cap_t(set))) + + #define cap_clear(c) do { cap_t(c) = 0; } while(0) ++#ifndef CONFIG_VE + #define cap_set_full(c) do { cap_t(c) = ~0; } while(0) ++#else ++#define cap_set_full(c) \ ++ do { \ ++ cap_t(c) = ve_is_super(get_exec_env()) ? \ ++ ~0 : \ ++ cap_bset; \ ++ } while(0) ++#endif + #define cap_mask(c,mask) do { cap_t(c) &= cap_t(mask); } while(0) + + #define cap_is_fs_cap(c) (CAP_TO_MASK(c) & CAP_FS_MASK) + + int capable(int cap); + int __capable(struct task_struct *t, int cap); ++extern spinlock_t task_capability_lock; + + #endif /* __KERNEL__ */ + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/cfq-iosched.h debian/binary-custom.d/openvz/src/include/linux/cfq-iosched.h +--- ./include/linux/cfq-iosched.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/cfq-iosched.h 2012-11-13 15:20:15.016569080 +0000 +@@ -0,0 +1,160 @@ ++#ifndef _LINUX_CFQ_IOSCHED_H ++#define _LINUX_CFQ_IOSCHED_H ++ ++#include ++#include ++#include ++ ++extern struct kmem_cache *cfq_pool; ++ ++#define CFQ_PRIO_LISTS IOPRIO_BE_NR ++ ++/* ++ * Most of our rbtree usage is for sorting with min extraction, so ++ * if we cache the leftmost node we don't have to walk down the tree ++ * to find it. Idea borrowed from Ingo Molnars CFS scheduler. We should ++ * move this into the elevator for the rq sorting as well. ++ */ ++struct cfq_rb_root { ++ struct rb_root rb; ++ struct rb_node *left; ++}; ++#define CFQ_RB_ROOT (struct cfq_rb_root) { RB_ROOT, NULL, } ++ ++/* ++ * Per (Device, UBC) queue data ++ */ ++struct cfq_bc_data { ++ /* for ub.iopriv->cfq_bc_head */ ++ struct list_head cfq_bc_list; ++ /* for cfqd->cfq_bc_queue */ ++ struct rb_node cfq_bc_node; ++ ++ struct cfq_data *cfqd; ++ struct ub_iopriv *ub_iopriv; ++ ++ /* ++ * rr list of queues with requests and the count of them ++ */ ++ struct cfq_rb_root service_tree; ++ ++ int cur_prio; ++ int cur_end_prio; ++ ++ unsigned long rqnum; ++ unsigned long on_dispatch; ++ unsigned long cfq_bc_iotime; ++ ++ /* ++ * async queue for each priority case ++ */ ++ struct cfq_queue *async_cfqq[2][CFQ_PRIO_LISTS]; ++ struct cfq_queue *async_idle_cfqq; ++ ++ /* write under cfqd->queue->request_queue_lock */ ++ seqcount_t stat_lock; ++ /* summarize delays between enqueue and activation. */ ++ unsigned long wait_time; ++ unsigned long wait_start; ++}; ++ ++/* ++ * Per block device queue structure ++ */ ++struct cfq_data { ++ struct request_queue *queue; ++ ++#ifndef CONFIG_BC_IO_SCHED ++ struct cfq_bc_data cfq_bc; ++#endif ++ unsigned int busy_queues; ++ ++ int rq_in_driver; ++ int sync_flight; ++ int hw_tag; ++ ++ /* ++ * idle window management ++ */ ++ struct timer_list idle_slice_timer; ++ struct work_struct unplug_work; ++ ++ struct cfq_queue *active_queue; ++ struct cfq_io_context *active_cic; ++ ++ struct timer_list idle_class_timer; ++ ++ sector_t last_position; ++ unsigned long last_end_request; ++ ++ /* ++ * tunables, see top of file ++ */ ++ unsigned int cfq_quantum; ++ unsigned int cfq_fifo_expire[2]; ++ unsigned int cfq_back_penalty; ++ unsigned int cfq_back_max; ++ unsigned int cfq_slice[2]; ++ unsigned int cfq_slice_async_rq; ++ unsigned int cfq_slice_idle; ++ ++ struct list_head cic_list; ++ ++ /* bc priority queue */ ++ struct rb_root cfq_bc_queue; ++ /* ub that owns a timeslice at the moment */ ++ struct cfq_bc_data *active_cfq_bc; ++ unsigned int cfq_ub_slice; ++ unsigned long slice_begin; ++ unsigned long slice_end; ++ unsigned long cfq_bc_position; ++ int virt_mode; ++ int write_virt_mode; ++}; ++ ++/* ++ * Per process-grouping structure ++ */ ++struct cfq_queue { ++ /* reference count */ ++ atomic_t ref; ++ /* parent cfq_data */ ++ struct cfq_data *cfqd; ++ /* service_tree member */ ++ struct rb_node rb_node; ++ /* service_tree key */ ++ unsigned long rb_key; ++ /* sorted list of pending requests */ ++ struct rb_root sort_list; ++ /* if fifo isn't expired, next request to serve */ ++ struct request *next_rq; ++ /* requests queued in sort_list */ ++ int queued[2]; ++ /* currently allocated requests */ ++ int allocated[2]; ++ /* pending metadata requests */ ++ int meta_pending; ++ /* fifo list of requests in sort_list */ ++ struct list_head fifo; ++ ++ unsigned long slice_end; ++ long slice_resid; ++ ++ /* number of requests that are on the dispatch list or inside driver */ ++ int dispatched; ++ ++ /* io prio of this group */ ++ unsigned short ioprio, org_ioprio; ++ unsigned short ioprio_class, org_ioprio_class; ++ ++ /* various state flags, see below */ ++ unsigned int flags; ++ ++ struct cfq_bc_data *cfq_bc; ++}; ++ ++static void inline cfq_init_cfq_bc(struct cfq_bc_data *cfq_bc) ++{ ++ cfq_bc->service_tree = CFQ_RB_ROOT; ++} ++#endif /* _LINUX_CFQ_IOSCHED_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/compat.h debian/binary-custom.d/openvz/src/include/linux/compat.h +--- ./include/linux/compat.h 2012-06-12 16:25:24.026312496 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/compat.h 2012-11-13 15:20:15.020569078 +0000 +@@ -233,6 +233,7 @@ + asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); + + extern int compat_printk(const char *fmt, ...); ++extern int ve_compat_printk(int dst, const char *fmt, ...); + extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); + + asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/console.h debian/binary-custom.d/openvz/src/include/linux/console.h +--- ./include/linux/console.h 2012-06-12 16:25:24.026312496 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/console.h 2012-11-13 15:20:15.020569078 +0000 +@@ -147,4 +147,22 @@ + #define VESA_HSYNC_SUSPEND 2 + #define VESA_POWERDOWN 3 + ++ ++#include ++#include ++#include ++ ++struct printk_aligned { ++ int v; ++} ____cacheline_aligned; ++extern struct printk_aligned printk_no_wake_var[NR_CPUS]; ++#define __printk_no_wake (printk_no_wake_var[smp_processor_id()].v) ++#define printk_no_wake ({ \ ++ int v; \ ++ preempt_disable(); \ ++ v = __printk_no_wake; \ ++ preempt_enable_no_resched(); \ ++ v; \ ++ }) ++ + #endif /* _LINUX_CONSOLE_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/cpt_image.h debian/binary-custom.d/openvz/src/include/linux/cpt_image.h +--- ./include/linux/cpt_image.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/cpt_image.h 2012-11-13 15:20:15.024569077 +0000 +@@ -0,0 +1,1761 @@ ++/* ++ * ++ * include/linux/cpt_image.h ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __CPT_IMAGE_H_ ++#define __CPT_IMAGE_H_ 1 ++ ++#define CPT_NULL (~0ULL) ++#define CPT_NOINDEX (~0U) ++ ++/* ++ * Image file layout. ++ * ++ * - major header ++ * - sections[] ++ * ++ * Each section is: ++ * - section header ++ * - array of objects ++ * ++ * All data records are arch independent, 64 bit aligned. ++ */ ++ ++enum _cpt_object_type ++{ ++ CPT_OBJ_TASK = 0, ++ CPT_OBJ_MM, ++ CPT_OBJ_FS, ++ CPT_OBJ_FILES, ++ CPT_OBJ_FILE, ++ CPT_OBJ_SIGHAND_STRUCT, ++ CPT_OBJ_SIGNAL_STRUCT, ++ CPT_OBJ_TTY, ++ CPT_OBJ_SOCKET, ++ CPT_OBJ_SYSVSEM_UNDO, ++ CPT_OBJ_NAMESPACE, ++ CPT_OBJ_SYSV_SHM, ++ CPT_OBJ_INODE, ++ CPT_OBJ_UBC, ++ CPT_OBJ_SLM_SGREG, ++ CPT_OBJ_SLM_REGOBJ, ++ CPT_OBJ_SLM_MM, ++ CPT_OBJ_MAX, ++ /* The objects above are stored in memory while checkpointing */ ++ ++ CPT_OBJ_VMA = 1024, ++ CPT_OBJ_FILEDESC, ++ CPT_OBJ_SIGHANDLER, ++ CPT_OBJ_SIGINFO, ++ CPT_OBJ_LASTSIGINFO, ++ CPT_OBJ_SYSV_SEM, ++ CPT_OBJ_SKB, ++ CPT_OBJ_FLOCK, ++ CPT_OBJ_OPENREQ, ++ CPT_OBJ_VFSMOUNT, ++ CPT_OBJ_TRAILER, ++ CPT_OBJ_SYSVSEM_UNDO_REC, ++ CPT_OBJ_NET_DEVICE, ++ CPT_OBJ_NET_IFADDR, ++ CPT_OBJ_NET_ROUTE, ++ CPT_OBJ_NET_CONNTRACK, ++ CPT_OBJ_NET_CONNTRACK_EXPECT, ++ CPT_OBJ_AIO_CONTEXT, ++ CPT_OBJ_VEINFO, ++ CPT_OBJ_EPOLL, ++ CPT_OBJ_EPOLL_FILE, ++ CPT_OBJ_SKFILTER, ++ CPT_OBJ_SIGALTSTACK, ++ CPT_OBJ_SOCK_MCADDR, ++ CPT_OBJ_BIND_MNT, ++ CPT_OBJ_SYSVMSG, ++ CPT_OBJ_SYSVMSG_MSG, ++ ++ CPT_OBJ_X86_REGS = 4096, ++ CPT_OBJ_X86_64_REGS, ++ CPT_OBJ_PAGES, ++ CPT_OBJ_COPYPAGES, ++ CPT_OBJ_REMAPPAGES, ++ CPT_OBJ_LAZYPAGES, ++ CPT_OBJ_NAME, ++ CPT_OBJ_BITS, ++ CPT_OBJ_REF, ++ CPT_OBJ_ITERPAGES, ++ CPT_OBJ_ITERYOUNGPAGES, ++ CPT_OBJ_VSYSCALL, ++ CPT_OBJ_IA64_REGS, ++ CPT_OBJ_INOTIFY, ++ CPT_OBJ_INOTIFY_WATCH, ++ CPT_OBJ_INOTIFY_EVENT, ++ CPT_OBJ_TASK_AUX, ++ CPT_OBJ_NET_TUNTAP, ++ CPT_OBJ_NET_HWADDR, ++ CPT_OBJ_NET_VETH, ++ CPT_OBJ_NET_STATS, ++}; ++ ++#define CPT_ALIGN(n) (((n)+7)&~7) ++ ++struct cpt_major_hdr ++{ ++ __u8 cpt_signature[4]; /* Magic number */ ++ __u16 cpt_hdrlen; /* Length of this header */ ++ __u16 cpt_image_version; /* Format of this file */ ++#define CPT_VERSION_MINOR(a) ((a) & 0xf) ++#define CPT_VERSION_8 0 ++#define CPT_VERSION_9 0x100 ++#define CPT_VERSION_9_1 0x101 ++#define CPT_VERSION_9_2 0x102 ++#define CPT_VERSION_16 0x200 ++#define CPT_VERSION_18 0x300 ++#define CPT_VERSION_18_1 0x301 ++#define CPT_VERSION_20 0x400 ++#define CPT_VERSION_24 0x500 ++ __u16 cpt_os_arch; /* Architecture */ ++#define CPT_OS_ARCH_I386 0 ++#define CPT_OS_ARCH_EMT64 1 ++#define CPT_OS_ARCH_IA64 2 ++ __u16 __cpt_pad1; ++ __u32 cpt_ve_features; /* VE features */ ++ __u32 cpt_ve_features2; /* VE features */ ++ __u16 cpt_pagesize; /* Page size used by OS */ ++ __u16 cpt_hz; /* HZ used by OS */ ++ __u64 cpt_start_jiffies64; /* Jiffies */ ++ __u32 cpt_start_sec; /* Seconds */ ++ __u32 cpt_start_nsec; /* Nanoseconds */ ++ __u32 cpt_cpu_caps[4]; /* CPU capabilities */ ++ __u32 cpt_kernel_config[4]; /* Kernel config */ ++ __u64 cpt_iptables_mask; /* Used netfilter modules */ ++} __attribute__ ((aligned (8))); ++ ++#define CPT_SIGNATURE0 0x79 ++#define CPT_SIGNATURE1 0x1c ++#define CPT_SIGNATURE2 0x01 ++#define CPT_SIGNATURE3 0x63 ++ ++/* CPU capabilities */ ++#define CPT_CPU_X86_CMOV 0 ++#define CPT_CPU_X86_FXSR 1 ++#define CPT_CPU_X86_SSE 2 ++#define CPT_CPU_X86_SSE2 3 ++#define CPT_CPU_X86_MMX 4 ++#define CPT_CPU_X86_3DNOW 5 ++#define CPT_CPU_X86_3DNOW2 6 ++#define CPT_CPU_X86_SEP 7 ++#define CPT_CPU_X86_EMT64 8 ++#define CPT_CPU_X86_IA64 9 ++#define CPT_CPU_X86_SYSCALL 10 ++#define CPT_CPU_X86_SYSCALL32 11 ++#define CPT_CPU_X86_SEP32 12 ++ ++/* Unsupported features */ ++#define CPT_EXTERNAL_PROCESS 16 ++#define CPT_NAMESPACES 17 ++#define CPT_SCHEDULER_POLICY 18 ++#define CPT_PTRACED_FROM_VE0 19 ++#define CPT_UNSUPPORTED_FSTYPE 20 ++#define CPT_BIND_MOUNT 21 ++#define CPT_UNSUPPORTED_NETDEV 22 ++#define CPT_UNSUPPORTED_MISC 23 ++ ++/* This mask is used to determine whether VE ++ has some unsupported features or not */ ++#define CPT_UNSUPPORTED_MASK 0xffff0000UL ++ ++#define CPT_KERNEL_CONFIG_PAE 0 ++ ++struct cpt_section_hdr ++{ ++ __u64 cpt_next; ++ __u32 cpt_section; ++ __u16 cpt_hdrlen; ++ __u16 cpt_align; ++} __attribute__ ((aligned (8))); ++ ++enum ++{ ++ CPT_SECT_ERROR, /* Error section, content is string */ ++ CPT_SECT_VEINFO, ++ CPT_SECT_FILES, /* Files. Content is array of file objects */ ++ CPT_SECT_TASKS, ++ CPT_SECT_MM, ++ CPT_SECT_FILES_STRUCT, ++ CPT_SECT_FS, ++ CPT_SECT_SIGHAND_STRUCT, ++ CPT_SECT_TTY, ++ CPT_SECT_SOCKET, ++ CPT_SECT_NAMESPACE, ++ CPT_SECT_SYSVSEM_UNDO, ++ CPT_SECT_INODE, /* Inodes with i->i_nlink==0 and ++ * deleted dentires with inodes not ++ * referenced inside dumped process. ++ */ ++ CPT_SECT_SYSV_SHM, ++ CPT_SECT_SYSV_SEM, ++ CPT_SECT_ORPHANS, ++ CPT_SECT_NET_DEVICE, ++ CPT_SECT_NET_IFADDR, ++ CPT_SECT_NET_ROUTE, ++ CPT_SECT_NET_IPTABLES, ++ CPT_SECT_NET_CONNTRACK, ++ CPT_SECT_NET_CONNTRACK_VE0, ++ CPT_SECT_UTSNAME, ++ CPT_SECT_TRAILER, ++ CPT_SECT_UBC, ++ CPT_SECT_SLM_SGREGS, ++ CPT_SECT_SLM_REGOBJS, ++/* Due to silly mistake we cannot index sections beyond this value */ ++#define CPT_SECT_MAX_INDEX (CPT_SECT_SLM_REGOBJS+1) ++ CPT_SECT_EPOLL, ++ CPT_SECT_VSYSCALL, ++ CPT_SECT_INOTIFY, ++ CPT_SECT_SYSV_MSG, ++ CPT_SECT_MAX ++}; ++ ++struct cpt_major_tail ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_lazypages; ++ __u32 cpt_64bit; ++ __u64 cpt_sections[CPT_SECT_MAX_INDEX]; ++ __u32 cpt_nsect; ++ __u8 cpt_signature[4]; /* Magic number */ ++} __attribute__ ((aligned (8))); ++ ++ ++/* Common object header. */ ++struct cpt_object_hdr ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++} __attribute__ ((aligned (8))); ++ ++enum _cpt_content_type { ++ CPT_CONTENT_VOID, ++ CPT_CONTENT_ARRAY, ++ CPT_CONTENT_DATA, ++ CPT_CONTENT_NAME, ++ ++ CPT_CONTENT_STACK, ++ CPT_CONTENT_X86_FPUSTATE_OLD, ++ CPT_CONTENT_X86_FPUSTATE, ++ CPT_CONTENT_MM_CONTEXT, ++ CPT_CONTENT_SEMARRAY, ++ CPT_CONTENT_SEMUNDO, ++ CPT_CONTENT_NLMARRAY, ++ CPT_CONTENT_MAX ++}; ++ ++/* CPT_OBJ_BITS: encode array of bytes */ ++struct cpt_obj_bits ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_size; ++ __u32 __cpt_pad1; ++} __attribute__ ((aligned (8))); ++ ++/* CPT_OBJ_REF: a reference to another object */ ++struct cpt_obj_ref ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_pos; ++} __attribute__ ((aligned (8))); ++ ++/* CPT_OBJ_VEINFO: various ve specific data */ ++struct cpt_veinfo_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ /* ipc ctls */ ++ __u32 shm_ctl_max; ++ __u32 shm_ctl_all; ++ __u32 shm_ctl_mni; ++ __u32 msg_ctl_max; ++ __u32 msg_ctl_mni; ++ __u32 msg_ctl_mnb; ++ __u32 sem_ctl_arr[4]; ++ ++ /* start time */ ++ __u64 start_timespec_delta; ++ __u64 start_jiffies_delta; ++ ++ /* later extension */ ++ __u32 last_pid; ++ __u32 pad1; ++ __u64 reserved[8]; ++} __attribute__ ((aligned (8))); ++ ++/* CPT_OBJ_FILE: one struct file */ ++struct cpt_file_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_flags; ++ __u32 cpt_mode; ++ __u64 cpt_pos; ++ __u32 cpt_uid; ++ __u32 cpt_gid; ++ ++ __u32 cpt_i_mode; ++ __u32 cpt_lflags; ++#define CPT_DENTRY_DELETED 1 ++#define CPT_DENTRY_ROOT 2 ++#define CPT_DENTRY_CLONING 4 ++#define CPT_DENTRY_PROC 8 ++#define CPT_DENTRY_EPOLL 0x10 ++#define CPT_DENTRY_REPLACED 0x20 ++#define CPT_DENTRY_INOTIFY 0x40 ++#define CPT_DENTRY_FUTEX 0x80 ++#define CPT_DENTRY_TUNTAP 0x100 ++ __u64 cpt_inode; ++ __u64 cpt_priv; ++ ++ __u32 cpt_fown_fd; ++ __u32 cpt_fown_pid; ++#define CPT_FOWN_STRAY_PID 0 ++ __u32 cpt_fown_uid; ++ __u32 cpt_fown_euid; ++ __u32 cpt_fown_signo; ++ __u32 __cpt_pad1; ++} __attribute__ ((aligned (8))); ++/* Followed by file name, encoded as CPT_OBJ_NAME */ ++ ++struct cpt_epoll_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_file; ++} __attribute__ ((aligned (8))); ++/* Followed by array of struct cpt_epoll_file */ ++ ++struct cpt_epoll_file_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_file; ++ __u32 cpt_fd; ++ __u32 cpt_events; ++ __u64 cpt_data; ++ __u32 cpt_revents; ++ __u32 cpt_ready; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_inotify_wd_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_wd; ++ __u32 cpt_mask; ++} __attribute__ ((aligned (8))); ++/* Followed by cpt_file_image of inode to watch */ ++ ++struct cpt_inotify_ev_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_wd; ++ __u32 cpt_mask; ++ __u32 cpt_cookie; ++ __u32 cpt_namelen; ++} __attribute__ ((aligned (8))); ++/* Followed by name */ ++ ++struct cpt_inotify_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_file; ++ __u32 cpt_user; ++ __u32 cpt_max_events; ++ __u32 cpt_last_wd; ++ __u32 __cpt_pad1; ++} __attribute__ ((aligned (8))); ++/* Followed by array of struct cpt_inotify_wd_image and cpt_inotify_ev_image */ ++ ++ ++/* CPT_OBJ_FILEDESC: one file descriptor */ ++struct cpt_fd_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_fd; ++ __u32 cpt_flags; ++#define CPT_FD_FLAG_CLOSEEXEC 1 ++ __u64 cpt_file; ++} __attribute__ ((aligned (8))); ++ ++/* CPT_OBJ_FILES: one files_struct */ ++struct cpt_files_struct_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_index; ++ __u32 cpt_max_fds; ++ __u32 cpt_next_fd; ++ __u32 __cpt_pad1; ++} __attribute__ ((aligned (8))); ++/* Followed by array of cpt_fd_image */ ++ ++/* CPT_OBJ_FS: one fs_struct */ ++struct cpt_fs_struct_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_umask; ++ __u32 __cpt_pad1; ++} __attribute__ ((aligned (8))); ++/* Followed by two/three CPT_OBJ_FILENAME for root, pwd and, optionally, altroot */ ++ ++/* CPT_OBJ_INODE: one struct inode */ ++struct cpt_inode_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_dev; ++ __u64 cpt_ino; ++ __u32 cpt_mode; ++ __u32 cpt_nlink; ++ __u32 cpt_uid; ++ __u32 cpt_gid; ++ __u64 cpt_rdev; ++ __u64 cpt_size; ++ __u64 cpt_blksize; ++ __u64 cpt_atime; ++ __u64 cpt_mtime; ++ __u64 cpt_ctime; ++ __u64 cpt_blocks; ++ __u32 cpt_sb; ++ __u32 __cpt_pad1; ++} __attribute__ ((aligned (8))); ++ ++/* CPT_OBJ_VFSMOUNT: one vfsmount */ ++struct cpt_vfsmount_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_mntflags; ++#define CPT_MNT_BIND 0x80000000 ++#define CPT_MNT_EXT 0x40000000 ++ __u32 cpt_flags; ++} __attribute__ ((aligned (8))); ++ ++ ++struct cpt_flock_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_owner; ++ __u32 cpt_pid; ++ __u64 cpt_start; ++ __u64 cpt_end; ++ __u32 cpt_flags; ++ __u32 cpt_type; ++} __attribute__ ((aligned (8))); ++ ++ ++struct cpt_tty_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_flags; ++ __u32 cpt_link; ++ __u32 cpt_index; ++ __u32 cpt_drv_type; ++ __u32 cpt_drv_subtype; ++ __u32 cpt_drv_flags; ++ __u8 cpt_packet; ++ __u8 cpt_stopped; ++ __u8 cpt_hw_stopped; ++ __u8 cpt_flow_stopped; ++ ++ __u32 cpt_canon_data; ++ __u32 cpt_canon_head; ++ __u32 cpt_canon_column; ++ __u32 cpt_column; ++ __u8 cpt_ctrl_status; ++ __u8 cpt_erasing; ++ __u8 cpt_lnext; ++ __u8 cpt_icanon; ++ __u8 cpt_raw; ++ __u8 cpt_real_raw; ++ __u8 cpt_closing; ++ __u8 __cpt_pad1; ++ __u16 cpt_minimum_to_wake; ++ __u16 __cpt_pad2; ++ __u32 cpt_pgrp; ++ __u32 cpt_session; ++ __u32 cpt_c_line; ++ __u8 cpt_name[64]; ++ __u16 cpt_ws_row; ++ __u16 cpt_ws_col; ++ __u16 cpt_ws_prow; ++ __u16 cpt_ws_pcol; ++ __u8 cpt_c_cc[32]; ++ __u32 cpt_c_iflag; ++ __u32 cpt_c_oflag; ++ __u32 cpt_c_cflag; ++ __u32 cpt_c_lflag; ++ __u32 cpt_read_flags[4096/32]; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_sock_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_file; ++ __u32 cpt_parent; ++ __u32 cpt_index; ++ ++ __u64 cpt_ssflags; ++ __u16 cpt_type; ++ __u16 cpt_family; ++ __u8 cpt_sstate; ++ __u8 cpt_passcred; ++ __u8 cpt_state; ++ __u8 cpt_reuse; ++ ++ __u8 cpt_zapped; ++ __u8 cpt_shutdown; ++ __u8 cpt_userlocks; ++ __u8 cpt_no_check; ++ __u8 cpt_debug; ++ __u8 cpt_rcvtstamp; ++ __u8 cpt_localroute; ++ __u8 cpt_protocol; ++ ++ __u32 cpt_err; ++ __u32 cpt_err_soft; ++ ++ __u16 cpt_max_ack_backlog; ++ __u16 __cpt_pad1; ++ __u32 cpt_priority; ++ ++ __u32 cpt_rcvlowat; ++ __u32 cpt_bound_dev_if; ++ ++ __u64 cpt_rcvtimeo; ++ __u64 cpt_sndtimeo; ++ __u32 cpt_rcvbuf; ++ __u32 cpt_sndbuf; ++ __u64 cpt_flags; ++ __u64 cpt_lingertime; ++ __u32 cpt_peer_pid; ++ __u32 cpt_peer_uid; ++ ++ __u32 cpt_peer_gid; ++ __u32 cpt_laddrlen; ++ __u32 cpt_laddr[128/4]; ++ __u32 cpt_raddrlen; ++ __u32 cpt_raddr[128/4]; ++ /* AF_UNIX */ ++ __u32 cpt_peer; ++ ++ __u8 cpt_socketpair; ++ __u8 cpt_deleted; ++ __u16 __cpt_pad4; ++ __u32 __cpt_pad5; ++/* ++ struct sk_filter *sk_filter; ++ */ ++ ++ __u64 cpt_stamp; ++ __u32 cpt_daddr; ++ __u16 cpt_dport; ++ __u16 cpt_sport; ++ ++ __u32 cpt_saddr; ++ __u32 cpt_rcv_saddr; ++ ++ __u32 cpt_uc_ttl; ++ __u32 cpt_tos; ++ ++ __u32 cpt_cmsg_flags; ++ __u32 cpt_mc_index; ++ ++ __u32 cpt_mc_addr; ++/* ++ struct ip_options *opt; ++ */ ++ __u8 cpt_hdrincl; ++ __u8 cpt_mc_ttl; ++ __u8 cpt_mc_loop; ++ __u8 cpt_pmtudisc; ++ ++ __u8 cpt_recverr; ++ __u8 cpt_freebind; ++ __u16 cpt_idcounter; ++ __u32 cpt_cork_flags; ++ ++ __u32 cpt_cork_fragsize; ++ __u32 cpt_cork_length; ++ __u32 cpt_cork_addr; ++ __u32 cpt_cork_saddr; ++ __u32 cpt_cork_daddr; ++ __u32 cpt_cork_oif; ++ ++ __u32 cpt_udp_pending; ++ __u32 cpt_udp_corkflag; ++ __u16 cpt_udp_encap; ++ __u16 cpt_udp_len; ++ __u32 __cpt_pad7; ++ ++ __u64 cpt_saddr6[2]; ++ __u64 cpt_rcv_saddr6[2]; ++ __u64 cpt_daddr6[2]; ++ __u32 cpt_flow_label6; ++ __u32 cpt_frag_size6; ++ __u32 cpt_hop_limit6; ++ __u32 cpt_mcast_hops6; ++ ++ __u32 cpt_mcast_oif6; ++ __u8 cpt_rxopt6; ++ __u8 cpt_mc_loop6; ++ __u8 cpt_recverr6; ++ __u8 cpt_sndflow6; ++ ++ __u8 cpt_pmtudisc6; ++ __u8 cpt_ipv6only6; ++ __u8 cpt_mapped; ++ __u8 __cpt_pad8; ++ __u32 cpt_pred_flags; ++ ++ __u32 cpt_rcv_nxt; ++ __u32 cpt_snd_nxt; ++ ++ __u32 cpt_snd_una; ++ __u32 cpt_snd_sml; ++ ++ __u32 cpt_rcv_tstamp; ++ __u32 cpt_lsndtime; ++ ++ __u8 cpt_tcp_header_len; ++ __u8 cpt_ack_pending; ++ __u8 cpt_quick; ++ __u8 cpt_pingpong; ++ __u8 cpt_blocked; ++ __u8 __cpt_pad9; ++ __u16 __cpt_pad10; ++ ++ __u32 cpt_ato; ++ __u32 cpt_ack_timeout; ++ ++ __u32 cpt_lrcvtime; ++ __u16 cpt_last_seg_size; ++ __u16 cpt_rcv_mss; ++ ++ __u32 cpt_snd_wl1; ++ __u32 cpt_snd_wnd; ++ ++ __u32 cpt_max_window; ++ __u32 cpt_pmtu_cookie; ++ ++ __u32 cpt_mss_cache; ++ __u16 cpt_mss_cache_std; ++ __u16 cpt_mss_clamp; ++ ++ __u16 cpt_ext_header_len; ++ __u16 cpt_ext2_header_len; ++ __u8 cpt_ca_state; ++ __u8 cpt_retransmits; ++ __u8 cpt_reordering; ++ __u8 cpt_frto_counter; ++ ++ __u32 cpt_frto_highmark; ++ __u8 cpt_adv_cong; ++ __u8 cpt_defer_accept; ++ __u8 cpt_backoff; ++ __u8 __cpt_pad11; ++ ++ __u32 cpt_srtt; ++ __u32 cpt_mdev; ++ ++ __u32 cpt_mdev_max; ++ __u32 cpt_rttvar; ++ ++ __u32 cpt_rtt_seq; ++ __u32 cpt_rto; ++ ++ __u32 cpt_packets_out; ++ __u32 cpt_left_out; ++ ++ __u32 cpt_retrans_out; ++ __u32 cpt_snd_ssthresh; ++ ++ __u32 cpt_snd_cwnd; ++ __u16 cpt_snd_cwnd_cnt; ++ __u16 cpt_snd_cwnd_clamp; ++ ++ __u32 cpt_snd_cwnd_used; ++ __u32 cpt_snd_cwnd_stamp; ++ ++ __u32 cpt_timeout; ++ __u32 cpt_ka_timeout; ++ ++ __u32 cpt_rcv_wnd; ++ __u32 cpt_rcv_wup; ++ ++ __u32 cpt_write_seq; ++ __u32 cpt_pushed_seq; ++ ++ __u32 cpt_copied_seq; ++ __u8 cpt_tstamp_ok; ++ __u8 cpt_wscale_ok; ++ __u8 cpt_sack_ok; ++ __u8 cpt_saw_tstamp; ++ ++ __u8 cpt_snd_wscale; ++ __u8 cpt_rcv_wscale; ++ __u8 cpt_nonagle; ++ __u8 cpt_keepalive_probes; ++ __u32 cpt_rcv_tsval; ++ ++ __u32 cpt_rcv_tsecr; ++ __u32 cpt_ts_recent; ++ ++ __u64 cpt_ts_recent_stamp; ++ __u16 cpt_user_mss; ++ __u8 cpt_dsack; ++ __u8 cpt_eff_sacks; ++ __u32 cpt_sack_array[2*5]; ++ __u32 cpt_window_clamp; ++ ++ __u32 cpt_rcv_ssthresh; ++ __u8 cpt_probes_out; ++ __u8 cpt_num_sacks; ++ __u16 cpt_advmss; ++ ++ __u8 cpt_syn_retries; ++ __u8 cpt_ecn_flags; ++ __u16 cpt_prior_ssthresh; ++ __u32 cpt_lost_out; ++ ++ __u32 cpt_sacked_out; ++ __u32 cpt_fackets_out; ++ ++ __u32 cpt_high_seq; ++ __u32 cpt_retrans_stamp; ++ ++ __u32 cpt_undo_marker; ++ __u32 cpt_undo_retrans; ++ ++ __u32 cpt_urg_seq; ++ __u16 cpt_urg_data; ++ __u8 cpt_pending; ++ __u8 cpt_urg_mode; ++ ++ __u32 cpt_snd_up; ++ __u32 cpt_keepalive_time; ++ ++ __u32 cpt_keepalive_intvl; ++ __u32 cpt_linger2; ++ ++ __u32 cpt_rcvrtt_rtt; ++ __u32 cpt_rcvrtt_seq; ++ ++ __u32 cpt_rcvrtt_time; ++ __u32 __cpt_pad12; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_sockmc_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u16 cpt_family; ++ __u16 cpt_mode; ++ __u32 cpt_ifindex; ++ __u32 cpt_mcaddr[4]; ++} __attribute__ ((aligned (8))); ++/* Followed by array of source addresses, each zero padded to 16 bytes */ ++ ++struct cpt_openreq_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_rcv_isn; ++ __u32 cpt_snt_isn; ++ ++ __u16 cpt_rmt_port; ++ __u16 cpt_mss; ++ __u8 cpt_family; ++ __u8 cpt_retrans; ++ __u8 cpt_snd_wscale; ++ __u8 cpt_rcv_wscale; ++ ++ __u8 cpt_tstamp_ok; ++ __u8 cpt_sack_ok; ++ __u8 cpt_wscale_ok; ++ __u8 cpt_ecn_ok; ++ __u8 cpt_acked; ++ __u8 __cpt_pad1; ++ __u16 __cpt_pad2; ++ ++ __u32 cpt_window_clamp; ++ __u32 cpt_rcv_wnd; ++ __u32 cpt_ts_recent; ++ __u32 cpt_iif; ++ __u64 cpt_expires; ++ ++ __u64 cpt_loc_addr[2]; ++ __u64 cpt_rmt_addr[2]; ++/* ++ struct ip_options *opt; ++ */ ++ ++} __attribute__ ((aligned (8))); ++ ++struct cpt_skb_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_owner; ++ __u32 cpt_queue; ++#define CPT_SKB_NQ 0 ++#define CPT_SKB_RQ 1 ++#define CPT_SKB_WQ 2 ++#define CPT_SKB_OFOQ 3 ++ ++ __u64 cpt_stamp; ++ __u32 cpt_len; ++ __u32 cpt_hspace; ++ __u32 cpt_tspace; ++ __u32 cpt_h; ++ __u32 cpt_nh; ++ __u32 cpt_mac; ++ ++ __u64 cpt_cb[5]; ++ __u32 cpt_mac_len; ++ __u32 cpt_csum; ++ __u8 cpt_local_df; ++ __u8 cpt_pkt_type; ++ __u8 cpt_ip_summed; ++ __u8 __cpt_pad1; ++ __u32 cpt_priority; ++ __u16 cpt_protocol; ++ __u16 cpt_security; ++ __u16 cpt_gso_segs; ++ __u16 cpt_gso_size; ++} __attribute__ ((aligned (8))); ++ ++ ++struct cpt_sysvshm_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_key; ++ __u64 cpt_uid; ++ __u64 cpt_gid; ++ __u64 cpt_cuid; ++ __u64 cpt_cgid; ++ __u64 cpt_mode; ++ __u64 cpt_seq; ++ ++ __u32 cpt_id; ++ __u32 cpt_mlockuser; ++ __u64 cpt_segsz; ++ __u64 cpt_atime; ++ __u64 cpt_ctime; ++ __u64 cpt_dtime; ++ __u64 cpt_creator; ++ __u64 cpt_last; ++} __attribute__ ((aligned (8))); ++ ++ ++struct cpt_sysvsem_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_key; ++ __u64 cpt_uid; ++ __u64 cpt_gid; ++ __u64 cpt_cuid; ++ __u64 cpt_cgid; ++ __u64 cpt_mode; ++ __u64 cpt_seq; ++ __u32 cpt_id; ++ __u32 __cpt_pad1; ++ ++ __u64 cpt_otime; ++ __u64 cpt_ctime; ++} __attribute__ ((aligned (8))); ++/* Content is array of pairs semval/sempid */ ++ ++struct cpt_sysvsem_undo_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_id; ++ __u32 cpt_nsem; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_sysvmsg_msg_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_type; ++ __u64 cpt_size; ++} __attribute__ ((aligned (8))); ++ ++ ++struct cpt_sysvmsg_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_key; ++ __u64 cpt_uid; ++ __u64 cpt_gid; ++ __u64 cpt_cuid; ++ __u64 cpt_cgid; ++ __u64 cpt_mode; ++ __u64 cpt_seq; ++ __u32 cpt_id; ++ __u32 __cpt_pad1; ++ ++ __u64 cpt_stime; ++ __u64 cpt_rtime; ++ __u64 cpt_ctime; ++ __u64 cpt_last_sender; ++ __u64 cpt_last_receiver; ++ __u64 cpt_qbytes; ++} __attribute__ ((aligned (8))); ++/* Content is array of sysv msg */ ++ ++ ++struct cpt_mm_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_start_code; ++ __u64 cpt_end_code; ++ __u64 cpt_start_data; ++ __u64 cpt_end_data; ++ __u64 cpt_start_brk; ++ __u64 cpt_brk; ++ __u64 cpt_start_stack; ++ __u64 cpt_start_arg; ++ __u64 cpt_end_arg; ++ __u64 cpt_start_env; ++ __u64 cpt_end_env; ++ __u64 cpt_def_flags; ++ __u64 cpt_mmub; ++ __u8 cpt_dumpable; ++ __u8 cpt_vps_dumpable; ++ __u8 cpt_used_hugetlb; ++ __u8 __cpt_pad; ++ __u32 cpt_vdso; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_page_block ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_start; ++ __u64 cpt_end; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_remappage_block ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_start; ++ __u64 cpt_end; ++ __u64 cpt_pgoff; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_copypage_block ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_start; ++ __u64 cpt_end; ++ __u64 cpt_source; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_lazypage_block ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_start; ++ __u64 cpt_end; ++ __u64 cpt_index; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_iterpage_block ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_start; ++ __u64 cpt_end; ++} __attribute__ ((aligned (8))); ++/* Followed by array of PFNs */ ++ ++struct cpt_vma_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_file; ++ __u32 cpt_type; ++#define CPT_VMA_TYPE_0 0 ++#define CPT_VMA_TYPE_SHM 1 ++#define CPT_VMA_VDSO 2 ++ __u32 cpt_anonvma; ++ __u64 cpt_anonvmaid; ++ ++ __u64 cpt_start; ++ __u64 cpt_end; ++ __u64 cpt_flags; ++ __u64 cpt_pgprot; ++ __u64 cpt_pgoff; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_aio_ctx_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_max_reqs; ++ __u32 cpt_ring_pages; ++ __u32 cpt_tail; ++ __u32 cpt_nr; ++ __u64 cpt_mmap_base; ++ /* Data (io_event's) and struct aio_ring are stored in user space VM */ ++} __attribute__ ((aligned (8))); ++ ++ ++/* Format of MM section. ++ * ++ * It is array of MM objects (mm_struct). Each MM object is ++ * header, encoding mm_struct, followed by array of VMA objects. ++ * Each VMA consists of VMA header, encoding vm_area_struct, and ++ * if the VMA contains copied pages, the header is followed by ++ * array of tuples start-end each followed by data. ++ * ++ * ATTN: no block/page alignment. Only 64bit alignment. This might be not good? ++ */ ++ ++struct cpt_restart_block { ++ __u64 fn; ++#define CPT_RBL_0 0 ++#define CPT_RBL_NANOSLEEP 1 ++#define CPT_RBL_COMPAT_NANOSLEEP 2 ++#define CPT_RBL_POLL 3 ++#define CPT_RBL_FUTEX_WAIT 4 ++ __u64 arg0; ++ __u64 arg1; ++ __u64 arg2; ++ __u64 arg3; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_siginfo_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_qflags; ++ __u32 cpt_signo; ++ __u32 cpt_errno; ++ __u32 cpt_code; ++ ++ __u64 cpt_sigval; ++ __u32 cpt_pid; ++ __u32 cpt_uid; ++ __u64 cpt_utime; ++ __u64 cpt_stime; ++ ++ __u64 cpt_user; ++} __attribute__ ((aligned (8))); ++ ++/* Portable presentaions for segment registers */ ++ ++#define CPT_SEG_ZERO 0 ++#define CPT_SEG_TLS1 1 ++#define CPT_SEG_TLS2 2 ++#define CPT_SEG_TLS3 3 ++#define CPT_SEG_USER32_DS 4 ++#define CPT_SEG_USER32_CS 5 ++#define CPT_SEG_USER64_DS 6 ++#define CPT_SEG_USER64_CS 7 ++#define CPT_SEG_LDT 256 ++ ++struct cpt_x86_regs ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_debugreg[8]; ++ __u32 cpt_fs; ++ __u32 cpt_gs; ++ ++ __u32 cpt_ebx; ++ __u32 cpt_ecx; ++ __u32 cpt_edx; ++ __u32 cpt_esi; ++ __u32 cpt_edi; ++ __u32 cpt_ebp; ++ __u32 cpt_eax; ++ __u32 cpt_xds; ++ __u32 cpt_xes; ++ __u32 cpt_orig_eax; ++ __u32 cpt_eip; ++ __u32 cpt_xcs; ++ __u32 cpt_eflags; ++ __u32 cpt_esp; ++ __u32 cpt_xss; ++ __u32 pad; ++}; ++ ++struct cpt_x86_64_regs ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_debugreg[8]; ++ ++ __u64 cpt_fsbase; ++ __u64 cpt_gsbase; ++ __u32 cpt_fsindex; ++ __u32 cpt_gsindex; ++ __u32 cpt_ds; ++ __u32 cpt_es; ++ ++ __u64 cpt_r15; ++ __u64 cpt_r14; ++ __u64 cpt_r13; ++ __u64 cpt_r12; ++ __u64 cpt_rbp; ++ __u64 cpt_rbx; ++ __u64 cpt_r11; ++ __u64 cpt_r10; ++ __u64 cpt_r9; ++ __u64 cpt_r8; ++ __u64 cpt_rax; ++ __u64 cpt_rcx; ++ __u64 cpt_rdx; ++ __u64 cpt_rsi; ++ __u64 cpt_rdi; ++ __u64 cpt_orig_rax; ++ __u64 cpt_rip; ++ __u64 cpt_cs; ++ __u64 cpt_eflags; ++ __u64 cpt_rsp; ++ __u64 cpt_ss; ++}; ++ ++struct cpt_ia64_regs ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 gr[128]; ++ __u64 fr[256]; ++ __u64 br[8]; ++ __u64 nat[2]; ++ ++ __u64 ar_bspstore; ++ __u64 num_regs; ++ __u64 loadrs; ++ __u64 ar_bsp; ++ __u64 ar_unat; ++ __u64 ar_pfs; ++ __u64 ar_ccv; ++ __u64 ar_fpsr; ++ __u64 ar_csd; ++ __u64 ar_ssd; ++ __u64 ar_ec; ++ __u64 ar_lc; ++ __u64 ar_rsc; ++ __u64 ar_rnat; ++ ++ __u64 cr_iip; ++ __u64 cr_ipsr; ++ ++ __u64 cfm; ++ __u64 pr; ++ ++ __u64 ibr[8]; ++ __u64 dbr[8]; ++}; ++ ++ ++struct cpt_task_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_state; ++ __u64 cpt_flags; ++ __u64 cpt_ptrace; ++ __u32 cpt_prio; ++ __u32 cpt_static_prio; ++ __u32 cpt_policy; ++ __u32 cpt_rt_priority; ++ ++ /* struct thread_info */ ++ __u64 cpt_exec_domain; ++ __u64 cpt_thrflags; ++ __u64 cpt_thrstatus; ++ __u64 cpt_addr_limit; ++ ++ __u64 cpt_personality; ++ ++ __u64 cpt_mm; ++ __u64 cpt_files; ++ __u64 cpt_fs; ++ __u64 cpt_signal; ++ __u64 cpt_sighand; ++ __u64 cpt_sigblocked; ++ __u64 cpt_sigrblocked; ++ __u64 cpt_sigpending; ++ __u64 cpt_namespace; ++ __u64 cpt_sysvsem_undo; ++ __u32 cpt_pid; ++ __u32 cpt_tgid; ++ __u32 cpt_ppid; ++ __u32 cpt_rppid; ++ __u32 cpt_pgrp; ++ __u32 cpt_session; ++ __u32 cpt_old_pgrp; ++ __u32 __cpt_pad; ++ __u32 cpt_leader; ++ __u8 cpt_pn_state; ++ __u8 cpt_stopped_state; ++ __u8 cpt_sigsuspend_state; ++ __u8 cpt_64bit; ++ __u64 cpt_set_tid; ++ __u64 cpt_clear_tid; ++ __u32 cpt_exit_code; ++ __u32 cpt_exit_signal; ++ __u32 cpt_pdeath_signal; ++ __u32 cpt_user; ++ __u32 cpt_uid; ++ __u32 cpt_euid; ++ __u32 cpt_suid; ++ __u32 cpt_fsuid; ++ __u32 cpt_gid; ++ __u32 cpt_egid; ++ __u32 cpt_sgid; ++ __u32 cpt_fsgid; ++ __u32 cpt_ngids; ++ __u32 cpt_gids[32]; ++ __u8 cpt_prctl_uac; ++ __u8 cpt_prctl_fpemu; ++ __u16 __cpt_pad1; ++ __u64 cpt_ecap; ++ __u64 cpt_icap; ++ __u64 cpt_pcap; ++ __u8 cpt_comm[16]; ++ __u64 cpt_tls[3]; ++ struct cpt_restart_block cpt_restart; ++ __u64 cpt_it_real_value; /* V8: jiffies, V9..: nsec */ ++ __u64 cpt_it_real_incr; /* V8: jiffies, V9..: nsec */ ++ __u64 cpt_it_prof_value; ++ __u64 cpt_it_prof_incr; ++ __u64 cpt_it_virt_value; ++ __u64 cpt_it_virt_incr; ++ ++ __u16 cpt_used_math; ++ __u8 cpt_keepcap; ++ __u8 cpt_did_exec; ++ __u32 cpt_ptrace_message; ++ ++ __u64 cpt_utime; ++ __u64 cpt_stime; ++ __u64 cpt_starttime; /* V8: jiffies, V9...: timespec */ ++ __u64 cpt_nvcsw; ++ __u64 cpt_nivcsw; ++ __u64 cpt_min_flt; ++ __u64 cpt_maj_flt; ++ ++ __u64 cpt_sigsuspend_blocked; ++ __u64 cpt_cutime, cpt_cstime; ++ __u64 cpt_cnvcsw, cpt_cnivcsw; ++ __u64 cpt_cmin_flt, cpt_cmaj_flt; ++ ++#define CPT_RLIM_NLIMITS 16 ++ __u64 cpt_rlim_cur[CPT_RLIM_NLIMITS]; ++ __u64 cpt_rlim_max[CPT_RLIM_NLIMITS]; ++ ++ __u64 cpt_task_ub; ++ __u64 cpt_exec_ub; ++ __u64 cpt_mm_ub; ++ __u64 cpt_fork_sub; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_sigaltstack_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_stack; ++ __u32 cpt_stacksize; ++ __u32 __cpt_pad1; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_task_aux_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_robust_list; ++ __u64 __cpt_future[16]; ++} __attribute__ ((aligned (8))); ++ ++ ++struct cpt_signal_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_leader; ++ __u8 cpt_pgrp_type; ++ __u8 cpt_old_pgrp_type; ++ __u8 cpt_session_type; ++#define CPT_PGRP_NORMAL 0 ++#define CPT_PGRP_ORPHAN 1 ++#define CPT_PGRP_STRAY 2 ++ __u8 __cpt_pad1; ++ __u64 cpt_pgrp; ++ __u64 cpt_old_pgrp; ++ __u64 cpt_session; ++ __u64 cpt_sigpending; ++ __u64 cpt_ctty; ++ ++ __u32 cpt_curr_target; ++ __u32 cpt_group_exit; ++ __u32 cpt_group_exit_code; ++ __u32 cpt_group_exit_task; ++ __u32 cpt_notify_count; ++ __u32 cpt_group_stop_count; ++ __u32 cpt_stop_state; ++ __u32 __cpt_pad2; ++ ++ __u64 cpt_utime, cpt_stime, cpt_cutime, cpt_cstime; ++ __u64 cpt_nvcsw, cpt_nivcsw, cpt_cnvcsw, cpt_cnivcsw; ++ __u64 cpt_min_flt, cpt_maj_flt, cpt_cmin_flt, cpt_cmaj_flt; ++ ++ __u64 cpt_rlim_cur[CPT_RLIM_NLIMITS]; ++ __u64 cpt_rlim_max[CPT_RLIM_NLIMITS]; ++} __attribute__ ((aligned (8))); ++/* Followed by list of posix timers. */ ++ ++struct cpt_sighand_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++} __attribute__ ((aligned (8))); ++/* Followed by list of sighandles. */ ++ ++struct cpt_sighandler_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_signo; ++ __u32 __cpt_pad1; ++ __u64 cpt_handler; ++ __u64 cpt_restorer; ++ __u64 cpt_flags; ++ __u64 cpt_mask; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_netdev_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_index; ++ __u32 cpt_flags; ++ __u8 cpt_name[16]; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_tuntap_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_owner; ++ __u32 cpt_attached; ++ __u64 cpt_flags; ++ __u64 cpt_bindfile; ++ __u64 cpt_if_flags; ++ __u8 cpt_dev_addr[6]; ++ __u16 cpt_pad; ++ __u32 cpt_chr_filter[2]; ++ __u32 cpt_net_filter[2]; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_veth_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_allow_mac_change; ++ __u32 __cpt_pad; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_hwaddr_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u8 cpt_dev_addr[32]; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_netstats_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_rx_packets; ++ __u64 cpt_tx_packets; ++ __u64 cpt_rx_bytes; ++ __u64 cpt_tx_bytes; ++ __u64 cpt_rx_errors; ++ __u64 cpt_tx_errors; ++ __u64 cpt_rx_dropped; ++ __u64 cpt_tx_dropped; ++ __u64 cpt_multicast; ++ __u64 cpt_collisions; ++ __u64 cpt_rx_length_errors; ++ __u64 cpt_rx_over_errors; ++ __u64 cpt_rx_crc_errors; ++ __u64 cpt_rx_frame_errors; ++ __u64 cpt_rx_fifo_errors; ++ __u64 cpt_rx_missed_errors; ++ __u64 cpt_tx_aborted_errors; ++ __u64 cpt_tx_carrier_errors; ++ __u64 cpt_tx_fifo_errors; ++ __u64 cpt_tx_heartbeat_errors; ++ __u64 cpt_tx_window_errors; ++ __u64 cpt_rx_compressed; ++ __u64 cpt_tx_compressed; ++ __u64 pad[4]; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_ifaddr_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_index; ++ __u8 cpt_family; ++ __u8 cpt_masklen; ++ __u8 cpt_flags; ++ __u8 cpt_scope; ++ __u32 cpt_address[4]; ++ __u32 cpt_peer[4]; ++ __u32 cpt_broadcast[4]; ++ __u8 cpt_label[16]; ++ __u32 cpt_valid_lft; ++ __u32 cpt_prefered_lft; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_ipct_tuple ++{ ++ __u32 cpt_src; ++ __u16 cpt_srcport; ++ __u16 __cpt_pad1; ++ ++ __u32 cpt_dst; ++ __u16 cpt_dstport; ++ __u8 cpt_protonum; ++ __u8 cpt_dir; /* TEMPORARY HACK TO VALIDATE CODE */ ++} __attribute__ ((aligned (8))); ++ ++struct cpt_nat_manip ++{ ++ __u8 cpt_direction; ++ __u8 cpt_hooknum; ++ __u8 cpt_maniptype; ++ __u8 __cpt_pad1; ++ ++ __u32 cpt_manip_addr; ++ __u16 cpt_manip_port; ++ __u16 __cpt_pad2; ++ __u32 __cpt_pad3; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_nat_seq ++{ ++ __u32 cpt_correction_pos; ++ __u32 cpt_offset_before; ++ __u32 cpt_offset_after; ++ __u32 __cpt_pad1; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_ip_connexpect_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_timeout; ++ __u32 cpt_sibling_conntrack; /* Index of child conntrack */ ++ __u32 cpt_seq; /* id in 2.6.15 */ ++ ++ struct cpt_ipct_tuple cpt_ct_tuple; /* NU 2.6.15 */ ++ struct cpt_ipct_tuple cpt_tuple; ++ struct cpt_ipct_tuple cpt_mask; ++ ++ /* union ip_conntrack_expect_help. Used by ftp, irc, amanda */ ++ __u32 cpt_help[3]; /* NU 2.6.15 */ ++ __u16 cpt_manip_proto; ++ __u8 cpt_dir; ++ __u8 cpt_flags; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_ip_conntrack_image ++{ ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ struct cpt_ipct_tuple cpt_tuple[2]; ++ __u64 cpt_status; ++ __u64 cpt_timeout; ++ __u32 cpt_index; ++ __u8 cpt_ct_helper; ++ __u8 cpt_nat_helper; ++ __u16 cpt_pad1; ++ ++ /* union ip_conntrack_proto. Used by tcp and icmp. */ ++ __u32 cpt_proto_data[12]; ++ ++ /* union ip_conntrack_help. Used by ftp and pptp helper. ++ * We do not support pptp... ++ */ ++ __u32 cpt_help_data[6]; ++ ++ /* nat info */ ++ __u32 cpt_initialized; /* NU 2.6.15 */ ++ __u32 cpt_num_manips; /* NU 2.6.15 */ ++ struct cpt_nat_manip cpt_nat_manips[6]; /* NU 2.6.15 */ ++ ++ struct cpt_nat_seq cpt_nat_seq[2]; ++ ++ __u32 cpt_masq_index; ++ __u32 cpt_id; ++ __u32 cpt_mark; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_ubparm ++{ ++ __u64 barrier; ++ __u64 limit; ++ __u64 held; ++ __u64 maxheld; ++ __u64 minheld; ++ __u64 failcnt; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_beancounter_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u64 cpt_parent; ++ __u32 cpt_id; ++ __u32 __cpt_pad; ++ struct cpt_ubparm cpt_parms[32 * 2]; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_slm_sgreg_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_size; ++ __u32 __cpt_pad1; ++ __u32 cpt_id; ++ __u16 cpt_resource; ++ __u8 cpt_regname[32]; ++ __u8 __cpt_pad2[2]; ++} __attribute__ ((aligned (8))); ++ ++struct cpt_slm_obj_image { ++ __u64 cpt_next; ++ __u32 cpt_object; ++ __u16 cpt_hdrlen; ++ __u16 cpt_content; ++ ++ __u32 cpt_size; ++ __u32 __cpt_pad1; ++} __attribute__ ((aligned (8))); ++ ++#ifdef __KERNEL__ ++ ++static inline void __user * cpt_ptr_import(__u64 ptr) ++{ ++ return (void*)(unsigned long)ptr; ++} ++ ++static inline __u64 cpt_ptr_export(void __user *ptr) ++{ ++ return (__u64)(unsigned long)ptr; ++} ++ ++static inline void cpt_sigset_import(sigset_t *sig, __u64 ptr) ++{ ++ memcpy(sig, &ptr, sizeof(*sig)); ++} ++ ++static inline __u64 cpt_sigset_export(sigset_t *sig) ++{ ++ return *(__u64*)sig; ++} ++ ++static inline __u64 cpt_timespec_export(struct timespec *tv) ++{ ++ return (((u64)tv->tv_sec) << 32) + tv->tv_nsec; ++} ++ ++static inline void cpt_timespec_import(struct timespec *tv, __u64 val) ++{ ++ tv->tv_sec = val>>32; ++ tv->tv_nsec = (val&0xFFFFFFFF); ++} ++ ++static inline __u64 cpt_timeval_export(struct timeval *tv) ++{ ++ return (((u64)tv->tv_sec) << 32) + tv->tv_usec; ++} ++ ++static inline void cpt_timeval_import(struct timeval *tv, __u64 val) ++{ ++ tv->tv_sec = val>>32; ++ tv->tv_usec = (val&0xFFFFFFFF); ++} ++ ++#endif ++ ++#endif /* __CPT_IMAGE_H_ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/cpt_ioctl.h debian/binary-custom.d/openvz/src/include/linux/cpt_ioctl.h +--- ./include/linux/cpt_ioctl.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/cpt_ioctl.h 2012-11-13 15:20:15.024569077 +0000 +@@ -0,0 +1,43 @@ ++/* ++ * ++ * include/linux/cpt_ioctl.h ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _CPT_IOCTL_H_ ++#define _CPT_IOCTL_H_ 1 ++ ++#include ++#include ++ ++#define CPTCTLTYPE '-' ++#define CPT_SET_DUMPFD _IOW(CPTCTLTYPE, 1, int) ++#define CPT_SET_STATUSFD _IOW(CPTCTLTYPE, 2, int) ++#define CPT_SET_LOCKFD _IOW(CPTCTLTYPE, 3, int) ++#define CPT_SET_VEID _IOW(CPTCTLTYPE, 4, int) ++#define CPT_SUSPEND _IO(CPTCTLTYPE, 5) ++#define CPT_DUMP _IO(CPTCTLTYPE, 6) ++#define CPT_UNDUMP _IO(CPTCTLTYPE, 7) ++#define CPT_RESUME _IO(CPTCTLTYPE, 8) ++#define CPT_KILL _IO(CPTCTLTYPE, 9) ++#define CPT_JOIN_CONTEXT _IO(CPTCTLTYPE, 10) ++#define CPT_GET_CONTEXT _IOW(CPTCTLTYPE, 11, unsigned int) ++#define CPT_PUT_CONTEXT _IO(CPTCTLTYPE, 12) ++#define CPT_SET_PAGEINFDIN _IOW(CPTCTLTYPE, 13, int) ++#define CPT_SET_PAGEINFDOUT _IOW(CPTCTLTYPE, 14, int) ++#define CPT_PAGEIND _IO(CPTCTLTYPE, 15) ++#define CPT_VMPREP _IOW(CPTCTLTYPE, 16, int) ++#define CPT_SET_LAZY _IOW(CPTCTLTYPE, 17, int) ++#define CPT_SET_CPU_FLAGS _IOW(CPTCTLTYPE, 18, unsigned int) ++#define CPT_TEST_CAPS _IOW(CPTCTLTYPE, 19, unsigned int) ++#define CPT_TEST_VECAPS _IOW(CPTCTLTYPE, 20, unsigned int) ++#define CPT_SET_ERRORFD _IOW(CPTCTLTYPE, 21, int) ++ ++#define CPT_ITER _IOW(CPTCTLTYPE, 23, int) ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/dcache.h debian/binary-custom.d/openvz/src/include/linux/dcache.h +--- ./include/linux/dcache.h 2012-06-12 16:25:24.030312496 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/dcache.h 2012-11-13 15:20:15.028569078 +0000 +@@ -9,6 +9,8 @@ + #include + #include + ++#include ++ + struct nameidata; + struct vfsmount; + +@@ -111,6 +113,9 @@ + struct dcookie_struct *d_cookie; /* cookie, if any */ + #endif + int d_mounted; ++#ifdef CONFIG_BEANCOUNTERS ++ struct dentry_beancounter dentry_bc; ++#endif + unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ + }; + +@@ -174,9 +179,13 @@ + + #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ + #define DCACHE_UNHASHED 0x0010 ++#define DCACHE_VIRTUAL 0x0100 /* ve accessible */ ++ ++extern void mark_tree_virtual(struct vfsmount *m, struct dentry *d); + + #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */ + ++extern struct kmem_cache *dentry_cache; + extern spinlock_t dcache_lock; + extern seqlock_t rename_lock; + +@@ -300,9 +309,12 @@ + */ + extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); + +-extern char *__d_path(struct dentry *, struct vfsmount *, struct dentry *, +- struct vfsmount *, char *, int, int); ++extern int d_root_check(struct dentry *, struct vfsmount *); ++ + extern char * d_path(struct dentry *, struct vfsmount *, char *, int); ++extern char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt, ++ struct dentry *root, struct vfsmount *rootmnt, ++ char *buffer, int buflen); + + /* Allocation counts.. */ + +@@ -322,6 +334,12 @@ + static inline struct dentry *dget(struct dentry *dentry) + { + if (dentry) { ++#ifdef CONFIG_BEANCOUNTERS ++ preempt_disable(); ++ if (ub_dentry_on && ub_dget_testone(dentry)) ++ BUG(); ++ preempt_enable_no_resched(); ++#endif + BUG_ON(!atomic_read(&dentry->d_count)); + atomic_inc(&dentry->d_count); + } +@@ -365,6 +383,8 @@ + + extern int sysctl_vfs_cache_pressure; + ++extern int check_area_access_ve(struct dentry *, struct vfsmount *); ++extern int check_area_execute_ve(struct dentry *, struct vfsmount *); + #endif /* __KERNEL__ */ + + #endif /* __LINUX_DCACHE_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/device.h debian/binary-custom.d/openvz/src/include/linux/device.h +--- ./include/linux/device.h 2012-06-12 16:25:24.030312496 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/device.h 2012-11-13 15:20:15.028569078 +0000 +@@ -279,6 +279,8 @@ + dev->class_data = data; + } + ++extern struct class net_class; ++ + + extern int __must_check class_device_register(struct class_device *); + extern void class_device_unregister(struct class_device *); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/devpts_fs.h debian/binary-custom.d/openvz/src/include/linux/devpts_fs.h +--- ./include/linux/devpts_fs.h 2012-06-12 16:25:24.030312496 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/devpts_fs.h 2012-11-13 15:20:15.028569078 +0000 +@@ -21,6 +21,16 @@ + struct tty_struct *devpts_get_tty(int number); /* get tty structure */ + void devpts_pty_kill(int number); /* unlink */ + ++struct devpts_config { ++ int setuid; ++ int setgid; ++ uid_t uid; ++ gid_t gid; ++ umode_t mode; ++}; ++ ++extern struct devpts_config devpts_config; ++extern struct file_system_type devpts_fs_type; + #else + + /* Dummy stubs in the no-pty case */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/elevator.h debian/binary-custom.d/openvz/src/include/linux/elevator.h +--- ./include/linux/elevator.h 2012-06-12 16:25:24.034312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/elevator.h 2012-11-13 15:20:15.036569081 +0000 +@@ -56,6 +56,11 @@ + elevator_init_fn *elevator_init_fn; + elevator_exit_fn *elevator_exit_fn; + void (*trim)(struct io_context *); ++ /* In original cfq design task holds a cfqq refcount and puts it ++ * on exit via io context. Now async cfqqs are hold by UB, ++ * so we need somehow to put these queues. Use this function. ++ */ ++ void (*put_queue)(struct cfq_queue *); + }; + + #define ELV_NAME_MAX (16) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/elfcore.h debian/binary-custom.d/openvz/src/include/linux/elfcore.h +--- ./include/linux/elfcore.h 2012-06-12 16:25:24.038312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/elfcore.h 2012-11-13 15:20:15.036569081 +0000 +@@ -7,6 +7,8 @@ + #include + #include + ++extern int sysctl_at_vsyscall; ++ + struct elf_siginfo + { + int si_signo; /* signal number */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/eventpoll.h debian/binary-custom.d/openvz/src/include/linux/eventpoll.h +--- ./include/linux/eventpoll.h 2012-06-12 16:25:24.038312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/eventpoll.h 2012-11-13 15:20:15.048569078 +0000 +@@ -60,6 +60,88 @@ + spin_lock_init(&file->f_ep_lock); + } + ++struct epoll_filefd { ++ struct file *file; ++ int fd; ++}; ++ ++/* ++ * This structure is stored inside the "private_data" member of the file ++ * structure and rapresent the main data sructure for the eventpoll ++ * interface. ++ */ ++struct eventpoll { ++ /* Protect the this structure access */ ++ spinlock_t lock; ++ ++ /* ++ * This mutex is used to ensure that files are not removed ++ * while epoll is using them. This is held during the event ++ * collection loop, the file cleanup path, the epoll file exit ++ * code and the ctl operations. ++ */ ++ struct mutex mtx; ++ ++ /* Wait queue used by sys_epoll_wait() */ ++ wait_queue_head_t wq; ++ ++ /* Wait queue used by file->poll() */ ++ wait_queue_head_t poll_wait; ++ ++ /* List of ready file descriptors */ ++ struct list_head rdllist; ++ ++ /* RB tree root used to store monitored fd structs */ ++ struct rb_root rbr; ++ ++ /* ++ * This is a single linked list that chains all the "struct epitem" that ++ * happened while transfering ready events to userspace w/out ++ * holding ->lock. ++ */ ++ struct epitem *ovflist; ++}; ++ ++/* ++ * Each file descriptor added to the eventpoll interface will ++ * have an entry of this type linked to the "rbr" RB tree. ++ */ ++struct epitem { ++ /* RB tree node used to link this structure to the eventpoll RB tree */ ++ struct rb_node rbn; ++ ++ /* List header used to link this structure to the eventpoll ready list */ ++ struct list_head rdllink; ++ ++ /* ++ * Works together "struct eventpoll"->ovflist in keeping the ++ * single linked chain of items. ++ */ ++ struct epitem *next; ++ ++ /* The file descriptor information this item refers to */ ++ struct epoll_filefd ffd; ++ ++ /* Number of active wait queue attached to poll operations */ ++ int nwait; ++ ++ /* List containing poll wait queues */ ++ struct list_head pwqlist; ++ ++ /* The "container" of this item */ ++ struct eventpoll *ep; ++ ++ /* List header used to link this item to the "struct file" items list */ ++ struct list_head fllink; ++ ++ /* The structure that describe the interested events and the source fd */ ++ struct epoll_event event; ++}; ++ ++extern struct semaphore epsem; ++struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd); ++int ep_insert(struct eventpoll *ep, struct epoll_event *event, ++ struct file *tfile, int fd); + + /* Used to release the epoll bits inside the "struct file" */ + void eventpoll_release_file(struct file *file); +@@ -92,6 +174,8 @@ + eventpoll_release_file(file); + } + ++extern struct mutex epmutex; ++ + #else + + static inline void eventpoll_init_file(struct file *file) {} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/fairsched.h debian/binary-custom.d/openvz/src/include/linux/fairsched.h +--- ./include/linux/fairsched.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/fairsched.h 2012-11-13 15:20:15.048569078 +0000 +@@ -0,0 +1,86 @@ ++/* ++ * Fair Scheduler ++ * ++ * Copyright (C) 2000-2008 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __LINUX_FAIRSCHED_H__ ++#define __LINUX_FAIRSCHED_H__ ++ ++#define FAIRSCHED_SET_RATE 0 ++#define FAIRSCHED_DROP_RATE 1 ++#define FAIRSCHED_GET_RATE 2 ++ ++#ifdef __KERNEL__ ++ ++/* refcnt change protected with tasklist write lock */ ++struct fairsched_node { ++ struct task_group *tg; ++ int refcnt; ++ unsigned id; ++ struct list_head nodelist; ++ ++ unsigned weight; ++ unsigned char rate_limited; ++ unsigned rate; ++#ifdef CONFIG_VE ++ struct ve_struct *owner_env; ++#endif ++}; ++ ++#ifdef CONFIG_VZ_FAIRSCHED ++ ++#define FAIRSCHED_INIT_NODE_ID INT_MAX ++ ++extern struct fairsched_node fairsched_init_node; ++ ++void fairsched_init_early(void); ++void fairsched_init_late(void); ++ ++static inline int task_fairsched_node_id(struct task_struct *p) ++{ ++ return p->fsched_node->id; ++} ++ ++/* must called with tasklist write locked */ ++static inline void get_task_fairsched_node(struct task_struct *p) ++{ ++ p->fsched_node->refcnt++; ++} ++static inline void put_task_fairsched_node(struct task_struct *p) ++{ ++ p->fsched_node->refcnt--; ++} ++ ++#define INIT_VZ_FAIRSCHED .fsched_node = &fairsched_init_node, ++ ++#define FSCHWEIGHT_MAX ((1 << 16) - 1) ++#define FSCHRATE_SHIFT 10 ++#define FSCH_TIMESLICE 16 ++ ++asmlinkage int sys_fairsched_mknod(unsigned int parent, unsigned int weight, ++ unsigned int newid); ++asmlinkage int sys_fairsched_rmnod(unsigned int id); ++asmlinkage int sys_fairsched_mvpr(pid_t pid, unsigned int nodeid); ++asmlinkage int sys_fairsched_vcpus(unsigned int id, unsigned int vcpus); ++asmlinkage int sys_fairsched_chwt(unsigned int id, unsigned int weight); ++asmlinkage int sys_fairsched_rate(unsigned int id, int op, unsigned rate); ++ ++#else /* CONFIG_VZ_FAIRSCHED */ ++ ++static inline void fairsched_init_early(void) { } ++static inline void fairsched_init_late(void) { } ++static inline int task_fairsched_node_id(struct task_struct *p) { return 0; } ++static inline void get_task_fairsched_node(struct task_struct *p) { } ++static inline void put_task_fairsched_node(struct task_struct *p) { } ++ ++#define INIT_VZ_FAIRSCHED ++ ++#endif /* CONFIG_VZ_FAIRSCHED */ ++#endif /* __KERNEL__ */ ++ ++#endif /* __LINUX_FAIRSCHED_H__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/faudit.h debian/binary-custom.d/openvz/src/include/linux/faudit.h +--- ./include/linux/faudit.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/faudit.h 2012-11-13 15:20:15.048569078 +0000 +@@ -0,0 +1,45 @@ ++/* ++ * include/linux/faudit.h ++ * ++ * Copyright (C) 2005 SWSoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __FAUDIT_H_ ++#define __FAUDIT_H_ ++ ++#include ++ ++struct vfsmount; ++struct dentry; ++struct super_block; ++struct kstatfs; ++struct kstat; ++struct pt_regs; ++ ++struct faudit_regs_arg { ++ int err; ++ struct pt_regs *regs; ++}; ++ ++struct faudit_stat_arg { ++ int err; ++ struct vfsmount *mnt; ++ struct dentry *dentry; ++ struct kstat *stat; ++}; ++ ++struct faudit_statfs_arg { ++ int err; ++ struct super_block *sb; ++ struct kstatfs *stat; ++}; ++ ++#define VIRTINFO_FAUDIT (0) ++#define VIRTINFO_FAUDIT_STAT (VIRTINFO_FAUDIT + 0) ++#define VIRTINFO_FAUDIT_STATFS (VIRTINFO_FAUDIT + 1) ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/fs.h debian/binary-custom.d/openvz/src/include/linux/fs.h +--- ./include/linux/fs.h 2012-06-12 16:25:24.042312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/fs.h 2012-11-13 15:20:15.056569078 +0000 +@@ -49,6 +49,7 @@ + extern struct inodes_stat_t inodes_stat; + + extern int leases_enable, lease_break_time; ++extern int odirect_enable; + + #ifdef CONFIG_DNOTIFY + extern int dir_notify_enable; +@@ -68,6 +69,7 @@ + #define FMODE_LSEEK 4 + #define FMODE_PREAD 8 + #define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */ ++#define FMODE_QUOTACTL 4 + + /* File is being opened for execution. Primary users of this flag are + distributed filesystems that can use it to achieve correct ETXTBUSY +@@ -93,6 +95,8 @@ + #define FS_REQUIRES_DEV 1 + #define FS_BINARY_MOUNTDATA 2 + #define FS_HAS_SUBTYPE 4 ++#define FS_VIRTUALIZED 64 /* Can mount this fstype inside ve */ ++#define FS_MANGLE_PROC 128 /* hide some /proc/mounts info inside VE */ + #define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ + #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() + * during rename() internally. +@@ -357,6 +361,9 @@ + * Includes for diskquotas. + */ + #include ++#if defined(CONFIG_VZ_QUOTA) || defined(CONFIG_VZ_QUOTA_MODULE) ++#include ++#endif + + /** + * enum positive_aop_returns - aop return codes with specific semantics +@@ -616,6 +623,9 @@ + #ifdef CONFIG_QUOTA + struct dquot *i_dquot[MAXQUOTAS]; + #endif ++#if defined(CONFIG_VZ_QUOTA) || defined(CONFIG_VZ_QUOTA_MODULE) ++ struct vz_quota_ilink i_qlnk; ++#endif + struct list_head i_devices; + union { + struct pipe_inode_info *i_pipe; +@@ -671,6 +681,8 @@ + extern void inode_double_lock(struct inode *inode1, struct inode *inode2); + extern void inode_double_unlock(struct inode *inode1, struct inode *inode2); + ++extern struct kmem_cache *inode_cachep; ++ + /* + * NOTE: in a 32bit arch with a preemptable kernel and + * an UP compile the i_size_read/write must be atomic +@@ -787,6 +799,7 @@ + struct fown_struct f_owner; + unsigned int f_uid, f_gid; + struct file_ra_state f_ra; ++ struct user_beancounter *f_ub; + + u64 f_version; + #ifdef CONFIG_SECURITY +@@ -801,7 +814,9 @@ + spinlock_t f_ep_lock; + #endif /* #ifdef CONFIG_EPOLL */ + struct address_space *f_mapping; ++ struct ve_struct *owner_env; + }; ++ + extern spinlock_t files_lock; + #define file_list_lock() spin_lock(&files_lock); + #define file_list_unlock() spin_unlock(&files_lock); +@@ -867,6 +882,9 @@ + struct file *fl_file; + unsigned char fl_flags; + unsigned char fl_type; ++#ifdef CONFIG_BEANCOUNTERS ++ unsigned char fl_charged; ++#endif + loff_t fl_start; + loff_t fl_end; + +@@ -1183,6 +1201,7 @@ + int (*setlease)(struct file *, long, struct file_lock **); + int (*fgetattr)(struct file *, struct kstat *); + int (*fsetattr)(struct file *, struct iattr *); ++ struct file * (*get_host)(struct file *); + }; + + struct inode_operations { +@@ -1256,6 +1275,7 @@ + #ifdef CONFIG_QUOTA + ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); + ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); ++ struct inode *(*get_quota_root)(struct super_block *); + #endif + }; + +@@ -1415,8 +1435,14 @@ + struct lock_class_key i_mutex_key; + struct lock_class_key i_mutex_dir_key; + struct lock_class_key i_alloc_sem_key; ++ ++ struct file_system_type *proto; ++ struct ve_struct *owner_env; + }; + ++void get_filesystem(struct file_system_type *fs); ++void put_filesystem(struct file_system_type *fs); ++ + extern int get_sb_bdev(struct file_system_type *fs_type, + int flags, const char *dev_name, void *data, + int (*fill_super)(struct super_block *, void *, int), +@@ -1457,9 +1483,14 @@ + extern int unregister_filesystem(struct file_system_type *); + extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data); + #define kern_mount(type) kern_mount_data(type, NULL) ++extern int register_ve_fs_type(struct ve_struct *, struct file_system_type *, ++ struct file_system_type **, struct vfsmount **); ++extern void unregister_ve_fs_type(struct file_system_type *, struct vfsmount *); ++extern void umount_ve_fs_type(struct file_system_type *local_fs_type); + extern int may_umount_tree(struct vfsmount *); + extern int may_umount(struct vfsmount *); + extern void umount_tree(struct vfsmount *, int, struct list_head *); ++#define kern_umount mntput + extern void release_mounts(struct list_head *); + extern long do_mount(char *, char *, char *, unsigned long, void *); + extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); +@@ -1469,6 +1500,7 @@ + extern void drop_collected_mounts(struct vfsmount *); + + extern int vfs_statfs(struct dentry *, struct kstatfs *); ++extern int faudit_statfs(struct super_block *, struct kstatfs *); + + /* /sys/fs */ + extern struct kset fs_subsys; +@@ -1608,7 +1640,7 @@ + #define BLKDEV_MAJOR_HASH_SIZE 255 + extern const char *__bdevname(dev_t, char *buffer); + extern const char *bdevname(struct block_device *bdev, char *buffer); +-extern struct block_device *lookup_bdev(const char *); ++extern struct block_device *lookup_bdev(const char *, int mode); + extern struct block_device *open_bdev_excl(const char *, int, void *); + extern void close_bdev_excl(struct block_device *); + extern void blkdev_show(struct seq_file *,off_t); +@@ -1643,7 +1675,8 @@ + extern int __invalidate_device(struct block_device *); + extern int invalidate_partition(struct gendisk *, int); + #endif +-extern int invalidate_inodes(struct super_block *); ++extern int invalidate_inodes_check(struct super_block *, int check); ++#define invalidate_inodes(sb) invalidate_inodes_check(sb, 0) + unsigned long __invalidate_mapping_pages(struct address_space *mapping, + pgoff_t start, pgoff_t end, + bool be_atomic); +@@ -2087,10 +2120,20 @@ + { } + #endif /* CONFIG_SECURITY */ + ++static inline void *file_private(struct file *file) ++{ ++ struct file *host = file; ++ ++ while (host->f_op->get_host) { ++ host = host->f_op->get_host(host); ++ BUG_ON(host->f_mapping != file->f_mapping); ++ } ++ return host->private_data; ++} ++ + struct ctl_table; + int proc_nr_files(struct ctl_table *table, int write, struct file *filp, + void __user *buffer, size_t *lenp, loff_t *ppos); + +- + #endif /* __KERNEL__ */ + #endif /* _LINUX_FS_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/futex.h debian/binary-custom.d/openvz/src/include/linux/futex.h +--- ./include/linux/futex.h 2012-06-12 16:25:24.042312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/futex.h 2012-11-13 15:20:15.060569079 +0000 +@@ -110,7 +110,7 @@ + #ifdef __KERNEL__ + long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout, + u32 __user *uaddr2, u32 val2, u32 val3); +- ++long futex_wait_restart(struct restart_block *restart); + extern int + handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/genhd.h debian/binary-custom.d/openvz/src/include/linux/genhd.h +--- ./include/linux/genhd.h 2012-06-12 16:25:24.046312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/genhd.h 2012-11-13 15:20:15.060569079 +0000 +@@ -435,6 +435,7 @@ + return bdget(MKDEV(disk->major, disk->first_minor) + index); + } + ++extern struct kset block_subsys; + #endif + + #else /* CONFIG_BLOCK */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/gfp.h debian/binary-custom.d/openvz/src/include/linux/gfp.h +--- ./include/linux/gfp.h 2012-06-12 16:25:24.046312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/gfp.h 2012-11-13 15:20:15.060569079 +0000 +@@ -50,20 +50,25 @@ + #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ + #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ + #define __GFP_MOVABLE ((__force gfp_t)0x100000u) /* Page is movable */ ++#define __GFP_UBC ((__force gfp_t)0x200000u)/* charge kmem in buddy and slab */ ++#define __GFP_SOFT_UBC ((__force gfp_t)0x400000u)/* use soft charging */ + +-#define __GFP_BITS_SHIFT 21 /* Room for 21 __GFP_FOO bits */ ++#define __GFP_BITS_SHIFT 23 /* Room for __GFP_FOO bits */ + #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) + + /* This equals 0, but use constants in case they ever change */ + #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) + /* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ + #define GFP_ATOMIC (__GFP_HIGH) ++#define GFP_ATOMIC_UBC (__GFP_HIGH | __GFP_UBC) + #define GFP_NOIO (__GFP_WAIT) + #define GFP_NOFS (__GFP_WAIT | __GFP_IO) + #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) ++#define GFP_KERNEL_UBC (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_UBC) + #define GFP_TEMPORARY (__GFP_WAIT | __GFP_IO | __GFP_FS | \ + __GFP_RECLAIMABLE) + #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) ++#define GFP_USER_UBC (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | __GFP_UBC) + #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ + __GFP_HIGHMEM) + #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/grinternal.h debian/binary-custom.d/openvz/src/include/linux/grinternal.h +--- ./include/linux/grinternal.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/grinternal.h 2012-11-13 15:20:15.060569079 +0000 +@@ -0,0 +1,91 @@ ++#ifndef __GRINTERNAL_H ++#define __GRINTERNAL_H ++ ++#ifdef CONFIG_GRKERNSEC ++ ++#include ++ ++extern char *gr_to_filename(const struct dentry *dentry, ++ const struct vfsmount *mnt); ++extern char *gr_to_filename2(const struct dentry *dentry, ++ const struct vfsmount *mnt); ++extern char *gr_to_filename3(const struct dentry *dentry, ++ const struct vfsmount *mnt); ++ ++#ifdef CONFIG_VE ++#include ++#define grsec_enable_tpe (get_exec_env()->grsec.enable_tpe) ++#define grsec_tpe_gid (get_exec_env()->grsec.tpe_gid) ++#define grsec_enable_tpe_all (get_exec_env()->grsec.enable_tpe_all) ++#define grsec_lock (get_exec_env()->grsec.lock) ++#else ++extern int grsec_enable_tpe; ++extern int grsec_tpe_gid; ++extern int grsec_enable_tpe_all; ++extern int grsec_lock; ++#endif ++ ++extern spinlock_t grsec_alert_lock; ++extern unsigned long grsec_alert_wtime; ++extern unsigned long grsec_alert_fyet; ++ ++extern spinlock_t grsec_audit_lock; ++ ++#define gr_task_fullpath(tsk) ("") ++ ++#define gr_parent_task_fullpath(tsk) ("") ++ ++#define DEFAULTSECARGS(task) gr_task_fullpath(task), task->comm, \ ++ task->pid, task->uid, \ ++ task->euid, task->gid, task->egid, \ ++ gr_parent_task_fullpath(task), \ ++ task->parent->comm, task->parent->pid, \ ++ task->parent->uid, task->parent->euid, \ ++ task->parent->gid, task->parent->egid ++ ++enum { ++ GR_DO_AUDIT, ++ GR_DONT_AUDIT, ++ GR_DONT_AUDIT_GOOD ++}; ++ ++enum { ++ GR_TTYSNIFF, ++ GR_RBAC, ++ GR_RBAC_STR, ++ GR_STR_RBAC, ++ GR_RBAC_MODE2, ++ GR_RBAC_MODE3, ++ GR_FILENAME, ++ GR_NOARGS, ++ GR_ONE_INT, ++ GR_ONE_INT_TWO_STR, ++ GR_ONE_STR, ++ GR_STR_INT, ++ GR_TWO_INT, ++ GR_THREE_INT, ++ GR_FIVE_INT_TWO_STR, ++ GR_TWO_STR, ++ GR_THREE_STR, ++ GR_FOUR_STR, ++ GR_STR_FILENAME, ++ GR_FILENAME_STR, ++ GR_FILENAME_TWO_INT, ++ GR_FILENAME_TWO_INT_STR, ++ GR_TEXTREL, ++ GR_PTRACE, ++ GR_RESOURCE, ++ GR_CAP, ++ GR_SIG, ++ GR_CRASH1, ++ GR_CRASH2, ++ GR_PSACCT ++}; ++ ++#define gr_log_fs_generic(audit, msg, dentry, mnt) gr_log_varargs(audit, msg, GR_FILENAME, dentry, mnt) ++#define gr_log_str(audit, msg, str) gr_log_varargs(audit, msg, GR_ONE_STR, str) ++ ++extern void gr_log_varargs(int audit, const char *msg, int argtypes, ...); ++ ++#endif ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/grmsg.h debian/binary-custom.d/openvz/src/include/linux/grmsg.h +--- ./include/linux/grmsg.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/grmsg.h 2012-11-13 15:20:15.060569079 +0000 +@@ -0,0 +1,3 @@ ++#define DEFAULTSECMSG "%.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u, parent %.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u" ++#define GR_EXEC_TPE_MSG "denied untrusted exec of %.950s by " ++#define GR_SYSCTL_MSG "denied modification of grsecurity sysctl value : %.32s by " +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/grsecurity.h debian/binary-custom.d/openvz/src/include/linux/grsecurity.h +--- ./include/linux/grsecurity.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/grsecurity.h 2012-11-13 15:20:15.060569079 +0000 +@@ -0,0 +1,13 @@ ++#ifndef GR_SECURITY_H ++#define GR_SECURITY_H ++#include ++ ++extern int gr_tpe_allow(const struct file *file); ++extern void gr_copy_label(struct task_struct *tsk); ++extern int gr_acl_handle_mmap(const struct file *file, ++ const unsigned long prot); ++extern int gr_acl_handle_mprotect(const struct file *file, ++ const unsigned long prot); ++extern void gr_acl_handle_exit(void); ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/hardirq.h debian/binary-custom.d/openvz/src/include/linux/hardirq.h +--- ./include/linux/hardirq.h 2012-06-12 16:25:24.046312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/hardirq.h 2012-11-13 15:20:15.064569078 +0000 +@@ -7,6 +7,9 @@ + #include + #include + ++#include ++#include ++ + /* + * We put the hardirq and softirq counter into the preemption + * counter. The bitmask has the following meaning: +@@ -113,6 +116,24 @@ + } + #endif + ++#define save_context() do { \ ++ struct task_struct *tsk; \ ++ if (hardirq_count() == HARDIRQ_OFFSET) { \ ++ tsk = current; \ ++ ve_save_context(tsk); \ ++ ub_save_context(tsk); \ ++ } \ ++ } while (0) ++ ++#define restore_context() do { \ ++ struct task_struct *tsk; \ ++ if (hardirq_count() == HARDIRQ_OFFSET) { \ ++ tsk = current; \ ++ ve_restore_context(tsk); \ ++ ub_restore_context(tsk); \ ++ } \ ++ } while (0) ++ + /* + * It is safe to do non-atomic ops on ->hardirq_context, + * because NMI handlers may not preempt and the ops are +@@ -123,6 +144,7 @@ + do { \ + account_system_vtime(current); \ + add_preempt_count(HARDIRQ_OFFSET); \ ++ save_context(); \ + trace_hardirq_enter(); \ + } while (0) + +@@ -138,6 +160,7 @@ + do { \ + trace_hardirq_exit(); \ + account_system_vtime(current); \ ++ restore_context(); \ + sub_preempt_count(HARDIRQ_OFFSET); \ + } while (0) + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/hrtimer.h debian/binary-custom.d/openvz/src/include/linux/hrtimer.h +--- ./include/linux/hrtimer.h 2012-06-12 16:25:24.050312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/hrtimer.h 2012-11-13 15:20:15.064569078 +0000 +@@ -304,6 +304,9 @@ + const enum hrtimer_mode mode, + const clockid_t clockid); + extern long hrtimer_nanosleep_restart(struct restart_block *restart_block); ++#ifdef CONFIG_COMPAT ++long compat_nanosleep_restart(struct restart_block *restart); ++#endif + + extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, + struct task_struct *tsk); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/if_bridge.h debian/binary-custom.d/openvz/src/include/linux/if_bridge.h +--- ./include/linux/if_bridge.h 2012-06-12 16:25:24.054312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/if_bridge.h 2012-11-13 15:20:15.080569077 +0000 +@@ -44,6 +44,7 @@ + #define BRCTL_SET_PORT_PRIORITY 16 + #define BRCTL_SET_PATH_COST 17 + #define BRCTL_GET_FDB_ENTRIES 18 ++#define BRCTL_SET_VIA_ORIG_DEV 19 + + #define BR_STATE_DISABLED 0 + #define BR_STATE_LISTENING 1 +@@ -72,6 +73,7 @@ + __u32 tcn_timer_value; + __u32 topology_change_timer_value; + __u32 gc_timer_value; ++ __u8 via_phys_dev; + }; + + struct __port_info +@@ -104,9 +106,12 @@ + + #include + ++#define BR_ALREADY_SEEN 1 ++ + extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); + extern struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p, + struct sk_buff *skb); ++extern int (*br_hard_xmit_hook)(struct sk_buff *skb, struct net_bridge_port *port); + extern int (*br_should_route_hook)(struct sk_buff *skb); + + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/if_tun.h debian/binary-custom.d/openvz/src/include/linux/if_tun.h +--- ./include/linux/if_tun.h 2012-06-12 16:25:24.054312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/if_tun.h 2012-11-13 15:20:15.080569077 +0000 +@@ -18,10 +18,14 @@ + #ifndef __IF_TUN_H + #define __IF_TUN_H + ++#include ++#include ++ + /* Uncomment to enable debugging */ + /* #define TUN_DEBUG 1 */ + + #ifdef __KERNEL__ ++#include + + #ifdef TUN_DEBUG + #define DBG if(tun->debug)printk +@@ -35,6 +39,7 @@ + struct list_head list; + unsigned long flags; + int attached; ++ void *bind_file; + uid_t owner; + gid_t group; + +@@ -92,4 +97,10 @@ + }; + #define TUN_PKT_STRIP 0x0001 + ++extern int tun_net_open(struct net_device *dev); ++extern int tun_chr_open(struct inode *inode, struct file * file); ++extern void tun_net_init(struct net_device *dev); ++extern void tun_setup(struct net_device *dev); ++extern struct list_head tun_dev_list; ++ + #endif /* __IF_TUN_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/if_vlan.h debian/binary-custom.d/openvz/src/include/linux/if_vlan.h +--- ./include/linux/if_vlan.h 2012-06-12 16:25:24.058312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/if_vlan.h 2012-11-13 15:20:15.080569077 +0000 +@@ -79,6 +79,9 @@ + struct hlist_node hlist; /* linked list */ + struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; + struct rcu_head rcu; ++#ifdef CONFIG_VE ++ struct ve_struct *owner; ++#endif + }; + + static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, int vlan_id) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/inetdevice.h debian/binary-custom.d/openvz/src/include/linux/inetdevice.h +--- ./include/linux/inetdevice.h 2012-06-12 16:25:24.058312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/inetdevice.h 2012-11-13 15:20:15.080569077 +0000 +@@ -18,6 +18,12 @@ + }; + + extern struct ipv4_devconf ipv4_devconf; ++extern struct ipv4_devconf ipv4_devconf_dflt; ++#if defined(CONFIG_VE) && defined(CONFIG_INET) ++#define ve_ipv4_devconf (*(get_exec_env()->_ipv4_devconf)) ++#else ++#define ve_ipv4_devconf ipv4_devconf ++#endif + + struct in_device + { +@@ -44,7 +50,7 @@ + }; + + #define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) +-#define IPV4_DEVCONF_ALL(attr) IPV4_DEVCONF(ipv4_devconf, attr) ++#define IPV4_DEVCONF_ALL(attr) IPV4_DEVCONF(ve_ipv4_devconf, attr) + + static inline int ipv4_devconf_get(struct in_device *in_dev, int index) + { +@@ -136,6 +142,7 @@ + extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope); + extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask); + extern void inet_forward_change(void); ++extern void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, int destroy); + + static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) + { +@@ -204,6 +211,16 @@ + #define __in_dev_put(idev) atomic_dec(&(idev)->refcnt) + #define in_dev_hold(idev) atomic_inc(&(idev)->refcnt) + ++struct ve_struct; ++#ifdef CONFIG_INET ++extern int devinet_sysctl_init(struct ve_struct *); ++extern void devinet_sysctl_fini(struct ve_struct *); ++extern void devinet_sysctl_free(struct ve_struct *); ++#else ++static inline int devinet_sysctl_init(struct ve_struct *ve) { return 0; } ++static inline void devinet_sysctl_fini(struct ve_struct *ve) { ; } ++static inline void devinet_sysctl_free(struct ve_struct *ve) { ; } ++#endif + #endif /* __KERNEL__ */ + + static __inline__ __be32 inet_make_mask(int logmask) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/init_task.h debian/binary-custom.d/openvz/src/include/linux/init_task.h +--- ./include/linux/init_task.h 2012-06-12 16:25:24.058312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/init_task.h 2012-11-13 15:20:15.080569077 +0000 +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #define INIT_FDTABLE \ + { \ +@@ -69,10 +70,17 @@ + .rlim = INIT_RLIMITS, \ + } + ++#ifdef CONFIG_VE ++/* one for ve0, one for init_task */ ++#define INIT_NSPROXY_COUNT ATOMIC_INIT(2) ++#else ++#define INIT_NSPROXY_COUNT ATOMIC_INIT(1) ++#endif ++ + extern struct nsproxy init_nsproxy; + #define INIT_NSPROXY(nsproxy) { \ + .pid_ns = &init_pid_ns, \ +- .count = ATOMIC_INIT(1), \ ++ .count = INIT_NSPROXY_COUNT, \ + .uts_ns = &init_uts_ns, \ + .mnt_ns = NULL, \ + INIT_NET_NS(net_ns) \ +@@ -173,6 +181,7 @@ + .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ + INIT_TRACE_IRQFLAGS \ + INIT_LOCKDEP \ ++ INIT_VZ_FAIRSCHED \ + } + + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/inotify.h debian/binary-custom.d/openvz/src/include/linux/inotify.h +--- ./include/linux/inotify.h 2012-06-12 16:25:24.058312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/inotify.h 2012-11-13 15:20:15.080569077 +0000 +@@ -67,6 +67,7 @@ + + #include + #include ++#include + + /* + * struct inotify_watch - represents a watch request on a specific inode +@@ -84,6 +85,8 @@ + struct list_head i_list; /* entry in inode's list */ + atomic_t count; /* reference count */ + struct inotify_handle *ih; /* associated inotify handle */ ++ struct dentry *dentry; ++ struct vfsmount *mnt; + struct inode *inode; /* associated inode */ + __s32 wd; /* watch descriptor */ + __u32 mask; /* event mask for this watch */ +@@ -120,6 +123,8 @@ + u32); + extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *, + struct inode *, __u32); ++extern __s32 inotify_add_watch_dget(struct inotify_handle *, struct inotify_watch *, ++ struct dentry *, struct vfsmount *, __u32); + extern __s32 inotify_clone_watch(struct inotify_watch *, struct inotify_watch *); + extern void inotify_evict_watch(struct inotify_watch *); + extern int inotify_rm_watch(struct inotify_handle *, struct inotify_watch *); +@@ -131,6 +136,66 @@ + extern int pin_inotify_watch(struct inotify_watch *); + extern void unpin_inotify_watch(struct inotify_watch *); + ++/* ++ * struct inotify_handle - represents an inotify instance ++ * ++ * This structure is protected by the mutex 'mutex'. ++ */ ++struct inotify_handle { ++ struct idr idr; /* idr mapping wd -> watch */ ++ struct mutex mutex; /* protects this bad boy */ ++ struct list_head watches; /* list of watches */ ++ atomic_t count; /* reference count */ ++ u32 last_wd; /* the last wd allocated */ ++ const struct inotify_operations *in_ops; /* inotify caller operations */ ++}; ++ ++ ++/* ++ * struct inotify_device - represents an inotify instance ++ * ++ * This structure is protected by the mutex 'mutex'. ++ */ ++struct inotify_device { ++ wait_queue_head_t wq; /* wait queue for i/o */ ++ struct mutex ev_mutex; /* protects event queue */ ++ struct mutex up_mutex; /* synchronizes watch updates */ ++ struct list_head events; /* list of queued events */ ++ atomic_t count; /* reference count */ ++ struct user_struct *user; /* user who opened this dev */ ++ struct inotify_handle *ih; /* inotify handle */ ++ unsigned int queue_size; /* size of the queue (bytes) */ ++ unsigned int event_count; /* number of pending events */ ++ unsigned int max_events; /* maximum number of events */ ++}; ++ ++/* ++ * struct inotify_kernel_event - An inotify event, originating from a watch and ++ * queued for user-space. A list of these is attached to each instance of the ++ * device. In read(), this list is walked and all events that can fit in the ++ * buffer are returned. ++ * ++ * Protected by dev->ev_mutex of the device in which we are queued. ++ */ ++struct inotify_kernel_event { ++ struct inotify_event event; /* the user-space event */ ++ struct list_head list; /* entry in inotify_device's list */ ++ char *name; /* filename, if any */ ++}; ++ ++/* ++ * struct inotify_user_watch - our version of an inotify_watch, we add ++ * a reference to the associated inotify_device. ++ */ ++struct inotify_user_watch { ++ struct inotify_device *dev; /* associated device */ ++ struct inotify_watch wdata; /* inotify watch data */ ++}; ++ ++int inotify_create_watch(struct inotify_device *dev, struct dentry *d, ++ struct vfsmount *mnt, u32 mask); ++ ++ + #else + + static inline void inotify_d_instantiate(struct dentry *dentry, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/ioprio.h debian/binary-custom.d/openvz/src/include/linux/ioprio.h +--- ./include/linux/ioprio.h 2012-06-12 16:25:24.058312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/ioprio.h 2012-11-13 15:20:15.084569077 +0000 +@@ -38,6 +38,7 @@ + IOPRIO_WHO_PROCESS = 1, + IOPRIO_WHO_PGRP, + IOPRIO_WHO_USER, ++ IOPRIO_WHO_UBC = 1000, + }; + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/ipc.h debian/binary-custom.d/openvz/src/include/linux/ipc.h +--- ./include/linux/ipc.h 2012-06-12 16:25:24.058312495 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/ipc.h 2012-11-13 15:20:15.096569076 +0000 +@@ -80,8 +80,21 @@ + #ifdef __KERNEL__ + + #include ++#include ++#include + #include + ++#define IPC_SEM_IDS 0 ++#define IPC_MSG_IDS 1 ++#define IPC_SHM_IDS 2 ++ ++struct ipc_ids { ++ int in_use; ++ unsigned short seq; ++ unsigned short seq_max; ++ struct rw_semaphore rw_mutex; ++ struct idr ipcs_idr; ++}; + #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ + + /* used by in-kernel data structures */ +@@ -100,6 +113,13 @@ + void *security; + }; + ++struct kern_ipc_perm *ipc_lock(struct ipc_ids *, int); ++static inline void ipc_unlock(struct kern_ipc_perm *perm) ++{ ++ spin_unlock(&perm->lock); ++ rcu_read_unlock(); ++} ++ + struct ipc_ids; + struct ipc_namespace { + struct kref kref; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/ipv6.h debian/binary-custom.d/openvz/src/include/linux/ipv6.h +--- ./include/linux/ipv6.h 2012-06-12 16:25:24.062312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/ipv6.h 2012-11-13 15:20:15.096569076 +0000 +@@ -457,12 +457,13 @@ + #define inet_v6_ipv6only(__sk) 0 + #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ + +-#define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ ++#define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif,__ve)\ + (((__sk)->sk_hash == (__hash)) && \ + ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ + ((__sk)->sk_family == AF_INET6) && \ + ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ + ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ ++ ve_accessible_strict((__sk)->owner_env, (__ve)) && \ + (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) + + #endif /* __KERNEL__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/kdev_t.h debian/binary-custom.d/openvz/src/include/linux/kdev_t.h +--- ./include/linux/kdev_t.h 2012-06-12 16:25:24.066312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/kdev_t.h 2012-11-13 15:20:15.108569076 +0000 +@@ -87,6 +87,57 @@ + return dev & 0x3ffff; + } + ++#define UNNAMED_MAJOR_COUNT 16 ++ ++#if UNNAMED_MAJOR_COUNT > 1 ++ ++extern int unnamed_dev_majors[UNNAMED_MAJOR_COUNT]; ++ ++static inline dev_t make_unnamed_dev(int idx) ++{ ++ /* ++ * Here we transfer bits from 8 to 8+log2(UNNAMED_MAJOR_COUNT) of the ++ * unnamed device index into major number. ++ */ ++ return MKDEV(unnamed_dev_majors[(idx >> 8) & (UNNAMED_MAJOR_COUNT - 1)], ++ idx & ~((UNNAMED_MAJOR_COUNT - 1) << 8)); ++} ++ ++static inline int unnamed_dev_idx(dev_t dev) ++{ ++ int i; ++ for (i = 0; i < UNNAMED_MAJOR_COUNT && ++ MAJOR(dev) != unnamed_dev_majors[i]; i++); ++ return MINOR(dev) | (i << 8); ++} ++ ++static inline int is_unnamed_dev(dev_t dev) ++{ ++ int i; ++ for (i = 0; i < UNNAMED_MAJOR_COUNT && ++ MAJOR(dev) != unnamed_dev_majors[i]; i++); ++ return i < UNNAMED_MAJOR_COUNT; ++} ++ ++#else /* UNNAMED_MAJOR_COUNT */ ++ ++static inline dev_t make_unnamed_dev(int idx) ++{ ++ return MKDEV(0, idx); ++} ++ ++static inline int unnamed_dev_idx(dev_t dev) ++{ ++ return MINOR(dev); ++} ++ ++static inline int is_unnamed_dev(dev_t dev) ++{ ++ return MAJOR(dev) == 0; ++} ++ ++#endif /* UNNAMED_MAJOR_COUNT */ ++ + #else /* __KERNEL__ */ + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/kernel.h debian/binary-custom.d/openvz/src/include/linux/kernel.h +--- ./include/linux/kernel.h 2012-06-12 16:25:24.066312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/kernel.h 2012-11-13 15:20:15.108569076 +0000 +@@ -182,6 +182,12 @@ + extern int log_buf_get_len(void); + extern int log_buf_read(int idx); + extern int log_buf_copy(char *dest, int idx, int len); ++ ++asmlinkage int ve_vprintk(int dst, const char *fmt, va_list args) ++ __attribute__ ((format (printf, 2, 0))); ++asmlinkage int ve_printk(int, const char * fmt, ...) ++ __attribute__ ((format (printf, 2, 3))); ++void prepare_printk(void); + #else + static inline int vprintk(const char *s, va_list args) + __attribute__ ((format (printf, 1, 0))); +@@ -192,8 +198,22 @@ + static inline int log_buf_get_len(void) { return 0; } + static inline int log_buf_read(int idx) { return 0; } + static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } ++ ++static inline int ve_printk(int d, const char *s, ...) ++ __attribute__ ((format (printf, 2, 3))); ++static inline int ve_printk(int d, const char *s, ...) ++{ ++ return 0; ++} ++static inline void prepare_printk(void) ++{ ++} + #endif + ++#define VE0_LOG 1 ++#define VE_LOG 2 ++#define VE_LOG_BOTH (VE0_LOG | VE_LOG) ++ + unsigned long int_sqrt(unsigned long); + + extern int printk_ratelimit(void); +@@ -201,9 +221,14 @@ + extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, + unsigned int interval_msec); + ++extern int console_silence_loglevel; ++ + static inline void console_silent(void) + { +- console_loglevel = 0; ++ if (console_loglevel > console_silence_loglevel) { ++ printk(KERN_EMERG "console shuts up ...\n"); ++ console_loglevel = 0; ++ } + } + + static inline void console_verbose(void) +@@ -217,8 +242,10 @@ + extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ + extern int panic_timeout; + extern int panic_on_oops; ++extern int decode_call_traces; + extern int panic_on_unrecovered_nmi; + extern int tainted; ++extern int kernel_text_csum_broken; + extern const char *print_tainted(void); + extern void add_taint(unsigned); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/kobject.h debian/binary-custom.d/openvz/src/include/linux/kobject.h +--- ./include/linux/kobject.h 2012-06-12 16:25:24.070312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/kobject.h 2012-11-13 15:20:15.108569076 +0000 +@@ -55,6 +55,8 @@ + KOBJ_REMOVE, + KOBJ_CHANGE, + KOBJ_MOVE, ++ KOBJ_START, ++ KOBJ_STOP, + KOBJ_ONLINE, + KOBJ_OFFLINE, + KOBJ_MAX +@@ -202,6 +204,9 @@ + /* The global /sys/hypervisor/ subsystem */ + extern struct kset hypervisor_subsys; + ++extern struct kset class_obj_subsys; ++extern struct kset class_subsys; ++ + /* + * Helpers for setting the kset of registered objects. + * Often, a registered object belongs to a kset embedded in a +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/lockd/lockd.h debian/binary-custom.d/openvz/src/include/linux/lockd/lockd.h +--- ./include/linux/lockd/lockd.h 2012-06-12 16:25:24.074312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/lockd/lockd.h 2012-11-13 15:20:15.124569074 +0000 +@@ -61,6 +61,7 @@ + struct list_head h_granted; /* Locks in GRANTED state */ + struct list_head h_reclaim; /* Locks in RECLAIM state */ + struct nsm_handle * h_nsmhandle; /* NSM status handle */ ++ struct ve_struct * owner_env; /* VE owning the host */ + }; + + struct nsm_handle { +@@ -151,8 +152,11 @@ + #ifdef CONFIG_LOCKD_V4 + extern struct svc_procedure nlmsvc_procedures4[]; + #endif +-extern int nlmsvc_grace_period; +-extern unsigned long nlmsvc_timeout; ++ ++#include ++extern int _nlmsvc_grace_period; ++extern unsigned long _nlmsvc_timeout; ++ + extern int nsm_use_hostnames; + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/major.h debian/binary-custom.d/openvz/src/include/linux/major.h +--- ./include/linux/major.h 2012-06-12 16:25:24.074312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/major.h 2012-11-13 15:20:15.124569074 +0000 +@@ -170,4 +170,7 @@ + + #define VIOTAPE_MAJOR 230 + ++#define UNNAMED_EXTRA_MAJOR 130 ++#define UNNAMED_EXTRA_MAJOR_COUNT 120 ++ + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/mm.h debian/binary-custom.d/openvz/src/include/linux/mm.h +--- ./include/linux/mm.h 2012-06-12 16:25:24.078312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/mm.h 2012-11-13 15:20:15.140569075 +0000 +@@ -646,15 +646,7 @@ + + extern void show_free_areas(void); + +-#ifdef CONFIG_SHMEM +-int shmem_lock(struct file *file, int lock, struct user_struct *user); +-#else +-static inline int shmem_lock(struct file *file, int lock, +- struct user_struct *user) +-{ +- return 0; +-} +-#endif ++#define shmem_nopage filemap_nopage + struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); + + int shmem_zero_setup(struct vm_area_struct *); +@@ -695,7 +687,9 @@ + void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, + unsigned long floor, unsigned long ceiling); + int copy_page_range(struct mm_struct *dst, struct mm_struct *src, +- struct vm_area_struct *vma); ++ struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma); ++int __copy_page_range(struct vm_area_struct *dst_vma, struct vm_area_struct *vma, ++ unsigned long addr, size_t size); + void unmap_mapping_range(struct address_space *mapping, + loff_t const holebegin, loff_t const holelen, int even_cows); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/mm_types.h debian/binary-custom.d/openvz/src/include/linux/mm_types.h +--- ./include/linux/mm_types.h 2012-06-12 16:25:24.078312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/mm_types.h 2012-11-13 15:20:15.140569075 +0000 +@@ -88,6 +88,13 @@ + void *virtual; /* Kernel virtual address (NULL if + not kmapped, ie. highmem) */ + #endif /* WANT_PAGE_VIRTUAL */ ++#ifdef CONFIG_BEANCOUNTERS ++ union { ++ struct user_beancounter *page_ub; ++ struct page_beancounter *page_pb; ++ struct user_beancounter **slub_ubs; ++ } bc; ++#endif + }; + + /* +@@ -212,6 +219,9 @@ + + unsigned long flags; /* Must use atomic bitops to access the bits */ + ++ unsigned int vps_dumpable:2; ++ unsigned int oom_killed:1; ++ + /* coredumping support */ + int core_waiters; + struct completion *core_startup_done, core_done; +@@ -219,6 +229,9 @@ + /* aio bits */ + rwlock_t ioctx_list_lock; + struct kioctx *ioctx_list; ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *mm_ub; ++#endif + }; + + #endif /* _LINUX_MM_TYPES_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/mman.h debian/binary-custom.d/openvz/src/include/linux/mman.h +--- ./include/linux/mman.h 2012-06-12 16:25:24.078312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/mman.h 2012-11-13 15:20:15.140569075 +0000 +@@ -61,6 +61,9 @@ + calc_vm_flag_bits(unsigned long flags) + { + return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | ++#ifdef MAP_GROWSUP ++ _calc_vm_trans(flags, MAP_GROWSUP, VM_GROWSUP ) | ++#endif + _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | + _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) | + _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/mnt_namespace.h debian/binary-custom.d/openvz/src/include/linux/mnt_namespace.h +--- ./include/linux/mnt_namespace.h 2012-06-12 16:25:24.082312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/mnt_namespace.h 2012-11-13 15:20:15.144569076 +0000 +@@ -16,6 +16,8 @@ + + extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, + struct fs_struct *); ++extern struct rw_semaphore namespace_sem; ++ + extern void __put_mnt_ns(struct mnt_namespace *ns); + + static inline void put_mnt_ns(struct mnt_namespace *ns) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/mount.h debian/binary-custom.d/openvz/src/include/linux/mount.h +--- ./include/linux/mount.h 2012-06-12 16:25:24.082312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/mount.h 2012-11-13 15:20:15.144569076 +0000 +@@ -61,6 +61,7 @@ + atomic_t mnt_count; + int mnt_expiry_mark; /* true if marked for expiry */ + int mnt_pinned; ++ unsigned owner; + }; + + static inline struct vfsmount *mntget(struct vfsmount *mnt) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/msg.h debian/binary-custom.d/openvz/src/include/linux/msg.h +--- ./include/linux/msg.h 2012-06-12 16:25:24.082312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/msg.h 2012-11-13 15:20:15.144569076 +0000 +@@ -97,6 +97,14 @@ + extern long do_msgrcv(int msqid, long *pmtype, void __user *mtext, + size_t msgsz, long msgtyp, int msgflg); + ++int sysvipc_walk_msg(int (*func)(int, struct msg_queue*, void *), void *arg); ++int sysvipc_setup_msg(key_t key, int msqid, int msgflg); ++int sysv_msg_store(struct msg_msg *msg, ++ int (*store)(void * src, int len, int offset, void * data), ++ int len, void * data); ++struct msg_msg *sysv_msg_load(int (*load)(void * dst, int len, int offset, ++ void * data), int len, void * data); ++ + #endif /* __KERNEL__ */ + + #endif /* _LINUX_MSG_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/namei.h debian/binary-custom.d/openvz/src/include/linux/namei.h +--- ./include/linux/namei.h 2012-06-12 16:25:24.086312494 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/namei.h 2012-11-13 15:20:15.152569073 +0000 +@@ -61,6 +61,8 @@ + #define LOOKUP_CREATE (0x0200) + #define LOOKUP_ACCESS (0x0400) + #define LOOKUP_CHDIR (0x0800) ++#define LOOKUP_NOAREACHECK (0x1000) /* no area check on lookup */ ++#define LOOKUP_STRICT (0x2000) /* no symlinks or other filesystems */ + + extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); + extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *)); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/netdevice.h debian/binary-custom.d/openvz/src/include/linux/netdevice.h +--- ./include/linux/netdevice.h 2012-06-12 16:25:24.090312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/netdevice.h 2012-11-13 15:20:15.152569073 +0000 +@@ -280,6 +280,11 @@ + __LINK_STATE_QDISC_RUNNING, + }; + ++struct netdev_bc { ++ struct user_beancounter *exec_ub, *owner_ub; ++}; ++ ++#define netdev_bc(dev) (&(dev)->dev_bc) + + /* + * This structure holds at boot time configured netdevice settings. They +@@ -514,6 +519,10 @@ + #define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT) + #define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT) + #define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT) ++/* device is venet device */ ++#define NETIF_F_VENET (1 << (NETIF_F_GSO_SHIFT - 1)) ++/* can be registered inside VE */ ++#define NETIF_F_VIRTUAL (1 << (NETIF_F_GSO_SHIFT - 2)) + + /* List of features with software fallbacks. */ + #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6) +@@ -716,6 +725,9 @@ + /* macvlan */ + struct macvlan_port *macvlan_port; + ++ struct ve_struct *owner_env; /* Owner VE of the interface */ ++ struct netdev_bc dev_bc; ++ + /* class/net/name entry */ + struct device dev; + /* space for optional statistics and wireless sysfs groups */ +@@ -730,6 +742,20 @@ + }; + #define to_net_dev(d) container_of(d, struct net_device, dev) + ++#define NETDEV_HASHBITS 8 ++#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) ++ ++static inline struct hlist_head *dev_name_hash(struct net *net, const char *name) ++{ ++ unsigned hash = full_name_hash(name, strnlen(name, IFNAMSIZ)); ++ return &net->dev_name_head[hash & ((1 << NETDEV_HASHBITS) - 1)]; ++} ++ ++static inline struct hlist_head *dev_index_hash(struct net *net, int ifindex) ++{ ++ return &net->dev_index_head[ifindex & ((1 << NETDEV_HASHBITS) - 1)]; ++} ++ + #define NETDEV_ALIGN 32 + #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) + +@@ -1092,6 +1118,9 @@ + extern unsigned dev_get_flags(const struct net_device *); + extern int dev_change_flags(struct net_device *, unsigned); + extern int dev_change_name(struct net_device *, char *); ++int __dev_change_net_namespace(struct net_device *, struct net *, const char *, ++ struct ve_struct *src_ve, struct ve_struct *dst_ve, ++ struct user_beancounter *exec_ub); + extern int dev_change_net_namespace(struct net_device *, + struct net *, const char *); + extern int dev_set_mtu(struct net_device *, int); +@@ -1453,6 +1482,18 @@ + + extern int netdev_compute_features(unsigned long all, unsigned long one); + ++#if defined(CONFIG_VE) && defined(CONFIG_NET) ++static inline int ve_is_dev_movable(struct net_device *dev) ++{ ++ return !(dev->features & NETIF_F_VIRTUAL); ++} ++#else ++static inline int ve_is_dev_movable(struct net_device *dev) ++{ ++ return 0; ++} ++#endif ++ + static inline int net_gso_ok(int features, int gso_type) + { + int feature = gso_type << NETIF_F_GSO_SHIFT; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/netfilter/x_tables.h debian/binary-custom.d/openvz/src/include/linux/netfilter/x_tables.h +--- ./include/linux/netfilter/x_tables.h 2012-06-12 16:25:24.094312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/netfilter/x_tables.h 2012-11-13 15:20:15.156569072 +0000 +@@ -259,6 +259,7 @@ + { + /* Size per table */ + unsigned int size; ++ unsigned int alloc_size; + /* Number of entries: FIXME. --RR */ + unsigned int number; + /* Initial number of entries. Needed for module usage count */ +@@ -293,6 +294,10 @@ + struct xt_table_info *bootstrap, + struct xt_table_info *newinfo); + extern void *xt_unregister_table(struct xt_table *table); ++extern struct xt_table *virt_xt_register_table(struct xt_table *table, ++ struct xt_table_info *bootstrap, ++ struct xt_table_info *newinfo); ++extern void *virt_xt_unregister_table(struct xt_table *table); + + extern struct xt_table_info *xt_replace_table(struct xt_table *table, + unsigned int num_counters, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/netfilter/xt_hashlimit.h debian/binary-custom.d/openvz/src/include/linux/netfilter/xt_hashlimit.h +--- ./include/linux/netfilter/xt_hashlimit.h 2012-06-12 16:25:24.094312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/netfilter/xt_hashlimit.h 2012-11-13 15:20:15.156569072 +0000 +@@ -37,4 +37,12 @@ + struct xt_hashlimit_info *master; + } u; + }; ++ ++#ifdef __KERNEL__ ++struct ve_xt_hashlimit { ++ struct hlist_head hashlimit_htables; ++ struct proc_dir_entry *hashlimit_procdir4; ++ struct proc_dir_entry *hashlimit_procdir6; ++}; ++#endif + #endif /*_XT_HASHLIMIT_H*/ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/netfilter.h debian/binary-custom.d/openvz/src/include/linux/netfilter.h +--- ./include/linux/netfilter.h 2012-06-12 16:25:24.090312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/netfilter.h 2012-11-13 15:20:15.152569073 +0000 +@@ -126,7 +126,13 @@ + extern struct ctl_table nf_net_ipv4_netfilter_sysctl_path[]; + #endif /* CONFIG_SYSCTL */ + ++#ifdef CONFIG_VE_IPTABLES ++#define ve_nf_hooks \ ++ ((struct list_head (*)[NF_MAX_HOOKS])(get_exec_env()->_nf_hooks)) ++#else + extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; ++#define ve_nf_hooks nf_hooks ++#endif + + /* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will + * disappear once iptables is replaced with pkttables. Please DO NOT use them +@@ -204,7 +210,7 @@ + if (!cond) + return 1; + #ifndef CONFIG_NETFILTER_DEBUG +- if (list_empty(&nf_hooks[pf][hook])) ++ if (list_empty(&ve_nf_hooks[pf][hook])) + return 1; + #endif + return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/netfilter_ipv4/ip_tables.h debian/binary-custom.d/openvz/src/include/linux/netfilter_ipv4/ip_tables.h +--- ./include/linux/netfilter_ipv4/ip_tables.h 2012-06-12 16:25:24.098312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/netfilter_ipv4/ip_tables.h 2012-11-13 15:20:15.160569073 +0000 +@@ -292,7 +292,7 @@ + #include + extern void ipt_init(void) __init; + +-extern int ipt_register_table(struct xt_table *table, ++extern struct xt_table *ipt_register_table(struct xt_table *table, + const struct ipt_replace *repl); + extern void ipt_unregister_table(struct xt_table *table); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/netfilter_ipv4/ipt_recent.h debian/binary-custom.d/openvz/src/include/linux/netfilter_ipv4/ipt_recent.h +--- ./include/linux/netfilter_ipv4/ipt_recent.h 2012-06-12 16:25:24.098312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/netfilter_ipv4/ipt_recent.h 2012-11-13 15:20:15.160569073 +0000 +@@ -24,4 +24,13 @@ + u_int8_t side; + }; + ++#ifdef __KERNEL__ ++struct ve_ipt_recent { ++ struct list_head tables; ++#ifdef CONFIG_PROC_FS ++ struct proc_dir_entry *proc_dir; ++#endif ++}; ++#endif ++ + #endif /*_IPT_RECENT_H*/ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/netfilter_ipv6/ip6_tables.h debian/binary-custom.d/openvz/src/include/linux/netfilter_ipv6/ip6_tables.h +--- ./include/linux/netfilter_ipv6/ip6_tables.h 2012-06-12 16:25:24.098312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/netfilter_ipv6/ip6_tables.h 2012-11-13 15:20:15.164569075 +0000 +@@ -333,7 +333,7 @@ + #include + extern void ip6t_init(void) __init; + +-extern int ip6t_register_table(struct xt_table *table, ++extern struct xt_table *ip6t_register_table(struct xt_table *table, + const struct ip6t_replace *repl); + extern void ip6t_unregister_table(struct xt_table *table); + extern unsigned int ip6t_do_table(struct sk_buff *skb, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/netlink.h debian/binary-custom.d/openvz/src/include/linux/netlink.h +--- ./include/linux/netlink.h 2012-06-12 16:25:24.102312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/netlink.h 2012-11-13 15:20:15.164569075 +0000 +@@ -178,6 +178,7 @@ + void (*input)(struct sk_buff *skb), + struct mutex *cb_mutex, + struct module *module); ++extern void netlink_kernel_release(struct sock *sk); + extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); + extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); + extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/nfcalls.h debian/binary-custom.d/openvz/src/include/linux/nfcalls.h +--- ./include/linux/nfcalls.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/nfcalls.h 2012-11-13 15:20:15.164569075 +0000 +@@ -0,0 +1,188 @@ ++/* ++ * include/linux/nfcalls.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _LINUX_NFCALLS_H ++#define _LINUX_NFCALLS_H ++ ++#include ++ ++#ifdef CONFIG_MODULES ++extern struct module no_module; ++ ++#define DECL_KSYM_MODULE(name) \ ++ extern struct module *vz_mod_##name ++ ++#define INIT_KSYM_MODULE(name) \ ++ struct module *vz_mod_##name = &no_module; \ ++ EXPORT_SYMBOL(vz_mod_##name) ++ ++static inline void __vzksym_modresolve(struct module **modp, struct module *mod) ++{ ++ /* ++ * we want to be sure, that pointer updates are visible first: ++ * 1. wmb() is here only for piece of sure ++ * (note, no rmb() in KSYMSAFECALL) ++ * 2. synchronize_sched() guarantees that updates are visible ++ * on all cpus and allows us to remove rmb() in KSYMSAFECALL ++ */ ++ wmb(); synchronize_sched(); ++ *modp = mod; ++ /* just to be sure, our changes are visible as soon as possible */ ++ wmb(); synchronize_sched(); ++} ++ ++static inline void __vzksym_modunresolve(struct module **modp) ++{ ++ /* ++ * try_module_get() in KSYMSAFECALL should fail at this moment since ++ * THIS_MODULE in in unloading state (we should be called from fini), ++ * no need to syncronize pointers/ve_module updates. ++ */ ++ *modp = &no_module; ++ /* ++ * synchronize_sched() guarantees here that we see ++ * updated module pointer before the module really gets away ++ */ ++ synchronize_sched(); ++} ++ ++static inline int __vzksym_module_get(struct module *mod) ++{ ++ /* ++ * we want to avoid rmb(), so use synchronize_sched() in KSYMUNRESOLVE ++ * and smp_read_barrier_depends() here... ++ */ ++ smp_read_barrier_depends(); /* for module loading */ ++ if (!try_module_get(mod)) ++ return -EBUSY; ++ ++ return 0; ++} ++ ++static inline void __vzksym_module_put(struct module *mod) ++{ ++ module_put(mod); ++} ++#else ++#define DECL_KSYM_MODULE(name) ++#define INIT_KSYM_MODULE(name) ++#define __vzksym_modresolve(modp, mod) ++#define __vzksym_modunresolve(modp) ++#define __vzksym_module_get(mod) 0 ++#define __vzksym_module_put(mod) ++#endif ++ ++#define __KSYMERRCALL(err, type, mod, name, args) \ ++({ \ ++ type ret = (type)err; \ ++ if (!__vzksym_module_get(vz_mod_##mod)) { \ ++ if (vz_##name) \ ++ ret = ((*vz_##name)args); \ ++ __vzksym_module_put(vz_mod_##mod); \ ++ } \ ++ ret; \ ++}) ++ ++#define __KSYMSAFECALL_VOID(mod, name, args) \ ++ do { \ ++ if (!__vzksym_module_get(vz_mod_##mod)) { \ ++ if (vz_##name) \ ++ ((*vz_##name)args); \ ++ __vzksym_module_put(vz_mod_##mod); \ ++ } \ ++ } while (0) ++ ++#define DECL_KSYM_CALL(type, name, args) \ ++ extern type (*vz_##name) args ++#define INIT_KSYM_CALL(type, name, args) \ ++ type (*vz_##name) args; \ ++EXPORT_SYMBOL(vz_##name) ++ ++#define KSYMERRCALL(err, mod, name, args) \ ++ __KSYMERRCALL(err, int, mod, name, args) ++#define KSYMSAFECALL(type, mod, name, args) \ ++ __KSYMERRCALL(0, type, mod, name, args) ++#define KSYMSAFECALL_VOID(mod, name, args) \ ++ __KSYMSAFECALL_VOID(mod, name, args) ++#define KSYMREF(name) vz_##name ++ ++/* should be called _after_ KSYMRESOLVE's */ ++#define KSYMMODRESOLVE(name) \ ++ __vzksym_modresolve(&vz_mod_##name, THIS_MODULE) ++#define KSYMMODUNRESOLVE(name) \ ++ __vzksym_modunresolve(&vz_mod_##name) ++ ++#define KSYMRESOLVE(name) \ ++ vz_##name = &name ++#define KSYMUNRESOLVE(name) \ ++ vz_##name = NULL ++ ++#if defined(CONFIG_VE) ++DECL_KSYM_MODULE(ip_tables); ++DECL_KSYM_MODULE(ip6_tables); ++DECL_KSYM_MODULE(iptable_filter); ++DECL_KSYM_MODULE(ip6table_filter); ++DECL_KSYM_MODULE(iptable_mangle); ++DECL_KSYM_MODULE(ip6table_mangle); ++DECL_KSYM_MODULE(ip_conntrack); ++DECL_KSYM_MODULE(nf_conntrack); ++DECL_KSYM_MODULE(nf_conntrack_ipv4); ++DECL_KSYM_MODULE(nf_conntrack_ipv6); ++DECL_KSYM_MODULE(xt_conntrack); ++DECL_KSYM_MODULE(ip_nat); ++DECL_KSYM_MODULE(nf_nat); ++DECL_KSYM_MODULE(iptable_nat); ++ ++struct sk_buff; ++ ++DECL_KSYM_CALL(int, init_netfilter, (void)); ++DECL_KSYM_CALL(int, init_iptables, (void)); ++DECL_KSYM_CALL(int, init_ip6tables, (void)); ++DECL_KSYM_CALL(int, init_iptable_filter, (void)); ++DECL_KSYM_CALL(int, init_ip6table_filter, (void)); ++DECL_KSYM_CALL(int, init_iptable_mangle, (void)); ++DECL_KSYM_CALL(int, init_ip6table_mangle, (void)); ++DECL_KSYM_CALL(int, init_iptable_conntrack, (void)); ++DECL_KSYM_CALL(int, nf_conntrack_init_ve, (void)); ++DECL_KSYM_CALL(int, init_nf_ct_l3proto_ipv4, (void)); ++DECL_KSYM_CALL(int, init_nf_ct_l3proto_ipv6, (void)); ++DECL_KSYM_CALL(int, nf_nat_init, (void)); ++DECL_KSYM_CALL(int, init_iptable_nat, (void)); ++DECL_KSYM_CALL(int, init_nftable_nat, (void)); ++DECL_KSYM_CALL(int, nf_nat_init, (void)); ++DECL_KSYM_CALL(void, fini_iptable_nat, (void)); ++DECL_KSYM_CALL(void, fini_nftable_nat, (void)); ++DECL_KSYM_CALL(void, nf_nat_cleanup, (void)); ++DECL_KSYM_CALL(void, fini_iptable_conntrack, (void)); ++DECL_KSYM_CALL(void, nf_conntrack_cleanup_ve, (void)); ++DECL_KSYM_CALL(void, fini_nf_ct_l3proto_ipv4, (void)); ++DECL_KSYM_CALL(void, fini_nf_ct_l3proto_ipv6, (void)); ++DECL_KSYM_CALL(void, fini_iptable_filter, (void)); ++DECL_KSYM_CALL(void, fini_ip6table_filter, (void)); ++DECL_KSYM_CALL(void, fini_iptable_mangle, (void)); ++DECL_KSYM_CALL(void, fini_ip6table_mangle, (void)); ++DECL_KSYM_CALL(void, fini_iptables, (void)); ++DECL_KSYM_CALL(void, fini_ip6tables, (void)); ++DECL_KSYM_CALL(void, fini_netfilter, (void)); ++ ++#include ++#endif ++ ++#if defined(CONFIG_VE_ETHDEV) || defined(CONFIG_VE_ETHDEV_MODULE) ++DECL_KSYM_MODULE(vzethdev); ++DECL_KSYM_CALL(int, veth_open, (struct net_device *dev)); ++#endif ++ ++#if defined(CONFIG_VE_CALLS) || defined(CONFIG_VE_CALLS_MODULE) ++DECL_KSYM_MODULE(vzmon); ++DECL_KSYM_CALL(void, real_do_env_free, (struct ve_struct *env)); ++#endif ++ ++#endif /* _LINUX_NFCALLS_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/nfs_fs_sb.h debian/binary-custom.d/openvz/src/include/linux/nfs_fs_sb.h +--- ./include/linux/nfs_fs_sb.h 2012-06-12 16:25:24.102312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/nfs_fs_sb.h 2012-11-13 15:20:15.168569076 +0000 +@@ -65,6 +65,7 @@ + char cl_ipaddr[16]; + unsigned char cl_id_uniquifier; + #endif ++ struct ve_struct *owner_env; + }; + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/notifier.h debian/binary-custom.d/openvz/src/include/linux/notifier.h +--- ./include/linux/notifier.h 2012-06-12 16:25:24.106312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/notifier.h 2012-11-13 15:20:15.172569076 +0000 +@@ -149,8 +149,9 @@ + + #define NOTIFY_DONE 0x0000 /* Don't care */ + #define NOTIFY_OK 0x0001 /* Suits me */ ++#define NOTIFY_FAIL 0x0002 /* Reject */ + #define NOTIFY_STOP_MASK 0x8000 /* Don't call further */ +-#define NOTIFY_BAD (NOTIFY_STOP_MASK|0x0002) ++#define NOTIFY_BAD (NOTIFY_STOP_MASK|NOTIFY_FAIL) + /* Bad/Veto action */ + /* + * Clean way to return from the notifier and stop further calls. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/nsproxy.h debian/binary-custom.d/openvz/src/include/linux/nsproxy.h +--- ./include/linux/nsproxy.h 2012-06-12 16:25:24.106312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/nsproxy.h 2012-11-13 15:20:15.172569076 +0000 +@@ -66,6 +66,7 @@ + void exit_task_namespaces(struct task_struct *tsk); + void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new); + void free_nsproxy(struct nsproxy *ns); ++struct mnt_namespace * get_task_mnt_ns(struct task_struct *tsk); + int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, + struct fs_struct *); + +@@ -76,9 +77,10 @@ + } + } + +-static inline void get_nsproxy(struct nsproxy *ns) ++static inline struct nsproxy *get_nsproxy(struct nsproxy *ns) + { + atomic_inc(&ns->count); ++ return ns; + } + + #ifdef CONFIG_CGROUP_NS +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/page-flags.h debian/binary-custom.d/openvz/src/include/linux/page-flags.h +--- ./include/linux/page-flags.h 2012-06-12 16:25:24.106312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/page-flags.h 2012-11-13 15:20:15.176569074 +0000 +@@ -93,6 +93,8 @@ + /* PG_readahead is only used for file reads; PG_reclaim is only for writes */ + #define PG_readahead PG_reclaim /* Reminder to do async read-ahead */ + ++#define PG_checkpointed 21 /* Page transferred */ ++ + /* PG_owner_priv_1 users should have descriptive aliases */ + #define PG_checked PG_owner_priv_1 /* Used by some filesystems */ + #define PG_pinned PG_owner_priv_1 /* Xen pinned pagetable */ +@@ -260,6 +262,8 @@ + #define SetPageUncached(page) set_bit(PG_uncached, &(page)->flags) + #define ClearPageUncached(page) clear_bit(PG_uncached, &(page)->flags) + ++#define ClearPageCheckpointed(page) clear_bit(PG_checkpointed, &(page)->flags) ++ + struct page; /* forward declaration */ + + extern void cancel_dirty_page(struct page *page, unsigned int account_size); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/percpu.h debian/binary-custom.d/openvz/src/include/linux/percpu.h +--- ./include/linux/percpu.h 2012-06-12 16:25:24.110312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/percpu.h 2012-11-13 15:20:15.184569071 +0000 +@@ -49,6 +49,22 @@ + (__typeof__(ptr))__p->ptrs[(cpu)]; \ + }) + ++struct percpu_data_static { ++ void *ptrs[NR_CPUS]; ++}; ++ ++#define DEFINE_PER_CPU_STATIC(type, name) \ ++ static struct percpu_data_static per_cpu_data__##name; \ ++ static __typeof__(type) per_cpu__##name[NR_CPUS] ++ ++#define percpu_static_init(name) ({ \ ++ int i; \ ++ for (i = 0; i < NR_CPUS; i++) \ ++ (per_cpu_data__##name).ptrs[i] = &(per_cpu__##name)[i];\ ++ (__typeof__(&(per_cpu__##name)[0])) \ ++ __percpu_disguise(&(per_cpu_data__##name));\ ++ }) ++ + extern void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu); + extern void percpu_depopulate(void *__pdata, int cpu); + extern int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, +@@ -61,6 +77,11 @@ + + #define percpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) + ++#define DEFINE_PER_CPU_STATIC(type, name) \ ++ static __typeof__(type) per_cpu__##name[NR_CPUS] ++ ++#define percpu_static_init(name) (&(per_cpu__##name)[0]) ++ + static inline void percpu_depopulate(void *__pdata, int cpu) + { + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/pid.h debian/binary-custom.d/openvz/src/include/linux/pid.h +--- ./include/linux/pid.h 2012-06-12 16:25:24.114312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/pid.h 2012-11-13 15:20:15.188569072 +0000 +@@ -59,6 +59,9 @@ + atomic_t count; + /* lists of tasks that use this pid */ + struct hlist_head tasks[PIDTYPE_MAX]; ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *ub; ++#endif + struct rcu_head rcu; + int level; + struct upid numbers[1]; +@@ -119,9 +122,12 @@ + extern struct pid *find_get_pid(int nr); + extern struct pid *find_ge_pid(int nr, struct pid_namespace *); + +-extern struct pid *alloc_pid(struct pid_namespace *ns); ++extern struct pid *alloc_pid(struct pid_namespace *ns, pid_t vpid); + extern void FASTCALL(free_pid(struct pid *pid)); ++extern int pid_ns_attach_init(struct pid_namespace *, struct task_struct *); ++extern int pid_ns_attach_task(struct pid_namespace *, struct task_struct *); + extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); ++pid_t pid_to_vpid(pid_t nr); + + /* + * the helpers to get the pid's id seen from different namespaces +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/pid_namespace.h debian/binary-custom.d/openvz/src/include/linux/pid_namespace.h +--- ./include/linux/pid_namespace.h 2012-06-12 16:25:24.114312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/pid_namespace.h 2012-11-13 15:20:15.188569072 +0000 +@@ -14,6 +14,14 @@ + + #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) + ++/* pid namespace flags */ ++ ++/* if set newly created pid ns got PID_NS_HIDE_CHILD flag */ ++#define PID_NS_HIDE_CHILD 0x00000001 ++ ++/* if set newly created processes invisible from parent ns*/ ++#define PID_NS_HIDDEN 0x00000002 ++ + struct pid_namespace { + struct kref kref; + struct pidmap pidmap[PIDMAP_ENTRIES]; +@@ -22,6 +30,7 @@ + struct kmem_cache *pid_cachep; + int level; + struct pid_namespace *parent; ++ unsigned flags; + #ifdef CONFIG_PROC_FS + struct vfsmount *proc_mnt; + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/poll.h debian/binary-custom.d/openvz/src/include/linux/poll.h +--- ./include/linux/poll.h 2012-06-12 16:25:24.114312493 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/poll.h 2012-11-13 15:20:15.188569072 +0000 +@@ -117,6 +117,7 @@ + extern int do_select(int n, fd_set_bits *fds, s64 *timeout); + extern int do_sys_poll(struct pollfd __user * ufds, unsigned int nfds, + s64 *timeout); ++long do_restart_poll(struct restart_block *restart_block); + + #endif /* KERNEL */ + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/proc_fs.h debian/binary-custom.d/openvz/src/include/linux/proc_fs.h +--- ./include/linux/proc_fs.h 2012-06-12 16:25:24.118312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/proc_fs.h 2012-11-13 15:20:15.192569074 +0000 +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + #include + + struct net; +@@ -100,6 +101,8 @@ + + extern struct proc_dir_entry proc_root; + extern struct proc_dir_entry *proc_root_fs; ++extern struct file_system_type proc_fs_type; ++ + extern struct proc_dir_entry *proc_bus; + extern struct proc_dir_entry *proc_root_driver; + extern struct proc_dir_entry *proc_root_kcore; +@@ -124,7 +127,17 @@ + + extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, + struct proc_dir_entry *parent); ++extern struct proc_dir_entry *create_proc_glob_entry(const char *name, ++ mode_t mode, ++ struct proc_dir_entry *parent); + extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); ++extern void remove_proc_glob_entry(const char *name, struct proc_dir_entry *parent); ++ ++#ifdef CONFIG_VE ++#define proc_mnt(ve) (ve->proc_mnt) ++#else ++#define proc_mnt(ve) (proc_mnt) ++#endif + + extern struct vfsmount *proc_mnt; + struct pid_namespace; +@@ -202,12 +215,22 @@ + const char *name, mode_t mode, const struct file_operations *fops); + extern void proc_net_remove(struct net *net, const char *name); + ++static inline struct proc_dir_entry *proc_glob_fops_create(const char *name, ++ mode_t mode, const struct file_operations *fops) ++{ ++ struct proc_dir_entry *res = create_proc_glob_entry(name, mode, NULL); ++ if (res) ++ res->proc_fops = fops; ++ return res; ++} ++ + #else + + #define proc_root_driver NULL + #define proc_bus NULL + + #define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; }) ++#define proc_glob_fops_create(name, mode, fops) ({ (void)(mode), NULL; }) + static inline void proc_net_remove(struct net *net, const char *name) {} + + static inline void proc_flush_task(struct task_struct *task) +@@ -216,6 +239,8 @@ + + static inline struct proc_dir_entry *create_proc_entry(const char *name, + mode_t mode, struct proc_dir_entry *parent) { return NULL; } ++static inline struct proc_dir_entry *create_proc_glob_entry(const char *name, ++ mode_t mode, struct proc_dir_entry *parent) { return NULL; } + + #define remove_proc_entry(name, parent) do {} while (0) + +@@ -248,6 +273,48 @@ + + #endif /* CONFIG_PROC_FS */ + ++static inline struct proc_dir_entry *create_proc_entry_mod(const char *name, ++ mode_t mode, ++ struct proc_dir_entry *parent, ++ struct module *owner) ++{ ++ struct proc_dir_entry *ent; ++ ++ /* ++ * lock_kernel() here protects against proc_lookup() ++ * which can find this freshly created entry w/o owner being set. ++ * this can lead to module being put more times then getted. ++ */ ++ lock_kernel(); ++ ent = create_proc_entry(name, mode, parent); ++ if (ent) ++ ent->owner = owner; ++ unlock_kernel(); ++ ++ return ent; ++} ++ ++static inline struct proc_dir_entry *create_proc_glob_entry_mod(const char *name, ++ mode_t mode, ++ struct proc_dir_entry *parent, ++ struct module *owner) ++{ ++ struct proc_dir_entry *ent; ++ ++ /* ++ * lock_kernel() here protects against proc_lookup() ++ * which can find this freshly created entry w/o owner being set. ++ * this can lead to module being put more times then getted. ++ */ ++ lock_kernel(); ++ ent = create_proc_glob_entry(name, mode, parent); ++ if (ent) ++ ent->owner = owner; ++ unlock_kernel(); ++ ++ return ent; ++} ++ + #if !defined(CONFIG_PROC_KCORE) + static inline void kclist_add(struct kcore_list *new, void *addr, size_t size) + { +@@ -294,4 +361,11 @@ + #endif + }; + ++#define LPDE(inode) (PROC_I((inode))->pde) ++#ifdef CONFIG_VE ++#define GPDE(inode) (*(struct proc_dir_entry **)(&(inode)->i_pipe)) ++#endif ++ ++int proc_match(int len, const char *name, struct proc_dir_entry *de); ++ + #endif /* _LINUX_PROC_FS_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/quota.h debian/binary-custom.d/openvz/src/include/linux/quota.h +--- ./include/linux/quota.h 2012-06-12 16:25:24.118312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/quota.h 2012-11-13 15:20:15.192569074 +0000 +@@ -164,6 +164,10 @@ + #include + #include + ++#include ++ ++extern spinlock_t dq_data_lock; ++ + #include + #include + #include +@@ -274,6 +278,8 @@ + int (*release_dqblk)(struct dquot *dquot); /* Called when last reference to dquot is being dropped */ + }; + ++struct inode; ++struct iattr; + /* Operations working with dquots */ + struct dquot_operations { + int (*initialize) (struct inode *, int); +@@ -288,9 +294,11 @@ + int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ + int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ + int (*write_info) (struct super_block *, int); /* Write of quota "superblock" */ ++ int (*rename) (struct inode *, struct inode *, struct inode *); + }; + + /* Operations handling requests from userspace */ ++struct v2_disk_dqblk; + struct quotactl_ops { + int (*quota_on)(struct super_block *, int, int, char *); + int (*quota_off)(struct super_block *, int); +@@ -303,6 +311,10 @@ + int (*set_xstate)(struct super_block *, unsigned int, int); + int (*get_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *); + int (*set_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *); ++#ifdef CONFIG_QUOTA_COMPAT ++ int (*get_quoti)(struct super_block *, int, unsigned int, ++ struct v2_disk_dqblk __user *); ++#endif + }; + + struct quota_format_type { +@@ -323,6 +335,10 @@ + struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ + struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ + struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ ++#if defined(CONFIG_VZ_QUOTA) || defined(CONFIG_VZ_QUOTA_MODULE) ++ struct vz_quota_master *vzdq_master; ++ int vzdq_count; ++#endif + }; + + /* Inline would be better but we need to dereference super_block which is not defined yet */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/quotaops.h debian/binary-custom.d/openvz/src/include/linux/quotaops.h +--- ./include/linux/quotaops.h 2012-06-12 16:25:24.118312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/quotaops.h 2012-11-13 15:20:15.192569074 +0000 +@@ -170,6 +170,19 @@ + return 0; + } + ++static __inline__ int DQUOT_RENAME(struct inode *inode, ++ struct inode *old_dir, struct inode *new_dir) ++{ ++ struct dquot_operations *q_op; ++ ++ q_op = inode->i_sb->dq_op; ++ if (q_op && q_op->rename) { ++ if (q_op->rename(inode, old_dir, new_dir) == NO_QUOTA) ++ return 1; ++ } ++ return 0; ++} ++ + /* The following two functions cannot be called inside a transaction */ + #define DQUOT_SYNC(sb) sync_dquots(sb, -1) + +@@ -196,6 +209,7 @@ + #define DQUOT_SYNC(sb) do { } while(0) + #define DQUOT_OFF(sb) do { } while(0) + #define DQUOT_TRANSFER(inode, iattr) (0) ++#define DQUOT_RENAME(inode, old_dir, new_dir) (0) + static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) + { + inode_add_bytes(inode, nr); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/rmap.h debian/binary-custom.d/openvz/src/include/linux/rmap.h +--- ./include/linux/rmap.h 2012-06-12 16:25:24.126312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/rmap.h 2012-11-13 15:20:15.200569075 +0000 +@@ -73,6 +73,8 @@ + void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); + void page_add_file_rmap(struct page *); + void page_remove_rmap(struct page *, struct vm_area_struct *); ++struct anon_vma *page_lock_anon_vma(struct page *page); ++void page_unlock_anon_vma(struct anon_vma *anon_vma); + + #ifdef CONFIG_DEBUG_VM + void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/rtnetlink.h debian/binary-custom.d/openvz/src/include/linux/rtnetlink.h +--- ./include/linux/rtnetlink.h 2012-06-12 16:25:24.126312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/rtnetlink.h 2012-11-13 15:20:15.200569075 +0000 +@@ -613,11 +613,11 @@ + ({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \ + __rtattr_parse_nested_compat(tb, max, rta, len); }) + +-extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); +-extern int rtnl_unicast(struct sk_buff *skb, u32 pid); +-extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, ++extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); ++extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); ++extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, + struct nlmsghdr *nlh, gfp_t flags); +-extern void rtnl_set_sk_err(u32 group, int error); ++extern void rtnl_set_sk_err(struct net *net, u32 group, int error); + extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); + extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, + u32 id, u32 ts, u32 tsage, long expires, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/sched.h debian/binary-custom.d/openvz/src/include/linux/sched.h +--- ./include/linux/sched.h 2012-06-12 16:25:24.126312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/sched.h 2012-11-13 15:20:15.204569073 +0000 +@@ -28,6 +28,9 @@ + #define CLONE_NEWPID 0x20000000 /* New pid namespace */ + #define CLONE_NEWNET 0x40000000 /* New network namespace */ + ++/* mask of clones which are disabled in OpenVZ VEs */ ++#define CLONE_NAMESPACES_MASK (CLONE_NEWUTS | CLONE_NEWIPC | CLONE_NEWUSER | CLONE_NEWPID | CLONE_NEWNET) ++ + /* + * Scheduling policies + */ +@@ -92,6 +95,8 @@ + + #include + ++#include ++ + struct exec_domain; + struct futex_pi_state; + struct bio; +@@ -126,15 +131,38 @@ + load += n*(FIXED_1-exp); \ + load >>= FSHIFT; + ++#define LOAD_INT(x) ((x) >> FSHIFT) ++#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100) ++ + extern unsigned long total_forks; + extern int nr_threads; + DECLARE_PER_CPU(unsigned long, process_counts); + extern int nr_processes(void); + extern unsigned long nr_running(void); ++extern unsigned long nr_sleeping(void); ++extern unsigned long nr_stopped(void); + extern unsigned long nr_uninterruptible(void); + extern unsigned long nr_active(void); + extern unsigned long nr_iowait(void); + extern unsigned long weighted_cpuload(const int cpu); ++extern atomic_t nr_dead; ++extern unsigned long nr_zombie; ++ ++#ifdef CONFIG_VE ++struct ve_struct; ++extern unsigned long nr_running_ve(struct ve_struct *); ++extern unsigned long nr_iowait_ve(struct ve_struct *); ++extern unsigned long nr_uninterruptible_ve(struct ve_struct *); ++extern cycles_t ve_sched_get_idle_time(struct ve_struct *ve, int cpu); ++extern cycles_t ve_sched_get_iowait_time(struct ve_struct *ve, int cpu); ++void ve_sched_attach(struct ve_struct *envid); ++#else ++#define nr_running_ve(ve) 0 ++#define nr_iowait_ve(ve) 0 ++#define nr_uninterruptible_ve(ve) 0 ++#define ve_sched_get_idle_time(ve, cpu) 0 ++#define ve_sched_get_iowait_time(ve, cpu) 0 ++#endif + + struct seq_file; + struct cfs_rq; +@@ -242,6 +270,7 @@ + } + + extern void show_regs(struct pt_regs *); ++extern void smp_show_regs(struct pt_regs *, void *); + + /* + * TASK is a pointer to the task whose backtrace we want to see (or NULL for current +@@ -389,6 +418,9 @@ + unsigned long ac_minflt, ac_majflt; + }; + ++#include ++#include ++ + /* + * NOTE! "signal_struct" does not have it's own + * locking, because a shared signal_struct always +@@ -985,6 +1017,7 @@ + /* ??? */ + unsigned int personality; + unsigned did_exec:1; ++ unsigned did_ve_enter:1; + pid_t pid; + pid_t tgid; + +@@ -1173,6 +1206,14 @@ + struct rcu_head rcu; + + /* ++ * state tracking for suspend ++ * FIXME - ptrace is completely rewritten in this kernel ++ * so set_pn_state() is not set in many places correctyl ++ */ ++ __u8 pn_state; ++ __u8 stopped_state:1; ++ ++ /* + * cache last used pipe for splice + */ + struct pipe_inode_info *splice_pipe; +@@ -1188,6 +1229,19 @@ + struct latency_record latency_record[LT_SAVECOUNT]; + #endif + struct list_head *scm_work_list; ++#ifdef CONFIG_BEANCOUNTERS ++ struct task_beancounter task_bc; ++#endif ++#ifdef CONFIG_VE ++ struct ve_task_info ve_task_info; ++#endif ++#if defined(CONFIG_VZ_QUOTA) || defined(CONFIG_VZ_QUOTA_MODULE) ++ unsigned long magic; ++ struct inode *ino; ++#endif ++#ifdef CONFIG_VZ_FAIRSCHED ++ struct fairsched_node *fsched_node; ++#endif + }; + + /* +@@ -1363,6 +1417,43 @@ + __put_task_struct(t); + } + ++#ifndef CONFIG_VE ++#define set_pn_state(tsk, state) do { } while(0) ++#define clear_pn_state(tsk) do { } while(0) ++#define set_stop_state(tsk) do { } while(0) ++#define clear_stop_state(tsk) do { } while(0) ++#else ++#define PN_STOP_TF 1 /* was not in 2.6.8 */ ++#define PN_STOP_TF_RT 2 /* was not in 2.6.8 */ ++#define PN_STOP_ENTRY 3 ++#define PN_STOP_FORK 4 ++#define PN_STOP_VFORK 5 ++#define PN_STOP_SIGNAL 6 ++#define PN_STOP_EXIT 7 ++#define PN_STOP_EXEC 8 ++#define PN_STOP_LEAVE 9 ++ ++static inline void set_pn_state(struct task_struct *tsk, int state) ++{ ++ tsk->pn_state = state; ++} ++ ++static inline void clear_pn_state(struct task_struct *tsk) ++{ ++ tsk->pn_state = 0; ++} ++ ++static inline void set_stop_state(struct task_struct *tsk) ++{ ++ tsk->stopped_state = 1; ++} ++ ++static inline void clear_stop_state(struct task_struct *tsk) ++{ ++ tsk->stopped_state = 0; ++} ++#endif ++ + /* + * Per process flags + */ +@@ -1379,6 +1470,7 @@ + #define PF_MEMALLOC 0x00000800 /* Allocating memory */ + #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ + #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ ++#define PF_EXIT_RESTART 0x00004000 /* do_exit() restarted, see do_exit() */ + #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ + #define PF_FROZEN 0x00010000 /* frozen for system suspend */ + #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ +@@ -1441,6 +1533,21 @@ + extern unsigned long long + task_sched_runtime(struct task_struct *task); + ++static inline unsigned long cycles_to_clocks(cycles_t cycles) ++{ ++ extern unsigned long cycles_per_clock; ++ do_div(cycles, cycles_per_clock); ++ return cycles; ++} ++ ++static inline u64 cycles_to_jiffies(cycles_t cycles) ++{ ++ extern unsigned long cycles_per_jiffy; ++ do_div(cycles, cycles_per_jiffy); ++ return cycles; ++} ++ ++ + /* sched_exec is called by processes performing an exec */ + #ifdef CONFIG_SMP + extern void sched_exec(void); +@@ -1558,8 +1665,6 @@ + extern struct task_struct *find_task_by_pid_ns(pid_t nr, + struct pid_namespace *ns); + +-extern void __set_special_pids(pid_t session, pid_t pgrp); +- + /* per-UID process charging. */ + extern struct user_struct * alloc_uid(struct user_namespace *, uid_t); + static inline struct user_struct *get_uid(struct user_struct *u) +@@ -1570,6 +1675,9 @@ + extern void free_uid(struct user_struct *); + extern void switch_uid(struct user_struct *); + extern void release_uids(struct user_namespace *ns); ++extern int set_user(uid_t uid, int dumpclear); ++extern void set_special_pids(struct pid *pid); ++extern void __set_special_pids(struct pid *pid); + + #include + +@@ -1701,6 +1809,13 @@ + + extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); + extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); ++extern long do_fork_pid(unsigned long clone_flags, ++ unsigned long stack_start, ++ struct pt_regs *regs, ++ unsigned long stack_size, ++ int __user *parent_tidptr, ++ int __user *child_tidptr, ++ long pid0); + struct task_struct *fork_idle(int); + + extern void set_task_comm(struct task_struct *tsk, char *from); +@@ -1715,19 +1830,19 @@ + #define remove_parent(p) list_del_init(&(p)->sibling) + #define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children) + +-#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) ++#define next_task_all(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) + +-#define for_each_process(p) \ +- for (p = &init_task ; (p = next_task(p)) != &init_task ; ) ++#define for_each_process_all(p) \ ++ for (p = &init_task ; (p = next_task_all(p)) != &init_task ; ) + + /* + * Careful: do_each_thread/while_each_thread is a double loop so + * 'break' will not work as expected - use goto instead. + */ +-#define do_each_thread(g, t) \ +- for (g = t = &init_task ; (g = t = next_task(g)) != &init_task ; ) do ++#define do_each_thread_all(g, t) \ ++ for (g = t = &init_task ; (g = t = next_task_all(g)) != &init_task ; ) do + +-#define while_each_thread(g, t) \ ++#define while_each_thread_all(g, t) \ + while ((t = next_thread(t)) != g) + + /* de_thread depends on thread_group_leader not being a pid based check */ +@@ -1752,8 +1867,15 @@ + + static inline struct task_struct *next_thread(const struct task_struct *p) + { +- return list_entry(rcu_dereference(p->thread_group.next), ++ struct task_struct *tsk; ++ ++ tsk = list_entry(rcu_dereference(p->thread_group.next), + struct task_struct, thread_group); ++#ifdef CONFIG_VE ++ /* all threads should belong to ONE ve! */ ++ BUG_ON(VE_TASK_INFO(tsk)->owner_env != VE_TASK_INFO(p)->owner_env); ++#endif ++ return tsk; + } + + static inline int thread_group_empty(struct task_struct *p) +@@ -1793,6 +1915,98 @@ + spin_unlock_irqrestore(&tsk->sighand->siglock, *flags); + } + ++#ifndef CONFIG_VE ++ ++#define for_each_process_ve(p) for_each_process_all(p) ++#define do_each_thread_ve(g, t) do_each_thread_all(g, t) ++#define while_each_thread_ve(g, t) while_each_thread_all(g, t) ++#define first_task_ve() next_task_ve(&init_task) ++#define __first_task_ve(owner) next_task_ve(&init_task) ++#define __next_task_ve(owner, p) next_task_ve(p) ++#define next_task_ve(p) \ ++ (next_task_all(p) != &init_task ? next_task_all(p) : NULL) ++ ++#define ve_is_super(env) 1 ++#define ve_accessible(target, owner) 1 ++#define ve_accessible_strict(target, owner) 1 ++#define ve_accessible_veid(target, owner) 1 ++#define ve_accessible_strict_veid(target, owner) 1 ++ ++#define VEID(ve) 0 ++ ++#else /* CONFIG_VE */ ++ ++#include ++ ++#define ve_is_super(env) ((env) == get_ve0()) ++ ++#define ve_accessible_strict(target, owner) ((target) == (owner)) ++static inline int ve_accessible(struct ve_struct *target, ++ struct ve_struct *owner) ++{ ++ return ve_is_super(owner) || ve_accessible_strict(target, owner); ++} ++ ++#define ve_accessible_strict_veid(target, owner) ((target) == (owner)) ++static inline int ve_accessible_veid(envid_t target, envid_t owner) ++{ ++ return get_ve0()->veid == owner || ++ ve_accessible_strict_veid(target, owner); ++} ++ ++#define VEID(ve) (ve->veid) ++ ++static inline struct task_struct *ve_lh2task(struct ve_struct *ve, ++ struct list_head *lh) ++{ ++ return lh == &ve->vetask_lh ? NULL : ++ list_entry(lh, struct task_struct, ve_task_info.vetask_list); ++} ++ ++static inline struct task_struct *__first_task_ve(struct ve_struct *ve) ++{ ++ struct task_struct *tsk; ++ ++ if (unlikely(ve_is_super(ve))) { ++ tsk = next_task_all(&init_task); ++ if (tsk == &init_task) ++ tsk = NULL; ++ } else { ++ tsk = ve_lh2task(ve, rcu_dereference(ve->vetask_lh.next)); ++ } ++ return tsk; ++} ++ ++static inline struct task_struct *__next_task_ve(struct ve_struct *ve, ++ struct task_struct *tsk) ++{ ++ if (unlikely(ve_is_super(ve))) { ++ tsk = next_task_all(tsk); ++ if (tsk == &init_task) ++ tsk = NULL; ++ } else { ++ BUG_ON(tsk->ve_task_info.owner_env != ve); ++ tsk = ve_lh2task(ve, rcu_dereference(tsk-> ++ ve_task_info.vetask_list.next)); ++ } ++ return tsk; ++} ++ ++#define first_task_ve() __first_task_ve(get_exec_env()) ++#define next_task_ve(p) __next_task_ve(get_exec_env(), p) ++/* no one uses prev_task_ve(), copy next_task_ve() if needed */ ++ ++#define for_each_process_ve(p) \ ++ for (p = first_task_ve(); p != NULL ; p = next_task_ve(p)) ++ ++#define do_each_thread_ve(g, t) \ ++ for (g = t = first_task_ve() ; g != NULL; g = t = next_task_ve(g)) do ++ ++#define while_each_thread_ve(g, t) \ ++ while ((t = next_thread(t)) != g) ++ ++#endif /* CONFIG_VE */ ++ + #ifndef __HAVE_THREAD_FUNCTIONS + + #define task_thread_info(task) ((struct thread_info *)(task)->stack) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/security.h debian/binary-custom.d/openvz/src/include/linux/security.h +--- ./include/linux/security.h 2012-06-12 16:25:24.130312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/security.h 2012-11-13 15:20:15.204569073 +0000 +@@ -35,11 +35,6 @@ + #include + #include + +-/* +- * Bounding set +- */ +-extern kernel_cap_t cap_bset; +- + extern unsigned securebits; + + struct ctl_table; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/sem.h debian/binary-custom.d/openvz/src/include/linux/sem.h +--- ./include/linux/sem.h 2012-06-12 16:25:24.130312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/sem.h 2012-11-13 15:20:15.208569071 +0000 +@@ -154,6 +154,9 @@ + } + #endif + ++int sysvipc_walk_sem(int (*func)(int, struct sem_array*, void *), void *arg); ++int sysvipc_setup_sem(key_t key, int semid, size_t size, int semflg); ++ + #endif /* __KERNEL__ */ + + #endif /* _LINUX_SEM_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/shm.h debian/binary-custom.d/openvz/src/include/linux/shm.h +--- ./include/linux/shm.h 2012-06-12 16:25:24.130312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/shm.h 2012-11-13 15:20:15.208569071 +0000 +@@ -75,6 +75,15 @@ + }; + + #ifdef __KERNEL__ ++struct shm_file_data { ++ int id; ++ struct ipc_namespace *ns; ++ struct file *file; ++ const struct vm_operations_struct *vm_ops; ++}; ++#define shm_file_data(file) (*((struct shm_file_data **)&(file)->private_data)) ++#define shm_ids(ns) (*((ns)->ids[IPC_SHM_IDS])) ++ + struct shmid_kernel /* private to the kernel */ + { + struct kern_ipc_perm shm_perm; +@@ -89,6 +98,20 @@ + struct user_struct *mlock_user; + }; + ++/* ++ * shm_lock_(check_) routines are called in the paths where the rw_mutex ++ * is not held. ++ */ ++static inline struct shmid_kernel *shm_lock(struct ipc_namespace *ns, int id) ++{ ++ struct kern_ipc_perm *ipcp = ipc_lock(&shm_ids(ns), id); ++ ++ return container_of(ipcp, struct shmid_kernel, shm_perm); ++} ++ ++#define shm_unlock(shp) \ ++ ipc_unlock(&(shp)->shm_perm) ++ + /* shm_mode upper byte flags */ + #define SHM_DEST 01000 /* segment will be destroyed on last detach */ + #define SHM_LOCKED 02000 /* segment will not be swapped */ +@@ -110,6 +133,11 @@ + } + #endif + ++int sysvipc_walk_shm(int (*func)(struct shmid_kernel*, void *), void *arg); ++struct file * sysvipc_setup_shm(key_t key, int shmid, size_t size, int shmflg); ++extern const struct file_operations shmem_file_operations; ++extern const struct file_operations shm_file_operations; ++ + #endif /* __KERNEL__ */ + + #endif /* _LINUX_SHM_H_ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/shmem_fs.h debian/binary-custom.d/openvz/src/include/linux/shmem_fs.h +--- ./include/linux/shmem_fs.h 2012-06-12 16:25:24.130312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/shmem_fs.h 2012-11-13 15:20:15.208569071 +0000 +@@ -23,6 +23,9 @@ + struct posix_acl *i_acl; + struct posix_acl *i_default_acl; + #endif ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *shmi_ub; ++#endif + }; + + struct shmem_sb_info { +@@ -60,4 +63,6 @@ + } + #endif /* CONFIG_TMPFS_POSIX_ACL */ + ++extern struct file_system_type tmpfs_fs_type; ++ + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/signal.h debian/binary-custom.d/openvz/src/include/linux/signal.h +--- ./include/linux/signal.h 2012-06-12 16:25:24.130312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/signal.h 2012-11-13 15:20:15.208569071 +0000 +@@ -6,6 +6,8 @@ + + #ifdef __KERNEL__ + #include ++#include ++#include + + /* + * Real Time signals may be queued. +@@ -16,6 +18,9 @@ + int flags; + siginfo_t info; + struct user_struct *user; ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *sig_ub; ++#endif + }; + + /* flags values. */ +@@ -371,6 +376,8 @@ + (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \ + (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL) + ++extern struct kmem_cache *sigqueue_cachep; ++ + #endif /* __KERNEL__ */ + + #endif /* _LINUX_SIGNAL_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/skbuff.h debian/binary-custom.d/openvz/src/include/linux/skbuff.h +--- ./include/linux/skbuff.h 2012-06-12 16:25:24.130312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/skbuff.h 2012-11-13 15:20:15.208569071 +0000 +@@ -247,6 +247,8 @@ + * @secmark: security marking + */ + ++#include ++ + struct sk_buff { + /* These two members must be first. */ + struct sk_buff *next; +@@ -289,7 +291,13 @@ + ipvs_property:1, + nf_trace:1; + __be16 protocol; +- ++#if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE) ++ __u8 brmark; ++#endif ++#ifdef CONFIG_VE ++ unsigned int accounted:1; ++ unsigned int redirected:1; ++#endif + void (*destructor)(struct sk_buff *skb); + #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) + struct nf_conntrack *nfct; +@@ -330,6 +338,8 @@ + *data; + unsigned int truesize; + atomic_t users; ++ struct skb_beancounter skb_bc; ++ struct ve_struct *owner_env; + }; + + #ifdef __KERNEL__ +@@ -337,6 +347,7 @@ + * Handling routines are only of interest to the kernel + */ + #include ++#include + + #include + +@@ -1258,6 +1269,8 @@ + */ + static inline void skb_orphan(struct sk_buff *skb) + { ++ ub_skb_uncharge(skb); ++ + if (skb->destructor) + skb->destructor(skb); + skb->destructor = NULL; +@@ -1764,6 +1777,26 @@ + { } + #endif + ++#if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE) ++static inline void skb_copy_brmark(struct sk_buff *to, const struct sk_buff *from) ++{ ++ to->brmark = from->brmark; ++} ++ ++static inline void skb_init_brmark(struct sk_buff *skb) ++{ ++ skb->brmark = 0; ++} ++#else ++static inline void skb_copy_brmark(struct sk_buff *to, const struct sk_buff *from) ++{ ++} ++ ++static inline void skb_init_brmark(struct sk_buff *skb) ++{ ++} ++#endif ++ + static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping) + { + #ifdef CONFIG_NETDEVICES_MULTIQUEUE +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/slab.h debian/binary-custom.d/openvz/src/include/linux/slab.h +--- ./include/linux/slab.h 2012-06-12 16:25:24.134312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/slab.h 2012-11-13 15:20:15.208569071 +0000 +@@ -46,6 +46,26 @@ + (unsigned long)ZERO_SIZE_PTR) + + /* ++ * allocation rules: __GFP_UBC 0 ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ * cache (SLAB_UBC) charge charge ++ * (usual caches: mm, vma, task_struct, ...) ++ * ++ * cache (SLAB_UBC | SLAB_NO_CHARGE) charge --- ++ * (ub_kmalloc) (kmalloc) ++ * ++ * cache (no UB flags) BUG() --- ++ * (nonub caches, mempools) ++ * ++ * pages charge --- ++ * (ub_vmalloc, (vmalloc, ++ * poll, fdsets, ...) non-ub allocs) ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ */ ++#define SLAB_UBC 0x10000000UL /* alloc space for ubs ... */ ++#define SLAB_NO_CHARGE 0x20000000UL /* ... but don't charge */ ++ ++/* + * struct kmem_cache related prototypes + */ + void __init kmem_cache_init(void); +@@ -60,7 +80,20 @@ + unsigned int kmem_cache_size(struct kmem_cache *); + const char *kmem_cache_name(struct kmem_cache *); + int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); ++extern void show_slab_info(void); ++int kmem_cache_objuse(struct kmem_cache *cachep); ++int kmem_obj_objuse(void *obj); ++int kmem_dname_objuse(void *obj); ++unsigned long ub_cache_growth(struct kmem_cache *cachep); + ++#ifdef CONFIG_BEANCOUNTERS ++void kmem_mark_nocharge(struct kmem_cache *cachep); ++struct user_beancounter **ub_slab_ptr(struct kmem_cache *cachep, void *obj); ++struct user_beancounter *slab_ub(void *obj); ++#else ++static inline void kmem_mark_nocharge(struct kmem_cache *cachep) { } ++static inline struct user_beancounter *slab_ub(void *obj) { return NULL; } ++#endif + /* + * Please use this macro to create slab caches. Simply specify the + * name of the structure and maybe some flags that are listed above. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/slab_def.h debian/binary-custom.d/openvz/src/include/linux/slab_def.h +--- ./include/linux/slab_def.h 2012-06-12 16:25:24.134312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/slab_def.h 2012-11-13 15:20:15.208569071 +0000 +@@ -15,6 +15,111 @@ + #include /* kmalloc_sizes.h needs L1_CACHE_BYTES */ + #include + ++/* ++ * DEBUG - 1 for kmem_cache_create() to honour; SLAB_RED_ZONE & SLAB_POISON. ++ * 0 for faster, smaller code (especially in the critical paths). ++ * ++ * STATS - 1 to collect stats for /proc/slabinfo. ++ * 0 for faster, smaller code (especially in the critical paths). ++ * ++ * FORCED_DEBUG - 1 enables SLAB_RED_ZONE and SLAB_POISON (if possible) ++ */ ++ ++#ifdef CONFIG_DEBUG_SLAB ++#define SLAB_DEBUG 1 ++#define SLAB_STATS 1 ++#define SLAB_FORCED_DEBUG 1 ++#else ++#define SLAB_DEBUG 0 ++#define SLAB_STATS 0 ++#define SLAB_FORCED_DEBUG 0 ++#endif ++ ++/* ++ * struct kmem_cache ++ * ++ * manages a cache. ++ */ ++ ++struct kmem_cache { ++/* 1) per-cpu data, touched during every alloc/free */ ++ struct array_cache *array[NR_CPUS]; ++/* 2) Cache tunables. Protected by cache_chain_mutex */ ++ unsigned int batchcount; ++ unsigned int limit; ++ unsigned int shared; ++ ++ unsigned int buffer_size; ++ u32 reciprocal_buffer_size; ++/* 3) touched by every alloc & free from the backend */ ++ ++ unsigned int flags; /* constant flags */ ++ unsigned int num; /* # of objs per slab */ ++ ++/* 4) cache_grow/shrink */ ++ /* order of pgs per slab (2^n) */ ++ unsigned int gfporder; ++ ++ /* force GFP flags, e.g. GFP_DMA */ ++ gfp_t gfpflags; ++ ++ size_t colour; /* cache colouring range */ ++ unsigned int colour_off; /* colour offset */ ++ struct kmem_cache *slabp_cache; ++ unsigned int slab_size; ++ unsigned int dflags; /* dynamic flags */ ++ ++ /* constructor func */ ++ void (*ctor) (struct kmem_cache *, void *); ++ ++/* 5) cache creation/removal */ ++ const char *name; ++ struct list_head next; ++ ++/* 6) statistics */ ++ unsigned long grown; ++ unsigned long reaped; ++ unsigned long shrunk; ++#if SLAB_STATS ++ unsigned long num_active; ++ unsigned long num_allocations; ++ unsigned long high_mark; ++ unsigned long errors; ++ unsigned long max_freeable; ++ unsigned long node_allocs; ++ unsigned long node_frees; ++ unsigned long node_overflow; ++ atomic_t allochit; ++ atomic_t allocmiss; ++ atomic_t freehit; ++ atomic_t freemiss; ++#endif ++#if SLAB_DEBUG ++ /* ++ * If debugging is enabled, then the allocator can add additional ++ * fields and/or padding to every object. buffer_size contains the total ++ * object size including these internal fields, the following two ++ * variables contain the offset to the user object and its size. ++ */ ++ int obj_offset; ++ int obj_size; ++#endif ++#ifdef CONFIG_BEANCOUNTERS ++ int objuse; ++#endif ++ /* ++ * We put nodelists[] at the end of kmem_cache, because we want to size ++ * this array to nr_node_ids slots instead of MAX_NUMNODES ++ * (see kmem_cache_init()) ++ * We still use [MAX_NUMNODES] and not [1] or [0] because cache_cache ++ * is statically defined, so we reserve the max number of nodes. ++ */ ++ struct kmem_list3 *nodelists[MAX_NUMNODES]; ++ /* ++ * Do not add fields after nodelists[] ++ */ ++}; ++ + /* Size description struct for general caches. */ + struct cache_sizes { + size_t cs_size; +@@ -24,6 +129,7 @@ + #endif + }; + extern struct cache_sizes malloc_sizes[]; ++extern int malloc_cache_num; + + void *kmem_cache_alloc(struct kmem_cache *, gfp_t); + void *__kmalloc(size_t size, gfp_t flags); +@@ -48,6 +154,8 @@ + __you_cannot_kmalloc_that_much(); + } + found: ++ if (flags & __GFP_UBC) ++ i += malloc_cache_num; + #ifdef CONFIG_ZONE_DMA + if (flags & GFP_DMA) + return kmem_cache_alloc(malloc_sizes[i].cs_dmacachep, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/slub_def.h debian/binary-custom.d/openvz/src/include/linux/slub_def.h +--- ./include/linux/slub_def.h 2012-06-12 16:25:24.134312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/slub_def.h 2012-11-13 15:20:15.216569071 +0000 +@@ -58,6 +58,10 @@ + struct kobject kobj; /* For sysfs */ + #endif + ++#ifdef CONFIG_BEANCOUNTERS ++ atomic_t grown; ++ int objuse; ++#endif + #ifdef CONFIG_NUMA + int defrag_ratio; + struct kmem_cache_node *node[MAX_NUMNODES]; +@@ -86,6 +90,19 @@ + */ + extern struct kmem_cache kmalloc_caches[PAGE_SHIFT]; + ++#ifdef CONFIG_BEANCOUNTERS ++extern struct kmem_cache ub_kmalloc_caches[KMALLOC_SHIFT_HIGH + 1]; ++static inline struct kmem_cache *__kmalloc_cache(gfp_t f, int idx) ++{ ++ return (f & __GFP_UBC) ? &ub_kmalloc_caches[idx] : &kmalloc_caches[idx]; ++} ++#else ++static inline struct kmem_cache *__kmalloc_cache(gfp_t flags, int idx) ++{ ++ return &kmalloc_caches[idx]; ++} ++#endif ++ + /* + * Sorry that the following has to be that ugly but some versions of GCC + * have trouble with constant propagation and loops. +@@ -142,14 +159,14 @@ + * This ought to end up with a global pointer to the right cache + * in kmalloc_caches. + */ +-static __always_inline struct kmem_cache *kmalloc_slab(size_t size) ++static __always_inline struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags) + { + int index = kmalloc_index(size); + + if (index == 0) + return NULL; + +- return &kmalloc_caches[index]; ++ return __kmalloc_cache(flags, index); + } + + #ifdef CONFIG_ZONE_DMA +@@ -170,7 +187,7 @@ + get_order(size)); + + if (!(flags & SLUB_DMA)) { +- struct kmem_cache *s = kmalloc_slab(size); ++ struct kmem_cache *s = kmalloc_slab(size, flags); + + if (!s) + return ZERO_SIZE_PTR; +@@ -189,7 +206,7 @@ + { + if (__builtin_constant_p(size) && + size <= PAGE_SIZE / 2 && !(flags & SLUB_DMA)) { +- struct kmem_cache *s = kmalloc_slab(size); ++ struct kmem_cache *s = kmalloc_slab(size, flags); + + if (!s) + return ZERO_SIZE_PTR; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/smp.h debian/binary-custom.d/openvz/src/include/linux/smp.h +--- ./include/linux/smp.h 2012-06-12 16:25:24.134312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/smp.h 2012-11-13 15:20:15.220569073 +0000 +@@ -10,6 +10,9 @@ + + extern void cpu_idle(void); + ++struct pt_regs; ++typedef void (*smp_nmi_function)(struct pt_regs *regs, void *info); ++ + #ifdef CONFIG_SMP + + #include +@@ -49,6 +52,8 @@ + */ + extern void smp_cpus_done(unsigned int max_cpus); + ++extern int smp_nmi_call_function(smp_nmi_function func, void *info, int wait); ++ + /* + * Call a function on all other processors + */ +@@ -111,6 +116,12 @@ + #define smp_call_function_mask(mask, func, info, wait) \ + (up_smp_call_function(func, info)) + ++static inline int smp_nmi_call_function(smp_nmi_function func, ++ void *info, int wait) ++{ ++ return 0; ++} ++ + #endif /* !SMP */ + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/socket.h debian/binary-custom.d/openvz/src/include/linux/socket.h +--- ./include/linux/socket.h 2012-06-12 16:25:24.134312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/socket.h 2012-11-13 15:20:15.220569073 +0000 +@@ -297,6 +297,16 @@ + #define IPX_TYPE 1 + + #ifdef __KERNEL__ ++ ++#define MAX_SOCK_ADDR 128 /* 108 for Unix domain - ++ 16 for IP, 16 for IPX, ++ 24 for IPv6, ++ about 80 for AX.25 ++ must be at least one bigger than ++ the AF_UNIX size (see net/unix/af_unix.c ++ :unix_mkname()). ++ */ ++ + extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); + extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, + int offset, int len); +@@ -310,6 +320,8 @@ + extern int move_addr_to_user(void *kaddr, int klen, void __user *uaddr, int __user *ulen); + extern int move_addr_to_kernel(void __user *uaddr, int ulen, void *kaddr); + extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); ++extern int vz_security_family_check(int family); ++extern int vz_security_protocol_check(int protocol); + + #endif + #endif /* not kernel and not glibc */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/sunrpc/clnt.h debian/binary-custom.d/openvz/src/include/linux/sunrpc/clnt.h +--- ./include/linux/sunrpc/clnt.h 2012-06-12 16:25:24.138312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/sunrpc/clnt.h 2012-11-13 15:20:15.224569074 +0000 +@@ -44,6 +44,7 @@ + cl_intr : 1,/* interruptible */ + cl_discrtry : 1,/* disconnect before retry */ + cl_autobind : 1;/* use getport() */ ++ unsigned int cl_broken : 1;/* no responce for too long */ + + struct rpc_rtt * cl_rtt; /* RTO estimator data */ + +@@ -55,6 +56,7 @@ + struct rpc_clnt * cl_parent; /* Points to parent of clones */ + struct rpc_rtt cl_rtt_default; + struct rpc_program * cl_program; ++ unsigned long cl_pr_time; + char cl_inline_name[32]; + }; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/sunrpc/xprt.h debian/binary-custom.d/openvz/src/include/linux/sunrpc/xprt.h +--- ./include/linux/sunrpc/xprt.h 2012-06-12 16:25:24.142312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/sunrpc/xprt.h 2012-11-13 15:20:15.228569074 +0000 +@@ -24,6 +24,14 @@ + #define RPC_MAX_SLOT_TABLE (128U) + + /* ++ * Grand abort timeout (stop the client if occures) ++ */ ++extern int xprt_abort_timeout; ++ ++#define RPC_MIN_ABORT_TIMEOUT 300 ++#define RPC_MAX_ABORT_TIMEOUT INT_MAX ++ ++/* + * This describes a timeout strategy + */ + struct rpc_timeout { +@@ -119,6 +127,7 @@ + struct rpc_xprt { + struct kref kref; /* Reference count */ + struct rpc_xprt_ops * ops; /* transport methods */ ++ struct ve_struct * owner_env; /* VE owner of mount */ + + struct rpc_timeout timeout; /* timeout parms */ + struct sockaddr_storage addr; /* server address */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/swap.h debian/binary-custom.d/openvz/src/include/linux/swap.h +--- ./include/linux/swap.h 2012-06-12 16:25:24.142312492 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/swap.h 2012-11-13 15:20:15.228569074 +0000 +@@ -17,6 +17,7 @@ + #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ + #define SWAP_FLAG_PRIO_MASK 0x7fff + #define SWAP_FLAG_PRIO_SHIFT 0 ++#define SWAP_FLAG_READONLY 0x40000000 /* set if swap is read-only */ + + static inline int current_is_kswapd(void) + { +@@ -92,6 +93,7 @@ + struct sysinfo; + struct writeback_control; + struct zone; ++struct user_beancounter; + + /* + * A swap extent maps a range of a swapfile's PAGE_SIZE pages onto a range of +@@ -121,6 +123,7 @@ + SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), + /* add others here before... */ + SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ ++ SWP_READONLY = (1 << 2), + }; + + #define SWAP_CLUSTER_MAX 32 +@@ -131,6 +134,7 @@ + /* + * The in-memory structure used to track swap areas. + */ ++struct user_beancounter; + struct swap_info_struct { + unsigned int flags; + int prio; /* swap priority */ +@@ -148,6 +152,9 @@ + unsigned int max; + unsigned int inuse_pages; + int next; /* next entry on swap list */ ++#ifdef CONFIG_BC_SWAP_ACCOUNTING ++ struct user_beancounter **swap_ubs; ++#endif + }; + + struct swap_list_t { +@@ -155,9 +162,19 @@ + int next; /* swapfile to be used next */ + }; + ++extern struct swap_list_t swap_list; ++extern struct swap_info_struct swap_info[MAX_SWAPFILES]; ++ + /* Swap 50% full? Release swapcache more aggressively.. */ + #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) + ++/* linux/mm/oom_kill.c */ ++extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); ++extern int register_oom_notifier(struct notifier_block *nb); ++extern int unregister_oom_notifier(struct notifier_block *nb); ++extern int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, const char *message); ++extern struct task_struct *oom_select_bad_process(struct user_beancounter *ub); ++ + /* linux/mm/memory.c */ + extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); + +@@ -224,6 +241,9 @@ + extern void show_swap_cache_info(void); + extern int add_to_swap(struct page *, gfp_t); + extern void __delete_from_swap_cache(struct page *); ++extern int add_to_swap_cache(struct page *page, swp_entry_t entry); ++extern int __add_to_swap_cache(struct page *page, ++ swp_entry_t entry, gfp_t gfp_mask); + extern void delete_from_swap_cache(struct page *); + extern int move_to_swap_cache(struct page *, swp_entry_t); + extern int move_from_swap_cache(struct page *, unsigned long, +@@ -237,7 +257,7 @@ + extern long total_swap_pages; + extern unsigned int nr_swapfiles; + extern void si_swapinfo(struct sysinfo *); +-extern swp_entry_t get_swap_page(void); ++extern swp_entry_t get_swap_page(struct user_beancounter *); + extern swp_entry_t get_swap_page_of_type(int); + extern int swap_duplicate(swp_entry_t); + extern int valid_swaphandles(swp_entry_t, unsigned long *); +@@ -250,6 +270,7 @@ + extern struct swap_info_struct *get_swap_info_struct(unsigned); + extern int can_share_swap_page(struct page *); + extern int remove_exclusive_swap_page(struct page *); ++extern int try_to_remove_exclusive_swap_page(struct page *); + struct backing_dev_info; + + extern spinlock_t swap_lock; +@@ -350,7 +371,7 @@ + return 0; + } + +-static inline swp_entry_t get_swap_page(void) ++static inline swp_entry_t get_swap_page(struct user_beancounter *ub) + { + swp_entry_t entry; + entry.val = 0; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/sysctl.h debian/binary-custom.d/openvz/src/include/linux/sysctl.h +--- ./include/linux/sysctl.h 2012-06-12 16:25:24.146312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/sysctl.h 2012-11-13 15:20:15.232569072 +0000 +@@ -159,6 +159,9 @@ + KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */ + KERN_SPIN_RETRY=70, /* int: number of spinlock retries */ + KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ ++#ifdef CONFIG_GRKERNSEC_SYSCTL ++ KERN_GRSECURITY=98, /* grsecurity */ ++#endif + KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ + KERN_COMPAT_LOG=73, /* int: print compat layer messages */ + KERN_MAX_LOCK_DEPTH=74, +@@ -948,6 +951,7 @@ + extern struct ctl_table_header *sysctl_head_next(struct ctl_table_header *prev); + extern void sysctl_head_finish(struct ctl_table_header *prev); + extern int sysctl_perm(struct ctl_table *table, int op); ++extern int ve_allow_kthreads; + + typedef struct ctl_table ctl_table; + +@@ -1036,6 +1040,8 @@ + */ + + /* A sysctl table is an array of struct ctl_table: */ ++struct ve_struct; ++ + struct ctl_table + { + int ctl_name; /* Binary ID */ +@@ -1049,6 +1055,8 @@ + ctl_handler *strategy; /* Callback function for all r/w */ + void *extra1; + void *extra2; ++ struct ve_struct *owner_env; ++ int virt_handler; + }; + + /* struct ctl_table_header is used to maintain dynamic lists of +@@ -1062,10 +1070,14 @@ + }; + + struct ctl_table_header *register_sysctl_table(struct ctl_table * table); ++struct ctl_table_header *register_glob_sysctl_table(struct ctl_table * table); + + void unregister_sysctl_table(struct ctl_table_header * table); + int sysctl_check_table(struct ctl_table *table); + ++ctl_table *clone_sysctl_template(ctl_table *tmpl); ++void free_sysctl_clone(ctl_table *clone); ++ + #else /* __KERNEL__ */ + + #endif /* __KERNEL__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/sysfs.h debian/binary-custom.d/openvz/src/include/linux/sysfs.h +--- ./include/linux/sysfs.h 2012-06-12 16:25:24.146312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/sysfs.h 2012-11-13 15:20:15.232569072 +0000 +@@ -19,6 +19,7 @@ + + struct kobject; + struct module; ++struct sysfs_open_dirent; + + /* FIXME + * The *owner field is no longer used, but leave around +@@ -76,6 +77,66 @@ + ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); + }; + ++/* type-specific structures for sysfs_dirent->s_* union members */ ++struct sysfs_elem_dir { ++ struct kobject *kobj; ++ /* children list starts here and goes through sd->s_sibling */ ++ struct sysfs_dirent *children; ++}; ++ ++struct sysfs_elem_symlink { ++ struct sysfs_dirent *target_sd; ++}; ++ ++struct sysfs_elem_attr { ++ struct attribute *attr; ++ struct sysfs_open_dirent *open; ++}; ++ ++struct sysfs_elem_bin_attr { ++ struct bin_attribute *bin_attr; ++}; ++ ++/* ++ * sysfs_dirent - the building block of sysfs hierarchy. Each and ++ * every sysfs node is represented by single sysfs_dirent. ++ * ++ * As long as s_count reference is held, the sysfs_dirent itself is ++ * accessible. Dereferencing s_elem or any other outer entity ++ * requires s_active reference. ++ */ ++struct sysfs_dirent { ++ atomic_t s_count; ++ atomic_t s_active; ++ struct sysfs_dirent *s_parent; ++ struct sysfs_dirent *s_sibling; ++ const char *s_name; ++ ++ union { ++ struct sysfs_elem_dir s_dir; ++ struct sysfs_elem_symlink s_symlink; ++ struct sysfs_elem_attr s_attr; ++ struct sysfs_elem_bin_attr s_bin_attr; ++ }; ++ ++ unsigned int s_flags; ++ ino_t s_ino; ++ umode_t s_mode; ++ struct iattr *s_iattr; ++}; ++ ++#define SD_DEACTIVATED_BIAS INT_MIN ++ ++#define SYSFS_TYPE_MASK 0x00ff ++#define SYSFS_DIR 0x0001 ++#define SYSFS_KOBJ_ATTR 0x0002 ++#define SYSFS_KOBJ_BIN_ATTR 0x0004 ++#define SYSFS_KOBJ_LINK 0x0008 ++#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) ++ ++#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK ++#define SYSFS_FLAG_REMOVED 0x0200 ++ + #ifdef CONFIG_SYSFS + + int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), +@@ -114,6 +175,8 @@ + + extern int __must_check sysfs_init(void); + ++extern struct file_system_type sysfs_fs_type; ++ + #else /* CONFIG_SYSFS */ + + static inline int sysfs_schedule_callback(struct kobject *kobj, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/task_io_accounting_ops.h debian/binary-custom.d/openvz/src/include/linux/task_io_accounting_ops.h +--- ./include/linux/task_io_accounting_ops.h 2012-06-12 16:25:24.146312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/task_io_accounting_ops.h 2012-11-13 15:20:15.232569072 +0000 +@@ -5,10 +5,12 @@ + #define __TASK_IO_ACCOUNTING_OPS_INCLUDED + + #include ++#include + + #ifdef CONFIG_TASK_IO_ACCOUNTING + static inline void task_io_account_read(size_t bytes) + { ++ ub_io_account_read(bytes); + current->ioac.read_bytes += bytes; + } + +@@ -21,8 +23,14 @@ + return p->ioac.read_bytes >> 9; + } + +-static inline void task_io_account_write(size_t bytes) ++static inline void task_io_account_write(struct page *page, size_t bytes, ++ int sync) + { ++ if (sync) ++ ub_io_account_write(bytes); ++ else ++ ub_io_account_dirty(page, bytes); ++ + current->ioac.write_bytes += bytes; + } + +@@ -37,6 +45,7 @@ + + static inline void task_io_account_cancelled_write(size_t bytes) + { ++ ub_io_account_write_cancelled(bytes); + current->ioac.cancelled_write_bytes += bytes; + } + +@@ -56,7 +65,8 @@ + return 0; + } + +-static inline void task_io_account_write(size_t bytes) ++static inline void task_io_account_write(struct page *page, size_t bytes, ++ int sync) + { + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/tty.h debian/binary-custom.d/openvz/src/include/linux/tty.h +--- ./include/linux/tty.h 2012-06-12 16:25:24.150312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/tty.h 2012-11-13 15:20:15.240569069 +0000 +@@ -241,6 +241,7 @@ + spinlock_t read_lock; + /* If the tty has a pending do_SAK, queue it here - akpm */ + struct work_struct SAK_work; ++ struct ve_struct *owner_env; + }; + + /* tty magic number */ +@@ -270,6 +271,7 @@ + #define TTY_HUPPED 18 /* Post driver->hangup() */ + #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ + #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ ++#define TTY_CHARGED 21 /* Charged as ub resource */ + + #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/tty_driver.h debian/binary-custom.d/openvz/src/include/linux/tty_driver.h +--- ./include/linux/tty_driver.h 2012-06-12 16:25:24.150312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/tty_driver.h 2012-11-13 15:20:15.240569069 +0000 +@@ -233,8 +233,19 @@ + struct serial_icounter_struct *icount); + + struct list_head tty_drivers; ++ struct ve_struct *owner_env; + }; + ++#ifdef CONFIG_UNIX98_PTYS ++extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */ ++extern struct tty_driver *pts_driver; /* Unix98 pty slaves; for /dev/ptmx */ ++#endif ++ ++#ifdef CONFIG_LEGACY_PTYS ++extern struct tty_driver *pty_driver; ++extern struct tty_driver *pty_slave_driver; ++#endif ++ + extern struct list_head tty_drivers; + + struct tty_driver *alloc_tty_driver(int lines); +@@ -242,6 +253,9 @@ + void tty_set_operations(struct tty_driver *driver, + const struct tty_operations *op); + ++struct class *init_ve_tty_class(void); ++void fini_ve_tty_class(struct class *ve_tty_class); ++ + /* tty driver magic number */ + #define TTY_DRIVER_MAGIC 0x5402 + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/types.h debian/binary-custom.d/openvz/src/include/linux/types.h +--- ./include/linux/types.h 2012-06-12 16:25:24.150312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/types.h 2012-11-13 15:20:15.240569069 +0000 +@@ -29,6 +29,11 @@ + typedef __kernel_clockid_t clockid_t; + typedef __kernel_mqd_t mqd_t; + ++#ifndef __ENVID_T_DEFINED__ ++typedef unsigned envid_t; ++#define __ENVID_T_DEFINED__ ++#endif ++ + #ifdef __KERNEL__ + typedef _Bool bool; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/utsname.h debian/binary-custom.d/openvz/src/include/linux/utsname.h +--- ./include/linux/utsname.h 2012-06-12 16:25:24.154312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/utsname.h 2012-11-13 15:20:15.244569070 +0000 +@@ -42,6 +42,7 @@ + struct new_utsname name; + }; + extern struct uts_namespace init_uts_ns; ++extern struct new_utsname virt_utsname; + + static inline void get_uts_ns(struct uts_namespace *ns) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/ve.h debian/binary-custom.d/openvz/src/include/linux/ve.h +--- ./include/linux/ve.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/ve.h 2012-11-13 15:20:15.244569070 +0000 +@@ -0,0 +1,418 @@ ++/* ++ * include/linux/ve.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _LINUX_VE_H ++#define _LINUX_VE_H ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef VZMON_DEBUG ++# define VZTRACE(fmt,args...) \ ++ printk(KERN_DEBUG fmt, ##args) ++#else ++# define VZTRACE(fmt,args...) ++#endif /* VZMON_DEBUG */ ++ ++struct tty_driver; ++struct devpts_config; ++struct task_struct; ++struct new_utsname; ++struct file_system_type; ++struct icmp_mib; ++struct ip_mib; ++struct tcp_mib; ++struct udp_mib; ++struct linux_mib; ++struct fib_info; ++struct fib_rule; ++struct veip_struct; ++struct ve_monitor; ++struct nsproxy; ++struct ve_sit_tunnels; ++ ++#if defined(CONFIG_VE) && defined(CONFIG_INET) ++struct fib_table; ++#ifdef CONFIG_VE_IPTABLES ++struct xt_table; ++struct nf_conn; ++ ++#define FRAG6Q_HASHSZ 64 ++ ++struct ve_nf_conntrack { ++ struct hlist_head *_bysource; ++ struct nf_nat_protocol **_nf_nat_protos; ++ int _nf_nat_vmalloced; ++ struct xt_table *_nf_nat_table; ++ struct nf_conntrack_l3proto *_nf_nat_l3proto; ++ atomic_t _nf_conntrack_count; ++ int _nf_conntrack_max; ++ struct hlist_head *_nf_conntrack_hash; ++ int _nf_conntrack_checksum; ++ int _nf_conntrack_vmalloc; ++ struct hlist_head _unconfirmed; ++ struct hlist_head *_nf_ct_expect_hash; ++ unsigned int _nf_ct_expect_vmalloc; ++ unsigned int _nf_ct_expect_count; ++ unsigned int _nf_ct_expect_max; ++ struct hlist_head *_nf_ct_helper_hash; ++ unsigned int _nf_ct_helper_vmalloc; ++ struct inet_frags _nf_frags6; ++ struct inet_frags_ctl _nf_frags6_ctl; ++#ifdef CONFIG_SYSCTL ++ /* l4 stuff: */ ++ unsigned long _nf_ct_icmp_timeout; ++ unsigned long _nf_ct_icmpv6_timeout; ++ unsigned int _nf_ct_udp_timeout; ++ unsigned int _nf_ct_udp_timeout_stream; ++ unsigned int _nf_ct_generic_timeout; ++ unsigned int _nf_ct_log_invalid; ++ unsigned int _nf_ct_tcp_timeout_max_retrans; ++ int _nf_ct_tcp_be_liberal; ++ int _nf_ct_tcp_loose; ++ int _nf_ct_tcp_max_retrans; ++ unsigned int _nf_ct_tcp_timeouts[10]; ++ struct ctl_table_header *_icmp_sysctl_header; ++ unsigned int _tcp_sysctl_table_users; ++ struct ctl_table_header *_tcp_sysctl_header; ++ unsigned int _udp_sysctl_table_users; ++ struct ctl_table_header *_udp_sysctl_header; ++ struct ctl_table_header *_icmpv6_sysctl_header; ++ struct ctl_table_header *_generic_sysctl_header; ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ struct ctl_table_header *_icmp_compat_sysctl_header; ++ struct ctl_table_header *_tcp_compat_sysctl_header; ++ struct ctl_table_header *_udp_compat_sysctl_header; ++ struct ctl_table_header *_generic_compat_sysctl_header; ++#endif ++ /* l4 protocols sysctl tables: */ ++ struct nf_conntrack_l4proto *_nf_conntrack_l4proto_icmp; ++ struct nf_conntrack_l4proto *_nf_conntrack_l4proto_tcp4; ++ struct nf_conntrack_l4proto *_nf_conntrack_l4proto_icmpv6; ++ struct nf_conntrack_l4proto *_nf_conntrack_l4proto_tcp6; ++ struct nf_conntrack_l4proto *_nf_conntrack_l4proto_udp4; ++ struct nf_conntrack_l4proto *_nf_conntrack_l4proto_udp6; ++ struct nf_conntrack_l4proto *_nf_conntrack_l4proto_generic; ++ struct nf_conntrack_l4proto **_nf_ct_protos[PF_MAX]; ++ /* l3 protocols sysctl tables: */ ++ struct nf_conntrack_l3proto *_nf_conntrack_l3proto_ipv4; ++ struct nf_conntrack_l3proto *_nf_conntrack_l3proto_ipv6; ++ struct nf_conntrack_l3proto *_nf_ct_l3protos[AF_MAX]; ++ /* sysctl standalone stuff: */ ++ struct ctl_table_header *_nf_ct_sysctl_header; ++ ctl_table *_nf_ct_sysctl_table; ++ ctl_table *_nf_ct_netfilter_table; ++ ctl_table *_nf_ct_net_table; ++ ctl_table *_ip_ct_net_table; ++ ctl_table *_ip_ct_netfilter_table; ++ struct ctl_table_header *_ip_ct_sysctl_header; ++ int _nf_ct_log_invalid_proto_min; ++ int _nf_ct_log_invalid_proto_max; ++#endif /* CONFIG_SYSCTL */ ++}; ++#endif ++#endif ++ ++struct ve_cpu_stats { ++ cycles_t idle_time; ++ cycles_t iowait_time; ++ cycles_t strt_idle_time; ++ cycles_t used_time; ++ seqcount_t stat_lock; ++ int nr_running; ++ int nr_unint; ++ int nr_iowait; ++ cputime64_t user; ++ cputime64_t nice; ++ cputime64_t system; ++} ____cacheline_aligned; ++ ++struct ve_ipt_recent; ++struct ve_xt_hashlimit; ++ ++struct ve_struct { ++ struct list_head ve_list; ++ ++ envid_t veid; ++ struct list_head vetask_lh; ++ /* capability bounding set */ ++ kernel_cap_t ve_cap_bset; ++ atomic_t pcounter; ++ /* ref counter to ve from ipc */ ++ atomic_t counter; ++ unsigned int class_id; ++ struct rw_semaphore op_sem; ++ int is_running; ++ int is_locked; ++ atomic_t suspend; ++ /* see vzcalluser.h for VE_FEATURE_XXX definitions */ ++ __u64 features; ++ ++/* VE's root */ ++ struct vfsmount *fs_rootmnt; ++ struct dentry *fs_root; ++ ++/* sysctl */ ++ struct list_head sysctl_lh; ++ struct ctl_table_header *uts_header; ++ struct file_system_type *proc_fstype; ++ struct vfsmount *proc_mnt; ++ struct proc_dir_entry *proc_root; ++ struct proc_dir_entry *proc_sys_root; ++ struct proc_dir_entry *_proc_net; ++ struct proc_dir_entry *_proc_net_stat; ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++ struct proc_dir_entry *_proc_net_devsnmp6; ++#endif ++ ++/* BSD pty's */ ++#ifdef CONFIG_LEGACY_PTYS ++ struct tty_driver *pty_driver; ++ struct tty_driver *pty_slave_driver; ++#endif ++#ifdef CONFIG_UNIX98_PTYS ++ struct tty_driver *ptm_driver; ++ struct tty_driver *pts_driver; ++ struct idr *allocated_ptys; ++ struct file_system_type *devpts_fstype; ++ struct vfsmount *devpts_mnt; ++ struct dentry *devpts_root; ++ struct devpts_config *devpts_config; ++#endif ++ ++ struct ve_nfs_context *nfs_context; ++ ++ struct file_system_type *shmem_fstype; ++ struct vfsmount *shmem_mnt; ++#ifdef CONFIG_SYSFS ++ struct file_system_type *sysfs_fstype; ++ struct vfsmount *sysfs_mnt; ++ struct super_block *sysfs_sb; ++ struct sysfs_dirent *_sysfs_root; ++#endif ++#ifndef CONFIG_SYSFS_DEPRECATED ++ struct kobject *_virtual_dir; ++#endif ++ struct kset *class_subsys; ++ struct kset *class_obj_subsys; ++ struct kset *devices_subsys; ++ struct class *tty_class; ++ struct class *mem_class; ++ ++#ifdef CONFIG_NET ++ struct class *net_class; ++#ifdef CONFIG_INET ++ struct ipv4_devconf *_ipv4_devconf; ++ struct ipv4_devconf *_ipv4_devconf_dflt; ++ struct ctl_table_header *forward_header; ++ struct ctl_table *forward_table; ++ unsigned long rt_flush_required; ++ struct neigh_table *ve_arp_tbl; ++ struct ve_sit_tunnels *_sit_tunnels; ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++ struct ipv6_devconf *_ipv6_devconf; ++ struct ipv6_devconf *_ipv6_devconf_dflt; ++ struct neigh_table *ve_nd_tbl; ++#endif ++#endif ++#endif ++#if defined(CONFIG_VE_NETDEV) || defined (CONFIG_VE_NETDEV_MODULE) ++ struct veip_struct *veip; ++ struct net_device *_venet_dev; ++#endif ++ ++/* per VE CPU stats*/ ++ struct timespec start_timespec; ++ u64 start_jiffies; /* Deprecated */ ++ cycles_t start_cycles; ++ unsigned long avenrun[3]; /* loadavg data */ ++ ++ cycles_t cpu_used_ve; ++ struct kstat_lat_pcpu_struct sched_lat_ve; ++ ++#ifdef CONFIG_INET ++ struct hlist_head *_fib_info_hash; ++ struct hlist_head *_fib_info_laddrhash; ++ int _fib_hash_size; ++ int _fib_info_cnt; ++ ++ struct fib_rule *_local_rule; ++ struct list_head _fib_rules; ++ /* XXX: why a magic constant? */ ++#ifdef CONFIG_IP_MULTIPLE_TABLES ++ struct hlist_head _fib_table_hash[256]; ++#else ++ struct hlist_head _fib_table_hash[1]; ++ struct fib_table *_main_table; ++ struct fib_table *_local_table; ++#endif ++ struct icmp_mib *_icmp_statistics[2]; ++ struct icmpmsg_mib *_icmpmsg_statistics[2]; ++ struct ipstats_mib *_ip_statistics[2]; ++ struct tcp_mib *_tcp_statistics[2]; ++ struct udp_mib *_udp_statistics[2]; ++ struct udp_mib *_udplite_statistics[2]; ++ struct linux_mib *_net_statistics[2]; ++ struct venet_stat *stat; ++#ifdef CONFIG_VE_IPTABLES ++/* core/netfilter.c virtualization */ ++ void *_nf_hooks; ++ struct xt_table *_ve_ipt_filter_pf; /* packet_filter struct */ ++ struct xt_table *_ve_ip6t_filter_pf; ++ struct xt_table *_ipt_mangle_table; ++ struct xt_table *_ip6t_mangle_table; ++ struct list_head _xt_tables[NPROTO]; ++ ++ __u64 _iptables_modules; ++ struct ve_nf_conntrack *_nf_conntrack; ++ struct ve_ipt_recent *_ipt_recent; ++ struct ve_xt_hashlimit *_xt_hashlimit; ++#endif /* CONFIG_VE_IPTABLES */ ++ ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++#ifdef CONFIG_IPV6_MULTIPLE_TABLES ++ struct hlist_head _fib6_table_hash[256]; ++ struct fib6_table *_fib6_local_table; ++#else ++ struct hlist_head _fib6_table_hash[1]; ++#endif ++ struct fib6_table *_fib6_table; ++ struct ipstats_mib *_ipv6_statistics[2]; ++ struct icmpv6_mib *_icmpv6_statistics[2]; ++ struct icmpv6msg_mib *_icmpv6msg_statistics[2]; ++ struct udp_mib *_udp_stats_in6[2]; ++ struct udp_mib *_udplite_stats_in6[2]; ++#endif ++#endif ++ wait_queue_head_t *_log_wait; ++ unsigned long *_log_start; ++ unsigned long *_log_end; ++ unsigned long *_logged_chars; ++ char *log_buf; ++#define VE_DEFAULT_LOG_BUF_LEN 4096 ++ ++ struct ve_cpu_stats *cpu_stats; ++ unsigned long down_at; ++ struct list_head cleanup_list; ++#if defined(CONFIG_FUSE_FS) || defined(CONFIG_FUSE_FS_MODULE) ++ struct list_head _fuse_conn_list; ++ struct super_block *_fuse_control_sb; ++ ++ struct file_system_type *fuse_fs_type; ++ struct file_system_type *fuse_ctl_fs_type; ++#endif ++#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) ++ struct proc_dir_entry *_proc_vlan_dir; ++ struct proc_dir_entry *_proc_vlan_conf; ++#endif ++ unsigned long jiffies_fixup; ++ unsigned char disable_net; ++ struct ve_monitor *monitor; ++ struct proc_dir_entry *monitor_proc; ++ unsigned long meminfo_val; ++ ++#if defined(CONFIG_NFS_FS) || defined(CONFIG_NFS_FS_MODULE) \ ++ || defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE) ++ unsigned int _nlmsvc_users; ++ pid_t _nlmsvc_pid; ++ int _nlmsvc_grace_period; ++ unsigned long _nlmsvc_timeout; ++#endif ++ ++#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) ++ struct file_system_type *bm_fs_type; ++ struct vfsmount *bm_mnt; ++ int bm_enabled; ++ int bm_entry_count; ++ struct list_head bm_entries; ++#endif ++ ++ struct nsproxy *ve_ns; ++ struct net *ve_netns; ++#ifdef CONFIG_GRKERNSEC ++ struct { ++ int lock; ++#ifdef CONFIG_GRKERNSEC_TPE ++ int enable_tpe; ++ int tpe_gid; ++#ifdef CONFIG_GRKERNSEC_TPE_ALL ++ int enable_tpe_all; ++#endif ++#endif /*CONFIG_GRKERNSEC_TPE */ ++ } grsec; ++#endif /* CONFIG_GRKERNSEC */ ++}; ++ ++#define VE_CPU_STATS(ve, cpu) (per_cpu_ptr((ve)->cpu_stats, cpu)) ++ ++extern int nr_ve; ++ ++#ifdef CONFIG_VE ++ ++void do_update_load_avg_ve(void); ++void do_env_free(struct ve_struct *ptr); ++ ++static inline struct ve_struct *get_ve(struct ve_struct *ptr) ++{ ++ if (ptr != NULL) ++ atomic_inc(&ptr->counter); ++ return ptr; ++} ++ ++static inline void put_ve(struct ve_struct *ptr) ++{ ++ if (ptr && atomic_dec_and_test(&ptr->counter)) { ++ if (atomic_read(&ptr->pcounter) > 0) ++ BUG(); ++ if (ptr->is_running) ++ BUG(); ++ do_env_free(ptr); ++ } ++} ++ ++static inline void pget_ve(struct ve_struct *ptr) ++{ ++ atomic_inc(&ptr->pcounter); ++} ++ ++void ve_cleanup_schedule(struct ve_struct *); ++static inline void pput_ve(struct ve_struct *ptr) ++{ ++ if (unlikely(atomic_dec_and_test(&ptr->pcounter))) ++ ve_cleanup_schedule(ptr); ++} ++ ++extern spinlock_t ve_cleanup_lock; ++extern struct list_head ve_cleanup_list; ++extern struct task_struct *ve_cleanup_thread; ++ ++extern unsigned long long ve_relative_clock(struct timespec * ts); ++ ++#ifdef CONFIG_FAIRSCHED ++#define ve_cpu_online_map(ve, mask) fairsched_cpu_online_map(ve->veid, mask) ++#else ++#define ve_cpu_online_map(ve, mask) do { *(mask) = cpu_online_map; } while (0) ++#endif ++#else /* CONFIG_VE */ ++#define ve_utsname system_utsname ++#define get_ve(ve) (NULL) ++#define put_ve(ve) do { } while (0) ++#define pget_ve(ve) do { } while (0) ++#define pput_ve(ve) do { } while (0) ++#endif /* CONFIG_VE */ ++ ++#endif /* _LINUX_VE_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/ve_nfs.h debian/binary-custom.d/openvz/src/include/linux/ve_nfs.h +--- ./include/linux/ve_nfs.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/ve_nfs.h 2012-11-13 15:20:15.244569070 +0000 +@@ -0,0 +1,29 @@ ++/* ++ * linux/include/ve_nfs.h ++ * ++ * VE context for NFS ++ * ++ * Copyright (C) 2007 SWsoft ++ */ ++ ++#ifndef __VE_NFS_H__ ++#define __VE_NFS_H__ ++ ++#ifdef CONFIG_VE ++ ++#include ++ ++#define NFS_CTX_FIELD(arg) (get_exec_env()->_##arg) ++ ++#define nlmsvc_grace_period NFS_CTX_FIELD(nlmsvc_grace_period) ++#define nlmsvc_timeout NFS_CTX_FIELD(nlmsvc_timeout) ++#define nlmsvc_users NFS_CTX_FIELD(nlmsvc_users) ++#define nlmsvc_pid NFS_CTX_FIELD(nlmsvc_pid) ++#else ++#define nlmsvc_grace_period _nlmsvc_grace_period ++#define nlmsvc_users _nlmsvc_users ++#define nlmsvc_pid _nlmsvc_pid ++#define nlmsvc_timeout _nlmsvc_timeout ++#endif ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/ve_proto.h debian/binary-custom.d/openvz/src/include/linux/ve_proto.h +--- ./include/linux/ve_proto.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/ve_proto.h 2012-11-13 15:20:15.244569070 +0000 +@@ -0,0 +1,94 @@ ++/* ++ * include/linux/ve_proto.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __VE_H__ ++#define __VE_H__ ++ ++#ifdef CONFIG_VE ++ ++struct ve_struct; ++struct seq_file; ++ ++typedef void (*ve_seq_print_t)(struct seq_file *, struct ve_struct *); ++void vzmon_register_veaddr_print_cb(ve_seq_print_t); ++void vzmon_unregister_veaddr_print_cb(ve_seq_print_t); ++ ++#ifdef CONFIG_INET ++void ip_fragment_cleanup(struct ve_struct *envid); ++void tcp_v4_kill_ve_sockets(struct ve_struct *envid); ++#ifdef CONFIG_VE_NETDEV ++int venet_init(void); ++#endif ++#else ++static inline void ip_fragment_cleanup(struct ve_struct *ve) { ; } ++#endif ++ ++extern struct list_head ve_list_head; ++#define for_each_ve(ve) list_for_each_entry((ve), &ve_list_head, ve_list) ++extern rwlock_t ve_list_lock; ++extern struct ve_struct *get_ve_by_id(envid_t); ++extern struct ve_struct *__find_ve_by_id(envid_t); ++ ++struct env_create_param3; ++extern int real_env_create(envid_t veid, unsigned flags, u32 class_id, ++ struct env_create_param3 *data, int datalen); ++extern void ve_move_task(struct task_struct *, struct ve_struct *); ++ ++int set_device_perms_ve(envid_t veid, unsigned type, dev_t dev, unsigned mask); ++int get_device_perms_ve(int dev_type, dev_t dev, int access_mode); ++void clean_device_perms_ve(envid_t veid); ++extern struct file_operations proc_devperms_ops; ++ ++enum { ++ VE_SS_CHAIN, ++ ++ VE_MAX_CHAINS ++}; ++ ++typedef int ve_hook_init_fn(void *data); ++typedef void ve_hook_fini_fn(void *data); ++ ++struct ve_hook ++{ ++ ve_hook_init_fn *init; ++ ve_hook_fini_fn *fini; ++ struct module *owner; ++ ++ /* Functions are called in ascending priority */ ++ int priority; ++ ++ /* Private part */ ++ struct list_head list; ++}; ++ ++enum { ++ HOOK_PRIO_DEFAULT = 0, ++ ++ HOOK_PRIO_FS = HOOK_PRIO_DEFAULT, ++ ++ HOOK_PRIO_NET_PRE, ++ HOOK_PRIO_NET, ++ HOOK_PRIO_NET_POST, ++ ++ HOOK_PRIO_AFTERALL = INT_MAX ++}; ++ ++extern int ve_hook_iterate_init(int chain, void *data); ++extern void ve_hook_iterate_fini(int chain, void *data); ++ ++extern void ve_hook_register(int chain, struct ve_hook *vh); ++extern void ve_hook_unregister(struct ve_hook *vh); ++#else /* CONFIG_VE */ ++#define ve_hook_register(ch, vh) do { } while (0) ++#define ve_hook_unregister(ve) do { } while (0) ++ ++#define get_device_perms_ve(t, d, a) (0) ++#endif /* CONFIG_VE */ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/ve_task.h debian/binary-custom.d/openvz/src/include/linux/ve_task.h +--- ./include/linux/ve_task.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/ve_task.h 2012-11-13 15:20:15.244569070 +0000 +@@ -0,0 +1,68 @@ ++/* ++ * include/linux/ve_task.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __VE_TASK_H__ ++#define __VE_TASK_H__ ++ ++#include ++#include ++ ++struct ve_task_info { ++/* virtualization */ ++ struct ve_struct *owner_env; ++ struct ve_struct *exec_env; ++ struct ve_struct *saved_env; ++ struct list_head vetask_list; ++ struct dentry *glob_proc_dentry; ++/* statistics: scheduling latency */ ++ cycles_t sleep_time; ++ cycles_t sched_time; ++ cycles_t sleep_stamp; ++ cycles_t wakeup_stamp; ++ seqcount_t wakeup_lock; ++}; ++ ++#define VE_TASK_INFO(task) (&(task)->ve_task_info) ++#define VE_TASK_LIST_2_TASK(lh) \ ++ list_entry(lh, struct task_struct, ve_task_info.vetask_list) ++ ++#ifdef CONFIG_VE ++extern struct ve_struct ve0; ++#define get_ve0() (&ve0) ++ ++#define ve_save_context(t) do { \ ++ t->ve_task_info.saved_env = \ ++ t->ve_task_info.exec_env; \ ++ t->ve_task_info.exec_env = get_ve0(); \ ++ } while (0) ++#define ve_restore_context(t) do { \ ++ t->ve_task_info.exec_env = \ ++ t->ve_task_info.saved_env; \ ++ } while (0) ++ ++#define get_exec_env() (current->ve_task_info.exec_env) ++#define set_exec_env(ve) ({ \ ++ struct ve_task_info *vi; \ ++ struct ve_struct *old; \ ++ \ ++ vi = ¤t->ve_task_info; \ ++ old = vi->exec_env; \ ++ vi->exec_env = ve; \ ++ old; \ ++ }) ++#else ++#define get_ve0() (NULL) ++#define get_exec_env() (NULL) ++#define set_exec_env(new_env) (NULL) ++#define ve_save_context(t) do { } while (0) ++#define ve_restore_context(t) do { } while (0) ++#endif ++ ++#endif /* __VE_TASK_H__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/veip.h debian/binary-custom.d/openvz/src/include/linux/veip.h +--- ./include/linux/veip.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/veip.h 2012-11-13 15:20:15.244569070 +0000 +@@ -0,0 +1,15 @@ ++#ifndef __VE_IP_H_ ++#define __VE_IP_H_ ++ ++struct ve_addr_struct { ++ int family; ++ __u32 key[4]; ++}; ++ ++struct sockaddr; ++ ++extern void veaddr_print(char *, int, struct ve_addr_struct *); ++extern int sockaddr_to_veaddr(struct sockaddr __user *uaddr, int addrlen, ++ struct ve_addr_struct *veaddr); ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/venet.h debian/binary-custom.d/openvz/src/include/linux/venet.h +--- ./include/linux/venet.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/venet.h 2012-11-13 15:20:15.244569070 +0000 +@@ -0,0 +1,86 @@ ++/* ++ * include/linux/venet.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _VENET_H ++#define _VENET_H ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define VEIP_HASH_SZ 512 ++ ++struct ve_struct; ++struct venet_stat; ++struct venet_stats { ++ struct net_device_stats stats; ++ struct net_device_stats *real_stats; ++}; ++ ++struct ip_entry_struct ++{ ++ struct ve_addr_struct addr; ++ struct ve_struct *active_env; ++ struct venet_stat *stat; ++ struct veip_struct *veip; ++ struct list_head ip_hash; ++ struct list_head ve_list; ++}; ++ ++struct veip_struct ++{ ++ struct list_head src_lh; ++ struct list_head dst_lh; ++ struct list_head ip_lh; ++ struct list_head list; ++ envid_t veid; ++}; ++ ++static inline struct net_device_stats * ++venet_stats(struct net_device *dev, int cpu) ++{ ++ struct venet_stats *stats; ++ stats = (struct venet_stats*)dev->priv; ++ return per_cpu_ptr(stats->real_stats, cpu); ++} ++ ++/* veip_hash_lock should be taken for write by caller */ ++void ip_entry_hash(struct ip_entry_struct *entry, struct veip_struct *veip); ++/* veip_hash_lock should be taken for write by caller */ ++void ip_entry_unhash(struct ip_entry_struct *entry); ++/* veip_hash_lock should be taken for read by caller */ ++struct ip_entry_struct *venet_entry_lookup(struct ve_addr_struct *); ++ ++/* veip_hash_lock should be taken for read by caller */ ++struct veip_struct *veip_find(envid_t veid); ++/* veip_hash_lock should be taken for write by caller */ ++struct veip_struct *veip_findcreate(envid_t veid); ++/* veip_hash_lock should be taken for write by caller */ ++void veip_put(struct veip_struct *veip); ++ ++extern struct list_head veip_lh; ++ ++int veip_start(struct ve_struct *ve); ++void veip_stop(struct ve_struct *ve); ++__exit void veip_cleanup(void); ++int veip_entry_add(struct ve_struct *ve, struct ve_addr_struct *addr); ++int veip_entry_del(envid_t veid, struct ve_addr_struct *addr); ++int venet_change_skb_owner(struct sk_buff *skb); ++ ++extern struct list_head ip_entry_hash_table[]; ++extern rwlock_t veip_hash_lock; ++ ++#ifdef CONFIG_PROC_FS ++int veip_seq_show(struct seq_file *m, void *v); ++#endif ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/veprintk.h debian/binary-custom.d/openvz/src/include/linux/veprintk.h +--- ./include/linux/veprintk.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/veprintk.h 2012-11-13 15:20:15.244569070 +0000 +@@ -0,0 +1,38 @@ ++/* ++ * include/linux/veprintk.h ++ * ++ * Copyright (C) 2006 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __VE_PRINTK_H__ ++#define __VE_PRINTK_H__ ++ ++#ifdef CONFIG_VE ++ ++#define ve_log_wait (*(get_exec_env()->_log_wait)) ++#define ve_log_start (*(get_exec_env()->_log_start)) ++#define ve_log_end (*(get_exec_env()->_log_end)) ++#define ve_logged_chars (*(get_exec_env()->_logged_chars)) ++#define ve_log_buf (get_exec_env()->log_buf) ++#define ve_log_buf_len (ve_is_super(get_exec_env()) ? \ ++ log_buf_len : VE_DEFAULT_LOG_BUF_LEN) ++#define VE_LOG_BUF_MASK (ve_log_buf_len - 1) ++#define VE_LOG_BUF(idx) (ve_log_buf[(idx) & VE_LOG_BUF_MASK]) ++ ++#else ++ ++#define ve_log_wait log_wait ++#define ve_log_start log_start ++#define ve_log_end log_end ++#define ve_logged_chars logged_chars ++#define ve_log_buf log_buf ++#define ve_log_buf_len log_buf_len ++#define VE_LOG_BUF_MASK LOG_BUF_MASK ++#define VE_LOG_BUF(idx) LOG_BUF(idx) ++ ++#endif /* CONFIG_VE */ ++#endif /* __VE_PRINTK_H__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/veth.h debian/binary-custom.d/openvz/src/include/linux/veth.h +--- ./include/linux/veth.h 2012-06-12 16:25:24.154312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/veth.h 2012-11-13 15:20:15.248569072 +0000 +@@ -1,3 +1,12 @@ ++/* ++ * include/linux/veth.h ++ * ++ * Copyright (C) 2007 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ + #ifndef __NET_VETH_H_ + #define __NET_VETH_H_ + +@@ -9,4 +18,28 @@ + #define VETH_INFO_MAX (__VETH_INFO_MAX - 1) + }; + ++#ifdef __KERNEL__ ++struct veth_struct ++{ ++ struct net_device_stats stats; ++ struct net_device *pair; ++ struct list_head hwaddr_list; ++ struct net_device_stats *real_stats; ++ int allow_mac_change; ++}; ++ ++#define veth_from_netdev(dev) \ ++ ((struct veth_struct *)(netdev_priv(dev))) ++static inline struct net_device * veth_to_netdev(struct veth_struct *veth) ++{ ++ return (struct net_device *)((char *)veth - ((sizeof(struct net_device) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST)); ++} ++#endif ++ ++static inline struct net_device_stats * ++veth_stats(struct net_device *dev, int cpuid) ++{ ++ return per_cpu_ptr(veth_from_netdev(dev)->real_stats, cpuid); ++} ++ + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/virtinfo.h debian/binary-custom.d/openvz/src/include/linux/virtinfo.h +--- ./include/linux/virtinfo.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/virtinfo.h 2012-11-13 15:20:15.248569072 +0000 +@@ -0,0 +1,99 @@ ++/* ++ * include/linux/virtinfo.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __LINUX_VIRTINFO_H ++#define __LINUX_VIRTINFO_H ++ ++#include ++#include ++#include ++ ++struct vnotifier_block ++{ ++ int (*notifier_call)(struct vnotifier_block *self, ++ unsigned long, void *, int); ++ struct vnotifier_block *next; ++ int priority; ++}; ++ ++extern struct semaphore virtinfo_sem; ++void __virtinfo_notifier_register(int type, struct vnotifier_block *nb); ++void virtinfo_notifier_register(int type, struct vnotifier_block *nb); ++void virtinfo_notifier_unregister(int type, struct vnotifier_block *nb); ++int virtinfo_notifier_call(int type, unsigned long n, void *data); ++ ++struct page_info { ++ unsigned long nr_file_dirty; ++ unsigned long nr_writeback; ++ unsigned long nr_anon_pages; ++ unsigned long nr_file_mapped; ++ unsigned long nr_slab_rec; ++ unsigned long nr_slab_unrec; ++ unsigned long nr_pagetable; ++ unsigned long nr_unstable_nfs; ++ unsigned long nr_bounce; ++}; ++ ++struct meminfo { ++ struct sysinfo si; ++ struct page_info pi; ++ unsigned long active, inactive; ++ unsigned long cache, swapcache; ++ unsigned long committed_space; ++ unsigned long allowed; ++ unsigned long vmalloc_total, vmalloc_used, vmalloc_largest; ++}; ++ ++#define VIRTINFO_MEMINFO 0 ++#define VIRTINFO_ENOUGHMEM 1 ++#define VIRTINFO_DOFORK 2 ++#define VIRTINFO_DOEXIT 3 ++#define VIRTINFO_DOEXECVE 4 ++#define VIRTINFO_DOFORKRET 5 ++#define VIRTINFO_DOFORKPOST 6 ++#define VIRTINFO_EXIT 7 ++#define VIRTINFO_EXITMMAP 8 ++#define VIRTINFO_EXECMMAP 9 ++#define VIRTINFO_OUTOFMEM 10 ++#define VIRTINFO_PAGEIN 11 ++#define VIRTINFO_SYSINFO 12 ++#define VIRTINFO_NEWUBC 13 ++#define VIRTINFO_VMSTAT 14 ++ ++enum virt_info_types { ++ VITYPE_GENERAL, ++ VITYPE_FAUDIT, ++ VITYPE_QUOTA, ++ VITYPE_SCP, ++ ++ VIRT_TYPES ++}; ++ ++#ifdef CONFIG_VZ_GENCALLS ++ ++static inline int virtinfo_gencall(unsigned long n, void *data) ++{ ++ int r; ++ ++ r = virtinfo_notifier_call(VITYPE_GENERAL, n, data); ++ if (r & NOTIFY_FAIL) ++ return -ENOBUFS; ++ if (r & NOTIFY_OK) ++ return -ERESTARTNOINTR; ++ return 0; ++} ++ ++#else ++ ++#define virtinfo_gencall(n, data) 0 ++ ++#endif ++ ++#endif /* __LINUX_VIRTINFO_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/virtinfoscp.h debian/binary-custom.d/openvz/src/include/linux/virtinfoscp.h +--- ./include/linux/virtinfoscp.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/virtinfoscp.h 2012-11-13 15:20:15.248569072 +0000 +@@ -0,0 +1,21 @@ ++#ifndef __VIRTINFO_SCP_H__ ++#define __VIRTINFO_SCP_H__ ++ ++/* ++ * Dump and restore operations are non-symmetric. ++ * With respect to finish/fail hooks, 2 dump hooks are called from ++ * different proc operations, but restore hooks are called from a single one. ++ */ ++#define VIRTINFO_SCP_COLLECT 0x10 ++#define VIRTINFO_SCP_DUMP 0x11 ++#define VIRTINFO_SCP_DMPFIN 0x12 ++#define VIRTINFO_SCP_RSTCHECK 0x13 ++#define VIRTINFO_SCP_RESTORE 0x14 ++#define VIRTINFO_SCP_RSTFAIL 0x15 ++ ++#define VIRTINFO_SCP_RSTTSK 0x20 ++#define VIRTINFO_SCP_RSTMM 0x21 ++ ++#define VIRTNOTIFY_CHANGE 0x100 ++ ++#endif /* __VIRTINFO_SCP_H__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vmalloc.h debian/binary-custom.d/openvz/src/include/linux/vmalloc.h +--- ./include/linux/vmalloc.h 2012-06-12 16:25:24.158312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vmalloc.h 2012-11-13 15:20:15.248569072 +0000 +@@ -22,6 +22,10 @@ + #define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */ + #endif + ++/* align size to 2^n page boundary */ ++#define POWER2_PAGE_ALIGN(size) \ ++ ((typeof(size))(1UL << (PAGE_SHIFT + get_order(size)))) ++ + struct vm_struct { + /* keep next,addr,size together to speedup lookups */ + struct vm_struct *next; +@@ -37,12 +41,16 @@ + * Highlevel APIs for driver use + */ + extern void *vmalloc(unsigned long size); ++extern void *ub_vmalloc(unsigned long size); + extern void *vmalloc_user(unsigned long size); + extern void *vmalloc_node(unsigned long size, int node); ++extern void *ub_vmalloc_node(unsigned long size, int node); + extern void *vmalloc_exec(unsigned long size); + extern void *vmalloc_32(unsigned long size); + extern void *vmalloc_32_user(unsigned long size); + extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); ++extern void *vmalloc_best(unsigned long size); ++extern void *ub_vmalloc_best(unsigned long size); + extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, + pgprot_t prot); + extern void vfree(void *addr); +@@ -68,6 +76,9 @@ + extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); + extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, + unsigned long start, unsigned long end); ++extern struct vm_struct * get_vm_area_best(unsigned long size, ++ unsigned long flags); ++extern void vprintstat(void); + extern struct vm_struct *get_vm_area_node(unsigned long size, + unsigned long flags, int node, + gfp_t gfp_mask); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vmstat.h debian/binary-custom.d/openvz/src/include/linux/vmstat.h +--- ./include/linux/vmstat.h 2012-06-12 16:25:24.158312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vmstat.h 2012-11-13 15:20:15.248569072 +0000 +@@ -79,6 +79,7 @@ + put_cpu(); + } + ++extern unsigned long vm_events(enum vm_event_item i); + extern void all_vm_events(unsigned long *); + #ifdef CONFIG_HOTPLUG + extern void vm_events_fold_cpu(int cpu); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzcalluser.h debian/binary-custom.d/openvz/src/include/linux/vzcalluser.h +--- ./include/linux/vzcalluser.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzcalluser.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,242 @@ ++/* ++ * include/linux/vzcalluser.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _LINUX_VZCALLUSER_H ++#define _LINUX_VZCALLUSER_H ++ ++#include ++#include ++ ++#define KERN_VZ_PRIV_RANGE 51 ++ ++#ifndef __ENVID_T_DEFINED__ ++typedef unsigned envid_t; ++#define __ENVID_T_DEFINED__ ++#endif ++ ++#ifndef __KERNEL__ ++#define __user ++#endif ++ ++/* ++ * VE management ioctls ++ */ ++ ++struct vzctl_old_env_create { ++ envid_t veid; ++ unsigned flags; ++#define VE_CREATE 1 /* Create VE, VE_ENTER added automatically */ ++#define VE_EXCLUSIVE 2 /* Fail if exists */ ++#define VE_ENTER 4 /* Enter existing VE */ ++#define VE_TEST 8 /* Test if VE exists */ ++#define VE_LOCK 16 /* Do not allow entering created VE */ ++#define VE_SKIPLOCK 32 /* Allow entering embrion VE */ ++ __u32 addr; ++}; ++ ++struct vzctl_mark_env_to_down { ++ envid_t veid; ++}; ++ ++struct vzctl_setdevperms { ++ envid_t veid; ++ unsigned type; ++#define VE_USE_MAJOR 010 /* Test MAJOR supplied in rule */ ++#define VE_USE_MINOR 030 /* Test MINOR supplied in rule */ ++#define VE_USE_MASK 030 /* Testing mask, VE_USE_MAJOR|VE_USE_MINOR */ ++ unsigned dev; ++ unsigned mask; ++}; ++ ++struct vzctl_ve_netdev { ++ envid_t veid; ++ int op; ++#define VE_NETDEV_ADD 1 ++#define VE_NETDEV_DEL 2 ++ char __user *dev_name; ++}; ++ ++struct vzctl_ve_meminfo { ++ envid_t veid; ++ unsigned long val; ++}; ++ ++/* these masks represent modules */ ++#define VE_IP_IPTABLES_MOD (1U<<0) ++#define VE_IP_FILTER_MOD (1U<<1) ++#define VE_IP_MANGLE_MOD (1U<<2) ++#define VE_IP_CONNTRACK_MOD (1U<<14) ++#define VE_IP_CONNTRACK_FTP_MOD (1U<<15) ++#define VE_IP_CONNTRACK_IRC_MOD (1U<<16) ++#define VE_IP_NAT_MOD (1U<<20) ++#define VE_IP_NAT_FTP_MOD (1U<<21) ++#define VE_IP_NAT_IRC_MOD (1U<<22) ++#define VE_IP_IPTABLES6_MOD (1U<<26) ++#define VE_IP_FILTER6_MOD (1U<<27) ++#define VE_IP_MANGLE6_MOD (1U<<28) ++#define VE_IP_IPTABLE_NAT_MOD (1U<<29) ++#define VE_NF_CONNTRACK_MOD (1U<<30) ++ ++/* these masks represent modules with their dependences */ ++#define VE_IP_IPTABLES (VE_IP_IPTABLES_MOD) ++#define VE_IP_FILTER (VE_IP_FILTER_MOD \ ++ | VE_IP_IPTABLES) ++#define VE_IP_MANGLE (VE_IP_MANGLE_MOD \ ++ | VE_IP_IPTABLES) ++#define VE_IP_IPTABLES6 (VE_IP_IPTABLES6_MOD) ++#define VE_IP_FILTER6 (VE_IP_FILTER6_MOD | VE_IP_IPTABLES6) ++#define VE_IP_MANGLE6 (VE_IP_MANGLE6_MOD | VE_IP_IPTABLES6) ++#define VE_NF_CONNTRACK (VE_NF_CONNTRACK_MOD | VE_IP_IPTABLES) ++#define VE_IP_CONNTRACK (VE_IP_CONNTRACK_MOD \ ++ | VE_IP_IPTABLES) ++#define VE_IP_CONNTRACK_FTP (VE_IP_CONNTRACK_FTP_MOD \ ++ | VE_IP_CONNTRACK) ++#define VE_IP_CONNTRACK_IRC (VE_IP_CONNTRACK_IRC_MOD \ ++ | VE_IP_CONNTRACK) ++#define VE_IP_NAT (VE_IP_NAT_MOD \ ++ | VE_IP_CONNTRACK) ++#define VE_IP_NAT_FTP (VE_IP_NAT_FTP_MOD \ ++ | VE_IP_NAT | VE_IP_CONNTRACK_FTP) ++#define VE_IP_NAT_IRC (VE_IP_NAT_IRC_MOD \ ++ | VE_IP_NAT | VE_IP_CONNTRACK_IRC) ++#define VE_IP_IPTABLE_NAT (VE_IP_IPTABLE_NAT_MOD | VE_IP_CONNTRACK) ++ ++/* safe iptables mask to be used by default */ ++#define VE_IP_DEFAULT \ ++ (VE_IP_IPTABLES | \ ++ VE_IP_FILTER | VE_IP_MANGLE) ++ ++#define VE_IPT_CMP(x,y) (((x) & (y)) == (y)) ++ ++struct vzctl_env_create_cid { ++ envid_t veid; ++ unsigned flags; ++ __u32 class_id; ++}; ++ ++struct vzctl_env_create { ++ envid_t veid; ++ unsigned flags; ++ __u32 class_id; ++}; ++ ++struct env_create_param { ++ __u64 iptables_mask; ++}; ++ ++#define VZCTL_ENV_CREATE_DATA_MINLEN sizeof(struct env_create_param) ++ ++struct env_create_param2 { ++ __u64 iptables_mask; ++ __u64 feature_mask; ++ __u32 total_vcpus; /* 0 - don't care, same as in host */ ++}; ++ ++struct env_create_param3 { ++ __u64 iptables_mask; ++ __u64 feature_mask; ++ __u32 total_vcpus; ++ __u32 pad; ++ __u64 known_features; ++}; ++ ++#define VE_FEATURE_SYSFS (1ULL << 0) ++#define VE_FEATURE_NFS (1ULL << 1) ++#define VE_FEATURE_DEF_PERMS (1ULL << 2) ++ ++#define VE_FEATURES_OLD (VE_FEATURE_SYSFS) ++#define VE_FEATURES_DEF (VE_FEATURE_SYSFS | \ ++ VE_FEATURE_DEF_PERMS) ++ ++typedef struct env_create_param3 env_create_param_t; ++#define VZCTL_ENV_CREATE_DATA_MAXLEN sizeof(env_create_param_t) ++ ++struct vzctl_env_create_data { ++ envid_t veid; ++ unsigned flags; ++ __u32 class_id; ++ env_create_param_t __user *data; ++ int datalen; ++}; ++ ++struct vz_load_avg { ++ int val_int; ++ int val_frac; ++}; ++ ++struct vz_cpu_stat { ++ unsigned long user_jif; ++ unsigned long nice_jif; ++ unsigned long system_jif; ++ unsigned long uptime_jif; ++ __u64 idle_clk; ++ __u64 strv_clk; ++ __u64 uptime_clk; ++ struct vz_load_avg avenrun[3]; /* loadavg data */ ++}; ++ ++struct vzctl_cpustatctl { ++ envid_t veid; ++ struct vz_cpu_stat __user *cpustat; ++}; ++ ++#define VZCTLTYPE '.' ++#define VZCTL_OLD_ENV_CREATE _IOW(VZCTLTYPE, 0, \ ++ struct vzctl_old_env_create) ++#define VZCTL_MARK_ENV_TO_DOWN _IOW(VZCTLTYPE, 1, \ ++ struct vzctl_mark_env_to_down) ++#define VZCTL_SETDEVPERMS _IOW(VZCTLTYPE, 2, \ ++ struct vzctl_setdevperms) ++#define VZCTL_ENV_CREATE_CID _IOW(VZCTLTYPE, 4, \ ++ struct vzctl_env_create_cid) ++#define VZCTL_ENV_CREATE _IOW(VZCTLTYPE, 5, \ ++ struct vzctl_env_create) ++#define VZCTL_GET_CPU_STAT _IOW(VZCTLTYPE, 6, \ ++ struct vzctl_cpustatctl) ++#define VZCTL_ENV_CREATE_DATA _IOW(VZCTLTYPE, 10, \ ++ struct vzctl_env_create_data) ++#define VZCTL_VE_NETDEV _IOW(VZCTLTYPE, 11, \ ++ struct vzctl_ve_netdev) ++#define VZCTL_VE_MEMINFO _IOW(VZCTLTYPE, 13, \ ++ struct vzctl_ve_meminfo) ++ ++#ifdef __KERNEL__ ++#ifdef CONFIG_COMPAT ++#include ++ ++struct compat_vzctl_ve_netdev { ++ envid_t veid; ++ int op; ++ compat_uptr_t dev_name; ++}; ++ ++struct compat_vzctl_ve_meminfo { ++ envid_t veid; ++ compat_ulong_t val; ++}; ++ ++struct compat_vzctl_env_create_data { ++ envid_t veid; ++ unsigned flags; ++ __u32 class_id; ++ compat_uptr_t data; ++ int datalen; ++}; ++ ++#define VZCTL_COMPAT_ENV_CREATE_DATA _IOW(VZCTLTYPE, 10, \ ++ struct compat_vzctl_env_create_data) ++#define VZCTL_COMPAT_VE_NETDEV _IOW(VZCTLTYPE, 11, \ ++ struct compat_vzctl_ve_netdev) ++#define VZCTL_COMPAT_VE_MEMINFO _IOW(VZCTLTYPE, 13, \ ++ struct compat_vzctl_ve_meminfo) ++#endif ++#endif ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzctl.h debian/binary-custom.d/openvz/src/include/linux/vzctl.h +--- ./include/linux/vzctl.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzctl.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,30 @@ ++/* ++ * include/linux/vzctl.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _LINUX_VZCTL_H ++#define _LINUX_VZCTL_H ++ ++#include ++ ++struct module; ++struct inode; ++struct file; ++struct vzioctlinfo { ++ unsigned type; ++ int (*ioctl)(struct file *, unsigned int, unsigned long); ++ int (*compat_ioctl)(struct file *, unsigned int, unsigned long); ++ struct module *owner; ++ struct list_head list; ++}; ++ ++extern void vzioctl_register(struct vzioctlinfo *inf); ++extern void vzioctl_unregister(struct vzioctlinfo *inf); ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzctl_quota.h debian/binary-custom.d/openvz/src/include/linux/vzctl_quota.h +--- ./include/linux/vzctl_quota.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzctl_quota.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,74 @@ ++/* ++ * include/linux/vzctl_quota.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __LINUX_VZCTL_QUOTA_H__ ++#define __LINUX_VZCTL_QUOTA_H__ ++ ++#include ++ ++#ifndef __KERNEL__ ++#define __user ++#endif ++ ++/* ++ * Quota management ioctl ++ */ ++ ++struct vz_quota_stat; ++struct vzctl_quotactl { ++ int cmd; ++ unsigned int quota_id; ++ struct vz_quota_stat __user *qstat; ++ char __user *ve_root; ++}; ++ ++struct vzctl_quotaugidctl { ++ int cmd; /* subcommand */ ++ unsigned int quota_id; /* quota id where it applies to */ ++ unsigned int ugid_index;/* for reading statistic. index of first ++ uid/gid record to read */ ++ unsigned int ugid_size; /* size of ugid_buf array */ ++ void *addr; /* user-level buffer */ ++}; ++ ++#define VZDQCTLTYPE '+' ++#define VZCTL_QUOTA_DEPR_CTL _IOWR(VZDQCTLTYPE, 1, \ ++ struct vzctl_quotactl) ++#define VZCTL_QUOTA_NEW_CTL _IOWR(VZDQCTLTYPE, 2, \ ++ struct vzctl_quotactl) ++#define VZCTL_QUOTA_UGID_CTL _IOWR(VZDQCTLTYPE, 3, \ ++ struct vzctl_quotaugidctl) ++ ++#ifdef __KERNEL__ ++#ifdef CONFIG_COMPAT ++struct compat_vzctl_quotactl { ++ int cmd; ++ unsigned int quota_id; ++ compat_uptr_t qstat; ++ compat_uptr_t ve_root; ++}; ++ ++struct compat_vzctl_quotaugidctl { ++ int cmd; /* subcommand */ ++ unsigned int quota_id; /* quota id where it applies to */ ++ unsigned int ugid_index;/* for reading statistic. index of first ++ uid/gid record to read */ ++ unsigned int ugid_size; /* size of ugid_buf array */ ++ compat_uptr_t addr; /* user-level buffer */ ++}; ++ ++#define VZCTL_COMPAT_QUOTA_CTL _IOWR(VZDQCTLTYPE, 2, \ ++ struct compat_vzctl_quotactl) ++#define VZCTL_COMPAT_QUOTA_UGID_CTL _IOWR(VZDQCTLTYPE, 3, \ ++ struct compat_vzctl_quotaugidctl) ++#endif ++#endif ++ ++#endif /* __LINUX_VZCTL_QUOTA_H__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzctl_venet.h debian/binary-custom.d/openvz/src/include/linux/vzctl_venet.h +--- ./include/linux/vzctl_venet.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzctl_venet.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,51 @@ ++/* ++ * include/linux/vzctl_venet.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _VZCTL_VENET_H ++#define _VZCTL_VENET_H ++ ++#include ++#include ++#include ++ ++#ifndef __ENVID_T_DEFINED__ ++typedef unsigned envid_t; ++#define __ENVID_T_DEFINED__ ++#endif ++ ++struct vzctl_ve_ip_map { ++ envid_t veid; ++ int op; ++#define VE_IP_ADD 1 ++#define VE_IP_DEL 2 ++ struct sockaddr *addr; ++ int addrlen; ++}; ++ ++#define VENETCTLTYPE '(' ++ ++#define VENETCTL_VE_IP_MAP _IOW(VENETCTLTYPE, 3, \ ++ struct vzctl_ve_ip_map) ++ ++#ifdef __KERNEL__ ++#ifdef CONFIG_COMPAT ++struct compat_vzctl_ve_ip_map { ++ envid_t veid; ++ int op; ++ compat_uptr_t addr; ++ int addrlen; ++}; ++ ++#define VENETCTL_COMPAT_VE_IP_MAP _IOW(VENETCTLTYPE, 3, \ ++ struct compat_vzctl_ve_ip_map) ++#endif ++#endif ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzctl_veth.h debian/binary-custom.d/openvz/src/include/linux/vzctl_veth.h +--- ./include/linux/vzctl_veth.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzctl_veth.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,42 @@ ++/* ++ * include/linux/vzctl_veth.h ++ * ++ * Copyright (C) 2006 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _VZCTL_VETH_H ++#define _VZCTL_VETH_H ++ ++#include ++#include ++ ++#ifndef __ENVID_T_DEFINED__ ++typedef unsigned envid_t; ++#define __ENVID_T_DEFINED__ ++#endif ++ ++struct vzctl_ve_hwaddr { ++ envid_t veid; ++ int op; ++#define VE_ETH_ADD 1 ++#define VE_ETH_DEL 2 ++#define VE_ETH_ALLOW_MAC_CHANGE 3 ++#define VE_ETH_DENY_MAC_CHANGE 4 ++ unsigned char dev_addr[6]; ++ int addrlen; ++ char dev_name[16]; ++ unsigned char dev_addr_ve[6]; ++ int addrlen_ve; ++ char dev_name_ve[16]; ++}; ++ ++#define VETHCTLTYPE '[' ++ ++#define VETHCTL_VE_HWADDR _IOW(VETHCTLTYPE, 3, \ ++ struct vzctl_ve_hwaddr) ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzdq_tree.h debian/binary-custom.d/openvz/src/include/linux/vzdq_tree.h +--- ./include/linux/vzdq_tree.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzdq_tree.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,99 @@ ++/* ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * This file contains Virtuozzo disk quota tree definition ++ */ ++ ++#ifndef _VZDQ_TREE_H ++#define _VZDQ_TREE_H ++ ++#include ++#include ++ ++typedef unsigned int quotaid_t; ++#define QUOTAID_BITS 32 ++#define QUOTAID_BBITS 4 ++#define QUOTAID_EBITS 8 ++ ++#if QUOTAID_EBITS % QUOTAID_BBITS ++#error Quota bit assumption failure ++#endif ++ ++#define QUOTATREE_BSIZE (1 << QUOTAID_BBITS) ++#define QUOTATREE_BMASK (QUOTATREE_BSIZE - 1) ++#define QUOTATREE_DEPTH ((QUOTAID_BITS + QUOTAID_BBITS - 1) \ ++ / QUOTAID_BBITS) ++#define QUOTATREE_EDEPTH ((QUOTAID_BITS + QUOTAID_EBITS - 1) \ ++ / QUOTAID_EBITS) ++#define QUOTATREE_BSHIFT(lvl) ((QUOTATREE_DEPTH - (lvl) - 1) * QUOTAID_BBITS) ++ ++/* ++ * Depth of keeping unused node (not inclusive). ++ * 0 means release all nodes including root, ++ * QUOTATREE_DEPTH means never release nodes. ++ * Current value: release all nodes strictly after QUOTATREE_EDEPTH ++ * (measured in external shift units). ++ */ ++#define QUOTATREE_CDEPTH (QUOTATREE_DEPTH \ ++ - 2 * QUOTATREE_DEPTH / QUOTATREE_EDEPTH \ ++ + 1) ++ ++/* ++ * Levels 0..(QUOTATREE_DEPTH-1) are tree nodes. ++ * On level i the maximal number of nodes is 2^(i*QUOTAID_BBITS), ++ * and each node contains 2^QUOTAID_BBITS pointers. ++ * Level 0 is a (single) tree root node. ++ * ++ * Nodes of level (QUOTATREE_DEPTH-1) contain pointers to caller's data. ++ * Nodes of lower levels contain pointers to nodes. ++ * ++ * Double pointer in array of i-level node, pointing to a (i+1)-level node ++ * (such as inside quotatree_find_state) are marked by level (i+1), not i. ++ * Level 0 double pointer is a pointer to root inside tree struct. ++ * ++ * The tree is permanent, i.e. all index blocks allocated are keeped alive to ++ * preserve the blocks numbers in the quota file tree to keep its changes ++ * locally. ++ */ ++struct quotatree_node { ++ struct list_head list; ++ quotaid_t num; ++ void *blocks[QUOTATREE_BSIZE]; ++}; ++ ++struct quotatree_level { ++ struct list_head usedlh, freelh; ++ quotaid_t freenum; ++}; ++ ++struct quotatree_tree { ++ struct quotatree_level levels[QUOTATREE_DEPTH]; ++ struct quotatree_node *root; ++ unsigned int leaf_num; ++}; ++ ++struct quotatree_find_state { ++ void **block; ++ int level; ++}; ++ ++/* number of leafs (objects) and leaf level of the tree */ ++#define QTREE_LEAFNUM(tree) ((tree)->leaf_num) ++#define QTREE_LEAFLVL(tree) (&(tree)->levels[QUOTATREE_DEPTH - 1]) ++ ++struct quotatree_tree *quotatree_alloc(void); ++void *quotatree_find(struct quotatree_tree *tree, quotaid_t id, ++ struct quotatree_find_state *st); ++int quotatree_insert(struct quotatree_tree *tree, quotaid_t id, ++ struct quotatree_find_state *st, void *data); ++void quotatree_remove(struct quotatree_tree *tree, quotaid_t id); ++void quotatree_free(struct quotatree_tree *tree, void (*dtor)(void *)); ++void *quotatree_get_next(struct quotatree_tree *tree, quotaid_t id); ++void *quotatree_leaf_byindex(struct quotatree_tree *tree, unsigned int index); ++ ++#endif /* _VZDQ_TREE_H */ ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzevent.h debian/binary-custom.d/openvz/src/include/linux/vzevent.h +--- ./include/linux/vzevent.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzevent.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,13 @@ ++#ifndef __LINUX_VZ_EVENT_H__ ++#define __LINUX_VZ_EVENT_H__ ++ ++#if defined(CONFIG_VZ_EVENT) || defined(CONFIG_VZ_EVENT_MODULE) ++extern int vzevent_send(int msg, const char *attrs_fmt, ...); ++#else ++static inline int vzevent_send(int msg, const char *attrs_fmt, ...) ++{ ++ return 0; ++} ++#endif ++ ++#endif /* __LINUX_VZ_EVENT_H__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzquota.h debian/binary-custom.d/openvz/src/include/linux/vzquota.h +--- ./include/linux/vzquota.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzquota.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,380 @@ ++/* ++ * ++ * Copyright (C) 2001-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * This file contains Virtuozzo disk quota implementation ++ */ ++ ++#ifndef _VZDQUOTA_H ++#define _VZDQUOTA_H ++ ++#include ++#include ++ ++/* vzquotactl syscall commands */ ++#define VZ_DQ_CREATE 5 /* create quota master block */ ++#define VZ_DQ_DESTROY 6 /* destroy qmblk */ ++#define VZ_DQ_ON 7 /* mark dentry with already created qmblk */ ++#define VZ_DQ_OFF 8 /* remove mark, don't destroy qmblk */ ++#define VZ_DQ_SETLIMIT 9 /* set new limits */ ++#define VZ_DQ_GETSTAT 10 /* get usage statistic */ ++#define VZ_DQ_OFF_FORCED 11 /* forced off */ ++/* set of syscalls to maintain UGID quotas */ ++#define VZ_DQ_UGID_GETSTAT 1 /* get usage/limits for ugid(s) */ ++#define VZ_DQ_UGID_ADDSTAT 2 /* set usage/limits statistic for ugid(s) */ ++#define VZ_DQ_UGID_GETGRACE 3 /* get expire times */ ++#define VZ_DQ_UGID_SETGRACE 4 /* set expire times */ ++#define VZ_DQ_UGID_GETCONFIG 5 /* get ugid_max limit, cnt, flags of qmblk */ ++#define VZ_DQ_UGID_SETCONFIG 6 /* set ugid_max limit, flags of qmblk */ ++#define VZ_DQ_UGID_SETLIMIT 7 /* set ugid B/I limits */ ++#define VZ_DQ_UGID_SETINFO 8 /* set ugid info */ ++ ++/* common structure for vz and ugid quota */ ++struct dq_stat { ++ /* blocks limits */ ++ __u64 bhardlimit; /* absolute limit in bytes */ ++ __u64 bsoftlimit; /* preferred limit in bytes */ ++ time_t btime; /* time limit for excessive disk use */ ++ __u64 bcurrent; /* current bytes count */ ++ /* inodes limits */ ++ __u32 ihardlimit; /* absolute limit on allocated inodes */ ++ __u32 isoftlimit; /* preferred inode limit */ ++ time_t itime; /* time limit for excessive inode use */ ++ __u32 icurrent; /* current # allocated inodes */ ++}; ++ ++/* One second resolution for grace times */ ++#define CURRENT_TIME_SECONDS (get_seconds()) ++ ++/* Values for dq_info->flags */ ++#define VZ_QUOTA_INODES 0x01 /* inodes limit warning printed */ ++#define VZ_QUOTA_SPACE 0x02 /* space limit warning printed */ ++ ++struct dq_info { ++ time_t bexpire; /* expire timeout for excessive disk use */ ++ time_t iexpire; /* expire timeout for excessive inode use */ ++ unsigned flags; /* see previos defines */ ++}; ++ ++struct vz_quota_stat { ++ struct dq_stat dq_stat; ++ struct dq_info dq_info; ++}; ++ ++/* UID/GID interface record - for user-kernel level exchange */ ++struct vz_quota_iface { ++ unsigned int qi_id; /* UID/GID this applies to */ ++ unsigned int qi_type; /* USRQUOTA|GRPQUOTA */ ++ struct dq_stat qi_stat; /* limits, options, usage stats */ ++}; ++ ++#ifdef CONFIG_COMPAT ++#include ++struct compat_dq_stat { ++ /* blocks limits */ ++ __u64 bhardlimit; /* absolute limit in bytes */ ++ __u64 bsoftlimit; /* preferred limit in bytes */ ++ compat_time_t btime; /* time limit for excessive disk use */ ++ __u64 bcurrent; /* current bytes count */ ++ /* inodes limits */ ++ __u32 ihardlimit; /* absolute limit on allocated inodes */ ++ __u32 isoftlimit; /* preferred inode limit */ ++ compat_time_t itime; /* time limit for excessive inode use */ ++ __u32 icurrent; /* current # allocated inodes */ ++}; ++ ++struct compat_dq_info { ++ compat_time_t bexpire; /* expire timeout for excessive disk use */ ++ compat_time_t iexpire; /* expire timeout for excessive inode use */ ++ unsigned flags; /* see previos defines */ ++}; ++ ++struct compat_vz_quota_stat { ++ struct compat_dq_stat dq_stat; ++ struct compat_dq_info dq_info; ++}; ++ ++struct compat_vz_quota_iface { ++ unsigned int qi_id; /* UID/GID this applies to */ ++ unsigned int qi_type; /* USRQUOTA|GRPQUOTA */ ++ struct compat_dq_stat qi_stat; /* limits, options, usage stats */ ++}; ++ ++static inline void compat_dqstat2dqstat(struct compat_dq_stat *odqs, ++ struct dq_stat *dqs) ++{ ++ dqs->bhardlimit = odqs->bhardlimit; ++ dqs->bsoftlimit = odqs->bsoftlimit; ++ dqs->bcurrent = odqs->bcurrent; ++ dqs->btime = odqs->btime; ++ ++ dqs->ihardlimit = odqs->ihardlimit; ++ dqs->isoftlimit = odqs->isoftlimit; ++ dqs->icurrent = odqs->icurrent; ++ dqs->itime = odqs->itime; ++} ++ ++static inline void compat_dqinfo2dqinfo(struct compat_dq_info *odqi, ++ struct dq_info *dqi) ++{ ++ dqi->bexpire = odqi->bexpire; ++ dqi->iexpire = odqi->iexpire; ++ dqi->flags = odqi->flags; ++} ++ ++static inline void dqstat2compat_dqstat(struct dq_stat *dqs, ++ struct compat_dq_stat *odqs) ++{ ++ odqs->bhardlimit = dqs->bhardlimit; ++ odqs->bsoftlimit = dqs->bsoftlimit; ++ odqs->bcurrent = dqs->bcurrent; ++ odqs->btime = (compat_time_t)dqs->btime; ++ ++ odqs->ihardlimit = dqs->ihardlimit; ++ odqs->isoftlimit = dqs->isoftlimit; ++ odqs->icurrent = dqs->icurrent; ++ odqs->itime = (compat_time_t)dqs->itime; ++} ++ ++static inline void dqinfo2compat_dqinfo(struct dq_info *dqi, ++ struct compat_dq_info *odqi) ++{ ++ odqi->bexpire = (compat_time_t)dqi->bexpire; ++ odqi->iexpire = (compat_time_t)dqi->iexpire; ++ odqi->flags = dqi->flags; ++} ++#endif ++ ++/* values for flags and dq_flags */ ++/* this flag is set if the userspace has been unable to provide usage ++ * information about all ugids ++ * if the flag is set, we don't allocate new UG quota blocks (their ++ * current usage is unknown) or free existing UG quota blocks (not to ++ * lose information that this block is ok) */ ++#define VZDQUG_FIXED_SET 0x01 ++/* permit to use ugid quota */ ++#define VZDQUG_ON 0x02 ++#define VZDQ_USRQUOTA 0x10 ++#define VZDQ_GRPQUOTA 0x20 ++#define VZDQ_NOACT 0x1000 /* not actual */ ++#define VZDQ_NOQUOT 0x2000 /* not under quota tree */ ++ ++struct vz_quota_ugid_stat { ++ unsigned int limit; /* max amount of ugid records */ ++ unsigned int count; /* amount of ugid records */ ++ unsigned int flags; ++}; ++ ++struct vz_quota_ugid_setlimit { ++ unsigned int type; /* quota type (USR/GRP) */ ++ unsigned int id; /* ugid */ ++ struct if_dqblk dqb; /* limits info */ ++}; ++ ++struct vz_quota_ugid_setinfo { ++ unsigned int type; /* quota type (USR/GRP) */ ++ struct if_dqinfo dqi; /* grace info */ ++}; ++ ++#ifdef __KERNEL__ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Values for dq_info flags */ ++#define VZ_QUOTA_INODES 0x01 /* inodes limit warning printed */ ++#define VZ_QUOTA_SPACE 0x02 /* space limit warning printed */ ++ ++/* values for dq_state */ ++#define VZDQ_STARTING 0 /* created, not turned on yet */ ++#define VZDQ_WORKING 1 /* quota created, turned on */ ++#define VZDQ_STOPING 2 /* created, turned on and off */ ++ ++/* master quota record - one per veid */ ++struct vz_quota_master { ++ struct list_head dq_hash; /* next quota in hash list */ ++ atomic_t dq_count; /* inode reference count */ ++ unsigned int dq_flags; /* see VZDQUG_FIXED_SET */ ++ unsigned int dq_state; /* see values above */ ++ unsigned int dq_id; /* VEID this applies to */ ++ struct dq_stat dq_stat; /* limits, grace, usage stats */ ++ struct dq_info dq_info; /* grace times and flags */ ++ spinlock_t dq_data_lock; /* for dq_stat */ ++ ++ struct semaphore dq_sem; /* semaphore to protect ++ ugid tree */ ++ ++ struct list_head dq_ilink_list; /* list of vz_quota_ilink */ ++ struct quotatree_tree *dq_uid_tree; /* vz_quota_ugid tree for UIDs */ ++ struct quotatree_tree *dq_gid_tree; /* vz_quota_ugid tree for GIDs */ ++ unsigned int dq_ugid_count; /* amount of ugid records */ ++ unsigned int dq_ugid_max; /* max amount of ugid records */ ++ struct dq_info dq_ugid_info[MAXQUOTAS]; /* ugid grace times */ ++ ++ struct dentry *dq_root_dentry;/* dentry of fs tree */ ++ struct vfsmount *dq_root_mnt; /* vfsmnt of this dentry */ ++ struct super_block *dq_sb; /* superblock of our quota root */ ++}; ++ ++/* UID/GID quota record - one per pair (quota_master, uid or gid) */ ++struct vz_quota_ugid { ++ unsigned int qugid_id; /* UID/GID this applies to */ ++ struct dq_stat qugid_stat; /* limits, options, usage stats */ ++ int qugid_type; /* USRQUOTA|GRPQUOTA */ ++ atomic_t qugid_count; /* reference count */ ++}; ++ ++#define VZ_QUOTA_UGBAD ((struct vz_quota_ugid *)0xfeafea11) ++ ++struct vz_quota_datast { ++ struct vz_quota_ilink qlnk; ++}; ++ ++#define VIRTINFO_QUOTA_GETSTAT 0 ++#define VIRTINFO_QUOTA_ON 1 ++#define VIRTINFO_QUOTA_OFF 2 ++#define VIRTINFO_QUOTA_DISABLE 3 ++ ++struct virt_info_quota { ++ struct super_block *super; ++ struct dq_stat *qstat; ++}; ++ ++/* ++ * Interface to VZ quota core ++ */ ++#define INODE_QLNK(inode) (&(inode)->i_qlnk) ++#define QLNK_INODE(qlnk) container_of((qlnk), struct inode, i_qlnk) ++ ++#define VZ_QUOTA_BAD ((struct vz_quota_master *)0xefefefef) ++ ++#define VZ_QUOTAO_SETE 1 ++#define VZ_QUOTAO_INIT 2 ++#define VZ_QUOTAO_DESTR 3 ++#define VZ_QUOTAO_SWAP 4 ++#define VZ_QUOTAO_INICAL 5 ++#define VZ_QUOTAO_DRCAL 6 ++#define VZ_QUOTAO_QSET 7 ++#define VZ_QUOTAO_TRANS 8 ++#define VZ_QUOTAO_ACT 9 ++#define VZ_QUOTAO_DTREE 10 ++#define VZ_QUOTAO_DET 11 ++#define VZ_QUOTAO_ON 12 ++#define VZ_QUOTAO_RE_LOCK 13 ++ ++#define DQUOT_CMD_ALLOC 0 ++#define DQUOT_CMD_PREALLOC 1 ++#define DQUOT_CMD_CHECK 12 ++#define DQUOT_CMD_FORCE 13 ++ ++extern struct semaphore vz_quota_sem; ++void inode_qmblk_lock(struct super_block *sb); ++void inode_qmblk_unlock(struct super_block *sb); ++void qmblk_data_read_lock(struct vz_quota_master *qmblk); ++void qmblk_data_read_unlock(struct vz_quota_master *qmblk); ++void qmblk_data_write_lock(struct vz_quota_master *qmblk); ++void qmblk_data_write_unlock(struct vz_quota_master *qmblk); ++ ++/* for quota operations */ ++void vzquota_inode_init_call(struct inode *inode); ++void vzquota_inode_drop_call(struct inode *inode); ++int vzquota_inode_transfer_call(struct inode *, struct iattr *); ++struct vz_quota_master *vzquota_inode_data(struct inode *inode, ++ struct vz_quota_datast *); ++void vzquota_data_unlock(struct inode *inode, struct vz_quota_datast *); ++int vzquota_rename_check(struct inode *inode, ++ struct inode *old_dir, struct inode *new_dir); ++struct vz_quota_master *vzquota_inode_qmblk(struct inode *inode); ++/* for second-level quota */ ++struct vz_quota_master *vzquota_find_qmblk(struct super_block *); ++/* for management operations */ ++struct vz_quota_master *vzquota_alloc_master(unsigned int quota_id, ++ struct vz_quota_stat *qstat); ++void vzquota_free_master(struct vz_quota_master *); ++struct vz_quota_master *vzquota_find_master(unsigned int quota_id); ++int vzquota_on_qmblk(struct super_block *sb, struct inode *inode, ++ struct vz_quota_master *qmblk, char __user *buf); ++int vzquota_off_qmblk(struct super_block *sb, struct vz_quota_master *qmblk, ++ char __user *buf, int force); ++int vzquota_get_super(struct super_block *sb); ++void vzquota_put_super(struct super_block *sb); ++ ++static inline struct vz_quota_master *qmblk_get(struct vz_quota_master *qmblk) ++{ ++ if (!atomic_read(&qmblk->dq_count)) ++ BUG(); ++ atomic_inc(&qmblk->dq_count); ++ return qmblk; ++} ++ ++static inline void __qmblk_put(struct vz_quota_master *qmblk) ++{ ++ atomic_dec(&qmblk->dq_count); ++} ++ ++static inline void qmblk_put(struct vz_quota_master *qmblk) ++{ ++ if (!atomic_dec_and_test(&qmblk->dq_count)) ++ return; ++ vzquota_free_master(qmblk); ++} ++ ++extern struct list_head vzquota_hash_table[]; ++extern int vzquota_hash_size; ++ ++/* ++ * Interface to VZ UGID quota ++ */ ++extern struct quotactl_ops vz_quotactl_operations; ++extern struct dquot_operations vz_quota_operations2; ++extern struct quota_format_type vz_quota_empty_v2_format; ++ ++#define QUGID_TREE(qmblk, type) (((type) == USRQUOTA) ? \ ++ qmblk->dq_uid_tree : \ ++ qmblk->dq_gid_tree) ++ ++#define VZDQUG_FIND_DONT_ALLOC 1 ++#define VZDQUG_FIND_FAKE 2 ++struct vz_quota_ugid *vzquota_find_ugid(struct vz_quota_master *qmblk, ++ unsigned int quota_id, int type, int flags); ++struct vz_quota_ugid *__vzquota_find_ugid(struct vz_quota_master *qmblk, ++ unsigned int quota_id, int type, int flags); ++struct vz_quota_ugid *vzquota_get_ugid(struct vz_quota_ugid *qugid); ++void vzquota_put_ugid(struct vz_quota_master *qmblk, ++ struct vz_quota_ugid *qugid); ++void vzquota_kill_ugid(struct vz_quota_master *qmblk); ++int vzquota_ugid_init(void); ++void vzquota_ugid_release(void); ++int vzquota_transfer_usage(struct inode *inode, int mask, ++ struct vz_quota_ilink *qlnk); ++void vzquota_inode_off(struct inode *inode); ++ ++long do_vzquotaugidctl(int cmd, unsigned int quota_id, ++ unsigned int ugid_index, unsigned int ugid_size, ++ void *addr, int compat); ++ ++/* ++ * Other VZ quota parts ++ */ ++extern struct dquot_operations vz_quota_operations; ++ ++long do_vzquotactl(int cmd, unsigned int quota_id, ++ struct vz_quota_stat __user *qstat, const char __user *ve_root, ++ int compat); ++int vzquota_proc_init(void); ++void vzquota_proc_release(void); ++struct vz_quota_master *vzquota_find_qmblk(struct super_block *); ++extern struct semaphore vz_quota_sem; ++ ++void vzaquota_init(void); ++void vzaquota_fini(void); ++ ++#endif /* __KERNEL__ */ ++ ++#endif /* _VZDQUOTA_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzquota_qlnk.h debian/binary-custom.d/openvz/src/include/linux/vzquota_qlnk.h +--- ./include/linux/vzquota_qlnk.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzquota_qlnk.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,25 @@ ++/* ++ * include/linux/vzquota_qlnk.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef _VZDQUOTA_QLNK_H ++#define _VZDQUOTA_QLNK_H ++ ++struct vz_quota_master; ++struct vz_quota_ugid; ++ ++/* inode link, used to track inodes using quota via dq_ilink_list */ ++struct vz_quota_ilink { ++ struct vz_quota_master *qmblk; ++ struct vz_quota_ugid *qugid[MAXQUOTAS]; ++ struct list_head list; ++ unsigned char origin[2]; ++}; ++ ++#endif /* _VZDQUOTA_QLNK_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzratelimit.h debian/binary-custom.d/openvz/src/include/linux/vzratelimit.h +--- ./include/linux/vzratelimit.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzratelimit.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,28 @@ ++/* ++ * include/linux/vzratelimit.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __VZ_RATELIMIT_H__ ++#define __VZ_RATELIMIT_H__ ++ ++/* ++ * Generic ratelimiting stuff. ++ */ ++ ++struct vz_rate_info { ++ int burst; ++ int interval; /* jiffy_t per event */ ++ int bucket; /* kind of leaky bucket */ ++ unsigned long last; /* last event */ ++}; ++ ++/* Return true if rate limit permits. */ ++int vz_ratelimit(struct vz_rate_info *p); ++ ++#endif /* __VZ_RATELIMIT_H__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/linux/vzstat.h debian/binary-custom.d/openvz/src/include/linux/vzstat.h +--- ./include/linux/vzstat.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/linux/vzstat.h 2012-11-13 15:20:15.252569073 +0000 +@@ -0,0 +1,182 @@ ++/* ++ * include/linux/vzstat.h ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#ifndef __VZSTAT_H__ ++#define __VZSTAT_H__ ++ ++struct swap_cache_info_struct { ++ unsigned long add_total; ++ unsigned long del_total; ++ unsigned long find_success; ++ unsigned long find_total; ++ unsigned long noent_race; ++ unsigned long exist_race; ++ unsigned long remove_race; ++}; ++ ++struct kstat_lat_snap_struct { ++ cycles_t maxlat, totlat; ++ unsigned long count; ++}; ++struct kstat_lat_pcpu_snap_struct { ++ cycles_t maxlat, totlat; ++ unsigned long count; ++ seqcount_t lock; ++} ____cacheline_aligned_in_smp; ++ ++struct kstat_lat_struct { ++ struct kstat_lat_snap_struct cur, last; ++ cycles_t avg[3]; ++}; ++struct kstat_lat_pcpu_struct { ++ struct kstat_lat_pcpu_snap_struct *cur; ++ cycles_t max_snap; ++ struct kstat_lat_snap_struct last; ++ cycles_t avg[3]; ++}; ++ ++struct kstat_perf_snap_struct { ++ cycles_t wall_tottime, cpu_tottime; ++ cycles_t wall_maxdur, cpu_maxdur; ++ unsigned long count; ++}; ++struct kstat_perf_struct { ++ struct kstat_perf_snap_struct cur, last; ++}; ++ ++struct kstat_zone_avg { ++ unsigned long free_pages_avg[3], ++ nr_active_avg[3], ++ nr_inactive_avg[3]; ++}; ++ ++#define KSTAT_ALLOCSTAT_NR 5 ++ ++struct kernel_stat_glob { ++ unsigned long nr_unint_avg[3]; ++ ++ unsigned long alloc_fails[KSTAT_ALLOCSTAT_NR]; ++ struct kstat_lat_struct alloc_lat[KSTAT_ALLOCSTAT_NR]; ++ struct kstat_lat_pcpu_struct sched_lat; ++ struct kstat_lat_struct swap_in; ++ ++ struct kstat_perf_struct ttfp, cache_reap, ++ refill_inact, shrink_icache, shrink_dcache; ++ ++ struct kstat_zone_avg zone_avg[3]; /* MAX_NR_ZONES */ ++} ____cacheline_aligned; ++ ++extern struct kernel_stat_glob kstat_glob ____cacheline_aligned; ++extern spinlock_t kstat_glb_lock; ++ ++#ifdef CONFIG_VE ++#define KSTAT_PERF_ENTER(name) \ ++ unsigned long flags; \ ++ cycles_t start, sleep_time; \ ++ \ ++ start = get_cycles(); \ ++ sleep_time = VE_TASK_INFO(current)->sleep_time; \ ++ ++#define KSTAT_PERF_LEAVE(name) \ ++ spin_lock_irqsave(&kstat_glb_lock, flags); \ ++ kstat_glob.name.cur.count++; \ ++ start = get_cycles() - start; \ ++ if (kstat_glob.name.cur.wall_maxdur < start) \ ++ kstat_glob.name.cur.wall_maxdur = start;\ ++ kstat_glob.name.cur.wall_tottime += start; \ ++ start -= VE_TASK_INFO(current)->sleep_time - \ ++ sleep_time; \ ++ if (kstat_glob.name.cur.cpu_maxdur < start) \ ++ kstat_glob.name.cur.cpu_maxdur = start; \ ++ kstat_glob.name.cur.cpu_tottime += start; \ ++ spin_unlock_irqrestore(&kstat_glb_lock, flags); \ ++ ++#else ++#define KSTAT_PERF_ENTER(name) ++#define KSTAT_PERF_LEAVE(name) ++#endif ++ ++/* ++ * Add another statistics reading. ++ * Serialization is the caller's due. ++ */ ++static inline void KSTAT_LAT_ADD(struct kstat_lat_struct *p, ++ cycles_t dur) ++{ ++ p->cur.count++; ++ if (p->cur.maxlat < dur) ++ p->cur.maxlat = dur; ++ p->cur.totlat += dur; ++} ++ ++static inline void KSTAT_LAT_PCPU_ADD(struct kstat_lat_pcpu_struct *p, int cpu, ++ cycles_t dur) ++{ ++ struct kstat_lat_pcpu_snap_struct *cur; ++ ++ cur = per_cpu_ptr(p->cur, cpu); ++ write_seqcount_begin(&cur->lock); ++ cur->count++; ++ if (cur->maxlat < dur) ++ cur->maxlat = dur; ++ cur->totlat += dur; ++ write_seqcount_end(&cur->lock); ++} ++ ++/* ++ * Move current statistics to last, clear last. ++ * Serialization is the caller's due. ++ */ ++static inline void KSTAT_LAT_UPDATE(struct kstat_lat_struct *p) ++{ ++ cycles_t m; ++ memcpy(&p->last, &p->cur, sizeof(p->last)); ++ p->cur.maxlat = 0; ++ m = p->last.maxlat; ++ CALC_LOAD(p->avg[0], EXP_1, m) ++ CALC_LOAD(p->avg[1], EXP_5, m) ++ CALC_LOAD(p->avg[2], EXP_15, m) ++} ++ ++static inline void KSTAT_LAT_PCPU_UPDATE(struct kstat_lat_pcpu_struct *p) ++{ ++ unsigned i, cpu; ++ struct kstat_lat_pcpu_snap_struct snap, *cur; ++ cycles_t m; ++ ++ memset(&p->last, 0, sizeof(p->last)); ++ for_each_online_cpu(cpu) { ++ cur = per_cpu_ptr(p->cur, cpu); ++ do { ++ i = read_seqcount_begin(&cur->lock); ++ memcpy(&snap, cur, sizeof(snap)); ++ } while (read_seqcount_retry(&cur->lock, i)); ++ /* ++ * read above and this update of maxlat is not atomic, ++ * but this is OK, since it happens rarely and losing ++ * a couple of peaks is not essential. xemul ++ */ ++ cur->maxlat = 0; ++ ++ p->last.count += snap.count; ++ p->last.totlat += snap.totlat; ++ if (p->last.maxlat < snap.maxlat) ++ p->last.maxlat = snap.maxlat; ++ } ++ ++ m = (p->last.maxlat > p->max_snap ? p->last.maxlat : p->max_snap); ++ CALC_LOAD(p->avg[0], EXP_1, m); ++ CALC_LOAD(p->avg[1], EXP_5, m); ++ CALC_LOAD(p->avg[2], EXP_15, m); ++ /* reset max_snap to calculate it correctly next time */ ++ p->max_snap = 0; ++} ++ ++#endif /* __VZSTAT_H__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/addrconf.h debian/binary-custom.d/openvz/src/include/net/addrconf.h +--- ./include/net/addrconf.h 2012-06-12 16:25:24.170312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/addrconf.h 2012-11-13 15:20:15.264569069 +0000 +@@ -246,5 +246,19 @@ + extern void if6_proc_exit(void); + #endif + ++int addrconf_ifdown(struct net_device *dev, int how); ++int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen, ++ __u8 ifa_flags, __u32 prefered_lft, __u32 valid_lft); ++ ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++int addrconf_sysctl_init(struct ve_struct *ve); ++void addrconf_sysctl_fini(struct ve_struct *ve); ++void addrconf_sysctl_free(struct ve_struct *ve); ++#else ++#define addrconf_sysctl_init(ve) (0) ++#define addrconf_sysctl_fini(ve) do { } while (0) ++#define addrconf_sysctl_free(ve) do { } while (0) ++#endif ++ + #endif + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/af_unix.h debian/binary-custom.d/openvz/src/include/net/af_unix.h +--- ./include/net/af_unix.h 2012-06-12 16:25:24.170312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/af_unix.h 2012-11-13 15:20:15.264569069 +0000 +@@ -10,6 +10,7 @@ + extern void unix_notinflight(struct file *fp); + extern void unix_gc(void); + extern void wait_for_unix_gc(void); ++extern void unix_destruct_fds(struct sk_buff *skb); + + #define UNIX_HASH_SIZE 256 + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/arp.h debian/binary-custom.d/openvz/src/include/net/arp.h +--- ./include/net/arp.h 2012-06-12 16:25:24.170312491 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/arp.h 2012-11-13 15:20:15.264569069 +0000 +@@ -7,7 +7,12 @@ + + #define HAVE_ARP_CREATE + +-extern struct neigh_table arp_tbl; ++#if defined(CONFIG_VE) && defined(CONFIG_INET) ++#define arp_tbl (*(get_exec_env()->ve_arp_tbl)) ++#else ++extern struct neigh_table global_arp_tbl; ++#define arp_tbl global_arp_tbl ++#endif + + extern void arp_init(void); + extern int arp_find(unsigned char *haddr, struct sk_buff *skb); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/flow.h debian/binary-custom.d/openvz/src/include/net/flow.h +--- ./include/net/flow.h 2012-06-12 16:25:24.174312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/flow.h 2012-11-13 15:20:15.272569069 +0000 +@@ -10,6 +10,7 @@ + #include + #include + ++struct ve_struct; + struct flowi { + int oif; + int iif; +@@ -77,6 +78,9 @@ + #define fl_icmp_code uli_u.icmpt.code + #define fl_ipsec_spi uli_u.spi + #define fl_mh_type uli_u.mht.type ++#ifdef CONFIG_VE ++ struct ve_struct *owner_env; ++#endif + __u32 secid; /* used by xfrm; see secid.txt */ + } __attribute__((__aligned__(BITS_PER_LONG/8))); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/icmp.h debian/binary-custom.d/openvz/src/include/net/icmp.h +--- ./include/net/icmp.h 2012-06-12 16:25:24.174312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/icmp.h 2012-11-13 15:20:15.272569069 +0000 +@@ -31,15 +31,24 @@ + extern struct icmp_err icmp_err_convert[]; + DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics); + DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics); +-#define ICMP_INC_STATS(field) SNMP_INC_STATS(icmp_statistics, field) +-#define ICMP_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmp_statistics, field) +-#define ICMP_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmp_statistics, field) +-#define ICMPMSGOUT_INC_STATS(field) SNMP_INC_STATS(icmpmsg_statistics, field+256) +-#define ICMPMSGOUT_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmpmsg_statistics, field+256) +-#define ICMPMSGOUT_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmpmsg_statistics, field+256) +-#define ICMPMSGIN_INC_STATS(field) SNMP_INC_STATS(icmpmsg_statistics, field) +-#define ICMPMSGIN_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmpmsg_statistics, field) +-#define ICMPMSGIN_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmpmsg_statistics, field) ++ ++#if defined(CONFIG_VE) && defined(CONFIG_INET) ++#define ve_icmp_statistics (get_exec_env()->_icmp_statistics) ++#define ve_icmpmsg_statistics (get_exec_env()->_icmpmsg_statistics) ++#else ++#define ve_icmp_statistics icmp_statistics ++#define ve_icmpmsg_statistics icmpmsg_statistics ++#endif ++ ++#define ICMP_INC_STATS(field) SNMP_INC_STATS(ve_icmp_statistics, field) ++#define ICMP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ve_icmp_statistics, field) ++#define ICMP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ve_icmp_statistics, field) ++#define ICMPMSGOUT_INC_STATS(field) SNMP_INC_STATS(ve_icmpmsg_statistics, field+256) ++#define ICMPMSGOUT_INC_STATS_BH(field) SNMP_INC_STATS_BH(ve_icmpmsg_statistics, field+256) ++#define ICMPMSGOUT_INC_STATS_USER(field) SNMP_INC_STATS_USER(ve_icmpmsg_statistics, field+256) ++#define ICMPMSGIN_INC_STATS(field) SNMP_INC_STATS(ve_icmpmsg_statistics, field) ++#define ICMPMSGIN_INC_STATS_BH(field) SNMP_INC_STATS_BH(ve_icmpmsg_statistics, field) ++#define ICMPMSGIN_INC_STATS_USER(field) SNMP_INC_STATS_USER(ve_icmpmsg_statistics, field) + + struct dst_entry; + struct net_proto_family; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/if_inet6.h debian/binary-custom.d/openvz/src/include/net/if_inet6.h +--- ./include/net/if_inet6.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/if_inet6.h 2012-11-13 15:20:15.272569069 +0000 +@@ -194,7 +194,14 @@ + struct rcu_head rcu; + }; + +-extern struct ipv6_devconf ipv6_devconf; ++extern struct ipv6_devconf global_ipv6_devconf; ++extern struct ipv6_devconf global_ipv6_devconf_dflt; ++ ++#ifdef CONFIG_VE ++#define ve_ipv6_devconf (*(get_exec_env()->_ipv6_devconf)) ++#else ++#define ve_ipv6_devconf global_ipv6_devconf ++#endif + + static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/inet6_hashtables.h debian/binary-custom.d/openvz/src/include/net/inet6_hashtables.h +--- ./include/net/inet6_hashtables.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/inet6_hashtables.h 2012-11-13 15:20:15.272569069 +0000 +@@ -29,9 +29,10 @@ + + /* I have no idea if this is a good hash for v6 or not. -DaveM */ + static inline unsigned int inet6_ehashfn(const struct in6_addr *laddr, const u16 lport, +- const struct in6_addr *faddr, const __be16 fport) ++ const struct in6_addr *faddr, const __be16 fport, ++ const envid_t veid) + { +- u32 ports = (lport ^ (__force u16)fport); ++ u32 ports = (lport ^ (__force u16)fport) ^ (veid ^ (veid >> 16)); + + return jhash_3words((__force u32)laddr->s6_addr32[3], + (__force u32)faddr->s6_addr32[3], +@@ -46,7 +47,7 @@ + const struct in6_addr *faddr = &np->daddr; + const __u16 lport = inet->num; + const __be16 fport = inet->dport; +- return inet6_ehashfn(laddr, lport, faddr, fport); ++ return inet6_ehashfn(laddr, lport, faddr, fport, VEID(sk->owner_env)); + } + + extern void __inet6_hash(struct inet_hashinfo *hashinfo, struct sock *sk); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/inet_frag.h debian/binary-custom.d/openvz/src/include/net/inet_frag.h +--- ./include/net/inet_frag.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/inet_frag.h 2012-11-13 15:20:15.276569071 +0000 +@@ -16,6 +16,10 @@ + #define COMPLETE 4 + #define FIRST_IN 2 + #define LAST_IN 1 ++ ++#ifdef CONFIG_VE ++ struct ve_struct *owner_ve; ++#endif + }; + + #define INETFRAGS_HASHSZ 64 +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/inet_hashtables.h debian/binary-custom.d/openvz/src/include/net/inet_hashtables.h +--- ./include/net/inet_hashtables.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/inet_hashtables.h 2012-11-13 15:20:15.276569071 +0000 +@@ -74,6 +74,7 @@ + * ports are created in O(1) time? I thought so. ;-) -DaveM + */ + struct inet_bind_bucket { ++ struct ve_struct *owner_env; + unsigned short port; + signed short fastreuse; + struct hlist_node node; +@@ -195,37 +196,43 @@ + extern struct inet_bind_bucket * + inet_bind_bucket_create(struct kmem_cache *cachep, + struct inet_bind_hashbucket *head, +- const unsigned short snum); ++ const unsigned short snum, ++ struct ve_struct *env); + extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, + struct inet_bind_bucket *tb); + +-static inline int inet_bhashfn(const __u16 lport, const int bhash_size) ++static inline int inet_bhashfn(const __u16 lport, const int bhash_size, ++ unsigned veid) + { +- return lport & (bhash_size - 1); ++ return ((lport + (veid ^ (veid >> 16))) & (bhash_size - 1)); + } + + extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, + const unsigned short snum); + + /* These can have wildcards, don't try too hard. */ +-static inline int inet_lhashfn(const unsigned short num) ++static inline int inet_lhashfn(const unsigned short num, unsigned veid) + { +- return num & (INET_LHTABLE_SIZE - 1); ++ return ((num + (veid ^ (veid >> 16))) & (INET_LHTABLE_SIZE - 1)); + } + + static inline int inet_sk_listen_hashfn(const struct sock *sk) + { +- return inet_lhashfn(inet_sk(sk)->num); ++ return inet_lhashfn(inet_sk(sk)->num, VEID(sk->owner_env)); + } + + /* Caller must disable local BH processing. */ + static inline void __inet_inherit_port(struct inet_hashinfo *table, + struct sock *sk, struct sock *child) + { +- const int bhash = inet_bhashfn(inet_sk(child)->num, table->bhash_size); +- struct inet_bind_hashbucket *head = &table->bhash[bhash]; ++ int bhash; ++ struct inet_bind_hashbucket *head; + struct inet_bind_bucket *tb; + ++ bhash = inet_bhashfn(inet_sk(child)->num, table->bhash_size, ++ VEID(child->owner_env)); ++ head = &table->bhash[bhash]; ++ + spin_lock(&head->lock); + tb = inet_csk(sk)->icsk_bind_hash; + sk_add_bind_node(child, &tb->owners); +@@ -365,25 +372,25 @@ + (((__force __u64)(__be32)(__daddr)) << 32) | \ + ((__force __u64)(__be32)(__saddr))); + #endif /* __BIG_ENDIAN */ +-#define INET_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ ++#define INET_MATCH_ALLVE(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ + (((__sk)->sk_hash == (__hash)) && \ + ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ + ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ + (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) +-#define INET_TW_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ ++#define INET_TW_MATCH_ALLVE(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ + (((__sk)->sk_hash == (__hash)) && \ + ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ + ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ + (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) + #else /* 32-bit arch */ + #define INET_ADDR_COOKIE(__name, __saddr, __daddr) +-#define INET_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ ++#define INET_MATCH_ALLVE(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ + (((__sk)->sk_hash == (__hash)) && \ + (inet_sk(__sk)->daddr == (__saddr)) && \ + (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ + ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ + (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) +-#define INET_TW_MATCH(__sk, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ ++#define INET_TW_MATCH_ALLVE(__sk, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ + (((__sk)->sk_hash == (__hash)) && \ + (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ + (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ +@@ -391,6 +398,18 @@ + (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) + #endif /* 64-bit arch */ + ++#define INET_MATCH(__sk, __hash, __cookie, __saddr, \ ++ __daddr, __ports, __dif, __ve) \ ++ (INET_MATCH_ALLVE((__sk), (__hash), (__cookie), (__saddr), \ ++ (__daddr), (__ports), (__dif)) \ ++ && ve_accessible_strict((__sk)->owner_env, (__ve))) ++ ++#define INET_TW_MATCH(__sk, __hash, __cookie, __saddr, \ ++ __daddr, __ports, __dif, __ve) \ ++ (INET_TW_MATCH_ALLVE((__sk), (__hash), (__cookie), (__saddr), \ ++ (__daddr), (__ports), (__dif)) \ ++ && ve_accessible_strict(inet_twsk(__sk)->tw_owner_env, VEID(__ve))) ++ + /* + * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so we need + * not check it for lookups anymore, thanks Alexey. -DaveM +@@ -410,20 +429,22 @@ + /* Optimize here for direct hit, only listening connections can + * have wildcards anyways. + */ +- unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport); ++ struct ve_struct *ve = get_exec_env(); ++ unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport, VEID(ve)); + struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); + rwlock_t *lock = inet_ehash_lockp(hashinfo, hash); + + prefetch(head->chain.first); + read_lock(lock); + sk_for_each(sk, node, &head->chain) { +- if (INET_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) ++ if (INET_MATCH(sk, hash, acookie, saddr, daddr, ++ ports, dif, ve)) + goto hit; /* You sunk my battleship! */ + } + + /* Must check for a TIME_WAIT'er before going to listener hash. */ + sk_for_each(sk, node, &head->twchain) { +- if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) ++ if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif, ve)) + goto hit; + } + sk = NULL; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/inet_sock.h debian/binary-custom.d/openvz/src/include/net/inet_sock.h +--- ./include/net/inet_sock.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/inet_sock.h 2012-11-13 15:20:15.276569071 +0000 +@@ -173,10 +173,11 @@ + extern void build_ehash_secret(void); + + static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport, +- const __be32 faddr, const __be16 fport) ++ const __be32 faddr, const __be16 fport, ++ const envid_t veid) + { + return jhash_3words((__force __u32) laddr, +- (__force __u32) faddr, ++ (__force __u32) faddr ^ (veid ^ (veid >> 16)), + ((__u32) lport) << 16 | (__force __u32)fport, + inet_ehash_secret); + } +@@ -188,8 +189,9 @@ + const __u16 lport = inet->num; + const __be32 faddr = inet->daddr; + const __be16 fport = inet->dport; ++ envid_t veid = VEID(sk->owner_env); + +- return inet_ehashfn(laddr, lport, faddr, fport); ++ return inet_ehashfn(laddr, lport, faddr, fport, veid); + } + + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/inet_timewait_sock.h debian/binary-custom.d/openvz/src/include/net/inet_timewait_sock.h +--- ./include/net/inet_timewait_sock.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/inet_timewait_sock.h 2012-11-13 15:20:15.276569071 +0000 +@@ -81,6 +81,7 @@ + struct inet_hashinfo *hashinfo; + int sysctl_tw_recycle; + int sysctl_max_tw_buckets; ++ int ub_managed; + }; + + extern void inet_twdr_hangman(unsigned long data); +@@ -134,6 +135,7 @@ + unsigned long tw_ttd; + struct inet_bind_bucket *tw_tb; + struct hlist_node tw_death_node; ++ envid_t tw_owner_env; + }; + + static inline void inet_twsk_add_node(struct inet_timewait_sock *tw, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/ip.h debian/binary-custom.d/openvz/src/include/net/ip.h +--- ./include/net/ip.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/ip.h 2012-11-13 15:20:15.276569071 +0000 +@@ -157,16 +157,28 @@ + + extern struct ipv4_config ipv4_config; + DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics); +-#define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field) +-#define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ip_statistics, field) +-#define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ip_statistics, field) +-#define IP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(ip_statistics, field, val) ++ ++#ifdef CONFIG_VE ++#define ve_ip_statistics (get_exec_env()->_ip_statistics) ++#else ++#define ve_ip_statistics ip_statistics ++#endif ++#define IP_INC_STATS(field) SNMP_INC_STATS(ve_ip_statistics, field) ++#define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ve_ip_statistics, field) ++#define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ve_ip_statistics, field) ++#define IP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(ve_ip_statistics, field, val) ++ + DECLARE_SNMP_STAT(struct linux_mib, net_statistics); +-#define NET_INC_STATS(field) SNMP_INC_STATS(net_statistics, field) +-#define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(net_statistics, field) +-#define NET_INC_STATS_USER(field) SNMP_INC_STATS_USER(net_statistics, field) +-#define NET_ADD_STATS_BH(field, adnd) SNMP_ADD_STATS_BH(net_statistics, field, adnd) +-#define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd) ++#if defined(CONFIG_VE) && defined(CONFIG_INET) ++#define ve_net_statistics (get_exec_env()->_net_statistics) ++#else ++#define ve_net_statistics net_statistics ++#endif ++#define NET_INC_STATS(field) SNMP_INC_STATS(ve_net_statistics, field) ++#define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(ve_net_statistics, field) ++#define NET_INC_STATS_USER(field) SNMP_INC_STATS_USER(ve_net_statistics, field) ++#define NET_ADD_STATS_BH(field, adnd) SNMP_ADD_STATS_BH(ve_net_statistics, field, adnd) ++#define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(ve_net_statistics, field, adnd) + + extern unsigned long snmp_fold_field(void *mib[], int offt); + extern int snmp_mib_init(void *ptr[2], size_t mibsize, size_t mibalign); +@@ -393,4 +405,11 @@ + + extern struct ctl_table ipv4_table[]; + ++#ifdef CONFIG_SYSCTL ++extern int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp, ++ void __user *buffer, size_t *lenp, loff_t *ppos); ++extern int ipv4_sysctl_forward_strategy(ctl_table *table, int __user *name, ++ int nlen, void __user *oldval, size_t __user *oldlenp, ++ void __user *newval, size_t newlen); ++#endif + #endif /* _IP_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/ip6_fib.h debian/binary-custom.d/openvz/src/include/net/ip6_fib.h +--- ./include/net/ip6_fib.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/ip6_fib.h 2012-11-13 15:20:15.276569071 +0000 +@@ -116,6 +116,8 @@ + return ((struct rt6_info *)dst)->rt6i_idev; + } + ++extern struct list_head fib6_table_list; ++ + struct fib6_walker_t + { + struct fib6_walker_t *prev, *next; +@@ -164,6 +166,7 @@ + u32 tb6_id; + rwlock_t tb6_lock; + struct fib6_node tb6_root; ++ struct ve_struct *owner_env; + }; + + #define RT6_TABLE_UNSPEC RT_TABLE_UNSPEC +@@ -220,6 +223,8 @@ + extern void fib6_gc_cleanup(void); + + extern void fib6_init(void); ++extern void fib6_tables_init(void); ++extern void fib6_tables_cleanup(void); + + extern void fib6_rules_init(void); + extern void fib6_rules_cleanup(void); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/ip6_route.h debian/binary-custom.d/openvz/src/include/net/ip6_route.h +--- ./include/net/ip6_route.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/ip6_route.h 2012-11-13 15:20:15.276569071 +0000 +@@ -162,5 +162,13 @@ + return rt->rt6i_flags & RTF_LOCAL; + } + ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++int init_ve_route6(struct ve_struct *ve); ++void fini_ve_route6(struct ve_struct *ve); ++#else ++#define init_ve_route6(ve) (0) ++#define fini_ve_route6(ve) do { } while (0) ++#endif ++ + #endif + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/ip_fib.h debian/binary-custom.d/openvz/src/include/net/ip_fib.h +--- ./include/net/ip_fib.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/ip_fib.h 2012-11-13 15:20:15.276569071 +0000 +@@ -153,10 +153,23 @@ + unsigned char tb_data[0]; + }; + ++struct fn_zone; ++struct fn_hash { ++ struct fn_zone *fn_zones[33]; ++ struct fn_zone *fn_zone_list; ++}; ++ + #ifndef CONFIG_IP_MULTIPLE_TABLES + +-extern struct fib_table *ip_fib_local_table; +-extern struct fib_table *ip_fib_main_table; ++#ifdef CONFIG_VE ++#define ip_fib_local_table get_exec_env()->_local_table ++#define ip_fib_main_table get_exec_env()->_main_table ++#else ++extern struct fib_table *__ip_fib_local_table; ++extern struct fib_table *__ip_fib_main_table; ++#define ip_fib_local_table __ip_fib_local_table ++#define ip_fib_main_table __ip_fib_main_table ++#endif + + static inline struct fib_table *fib_get_table(u32 id) + { +@@ -200,6 +213,10 @@ + extern struct fib_table *fib_get_table(u32 id); + extern void fib_select_default(const struct flowi *flp, struct fib_result *res); + ++extern int fib_rules_create(void); ++extern void fib_rules_destroy(void); ++extern int fib4_rules_dump(struct sk_buff *skb, struct netlink_callback *cb); ++ + #endif /* CONFIG_IP_MULTIPLE_TABLES */ + + /* Exported by fib_frontend.c */ +@@ -220,6 +237,15 @@ + /* Exported by fib_hash.c */ + extern struct fib_table *fib_hash_init(u32 id); + ++#if defined(CONFIG_VE) && defined(CONFIG_INET) ++struct ve_struct; ++extern int init_ve_route(struct ve_struct *ve); ++extern void fini_ve_route(struct ve_struct *ve); ++#else ++#define init_ve_route(ve) 0 ++#define fini_ve_route(ve) do { } while (0) ++#endif ++ + static inline void fib_combine_itag(u32 *itag, struct fib_result *res) + { + #ifdef CONFIG_NET_CLS_ROUTE +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/ipv6.h debian/binary-custom.d/openvz/src/include/net/ipv6.h +--- ./include/net/ipv6.h 2012-06-12 16:25:24.178312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/ipv6.h 2012-11-13 15:20:15.276569071 +0000 +@@ -117,7 +117,7 @@ + struct inet6_dev *_idev = (idev); \ + if (likely(_idev != NULL)) \ + SNMP_INC_STATS##modifier((_idev)->stats.statname, (field)); \ +- SNMP_INC_STATS##modifier(statname##_statistics, (field)); \ ++ SNMP_INC_STATS##modifier(ve_##statname##_statistics, (field)); \ + }) + + #define _DEVADD(statname, modifier, idev, field, val) \ +@@ -125,9 +125,22 @@ + struct inet6_dev *_idev = (idev); \ + if (likely(_idev != NULL)) \ + SNMP_ADD_STATS##modifier((_idev)->stats.statname, (field), (val)); \ +- SNMP_ADD_STATS##modifier(statname##_statistics, (field), (val));\ ++ SNMP_ADD_STATS##modifier(ve_##statname##_statistics, (field), (val));\ + }) + ++#ifdef CONFIG_VE ++#define ve_ipv6_statistics (get_exec_env()->_ipv6_statistics) ++#define ve_icmpv6_statistics (get_exec_env()->_icmpv6_statistics) ++#define ve_icmpv6msg_statistics (get_exec_env()->_icmpv6msg_statistics) ++#define ve_udp_stats_in6 (get_exec_env()->_udp_stats_in6) ++#define ve_udplite_stats_in6 (get_exec_env()->_udplite_stats_in6) ++#else ++#define ve_ipv6_statistics ipv6_statistics ++#define ve_icmpv6_statistics icmpv6_statistics ++#define ve_icmpv6msg_statistics icmpv6msg_statistics ++#define ve_udplite_stats_in6 udplite_stats_in6 ++#endif ++ + /* MIBs */ + DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); + +@@ -167,11 +180,29 @@ + DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); + DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); + #define UDP6_INC_STATS_BH(field, is_udplite) do { \ +- if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ +- else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) ++ if (is_udplite) SNMP_INC_STATS_BH(ve_udplite_stats_in6, field); \ ++ else SNMP_INC_STATS_BH(ve_udp_stats_in6, field); } while(0) + #define UDP6_INC_STATS_USER(field, is_udplite) do { \ +- if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ +- else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) ++ if (is_udplite) SNMP_INC_STATS_USER(ve_udplite_stats_in6, field); \ ++ else SNMP_INC_STATS_USER(ve_udp_stats_in6, field); } while(0) ++ ++int snmp6_register_dev(struct inet6_dev *idev); ++int snmp6_unregister_dev(struct inet6_dev *idev); ++int snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign); ++void snmp6_mib_free(void *ptr[2]); ++ ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++int ve_snmp_proc_init(struct ve_struct *ve); ++void ve_snmp_proc_fini(struct ve_struct *ve); ++#else ++static inline int ve_snmp_proc_init(struct ve_struct *ve) ++{ ++ return 0; ++} ++static inline void ve_snmp_proc_fini(struct ve_struct *ve) ++{ ++} ++#endif + + struct ip6_ra_chain + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/ndisc.h debian/binary-custom.d/openvz/src/include/net/ndisc.h +--- ./include/net/ndisc.h 2012-06-12 16:25:24.186312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/ndisc.h 2012-11-13 15:20:15.284569072 +0000 +@@ -52,7 +52,12 @@ + struct net_proto_family; + struct sk_buff; + +-extern struct neigh_table nd_tbl; ++#ifdef CONFIG_VE ++#define nd_tbl (*(get_exec_env()->ve_nd_tbl)) ++#else ++#define nd_tbl global_nd_tbl ++extern struct neigh_table global_nd_tbl; ++#endif + + struct nd_msg { + struct icmp6hdr icmph; +@@ -130,6 +135,7 @@ + extern void inet6_ifinfo_notify(int event, + struct inet6_dev *idev); + ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) + static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr) + { + +@@ -138,6 +144,7 @@ + + return NULL; + } ++#endif + + + #endif /* __KERNEL__ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/neighbour.h debian/binary-custom.d/openvz/src/include/net/neighbour.h +--- ./include/net/neighbour.h 2012-06-12 16:25:24.186312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/neighbour.h 2012-11-13 15:20:15.284569072 +0000 +@@ -161,6 +161,8 @@ + atomic_t entries; + rwlock_t lock; + unsigned long last_rand; ++ struct ve_struct *owner_env; ++ struct user_beancounter *owner_ub; + struct kmem_cache *kmem_cachep; + struct neigh_statistics *stats; + struct neighbour **hash_buckets; +@@ -180,8 +182,8 @@ + #define NEIGH_UPDATE_F_ISROUTER 0x40000000 + #define NEIGH_UPDATE_F_ADMIN 0x80000000 + +-extern void neigh_table_init(struct neigh_table *tbl); +-extern void neigh_table_init_no_netlink(struct neigh_table *tbl); ++extern int neigh_table_init(struct neigh_table *tbl); ++extern int neigh_table_init_no_netlink(struct neigh_table *tbl); + extern int neigh_table_clear(struct neigh_table *tbl); + extern struct neighbour * neigh_lookup(struct neigh_table *tbl, + const void *pkey, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/net_namespace.h debian/binary-custom.d/openvz/src/include/net/net_namespace.h +--- ./include/net/net_namespace.h 2012-06-12 16:25:24.186312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/net_namespace.h 2012-11-13 15:20:15.284569072 +0000 +@@ -10,6 +10,7 @@ + + struct proc_dir_entry; + struct net_device; ++struct sock; + struct net { + atomic_t count; /* To decided when the network + * namespace should be freed. +@@ -29,6 +30,15 @@ + struct list_head dev_base_head; + struct hlist_head *dev_name_head; + struct hlist_head *dev_index_head; ++ ++ struct sock *rtnl; /* rtnetlink socket */ ++ ++ int ifindex; ++ ++#ifdef CONFIG_VE ++ struct completion *sysfs_completion; ++ struct ve_struct *owner_ve; ++#endif + }; + + #ifdef CONFIG_NET +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netfilter/ipv4/nf_conntrack_ipv4.h debian/binary-custom.d/openvz/src/include/net/netfilter/ipv4/nf_conntrack_ipv4.h +--- ./include/net/netfilter/ipv4/nf_conntrack_ipv4.h 2012-06-12 16:25:24.186312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netfilter/ipv4/nf_conntrack_ipv4.h 2012-11-13 15:20:15.284569072 +0000 +@@ -18,8 +18,18 @@ + extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; + extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; + ++#if defined(CONFIG_PROC_FS) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) + extern int nf_conntrack_ipv4_compat_init(void); + extern void nf_conntrack_ipv4_compat_fini(void); ++#else ++static inline int nf_conntrack_ipv4_compat_init(void) ++{ ++ return 0; ++} ++static inline void nf_conntrack_ipv4_compat_fini(void) ++{ ++} ++#endif + + extern void need_ipv4_conntrack(void); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netfilter/nf_conntrack.h debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack.h +--- ./include/net/netfilter/nf_conntrack.h 2012-06-12 16:25:24.186312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack.h 2012-11-13 15:20:15.288569070 +0000 +@@ -27,6 +27,10 @@ + + #include + ++#ifdef CONFIG_VE_IPTABLES ++#include ++#endif ++ + /* per conntrack: protocol private data */ + union nf_conntrack_proto { + /* insert conntrack proto private data here */ +@@ -92,6 +96,10 @@ + #include + #include + ++#ifdef CONFIG_VE_IPTABLES ++#include ++#endif ++ + struct nf_conn + { + /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, +@@ -129,6 +137,10 @@ + + /* Extensions */ + struct nf_ct_ext *ext; ++ ++#ifdef CONFIG_VE_IPTABLES ++ struct ve_struct *ct_owner_env; ++#endif + }; + + static inline struct nf_conn * +@@ -183,6 +195,11 @@ + + extern void nf_conntrack_flush(void); + ++struct nf_conntrack_helper * nf_ct_helper_find_get( const struct nf_conntrack_tuple *tuple); ++void nf_ct_helper_put(struct nf_conntrack_helper *helper); ++ ++struct nf_conntrack_helper * __nf_conntrack_helper_find_byname(const char *name); ++ + extern int nf_ct_get_tuplepr(const struct sk_buff *skb, + unsigned int nhoff, + u_int16_t l3num, +@@ -231,7 +248,8 @@ + extern void nf_conntrack_free(struct nf_conn *ct); + extern struct nf_conn * + nf_conntrack_alloc(const struct nf_conntrack_tuple *orig, +- const struct nf_conntrack_tuple *repl); ++ const struct nf_conntrack_tuple *repl, ++ struct user_beancounter *); + + /* It's confirmed if it is, or has been in the hash table. */ + static inline int nf_ct_is_confirmed(struct nf_conn *ct) +@@ -254,6 +272,8 @@ + extern int nf_conntrack_checksum; + extern atomic_t nf_conntrack_count; + extern int nf_conntrack_max; ++extern int nf_conntrack_disable_ve0; ++extern int ip_conntrack_disable_ve0; + + DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); + #define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netfilter/nf_conntrack_core.h debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_core.h +--- ./include/net/netfilter/nf_conntrack_core.h 2012-06-12 16:25:24.186312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_core.h 2012-11-13 15:20:15.288569070 +0000 +@@ -62,6 +62,49 @@ + + extern int __nf_conntrack_confirm(struct sk_buff *skb); + ++#if defined(CONFIG_VE_IPTABLES) ++#include ++#define ve_nf_conntrack_initialized() (get_exec_env()->_nf_conntrack != NULL) ++#define ve_nf_conntrack_hash (get_exec_env()->_nf_conntrack->_nf_conntrack_hash) ++#define ve_nf_conntrack_vmalloc (get_exec_env()->_nf_conntrack->_nf_conntrack_vmalloc) ++#define ve_unconfirmed (get_exec_env()->_nf_conntrack->_unconfirmed) ++#else ++#define ve_nf_conntrack_initialized() 1 ++#define ve_nf_conntrack_hash nf_conntrack_hash ++#define ve_nf_conntrack_vmalloc nf_conntrack_vmalloc ++#define ve_unconfirmed unconfirmed ++#endif /* CONFIG_VE_IPTABLES */ ++ ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++#define ve_nf_ct_sysctl_header \ ++ (get_exec_env()->_nf_conntrack->_nf_ct_sysctl_header) ++#define ve_nf_ct_sysctl_table \ ++ (get_exec_env()->_nf_conntrack->_nf_ct_sysctl_table) ++#define ve_nf_ct_netfilter_table \ ++ (get_exec_env()->_nf_conntrack->_nf_ct_netfilter_table) ++#define ve_nf_ct_net_table \ ++ (get_exec_env()->_nf_conntrack->_nf_ct_net_table) ++extern void nf_ct_proto_generic_sysctl_cleanup(void); ++extern int nf_ct_proto_generic_sysctl_init(void); ++#else ++#define ve_nf_ct_sysctl_header nf_ct_sysctl_header ++#define ve_nf_ct_sysctl_table nf_ct_sysctl_table ++#define ve_nf_ct_netfilter_table nf_ct_netfilter_table ++#define ve_nf_ct_net_table nf_ct_net_table ++static inline int nf_ct_proto_generic_sysctl_init(void) ++{ ++ return 0; ++} ++static inline void nf_ct_proto_generic_sysctl_cleanup(void) ++{ ++} ++#endif /* CONFIG_VE_IPTABLES */ ++ ++#if defined(CONFIG_VE_IPTABLES) ++extern int nf_conntrack_init_ve(void); ++extern void nf_conntrack_cleanup_ve(void); ++#endif /* CONFIG_VE_IPTABLES */ ++ + /* Confirm a connection: returns NF_DROP if packet must be dropped. */ + static inline int nf_conntrack_confirm(struct sk_buff *skb) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netfilter/nf_conntrack_ecache.h debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_ecache.h +--- ./include/net/netfilter/nf_conntrack_ecache.h 2012-06-12 16:25:24.186312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_ecache.h 2012-11-13 15:20:15.288569070 +0000 +@@ -34,6 +34,9 @@ + struct nf_conn *ct = (struct nf_conn *)skb->nfct; + struct nf_conntrack_ecache *ecache; + ++ if (!ve_is_super(get_exec_env())) ++ return; ++ + local_bh_disable(); + ecache = &__get_cpu_var(nf_conntrack_ecache); + if (ct != ecache->ct) +@@ -45,7 +48,7 @@ + static inline void nf_conntrack_event(enum ip_conntrack_events event, + struct nf_conn *ct) + { +- if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) ++ if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct) && ve_is_super(get_exec_env())) + atomic_notifier_call_chain(&nf_conntrack_chain, event, ct); + } + +@@ -57,7 +60,8 @@ + nf_ct_expect_event(enum ip_conntrack_expect_events event, + struct nf_conntrack_expect *exp) + { +- atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp); ++ if (ve_is_super(get_exec_env())) ++ atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp); + } + + #else /* CONFIG_NF_CONNTRACK_EVENTS */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netfilter/nf_conntrack_expect.h debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_expect.h +--- ./include/net/netfilter/nf_conntrack_expect.h 2012-06-12 16:25:24.186312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_expect.h 2012-11-13 15:20:15.288569070 +0000 +@@ -9,6 +9,14 @@ + extern struct hlist_head *nf_ct_expect_hash; + extern unsigned int nf_ct_expect_hsize; + extern unsigned int nf_ct_expect_max; ++#ifdef CONFIG_VE_IPTABLES ++#include ++#define ve_nf_ct_expect_hash (get_exec_env()->_nf_conntrack->_nf_ct_expect_hash) ++#define ve_nf_ct_expect_max (get_exec_env()->_nf_conntrack->_nf_ct_expect_max) ++#else ++#define ve_nf_ct_expect_hash nf_ct_expect_hash ++#define ve_nf_ct_expect_max nf_ct_expect_max ++#endif + + struct nf_conntrack_expect + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netfilter/nf_conntrack_l3proto.h debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_l3proto.h +--- ./include/net/netfilter/nf_conntrack_l3proto.h 2012-06-12 16:25:24.190312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_l3proto.h 2012-11-13 15:20:15.288569070 +0000 +@@ -56,6 +56,9 @@ + */ + int (*new)(struct nf_conn *conntrack, const struct sk_buff *skb); + ++ /* Called when a conntrack entry is destroyed */ ++ void (*destroy)(struct nf_conn *conntrack); ++ + /* + * Called before tracking. + * *dataoff: offset of protocol header (TCP, UDP,...) in skb +@@ -81,6 +84,39 @@ + struct module *me; + }; + ++/* virtualization of l3 protocol's sysctl tables: */ ++#if defined(CONFIG_VE_IPTABLES) ++#include ++#define ve_nf_ct3 (get_exec_env()->_nf_conntrack) ++#endif ++ ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++#define ve_nf_ct_l3protos ve_nf_ct3->_nf_ct_l3protos ++#define ve_nf_conntrack_l3proto_ipv4 (ve_nf_ct3->_nf_conntrack_l3proto_ipv4) ++#define ve_nf_conntrack_l3proto_ipv6 (ve_nf_ct3->_nf_conntrack_l3proto_ipv6) ++#define ve_nf_conntrack_max (ve_nf_ct3->_nf_conntrack_max) ++#define ve_nf_conntrack_count (ve_nf_ct3->_nf_conntrack_count) ++#define ve_nf_conntrack_checksum (ve_nf_ct3->_nf_conntrack_checksum) ++#define ve_nf_ct_frag6_timeout (ve_nf_ct3->_nf_frags6_ctl.timeout) ++#define ve_nf_ct_frag6_low_thresh (ve_nf_ct3->_nf_frags6_ctl.low_thresh) ++#define ve_nf_ct_frag6_high_thresh (ve_nf_ct3->_nf_frags6_ctl.high_thresh) ++#else /* !CONFIG_VE_IPTABLES || !CONFIG_SYSCTL: */ ++#define ve_nf_ct_l3protos nf_ct_l3protos ++#define ve_nf_conntrack_l3proto_ipv4 &nf_conntrack_l3proto_ipv4 ++#define ve_nf_conntrack_l3proto_ipv6 &nf_conntrack_l3proto_ipv6 ++#define ve_nf_conntrack_max nf_conntrack_max ++#define ve_nf_conntrack_count nf_conntrack_count ++#define ve_nf_conntrack_checksum nf_conntrack_checksum ++#define ve_nf_ct_frag6_timeout nf_ct_frag6_timeout ++#define ve_nf_ct_frag6_low_thresh nf_ct_frag6_low_thresh ++#define ve_nf_ct_frag6_high_thresh nf_ct_frag6_high_thresh ++#endif /* CONFIG_VE_IPTABLES && CONFIG_SYSCTL */ ++ ++extern int init_nf_ct_l3proto_ipv4(void); ++extern void fini_nf_ct_l3proto_ipv4(void); ++extern int init_nf_ct_l3proto_ipv6(void); ++extern void fini_nf_ct_l3proto_ipv6(void); ++ + extern struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX]; + + /* Protocol registration. */ +@@ -97,7 +133,11 @@ + { + if (unlikely(l3proto >= AF_MAX)) + return &nf_conntrack_l3proto_generic; +- return rcu_dereference(nf_ct_l3protos[l3proto]); ++#ifdef CONFIG_VE_IPTABLES ++ if (!get_exec_env()->_nf_conntrack) ++ return &nf_conntrack_l3proto_generic; ++#endif ++ return rcu_dereference(ve_nf_ct_l3protos[l3proto]); + } + + #endif /*_NF_CONNTRACK_L3PROTO_H*/ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netfilter/nf_conntrack_l4proto.h debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_l4proto.h +--- ./include/net/netfilter/nf_conntrack_l4proto.h 2012-06-12 16:25:24.190312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netfilter/nf_conntrack_l4proto.h 2012-11-13 15:20:15.288569070 +0000 +@@ -99,6 +99,7 @@ + extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic; + + #define MAX_NF_CT_PROTO 256 ++extern struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX]; + + extern struct nf_conntrack_l4proto * + __nf_ct_l4proto_find(u_int16_t l3proto, u_int8_t l4proto); +@@ -119,16 +120,142 @@ + struct nf_conntrack_tuple *t); + extern const struct nla_policy nf_ct_port_nla_policy[]; + ++#ifdef CONFIG_SYSCTL + /* Log invalid packets */ + extern unsigned int nf_ct_log_invalid; ++#endif ++ ++#ifdef CONFIG_VE_IPTABLES ++#include ++#define ve_nf_ct4 (get_exec_env()->_nf_conntrack) ++#endif ++ ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++ ++#define ve_nf_ct_protos (ve_nf_ct4->_nf_ct_protos) ++#define ve_nf_conntrack_l4proto_icmp (ve_nf_ct4->_nf_conntrack_l4proto_icmp) ++#define ve_nf_conntrack_l4proto_icmpv6 \ ++ (ve_nf_ct4->_nf_conntrack_l4proto_icmpv6) ++#define ve_nf_conntrack_l4proto_tcp4 (ve_nf_ct4->_nf_conntrack_l4proto_tcp4) ++#define ve_nf_conntrack_l4proto_tcp6 (ve_nf_ct4->_nf_conntrack_l4proto_tcp6) ++#define ve_nf_conntrack_l4proto_udp4 (ve_nf_ct4->_nf_conntrack_l4proto_udp4) ++#define ve_nf_conntrack_l4proto_udp6 (ve_nf_ct4->_nf_conntrack_l4proto_udp6) ++#define ve_nf_conntrack_l4proto_generic \ ++ (ve_nf_ct4->_nf_conntrack_l4proto_generic) ++#define ve_nf_ct_log_invalid (ve_nf_ct4->_nf_ct_log_invalid) ++/* TCP: */ ++#define ve_nf_ct_tcp_timeouts (ve_nf_ct4->_nf_ct_tcp_timeouts) ++#define ve_nf_ct_tcp_timeout_max_retrans \ ++ (ve_nf_ct4->_nf_ct_tcp_timeout_max_retrans) ++#define ve_nf_ct_tcp_max_retrans (ve_nf_ct4->_nf_ct_tcp_max_retrans) ++#define ve_nf_ct_tcp_loose (ve_nf_ct4->_nf_ct_tcp_loose) ++#define ve_nf_ct_tcp_be_liberal (ve_nf_ct4->_nf_ct_tcp_be_liberal) ++#define ve_tcp_sysctl_table_users (ve_nf_ct4->_tcp_sysctl_table_users) ++#define ve_tcp_sysctl_header (ve_nf_ct4->_tcp_sysctl_header) ++#define ve_tcp_compat_sysctl_header (ve_nf_ct4->_tcp_compat_sysctl_header) ++/* UDP: */ ++#define ve_nf_ct_udp_timeout (ve_nf_ct4->_nf_ct_udp_timeout) ++#define ve_nf_ct_udp_timeout_stream (ve_nf_ct4->_nf_ct_udp_timeout_stream) ++#define ve_udp_sysctl_table_users (ve_nf_ct4->_udp_sysctl_table_users) ++#define ve_udp_sysctl_header (ve_nf_ct4->_udp_sysctl_header) ++#define ve_udp_compat_sysctl_header (ve_nf_ct4->_udp_compat_sysctl_header) ++/* ICMP: */ ++#define ve_nf_ct_icmp_timeout (ve_nf_ct4->_nf_ct_icmp_timeout) ++#define ve_icmp_sysctl_header (ve_nf_ct4->_icmp_sysctl_header) ++#define ve_icmp_compat_sysctl_header (ve_nf_ct4->_icmp_compat_sysctl_header) ++/* ICMPV6: */ ++#define ve_nf_ct_icmpv6_timeout (ve_nf_ct4->_nf_ct_icmpv6_timeout) ++#define ve_icmpv6_sysctl_header (ve_nf_ct4->_icmpv6_sysctl_header) ++/* GENERIC: */ ++#define ve_nf_ct_generic_timeout (ve_nf_ct4->_nf_ct_generic_timeout) ++#define ve_generic_sysctl_header (ve_nf_ct4->_generic_sysctl_header) ++#define ve_generic_compat_sysctl_header (ve_nf_ct4->_generic_compat_sysctl_header) ++ ++extern void nf_ct_proto_icmp_sysctl_cleanup(void); ++extern int nf_ct_proto_icmp_sysctl_init(void); ++extern void nf_ct_proto_icmpv6_sysctl_cleanup(void); ++extern int nf_ct_proto_icmpv6_sysctl_init(void); ++extern void nf_ct_proto_tcp_sysctl_cleanup(void); ++extern int nf_ct_proto_tcp_sysctl_init(void); ++extern void nf_ct_proto_udp_sysctl_cleanup(void); ++extern int nf_ct_proto_udp_sysctl_init(void); ++ ++#else /* !CONFIG_VE_IPTABLES || !CONFIG_SYSCTL: */ ++ ++#define ve_nf_ct_protos nf_ct_protos ++#define ve_nf_conntrack_l4proto_icmp &nf_conntrack_l4proto_icmp ++#define ve_nf_conntrack_l4proto_icmpv6 &nf_conntrack_l4proto_icmpv6 ++#define ve_nf_conntrack_l4proto_tcp4 &nf_conntrack_l4proto_tcp4 ++#define ve_nf_conntrack_l4proto_tcp6 &nf_conntrack_l4proto_tcp6 ++#define ve_nf_conntrack_l4proto_udp4 &nf_conntrack_l4proto_udp4 ++#define ve_nf_conntrack_l4proto_udp6 &nf_conntrack_l4proto_udp6 ++#define ve_nf_conntrack_l4proto_generic &nf_conntrack_l4proto_generic ++ ++#if defined(CONFIG_SYSCTL) ++ ++#define ve_nf_ct_log_invalid nf_ct_log_invalid ++/* TCP: */ ++#define ve_nf_ct_tcp_timeouts *tcp_timeouts ++#define ve_nf_ct_tcp_timeout_max_retrans \ ++ nf_ct_tcp_timeout_max_retrans ++#define ve_nf_ct_tcp_max_retrans nf_ct_tcp_max_retrans ++#define ve_nf_ct_tcp_loose nf_ct_tcp_loose ++#define ve_nf_ct_tcp_be_liberal nf_ct_tcp_be_liberal ++#define ve_tcp_sysctl_table_users tcp_sysctl_table_users ++#define ve_tcp_sysctl_header tcp_sysctl_header ++/* UDP:*/ ++#define ve_nf_ct_udp_timeout nf_ct_udp_timeout ++#define ve_nf_ct_udp_timeout_stream nf_ct_udp_timeout_stream ++#define ve_udp_sysctl_table_users udp_sysctl_table_users ++#define ve_udp_sysctl_header udp_sysctl_header ++/* ICMP: */ ++#define ve_nf_ct_icmp_timeout nf_ct_icmp_timeout ++#define ve_icmp_sysctl_header icmp_sysctl_header ++/* ICMPV6: */ ++#define ve_nf_ct_icmpv6_timeout nf_ct_icmpv6_timeout ++#define ve_icmpv6_sysctl_header icmpv6_sysctl_header ++/* GENERIC: */ ++#define ve_nf_ct_generic_timeout nf_ct_generic_timeout ++#define ve_generic_sysctl_header generic_sysctl_header ++#endif /* CONFIG_SYSCTL */ ++ ++static inline int nf_ct_proto_icmp_sysctl_init(void) ++{ ++ return 0; ++} ++static inline void nf_ct_proto_icmp_sysctl_cleanup(void) ++{ ++} ++static inline int nf_ct_proto_tcp_sysctl_init(void) ++{ ++ return 0; ++} ++static inline void nf_ct_proto_tcp_sysctl_cleanup(void) ++{ ++} ++static inline int nf_ct_proto_udp_sysctl_init(void) ++{ ++ return 0; ++} ++static inline void nf_ct_proto_udp_sysctl_cleanup(void) ++{ ++} ++static inline int nf_ct_proto_icmpv6_sysctl_init(void) ++{ ++ return 0; ++} ++static inline void nf_ct_proto_icmpv6_sysctl_cleanup(void) ++{ ++} ++#endif /* CONFIG_VE_IPTABLES && CONFIG_SYSCTL */ + + #ifdef CONFIG_SYSCTL + #ifdef DEBUG_INVALID_PACKETS + #define LOG_INVALID(proto) \ +- (nf_ct_log_invalid == (proto) || nf_ct_log_invalid == IPPROTO_RAW) ++ (ve_nf_ct_log_invalid == (proto) || ve_nf_ct_log_invalid == IPPROTO_RAW) + #else + #define LOG_INVALID(proto) \ +- ((nf_ct_log_invalid == (proto) || nf_ct_log_invalid == IPPROTO_RAW) \ ++ ((ve_nf_ct_log_invalid == (proto) || ve_nf_ct_log_invalid == IPPROTO_RAW) \ + && net_ratelimit()) + #endif + #else +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netfilter/nf_nat.h debian/binary-custom.d/openvz/src/include/net/netfilter/nf_nat.h +--- ./include/net/netfilter/nf_nat.h 2012-06-12 16:25:24.190312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netfilter/nf_nat.h 2012-11-13 15:20:15.288569070 +0000 +@@ -84,6 +84,7 @@ + /* Is this tuple already taken? (not by us)*/ + extern int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple, + const struct nf_conn *ignored_conntrack); ++extern void ip_nat_hash_conntrack(struct nf_conn *ct); + + static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netfilter/nf_nat_rule.h debian/binary-custom.d/openvz/src/include/net/netfilter/nf_nat_rule.h +--- ./include/net/netfilter/nf_nat_rule.h 2012-06-12 16:25:24.190312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netfilter/nf_nat_rule.h 2012-11-13 15:20:15.288569070 +0000 +@@ -4,7 +4,7 @@ + #include + #include + +-extern int nf_nat_rule_init(void) __init; ++extern int nf_nat_rule_init(void); + extern void nf_nat_rule_cleanup(void); + extern int nf_nat_rule_find(struct sk_buff *skb, + unsigned int hooknum, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/netlink_sock.h debian/binary-custom.d/openvz/src/include/net/netlink_sock.h +--- ./include/net/netlink_sock.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/netlink_sock.h 2012-11-13 15:20:15.288569070 +0000 +@@ -0,0 +1,23 @@ ++#ifndef __NET_NETLINK_SOCK_H ++#define __NET_NETLINK_SOCK_H ++ ++struct netlink_sock { ++ /* struct sock has to be the first member of netlink_sock */ ++ struct sock sk; ++ u32 pid; ++ u32 dst_pid; ++ u32 dst_group; ++ u32 flags; ++ u32 subscriptions; ++ u32 ngroups; ++ unsigned long *groups; ++ unsigned long state; ++ wait_queue_head_t wait; ++ struct netlink_callback *cb; ++ struct mutex *cb_mutex; ++ struct mutex cb_def_mutex; ++ void (*netlink_rcv)(struct sk_buff *skb); ++ struct module *module; ++}; ++ ++#endif /* __NET_NETLINK_SOCK_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/route.h debian/binary-custom.d/openvz/src/include/net/route.h +--- ./include/net/route.h 2012-06-12 16:25:24.190312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/route.h 2012-11-13 15:20:15.292569068 +0000 +@@ -135,6 +135,7 @@ + #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) + + extern const __u8 ip_tos2prio[16]; ++extern int ip_rt_src_check; + + static inline char rt_tos2priority(u8 tos) + { +@@ -201,4 +202,14 @@ + + extern ctl_table ipv4_route_table[]; + ++#ifdef CONFIG_SYSCTL ++extern int ipv4_flush_delay; ++extern int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write, ++ struct file *filp, void __user *buffer, size_t *lenp, ++ loff_t *ppos); ++extern int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, ++ int __user *name, int nlen, void __user *oldval, ++ size_t __user *oldlenp, void __user *newval, ++ size_t newlen); ++#endif + #endif /* _ROUTE_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/sock.h debian/binary-custom.d/openvz/src/include/net/sock.h +--- ./include/net/sock.h 2012-06-12 16:25:24.194312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/sock.h 2012-11-13 15:20:15.296569067 +0000 +@@ -58,6 +58,8 @@ + #include + #include + ++#include ++ + /* + * This structure really needs to be cleaned up. + * Most of it is for TCP, and not used by any of +@@ -263,6 +265,8 @@ + int (*sk_backlog_rcv)(struct sock *sk, + struct sk_buff *skb); + void (*sk_destruct)(struct sock *sk); ++ struct sock_beancounter sk_bc; ++ struct ve_struct *owner_env; + }; + + /* +@@ -498,6 +502,8 @@ + }) + + extern int sk_stream_wait_connect(struct sock *sk, long *timeo_p); ++extern int __sk_stream_wait_memory(struct sock *sk, long *timeo_p, ++ unsigned long amount); + extern int sk_stream_wait_memory(struct sock *sk, long *timeo_p); + extern void sk_stream_wait_close(struct sock *sk, long timeo_p); + extern int sk_stream_error(struct sock *sk, int flags, int err); +@@ -768,8 +774,11 @@ + + static inline int sk_stream_rmem_schedule(struct sock *sk, struct sk_buff *skb) + { +- return (int)skb->truesize <= sk->sk_forward_alloc || +- sk_stream_mem_schedule(sk, skb->truesize, 1); ++ if ((int)skb->truesize > sk->sk_forward_alloc && ++ !sk_stream_mem_schedule(sk, skb->truesize, 1)) ++ /* The situation is bad according to mainstream. Den */ ++ return 0; ++ return ub_tcprcvbuf_charge(sk, skb) == 0; + } + + static inline int sk_stream_wmem_schedule(struct sock *sk, int size) +@@ -832,6 +841,7 @@ + gfp_t priority, + struct proto *prot); + extern void sk_free(struct sock *sk); ++extern void sk_release_kernel(struct sock *sk); + extern struct sock *sk_clone(const struct sock *sk, + const gfp_t priority); + +@@ -855,6 +865,11 @@ + unsigned long size, + int noblock, + int *errcode); ++extern struct sk_buff *sock_alloc_send_skb2(struct sock *sk, ++ unsigned long size, ++ unsigned long size2, ++ int noblock, ++ int *errcode); + extern void *sock_kmalloc(struct sock *sk, int size, + gfp_t priority); + extern void sock_kfree_s(struct sock *sk, void *mem, int size); +@@ -1153,6 +1168,7 @@ + + static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) + { ++ WARN_ON(skb->destructor); + sock_hold(sk); + skb->sk = sk; + skb->destructor = sock_wfree; +@@ -1161,6 +1177,7 @@ + + static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) + { ++ WARN_ON(skb->destructor); + skb->sk = sk; + skb->destructor = sock_rfree; + atomic_add(skb->truesize, &sk->sk_rmem_alloc); +@@ -1353,6 +1370,18 @@ + } + #endif + ++/* ++ * Kernel sockets, f.e. rtnl or icmp_socket, are a part of a namespace. ++ * They should not hold a referrence to a namespace in order to allow ++ * to stop it. ++ * Sockets after sk_change_net should be released using sk_release_kernel ++ */ ++static inline void sk_change_net(struct sock *sk, struct net *net) ++{ ++ put_net(sk->sk_net); ++ sk->sk_net = net; ++} ++ + extern void sock_enable_timestamp(struct sock *sk); + extern int sock_get_timestamp(struct sock *, struct timeval __user *); + extern int sock_get_timestampns(struct sock *, struct timespec __user *); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/tcp.h debian/binary-custom.d/openvz/src/include/net/tcp.h +--- ./include/net/tcp.h 2012-06-12 16:25:24.194312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/tcp.h 2012-11-13 15:20:15.296569067 +0000 +@@ -42,6 +42,13 @@ + #include + + #include ++#include ++ ++#define TCP_PAGE(sk) (sk->sk_sndmsg_page) ++#define TCP_OFF(sk) (sk->sk_sndmsg_off) ++ ++#define TW_WSCALE_MASK 0x0f ++#define TW_WSCALE_SPEC 0x10 + + extern struct inet_hashinfo tcp_hashinfo; + +@@ -218,7 +225,9 @@ + extern int sysctl_tcp_wmem[3]; + extern int sysctl_tcp_rmem[3]; + extern int sysctl_tcp_app_win; ++#ifndef sysctl_tcp_adv_win_scale + extern int sysctl_tcp_adv_win_scale; ++#endif + extern int sysctl_tcp_tw_reuse; + extern int sysctl_tcp_frto; + extern int sysctl_tcp_frto_response; +@@ -233,6 +242,10 @@ + extern int sysctl_tcp_workaround_signed_windows; + extern int sysctl_tcp_slow_start_after_idle; + extern int sysctl_tcp_max_ssthresh; ++extern int sysctl_tcp_use_sg; ++extern int sysctl_tcp_max_tw_kmem_fraction; ++extern int sysctl_tcp_max_tw_buckets_ub; ++ + + extern atomic_t tcp_memory_allocated; + extern atomic_t tcp_sockets_allocated; +@@ -265,12 +278,17 @@ + extern struct proto tcp_prot; + + DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics); +-#define TCP_INC_STATS(field) SNMP_INC_STATS(tcp_statistics, field) +-#define TCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(tcp_statistics, field) +-#define TCP_INC_STATS_USER(field) SNMP_INC_STATS_USER(tcp_statistics, field) +-#define TCP_DEC_STATS(field) SNMP_DEC_STATS(tcp_statistics, field) +-#define TCP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(tcp_statistics, field, val) +-#define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(tcp_statistics, field, val) ++#if defined(CONFIG_VE) && defined(CONFIG_INET) ++#define ve_tcp_statistics (get_exec_env()->_tcp_statistics) ++#else ++#define ve_tcp_statistics tcp_statistics ++#endif ++#define TCP_INC_STATS(field) SNMP_INC_STATS(ve_tcp_statistics, field) ++#define TCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ve_tcp_statistics, field) ++#define TCP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ve_tcp_statistics, field) ++#define TCP_DEC_STATS(field) SNMP_DEC_STATS(ve_tcp_statistics, field) ++#define TCP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(ve_tcp_statistics, field, val) ++#define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(ve_tcp_statistics, field, val) + + extern void tcp_v4_err(struct sk_buff *skb, u32); + +@@ -533,7 +551,11 @@ + * to use only the low 32-bits of jiffies and hide the ugly + * casts with the following macro. + */ ++#ifdef CONFIG_VE ++#define tcp_time_stamp ((__u32)(jiffies + get_exec_env()->jiffies_fixup)) ++#else + #define tcp_time_stamp ((__u32)(jiffies)) ++#endif + + /* This is what the send packet queuing engine uses to pass + * TCP per-packet control information to the transmission +@@ -1336,10 +1358,11 @@ + struct seq_operations seq_ops; + }; + +-extern int tcp_proc_register(struct tcp_seq_afinfo *afinfo); +-extern void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo); ++extern int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo); ++extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo); + + extern struct request_sock_ops tcp_request_sock_ops; ++extern struct request_sock_ops tcp6_request_sock_ops; + + extern int tcp_v4_destroy_sock(struct sock *sk); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./include/net/udp.h debian/binary-custom.d/openvz/src/include/net/udp.h +--- ./include/net/udp.h 2012-06-12 16:25:24.198312490 +0100 ++++ debian/binary-custom.d/openvz/src/include/net/udp.h 2012-11-13 15:20:15.300569068 +0000 +@@ -138,16 +138,29 @@ + char __user *optval, int optlen, + int (*push_pending_frames)(struct sock *)); + ++static inline int udp_hashfn(u16 num, unsigned veid) ++{ ++ return ((num + (veid ^ (veid >> 16))) & (UDP_HTABLE_SIZE - 1)); ++} ++ + DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); + /* + * SNMP statistics for UDP and UDP-Lite + */ ++#ifdef CONFIG_VE ++#define ve_udp_statistics (get_exec_env()->_udp_statistics) ++#define ve_udplite_statistics (get_exec_env()->_udplite_statistics) ++#else ++#define ve_udp_statistics udp_statistics ++#define ve_udplite_statistics udplite_statistics ++#endif ++ + #define UDP_INC_STATS_USER(field, is_udplite) do { \ +- if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \ +- else SNMP_INC_STATS_USER(udp_statistics, field); } while(0) ++ if (is_udplite) SNMP_INC_STATS_USER(ve_udplite_statistics, field); \ ++ else SNMP_INC_STATS_USER(ve_udp_statistics, field); } while(0) + #define UDP_INC_STATS_BH(field, is_udplite) do { \ +- if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \ +- else SNMP_INC_STATS_BH(udp_statistics, field); } while(0) ++ if (is_udplite) SNMP_INC_STATS_BH(ve_udplite_statistics, field); \ ++ else SNMP_INC_STATS_BH(ve_udp_statistics, field); } while(0) + + /* /proc */ + struct udp_seq_afinfo { +@@ -167,8 +180,8 @@ + }; + + #ifdef CONFIG_PROC_FS +-extern int udp_proc_register(struct udp_seq_afinfo *afinfo); +-extern void udp_proc_unregister(struct udp_seq_afinfo *afinfo); ++extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); ++extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); + + extern int udp4_proc_init(void); + extern void udp4_proc_exit(void); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./init/Kconfig debian/binary-custom.d/openvz/src/init/Kconfig +--- ./init/Kconfig 2012-06-12 16:25:24.230312488 +0100 ++++ debian/binary-custom.d/openvz/src/init/Kconfig 2012-11-13 15:20:15.348569066 +0000 +@@ -208,7 +208,7 @@ + + config TASK_IO_ACCOUNTING + bool "Enable per-task storage I/O accounting (EXPERIMENTAL)" +- depends on TASK_XACCT ++ depends on TASK_XACCT && BEANCOUNTERS + help + Collect information on the number of bytes of storage I/O which this + task has caused. +@@ -347,6 +347,7 @@ + + config FAIR_USER_SCHED + bool "user id" ++ depends on !VE + help + This option will choose userid as the basis for grouping + tasks, thus providing equal CPU bandwidth to each user. +@@ -361,6 +362,12 @@ + Refer to Documentation/cgroups.txt for more information + on "cgroup" pseudo filesystem. + ++config VZ_FAIRSCHED ++ bool "OpenVZ groups" ++ help ++ This option add customizable task groups with OpenVZ compatible ++ syscall and procfs interface. ++ + endchoice + + config CGROUP_CPUACCT +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./init/calibrate.c debian/binary-custom.d/openvz/src/init/calibrate.c +--- ./init/calibrate.c 2012-06-12 16:25:24.230312488 +0100 ++++ debian/binary-custom.d/openvz/src/init/calibrate.c 2012-11-13 15:20:15.348569066 +0000 +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -107,6 +108,60 @@ + static unsigned long __devinit calibrate_delay_direct(void) {return 0;} + #endif + ++unsigned long cycles_per_jiffy, cycles_per_clock; ++ ++static __devinit void calibrate_cycles(void) ++{ ++ unsigned long ticks; ++ cycles_t time; ++ ++ ticks = jiffies; ++ while (ticks == jiffies) ++ /* nothing */; ++ time = get_cycles(); ++ ticks = jiffies; ++ while (ticks == jiffies) ++ /* nothing */; ++ ++ time = get_cycles() - time; ++ cycles_per_jiffy = time; ++ if ((time >> 32) != 0) { ++ printk("CPU too fast! timings are incorrect\n"); ++ cycles_per_jiffy = -1; ++ } ++} ++ ++EXPORT_SYMBOL(cycles_per_jiffy); ++EXPORT_SYMBOL(cycles_per_clock); ++ ++static __devinit void calc_cycles_per_jiffy(void) ++{ ++#if 0 ++ extern unsigned long fast_gettimeoffset_quotient; ++ unsigned long low, high; ++ ++ if (fast_gettimeoffset_quotient != 0) { ++ __asm__("divl %2" ++ :"=a" (low), "=d" (high) ++ :"r" (fast_gettimeoffset_quotient), ++ "0" (0), "1" (1000000/HZ)); ++ ++ cycles_per_jiffy = low; ++ } ++#endif ++ if (cycles_per_jiffy == 0) ++ calibrate_cycles(); ++ ++ if (cycles_per_jiffy == 0) { ++ printk(KERN_WARNING "Cycles are stuck! " ++ "Some statistics will not be available."); ++ /* to prevent division by zero in cycles_to_(clocks|jiffies) */ ++ cycles_per_jiffy = 1; ++ cycles_per_clock = 1; ++ } else ++ cycles_per_clock = cycles_per_jiffy * (HZ / CLOCKS_PER_SEC); ++} ++ + /* + * This is the number of bits of precision for the loops_per_jiffy. Each + * bit takes on average 1.5/HZ seconds. This (like the original) is a little +@@ -172,4 +227,6 @@ + printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n", + loops_per_jiffy/(500000/HZ), + (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy); ++ ++ calc_cycles_per_jiffy(); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./init/main.c debian/binary-custom.d/openvz/src/init/main.c +--- ./init/main.c 2012-06-12 16:25:24.230312488 +0100 ++++ debian/binary-custom.d/openvz/src/init/main.c 2012-11-13 15:20:15.352569065 +0000 +@@ -57,6 +57,9 @@ + #include + #include + #include ++#include ++ ++#include + + #include + #include +@@ -105,10 +108,25 @@ + #ifdef CONFIG_TC + extern void tc_init(void); + #endif ++extern void grsecurity_init(void); + + enum system_states system_state; + EXPORT_SYMBOL(system_state); + ++#ifdef CONFIG_VE ++extern void init_ve_system(void); ++extern void init_ve0(void); ++extern void prepare_ve0_process(struct task_struct *tsk); ++extern void prepare_ve0_proc_root(void); ++extern void prepare_ve0_sysctl(void); ++#else ++#define init_ve_system() do { } while (0) ++#define init_ve0() do { } while (0) ++#define prepare_ve0_process(tsk) do { } while (0) ++#define prepare_ve0_proc_root() do { } while (0) ++#define prepare_ve0_sysctl() do { } while (0) ++#endif ++ + /* + * Boot command-line arguments + */ +@@ -515,6 +533,9 @@ + + smp_setup_processor_id(); + ++ prepare_ve0_process(&init_task); ++ init_ve0(); ++ + /* + * Need to run as early as possible, to initialize the + * lockdep hash: +@@ -532,6 +553,7 @@ + * enable them + */ + lock_kernel(); ++ ub_init_early(); + tick_init(); + boot_cpu_init(); + page_address_init(); +@@ -627,6 +649,7 @@ + #endif + fork_init(num_physpages); + proc_caches_init(); ++ ub_init_late(); + buffer_init(); + unnamed_dev_init(); + key_init(); +@@ -637,6 +660,8 @@ + /* rootfs populating might need page-writeback */ + page_writeback_init(); + #ifdef CONFIG_PROC_FS ++ prepare_ve0_proc_root(); ++ prepare_ve0_sysctl(); + proc_root_init(); + #endif + cgroup_init(); +@@ -651,6 +676,10 @@ + #endif + acpi_early_init(); /* before LAPIC and SMP init */ + ++#ifdef CONFIG_BC_RSS_ACCOUNTING ++ ub_init_pbc(); ++#endif ++ + /* Do the rest non-__init'ed, we're now alive */ + rest_init(); + } +@@ -735,6 +764,8 @@ + */ + static void __init do_basic_setup(void) + { ++ init_ve_system(); ++ + /* drivers will send hotplug events */ + init_workqueues(); + usermodehelper_init(); +@@ -827,7 +858,7 @@ + */ + init_pid_ns.child_reaper = current; + +- __set_special_pids(1, 1); ++ __set_special_pids(&init_struct_pid); + cad_pid = task_pid(current); + + smp_prepare_cpus(max_cpus); +@@ -835,6 +866,7 @@ + do_pre_smp_initcalls(); + + smp_init(); ++ fairsched_init_late(); + sched_init_smp(); + + cpuset_init_smp(); +@@ -854,6 +886,8 @@ + prepare_namespace(); + } + ++ grsecurity_init(); ++ + /* + * Ok, we have completed the initial bootup, and + * we're essentially up and running. Get rid of the +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./init/version.c debian/binary-custom.d/openvz/src/init/version.c +--- ./init/version.c 2012-06-12 16:25:24.230312488 +0100 ++++ debian/binary-custom.d/openvz/src/init/version.c 2012-11-13 15:20:15.352569065 +0000 +@@ -33,6 +33,12 @@ + }; + EXPORT_SYMBOL_GPL(init_uts_ns); + ++struct new_utsname virt_utsname = { ++ /* we need only this field */ ++ .release = UTS_RELEASE, ++}; ++EXPORT_SYMBOL(virt_utsname); ++ + /* FIXED STRINGS! Don't touch! */ + const char linux_banner[] = + "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./ipc/ipc_sysctl.c debian/binary-custom.d/openvz/src/ipc/ipc_sysctl.c +--- ./ipc/ipc_sysctl.c 2012-06-12 16:25:24.230312488 +0100 ++++ debian/binary-custom.d/openvz/src/ipc/ipc_sysctl.c 2012-11-13 15:20:15.360569068 +0000 +@@ -102,6 +102,7 @@ + .mode = 0644, + .proc_handler = proc_ipc_doulongvec_minmax, + .strategy = sysctl_ipc_data, ++ .virt_handler = 1, + }, + { + .ctl_name = KERN_SHMALL, +@@ -111,6 +112,7 @@ + .mode = 0644, + .proc_handler = proc_ipc_doulongvec_minmax, + .strategy = sysctl_ipc_data, ++ .virt_handler = 1, + }, + { + .ctl_name = KERN_SHMMNI, +@@ -120,6 +122,7 @@ + .mode = 0644, + .proc_handler = proc_ipc_dointvec, + .strategy = sysctl_ipc_data, ++ .virt_handler = 1, + }, + { + .ctl_name = KERN_MSGMAX, +@@ -129,6 +132,7 @@ + .mode = 0644, + .proc_handler = proc_ipc_dointvec, + .strategy = sysctl_ipc_data, ++ .virt_handler = 1, + }, + { + .ctl_name = KERN_MSGMNI, +@@ -138,6 +142,7 @@ + .mode = 0644, + .proc_handler = proc_ipc_dointvec, + .strategy = sysctl_ipc_data, ++ .virt_handler = 1, + }, + { + .ctl_name = KERN_MSGMNB, +@@ -147,6 +152,7 @@ + .mode = 0644, + .proc_handler = proc_ipc_dointvec, + .strategy = sysctl_ipc_data, ++ .virt_handler = 1, + }, + { + .ctl_name = KERN_SEM, +@@ -156,6 +162,7 @@ + .mode = 0644, + .proc_handler = proc_ipc_dointvec, + .strategy = sysctl_ipc_data, ++ .virt_handler = 1, + }, + {} + }; +@@ -172,7 +179,7 @@ + + static int __init ipc_sysctl_init(void) + { +- register_sysctl_table(ipc_root_table); ++ register_glob_sysctl_table(ipc_root_table); + return 0; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./ipc/msg.c debian/binary-custom.d/openvz/src/ipc/msg.c +--- ./ipc/msg.c 2012-06-12 16:25:24.230312488 +0100 ++++ debian/binary-custom.d/openvz/src/ipc/msg.c 2012-11-13 15:20:15.360569068 +0000 +@@ -184,6 +184,7 @@ + int id, retval; + key_t key = params->key; + int msgflg = params->flg; ++ int msqid = params->id; + + msq = ipc_rcu_alloc(sizeof(*msq)); + if (!msq) +@@ -202,7 +203,7 @@ + /* + * ipc_addid() locks msq + */ +- id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni); ++ id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni, msqid); + if (id < 0) { + security_msg_queue_free(msq); + ipc_rcu_putref(msq); +@@ -324,6 +325,7 @@ + + msg_params.key = key; + msg_params.flg = msgflg; ++ msg_params.id = -1; + + return ipcget(ns, &msg_ids(ns), &msg_ops, &msg_params); + } +@@ -552,7 +554,7 @@ + + err = -EPERM; + if (current->euid != ipcp->cuid && +- current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN)) ++ current->euid != ipcp->uid && !capable(CAP_VE_SYS_ADMIN)) + /* We _could_ check for CAP_CHOWN above, but we don't */ + goto out_unlock_up; + +@@ -968,3 +970,55 @@ + msq->q_ctime); + } + #endif ++ ++#ifdef CONFIG_VE ++#include ++ ++int sysvipc_setup_msg(key_t key, int msqid, int msgflg) ++{ ++ struct ipc_namespace *ns; ++ struct ipc_ops msg_ops; ++ struct ipc_params msg_params; ++ ++ ns = current->nsproxy->ipc_ns; ++ ++ msg_ops.getnew = newque; ++ msg_ops.associate = msg_security; ++ msg_ops.more_checks = NULL; ++ ++ msg_params.key = key; ++ msg_params.flg = msgflg | IPC_CREAT; ++ msg_params.id = msqid; ++ ++ return ipcget(ns, &msg_ids(ns), &msg_ops, &msg_params); ++} ++EXPORT_SYMBOL_GPL(sysvipc_setup_msg); ++ ++int sysvipc_walk_msg(int (*func)(int i, struct msg_queue*, void *), void *arg) ++{ ++ int err = 0; ++ struct msg_queue * msq; ++ struct ipc_namespace *ns; ++ int next_id; ++ int total, in_use; ++ ++ ns = current->nsproxy->ipc_ns; ++ ++ down_write(&msg_ids(ns).rw_mutex); ++ in_use = msg_ids(ns).in_use; ++ for (total = 0, next_id = 0; total < in_use; next_id++) { ++ msq = idr_find(&msg_ids(ns).ipcs_idr, next_id); ++ if (msq == NULL) ++ continue; ++ ipc_lock_by_ptr(&msq->q_perm); ++ err = func(msg_buildid(next_id, msq->q_perm.seq), msq, arg); ++ msg_unlock(msq); ++ if (err) ++ break; ++ total++; ++ } ++ up_write(&msg_ids(ns).rw_mutex); ++ return err; ++} ++EXPORT_SYMBOL_GPL(sysvipc_walk_msg); ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./ipc/msgutil.c debian/binary-custom.d/openvz/src/ipc/msgutil.c +--- ./ipc/msgutil.c 2012-06-12 16:25:24.230312488 +0100 ++++ debian/binary-custom.d/openvz/src/ipc/msgutil.c 2012-11-13 15:20:15.360569068 +0000 +@@ -8,6 +8,7 @@ + * See the file COPYING for more details. + */ + ++#include + #include + #include + #include +@@ -17,6 +18,8 @@ + + #include "util.h" + ++#include ++ + struct msg_msgseg { + struct msg_msgseg* next; + /* the next part of the message follows immediately */ +@@ -25,52 +28,53 @@ + #define DATALEN_MSG (PAGE_SIZE-sizeof(struct msg_msg)) + #define DATALEN_SEG (PAGE_SIZE-sizeof(struct msg_msgseg)) + +-struct msg_msg *load_msg(const void __user *src, int len) ++struct msg_msg *sysv_msg_load(int (*load)(void * dst, int len, int offset, ++ void * data), int len, void * data) + { + struct msg_msg *msg; + struct msg_msgseg **pseg; + int err; + int alen; ++ int offset = 0; + + alen = len; + if (alen > DATALEN_MSG) + alen = DATALEN_MSG; + +- msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL); ++ msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL_UBC); + if (msg == NULL) + return ERR_PTR(-ENOMEM); + + msg->next = NULL; + msg->security = NULL; + +- if (copy_from_user(msg + 1, src, alen)) { ++ if (load(msg + 1, alen, offset, data)) { + err = -EFAULT; + goto out_err; + } + + len -= alen; +- src = ((char __user *)src) + alen; ++ offset += alen; + pseg = &msg->next; + while (len > 0) { + struct msg_msgseg *seg; + alen = len; + if (alen > DATALEN_SEG) + alen = DATALEN_SEG; +- seg = kmalloc(sizeof(*seg) + alen, +- GFP_KERNEL); ++ seg = kmalloc(sizeof(*seg) + alen, GFP_KERNEL_UBC); + if (seg == NULL) { + err = -ENOMEM; + goto out_err; + } + *pseg = seg; + seg->next = NULL; +- if (copy_from_user(seg + 1, src, alen)) { ++ if (load(seg + 1, alen, offset, data)) { + err = -EFAULT; + goto out_err; + } + pseg = &seg->next; + len -= alen; +- src = ((char __user *)src) + alen; ++ offset += alen; + } + + err = security_msg_msg_alloc(msg); +@@ -83,33 +87,58 @@ + free_msg(msg); + return ERR_PTR(err); + } ++EXPORT_SYMBOL_GPL(sysv_msg_load); + +-int store_msg(void __user *dest, struct msg_msg *msg, int len) ++static int do_load_msg(void * dst, int len, int offset, void * data) ++{ ++ return copy_from_user(dst, data + offset, len); ++} ++ ++struct msg_msg *load_msg(const void __user *src, int len) ++{ ++ return sysv_msg_load(do_load_msg, len, (void*)src); ++} ++ ++int sysv_msg_store(struct msg_msg *msg, ++ int (*store)(void * src, int len, int offset, void * data), ++ int len, void * data) + { + int alen; ++ int offset = 0; + struct msg_msgseg *seg; +- ++ + alen = len; + if (alen > DATALEN_MSG) + alen = DATALEN_MSG; +- if (copy_to_user(dest, msg + 1, alen)) ++ if (store(msg + 1, alen, offset, data)) + return -1; + + len -= alen; +- dest = ((char __user *)dest) + alen; ++ offset += alen; + seg = msg->next; + while (len > 0) { + alen = len; + if (alen > DATALEN_SEG) + alen = DATALEN_SEG; +- if (copy_to_user(dest, seg + 1, alen)) ++ if (store(seg + 1, alen, offset, data)) + return -1; + len -= alen; +- dest = ((char __user *)dest) + alen; ++ offset += alen; + seg = seg->next; + } + return 0; + } ++EXPORT_SYMBOL_GPL(sysv_msg_store); ++ ++static int do_store_msg(void * src, int len, int offset, void * data) ++{ ++ return copy_to_user(data + offset, src, len); ++} ++ ++int store_msg(void __user *dest, struct msg_msg *msg, int len) ++{ ++ return sysv_msg_store(msg, do_store_msg, len, dest); ++} + + void free_msg(struct msg_msg *msg) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./ipc/sem.c debian/binary-custom.d/openvz/src/ipc/sem.c +--- ./ipc/sem.c 2012-06-12 16:25:24.234312488 +0100 ++++ debian/binary-custom.d/openvz/src/ipc/sem.c 2012-11-13 15:20:15.360569068 +0000 +@@ -86,6 +86,8 @@ + #include + #include "util.h" + ++#include ++ + #define sem_ids(ns) (*((ns)->ids[IPC_SEM_IDS])) + + #define sem_unlock(sma) ipc_unlock(&(sma)->sem_perm) +@@ -259,6 +261,7 @@ + key_t key = params->key; + int nsems = params->u.nsems; + int semflg = params->flg; ++ int semid = params->id; + + if (!nsems) + return -EINVAL; +@@ -282,7 +285,7 @@ + return retval; + } + +- id = ipc_addid(&sem_ids(ns), &sma->sem_perm, ns->sc_semmni); ++ id = ipc_addid(&sem_ids(ns), &sma->sem_perm, ns->sc_semmni, semid); + if (id < 0) { + security_sem_free(sma); + ipc_rcu_putref(sma); +@@ -347,6 +350,7 @@ + sem_params.key = key; + sem_params.flg = semflg; + sem_params.u.nsems = nsems; ++ sem_params.id = -1; + + return ipcget(ns, &sem_ids(ns), &sem_ops, &sem_params); + } +@@ -927,7 +931,7 @@ + goto out_unlock; + } + if (current->euid != ipcp->cuid && +- current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN)) { ++ current->euid != ipcp->uid && !capable(CAP_VE_SYS_ADMIN)) { + err=-EPERM; + goto out_unlock; + } +@@ -1018,7 +1022,7 @@ + + undo_list = current->sysvsem.undo_list; + if (!undo_list) { +- undo_list = kzalloc(sizeof(*undo_list), GFP_KERNEL); ++ undo_list = kzalloc(sizeof(*undo_list), GFP_KERNEL_UBC); + if (undo_list == NULL) + return -ENOMEM; + spin_lock_init(&undo_list->lock); +@@ -1076,7 +1080,8 @@ + ipc_rcu_getref(sma); + sem_unlock(sma); + +- new = kzalloc(sizeof(struct sem_undo) + sizeof(short)*nsems, GFP_KERNEL); ++ new = kzalloc(sizeof(struct sem_undo) + sizeof(short)*nsems, ++ GFP_KERNEL_UBC); + if (!new) { + ipc_lock_by_ptr(&sma->sem_perm); + ipc_rcu_putref(sma); +@@ -1136,7 +1141,7 @@ + if (nsops > ns->sc_semopm) + return -E2BIG; + if(nsops > SEMOPM_FAST) { +- sops = kmalloc(sizeof(*sops)*nsops,GFP_KERNEL); ++ sops = kmalloc(sizeof(*sops)*nsops, GFP_KERNEL_UBC); + if(sops==NULL) + return -ENOMEM; + } +@@ -1417,3 +1422,57 @@ + sma->sem_ctime); + } + #endif ++ ++#ifdef CONFIG_VE ++#include ++ ++int sysvipc_setup_sem(key_t key, int semid, size_t size, int semflg) ++{ ++ struct ipc_namespace *ns; ++ struct ipc_ops sem_ops; ++ struct ipc_params sem_params; ++ ++ ns = current->nsproxy->ipc_ns; ++ ++ sem_ops.getnew = newary; ++ sem_ops.associate = sem_security; ++ sem_ops.more_checks = sem_more_checks; ++ ++ sem_params.key = key; ++ sem_params.flg = semflg | IPC_CREAT; ++ sem_params.u.nsems = size; ++ sem_params.id = semid; ++ ++ return ipcget(ns, &sem_ids(ns), &sem_ops, &sem_params); ++} ++EXPORT_SYMBOL_GPL(sysvipc_setup_sem); ++ ++int sysvipc_walk_sem(int (*func)(int i, struct sem_array*, void *), void *arg) ++{ ++ int err = 0; ++ struct sem_array *sma; ++ struct ipc_namespace *ns; ++ int next_id; ++ int total, in_use; ++ ++ ns = current->nsproxy->ipc_ns; ++ ++ down_write(&sem_ids(ns).rw_mutex); ++ in_use = sem_ids(ns).in_use; ++ for (total = 0, next_id = 0; total < in_use; next_id++) { ++ sma = idr_find(&sem_ids(ns).ipcs_idr, next_id); ++ if (sma == NULL) ++ continue; ++ ipc_lock_by_ptr(&sma->sem_perm); ++ err = func(sem_buildid(next_id, sma->sem_perm.seq), sma, arg); ++ sem_unlock(sma); ++ if (err) ++ break; ++ total++; ++ } ++ up_write(&sem_ids(ns).rw_mutex); ++ return err; ++} ++EXPORT_SYMBOL_GPL(sysvipc_walk_sem); ++EXPORT_SYMBOL_GPL(exit_sem); ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./ipc/shm.c debian/binary-custom.d/openvz/src/ipc/shm.c +--- ./ipc/shm.c 2012-06-12 16:25:24.234312488 +0100 ++++ debian/binary-custom.d/openvz/src/ipc/shm.c 2012-11-13 15:20:15.360569068 +0000 +@@ -38,29 +38,19 @@ + #include + #include + #include ++#include + + #include + +-#include "util.h" +- +-struct shm_file_data { +- int id; +- struct ipc_namespace *ns; +- struct file *file; +- const struct vm_operations_struct *vm_ops; +-}; ++#include ++#include + +-#define shm_file_data(file) (*((struct shm_file_data **)&(file)->private_data)) ++#include "util.h" + +-static const struct file_operations shm_file_operations; + static struct vm_operations_struct shm_vm_ops; + + static struct ipc_ids init_shm_ids; + +-#define shm_ids(ns) (*((ns)->ids[IPC_SHM_IDS])) +- +-#define shm_unlock(shp) \ +- ipc_unlock(&(shp)->shm_perm) + #define shm_buildid(id, seq) ipc_buildid(id, seq) + + static int newseg(struct ipc_namespace *, struct ipc_params *); +@@ -161,17 +151,6 @@ + return container_of(ipcp, struct shmid_kernel, shm_perm); + } + +-/* +- * shm_lock_(check_) routines are called in the paths where the rw_mutex +- * is not held. +- */ +-static inline struct shmid_kernel *shm_lock(struct ipc_namespace *ns, int id) +-{ +- struct kern_ipc_perm *ipcp = ipc_lock(&shm_ids(ns), id); +- +- return container_of(ipcp, struct shmid_kernel, shm_perm); +-} +- + static inline struct shmid_kernel *shm_lock_check(struct ipc_namespace *ns, + int id) + { +@@ -185,9 +164,10 @@ + ipc_rmid(&shm_ids(ns), &s->shm_perm); + } + +-static inline int shm_addid(struct ipc_namespace *ns, struct shmid_kernel *shp) ++static inline int shm_addid(struct ipc_namespace *ns, struct shmid_kernel *shp, ++ int reqid) + { +- return ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); ++ return ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni, reqid); + } + + +@@ -207,6 +187,48 @@ + shm_unlock(shp); + } + ++static int shmem_lock(struct shmid_kernel *shp, int lock, ++ struct user_struct *user) ++{ ++ struct file *file = shp->shm_file; ++ struct inode *inode = file->f_path.dentry->d_inode; ++ struct shmem_inode_info *info = SHMEM_I(inode); ++ unsigned long size; ++ ++ size = shp->shm_segsz + PAGE_SIZE - 1; ++ ++#ifdef CONFIG_SHMEM ++ spin_lock(&info->lock); ++ if (lock && !(info->flags & VM_LOCKED)) { ++ if (ub_lockedshm_charge(info, size) < 0) ++ goto out_ch; ++ ++ if (!user_shm_lock(inode->i_size, user)) ++ goto out_user; ++ info->flags |= VM_LOCKED; ++ } ++ if (!lock && (info->flags & VM_LOCKED) && user) { ++ ub_lockedshm_uncharge(info, size); ++ user_shm_unlock(inode->i_size, user); ++ info->flags &= ~VM_LOCKED; ++ } ++ spin_unlock(&info->lock); ++ return 0; ++ ++out_user: ++ ub_lockedshm_uncharge(info, size); ++out_ch: ++ spin_unlock(&info->lock); ++ return -ENOMEM; ++#else ++ if (lock && ub_lockedshm_charge(info, size)) ++ return -ENOMEM; ++ if (!lock) ++ ub_lockedshm_uncharge(info, size); ++ return 0; ++#endif ++} ++ + /* + * shm_destroy - free the struct shmid_kernel + * +@@ -222,7 +244,7 @@ + shm_rmid(ns, shp); + shm_unlock(shp); + if (!is_file_hugepages(shp->shm_file)) +- shmem_lock(shp->shm_file, 0, shp->mlock_user); ++ shmem_lock(shp, 0, shp->mlock_user); + else + user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size, + shp->mlock_user); +@@ -344,11 +366,12 @@ + pgoff, flags); + } + +-static const struct file_operations shm_file_operations = { ++const struct file_operations shm_file_operations = { + .mmap = shm_mmap, + .fsync = shm_fsync, + .release = shm_release, + }; ++EXPORT_SYMBOL_GPL(shm_file_operations); + + static const struct file_operations shm_file_operations_huge = { + .mmap = shm_mmap, +@@ -385,11 +408,12 @@ + key_t key = params->key; + int shmflg = params->flg; + size_t size = params->u.size; ++ int shmid = params->id; + int error; + struct shmid_kernel *shp; + int numpages = (size + PAGE_SIZE -1) >> PAGE_SHIFT; + struct file * file; +- char name[13]; ++ char name[64]; + int id; + + if (size < SHMMIN || size > ns->shm_ctlmax) +@@ -413,7 +437,7 @@ + return error; + } + +- sprintf (name, "SYSV%08x", key); ++ snprintf (name, sizeof(name), "VE%d-SYSV%08x", VEID(get_exec_env()), key); + if (shmflg & SHM_HUGETLB) { + /* hugetlb_file_setup takes care of mlock user accounting */ + file = hugetlb_file_setup(name, size); +@@ -433,7 +457,7 @@ + if (IS_ERR(file)) + goto no_file; + +- id = shm_addid(ns, shp); ++ id = shm_addid(ns, shp, shmid); + if (id < 0) { + error = id; + goto no_id; +@@ -507,6 +531,7 @@ + shm_params.key = key; + shm_params.flg = shmflg; + shm_params.u.size = size; ++ shm_params.id = -1; + + return ipcget(ns, &shm_ids(ns), &shm_ops, &shm_params); + } +@@ -790,14 +815,14 @@ + if(cmd==SHM_LOCK) { + struct user_struct * user = current->user; + if (!is_file_hugepages(shp->shm_file)) { +- err = shmem_lock(shp->shm_file, 1, user); ++ err = shmem_lock(shp, 1, user); + if (!err && !(shp->shm_perm.mode & SHM_LOCKED)){ + shp->shm_perm.mode |= SHM_LOCKED; + shp->mlock_user = user; + } + } + } else if (!is_file_hugepages(shp->shm_file)) { +- shmem_lock(shp->shm_file, 0, shp->mlock_user); ++ shmem_lock(shp, 0, shp->mlock_user); + shp->shm_perm.mode &= ~SHM_LOCKED; + shp->mlock_user = NULL; + } +@@ -829,7 +854,7 @@ + + if (current->euid != shp->shm_perm.uid && + current->euid != shp->shm_perm.cuid && +- !capable(CAP_SYS_ADMIN)) { ++ !capable(CAP_VE_SYS_ADMIN)) { + err=-EPERM; + goto out_unlock_up; + } +@@ -869,7 +894,7 @@ + err=-EPERM; + if (current->euid != shp->shm_perm.uid && + current->euid != shp->shm_perm.cuid && +- !capable(CAP_SYS_ADMIN)) { ++ !capable(CAP_VE_SYS_ADMIN)) { + goto out_unlock_up; + } + +@@ -1185,3 +1210,67 @@ + shp->shm_ctim); + } + #endif ++ ++#ifdef CONFIG_VE ++#include ++ ++struct file * sysvipc_setup_shm(key_t key, int shmid, size_t size, int shmflg) ++{ ++ struct ipc_namespace *ns; ++ struct ipc_ops shm_ops; ++ struct ipc_params shm_params; ++ struct shmid_kernel *shp; ++ struct file *file; ++ int rv; ++ ++ ns = current->nsproxy->ipc_ns; ++ ++ shm_ops.getnew = newseg; ++ shm_ops.associate = shm_security; ++ shm_ops.more_checks = shm_more_checks; ++ ++ shm_params.key = key; ++ shm_params.flg = shmflg | IPC_CREAT; ++ shm_params.u.size = size; ++ shm_params.id = shmid; ++ ++ rv = ipcget(ns, &shm_ids(ns), &shm_ops, &shm_params); ++ if (rv < 0) ++ return ERR_PTR(rv); ++ shp = shm_lock(ns, rv); ++ BUG_ON(IS_ERR(shp)); ++ file = shp->shm_file; ++ get_file(file); ++ shm_unlock(shp); ++ return file; ++} ++EXPORT_SYMBOL_GPL(sysvipc_setup_shm); ++ ++int sysvipc_walk_shm(int (*func)(struct shmid_kernel*, void *), void *arg) ++{ ++ int err = 0; ++ struct shmid_kernel* shp; ++ struct ipc_namespace *ns; ++ int next_id; ++ int total, in_use; ++ ++ ns = current->nsproxy->ipc_ns; ++ ++ down_write(&shm_ids(ns).rw_mutex); ++ in_use = shm_ids(ns).in_use; ++ for (total = 0, next_id = 0; total < in_use; next_id++) { ++ shp = idr_find(&shm_ids(ns).ipcs_idr, next_id); ++ if (shp == NULL) ++ continue; ++ ipc_lock_by_ptr(&shp->shm_perm); ++ err = func(shp, arg); ++ shm_unlock(shp); ++ if (err) ++ break; ++ total++; ++ } ++ up_write(&shm_ids(ns).rw_mutex); ++ return err; ++} ++EXPORT_SYMBOL_GPL(sysvipc_walk_shm); ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./ipc/util.c debian/binary-custom.d/openvz/src/ipc/util.c +--- ./ipc/util.c 2012-06-12 16:25:24.234312488 +0100 ++++ debian/binary-custom.d/openvz/src/ipc/util.c 2012-11-13 15:20:15.360569068 +0000 +@@ -36,6 +36,8 @@ + + #include + ++#include ++ + #include "util.h" + + struct ipc_proc_iface { +@@ -258,6 +260,7 @@ + * @ids: IPC identifier set + * @new: new IPC permission set + * @size: limit for the number of used ids ++ * @reqid: if >= 0, get this id exactly. If -1 -- don't care. + * + * Add an entry 'new' to the IPC ids idr. The permissions object is + * initialised and the first free entry is set up and the id assigned +@@ -267,10 +270,18 @@ + * Called with ipc_ids.rw_mutex held as a writer. + */ + +-int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size) ++int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size, int reqid) + { + int id, err; + ++ if (reqid >= 0) { ++ id = reqid % SEQ_MULTIPLIER; ++ err = idr_get_new_above(&ids->ipcs_idr, new, id, &id); ++ if (err || id != (reqid % SEQ_MULTIPLIER)) ++ return -EEXIST; ++ goto found; ++ } ++ + if (size > IPCMNI) + size = IPCMNI; + +@@ -280,15 +291,19 @@ + err = idr_get_new(&ids->ipcs_idr, new, &id); + if (err) + return err; +- ++found: + ids->in_use++; + + new->cuid = new->uid = current->euid; + new->gid = new->cgid = current->egid; + +- new->seq = ids->seq++; +- if(ids->seq > ids->seq_max) +- ids->seq = 0; ++ if (reqid >= 0) { ++ new->seq = reqid/SEQ_MULTIPLIER; ++ } else { ++ new->seq = ids->seq++; ++ if(ids->seq > ids->seq_max) ++ ids->seq = 0; ++ } + + spin_lock_init(&new->lock); + new->deleted = 0; +@@ -455,9 +470,9 @@ + { + void* out; + if(size > PAGE_SIZE) +- out = vmalloc(size); ++ out = ub_vmalloc(size); + else +- out = kmalloc(size, GFP_KERNEL); ++ out = kmalloc(size, GFP_KERNEL_UBC); + return out; + } + +@@ -540,14 +555,14 @@ + * workqueue if necessary (for vmalloc). + */ + if (rcu_use_vmalloc(size)) { +- out = vmalloc(HDRLEN_VMALLOC + size); ++ out = ub_vmalloc(HDRLEN_VMALLOC + size); + if (out) { + out += HDRLEN_VMALLOC; + container_of(out, struct ipc_rcu_hdr, data)->is_vmalloc = 1; + container_of(out, struct ipc_rcu_hdr, data)->refcount = 1; + } + } else { +- out = kmalloc(HDRLEN_KMALLOC + size, GFP_KERNEL); ++ out = kmalloc(HDRLEN_KMALLOC + size, GFP_KERNEL_UBC); + if (out) { + out += HDRLEN_KMALLOC; + container_of(out, struct ipc_rcu_hdr, data)->is_vmalloc = 0; +@@ -734,6 +749,7 @@ + + return out; + } ++EXPORT_SYMBOL_GPL(ipc_lock); + + /** + * ipc_lock_down - Lock an ipc structure with rw_sem held +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./ipc/util.h debian/binary-custom.d/openvz/src/ipc/util.h +--- ./ipc/util.h 2012-06-12 16:25:24.234312488 +0100 ++++ debian/binary-custom.d/openvz/src/ipc/util.h 2012-11-13 15:20:15.360569068 +0000 +@@ -28,14 +28,6 @@ + void msg_exit_ns(struct ipc_namespace *ns); + void shm_exit_ns(struct ipc_namespace *ns); + +-struct ipc_ids { +- int in_use; +- unsigned short seq; +- unsigned short seq_max; +- struct rw_semaphore rw_mutex; +- struct idr ipcs_idr; +-}; +- + /* + * Structure that holds the parameters needed by the ipc operations + * (see after) +@@ -47,6 +39,7 @@ + size_t size; /* for shared memories */ + int nsems; /* for semaphores */ + } u; /* holds the getnew() specific param */ ++ int id; + }; + + /* +@@ -75,14 +68,10 @@ + #define ipc_init_proc_interface(path, header, ids, show) do {} while (0) + #endif + +-#define IPC_SEM_IDS 0 +-#define IPC_MSG_IDS 1 +-#define IPC_SHM_IDS 2 +- + #define ipcid_to_idx(id) ((id) % SEQ_MULTIPLIER) + + /* must be called with ids->rw_mutex acquired for writing */ +-int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int); ++int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int, int); + + /* must be called with ids->rw_mutex acquired for reading */ + int ipc_get_maxid(struct ipc_ids *); +@@ -114,7 +103,6 @@ + * ipc_lock: called without that lock held + */ + struct kern_ipc_perm *ipc_lock_down(struct ipc_ids *, int); +-struct kern_ipc_perm *ipc_lock(struct ipc_ids *, int); + + void kernel_to_ipc64_perm(struct kern_ipc_perm *in, struct ipc64_perm *out); + void ipc64_perm_to_ipc_perm(struct ipc64_perm *in, struct ipc_perm *out); +@@ -155,12 +143,6 @@ + spin_lock(&perm->lock); + } + +-static inline void ipc_unlock(struct kern_ipc_perm *perm) +-{ +- spin_unlock(&perm->lock); +- rcu_read_unlock(); +-} +- + static inline struct kern_ipc_perm *ipc_lock_check_down(struct ipc_ids *ids, + int id) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/Kconfig.openvz debian/binary-custom.d/openvz/src/kernel/Kconfig.openvz +--- ./kernel/Kconfig.openvz 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/Kconfig.openvz 2012-11-13 15:20:15.360569068 +0000 +@@ -0,0 +1,84 @@ ++# Copyright (C) 2005 SWsoft ++# All rights reserved. ++# Licensing governed by "linux/COPYING.SWsoft" file. ++ ++menu "OpenVZ" ++ ++config VE ++ bool "Virtual Environment support" ++ default y ++ select PID_NS ++ select NET_NS ++ select USER_NS ++ help ++ This option adds support of virtual Linux running on the original box ++ with fully supported virtual network driver, tty subsystem and ++ configurable access for hardware and other resources. ++ ++config VE_CALLS ++ tristate "VE calls interface" ++ depends on VE ++ select VZ_DEV ++ default m ++ help ++ This option controls how to build vzmon code containing VE calls. ++ By default it's build in module vzmon.o ++ ++config VZ_GENCALLS ++ bool ++ default y ++ ++config VE_NETDEV ++ tristate "VE network device" ++ depends on VE_CALLS && NET ++ select VZ_DEV ++ default m ++ help ++ This option controls whether to build venet device. This is a ++ common interface for networking in VE. ++ ++config VE_ETHDEV ++ tristate "Virtual ethernet device" ++ depends on VE_CALLS && NET ++ select VZ_DEV ++ default m ++ help ++ This option controls whether to build virtual ethernet device. ++ ++config VZ_DEV ++ tristate "VE device" ++ default m ++ help ++ This option adds support of vzdev device, which is used by ++ user-space applications to control Virtual Environments. ++ ++config VE_IPTABLES ++ bool "VE netfiltering" ++ depends on VE && VE_NETDEV && INET && NETFILTER ++ default y ++ help ++ This option controls whether to build VE netfiltering code. ++ ++config VZ_WDOG ++ tristate "VE watchdog module" ++ depends on VE_CALLS ++ default m ++ help ++ This option controls building of vzwdog module, which dumps ++ a lot of useful system info on console periodically. ++ ++config VZ_CHECKPOINT ++ tristate "Checkpointing & restoring Virtual Environments" ++ depends on VE_CALLS && INET ++ select PM ++ select PM_SLEEP ++ select TUN ++ select VE_ETHDEV ++ select VE_NETDEV ++ default m ++ help ++ This option adds two modules, "cpt" and "rst", which allow ++ to save a running Virtual Environment and restore it ++ on another host (live migration) or on the same host (checkpointing). ++ ++endmenu +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/Makefile debian/binary-custom.d/openvz/src/kernel/Makefile +--- ./kernel/Makefile 2012-06-12 16:25:24.234312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/Makefile 2012-11-13 15:20:15.360569068 +0000 +@@ -14,6 +14,10 @@ + obj-$(CONFIG_SYSCTL) += sysctl_check.o + obj-$(CONFIG_STACKTRACE) += stacktrace.o + obj-y += time/ ++obj-$(CONFIG_BEANCOUNTERS) += bc/ ++obj-y += ve/ ++obj-$(CONFIG_VZ_CHECKPOINT) += cpt/ ++ + obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o + obj-$(CONFIG_LOCKDEP) += lockdep.o + ifeq ($(CONFIG_PROC_FS),y) +@@ -58,6 +62,7 @@ + obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o + obj-$(CONFIG_MARKERS) += marker.o + obj-$(CONFIG_LATENCYTOP) += latencytop.o ++obj-$(CONFIG_VZ_FAIRSCHED) += fairsched.o + + ifneq ($(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER),y) + # According to Alan Modra , the -fno-omit-frame-pointer is +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/audit.c debian/binary-custom.d/openvz/src/kernel/audit.c +--- ./kernel/audit.c 2012-06-12 16:25:24.234312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/audit.c 2012-11-13 15:20:15.364569069 +0000 +@@ -586,6 +586,9 @@ + char *ctx; + u32 len; + ++ if (!ve_is_super(skb->owner_env)) ++ return -ECONNREFUSED; ++ + err = audit_netlink_ok(skb, msg_type); + if (err) + return err; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/auditfilter.c debian/binary-custom.d/openvz/src/kernel/auditfilter.c +--- ./kernel/auditfilter.c 2012-06-12 16:25:24.234312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/auditfilter.c 2012-11-13 15:20:15.364569069 +0000 +@@ -167,7 +167,7 @@ + inotify_init_watch(&parent->wdata); + /* grab a ref so inotify watch hangs around until we take audit_filter_mutex */ + get_inotify_watch(&parent->wdata); +- wd = inotify_add_watch(audit_ih, &parent->wdata, ndp->dentry->d_inode, ++ wd = inotify_add_watch_dget(audit_ih, &parent->wdata, ndp->dentry, ndp->mnt, + AUDIT_IN_WATCH); + if (wd < 0) { + audit_free_parent(&parent->wdata); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/Kconfig debian/binary-custom.d/openvz/src/kernel/bc/Kconfig +--- ./kernel/bc/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/Kconfig 2012-11-13 15:20:15.364569069 +0000 +@@ -0,0 +1,111 @@ ++# ++# User resources part (UBC) ++# ++# Copyright (C) 2005 SWsoft ++# All rights reserved. ++# ++# Licensing governed by "linux/COPYING.SWsoft" file. ++ ++menu "User resources" ++ ++config BEANCOUNTERS ++ bool "Enable user resource accounting" ++ default y ++ help ++ This patch provides accounting and allows to configure ++ limits for user's consumption of exhaustible system resources. ++ The most important resource controlled by this patch is unswappable ++ memory (either mlock'ed or used by internal kernel structures and ++ buffers). The main goal of this patch is to protect processes ++ from running short of important resources because of an accidental ++ misbehavior of processes or malicious activity aiming to ``kill'' ++ the system. It's worth to mention that resource limits configured ++ by setrlimit(2) do not give an acceptable level of protection ++ because they cover only small fraction of resources and work on a ++ per-process basis. Per-process accounting doesn't prevent malicious ++ users from spawning a lot of resource-consuming processes. ++ ++config BC_RSS_ACCOUNTING ++ bool "Account physical memory usage" ++ default y ++ depends on BEANCOUNTERS ++ help ++ This allows to estimate per beancounter physical memory usage. ++ Implemented alghorithm accounts shared pages of memory as well, ++ dividing them by number of beancounter which use the page. ++ ++config BC_IO_ACCOUNTING ++ bool "Account disk IO" ++ default y ++ depends on BC_RSS_ACCOUNTING ++ help ++ When on this option allows seeing disk IO activity caused by ++ tasks from each UB ++ ++config BC_IO_SCHED ++ bool "UBC I/O priority" ++ default y ++ depends on BC_IO_ACCOUNTING && IOSCHED_CFQ ++ help ++ This option controls whether to build CFQ I/O scheduler ++ with support of UBC I/O priority. ++ ++config BC_SWAP_ACCOUNTING ++ bool "Account swap usage" ++ default y ++ depends on BEANCOUNTERS ++ help ++ This allows accounting of swap usage. ++ ++config BC_PROC ++ bool "Report resource usage in /proc" ++ default y ++ depends on BEANCOUNTERS ++ help ++ Allows a system administrator to inspect resource accounts and limits. ++ ++config BC_DEBUG ++ bool "User resources debug features" ++ default n ++ depends on BEANCOUNTERS ++ help ++ Enables to setup debug features for user resource accounting ++ ++config BC_DEBUG_IO ++ bool "Debug IO accounting" ++ default y ++ depends on BC_DEBUG && BC_IO_ACCOUNTING ++ help ++ Debugging for IO accointing. ++ ++config BC_DEBUG_KMEM ++ bool "Debug kmemsize with cache counters" ++ default n ++ depends on BC_DEBUG ++ help ++ Adds /proc/user_beancounters_debug entry to get statistics ++ about cache usage of each beancounter ++ ++config BC_KEEP_UNUSED ++ bool "Keep unused beancounter alive" ++ default y ++ depends on BC_DEBUG ++ help ++ If on, unused beancounters are kept on the hash and maxheld value ++ can be looked through. ++ ++config BC_DEBUG_ITEMS ++ bool "Account resources in items rather than in bytes" ++ default y ++ depends on BC_DEBUG ++ help ++ When true some of the resources (e.g. kmemsize) are accounted ++ in items instead of bytes. ++ ++config BC_UNLIMITED ++ bool "Use unlimited ubc settings" ++ default y ++ depends on BC_DEBUG ++ help ++ When ON all limits and barriers are set to max values. ++endmenu +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/Makefile debian/binary-custom.d/openvz/src/kernel/bc/Makefile +--- ./kernel/bc/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/Makefile 2012-11-13 15:20:15.364569069 +0000 +@@ -0,0 +1,16 @@ ++# ++# User resources part (UBC) ++# ++# Copyright (C) 2005 SWsoft ++# All rights reserved. ++# ++# Licensing governed by "linux/COPYING.SWsoft" file. ++ ++obj-y := sys.o beancounter.o dcache.o kmem.o misc.o \ ++ vm_pages.o statd.o oom_kill.o ++ ++obj-$(CONFIG_NET) += net.o ++obj-$(CONFIG_BC_RSS_ACCOUNTING) += rss_pages.o ++obj-$(CONFIG_BC_PROC) += proc.o ++obj-$(CONFIG_BC_IO_ACCOUNTING) += io_acct.o ++obj-$(CONFIG_BC_IO_SCHED) += io_prio.o +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/beancounter.c debian/binary-custom.d/openvz/src/kernel/bc/beancounter.c +--- ./kernel/bc/beancounter.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/beancounter.c 2012-11-13 15:20:15.364569069 +0000 +@@ -0,0 +1,696 @@ ++/* ++ * linux/kernel/bc/beancounter.c ++ * ++ * Copyright (C) 1998 Alan Cox ++ * 1998-2000 Andrey V. Savochkin ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * TODO: ++ * - more intelligent limit check in mremap(): currently the new size is ++ * charged and _then_ old size is uncharged ++ * (almost done: !move_vma case is completely done, ++ * move_vma in its current implementation requires too many conditions to ++ * do things right, because it may be not only expansion, but shrinking ++ * also, plus do_munmap will require an additional parameter...) ++ * - problem: bad pmd page handling ++ * - consider /proc redesign ++ * - TCP/UDP ports ++ * + consider whether __charge_beancounter_locked should be inline ++ * ++ * Changes: ++ * 1999/08/17 Marcelo Tosatti ++ * - Set "barrier" and "limit" parts of limits atomically. ++ * 1999/10/06 Marcelo Tosatti ++ * - setublimit system call. ++ */ ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++static struct kmem_cache *ub_cachep; ++static struct user_beancounter default_beancounter; ++struct user_beancounter ub0; ++EXPORT_SYMBOL_GPL(ub0); ++ ++const char *ub_rnames[] = { ++ "kmemsize", /* 0 */ ++ "lockedpages", ++ "privvmpages", ++ "shmpages", ++ "dummy", ++ "numproc", /* 5 */ ++ "physpages", ++ "vmguarpages", ++ "oomguarpages", ++ "numtcpsock", ++ "numflock", /* 10 */ ++ "numpty", ++ "numsiginfo", ++ "tcpsndbuf", ++ "tcprcvbuf", ++ "othersockbuf", /* 15 */ ++ "dgramrcvbuf", ++ "numothersock", ++ "dcachesize", ++ "numfile", ++ "dummy", /* 20 */ ++ "dummy", ++ "dummy", ++ "numiptent", ++ "unused_privvmpages", /* UB_RESOURCES */ ++ "tmpfs_respages", ++ "swap_pages", ++ "held_pages", ++}; ++ ++static void init_beancounter_struct(struct user_beancounter *ub); ++static void init_beancounter_store(struct user_beancounter *ub); ++static void init_beancounter_nolimits(struct user_beancounter *ub); ++ ++int print_ub_uid(struct user_beancounter *ub, char *buf, int size) ++{ ++ if (ub->parent != NULL) ++ return snprintf(buf, size, "%u.%u", ++ ub->parent->ub_uid, ub->ub_uid); ++ else ++ return snprintf(buf, size, "%u", ub->ub_uid); ++} ++EXPORT_SYMBOL(print_ub_uid); ++ ++#define ub_hash_fun(x) ((((x) >> 8) ^ (x)) & (UB_HASH_SIZE - 1)) ++#define ub_subhash_fun(p, id) ub_hash_fun((p)->ub_uid + (id) * 17) ++struct hlist_head ub_hash[UB_HASH_SIZE]; ++DEFINE_SPINLOCK(ub_hash_lock); ++LIST_HEAD(ub_list_head); /* protected by ub_hash_lock */ ++EXPORT_SYMBOL(ub_hash); ++EXPORT_SYMBOL(ub_hash_lock); ++EXPORT_SYMBOL(ub_list_head); ++ ++/* ++ * Per user resource beancounting. Resources are tied to their luid. ++ * The resource structure itself is tagged both to the process and ++ * the charging resources (a socket doesn't want to have to search for ++ * things at irq time for example). Reference counters keep things in ++ * hand. ++ * ++ * The case where a user creates resource, kills all his processes and ++ * then starts new ones is correctly handled this way. The refcounters ++ * will mean the old entry is still around with resource tied to it. ++ */ ++ ++static inline void free_ub(struct user_beancounter *ub) ++{ ++ free_percpu(ub->ub_percpu); ++ kmem_cache_free(ub_cachep, ub); ++} ++ ++static inline struct user_beancounter *bc_lookup_hash(struct hlist_head *hash, ++ uid_t uid, struct user_beancounter *parent) ++{ ++ struct user_beancounter *ub; ++ struct hlist_node *ptr; ++ ++ hlist_for_each_entry (ub, ptr, hash, ub_hash) ++ if (ub->ub_uid == uid && ub->parent == parent) ++ return get_beancounter(ub); ++ ++ return NULL; ++} ++ ++int ub_count; ++ ++/* next two must be called under ub_hash_lock */ ++static inline void ub_count_inc(struct user_beancounter *ub) ++{ ++ if (ub->parent) ++ ub->parent->ub_childs++; ++ else ++ ub_count++; ++} ++ ++static inline void ub_count_dec(struct user_beancounter *ub) ++{ ++ if (ub->parent) ++ ub->parent->ub_childs--; ++ else ++ ub_count--; ++} ++ ++struct user_beancounter *get_beancounter_byuid(uid_t uid, int create) ++{ ++ struct user_beancounter *new_ub, *ub; ++ unsigned long flags; ++ struct hlist_head *hash; ++ ++ hash = &ub_hash[ub_hash_fun(uid)]; ++ new_ub = NULL; ++retry: ++ spin_lock_irqsave(&ub_hash_lock, flags); ++ ub = bc_lookup_hash(hash, uid, NULL); ++ if (ub != NULL) { ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ ++ if (new_ub != NULL) ++ free_ub(new_ub); ++ return ub; ++ } ++ ++ if (!create) { ++ /* no ub found */ ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ return NULL; ++ } ++ ++ if (new_ub != NULL) { ++ list_add_rcu(&new_ub->ub_list, &ub_list_head); ++ hlist_add_head(&new_ub->ub_hash, hash); ++ ub_count_inc(new_ub); ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ return new_ub; ++ } ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ ++ /* alloc new ub */ ++ new_ub = (struct user_beancounter *)kmem_cache_alloc(ub_cachep, ++ GFP_KERNEL); ++ if (new_ub == NULL) ++ return NULL; ++ ++ ub_debug(UBD_ALLOC, "Creating ub %p\n", new_ub); ++ memcpy(new_ub, &default_beancounter, sizeof(*new_ub)); ++ init_beancounter_struct(new_ub); ++ new_ub->ub_percpu = alloc_percpu(struct ub_percpu_struct); ++ if (new_ub->ub_percpu == NULL) ++ goto fail_free; ++ new_ub->ub_uid = uid; ++ goto retry; ++ ++fail_free: ++ kmem_cache_free(ub_cachep, new_ub); ++ return NULL; ++} ++EXPORT_SYMBOL(get_beancounter_byuid); ++ ++struct user_beancounter *get_subbeancounter_byid(struct user_beancounter *p, ++ int id, int create) ++{ ++ struct user_beancounter *new_ub, *ub; ++ unsigned long flags; ++ struct hlist_head *hash; ++ ++ hash = &ub_hash[ub_subhash_fun(p, id)]; ++ new_ub = NULL; ++retry: ++ spin_lock_irqsave(&ub_hash_lock, flags); ++ ub = bc_lookup_hash(hash, id, p); ++ if (ub != NULL) { ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ ++ if (new_ub != NULL) { ++ put_beancounter(new_ub->parent); ++ free_ub(new_ub); ++ } ++ return ub; ++ } ++ ++ if (!create) { ++ /* no ub found */ ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ return NULL; ++ } ++ ++ if (new_ub != NULL) { ++ list_add_rcu(&new_ub->ub_list, &ub_list_head); ++ hlist_add_head(&new_ub->ub_hash, hash); ++ ub_count_inc(new_ub); ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ return new_ub; ++ } ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ ++ /* alloc new ub */ ++ new_ub = (struct user_beancounter *)kmem_cache_alloc(ub_cachep, ++ GFP_KERNEL); ++ if (new_ub == NULL) ++ return NULL; ++ ++ ub_debug(UBD_ALLOC, "Creating sub %p\n", new_ub); ++ memset(new_ub, 0, sizeof(*new_ub)); ++ init_beancounter_nolimits(new_ub); ++ init_beancounter_store(new_ub); ++ init_beancounter_struct(new_ub); ++ new_ub->ub_percpu = alloc_percpu(struct ub_percpu_struct); ++ if (new_ub->ub_percpu == NULL) ++ goto fail_free; ++ new_ub->ub_uid = id; ++ new_ub->parent = get_beancounter(p); ++ goto retry; ++ ++fail_free: ++ kmem_cache_free(ub_cachep, new_ub); ++ return NULL; ++} ++EXPORT_SYMBOL(get_subbeancounter_byid); ++ ++static void put_warn(struct user_beancounter *ub) ++{ ++ char id[64]; ++ ++ print_ub_uid(ub, id, sizeof(id)); ++ printk(KERN_ERR "UB: Bad refcount (%d) on put of %s (%p)\n", ++ atomic_read(&ub->ub_refcount), id, ub); ++} ++ ++#ifdef CONFIG_BC_KEEP_UNUSED ++#define release_beancounter(ub) do { } while (0) ++#else ++static int verify_res(struct user_beancounter *ub, int resource, ++ unsigned long held) ++{ ++ char id[64]; ++ ++ if (likely(held == 0)) ++ return 1; ++ ++ print_ub_uid(ub, id, sizeof(id)); ++ printk(KERN_WARNING "Ub %s helds %lu in %s on put\n", ++ id, held, ub_rnames[resource]); ++ return 0; ++} ++ ++static inline void bc_verify_held(struct user_beancounter *ub) ++{ ++ int i, clean; ++ ++ clean = 1; ++ for (i = 0; i < UB_RESOURCES; i++) ++ clean &= verify_res(ub, i, ub->ub_parms[i].held); ++ ++ clean &= verify_res(ub, UB_UNUSEDPRIVVM, ub->ub_unused_privvmpages); ++ clean &= verify_res(ub, UB_TMPFSPAGES, ub->ub_tmpfs_respages); ++ clean &= verify_res(ub, UB_SWAPPAGES, ub->ub_swap_pages); ++ clean &= verify_res(ub, UB_HELDPAGES, (unsigned long)ub->ub_held_pages); ++ ++ ub_debug_trace(!clean, 5, 60*HZ); ++} ++ ++static void bc_free_rcu(struct rcu_head *rcu) ++{ ++ struct user_beancounter *ub; ++ ++ ub = container_of(rcu, struct user_beancounter, rcu); ++ free_ub(ub); ++} ++ ++static void delayed_release_beancounter(struct work_struct *w) ++{ ++ struct user_beancounter *ub, *parent; ++ unsigned long flags; ++ ++ ub = container_of(w, struct user_beancounter, cleanup.work); ++again: ++ local_irq_save(flags); ++ if (!atomic_dec_and_lock(&ub->ub_refcount, &ub_hash_lock)) { ++ /* raced with get_beancounter_byuid */ ++ local_irq_restore(flags); ++ return; ++ } ++ ++ hlist_del(&ub->ub_hash); ++ list_del_rcu(&ub->ub_list); ++ ub_count_dec(ub); ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ ++ bc_verify_held(ub); ++ ub_free_counters(ub); ++ bc_fini_ioprio(&ub->iopriv); ++ parent = ub->parent; ++ ++ call_rcu(&ub->rcu, bc_free_rcu); ++ if (parent) { ++ ub = parent; ++ goto again; ++ } ++} ++ ++static inline void release_beancounter(struct user_beancounter *ub) ++{ ++ struct execute_work *ew; ++ ++ ew = &ub->cleanup; ++ INIT_WORK(&ew->work, delayed_release_beancounter); ++ schedule_work(&ew->work); ++} ++#endif ++ ++void __put_beancounter(struct user_beancounter *ub) ++{ ++ unsigned long flags; ++ ++ /* equevalent to atomic_dec_and_lock_irqsave() */ ++ local_irq_save(flags); ++ if (likely(!atomic_dec_and_lock(&ub->ub_refcount, &ub_hash_lock))) { ++ if (unlikely(atomic_read(&ub->ub_refcount) < 0)) ++ put_warn(ub); ++ local_irq_restore(flags); ++ return; ++ } ++ ++ if (unlikely(ub == get_ub0())) { ++ printk(KERN_ERR "Trying to put ub0\n"); ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ return; ++ } ++ ++ /* prevent get_beancounter_byuid + put_beancounter() reentrance */ ++ atomic_inc(&ub->ub_refcount); ++ spin_unlock_irqrestore(&ub_hash_lock, flags); ++ ++ release_beancounter(ub); ++} ++EXPORT_SYMBOL(__put_beancounter); ++ ++void put_beancounter_safe(struct user_beancounter *ub) ++{ ++ synchronize_rcu(); ++ __put_beancounter(ub); ++} ++EXPORT_SYMBOL(put_beancounter_safe); ++ ++/* ++ * Generic resource charging stuff ++ */ ++ ++int __charge_beancounter_locked(struct user_beancounter *ub, ++ int resource, unsigned long val, enum ub_severity strict) ++{ ++ ub_debug_resource(resource, "Charging %lu for %d of %p with %lu\n", ++ val, resource, ub, ub->ub_parms[resource].held); ++ /* ++ * ub_value <= UB_MAXVALUE, value <= UB_MAXVALUE, and only one addition ++ * at the moment is possible so an overflow is impossible. ++ */ ++ ub->ub_parms[resource].held += val; ++ ++ switch (strict) { ++ case UB_HARD: ++ if (ub->ub_parms[resource].held > ++ ub->ub_parms[resource].barrier) ++ break; ++ case UB_SOFT: ++ if (ub->ub_parms[resource].held > ++ ub->ub_parms[resource].limit) ++ break; ++ case UB_FORCE: ++ ub_adjust_maxheld(ub, resource); ++ return 0; ++ default: ++ BUG(); ++ } ++ ++ if (strict == UB_SOFT && ub_ratelimit(&ub->ub_limit_rl)) ++ printk(KERN_INFO "Fatal resource shortage: %s, UB %d.\n", ++ ub_rnames[resource], ub->ub_uid); ++ ub->ub_parms[resource].failcnt++; ++ ub->ub_parms[resource].held -= val; ++ return -ENOMEM; ++} ++ ++int charge_beancounter(struct user_beancounter *ub, ++ int resource, unsigned long val, enum ub_severity strict) ++{ ++ int retval; ++ struct user_beancounter *p, *q; ++ unsigned long flags; ++ ++ retval = -EINVAL; ++ if (val > UB_MAXVALUE) ++ goto out; ++ ++ local_irq_save(flags); ++ for (p = ub; p != NULL; p = p->parent) { ++ spin_lock(&p->ub_lock); ++ retval = __charge_beancounter_locked(p, resource, val, strict); ++ spin_unlock(&p->ub_lock); ++ if (retval) ++ goto unroll; ++ } ++out_restore: ++ local_irq_restore(flags); ++out: ++ return retval; ++ ++unroll: ++ for (q = ub; q != p; q = q->parent) { ++ spin_lock(&q->ub_lock); ++ __uncharge_beancounter_locked(q, resource, val); ++ spin_unlock(&q->ub_lock); ++ } ++ goto out_restore; ++} ++ ++EXPORT_SYMBOL(charge_beancounter); ++ ++void __charge_beancounter_notop(struct user_beancounter *ub, ++ int resource, unsigned long val) ++{ ++ struct user_beancounter *p; ++ unsigned long flags; ++ ++ local_irq_save(flags); ++ for (p = ub; p->parent != NULL; p = p->parent) { ++ spin_lock(&p->ub_lock); ++ __charge_beancounter_locked(p, resource, val, UB_FORCE); ++ spin_unlock(&p->ub_lock); ++ } ++ local_irq_restore(flags); ++} ++ ++EXPORT_SYMBOL(__charge_beancounter_notop); ++ ++void uncharge_warn(struct user_beancounter *ub, int resource, ++ unsigned long val, unsigned long held) ++{ ++ char id[64]; ++ ++ print_ub_uid(ub, id, sizeof(id)); ++ printk(KERN_ERR "Uncharging too much %lu h %lu, res %s ub %s\n", ++ val, held, ub_rnames[resource], id); ++ ub_debug_trace(1, 10, 10*HZ); ++} ++ ++void __uncharge_beancounter_locked(struct user_beancounter *ub, ++ int resource, unsigned long val) ++{ ++ ub_debug_resource(resource, "Uncharging %lu for %d of %p with %lu\n", ++ val, resource, ub, ub->ub_parms[resource].held); ++ if (ub->ub_parms[resource].held < val) { ++ uncharge_warn(ub, resource, ++ val, ub->ub_parms[resource].held); ++ val = ub->ub_parms[resource].held; ++ } ++ ub->ub_parms[resource].held -= val; ++} ++ ++void uncharge_beancounter(struct user_beancounter *ub, ++ int resource, unsigned long val) ++{ ++ unsigned long flags; ++ struct user_beancounter *p; ++ ++ for (p = ub; p != NULL; p = p->parent) { ++ spin_lock_irqsave(&p->ub_lock, flags); ++ __uncharge_beancounter_locked(p, resource, val); ++ spin_unlock_irqrestore(&p->ub_lock, flags); ++ } ++} ++ ++EXPORT_SYMBOL(uncharge_beancounter); ++ ++void __uncharge_beancounter_notop(struct user_beancounter *ub, ++ int resource, unsigned long val) ++{ ++ struct user_beancounter *p; ++ unsigned long flags; ++ ++ local_irq_save(flags); ++ for (p = ub; p->parent != NULL; p = p->parent) { ++ spin_lock(&p->ub_lock); ++ __uncharge_beancounter_locked(p, resource, val); ++ spin_unlock(&p->ub_lock); ++ } ++ local_irq_restore(flags); ++} ++ ++EXPORT_SYMBOL(__uncharge_beancounter_notop); ++ ++ ++/* ++ * Rate limiting stuff. ++ */ ++int ub_ratelimit(struct ub_rate_info *p) ++{ ++ unsigned long cjif, djif; ++ unsigned long flags; ++ static spinlock_t ratelimit_lock = SPIN_LOCK_UNLOCKED; ++ long new_bucket; ++ ++ spin_lock_irqsave(&ratelimit_lock, flags); ++ cjif = jiffies; ++ djif = cjif - p->last; ++ if (djif < p->interval) { ++ if (p->bucket >= p->burst) { ++ spin_unlock_irqrestore(&ratelimit_lock, flags); ++ return 0; ++ } ++ p->bucket++; ++ } else { ++ new_bucket = p->bucket - (djif / (unsigned)p->interval); ++ if (new_bucket < 0) ++ new_bucket = 0; ++ p->bucket = new_bucket + 1; ++ } ++ p->last = cjif; ++ spin_unlock_irqrestore(&ratelimit_lock, flags); ++ return 1; ++} ++EXPORT_SYMBOL(ub_ratelimit); ++ ++ ++/* ++ * Initialization ++ * ++ * struct user_beancounter contains ++ * - limits and other configuration settings, ++ * with a copy stored for accounting purposes, ++ * - structural fields: lists, spinlocks and so on. ++ * ++ * Before these parts are initialized, the structure should be memset ++ * to 0 or copied from a known clean structure. That takes care of a lot ++ * of fields not initialized explicitly. ++ */ ++ ++static void init_beancounter_struct(struct user_beancounter *ub) ++{ ++ ub->ub_magic = UB_MAGIC; ++ atomic_set(&ub->ub_refcount, 1); ++ spin_lock_init(&ub->ub_lock); ++ INIT_LIST_HEAD(&ub->ub_tcp_sk_list); ++ INIT_LIST_HEAD(&ub->ub_other_sk_list); ++#ifdef CONFIG_BC_DEBUG_KMEM ++ INIT_LIST_HEAD(&ub->ub_cclist); ++#endif ++ bc_init_ioprio(&ub->iopriv); ++} ++ ++static void init_beancounter_store(struct user_beancounter *ub) ++{ ++ int k; ++ ++ for (k = 0; k < UB_RESOURCES; k++) { ++ memcpy(&ub->ub_store[k], &ub->ub_parms[k], ++ sizeof(struct ubparm)); ++ } ++} ++ ++static void init_beancounter_nolimits(struct user_beancounter *ub) ++{ ++ int k; ++ ++ for (k = 0; k < UB_RESOURCES; k++) { ++ ub->ub_parms[k].limit = UB_MAXVALUE; ++ /* FIXME: whether this is right for physpages and guarantees? */ ++ ub->ub_parms[k].barrier = UB_MAXVALUE; ++ } ++ ++ /* FIXME: set unlimited rate? */ ++ ub->ub_limit_rl.burst = 4; ++ ub->ub_limit_rl.interval = 300*HZ; ++} ++ ++static void init_beancounter_syslimits(struct user_beancounter *ub) ++{ ++ unsigned long mp; ++ extern int max_threads; ++ int k; ++ ++ mp = num_physpages; ++ ub->ub_parms[UB_KMEMSIZE].limit = ++ mp > (192*1024*1024 >> PAGE_SHIFT) ? ++ 32*1024*1024 : (mp << PAGE_SHIFT) / 6; ++ ub->ub_parms[UB_LOCKEDPAGES].limit = 8; ++ ub->ub_parms[UB_PRIVVMPAGES].limit = UB_MAXVALUE; ++ ub->ub_parms[UB_SHMPAGES].limit = 64; ++ ub->ub_parms[UB_NUMPROC].limit = max_threads / 2; ++ ub->ub_parms[UB_NUMTCPSOCK].limit = 1024; ++ ub->ub_parms[UB_TCPSNDBUF].limit = 1024*4*1024; /* 4k per socket */ ++ ub->ub_parms[UB_TCPRCVBUF].limit = 1024*6*1024; /* 6k per socket */ ++ ub->ub_parms[UB_NUMOTHERSOCK].limit = 256; ++ ub->ub_parms[UB_DGRAMRCVBUF].limit = 256*4*1024; /* 4k per socket */ ++ ub->ub_parms[UB_OTHERSOCKBUF].limit = 256*8*1024; /* 8k per socket */ ++ ub->ub_parms[UB_NUMFLOCK].limit = 1024; ++ ub->ub_parms[UB_NUMPTY].limit = 16; ++ ub->ub_parms[UB_NUMSIGINFO].limit = 1024; ++ ub->ub_parms[UB_DCACHESIZE].limit = 1024*1024; ++ ub->ub_parms[UB_NUMFILE].limit = 1024; ++ ++ for (k = 0; k < UB_RESOURCES; k++) ++ ub->ub_parms[k].barrier = ub->ub_parms[k].limit; ++ ++ ub->ub_limit_rl.burst = 4; ++ ub->ub_limit_rl.interval = 300*HZ; ++} ++ ++DEFINE_PER_CPU_STATIC(struct ub_percpu_struct, ub0_percpu); ++ ++void __init ub_init_early(void) ++{ ++ struct user_beancounter *ub; ++ ++ init_cache_counters(); ++ ub = get_ub0(); ++ memset(ub, 0, sizeof(*ub)); ++ ub->ub_uid = 0; ++ init_beancounter_nolimits(ub); ++ init_beancounter_store(ub); ++ init_beancounter_struct(ub); ++ ub->ub_percpu = percpu_static_init(ub0_percpu); ++ ++ memset(¤t->task_bc, 0, sizeof(struct task_beancounter)); ++ (void)set_exec_ub(ub); ++ current->task_bc.task_ub = get_beancounter(ub); ++ __charge_beancounter_locked(ub, UB_NUMPROC, 1, UB_FORCE); ++ current->task_bc.fork_sub = get_beancounter(ub); ++ ub_init_task_bc(¤t->task_bc); ++ init_mm.mm_ub = get_beancounter(ub); ++ ++ hlist_add_head(&ub->ub_hash, &ub_hash[ub->ub_uid]); ++ list_add(&ub->ub_list, &ub_list_head); ++ ub_count_inc(ub); ++} ++ ++void __init ub_init_late(void) ++{ ++ ub_cachep = kmem_cache_create("user_beancounters", ++ sizeof(struct user_beancounter), ++ 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); ++ ++ memset(&default_beancounter, 0, sizeof(default_beancounter)); ++#ifdef CONFIG_BC_UNLIMITED ++ init_beancounter_nolimits(&default_beancounter); ++#else ++ init_beancounter_syslimits(&default_beancounter); ++#endif ++ init_beancounter_store(&default_beancounter); ++ init_beancounter_struct(&default_beancounter); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/dcache.c debian/binary-custom.d/openvz/src/kernel/bc/dcache.c +--- ./kernel/bc/dcache.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/dcache.c 2012-11-13 15:20:15.364569069 +0000 +@@ -0,0 +1,399 @@ ++/* ++ * kernel/bc/dcache.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++/* ++ * Locking ++ * traverse dcache_lock d_lock ++ * ub_dentry_charge + - + ++ * ub_dentry_uncharge + + - ++ * ub_dentry_charge_nofail + + - ++ * ++ * d_inuse changes are atomic, with special handling of "not in use" <-> ++ * "in use" (-1 <-> 0) transitions. We have two sources of non-atomicity ++ * here: (1) in many operations we need to change d_inuse of both dentry and ++ * its parent, and (2) on state transitions we need to adjust the account. ++ * ++ * Regarding (1): we do not have (and do not want) a single lock covering all ++ * operations, so in general it's impossible to get a consistent view of ++ * a tree with respect to d_inuse counters (except by swsuspend). It also ++ * means if a dentry with d_inuse of 0 gets one new in-use child and loses ++ * one, it's d_inuse counter will go either 0 -> 1 -> 0 path or 0 -> -1 -> 0, ++ * and we can't say which way. ++ * Note that path -1 -> 0 -> -1 can't turn into -1 -> -2 -> -1, since ++ * uncharge can be done only after return from charge (with d_genocide being ++ * the only apparent exception). ++ * Regarding (2): there is a similar uncertainty with the dcache account. ++ * If the account is equal to the limit, one more dentry is started to be ++ * used and one is put, the account will either hit the limit (and an error ++ * will be returned), or decrement will happen before increment. ++ * ++ * These races do not really matter. ++ * The only things we want are: ++ * - if a system is suspenede with no in-use dentries, all d_inuse counters ++ * should be correct (-1); ++ * - d_inuse counters should always be >= -1. ++ * This holds if ->parent references are accessed and maintained properly. ++ * In subtle moments (like d_move) dentries exchanging their parents should ++ * both be in-use. At d_genocide time, lookups and charges are assumed to be ++ * impossible. ++ */ ++ ++/* ++ * Hierarchical accounting ++ * UB argument must NOT be NULL ++ */ ++ ++static int do_charge_dcache(struct user_beancounter *ub, unsigned long size, ++ enum ub_severity sv) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ if (__charge_beancounter_locked(ub, UB_KMEMSIZE, CHARGE_SIZE(size), sv)) ++ goto out_mem; ++ if (__charge_beancounter_locked(ub, UB_DCACHESIZE, size, sv)) ++ goto out_dcache; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ return 0; ++ ++out_dcache: ++ __uncharge_beancounter_locked(ub, UB_KMEMSIZE, CHARGE_SIZE(size)); ++out_mem: ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ return -ENOMEM; ++} ++ ++static void do_uncharge_dcache(struct user_beancounter *ub, ++ unsigned long size) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ __uncharge_beancounter_locked(ub, UB_KMEMSIZE, CHARGE_SIZE(size)); ++ __uncharge_beancounter_locked(ub, UB_DCACHESIZE, size); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++static int charge_dcache(struct user_beancounter *ub, unsigned long size, ++ enum ub_severity sv) ++{ ++ struct user_beancounter *p, *q; ++ ++ for (p = ub; p != NULL; p = p->parent) { ++ if (do_charge_dcache(p, size, sv)) ++ goto unroll; ++ } ++ return 0; ++ ++unroll: ++ for (q = ub; q != p; q = q->parent) ++ do_uncharge_dcache(q, size); ++ return -ENOMEM; ++} ++ ++void uncharge_dcache(struct user_beancounter *ub, unsigned long size) ++{ ++ for (; ub != NULL; ub = ub->parent) ++ do_uncharge_dcache(ub, size); ++} ++ ++/* ++ * Simple helpers to do maintain account and d_ub field. ++ */ ++ ++static inline int d_charge(struct dentry_beancounter *d_bc) ++{ ++ struct user_beancounter *ub; ++ ++ ub = get_beancounter(get_exec_ub()); ++ if (charge_dcache(ub, d_bc->d_ubsize, UB_SOFT)) { ++ put_beancounter(ub); ++ return -1; ++ } ++ d_bc->d_ub = ub; ++ return 0; ++} ++ ++static inline void d_forced_charge(struct dentry_beancounter *d_bc) ++{ ++ struct user_beancounter *ub; ++ ++ ub = get_beancounter(get_exec_ub()); ++ charge_dcache(ub, d_bc->d_ubsize, UB_FORCE); ++ d_bc->d_ub = ub; ++} ++ ++/* ++ * Minor helpers ++ */ ++ ++extern struct kmem_cache *dentry_cache; ++extern struct kmem_cache *inode_cachep; ++static struct rw_semaphore ub_dentry_alloc_sem; ++ ++static inline unsigned long d_charge_size(struct dentry *dentry) ++{ ++ /* dentry's d_name is already set to appropriate value (see d_alloc) */ ++ return kmem_cache_objuse(inode_cachep) + kmem_cache_objuse(dentry_cache) + ++ (dname_external(dentry) ? ++ kmem_dname_objuse((void *)dentry->d_name.name) : 0); ++} ++ ++/* ++ * Entry points from dcache.c ++ */ ++ ++/* ++ * Set initial d_inuse on d_alloc. ++ * Called with no locks, preemption disabled. ++ */ ++int __ub_dentry_alloc(struct dentry *dentry) ++{ ++ struct dentry_beancounter *d_bc; ++ ++ d_bc = &dentry->dentry_bc; ++ d_bc->d_ub = get_beancounter(get_exec_ub()); ++ atomic_set(&d_bc->d_inuse, INUSE_INIT); /* see comment in dcache.h */ ++ d_bc->d_ubsize = d_charge_size(dentry); ++ ++ if (charge_dcache(d_bc->d_ub, d_bc->d_ubsize, UB_HARD)) ++ goto failure; ++ return 0; ++ ++failure: ++ put_beancounter(d_bc->d_ub); ++ d_bc->d_ub = NULL; ++ return -ENOMEM; ++} ++void __ub_dentry_alloc_start(void) ++{ ++ down_read(&ub_dentry_alloc_sem); ++ current->task_bc.dentry_alloc = 1; ++} ++ ++void __ub_dentry_alloc_end(void) ++{ ++ current->task_bc.dentry_alloc = 0; ++ up_read(&ub_dentry_alloc_sem); ++} ++ ++/* ++ * It is assumed that parent is already in use, so traverse upwards is ++ * limited to one ancestor only. ++ * Called under d_lock and rcu_read_lock. ++ */ ++int __ub_dentry_charge(struct dentry *dentry) ++{ ++ struct dentry_beancounter *d_bc; ++ struct dentry *parent; ++ int ret; ++ ++ if (ub_dget_testone(dentry)) { ++ d_bc = &dentry->dentry_bc; ++ /* state transition -1 => 0 */ ++ if (d_charge(d_bc)) ++ goto failure; ++ ++ if (dentry != dentry->d_parent) { ++ parent = dentry->d_parent; ++ if (ub_dget_testone(parent)) ++ BUG(); ++ } ++ } ++ return 0; ++ ++failure: ++ /* ++ * Here we would like to fail the lookup. ++ * It is not easy: if d_lookup fails, callers expect that a dentry ++ * with the given name doesn't exist, and create a new one. ++ * So, first we forcedly charge for this dentry. ++ * Then try to remove it from cache safely. If it turns out to be ++ * possible, we can return error. ++ */ ++ d_forced_charge(d_bc); ++ ++ if (dentry != dentry->d_parent) { ++ parent = dentry->d_parent; ++ if (ub_dget_testone(parent)) ++ BUG(); ++ } ++ ++ ret = 0; ++ if (spin_trylock(&dcache_lock)) { ++ if (!list_empty(&dentry->d_subdirs)) { ++ spin_unlock(&dentry->d_lock); ++ spin_unlock(&dcache_lock); ++ rcu_read_unlock(); ++ shrink_dcache_parent(dentry); ++ rcu_read_lock(); ++ spin_lock(&dcache_lock); ++ spin_lock(&dentry->d_lock); ++ } ++ if (atomic_read(&dentry->d_count) == 1) { ++ __d_drop(dentry); ++ ret = -1; ++ } ++ spin_unlock(&dcache_lock); ++ } ++ ++ return ret; ++} ++ ++/* ++ * Go up in the tree decreasing d_inuse. ++ * Called under dcache_lock. ++ */ ++void __ub_dentry_uncharge(struct dentry *dentry) ++{ ++ struct dentry *parent; ++ struct user_beancounter *ub; ++ unsigned long size; ++ ++ /* go up until state doesn't change or and root is reached */ ++ size = dentry->dentry_bc.d_ubsize; ++ ub = dentry->dentry_bc.d_ub; ++ while (ub_dput_testzero(dentry)) { ++ /* state transition 0 => -1 */ ++ uncharge_dcache(ub, size); ++ put_beancounter(ub); ++ ++ parent = dentry->d_parent; ++ if (dentry == parent) ++ break; ++ ++ dentry = parent; ++ size = dentry->dentry_bc.d_ubsize; ++ ub = dentry->dentry_bc.d_ub; ++ } ++} ++ ++/* ++ * Forced charge for __dget_locked, where API doesn't allow to return error. ++ * Called under dcache_lock. ++ */ ++void __ub_dentry_charge_nofail(struct dentry *dentry) ++{ ++ struct dentry *parent; ++ ++ while (ub_dget_testone(dentry)) { ++ /* state transition -1 => 0 */ ++ d_forced_charge(&dentry->dentry_bc); ++ ++ parent = dentry->d_parent; ++ if (dentry == parent) ++ break; ++ dentry = parent; ++ } ++} ++ ++/* ++ * Adaptive accounting ++ */ ++ ++int ub_dentry_on = 1; ++int ub_dentry_alloc_barrier; ++EXPORT_SYMBOL(ub_dentry_on); ++ ++static unsigned long checklowat = 0; ++static unsigned long checkhiwat = ULONG_MAX; ++ ++static int sysctl_ub_dentry_chk = 10; ++#define sysctl_ub_lowat sysctl_ub_watermark[0] ++#define sysctl_ub_hiwat sysctl_ub_watermark[1] ++static DECLARE_RWSEM(ub_dentry_alloc_sem); ++/* 1024th of lowmem size */ ++static unsigned int sysctl_ub_watermark[2] = {0, 100}; ++ ++static void ub_dentry_set_limits(unsigned long pages, unsigned long cap) ++{ ++ down_write(&ub_dentry_alloc_sem); ++ preempt_disable(); ++ checklowat = (pages >> 10) * sysctl_ub_lowat; ++ checkhiwat = (pages >> 10) * sysctl_ub_hiwat; ++ if (checkhiwat > cap) { ++ checkhiwat = cap; ++ checklowat = cap / sysctl_ub_hiwat * sysctl_ub_lowat; ++ } ++ preempt_enable(); ++ up_write(&ub_dentry_alloc_sem); ++} ++ ++static int ub_dentry_proc_handler(ctl_table *ctl, int write, struct file *filp, ++ void __user *buffer, size_t *lenp, loff_t *ppos) ++{ ++ int r; ++ ++ r = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); ++ if (!r && write) ++ ub_dentry_set_limits(totalram_pages - totalhigh_pages, ++ ULONG_MAX); ++ return r; ++} ++ ++static ctl_table ub_dentry_sysctl_table[] = { ++ { ++ .procname = "dentry_check", ++ .data = &sysctl_ub_dentry_chk, ++ .maxlen = sizeof(sysctl_ub_dentry_chk), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++ { ++ .procname = "dentry_watermark", ++ .data = &sysctl_ub_lowat, ++ .maxlen = sizeof(sysctl_ub_lowat) * 2, ++ .mode = 0644, ++ .proc_handler = ub_dentry_proc_handler, ++ }, ++ { .ctl_name = 0 } ++}; ++static ctl_table ub_dentry_sysctl_root[] = { ++ { ++ .procname = "ubc", ++ .mode = 0555, ++ .child = ub_dentry_sysctl_table, ++ }, ++ { .ctl_name = 0 } ++}; ++ ++static int __init ub_dentry_init(void) ++{ ++ /* ++ * Initial watermarks are limited, to limit walk time. ++ * 384MB translates into 0.8 sec on PIII 866MHz. ++ */ ++ ub_dentry_set_limits(totalram_pages - totalhigh_pages, ++ 384 * 1024 * 1024 / PAGE_SIZE); ++ if (register_sysctl_table(ub_dentry_sysctl_root) == NULL) ++ return -ENOMEM; ++ return 0; ++} ++__initcall(ub_dentry_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/io_acct.c debian/binary-custom.d/openvz/src/kernel/bc/io_acct.c +--- ./kernel/bc/io_acct.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/io_acct.c 2012-11-13 15:20:15.364569069 +0000 +@@ -0,0 +1,514 @@ ++/* ++ * kernel/bc/io_acct.c ++ * ++ * Copyright (C) 2006 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * Pavel Emelianov ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++static struct mempool_s *pb_pool; ++ ++#define PB_MIN_IO (1024) ++ ++static inline struct page_beancounter *io_pb_alloc(void) ++{ ++ return mempool_alloc(pb_pool, GFP_ATOMIC); ++} ++ ++static inline void io_pb_free(struct page_beancounter *pb) ++{ ++ mempool_free(pb, pb_pool); ++} ++ ++struct page_beancounter **page_pblist(struct page *page) ++{ ++ struct page_beancounter **pb, *iopb; ++ ++ pb = &page_pbc(page); ++ iopb = iopb_to_pb(*pb); ++ ++ return iopb == NULL ? pb : &iopb->page_pb_list; ++} ++ ++/* ++ * We save the context page was set dirty to use it later ++ * when the real write starts. If the page is mapped then ++ * IO pb is stores like this: ++ * ++ * Before saving: ++ * ++ * +- page -------+ ++ * | ... | ++ * | page_pb +---+ ++ * +--------------+ | +-----+ +-----+ +-----+ ++ * +-> | pb1 | -> | pb2 | - ... -> | pbN | -+ ++ * +-----+ +-----+ +-----+ | ++ * ^ | ++ * +---------------------------------+ ++ * ++ * After saving: ++ * ++ * +- page -------+ +- io pb ------+ ++ * | ... | | ... | ++ * | page_pb +----> | page_pb_list +-+ ++ * +--------------+ +--------------+ | ++ * | ++ * +-------------------+ ++ * | ++ * | +-----+ +-----+ +-----+ ++ * +-> | pb1 | -> | pb2 | - ... -> | pbN | -+ ++ * +-----+ +-----+ +-----+ | ++ * ^ | ++ * +---------------------------------+ ++ * ++ * And the page_pblist(...) function returns pointer to the place that ++ * points to this pbX ring. ++ */ ++ ++#ifdef CONFIG_BC_DEBUG_IO ++static LIST_HEAD(pb_io_list); ++static unsigned long anon_pages, not_released; ++ ++static inline void io_debug_save(struct page_beancounter *pb, ++ struct page_beancounter *mpb) ++{ ++ pb->io_debug = (mpb == NULL); ++ list_add(&pb->io_list, &pb_io_list); ++} ++ ++static inline void io_debug_release(struct page_beancounter *pb) ++{ ++ list_del(&pb->io_list); ++} ++ ++void ub_io_release_debug(struct page *page) ++{ ++ struct page_beancounter *pb; ++ static int once = 0; ++ ++ pb = page_pbc(page); ++ if (likely(iopb_to_pb(pb) == NULL)) ++ return; ++ ++ if (!once) { ++ printk("BUG: Page has an IO bc but is not expectd to\n"); ++ dump_stack(); ++ once = 1; ++ } ++ ++ spin_lock(&pb_lock); ++ not_released++; ++ pb = iopb_to_pb(pb); ++ page_pbc(page) = NULL; ++ io_debug_release(pb); ++ pb->ub->io_pb_held--; ++ spin_unlock(&pb_lock); ++ ++ put_beancounter(pb->ub); ++ io_pb_free(pb); ++} ++ ++static inline int io_debug_precheck_save(struct page *page) ++{ ++ if (unlikely(PageAnon(page))) { ++ anon_pages++; ++ return 1; ++ } ++ ++ return 0; ++} ++ ++static inline int io_debug_precheck_release(struct page *page) ++{ ++ return 0; ++} ++#else ++#define io_debug_save(pb, mpb) do { } while (0) ++#define io_debug_release(pb) do { } while (0) ++#define io_debug_precheck_save(page) (0) ++#define io_debug_precheck_release(p) (0) ++#endif ++ ++static inline void set_page_io(struct page *page, struct page_beancounter *pb, ++ struct page_beancounter *mapped_pb) ++{ ++ unsigned long val; ++ ++ val = (unsigned long)pb | PAGE_IO_MARK; ++ pb->page = page; ++ ++ page_pbc(page) = (struct page_beancounter *)val; ++ io_debug_save(pb, mapped_pb); ++ pb->ub->io_pb_held++; ++} ++ ++static inline void put_page_io(struct page *page, struct page_beancounter *pb) ++{ ++ pb->ub->io_pb_held--; ++ io_debug_release(pb); ++ page_pbc(page) = pb->page_pb_list; ++} ++ ++void ub_io_save_context(struct page *page, size_t bytes_dirtied) ++{ ++ struct user_beancounter *ub; ++ struct page_beancounter *pb, *mapped_pb, *io_pb; ++ ++ if (unlikely(in_interrupt())) { ++ WARN_ON_ONCE(1); ++ return; ++ } ++ ++ /* ++ * FIXME - this can happen from atomic context and ++ * it's probably not that good to loose some requests ++ */ ++ ++ pb = io_pb_alloc(); ++ io_pb = NULL; ++ ++ spin_lock(&pb_lock); ++ if (io_debug_precheck_save(page)) ++ goto out_unlock; ++ ++ mapped_pb = page_pbc(page); ++ io_pb = iopb_to_pb(mapped_pb); ++ if (io_pb != NULL) { ++ /* ++ * this page has an IO - release it and force a new one ++ * We could also race with page cleaning - see below ++ */ ++ mapped_pb = io_pb->page_pb_list; ++ put_page_io(page, io_pb); ++ } ++ ++ /* ++ * If the page is mapped we must save the context ++ * it maps to. If the page isn't mapped we use current ++ * context as this is a regular write. ++ */ ++ ++ if (mapped_pb != NULL) ++ ub = top_beancounter(mapped_pb->ub); ++ else ++ ub = get_io_ub(); ++ ++ if (!PageDirty(page)) { ++ /* ++ * race with clear_page_dirty(_for_io) - account ++ * writes for ub_io_release_context() ++ */ ++ if (io_pb != NULL) ++ io_pb->ub->bytes_wrote += PAGE_CACHE_SIZE; ++ if (pb != NULL) ++ io_pb_free(pb); ++ goto out_unlock; ++ } ++ ++ if (pb == NULL) { ++ ub->bytes_dirty_missed += bytes_dirtied; ++ goto out_unlock; ++ } ++ ++ /* ++ * the page may become clean here, but the context will be seen ++ * in ub_io_release_context() ++ */ ++ ++ pb->ub = get_beancounter(ub); ++ pb->page_pb_list = mapped_pb; ++ ub->bytes_dirtied += bytes_dirtied; ++ ++ set_page_io(page, pb, mapped_pb); ++ ++out_unlock: ++ spin_unlock(&pb_lock); ++ ++ if (io_pb != NULL) { ++ put_beancounter(io_pb->ub); ++ io_pb_free(io_pb); ++ } ++} ++ ++void ub_io_release_context(struct page *page, size_t wrote) ++{ ++ struct page_beancounter *pb; ++ ++ if (io_debug_precheck_release(page)) ++ return; ++ ++ if (unlikely(in_interrupt())) { ++ WARN_ON_ONCE(1); ++ return; ++ } ++ ++ spin_lock(&pb_lock); ++ pb = iopb_to_pb(page_pbc(page)); ++ if (unlikely(pb == NULL)) ++ /* ++ * this may happen if we failed to allocate ++ * context in ub_io_save_context or raced with it ++ */ ++ goto out_unlock; ++ ++ if (wrote) ++ pb->ub->bytes_wrote += wrote; ++ ++ put_page_io(page, pb); ++out_unlock: ++ spin_unlock(&pb_lock); ++ ++ if (pb != NULL) { ++ put_beancounter(pb->ub); ++ io_pb_free(pb); ++ } ++} ++ ++void __init ub_init_io(struct kmem_cache *pb_cachep) ++{ ++ pb_pool = mempool_create_slab_pool(PB_MIN_IO, pb_cachep); ++ if (pb_pool == NULL) ++ panic("Can't create pb_pool"); ++} ++ ++#ifdef CONFIG_PROC_FS ++#define in_flight(var) (var > var##_done ? var - var##_done : 0) ++ ++static int bc_ioacct_show(struct seq_file *f, void *v) ++{ ++ int i; ++ unsigned long long read, write, cancel; ++ unsigned long sync, sync_done; ++ unsigned long fsync, fsync_done; ++ unsigned long fdsync, fdsync_done; ++ unsigned long frsync, frsync_done; ++ unsigned long reads, writes; ++ unsigned long long rchar, wchar; ++ struct user_beancounter *ub; ++ ++ ub = seq_beancounter(f); ++ ++ read = write = cancel = 0; ++ sync = sync_done = fsync = fsync_done = ++ fdsync = fdsync_done = frsync = frsync_done = 0; ++ reads = writes = 0; ++ rchar = wchar = 0; ++ for_each_online_cpu(i) { ++ struct ub_percpu_struct *ub_percpu; ++ ub_percpu = per_cpu_ptr(ub->ub_percpu, i); ++ ++ read += ub_percpu->bytes_read; ++ write += ub_percpu->bytes_wrote; ++ cancel += ub_percpu->bytes_cancelled; ++ ++ sync += ub_percpu->sync; ++ fsync += ub_percpu->fsync; ++ fdsync += ub_percpu->fdsync; ++ frsync += ub_percpu->frsync; ++ sync_done += ub_percpu->sync_done; ++ fsync_done += ub_percpu->fsync_done; ++ fdsync_done += ub_percpu->fdsync_done; ++ frsync_done += ub_percpu->frsync_done; ++ ++ reads += ub_percpu->read; ++ writes += ub_percpu->write; ++ rchar += ub_percpu->rchar; ++ wchar += ub_percpu->wchar; ++ } ++ ++ seq_printf(f, bc_proc_llu_fmt, "read", read); ++ seq_printf(f, bc_proc_llu_fmt, "write", ub->bytes_wrote + write); ++ seq_printf(f, bc_proc_llu_fmt, "dirty", ub->bytes_dirtied); ++ seq_printf(f, bc_proc_llu_fmt, "cancel", cancel); ++ seq_printf(f, bc_proc_llu_fmt, "missed", ub->bytes_dirty_missed); ++ ++ seq_printf(f, bc_proc_lu_lfmt, "syncs_total", sync); ++ seq_printf(f, bc_proc_lu_lfmt, "fsyncs_total", fsync); ++ seq_printf(f, bc_proc_lu_lfmt, "fdatasyncs_total", fdsync); ++ seq_printf(f, bc_proc_lu_lfmt, "range_syncs_total", frsync); ++ ++ seq_printf(f, bc_proc_lu_lfmt, "syncs_active", in_flight(sync)); ++ seq_printf(f, bc_proc_lu_lfmt, "fsyncs_active", in_flight(fsync)); ++ seq_printf(f, bc_proc_lu_lfmt, "fdatasyncs_active", in_flight(fsync)); ++ seq_printf(f, bc_proc_lu_lfmt, "range_syncs_active", in_flight(frsync)); ++ ++ seq_printf(f, bc_proc_lu_lfmt, "vfs_reads", reads); ++ seq_printf(f, bc_proc_llu_fmt, "vfs_read_chars", rchar); ++ seq_printf(f, bc_proc_lu_lfmt, "vfs_writes", writes); ++ seq_printf(f, bc_proc_llu_fmt, "vfs_write_chars", wchar); ++ ++ seq_printf(f, bc_proc_lu_lfmt, "io_pbs", ub->io_pb_held); ++ return 0; ++} ++ ++static struct bc_proc_entry bc_ioacct_entry = { ++ .name = "ioacct", ++ .u.show = bc_ioacct_show, ++}; ++ ++#ifdef CONFIG_BC_DEBUG_IO ++#define PTR_SIZE (int)(sizeof(void *) * 2) ++#define INT_SIZE (int)(sizeof(int) * 2) ++ ++static int bc_io_show(struct seq_file *f, void *v) ++{ ++ struct list_head *lh; ++ struct page_beancounter *pb; ++ struct page *pg; ++ ++ lh = (struct list_head *)v; ++ if (lh == &pb_io_list) { ++ seq_printf(f, "Races: anon %lu missed %lu\n", ++ anon_pages, not_released); ++ ++ seq_printf(f, "%-*s %-1s %-*s %-4s %*s %*s " ++ "%-*s %-*s %-1s %-*s %-*s\n", ++ PTR_SIZE, "pb", "", ++ PTR_SIZE, "page", "flg", ++ INT_SIZE, "cnt", INT_SIZE, "mcnt", ++ PTR_SIZE, "pb_list", ++ PTR_SIZE, "page_pb", "", ++ PTR_SIZE, "mapping", ++ INT_SIZE, "ub"); ++ return 0; ++ } ++ ++ pb = list_entry(lh, struct page_beancounter, io_list); ++ pg = pb->page; ++ seq_printf(f, "%p %c %p %c%c%c%c %*d %*d %p %p %c %p %d\n", ++ pb, pb->io_debug ? 'e' : 'm', pg, ++ PageDirty(pg) ? 'D' : 'd', ++ PageAnon(pg) ? 'A' : 'a', ++ PageWriteback(pg) ? 'W' : 'w', ++ PageLocked(pg) ? 'L' : 'l', ++ INT_SIZE, page_count(pg), ++ INT_SIZE, page_mapcount(pg), ++ pb->page_pb_list, page_pbc(pg), ++ iopb_to_pb(page_pbc(pg)) == pb ? ' ' : '!', ++ pg->mapping, pb->ub->ub_uid); ++ return 0; ++} ++ ++static void *bc_io_start(struct seq_file *f, loff_t *ppos) ++{ ++ loff_t pos; ++ struct list_head *lh; ++ ++ pos = *ppos; ++ spin_lock(&pb_lock); ++ if (pos == 0) ++ return &pb_io_list; ++ ++ list_for_each (lh, &pb_io_list) ++ if (pos-- == 1) ++ return lh; ++ return NULL; ++} ++ ++static void *bc_io_next(struct seq_file *f, void *v, loff_t *ppos) ++{ ++ struct list_head *lh; ++ ++ (*ppos)++; ++ lh = (struct list_head *)v; ++ return lh->next == &pb_io_list ? NULL : lh->next; ++} ++ ++static void bc_io_stop(struct seq_file *f, void *v) ++{ ++ spin_unlock(&pb_lock); ++} ++ ++static struct seq_operations bc_io_seq_ops = { ++ .start = bc_io_start, ++ .next = bc_io_next, ++ .stop = bc_io_stop, ++ .show = bc_io_show, ++}; ++ ++static int bc_io_open(struct inode *inode, struct file *filp) ++{ ++ if (!(capable(CAP_DAC_OVERRIDE) && capable(CAP_DAC_READ_SEARCH))) ++ return -EACCES; ++ ++ return seq_open(filp, &bc_io_seq_ops); ++} ++static struct file_operations bc_io_debug_ops = { ++ .open = bc_io_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = seq_release, ++}; ++ ++static struct bc_proc_entry bc_ioacct_debug_entry = { ++ .name = "ioacct_debug", ++ .u.fops = &bc_io_debug_ops, ++}; ++#endif ++ ++static int bc_ioacct_notify(struct vnotifier_block *self, ++ unsigned long event, void *arg, int old_ret) ++{ ++ struct user_beancounter *ub; ++ unsigned long *vm_events; ++ unsigned long long bin, bout; ++ int i; ++ ++ if (event != VIRTINFO_VMSTAT) ++ return old_ret; ++ ++ ub = top_beancounter(get_exec_ub()); ++ if (ub == get_ub0()) ++ return old_ret; ++ ++ /* Think over: do we need to account here bytes_dirty_missed? */ ++ bout = ub->bytes_wrote; ++ bin = 0; ++ for_each_online_cpu(i) { ++ bout += per_cpu_ptr(ub->ub_percpu, i)->bytes_wrote; ++ bin += per_cpu_ptr(ub->ub_percpu, i)->bytes_read; ++ } ++ ++ /* convert to Kbytes */ ++ bout >>= 10; ++ bin >>= 10; ++ ++ vm_events = ((unsigned long *)arg) + NR_VM_ZONE_STAT_ITEMS; ++ vm_events[PGPGOUT] = (unsigned long)bout; ++ vm_events[PGPGIN] = (unsigned long)bin; ++ return NOTIFY_OK; ++} ++ ++static struct vnotifier_block bc_ioacct_nb = { ++ .notifier_call = bc_ioacct_notify, ++}; ++ ++static int __init bc_ioacct_init(void) ++{ ++#ifdef CONFIG_BC_DEBUG_IO ++ bc_register_proc_root_entry(&bc_ioacct_debug_entry); ++#endif ++ bc_register_proc_entry(&bc_ioacct_entry); ++ ++ virtinfo_notifier_register(VITYPE_GENERAL, &bc_ioacct_nb); ++ return 0; ++} ++ ++late_initcall(bc_ioacct_init); ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/io_prio.c debian/binary-custom.d/openvz/src/kernel/bc/io_prio.c +--- ./kernel/bc/io_prio.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/io_prio.c 2012-11-13 15:20:15.364569069 +0000 +@@ -0,0 +1,466 @@ ++/* ++ * kernel/bc/io_prio.c ++ * ++ * Copyright (C) 2007 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * Vasily Tarasov ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define BC_MAX_RATIO 100 ++ ++/* bc bandwidth inversely proportional coefficient per ioprio */ ++static int bc_ioprio_ratio[CFQ_PRIO_LISTS] = {100, 87, 77, 70, 63, 58, 53, 50}; ++ ++struct cfq_bc_data *__find_cfq_bc(struct ub_iopriv *iopriv, ++ struct cfq_data *cfqd) ++{ ++ struct cfq_bc_data *cfq_bc; ++ ++ list_for_each_entry(cfq_bc, &iopriv->cfq_bc_head, cfq_bc_list) ++ if (cfq_bc->cfqd == cfqd) ++ return cfq_bc; ++ ++ return NULL; ++} ++ ++struct cfq_bc_data *bc_find_cfq_bc(struct ub_iopriv *iopriv, ++ struct cfq_data *cfqd) ++{ ++ struct cfq_bc_data *cfq_bc; ++ unsigned long flags; ++ ++ read_lock_irqsave(&iopriv->cfq_bc_list_lock, flags); ++ cfq_bc = __find_cfq_bc(iopriv, cfqd); ++ read_unlock_irqrestore(&iopriv->cfq_bc_list_lock, flags); ++ return cfq_bc; ++} ++struct cfq_bc_data *bc_findcreate_cfq_bc(struct ub_iopriv *iopriv, ++ struct cfq_data *cfqd, gfp_t gfp_mask) ++{ ++ struct cfq_bc_data *cfq_bc_new; ++ struct cfq_bc_data *cfq_bc; ++ unsigned long flags; ++ ++ cfq_bc = bc_find_cfq_bc(iopriv, cfqd); ++ if (cfq_bc) ++ return cfq_bc; ++ ++ cfq_bc_new = kzalloc(sizeof(*cfq_bc_new), gfp_mask); ++ if (!cfq_bc_new) ++ return NULL; ++ ++ cfq_init_cfq_bc(cfq_bc_new); ++ cfq_bc_new->cfqd = cfqd; ++ cfq_bc_new->ub_iopriv = iopriv; ++ ++ write_lock_irqsave(&iopriv->cfq_bc_list_lock, flags); ++ cfq_bc = __find_cfq_bc(iopriv, cfqd); ++ if (cfq_bc) ++ kfree(cfq_bc_new); ++ else { ++ list_add_tail(&cfq_bc_new->cfq_bc_list, ++ &iopriv->cfq_bc_head); ++ cfq_bc = cfq_bc_new; ++ } ++ write_unlock_irqrestore(&iopriv->cfq_bc_list_lock, flags); ++ ++ return cfq_bc; ++} ++ ++void bc_init_ioprio(struct ub_iopriv *iopriv) ++{ ++ INIT_LIST_HEAD(&iopriv->cfq_bc_head); ++ rwlock_init(&iopriv->cfq_bc_list_lock); ++ iopriv->ioprio = UB_IOPRIO_BASE; ++} ++ ++static void inline bc_cfq_bc_check_empty(struct cfq_bc_data *cfq_bc) ++{ ++ BUG_ON(!RB_EMPTY_ROOT(&cfq_bc->service_tree.rb)); ++} ++ ++static void bc_release_cfq_bc(struct cfq_bc_data *cfq_bc) ++{ ++ struct cfq_data *cfqd; ++ elevator_t *eq; ++ int i; ++ ++ cfqd = cfq_bc->cfqd; ++ eq = cfqd->queue->elevator; ++ ++ for (i = 0; i < CFQ_PRIO_LISTS; i++) { ++ if (cfq_bc->async_cfqq[0][i]) { ++ eq->ops->put_queue(cfq_bc->async_cfqq[0][i]); ++ cfq_bc->async_cfqq[0][i] = NULL; ++ } ++ if (cfq_bc->async_cfqq[1][i]) { ++ eq->ops->put_queue(cfq_bc->async_cfqq[1][i]); ++ cfq_bc->async_cfqq[1][i] = NULL; ++ } ++ } ++ if (cfq_bc->async_idle_cfqq) { ++ eq->ops->put_queue(cfq_bc->async_idle_cfqq); ++ cfq_bc->async_idle_cfqq = NULL; ++ } ++ /* ++ * Note: this cfq_bc is already not in active list, ++ * but can be still pointed from cfqd as active. ++ */ ++ cfqd->active_cfq_bc = NULL; ++ ++ bc_cfq_bc_check_empty(cfq_bc); ++ list_del(&cfq_bc->cfq_bc_list); ++ kfree(cfq_bc); ++} ++ ++void bc_fini_ioprio(struct ub_iopriv *iopriv) ++{ ++ struct cfq_bc_data *cfq_bc; ++ struct cfq_bc_data *cfq_bc_tmp; ++ unsigned long flags; ++ spinlock_t *queue_lock; ++ ++ /* ++ * Don't get cfq_bc_list_lock since ub is already dead, ++ * but async cfqqs are still in hash list, consequently ++ * queue_lock should be hold. ++ */ ++ list_for_each_entry_safe(cfq_bc, cfq_bc_tmp, ++ &iopriv->cfq_bc_head, cfq_bc_list) { ++ queue_lock = cfq_bc->cfqd->queue->queue_lock; ++ spin_lock_irqsave(queue_lock, flags); ++ bc_release_cfq_bc(cfq_bc); ++ spin_unlock_irqrestore(queue_lock, flags); ++ } ++} ++ ++void bc_cfq_exit_queue(struct cfq_data *cfqd) ++{ ++ struct cfq_bc_data *cfq_bc; ++ struct user_beancounter *ub; ++ ++ local_irq_disable(); ++ for_each_beancounter(ub) { ++ write_lock(&ub->iopriv.cfq_bc_list_lock); ++ cfq_bc = __find_cfq_bc(&ub->iopriv, cfqd); ++ if (!cfq_bc) { ++ write_unlock(&ub->iopriv.cfq_bc_list_lock); ++ continue; ++ } ++ bc_release_cfq_bc(cfq_bc); ++ write_unlock(&ub->iopriv.cfq_bc_list_lock); ++ } ++ local_irq_enable(); ++} ++ ++int bc_expired(struct cfq_data *cfqd) ++{ ++ return time_after(jiffies, cfqd->slice_end) ? 1 : 0; ++} ++ ++static inline int bc_empty(struct cfq_bc_data *cfq_bc) ++{ ++ /* ++ * consider BC as empty only if there is no requests ++ * in elevator _and_ in driver ++ */ ++ if (!cfq_bc->rqnum && !cfq_bc->on_dispatch) ++ return 1; ++ ++ return 0; ++} ++ ++static void bc_wait_start(struct cfq_bc_data *cfq_bc, unsigned long now) ++{ ++ write_seqcount_begin(&cfq_bc->stat_lock); ++ cfq_bc->wait_start = now; ++ write_seqcount_end(&cfq_bc->stat_lock); ++} ++ ++static void bc_wait_stop(struct cfq_bc_data *cfq_bc, unsigned long now) ++{ ++ write_seqcount_begin(&cfq_bc->stat_lock); ++ cfq_bc->wait_time += now - cfq_bc->wait_start; ++ cfq_bc->wait_start = 0; ++ write_seqcount_end(&cfq_bc->stat_lock); ++} ++ ++static unsigned int bc_wait_time(struct cfq_bc_data *cfq_bc, unsigned long now) ++{ ++ unsigned long res; ++ unsigned seq; ++ ++ do { ++ seq = read_seqcount_begin(&cfq_bc->stat_lock); ++ res = cfq_bc->wait_time + now - (cfq_bc->wait_start ?: now); ++ } while (read_seqcount_retry(&cfq_bc->stat_lock, seq)); ++ ++ return jiffies_to_msecs(res); ++} ++ ++/* return true if a iotime after b, like time_after */ ++static int bc_iotime_after(unsigned long a, unsigned long b) ++{ ++ return (long)a - (long)b > 0; ++} ++ ++/* cfq bc queue rb_tree helper function */ ++static void bc_insert(struct cfq_data *cfqd, struct cfq_bc_data *cfq_bc) ++{ ++ struct rb_node **p = &cfqd->cfq_bc_queue.rb_node; ++ struct rb_node *parent = NULL; ++ struct cfq_bc_data *__cfq_bc; ++ ++ while (*p) { ++ parent = *p; ++ __cfq_bc = rb_entry(parent, struct cfq_bc_data, cfq_bc_node); ++ /* important: if equal push right */ ++ if (bc_iotime_after(__cfq_bc->cfq_bc_iotime, ++ cfq_bc->cfq_bc_iotime)) ++ p = &(*p)->rb_left; ++ else ++ p = &(*p)->rb_right; ++ } ++ rb_link_node(&cfq_bc->cfq_bc_node, parent, p); ++ rb_insert_color(&cfq_bc->cfq_bc_node, &cfqd->cfq_bc_queue); ++} ++ ++static void bc_remove(struct cfq_data *cfqd, struct cfq_bc_data *cfq_bc) ++{ ++ rb_erase(&cfq_bc->cfq_bc_node, &cfqd->cfq_bc_queue); ++} ++ ++static void bc_enqueue(struct cfq_data *cfqd, struct cfq_bc_data *cfq_bc) ++{ ++ unsigned long iotime, slice, position; ++ ++ iotime = cfq_bc->cfq_bc_iotime; ++ slice = cfqd->cfq_ub_slice * BC_MAX_RATIO; ++ position = cfqd->cfq_bc_position; ++ ++ /* adjust iotime to hit in interval position +/- maximum slice */ ++ if (bc_iotime_after(position, iotime + slice) ++ || bc_iotime_after(iotime, position + slice)) ++ cfq_bc->cfq_bc_iotime = position; ++ ++ bc_insert(cfqd, cfq_bc); ++ ++ if (cfq_bc != cfqd->active_cfq_bc) ++ bc_wait_start(cfq_bc, jiffies); ++} ++ ++static void bc_dequeue(struct cfq_data *cfqd, struct cfq_bc_data *cfq_bc) ++{ ++ bc_remove(cfqd, cfq_bc); ++} ++ ++/* update bc iotime */ ++static void bc_update(struct cfq_data *cfqd, struct cfq_bc_data *cfq_bc, ++ unsigned long delta) ++{ ++ int ioprio; ++ ++ ioprio = cfq_bc->ub_iopriv->ioprio; ++ delta *= bc_ioprio_ratio[ioprio]; ++ cfq_bc->cfq_bc_iotime += delta; ++ ++ if (!cfq_bc->rqnum) ++ return; ++ ++ bc_remove(cfqd, cfq_bc); ++ bc_insert(cfqd, cfq_bc); ++} ++ ++static inline void bc_set_active(struct cfq_data *cfqd) ++{ ++ struct cfq_bc_data *cfq_bc; ++ unsigned long now = jiffies; ++ ++ /* update iotime of last active bc according to used time */ ++ cfq_bc = cfqd->active_cfq_bc; ++ if (cfq_bc && cfqd->slice_begin) ++ bc_update(cfqd, cfq_bc, now - cfqd->slice_begin); ++ ++ /* if no active BCs then keep this as an active one */ ++ if (RB_EMPTY_ROOT(&cfqd->cfq_bc_queue)) { ++ cfqd->slice_begin = 0; ++ return; ++ } ++ ++ if (cfq_bc && cfq_bc->rqnum) ++ bc_wait_start(cfq_bc, now); ++ ++ /* peek first bc from queue */ ++ cfq_bc = rb_entry(rb_first(&cfqd->cfq_bc_queue), ++ struct cfq_bc_data, cfq_bc_node); ++ ++ /* adjust queue active position */ ++ if (bc_iotime_after(cfq_bc->cfq_bc_iotime, cfqd->cfq_bc_position)) ++ cfqd->cfq_bc_position = cfq_bc->cfq_bc_iotime; ++ ++ cfqd->active_cfq_bc = cfq_bc; ++ cfqd->slice_begin = now; ++ cfqd->slice_end = now + cfqd->cfq_ub_slice; ++ ++ bc_wait_stop(cfq_bc, now); ++} ++ ++void bc_schedule_active(struct cfq_data *cfqd) ++{ ++ if (bc_expired(cfqd) || !cfqd->active_cfq_bc || ++ bc_empty(cfqd->active_cfq_bc)) ++ bc_set_active(cfqd); ++} ++ ++void bc_inc_rqnum(struct cfq_queue *cfqq) ++{ ++ struct cfq_bc_data *cfq_bc; ++ ++ cfq_bc = cfqq->cfq_bc; ++ ++ if (!cfq_bc->rqnum) ++ bc_enqueue(cfq_bc->cfqd, cfq_bc); ++ ++ cfq_bc->rqnum++; ++} ++ ++void bc_dec_rqnum(struct cfq_queue *cfqq) ++{ ++ struct cfq_bc_data *cfq_bc; ++ ++ cfq_bc = cfqq->cfq_bc; ++ ++ cfq_bc->rqnum--; ++ ++ if (!cfq_bc->rqnum) ++ bc_dequeue(cfq_bc->cfqd, cfq_bc); ++} ++ ++unsigned long bc_set_ioprio(int ubid, int ioprio) ++{ ++ struct user_beancounter *ub; ++ ++ if (ioprio < UB_IOPRIO_MIN || ioprio >= UB_IOPRIO_MAX) ++ return -ERANGE; ++ ++ ub = get_beancounter_byuid(ubid, 0); ++ if (!ub) ++ return -ESRCH; ++ ++ ub->iopriv.ioprio = ioprio; ++ put_beancounter(ub); ++ ++ return 0; ++} ++ ++struct user_beancounter *bc_io_switch_context(struct page *page) ++{ ++ struct page_beancounter *pb; ++ struct user_beancounter *old_ub = NULL; ++ ++ pb = page_iopb(page); ++ pb = iopb_to_pb(pb); ++ if (pb) { ++ get_beancounter(pb->ub); ++ old_ub = set_exec_ub(pb->ub); ++ } ++ ++ return old_ub; ++} ++ ++void bc_io_restore_context(struct user_beancounter *ub) ++{ ++ struct user_beancounter *old_ub; ++ ++ if (ub) { ++ old_ub = set_exec_ub(ub); ++ put_beancounter(old_ub); ++ } ++} ++ ++#ifdef CONFIG_PROC_FS ++static int bc_ioprio_show(struct seq_file *f, void *v) ++{ ++ struct user_beancounter *bc; ++ ++ bc = seq_beancounter(f); ++ seq_printf(f, "prio: %u\n", bc->iopriv.ioprio); ++ ++ return 0; ++} ++ ++static struct bc_proc_entry bc_ioprio_entry = { ++ .name = "ioprio", ++ .u.show = bc_ioprio_show, ++}; ++ ++static int bc_ioprio_queue_show(struct seq_file *f, void *v) ++{ ++ struct user_beancounter *bc; ++ struct cfq_bc_data *cfq_bc; ++ unsigned long now = jiffies; ++ ++ bc = seq_beancounter(f); ++ ++ read_lock_irq(&bc->iopriv.cfq_bc_list_lock); ++ list_for_each_entry(cfq_bc, &bc->iopriv.cfq_bc_head, cfq_bc_list) { ++ struct cfq_data *cfqd; ++ ++ cfqd = cfq_bc->cfqd; ++ seq_printf(f, "\t%-10s%6lu %c%c %10u\n", ++ /* ++ * this per-bc -> queue-data -> queue -> device ++ * access is safe w/o additional locks, since ++ * all the stuff above dies in the order shown ++ * and we're holding the first element ++ */ ++ kobject_name(cfqd->queue->kobj.parent), ++ cfq_bc->rqnum, ++ cfq_bc->on_dispatch ? 'D' : ' ', ++ cfqd->active_cfq_bc == cfq_bc ? 'A' : ' ', ++ bc_wait_time(cfq_bc, now)); ++ } ++ read_unlock_irq(&bc->iopriv.cfq_bc_list_lock); ++ ++ return 0; ++} ++ ++static struct bc_proc_entry bc_ioprio_queues_entry = { ++ .name = "ioprio_queues", ++ .u.show = bc_ioprio_queue_show, ++}; ++ ++static int __init bc_ioprio_init(void) ++{ ++ bc_register_proc_entry(&bc_ioprio_entry); ++ bc_register_proc_entry(&bc_ioprio_queues_entry); ++ return 0; ++} ++ ++late_initcall(bc_ioprio_init); ++#endif ++ ++EXPORT_SYMBOL(bc_io_switch_context); ++EXPORT_SYMBOL(bc_io_restore_context); ++EXPORT_SYMBOL(__find_cfq_bc); ++EXPORT_SYMBOL(bc_fini_ioprio); ++EXPORT_SYMBOL(bc_init_ioprio); ++EXPORT_SYMBOL(bc_findcreate_cfq_bc); ++EXPORT_SYMBOL(bc_cfq_exit_queue); ++EXPORT_SYMBOL(bc_expired); ++EXPORT_SYMBOL(bc_schedule_active); ++EXPORT_SYMBOL(bc_inc_rqnum); ++EXPORT_SYMBOL(bc_dec_rqnum); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/kmem.c debian/binary-custom.d/openvz/src/kernel/bc/kmem.c +--- ./kernel/bc/kmem.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/kmem.c 2012-11-13 15:20:15.364569069 +0000 +@@ -0,0 +1,406 @@ ++/* ++ * kernel/bc/kmem.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * Initialization ++ */ ++ ++/* ++ * Slab accounting ++ */ ++ ++#ifdef CONFIG_BC_DEBUG_KMEM ++ ++#define CC_HASH_SIZE 1024 ++static struct ub_cache_counter *cc_hash[CC_HASH_SIZE]; ++spinlock_t cc_lock; ++ ++static void __free_cache_counters(struct user_beancounter *ub, ++ struct kmem_cache *cachep) ++{ ++ struct ub_cache_counter *cc, **pprev, *del; ++ int i; ++ unsigned long flags; ++ ++ del = NULL; ++ spin_lock_irqsave(&cc_lock, flags); ++ for (i = 0; i < CC_HASH_SIZE; i++) { ++ pprev = &cc_hash[i]; ++ cc = cc_hash[i]; ++ while (cc != NULL) { ++ if (cc->ub != ub && cc->cachep != cachep) { ++ pprev = &cc->next; ++ cc = cc->next; ++ continue; ++ } ++ ++ list_del(&cc->ulist); ++ *pprev = cc->next; ++ cc->next = del; ++ del = cc; ++ cc = *pprev; ++ } ++ } ++ spin_unlock_irqrestore(&cc_lock, flags); ++ ++ while (del != NULL) { ++ cc = del->next; ++ kfree(del); ++ del = cc; ++ } ++} ++ ++void ub_free_counters(struct user_beancounter *ub) ++{ ++ __free_cache_counters(ub, NULL); ++} ++ ++void ub_kmemcache_free(struct kmem_cache *cachep) ++{ ++ __free_cache_counters(NULL, cachep); ++} ++ ++void __init init_cache_counters(void) ++{ ++ memset(cc_hash, 0, CC_HASH_SIZE * sizeof(cc_hash[0])); ++ spin_lock_init(&cc_lock); ++} ++ ++#define cc_hash_fun(ub, cachep) ( \ ++ (((unsigned long)(ub) >> L1_CACHE_SHIFT) ^ \ ++ ((unsigned long)(ub) >> (BITS_PER_LONG / 2)) ^ \ ++ ((unsigned long)(cachep) >> L1_CACHE_SHIFT) ^ \ ++ ((unsigned long)(cachep) >> (BITS_PER_LONG / 2)) \ ++ ) & (CC_HASH_SIZE - 1)) ++ ++static int change_slab_charged(struct user_beancounter *ub, ++ struct kmem_cache *cachep, long val) ++{ ++ struct ub_cache_counter *cc, *new_cnt, **pprev; ++ unsigned long flags; ++ ++ new_cnt = NULL; ++again: ++ spin_lock_irqsave(&cc_lock, flags); ++ cc = cc_hash[cc_hash_fun(ub, cachep)]; ++ while (cc) { ++ if (cc->ub == ub && cc->cachep == cachep) ++ goto found; ++ cc = cc->next; ++ } ++ ++ if (new_cnt != NULL) ++ goto insert; ++ ++ spin_unlock_irqrestore(&cc_lock, flags); ++ ++ new_cnt = kmalloc(sizeof(*new_cnt), GFP_ATOMIC); ++ if (new_cnt == NULL) ++ return -ENOMEM; ++ ++ new_cnt->counter = 0; ++ new_cnt->ub = ub; ++ new_cnt->cachep = cachep; ++ goto again; ++ ++insert: ++ pprev = &cc_hash[cc_hash_fun(ub, cachep)]; ++ new_cnt->next = *pprev; ++ *pprev = new_cnt; ++ list_add(&new_cnt->ulist, &ub->ub_cclist); ++ cc = new_cnt; ++ new_cnt = NULL; ++ ++found: ++ cc->counter += val; ++ spin_unlock_irqrestore(&cc_lock, flags); ++ if (new_cnt) ++ kfree(new_cnt); ++ return 0; ++} ++ ++static inline int inc_slab_charged(struct user_beancounter *ub, ++ struct kmem_cache *cachep) ++{ ++ return change_slab_charged(ub, cachep, 1); ++} ++ ++static inline void dec_slab_charged(struct user_beancounter *ub, ++ struct kmem_cache *cachep) ++{ ++ if (change_slab_charged(ub, cachep, -1) < 0) ++ BUG(); ++} ++ ++#include ++ ++#define inc_pages_charged(ub, order) ub_percpu_add(ub, \ ++ pages_charged, 1 << order) ++#define dec_pages_charged(ub, order) ub_percpu_sub(ub, \ ++ pages_charged, 1 << order) ++ ++#ifdef CONFIG_PROC_FS ++static int bc_kmem_debug_show(struct seq_file *f, void *v) ++{ ++ struct user_beancounter *ub; ++ struct ub_cache_counter *cc; ++ long pages, vmpages, pbc; ++ int i; ++ ++ ub = seq_beancounter(f); ++ ++ pages = vmpages = pbc = 0; ++ for_each_online_cpu(i) { ++ pages += per_cpu_ptr(ub->ub_percpu, i)->pages_charged; ++ vmpages += per_cpu_ptr(ub->ub_percpu, i)->vmalloc_charged; ++ pbc += per_cpu_ptr(ub->ub_percpu, i)->pbcs; ++ } ++ if (pages < 0) ++ pages = 0; ++ if (vmpages < 0) ++ vmpages = 0; ++ ++ seq_printf(f, bc_proc_lu_lu_fmt, "pages", pages, PAGE_SIZE); ++ seq_printf(f, bc_proc_lu_lu_fmt, "vmalloced", vmpages, PAGE_SIZE); ++ seq_printf(f, bc_proc_lu_lu_fmt, "pbcs", pbc, ++ sizeof(struct page_beancounter)); ++ ++ spin_lock_irq(&cc_lock); ++ list_for_each_entry (cc, &ub->ub_cclist, ulist) { ++ struct kmem_cache *cachep; ++ ++ cachep = cc->cachep; ++ seq_printf(f, bc_proc_lu_lu_fmt, ++ kmem_cache_name(cachep), ++ cc->counter, ++ kmem_cache_objuse(cachep)); ++ } ++ spin_unlock_irq(&cc_lock); ++ return 0; ++} ++ ++static struct bc_proc_entry bc_kmem_debug_entry = { ++ .name = "kmem_debug", ++ .u.show = bc_kmem_debug_show, ++}; ++ ++static int __init bc_kmem_debug_init(void) ++{ ++ bc_register_proc_entry(&bc_kmem_debug_entry); ++ return 0; ++} ++ ++late_initcall(bc_kmem_debug_init); ++#endif ++ ++#else ++#define inc_slab_charged(ub, cache) (0) ++#define dec_slab_charged(ub, cache) do { } while (0) ++#define inc_pages_charged(ub, cache) do { } while (0) ++#define dec_pages_charged(ub, cache) do { } while (0) ++#endif ++ ++#define UB_KMEM_QUANT (PAGE_SIZE * 4) ++ ++/* called with IRQ disabled */ ++int ub_kmemsize_charge(struct user_beancounter *ub, ++ unsigned long size, ++ enum ub_severity strict) ++{ ++ struct task_beancounter *tbc; ++ ++ tbc = ¤t->task_bc; ++ if (ub != tbc->task_ub || size > UB_KMEM_QUANT) ++ goto just_charge; ++ if (tbc->kmem_precharged >= size) { ++ tbc->kmem_precharged -= size; ++ return 0; ++ } ++ ++ if (charge_beancounter(ub, UB_KMEMSIZE, UB_KMEM_QUANT, UB_HARD) == 0) { ++ tbc->kmem_precharged += UB_KMEM_QUANT - size; ++ return 0; ++ } ++ ++just_charge: ++ return charge_beancounter(ub, UB_KMEMSIZE, size, strict); ++} ++ ++/* called with IRQ disabled */ ++void ub_kmemsize_uncharge(struct user_beancounter *ub, ++ unsigned long size) ++{ ++ struct task_beancounter *tbc; ++ ++ if (size > UB_MAXVALUE) { ++ printk("ub_kmemsize_uncharge: size %lu\n", size); ++ dump_stack(); ++ } ++ ++ tbc = ¤t->task_bc; ++ if (ub != tbc->task_ub) ++ goto just_uncharge; ++ ++ tbc->kmem_precharged += size; ++ if (tbc->kmem_precharged < UB_KMEM_QUANT * 2) ++ return; ++ size = tbc->kmem_precharged - UB_KMEM_QUANT; ++ tbc->kmem_precharged -= size; ++ ++just_uncharge: ++ uncharge_beancounter(ub, UB_KMEMSIZE, size); ++} ++ ++/* called with IRQ disabled */ ++int ub_slab_charge(struct kmem_cache *cachep, void *objp, gfp_t flags) ++{ ++ unsigned int size; ++ struct user_beancounter *ub; ++ ++ ub = get_beancounter(get_exec_ub()); ++ if (ub == NULL) ++ return 0; ++ ++ size = CHARGE_SIZE(kmem_cache_objuse(cachep)); ++ if (ub_kmemsize_charge(ub, size, ++ (flags & __GFP_SOFT_UBC ? UB_SOFT : UB_HARD))) ++ goto out_err; ++ ++ if (inc_slab_charged(ub, cachep) < 0) { ++ ub_kmemsize_uncharge(ub, size); ++ goto out_err; ++ } ++ *ub_slab_ptr(cachep, objp) = ub; ++ return 0; ++ ++out_err: ++ put_beancounter(ub); ++ return -ENOMEM; ++} ++ ++/* called with IRQ disabled */ ++void ub_slab_uncharge(struct kmem_cache *cachep, void *objp) ++{ ++ unsigned int size; ++ struct user_beancounter **ub_ref; ++ ++ ub_ref = ub_slab_ptr(cachep, objp); ++ if (*ub_ref == NULL) ++ return; ++ ++ dec_slab_charged(*ub_ref, cachep); ++ size = CHARGE_SIZE(kmem_cache_objuse(cachep)); ++ ub_kmemsize_uncharge(*ub_ref, size); ++ put_beancounter(*ub_ref); ++ *ub_ref = NULL; ++} ++ ++/* ++ * Pages accounting ++ */ ++ ++int ub_page_charge(struct page *page, int order, gfp_t mask) ++{ ++ struct user_beancounter *ub; ++ unsigned long flags; ++ ++ ub = NULL; ++ if (!(mask & __GFP_UBC)) ++ goto out; ++ ++ ub = get_beancounter(get_exec_ub()); ++ if (ub == NULL) ++ goto out; ++ ++ local_irq_save(flags); ++ if (ub_kmemsize_charge(ub, CHARGE_ORDER(order), ++ (mask & __GFP_SOFT_UBC ? UB_SOFT : UB_HARD))) ++ goto err; ++ ++ inc_pages_charged(ub, order); ++ local_irq_restore(flags); ++out: ++ BUG_ON(page_ub(page) != NULL); ++ page_ub(page) = ub; ++ return 0; ++ ++err: ++ local_irq_restore(flags); ++ BUG_ON(page_ub(page) != NULL); ++ put_beancounter(ub); ++ return -ENOMEM; ++} ++ ++void ub_page_uncharge(struct page *page, int order) ++{ ++ struct user_beancounter *ub; ++ unsigned long flags; ++ ++ ub = page_ub(page); ++ if (ub == NULL) ++ return; ++ ++ BUG_ON(ub->ub_magic != UB_MAGIC); ++ dec_pages_charged(ub, order); ++ local_irq_save(flags); ++ ub_kmemsize_uncharge(ub, CHARGE_ORDER(order)); ++ local_irq_restore(flags); ++ put_beancounter(ub); ++ page_ub(page) = NULL; ++} ++ ++/* ++ * takes init_mm.page_table_lock ++ * some outer lock to protect pages from vmalloced area must be held ++ */ ++struct user_beancounter *vmalloc_ub(void *obj) ++{ ++ struct page *pg; ++ ++ pg = vmalloc_to_page(obj); ++ if (pg == NULL) ++ return NULL; ++ ++ return page_ub(pg); ++} ++ ++EXPORT_SYMBOL(vmalloc_ub); ++ ++struct user_beancounter *mem_ub(void *obj) ++{ ++ struct user_beancounter *ub; ++ ++ if ((unsigned long)obj >= VMALLOC_START && ++ (unsigned long)obj < VMALLOC_END) ++ ub = vmalloc_ub(obj); ++ else ++ ub = slab_ub(obj); ++ ++ return ub; ++} ++ ++EXPORT_SYMBOL(mem_ub); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/misc.c debian/binary-custom.d/openvz/src/kernel/bc/misc.c +--- ./kernel/bc/misc.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/misc.c 2012-11-13 15:20:15.364569069 +0000 +@@ -0,0 +1,455 @@ ++/* ++ * kernel/bc/misc.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#define UB_FILE_MINQUANT 3 ++#define UB_FILE_MAXQUANT 10 ++#define UB_FILE_INIQUANT 4 ++ ++static unsigned long ub_file_precharge(struct task_beancounter *task_bc, ++ struct user_beancounter *ub, unsigned long *kmemsize); ++ ++extern struct kmem_cache *filp_cachep; ++ ++static inline unsigned long ub_file_kmemsize(unsigned long nr) ++{ ++ return CHARGE_SIZE(kmem_cache_objuse(filp_cachep)) * nr; ++} ++ ++/* ++ * Task staff ++ */ ++ ++static void init_task_sub(struct task_struct *parent, ++ struct task_struct *tsk, ++ struct task_beancounter *old_bc) ++{ ++ struct task_beancounter *new_bc; ++ struct user_beancounter *sub; ++ ++ new_bc = &tsk->task_bc; ++ sub = old_bc->fork_sub; ++ new_bc->fork_sub = get_beancounter(sub); ++ new_bc->task_fnode = NULL; ++ new_bc->task_freserv = old_bc->task_freserv; ++ old_bc->task_freserv = NULL; ++ memset(&new_bc->task_data, 0, sizeof(new_bc->task_data)); ++ new_bc->pgfault_handle = 0; ++ new_bc->pgfault_allot = 0; ++} ++ ++void ub_init_task_bc(struct task_beancounter *tbc) ++{ ++ tbc->file_precharged = 0; ++ tbc->file_quant = UB_FILE_INIQUANT; ++ tbc->file_count = 0; ++ ++ tbc->kmem_precharged = 0; ++ tbc->dentry_alloc = 0; ++} ++ ++int ub_task_charge(struct task_struct *parent, struct task_struct *task) ++{ ++ struct task_beancounter *old_bc; ++ struct task_beancounter *new_bc; ++ struct user_beancounter *ub, *pub; ++ unsigned long file_nr, kmemsize; ++ unsigned long flags; ++ ++ old_bc = &parent->task_bc; ++ ub = old_bc->fork_sub; ++ new_bc = &task->task_bc; ++ new_bc->task_ub = get_beancounter(ub); ++ new_bc->exec_ub = get_beancounter(ub); ++ ++ pub = top_beancounter(ub); ++ spin_lock_irqsave(&pub->ub_lock, flags); ++ if (unlikely(__charge_beancounter_locked(pub, UB_NUMPROC, ++ 1, UB_HARD) < 0)) ++ goto out_numproc; ++ ++ ub_init_task_bc(new_bc); ++ file_nr = ub_file_precharge(new_bc, pub, &kmemsize); ++ spin_unlock_irqrestore(&pub->ub_lock, flags); ++ ++ charge_beancounter_notop(ub, UB_NUMPROC, 1); ++ if (likely(file_nr)) { ++ charge_beancounter_notop(ub, UB_NUMFILE, file_nr); ++ charge_beancounter_notop(ub, UB_KMEMSIZE, kmemsize); ++ } ++ ++ init_task_sub(parent, task, old_bc); ++ return 0; ++ ++out_numproc: ++ spin_unlock_irqrestore(&pub->ub_lock, flags); ++ __put_beancounter_batch(ub, 2); ++ return -ENOMEM; ++} ++ ++extern atomic_t dbgpre; ++ ++void ub_task_uncharge(struct task_struct *task) ++{ ++ struct task_beancounter *task_bc; ++ struct user_beancounter *pub; ++ unsigned long file_nr, file_kmemsize; ++ unsigned long flags; ++ ++ task_bc = &task->task_bc; ++ pub = top_beancounter(task_bc->task_ub); ++ spin_lock_irqsave(&pub->ub_lock, flags); ++ __uncharge_beancounter_locked(pub, UB_NUMPROC, 1); ++ file_nr = task_bc->file_precharged; ++ if (likely(file_nr)) ++ __uncharge_beancounter_locked(pub, ++ UB_NUMFILE, file_nr); ++ ++ /* see comment in ub_file_charge */ ++ task_bc->file_precharged = 0; ++ file_kmemsize = ub_file_kmemsize(file_nr); ++ if (likely(file_kmemsize)) ++ __uncharge_beancounter_locked(pub, ++ UB_KMEMSIZE, file_kmemsize); ++ spin_unlock_irqrestore(&pub->ub_lock, flags); ++ ++ uncharge_beancounter_notop(task_bc->task_ub, UB_NUMPROC, 1); ++ if (likely(file_nr)) { ++ uncharge_beancounter_notop(task_bc->task_ub, ++ UB_NUMFILE, file_nr); ++ __put_beancounter_batch(task_bc->task_ub, file_nr); ++ } ++ if (likely(file_kmemsize)) ++ uncharge_beancounter_notop(task_bc->task_ub, ++ UB_KMEMSIZE, file_kmemsize); ++} ++ ++void ub_task_put(struct task_struct *task) ++{ ++ struct task_beancounter *task_bc; ++ struct user_beancounter *pub; ++ unsigned long kmemsize, flags; ++ ++ task_bc = &task->task_bc; ++ ++ pub = top_beancounter(task_bc->task_ub); ++ spin_lock_irqsave(&pub->ub_lock, flags); ++ kmemsize = task_bc->kmem_precharged; ++ task_bc->kmem_precharged = 0; ++ if (likely(kmemsize)) ++ __uncharge_beancounter_locked(pub, UB_KMEMSIZE, kmemsize); ++ spin_unlock_irqrestore(&pub->ub_lock, flags); ++ if (likely(kmemsize)) ++ uncharge_beancounter_notop(task_bc->task_ub, UB_KMEMSIZE, kmemsize); ++ ++ put_beancounter(task_bc->exec_ub); ++ put_beancounter(task_bc->task_ub); ++ put_beancounter(task_bc->fork_sub); ++ /* can't be freed elsewhere, failures possible in the middle of fork */ ++ if (task_bc->task_freserv != NULL) ++ kfree(task_bc->task_freserv); ++ ++ task_bc->exec_ub = (struct user_beancounter *)0xdeadbcbc; ++ task_bc->task_ub = (struct user_beancounter *)0xdead100c; ++ BUG_ON(task_bc->kmem_precharged != 0); ++} ++ ++/* ++ * Files and file locks. ++ */ ++/* ++ * For NUMFILE, we do not take a lock and call charge function ++ * for every file. We try to charge in batches, keeping local reserve on ++ * task. For experimental purposes, batch size is adaptive and depends ++ * on numfile barrier, number of processes, and the history of successes and ++ * failures of batch charges. ++ * ++ * Per-task fields have the following meaning ++ * file_precharged number of files charged to beancounter in advance, ++ * file_quant logarithm of batch size ++ * file_count counter of charge successes, to reduce batch size ++ * fluctuations. ++ */ ++static unsigned long ub_file_precharge(struct task_beancounter *task_bc, ++ struct user_beancounter *ub, unsigned long *kmemsize) ++{ ++ unsigned long n, kmem; ++ ++ n = 1UL << task_bc->file_quant; ++ if (ub->ub_parms[UB_NUMPROC].held > ++ (ub->ub_parms[UB_NUMFILE].barrier >> ++ task_bc->file_quant)) ++ goto nopre; ++ if (unlikely(__charge_beancounter_locked(ub, UB_NUMFILE, n, UB_HARD))) ++ goto nopre; ++ kmem = ub_file_kmemsize(n); ++ if (unlikely(__charge_beancounter_locked(ub, UB_KMEMSIZE, ++ kmem, UB_HARD))) ++ goto nopre_kmem; ++ ++ task_bc->file_precharged += n; ++ get_beancounter_batch(task_bc->task_ub, n); ++ task_bc->file_count++; ++ if (task_bc->file_quant < UB_FILE_MAXQUANT && ++ task_bc->file_count >= task_bc->file_quant) { ++ task_bc->file_quant++; ++ task_bc->file_count = 0; ++ } ++ *kmemsize = kmem; ++ return n; ++ ++nopre_kmem: ++ __uncharge_beancounter_locked(ub, UB_NUMFILE, n); ++nopre: ++ if (task_bc->file_quant > UB_FILE_MINQUANT) ++ task_bc->file_quant--; ++ task_bc->file_count = 0; ++ return 0; ++} ++ ++int ub_file_charge(struct file *f) ++{ ++ struct user_beancounter *ub, *pub; ++ struct task_beancounter *task_bc; ++ unsigned long file_nr, kmem; ++ unsigned long flags; ++ int err; ++ ++ task_bc = ¤t->task_bc; ++ ub = get_exec_ub(); ++ if (unlikely(ub != task_bc->task_ub)) ++ goto just_charge; ++ ++ if (likely(task_bc->file_precharged > 0)) { ++ /* ++ * files are put via RCU in 2.6.16 so during ++ * this decrement an IRQ can happen and called ++ * ub_files_uncharge() will mess file_precharged ++ * ++ * ub_task_uncharge() is called via RCU also so no ++ * protection is needed there ++ * ++ * Xemul ++ */ ++ ++ local_irq_save(flags); ++ task_bc->file_precharged--; ++ local_irq_restore(flags); ++ ++ f->f_ub = ub; ++ return 0; ++ } ++ ++ pub = top_beancounter(ub); ++ spin_lock_irqsave(&pub->ub_lock, flags); ++ file_nr = ub_file_precharge(task_bc, pub, &kmem); ++ if (unlikely(!file_nr)) ++ goto last_try; ++ spin_unlock(&pub->ub_lock); ++ task_bc->file_precharged--; ++ local_irq_restore(flags); ++ ++ charge_beancounter_notop(ub, UB_NUMFILE, file_nr); ++ charge_beancounter_notop(ub, UB_KMEMSIZE, kmem); ++ f->f_ub = ub; ++ return 0; ++ ++just_charge: ++ pub = top_beancounter(ub); ++ spin_lock_irqsave(&pub->ub_lock, flags); ++last_try: ++ kmem = ub_file_kmemsize(1); ++ err = __charge_beancounter_locked(pub, UB_NUMFILE, 1, UB_HARD); ++ if (likely(!err)) { ++ err = __charge_beancounter_locked(pub, UB_KMEMSIZE, ++ kmem, UB_HARD); ++ if (unlikely(err)) ++ __uncharge_beancounter_locked(pub, UB_NUMFILE, 1); ++ } ++ spin_unlock_irqrestore(&pub->ub_lock, flags); ++ if (likely(!err)) { ++ charge_beancounter_notop(ub, UB_NUMFILE, 1); ++ charge_beancounter_notop(ub, UB_KMEMSIZE, kmem); ++ f->f_ub = get_beancounter(ub); ++ } ++ return err; ++} ++ ++void ub_file_uncharge(struct file *f) ++{ ++ struct user_beancounter *ub, *pub; ++ struct task_beancounter *task_bc; ++ unsigned long nr; ++ ++ ub = f->f_ub; ++ task_bc = ¤t->task_bc; ++ if (likely(ub == task_bc->task_ub)) { ++ task_bc->file_precharged++; ++ pub = top_beancounter(ub); ++ if (ub_barrier_farnr(pub, UB_NUMFILE) && ++ ub_barrier_farsz(pub, UB_KMEMSIZE)) ++ return; ++ if (task_bc->file_precharged < (1UL << task_bc->file_quant)) ++ return; ++ nr = task_bc->file_precharged ++ - (1UL << (task_bc->file_quant - 1)); ++ task_bc->file_precharged -= nr; ++ __put_beancounter_batch(ub, nr); ++ uncharge_beancounter(ub, UB_NUMFILE, nr); ++ uncharge_beancounter(ub, UB_KMEMSIZE, ub_file_kmemsize(nr)); ++ } else { ++ uncharge_beancounter(ub, UB_NUMFILE, 1); ++ uncharge_beancounter(ub, UB_KMEMSIZE, ub_file_kmemsize(1)); ++ put_beancounter(ub); ++ } ++} ++ ++int ub_flock_charge(struct file_lock *fl, int hard) ++{ ++ struct user_beancounter *ub; ++ int err; ++ ++ /* No need to get_beancounter here since it's already got in slab */ ++ ub = slab_ub(fl); ++ if (ub == NULL) ++ return 0; ++ ++ err = charge_beancounter(ub, UB_NUMFLOCK, 1, hard ? UB_HARD : UB_SOFT); ++ if (!err) ++ fl->fl_charged = 1; ++ return err; ++} ++ ++void ub_flock_uncharge(struct file_lock *fl) ++{ ++ struct user_beancounter *ub; ++ ++ /* Ub will be put in slab */ ++ ub = slab_ub(fl); ++ if (ub == NULL || !fl->fl_charged) ++ return; ++ ++ uncharge_beancounter(ub, UB_NUMFLOCK, 1); ++ fl->fl_charged = 0; ++} ++ ++/* ++ * Signal handling ++ */ ++ ++static int do_ub_siginfo_charge(struct user_beancounter *ub, ++ unsigned long size) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ if (__charge_beancounter_locked(ub, UB_KMEMSIZE, size, UB_HARD)) ++ goto out_kmem; ++ ++ if (__charge_beancounter_locked(ub, UB_NUMSIGINFO, 1, UB_HARD)) ++ goto out_num; ++ ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ return 0; ++ ++out_num: ++ __uncharge_beancounter_locked(ub, UB_KMEMSIZE, size); ++out_kmem: ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ return -ENOMEM; ++} ++ ++static void do_ub_siginfo_uncharge(struct user_beancounter *ub, ++ unsigned long size) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ __uncharge_beancounter_locked(ub, UB_KMEMSIZE, size); ++ __uncharge_beancounter_locked(ub, UB_NUMSIGINFO, 1); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++int ub_siginfo_charge(struct sigqueue *sq, struct user_beancounter *ub) ++{ ++ unsigned long size; ++ struct user_beancounter *p, *q; ++ ++ size = CHARGE_SIZE(kmem_obj_objuse(sq)); ++ for (p = ub; p != NULL; p = p->parent) { ++ if (do_ub_siginfo_charge(p, size)) ++ goto unroll; ++ } ++ ++ sq->sig_ub = get_beancounter(ub); ++ return 0; ++ ++unroll: ++ for (q = ub; q != p; q = q->parent) ++ do_ub_siginfo_uncharge(q, size); ++ return -ENOMEM; ++} ++EXPORT_SYMBOL(ub_siginfo_charge); ++ ++void ub_siginfo_uncharge(struct sigqueue *sq) ++{ ++ unsigned long size; ++ struct user_beancounter *ub, *p; ++ ++ p = ub = sq->sig_ub; ++ sq->sig_ub = NULL; ++ size = CHARGE_SIZE(kmem_obj_objuse(sq)); ++ for (; ub != NULL; ub = ub->parent) ++ do_ub_siginfo_uncharge(ub, size); ++ put_beancounter(p); ++} ++ ++/* ++ * PTYs ++ */ ++ ++int ub_pty_charge(struct tty_struct *tty) ++{ ++ struct user_beancounter *ub; ++ int retval; ++ ++ ub = slab_ub(tty); ++ retval = 0; ++ if (ub && tty->driver->subtype == PTY_TYPE_MASTER && ++ !test_bit(TTY_CHARGED, &tty->flags)) { ++ retval = charge_beancounter(ub, UB_NUMPTY, 1, UB_HARD); ++ if (!retval) ++ set_bit(TTY_CHARGED, &tty->flags); ++ } ++ return retval; ++} ++ ++void ub_pty_uncharge(struct tty_struct *tty) ++{ ++ struct user_beancounter *ub; ++ ++ ub = slab_ub(tty); ++ if (ub && tty->driver->subtype == PTY_TYPE_MASTER && ++ test_bit(TTY_CHARGED, &tty->flags)) { ++ uncharge_beancounter(ub, UB_NUMPTY, 1); ++ clear_bit(TTY_CHARGED, &tty->flags); ++ } ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/net.c debian/binary-custom.d/openvz/src/kernel/bc/net.c +--- ./kernel/bc/net.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/net.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,1145 @@ ++/* ++ * linux/kernel/bc/net.c ++ * ++ * Copyright (C) 1998-2004 Andrey V. Savochkin ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * TODO: ++ * - sizeof(struct inode) charge ++ * = tcp_mem_schedule() feedback based on ub limits ++ * + measures so that one socket won't exhaust all send buffers, ++ * see bug in bugzilla ++ * = sk->socket check for NULL in snd_wakeups ++ * (tcp_write_space checks for NULL itself) ++ * + in tcp_close(), orphaned socket abortion should be based on ubc ++ * resources (same in tcp_out_of_resources) ++ * Beancounter should also have separate orphaned socket counter... ++ * + for rcv, in-order segment should be accepted ++ * if only barrier is exceeded ++ * = tcp_rmem_schedule() feedback based on ub limits ++ * - repair forward_alloc mechanism for receive buffers ++ * It's idea is that some buffer space is pre-charged so that receive fast ++ * path doesn't need to take spinlocks and do other heavy stuff ++ * + tcp_prune_queue actions based on ub limits ++ * + window adjustments depending on available buffers for receive ++ * - window adjustments depending on available buffers for send ++ * + race around usewreserv ++ * + avoid allocating new page for each tiny-gram, see letter from ANK ++ * + rename ub_sock_lock ++ * + sk->sleep wait queue probably can be used for all wakeups, and ++ * sk->ub_wait is unnecessary ++ * + for UNIX sockets, the current algorithm will lead to ++ * UB_UNIX_MINBUF-sized messages only for non-blocking case ++ * - charge for af_packet sockets ++ * + all datagram sockets should be charged to NUMUNIXSOCK ++ * - we do not charge for skb copies and clones staying in device queues ++ * + live-lock if number of sockets is big and buffer limits are small ++ * [diff-ubc-dbllim3] ++ * - check that multiple readers/writers on the same socket won't cause fatal ++ * consequences ++ * - check allocation/charge orders ++ * + There is potential problem with callback_lock. In *snd_wakeup we take ++ * beancounter first, in sock_def_error_report - callback_lock first. ++ * then beancounter. This is not a problem if callback_lock taken ++ * readonly, but anyway... ++ * - SKB_CHARGE_SIZE doesn't include the space wasted by slab allocator ++ * General kernel problems: ++ * - in tcp_sendmsg(), if allocation fails, non-blocking sockets with ASYNC ++ * notification won't get signals ++ * - datagram_poll looks racy ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++/* by some reason it is not used currently */ ++#define UB_SOCK_MAINTAIN_WMEMPRESSURE 0 ++ ++ ++/* Skb truesize definition. Bad place. Den */ ++ ++static inline int skb_chargesize_head(struct sk_buff *skb) ++{ ++ return skb_charge_size(skb_end_pointer(skb) - skb->head + ++ sizeof(struct skb_shared_info)); ++} ++ ++int skb_charge_fullsize(struct sk_buff *skb) ++{ ++ int chargesize; ++ struct sk_buff *skbfrag; ++ ++ chargesize = skb_chargesize_head(skb) + ++ PAGE_SIZE * skb_shinfo(skb)->nr_frags; ++ if (likely(skb_shinfo(skb)->frag_list == NULL)) ++ return chargesize; ++ for (skbfrag = skb_shinfo(skb)->frag_list; ++ skbfrag != NULL; ++ skbfrag = skbfrag->next) { ++ chargesize += skb_charge_fullsize(skbfrag); ++ } ++ return chargesize; ++} ++EXPORT_SYMBOL(skb_charge_fullsize); ++ ++static int ub_sock_makewreserv_locked(struct sock *sk, ++ int bufid, unsigned long size); ++ ++int __ub_too_many_orphans(struct sock *sk, int count) ++{ ++ struct user_beancounter *ub; ++ ++ if (sock_has_ubc(sk)) { ++ ub = top_beancounter(sock_bc(sk)->ub); ++ if (count >= ub->ub_parms[UB_NUMTCPSOCK].barrier >> 2) ++ return 1; ++ } ++ return 0; ++} ++ ++/* ++ * Queueing ++ */ ++ ++static void ub_sock_snd_wakeup(struct user_beancounter *ub) ++{ ++ struct list_head *p; ++ struct sock *sk; ++ struct sock_beancounter *skbc; ++ struct socket *sock; ++ unsigned long added; ++ ++ while (!list_empty(&ub->ub_other_sk_list)) { ++ p = ub->ub_other_sk_list.next; ++ skbc = list_entry(p, struct sock_beancounter, ub_sock_list); ++ sk = skbc_sock(skbc); ++ ++ added = 0; ++ sock = sk->sk_socket; ++ if (sock == NULL) { ++ /* sk being destroyed */ ++ list_del_init(&skbc->ub_sock_list); ++ continue; ++ } ++ ++ ub_debug(UBD_NET_SLEEP, ++ "Checking queue, waiting %lu, reserv %lu\n", ++ skbc->ub_waitspc, skbc->poll_reserv); ++ added = -skbc->poll_reserv; ++ if (ub_sock_makewreserv_locked(sk, UB_OTHERSOCKBUF, ++ skbc->ub_waitspc)) ++ break; ++ added += skbc->poll_reserv; ++ ++ list_del_init(&skbc->ub_sock_list); ++ ++ /* ++ * See comments in ub_tcp_snd_wakeup. ++ * Locking note: both unix_write_space and ++ * sock_def_write_space take callback_lock themselves. ++ * We take it here just to be on the safe side and to ++ * act the same way as ub_tcp_snd_wakeup does. ++ */ ++ sock_hold(sk); ++ read_lock(&sk->sk_callback_lock); ++ spin_unlock(&ub->ub_lock); ++ ++ sk->sk_write_space(sk); ++ read_unlock(&sk->sk_callback_lock); ++ ++ if (skbc->ub != ub && added) ++ charge_beancounter_notop(skbc->ub, ++ UB_OTHERSOCKBUF, added); ++ sock_put(sk); ++ ++ spin_lock(&ub->ub_lock); ++ } ++} ++ ++static void ub_tcp_snd_wakeup(struct user_beancounter *ub) ++{ ++ struct list_head *p; ++ struct sock *sk; ++ struct sock_beancounter *skbc; ++ struct socket *sock; ++ unsigned long added; ++ ++ while (!list_empty(&ub->ub_tcp_sk_list)) { ++ p = ub->ub_tcp_sk_list.next; ++ skbc = list_entry(p, struct sock_beancounter, ub_sock_list); ++ sk = skbc_sock(skbc); ++ ++ added = 0; ++ sock = sk->sk_socket; ++ if (sock == NULL) { ++ /* sk being destroyed */ ++ list_del_init(&skbc->ub_sock_list); ++ continue; ++ } ++ ++ ub_debug(UBD_NET_SLEEP, ++ "Checking queue, waiting %lu, reserv %lu\n", ++ skbc->ub_waitspc, skbc->poll_reserv); ++ added = -skbc->poll_reserv; ++ if (ub_sock_makewreserv_locked(sk, UB_TCPSNDBUF, ++ skbc->ub_waitspc)) ++ break; ++ added += skbc->poll_reserv; ++ ++ list_del_init(&skbc->ub_sock_list); ++ ++ /* ++ * Send async notifications and wake up. ++ * Locking note: we get callback_lock here because ++ * tcp_write_space is over-optimistic about calling context ++ * (socket lock is presumed). So we get the lock here although ++ * it belongs to the callback. ++ */ ++ sock_hold(sk); ++ read_lock(&sk->sk_callback_lock); ++ spin_unlock(&ub->ub_lock); ++ ++ sk->sk_write_space(sk); ++ read_unlock(&sk->sk_callback_lock); ++ ++ if (skbc->ub != ub && added) ++ charge_beancounter_notop(skbc->ub, UB_TCPSNDBUF, added); ++ sock_put(sk); ++ ++ spin_lock(&ub->ub_lock); ++ } ++} ++ ++int ub_sock_snd_queue_add(struct sock *sk, int res, unsigned long size) ++{ ++ unsigned long flags; ++ struct sock_beancounter *skbc; ++ struct user_beancounter *ub; ++ unsigned long added_reserv; ++ ++ if (!sock_has_ubc(sk)) ++ return 0; ++ ++ skbc = sock_bc(sk); ++ ub = top_beancounter(skbc->ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ub_debug(UBD_NET_SLEEP, "attempt to charge for %lu\n", size); ++ added_reserv = -skbc->poll_reserv; ++ if (!ub_sock_makewreserv_locked(sk, res, size)) { ++ /* ++ * It looks a bit hackish, but it is compatible with both ++ * wait_for_xx_ubspace and poll. ++ * This __set_current_state is equivalent to a wakeup event ++ * right after spin_unlock_irqrestore. ++ */ ++ __set_current_state(TASK_RUNNING); ++ added_reserv += skbc->poll_reserv; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ if (added_reserv) ++ charge_beancounter_notop(skbc->ub, res, added_reserv); ++ return 0; ++ } ++ ++ ub_debug(UBD_NET_SLEEP, "Adding sk to queue\n"); ++ skbc->ub_waitspc = size; ++ if (!list_empty(&skbc->ub_sock_list)) { ++ ub_debug(UBD_NET_SOCKET, ++ "re-adding socket to beancounter %p.\n", ub); ++ goto out; ++ } ++ ++ switch (res) { ++ case UB_TCPSNDBUF: ++ list_add_tail(&skbc->ub_sock_list, ++ &ub->ub_tcp_sk_list); ++ break; ++ case UB_OTHERSOCKBUF: ++ list_add_tail(&skbc->ub_sock_list, ++ &ub->ub_other_sk_list); ++ break; ++ default: ++ BUG(); ++ } ++out: ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ return -ENOMEM; ++} ++ ++EXPORT_SYMBOL(ub_sock_snd_queue_add); ++ ++long ub_sock_wait_for_space(struct sock *sk, long timeo, unsigned long size) ++{ ++ DECLARE_WAITQUEUE(wait, current); ++ ++ add_wait_queue(sk->sk_sleep, &wait); ++ for (;;) { ++ if (signal_pending(current)) ++ break; ++ set_current_state(TASK_INTERRUPTIBLE); ++ if (!ub_sock_make_wreserv(sk, UB_OTHERSOCKBUF, size)) ++ break; ++ ++ if (sk->sk_shutdown & SEND_SHUTDOWN) ++ break; ++ if (sk->sk_err) ++ break; ++ ub_sock_snd_queue_add(sk, UB_OTHERSOCKBUF, size); ++ timeo = schedule_timeout(timeo); ++ } ++ __set_current_state(TASK_RUNNING); ++ remove_wait_queue(sk->sk_sleep, &wait); ++ return timeo; ++} ++ ++void ub_sock_sndqueuedel(struct sock *sk) ++{ ++ struct user_beancounter *ub; ++ struct sock_beancounter *skbc; ++ unsigned long flags; ++ ++ if (!sock_has_ubc(sk)) ++ return; ++ skbc = sock_bc(sk); ++ ++ /* race with write_space callback of other socket */ ++ ub = top_beancounter(skbc->ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ list_del_init(&skbc->ub_sock_list); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++/* ++ * Helpers ++ */ ++ ++static inline void __ub_skb_set_charge(struct sk_buff *skb, struct sock *sk, ++ unsigned long size, int resource) ++{ ++ WARN_ON_ONCE(skb_bc(skb)->ub != NULL); ++ ++ skb_bc(skb)->ub = sock_bc(sk)->ub; ++ skb_bc(skb)->charged = size; ++ skb_bc(skb)->resource = resource; ++} ++ ++void ub_skb_set_charge(struct sk_buff *skb, struct sock *sk, ++ unsigned long size, int resource) ++{ ++ if (!sock_has_ubc(sk)) ++ return; ++ ++ if (sock_bc(sk)->ub == NULL) ++ BUG(); ++ ++ __ub_skb_set_charge(skb, sk, size, resource); ++ ++ /* Ugly. Ugly. Skb in sk writequeue can live without ref to sk */ ++ if (skb->sk == NULL) ++ skb->sk = sk; ++} ++ ++EXPORT_SYMBOL(ub_skb_set_charge); ++ ++static inline void ub_skb_set_uncharge(struct sk_buff *skb) ++{ ++ skb_bc(skb)->ub = NULL; ++ skb_bc(skb)->charged = 0; ++ skb_bc(skb)->resource = 0; ++} ++ ++static void ub_update_rmem_thres(struct sock_beancounter *skub) ++{ ++ struct user_beancounter *ub; ++ ++ if (skub && skub->ub) { ++ ub = top_beancounter(skub->ub); ++ ub->ub_rmem_thres = ub->ub_parms[UB_TCPRCVBUF].barrier / ++ (ub->ub_parms[UB_NUMTCPSOCK].held + 1); ++ } ++} ++ ++static inline void ub_sock_wcharge_dec(struct sock *sk, ++ unsigned long chargesize) ++{ ++ /* The check sk->sk_family != PF_NETLINK is made as the skb is ++ * queued to the kernel end of socket while changed to the user one. ++ * Den */ ++ if (unlikely(sock_bc(sk)->ub_wcharged) && sk->sk_family != PF_NETLINK) { ++ if (sock_bc(sk)->ub_wcharged > chargesize) ++ sock_bc(sk)->ub_wcharged -= chargesize; ++ else ++ sock_bc(sk)->ub_wcharged = 0; ++ } ++} ++ ++/* ++ * Charge socket number ++ */ ++ ++static inline void sk_alloc_beancounter(struct sock *sk) ++{ ++ struct sock_beancounter *skbc; ++ ++ skbc = sock_bc(sk); ++ memset(skbc, 0, sizeof(struct sock_beancounter)); ++} ++ ++static inline void sk_free_beancounter(struct sock *sk) ++{ ++} ++ ++static int __sock_charge(struct sock *sk, int res) ++{ ++ struct sock_beancounter *skbc; ++ struct user_beancounter *cub, *ub; ++ unsigned long added_reserv, added_forw; ++ unsigned long flags; ++ ++ cub = get_exec_ub(); ++ if (unlikely(cub == NULL)) ++ return 0; ++ ++ sk_alloc_beancounter(sk); ++ skbc = sock_bc(sk); ++ INIT_LIST_HEAD(&skbc->ub_sock_list); ++ ++ ub = top_beancounter(cub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ if (unlikely(__charge_beancounter_locked(ub, res, 1, UB_HARD) < 0)) ++ goto out_limit; ++ ++ added_reserv = 0; ++ added_forw = 0; ++ if (res == UB_NUMTCPSOCK) { ++ added_reserv = skb_charge_size(MAX_TCP_HEADER + ++ 1500 - sizeof(struct iphdr) - ++ sizeof(struct tcphdr)); ++ added_reserv *= 4; ++ ub->ub_parms[UB_TCPSNDBUF].held += added_reserv; ++ if (!ub_barrier_farsz(ub, UB_TCPSNDBUF)) { ++ ub->ub_parms[UB_TCPSNDBUF].held -= added_reserv; ++ added_reserv = 0; ++ } ++ skbc->poll_reserv = added_reserv; ++ ++ added_forw = SK_STREAM_MEM_QUANTUM * 4; ++ ub->ub_parms[UB_TCPRCVBUF].held += added_forw; ++ if (!ub_barrier_farsz(ub, UB_TCPRCVBUF)) { ++ ub->ub_parms[UB_TCPRCVBUF].held -= added_forw; ++ added_forw = 0; ++ } ++ skbc->forw_space = added_forw; ++ } ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ ++ charge_beancounter_notop(cub, res, 1); ++ if (added_reserv) ++ charge_beancounter_notop(cub, UB_TCPSNDBUF, added_reserv); ++ if (added_forw) ++ charge_beancounter_notop(cub, UB_TCPRCVBUF, added_forw); ++ ++ skbc->ub = get_beancounter(cub); ++ return 0; ++ ++out_limit: ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ sk_free_beancounter(sk); ++ return -ENOMEM; ++} ++ ++int ub_tcp_sock_charge(struct sock *sk) ++{ ++ int ret; ++ ++ ret = __sock_charge(sk, UB_NUMTCPSOCK); ++ ub_update_rmem_thres(sock_bc(sk)); ++ ++ return ret; ++} ++ ++int ub_other_sock_charge(struct sock *sk) ++{ ++ return __sock_charge(sk, UB_NUMOTHERSOCK); ++} ++ ++EXPORT_SYMBOL(ub_other_sock_charge); ++ ++int ub_sock_charge(struct sock *sk, int family, int type) ++{ ++ return (IS_TCP_SOCK(family, type) ? ++ ub_tcp_sock_charge(sk) : ub_other_sock_charge(sk)); ++} ++ ++EXPORT_SYMBOL(ub_sock_charge); ++ ++/* ++ * Uncharge socket number ++ */ ++ ++void ub_sock_uncharge(struct sock *sk) ++{ ++ int is_tcp_sock; ++ unsigned long flags; ++ struct sock_beancounter *skbc; ++ struct user_beancounter *ub; ++ unsigned long reserv, forw; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return; ++ ++ is_tcp_sock = IS_TCP_SOCK(sk->sk_family, sk->sk_type); ++ skbc = sock_bc(sk); ++ ub_debug(UBD_NET_SOCKET, "Calling ub_sock_uncharge on %p\n", sk); ++ ++ ub = top_beancounter(skbc->ub); ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ if (!list_empty(&skbc->ub_sock_list)) { ++ ub_debug(UBD_NET_SOCKET, ++ "ub_sock_uncharge: removing from ub(%p) queue.\n", ++ skbc); ++ list_del_init(&skbc->ub_sock_list); ++ } ++ ++ reserv = skbc->poll_reserv; ++ forw = skbc->forw_space; ++ __uncharge_beancounter_locked(ub, ++ (is_tcp_sock ? UB_TCPSNDBUF : UB_OTHERSOCKBUF), ++ reserv); ++ if (forw) ++ __uncharge_beancounter_locked(ub, ++ (is_tcp_sock ? UB_TCPRCVBUF : UB_DGRAMRCVBUF), ++ forw); ++ __uncharge_beancounter_locked(ub, ++ (is_tcp_sock ? UB_NUMTCPSOCK : UB_NUMOTHERSOCK), 1); ++ ++ ub_sock_wcharge_dec(sk, reserv); ++ if (unlikely(skbc->ub_wcharged)) ++ printk(KERN_WARNING ++ "ub_sock_uncharge: wch=%lu for ub %p (%d).\n", ++ skbc->ub_wcharged, skbc->ub, skbc->ub->ub_uid); ++ skbc->poll_reserv = 0; ++ skbc->forw_space = 0; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ ++ uncharge_beancounter_notop(skbc->ub, ++ (is_tcp_sock ? UB_TCPSNDBUF : UB_OTHERSOCKBUF), ++ reserv); ++ if (forw) ++ uncharge_beancounter_notop(skbc->ub, ++ (is_tcp_sock ? UB_TCPRCVBUF : UB_DGRAMRCVBUF), ++ forw); ++ uncharge_beancounter_notop(skbc->ub, ++ (is_tcp_sock ? UB_NUMTCPSOCK : UB_NUMOTHERSOCK), 1); ++ ++ put_beancounter(skbc->ub); ++ sk_free_beancounter(sk); ++} ++ ++/* ++ * Special case for netlink_dump - (un)charges precalculated size ++ */ ++ ++int ub_nlrcvbuf_charge(struct sk_buff *skb, struct sock *sk) ++{ ++ int ret; ++ unsigned long chargesize; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return 0; ++ ++ chargesize = skb_charge_fullsize(skb); ++ ret = charge_beancounter(sock_bc(sk)->ub, ++ UB_DGRAMRCVBUF, chargesize, UB_HARD); ++ if (ret < 0) ++ return ret; ++ ub_skb_set_charge(skb, sk, chargesize, UB_DGRAMRCVBUF); ++ return ret; ++} ++ ++/* ++ * Poll reserve accounting ++ * ++ * This is the core of socket buffer management (along with queueing/wakeup ++ * functions. The rest of buffer accounting either call these functions, or ++ * repeat parts of their logic for some simpler cases. ++ */ ++ ++static int ub_sock_makewreserv_locked(struct sock *sk, ++ int bufid, unsigned long size) ++{ ++ unsigned long wcharge_added; ++ struct sock_beancounter *skbc; ++ struct user_beancounter *ub; ++ ++ skbc = sock_bc(sk); ++ if (skbc->poll_reserv >= size) /* no work to be done */ ++ goto out; ++ ++ ub = top_beancounter(skbc->ub); ++ ub->ub_parms[bufid].held += size - skbc->poll_reserv; ++ ++ wcharge_added = 0; ++ /* ++ * Logic: ++ * 1) when used memory hits barrier, we set wmem_pressure; ++ * wmem_pressure is reset under barrier/2; ++ * between barrier/2 and barrier we limit per-socket buffer growth; ++ * 2) each socket is guaranteed to get (limit-barrier)/maxsockets ++ * calculated on the base of memory eaten after the barrier is hit ++ */ ++ skbc = sock_bc(sk); ++#if UB_SOCK_MAINTAIN_WMEMPRESSURE ++ if (!ub_hfbarrier_hit(ub, bufid)) { ++ if (ub->ub_wmem_pressure) ++ ub_debug(UBD_NET_SEND, "makewres: pressure -> 0 " ++ "sk %p sz %lu pr %lu hd %lu wc %lu sb %d.\n", ++ sk, size, skbc->poll_reserv, ++ ub->ub_parms[bufid].held, ++ skbc->ub_wcharged, sk->sk_sndbuf); ++ ub->ub_wmem_pressure = 0; ++ } ++#endif ++ if (ub_barrier_hit(ub, bufid)) { ++#if UB_SOCK_MAINTAIN_WMEMPRESSURE ++ if (!ub->ub_wmem_pressure) ++ ub_debug(UBD_NET_SEND, "makewres: pressure -> 1 " ++ "sk %p sz %lu pr %lu hd %lu wc %lu sb %d.\n", ++ sk, size, skbc->poll_reserv, ++ ub->ub_parms[bufid].held, ++ skbc->ub_wcharged, sk->sk_sndbuf); ++ ub->ub_wmem_pressure = 1; ++#endif ++ if (sk->sk_family == PF_NETLINK) ++ goto unroll; ++ wcharge_added = size - skbc->poll_reserv; ++ skbc->ub_wcharged += wcharge_added; ++ if (skbc->ub_wcharged * ub->ub_parms[bid2sid(bufid)].limit + ++ ub->ub_parms[bufid].barrier > ++ ub->ub_parms[bufid].limit) ++ goto unroll_wch; ++ } ++ if (ub->ub_parms[bufid].held > ub->ub_parms[bufid].limit) ++ goto unroll; ++ ++ ub_adjust_maxheld(ub, bufid); ++ skbc->poll_reserv = size; ++out: ++ return 0; ++ ++unroll_wch: ++ skbc->ub_wcharged -= wcharge_added; ++unroll: ++ ub_debug(UBD_NET_SEND, ++ "makewres: deny " ++ "sk %p sz %lu pr %lu hd %lu wc %lu sb %d.\n", ++ sk, size, skbc->poll_reserv, ub->ub_parms[bufid].held, ++ skbc->ub_wcharged, sk->sk_sndbuf); ++ ub->ub_parms[bufid].failcnt++; ++ ub->ub_parms[bufid].held -= size - skbc->poll_reserv; ++ ++ if (sk->sk_socket != NULL) { ++ set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); ++ set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); ++ } ++ return -ENOMEM; ++} ++ ++int ub_sock_make_wreserv(struct sock *sk, int bufid, unsigned long size) ++{ ++ struct sock_beancounter *skbc; ++ struct user_beancounter *ub; ++ unsigned long flags; ++ unsigned long added_reserv; ++ int err; ++ ++ skbc = sock_bc(sk); ++ ++ /* ++ * This function provides that there is sufficient reserve upon return ++ * only if sk has only one user. We can check poll_reserv without ++ * serialization and avoid locking if the reserve already exists. ++ */ ++ if (unlikely(!sock_has_ubc(sk)) || likely(skbc->poll_reserv >= size)) ++ return 0; ++ ++ ub = top_beancounter(skbc->ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ added_reserv = -skbc->poll_reserv; ++ err = ub_sock_makewreserv_locked(sk, bufid, size); ++ added_reserv += skbc->poll_reserv; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ ++ if (added_reserv) ++ charge_beancounter_notop(skbc->ub, bufid, added_reserv); ++ ++ return err; ++} ++ ++EXPORT_SYMBOL(ub_sock_make_wreserv); ++ ++int ub_sock_get_wreserv(struct sock *sk, int bufid, unsigned long size) ++{ ++ struct sock_beancounter *skbc; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return 0; ++ ++ /* optimize for the case if socket has sufficient reserve */ ++ ub_sock_make_wreserv(sk, bufid, size); ++ skbc = sock_bc(sk); ++ if (likely(skbc->poll_reserv >= size)) { ++ skbc->poll_reserv -= size; ++ return 0; ++ } ++ return -ENOMEM; ++} ++ ++EXPORT_SYMBOL(ub_sock_get_wreserv); ++ ++static void ub_sock_do_ret_wreserv(struct sock *sk, int bufid, ++ unsigned long size, unsigned long ressize) ++{ ++ struct sock_beancounter *skbc; ++ struct user_beancounter *ub; ++ unsigned long extra; ++ unsigned long flags; ++ ++ skbc = sock_bc(sk); ++ ub = top_beancounter(skbc->ub); ++ ++ extra = 0; ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ skbc->poll_reserv += size; ++ if (skbc->poll_reserv > ressize) { ++ extra = skbc->poll_reserv - ressize; ++ ub_sock_wcharge_dec(sk, extra); ++ skbc->poll_reserv = ressize; ++ ++ __uncharge_beancounter_locked(ub, bufid, extra); ++ if (bufid == UB_TCPSNDBUF) ++ ub_tcp_snd_wakeup(ub); ++ else ++ ub_sock_snd_wakeup(ub); ++ } ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ ++ if (extra) ++ uncharge_beancounter_notop(skbc->ub, bufid, extra); ++} ++ ++void ub_sock_ret_wreserv(struct sock *sk, int bufid, ++ unsigned long size, unsigned long ressize) ++{ ++ struct sock_beancounter *skbc; ++ struct user_beancounter *ub; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return; ++ ++ skbc = sock_bc(sk); ++ ub = top_beancounter(skbc->ub); ++ /* check if the reserve can be kept */ ++ if (ub_barrier_farsz(ub, bufid)) { ++ skbc->poll_reserv += size; ++ return; ++ } ++ ub_sock_do_ret_wreserv(sk, bufid, size, ressize); ++} ++ ++/* ++ * UB_DGRAMRCVBUF ++ */ ++ ++int ub_sockrcvbuf_charge(struct sock *sk, struct sk_buff *skb) ++{ ++ unsigned long chargesize; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return 0; ++ ++ chargesize = skb_charge_fullsize(skb); ++ if (charge_beancounter(sock_bc(sk)->ub, UB_DGRAMRCVBUF, ++ chargesize, UB_HARD)) ++ return -ENOMEM; ++ ++ ub_skb_set_charge(skb, sk, chargesize, UB_DGRAMRCVBUF); ++ return 0; ++} ++ ++EXPORT_SYMBOL(ub_sockrcvbuf_charge); ++ ++static void ub_sockrcvbuf_uncharge(struct sk_buff *skb) ++{ ++ uncharge_beancounter(skb_bc(skb)->ub, UB_DGRAMRCVBUF, ++ skb_bc(skb)->charged); ++ ub_skb_set_uncharge(skb); ++} ++ ++/* ++ * UB_TCPRCVBUF ++ */ ++ ++int ub_sock_tcp_chargerecv(struct sock *sk, struct sk_buff *skb, ++ enum ub_severity strict) ++{ ++ int retval; ++ unsigned long flags; ++ struct user_beancounter *ub; ++ struct sock_beancounter *skbc; ++ unsigned long chargesize; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return 0; ++ skbc = sock_bc(sk); ++ ++ chargesize = skb_charge_fullsize(skb); ++ if (likely(skbc->forw_space >= chargesize)) { ++ skbc->forw_space -= chargesize; ++ __ub_skb_set_charge(skb, sk, chargesize, UB_TCPRCVBUF); ++ return 0; ++ } ++ ++ /* ++ * Memory pressure reactions: ++ * 1) set UB_RMEM_KEEP (clearing UB_RMEM_EXPAND) ++ * 2) set UB_RMEM_SHRINK and tcp_clamp_window() ++ * tcp_collapse_queues() if rmem_alloc > rcvbuf ++ * 3) drop OFO, tcp_purge_ofo() ++ * 4) drop all. ++ * Currently, we do #2 and #3 at once (which means that current ++ * collapsing of OFO queue in tcp_collapse_queues() is a waste of time, ++ * for example...) ++ * On memory pressure we jump from #0 to #3, and when the pressure ++ * subsides, to #1. ++ */ ++ retval = 0; ++ ub = top_beancounter(sock_bc(sk)->ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ub->ub_parms[UB_TCPRCVBUF].held += chargesize; ++ if (ub->ub_parms[UB_TCPRCVBUF].held > ++ ub->ub_parms[UB_TCPRCVBUF].barrier && ++ strict != UB_FORCE) ++ goto excess; ++ ub_adjust_maxheld(ub, UB_TCPRCVBUF); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ ++out: ++ if (retval == 0) { ++ charge_beancounter_notop(sock_bc(sk)->ub, UB_TCPRCVBUF, ++ chargesize); ++ ub_skb_set_charge(skb, sk, chargesize, UB_TCPRCVBUF); ++ } ++ return retval; ++ ++excess: ++ ub->ub_rmem_pressure = UB_RMEM_SHRINK; ++ if (strict == UB_HARD) ++ retval = -ENOMEM; ++ if (ub->ub_parms[UB_TCPRCVBUF].held > ub->ub_parms[UB_TCPRCVBUF].limit) ++ retval = -ENOMEM; ++ /* ++ * We try to leave numsock*maxadvmss as a reserve for sockets not ++ * queueing any data yet (if the difference between the barrier and the ++ * limit is enough for this reserve). ++ */ ++ if (ub->ub_parms[UB_TCPRCVBUF].held + ++ ub->ub_parms[UB_NUMTCPSOCK].limit * ub->ub_maxadvmss ++ > ub->ub_parms[UB_TCPRCVBUF].limit && ++ atomic_read(&sk->sk_rmem_alloc)) ++ retval = -ENOMEM; ++ if (retval) { ++ ub->ub_parms[UB_TCPRCVBUF].held -= chargesize; ++ ub->ub_parms[UB_TCPRCVBUF].failcnt++; ++ } ++ ub_adjust_maxheld(ub, UB_TCPRCVBUF); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ goto out; ++} ++EXPORT_SYMBOL(ub_sock_tcp_chargerecv); ++ ++static void ub_tcprcvbuf_uncharge(struct sk_buff *skb) ++{ ++ unsigned long flags; ++ unsigned long held, bar; ++ int prev_pres; ++ struct user_beancounter *ub; ++ ++ ub = top_beancounter(skb_bc(skb)->ub); ++ if (ub_barrier_farsz(ub, UB_TCPRCVBUF)) { ++ sock_bc(skb->sk)->forw_space += skb_bc(skb)->charged; ++ ub_skb_set_uncharge(skb); ++ return; ++ } ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ if (ub->ub_parms[UB_TCPRCVBUF].held < skb_bc(skb)->charged) { ++ printk(KERN_ERR "Uncharging %d for tcprcvbuf of %p with %lu\n", ++ skb_bc(skb)->charged, ++ ub, ub->ub_parms[UB_TCPRCVBUF].held); ++ /* ass-saving bung */ ++ skb_bc(skb)->charged = ub->ub_parms[UB_TCPRCVBUF].held; ++ } ++ ub->ub_parms[UB_TCPRCVBUF].held -= skb_bc(skb)->charged; ++ held = ub->ub_parms[UB_TCPRCVBUF].held; ++ bar = ub->ub_parms[UB_TCPRCVBUF].barrier; ++ prev_pres = ub->ub_rmem_pressure; ++ if (held <= bar - (bar >> 2)) ++ ub->ub_rmem_pressure = UB_RMEM_EXPAND; ++ else if (held <= bar) ++ ub->ub_rmem_pressure = UB_RMEM_KEEP; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ ++ uncharge_beancounter_notop(skb_bc(skb)->ub, UB_TCPRCVBUF, ++ skb_bc(skb)->charged); ++ ub_skb_set_uncharge(skb); ++} ++ ++ ++/* ++ * UB_OTHERSOCKBUF and UB_TCPSNDBUF ++ */ ++ ++static void ub_socksndbuf_uncharge(struct sk_buff *skb) ++{ ++ unsigned long flags; ++ struct user_beancounter *ub, *cub; ++ unsigned long chargesize; ++ ++ cub = skb_bc(skb)->ub; ++ ub = top_beancounter(cub); ++ chargesize = skb_bc(skb)->charged; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ __uncharge_beancounter_locked(ub, UB_OTHERSOCKBUF, chargesize); ++ if (skb->sk != NULL && sock_has_ubc(skb->sk)) ++ ub_sock_wcharge_dec(skb->sk, chargesize); ++ ub_sock_snd_wakeup(ub); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ ++ uncharge_beancounter_notop(cub, UB_OTHERSOCKBUF, chargesize); ++ ub_skb_set_uncharge(skb); ++} ++ ++/* expected to be called under socket lock */ ++static void ub_tcpsndbuf_uncharge(struct sk_buff *skb) ++{ ++ /* ++ * ub_sock_ret_wreserv call is abused here, we just want to uncharge ++ * skb size. However, to reduce duplication of the code doing ++ * ub_hfbarrier_hit check, ub_wcharged reduction, and wakeup we call ++ * a function that already does all of this. 2006/04/27 SAW ++ */ ++ ub_sock_ret_wreserv(skb->sk, UB_TCPSNDBUF, skb_bc(skb)->charged, ++ sock_bc(skb->sk)->poll_reserv); ++ ub_skb_set_uncharge(skb); ++} ++ ++void ub_skb_uncharge(struct sk_buff *skb) ++{ ++ switch (skb_bc(skb)->resource) { ++ case UB_TCPSNDBUF: ++ ub_tcpsndbuf_uncharge(skb); ++ break; ++ case UB_TCPRCVBUF: ++ ub_tcprcvbuf_uncharge(skb); ++ break; ++ case UB_DGRAMRCVBUF: ++ ub_sockrcvbuf_uncharge(skb); ++ break; ++ case UB_OTHERSOCKBUF: ++ ub_socksndbuf_uncharge(skb); ++ break; ++ } ++} ++ ++EXPORT_SYMBOL(ub_skb_uncharge); /* due to skb_orphan()/conntracks */ ++ ++/* ++ * Other sock reserve managment ++ */ ++ ++int ub_sock_getwres_other(struct sock *sk, unsigned long size) ++{ ++ struct sock_beancounter *skbc; ++ struct user_beancounter *ub; ++ unsigned long flags; ++ unsigned long added_reserv; ++ int err; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return 0; ++ ++ /* ++ * Nothing except beancounter lock protects skbc->poll_reserv. ++ * So, take the lock and do the job. ++ * Dances with added_reserv repeat ub_sock_make_wreserv. ++ */ ++ skbc = sock_bc(sk); ++ ub = top_beancounter(skbc->ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ added_reserv = -skbc->poll_reserv; ++ err = ub_sock_makewreserv_locked(sk, UB_OTHERSOCKBUF, size); ++ added_reserv += skbc->poll_reserv; ++ if (!err) ++ skbc->poll_reserv -= size; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ ++ if (added_reserv) ++ charge_beancounter_notop(skbc->ub, UB_OTHERSOCKBUF, added_reserv); ++ ++ return err; ++} ++EXPORT_SYMBOL(ub_sock_getwres_other); ++ ++void ub_sock_retwres_other(struct sock *sk, ++ unsigned long size, unsigned long ressize) ++{ ++ if (unlikely(!sock_has_ubc(sk))) ++ return; ++ ++ ub_sock_do_ret_wreserv(sk, UB_OTHERSOCKBUF, size, ressize); ++} ++ ++/* ++ * TCP send buffers accouting. Paged part ++ */ ++ ++int ub_sock_tcp_chargepage(struct sock *sk) ++{ ++ struct sock_beancounter *skbc; ++ unsigned long extra; ++ int err; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return 0; ++ ++ skbc = sock_bc(sk); ++ ub_sock_make_wreserv(sk, UB_TCPSNDBUF, PAGE_SIZE); ++ if (likely(skbc->poll_reserv >= PAGE_SIZE)) { ++ skbc->poll_reserv -= PAGE_SIZE; ++ return 0; ++ } ++ ++ /* ++ * Ok, full page is not available. ++ * However, this function must succeed if poll previously indicated ++ * that write is possible. We better make a forced charge here ++ * than reserve a whole page in poll. ++ */ ++ err = ub_sock_make_wreserv(sk, UB_TCPSNDBUF, SOCK_MIN_UBCSPACE); ++ if (unlikely(err < 0)) ++ goto out; ++ if (skbc->poll_reserv < PAGE_SIZE) { ++ extra = PAGE_SIZE - skbc->poll_reserv; ++ err = charge_beancounter(skbc->ub, UB_TCPSNDBUF, extra, ++ UB_FORCE); ++ if (err < 0) ++ goto out; ++ skbc->poll_reserv += extra; ++ } ++ skbc->poll_reserv -= PAGE_SIZE; ++ return 0; ++ ++out: ++ return err; ++} ++ ++void ub_sock_tcp_detachpage(struct sock *sk) ++{ ++ struct sk_buff *skb; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return; ++ ++ /* The page is just detached from socket. The last skb in queue ++ with paged part holds referrence to it */ ++ skb = skb_peek_tail(&sk->sk_write_queue); ++ if (skb == NULL) { ++ /* If the queue is empty - all data is sent and page is about ++ to be freed */ ++ ub_sock_ret_wreserv(sk, UB_TCPSNDBUF, PAGE_SIZE, ++ sock_bc(sk)->poll_reserv); ++ } else { ++ /* Last skb is a good aproximation for a last skb with ++ paged part */ ++ skb_bc(skb)->charged += PAGE_SIZE; ++ } ++} ++ ++/* ++ * TCPSNDBUF charge functions below are called in the following cases: ++ * - sending of SYN, SYN-ACK, FIN, the latter charge is forced by ++ * some technical reasons in TCP code; ++ * - fragmentation of TCP packets. ++ * These functions are allowed but not required to use poll_reserv. ++ * Originally, these functions didn't do that, since it didn't make ++ * any sense. Now, since poll_reserv now has a function of general reserve, ++ * they use it. ++ */ ++int ub_sock_tcp_chargesend(struct sock *sk, struct sk_buff *skb, ++ enum ub_severity strict) ++{ ++ int ret; ++ unsigned long chargesize; ++ struct sock_beancounter *skbc; ++ struct user_beancounter *ub; ++ unsigned long flags; ++ ++ if (unlikely(!sock_has_ubc(sk))) ++ return 0; ++ ++ skbc = sock_bc(sk); ++ chargesize = skb_charge_fullsize(skb); ++ if (likely(skbc->poll_reserv >= chargesize)) { ++ skbc->poll_reserv -= chargesize; ++ __ub_skb_set_charge(skb, sk, chargesize, UB_TCPSNDBUF); ++ /* XXX hack, see ub_skb_set_charge */ ++ skb->sk = sk; ++ return 0; ++ } ++ ++ ub = top_beancounter(skbc->ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ret = __charge_beancounter_locked(ub, UB_TCPSNDBUF, ++ chargesize, strict); ++ /* ++ * Note: this check is not equivalent of the corresponding check ++ * in makewreserv. It's similar in spirit, but an equivalent check ++ * would be too long and complicated here. ++ */ ++ if (!ret && ub_barrier_hit(ub, UB_TCPSNDBUF)) ++ skbc->ub_wcharged += chargesize; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ if (likely(!ret)) { ++ charge_beancounter_notop(skbc->ub, UB_TCPSNDBUF, chargesize); ++ ub_skb_set_charge(skb, sk, chargesize, UB_TCPSNDBUF); ++ } ++ return ret; ++} ++EXPORT_SYMBOL(ub_sock_tcp_chargesend); ++ ++/* ++ * Initialization ++ */ ++ ++int __init skbc_cache_init(void) ++{ ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/oom_kill.c debian/binary-custom.d/openvz/src/kernel/bc/oom_kill.c +--- ./kernel/bc/oom_kill.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/oom_kill.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,195 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#define UB_OOM_TIMEOUT (5 * HZ) ++ ++int oom_generation; ++int oom_kill_counter; ++static DEFINE_SPINLOCK(oom_lock); ++static DECLARE_WAIT_QUEUE_HEAD(oom_wq); ++ ++static inline int ub_oom_completed(struct task_struct *tsk) ++{ ++ if (test_tsk_thread_flag(tsk, TIF_MEMDIE)) ++ /* we were oom killed - just die */ ++ return 1; ++ if (tsk->task_bc.oom_generation != oom_generation) ++ /* some task was succesfully killed */ ++ return 1; ++ return 0; ++} ++ ++static void ub_clear_oom(void) ++{ ++ struct user_beancounter *ub; ++ ++ rcu_read_lock(); ++ for_each_beancounter(ub) ++ ub->ub_oom_noproc = 0; ++ rcu_read_unlock(); ++} ++ ++int ub_oom_lock(void) ++{ ++ int timeout; ++ DEFINE_WAIT(oom_w); ++ struct task_struct *tsk; ++ ++ tsk = current; ++ ++ spin_lock(&oom_lock); ++ if (!oom_kill_counter) ++ goto out_do_oom; ++ ++ timeout = UB_OOM_TIMEOUT; ++ while (1) { ++ if (ub_oom_completed(tsk)) { ++ spin_unlock(&oom_lock); ++ return -EINVAL; ++ } ++ ++ if (timeout == 0) ++ break; ++ ++ __set_current_state(TASK_UNINTERRUPTIBLE); ++ add_wait_queue(&oom_wq, &oom_w); ++ spin_unlock(&oom_lock); ++ ++ timeout = schedule_timeout(timeout); ++ ++ spin_lock(&oom_lock); ++ remove_wait_queue(&oom_wq, &oom_w); ++ } ++ ++out_do_oom: ++ ub_clear_oom(); ++ return 0; ++} ++ ++static inline long ub_current_overdraft(struct user_beancounter *ub) ++{ ++ return ub->ub_parms[UB_OOMGUARPAGES].held + ++ ((ub->ub_parms[UB_KMEMSIZE].held ++ + ub->ub_parms[UB_TCPSNDBUF].held ++ + ub->ub_parms[UB_TCPRCVBUF].held ++ + ub->ub_parms[UB_OTHERSOCKBUF].held ++ + ub->ub_parms[UB_DGRAMRCVBUF].held) ++ >> PAGE_SHIFT) - ub->ub_parms[UB_OOMGUARPAGES].barrier; ++} ++ ++int ub_oom_task_skip(struct user_beancounter *ub, struct task_struct *tsk) ++{ ++ struct user_beancounter *mm_ub; ++ ++ if (ub == NULL) ++ return 0; ++ ++ task_lock(tsk); ++ if (tsk->mm == NULL) ++ mm_ub = NULL; ++ else ++ mm_ub = tsk->mm->mm_ub; ++ ++ while (mm_ub != NULL && mm_ub != ub) ++ mm_ub = mm_ub->parent; ++ task_unlock(tsk); ++ ++ return mm_ub != ub; ++} ++ ++struct user_beancounter *ub_oom_select_worst(void) ++{ ++ struct user_beancounter *ub, *walkp; ++ long ub_maxover; ++ ++ ub_maxover = 0; ++ ub = NULL; ++ ++ rcu_read_lock(); ++ for_each_beancounter (walkp) { ++ long ub_overdraft; ++ ++ if (walkp->parent != NULL) ++ continue; ++ if (walkp->ub_oom_noproc) ++ continue; ++ ++ ub_overdraft = ub_current_overdraft(walkp); ++ if (ub_overdraft > ub_maxover && get_beancounter_rcu(walkp)) { ++ put_beancounter(ub); ++ ub = walkp; ++ ub_maxover = ub_overdraft; ++ } ++ } ++ ++ if (ub) ++ ub->ub_oom_noproc = 1; ++ rcu_read_unlock(); ++ ++ return ub; ++} ++ ++void ub_oom_mm_killed(struct user_beancounter *ub) ++{ ++ static struct ub_rate_info ri = { 5, 60*HZ }; ++ ++ /* increment is serialized with oom_lock */ ++ ub->ub_parms[UB_OOMGUARPAGES].failcnt++; ++ ++ if (ub_ratelimit(&ri)) ++ show_mem(); ++} ++ ++void ub_oom_unlock(void) ++{ ++ spin_unlock(&oom_lock); ++} ++ ++void ub_oom_task_dead(struct task_struct *tsk) ++{ ++ spin_lock(&oom_lock); ++ oom_kill_counter = 0; ++ oom_generation++; ++ ++ printk("OOM killed process %s (pid=%d, ve=%d) exited, " ++ "free=%lu gen=%d.\n", ++ tsk->comm, tsk->pid, VEID(tsk->ve_task_info.owner_env), ++ nr_free_pages(), oom_generation); ++ /* if there is time to sleep in ub_oom_lock -> sleep will continue */ ++ wake_up_all(&oom_wq); ++ spin_unlock(&oom_lock); ++} ++ ++void ub_out_of_memory(struct user_beancounter *scope) ++{ ++ struct user_beancounter *ub; ++ struct task_struct *p; ++ ++ spin_lock(&oom_lock); ++ ub_clear_oom(); ++ ub = get_beancounter(scope); ++ ++ read_lock(&tasklist_lock); ++retry: ++ p = oom_select_bad_process(ub); ++ if (p == NULL || PTR_ERR(p) == -1UL) ++ goto unlock; ++ ++ if (oom_kill_process(p, (gfp_t)-1, -1, "UB Out of memory")) ++ goto retry; ++ ++ put_beancounter(ub); ++ ++unlock: ++ read_unlock(&tasklist_lock); ++ spin_unlock(&oom_lock); ++} ++EXPORT_SYMBOL(ub_out_of_memory); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/proc.c debian/binary-custom.d/openvz/src/kernel/bc/proc.c +--- ./kernel/bc/proc.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/proc.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,701 @@ ++/* ++ * kernel/bc/proc.c ++ * ++ * Copyright (C) 2006 OpenVZ. SWsoft Inc. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++/* Generic output formats */ ++#if BITS_PER_LONG == 32 ++const char *bc_proc_lu_fmt = "\t%-20s %10lu\n"; ++const char *bc_proc_lu_lfmt = "\t%-20s %21lu\n"; ++const char *bc_proc_llu_fmt = "\t%-20s %21llu\n"; ++const char *bc_proc_lu_lu_fmt = "\t%-20s %10lu %10lu\n"; ++#else ++const char *bc_proc_lu_fmt = "\t%-20s %21lu\n"; ++const char *bc_proc_lu_lfmt = "\t%-20s %21lu\n"; ++const char *bc_proc_llu_fmt = "\t%-20s %21llu\n"; ++const char *bc_proc_lu_lu_fmt = "\t%-20s %21lu %21lu\n"; ++#endif ++ ++#if BITS_PER_LONG == 32 ++static const char *head_fmt = "%10s %-12s %10s %10s %10s %10s %10s\n"; ++static const char *res_fmt = "%10s %-12s %10lu %10lu %10lu %10lu %10lu\n"; ++#else ++static const char *head_fmt = "%10s %-12s %20s %20s %20s %20s %20s\n"; ++static const char *res_fmt = "%10s %-12s %20lu %20lu %20lu %20lu %20lu\n"; ++#endif ++ ++static void ub_show_res(struct seq_file *f, struct user_beancounter *ub, ++ int r, int show_uid) ++{ ++ int len; ++ char ub_uid[64]; ++ ++ if (show_uid && r == 0) { ++ len = print_ub_uid(ub, ub_uid, sizeof(ub_uid) - 2); ++ ub_uid[len] = ':'; ++ ub_uid[len + 1] = '\0'; ++ } else ++ strcpy(ub_uid, ""); ++ ++ seq_printf(f, res_fmt, ub_uid, ub_rnames[r], ++ ub->ub_parms[r].held, ++ ub->ub_parms[r].maxheld, ++ ub->ub_parms[r].barrier, ++ ub->ub_parms[r].limit, ++ ub->ub_parms[r].failcnt); ++} ++ ++static void __show_resources(struct seq_file *f, struct user_beancounter *ub, ++ int show_uid) ++{ ++ int i; ++ ++ for (i = 0; i < UB_RESOURCES_COMPAT; i++) ++ if (strcmp(ub_rnames[i], "dummy") != 0) ++ ub_show_res(f, ub, i, show_uid); ++ ++ for (i = UB_RESOURCES_COMPAT; i < UB_RESOURCES; i++) ++ ub_show_res(f, ub, i, show_uid); ++} ++ ++static int bc_resources_show(struct seq_file *f, void *v) ++{ ++ __show_resources(f, seq_beancounter(f), 0); ++ return 0; ++} ++ ++static struct bc_proc_entry bc_resources_entry = { ++ .name = "resources", ++ .u.show = bc_resources_show, ++}; ++ ++static int bc_debug_show(struct seq_file *f, void *v) ++{ ++ struct user_beancounter *ub; ++ char buf[64]; ++ ++ ub = seq_beancounter(f); ++ print_ub_uid(ub, buf, sizeof(buf)); ++ seq_printf(f, "uid: %s\n", buf); ++ seq_printf(f, "ref: %d\n", atomic_read(&ub->ub_refcount)); ++ ++ seq_printf(f, "bc: %p\n", ub); ++ seq_printf(f, "par: %p\n", ub->parent); ++ seq_printf(f, "priv: %p\n", ub->private_data); ++ return 0; ++} ++ ++static struct bc_proc_entry bc_debug_entry = { ++ .name = "debug", ++ .u.show = bc_debug_show, ++}; ++ ++static int ub_show(struct seq_file *f, void *v) ++{ ++ int i; ++ ++ for (i = 0; i < UB_RESOURCES_COMPAT; i++) ++ ub_show_res(f, (struct user_beancounter *)v, i, 1); ++ return 0; ++} ++ ++static int res_show(struct seq_file *f, void *v) ++{ ++ __show_resources(f, (struct user_beancounter *)v, 1); ++ return 0; ++} ++ ++static int ub_accessible(struct user_beancounter *exec, ++ struct user_beancounter *target) ++{ ++ struct user_beancounter *p, *q; ++ ++ p = top_beancounter(exec); ++ q = top_beancounter(target); ++ ++ return (p == get_ub0() || p == q); ++} ++ ++static void ub_show_header(struct seq_file *f) ++{ ++ seq_printf(f, "Version: 2.5\n"); ++ seq_printf(f, head_fmt, "uid", "resource", ++ "held", "maxheld", "barrier", "limit", "failcnt"); ++} ++ ++static void *ub_start(struct seq_file *f, loff_t *ppos) ++{ ++ struct user_beancounter *ub; ++ struct user_beancounter *exec_ub; ++ unsigned long pos; ++ ++ pos = *ppos; ++ if (pos == 0) ++ ub_show_header(f); ++ ++ exec_ub = get_exec_ub(); ++ ++ rcu_read_lock(); ++ for_each_beancounter(ub) { ++ if (ub->parent != NULL) ++ continue; ++ if (!ub_accessible(exec_ub, ub)) ++ continue; ++ if (pos-- == 0) ++ return ub; ++ } ++ return NULL; ++} ++ ++static void *ub_next(struct seq_file *f, void *v, loff_t *ppos) ++{ ++ struct user_beancounter *ub; ++ struct list_head *entry; ++ struct user_beancounter *exec_ub; ++ ++ exec_ub = get_exec_ub(); ++ ub = (struct user_beancounter *)v; ++ ++ entry = &ub->ub_list; ++ ++ list_for_each_continue_rcu(entry, &ub_list_head) { ++ ub = list_entry(entry, struct user_beancounter, ub_list); ++ if (ub->parent != NULL) ++ continue; ++ if (!ub_accessible(exec_ub, ub)) ++ continue; ++ ++ (*ppos)++; ++ return ub; ++ } ++ return NULL; ++} ++ ++static void ub_stop(struct seq_file *f, void *v) ++{ ++ rcu_read_unlock(); ++} ++ ++static struct seq_operations ub_seq_ops = { ++ .start = ub_start, ++ .next = ub_next, ++ .stop = ub_stop, ++ .show = ub_show, ++}; ++ ++static int ub_open(struct inode *inode, struct file *filp) ++{ ++ if (!(capable(CAP_DAC_OVERRIDE) && capable(CAP_DAC_READ_SEARCH))) ++ return -EACCES; ++ ++ return seq_open(filp, &ub_seq_ops); ++} ++ ++static struct file_operations ub_file_operations = { ++ .open = ub_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = seq_release, ++}; ++ ++static struct seq_operations res_seq_ops = { ++ .start = ub_start, ++ .next = ub_next, ++ .stop = ub_stop, ++ .show = res_show, ++}; ++ ++static int res_open(struct inode *inode, struct file *filp) ++{ ++ if (!(capable(CAP_DAC_OVERRIDE) && capable(CAP_DAC_READ_SEARCH))) ++ return -EACCES; ++ ++ return seq_open(filp, &res_seq_ops); ++} ++ ++static struct file_operations resources_operations = { ++ .open = res_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = seq_release, ++}; ++ ++static struct bc_proc_entry bc_all_resources_entry = { ++ .name = "resources", ++ .u.fops = &resources_operations, ++}; ++ ++/* ++ * Generic showing stuff ++ */ ++ ++static int cookies, num_entries; ++static struct bc_proc_entry *bc_entries __read_mostly; ++static struct bc_proc_entry *bc_root_entries __read_mostly; ++static DEFINE_SPINLOCK(bc_entries_lock); ++static struct proc_dir_entry *bc_proc_root; ++ ++void bc_register_proc_entry(struct bc_proc_entry *e) ++{ ++ spin_lock(&bc_entries_lock); ++ e->cookie = ++cookies; ++ e->next = bc_entries; ++ bc_entries = e; ++ num_entries++; ++ spin_unlock(&bc_entries_lock); ++} ++ ++EXPORT_SYMBOL(bc_register_proc_entry); ++ ++void bc_register_proc_root_entry(struct bc_proc_entry *e) ++{ ++ spin_lock(&bc_entries_lock); ++ e->cookie = ++cookies; ++ e->next = bc_root_entries; ++ bc_root_entries = e; ++ bc_proc_root->nlink++; ++ spin_unlock(&bc_entries_lock); ++} ++ ++EXPORT_SYMBOL(bc_register_proc_root_entry); ++ ++/* ++ * small helpers ++ */ ++ ++static inline unsigned long bc_make_ino(struct user_beancounter *ub) ++{ ++ unsigned long ret; ++ ++ ret = 0xbc000000; ++ if (ub->parent) ++ ret |= ((ub->parent->ub_uid) << 4); ++ ret |= (ub->ub_uid + 1); ++ return ret; ++} ++ ++static inline unsigned long bc_make_file_ino(struct bc_proc_entry *de) ++{ ++ return 0xbe000000 + de->cookie; ++} ++ ++static int bc_d_delete(struct dentry *d) ++{ ++ return 1; ++} ++ ++static void bc_d_release(struct dentry *d) ++{ ++ put_beancounter((struct user_beancounter *)d->d_fsdata); ++} ++ ++static struct inode_operations bc_entry_iops; ++static struct file_operations bc_entry_fops; ++static struct dentry_operations bc_dentry_ops = { ++ .d_delete = bc_d_delete, ++ .d_release = bc_d_release, ++}; ++ ++/* ++ * common directory operations' helpers ++ */ ++ ++static int bc_readdir(struct file *file, filldir_t filler, void *data, ++ struct user_beancounter *parent) ++{ ++ int err = 0; ++ loff_t pos, filled; ++ struct user_beancounter *ub, *prev; ++ struct bc_proc_entry *pde; ++ ++ if (!(capable(CAP_DAC_OVERRIDE) && capable(CAP_DAC_READ_SEARCH))) ++ return -EPERM; ++ ++ pos = file->f_pos; ++ if (pos == 0) { ++ err = (*filler)(data, ".", 1, pos, ++ file->f_dentry->d_inode->i_ino, DT_DIR); ++ if (err < 0) { ++ err = 0; ++ goto out; ++ } ++ pos++; ++ } ++ ++ if (pos == 1) { ++ err = (*filler)(data, "..", 2, pos, ++ parent_ino(file->f_dentry), DT_DIR); ++ if (err < 0) { ++ err = 0; ++ goto out; ++ } ++ pos++; ++ } ++ ++ filled = 2; ++ for (pde = (parent == NULL ? bc_root_entries : bc_entries); ++ pde != NULL; pde = pde->next) { ++ if (filled++ < pos) ++ continue; ++ ++ err = (*filler)(data, pde->name, strlen(pde->name), pos, ++ bc_make_file_ino(pde), DT_REG); ++ if (err < 0) { ++ err = 0; ++ goto out; ++ } ++ pos++; ++ } ++ ++ rcu_read_lock(); ++ prev = NULL; ++ ub = list_entry(&ub_list_head, struct user_beancounter, ub_list); ++ while (1) { ++ int len; ++ unsigned long ino; ++ char buf[64]; ++ ++ ub = list_entry(rcu_dereference(ub->ub_list.next), ++ struct user_beancounter, ub_list); ++ if (&ub->ub_list == &ub_list_head) ++ break; ++ ++ if (ub->parent != parent) ++ continue; ++ ++ if (filled++ < pos) ++ continue; ++ ++ if (!get_beancounter_rcu(ub)) ++ continue; ++ ++ rcu_read_unlock(); ++ put_beancounter(prev); ++ ++ len = print_ub_uid(ub, buf, sizeof(buf)); ++ ino = bc_make_ino(ub); ++ ++ err = (*filler)(data, buf, len, pos, ino, DT_DIR); ++ if (err < 0) { ++ err = 0; ++ put_beancounter(ub); ++ goto out; ++ } ++ ++ rcu_read_lock(); ++ prev = ub; ++ pos++; ++ } ++ rcu_read_unlock(); ++ put_beancounter(prev); ++out: ++ file->f_pos = pos; ++ return err; ++} ++ ++static int bc_looktest(struct inode *ino, void *data) ++{ ++ return ino->i_op == &bc_entry_iops && ino->i_private == data; ++} ++ ++static int bc_lookset(struct inode *ino, void *data) ++{ ++ struct user_beancounter *ub; ++ ++ ub = (struct user_beancounter *)data; ++ ino->i_private = data; ++ ino->i_ino = bc_make_ino(ub); ++ ino->i_fop = &bc_entry_fops; ++ ino->i_op = &bc_entry_iops; ++ ino->i_mode = S_IFDIR | S_IRUSR | S_IXUSR; ++ /* subbeancounters are not included, but who cares? */ ++ ino->i_nlink = num_entries + 2; ++ ino->i_gid = 0; ++ ino->i_uid = 0; ++ return 0; ++} ++ ++static struct dentry *bc_lookup(struct user_beancounter *ub, struct inode *dir, ++ struct dentry *dentry) ++{ ++ struct inode *ino; ++ ++ ino = iget5_locked(dir->i_sb, ub->ub_uid, bc_looktest, bc_lookset, ub); ++ if (ino == NULL) ++ goto out_put; ++ ++ unlock_new_inode(ino); ++ dentry->d_op = &bc_dentry_ops; ++ dentry->d_fsdata = ub; ++ d_add(dentry, ino); ++ return NULL; ++ ++out_put: ++ put_beancounter(ub); ++ return ERR_PTR(-ENOENT); ++} ++ ++/* ++ * files (bc_proc_entry) manipulations ++ */ ++ ++static struct dentry *bc_lookup_file(struct inode *dir, ++ struct dentry *dentry, struct bc_proc_entry *root, ++ int (*test)(struct inode *, void *), ++ int (*set)(struct inode *, void *)) ++{ ++ struct bc_proc_entry *pde; ++ struct inode *ino; ++ ++ for (pde = root; pde != NULL; pde = pde->next) ++ if (strcmp(pde->name, dentry->d_name.name) == 0) ++ break; ++ ++ if (pde == NULL) ++ return ERR_PTR(-ESRCH); ++ ++ ino = iget5_locked(dir->i_sb, pde->cookie, test, set, pde); ++ if (ino == NULL) ++ return ERR_PTR(-ENOENT); ++ ++ unlock_new_inode(ino); ++ dentry->d_op = &bc_dentry_ops; ++ d_add(dentry, ino); ++ return NULL; ++} ++ ++static int bc_file_open(struct inode *ino, struct file *filp) ++{ ++ struct bc_proc_entry *de; ++ struct user_beancounter *ub; ++ ++ de = (struct bc_proc_entry *)ino->i_private; ++ ub = (struct user_beancounter *)filp->f_dentry->d_parent->d_fsdata; ++ BUG_ON(ub->ub_magic != UB_MAGIC); ++ ++ /* ++ * ub can't disappear: we hold d_parent, he holds the beancounter ++ */ ++ return single_open(filp, de->u.show, ub); ++} ++ ++static struct file_operations bc_file_ops = { ++ .open = bc_file_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++static int bc_looktest_entry(struct inode *ino, void *data) ++{ ++ return ino->i_fop == &bc_file_ops && ino->i_private == data; ++} ++ ++static int bc_lookset_entry(struct inode *ino, void *data) ++{ ++ struct bc_proc_entry *de; ++ ++ de = (struct bc_proc_entry *)data; ++ ino->i_private = data; ++ ino->i_ino = bc_make_file_ino(de); ++ ino->i_fop = &bc_file_ops, ++ ino->i_mode = S_IFREG | S_IRUSR; ++ ino->i_nlink = 1; ++ ino->i_gid = 0; ++ ino->i_uid = 0; ++ return 0; ++} ++ ++static inline struct dentry *bc_lookup_files(struct inode *dir, ++ struct dentry *de) ++{ ++ return bc_lookup_file(dir, de, bc_entries, ++ bc_looktest_entry, bc_lookset_entry); ++} ++ ++static int bc_looktest_root_entry(struct inode *ino, void *data) ++{ ++ struct bc_proc_entry *de; ++ ++ de = (struct bc_proc_entry *)data; ++ return ino->i_fop == de->u.fops && ino->i_private == data; ++} ++ ++static int bc_lookset_root_entry(struct inode *ino, void *data) ++{ ++ struct bc_proc_entry *de; ++ ++ de = (struct bc_proc_entry *)data; ++ ino->i_private = data; ++ ino->i_ino = bc_make_file_ino(de); ++ ino->i_fop = de->u.fops; ++ ino->i_mode = S_IFREG | S_IRUSR; ++ ino->i_nlink = 1; ++ ino->i_gid = 0; ++ ino->i_uid = 0; ++ return 0; ++} ++ ++static inline struct dentry *bc_lookup_root_files(struct inode *dir, ++ struct dentry *de) ++{ ++ return bc_lookup_file(dir, de, bc_root_entries, ++ bc_looktest_root_entry, bc_lookset_root_entry); ++} ++ ++/* ++ * /proc/bc/.../ directory operations ++ */ ++ ++static int bc_entry_readdir(struct file *file, void *data, filldir_t filler) ++{ ++ return bc_readdir(file, filler, data, ++ (struct user_beancounter *)file->f_dentry->d_fsdata); ++} ++ ++static struct dentry *bc_entry_lookup(struct inode *dir, struct dentry *dentry, ++ struct nameidata *nd) ++{ ++ int id; ++ char *end; ++ struct user_beancounter *par, *ub; ++ struct dentry *de; ++ ++ if (!(capable(CAP_DAC_OVERRIDE) && capable(CAP_DAC_READ_SEARCH))) ++ return ERR_PTR(-EPERM); ++ ++ de = bc_lookup_files(dir, dentry); ++ if (de != ERR_PTR(-ESRCH)) ++ return de; ++ ++ id = simple_strtol(dentry->d_name.name, &end, 10); ++ if (*end != '.') ++ return ERR_PTR(-ENOENT); ++ ++ par = (struct user_beancounter *)dir->i_private; ++ if (par->ub_uid != id) ++ return ERR_PTR(-ENOENT); ++ ++ id = simple_strtol(end + 1, &end, 10); ++ if (*end != '\0') ++ return ERR_PTR(-ENOENT); ++ ++ ub = get_subbeancounter_byid(par, id, 0); ++ if (ub == NULL) ++ return ERR_PTR(-ENOENT); ++ ++ return bc_lookup(ub, dir, dentry); ++} ++ ++static int bc_entry_getattr(struct vfsmount *mnt, struct dentry *dentry, ++ struct kstat *stat) ++{ ++ struct user_beancounter *ub; ++ ++ generic_fillattr(dentry->d_inode, stat); ++ ub = (struct user_beancounter *)dentry->d_fsdata; ++ stat->nlink = ub->ub_childs + 2; ++ return 0; ++} ++ ++static struct file_operations bc_entry_fops = { ++ .read = generic_read_dir, ++ .readdir = bc_entry_readdir, ++}; ++ ++static struct inode_operations bc_entry_iops = { ++ .lookup = bc_entry_lookup, ++ .getattr = bc_entry_getattr, ++}; ++ ++/* ++ * /proc/bc directory operations ++ */ ++ ++static int bc_root_readdir(struct file *file, void *data, filldir_t filler) ++{ ++ return bc_readdir(file, filler, data, NULL); ++} ++ ++static struct dentry *bc_root_lookup(struct inode *dir, struct dentry *dentry, ++ struct nameidata *nd) ++{ ++ int id; ++ char *end; ++ struct user_beancounter *ub; ++ struct dentry *de; ++ ++ if (!(capable(CAP_DAC_OVERRIDE) && capable(CAP_DAC_READ_SEARCH))) ++ return ERR_PTR(-EPERM); ++ ++ de = bc_lookup_root_files(dir, dentry); ++ if (de != ERR_PTR(-ESRCH)) ++ return de; ++ ++ id = simple_strtol(dentry->d_name.name, &end, 10); ++ if (*end != '\0') ++ return ERR_PTR(-ENOENT); ++ ++ ub = get_beancounter_byuid(id, 0); ++ if (ub == NULL) ++ return ERR_PTR(-ENOENT); ++ ++ return bc_lookup(ub, dir, dentry); ++} ++ ++static int bc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, ++ struct kstat *stat) ++{ ++ generic_fillattr(dentry->d_inode, stat); ++ stat->nlink = ub_count + 2; ++ return 0; ++} ++ ++static struct file_operations bc_root_fops = { ++ .read = generic_read_dir, ++ .readdir = bc_root_readdir, ++}; ++ ++static struct inode_operations bc_root_iops = { ++ .lookup = bc_root_lookup, ++ .getattr = bc_root_getattr, ++}; ++ ++static int __init ub_init_proc(void) ++{ ++ struct proc_dir_entry *entry; ++ ++ bc_proc_root = create_proc_entry("bc", ++ S_IFDIR | S_IRUSR | S_IXUSR, NULL); ++ if (bc_proc_root == NULL) ++ panic("Can't create /proc/bc entry"); ++ ++ bc_proc_root->proc_fops = &bc_root_fops; ++ bc_proc_root->proc_iops = &bc_root_iops; ++ ++ bc_register_proc_entry(&bc_resources_entry); ++#ifdef CONFIG_UBC_DEBUG ++ bc_register_proc_entry(&bc_debug_entry); ++#endif ++ bc_register_proc_root_entry(&bc_all_resources_entry); ++ ++ entry = create_proc_glob_entry("user_beancounters", S_IRUSR, NULL); ++ entry->proc_fops = &ub_file_operations; ++ return 0; ++} ++ ++core_initcall(ub_init_proc); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/rss_pages.c debian/binary-custom.d/openvz/src/kernel/bc/rss_pages.c +--- ./kernel/bc/rss_pages.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/rss_pages.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,453 @@ ++/* ++ * kernel/bc/rss_pages.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++static struct kmem_cache *pb_cachep; ++spinlock_t pb_lock = SPIN_LOCK_UNLOCKED; ++static struct page_beancounter **pb_hash_table; ++static unsigned int pb_hash_mask; ++ ++/* ++ * Auxiliary staff ++ */ ++ ++static inline struct page_beancounter *next_page_pb(struct page_beancounter *p) ++{ ++ return list_entry(p->page_list.next, struct page_beancounter, ++ page_list); ++} ++ ++static inline struct page_beancounter *prev_page_pb(struct page_beancounter *p) ++{ ++ return list_entry(p->page_list.prev, struct page_beancounter, ++ page_list); ++} ++ ++/* ++ * Held pages manipulation ++ */ ++static inline void set_held_pages(struct user_beancounter *bc) ++{ ++ /* all three depend on ub_held_pages */ ++ __ub_update_physpages(bc); ++ __ub_update_oomguarpages(bc); ++ __ub_update_privvm(bc); ++} ++ ++static inline void do_dec_held_pages(struct user_beancounter *ub, int value) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ub->ub_held_pages -= value; ++ set_held_pages(ub); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++static void dec_held_pages(struct user_beancounter *ub, int value) ++{ ++ for (; ub != NULL; ub = ub->parent) ++ do_dec_held_pages(ub, value); ++} ++ ++static inline void do_inc_held_pages(struct user_beancounter *ub, int value) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ub->ub_held_pages += value; ++ set_held_pages(ub); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++static void inc_held_pages(struct user_beancounter *ub, int value) ++{ ++ for (; ub != NULL; ub = ub->parent) ++ do_inc_held_pages(ub, value); ++} ++ ++/* ++ * ++ and -- beyond are protected with pb_lock ++ */ ++ ++static inline void inc_pbc_count(struct user_beancounter *ub) ++{ ++ for (; ub != NULL; ub = ub->parent) ++ ub->ub_pbcs++; ++} ++ ++static inline void dec_pbc_count(struct user_beancounter *ub) ++{ ++ for (; ub != NULL; ub = ub->parent) ++ ub->ub_pbcs--; ++} ++ ++/* ++ * Alloc - free ++ */ ++ ++inline int pb_alloc(struct page_beancounter **pbc) ++{ ++ *pbc = kmem_cache_alloc(pb_cachep, GFP_KERNEL); ++ if (*pbc != NULL) { ++ (*pbc)->next_hash = NULL; ++ (*pbc)->pb_magic = PB_MAGIC; ++ } ++ return (*pbc == NULL); ++} ++ ++inline void pb_free(struct page_beancounter **pb) ++{ ++ if (*pb != NULL) { ++ kmem_cache_free(pb_cachep, *pb); ++ *pb = NULL; ++ } ++} ++ ++void pb_free_list(struct page_beancounter **p_pb) ++{ ++ struct page_beancounter *list, *pb; ++ ++ list = *p_pb; ++ if (list == PBC_COPY_SAME) ++ return; ++ ++ while (list) { ++ pb = list; ++ list = list->next_hash; ++ pb_free(&pb); ++ } ++ *p_pb = NULL; ++} ++ ++/* ++ * head -> -> -> ... ++ */ ++static int __alloc_list(struct page_beancounter **head, int num) ++{ ++ struct page_beancounter *pb; ++ ++ while (num > 0) { ++ if (pb_alloc(&pb)) ++ return -1; ++ pb->next_hash = *head; ++ *head = pb; ++ num--; ++ } ++ ++ return num; ++} ++ ++/* ++ * Ensure that the list contains at least num elements. ++ * p_pb points to an initialized list, may be of the zero length. ++ * ++ * mm->page_table_lock should be held ++ */ ++int pb_alloc_list(struct page_beancounter **p_pb, int num) ++{ ++ struct page_beancounter *list; ++ ++ for (list = *p_pb; list != NULL && num; list = list->next_hash, num--); ++ if (!num) ++ return 0; ++ ++ /* ++ * *p_pb(after) *p_pb (before) ++ * \ \ ++ * -...-> -> ... ++ */ ++ if (__alloc_list(p_pb, num) < 0) ++ goto nomem; ++ return 0; ++ ++nomem: ++ pb_free_list(p_pb); ++ return -ENOMEM; ++} ++ ++/* ++ * Allocates a page_beancounter for each ++ * user_beancounter in a hash ++ */ ++int pb_alloc_all(struct page_beancounter **pbs) ++{ ++ int need_alloc; ++ struct user_beancounter *ub; ++ ++ need_alloc = 0; ++ rcu_read_lock(); ++ for_each_beancounter(ub) ++ need_alloc++; ++ rcu_read_unlock(); ++ ++ if (!__alloc_list(pbs, need_alloc)) ++ return 0; ++ ++ pb_free_list(pbs); ++ return -ENOMEM; ++} ++ ++/* ++ * Hash routines ++ */ ++ ++static inline int pb_hash(struct user_beancounter *ub, struct page *page) ++{ ++ return (page_to_pfn(page) + (ub->ub_uid << 10)) & pb_hash_mask; ++} ++ ++/* pb_lock should be held */ ++static inline void insert_pb(struct page_beancounter *p, struct page *page, ++ struct user_beancounter *ub, int hash) ++{ ++ p->page = page; ++ p->ub = get_beancounter(ub); ++ p->next_hash = pb_hash_table[hash]; ++ pb_hash_table[hash] = p; ++ inc_pbc_count(ub); ++} ++ ++/* ++ * Heart ++ */ ++ ++static int __pb_dup_ref(struct page *page, struct user_beancounter *bc, ++ int hash) ++{ ++ struct page_beancounter *p; ++ ++ for (p = pb_hash_table[hash]; ++ p != NULL && (p->page != page || p->ub != bc); ++ p = p->next_hash); ++ if (p == NULL) ++ return -1; ++ ++ PB_COUNT_INC(p->refcount); ++ return 0; ++} ++ ++static void __pb_add_ref(struct page *page, struct user_beancounter *bc, ++ struct page_beancounter **ppb, int hash) ++{ ++ struct page_beancounter *head, *p, **hp; ++ int shift; ++ ++ p = *ppb; ++ *ppb = p->next_hash; ++ ++ insert_pb(p, page, bc, hash); ++ hp = page_pblist(page); ++ head = *hp; ++ ++ if (head != NULL) { ++ /* ++ * Move the first element to the end of the list. ++ * List head (pb_head) is set to the next entry. ++ * Note that this code works even if head is the only element ++ * on the list (because it's cyclic). ++ */ ++ BUG_ON(head->pb_magic != PB_MAGIC); ++ *hp = next_page_pb(head); ++ PB_SHIFT_INC(head->refcount); ++ shift = PB_SHIFT_GET(head->refcount); ++ /* ++ * Update user beancounter, the share of head has been changed. ++ * Note that the shift counter is taken after increment. ++ */ ++ dec_held_pages(head->ub, UB_PAGE_WEIGHT >> shift); ++ /* add the new page beancounter to the end of the list */ ++ head = *hp; ++ list_add_tail(&p->page_list, &head->page_list); ++ } else { ++ *hp = p; ++ shift = 0; ++ INIT_LIST_HEAD(&p->page_list); ++ } ++ ++ p->refcount = PB_REFCOUNT_MAKE(shift, 1); ++ /* update user beancounter for the new page beancounter */ ++ inc_held_pages(bc, UB_PAGE_WEIGHT >> shift); ++} ++ ++void pb_add_ref(struct page *page, struct mm_struct *mm, ++ struct page_beancounter **p_pb) ++{ ++ int hash; ++ struct user_beancounter *bc; ++ ++ bc = mm->mm_ub; ++ if (bc == NULL) ++ return; ++ ++ if (!PageAnon(page) && is_shmem_mapping(page->mapping)) ++ return; ++ ++ hash = pb_hash(bc, page); ++ ++ spin_lock(&pb_lock); ++ if (__pb_dup_ref(page, bc, hash)) ++ __pb_add_ref(page, bc, p_pb, hash); ++ spin_unlock(&pb_lock); ++} ++ ++void pb_dup_ref(struct page *page, struct mm_struct *mm, ++ struct page_beancounter **p_pb) ++{ ++ int hash; ++ struct user_beancounter *bc; ++ ++ bc = mm->mm_ub; ++ if (bc == NULL) ++ return; ++ ++ if (!PageAnon(page) && is_shmem_mapping(page->mapping)) ++ return; ++ ++ hash = pb_hash(bc, page); ++ ++ spin_lock(&pb_lock); ++ if (*page_pblist(page) == NULL) ++ /* ++ * pages like ZERO_PAGE must not be accounted in pbc ++ * so on fork we just skip them ++ */ ++ goto out_unlock; ++ ++ if (unlikely(*p_pb != PBC_COPY_SAME)) ++ __pb_add_ref(page, bc, p_pb, hash); ++ else if (unlikely(__pb_dup_ref(page, bc, hash))) ++ WARN_ON(1); ++out_unlock: ++ spin_unlock(&pb_lock); ++} ++ ++void pb_remove_ref(struct page *page, struct mm_struct *mm) ++{ ++ int hash; ++ struct user_beancounter *bc; ++ struct page_beancounter *p, **q, *f; ++ int shift, shiftt; ++ ++ bc = mm->mm_ub; ++ if (bc == NULL) ++ return; ++ ++ if (!PageAnon(page) && is_shmem_mapping(page->mapping)) ++ return; ++ ++ hash = pb_hash(bc, page); ++ ++ spin_lock(&pb_lock); ++ for (q = pb_hash_table + hash, p = *q; ++ p != NULL && (p->page != page || p->ub != bc); ++ q = &p->next_hash, p = *q); ++ if (p == NULL) ++ goto out_unlock; ++ ++ PB_COUNT_DEC(p->refcount); ++ if (PB_COUNT_GET(p->refcount)) ++ /* ++ * More references from the same user beancounter exist. ++ * Nothing needs to be done. ++ */ ++ goto out_unlock; ++ ++ /* remove from the hash list */ ++ f = p; ++ *q = p->next_hash; ++ ++ shift = PB_SHIFT_GET(p->refcount); ++ ++ dec_held_pages(p->ub, UB_PAGE_WEIGHT >> shift); ++ ++ q = page_pblist(page); ++ if (*q == p) { ++ if (list_empty(&p->page_list)) { ++ *q = NULL; ++ goto out_free; ++ } ++ ++ *q = next_page_pb(p); ++ } ++ list_del(&p->page_list); ++ ++ /* Now balance the list. Move the tail and adjust its shift counter. */ ++ p = prev_page_pb(*q); ++ shiftt = PB_SHIFT_GET(p->refcount); ++ *q = p; ++ PB_SHIFT_DEC(p->refcount); ++ ++ inc_held_pages(p->ub, UB_PAGE_WEIGHT >> shiftt); ++ ++ /* ++ * If the shift counter of the moved beancounter is different from the ++ * removed one's, repeat the procedure for one more tail beancounter ++ */ ++ if (shiftt > shift) { ++ p = prev_page_pb(*q); ++ *q = p; ++ PB_SHIFT_DEC(p->refcount); ++ inc_held_pages(p->ub, UB_PAGE_WEIGHT >> shiftt); ++ } ++out_free: ++ dec_pbc_count(f->ub); ++ spin_unlock(&pb_lock); ++ ++ put_beancounter(f->ub); ++ pb_free(&f); ++ return; ++ ++out_unlock: ++ spin_unlock(&pb_lock); ++} ++ ++struct user_beancounter *pb_grab_page_ub(struct page *page) ++{ ++ struct page_beancounter *pb; ++ struct user_beancounter *ub; ++ ++ spin_lock(&pb_lock); ++ pb = *page_pblist(page); ++ ub = (pb == NULL ? ERR_PTR(-EINVAL) : ++ get_beancounter(pb->ub)); ++ spin_unlock(&pb_lock); ++ return ub; ++} ++ ++void __init ub_init_pbc(void) ++{ ++ unsigned long hash_size; ++ ++ pb_cachep = kmem_cache_create("page_beancounter", ++ sizeof(struct page_beancounter), 0, ++ SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); ++ hash_size = num_physpages >> 2; ++ for (pb_hash_mask = 1; ++ (hash_size & pb_hash_mask) != hash_size; ++ pb_hash_mask = (pb_hash_mask << 1) + 1); ++ hash_size = pb_hash_mask + 1; ++ printk(KERN_INFO "Page beancounter hash is %lu entries.\n", hash_size); ++ pb_hash_table = vmalloc(hash_size * sizeof(struct page_beancounter *)); ++ memset(pb_hash_table, 0, hash_size * sizeof(struct page_beancounter *)); ++ ++ ub_init_io(pb_cachep); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/statd.c debian/binary-custom.d/openvz/src/kernel/bc/statd.c +--- ./kernel/bc/statd.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/statd.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,453 @@ ++/* ++ * kernel/bc/statd.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++static spinlock_t ubs_notify_lock = SPIN_LOCK_UNLOCKED; ++static LIST_HEAD(ubs_notify_list); ++static long ubs_min_interval; ++static ubstattime_t ubs_start_time, ubs_end_time; ++static struct timer_list ubs_timer; ++ ++static int ubstat_get_list(void __user *buf, long size) ++{ ++ int retval; ++ struct user_beancounter *ub, *ubp; ++ long *page, *ptr, *end; ++ int len; ++ ++ page = (long *)__get_free_page(GFP_KERNEL); ++ if (page == NULL) ++ return -ENOMEM; ++ ++ retval = 0; ++ ubp = NULL; ++ ptr = page; ++ end = page + PAGE_SIZE / sizeof(*ptr); ++ ++ spin_lock_irq(&ub_hash_lock); ++ for_each_beancounter(ub) { ++ if (ub->parent != NULL) ++ continue; ++ *ptr++ = ub->ub_uid; ++ if (ptr != end) ++ continue; ++ ++ get_beancounter(ub); ++ spin_unlock_irq(&ub_hash_lock); ++ ++ put_beancounter(ubp); ++ ubp = ub; ++ ++ len = min_t(long, (ptr - page) * sizeof(*ptr), size); ++ if (copy_to_user(buf, page, len)) { ++ retval = -EFAULT; ++ goto out_put; ++ } ++ retval += len; ++ if (len < PAGE_SIZE) ++ goto out_put; ++ buf += len; ++ size -= len; ++ ++ ptr = page; ++ end = page + PAGE_SIZE / sizeof(*ptr); ++ ++ spin_lock_irq(&ub_hash_lock); ++ } ++ spin_unlock_irq(&ub_hash_lock); ++ ++ put_beancounter(ubp); ++ size = min_t(long, (ptr - page) * sizeof(*ptr), size); ++ if (size > 0 && copy_to_user(buf, page, size)) { ++ retval = -EFAULT; ++ goto out_put; ++ } ++ retval += size; ++ ++out_put: ++ put_beancounter(ubp); ++ free_page((unsigned long)page); ++ return retval; ++} ++ ++static int ubstat_gettime(void __user *buf, long size) ++{ ++ ubgettime_t data; ++ int retval; ++ ++ spin_lock(&ubs_notify_lock); ++ data.start_time = ubs_start_time; ++ data.end_time = ubs_end_time; ++ data.cur_time = ubs_start_time + (jiffies - ubs_start_time * HZ) / HZ; ++ spin_unlock(&ubs_notify_lock); ++ ++ retval = min_t(long, sizeof(data), size); ++ if (copy_to_user(buf, &data, retval)) ++ retval = -EFAULT; ++ return retval; ++} ++ ++static int ubstat_do_read_one(struct user_beancounter *ub, int res, void *kbuf) ++{ ++ struct { ++ ubstattime_t start_time; ++ ubstattime_t end_time; ++ ubstatparm_t param[1]; ++ } *data; ++ ++ data = kbuf; ++ data->start_time = ubs_start_time; ++ data->end_time = ubs_end_time; ++ ++ data->param[0].maxheld = ub->ub_store[res].maxheld; ++ data->param[0].failcnt = ub->ub_store[res].failcnt; ++ ++ return sizeof(*data); ++} ++ ++static int ubstat_do_read_all(struct user_beancounter *ub, void *kbuf, int size) ++{ ++ int wrote; ++ struct { ++ ubstattime_t start_time; ++ ubstattime_t end_time; ++ ubstatparm_t param[UB_RESOURCES]; ++ } *data; ++ int resource; ++ ++ data = kbuf; ++ data->start_time = ubs_start_time; ++ data->end_time = ubs_end_time; ++ wrote = sizeof(data->start_time) + sizeof(data->end_time); ++ ++ for (resource = 0; resource < UB_RESOURCES; resource++) { ++ if (size < wrote + sizeof(data->param[resource])) ++ break; ++ data->param[resource].maxheld = ub->ub_store[resource].maxheld; ++ data->param[resource].failcnt = ub->ub_store[resource].failcnt; ++ wrote += sizeof(data->param[resource]); ++ } ++ ++ return wrote; ++} ++ ++static int ubstat_do_read_full(struct user_beancounter *ub, void *kbuf, ++ int size) ++{ ++ int wrote; ++ struct { ++ ubstattime_t start_time; ++ ubstattime_t end_time; ++ ubstatparmf_t param[UB_RESOURCES]; ++ } *data; ++ int resource; ++ ++ data = kbuf; ++ data->start_time = ubs_start_time; ++ data->end_time = ubs_end_time; ++ wrote = sizeof(data->start_time) + sizeof(data->end_time); ++ ++ for (resource = 0; resource < UB_RESOURCES; resource++) { ++ if (size < wrote + sizeof(data->param[resource])) ++ break; ++ /* The beginning of ubstatparmf_t matches struct ubparm. */ ++ memcpy(&data->param[resource], &ub->ub_store[resource], ++ sizeof(ub->ub_store[resource])); ++ data->param[resource].__unused1 = 0; ++ data->param[resource].__unused2 = 0; ++ wrote += sizeof(data->param[resource]); ++ } ++ return wrote; ++} ++ ++static int ubstat_get_stat(struct user_beancounter *ub, long cmd, ++ void __user *buf, long size) ++{ ++ void *kbuf; ++ int retval; ++ ++ kbuf = (void *)__get_free_page(GFP_KERNEL); ++ if (kbuf == NULL) ++ return -ENOMEM; ++ ++ spin_lock(&ubs_notify_lock); ++ switch (UBSTAT_CMD(cmd)) { ++ case UBSTAT_READ_ONE: ++ retval = -EINVAL; ++ if (UBSTAT_PARMID(cmd) >= UB_RESOURCES) ++ break; ++ retval = ubstat_do_read_one(ub, ++ UBSTAT_PARMID(cmd), kbuf); ++ break; ++ case UBSTAT_READ_ALL: ++ retval = ubstat_do_read_all(ub, kbuf, PAGE_SIZE); ++ break; ++ case UBSTAT_READ_FULL: ++ retval = ubstat_do_read_full(ub, kbuf, PAGE_SIZE); ++ break; ++ default: ++ retval = -EINVAL; ++ } ++ spin_unlock(&ubs_notify_lock); ++ ++ if (retval > 0) { ++ retval = min_t(long, retval, size); ++ if (copy_to_user(buf, kbuf, retval)) ++ retval = -EFAULT; ++ } ++ ++ free_page((unsigned long)kbuf); ++ return retval; ++} ++ ++static int ubstat_handle_notifrq(ubnotifrq_t *req) ++{ ++ int retval; ++ struct ub_stat_notify *new_notify; ++ struct list_head *entry; ++ struct task_struct *tsk_to_free; ++ ++ new_notify = kmalloc(sizeof(new_notify), GFP_KERNEL); ++ if (new_notify == NULL) ++ return -ENOMEM; ++ ++ tsk_to_free = NULL; ++ INIT_LIST_HEAD(&new_notify->list); ++ ++ spin_lock(&ubs_notify_lock); ++ list_for_each(entry, &ubs_notify_list) { ++ struct ub_stat_notify *notify; ++ ++ notify = list_entry(entry, struct ub_stat_notify, list); ++ if (notify->task == current) { ++ kfree(new_notify); ++ new_notify = notify; ++ break; ++ } ++ } ++ ++ retval = -EINVAL; ++ if (req->maxinterval < 1) ++ goto out_unlock; ++ if (req->maxinterval > TIME_MAX_SEC) ++ req->maxinterval = TIME_MAX_SEC; ++ if (req->maxinterval < ubs_min_interval) { ++ unsigned long dif; ++ ++ ubs_min_interval = req->maxinterval; ++ dif = (ubs_timer.expires - jiffies + HZ - 1) / HZ; ++ if (dif > req->maxinterval) ++ mod_timer(&ubs_timer, ++ ubs_timer.expires - ++ (dif - req->maxinterval) * HZ); ++ } ++ ++ if (entry != &ubs_notify_list) { ++ list_del(&new_notify->list); ++ tsk_to_free = new_notify->task; ++ } ++ if (req->signum) { ++ new_notify->task = current; ++ get_task_struct(new_notify->task); ++ new_notify->signum = req->signum; ++ list_add(&new_notify->list, &ubs_notify_list); ++ } else ++ kfree(new_notify); ++ retval = 0; ++out_unlock: ++ spin_unlock(&ubs_notify_lock); ++ if (tsk_to_free != NULL) ++ put_task_struct(tsk_to_free); ++ return retval; ++} ++ ++/* ++ * former sys_ubstat ++ */ ++long do_ubstat(int func, unsigned long arg1, unsigned long arg2, ++ void __user *buf, long size) ++{ ++ int retval; ++ struct user_beancounter *ub; ++ ++ if (func == UBSTAT_UBPARMNUM) ++ return UB_RESOURCES; ++ if (func == UBSTAT_UBLIST) ++ return ubstat_get_list(buf, size); ++ if (!(capable(CAP_DAC_OVERRIDE) || capable(CAP_DAC_READ_SEARCH))) ++ return -EPERM; ++ ++ if (func == UBSTAT_GETTIME) { ++ retval = ubstat_gettime(buf, size); ++ goto notify; ++ } ++ ++ ub = get_exec_ub(); ++ if (ub != NULL && ub->ub_uid == arg1) ++ get_beancounter(ub); ++ else /* FIXME must be if (ve_is_super) */ ++ ub = get_beancounter_byuid(arg1, 0); ++ ++ if (ub == NULL) ++ return -ESRCH; ++ ++ retval = ubstat_get_stat(ub, func, buf, size); ++ put_beancounter(ub); ++notify: ++ /* Handle request for notification */ ++ if (retval >= 0) { ++ ubnotifrq_t notifrq; ++ int err; ++ ++ err = -EFAULT; ++ if (!copy_from_user(¬ifrq, (void __user *)arg2, ++ sizeof(notifrq))) ++ err = ubstat_handle_notifrq(¬ifrq); ++ if (err) ++ retval = err; ++ } ++ ++ return retval; ++} ++ ++static void ubstat_save_onestat(struct user_beancounter *ub) ++{ ++ int resource; ++ ++ /* called with local irq disabled */ ++ spin_lock(&ub->ub_lock); ++ for (resource = 0; resource < UB_RESOURCES; resource++) { ++ memcpy(&ub->ub_store[resource], &ub->ub_parms[resource], ++ sizeof(struct ubparm)); ++ ub->ub_parms[resource].minheld = ++ ub->ub_parms[resource].maxheld = ++ ub->ub_parms[resource].held; ++ } ++ spin_unlock(&ub->ub_lock); ++} ++ ++static void ubstat_save_statistics(void) ++{ ++ unsigned long flags; ++ struct user_beancounter *ub; ++ ++ local_irq_save(flags); ++ for_each_beancounter (ub) ++ ubstat_save_onestat(ub); ++ local_irq_restore(flags); ++} ++ ++static void ubstatd_timeout(unsigned long __data) ++{ ++ struct task_struct *p; ++ ++ p = (struct task_struct *) __data; ++ wake_up_process(p); ++} ++ ++/* ++ * Safe wrapper for send_sig. It prevents a race with release_task ++ * for sighand. ++ * Should be called under tasklist_lock. ++ */ ++static void task_send_sig(struct ub_stat_notify *notify) ++{ ++ if (likely(notify->task->sighand != NULL)) ++ send_sig(notify->signum, notify->task, 1); ++} ++ ++static inline void do_notifies(void) ++{ ++ LIST_HEAD(notif_free_list); ++ struct ub_stat_notify *notify; ++ struct ub_stat_notify *tmp; ++ ++ spin_lock(&ubs_notify_lock); ++ ubs_start_time = ubs_end_time; ++ /* ++ * the expression below relies on time being unsigned long and ++ * arithmetic promotion rules ++ */ ++ ubs_end_time += (ubs_timer.expires - ubs_start_time * HZ) / HZ; ++ mod_timer(&ubs_timer, ubs_timer.expires + ubs_min_interval * HZ); ++ ubs_min_interval = TIME_MAX_SEC; ++ /* save statistics accumulated for the interval */ ++ ubstat_save_statistics(); ++ /* send signals */ ++ read_lock(&tasklist_lock); ++ while (!list_empty(&ubs_notify_list)) { ++ notify = list_entry(ubs_notify_list.next, ++ struct ub_stat_notify, list); ++ task_send_sig(notify); ++ list_del(¬ify->list); ++ list_add(¬ify->list, ¬if_free_list); ++ } ++ read_unlock(&tasklist_lock); ++ spin_unlock(&ubs_notify_lock); ++ ++ list_for_each_entry_safe(notify, tmp, ¬if_free_list, list) { ++ put_task_struct(notify->task); ++ kfree(notify); ++ } ++} ++ ++/* ++ * Kernel thread ++ */ ++static int ubstatd(void *unused) ++{ ++ /* daemonize call will take care of signals */ ++ daemonize("ubstatd"); ++ ++ ubs_timer.data = (unsigned long)current; ++ ubs_timer.function = ubstatd_timeout; ++ add_timer(&ubs_timer); ++ ++ while (1) { ++ set_task_state(current, TASK_INTERRUPTIBLE); ++ if (time_after(ubs_timer.expires, jiffies)) { ++ schedule(); ++ try_to_freeze(); ++ continue; ++ } ++ ++ __set_task_state(current, TASK_RUNNING); ++ do_notifies(); ++ } ++ return 0; ++} ++ ++static int __init ubstatd_init(void) ++{ ++ init_timer(&ubs_timer); ++ ubs_timer.expires = TIME_MAX_JIF; ++ ubs_min_interval = TIME_MAX_SEC; ++ ubs_start_time = ubs_end_time = 0; ++ ++ kernel_thread(ubstatd, NULL, 0); ++ return 0; ++} ++ ++module_init(ubstatd_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/sys.c debian/binary-custom.d/openvz/src/kernel/bc/sys.c +--- ./kernel/bc/sys.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/sys.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,173 @@ ++/* ++ * kernel/bc/sys.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++ ++#include ++ ++/* ++ * The (rather boring) getluid syscall ++ */ ++asmlinkage long sys_getluid(void) ++{ ++ struct user_beancounter *ub; ++ ++ ub = get_exec_ub(); ++ if (ub == NULL) ++ return -EINVAL; ++ ++ return ub->ub_uid; ++} ++ ++/* ++ * The setluid syscall ++ */ ++asmlinkage long sys_setluid(uid_t uid) ++{ ++ struct user_beancounter *ub; ++ struct task_beancounter *task_bc; ++ int error; ++ ++ task_bc = ¤t->task_bc; ++ ++ /* You may not disown a setluid */ ++ error = -EINVAL; ++ if (uid == (uid_t)-1) ++ goto out; ++ ++ /* You may only set an ub as root */ ++ error = -EPERM; ++ if (!capable(CAP_SETUID)) ++ goto out; ++ /* ++ * The ub once set is irrevocable to all ++ * unless it's set from ve0. ++ */ ++ if (!ve_is_super(get_exec_env())) ++ goto out; ++ ++ /* Ok - set up a beancounter entry for this user */ ++ error = -ENOBUFS; ++ ub = get_beancounter_byuid(uid, 1); ++ if (ub == NULL) ++ goto out; ++ ++ ub_debug(UBD_ALLOC | UBD_LIMIT, "setluid, bean %p (count %d) " ++ "for %.20s pid %d\n", ++ ub, atomic_read(&ub->ub_refcount), ++ current->comm, current->pid); ++ /* install bc */ ++ error = virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_NEWUBC, ub); ++ if (!(error & NOTIFY_FAIL)) { ++ put_beancounter(task_bc->exec_ub); ++ task_bc->exec_ub = ub; ++ if (!(error & NOTIFY_OK)) { ++ put_beancounter(task_bc->fork_sub); ++ task_bc->fork_sub = get_beancounter(ub); ++ } ++ error = 0; ++ } else { ++ put_beancounter(ub); ++ error = -ENOBUFS; ++ } ++out: ++ return error; ++} ++ ++long do_setublimit(uid_t uid, unsigned long resource, ++ unsigned long *new_limits) ++{ ++ int error; ++ unsigned long flags; ++ struct user_beancounter *ub; ++ ++ error = -EPERM; ++ if(!capable(CAP_SYS_RESOURCE)) ++ goto out; ++ ++ if (!ve_is_super(get_exec_env())) ++ goto out; ++ ++ error = -EINVAL; ++ if (resource >= UB_RESOURCES) ++ goto out; ++ ++ error = -EINVAL; ++ if (new_limits[0] > UB_MAXVALUE || new_limits[1] > UB_MAXVALUE) ++ goto out; ++ ++ error = -ENOENT; ++ ub = get_beancounter_byuid(uid, 0); ++ if (ub == NULL) { ++ ub_debug(UBD_LIMIT, "No login bc for uid %d\n", uid); ++ goto out; ++ } ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ub->ub_parms[resource].barrier = new_limits[0]; ++ ub->ub_parms[resource].limit = new_limits[1]; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ ++ put_beancounter(ub); ++ ++ error = 0; ++out: ++ return error; ++} ++ ++/* ++ * The setbeanlimit syscall ++ */ ++asmlinkage long sys_setublimit(uid_t uid, unsigned long resource, ++ unsigned long __user *limits) ++{ ++ unsigned long new_limits[2]; ++ ++ if (copy_from_user(&new_limits, limits, sizeof(new_limits))) ++ return -EFAULT; ++ ++ return do_setublimit(uid, resource, new_limits); ++} ++ ++extern long do_ubstat(int func, unsigned long arg1, unsigned long arg2, ++ void __user *buf, long size); ++asmlinkage long sys_ubstat(int func, unsigned long arg1, unsigned long arg2, ++ void __user *buf, long size) ++{ ++ if (!ve_is_super(get_exec_env())) ++ return -EPERM; ++ ++ return do_ubstat(func, arg1, arg2, buf, size); ++} ++ ++#ifdef CONFIG_COMPAT ++asmlinkage long compat_sys_setublimit(uid_t uid, int resource, ++ unsigned int __user *limits) ++{ ++ unsigned int u_new_limits[2]; ++ unsigned long new_limits[2]; ++ ++ if (copy_from_user(&u_new_limits, limits, sizeof(u_new_limits))) ++ return -EFAULT; ++ ++ new_limits[0] = u_new_limits[0]; ++ new_limits[1] = u_new_limits[1]; ++ ++ return do_setublimit(uid, resource, new_limits); ++} ++ ++asmlinkage long compat_sys_ubstat(int func, unsigned int arg1, ++ unsigned int arg2, compat_uptr_t *buf, long size) ++{ ++ return sys_ubstat(func, arg1, arg2, buf, size); ++} ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/bc/vm_pages.c debian/binary-custom.d/openvz/src/kernel/bc/vm_pages.c +--- ./kernel/bc/vm_pages.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/bc/vm_pages.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,550 @@ ++/* ++ * kernel/bc/vm_pages.c ++ * ++ * Copyright (C) 2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++static inline unsigned long pages_in_pte_range(struct vm_area_struct *vma, ++ pmd_t *pmd, unsigned long addr, unsigned long end, ++ unsigned long *ret) ++{ ++ pte_t *pte; ++ spinlock_t *ptl; ++ ++ pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); ++ do { ++ if (!pte_none(*pte) && pte_present(*pte)) ++ (*ret)++; ++ } while (pte++, addr += PAGE_SIZE, (addr != end)); ++ pte_unmap_unlock(pte - 1, ptl); ++ ++ return addr; ++} ++ ++static inline unsigned long pages_in_pmd_range(struct vm_area_struct *vma, ++ pud_t *pud, unsigned long addr, unsigned long end, ++ unsigned long *ret) ++{ ++ pmd_t *pmd; ++ unsigned long next; ++ ++ pmd = pmd_offset(pud, addr); ++ do { ++ next = pmd_addr_end(addr, end); ++ if (pmd_none_or_clear_bad(pmd)) ++ continue; ++ next = pages_in_pte_range(vma, pmd, addr, next, ret); ++ } while (pmd++, addr = next, (addr != end)); ++ ++ return addr; ++} ++ ++static inline unsigned long pages_in_pud_range(struct vm_area_struct *vma, ++ pgd_t *pgd, unsigned long addr, unsigned long end, ++ unsigned long *ret) ++{ ++ pud_t *pud; ++ unsigned long next; ++ ++ pud = pud_offset(pgd, addr); ++ do { ++ next = pud_addr_end(addr, end); ++ if (pud_none_or_clear_bad(pud)) ++ continue; ++ next = pages_in_pmd_range(vma, pud, addr, next, ret); ++ } while (pud++, addr = next, (addr != end)); ++ ++ return addr; ++} ++ ++unsigned long pages_in_vma_range(struct vm_area_struct *vma, ++ unsigned long addr, unsigned long end) ++{ ++ pgd_t *pgd; ++ unsigned long next; ++ unsigned long ret; ++ ++ ret = 0; ++ BUG_ON(addr >= end); ++ pgd = pgd_offset(vma->vm_mm, addr); ++ do { ++ next = pgd_addr_end(addr, end); ++ if (pgd_none_or_clear_bad(pgd)) ++ continue; ++ next = pages_in_pud_range(vma, pgd, addr, next, &ret); ++ } while (pgd++, addr = next, (addr != end)); ++ return ret; ++} ++ ++void fastcall __ub_update_physpages(struct user_beancounter *ub) ++{ ++ ub->ub_parms[UB_PHYSPAGES].held = ub->ub_tmpfs_respages ++ + (ub->ub_held_pages >> UB_PAGE_WEIGHT_SHIFT); ++ ub_adjust_maxheld(ub, UB_PHYSPAGES); ++} ++ ++void fastcall __ub_update_oomguarpages(struct user_beancounter *ub) ++{ ++ ub->ub_parms[UB_OOMGUARPAGES].held = ++ ub->ub_parms[UB_PHYSPAGES].held + ub->ub_swap_pages; ++ ub_adjust_maxheld(ub, UB_OOMGUARPAGES); ++} ++ ++void fastcall __ub_update_privvm(struct user_beancounter *ub) ++{ ++ ub->ub_parms[UB_PRIVVMPAGES].held = ++ (ub->ub_held_pages >> UB_PAGE_WEIGHT_SHIFT) ++ + ub->ub_unused_privvmpages ++ + ub->ub_parms[UB_SHMPAGES].held; ++ ub_adjust_maxheld(ub, UB_PRIVVMPAGES); ++} ++ ++static inline int __charge_privvm_locked(struct user_beancounter *ub, ++ unsigned long s, enum ub_severity strict) ++{ ++ if (__charge_beancounter_locked(ub, UB_PRIVVMPAGES, s, strict) < 0) ++ return -ENOMEM; ++ ++ ub->ub_unused_privvmpages += s; ++ return 0; ++} ++ ++static void __unused_privvm_dec_locked(struct user_beancounter *ub, ++ long size) ++{ ++ /* catch possible overflow */ ++ if (ub->ub_unused_privvmpages < size) { ++ uncharge_warn(ub, UB_UNUSEDPRIVVM, ++ size, ub->ub_unused_privvmpages); ++ size = ub->ub_unused_privvmpages; ++ } ++ ub->ub_unused_privvmpages -= size; ++ __ub_update_privvm(ub); ++} ++ ++void __ub_unused_privvm_dec(struct mm_struct *mm, long size) ++{ ++ unsigned long flags; ++ struct user_beancounter *ub; ++ ++ ub = mm->mm_ub; ++ if (ub == NULL) ++ return; ++ ++ ub = top_beancounter(ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ __unused_privvm_dec_locked(ub, size); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++void ub_unused_privvm_sub(struct mm_struct *mm, ++ struct vm_area_struct *vma, unsigned long count) ++{ ++ if (VM_UB_PRIVATE(vma->vm_flags, vma->vm_file)) ++ __ub_unused_privvm_dec(mm, count); ++} ++ ++void ub_unused_privvm_add(struct mm_struct *mm, ++ struct vm_area_struct *vma, unsigned long size) ++{ ++ unsigned long flags; ++ struct user_beancounter *ub; ++ ++ ub = mm->mm_ub; ++ if (ub == NULL || !VM_UB_PRIVATE(vma->vm_flags, vma->vm_file)) ++ return; ++ ++ ub = top_beancounter(ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ub->ub_unused_privvmpages += size; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++int ub_protected_charge(struct mm_struct *mm, unsigned long size, ++ unsigned long newflags, struct vm_area_struct *vma) ++{ ++ unsigned long flags; ++ struct file *file; ++ struct user_beancounter *ub; ++ ++ ub = mm->mm_ub; ++ if (ub == NULL) ++ return PRIVVM_NO_CHARGE; ++ ++ flags = vma->vm_flags; ++ if (!((newflags ^ flags) & VM_WRITE)) ++ return PRIVVM_NO_CHARGE; ++ ++ file = vma->vm_file; ++ if (!VM_UB_PRIVATE(newflags | VM_WRITE, file)) ++ return PRIVVM_NO_CHARGE; ++ ++ if (flags & VM_WRITE) ++ return PRIVVM_TO_SHARED; ++ ++ ub = top_beancounter(ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ if (__charge_privvm_locked(ub, size, UB_SOFT) < 0) ++ goto err; ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ return PRIVVM_TO_PRIVATE; ++ ++err: ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ return PRIVVM_ERROR; ++} ++ ++int ub_memory_charge(struct mm_struct *mm, unsigned long size, ++ unsigned vm_flags, struct file *vm_file, int sv) ++{ ++ struct user_beancounter *ub, *ubl; ++ unsigned long flags; ++ ++ ub = mm->mm_ub; ++ if (ub == NULL) ++ return 0; ++ ++ size >>= PAGE_SHIFT; ++ if (size > UB_MAXVALUE) ++ return -EINVAL; ++ ++ BUG_ON(sv != UB_SOFT && sv != UB_HARD); ++ ++ if (vm_flags & VM_LOCKED) { ++ if (charge_beancounter(ub, UB_LOCKEDPAGES, size, sv)) ++ goto out_err; ++ } ++ if (VM_UB_PRIVATE(vm_flags, vm_file)) { ++ ubl = top_beancounter(ub); ++ spin_lock_irqsave(&ubl->ub_lock, flags); ++ if (__charge_privvm_locked(ubl, size, sv)) ++ goto out_private; ++ spin_unlock_irqrestore(&ubl->ub_lock, flags); ++ } ++ return 0; ++ ++out_private: ++ spin_unlock_irqrestore(&ubl->ub_lock, flags); ++ if (vm_flags & VM_LOCKED) ++ uncharge_beancounter(ub, UB_LOCKEDPAGES, size); ++out_err: ++ return -ENOMEM; ++} ++ ++void ub_memory_uncharge(struct mm_struct *mm, unsigned long size, ++ unsigned vm_flags, struct file *vm_file) ++{ ++ struct user_beancounter *ub; ++ unsigned long flags; ++ ++ ub = mm->mm_ub; ++ if (ub == NULL) ++ return; ++ ++ size >>= PAGE_SHIFT; ++ ++ if (vm_flags & VM_LOCKED) ++ uncharge_beancounter(ub, UB_LOCKEDPAGES, size); ++ if (VM_UB_PRIVATE(vm_flags, vm_file)) { ++ ub = top_beancounter(ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ __unused_privvm_dec_locked(ub, size); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ } ++} ++ ++int ub_locked_charge(struct mm_struct *mm, unsigned long size) ++{ ++ struct user_beancounter *ub; ++ ++ ub = mm->mm_ub; ++ if (ub == NULL) ++ return 0; ++ ++ return charge_beancounter(ub, UB_LOCKEDPAGES, ++ size >> PAGE_SHIFT, UB_HARD); ++} ++ ++void ub_locked_uncharge(struct mm_struct *mm, unsigned long size) ++{ ++ struct user_beancounter *ub; ++ ++ ub = mm->mm_ub; ++ if (ub == NULL) ++ return; ++ ++ uncharge_beancounter(ub, UB_LOCKEDPAGES, size >> PAGE_SHIFT); ++} ++ ++int ub_lockedshm_charge(struct shmem_inode_info *shi, unsigned long size) ++{ ++ struct user_beancounter *ub; ++ ++ ub = shi->shmi_ub; ++ if (ub == NULL) ++ return 0; ++ ++ return charge_beancounter(ub, UB_LOCKEDPAGES, ++ size >> PAGE_SHIFT, UB_HARD); ++} ++ ++void ub_lockedshm_uncharge(struct shmem_inode_info *shi, unsigned long size) ++{ ++ struct user_beancounter *ub; ++ ++ ub = shi->shmi_ub; ++ if (ub == NULL) ++ return; ++ ++ uncharge_beancounter(ub, UB_LOCKEDPAGES, size >> PAGE_SHIFT); ++} ++ ++ ++static inline void do_ub_tmpfs_respages_inc(struct user_beancounter *ub) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ub->ub_tmpfs_respages++; ++ __ub_update_physpages(ub); ++ __ub_update_oomguarpages(ub); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++void ub_tmpfs_respages_inc(struct shmem_inode_info *shi) ++{ ++ struct user_beancounter *ub; ++ ++ for (ub = shi->shmi_ub; ub != NULL; ub = ub->parent) ++ do_ub_tmpfs_respages_inc(ub); ++} ++ ++static inline void do_ub_tmpfs_respages_sub(struct user_beancounter *ub, ++ unsigned long size) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ /* catch possible overflow */ ++ if (ub->ub_tmpfs_respages < size) { ++ uncharge_warn(ub, UB_TMPFSPAGES, ++ size, ub->ub_tmpfs_respages); ++ size = ub->ub_tmpfs_respages; ++ } ++ ub->ub_tmpfs_respages -= size; ++ /* update values what is the most interesting */ ++ __ub_update_physpages(ub); ++ __ub_update_oomguarpages(ub); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++void ub_tmpfs_respages_sub(struct shmem_inode_info *shi, ++ unsigned long size) ++{ ++ struct user_beancounter *ub; ++ ++ for (ub = shi->shmi_ub; ub != NULL; ub = ub->parent) ++ do_ub_tmpfs_respages_sub(ub, size); ++} ++ ++int ub_shmpages_charge(struct shmem_inode_info *shi, unsigned long size) ++{ ++ int ret; ++ unsigned long flags; ++ struct user_beancounter *ub; ++ ++ ub = shi->shmi_ub; ++ if (ub == NULL) ++ return 0; ++ ++ ub = top_beancounter(ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ret = __charge_beancounter_locked(ub, UB_SHMPAGES, size, UB_HARD); ++ if (ret == 0) ++ __ub_update_privvm(ub); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++ return ret; ++} ++ ++void ub_shmpages_uncharge(struct shmem_inode_info *shi, unsigned long size) ++{ ++ unsigned long flags; ++ struct user_beancounter *ub; ++ ++ ub = shi->shmi_ub; ++ if (ub == NULL) ++ return; ++ ++ ub = top_beancounter(ub); ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ __uncharge_beancounter_locked(ub, UB_SHMPAGES, size); ++ __ub_update_privvm(ub); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++#ifdef CONFIG_BC_SWAP_ACCOUNTING ++static inline void do_ub_swapentry_inc(struct user_beancounter *ub) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ ub->ub_swap_pages++; ++ __ub_update_oomguarpages(ub); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++void ub_swapentry_inc(struct swap_info_struct *si, pgoff_t num, ++ struct user_beancounter *ub) ++{ ++ si->swap_ubs[num] = get_beancounter(ub); ++ for (; ub != NULL; ub = ub->parent) ++ do_ub_swapentry_inc(ub); ++} ++EXPORT_SYMBOL(ub_swapentry_inc); ++ ++static inline void do_ub_swapentry_dec(struct user_beancounter *ub) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ub->ub_lock, flags); ++ if (ub->ub_swap_pages <= 0) ++ uncharge_warn(ub, UB_SWAPPAGES, 1, ub->ub_swap_pages); ++ else ++ ub->ub_swap_pages--; ++ __ub_update_oomguarpages(ub); ++ spin_unlock_irqrestore(&ub->ub_lock, flags); ++} ++ ++void ub_swapentry_dec(struct swap_info_struct *si, pgoff_t num) ++{ ++ struct user_beancounter *ub, *ubp; ++ ++ ub = si->swap_ubs[num]; ++ si->swap_ubs[num] = NULL; ++ for (ubp = ub; ubp != NULL; ubp = ubp->parent) ++ do_ub_swapentry_dec(ubp); ++ put_beancounter(ub); ++} ++EXPORT_SYMBOL(ub_swapentry_dec); ++ ++int ub_swap_init(struct swap_info_struct *si, pgoff_t num) ++{ ++ struct user_beancounter **ubs; ++ ++ ubs = vmalloc(num * sizeof(struct user_beancounter *)); ++ if (ubs == NULL) ++ return -ENOMEM; ++ ++ memset(ubs, 0, num * sizeof(struct user_beancounter *)); ++ si->swap_ubs = ubs; ++ return 0; ++} ++ ++void ub_swap_fini(struct swap_info_struct *si) ++{ ++ if (si->swap_ubs) { ++ vfree(si->swap_ubs); ++ si->swap_ubs = NULL; ++ } ++} ++#endif ++ ++static int vmguar_enough_memory(struct vnotifier_block *self, ++ unsigned long event, void *arg, int old_ret) ++{ ++ struct user_beancounter *ub; ++ ++ if (event != VIRTINFO_ENOUGHMEM) ++ return old_ret; ++ /* ++ * If it's a kernel thread, don't care about it. ++ * Added in order aufsd to run smoothly over ramfs. ++ */ ++ if (!current->mm) ++ return NOTIFY_DONE; ++ ++ ub = top_beancounter(current->mm->mm_ub); ++ if (ub->ub_parms[UB_PRIVVMPAGES].held > ++ ub->ub_parms[UB_VMGUARPAGES].barrier) ++ return old_ret; ++ ++ return NOTIFY_OK; ++} ++ ++static struct vnotifier_block vmguar_notifier_block = { ++ .notifier_call = vmguar_enough_memory ++}; ++ ++static int __init init_vmguar_notifier(void) ++{ ++ virtinfo_notifier_register(VITYPE_GENERAL, &vmguar_notifier_block); ++ return 0; ++} ++ ++static void __exit fini_vmguar_notifier(void) ++{ ++ virtinfo_notifier_unregister(VITYPE_GENERAL, &vmguar_notifier_block); ++} ++ ++module_init(init_vmguar_notifier); ++module_exit(fini_vmguar_notifier); ++ ++#ifdef CONFIG_PROC_FS ++static int bc_vmaux_show(struct seq_file *f, void *v) ++{ ++ struct user_beancounter *ub; ++ unsigned long swap, unmap; ++ int i; ++ ++ ub = seq_beancounter(f); ++ ++ swap = unmap = 0; ++ for_each_online_cpu(i) { ++ swap += per_cpu_ptr(ub->ub_percpu, i)->swapin; ++ unmap += per_cpu_ptr(ub->ub_percpu, i)->unmap; ++ } ++ ++ seq_printf(f, bc_proc_lu_fmt, ub_rnames[UB_UNUSEDPRIVVM], ++ ub->ub_unused_privvmpages); ++ seq_printf(f, bc_proc_lu_fmt, ub_rnames[UB_TMPFSPAGES], ++ ub->ub_tmpfs_respages); ++ seq_printf(f, bc_proc_lu_fmt, ub_rnames[UB_SWAPPAGES], ++ ub->ub_swap_pages); ++ seq_printf(f, bc_proc_lu_fmt, "rss", ub->ub_pbcs); ++ ++ seq_printf(f, bc_proc_lu_fmt, "swapin", swap); ++ seq_printf(f, bc_proc_lu_fmt, "unmap", unmap); ++ return 0; ++} ++static struct bc_proc_entry bc_vmaux_entry = { ++ .name = "vmaux", ++ .u.show = bc_vmaux_show, ++}; ++ ++static int __init bc_vmaux_init(void) ++{ ++ bc_register_proc_entry(&bc_vmaux_entry); ++ return 0; ++} ++ ++late_initcall(bc_vmaux_init); ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/capability.c debian/binary-custom.d/openvz/src/kernel/capability.c +--- ./kernel/capability.c 2012-06-12 16:25:24.238312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/capability.c 2012-11-13 15:20:15.368569068 +0000 +@@ -10,16 +10,23 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + ++#ifndef CONFIG_VE ++kernel_cap_t cap_bset = CAP_INIT_EFF_SET; ++EXPORT_SYMBOL(cap_bset); ++#endif ++ + /* + * This lock protects task->cap_* for all tasks including current. + * Locking rule: acquire this prior to tasklist_lock. + */ +-static DEFINE_SPINLOCK(task_capability_lock); ++DEFINE_SPINLOCK(task_capability_lock); ++EXPORT_SYMBOL(task_capability_lock); + + /* + * For sys_getproccap() and sys_setproccap(), any of the three +@@ -99,7 +106,7 @@ + pgrp = find_vpid(pgrp_nr); + do_each_pid_task(pgrp, PIDTYPE_PGID, g) { + target = g; +- while_each_thread(g, target) { ++ while_each_thread_ve(g, target) { + if (!security_capset_check(target, effective, + inheritable, + permitted)) { +@@ -129,7 +136,7 @@ + int ret = -EPERM; + int found = 0; + +- do_each_thread(g, target) { ++ do_each_thread_ve(g, target) { + if (target == current || is_container_init(target->group_leader)) + continue; + found = 1; +@@ -138,7 +145,7 @@ + continue; + ret = 0; + security_capset_set(target, effective, inheritable, permitted); +- } while_each_thread(g, target); ++ } while_each_thread_ve(g, target); + + if (!found) + ret = 0; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cgroup.c debian/binary-custom.d/openvz/src/kernel/cgroup.c +--- ./kernel/cgroup.c 2012-06-12 16:25:24.238312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cgroup.c 2012-11-13 15:20:15.368569068 +0000 +@@ -1686,12 +1686,12 @@ + struct task_struct *p, *g; + write_lock(&css_set_lock); + use_task_css_set_links = 1; +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + task_lock(p); + if (list_empty(&p->cg_list)) + list_add(&p->cg_list, &p->cgroups->tasks); + task_unlock(p); +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + write_unlock(&css_set_lock); + } + read_lock(&css_set_lock); +@@ -2229,9 +2229,9 @@ + struct task_struct *g, *p; + + read_lock(&tasklist_lock); +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + ss->fork(ss, p); +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + read_unlock(&tasklist_lock); + } + +@@ -2577,9 +2577,6 @@ + again: + root = subsys->root; + if (root == &rootnode) { +- printk(KERN_INFO +- "Not cloning cgroup for unused subsystem %s\n", +- subsys->name); + mutex_unlock(&cgroup_mutex); + return 0; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/compat.c debian/binary-custom.d/openvz/src/kernel/compat.c +--- ./kernel/compat.c 2012-06-12 16:25:24.238312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/compat.c 2012-11-13 15:20:15.368569068 +0000 +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -41,7 +42,7 @@ + __put_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0; + } + +-static long compat_nanosleep_restart(struct restart_block *restart) ++long compat_nanosleep_restart(struct restart_block *restart) + { + struct compat_timespec __user *rmtp; + struct timespec rmt; +@@ -65,6 +66,7 @@ + + return ret; + } ++EXPORT_SYMBOL_GPL(compat_nanosleep_restart); + + asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp, + struct compat_timespec __user *rmtp) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/configs.c debian/binary-custom.d/openvz/src/kernel/configs.c +--- ./kernel/configs.c 2012-06-12 16:25:24.238312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/configs.c 2012-11-13 15:20:15.368569068 +0000 +@@ -79,8 +79,7 @@ + struct proc_dir_entry *entry; + + /* create the current config file */ +- entry = create_proc_entry("config.gz", S_IFREG | S_IRUGO, +- &proc_root); ++ entry = create_proc_entry("config.gz", S_IFREG | S_IRUGO, NULL); + if (!entry) + return -ENOMEM; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/Makefile debian/binary-custom.d/openvz/src/kernel/cpt/Makefile +--- ./kernel/cpt/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/Makefile 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,53 @@ ++# ++# ++# kernel/cpt/Makefile ++# ++# Copyright (C) 2000-2005 SWsoft ++# All rights reserved. ++# ++# Licensing governed by "linux/COPYING.SWsoft" file. ++ ++obj-$(CONFIG_VZ_CHECKPOINT) += vzcpt.o vzrst.o ++ ++vzcpt-objs := cpt_proc.o cpt_dump.o cpt_obj.o cpt_context.o cpt_process.o \ ++ cpt_mm.o cpt_files.o cpt_kernel.o \ ++ cpt_socket.o cpt_socket_in.o cpt_tty.o cpt_sysvipc.o cpt_net.o \ ++ cpt_conntrack.o cpt_epoll.o ++ ++vzrst-objs := rst_proc.o rst_undump.o rst_context.o rst_process.o \ ++ rst_mm.o rst_files.o \ ++ rst_socket.o rst_socket_in.o rst_tty.o rst_sysvipc.o rst_net.o \ ++ rst_conntrack.o rst_epoll.o ++ ++ifeq ($(CONFIG_BEANCOUNTERS), y) ++vzcpt-objs += cpt_ubc.o ++vzrst-objs += rst_ubc.o ++endif ++ ++ifeq ($(CONFIG_INOTIFY_USER), y) ++vzcpt-objs += cpt_inotify.o ++vzrst-objs += rst_inotify.o ++endif ++ ++vzrst-objs += cpt_exports.o ++ ++ifeq ($(CONFIG_VZ_CHECKPOINT), m) ++vzrst-objs += cpt_obj.o cpt_kernel.o ++endif ++ ++ifeq ($(CONFIG_VZ_CHECKPOINT_ITER), y) ++vzcpt-objs += cpt_iterative.o ++vzrst-objs += rst_iterative.o ++endif ++ ++ifeq ($(CONFIG_VZ_CHECKPOINT_LAZY), y) ++vzcpt-objs += cpt_pagein.o ++vzrst-objs += rst_pagein.o ++endif ++ ++ifeq ($(CONFIG_X86_64), y) ++vzcpt-objs += cpt_x8664.o ++ifeq ($(CONFIG_VZ_CHECKPOINT), m) ++vzrst-objs += cpt_x8664.o ++endif ++endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_conntrack.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_conntrack.c +--- ./kernel/cpt/cpt_conntrack.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_conntrack.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,365 @@ ++/* ++ * ++ * kernel/cpt/cpt_conntrack.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#if defined(CONFIG_VE_IPTABLES) && \ ++ (defined(CONFIG_IP_NF_CONNTRACK) || defined(CONFIG_IP_NF_CONNTRACK_MODULE)) ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++ ++ ++/* How does it work? ++ * ++ * Network is disabled, so new conntrack entries will not appear. ++ * However, some of them can disappear because of timeouts. ++ * ++ * So, we take read_lock, collect all required information atomically, ++ * essentially, creating parallel "refcount" structures holding pointers. ++ * We delete conntrack timers as well, so the structures cannot disappear ++ * after releasing the lock. Now, after releasing lock we can dump everything ++ * safely. And on exit we restore timers to their original values. ++ * ++ * Note, this approach is not going to work in VE0. ++ */ ++ ++struct ct_holder ++{ ++ struct ct_holder *next; ++ struct ip_conntrack_tuple_hash *cth; ++ int index; ++}; ++ ++static void encode_tuple(struct cpt_ipct_tuple *v, struct ip_conntrack_tuple *tuple) ++{ ++ v->cpt_dst = tuple->dst.ip; ++ v->cpt_dstport = tuple->dst.u.all; ++ v->cpt_protonum = tuple->dst.protonum; ++ v->cpt_dir = tuple->dst.dir; ++ ++ v->cpt_src = tuple->src.ip; ++ v->cpt_srcport = tuple->src.u.all; ++} ++ ++static int dump_one_expect(struct cpt_ip_connexpect_image *v, ++ struct ip_conntrack_expect *exp, ++ int sibling, cpt_context_t *ctx) ++{ ++ int err = 0; ++ ++ v->cpt_next = sizeof(*v); ++ v->cpt_object = CPT_OBJ_NET_CONNTRACK_EXPECT; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_VOID; ++ ++ encode_tuple(&v->cpt_tuple, &exp->tuple); ++ encode_tuple(&v->cpt_mask, &exp->mask); ++ v->cpt_sibling_conntrack = sibling; ++ v->cpt_flags = exp->flags; ++ v->cpt_seq = exp->id; ++ v->cpt_dir = 0; ++ v->cpt_manip_proto = 0; ++#ifdef CONFIG_IP_NF_NAT_NEEDED ++ v->cpt_manip_proto = exp->saved_proto.all; ++ v->cpt_dir = exp->dir; ++#endif ++ v->cpt_timeout = 0; ++ if (exp->master->helper->timeout) ++ v->cpt_timeout = exp->timeout.expires - jiffies; ++ return err; ++} ++ ++/* NOTE. We use one page to dump list of expectations. This may be not enough ++ * in theory. In practice there is only one expectation per conntrack record. ++ * Moreover, taking into account that _ALL_ of expecations are saved in one ++ * global list, which is looked up each incoming/outpging packet, the system ++ * would be severely dead when even one conntrack would have so much of ++ * expectations. Shortly, I am not going to repair this. ++ */ ++ ++static int dump_expect_list(struct ip_conntrack *ct, struct ct_holder *list, ++ cpt_context_t *ctx) ++{ ++ int err = 0; ++ unsigned long pg; ++ struct cpt_ip_connexpect_image *v; ++ struct ip_conntrack_expect *exp; ++ ++ if (ct->expecting == 0) ++ return err; ++ if (ct->expecting*sizeof(struct cpt_ip_connexpect_image) > PAGE_SIZE) ++ return -ENOBUFS; ++ ++ pg = __get_free_page(GFP_KERNEL); ++ if (!pg) ++ return -ENOMEM; ++ v = (struct cpt_ip_connexpect_image *)pg; ++ ++ read_lock_bh(&ip_conntrack_lock); ++ list_for_each_entry(exp, &ve_ip_conntrack_expect_list, list) { ++ int sibling; ++ ++ if (exp->master != ct) ++ continue; ++ ++ if (ct->helper == NULL) { ++ eprintk_ctx("conntrack: no helper and non-trivial expectation\n"); ++ err = -EINVAL; ++ break; ++ } ++ ++ sibling = 0; ++#if 0 ++ /* That's all? No need to calculate sibling? */ ++ if (exp->sibling) { ++ struct ct_holder *c; ++ for (c = list; c; c = c->next) { ++ if (tuplehash_to_ctrack(c->cth) == exp->sibling) { ++ sibling = c->index; ++ break; ++ } ++ } ++ /* NOTE: exp->sibling could be not "confirmed" and, hence, ++ * out of hash table. We should just ignore such a sibling, ++ * the connection is going to be retried, the packet ++ * apparently was lost somewhere. ++ */ ++ if (sibling == 0) ++ dprintk_ctx("sibling conntrack is not found\n"); ++ } ++#endif ++ ++ /* If the expectation still does not have exp->sibling ++ * and timer is not running, it is about to die on another ++ * cpu. Skip it. */ ++ if (!sibling && ++ ct->helper->timeout && ++ !timer_pending(&exp->timeout)) { ++ dprintk_ctx("conntrack: expectation: no timer\n"); ++ continue; ++ } ++ ++ err = dump_one_expect(v, exp, sibling, ctx); ++ if (err) ++ break; ++ ++ v++; ++ } ++ read_unlock_bh(&ip_conntrack_lock); ++ ++ if (err == 0 && (unsigned long)v != pg) ++ ctx->write((void*)pg, (unsigned long)v - pg, ctx); ++ ++ free_page(pg); ++ return err; ++} ++ ++static int dump_one_ct(struct ct_holder *c, struct ct_holder *list, ++ cpt_context_t *ctx) ++{ ++ struct ip_conntrack_tuple_hash *h = c->cth; ++ struct ip_conntrack *ct = tuplehash_to_ctrack(h); ++ struct cpt_ip_conntrack_image v; ++ int err = 0; ++ ++ if (sizeof(v.cpt_proto_data) != sizeof(ct->proto)) { ++ eprintk_ctx("conntrack module ct->proto version mismatch\n"); ++ return -EINVAL; ++ } ++ ++ cpt_open_object(NULL, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_NET_CONNTRACK; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_ARRAY; ++ ++ read_lock_bh(&ip_conntrack_lock); ++ v.cpt_status = ct->status; ++ v.cpt_timeout = ct->timeout.expires - jiffies; ++ v.cpt_ct_helper = (ct->helper != NULL); ++ v.cpt_index = c->index; ++ v.cpt_id = ct->id; ++ v.cpt_mark = 0; ++#if defined(CONFIG_IP_NF_CONNTRACK_MARK) ++ v.cpt_mark = ct->mark; ++#endif ++ encode_tuple(&v.cpt_tuple[0], &ct->tuplehash[0].tuple); ++ encode_tuple(&v.cpt_tuple[1], &ct->tuplehash[1].tuple); ++ memcpy(&v.cpt_proto_data, &ct->proto, sizeof(v.cpt_proto_data)); ++ memcpy(&v.cpt_help_data, &ct->help, sizeof(v.cpt_help_data)); ++ ++ v.cpt_masq_index = 0; ++ v.cpt_initialized = 0; ++ v.cpt_num_manips = 0; ++ v.cpt_nat_helper = 0; ++#ifdef CONFIG_IP_NF_NAT_NEEDED ++#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ ++ defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) ++ v.cpt_masq_index = ct->nat.masq_index; ++#endif ++ /* "help" data is used by pptp, difficult to support */ ++ v.cpt_nat_seq[0].cpt_correction_pos = ct->nat.info.seq[0].correction_pos; ++ v.cpt_nat_seq[0].cpt_offset_before = ct->nat.info.seq[0].offset_before; ++ v.cpt_nat_seq[0].cpt_offset_after = ct->nat.info.seq[0].offset_after; ++ v.cpt_nat_seq[1].cpt_correction_pos = ct->nat.info.seq[1].correction_pos; ++ v.cpt_nat_seq[1].cpt_offset_before = ct->nat.info.seq[1].offset_before; ++ v.cpt_nat_seq[1].cpt_offset_after = ct->nat.info.seq[1].offset_after; ++#endif ++ read_unlock_bh(&ip_conntrack_lock); ++ ++ ctx->write(&v, sizeof(v), ctx); ++ ++ err = dump_expect_list(ct, list, ctx); ++ ++ cpt_close_object(ctx); ++ return err; ++} ++ ++int cpt_dump_ip_conntrack(cpt_context_t * ctx) ++{ ++ struct ct_holder *ct_list = NULL; ++ struct ct_holder *c, **cp; ++ int err = 0; ++ int index = 0; ++ int idx; ++ ++ if (get_exec_env()->_ip_conntrack == NULL) ++ return 0; ++ ++ for (idx = atomic_read(&(get_exec_env()->_ip_conntrack->_ip_conntrack_count)); idx >= 0; idx--) { ++ c = kmalloc(sizeof(struct ct_holder), GFP_KERNEL); ++ if (c == NULL) { ++ err = -ENOMEM; ++ goto done; ++ } ++ memset(c, 0, sizeof(struct ct_holder)); ++ c->next = ct_list; ++ ct_list = c; ++ } ++ ++ c = ct_list; ++ ++ read_lock_bh(&ip_conntrack_lock); ++ for (idx = 0; idx < ip_conntrack_htable_size; idx++) { ++ struct ip_conntrack_tuple_hash *h; ++ list_for_each_entry(h, &ve_ip_conntrack_hash[idx], list) { ++ /* Skip reply tuples, they are covered by original ++ * direction. */ ++ if (DIRECTION(h)) ++ continue; ++ ++ /* Oops, we have not enough of holders... ++ * It is impossible. */ ++ if (unlikely(c == NULL)) { ++ read_unlock_bh(&ip_conntrack_lock); ++ eprintk_ctx("unexpected conntrack appeared\n"); ++ err = -ENOMEM; ++ goto done; ++ } ++ ++ /* If timer is not running, it means that it ++ * has just been scheduled on another cpu. ++ * We should skip this conntrack, it is about to be ++ * destroyed. */ ++ if (!del_timer(&tuplehash_to_ctrack(h)->timeout)) { ++ dprintk_ctx("conntrack: no timer\n"); ++ continue; ++ } ++ ++ /* Timer is deleted. refcnt is _not_ decreased. ++ * We are going to restore the timer on exit ++ * from this function. */ ++ c->cth = h; ++ c->index = ++index; ++ c = c->next; ++ } ++ } ++ read_unlock_bh(&ip_conntrack_lock); ++ ++ /* No conntracks? Good. */ ++ if (index == 0) ++ goto done; ++ ++ /* Comb the list a little. */ ++ cp = &ct_list; ++ while ((c = *cp) != NULL) { ++ /* Discard unused entries; they can appear, if some ++ * entries were timed out since we preallocated the list. ++ */ ++ if (c->cth == NULL) { ++ *cp = c->next; ++ kfree(c); ++ continue; ++ } ++ ++ /* Move conntracks attached to expectations to the beginning ++ * of the list. */ ++ if (tuplehash_to_ctrack(c->cth)->master && c != ct_list) { ++ *cp = c->next; ++ c->next = ct_list; ++ ct_list = c; ++ dprintk_ctx("conntrack: %d moved in list\n", c->index); ++ continue; ++ } ++ cp = &c->next; ++ } ++ ++ cpt_open_section(ctx, CPT_SECT_NET_CONNTRACK); ++ ++ for (c = ct_list; c; c = c->next) { ++ err = dump_one_ct(c, ct_list, ctx); ++ if (err) ++ goto done; ++ } ++ ++ cpt_close_section(ctx); ++ ++done: ++ while ((c = ct_list) != NULL) { ++ ct_list = c->next; ++ if (c->cth) { ++ /* Restore timer. refcnt is preserved. */ ++ add_timer(&tuplehash_to_ctrack(c->cth)->timeout); ++ } ++ kfree(c); ++ } ++ return err; ++} ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_context.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_context.c +--- ./kernel/cpt/cpt_context.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_context.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,257 @@ ++/* ++ * ++ * kernel/cpt/cpt_context.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++ ++ ++static void file_write(const void *addr, size_t count, struct cpt_context *ctx) ++{ ++ mm_segment_t oldfs; ++ ssize_t err = -EBADF; ++ struct file *file = ctx->file; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if (file) ++ err = file->f_op->write(file, addr, count, &file->f_pos); ++ set_fs(oldfs); ++ if (err != count && !ctx->write_error) ++ ctx->write_error = err < 0 ? err : -EIO; ++} ++ ++static void file_pwrite(void *addr, size_t count, struct cpt_context *ctx, loff_t pos) ++{ ++ mm_segment_t oldfs; ++ ssize_t err = -EBADF; ++ struct file *file = ctx->file; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if (file) ++ err = file->f_op->write(file, addr, count, &pos); ++ set_fs(oldfs); ++ if (err != count && !ctx->write_error) ++ ctx->write_error = err < 0 ? err : -EIO; ++} ++ ++static void file_align(struct cpt_context *ctx) ++{ ++ struct file *file = ctx->file; ++ ++ if (file) ++ file->f_pos = CPT_ALIGN(file->f_pos); ++} ++ ++void cpt_context_init(struct cpt_context *ctx) ++{ ++ int i; ++ ++ memset(ctx, 0, sizeof(*ctx)); ++ ++ init_MUTEX(&ctx->main_sem); ++ ctx->refcount = 1; ++ ++ ctx->current_section = -1; ++ ctx->current_object = -1; ++ ctx->pagesize = PAGE_SIZE; ++ ctx->write = file_write; ++ ctx->pwrite = file_pwrite; ++ ctx->align = file_align; ++ for (i=0; i < CPT_SECT_MAX; i++) ++ ctx->sections[i] = CPT_NULL; ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ init_completion(&ctx->pgin_notify); ++#endif ++ cpt_object_init(ctx); ++} ++ ++int cpt_open_dumpfile(struct cpt_context *ctx) ++{ ++ ctx->tmpbuf = (char*)__get_free_page(GFP_KERNEL); ++ if (ctx->tmpbuf == NULL) ++ return -ENOMEM; ++ __cpt_release_buf(ctx); ++ return 0; ++} ++ ++int cpt_close_dumpfile(struct cpt_context *ctx) ++{ ++ if (ctx->file) { ++ fput(ctx->file); ++ ctx->file = NULL; ++ } ++ if (ctx->tmpbuf) { ++ free_page((unsigned long)ctx->tmpbuf); ++ ctx->tmpbuf = NULL; ++ } ++ if (ctx->write_error) ++ eprintk_ctx("error while writing dump file: %d\n", ctx->write_error); ++ return ctx->write_error; ++} ++ ++int cpt_major_hdr_out(struct cpt_context *ctx) ++{ ++ struct cpt_major_hdr hdr; ++ ++ if (ctx->file == NULL) ++ return 0; ++ ++ memset(&hdr, 0, sizeof(hdr)); ++ hdr.cpt_signature[0] = CPT_SIGNATURE0; ++ hdr.cpt_signature[1] = CPT_SIGNATURE1; ++ hdr.cpt_signature[2] = CPT_SIGNATURE2; ++ hdr.cpt_signature[3] = CPT_SIGNATURE3; ++ hdr.cpt_hdrlen = sizeof(hdr); ++ hdr.cpt_image_version = CPT_VERSION_20; ++#ifdef CONFIG_X86_64 ++ hdr.cpt_os_arch = CPT_OS_ARCH_EMT64; ++#elif defined(CONFIG_X86_32) ++ hdr.cpt_os_arch = CPT_OS_ARCH_I386; ++#elif defined(CONFIG_IA64) ++ hdr.cpt_os_arch = CPT_OS_ARCH_IA64; ++#else ++#error Arch is not supported ++#endif ++ hdr.cpt_ve_features = (__u32)ctx->features; ++ hdr.cpt_ve_features2 = (__u32)(ctx->features>>32); ++ hdr.cpt_pagesize = (__u16)PAGE_SIZE; ++ hdr.cpt_hz = HZ; ++ hdr.cpt_start_jiffies64 = ctx->virt_jiffies64; ++ hdr.cpt_start_sec = ctx->start_time.tv_sec; ++ hdr.cpt_start_nsec = ctx->start_time.tv_nsec; ++ hdr.cpt_cpu_caps[0] = ctx->src_cpu_flags; ++ hdr.cpt_kernel_config[0] = ctx->kernel_config_flags; ++ hdr.cpt_iptables_mask = ctx->iptables_mask; ++ ++ ctx->write(&hdr, sizeof(hdr), ctx); ++ return 0; ++} ++ ++int cpt_close_section(struct cpt_context *ctx) ++{ ++ if (ctx->file && ctx->current_section >= 0) { ++ __u64 next = ctx->file->f_pos - ctx->current_section; ++ ctx->pwrite(&next, 8, ctx, ctx->current_section); ++ ctx->current_section = -1; ++ } ++ return 0; ++} ++EXPORT_SYMBOL(cpt_close_section); ++ ++int cpt_open_section(struct cpt_context *ctx, __u32 type) ++{ ++ struct cpt_section_hdr hdr; ++ ++ if (ctx->file == NULL) ++ return 0; ++ ++ cpt_close_section(ctx); ++ ++ ctx->current_section = ctx->file->f_pos; ++ ctx->sections[type] = ctx->current_section; ++ ++ hdr.cpt_next = 0; ++ hdr.cpt_section = type; ++ hdr.cpt_hdrlen = sizeof(hdr); ++ hdr.cpt_align = 0; ++ ctx->write(&hdr, sizeof(hdr), ctx); ++ ++ return 0; ++} ++EXPORT_SYMBOL(cpt_open_section); ++ ++ ++int cpt_close_object(struct cpt_context *ctx) ++{ ++ if (ctx->file && ctx->current_object >= 0) { ++ __u64 next = ctx->file->f_pos - ctx->current_object; ++ ctx->pwrite(&next, 8, ctx, ctx->current_object); ++ ctx->current_object = -1; ++ } ++ return 0; ++} ++EXPORT_SYMBOL(cpt_close_object); ++ ++int cpt_open_object(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ if (ctx->file == NULL) ++ return 0; ++ ++ cpt_close_object(ctx); ++ ++ ctx->current_object = ctx->file->f_pos; ++ if (obj) ++ cpt_obj_setpos(obj, ctx->current_object, ctx); ++ ++ return 0; ++} ++EXPORT_SYMBOL(cpt_open_object); ++ ++int cpt_push_object(loff_t *saved, struct cpt_context *ctx) ++{ ++ if (ctx->file) { ++ *saved = ctx->current_object; ++ ctx->current_object = ctx->file->f_pos; ++ } ++ return 0; ++} ++EXPORT_SYMBOL(cpt_push_object); ++ ++int cpt_pop_object(loff_t *saved, struct cpt_context *ctx) ++{ ++ ctx->current_object = *saved; ++ return 0; ++} ++EXPORT_SYMBOL(cpt_pop_object); ++ ++int cpt_dump_tail(struct cpt_context *ctx) ++{ ++ struct cpt_major_tail hdr; ++ int i; ++ ++ if (ctx->file == NULL) ++ return 0; ++ ++ cpt_open_section(ctx, CPT_SECT_TRAILER); ++ memset(&hdr, 0, sizeof(hdr)); ++ hdr.cpt_next = sizeof(hdr); ++ hdr.cpt_object = CPT_OBJ_TRAILER; ++ hdr.cpt_hdrlen = sizeof(hdr); ++ hdr.cpt_content = CPT_CONTENT_VOID; ++ hdr.cpt_lazypages = 0; ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ hdr.cpt_lazypages = ctx->lazypages; ++#endif ++ hdr.cpt_64bit = ctx->tasks64; ++ hdr.cpt_signature[0] = CPT_SIGNATURE0; ++ hdr.cpt_signature[1] = CPT_SIGNATURE1; ++ hdr.cpt_signature[2] = CPT_SIGNATURE2; ++ hdr.cpt_signature[3] = CPT_SIGNATURE3; ++ hdr.cpt_nsect = CPT_SECT_MAX_INDEX; ++ for (i = 0; i < CPT_SECT_MAX_INDEX; i++) ++ hdr.cpt_sections[i] = ctx->sections[i]; ++ ++ ctx->write(&hdr, sizeof(hdr), ctx); ++ cpt_close_section(ctx); ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_context.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_context.h +--- ./kernel/cpt/cpt_context.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_context.h 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,215 @@ ++#include ++#include ++#include ++ ++#define CPT_CTX_ERROR -1 ++#define CPT_CTX_IDLE 0 ++#define CPT_CTX_SUSPENDING 1 ++#define CPT_CTX_SUSPENDED 2 ++#define CPT_CTX_DUMPING 3 ++#define CPT_CTX_UNDUMPING 4 ++#define CPT_CTX_UNDUMPED 5 ++ ++#define CPT_TID(tsk) task_pid_nr(tsk), task_pid_vnr(tsk), (tsk)->comm ++#define CPT_FID "%d,%d(%s)" ++ ++ ++typedef struct cpt_context ++{ ++ struct list_head ctx_list; ++ int refcount; ++ int ctx_state; ++ int objcount; ++ int sticky; ++ struct semaphore main_sem; ++ ++ struct file *errorfile; ++ struct file *statusfile; ++ struct file *lockfile; ++ ++ int errno; ++ char *error_msg; ++ loff_t err_offset; ++ ++ struct file *file; ++ char *tmpbuf; ++ int pagesize; ++#ifdef CONFIG_VZ_CHECKPOINT_ITER ++ int iter_done; ++ void *iter_dir; ++ struct user_beancounter *iter_ub; ++#endif ++ loff_t current_section; ++ loff_t current_object; ++ ++ loff_t sections[CPT_SECT_MAX]; ++ ++ __u32 errormask; ++ __u32 write_error; ++ ++ struct list_head object_array[CPT_OBJ_MAX]; ++ ++ void (*write)(const void *addr, size_t count, struct cpt_context *ctx); ++ void (*pwrite)(void *addr, size_t count, struct cpt_context *ctx, loff_t pos); ++ ssize_t (*read)(void *addr, size_t count, struct cpt_context *ctx); ++ ssize_t (*pread)(void *addr, size_t count, struct cpt_context *ctx, loff_t pos); ++ void (*align)(struct cpt_context *ctx); ++ int ve_id; ++ int contextid; ++ struct timespec cpt_monotonic_time; /* Host monotonic time at the moment of cpt/rst ++ * corresponging to start_time */ ++ __u64 virt_jiffies64; /* Virtual jiffies64. It is == cpt_jiffies64 when ++ * VE did not migrate. */ ++ struct timespec start_time; ++ struct timespec delta_time; ++ __s64 delta_nsec; ++ int image_version; ++ __u16 image_arch; ++ __u64 iptables_mask; ++ __u64 features; ++ ++#define CPT_ANONVMA_HBITS (sizeof(void*) == 4 ? 10 : 9) ++#define CPT_ANONVMA_HSIZE (1<ve_id, ##arg) ++ ++#define wprintk(a...) cpt_printk(2, "CPT WRN: " a) ++#define wprintk_ctx(f, arg...) wprintk("%p,%u: " f, ctx, ctx->ve_id, ##arg) ++ ++#define eprintk(a...) cpt_printk(1, "CPT ERR: " a) ++#define eprintk_ctx(f, arg...) \ ++do { \ ++ eprintk("%p,%u :" f, ctx, ctx->ve_id, ##arg); \ ++ if (ctx->error_msg && ctx->err_offset < PAGE_SIZE) \ ++ ctx->err_offset += snprintf((char*)(ctx->error_msg + \ ++ ctx->err_offset), \ ++ PAGE_SIZE - ctx->err_offset, \ ++ "Error: " f, ##arg); \ ++} while(0) ++ ++#define CPT_TMPBUF_FREE 0x789adf12 ++#define CPT_TMPBUF_BUSY 0xabcd9876 ++ ++static inline void *cpt_get_buf(cpt_context_t *ctx) ++{ ++ void *buf = ctx->tmpbuf; ++ ++ BUG_ON(*(u32*)(buf + PAGE_SIZE - 4) != CPT_TMPBUF_FREE); ++ *(u32*)(buf + PAGE_SIZE - 4) = CPT_TMPBUF_BUSY; ++ return buf; ++} ++ ++static inline void __cpt_release_buf(cpt_context_t *ctx) ++{ ++ void *buf = ctx->tmpbuf; ++ ++ *(u32*)(buf + PAGE_SIZE - 4) = CPT_TMPBUF_FREE; ++} ++ ++static inline void cpt_release_buf(cpt_context_t *ctx) ++{ ++ void *buf = ctx->tmpbuf; ++ ++ BUG_ON(*(u32*)(buf + PAGE_SIZE - 4) != CPT_TMPBUF_BUSY); ++ *(u32*)(buf + PAGE_SIZE - 4) = CPT_TMPBUF_FREE; ++} ++ ++static inline void cpt_flush_error(cpt_context_t *ctx) ++{ ++ mm_segment_t oldfs; ++ ++ if (ctx->errorfile && ctx->error_msg && ctx->err_offset) { ++ if (ctx->errorfile->f_op && ctx->errorfile->f_op->write) { ++ oldfs = get_fs(); ++ set_fs(KERNEL_DS); ++ ctx->errorfile->f_op->write(ctx->errorfile, ++ ctx->error_msg, ctx->err_offset, ++ &ctx->errorfile->f_pos); ++ set_fs(oldfs); ++ } ++ ctx->error_msg[0] = 0; ++ ctx->err_offset = 0; ++ } ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_dump.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_dump.c +--- ./kernel/cpt/cpt_dump.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_dump.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,1261 @@ ++/* ++ * ++ * kernel/cpt/cpt_dump.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_dump.h" ++#include "cpt_files.h" ++#include "cpt_mm.h" ++#include "cpt_process.h" ++#include "cpt_net.h" ++#include "cpt_socket.h" ++#include "cpt_ubc.h" ++#include "cpt_kernel.h" ++ ++ ++static int vps_child_level(struct task_struct *root, struct task_struct *c) ++{ ++ int level = 0; ++ int veid = VE_TASK_INFO(c)->owner_env->veid; ++ ++ while (VE_TASK_INFO(c)->owner_env->veid == veid) { ++ if (c->pid != c->tgid) ++ c = c->group_leader; ++ if (c == root) ++ return level; ++ ++ c = c->parent; ++ level++; ++ } ++ return -1; ++} ++ ++static inline int freezable(struct task_struct * p) ++{ ++ if (p->exit_state) ++ return 0; ++ ++ switch (p->state) { ++ case EXIT_ZOMBIE: ++ case EXIT_DEAD: ++ case TASK_STOPPED: ++#if TASK_TRACED != TASK_STOPPED ++ case TASK_TRACED: ++#endif ++ return 0; ++ default: ++ return 1; ++ } ++} ++ ++static void wake_ve(cpt_context_t *ctx) ++{ ++ struct task_struct *p, *g; ++ ++ do_each_thread_ve(g, p) { ++ spin_lock_irq(&p->sighand->siglock); ++ if (p->flags & PF_FROZEN) { ++ p->flags &= ~PF_FROZEN; ++ wake_up_process(p); ++ } ++ spin_unlock_irq(&p->sighand->siglock); ++ } while_each_thread_ve(g, p); ++} ++ ++/* ++ * Some comment is necessary about PF_FREEZE,PF_FROZEN,TIF_FREEZE... ++ * ++ * SWSUSP uses PF_FREEZE flag in tsk->flags raising it in context ++ * of another process. Apparently, it is unacceptable on SMP. ++ * Let's take freeze_processes() in kernel/power/process.c as an example. ++ * Unserialized modifications tsk->flags easily ++ * (believe or not, but it happens with probability of almost 100% :-)) ++ * creates the situation when setting PF_FREEZE in freeze_processes(), ++ * which quickly spins raising PF_FREEZE of all the processes, ++ * _clears_ PF_FROZEN just set in refrigerator(), so that suspend deadlocks. ++ * ++ * So, to make things clean, we require that those flags may be modified ++ * only under tsk->sighand->siglock, which is quite natural because PF_FREEZE ++ * is just a kind of signal. ++ * ++ * It is not enough, because we are still not allowed to change tsk->flags ++ * in context of another process, we can corrupt another flags, when the process ++ * running on another cpu modifies them. So, we use TIF_FREEZE in thread flags, ++ * which can be changed atomically. ++ * ++ * PF_FROZEN also changes in context of another process, but this happens ++ * only when the process is already in refrigerator() which does not modify ++ * tsk->flags. ++ */ ++ ++static int check_process_external(struct task_struct *p) ++{ ++ if (pid_alive(p)) { ++ if (p->pids[PIDTYPE_PID].pid->level == 0) ++ return PIDTYPE_PID; ++ if (p->pids[PIDTYPE_PGID].pid->level == 0) ++ return PIDTYPE_PGID; ++ if (p->pids[PIDTYPE_SID].pid->level == 0) ++ return PIDTYPE_SID; ++ } ++ ++ return PIDTYPE_MAX; ++} ++ ++enum ++{ ++ OBSTACLE_NOGO = -1, ++ OBSTACLE_TIMEOUT = -2, ++ OBSTACLE_TRYAGAIN = -3, ++}; ++ ++#define SUSPEND_TIMEOUT (10UL*HZ) ++ ++static int vps_stop_tasks(struct cpt_context *ctx) ++{ ++ unsigned long start_time = jiffies; ++ unsigned long target, timeout; ++ struct task_struct *p, *g; ++ int todo; ++ int round = 0; ++ ++ do_gettimespec(&ctx->start_time); ++ do_posix_clock_monotonic_gettime(&ctx->cpt_monotonic_time); ++ ctx->virt_jiffies64 = get_jiffies_64() + get_exec_env()->jiffies_fixup; ++ ++ read_lock(&tasklist_lock); ++ ++ atomic_inc(&get_exec_env()->suspend); ++ timeout = HZ/5; ++ target = jiffies + timeout; ++ ++ for(;;) { ++ struct task_struct *root; ++ todo = 0; ++ ++ root = find_task_by_vpid(1); ++ if (!root) { ++ read_unlock(&tasklist_lock); ++ eprintk_ctx("cannot find ve init\n"); ++ atomic_dec(&get_exec_env()->suspend); ++ return -ESRCH; ++ } ++ ++ do_each_thread_ve(g, p) { ++ if (vps_child_level(root, p) >= 0) { ++ switch (check_process_external(p)) { ++ case PIDTYPE_PID: ++ eprintk_ctx("external process %d/%d(%s) inside CT (e.g. vzctl enter or vzctl exec).\n", ++ task_pid_vnr(p), p->pid, p->comm); ++ todo = OBSTACLE_NOGO; ++ goto out; ++ case PIDTYPE_PGID: ++ eprintk_ctx("external process group %d/%d(%s) inside CT " ++ "(e.g. vzctl enter or vzctl exec).\n", ++ task_pgrp_vnr(p), p->pid, p->comm); ++ todo = OBSTACLE_NOGO; ++ goto out; ++ case PIDTYPE_SID: ++ eprintk_ctx("external process session %d/%d(%s) inside CT " ++ "(e.g. vzctl enter or vzctl exec).\n", ++ task_session_vnr(p), p->pid, p->comm); ++ todo = OBSTACLE_NOGO; ++ goto out; ++ } ++ if (p->vfork_done) { ++ /* Task between vfork()...exec() ++ * cannot be frozen, because parent ++ * wait in uninterruptible state. ++ * So, we do nothing, waiting for ++ * exec(), unless: ++ */ ++ if (p->state == TASK_STOPPED || ++ p->state == TASK_TRACED) { ++ eprintk_ctx("task " CPT_FID " is stopped while vfork(). " ++ "Checkpointing is impossible.\n", ++ CPT_TID(p)); ++ todo = OBSTACLE_NOGO; ++ /* It is fatal, _user_ stopped ++ * vfork()ing task, so that we ++ * cannot suspend now. ++ */ ++ } else { ++ todo = OBSTACLE_TRYAGAIN; ++ } ++ goto out; ++ } ++ if (p->signal->group_exit_task && ++ p->signal->notify_count) { ++ /* exec() waits for threads' death */ ++ wprintk_ctx("task " CPT_FID " waits for threads' death\n", CPT_TID(p)); ++ todo = OBSTACLE_TRYAGAIN; ++ goto out; ++ } ++ if (p->state == TASK_TRACED ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) ++ && !p->stopped_state ++#endif ++ ) { ++ int ptrace_id = p->pn_state; ++ /* Debugger waits for signal. */ ++ switch (ptrace_id) { ++ case PN_STOP_TF: ++ case PN_STOP_TF_RT: ++ case PN_STOP_ENTRY: ++ case PN_STOP_FORK: ++ case PN_STOP_VFORK: ++ case PN_STOP_SIGNAL: ++ case PN_STOP_EXIT: ++ case PN_STOP_LEAVE: ++ break; ++ default: ++ eprintk_ctx("task " CPT_FID " is stopped by debugger while %d.\n", CPT_TID(p), ptrace_id); ++ todo = OBSTACLE_NOGO; ++ goto out; ++ } ++ } ++#ifdef CONFIG_UTRACE ++ if (check_utrace(p, root, ctx)) { ++ eprintk_ctx("task " CPT_FID " is utraced. Checkpointing is impossible.\n", CPT_TID(p)); ++ todo = OBSTACLE_NOGO; ++ goto out; ++ } ++#endif ++ if (p->flags & PF_NOFREEZE) { ++ eprintk_ctx("task " CPT_FID " is unfreezable. Checkpointing is impossible.\n", CPT_TID(p)); ++ todo = OBSTACLE_NOGO; ++ goto out; ++ } ++ ++ if (!freezable(p)) ++ continue; ++ ++ spin_lock_irq(&p->sighand->siglock); ++ if (!(p->flags & PF_FROZEN)) { ++ set_tsk_thread_flag(p, TIF_FREEZE); ++ signal_wake_up(p, 0); ++ } ++ spin_unlock_irq(&p->sighand->siglock); ++ ++ if (p->flags & PF_FROZEN) { ++ if (p->state != TASK_UNINTERRUPTIBLE) ++ printk("Holy Crap 1 %ld " CPT_FID "\n", p->state, CPT_TID(p)); ++ continue; ++ } ++ ++ if (round == 10) ++ wprintk_ctx(CPT_FID " is running\n", CPT_TID(p)); ++ ++ todo++; ++ } else { ++ if (p != current) { ++ eprintk_ctx("foreign process %d/%d(%s) inside CT (e.g. vzctl enter or vzctl exec).\n", ++ task_pid_vnr(p), task_pid_nr(p), p->comm); ++ todo = OBSTACLE_NOGO; ++ goto out; ++ } ++ } ++ } while_each_thread_ve(g, p); ++ ++ if (todo > 0) { ++ /* No visible obstacles, but VE did not freeze ++ * for timeout. Interrupt suspend, if it is major ++ * timeout or signal; if it is minor timeout ++ * we will wake VE and restart suspend. ++ */ ++ if (time_after(jiffies, start_time + SUSPEND_TIMEOUT) ++ || signal_pending(current)) ++ todo = OBSTACLE_TIMEOUT; ++ else if (time_after(jiffies, target)) ++ todo = OBSTACLE_TRYAGAIN; ++ } ++ ++out: ++ if (todo < 0) { ++ atomic_dec(&get_exec_env()->suspend); ++ ++ wake_ve(ctx); ++ ++#if 0 ++ /* This is sign of failure of printk(), which is not ++ * ours. So, no prefixes. */ ++ printk(">\n"); ++#endif ++ } ++ ++ read_unlock(&tasklist_lock); ++ ++ if (!todo) { ++ atomic_dec(&get_exec_env()->suspend); ++ return 0; ++ } ++ ++ switch (todo) { ++ case OBSTACLE_NOGO: ++ eprintk_ctx("suspend is impossible now.\n"); ++ return -EAGAIN; ++ ++ case OBSTACLE_TIMEOUT: ++ eprintk_ctx("interrupted or timed out.\n"); ++ return -EINTR; ++ ++ case OBSTACLE_TRYAGAIN: ++ if (time_after(jiffies, start_time + SUSPEND_TIMEOUT) || ++ signal_pending(current)) { ++ wprintk_ctx("suspend timed out\n"); ++ return -EAGAIN; ++ } ++ ++ wprintk_ctx("minor suspend timeout (%lu) expired, " ++ "trying again\n", timeout); ++ ++ /* Try again. VE is awake, give it some time to run. */ ++ current->state = TASK_INTERRUPTIBLE; ++ schedule_timeout(HZ); ++ ++ /* After a short wait restart suspend ++ * with longer timeout */ ++ atomic_inc(&get_exec_env()->suspend); ++ timeout = min(timeout<<1, SUSPEND_TIMEOUT); ++ target = jiffies + timeout; ++ break; ++ ++ default: ++ if (round > 0) { ++ /* VE is partially frozen, give processes ++ * a chance to enter to refrigerator(). */ ++ current->state = TASK_INTERRUPTIBLE; ++ schedule_timeout(HZ/20); ++ } else { ++ yield(); ++ } ++ } ++ ++ read_lock(&tasklist_lock); ++ round++; ++ } ++} ++ ++static int cpt_unlock_ve(struct cpt_context *ctx) ++{ ++ struct ve_struct *env; ++ ++ env = get_ve_by_id(ctx->ve_id); ++ if (!env) ++ return -ESRCH; ++ down_write(&env->op_sem); ++ env->is_locked = 0; ++ up_write(&env->op_sem); ++ put_ve(env); ++ return 0; ++} ++ ++int cpt_resume(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ virtinfo_notifier_call(VITYPE_SCP, VIRTINFO_SCP_DMPFIN, ctx); ++ ++ cpt_unlock_sockets(ctx); ++ ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ if (ctx->pgin_task) { ++ wait_for_completion(&ctx->pgin_notify); ++ put_task_struct(ctx->pgin_task); ++ ctx->pgin_task = NULL; ++ } ++#endif ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ ++ spin_lock_irq(&tsk->sighand->siglock); ++ if (tsk->flags & PF_FROZEN) { ++ tsk->flags &= ~PF_FROZEN; ++ wake_up_process(tsk); ++ } else if (freezable(tsk)) { ++ eprintk_ctx("strange, %s not frozen\n", tsk->comm ); ++ } ++ spin_unlock_irq(&tsk->sighand->siglock); ++ put_task_struct(tsk); ++ } ++ ++ cpt_resume_network(ctx); ++ ++ cpt_unlock_ve(ctx); ++ ++ cpt_finish_ubc(ctx); ++ cpt_object_destroy(ctx); ++ return 0; ++} ++ ++int cpt_kill(struct cpt_context *ctx) ++{ ++ int err = 0; ++ struct ve_struct *env; ++ cpt_object_t *obj; ++ struct task_struct *root_task = NULL; ++ long delay; ++ ++ if (!ctx->ve_id) ++ return -EINVAL; ++ ++ env = get_ve_by_id(ctx->ve_id); ++ if (!env) ++ return -ESRCH; ++ ++ /* from here cpt_kill succeeds */ ++ virtinfo_notifier_call(VITYPE_SCP, VIRTINFO_SCP_DMPFIN, ctx); ++ ++ if (current->ve_task_info.owner_env == env) { ++ wprintk_ctx("attempt to kill ve from inside, escaping...\n"); ++ ve_move_task(current, get_ve0()); ++ } ++ ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ if (ctx->pgin_task) { ++ wait_for_completion(&ctx->pgin_notify); ++ put_task_struct(ctx->pgin_task); ++ ctx->pgin_task = NULL; ++ } ++#endif ++ ++ cpt_kill_sockets(ctx); ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ ++ if (tsk->exit_state) { ++ put_task_struct(tsk); ++ continue; ++ } ++ ++ if (task_pid_vnr(tsk) == 1) { ++ root_task = tsk; ++ continue; ++ } ++ ++ tsk->robust_list = NULL; ++#ifdef CONFIG_COMPAT ++ tsk->compat_robust_list = NULL; ++#endif ++ tsk->clear_child_tid = NULL; ++ ++ if (tsk->ptrace) { ++ write_lock_irq(&tasklist_lock); ++ tsk->ptrace = 0; ++ if (!list_empty(&tsk->ptrace_list)) { ++ list_del_init(&tsk->ptrace_list); ++ remove_parent(tsk); ++ tsk->parent = tsk->parent; ++ add_parent(tsk); ++ } ++ write_unlock_irq(&tasklist_lock); ++ } ++ ++ send_sig(SIGKILL, tsk, 1); ++ ++ spin_lock_irq(&tsk->sighand->siglock); ++ sigfillset(&tsk->blocked); ++ sigdelsetmask(&tsk->blocked, sigmask(SIGKILL)); ++ set_tsk_thread_flag(tsk, TIF_SIGPENDING); ++ if (tsk->flags & PF_FROZEN) ++ tsk->flags &= ~PF_FROZEN; ++ spin_unlock_irq(&tsk->sighand->siglock); ++ ++ wake_up_process(tsk); ++ put_task_struct(tsk); ++ } ++ ++ yield(); ++ ++ if (root_task != NULL) { ++ send_sig(SIGKILL, root_task, 1); ++ ++ spin_lock_irq(&root_task->sighand->siglock); ++ sigfillset(&root_task->blocked); ++ sigdelsetmask(&root_task->blocked, sigmask(SIGKILL)); ++ set_tsk_thread_flag(root_task, TIF_SIGPENDING); ++ clear_tsk_thread_flag(root_task, TIF_FREEZE); ++ if (root_task->flags & PF_FROZEN) ++ root_task->flags &= ~PF_FROZEN; ++ spin_unlock_irq(&root_task->sighand->siglock); ++ ++ wake_up_process(root_task); ++ put_task_struct(root_task); ++ } ++ ++ cpt_finish_ubc(ctx); ++ cpt_object_destroy(ctx); ++ ++ delay = 1; ++ while (atomic_read(&env->counter) != 1) { ++ if (signal_pending(current)) ++ break; ++ current->state = TASK_INTERRUPTIBLE; ++ delay = (delay < HZ) ? (delay << 1) : HZ; ++ schedule_timeout(delay); ++ } ++ put_ve(env); ++ ++ return err; ++} ++ ++#ifdef CONFIG_BEANCOUNTERS ++static void collect_task_ubc(struct task_struct *t, struct cpt_context *ctx) ++{ ++ struct task_beancounter *tbc; ++ ++ tbc = &(t->task_bc); ++ cpt_add_ubc(tbc->exec_ub, ctx); ++ cpt_add_ubc(tbc->task_ub, ctx); ++ cpt_add_ubc(tbc->fork_sub, ctx); ++} ++#else ++static void inline collect_task_ubc(struct task_struct *t, ++ struct cpt_context *ctx) ++{ return; } ++#endif ++ ++static cpt_object_t * remember_task(struct task_struct * child, ++ cpt_object_t * head, cpt_context_t * ctx) ++{ ++ cpt_object_t *cobj; ++ ++ if (freezable(child) && !(child->flags&PF_FROZEN)) { ++ eprintk_ctx("process " CPT_FID " is not frozen\n", CPT_TID(child)); ++ put_task_struct(child); ++ return NULL; ++ } ++ ++ if (lookup_cpt_object(CPT_OBJ_TASK, child, ctx)) BUG(); ++ if ((cobj = alloc_cpt_object(GFP_KERNEL, ctx)) == NULL) { ++ put_task_struct(child); ++ return NULL; ++ } ++ cobj->o_count = 1; ++ cpt_obj_setobj(cobj, child, ctx); ++ insert_cpt_object(CPT_OBJ_TASK, cobj, head, ctx); ++ collect_task_ubc(child, ctx); ++ return cobj; ++} ++ ++static int vps_collect_tasks(struct cpt_context *ctx) ++{ ++ int err = -ESRCH; ++ cpt_object_t *obj; ++ struct task_struct *root; ++ read_lock(&tasklist_lock); ++ root = find_task_by_vpid(1); ++ if (root) ++ get_task_struct(root); ++ read_unlock(&tasklist_lock); ++ ++ if (!root) { ++ err = -ESRCH; ++ eprintk_ctx("vps_collect_tasks: cannot find root\n"); ++ goto out; ++ } ++ ++ if ((obj = alloc_cpt_object(GFP_KERNEL, ctx)) == NULL) { ++ put_task_struct(root); ++ return -ENOMEM; ++ } ++ obj->o_count = 1; ++ cpt_obj_setobj(obj, root, ctx); ++ intern_cpt_object(CPT_OBJ_TASK, obj, ctx); ++ collect_task_ubc(root, ctx); ++ ++ /* Collect process subtree recursively */ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ cpt_object_t *head = obj; ++ struct task_struct *tsk = obj->o_obj; ++ struct task_struct *child; ++ ++ if (freezable(tsk) && !(tsk->flags&PF_FROZEN)) { ++ eprintk_ctx("process " CPT_FID " is not frozen\n", CPT_TID(tsk)); ++ err = -EINVAL; ++ goto out; ++ } ++ ++ if (tsk->state == TASK_RUNNING) ++ printk("Holy Crap 2 %ld " CPT_FID "\n", tsk->state, CPT_TID(tsk)); ++ ++ wait_task_inactive(tsk); ++ ++ err = check_task_state(tsk, ctx); ++ if (err) ++ goto out; ++ ++ if (tsk->pid == tsk->tgid) { ++ child = tsk; ++ for (;;) { ++ read_lock(&tasklist_lock); ++ child = next_thread(child); ++ if (child != tsk) ++ get_task_struct(child); ++ read_unlock(&tasklist_lock); ++ ++ if (child == tsk) ++ break; ++ ++ if (child->parent != tsk->parent) { ++ put_task_struct(child); ++ eprintk_ctx("illegal thread structure, kernel bug\n"); ++ err = -EINVAL; ++ goto out; ++ } ++ ++ if ((head = remember_task(child, head, ctx)) == NULL) { ++ eprintk_ctx("task obj allocation failure\n"); ++ err = -ENOMEM; ++ goto out; ++ } ++ } ++ } ++ ++ /* About locking. VE is frozen. But lists of children ++ * may change at least for init, when entered task reparents ++ * to init and when reparented task exits. If we take care ++ * of this case, we still can unlock while scanning ++ * tasklists. ++ */ ++ read_lock(&tasklist_lock); ++ list_for_each_entry(child, &tsk->children, sibling) { ++ if (child->parent != tsk) ++ continue; ++ if (child->pid != child->tgid) ++ continue; ++ get_task_struct(child); ++ read_unlock(&tasklist_lock); ++ ++ if ((head = remember_task(child, head, ctx)) == NULL) { ++ eprintk_ctx("task obj allocation failure\n"); ++ err = -ENOMEM; ++ goto out; ++ } ++ ++ read_lock(&tasklist_lock); ++ } ++ ++ list_for_each_entry(child, &tsk->ptrace_children, ptrace_list) { ++ if (child->parent != tsk) ++ continue; ++ if (child->pid != child->tgid) ++ continue; ++ get_task_struct(child); ++ read_unlock(&tasklist_lock); ++ ++ if ((head = remember_task(child, head, ctx)) == NULL) { ++ eprintk_ctx("task obj allocation failure\n"); ++ err = -ENOMEM; ++ goto out; ++ } ++ ++ read_lock(&tasklist_lock); ++ } ++ read_unlock(&tasklist_lock); ++ } ++ ++ return 0; ++ ++out: ++ while (!list_empty(&ctx->object_array[CPT_OBJ_TASK])) { ++ struct list_head *head = ctx->object_array[CPT_OBJ_TASK].next; ++ cpt_object_t *obj = list_entry(head, cpt_object_t, o_list); ++ struct task_struct *tsk; ++ ++ list_del(head); ++ tsk = obj->o_obj; ++ put_task_struct(tsk); ++ free_cpt_object(obj, ctx); ++ } ++ return err; ++} ++ ++static int cpt_collect(struct cpt_context *ctx) ++{ ++ int err; ++ ++ if ((err = cpt_collect_mm(ctx)) != 0) ++ return err; ++ ++ if ((err = cpt_collect_sysv(ctx)) != 0) ++ return err; ++ ++ if ((err = cpt_collect_files(ctx)) != 0) ++ return err; ++ ++ if ((err = cpt_collect_fs(ctx)) != 0) ++ return err; ++ ++ if ((err = cpt_collect_namespace(ctx)) != 0) ++ return err; ++ ++ if ((err = cpt_collect_signals(ctx)) != 0) ++ return err; ++ ++ if (virtinfo_notifier_call(VITYPE_SCP, ++ VIRTINFO_SCP_COLLECT, ctx) & NOTIFY_FAIL) ++ return -ECHRNG; ++ ++ return 0; ++} ++ ++static int cpt_dump_veinfo(cpt_context_t *ctx) ++{ ++ struct cpt_veinfo_image *i = cpt_get_buf(ctx); ++ struct ve_struct *ve; ++ struct timespec delta; ++ struct ipc_namespace *ns; ++ ++ cpt_open_section(ctx, CPT_SECT_VEINFO); ++ cpt_open_object(NULL, ctx); ++ ++ memset(i, 0, sizeof(*i)); ++ ++ i->cpt_next = CPT_NULL; ++ i->cpt_object = CPT_OBJ_VEINFO; ++ i->cpt_hdrlen = sizeof(*i); ++ i->cpt_content = CPT_CONTENT_VOID; ++ ++ ve = get_exec_env(); ++ ns = ve->ve_ns->ipc_ns; ++ ++ if (ns->shm_ctlall > 0xFFFFFFFFU) ++ i->shm_ctl_all = 0xFFFFFFFFU; ++ if (ns->shm_ctlmax > 0xFFFFFFFFU) ++ i->shm_ctl_max = 0xFFFFFFFFU; ++ i->shm_ctl_mni = ns->shm_ctlmni; ++ ++ i->msg_ctl_max = ns->msg_ctlmax; ++ i->msg_ctl_mni = ns->msg_ctlmni; ++ i->msg_ctl_mnb = ns->msg_ctlmnb; ++ ++ BUILD_BUG_ON(sizeof(ns->sem_ctls) != sizeof(i->sem_ctl_arr)); ++ i->sem_ctl_arr[0] = ns->sem_ctls[0]; ++ i->sem_ctl_arr[1] = ns->sem_ctls[1]; ++ i->sem_ctl_arr[2] = ns->sem_ctls[2]; ++ i->sem_ctl_arr[3] = ns->sem_ctls[3]; ++ ++ do_posix_clock_monotonic_gettime(&delta); ++ _set_normalized_timespec(&delta, ++ delta.tv_sec - ve->start_timespec.tv_sec, ++ delta.tv_nsec - ve->start_timespec.tv_nsec); ++ i->start_timespec_delta = cpt_timespec_export(&delta); ++ i->start_jiffies_delta = get_jiffies_64() - ve->start_jiffies; ++ ++ i->last_pid = ve->ve_ns->pid_ns->last_pid; ++ ++ ctx->write(i, sizeof(*i), ctx); ++ cpt_release_buf(ctx); ++ cpt_close_object(ctx); ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++static int cpt_dump_utsname(cpt_context_t *ctx) ++{ ++ int len; ++ struct cpt_object_hdr o; ++ struct ve_struct *ve; ++ struct uts_namespace *ns; ++ ++ cpt_open_section(ctx, CPT_SECT_UTSNAME); ++ ++ ve = get_exec_env(); ++ ns = ve->ve_ns->uts_ns; ++ ++ cpt_open_object(NULL, ctx); ++ len = strlen(ns->name.nodename); ++ o.cpt_next = CPT_NULL; ++ o.cpt_object = CPT_OBJ_NAME; ++ o.cpt_hdrlen = sizeof(o); ++ o.cpt_content = CPT_CONTENT_NAME; ++ ++ ctx->write(&o, sizeof(o), ctx); ++ ctx->write(ns->name.nodename, len+1, ctx); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ ++ cpt_open_object(NULL, ctx); ++ len = strlen(ns->name.domainname); ++ o.cpt_next = CPT_NULL; ++ o.cpt_object = CPT_OBJ_NAME; ++ o.cpt_hdrlen = sizeof(o); ++ o.cpt_content = CPT_CONTENT_NAME; ++ ++ ctx->write(&o, sizeof(o), ctx); ++ ctx->write(ns->name.domainname, len+1, ctx); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++#ifndef CONFIG_IA64 ++static int cpt_dump_vsyscall(cpt_context_t *ctx) ++{ ++ struct cpt_page_block *pgb = cpt_get_buf(ctx); ++ ++ cpt_open_section(ctx, CPT_SECT_VSYSCALL); ++ cpt_open_object(NULL, ctx); ++ ++ pgb->cpt_next = CPT_NULL; ++ pgb->cpt_object = CPT_OBJ_VSYSCALL; ++ pgb->cpt_hdrlen = sizeof(*pgb); ++ pgb->cpt_content = CPT_CONTENT_DATA; ++ pgb->cpt_start = cpt_ptr_export(vsyscall_addr); ++ pgb->cpt_end = pgb->cpt_start + PAGE_SIZE; ++ ++ ctx->write(pgb, sizeof(*pgb), ctx); ++ cpt_release_buf(ctx); ++ ++ ctx->write(vsyscall_addr, PAGE_SIZE, ctx); ++ ++ cpt_close_object(ctx); ++ cpt_close_section(ctx); ++ return 0; ++} ++#endif ++ ++int cpt_dump(struct cpt_context *ctx) ++{ ++ struct ve_struct *oldenv, *env; ++ struct nsproxy *old_ns; ++ int err, err2 = 0; ++ ++ if (!ctx->ve_id) ++ return -EINVAL; ++ ++ env = get_ve_by_id(ctx->ve_id); ++ if (!env) ++ return -ESRCH; ++ ++ down_read(&env->op_sem); ++ err = -ESRCH; ++ if (!env->is_running) ++ goto out_noenv; ++ if (!env->is_locked) ++ goto out_noenv; ++ err = -EINVAL; ++ if (env->ve_ns->pid_ns->flags & PID_NS_HIDDEN) { ++ printk(KERN_WARNING "CT: checkpointing not supported yet" ++ " for hidden pid namespaces.\n"); ++ goto out_noenv; ++ } ++ ++ oldenv = set_exec_env(env); ++ old_ns = current->nsproxy; ++ current->nsproxy = env->ve_ns; ++ ++ /* Phase 2: real checkpointing */ ++ err = cpt_open_dumpfile(ctx); ++ if (err) ++ goto out; ++ ++ cpt_major_hdr_out(ctx); ++ ++ if (!err) ++ err = cpt_dump_veinfo(ctx); ++ if (!err) ++ err = cpt_dump_ubc(ctx); ++ if (!err) ++ err = cpt_dump_files(ctx); ++ if (!err) ++ err = cpt_dump_files_struct(ctx); ++ if (!err) ++ err = cpt_dump_fs_struct(ctx); ++ /* netdevices should be dumped after dumping open files ++ as we need to restore netdevice binding to /dev/net/tun file */ ++ if (!err) ++ err = cpt_dump_ifinfo(ctx); ++ if (!err) ++ err = cpt_dump_namespace(ctx); ++ if (!err) ++ err = cpt_dump_sighand(ctx); ++ if (!err) ++ err = cpt_dump_vm(ctx); ++ if (!err) ++ err = cpt_dump_sysvsem(ctx); ++ if (!err) ++ err = cpt_dump_sysvmsg(ctx); ++ if (!err) ++ err = cpt_dump_tasks(ctx); ++ if (!err) ++ err = cpt_dump_orphaned_sockets(ctx); ++#if defined(CONFIG_VE_IPTABLES) && \ ++ (defined(CONFIG_IP_NF_CONNTRACK) || defined(CONFIG_IP_NF_CONNTRACK_MODULE)) ++ if (!err) ++ err = cpt_dump_ip_conntrack(ctx); ++#endif ++ if (!err) { ++ if (virtinfo_notifier_call(VITYPE_SCP, ++ VIRTINFO_SCP_DUMP, ctx) & NOTIFY_FAIL) ++ err = -ECHRNG; ++ } ++ if (!err) ++ err = cpt_dump_utsname(ctx); ++ ++#ifndef CONFIG_IA64 ++ if (!err) ++ err = cpt_dump_vsyscall(ctx); ++#endif ++ ++ if (!err) ++ err = cpt_dump_tail(ctx); ++ ++ err2 = cpt_close_dumpfile(ctx); ++ ++out: ++ current->nsproxy = old_ns; ++ set_exec_env(oldenv); ++out_noenv: ++ up_read(&env->op_sem); ++ put_ve(env); ++ return err ? : err2; ++} ++ ++int cpt_vps_suspend(struct cpt_context *ctx) ++{ ++ struct ve_struct *oldenv, *env; ++ struct nsproxy *old_ns; ++ int err = 0; ++ ++ ctx->kernel_config_flags = test_kernel_config(); ++ cpt_object_init(ctx); ++ ++ if (!ctx->ve_id) { ++ env = get_exec_env(); ++ if (env == get_ve0()) ++ return -EINVAL; ++ wprintk("undefined ve_id\n"); ++ ctx->ve_id = env->veid; ++ get_ve(env); ++ } else { ++ env = get_ve_by_id(ctx->ve_id); ++ if (!env) ++ return -ESRCH; ++ } ++ ++#ifdef CONFIG_VE_IPTABLES ++ ctx->iptables_mask = env->_iptables_modules; ++#endif ++ ctx->features = env->features; ++ ++ down_write(&env->op_sem); ++ err = -ESRCH; ++ if (!env->is_running) ++ goto out_noenv; ++ ++ err = -EBUSY; ++ if (env->is_locked) ++ goto out_noenv; ++ env->is_locked = 1; ++ downgrade_write(&env->op_sem); ++ ++ oldenv = set_exec_env(env); ++ old_ns = current->nsproxy; ++ current->nsproxy = env->ve_ns; ++ ++ /* Phase 0: find and stop all the tasks */ ++ if ((err = vps_stop_tasks(ctx)) != 0) ++ goto out; ++ ++ if ((err = cpt_suspend_network(ctx)) != 0) ++ goto out_wake; ++ ++ /* At the moment all the state is frozen. We do not need to lock ++ * the state, which can be changed only if the tasks are running. ++ */ ++ ++ /* Phase 1: collect task tree */ ++ if ((err = vps_collect_tasks(ctx)) != 0) ++ goto out_wake; ++ ++ /* Phase 1': collect all the resources */ ++ if ((err = cpt_collect(ctx)) != 0) ++ goto out; ++ ++out: ++ current->nsproxy = old_ns; ++ set_exec_env(oldenv); ++ up_read(&env->op_sem); ++ put_ve(env); ++ return err; ++ ++out_noenv: ++ up_write(&env->op_sem); ++ put_ve(env); ++ return err; ++ ++out_wake: ++ read_lock(&tasklist_lock); ++ wake_ve(ctx); ++ read_unlock(&tasklist_lock); ++ goto out; ++} ++ ++static void check_unsupported_netdevices(struct cpt_context *ctx, __u32 *caps) ++{ ++ struct net *net = get_exec_env()->ve_netns; ++ struct net_device *dev; ++ ++ read_lock(&dev_base_lock); ++ for_each_netdev(net, dev) { ++ if (dev != net->loopback_dev ++#if defined(CONFIG_VE_ETHDEV) || defined(CONFIG_VE_ETHDEV_MODULE) ++ && !(KSYMREF(veth_open) && dev->open == KSYMREF(veth_open)) ++#endif ++#if defined(CONFIG_VE_NETDEV) || defined(CONFIG_VE_NETDEV_MODULE) ++ && dev != get_exec_env()->_venet_dev ++#endif ++#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) ++ && dev->open != tun_net_open ++#endif ++ ) { ++ eprintk_ctx("unsupported netdevice %s\n", dev->name); ++ *caps |= (1<flags & _TIF_IA32)) ++ *caps |= flags & ((1<mm && p->mm->context.vdso) { ++ if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) ++ *caps |= flags & (1<mm && p->mm->context.vdso) ++ *caps |= flags & (1<= 0) { ++ switch (check_process_external(p)) { ++ case PIDTYPE_PID: ++ eprintk_ctx("external process %d/%d(%s) inside CT (e.g. vzctl enter or vzctl exec).\n", task_pid_vnr(p), p->pid, p->comm); ++ *caps |= (1<pid, p->comm); ++ *caps |= (1<pid, p->comm); ++ *caps |= (1<pid, p->comm); ++ *caps |= (1<nsproxy) { ++ ns = p->nsproxy->mnt_ns; ++ if (ns) ++ get_mnt_ns(ns); ++ } ++ task_unlock(p); ++ if (ns) { ++ if (ns != current->nsproxy->mnt_ns) { ++ eprintk_ctx("namespaces are not supported: process %d/%d(%s)\n", task_pid_vnr(p), p->pid, p->comm); ++ *caps |= (1<policy != SCHED_NORMAL) { ++ eprintk_ctx("scheduler policy is not supported %d/%d(%s)\n", task_pid_vnr(p), p->pid, p->comm); ++ *caps |= (1<pid, virt_pid(p), p->comm); ++ *caps |= (1<list) { ++ struct vfsmount *mnt = list_entry(p, struct vfsmount, mnt_list); ++ ++ spin_lock(&dcache_lock); ++ path = __d_path(mnt->mnt_root, mnt, ++ env->fs_root, env->fs_rootmnt, ++ path_buf, PAGE_SIZE); ++ spin_unlock(&dcache_lock); ++ if (IS_ERR(path)) ++ continue; ++ ++ if (check_one_vfsmount(mnt)) { ++ eprintk_ctx("Unsupported filesystem %s\n", mnt->mnt_sb->s_type->name); ++ *caps |= (1<ve_id) ++ return -EINVAL; ++ ++ env = get_ve_by_id(ctx->ve_id); ++ if (env == NULL) ++ return -ESRCH; ++ ++ down_read(&env->op_sem); ++ err = -ESRCH; ++ if (!env->is_running) { ++ eprintk_ctx("CT is not running\n"); ++ goto out_noenv; ++ } ++ ++ err = -EBUSY; ++ if (env->is_locked) { ++ eprintk_ctx("CT is locked\n"); ++ goto out_noenv; ++ } ++ ++ *caps = flags & (1<nsproxy; ++ current->nsproxy = env->ve_ns; ++ ++ check_unsupported_netdevices(ctx, caps); ++ ++ read_lock(&tasklist_lock); ++ root = find_task_by_vpid(1); ++ if (!root) { ++ read_unlock(&tasklist_lock); ++ eprintk_ctx("cannot find ve init\n"); ++ err = -ESRCH; ++ goto out; ++ } ++ get_task_struct(root); ++ for (p = __first_task_ve(env); p != NULL ; p = __next_task_ve(env, p)) ++ check_one_process(ctx, caps, flags, env, root, p); ++ read_unlock(&tasklist_lock); ++ ++ task_lock(root); ++ n = NULL; ++ if (root->nsproxy) { ++ n = root->nsproxy->mnt_ns; ++ if (n) ++ get_mnt_ns(n); ++ } ++ task_unlock(root); ++ if (n) { ++ char *path_buf; ++ ++ path_buf = (char *) __get_free_page(GFP_KERNEL); ++ if (!path_buf) { ++ put_mnt_ns(n); ++ err = -ENOMEM; ++ goto out_root; ++ } ++ ++ check_unsupported_mounts(ctx, caps, env, n, path_buf); ++ ++ free_page((unsigned long) path_buf); ++ put_mnt_ns(n); ++ } ++ ++ err = 0; ++ ++out_root: ++ put_task_struct(root); ++out: ++ current->nsproxy = old_ns; ++ set_exec_env(old_env); ++out_noenv: ++ up_read(&env->op_sem); ++ put_ve(env); ++ ++ return err; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_dump.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_dump.h +--- ./kernel/cpt/cpt_dump.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_dump.h 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,16 @@ ++int cpt_dump(struct cpt_context *cpt); ++int rst_undump(struct cpt_context *cpt); ++int cpt_suspend(struct cpt_context *cpt); ++int cpt_resume(struct cpt_context *cpt); ++int cpt_kill(struct cpt_context *cpt); ++int rst_clean(struct cpt_context *cpt); ++int rst_resume(struct cpt_context *cpt); ++int rst_kill(struct cpt_context *cpt); ++ ++int cpt_freeze_one(pid_t pid, int freeze); ++int cpt_vps_suspend(struct cpt_context *ctx); ++int vps_rst_undump(struct cpt_context *ctx); ++ ++int cpt_vps_caps(struct cpt_context *ctx, __u32 *caps); ++ ++int cpt_check_unsupported(struct task_struct *tsk, struct cpt_context *ctx); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_epoll.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_epoll.c +--- ./kernel/cpt/cpt_epoll.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_epoll.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,113 @@ ++/* ++ * ++ * kernel/cpt/cpt_epoll.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_files.h" ++#include "cpt_kernel.h" ++#include "cpt_fsmagic.h" ++#include "cpt_syscalls.h" ++ ++int cpt_dump_epolldev(cpt_object_t *obj, cpt_context_t *ctx) ++{ ++ int err = 0; ++ struct file *file = obj->o_obj; ++ struct eventpoll *ep; ++ struct rb_node *rbp; ++ struct cpt_epoll_image ei; ++ ++ if (file->f_op != &eventpoll_fops) { ++ eprintk_ctx("bad epoll file\n"); ++ return -EINVAL; ++ } ++ ++ ep = file->private_data; ++ ++ /* eventpoll.c does not protect open /proc/N/fd, silly. ++ * Opener will get an invalid file with uninitialized private_data ++ */ ++ if (unlikely(ep == NULL)) { ++ eprintk_ctx("bad epoll device\n"); ++ return -EINVAL; ++ } ++ ++ cpt_open_object(NULL, ctx); ++ ++ ei.cpt_next = CPT_NULL; ++ ei.cpt_object = CPT_OBJ_EPOLL; ++ ei.cpt_hdrlen = sizeof(ei); ++ ei.cpt_content = CPT_CONTENT_ARRAY; ++ ei.cpt_file = obj->o_pos; ++ ++ ctx->write(&ei, sizeof(ei), ctx); ++ ++ mutex_lock(&epmutex); ++ for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) { ++ loff_t saved_obj; ++ cpt_object_t *tobj; ++ struct cpt_epoll_file_image efi; ++ struct epitem *epi; ++ epi = rb_entry(rbp, struct epitem, rbn); ++ tobj = lookup_cpt_object(CPT_OBJ_FILE, epi->ffd.file, ctx); ++ if (tobj == NULL) { ++ eprintk_ctx("epoll device refers to an external file\n"); ++ err = -EBUSY; ++ break; ++ } ++ cpt_push_object(&saved_obj, ctx); ++ cpt_open_object(NULL, ctx); ++ ++ efi.cpt_next = CPT_NULL; ++ efi.cpt_object = CPT_OBJ_EPOLL_FILE; ++ efi.cpt_hdrlen = sizeof(efi); ++ efi.cpt_content = CPT_CONTENT_VOID; ++ efi.cpt_file = tobj->o_pos; ++ efi.cpt_fd = epi->ffd.fd; ++ efi.cpt_events = epi->event.events; ++ efi.cpt_data = epi->event.data; ++ efi.cpt_revents = 0; ++ efi.cpt_ready = 0; ++ if (!list_empty(&epi->rdllink)) ++ efi.cpt_ready = 1; ++ ++ ctx->write(&efi, sizeof(efi), ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ mutex_unlock(&epmutex); ++ ++ cpt_close_object(ctx); ++ ++ return err; ++} ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_exports.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_exports.c +--- ./kernel/cpt/cpt_exports.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_exports.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,13 @@ ++#include ++#include ++ ++#include "cpt_obj.h" ++ ++EXPORT_SYMBOL(alloc_cpt_object); ++EXPORT_SYMBOL(intern_cpt_object); ++EXPORT_SYMBOL(insert_cpt_object); ++EXPORT_SYMBOL(__cpt_object_add); ++EXPORT_SYMBOL(cpt_object_add); ++EXPORT_SYMBOL(cpt_object_get); ++EXPORT_SYMBOL(lookup_cpt_object); ++EXPORT_SYMBOL(lookup_cpt_obj_bypos); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_files.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_files.c +--- ./kernel/cpt/cpt_files.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_files.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,1625 @@ ++/* ++ * ++ * kernel/cpt/cpt_files.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_files.h" ++#include "cpt_socket.h" ++#include "cpt_kernel.h" ++#include "cpt_fsmagic.h" ++#include "cpt_syscalls.h" ++ ++void cpt_printk_dentry(struct dentry *d, struct vfsmount *mnt) ++{ ++ char *path; ++ unsigned long pg = __get_free_page(GFP_KERNEL); ++ ++ if (!pg) ++ return; ++ ++ path = d_path(d, mnt, (char *)pg, PAGE_SIZE); ++ ++ if (!IS_ERR(path)) ++ eprintk("<%s>", path); ++ free_page(pg); ++} ++ ++int cpt_verify_overmount(char *path, struct dentry *d, struct vfsmount *mnt, ++ int verify, cpt_context_t *ctx) ++{ ++ if (path[0] == '/' && !(!IS_ROOT(d) && d_unhashed(d))) { ++ struct nameidata nd; ++ if (path_lookup(path, 0, &nd)) { ++ eprintk_ctx("d_path cannot be looked up %s\n", path); ++ return -EINVAL; ++ } ++ if (nd.dentry != d || (verify && nd.mnt != mnt)) { ++ eprintk_ctx("d_path is invisible %s\n", path); ++ path_release(&nd); ++ return -EINVAL; ++ } ++ path_release(&nd); ++ } ++ return 0; ++} ++ ++static int ++cpt_replaced(struct dentry * de, struct vfsmount *mnt, cpt_context_t * ctx) ++{ ++ int result = 0; ++ ++#if defined(CONFIG_VZFS_FS) || defined(CONFIG_VZFS_FS_MODULE) ++ char *path; ++ unsigned long pg; ++ struct dentry * renamed_dentry; ++ ++ if (de->d_sb->s_magic != FSMAGIC_VEFS) ++ return 0; ++ if (de->d_inode->i_nlink != 0 || ++ atomic_read(&de->d_inode->i_writecount) > 0) ++ return 0; ++ ++ renamed_dentry = vefs_replaced_dentry(de); ++ if (renamed_dentry == NULL) ++ return 0; ++ ++ pg = __get_free_page(GFP_KERNEL); ++ if (!pg) ++ return 0; ++ ++ path = d_path(de, mnt, (char *)pg, PAGE_SIZE); ++ if (!IS_ERR(path)) { ++ int len; ++ struct nameidata nd; ++ ++ len = pg + PAGE_SIZE - 1 - (unsigned long)path; ++ if (len >= sizeof("(deleted) ") - 1 && ++ !memcmp(path, "(deleted) ", sizeof("(deleted) ") - 1)) { ++ len -= sizeof("(deleted) ") - 1; ++ path += sizeof("(deleted) ") - 1; ++ } ++ ++ if (path_lookup(path, 0, &nd) == 0) { ++ if (mnt == nd.mnt && ++ vefs_is_renamed_dentry(nd.dentry, renamed_dentry)) ++ result = 1; ++ path_release(&nd); ++ } ++ } ++ free_page(pg); ++#endif ++ return result; ++} ++ ++static int cpt_dump_dentry(struct dentry *d, struct vfsmount *mnt, ++ int replaced, int verify, cpt_context_t *ctx) ++{ ++ int len; ++ char *path; ++ char *pg = cpt_get_buf(ctx); ++ loff_t saved; ++ ++ path = d_path(d, mnt, pg, PAGE_SIZE); ++ len = PTR_ERR(path); ++ ++ if (IS_ERR(path)) { ++ struct cpt_object_hdr o; ++ char tmp[1]; ++ ++ /* VZ changes d_path() to return EINVAL, when path ++ * is not supposed to be visible inside VE. ++ * This changes behaviour of d_path() comparing ++ * to mainstream kernel, f.e. d_path() fails ++ * on any kind of shared memory. Maybe, there are ++ * another cases, but I am aware only about this one. ++ * So, we just ignore error on shmem mounts and proceed. ++ * Otherwise, checkpointing is prohibited because ++ * of reference to an invisible file. ++ */ ++ if (len != -EINVAL || ++ mnt != get_exec_env()->shmem_mnt) ++ eprintk_ctx("d_path err=%d\n", len); ++ else ++ len = 0; ++ ++ cpt_push_object(&saved, ctx); ++ cpt_open_object(NULL, ctx); ++ o.cpt_next = CPT_NULL; ++ o.cpt_object = CPT_OBJ_NAME; ++ o.cpt_hdrlen = sizeof(o); ++ o.cpt_content = CPT_CONTENT_NAME; ++ tmp[0] = 0; ++ ++ ctx->write(&o, sizeof(o), ctx); ++ ctx->write(tmp, 1, ctx); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved, ctx); ++ ++ __cpt_release_buf(ctx); ++ return len; ++ } else { ++ struct cpt_object_hdr o; ++ ++ len = pg + PAGE_SIZE - 1 - path; ++ if (replaced && ++ len >= sizeof("(deleted) ") - 1 && ++ !memcmp(path, "(deleted) ", sizeof("(deleted) ") - 1)) { ++ len -= sizeof("(deleted) ") - 1; ++ path += sizeof("(deleted) ") - 1; ++ } ++ o.cpt_next = CPT_NULL; ++ o.cpt_object = CPT_OBJ_NAME; ++ o.cpt_hdrlen = sizeof(o); ++ o.cpt_content = CPT_CONTENT_NAME; ++ path[len] = 0; ++ ++ if (cpt_verify_overmount(path, d, mnt, verify, ctx)) { ++ __cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ ++ cpt_push_object(&saved, ctx); ++ cpt_open_object(NULL, ctx); ++ ctx->write(&o, sizeof(o), ctx); ++ ctx->write(path, len+1, ctx); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved, ctx); ++ __cpt_release_buf(ctx); ++ } ++ return 0; ++} ++ ++int cpt_dump_string(const char *s, struct cpt_context *ctx) ++{ ++ int len; ++ struct cpt_object_hdr o; ++ ++ cpt_open_object(NULL, ctx); ++ len = strlen(s); ++ o.cpt_next = CPT_NULL; ++ o.cpt_object = CPT_OBJ_NAME; ++ o.cpt_hdrlen = sizeof(o); ++ o.cpt_content = CPT_CONTENT_NAME; ++ ++ ctx->write(&o, sizeof(o), ctx); ++ ctx->write(s, len+1, ctx); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ return 0; ++} ++ ++static int ++cpt_dump_filename(struct file *file, int replaced, cpt_context_t *ctx) ++{ ++ return cpt_dump_dentry(file->f_dentry, file->f_vfsmnt, replaced, 1, ctx); ++} ++ ++int cpt_dump_inode(struct dentry *d, struct vfsmount *mnt, struct cpt_context *ctx) ++{ ++ int err; ++ struct cpt_inode_image *v = cpt_get_buf(ctx); ++ struct kstat sbuf; ++ ++ v->cpt_next = sizeof(*v); ++ v->cpt_object = CPT_OBJ_INODE; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ if ((err = vfs_getattr(mnt, d, &sbuf)) != 0) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++ ++ v->cpt_dev = d->d_inode->i_sb->s_dev; ++ v->cpt_ino = d->d_inode->i_ino; ++ v->cpt_mode = sbuf.mode; ++ v->cpt_nlink = sbuf.nlink; ++ v->cpt_uid = sbuf.uid; ++ v->cpt_gid = sbuf.gid; ++ v->cpt_rdev = d->d_inode->i_rdev; ++ v->cpt_size = sbuf.size; ++ v->cpt_atime = cpt_timespec_export(&sbuf.atime); ++ v->cpt_mtime = cpt_timespec_export(&sbuf.mtime); ++ v->cpt_ctime = cpt_timespec_export(&sbuf.ctime); ++ v->cpt_blksize = sbuf.blksize; ++ v->cpt_blocks = sbuf.blocks; ++ v->cpt_sb = d->d_inode->i_sb->s_magic; ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ return 0; ++} ++ ++int cpt_collect_files(cpt_context_t * ctx) ++{ ++ int err; ++ cpt_object_t *obj; ++ int index = 0; ++ ++ /* Collect process fd sets */ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ if (tsk->files && cpt_object_add(CPT_OBJ_FILES, tsk->files, ctx) == NULL) ++ return -ENOMEM; ++ } ++ ++ /* Collect files from fd sets */ ++ for_each_object(obj, CPT_OBJ_FILES) { ++ int fd; ++ struct files_struct *f = obj->o_obj; ++ ++ cpt_obj_setindex(obj, index++, ctx); ++ ++ if (obj->o_count != atomic_read(&f->count)) { ++ eprintk_ctx("files_struct is referenced outside %d %d\n", obj->o_count, atomic_read(&f->count)); ++ return -EBUSY; ++ } ++ ++ for (fd = 0; fd < f->fdt->max_fds; fd++) { ++ struct file *file = fcheck_files(f, fd); ++ if (file && cpt_object_add(CPT_OBJ_FILE, file, ctx) == NULL) ++ return -ENOMEM; ++ } ++ } ++ ++ /* Collect files queued by AF_UNIX sockets. */ ++ if ((err = cpt_collect_passedfds(ctx)) < 0) ++ return err; ++ ++ /* OK. At this point we should count all the references. */ ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file = obj->o_obj; ++ struct file *parent; ++ cpt_object_t *ino_obj; ++ ++ if (obj->o_count != atomic_read(&file->f_count)) { ++ eprintk_ctx("file struct is referenced outside %d %d\n", obj->o_count, atomic_read(&file->f_count)); ++ cpt_printk_dentry(file->f_dentry, file->f_vfsmnt); ++ return -EBUSY; ++ } ++ ++ switch (file->f_dentry->d_inode->i_sb->s_magic) { ++ case FSMAGIC_FUTEX: ++ case FSMAGIC_MQUEUE: ++ case FSMAGIC_BDEV: ++#ifndef CONFIG_INOTIFY_USER ++ case FSMAGIC_INOTIFY: ++#endif ++ eprintk_ctx("file on unsupported FS: magic %08lx\n", file->f_dentry->d_inode->i_sb->s_magic); ++ return -EBUSY; ++ } ++ ++ /* Collect inode. It is necessary mostly to resolve deleted ++ * hard links. */ ++ ino_obj = cpt_object_add(CPT_OBJ_INODE, file->f_dentry->d_inode, ctx); ++ if (ino_obj == NULL) ++ return -ENOMEM; ++ ++ parent = ino_obj->o_parent; ++ if (!parent || (!IS_ROOT(parent->f_dentry) && d_unhashed(parent->f_dentry))) ++ ino_obj->o_parent = file; ++ ++ if (S_ISCHR(file->f_dentry->d_inode->i_mode)) { ++ int maj = imajor(file->f_dentry->d_inode); ++ if (maj == PTY_MASTER_MAJOR || ++ (maj >= UNIX98_PTY_MASTER_MAJOR && ++ maj < UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT) || ++ maj == PTY_SLAVE_MAJOR || ++ maj == UNIX98_PTY_SLAVE_MAJOR || ++ maj == TTYAUX_MAJOR) { ++ err = cpt_collect_tty(file, ctx); ++ if (err) ++ return err; ++ } ++ } ++ ++ if (S_ISSOCK(file->f_dentry->d_inode->i_mode)) { ++ err = cpt_collect_socket(file, ctx); ++ if (err) ++ return err; ++ } ++ } ++ ++ err = cpt_index_sockets(ctx); ++ ++ return err; ++} ++ ++/* /dev/ptmx is special, all the files share one inode, but real tty backend ++ * is attached via file->private_data. ++ */ ++ ++static inline int is_cloning_inode(struct inode *ino) ++{ ++ return S_ISCHR(ino->i_mode) && ++ ino->i_rdev == MKDEV(TTYAUX_MAJOR,2); ++} ++ ++static int dump_one_flock(struct file_lock *fl, int owner, struct cpt_context *ctx) ++{ ++ pid_t pid; ++ struct cpt_flock_image *v = cpt_get_buf(ctx); ++ ++ v->cpt_next = sizeof(*v); ++ v->cpt_object = CPT_OBJ_FLOCK; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_VOID; ++ ++ v->cpt_owner = owner; ++ ++ pid = fl->fl_pid; ++ if (pid) { ++ pid = pid_to_vpid(fl->fl_pid); ++ if (pid == -1) { ++ if (!(fl->fl_flags&FL_FLOCK)) { ++ eprintk_ctx("posix lock from another container?\n"); ++ cpt_release_buf(ctx); ++ return -EBUSY; ++ } ++ pid = 0; ++ } ++ } ++ ++ v->cpt_pid = pid; ++ v->cpt_start = fl->fl_start; ++ v->cpt_end = fl->fl_end; ++ v->cpt_flags = fl->fl_flags; ++ v->cpt_type = fl->fl_type; ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ return 0; ++} ++ ++ ++int cpt_dump_flock(struct file *file, struct cpt_context *ctx) ++{ ++ int err = 0; ++ struct file_lock *fl; ++ ++ lock_kernel(); ++ for (fl = file->f_dentry->d_inode->i_flock; ++ fl; fl = fl->fl_next) { ++ if (file != fl->fl_file) ++ continue; ++ if (fl->fl_flags & FL_LEASE) { ++ eprintk_ctx("lease lock is not supported\n"); ++ err = -EINVAL; ++ break; ++ } ++ if (fl->fl_flags & FL_POSIX) { ++ cpt_object_t *obj; ++ obj = lookup_cpt_object(CPT_OBJ_FILES, fl->fl_owner, ctx); ++ if (obj) { ++ dump_one_flock(fl, obj->o_index, ctx); ++ continue; ++ } else { ++ eprintk_ctx("unknown lock owner %p\n", fl->fl_owner); ++ err = -EINVAL; ++ } ++ } ++ if (fl->fl_flags & FL_FLOCK) { ++ dump_one_flock(fl, -1, ctx); ++ continue; ++ } ++ } ++ unlock_kernel(); ++ return err; ++} ++ ++static int dump_one_file(cpt_object_t *obj, struct file *file, cpt_context_t *ctx) ++{ ++ int err = 0; ++ cpt_object_t *iobj; ++ struct cpt_file_image *v = cpt_get_buf(ctx); ++ struct kstat sbuf; ++ int replaced = 0; ++ ++ cpt_open_object(obj, ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_FILE; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_flags = file->f_flags; ++ v->cpt_mode = file->f_mode; ++ v->cpt_pos = file->f_pos; ++ v->cpt_uid = file->f_uid; ++ v->cpt_gid = file->f_gid; ++ ++ vfs_getattr(file->f_vfsmnt, file->f_dentry, &sbuf); ++ ++ v->cpt_i_mode = sbuf.mode; ++ v->cpt_lflags = 0; ++ if (IS_ROOT(file->f_dentry)) ++ v->cpt_lflags |= CPT_DENTRY_ROOT; ++ else if (d_unhashed(file->f_dentry)) { ++ if (cpt_replaced(file->f_dentry, file->f_vfsmnt, ctx)) { ++ v->cpt_lflags |= CPT_DENTRY_REPLACED; ++ replaced = 1; ++ } else { ++ v->cpt_lflags |= CPT_DENTRY_DELETED; ++ } ++ } ++ if (is_cloning_inode(file->f_dentry->d_inode)) ++ v->cpt_lflags |= CPT_DENTRY_CLONING; ++ if (file->f_dentry->d_inode->i_sb->s_magic == FSMAGIC_PROC) ++ v->cpt_lflags |= CPT_DENTRY_PROC; ++ v->cpt_inode = CPT_NULL; ++ if (!(v->cpt_lflags & CPT_DENTRY_REPLACED)) { ++ iobj = lookup_cpt_object(CPT_OBJ_INODE, file->f_dentry->d_inode, ctx); ++ if (iobj) ++ v->cpt_inode = iobj->o_pos; ++ } ++ v->cpt_priv = CPT_NULL; ++ v->cpt_fown_fd = -1; ++ if (S_ISCHR(v->cpt_i_mode)) { ++ iobj = lookup_cpt_object(CPT_OBJ_TTY, file->private_data, ctx); ++ if (iobj) { ++ v->cpt_priv = iobj->o_pos; ++ if (file->f_flags&FASYNC) ++ v->cpt_fown_fd = cpt_tty_fasync(file, ctx); ++ } ++#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) ++ if (file->f_op && file->f_op->open == tun_chr_open) ++ v->cpt_lflags |= CPT_DENTRY_TUNTAP; ++#endif ++ } ++ if (S_ISSOCK(v->cpt_i_mode)) { ++ if (obj->o_index < 0) { ++ eprintk_ctx("BUG: no socket index\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ v->cpt_priv = obj->o_index; ++ if (file->f_flags&FASYNC) ++ v->cpt_fown_fd = cpt_socket_fasync(file, ctx); ++ } ++ if (file->f_op == &eventpoll_fops) { ++ v->cpt_priv = file->f_dentry->d_inode->i_ino; ++ v->cpt_lflags |= CPT_DENTRY_EPOLL; ++ } ++ if (file->f_dentry->d_inode->i_sb->s_magic == FSMAGIC_INOTIFY) { ++ v->cpt_priv = file->f_dentry->d_inode->i_ino; ++ v->cpt_lflags |= CPT_DENTRY_INOTIFY; ++ } ++ ++ v->cpt_fown_pid = (file->f_owner.pid == NULL ? ++ CPT_FOWN_STRAY_PID : pid_vnr(file->f_owner.pid)); ++ v->cpt_fown_uid = file->f_owner.uid; ++ v->cpt_fown_euid = file->f_owner.euid; ++ v->cpt_fown_signo = file->f_owner.signum; ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ if (!S_ISSOCK(v->cpt_i_mode)) { ++ err = cpt_dump_filename(file, replaced, ctx); ++ if (err) ++ return err; ++ if ((file->f_mode & FMODE_WRITE) && ++ file->f_dentry->d_inode->i_sb->s_magic == FSMAGIC_VEFS) ++ vefs_track_notify(file->f_dentry, 1); ++ } ++ ++ if (file->f_dentry->d_inode->i_flock) ++ err = cpt_dump_flock(file, ctx); ++ ++ cpt_close_object(ctx); ++ ++ return err; ++} ++ ++/* About this weird function... Crappy code dealing with SYSV shared memory ++ * defines TMPFS inode and file with f_op doing only mmap. So... ++ * Maybe, this is wrong and leaks something. It is clear access to ++ * SYSV shmem via mmap is quite unusual and impossible from user space. ++ */ ++static int dump_content_shm(struct file *file, struct cpt_context *ctx) ++{ ++ struct cpt_obj_bits *v; ++ loff_t saved_pos; ++ unsigned long addr; ++ ++ addr = do_mmap_pgoff(file, 0, file->f_dentry->d_inode->i_size, ++ PROT_READ, MAP_SHARED, 0); ++ if (IS_ERR((void*)addr)) ++ return PTR_ERR((void*)addr); ++ ++ cpt_push_object(&saved_pos, ctx); ++ cpt_open_object(NULL, ctx); ++ v = cpt_get_buf(ctx); ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_BITS; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_DATA; ++ v->cpt_size = file->f_dentry->d_inode->i_size; ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ctx->write((void*)addr, file->f_dentry->d_inode->i_size, ctx); ++ ctx->align(ctx); ++ do_munmap(current->mm, addr, file->f_dentry->d_inode->i_size); ++ ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_pos, ctx); ++ return 0; ++} ++ ++static int data_is_zero(char *addr, int len) ++{ ++ int i; ++ unsigned long zerolong = 0; ++ ++ for (i=0; if_op == NULL) ++ return -EINVAL; ++ ++ do_read = file->f_op->read; ++ if (file->f_op == &shm_file_operations) { ++ struct shm_file_data *sfd = file->private_data; ++ ++ cpt_dump_content_sysvshm(sfd->file, ctx); ++ ++ return 0; ++ } ++ if (file->f_op == &shmem_file_operations) { ++ do_read = file->f_dentry->d_inode->i_fop->read; ++ cpt_dump_content_sysvshm(file, ctx); ++ if (!do_read) { ++ wprintk_ctx("TMPFS is not configured?\n"); ++ return dump_content_shm(file, ctx); ++ } ++ } ++ ++ if (!(file->f_mode & FMODE_READ) || ++ (file->f_flags & O_DIRECT)) { ++ struct file *filp; ++ filp = dentry_open(dget(file->f_dentry), ++ mntget(file->f_vfsmnt), ++ O_RDONLY | O_LARGEFILE); ++ if (IS_ERR(filp)) { ++ cpt_printk_dentry(file->f_dentry, file->f_vfsmnt); ++ eprintk_ctx("cannot reopen file for read %ld\n", PTR_ERR(filp)); ++ return PTR_ERR(filp); ++ } ++ file = filp; ++ } else { ++ atomic_inc(&file->f_count); ++ } ++ ++ for (;;) { ++ mm_segment_t oldfs; ++ int err; ++ ++ (void)cpt_get_buf(ctx); ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ err = do_read(file, ctx->tmpbuf, PAGE_SIZE, &pos); ++ set_fs(oldfs); ++ if (err < 0) { ++ eprintk_ctx("dump_content_regular: do_read: %d", err); ++ fput(file); ++ __cpt_release_buf(ctx); ++ return err; ++ } ++ if (err == 0) { ++ __cpt_release_buf(ctx); ++ break; ++ } ++ if (data_is_zero(ctx->tmpbuf, err)) { ++ if (obj_opened != CPT_NULL) { ++ ctx->pwrite(&pgb.cpt_end, 8, ctx, obj_opened + offsetof(struct cpt_page_block, cpt_end)); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_pos, ctx); ++ obj_opened = CPT_NULL; ++ } ++ } else { ++ if (obj_opened == CPT_NULL) { ++ cpt_push_object(&saved_pos, ctx); ++ cpt_open_object(NULL, ctx); ++ obj_opened = ctx->file->f_pos; ++ pgb.cpt_next = CPT_NULL; ++ pgb.cpt_object = CPT_OBJ_PAGES; ++ pgb.cpt_hdrlen = sizeof(pgb); ++ pgb.cpt_content = CPT_CONTENT_DATA; ++ pgb.cpt_start = pos - err; ++ pgb.cpt_end = pgb.cpt_start; ++ ctx->write(&pgb, sizeof(pgb), ctx); ++ } ++ ctx->write(ctx->tmpbuf, err, ctx); ++ pgb.cpt_end += err; ++ } ++ __cpt_release_buf(ctx); ++ } ++ ++ fput(file); ++ ++ if (obj_opened != CPT_NULL) { ++ ctx->pwrite(&pgb.cpt_end, 8, ctx, obj_opened + offsetof(struct cpt_page_block, cpt_end)); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_pos, ctx); ++ obj_opened = CPT_NULL; ++ } ++ return 0; ++} ++ ++ ++static int dump_content_chrdev(struct file *file, struct cpt_context *ctx) ++{ ++ struct inode *ino = file->f_dentry->d_inode; ++ int maj; ++ ++ maj = imajor(ino); ++ if (maj == MEM_MAJOR) { ++ /* Well, OK. */ ++ return 0; ++ } ++ if (maj == PTY_MASTER_MAJOR || ++ (maj >= UNIX98_PTY_MASTER_MAJOR && ++ maj < UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT) || ++ maj == PTY_SLAVE_MAJOR || ++ maj == UNIX98_PTY_SLAVE_MAJOR || ++ maj == TTYAUX_MAJOR) { ++ return cpt_dump_content_tty(file, ctx); ++ } ++#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) ++ if (file->f_op && file->f_op->open == tun_chr_open) ++ return 0; ++#endif ++ eprintk_ctx("unsupported chrdev %d/%d\n", maj, iminor(ino)); ++ return -EINVAL; ++} ++ ++static int dump_content_blkdev(struct file *file, struct cpt_context *ctx) ++{ ++ struct inode *ino = file->f_dentry->d_inode; ++ ++ /* We are not going to transfer them. */ ++ eprintk_ctx("unsupported blkdev %d/%d\n", imajor(ino), iminor(ino)); ++ return -EINVAL; ++} ++ ++static int dump_content_fifo(struct file *file, struct cpt_context *ctx) ++{ ++ struct inode *ino = file->f_dentry->d_inode; ++ cpt_object_t *obj; ++ loff_t saved_pos; ++ int readers; ++ int writers; ++ int anon = 0; ++ ++ mutex_lock(&ino->i_mutex); ++ readers = ino->i_pipe->readers; ++ writers = ino->i_pipe->writers; ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file1 = obj->o_obj; ++ if (file1->f_dentry->d_inode == ino) { ++ if (file1->f_mode & FMODE_READ) ++ readers--; ++ if (file1->f_mode & FMODE_WRITE) ++ writers--; ++ } ++ } ++ mutex_unlock(&ino->i_mutex); ++ if (readers || writers) { ++ struct dentry *dr = file->f_dentry->d_sb->s_root; ++ if (dr->d_name.len == 7 && memcmp(dr->d_name.name,"pipefs:",7) == 0) ++ anon = 1; ++ ++ if (anon) { ++ eprintk_ctx("pipe has %d/%d external readers/writers\n", readers, writers); ++ return -EBUSY; ++ } ++ /* If fifo has external readers/writers, we are in troubles. ++ * If the buffer is not empty, we must move its content. ++ * But if the fifo is owned by a service, we cannot do ++ * this. See? ++ * ++ * For now we assume, that if fifo is opened by another ++ * process, we do not own it and, hence, migrate without ++ * data. ++ */ ++ return 0; ++ } ++ ++ /* OK, we must save fifo state. No semaphores required. */ ++ ++ if (ino->i_pipe->nrbufs) { ++ struct cpt_obj_bits *v = cpt_get_buf(ctx); ++ struct pipe_inode_info *info; ++ int count, buf, nrbufs; ++ ++ mutex_lock(&ino->i_mutex); ++ info = ino->i_pipe; ++ count = 0; ++ buf = info->curbuf; ++ nrbufs = info->nrbufs; ++ while (--nrbufs >= 0) { ++ if (!info->bufs[buf].ops->can_merge) { ++ mutex_unlock(&ino->i_mutex); ++ eprintk_ctx("unknown format of pipe buffer\n"); ++ return -EINVAL; ++ } ++ count += info->bufs[buf].len; ++ buf = (buf+1) & (PIPE_BUFFERS-1); ++ } ++ ++ if (!count) { ++ mutex_unlock(&ino->i_mutex); ++ return 0; ++ } ++ ++ cpt_push_object(&saved_pos, ctx); ++ cpt_open_object(NULL, ctx); ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_BITS; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_DATA; ++ v->cpt_size = count; ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ count = 0; ++ buf = info->curbuf; ++ nrbufs = info->nrbufs; ++ while (--nrbufs >= 0) { ++ struct pipe_buffer *b = info->bufs + buf; ++ /* need to ->pin first? */ ++ void * addr = b->ops->map(info, b, 0); ++ ctx->write(addr + b->offset, b->len, ctx); ++ b->ops->unmap(info, b, addr); ++ buf = (buf+1) & (PIPE_BUFFERS-1); ++ } ++ ++ mutex_unlock(&ino->i_mutex); ++ ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_pos, ctx); ++ } ++ ++ return 0; ++} ++ ++static int dump_content_socket(struct file *file, struct cpt_context *ctx) ++{ ++ return 0; ++} ++ ++struct cpt_dirent { ++ unsigned long ino; ++ char *name; ++ int namelen; ++ int found; ++}; ++ ++static int cpt_filldir(void * __buf, const char * name, int namelen, ++ loff_t offset, u64 ino, unsigned int d_type) ++{ ++ struct cpt_dirent * dirent = __buf; ++ ++ if ((ino == dirent->ino) && (namelen < PAGE_SIZE - 1)) { ++ memcpy(dirent->name, name, namelen); ++ dirent->name[namelen] = '\0'; ++ dirent->namelen = namelen; ++ dirent->found = 1; ++ return 1; ++ } ++ return 0; ++} ++ ++static int find_linked_dentry(struct dentry *d, struct vfsmount *mnt, ++ struct inode *ino, struct cpt_context *ctx) ++{ ++ int err = -EBUSY; ++ struct file *f = NULL; ++ struct cpt_dirent entry; ++ struct dentry *de, *found = NULL; ++ ++ dprintk_ctx("deleted reference to existing inode, try to find file\n"); ++ /* 1. Try to find not deleted dentry in ino->i_dentry list */ ++ spin_lock(&dcache_lock); ++ list_for_each_entry(de, &ino->i_dentry, d_alias) { ++ if (!IS_ROOT(de) && d_unhashed(de)) ++ continue; ++ found = de; ++ dget_locked(found); ++ break; ++ } ++ spin_unlock(&dcache_lock); ++ if (found) { ++ err = cpt_dump_dentry(found, mnt, 0, 1, ctx); ++ dput(found); ++ if (!err) { ++ dprintk_ctx("dentry found in aliases\n"); ++ return 0; ++ } ++ } ++ ++ /* 2. Try to find file in current dir */ ++ de = dget_parent(d); ++ if (!de) ++ return -EINVAL; ++ ++ mntget(mnt); ++ f = dentry_open(de, mnt, O_RDONLY | O_LARGEFILE); ++ if (IS_ERR(f)) ++ return PTR_ERR(f); ++ ++ entry.ino = ino->i_ino; ++ entry.name = cpt_get_buf(ctx); ++ entry.found = 0; ++ err = vfs_readdir(f, cpt_filldir, &entry); ++ if (err || !entry.found) { ++ err = err ? err : -ENOENT; ++ goto err_readdir; ++ } ++ ++ found = lookup_one_len(entry.name, de, entry.namelen); ++ if (IS_ERR(found)) { ++ err = PTR_ERR(found); ++ goto err_readdir; ++ } ++ ++ err = -ENOENT; ++ if (found->d_inode != ino) ++ goto err_lookup; ++ ++ dprintk_ctx("dentry found in dir\n"); ++ __cpt_release_buf(ctx); ++ err = cpt_dump_dentry(found, mnt, 0, 1, ctx); ++ ++err_lookup: ++ dput(found); ++err_readdir: ++ fput(f); ++ __cpt_release_buf(ctx); ++ return err; ++} ++ ++static int dump_one_inode(struct file *file, struct dentry *d, ++ struct vfsmount *mnt, struct cpt_context *ctx) ++{ ++ int err = 0; ++ struct inode *ino = d->d_inode; ++ cpt_object_t *iobj; ++ int dump_it = 0; ++ ++ iobj = lookup_cpt_object(CPT_OBJ_INODE, ino, ctx); ++ if (!iobj) ++ return -EINVAL; ++ ++ if (iobj->o_pos >= 0) ++ return 0; ++ ++ if ((!IS_ROOT(d) && d_unhashed(d)) && ++ !cpt_replaced(d, mnt, ctx)) ++ dump_it = 1; ++ if (!S_ISREG(ino->i_mode) && !S_ISDIR(ino->i_mode)) { ++ if (file->f_op == &eventpoll_fops) ++ return 0; ++ dump_it = 1; ++ } ++ ++ if (!dump_it) ++ return 0; ++ ++ cpt_open_object(iobj, ctx); ++ cpt_dump_inode(d, mnt, ctx); ++ ++ if (!IS_ROOT(d) && d_unhashed(d)) { ++ struct file *parent; ++ parent = iobj->o_parent; ++ if (!parent || ++ (!IS_ROOT(parent->f_dentry) && d_unhashed(parent->f_dentry))) { ++ /* Inode is not deleted, but it does not ++ * have references from inside checkpointed ++ * process group. */ ++ if (ino->i_nlink != 0) { ++ err = find_linked_dentry(d, mnt, ino, ctx); ++ if (err) { ++ eprintk_ctx("deleted reference to existing inode, checkpointing is impossible: %d\n", err); ++ return -EBUSY; ++ } ++ if (S_ISREG(ino->i_mode) || S_ISDIR(ino->i_mode)) ++ dump_it = 0; ++ } ++ } else { ++ /* Refer to _another_ file name. */ ++ err = cpt_dump_filename(parent, 0, ctx); ++ if (err) ++ return err; ++ if (S_ISREG(ino->i_mode) || S_ISDIR(ino->i_mode)) ++ dump_it = 0; ++ } ++ } ++ if (dump_it) { ++ if (S_ISREG(ino->i_mode)) { ++ if ((err = dump_content_regular(file, ctx)) != 0) { ++ eprintk_ctx("dump_content_regular "); ++ cpt_printk_dentry(d, mnt); ++ } ++ } else if (S_ISDIR(ino->i_mode)) { ++ /* We cannot do anything. The directory should be ++ * empty, so it is not a big deal. ++ */ ++ } else if (S_ISCHR(ino->i_mode)) { ++ err = dump_content_chrdev(file, ctx); ++ } else if (S_ISBLK(ino->i_mode)) { ++ err = dump_content_blkdev(file, ctx); ++ } else if (S_ISFIFO(ino->i_mode)) { ++ err = dump_content_fifo(file, ctx); ++ } else if (S_ISSOCK(ino->i_mode)) { ++ err = dump_content_socket(file, ctx); ++ } else { ++ eprintk_ctx("unknown inode mode %o, magic 0x%lx\n", ino->i_mode & S_IFMT, ino->i_sb->s_magic); ++ err = -EINVAL; ++ } ++ } ++ cpt_close_object(ctx); ++ ++ return err; ++} ++ ++int cpt_dump_files(struct cpt_context *ctx) ++{ ++ int epoll_nr, inotify_nr; ++ cpt_object_t *obj; ++ ++ cpt_open_section(ctx, CPT_SECT_TTY); ++ for_each_object(obj, CPT_OBJ_TTY) { ++ int err; ++ ++ if ((err = cpt_dump_tty(obj, ctx)) != 0) ++ return err; ++ } ++ cpt_close_section(ctx); ++ ++ cpt_open_section(ctx, CPT_SECT_INODE); ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file = obj->o_obj; ++ int err; ++ ++ if ((err = dump_one_inode(file, file->f_dentry, ++ file->f_vfsmnt, ctx)) != 0) ++ return err; ++ } ++ for_each_object(obj, CPT_OBJ_FS) { ++ struct fs_struct *fs = obj->o_obj; ++ int err; ++ ++ if (fs->root && ++ (err = dump_one_inode(NULL, fs->root, fs->rootmnt, ctx)) != 0) ++ return err; ++ if (fs->pwd && ++ (err = dump_one_inode(NULL, fs->pwd, fs->pwdmnt, ctx)) != 0) ++ return err; ++ if (fs->altroot && ++ (err = dump_one_inode(NULL, fs->altroot, fs->altrootmnt, ctx)) != 0) ++ return err; ++ } ++ cpt_close_section(ctx); ++ ++ epoll_nr = 0; ++ inotify_nr = 0; ++ cpt_open_section(ctx, CPT_SECT_FILES); ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file = obj->o_obj; ++ int err; ++ ++ if ((err = dump_one_file(obj, file, ctx)) != 0) ++ return err; ++ if (file->f_op == &eventpoll_fops) ++ epoll_nr++; ++ if (file->f_dentry->d_inode->i_sb->s_magic == FSMAGIC_INOTIFY) ++ inotify_nr++; ++ } ++ cpt_close_section(ctx); ++ ++ if (epoll_nr) { ++ cpt_open_section(ctx, CPT_SECT_EPOLL); ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file = obj->o_obj; ++ if (file->f_op == &eventpoll_fops) { ++ int err; ++ if ((err = cpt_dump_epolldev(obj, ctx)) != 0) ++ return err; ++ } ++ } ++ cpt_close_section(ctx); ++ } ++ ++ if (inotify_nr) { ++ cpt_open_section(ctx, CPT_SECT_INOTIFY); ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file = obj->o_obj; ++ if (file->f_dentry->d_inode->i_sb->s_magic == FSMAGIC_INOTIFY) { ++ int err = -EINVAL; ++#ifdef CONFIG_INOTIFY_USER ++ if ((err = cpt_dump_inotify(obj, ctx)) != 0) ++#endif ++ return err; ++ } ++ } ++ cpt_close_section(ctx); ++ } ++ ++ cpt_open_section(ctx, CPT_SECT_SOCKET); ++ for_each_object(obj, CPT_OBJ_SOCKET) { ++ int err; ++ ++ if ((err = cpt_dump_socket(obj, obj->o_obj, obj->o_index, -1, ctx)) != 0) ++ return err; ++ } ++ cpt_close_section(ctx); ++ ++ return 0; ++} ++ ++static int dump_filedesc(int fd, struct file *file, ++ struct files_struct *f, struct cpt_context *ctx) ++{ ++ struct cpt_fd_image *v = cpt_get_buf(ctx); ++ cpt_object_t *obj; ++ ++ cpt_open_object(NULL, ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_FILEDESC; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_VOID; ++ ++ v->cpt_fd = fd; ++ obj = lookup_cpt_object(CPT_OBJ_FILE, file, ctx); ++ if (!obj) BUG(); ++ v->cpt_file = obj->o_pos; ++ v->cpt_flags = 0; ++ if (FD_ISSET(fd, f->fdt->close_on_exec)) ++ v->cpt_flags = CPT_FD_FLAG_CLOSEEXEC; ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ cpt_close_object(ctx); ++ ++ return 0; ++} ++ ++static int dump_one_file_struct(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct files_struct *f = obj->o_obj; ++ struct cpt_files_struct_image *v = cpt_get_buf(ctx); ++ int fd; ++ loff_t saved_obj; ++ ++ cpt_open_object(obj, ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_FILES; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_index = obj->o_index; ++ v->cpt_max_fds = f->fdt->max_fds; ++ v->cpt_next_fd = f->next_fd; ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ for (fd = 0; fd < f->fdt->max_fds; fd++) { ++ struct file *file = fcheck_files(f, fd); ++ if (file) ++ dump_filedesc(fd, file, f, ctx); ++ } ++ cpt_pop_object(&saved_obj, ctx); ++ ++ cpt_close_object(ctx); ++ ++ return 0; ++} ++ ++int cpt_dump_files_struct(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ cpt_open_section(ctx, CPT_SECT_FILES_STRUCT); ++ ++ for_each_object(obj, CPT_OBJ_FILES) { ++ int err; ++ ++ if ((err = dump_one_file_struct(obj, ctx)) != 0) ++ return err; ++ } ++ ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++int cpt_collect_fs(cpt_context_t * ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ if (tsk->fs) { ++ if (cpt_object_add(CPT_OBJ_FS, tsk->fs, ctx) == NULL) ++ return -ENOMEM; ++ if (tsk->fs->pwd && ++ cpt_object_add(CPT_OBJ_INODE, tsk->fs->pwd->d_inode, ctx) == NULL) ++ return -ENOMEM; ++ if (tsk->fs->root && ++ cpt_object_add(CPT_OBJ_INODE, tsk->fs->root->d_inode, ctx) == NULL) ++ return -ENOMEM; ++ if (tsk->fs->altroot && ++ cpt_object_add(CPT_OBJ_INODE, tsk->fs->altroot->d_inode, ctx) == NULL) ++ return -ENOMEM; ++ } ++ } ++ return 0; ++} ++ ++int cpt_dump_dir(struct dentry *d, struct vfsmount *mnt, struct cpt_context *ctx) ++{ ++ struct file file; ++ ++ memset(&file, 0, sizeof(file)); ++ ++ file.f_dentry = d; ++ file.f_vfsmnt = mnt; ++ file.f_mode = FMODE_READ|FMODE_PREAD|FMODE_LSEEK; ++ return dump_one_file(NULL, &file, ctx); ++} ++ ++static int dump_one_fs(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct fs_struct *fs = obj->o_obj; ++ struct cpt_fs_struct_image *v = cpt_get_buf(ctx); ++ loff_t saved_obj; ++ int err; ++ ++ cpt_open_object(obj, ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_FS; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_umask = fs->umask; ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ err = cpt_dump_dir(fs->root, fs->rootmnt, ctx); ++ if (!err) ++ err = cpt_dump_dir(fs->pwd, fs->pwdmnt, ctx); ++ if (!err && fs->altroot) ++ err = cpt_dump_dir(fs->altroot, fs->altrootmnt, ctx); ++ ++ cpt_pop_object(&saved_obj, ctx); ++ ++ cpt_close_object(ctx); ++ ++ return err; ++} ++ ++int cpt_dump_fs_struct(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ cpt_open_section(ctx, CPT_SECT_FS); ++ ++ for_each_object(obj, CPT_OBJ_FS) { ++ int err; ++ ++ if ((err = dump_one_fs(obj, ctx)) != 0) ++ return err; ++ } ++ ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++static int check_one_namespace(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ int err = 0; ++ struct mnt_namespace *n = obj->o_obj; ++ struct list_head *p; ++ char *path_buf, *path; ++ ++ path_buf = (char *) __get_free_page(GFP_KERNEL); ++ if (!path_buf) ++ return -ENOMEM; ++ ++ down_read(&namespace_sem); ++ list_for_each(p, &n->list) { ++ struct vfsmount *mnt = list_entry(p, struct vfsmount, mnt_list); ++ ++ path = d_path(mnt->mnt_root, mnt, path_buf, PAGE_SIZE); ++ if (IS_ERR(path)) ++ continue; ++ ++ if (check_one_vfsmount(mnt)) { ++ eprintk_ctx("unsupported fs type %s\n", mnt->mnt_sb->s_type->name); ++ err = -EINVAL; ++ break; ++ } ++ } ++ up_read(&namespace_sem); ++ ++ free_page((unsigned long) path_buf); ++ ++ return err; ++} ++ ++int cpt_collect_namespace(cpt_context_t * ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ if (tsk->nsproxy && tsk->nsproxy->mnt_ns && ++ cpt_object_add(CPT_OBJ_NAMESPACE, ++ tsk->nsproxy->mnt_ns, ctx) == NULL) ++ return -ENOMEM; ++ } ++ ++ for_each_object(obj, CPT_OBJ_NAMESPACE) { ++ int err; ++ if ((err = check_one_namespace(obj, ctx)) != 0) ++ return err; ++ } ++ ++ return 0; ++} ++ ++struct args_t ++{ ++ int* pfd; ++ char* path; ++ envid_t veid; ++}; ++ ++static int dumptmpfs(void *arg) ++{ ++ int i; ++ struct args_t *args = arg; ++ int *pfd = args->pfd; ++ int fd0, fd2; ++ char *path = args->path; ++ char *argv[] = { "tar", "-c", "-S", "--numeric-owner", path, NULL }; ++ ++ i = real_env_create(args->veid, VE_ENTER|VE_SKIPLOCK, 2, NULL, 0); ++ if (i < 0) { ++ eprintk("cannot enter ve to dump tmpfs\n"); ++ module_put(THIS_MODULE); ++ return 255 << 8; ++ } ++ ++ if (pfd[1] != 1) ++ sc_dup2(pfd[1], 1); ++ set_fs(KERNEL_DS); ++ fd0 = sc_open("/dev/null", O_RDONLY, 0); ++ fd2 = sc_open("/dev/null", O_WRONLY, 0); ++ if (fd0 < 0 || fd2 < 0) { ++ eprintk("can not open /dev/null for tar: %d %d\n", fd0, fd2); ++ module_put(THIS_MODULE); ++ return 255 << 8; ++ } ++ if (fd0 != 0) ++ sc_dup2(fd0, 0); ++ if (fd2 != 2) ++ sc_dup2(fd2, 2); ++ ++ for (i = 3; i < current->files->fdt->max_fds; i++) { ++ sc_close(i); ++ } ++ ++ module_put(THIS_MODULE); ++ ++ i = sc_execve("/bin/tar", argv, NULL); ++ eprintk("failed to exec /bin/tar: %d\n", i); ++ return 255 << 8; ++} ++ ++static int cpt_dump_tmpfs(char *path, struct cpt_context *ctx) ++{ ++ int err; ++ int pid; ++ int pfd[2]; ++ struct file *f; ++ struct cpt_object_hdr v; ++ char buf[16]; ++ int n; ++ loff_t saved_obj; ++ struct args_t args; ++ int status; ++ mm_segment_t oldfs; ++ sigset_t ignore, blocked; ++ struct ve_struct *oldenv; ++ ++ err = sc_pipe(pfd); ++ if (err < 0) ++ return err; ++ args.pfd = pfd; ++ args.path = path; ++ args.veid = VEID(get_exec_env()); ++ ignore.sig[0] = CPT_SIG_IGNORE_MASK; ++ sigprocmask(SIG_BLOCK, &ignore, &blocked); ++ oldenv = set_exec_env(get_ve0()); ++ err = pid = local_kernel_thread(dumptmpfs, (void*)&args, ++ SIGCHLD | CLONE_VFORK, 0); ++ set_exec_env(oldenv); ++ if (err < 0) { ++ eprintk_ctx("tmpfs local_kernel_thread: %d\n", err); ++ goto out; ++ } ++ f = fget(pfd[0]); ++ sc_close(pfd[1]); ++ sc_close(pfd[0]); ++ ++ cpt_push_object(&saved_obj, ctx); ++ cpt_open_object(NULL, ctx); ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_NAME; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_NAME; ++ ++ ctx->write(&v, sizeof(v), ctx); ++ ++ do { ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ n = f->f_op->read(f, buf, sizeof(buf), &f->f_pos); ++ set_fs(oldfs); ++ if (n > 0) ++ ctx->write(buf, n, ctx); ++ } while (n > 0); ++ ++ fput(f); ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if ((err = sc_waitx(pid, 0, &status)) < 0) ++ eprintk_ctx("wait4: %d\n", err); ++ else if ((status & 0x7f) == 0) { ++ err = (status & 0xff00) >> 8; ++ if (err != 0) { ++ eprintk_ctx("tar exited with %d\n", err); ++ err = -EINVAL; ++ } ++ } else { ++ eprintk_ctx("tar terminated\n"); ++ err = -EINVAL; ++ } ++ set_fs(oldfs); ++ sigprocmask(SIG_SETMASK, &blocked, NULL); ++ ++ buf[0] = 0; ++ ctx->write(buf, 1, ctx); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ return n ? : err; ++ ++out: ++ if (pfd[1] >= 0) ++ sc_close(pfd[1]); ++ if (pfd[0] >= 0) ++ sc_close(pfd[0]); ++ sigprocmask(SIG_SETMASK, &blocked, NULL); ++ return err; ++} ++ ++static int loopy_root(struct vfsmount *mnt) ++{ ++ struct list_head *p; ++ ++ list_for_each(p, &mnt->mnt_ns->list) { ++ struct vfsmount * m = list_entry(p, struct vfsmount, mnt_list); ++ if (m == mnt) ++ return 0; ++ if (m->mnt_sb == mnt->mnt_sb) ++ return 1; ++ } ++ /* Cannot happen */ ++ return 0; ++} ++ ++static int cpt_dump_bind_mnt(struct vfsmount * mnt, cpt_context_t * ctx) ++{ ++ struct list_head *p; ++ int err = -EINVAL; ++ ++ /* One special case: mount --bind /a /a */ ++ if (mnt->mnt_root == mnt->mnt_mountpoint) ++ return cpt_dump_dentry(mnt->mnt_root, mnt, 0, 0, ctx); ++ ++ list_for_each_prev(p, &mnt->mnt_list) { ++ struct vfsmount * m; ++ ++ if (p == &mnt->mnt_ns->list) ++ break; ++ ++ m = list_entry(p, struct vfsmount, mnt_list); ++ ++ if (m->mnt_sb != mnt->mnt_sb) ++ continue; ++ ++ err = cpt_dump_dentry(mnt->mnt_root, m, 0, 1, ctx); ++ if (err == 0) ++ break; ++ } ++ return err; ++} ++ ++static int dump_vfsmount(struct vfsmount *mnt, struct cpt_context *ctx) ++{ ++ int err = 0; ++ struct cpt_vfsmount_image v; ++ loff_t saved_obj; ++ char *path_buf, *path; ++ ++ path_buf = (char *) __get_free_page(GFP_KERNEL); ++ if (!path_buf) ++ return -ENOMEM; ++ ++ path = d_path(mnt->mnt_root, mnt, path_buf, PAGE_SIZE); ++ if (IS_ERR(path)) { ++ free_page((unsigned long) path_buf); ++ return PTR_ERR(path) == -EINVAL ? 0 : PTR_ERR(path); ++ } ++ ++ cpt_open_object(NULL, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_VFSMOUNT; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_ARRAY; ++ ++ v.cpt_mntflags = mnt->mnt_flags; ++ if (top_beancounter(slab_ub(mnt)) != top_beancounter(get_exec_ub())) { ++ v.cpt_mntflags |= CPT_MNT_EXT; ++ } else { ++ if (mnt->mnt_root != mnt->mnt_sb->s_root || loopy_root(mnt)) ++ v.cpt_mntflags |= CPT_MNT_BIND; ++ } ++ v.cpt_flags = mnt->mnt_sb->s_flags; ++ ++ ctx->write(&v, sizeof(v), ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ cpt_dump_string(mnt->mnt_devname ? : "none", ctx); ++ cpt_dump_string(path, ctx); ++ cpt_dump_string(mnt->mnt_sb->s_type->name, ctx); ++ ++ if (v.cpt_mntflags & CPT_MNT_BIND) ++ err = cpt_dump_bind_mnt(mnt, ctx); ++ else if (!(v.cpt_mntflags & CPT_MNT_EXT) && ++ strcmp(mnt->mnt_sb->s_type->name, "tmpfs") == 0) { ++ mntget(mnt); ++ up_read(&namespace_sem); ++ err = cpt_dump_tmpfs(path, ctx); ++ down_read(&namespace_sem); ++ if (!err) { ++ if (list_empty(&mnt->mnt_list)) ++ err = -EBUSY; ++ } ++ mntput(mnt); ++ } ++ ++ cpt_pop_object(&saved_obj, ctx); ++ ++ cpt_close_object(ctx); ++ if (!err && mnt->mnt_sb->s_magic == FSMAGIC_VEFS) ++ vefs_track_force_stop(mnt->mnt_sb); ++ ++ free_page((unsigned long) path_buf); ++ ++ return err; ++} ++ ++static int dump_one_namespace(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct mnt_namespace *n = obj->o_obj; ++ struct cpt_object_hdr v; ++ struct list_head *p; ++ loff_t saved_obj; ++ int err = 0; ++ ++ cpt_open_object(obj, ctx); ++ ++ v.cpt_next = -1; ++ v.cpt_object = CPT_OBJ_NAMESPACE; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_ARRAY; ++ ++ ctx->write(&v, sizeof(v), ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ ++ down_read(&namespace_sem); ++ list_for_each(p, &n->list) { ++ err = dump_vfsmount(list_entry(p, struct vfsmount, mnt_list), ctx); ++ if (err) ++ break; ++ } ++ up_read(&namespace_sem); ++ ++ cpt_pop_object(&saved_obj, ctx); ++ ++ cpt_close_object(ctx); ++ ++ return err; ++} ++ ++int cpt_dump_namespace(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ cpt_open_section(ctx, CPT_SECT_NAMESPACE); ++ ++ for_each_object(obj, CPT_OBJ_NAMESPACE) { ++ int err; ++ ++ if ((err = dump_one_namespace(obj, ctx)) != 0) ++ return err; ++ } ++ ++ cpt_close_section(ctx); ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_files.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_files.h +--- ./kernel/cpt/cpt_files.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_files.h 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,71 @@ ++int cpt_collect_files(cpt_context_t *); ++int cpt_collect_fs(cpt_context_t *); ++int cpt_collect_namespace(cpt_context_t *); ++int cpt_collect_sysvsem_undo(cpt_context_t *); ++int cpt_collect_tty(struct file *, cpt_context_t *); ++int cpt_dump_files(struct cpt_context *ctx); ++int cpt_dump_files_struct(struct cpt_context *ctx); ++int cpt_dump_fs_struct(struct cpt_context *ctx); ++int cpt_dump_content_sysvshm(struct file *file, struct cpt_context *ctx); ++int cpt_dump_content_tty(struct file *file, struct cpt_context *ctx); ++int cpt_dump_tty(cpt_object_t *, struct cpt_context *ctx); ++struct file * rst_sysv_shm_vma(struct cpt_vma_image *vmai, struct cpt_context *ctx); ++struct file * rst_sysv_shm_itself(loff_t pos, struct cpt_context *ctx); ++struct file * rst_open_tty(struct cpt_file_image *fi, struct cpt_inode_image *ii, unsigned flags, struct cpt_context *ctx); ++__u32 cpt_tty_fasync(struct file *file, struct cpt_context *ctx); ++ ++int rst_posix_locks(struct cpt_context *ctx); ++ ++struct file *rst_file(loff_t pos, int fd, struct cpt_context *ctx); ++int rst_files_complete(struct cpt_task_image *ti, struct cpt_context *ctx); ++__u32 rst_files_flag(struct cpt_task_image *ti, struct cpt_context *ctx); ++int rst_fs_complete(struct cpt_task_image *ti, struct cpt_context *ctx); ++int rst_restore_fs(struct cpt_context *ctx); ++ ++int cpt_collect_sysv(cpt_context_t *); ++int cpt_dump_sysvsem(struct cpt_context *ctx); ++int cpt_dump_sysvmsg(struct cpt_context *ctx); ++int rst_sysv_ipc(struct cpt_context *ctx); ++int rst_semundo_complete(struct cpt_task_image *ti, struct cpt_context *ctx); ++__u32 rst_semundo_flag(struct cpt_task_image *ti, struct cpt_context *ctx); ++ ++int cpt_dump_namespace(struct cpt_context *ctx); ++int rst_root_namespace(struct cpt_context *ctx); ++ ++int rst_stray_files(struct cpt_context *ctx); ++int rst_tty_jobcontrol(struct cpt_context *ctx); ++ ++void rst_flush_filejobs(struct cpt_context *); ++int rst_do_filejobs(struct cpt_context *); ++ ++extern struct file_operations eventpoll_fops; ++int rst_eventpoll(struct cpt_context *); ++struct file *cpt_open_epolldev(struct cpt_file_image *fi, ++ unsigned flags, ++ struct cpt_context *ctx); ++int cpt_dump_epolldev(cpt_object_t *obj, struct cpt_context *); ++ ++int cpt_dump_dir(struct dentry *d, struct vfsmount *mnt, struct cpt_context *ctx); ++int cpt_get_dentry(struct dentry **dp, struct vfsmount **mp, ++ loff_t *pos, struct cpt_context *ctx); ++ ++int cpt_dump_inotify(cpt_object_t *obj, cpt_context_t *ctx); ++int rst_inotify(cpt_context_t *ctx); ++struct file *rst_open_inotify(struct cpt_file_image *fi, ++ unsigned flags, ++ struct cpt_context *ctx); ++ ++ ++int cpt_verify_overmount(char *path, struct dentry *d, struct vfsmount *mnt, ++ int verify, cpt_context_t *ctx); ++ ++#define check_one_vfsmount(mnt) \ ++ (strcmp(mnt->mnt_sb->s_type->name, "rootfs") != 0 && \ ++ strcmp(mnt->mnt_sb->s_type->name, "ext3") != 0 && \ ++ strcmp(mnt->mnt_sb->s_type->name, "ext2") != 0 && \ ++ strcmp(mnt->mnt_sb->s_type->name, "simfs") != 0 && \ ++ strcmp(mnt->mnt_sb->s_type->name, "unionfs") != 0 && \ ++ strcmp(mnt->mnt_sb->s_type->name, "tmpfs") != 0 && \ ++ strcmp(mnt->mnt_sb->s_type->name, "devpts") != 0 && \ ++ strcmp(mnt->mnt_sb->s_type->name, "proc") != 0 && \ ++ strcmp(mnt->mnt_sb->s_type->name, "sysfs") != 0) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_fsmagic.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_fsmagic.h +--- ./kernel/cpt/cpt_fsmagic.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_fsmagic.h 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,16 @@ ++/* Collected from kernel sources. */ ++ ++#define FSMAGIC_TMPFS 0x01021994 ++#define FSMAGIC_PIPEFS 0x50495045 ++#define FSMAGIC_SOCKFS 0x534F434B ++#define FSMAGIC_PFMFS 0xa0b4d889 ++#define FSMAGIC_BDEV 0x62646576 ++#define FSMAGIC_FUTEX 0x0BAD1DEA ++#define FSMAGIC_INOTIFY 0x2BAD1DEA ++#define FSMAGIC_MQUEUE 0x19800202 ++#define FSMAGIC_PROC 0x9fa0 ++#define FSMAGIC_DEVPTS 0x1CD1 ++#define FSMAGIC_AUTOFS 0x0187 ++#define FSMAGIC_EXT2 0xEF53 ++#define FSMAGIC_REISER 0x52654973 ++#define FSMAGIC_VEFS 0x565a4653 +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_inotify.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_inotify.c +--- ./kernel/cpt/cpt_inotify.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_inotify.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,144 @@ ++/* ++ * ++ * kernel/cpt/cpt_inotify.c ++ * ++ * Copyright (C) 2000-2007 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_files.h" ++#include "cpt_kernel.h" ++#include "cpt_fsmagic.h" ++#include "cpt_syscalls.h" ++ ++extern struct file_operations inotify_fops; ++ ++int cpt_dump_inotify(cpt_object_t *obj, cpt_context_t *ctx) ++{ ++ int err = 0; ++ struct file *file = obj->o_obj; ++ struct inotify_device *dev; ++ struct inotify_watch *watch; ++ struct inotify_kernel_event *kev; ++ struct cpt_inotify_image ii; ++ ++ if (file->f_op != &inotify_fops) { ++ eprintk_ctx("bad inotify file\n"); ++ return -EINVAL; ++ } ++ ++ dev = file->private_data; ++ ++ /* inotify_user.c does not protect open /proc/N/fd, silly. ++ * Opener will get an invalid file with uninitialized private_data ++ */ ++ if (unlikely(dev == NULL)) { ++ eprintk_ctx("bad inotify dev\n"); ++ return -EINVAL; ++ } ++ ++ cpt_open_object(NULL, ctx); ++ ++ ii.cpt_next = CPT_NULL; ++ ii.cpt_object = CPT_OBJ_INOTIFY; ++ ii.cpt_hdrlen = sizeof(ii); ++ ii.cpt_content = CPT_CONTENT_ARRAY; ++ ii.cpt_file = obj->o_pos; ++ ii.cpt_user = dev->user->uid; ++ ii.cpt_max_events = dev->max_events; ++ ii.cpt_last_wd = dev->ih->last_wd; ++ ++ ctx->write(&ii, sizeof(ii), ctx); ++ ++ mutex_lock(&dev->ih->mutex); ++ list_for_each_entry(watch, &dev->ih->watches, h_list) { ++ loff_t saved_obj; ++ loff_t saved_obj2; ++ struct cpt_inotify_wd_image wi; ++ ++ cpt_push_object(&saved_obj, ctx); ++ cpt_open_object(NULL, ctx); ++ ++ wi.cpt_next = CPT_NULL; ++ wi.cpt_object = CPT_OBJ_INOTIFY_WATCH; ++ wi.cpt_hdrlen = sizeof(wi); ++ wi.cpt_content = CPT_CONTENT_ARRAY; ++ wi.cpt_wd = watch->wd; ++ wi.cpt_mask = watch->mask; ++ ++ ctx->write(&wi, sizeof(wi), ctx); ++ ++ cpt_push_object(&saved_obj2, ctx); ++ err = cpt_dump_dir(watch->dentry, watch->mnt, ctx); ++ cpt_pop_object(&saved_obj2, ctx); ++ if (err) ++ break; ++ ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ mutex_unlock(&dev->ih->mutex); ++ ++ if (err) ++ return err; ++ ++ mutex_lock(&dev->ev_mutex); ++ list_for_each_entry(kev, &dev->events, list) { ++ loff_t saved_obj; ++ struct cpt_inotify_ev_image ei; ++ ++ cpt_push_object(&saved_obj, ctx); ++ cpt_open_object(NULL, ctx); ++ ++ ei.cpt_next = CPT_NULL; ++ ei.cpt_object = CPT_OBJ_INOTIFY_EVENT; ++ ei.cpt_hdrlen = sizeof(ei); ++ ei.cpt_content = CPT_CONTENT_NAME; ++ ei.cpt_wd = kev->event.wd; ++ ei.cpt_mask = kev->event.mask; ++ ei.cpt_cookie = kev->event.cookie; ++ ei.cpt_namelen = kev->name ? strlen(kev->name) : 0; ++ ++ ctx->write(&ei, sizeof(ei), ctx); ++ ++ if (kev->name) { ++ ctx->write(kev->name, ei.cpt_namelen+1, ctx); ++ ctx->align(ctx); ++ } ++ ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ mutex_unlock(&dev->ev_mutex); ++ ++ cpt_close_object(ctx); ++ ++ return err; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_kernel.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_kernel.c +--- ./kernel/cpt/cpt_kernel.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_kernel.c 2012-11-13 15:20:15.368569068 +0000 +@@ -0,0 +1,177 @@ ++/* ++ * ++ * kernel/cpt/cpt_kernel.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#define __KERNEL_SYSCALLS__ 1 ++ ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_X86 ++#include ++#endif ++#include ++ ++#include "cpt_kernel.h" ++#include "cpt_syscalls.h" ++ ++int debug_level = 1; ++ ++#ifdef CONFIG_X86_32 ++ ++/* ++ * Create a kernel thread ++ */ ++extern void kernel_thread_helper(void); ++int asm_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags, pid_t pid) ++{ ++ struct pt_regs regs; ++ ++ memset(®s, 0, sizeof(regs)); ++ ++ regs.ebx = (unsigned long) fn; ++ regs.edx = (unsigned long) arg; ++ ++ regs.xds = __USER_DS; ++ regs.xes = __USER_DS; ++ regs.xfs = __KERNEL_PERCPU; ++ regs.orig_eax = -1; ++ regs.eip = (unsigned long) kernel_thread_helper; ++ regs.xcs = __KERNEL_CS | get_kernel_rpl(); ++ regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2; ++ ++ /* Ok, create the new process.. */ ++ return do_fork_pid(flags | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL, pid); ++} ++#endif ++ ++#ifdef CONFIG_IA64 ++pid_t ++asm_kernel_thread (int (*fn)(void *), void *arg, unsigned long flags, pid_t pid) ++{ ++ extern void start_kernel_thread (void); ++ unsigned long *helper_fptr = (unsigned long *) &start_kernel_thread; ++ struct { ++ struct switch_stack sw; ++ struct pt_regs pt; ++ } regs; ++ ++ memset(®s, 0, sizeof(regs)); ++ regs.pt.cr_iip = helper_fptr[0]; /* set entry point (IP) */ ++ regs.pt.r1 = helper_fptr[1]; /* set GP */ ++ regs.pt.r9 = (unsigned long) fn; /* 1st argument */ ++ regs.pt.r11 = (unsigned long) arg; /* 2nd argument */ ++ /* Preserve PSR bits, except for bits 32-34 and 37-45, which we can't read. */ ++ regs.pt.cr_ipsr = ia64_getreg(_IA64_REG_PSR) | IA64_PSR_BN; ++ regs.pt.cr_ifs = 1UL << 63; /* mark as valid, empty frame */ ++ regs.sw.ar_fpsr = regs.pt.ar_fpsr = ia64_getreg(_IA64_REG_AR_FPSR); ++ regs.sw.ar_bspstore = (unsigned long) current + IA64_RBS_OFFSET; ++ regs.sw.pr = (1 << 2 /*PRED_KERNEL_STACK*/); ++ return do_fork_pid(flags | CLONE_UNTRACED, 0, ®s.pt, 0, NULL, NULL, pid); ++} ++#endif ++ ++int local_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags, pid_t pid) ++{ ++ pid_t ret; ++ ++ if (current->fs == NULL) { ++ /* do_fork_pid() hates processes without fs, oopses. */ ++ printk("CPT BUG: local_kernel_thread: current->fs==NULL\n"); ++ return -EINVAL; ++ } ++ if (!try_module_get(THIS_MODULE)) ++ return -EBUSY; ++ ret = asm_kernel_thread(fn, arg, flags, pid); ++ if (ret < 0) ++ module_put(THIS_MODULE); ++ return ret; ++} ++ ++#ifdef __i386__ ++int __execve(const char *file, char **argv, char **envp) ++{ ++ long res; ++ __asm__ volatile ("int $0x80" ++ : "=a" (res) ++ : "0" (__NR_execve),"b" ((long)(file)),"c" ((long)(argv)), ++ "d" ((long)(envp)) : "memory"); ++ return (int)res; ++} ++#endif ++ ++int sc_execve(char *cmd, char **argv, char **env) ++{ ++ int ret; ++#ifndef __i386__ ++ ret = kernel_execve(cmd, argv, env); ++#else ++ ret = __execve(cmd, argv, env); ++#endif ++ return ret; ++} ++ ++unsigned int test_cpu_caps(void) ++{ ++ unsigned int flags = 0; ++ ++#ifdef CONFIG_X86 ++ if (boot_cpu_has(X86_FEATURE_CMOV)) ++ flags |= 1 << CPT_CPU_X86_CMOV; ++ if (cpu_has_fxsr) ++ flags |= 1 << CPT_CPU_X86_FXSR; ++ if (cpu_has_xmm) ++ flags |= 1 << CPT_CPU_X86_SSE; ++#ifndef CONFIG_X86_64 ++ if (cpu_has_xmm2) ++#endif ++ flags |= 1 << CPT_CPU_X86_SSE2; ++ if (cpu_has_mmx) ++ flags |= 1 << CPT_CPU_X86_MMX; ++ if (boot_cpu_has(X86_FEATURE_3DNOW)) ++ flags |= 1 << CPT_CPU_X86_3DNOW; ++ if (boot_cpu_has(X86_FEATURE_3DNOWEXT)) ++ flags |= 1 << CPT_CPU_X86_3DNOW2; ++ if (boot_cpu_has(X86_FEATURE_SYSCALL)) ++ flags |= 1 << CPT_CPU_X86_SYSCALL; ++#ifdef CONFIG_X86_64 ++ if (boot_cpu_has(X86_FEATURE_SYSCALL) && ++ boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) ++ flags |= 1 << CPT_CPU_X86_SYSCALL32; ++#endif ++ if (boot_cpu_has(X86_FEATURE_SEP) ++#ifdef CONFIG_X86_64 ++ && boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ++#endif ++ ) ++ flags |= ((1 << CPT_CPU_X86_SEP) | (1 << CPT_CPU_X86_SEP32)); ++#ifdef CONFIG_X86_64 ++ flags |= 1 << CPT_CPU_X86_EMT64; ++#endif ++#endif ++#ifdef CONFIG_IA64 ++ flags |= 1 << CPT_CPU_X86_IA64; ++ flags |= 1 << CPT_CPU_X86_FXSR; ++#endif ++ return flags; ++} ++ ++unsigned int test_kernel_config(void) ++{ ++ unsigned int flags = 0; ++#ifdef CONFIG_X86 ++#if defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64) ++ flags |= 1 << CPT_KERNEL_CONFIG_PAE; ++#endif ++#endif ++ return flags; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_kernel.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_kernel.h +--- ./kernel/cpt/cpt_kernel.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_kernel.h 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,99 @@ ++/* Interface to kernel vars which we had to _add_. */ ++ ++#define PRIO_TO_NICE(prio) ((prio) - MAX_RT_PRIO - 20) ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) ++#define TASK_TRACED TASK_STOPPED ++#define unix_peer(sk) ((sk)->sk_pair) ++#define page_mapcount(pg) ((pg)->mapcount) ++#else ++#define unix_peer(sk) (unix_sk(sk)->peer) ++#endif ++ ++#ifdef CONFIG_IA64 ++#define cpu_has_fxsr 1 ++#endif ++ ++#define CPT_SIG_IGNORE_MASK (\ ++ (1 << (SIGCONT - 1)) | (1 << (SIGCHLD - 1)) | \ ++ (1 << (SIGWINCH - 1)) | (1 << (SIGURG - 1))) ++ ++static inline void do_gettimespec(struct timespec *ts) ++{ ++ struct timeval tv; ++ do_gettimeofday(&tv); ++ ts->tv_sec = tv.tv_sec; ++ ts->tv_nsec = tv.tv_usec*1000; ++} ++ ++int local_kernel_thread(int (*fn)(void *), ++ void * arg, ++ unsigned long flags, ++ pid_t pid); ++int asm_kernel_thread(int (*fn)(void *), ++ void * arg, ++ unsigned long flags, ++ pid_t pid); ++ ++#if defined(CONFIG_VZFS_FS) || defined(CONFIG_VZFS_FS_MODULE) ++void vefs_track_force_stop(struct super_block *super); ++ ++void vefs_track_notify(struct dentry *vdentry, int track_cow); ++ ++struct dentry * vefs_replaced_dentry(struct dentry *de); ++int vefs_is_renamed_dentry(struct dentry *vde, struct dentry *pde); ++#else ++static inline void vefs_track_force_stop(struct super_block *super) { }; ++ ++static inline void vefs_track_notify(struct dentry *vdentry, int track_cow) { }; ++#endif ++ ++unsigned int test_cpu_caps(void); ++unsigned int test_kernel_config(void); ++ ++#define test_one_flag_old(src, dst, flag, message, ret) \ ++if (src & (1 << flag)) \ ++ if (!(dst & (1 << flag))) { \ ++ wprintk("Destination cpu does not have " message "\n"); \ ++ ret = 1; \ ++ } ++#define test_one_flag(src, dst, flag, message, ret) \ ++if (src & (1 << flag)) \ ++ if (!(dst & (1 << flag))) { \ ++ eprintk_ctx("Destination cpu does not have " message "\n"); \ ++ ret = 1; \ ++ } ++ ++static inline void ++_set_normalized_timespec(struct timespec *ts, time_t sec, long nsec) ++{ ++ while (nsec >= NSEC_PER_SEC) { ++ nsec -= NSEC_PER_SEC; ++ ++sec; ++ } ++ while (nsec < 0) { ++ nsec += NSEC_PER_SEC; ++ --sec; ++ } ++ ts->tv_sec = sec; ++ ts->tv_nsec = nsec; ++} ++ ++static inline struct timespec ++_ns_to_timespec(const s64 nsec) ++{ ++ struct timespec ts; ++ s32 rem; ++ ++ if (!nsec) ++ return (struct timespec) {0, 0}; ++ ++ ts.tv_sec = div_s64_rem(nsec, NSEC_PER_SEC, &rem); ++ if (unlikely(rem < 0)) { ++ ts.tv_sec--; ++ rem += NSEC_PER_SEC; ++ } ++ ts.tv_nsec = rem; ++ ++ return ts; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_mm.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_mm.c +--- ./kernel/cpt/cpt_mm.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_mm.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,917 @@ ++/* ++ * ++ * kernel/cpt/cpt_mm.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_X86 ++#include ++#endif ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_kernel.h" ++#include "cpt_fsmagic.h" ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++#include "cpt_pagein.h" ++#endif ++#include "cpt_ubc.h" ++ ++static int collect_one_aio_ctx(struct mm_struct *mm, struct kioctx *aio_ctx, ++ cpt_context_t *ctx) ++{ ++ if (!list_empty(&aio_ctx->run_list)) { ++ /* This is impossible at least with kernel 2.6.8.1 or 2.6.16 */ ++ eprintk_ctx("run list is not empty, cannot suspend AIO\n"); ++ return -EBUSY; ++ } ++ ++ /* Wait for pending IOCBs. Linux AIO is mostly _fake_. ++ * It is actually synchronous, except for direct IO and ++ * some funny raw USB things, which cannot happen inside VE. ++ * However, we do this for future. ++ * ++ * Later note: in 2.6.16 we may allow O_DIRECT, so that ++ * it is not meaningless code. ++ */ ++ wait_for_all_aios(aio_ctx); ++ ++ if (!list_empty(&aio_ctx->run_list) || ++ !list_empty(&aio_ctx->active_reqs) || ++ aio_ctx->reqs_active) { ++ eprintk_ctx("were not able to suspend AIO\n"); ++ return -EBUSY; ++ } ++ ++ return 0; ++} ++ ++static int collect_one_mm(struct mm_struct *mm, cpt_context_t * ctx) ++{ ++ struct vm_area_struct *vma; ++ ++ for (vma = mm->mmap; vma; vma = vma->vm_next) { ++ if (vma->vm_file) { ++ if (cpt_object_add(CPT_OBJ_FILE, vma->vm_file, ctx) == NULL) ++ return -ENOMEM; ++ } ++ } ++#ifdef CONFIG_BEANCOUNTERS ++ if (cpt_add_ubc(mm->mm_ub, ctx) == NULL) ++ return -ENOMEM; ++#endif ++ ++ if (mm->ioctx_list) { ++ struct kioctx *aio_ctx; ++ int err; ++ ++ for (aio_ctx = mm->ioctx_list; aio_ctx; aio_ctx = aio_ctx->next) ++ if ((err = collect_one_aio_ctx(mm, aio_ctx, ctx)) != 0) ++ return err; ++ } ++ ++ return 0; ++} ++ ++int cpt_collect_mm(cpt_context_t * ctx) ++{ ++ cpt_object_t *obj; ++ int err; ++ int index; ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ if (tsk->mm && cpt_object_add(CPT_OBJ_MM, tsk->mm, ctx) == NULL) ++ return -ENOMEM; ++ } ++ ++ index = 1; ++ for_each_object(obj, CPT_OBJ_MM) { ++ struct mm_struct *mm = obj->o_obj; ++ if (obj->o_count != atomic_read(&mm->mm_users)) { ++ eprintk_ctx("mm_struct is referenced outside %d %d\n", obj->o_count, atomic_read(&mm->mm_users)); ++ return -EAGAIN; ++ } ++ cpt_obj_setindex(obj, index++, ctx); ++ ++ if ((err = collect_one_mm(mm, ctx)) != 0) ++ return err; ++ } ++ ++ return 0; ++} ++ ++static int zcnt, scnt, scnt0, ucnt; ++ ++/* Function where_is_anon_page() returns address of a anonymous page in mm ++ * of already dumped process. This happens f.e. after fork(). We do not use ++ * this right now, just keep statistics, it is diffucult to restore such state, ++ * but the most direct use is to save space in dumped image. */ ++ ++ ++static inline unsigned long ++vma_address0(struct page *page, struct vm_area_struct *vma) ++{ ++ pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); ++ unsigned long address; ++ ++ address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT); ++ if (unlikely(address < vma->vm_start || address >= vma->vm_end)) ++ address |= 1; ++ return address; ++} ++ ++static int really_this_one(struct vm_area_struct *vma, unsigned long address, ++ struct page *page) ++{ ++ struct mm_struct *mm = vma->vm_mm; ++ pgd_t *pgd; ++ pud_t *pud; ++ pmd_t *pmd; ++ pte_t *pte; ++ spinlock_t *ptl; ++ int result; ++ ++ pgd = pgd_offset(mm, address); ++ if (unlikely(!pgd_present(*pgd))) ++ return 0; ++ ++ pud = pud_offset(pgd, address); ++ if (!pud_present(*pud)) ++ return 0; ++ ++ pmd = pmd_offset(pud, address); ++ if (unlikely(!pmd_present(*pmd))) ++ return 0; ++ ++ result = 0; ++ pte = pte_offset_map(pmd, address); ++ if (!pte_present(*pte)) { ++ pte_unmap(pte); ++ return 0; ++ } ++ ++ ptl = pte_lockptr(mm, pmd); ++ spin_lock(ptl); ++ if (pte_present(*pte) && page_to_pfn(page) == pte_pfn(*pte)) ++ result = 1; ++ pte_unmap_unlock(pte, ptl); ++ return result; ++} ++ ++static loff_t where_is_anon_page(cpt_object_t *mmobj, unsigned long mapaddr, ++ struct page *page, cpt_context_t * ctx) ++{ ++ loff_t mmptr = CPT_NULL; ++ struct anon_vma *anon_vma; ++ struct vm_area_struct *vma; ++ int idx = mmobj->o_index; ++ ++ if (!PageAnon(page)) ++ return CPT_NULL; ++ ++ anon_vma = page_lock_anon_vma(page); ++ if (!anon_vma) ++ return CPT_NULL; ++ ++ list_for_each_entry(vma, &anon_vma->head, anon_vma_node) { ++ unsigned long addr = vma_address0(page, vma); ++ cpt_object_t *obj; ++ ++ /* We do not try to support mremapped regions (addr != mapaddr), ++ * only mmaps directly inherited via fork(). ++ * With this limitation we may check self-consistency of ++ * vmas (vm_start, vm_pgoff, anon_vma) before ++ * doing __copy_page_range() in rst_mm. ++ */ ++ if (mmobj->o_obj != vma->vm_mm && addr == mapaddr) { ++ obj = lookup_cpt_object(CPT_OBJ_MM, vma->vm_mm, ctx); ++ if (obj && obj->o_pos != CPT_NULL && obj->o_index < idx) { ++ if (really_this_one(vma, addr, page)) { ++ mmptr = obj->o_pos; ++ idx = obj->o_index; ++ } ++ } ++ } ++ } ++ page_unlock_anon_vma(anon_vma); ++ ++ return mmptr; ++} ++ ++struct page_area ++{ ++ int type; ++ unsigned long start; ++ unsigned long end; ++ pgoff_t pgoff; ++ loff_t mm; ++ __u64 list[16]; ++}; ++ ++struct page_desc ++{ ++ int type; ++ pgoff_t index; ++ loff_t mm; ++ int shared; ++}; ++ ++enum { ++ PD_ABSENT, ++ PD_COPY, ++ PD_ZERO, ++ PD_CLONE, ++ PD_FUNKEY, ++ PD_LAZY, ++ PD_ITER, ++ PD_ITERYOUNG, ++}; ++ ++/* 0: page can be obtained from backstore, or still not mapped anonymous page, ++ or something else, which does not requre copy. ++ 1: page requires copy ++ 2: page requres copy but its content is zero. Quite useless. ++ 3: wp page is shared after fork(). It is to be COWed when modified. ++ 4: page is something unsupported... We copy it right now. ++ */ ++ ++ ++ ++static void page_get_desc(cpt_object_t *mmobj, ++ struct vm_area_struct *vma, unsigned long addr, ++ struct page_desc *pdesc, cpt_context_t * ctx) ++{ ++ struct mm_struct *mm = vma->vm_mm; ++ pgd_t *pgd; ++ pud_t *pud; ++ pmd_t *pmd; ++ pte_t *ptep, pte; ++ spinlock_t *ptl; ++ struct page *pg = NULL; ++ pgoff_t linear_index = (addr - vma->vm_start)/PAGE_SIZE + vma->vm_pgoff; ++ ++ pdesc->index = linear_index; ++ pdesc->shared = 0; ++ pdesc->mm = CPT_NULL; ++ ++ if (vma->vm_flags & VM_IO) { ++ pdesc->type = PD_ABSENT; ++ return; ++ } ++ ++ pgd = pgd_offset(mm, addr); ++ if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd))) ++ goto out_absent; ++ pud = pud_offset(pgd, addr); ++ if (pud_none(*pud) || unlikely(pud_bad(*pud))) ++ goto out_absent; ++ pmd = pmd_offset(pud, addr); ++ if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd))) ++ goto out_absent; ++#ifdef CONFIG_X86 ++ if (pmd_huge(*pmd)) { ++ eprintk_ctx("page_huge\n"); ++ goto out_unsupported; ++ } ++#endif ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++retry: ++#endif ++ ptep = pte_offset_map_lock(mm, pmd, addr, &ptl); ++ pte = *ptep; ++ pte_unmap(ptep); ++ ++ if (pte_none(pte)) ++ goto out_absent_unlock; ++ ++ if (!pte_present(pte)) { ++ if (pte_file(pte)) { ++ pdesc->index = pte_to_pgoff(pte); ++ goto out_absent_unlock; ++ } ++ if (vma->vm_flags & VM_SHARED) { ++ /* It is impossible: shared mappings cannot be in swap */ ++ eprintk_ctx("shared mapping is not present: %08lx@%Ld\n", addr, mmobj->o_pos); ++ goto out_unsupported_unlock; ++ } ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ /* Otherwise it is in swap. */ ++ if (!ctx->lazy_vm) { ++ int err; ++ /* If lazy transfer is not enabled, ++ * raise it from swap now, so that we ++ * save at least when the page is shared. ++ */ ++ spin_unlock(ptl); ++ err = handle_mm_fault(mm, vma, addr, 0); ++ if (err == VM_FAULT_SIGBUS) ++ goto out_absent; ++ if (err == VM_FAULT_OOM) ++ goto out_absent; ++ err = 0; ++ goto retry; ++ } ++#endif ++ pdesc->type = PD_LAZY; ++ goto out_unlock; ++ } ++ ++ if ((pg = vm_normal_page(vma, addr, pte)) == NULL) { ++ pdesc->type = PD_COPY; ++ goto out_unlock; ++ } ++ ++ get_page(pg); ++ spin_unlock(ptl); ++ ++ if (pg->mapping && !PageAnon(pg)) { ++ if (vma->vm_file == NULL) { ++ eprintk_ctx("pg->mapping!=NULL for fileless vma: %08lx\n", addr); ++ goto out_unsupported; ++ } ++ if (vma->vm_file->f_mapping != pg->mapping) { ++ eprintk_ctx("pg->mapping!=f_mapping: %08lx %p %p %Ld\n", ++ addr, vma->vm_file->f_mapping, pg->mapping, ++ mmobj->o_pos); ++ goto out_unsupported; ++ } ++ pdesc->index = (pg->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT)); ++ /* Page is in backstore. For us it is like ++ * it is not present. ++ */ ++ goto out_absent; ++ } ++ ++ if (PageReserved(pg)) { ++ /* Special case: ZERO_PAGE is used, when an ++ * anonymous page is accessed but not written. */ ++ if (pg == ZERO_PAGE(addr)) { ++ if (pte_write(pte)) { ++ eprintk_ctx("not funny already, writable ZERO_PAGE\n"); ++ goto out_unsupported; ++ } ++ zcnt++; ++ goto out_absent; ++ } ++ eprintk_ctx("reserved page %lu at %08lx@%Ld\n", pg->index, ++ addr, mmobj->o_pos); ++ goto out_unsupported; ++ } ++ ++ if (pg == ZERO_PAGE(addr)) { ++ wprintk_ctx("that's how it works now\n"); ++ } ++ ++ if (!pg->mapping) { ++ eprintk_ctx("page without mapping at %08lx@%Ld\n", addr, ++ mmobj->o_pos); ++ goto out_unsupported; ++ } ++ ++ if (pg->mapping && page_mapcount(pg) > 1) { ++ pdesc->shared = 1; ++ pdesc->mm = where_is_anon_page(mmobj, addr, pg, ctx); ++ if (pdesc->mm != CPT_NULL) { ++ scnt0++; ++ pdesc->type = PD_CLONE; ++ goto out_put; ++ } else { ++ scnt++; ++ } ++ } ++#ifdef CONFIG_VZ_CHECKPOINT_ITER ++ if (ctx->iter_done && ++ test_bit(PG_checkpointed, &pg->flags)) { ++ if (pte_write(pte)) { ++ wprintk_ctx("writable PG_checkpointed page\n"); ++ } ++ pdesc->index = page_to_pfn(pg); ++ pdesc->type = pte_young(pte) ? PD_ITERYOUNG : PD_ITER; ++ goto out_put; ++ } ++#endif ++ pdesc->type = pte_young(pte) ? PD_COPY : PD_LAZY; ++ ++out_put: ++ if (pg) ++ put_page(pg); ++ return; ++ ++out_unlock: ++ spin_unlock(ptl); ++ goto out_put; ++ ++out_absent_unlock: ++ spin_unlock(ptl); ++out_absent: ++ pdesc->type = PD_ABSENT; ++ goto out_put; ++ ++out_unsupported_unlock: ++ spin_unlock(ptl); ++out_unsupported: ++ ucnt++; ++ pdesc->type = PD_FUNKEY; ++ goto out_put; ++} ++ ++/* ATTN: We give "current" to get_user_pages(). This is wrong, but get_user_pages() ++ * does not really need this thing. It just stores some page fault stats there. ++ * ++ * BUG: some archs (f.e. sparc64, but not Intel*) require flush cache pages ++ * before accessing vma. ++ */ ++void dump_pages(struct vm_area_struct *vma, unsigned long start, ++ unsigned long end, struct cpt_context *ctx) ++{ ++#define MAX_PAGE_BATCH 16 ++ struct page *pg[MAX_PAGE_BATCH]; ++ int npages = (end - start)/PAGE_SIZE; ++ int count = 0; ++ ++ while (count < npages) { ++ int copy = npages - count; ++ int n; ++ ++ if (copy > MAX_PAGE_BATCH) ++ copy = MAX_PAGE_BATCH; ++ n = get_user_pages(current, vma->vm_mm, start, copy, ++ 0, 1, pg, NULL); ++ if (n == copy) { ++ int i; ++ for (i=0; iwrite(maddr, PAGE_SIZE, ctx); ++ kunmap(pg[i]); ++ } ++ } else { ++ eprintk_ctx("get_user_pages fault"); ++ for ( ; n > 0; n--) ++ page_cache_release(pg[n-1]); ++ return; ++ } ++ start += n*PAGE_SIZE; ++ count += n; ++ for ( ; n > 0; n--) ++ page_cache_release(pg[n-1]); ++ } ++ return; ++} ++ ++int dump_page_block(struct vm_area_struct *vma, struct cpt_page_block *pgb, ++ int copy, ++ struct cpt_context *ctx) ++{ ++ loff_t saved_object; ++ ++ cpt_push_object(&saved_object, ctx); ++ ++ pgb->cpt_object = (copy != PD_LAZY) ? CPT_OBJ_PAGES : CPT_OBJ_LAZYPAGES; ++ pgb->cpt_hdrlen = sizeof(*pgb); ++ pgb->cpt_content = (copy == PD_COPY || copy == PD_LAZY) ? CPT_CONTENT_DATA : CPT_CONTENT_VOID; ++ ++ ctx->write(pgb, sizeof(*pgb), ctx); ++ if (copy == PD_COPY || copy == PD_LAZY) ++ dump_pages(vma, pgb->cpt_start, pgb->cpt_end, ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_object, ctx); ++ return 0; ++} ++ ++int dump_remappage_block(struct vm_area_struct *vma, struct page_area *pa, ++ struct cpt_context *ctx) ++{ ++ struct cpt_remappage_block pgb; ++ loff_t saved_object; ++ ++ cpt_push_object(&saved_object, ctx); ++ ++ pgb.cpt_object = CPT_OBJ_REMAPPAGES; ++ pgb.cpt_hdrlen = sizeof(pgb); ++ pgb.cpt_content = CPT_CONTENT_VOID; ++ pgb.cpt_start = pa->start; ++ pgb.cpt_end = pa->end; ++ pgb.cpt_pgoff = pa->pgoff - (pa->end-pa->start)/PAGE_SIZE + 1; ++ ++ ctx->write(&pgb, sizeof(pgb), ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_object, ctx); ++ return 0; ++} ++ ++int dump_copypage_block(struct vm_area_struct *vma, struct page_area *pa, ++ struct cpt_context *ctx) ++{ ++ struct cpt_copypage_block pgb; ++ loff_t saved_object; ++ ++ cpt_push_object(&saved_object, ctx); ++ ++ pgb.cpt_object = CPT_OBJ_COPYPAGES; ++ pgb.cpt_hdrlen = sizeof(pgb); ++ pgb.cpt_content = CPT_CONTENT_VOID; ++ pgb.cpt_start = pa->start; ++ pgb.cpt_end = pa->end; ++ pgb.cpt_source = pa->mm; ++ ++ ctx->write(&pgb, sizeof(pgb), ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_object, ctx); ++ return 0; ++} ++ ++int dump_lazypage_block(struct vm_area_struct *vma, struct page_area *pa, ++ cpt_context_t *ctx) ++{ ++ struct cpt_lazypage_block pgb; ++ loff_t saved_object; ++ ++ cpt_push_object(&saved_object, ctx); ++ ++ pgb.cpt_object = CPT_OBJ_LAZYPAGES; ++ pgb.cpt_hdrlen = sizeof(pgb); ++ pgb.cpt_content = CPT_CONTENT_VOID; ++ pgb.cpt_start = pa->start; ++ pgb.cpt_end = pa->end; ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ pgb.cpt_index = cpt_alloc_pgin_index(vma, pa->start, ++ (pa->end-pa->start)/PAGE_SIZE, ctx); ++#endif ++ ctx->write(&pgb, sizeof(pgb), ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_object, ctx); ++ return 0; ++} ++ ++int dump_iterpage_block(struct vm_area_struct *vma, struct page_area *pa, ++ cpt_context_t *ctx) ++{ ++ struct cpt_iterpage_block pgb; ++ loff_t saved_object; ++ ++ cpt_push_object(&saved_object, ctx); ++ ++ pgb.cpt_object = pa->type == PD_ITER ? CPT_OBJ_ITERPAGES : ++ CPT_OBJ_ITERYOUNGPAGES; ++ pgb.cpt_hdrlen = sizeof(pgb); ++ pgb.cpt_content = CPT_CONTENT_VOID; ++ pgb.cpt_start = pa->start; ++ pgb.cpt_end = pa->end; ++ ctx->write(&pgb, sizeof(pgb), ctx); ++ ++ ctx->write(pa->list, 8*((pa->end-pa->start)/PAGE_SIZE), ctx); ++ ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_object, ctx); ++ return 0; ++} ++ ++ ++static int can_expand(struct page_area *pa, struct page_desc *pd) ++{ ++ if (pa->start == pa->end) ++ return 1; ++ if (pa->type != pd->type) ++ return 0; ++ if (pa->type == PD_ITER || pa->type == PD_ITERYOUNG) { ++ if (pa->end - pa->start >= PAGE_SIZE*16) ++ return 0; ++ pa->list[(pa->end - pa->start)/PAGE_SIZE] = pd->index; ++ } ++ if (pa->type == PD_ABSENT) ++ return pd->index == pa->pgoff + 1; ++ if (pa->type == PD_CLONE) ++ return pd->mm == pa->mm; ++ return 1; ++} ++ ++static int dump_one_vma(cpt_object_t *mmobj, ++ struct vm_area_struct *vma, struct cpt_context *ctx) ++{ ++ struct cpt_vma_image *v = cpt_get_buf(ctx); ++ unsigned long addr; ++ loff_t saved_object; ++ struct cpt_page_block pgb; ++ struct page_area pa; ++ int cloned_pages = 0; ++ ++ cpt_push_object(&saved_object, ctx); ++ ++ v->cpt_object = CPT_OBJ_VMA; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_start = vma->vm_start; ++ v->cpt_end = vma->vm_end; ++ v->cpt_flags = vma->vm_flags; ++ if (vma->vm_flags&VM_HUGETLB) { ++ eprintk_ctx("huge TLB VMAs are still not supported\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ v->cpt_pgprot = vma->vm_page_prot.pgprot; ++ v->cpt_pgoff = vma->vm_pgoff; ++ v->cpt_file = CPT_NULL; ++#ifndef CONFIG_IA64 ++ if ((void *)vma->vm_start == vma->vm_mm->context.vdso && ++ vma->vm_ops == &special_mapping_vmops) ++ v->cpt_type = CPT_VMA_VDSO; ++ else ++#endif ++ v->cpt_type = CPT_VMA_TYPE_0; ++ v->cpt_anonvma = 0; ++ ++ /* We have to remember what VMAs are bound to one anon_vma. ++ * So, we store an identifier of group of VMAs. It is handy ++ * to use absolute address of anon_vma as this identifier. */ ++ v->cpt_anonvmaid = (unsigned long)vma->anon_vma; ++ ++ if (vma->vm_file) { ++ struct file *filp; ++ cpt_object_t *obj = lookup_cpt_object(CPT_OBJ_FILE, vma->vm_file, ctx); ++ if (obj == NULL) BUG(); ++ filp = obj->o_obj; ++ if (filp->f_op == &shm_file_operations) { ++ struct shm_file_data *sfd = filp->private_data; ++ ++ v->cpt_type = CPT_VMA_TYPE_SHM; ++ obj = lookup_cpt_object(CPT_OBJ_FILE, sfd->file, ctx); ++ } ++ v->cpt_file = obj->o_pos; ++ } ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ if (v->cpt_type == CPT_VMA_VDSO) ++ goto out; ++ ++ pa.type = PD_ABSENT; ++ pa.pgoff = vma->vm_pgoff; ++ pa.mm = CPT_NULL; ++ pa.start = vma->vm_start; ++ pa.end = vma->vm_start; ++ ++ for (addr = vma->vm_start; addr < vma->vm_end; addr += PAGE_SIZE) { ++ struct page_desc pd; ++ ++ page_get_desc(mmobj, vma, addr, &pd, ctx); ++ cloned_pages += pd.shared; ++ ++ if (pd.type == PD_FUNKEY) { ++ eprintk_ctx("dump_one_vma: funkey page\n"); ++ return -EINVAL; ++ } ++ ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ if (pd.type == PD_LAZY && ++ (ctx->lazy_vm == 0 || (vma->vm_flags&VM_LOCKED))) ++ pd.type = PD_COPY; ++#else ++ if (pd.type == PD_LAZY) ++ pd.type = PD_COPY; ++#endif ++ ++ if (!can_expand(&pa, &pd)) { ++ if (pa.type == PD_COPY || ++ pa.type == PD_ZERO) { ++ pgb.cpt_start = pa.start; ++ pgb.cpt_end = pa.end; ++ dump_page_block(vma, &pgb, pa.type, ctx); ++ } else if (pa.type == PD_CLONE) { ++ dump_copypage_block(vma, &pa, ctx); ++ cloned_pages++; ++ } else if (pa.type == PD_LAZY) { ++ dump_lazypage_block(vma, &pa, ctx); ++ } else if (pa.type == PD_ITER || pa.type == PD_ITERYOUNG) { ++ dump_iterpage_block(vma, &pa, ctx); ++ cloned_pages++; ++ } else if (pa.type == PD_ABSENT && ++ pa.pgoff != (pa.end - vma->vm_start)/PAGE_SIZE + vma->vm_pgoff - 1) { ++ dump_remappage_block(vma, &pa, ctx); ++ } ++ pa.start = addr; ++ } ++ pa.type = pd.type; ++ pa.end = addr + PAGE_SIZE; ++ pa.pgoff = pd.index; ++ if (addr == pa.start) ++ pa.list[0] = pd.index; ++ pa.mm = pd.mm; ++ } ++ ++ if (pa.end > pa.start) { ++ if (pa.type == PD_COPY || ++ pa.type == PD_ZERO) { ++ pgb.cpt_start = pa.start; ++ pgb.cpt_end = pa.end; ++ dump_page_block(vma, &pgb, pa.type, ctx); ++ } else if (pa.type == PD_CLONE) { ++ dump_copypage_block(vma, &pa, ctx); ++ cloned_pages++; ++ } else if (pa.type == PD_LAZY) { ++ dump_lazypage_block(vma, &pa, ctx); ++ } else if (pa.type == PD_ITER || pa.type == PD_ITERYOUNG) { ++ dump_iterpage_block(vma, &pa, ctx); ++ cloned_pages++; ++ } else if (pa.type == PD_ABSENT && ++ pa.pgoff != (pa.end - vma->vm_start)/PAGE_SIZE + vma->vm_pgoff - 1) { ++ dump_remappage_block(vma, &pa, ctx); ++ } ++ } ++ ++ if (cloned_pages) { ++ __u32 anonvma = 1; ++ loff_t anonpos = ctx->current_object + offsetof(struct cpt_vma_image, cpt_anonvma); ++ ctx->pwrite(&anonvma, 4, ctx, anonpos); ++ } ++ ++out: ++ cpt_close_object(ctx); ++ ++ cpt_pop_object(&saved_object, ctx); ++ ++ return 0; ++} ++ ++static int dump_one_aio_ctx(struct mm_struct *mm, struct kioctx *aio_ctx, ++ cpt_context_t *ctx) ++{ ++ loff_t saved_object; ++ struct cpt_aio_ctx_image aimg; ++ ++ if (!list_empty(&aio_ctx->run_list) || ++ !list_empty(&aio_ctx->active_reqs) || ++ aio_ctx->reqs_active) { ++ eprintk_ctx("AIO is active after suspend\n"); ++ return -EBUSY; ++ } ++ ++ cpt_push_object(&saved_object, ctx); ++ ++ aimg.cpt_next = CPT_ALIGN(sizeof(aimg)); ++ aimg.cpt_object = CPT_OBJ_AIO_CONTEXT; ++ aimg.cpt_hdrlen = sizeof(aimg); ++ aimg.cpt_content = CPT_CONTENT_ARRAY; ++ ++ aimg.cpt_max_reqs = aio_ctx->max_reqs; ++ aimg.cpt_ring_pages = aio_ctx->ring_info.nr_pages; ++ aimg.cpt_nr = aio_ctx->ring_info.nr; ++ aimg.cpt_tail = aio_ctx->ring_info.tail; ++ aimg.cpt_mmap_base = aio_ctx->ring_info.mmap_base; ++ ++ ctx->write(&aimg, sizeof(aimg), ctx); ++ ++ cpt_pop_object(&saved_object, ctx); ++ return 0; ++} ++ ++static int dump_one_mm(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct mm_struct *mm = obj->o_obj; ++ struct vm_area_struct *vma; ++ struct cpt_mm_image *v = cpt_get_buf(ctx); ++ ++ cpt_open_object(obj, ctx); ++ ++ v->cpt_next = -1; ++ v->cpt_object = CPT_OBJ_MM; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_start_code = mm->start_code; ++ v->cpt_end_code = mm->end_code; ++ v->cpt_start_data = mm->start_data; ++ v->cpt_end_data = mm->end_data; ++ v->cpt_start_brk = mm->start_brk; ++ v->cpt_brk = mm->brk; ++ v->cpt_start_stack = mm->start_stack; ++ v->cpt_start_arg = mm->arg_start; ++ v->cpt_end_arg = mm->arg_end; ++ v->cpt_start_env = mm->env_start; ++ v->cpt_end_env = mm->env_end; ++ v->cpt_def_flags = mm->def_flags; ++#ifdef CONFIG_BEANCOUNTERS ++ v->cpt_mmub = cpt_lookup_ubc(mm->mm_ub, ctx); ++#endif ++ /* FIXME when coredump mask exceeds 8 bits */ ++ WARN_ON(mm->flags >> 8); ++ v->cpt_dumpable = mm->flags; ++ v->cpt_vps_dumpable = mm->vps_dumpable; ++ v->cpt_used_hugetlb = 0; /* not used */ ++#ifndef CONFIG_IA64 ++ v->cpt_vdso = (__u32)(unsigned long)mm->context.vdso; ++#endif ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++#ifdef CONFIG_X86 ++ if (mm->context.size) { ++ loff_t saved_object; ++ struct cpt_obj_bits b; ++ int size; ++ ++ dprintk_ctx("nontrivial LDT\n"); ++ ++ cpt_push_object(&saved_object, ctx); ++ ++ cpt_open_object(NULL, ctx); ++ b.cpt_next = CPT_NULL; ++ b.cpt_object = CPT_OBJ_BITS; ++ b.cpt_hdrlen = sizeof(b); ++ b.cpt_content = CPT_CONTENT_MM_CONTEXT; ++ b.cpt_size = mm->context.size*LDT_ENTRY_SIZE; ++ ++ ctx->write(&b, sizeof(b), ctx); ++ ++ size = mm->context.size*LDT_ENTRY_SIZE; ++ ++#if defined(CONFIG_X86_64) || defined(CONFIG_XEN) || \ ++ LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) ++ ctx->write(mm->context.ldt, size, ctx); ++#else ++ for (i = 0; i < size; i += PAGE_SIZE) { ++ int nr = i / PAGE_SIZE, bytes; ++ char *kaddr = kmap(mm->context.ldt_pages[nr]); ++ ++ bytes = size - i; ++ if (bytes > PAGE_SIZE) ++ bytes = PAGE_SIZE; ++ ctx->write(kaddr, bytes, ctx); ++ kunmap(mm->context.ldt_pages[nr]); ++ } ++#endif ++ ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_object, ctx); ++ } ++#endif ++ ++ for (vma = mm->mmap; vma; vma = vma->vm_next) { ++ int err; ++ ++ if ((err = dump_one_vma(obj, vma, ctx)) != 0) ++ return err; ++ } ++ ++ if (mm->ioctx_list) { ++ struct kioctx *aio_ctx; ++ int err; ++ ++ for (aio_ctx = mm->ioctx_list; aio_ctx; aio_ctx = aio_ctx->next) ++ if ((err = dump_one_aio_ctx(mm, aio_ctx, ctx)) != 0) ++ return err; ++ } ++ ++ cpt_close_object(ctx); ++ ++ return 0; ++} ++ ++int cpt_dump_vm(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ scnt = scnt0 = zcnt = 0; ++ ++ cpt_open_section(ctx, CPT_SECT_MM); ++ ++ for_each_object(obj, CPT_OBJ_MM) { ++ int err; ++ ++ if ((err = dump_one_mm(obj, ctx)) != 0) ++ return err; ++ } ++ ++ cpt_close_section(ctx); ++ ++ if (scnt) ++ dprintk_ctx("cpt_dump_vm: %d shared private anon pages\n", scnt); ++ if (scnt0) ++ dprintk_ctx("cpt_dump_vm: %d anon pages are cloned\n", scnt0); ++ if (zcnt) ++ dprintk_ctx("cpt_dump_vm: %d silly pages canceled\n", zcnt); ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_mm.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_mm.h +--- ./kernel/cpt/cpt_mm.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_mm.h 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,43 @@ ++int cpt_collect_mm(cpt_context_t *); ++ ++int cpt_dump_vm(struct cpt_context *ctx); ++ ++__u32 rst_mm_flag(struct cpt_task_image *ti, struct cpt_context *ctx); ++int rst_mm_basic(cpt_object_t *obj, struct cpt_task_image *ti, struct cpt_context *ctx); ++int rst_mm_complete(struct cpt_task_image *ti, struct cpt_context *ctx); ++ ++int cpt_mm_prepare(unsigned long veid); ++ ++int cpt_free_pgin_dir(struct cpt_context *); ++int cpt_start_pagein(struct cpt_context *); ++int rst_setup_pagein(struct cpt_context *); ++int rst_complete_pagein(struct cpt_context *, int); ++int rst_pageind(struct cpt_context *); ++int cpt_iteration(cpt_context_t *ctx); ++int rst_iteration(cpt_context_t *ctx); ++void rst_drop_iter_dir(cpt_context_t *ctx); ++int rst_iter(struct vm_area_struct *vma, u64 pfn, ++ unsigned long addr, cpt_context_t * ctx); ++ ++int rst_swapoff(struct cpt_context *); ++ ++#ifdef ARCH_HAS_SETUP_ADDITIONAL_PAGES ++struct linux_binprm; ++extern int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack, ++ unsigned long map_address); ++#endif ++ ++#ifdef CONFIG_X86_64 ++extern char *syscall32_page; ++#define vsyscall_addr syscall32_page ++#define CPT_SYSENTER_RETURN VSYSCALL32_SYSEXIT ++#elif defined(CONFIG_X86_32) ++extern void *syscall_page; ++extern struct vm_operations_struct syscall_vm_ops; ++extern void SYSENTER_RETURN; ++#define vsyscall_addr syscall_page ++#define CPT_SYSENTER_RETURN (current->mm->context.vdso + \ ++ (unsigned long)&SYSENTER_RETURN) ++#endif ++ ++extern struct vm_operations_struct special_mapping_vmops; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_net.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_net.c +--- ./kernel/cpt/cpt_net.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_net.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,623 @@ ++/* ++ * ++ * kernel/cpt/cpt_net.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_kernel.h" ++#include "cpt_syscalls.h" ++ ++static void cpt_dump_veth(struct net_device *dev, struct cpt_context * ctx) ++{ ++#if defined(CONFIG_VE_ETHDEV) || defined(CONFIG_VE_ETHDEV_MODULE) ++ struct cpt_veth_image v; ++ struct veth_struct *veth; ++ ++ if (!KSYMREF(veth_open) || dev->open != KSYMREF(veth_open)) ++ return; ++ ++ veth = veth_from_netdev(dev); ++ cpt_open_object(NULL, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_NET_VETH; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_VOID; ++ ++ v.cpt_allow_mac_change = veth->allow_mac_change; ++ ++ ctx->write(&v, sizeof(v), ctx); ++ cpt_close_object(ctx); ++#endif ++ return; ++} ++ ++static void cpt_dump_netstats(struct net_device *dev, struct cpt_context * ctx) ++{ ++ struct cpt_netstats_image *n; ++ struct net_device_stats *stats; ++ ++ if (!dev->get_stats) ++ return; ++ ++ n = cpt_get_buf(ctx); ++ stats = dev->get_stats(dev); ++ cpt_open_object(NULL, ctx); ++ ++ n->cpt_next = CPT_NULL; ++ n->cpt_object = CPT_OBJ_NET_STATS; ++ n->cpt_hdrlen = sizeof(*n); ++ n->cpt_content = CPT_CONTENT_VOID; ++ ++ n->cpt_rx_packets = stats->rx_packets; ++ n->cpt_tx_packets = stats->tx_packets; ++ n->cpt_rx_bytes = stats->rx_bytes; ++ n->cpt_tx_bytes = stats->tx_bytes; ++ n->cpt_rx_errors = stats->rx_errors; ++ n->cpt_tx_errors = stats->tx_errors; ++ n->cpt_rx_dropped = stats->rx_dropped; ++ n->cpt_tx_dropped = stats->tx_dropped; ++ n->cpt_multicast = stats->multicast; ++ n->cpt_collisions = stats->collisions; ++ n->cpt_rx_length_errors = stats->rx_length_errors; ++ n->cpt_rx_over_errors = stats->rx_over_errors; ++ n->cpt_rx_crc_errors = stats->rx_crc_errors; ++ n->cpt_rx_frame_errors = stats->rx_frame_errors; ++ n->cpt_rx_fifo_errors = stats->rx_fifo_errors; ++ n->cpt_rx_missed_errors = stats->rx_missed_errors; ++ n->cpt_tx_aborted_errors = stats->tx_aborted_errors; ++ n->cpt_tx_carrier_errors = stats->tx_carrier_errors; ++ n->cpt_tx_fifo_errors = stats->tx_fifo_errors; ++ n->cpt_tx_heartbeat_errors = stats->tx_heartbeat_errors; ++ n->cpt_tx_window_errors = stats->tx_window_errors; ++ n->cpt_rx_compressed = stats->rx_compressed; ++ n->cpt_tx_compressed = stats->tx_compressed; ++ ++ ctx->write(n, sizeof(*n), ctx); ++ cpt_close_object(ctx); ++ cpt_release_buf(ctx); ++ return; ++} ++ ++static void cpt_dump_tuntap(struct net_device *dev, struct cpt_context * ctx) ++{ ++#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) ++ struct cpt_tuntap_image v; ++ struct tun_struct *tun; ++ cpt_object_t *obj; ++ ++ if (dev->open != tun_net_open) ++ return; ++ ++ tun = netdev_priv(dev); ++ cpt_open_object(NULL, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_NET_TUNTAP; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_VOID; ++ ++ v.cpt_owner = tun->owner; ++ v.cpt_flags = tun->flags; ++ v.cpt_attached = tun->attached; ++ ++ if (tun->bind_file) { ++ obj = lookup_cpt_object(CPT_OBJ_FILE, tun->bind_file, ctx); ++ BUG_ON(!obj); ++ v.cpt_bindfile = obj->o_pos; ++ } ++ ++ v.cpt_if_flags = tun->if_flags; ++ BUG_ON(sizeof(v.cpt_dev_addr) != sizeof(tun->dev_addr)); ++ memcpy(v.cpt_dev_addr, tun->dev_addr, sizeof(v.cpt_dev_addr)); ++ BUG_ON(sizeof(v.cpt_chr_filter) != sizeof(tun->chr_filter)); ++ memcpy(v.cpt_chr_filter, tun->chr_filter, sizeof(v.cpt_chr_filter)); ++ BUG_ON(sizeof(v.cpt_net_filter) != sizeof(tun->net_filter)); ++ memcpy(v.cpt_net_filter, tun->net_filter, sizeof(v.cpt_net_filter)); ++ ctx->write(&v, sizeof(v), ctx); ++ cpt_close_object(ctx); ++#endif ++ return; ++} ++ ++int cpt_dump_link(struct cpt_context * ctx) ++{ ++ struct net *net = get_exec_env()->ve_netns; ++ struct net_device *dev; ++ ++ cpt_open_section(ctx, CPT_SECT_NET_DEVICE); ++ for_each_netdev(net, dev) { ++ struct cpt_netdev_image v; ++ struct cpt_hwaddr_image hw; ++ loff_t saved_obj; ++ ++ cpt_open_object(NULL, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_NET_DEVICE; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_ARRAY; ++ ++ v.cpt_index = dev->ifindex; ++ v.cpt_flags = dev->flags; ++ memcpy(v.cpt_name, dev->name, IFNAMSIZ); ++ ctx->write(&v, sizeof(v), ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ ++ cpt_dump_tuntap(dev, ctx); ++ ++ cpt_dump_veth(dev, ctx); ++ ++ /* Dump hardware address */ ++ cpt_open_object(NULL, ctx); ++ hw.cpt_next = CPT_NULL; ++ hw.cpt_object = CPT_OBJ_NET_HWADDR; ++ hw.cpt_hdrlen = sizeof(hw); ++ hw.cpt_content = CPT_CONTENT_VOID; ++ BUG_ON(sizeof(hw.cpt_dev_addr) != sizeof(dev->dev_addr)); ++ memcpy(hw.cpt_dev_addr, dev->dev_addr, sizeof(hw.cpt_dev_addr)); ++ ctx->write(&hw, sizeof(hw), ctx); ++ cpt_close_object(ctx); ++ ++ cpt_dump_netstats(dev, ctx); ++ ++ cpt_pop_object(&saved_obj, ctx); ++ ++ cpt_close_object(ctx); ++ ++ if (dev != net->loopback_dev ++#if defined(CONFIG_VE_ETHDEV) || defined(CONFIG_VE_ETHDEV_MODULE) ++ && !(KSYMREF(veth_open) && dev->open == KSYMREF(veth_open)) ++#endif ++#if defined(CONFIG_VE_NETDEV) || defined(CONFIG_VE_NETDEV_MODULE) ++ && dev != get_exec_env()->_venet_dev ++#endif ++#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) ++ && dev->open != tun_net_open ++#endif ++ ) { ++ eprintk_ctx("unsupported netdevice %s\n", dev->name); ++ cpt_close_section(ctx); ++ return -EBUSY; ++ } ++ } ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++int cpt_suspend_network(struct cpt_context *ctx) ++{ ++ get_exec_env()->disable_net = 1; ++ synchronize_net(); ++ return 0; ++} ++ ++int cpt_resume_network(struct cpt_context *ctx) ++{ ++ struct ve_struct *env; ++ env = get_ve_by_id(ctx->ve_id); ++ if (!env) ++ return -ESRCH; ++ env->disable_net = 0; ++ put_ve(env); ++ return 0; ++} ++ ++int cpt_dump_ifaddr(struct cpt_context * ctx) ++{ ++ struct net *net = get_exec_env()->ve_netns; ++ struct net_device *dev; ++ ++ cpt_open_section(ctx, CPT_SECT_NET_IFADDR); ++ for_each_netdev(net, dev) { ++ struct in_device *idev = in_dev_get(dev); ++ struct in_ifaddr *ifa; ++ ++ if (!idev) ++ continue; ++ ++ for (ifa = idev->ifa_list; ifa; ifa = ifa->ifa_next) { ++ struct cpt_ifaddr_image v; ++ cpt_open_object(NULL, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_NET_IFADDR; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_VOID; ++ ++ v.cpt_index = dev->ifindex; ++ v.cpt_family = AF_INET; ++ v.cpt_masklen = ifa->ifa_prefixlen; ++ v.cpt_flags = ifa->ifa_flags; ++ v.cpt_scope = ifa->ifa_scope; ++ memset(&v.cpt_address, 0, sizeof(v.cpt_address)); ++ memset(&v.cpt_peer, 0, sizeof(v.cpt_peer)); ++ memset(&v.cpt_broadcast, 0, sizeof(v.cpt_broadcast)); ++ v.cpt_address[0] = ifa->ifa_local; ++ v.cpt_peer[0] = ifa->ifa_address; ++ v.cpt_broadcast[0] = ifa->ifa_broadcast; ++ memcpy(v.cpt_label, ifa->ifa_label, IFNAMSIZ); ++ ctx->write(&v, sizeof(v), ctx); ++ cpt_close_object(ctx); ++ } ++ in_dev_put(idev); ++ } ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++ for_each_netdev(net, dev) { ++ struct inet6_dev *idev = in6_dev_get(dev); ++ struct inet6_ifaddr *ifa; ++ ++ if (!idev) ++ continue; ++ ++ for (ifa = idev->addr_list; ifa; ifa = ifa->if_next) { ++ struct cpt_ifaddr_image v; ++ ++ if (dev == net->loopback_dev && ++ ifa->prefix_len == 128 && ++ ifa->addr.s6_addr32[0] == 0 && ++ ifa->addr.s6_addr32[1] == 0 && ++ ifa->addr.s6_addr32[2] == 0 && ++ ifa->addr.s6_addr32[3] == htonl(1)) ++ continue; ++ ++ cpt_open_object(NULL, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_NET_IFADDR; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_VOID; ++ ++ v.cpt_index = dev->ifindex; ++ v.cpt_family = AF_INET6; ++ v.cpt_masklen = ifa->prefix_len; ++ v.cpt_flags = ifa->flags; ++ v.cpt_scope = ifa->scope; ++ v.cpt_valid_lft = ifa->valid_lft; ++ v.cpt_prefered_lft = ifa->prefered_lft; ++ memcpy(&v.cpt_address, &ifa->addr, 16); ++ memcpy(&v.cpt_peer, &ifa->addr, 16); ++ memset(&v.cpt_broadcast, 0, sizeof(v.cpt_broadcast)); ++ memcpy(v.cpt_label, dev->name, IFNAMSIZ); ++ ctx->write(&v, sizeof(v), ctx); ++ cpt_close_object(ctx); ++ } ++ in6_dev_put(idev); ++ } ++#endif ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++static int cpt_dump_route(struct cpt_context * ctx) ++{ ++ int err; ++ struct socket *sock; ++ struct msghdr msg; ++ struct iovec iov; ++ struct { ++ struct nlmsghdr nlh; ++ struct rtgenmsg g; ++ } req; ++ struct sockaddr_nl nladdr; ++ struct cpt_object_hdr v; ++ mm_segment_t oldfs; ++ char *pg; ++ ++ err = sock_create_kern(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE, &sock); ++ if (err) ++ return err; ++ ++ memset(&nladdr, 0, sizeof(nladdr)); ++ nladdr.nl_family = AF_NETLINK; ++ ++ req.nlh.nlmsg_len = sizeof(req); ++ req.nlh.nlmsg_type = RTM_GETROUTE; ++ req.nlh.nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST; ++ req.nlh.nlmsg_pid = 0; ++ req.g.rtgen_family = AF_INET; ++ ++ iov.iov_base=&req; ++ iov.iov_len=sizeof(req); ++ msg.msg_name=&nladdr; ++ msg.msg_namelen=sizeof(nladdr); ++ msg.msg_iov=&iov; ++ msg.msg_iovlen=1; ++ msg.msg_control=NULL; ++ msg.msg_controllen=0; ++ msg.msg_flags=MSG_DONTWAIT; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ err = sock_sendmsg(sock, &msg, sizeof(req)); ++ set_fs(oldfs); ++ ++ if (err < 0) ++ goto out_sock; ++ ++ pg = (char*)__get_free_page(GFP_KERNEL); ++ if (pg == NULL) { ++ err = -ENOMEM; ++ goto out_sock; ++ } ++ ++ cpt_open_section(ctx, CPT_SECT_NET_ROUTE); ++ cpt_open_object(NULL, ctx); ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_NET_ROUTE; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_NLMARRAY; ++ ++ ctx->write(&v, sizeof(v), ctx); ++ ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++restart: ++#endif ++ for (;;) { ++ struct nlmsghdr *h; ++ ++ iov.iov_base = pg; ++ iov.iov_len = PAGE_SIZE; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ err = sock_recvmsg(sock, &msg, PAGE_SIZE, MSG_DONTWAIT); ++ set_fs(oldfs); ++ ++ if (err < 0) ++ goto out_sock_pg; ++ if (msg.msg_flags & MSG_TRUNC) { ++ err = -ENOBUFS; ++ goto out_sock_pg; ++ } ++ ++ h = (struct nlmsghdr*)pg; ++ while (NLMSG_OK(h, err)) { ++ if (h->nlmsg_type == NLMSG_DONE) { ++ err = 0; ++ goto done; ++ } ++ if (h->nlmsg_type == NLMSG_ERROR) { ++ struct nlmsgerr *errm = (struct nlmsgerr*)NLMSG_DATA(h); ++ err = errm->error; ++ eprintk_ctx("NLMSG error: %d\n", errm->error); ++ goto done; ++ } ++ if (h->nlmsg_type != RTM_NEWROUTE) { ++ eprintk_ctx("NLMSG: %d\n", h->nlmsg_type); ++ err = -EINVAL; ++ goto done; ++ } ++ ctx->write(h, NLMSG_ALIGN(h->nlmsg_len), ctx); ++ h = NLMSG_NEXT(h, err); ++ } ++ if (err) { ++ eprintk_ctx("!!!Remnant of size %d %d %d\n", err, h->nlmsg_len, h->nlmsg_type); ++ err = -EINVAL; ++ break; ++ } ++ } ++done: ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++ if (!err && req.g.rtgen_family == AF_INET) { ++ req.g.rtgen_family = AF_INET6; ++ iov.iov_base=&req; ++ iov.iov_len=sizeof(req); ++ msg.msg_name=&nladdr; ++ msg.msg_namelen=sizeof(nladdr); ++ msg.msg_iov=&iov; ++ msg.msg_iovlen=1; ++ msg.msg_control=NULL; ++ msg.msg_controllen=0; ++ msg.msg_flags=MSG_DONTWAIT; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ err = sock_sendmsg(sock, &msg, sizeof(req)); ++ set_fs(oldfs); ++ ++ if (err > 0) ++ goto restart; ++ } ++#endif ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ cpt_close_section(ctx); ++ ++out_sock_pg: ++ free_page((unsigned long)pg); ++out_sock: ++ sock_release(sock); ++ return err; ++} ++ ++struct args_t ++{ ++ int* pfd; ++ envid_t veid; ++}; ++ ++static int dumpfn(void *arg) ++{ ++ int i; ++ struct args_t *args = arg; ++ int *pfd = args->pfd; ++ char *argv[] = { "iptables-save", "-c", NULL }; ++ ++ i = real_env_create(args->veid, VE_ENTER|VE_SKIPLOCK, 2, NULL, 0); ++ if (i < 0) { ++ eprintk("cannot enter ve to dump iptables\n"); ++ module_put(THIS_MODULE); ++ return 255 << 8; ++ } ++ ++ if (pfd[1] != 1) ++ sc_dup2(pfd[1], 1); ++ ++ for (i=0; ifiles->fdt->max_fds; i++) { ++ if (i != 1) ++ sc_close(i); ++ } ++ ++ module_put(THIS_MODULE); ++ ++ set_fs(KERNEL_DS); ++ i = sc_execve("/sbin/iptables-save", argv, NULL); ++ if (i == -ENOENT) ++ i = sc_execve("/usr/sbin/iptables-save", argv, NULL); ++ eprintk("failed to exec iptables-save: %d\n", i); ++ return 255 << 8; ++} ++ ++ ++static int cpt_dump_iptables(struct cpt_context * ctx) ++{ ++ int err = 0; ++#ifdef CONFIG_VE_IPTABLES ++ int pid; ++ int pfd[2]; ++ struct file *f; ++ struct cpt_object_hdr v; ++ char buf[16]; ++ loff_t pos; ++ int n; ++ int status; ++ mm_segment_t oldfs; ++ sigset_t ignore, blocked; ++ struct args_t args; ++ struct ve_struct *oldenv; ++ ++ if (!(get_exec_env()->_iptables_modules & VE_IP_IPTABLES_MOD)) ++ return 0; ++ ++ err = sc_pipe(pfd); ++ if (err < 0) { ++ eprintk_ctx("sc_pipe: %d\n", err); ++ return err; ++ } ++ args.pfd = pfd; ++ args.veid = VEID(get_exec_env()); ++ ignore.sig[0] = CPT_SIG_IGNORE_MASK; ++ sigprocmask(SIG_BLOCK, &ignore, &blocked); ++ oldenv = set_exec_env(get_ve0()); ++ err = pid = local_kernel_thread(dumpfn, (void*)&args, ++ SIGCHLD | CLONE_VFORK, 0); ++ set_exec_env(oldenv); ++ if (err < 0) { ++ eprintk_ctx("local_kernel_thread: %d\n", err); ++ goto out; ++ } ++ ++ f = fget(pfd[0]); ++ sc_close(pfd[1]); ++ sc_close(pfd[0]); ++ ++ cpt_open_section(ctx, CPT_SECT_NET_IPTABLES); ++ ++ cpt_open_object(NULL, ctx); ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_NAME; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_NAME; ++ ++ ctx->write(&v, sizeof(v), ctx); ++ ++ pos = ctx->file->f_pos; ++ do { ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ n = f->f_op->read(f, buf, sizeof(buf), &f->f_pos); ++ set_fs(oldfs); ++ if (n > 0) ++ ctx->write(buf, n, ctx); ++ } while (n > 0); ++ ++ if (n < 0) ++ eprintk_ctx("read: %d\n", n); ++ ++ fput(f); ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if ((err = sc_waitx(pid, 0, &status)) < 0) ++ eprintk_ctx("wait4: %d\n", err); ++ else if ((status & 0x7f) == 0) { ++ err = (status & 0xff00) >> 8; ++ if (err != 0) { ++ eprintk_ctx("iptables-save exited with %d\n", err); ++ err = -EINVAL; ++ } ++ } else { ++ eprintk_ctx("iptables-save terminated\n"); ++ err = -EINVAL; ++ } ++ set_fs(oldfs); ++ sigprocmask(SIG_SETMASK, &blocked, NULL); ++ ++ if (ctx->file->f_pos != pos) { ++ buf[0] = 0; ++ ctx->write(buf, 1, ctx); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ cpt_close_section(ctx); ++ } else { ++ pos = ctx->current_section; ++ cpt_close_object(ctx); ++ cpt_close_section(ctx); ++ ctx->sections[CPT_SECT_NET_IPTABLES] = CPT_NULL; ++ ctx->file->f_pos = pos; ++ } ++ return n ? : err; ++ ++out: ++ if (pfd[1] >= 0) ++ sc_close(pfd[1]); ++ if (pfd[0] >= 0) ++ sc_close(pfd[0]); ++ sigprocmask(SIG_SETMASK, &blocked, NULL); ++#endif ++ return err; ++} ++ ++int cpt_dump_ifinfo(struct cpt_context * ctx) ++{ ++ int err; ++ ++ rtnl_lock(); ++ err = cpt_dump_link(ctx); ++ if (!err) ++ err = cpt_dump_ifaddr(ctx); ++ rtnl_unlock(); ++ if (!err) ++ err = cpt_dump_route(ctx); ++ if (!err) ++ err = cpt_dump_iptables(ctx); ++ return err; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_net.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_net.h +--- ./kernel/cpt/cpt_net.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_net.h 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,7 @@ ++int cpt_dump_ifinfo(struct cpt_context *ctx); ++int rst_restore_net(struct cpt_context *ctx); ++int cpt_suspend_network(struct cpt_context *ctx); ++int cpt_resume_network(struct cpt_context *ctx); ++int rst_resume_network(struct cpt_context *ctx); ++int cpt_dump_ip_conntrack(struct cpt_context *ctx); ++int rst_restore_ip_conntrack(struct cpt_context * ctx); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_obj.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_obj.c +--- ./kernel/cpt/cpt_obj.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_obj.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,162 @@ ++/* ++ * ++ * kernel/cpt/cpt_obj.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++ ++cpt_object_t *alloc_cpt_object(int gfp, struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ obj = kmalloc(sizeof(cpt_object_t), gfp); ++ if (obj) { ++ INIT_LIST_HEAD(&obj->o_list); ++ INIT_LIST_HEAD(&obj->o_hash); ++ INIT_LIST_HEAD(&obj->o_alist); ++ obj->o_count = 1; ++ obj->o_pos = CPT_NULL; ++ obj->o_lock = 0; ++ obj->o_parent = NULL; ++ obj->o_index = CPT_NOINDEX; ++ obj->o_obj = NULL; ++ obj->o_image = NULL; ++ ctx->objcount++; ++ } ++ return obj; ++} ++ ++void free_cpt_object(cpt_object_t *obj, cpt_context_t *ctx) ++{ ++ list_del(&obj->o_alist); ++ kfree(obj); ++ ctx->objcount--; ++} ++ ++void intern_cpt_object(enum _cpt_object_type type, cpt_object_t *obj, cpt_context_t *ctx) ++{ ++ list_add_tail(&obj->o_list, &ctx->object_array[type]); ++} ++ ++void insert_cpt_object(enum _cpt_object_type type, cpt_object_t *obj, ++ cpt_object_t *head, cpt_context_t *ctx) ++{ ++ list_add(&obj->o_list, &head->o_list); ++} ++ ++cpt_object_t * __cpt_object_add(enum _cpt_object_type type, void *p, ++ unsigned gfp_mask, cpt_context_t *ctx) ++{ ++ cpt_object_t *obj; ++ ++ obj = lookup_cpt_object(type, p, ctx); ++ ++ if (obj) { ++ obj->o_count++; ++ return obj; ++ } ++ ++ if ((obj = alloc_cpt_object(gfp_mask, ctx)) != NULL) { ++ if (p) ++ cpt_obj_setobj(obj, p, ctx); ++ intern_cpt_object(type, obj, ctx); ++ return obj; ++ } ++ return NULL; ++} ++ ++cpt_object_t * cpt_object_add(enum _cpt_object_type type, void *p, cpt_context_t *ctx) ++{ ++ return __cpt_object_add(type, p, GFP_KERNEL, ctx); ++} ++ ++cpt_object_t * cpt_object_get(enum _cpt_object_type type, void *p, cpt_context_t *ctx) ++{ ++ cpt_object_t *obj; ++ ++ obj = lookup_cpt_object(type, p, ctx); ++ ++ if (obj) ++ obj->o_count++; ++ ++ return obj; ++} ++ ++int cpt_object_init(cpt_context_t *ctx) ++{ ++ int i; ++ ++ for (i=0; iobject_array[i]); ++ } ++ return 0; ++} ++ ++int cpt_object_destroy(cpt_context_t *ctx) ++{ ++ int i; ++ ++ for (i=0; iobject_array[i])) { ++ struct list_head *head = ctx->object_array[i].next; ++ cpt_object_t *obj = list_entry(head, cpt_object_t, o_list); ++ list_del(head); ++ if (obj->o_image) ++ kfree(obj->o_image); ++ free_cpt_object(obj, ctx); ++ } ++ } ++ if (ctx->objcount != 0) ++ eprintk_ctx("BUG: ctx->objcount=%d\n", ctx->objcount); ++ return 0; ++} ++ ++cpt_object_t *lookup_cpt_object(enum _cpt_object_type type, void *p, struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, type) { ++ if (obj->o_obj == p) ++ return obj; ++ } ++ return NULL; ++} ++ ++cpt_object_t *lookup_cpt_obj_bypos(enum _cpt_object_type type, loff_t pos, struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, type) { ++ if (obj->o_pos == pos) ++ return obj; ++ } ++ return NULL; ++} ++ ++cpt_object_t *lookup_cpt_obj_byindex(enum _cpt_object_type type, __u32 index, struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, type) { ++ if (obj->o_index == index) ++ return obj; ++ } ++ return NULL; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_obj.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_obj.h +--- ./kernel/cpt/cpt_obj.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_obj.h 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,62 @@ ++#ifndef __CPT_OBJ_H_ ++#define __CPT_OBJ_H_ 1 ++ ++#include ++#include ++ ++typedef struct _cpt_object ++{ ++ struct list_head o_list; ++ struct list_head o_hash; ++ int o_count; ++ int o_index; ++ int o_lock; ++ loff_t o_pos; ++ loff_t o_ppos; ++ void *o_obj; ++ void *o_image; ++ void *o_parent; ++ struct list_head o_alist; ++} cpt_object_t; ++ ++struct cpt_context; ++ ++#define for_each_object(obj, type) list_for_each_entry(obj, &ctx->object_array[type], o_list) ++ ++ ++extern cpt_object_t *alloc_cpt_object(int gfp, struct cpt_context *ctx); ++extern void free_cpt_object(cpt_object_t *obj, struct cpt_context *ctx); ++ ++cpt_object_t *lookup_cpt_object(enum _cpt_object_type type, void *p, struct cpt_context *ctx); ++cpt_object_t *lookup_cpt_obj_bypos(enum _cpt_object_type type, loff_t pos, struct cpt_context *ctx); ++cpt_object_t *lookup_cpt_obj_byindex(enum _cpt_object_type type, __u32 index, struct cpt_context *ctx); ++ ++static inline void cpt_obj_setpos(cpt_object_t *cpt, loff_t pos, struct cpt_context *ctx) ++{ ++ cpt->o_pos = pos; ++ /* Add to pos hash table */ ++} ++ ++static inline void cpt_obj_setobj(cpt_object_t *cpt, void *ptr, struct cpt_context *ctx) ++{ ++ cpt->o_obj = ptr; ++ /* Add to hash table */ ++} ++ ++static inline void cpt_obj_setindex(cpt_object_t *cpt, __u32 index, struct cpt_context *ctx) ++{ ++ cpt->o_index = index; ++ /* Add to index hash table */ ++} ++ ++ ++extern void intern_cpt_object(enum _cpt_object_type type, cpt_object_t *obj, struct cpt_context *ctx); ++extern void insert_cpt_object(enum _cpt_object_type type, cpt_object_t *obj, cpt_object_t *head, struct cpt_context *ctx); ++extern cpt_object_t *cpt_object_add(enum _cpt_object_type type, void *p, struct cpt_context *ctx); ++extern cpt_object_t *__cpt_object_add(enum _cpt_object_type type, void *p, unsigned int gfp_mask, struct cpt_context *ctx); ++extern cpt_object_t *cpt_object_get(enum _cpt_object_type type, void *p, struct cpt_context *ctx); ++ ++extern int cpt_object_init(struct cpt_context *ctx); ++extern int cpt_object_destroy(struct cpt_context *ctx); ++ ++#endif /* __CPT_OBJ_H_ */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_proc.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_proc.c +--- ./kernel/cpt/cpt_proc.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_proc.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,596 @@ ++/* ++ * ++ * kernel/cpt/cpt_proc.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_dump.h" ++#include "cpt_mm.h" ++#include "cpt_kernel.h" ++ ++MODULE_AUTHOR("Alexey Kuznetsov "); ++MODULE_LICENSE("GPL"); ++ ++/* List of contexts and lock protecting the list */ ++static struct list_head cpt_context_list; ++static spinlock_t cpt_context_lock; ++ ++static int proc_read(char *buffer, char **start, off_t offset, ++ int length, int *eof, void *data) ++{ ++ off_t pos = 0; ++ off_t begin = 0; ++ int len = 0; ++ cpt_context_t *ctx; ++ ++ len += sprintf(buffer, "Ctx Id VE State\n"); ++ ++ spin_lock(&cpt_context_lock); ++ ++ list_for_each_entry(ctx, &cpt_context_list, ctx_list) { ++ len += sprintf(buffer+len,"%p %08x %-8u %d", ++ ctx, ++ ctx->contextid, ++ ctx->ve_id, ++ ctx->ctx_state ++ ); ++ ++ buffer[len++] = '\n'; ++ ++ pos = begin+len; ++ if (pos < offset) { ++ len = 0; ++ begin = pos; ++ } ++ if (pos > offset+length) ++ goto done; ++ } ++ *eof = 1; ++ ++done: ++ spin_unlock(&cpt_context_lock); ++ *start = buffer + (offset - begin); ++ len -= (offset - begin); ++ if(len > length) ++ len = length; ++ if(len < 0) ++ len = 0; ++ return len; ++} ++ ++void cpt_context_release(cpt_context_t *ctx) ++{ ++ list_del(&ctx->ctx_list); ++ spin_unlock(&cpt_context_lock); ++ ++ if (ctx->ctx_state > 0) ++ cpt_resume(ctx); ++ ctx->ctx_state = CPT_CTX_ERROR; ++ ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ if (ctx->pgin_task) ++ put_task_struct(ctx->pgin_task); ++ if (ctx->pgin_dir) ++ cpt_free_pgin_dir(ctx); ++ if (ctx->pagein_file_out) ++ fput(ctx->pagein_file_out); ++ if (ctx->pagein_file_in) ++ fput(ctx->pagein_file_in); ++#endif ++ if (ctx->objcount) ++ eprintk_ctx("%d objects leaked\n", ctx->objcount); ++ if (ctx->file) ++ fput(ctx->file); ++ cpt_flush_error(ctx); ++ if (ctx->errorfile) { ++ fput(ctx->errorfile); ++ ctx->errorfile = NULL; ++ } ++ if (ctx->error_msg) { ++ free_page((unsigned long)ctx->error_msg); ++ ctx->error_msg = NULL; ++ } ++ if (ctx->statusfile) ++ fput(ctx->statusfile); ++ if (ctx->lockfile) ++ fput(ctx->lockfile); ++ kfree(ctx); ++ ++ spin_lock(&cpt_context_lock); ++} ++ ++static void __cpt_context_put(cpt_context_t *ctx) ++{ ++ if (!--ctx->refcount) ++ cpt_context_release(ctx); ++} ++ ++static void cpt_context_put(cpt_context_t *ctx) ++{ ++ spin_lock(&cpt_context_lock); ++ __cpt_context_put(ctx); ++ spin_unlock(&cpt_context_lock); ++} ++ ++cpt_context_t * cpt_context_open(void) ++{ ++ cpt_context_t *ctx; ++ ++ if ((ctx = kmalloc(sizeof(*ctx), GFP_KERNEL)) != NULL) { ++ cpt_context_init(ctx); ++ spin_lock(&cpt_context_lock); ++ list_add_tail(&ctx->ctx_list, &cpt_context_list); ++ spin_unlock(&cpt_context_lock); ++ ctx->error_msg = (char*)__get_free_page(GFP_KERNEL); ++ if (ctx->error_msg != NULL) ++ ctx->error_msg[0] = 0; ++ } ++ return ctx; ++} ++ ++static cpt_context_t * cpt_context_lookup(unsigned int contextid) ++{ ++ cpt_context_t *ctx; ++ ++ spin_lock(&cpt_context_lock); ++ list_for_each_entry(ctx, &cpt_context_list, ctx_list) { ++ if (ctx->contextid == contextid) { ++ ctx->refcount++; ++ spin_unlock(&cpt_context_lock); ++ return ctx; ++ } ++ } ++ spin_unlock(&cpt_context_lock); ++ return NULL; ++} ++ ++int cpt_context_lookup_veid(unsigned int veid) ++{ ++ cpt_context_t *ctx; ++ ++ spin_lock(&cpt_context_lock); ++ list_for_each_entry(ctx, &cpt_context_list, ctx_list) { ++ if (ctx->ve_id == veid && ctx->ctx_state > 0) { ++ spin_unlock(&cpt_context_lock); ++ return 1; ++ } ++ } ++ spin_unlock(&cpt_context_lock); ++ return 0; ++} ++ ++static int cpt_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg) ++{ ++ int err = 0; ++ cpt_context_t *ctx; ++ struct file *dfile = NULL; ++ int try; ++ ++ unlock_kernel(); ++ ++ if (cmd == CPT_VMPREP) { ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ err = cpt_mm_prepare(arg); ++#else ++ err = -EINVAL; ++#endif ++ goto out_lock; ++ } ++ ++ if (cmd == CPT_TEST_CAPS) { ++ unsigned int src_flags, dst_flags = arg; ++ ++ err = 0; ++ src_flags = test_cpu_caps(); ++ test_one_flag_old(src_flags, dst_flags, CPT_CPU_X86_CMOV, "cmov", err); ++ test_one_flag_old(src_flags, dst_flags, CPT_CPU_X86_FXSR, "fxsr", err); ++ test_one_flag_old(src_flags, dst_flags, CPT_CPU_X86_SSE, "sse", err); ++ test_one_flag_old(src_flags, dst_flags, CPT_CPU_X86_SSE2, "sse2", err); ++ test_one_flag_old(src_flags, dst_flags, CPT_CPU_X86_MMX, "mmx", err); ++ test_one_flag_old(src_flags, dst_flags, CPT_CPU_X86_3DNOW, "3dnow", err); ++ test_one_flag_old(src_flags, dst_flags, CPT_CPU_X86_3DNOW2, "3dnowext", err); ++ test_one_flag_old(src_flags, dst_flags, CPT_CPU_X86_SEP, "sysenter", err); ++ goto out_lock; ++ } ++ ++ if (cmd == CPT_JOIN_CONTEXT || cmd == CPT_PUT_CONTEXT) { ++ cpt_context_t *old_ctx; ++ ++ ctx = NULL; ++ if (cmd == CPT_JOIN_CONTEXT) { ++ err = -ENOENT; ++ ctx = cpt_context_lookup(arg); ++ if (!ctx) ++ goto out_lock; ++ } ++ ++ spin_lock(&cpt_context_lock); ++ old_ctx = (cpt_context_t*)file->private_data; ++ file->private_data = ctx; ++ ++ if (old_ctx) { ++ if (cmd == CPT_PUT_CONTEXT && old_ctx->sticky) { ++ old_ctx->sticky = 0; ++ old_ctx->refcount--; ++ } ++ __cpt_context_put(old_ctx); ++ } ++ spin_unlock(&cpt_context_lock); ++ err = 0; ++ goto out_lock; ++ } ++ ++ spin_lock(&cpt_context_lock); ++ ctx = (cpt_context_t*)file->private_data; ++ if (ctx) ++ ctx->refcount++; ++ spin_unlock(&cpt_context_lock); ++ ++ if (!ctx) { ++ cpt_context_t *old_ctx; ++ ++ err = -ENOMEM; ++ ctx = cpt_context_open(); ++ if (!ctx) ++ goto out_lock; ++ ++ spin_lock(&cpt_context_lock); ++ old_ctx = (cpt_context_t*)file->private_data; ++ if (!old_ctx) { ++ ctx->refcount++; ++ file->private_data = ctx; ++ } else { ++ old_ctx->refcount++; ++ } ++ if (old_ctx) { ++ __cpt_context_put(ctx); ++ ctx = old_ctx; ++ } ++ spin_unlock(&cpt_context_lock); ++ } ++ ++ if (cmd == CPT_GET_CONTEXT) { ++ unsigned int contextid = (unsigned int)arg; ++ ++ if (ctx->contextid && ctx->contextid != contextid) { ++ err = -EINVAL; ++ goto out_nosem; ++ } ++ if (!ctx->contextid) { ++ cpt_context_t *c1 = cpt_context_lookup(contextid); ++ if (c1) { ++ cpt_context_put(c1); ++ err = -EEXIST; ++ goto out_nosem; ++ } ++ ctx->contextid = contextid; ++ } ++ spin_lock(&cpt_context_lock); ++ if (!ctx->sticky) { ++ ctx->sticky = 1; ++ ctx->refcount++; ++ } ++ spin_unlock(&cpt_context_lock); ++ goto out_nosem; ++ } ++ ++ down(&ctx->main_sem); ++ ++ err = -EBUSY; ++ if (ctx->ctx_state < 0) ++ goto out; ++ ++ err = 0; ++ switch (cmd) { ++ case CPT_SET_DUMPFD: ++ if (ctx->ctx_state == CPT_CTX_DUMPING) { ++ err = -EBUSY; ++ break; ++ } ++ if (arg >= 0) { ++ err = -EBADF; ++ dfile = fget(arg); ++ if (dfile == NULL) ++ break; ++ if (dfile->f_op == NULL || ++ dfile->f_op->write == NULL) { ++ fput(dfile); ++ break; ++ } ++ err = 0; ++ } ++ if (ctx->file) ++ fput(ctx->file); ++ ctx->file = dfile; ++ break; ++ case CPT_SET_ERRORFD: ++ if (arg >= 0) { ++ dfile = fget(arg); ++ if (dfile == NULL) { ++ err = -EBADF; ++ break; ++ } ++ } ++ if (ctx->errorfile) ++ fput(ctx->errorfile); ++ ctx->errorfile = dfile; ++ break; ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ case CPT_SET_PAGEINFDIN: ++ if (arg >= 0) { ++ dfile = fget(arg); ++ if (dfile == NULL) { ++ err = -EBADF; ++ break; ++ } ++ } ++ if (ctx->pagein_file_in) ++ fput(ctx->pagein_file_in); ++ ctx->pagein_file_in = dfile; ++ break; ++ case CPT_SET_PAGEINFDOUT: ++ if (arg >= 0) { ++ dfile = fget(arg); ++ if (dfile == NULL) { ++ err = -EBADF; ++ break; ++ } ++ } ++ if (ctx->pagein_file_out) ++ fput(ctx->pagein_file_out); ++ ctx->pagein_file_out = dfile; ++ break; ++ case CPT_SET_LAZY: ++ ctx->lazy_vm = arg; ++ break; ++ case CPT_ITER: ++ err = cpt_iteration(ctx); ++ break; ++ case CPT_PAGEIND: ++ err = cpt_start_pagein(ctx); ++ break; ++#endif ++ case CPT_SET_VEID: ++ if (ctx->ctx_state > 0) { ++ err = -EBUSY; ++ break; ++ } ++ ctx->ve_id = arg; ++ break; ++ case CPT_SET_CPU_FLAGS: ++ if (ctx->ctx_state > 0) { ++ err = -EBUSY; ++ break; ++ } ++ ctx->dst_cpu_flags = arg; ++ ctx->src_cpu_flags = test_cpu_caps(); ++ break; ++ case CPT_SUSPEND: ++ if (cpt_context_lookup_veid(ctx->ve_id) || ++ ctx->ctx_state > 0) { ++ err = -EBUSY; ++ break; ++ } ++ ctx->ctx_state = CPT_CTX_SUSPENDING; ++ try = 0; ++ do { ++ err = cpt_vps_suspend(ctx); ++ if (err) ++ cpt_resume(ctx); ++ if (err == -EAGAIN) ++ msleep(1000); ++ try++; ++ } while (err == -EAGAIN && try < 3); ++ if (err) { ++ ctx->ctx_state = CPT_CTX_IDLE; ++ } else { ++ ctx->ctx_state = CPT_CTX_SUSPENDED; ++ } ++ break; ++ case CPT_DUMP: ++ if (!ctx->ctx_state) { ++ err = -ENOENT; ++ break; ++ } ++ if (!ctx->file) { ++ err = -EBADF; ++ break; ++ } ++ err = cpt_dump(ctx); ++ break; ++ case CPT_RESUME: ++ if (ctx->ctx_state == CPT_CTX_IDLE) { ++ err = -ENOENT; ++ break; ++ } ++ err = cpt_resume(ctx); ++ if (!err) ++ ctx->ctx_state = CPT_CTX_IDLE; ++ break; ++ case CPT_KILL: ++ if (ctx->ctx_state == CPT_CTX_IDLE) { ++ err = -ENOENT; ++ break; ++ } ++ err = cpt_kill(ctx); ++ if (!err) ++ ctx->ctx_state = CPT_CTX_IDLE; ++ break; ++ case CPT_TEST_VECAPS: ++ { ++ __u32 dst_flags = arg; ++ __u32 src_flags; ++ ++ err = cpt_vps_caps(ctx, &src_flags); ++ if (err) ++ break; ++ ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_CMOV, "cmov", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_FXSR, "fxsr", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_SSE, "sse", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_SSE2, "sse2", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_MMX, "mmx", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_3DNOW, "3dnow", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_3DNOW2, "3dnowext", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_SEP, "sysenter", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_EMT64, "emt64", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_IA64, "ia64", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_SYSCALL, "syscall", err); ++ test_one_flag(src_flags, dst_flags, CPT_CPU_X86_SYSCALL32, "syscall32", err); ++ if (src_flags & CPT_UNSUPPORTED_MASK) ++ err = 2; ++ break; ++ } ++ default: ++ err = -EINVAL; ++ break; ++ } ++ ++out: ++ cpt_flush_error(ctx); ++ up(&ctx->main_sem); ++out_nosem: ++ cpt_context_put(ctx); ++out_lock: ++ lock_kernel(); ++ if (err == -ERESTARTSYS || err == -ERESTARTNOINTR || ++ err == -ERESTARTNOHAND || err == -ERESTART_RESTARTBLOCK) ++ err = -EINTR; ++ return err; ++} ++ ++static int cpt_open(struct inode *inode, struct file *file) ++{ ++ if (!try_module_get(THIS_MODULE)) ++ return -EBUSY; ++ ++ return 0; ++} ++ ++static int cpt_release(struct inode * inode, struct file * file) ++{ ++ cpt_context_t *ctx; ++ ++ spin_lock(&cpt_context_lock); ++ ctx = (cpt_context_t*)file->private_data; ++ file->private_data = NULL; ++ ++ if (ctx) ++ __cpt_context_put(ctx); ++ spin_unlock(&cpt_context_lock); ++ ++ module_put(THIS_MODULE); ++ return 0; ++} ++ ++ ++static struct file_operations cpt_fops = { ++ .owner = THIS_MODULE, ++ .open = cpt_open, ++ .release = cpt_release, ++ .ioctl = cpt_ioctl, ++}; ++ ++static struct proc_dir_entry *proc_ent; ++ ++static struct ctl_table_header *ctl_header; ++ ++static ctl_table debug_table[] = { ++ { ++ .ctl_name = 9475, ++ .procname = "cpt", ++ .data = &debug_level, ++ .maxlen = sizeof(debug_level), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec, ++ }, ++ { .ctl_name = 0 } ++}; ++static ctl_table root_table[] = { ++ { ++ .ctl_name = CTL_DEBUG, ++ .procname = "debug", ++ .mode = 0555, ++ .child = debug_table, ++ }, ++ { .ctl_name = 0 } ++}; ++ ++static int __init init_cpt(void) ++{ ++ int err; ++ ++ err = -ENOMEM; ++ ctl_header = register_sysctl_table(root_table); ++ if (!ctl_header) ++ goto err_mon; ++ ++ spin_lock_init(&cpt_context_lock); ++ INIT_LIST_HEAD(&cpt_context_list); ++ ++ err = -EINVAL; ++ proc_ent = create_proc_entry_mod("cpt", 0600, NULL, THIS_MODULE); ++ if (!proc_ent) ++ goto err_out; ++ ++ cpt_fops.read = proc_ent->proc_fops->read; ++ cpt_fops.write = proc_ent->proc_fops->write; ++ cpt_fops.llseek = proc_ent->proc_fops->llseek; ++ proc_ent->proc_fops = &cpt_fops; ++ ++ proc_ent->read_proc = proc_read; ++ proc_ent->data = NULL; ++ proc_ent->owner = THIS_MODULE; ++ return 0; ++ ++err_out: ++ unregister_sysctl_table(ctl_header); ++err_mon: ++ return err; ++} ++module_init(init_cpt); ++ ++static void __exit exit_cpt(void) ++{ ++ remove_proc_entry("cpt", NULL); ++ unregister_sysctl_table(ctl_header); ++ ++ spin_lock(&cpt_context_lock); ++ while (!list_empty(&cpt_context_list)) { ++ cpt_context_t *ctx; ++ ctx = list_entry(cpt_context_list.next, cpt_context_t, ctx_list); ++ ++ if (!ctx->sticky) ++ ctx->refcount++; ++ ctx->sticky = 0; ++ ++ BUG_ON(ctx->refcount != 1); ++ ++ __cpt_context_put(ctx); ++ } ++ spin_unlock(&cpt_context_lock); ++} ++module_exit(exit_cpt); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_process.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_process.c +--- ./kernel/cpt/cpt_process.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_process.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,1371 @@ ++/* ++ * ++ * kernel/cpt/cpt_process.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_ubc.h" ++#include "cpt_process.h" ++#include "cpt_kernel.h" ++ ++#ifdef CONFIG_X86_32 ++#undef task_pt_regs ++#define task_pt_regs(t) ((struct pt_regs *)((t)->thread.esp0) - 1) ++#endif ++ ++int check_task_state(struct task_struct *tsk, struct cpt_context *ctx) ++{ ++#ifdef CONFIG_X86_64 ++ if (!(task_thread_info(tsk)->flags&_TIF_IA32)) { ++ if (task_pt_regs(tsk)->rip >= VSYSCALL_START && ++ task_pt_regs(tsk)->rip < VSYSCALL_END) { ++ eprintk_ctx(CPT_FID "cannot be checkpointied while vsyscall, try later\n", CPT_TID(tsk)); ++ return -EAGAIN; ++ } ++ } ++#endif ++ return 0; ++} ++ ++#ifdef CONFIG_X86 ++ ++static u32 encode_segment(u32 segreg) ++{ ++ segreg &= 0xFFFF; ++ ++ if (segreg == 0) ++ return CPT_SEG_ZERO; ++ if ((segreg & 3) != 3) { ++ wprintk("Invalid RPL of a segment reg %x\n", segreg); ++ return CPT_SEG_ZERO; ++ } ++ ++ /* LDT descriptor, it is just an index to LDT array */ ++ if (segreg & 4) ++ return CPT_SEG_LDT + (segreg >> 3); ++ ++ /* TLS descriptor. */ ++ if ((segreg >> 3) >= GDT_ENTRY_TLS_MIN && ++ (segreg >> 3) <= GDT_ENTRY_TLS_MAX) ++ return CPT_SEG_TLS1 + ((segreg>>3) - GDT_ENTRY_TLS_MIN); ++ ++ /* One of standard desriptors */ ++#ifdef CONFIG_X86_64 ++ if (segreg == __USER32_DS) ++ return CPT_SEG_USER32_DS; ++ if (segreg == __USER32_CS) ++ return CPT_SEG_USER32_CS; ++ if (segreg == __USER_DS) ++ return CPT_SEG_USER64_DS; ++ if (segreg == __USER_CS) ++ return CPT_SEG_USER64_CS; ++#else ++ if (segreg == __USER_DS) ++ return CPT_SEG_USER32_DS; ++ if (segreg == __USER_CS) ++ return CPT_SEG_USER32_CS; ++#endif ++ wprintk("Invalid segment reg %x\n", segreg); ++ return CPT_SEG_ZERO; ++} ++ ++#ifdef CONFIG_X86_64 ++static void xlate_ptregs_64_to_32(struct cpt_x86_regs *d, struct pt_regs *s, ++ struct task_struct *tsk) ++{ ++ d->cpt_ebp = s->rbp; ++ d->cpt_ebx = s->rbx; ++ d->cpt_eax = s->rax; ++ d->cpt_ecx = s->rcx; ++ d->cpt_edx = s->rdx; ++ d->cpt_esi = s->rsi; ++ d->cpt_edi = s->rdi; ++ d->cpt_orig_eax = s->orig_rax; ++ d->cpt_eip = s->rip; ++ d->cpt_xcs = encode_segment(s->cs); ++ d->cpt_eflags = s->eflags; ++ d->cpt_esp = s->rsp; ++ d->cpt_xss = encode_segment(s->ss); ++ d->cpt_xds = encode_segment(tsk->thread.ds); ++ d->cpt_xes = encode_segment(tsk->thread.es); ++} ++ ++static int dump_registers(struct task_struct *tsk, struct cpt_context *ctx) ++{ ++ cpt_open_object(NULL, ctx); ++ ++ if (task_thread_info(tsk)->flags & _TIF_IA32) { ++ struct cpt_x86_regs ri; ++ ri.cpt_next = sizeof(ri); ++ ri.cpt_object = CPT_OBJ_X86_REGS; ++ ri.cpt_hdrlen = sizeof(ri); ++ ri.cpt_content = CPT_CONTENT_VOID; ++ ++ ri.cpt_debugreg[0] = tsk->thread.debugreg0; ++ ri.cpt_debugreg[1] = tsk->thread.debugreg1; ++ ri.cpt_debugreg[2] = tsk->thread.debugreg2; ++ ri.cpt_debugreg[3] = tsk->thread.debugreg3; ++ ri.cpt_debugreg[4] = 0; ++ ri.cpt_debugreg[5] = 0; ++ ri.cpt_debugreg[6] = tsk->thread.debugreg6; ++ ri.cpt_debugreg[7] = tsk->thread.debugreg7; ++ ri.cpt_fs = encode_segment(tsk->thread.fsindex); ++ ri.cpt_gs = encode_segment(tsk->thread.gsindex); ++ ++ xlate_ptregs_64_to_32(&ri, task_pt_regs(tsk), tsk); ++ ++ ctx->write(&ri, sizeof(ri), ctx); ++ } else { ++ struct cpt_x86_64_regs ri; ++ ri.cpt_next = sizeof(ri); ++ ri.cpt_object = CPT_OBJ_X86_64_REGS; ++ ri.cpt_hdrlen = sizeof(ri); ++ ri.cpt_content = CPT_CONTENT_VOID; ++ ++ ri.cpt_fsbase = tsk->thread.fs; ++ ri.cpt_gsbase = tsk->thread.gs; ++ ri.cpt_fsindex = encode_segment(tsk->thread.fsindex); ++ ri.cpt_gsindex = encode_segment(tsk->thread.gsindex); ++ ri.cpt_ds = encode_segment(tsk->thread.ds); ++ ri.cpt_es = encode_segment(tsk->thread.es); ++ ri.cpt_debugreg[0] = tsk->thread.debugreg0; ++ ri.cpt_debugreg[1] = tsk->thread.debugreg1; ++ ri.cpt_debugreg[2] = tsk->thread.debugreg2; ++ ri.cpt_debugreg[3] = tsk->thread.debugreg3; ++ ri.cpt_debugreg[4] = 0; ++ ri.cpt_debugreg[5] = 0; ++ ri.cpt_debugreg[6] = tsk->thread.debugreg6; ++ ri.cpt_debugreg[7] = tsk->thread.debugreg7; ++ ++ memcpy(&ri.cpt_r15, task_pt_regs(tsk), sizeof(struct pt_regs)); ++ ++ ri.cpt_cs = encode_segment(task_pt_regs(tsk)->cs); ++ ri.cpt_ss = encode_segment(task_pt_regs(tsk)->ss); ++ ++ ctx->write(&ri, sizeof(ri), ctx); ++ ++ } ++ cpt_close_object(ctx); ++ ++ return 0; ++} ++ ++#else ++ ++static int dump_registers(struct task_struct *tsk, struct cpt_context *ctx) ++{ ++ struct cpt_x86_regs ri; ++ struct pt_regs *pt_regs; ++ ++ cpt_open_object(NULL, ctx); ++ ++ ri.cpt_next = sizeof(ri); ++ ri.cpt_object = CPT_OBJ_X86_REGS; ++ ri.cpt_hdrlen = sizeof(ri); ++ ri.cpt_content = CPT_CONTENT_VOID; ++ ++ ri.cpt_debugreg[0] = tsk->thread.debugreg[0]; ++ ri.cpt_debugreg[1] = tsk->thread.debugreg[1]; ++ ri.cpt_debugreg[2] = tsk->thread.debugreg[2]; ++ ri.cpt_debugreg[3] = tsk->thread.debugreg[3]; ++ ri.cpt_debugreg[4] = tsk->thread.debugreg[4]; ++ ri.cpt_debugreg[5] = tsk->thread.debugreg[5]; ++ ri.cpt_debugreg[6] = tsk->thread.debugreg[6]; ++ ri.cpt_debugreg[7] = tsk->thread.debugreg[7]; ++ ++ pt_regs = task_pt_regs(tsk); ++ ++ ri.cpt_fs = encode_segment(pt_regs->xfs); ++ ri.cpt_gs = encode_segment(tsk->thread.gs); ++ ++ ri.cpt_ebx = pt_regs->ebx; ++ ri.cpt_ecx = pt_regs->ecx; ++ ri.cpt_edx = pt_regs->edx; ++ ri.cpt_esi = pt_regs->esi; ++ ri.cpt_edi = pt_regs->edi; ++ ri.cpt_ebp = pt_regs->ebp; ++ ri.cpt_eax = pt_regs->eax; ++ ri.cpt_xds = pt_regs->xds; ++ ri.cpt_xes = pt_regs->xes; ++ ri.cpt_orig_eax = pt_regs->orig_eax; ++ ri.cpt_eip = pt_regs->eip; ++ ri.cpt_xcs = pt_regs->xcs; ++ ri.cpt_eflags = pt_regs->eflags; ++ ri.cpt_esp = pt_regs->esp; ++ ri.cpt_xss = pt_regs->xss; ++ ++ ri.cpt_xcs = encode_segment(pt_regs->xcs); ++ ri.cpt_xss = encode_segment(pt_regs->xss); ++ ri.cpt_xds = encode_segment(pt_regs->xds); ++ ri.cpt_xes = encode_segment(pt_regs->xes); ++ ++ ctx->write(&ri, sizeof(ri), ctx); ++ cpt_close_object(ctx); ++ ++ return 0; ++} ++#endif ++#endif ++ ++#ifdef CONFIG_IA64 ++ ++/* ++ PMD? ++ */ ++ ++#define _C(x) do { if ((err = (x)) < 0) { printk("atm:" CPT_FID #x " %d\n", \ ++ CPT_TID(tsk), err); return -EINVAL; } } while (0) ++ ++static int ass_to_mouth(struct cpt_ia64_regs *r, struct task_struct *tsk, ++ struct cpt_context *ctx) ++{ ++ int err; ++ struct unw_frame_info info; ++ struct ia64_fpreg fpval; ++ int i; ++ ++ unw_init_from_blocked_task(&info, tsk); ++ _C(unw_unwind_to_user(&info)); ++ ++ /* NAT_BITS */ ++ do { ++ unsigned long scratch_unat; ++ ++ scratch_unat = info.sw->caller_unat; ++ if (info.pri_unat_loc) ++ scratch_unat = *info.pri_unat_loc; ++ ++ r->nat[0] = ia64_get_scratch_nat_bits(task_pt_regs(tsk), scratch_unat); ++ /* Just to be on safe side. */ ++ r->nat[0] &= 0xFFFFFFFFUL; ++ } while (0); ++ ++ /* R4-R7 */ ++ for (i = 4; i <= 7; i++) { ++ char nat = 0; ++ _C(unw_access_gr(&info, i, &r->gr[i], &nat, 0)); ++ r->nat[0] |= (nat != 0) << i; ++ } ++ ++ /* B1-B5 */ ++ for (i = 1; i <= 5; i++) { ++ _C(unw_access_br(&info, i, &r->br[i], 0)); ++ } ++ ++ /* AR_EC, AR_LC */ ++ _C(unw_access_ar(&info, UNW_AR_EC, &r->ar_ec, 0)); ++ _C(unw_access_ar(&info, UNW_AR_LC, &r->ar_lc, 0)); ++ ++ /* F2..F5, F16..F31 */ ++ for (i = 2; i <= 5; i++) { ++ _C(unw_get_fr(&info, i, &fpval)); ++ memcpy(&r->fr[i*2], &fpval, 16); ++ } ++ for (i = 16; i <= 31; i++) { ++ _C(unw_get_fr(&info, i, &fpval)); ++ memcpy(&r->fr[i*2], &fpval, 16); ++ } ++ return 0; ++} ++ ++#undef _C ++ ++static int dump_registers(struct task_struct *tsk, struct cpt_context *ctx) ++{ ++ int err; ++ unsigned long pg; ++ struct cpt_ia64_regs *r; ++ struct ia64_psr *psr; ++ struct switch_stack *sw; ++ struct pt_regs *pt; ++ void *krbs = (void *)tsk + IA64_RBS_OFFSET; ++ unsigned long reg; ++ ++ if (tsk->exit_state) ++ return 0; ++ ++ pt = task_pt_regs(tsk); ++ ++ sw = (struct switch_stack *) (tsk->thread.ksp + 16); ++ ++ if ((pg = __get_free_page(GFP_KERNEL)) == 0) ++ return -ENOMEM; ++ ++ r = (void*)pg; ++ /* To catch if we forgot some register */ ++ memset(r, 0xA5, sizeof(*r)); ++ ++ r->gr[0] = 0; ++ r->fr[0] = r->fr[1] = 0; ++ r->fr[2] = 0x8000000000000000UL; ++ r->fr[3] = 0xffff; ++ ++ r->nat[0] = r->nat[1] = 0; ++ ++ err = ass_to_mouth(r, tsk, ctx); ++ if (err) { ++ printk("ass_to_mouth error %d\n", err); ++ goto out; ++ } ++ ++ /* gr 1,2-3,8-11,12-13,14,15,16-31 are on pt_regs */ ++ memcpy(&r->gr[1], &pt->r1, 8*(2-1)); ++ memcpy(&r->gr[2], &pt->r2, 8*(4-2)); ++ memcpy(&r->gr[8], &pt->r8, 8*(12-8)); ++ memcpy(&r->gr[12], &pt->r12, 8*(14-12)); ++ memcpy(&r->gr[14], &pt->r14, 8*(15-14)); ++ memcpy(&r->gr[15], &pt->r15, 8*(16-15)); ++ memcpy(&r->gr[16], &pt->r16, 8*(32-16)); ++ ++ r->br[0] = pt->b0; ++ r->br[6] = pt->b6; ++ r->br[7] = pt->b7; ++ ++ r->ar_bspstore = pt->ar_bspstore; ++ r->ar_unat = pt->ar_unat; ++ r->ar_pfs = pt->ar_pfs; ++ r->ar_ccv = pt->ar_ccv; ++ r->ar_fpsr = pt->ar_fpsr; ++ r->ar_csd = pt->ar_csd; ++ r->ar_ssd = pt->ar_ssd; ++ r->ar_rsc = pt->ar_rsc; ++ ++ r->cr_iip = pt->cr_iip; ++ r->cr_ipsr = pt->cr_ipsr; ++ ++ r->pr = pt->pr; ++ ++ r->cfm = pt->cr_ifs; ++ r->ar_rnat = pt->ar_rnat; ++ ++ /* fpregs 6..9,10..11 are in pt_regs */ ++ memcpy(&r->fr[2*6], &pt->f6, 16*(10-6)); ++ memcpy(&r->fr[2*10], &pt->f10, 16*(12-10)); ++ /* fpreg 12..15 are on switch stack */ ++ memcpy(&r->fr[2*12], &sw->f12, 16*(16-12)); ++ /* fpregs 32...127 */ ++ psr = ia64_psr(task_pt_regs(tsk)); ++ preempt_disable(); ++ if (ia64_is_local_fpu_owner(tsk) && psr->mfh) { ++ psr->mfh = 0; ++ tsk->thread.flags |= IA64_THREAD_FPH_VALID; ++ ia64_save_fpu(&tsk->thread.fph[0]); ++ } ++ preempt_enable(); ++ memcpy(&r->fr[32*2], tsk->thread.fph, 16*(128-32)); ++ ++ if (tsk->thread.flags & IA64_THREAD_DBG_VALID) { ++ memcpy(r->ibr, tsk->thread.ibr, sizeof(r->ibr)); ++ memcpy(r->dbr, tsk->thread.dbr, sizeof(r->ibr)); ++ } else { ++ memset(r->ibr, 0, sizeof(r->ibr)); ++ memset(r->dbr, 0, sizeof(r->dbr)); ++ } ++ ++ r->loadrs = pt->loadrs; ++ r->num_regs = ia64_rse_num_regs(krbs, krbs + 8*(pt->loadrs >> 19)); ++ if ((long)pt->cr_ifs > 0) ++ r->num_regs += (pt->cr_ifs & 0x7f); ++ ++ if (r->num_regs > 96) { ++ eprintk_ctx(CPT_FID " too much RSE regs %lu\n", ++ CPT_TID(tsk), r->num_regs); ++ return -EINVAL; ++ } ++ ++ for (reg = 0; reg < r->num_regs; reg++) { ++ unsigned long *ptr = ia64_rse_skip_regs(krbs, reg); ++ unsigned long *rnatp = ia64_rse_rnat_addr(ptr); ++ ++ r->gr[32+reg] = *ptr; ++ ++ if ((unsigned long)rnatp >= sw->ar_bspstore) ++ rnatp = &sw->ar_rnat; ++ if (*rnatp & (1UL<nat[0] |= (1UL<<(reg+32)); ++ else ++ r->nat[1] |= (1UL<<(reg-32)); ++ } ++ } ++ if (r->nat[0] | r->nat[1]) ++ wprintk_ctx(CPT_FID " nat bits %lx%016lx\n", CPT_TID(tsk), ++ r->nat[1], r->nat[0]); ++ ++ cpt_open_object(NULL, ctx); ++ r->cpt_next = sizeof(*r); ++ r->cpt_object = CPT_OBJ_IA64_REGS; ++ r->cpt_hdrlen = sizeof(*r); ++ r->cpt_content = CPT_CONTENT_VOID; ++ ctx->write(r, sizeof(*r), ctx); ++ cpt_close_object(ctx); ++ err = 0; ++ ++out: ++ free_page(pg); ++ return err; ++} ++#endif ++ ++static int dump_kstack(struct task_struct *tsk, struct cpt_context *ctx) ++{ ++ struct cpt_obj_bits hdr; ++ unsigned long size; ++ void *start; ++ ++ cpt_open_object(NULL, ctx); ++ ++#ifdef CONFIG_X86_64 ++ size = tsk->thread.rsp0 - tsk->thread.rsp; ++ start = (void*)tsk->thread.rsp; ++#elif defined(CONFIG_X86_32) ++ size = tsk->thread.esp0 - tsk->thread.esp; ++ start = (void*)tsk->thread.esp; ++#elif defined(CONFIG_IA64) ++ size = (unsigned long)(task_pt_regs(tsk)+1) - tsk->thread.ksp; ++ start = (void*)tsk->thread.ksp; ++#else ++#error Arch is not supported ++#endif ++ ++ hdr.cpt_next = sizeof(hdr) + CPT_ALIGN(size); ++ hdr.cpt_object = CPT_OBJ_BITS; ++ hdr.cpt_hdrlen = sizeof(hdr); ++ hdr.cpt_content = CPT_CONTENT_STACK; ++ hdr.cpt_size = size; ++ ++ ctx->write(&hdr, sizeof(hdr), ctx); ++ ctx->write(start, size, ctx); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ return 0; ++} ++ ++#ifdef CONFIG_X86 ++/* Formats of i387_fxsave_struct are the same for x86_64 ++ * and i386. Plain luck. */ ++ ++static int dump_fpustate(struct task_struct *tsk, struct cpt_context *ctx) ++{ ++ struct cpt_obj_bits hdr; ++ unsigned long size; ++ int type; ++ ++ cpt_open_object(NULL, ctx); ++ ++ type = CPT_CONTENT_X86_FPUSTATE; ++ size = sizeof(struct i387_fxsave_struct); ++#ifndef CONFIG_X86_64 ++ if (!cpu_has_fxsr) { ++ size = sizeof(struct i387_fsave_struct); ++ type = CPT_CONTENT_X86_FPUSTATE_OLD; ++ } ++#endif ++ ++ hdr.cpt_next = sizeof(hdr) + CPT_ALIGN(size); ++ hdr.cpt_object = CPT_OBJ_BITS; ++ hdr.cpt_hdrlen = sizeof(hdr); ++ hdr.cpt_content = type; ++ hdr.cpt_size = size; ++ ++ ctx->write(&hdr, sizeof(hdr), ctx); ++ ctx->write(&tsk->thread.i387, size, ctx); ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ return 0; ++} ++#endif ++ ++#ifdef CONFIG_IA64 ++ ++static int dump_fpustate(struct task_struct *tsk, struct cpt_context *ctx) ++{ ++ return 0; ++} ++#endif ++ ++static int encode_siginfo(struct cpt_siginfo_image *si, siginfo_t *info) ++{ ++ si->cpt_signo = info->si_signo; ++ si->cpt_errno = info->si_errno; ++ si->cpt_code = info->si_code; ++ ++ switch(si->cpt_code & __SI_MASK) { ++ case __SI_TIMER: ++ si->cpt_pid = info->si_tid; ++ si->cpt_uid = info->si_overrun; ++ si->cpt_sigval = cpt_ptr_export(info->_sifields._timer._sigval.sival_ptr); ++ si->cpt_utime = info->si_sys_private; ++ break; ++ case __SI_POLL: ++ si->cpt_pid = info->si_band; ++ si->cpt_uid = info->si_fd; ++ break; ++ case __SI_FAULT: ++ si->cpt_sigval = cpt_ptr_export(info->si_addr); ++#ifdef __ARCH_SI_TRAPNO ++ si->cpt_pid = info->si_trapno; ++#endif ++ break; ++ case __SI_CHLD: ++ si->cpt_pid = info->si_pid; ++ si->cpt_uid = info->si_uid; ++ si->cpt_sigval = info->si_status; ++ si->cpt_stime = info->si_stime; ++ si->cpt_utime = info->si_utime; ++ break; ++ case __SI_KILL: ++ case __SI_RT: ++ case __SI_MESGQ: ++ default: ++ si->cpt_pid = info->si_pid; ++ si->cpt_uid = info->si_uid; ++ si->cpt_sigval = cpt_ptr_export(info->si_ptr); ++ break; ++ } ++ return 0; ++} ++ ++static int dump_sigqueue(struct sigpending *list, struct cpt_context *ctx) ++{ ++ struct sigqueue *q; ++ loff_t saved_obj; ++ ++ if (list_empty(&list->list)) ++ return 0; ++ ++ cpt_push_object(&saved_obj, ctx); ++ list_for_each_entry(q, &list->list, list) { ++ struct cpt_siginfo_image si; ++ ++ si.cpt_next = sizeof(si); ++ si.cpt_object = CPT_OBJ_SIGINFO; ++ si.cpt_hdrlen = sizeof(si); ++ si.cpt_content = CPT_CONTENT_VOID; ++ ++ si.cpt_qflags = q->flags; ++ si.cpt_user = q->user->uid; ++ ++ if (encode_siginfo(&si, &q->info)) ++ return -EINVAL; ++ ++ ctx->write(&si, sizeof(si), ctx); ++ } ++ cpt_pop_object(&saved_obj, ctx); ++ return 0; ++} ++ ++ ++ ++static int dump_one_signal_struct(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct signal_struct *sig = obj->o_obj; ++ struct cpt_signal_image *v = cpt_get_buf(ctx); ++ struct task_struct *tsk; ++ int i; ++ ++ cpt_open_object(obj, ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_SIGNAL_STRUCT; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ if (sig->__pgrp <= 0) { ++ eprintk_ctx("bad pgid\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ v->cpt_pgrp_type = CPT_PGRP_NORMAL; ++ read_lock(&tasklist_lock); ++ tsk = find_task_by_pid(sig->__pgrp); ++ if (tsk == NULL) ++ v->cpt_pgrp_type = CPT_PGRP_ORPHAN; ++ read_unlock(&tasklist_lock); ++ v->cpt_pgrp = pid_to_vpid(sig->__pgrp); ++ ++ v->cpt_old_pgrp = 0; ++/* if (!sig->tty_old_pgrp) { ++ eprintk_ctx("bad tty_old_pgrp\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ }*/ ++ if (sig->tty_old_pgrp) { ++ v->cpt_old_pgrp_type = CPT_PGRP_NORMAL; ++ read_lock(&tasklist_lock); ++ tsk = pid_task(sig->tty_old_pgrp, PIDTYPE_PID); ++ if (tsk == NULL) { ++ v->cpt_old_pgrp_type = CPT_PGRP_ORPHAN; ++ tsk = pid_task(sig->tty_old_pgrp, PIDTYPE_PGID); ++ } ++ read_unlock(&tasklist_lock); ++ if (tsk == NULL) { ++ eprintk_ctx("tty_old_pgrp does not exist anymore\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ v->cpt_old_pgrp = pid_vnr(sig->tty_old_pgrp); ++ if ((int)v->cpt_old_pgrp < 0) { ++ dprintk_ctx("stray tty_old_pgrp %d\n", pid_nr(sig->tty_old_pgrp)); ++ v->cpt_old_pgrp = -1; ++ v->cpt_old_pgrp_type = CPT_PGRP_STRAY; ++ } ++ } ++ ++ if (sig->__session <= 0) { ++ eprintk_ctx("bad session\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ v->cpt_session_type = CPT_PGRP_NORMAL; ++ read_lock(&tasklist_lock); ++ tsk = find_task_by_pid(sig->__session); ++ if (tsk == NULL) ++ v->cpt_session_type = CPT_PGRP_ORPHAN; ++ read_unlock(&tasklist_lock); ++ v->cpt_session = pid_to_vpid(sig->__session); ++ ++ v->cpt_leader = sig->leader; ++ v->cpt_ctty = CPT_NULL; ++ if (sig->tty) { ++ cpt_object_t *cobj = lookup_cpt_object(CPT_OBJ_TTY, sig->tty, ctx); ++ if (cobj) ++ v->cpt_ctty = cobj->o_pos; ++ else { ++ eprintk_ctx("controlling tty is not found\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ } ++ memcpy(&v->cpt_sigpending, &sig->shared_pending.signal, 8); ++ ++ v->cpt_curr_target = 0; ++ if (sig->curr_target) ++ v->cpt_curr_target = task_pid_vnr(sig->curr_target); ++ v->cpt_group_exit = ((sig->flags & SIGNAL_GROUP_EXIT) != 0); ++ v->cpt_group_exit_code = sig->group_exit_code; ++ v->cpt_group_exit_task = 0; ++ if (sig->group_exit_task) ++ v->cpt_group_exit_task = task_pid_vnr(sig->group_exit_task); ++ v->cpt_notify_count = sig->notify_count; ++ v->cpt_group_stop_count = sig->group_stop_count; ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8) ++ v->cpt_utime = sig->utime; ++ v->cpt_stime = sig->stime; ++ v->cpt_cutime = sig->cutime; ++ v->cpt_cstime = sig->cstime; ++ v->cpt_nvcsw = sig->nvcsw; ++ v->cpt_nivcsw = sig->nivcsw; ++ v->cpt_cnvcsw = sig->cnvcsw; ++ v->cpt_cnivcsw = sig->cnivcsw; ++ v->cpt_min_flt = sig->min_flt; ++ v->cpt_maj_flt = sig->maj_flt; ++ v->cpt_cmin_flt = sig->cmin_flt; ++ v->cpt_cmaj_flt = sig->cmaj_flt; ++ ++ if (RLIM_NLIMITS > CPT_RLIM_NLIMITS) ++ __asm__("undefined\n"); ++ ++ for (i=0; icpt_rlim_cur[i] = sig->rlim[i].rlim_cur; ++ v->cpt_rlim_max[i] = sig->rlim[i].rlim_max; ++ } else { ++ v->cpt_rlim_cur[i] = CPT_NULL; ++ v->cpt_rlim_max[i] = CPT_NULL; ++ } ++ } ++#endif ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ dump_sigqueue(&sig->shared_pending, ctx); ++ ++ cpt_close_object(ctx); ++ return 0; ++} ++ ++int cpt_check_unsupported(struct task_struct *tsk, cpt_context_t *ctx) ++{ ++ if (tsk->splice_pipe) { ++ eprintk_ctx("splice is used by " CPT_FID "\n", CPT_TID(tsk)); ++ return -EBUSY; ++ } ++#ifdef CONFIG_KEYS ++ if (tsk->request_key_auth || tsk->thread_keyring) { ++ eprintk_ctx("keys are used by " CPT_FID "\n", CPT_TID(tsk)); ++ return -EBUSY; ++ } ++#endif ++#ifdef CONFIG_NUMA ++ if (tsk->mempolicy) { ++ eprintk_ctx("NUMA mempolicy is used by " CPT_FID "\n", CPT_TID(tsk)); ++ return -EBUSY; ++ } ++#endif ++#ifdef CONFIG_TUX ++ if (tsk->tux_info) { ++ eprintk_ctx("TUX is used by " CPT_FID "\n", CPT_TID(tsk)); ++ return -EBUSY; ++ } ++#endif ++ return 0; ++} ++ ++static int dump_one_process(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct task_struct *tsk = obj->o_obj; ++ int last_thread; ++ struct cpt_task_image *v = cpt_get_buf(ctx); ++ cpt_object_t *tobj; ++ cpt_object_t *tg_obj; ++ loff_t saved_obj; ++ int i; ++ int err; ++ struct timespec delta; ++ struct mm_struct * tsk_mm; ++ struct files_struct * tsk_files; ++ struct fs_struct * tsk_fs; ++ struct mnt_namespace * tsk_ns; ++ ++ cpt_open_object(obj, ctx); ++ ++ v->cpt_signal = CPT_NULL; ++ tg_obj = lookup_cpt_object(CPT_OBJ_SIGNAL_STRUCT, tsk->signal, ctx); ++ if (!tg_obj) BUG(); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_TASK; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_state = tsk->state; ++ if (tsk->state == EXIT_ZOMBIE) { ++ eprintk_ctx("invalid zombie state on" CPT_FID "\n", CPT_TID(tsk)); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } else if (tsk->state == EXIT_DEAD) { ++ if (tsk->exit_state != EXIT_DEAD && ++ tsk->exit_state != EXIT_ZOMBIE) { ++ eprintk_ctx("invalid exit_state %d on" CPT_FID "\n", tsk->exit_state, CPT_TID(tsk)); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ } ++ if (tsk->exit_state) { ++ v->cpt_state = tsk->exit_state; ++ if (tsk->state != TASK_DEAD) { ++ eprintk_ctx("invalid tsk->state %ld/%d on" CPT_FID "\n", ++ tsk->state, tsk->exit_state, CPT_TID(tsk)); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ } ++ if (cpt_check_unsupported(tsk, ctx)) { ++ cpt_release_buf(ctx); ++ return -EBUSY; ++ } ++ ++ v->cpt_flags = tsk->flags&~(PF_FROZEN|PF_EXIT_RESTART); ++ v->cpt_ptrace = tsk->ptrace; ++ v->cpt_prio = tsk->prio; ++ v->cpt_exit_code = tsk->exit_code; ++ v->cpt_exit_signal = tsk->exit_signal; ++ v->cpt_pdeath_signal = tsk->pdeath_signal; ++ v->cpt_static_prio = tsk->static_prio; ++ v->cpt_rt_priority = tsk->rt_priority; ++ v->cpt_policy = tsk->policy; ++ if (v->cpt_policy != SCHED_NORMAL) { ++ eprintk_ctx("scheduler policy is not supported %d/%d(%s)\n", task_pid_vnr(tsk), tsk->pid, tsk->comm); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ ++ /* Unpleasant moment. When leader of thread group exits, ++ * it remains in zombie state until all the group exits. ++ * We save not-NULL pointers to process mm/files/fs, so ++ * that we can restore this thread group. ++ */ ++ tsk_mm = tsk->mm; ++ tsk_files = tsk->files; ++ tsk_fs = tsk->fs; ++ tsk_ns = tsk->nsproxy ? tsk->nsproxy->mnt_ns : NULL; ++ ++ if (tsk->exit_state && !thread_group_empty(tsk) && ++ thread_group_leader(tsk)) { ++ struct task_struct * p = tsk; ++ ++ read_lock(&tasklist_lock); ++ do { ++ if (p->mm) ++ tsk_mm = p->mm; ++ if (p->files) ++ tsk_files = p->files; ++ if (p->fs) ++ tsk_fs = p->fs; ++ if (p->nsproxy && p->nsproxy->mnt_ns) ++ tsk_ns = p->nsproxy->mnt_ns; ++ p = next_thread(p); ++ } while (p != tsk); ++ read_unlock(&tasklist_lock); ++ } ++ ++ v->cpt_mm = CPT_NULL; ++ if (tsk_mm) { ++ tobj = lookup_cpt_object(CPT_OBJ_MM, tsk_mm, ctx); ++ if (!tobj) BUG(); ++ v->cpt_mm = tobj->o_pos; ++ } ++ v->cpt_files = CPT_NULL; ++ if (tsk_files) { ++ tobj = lookup_cpt_object(CPT_OBJ_FILES, tsk_files, ctx); ++ if (!tobj) BUG(); ++ v->cpt_files = tobj->o_pos; ++ } ++ v->cpt_fs = CPT_NULL; ++ if (tsk_fs) { ++ tobj = lookup_cpt_object(CPT_OBJ_FS, tsk_fs, ctx); ++ if (!tobj) BUG(); ++ v->cpt_fs = tobj->o_pos; ++ } ++ v->cpt_namespace = CPT_NULL; ++ if (tsk_ns) { ++ tobj = lookup_cpt_object(CPT_OBJ_NAMESPACE, tsk_ns, ctx); ++ if (!tobj) BUG(); ++ v->cpt_namespace = tobj->o_pos; ++ ++ if (tsk_ns != current->nsproxy->mnt_ns) ++ eprintk_ctx("namespaces are not supported:" ++ "process " CPT_FID "\n", CPT_TID(tsk)); ++ } ++ v->cpt_sysvsem_undo = CPT_NULL; ++ if (tsk->sysvsem.undo_list && !tsk->exit_state) { ++ tobj = lookup_cpt_object(CPT_OBJ_SYSVSEM_UNDO, tsk->sysvsem.undo_list, ctx); ++ if (!tobj) BUG(); ++ v->cpt_sysvsem_undo = tobj->o_pos; ++ } ++ v->cpt_sighand = CPT_NULL; ++ if (tsk->sighand) { ++ tobj = lookup_cpt_object(CPT_OBJ_SIGHAND_STRUCT, tsk->sighand, ctx); ++ if (!tobj) BUG(); ++ v->cpt_sighand = tobj->o_pos; ++ } ++ v->cpt_sigblocked = cpt_sigset_export(&tsk->blocked); ++ v->cpt_sigrblocked = cpt_sigset_export(&tsk->real_blocked); ++ v->cpt_sigsuspend_blocked = cpt_sigset_export(&tsk->saved_sigmask); ++ ++ v->cpt_pid = task_pid_vnr(tsk); ++ v->cpt_tgid = task_tgid_vnr(tsk); ++ v->cpt_ppid = 0; ++ if (tsk->parent) { ++ if (tsk->parent != tsk->real_parent && ++ !lookup_cpt_object(CPT_OBJ_TASK, tsk->parent, ctx)) { ++ eprintk_ctx("task %d/%d(%s) is ptraced from ve0\n", tsk->pid, task_pid_vnr(tsk), tsk->comm); ++ cpt_release_buf(ctx); ++ return -EBUSY; ++ } ++ v->cpt_ppid = task_pid_vnr(tsk->parent); ++ } ++ v->cpt_rppid = tsk->real_parent ? task_pid_vnr(tsk->real_parent) : 0; ++ v->cpt_pgrp = task_pgrp_vnr(tsk); ++ v->cpt_session = task_session_vnr(tsk); ++ v->cpt_old_pgrp = 0; ++ if (tsk->signal->tty_old_pgrp) ++ v->cpt_old_pgrp = pid_vnr(tsk->signal->tty_old_pgrp); ++ v->cpt_leader = tsk->group_leader ? task_pid_vnr(tsk->group_leader) : 0; ++ v->cpt_set_tid = (unsigned long)tsk->set_child_tid; ++ v->cpt_clear_tid = (unsigned long)tsk->clear_child_tid; ++ memcpy(v->cpt_comm, tsk->comm, 16); ++ v->cpt_user = tsk->user->uid; ++ v->cpt_uid = tsk->uid; ++ v->cpt_euid = tsk->euid; ++ v->cpt_suid = tsk->suid; ++ v->cpt_fsuid = tsk->fsuid; ++ v->cpt_gid = tsk->gid; ++ v->cpt_egid = tsk->egid; ++ v->cpt_sgid = tsk->sgid; ++ v->cpt_fsgid = tsk->fsgid; ++ v->cpt_ngids = 0; ++ if (tsk->group_info && tsk->group_info->ngroups != 0) { ++ int i = tsk->group_info->ngroups; ++ if (i > 32) { ++ /* Shame... I did a simplified version and _forgot_ ++ * about this. Later, later. */ ++ eprintk_ctx("too many of groups " CPT_FID "\n", CPT_TID(tsk)); ++ return -EINVAL; ++ } ++ v->cpt_ngids = i; ++ for (i--; i>=0; i--) ++ v->cpt_gids[i] = tsk->group_info->small_block[i]; ++ } ++ v->cpt_prctl_uac = 0; ++ v->cpt_prctl_fpemu = 0; ++ v->__cpt_pad1 = 0; ++#ifdef CONFIG_IA64 ++ v->cpt_prctl_uac = (tsk->thread.flags & IA64_THREAD_UAC_MASK) >> IA64_THREAD_UAC_SHIFT; ++ v->cpt_prctl_fpemu = (tsk->thread.flags & IA64_THREAD_FPEMU_MASK) >> IA64_THREAD_FPEMU_SHIFT; ++#endif ++ memcpy(&v->cpt_ecap, &tsk->cap_effective, 8); ++ memcpy(&v->cpt_icap, &tsk->cap_inheritable, 8); ++ memcpy(&v->cpt_pcap, &tsk->cap_permitted, 8); ++ v->cpt_keepcap = tsk->keep_capabilities; ++ ++ v->cpt_did_exec = tsk->did_exec; ++ v->cpt_exec_domain = -1; ++ v->cpt_thrflags = task_thread_info(tsk)->flags & ~(1<cpt_64bit = 0; ++#ifdef CONFIG_X86_64 ++ /* Clear x86_64 specific flags */ ++ v->cpt_thrflags &= ~(_TIF_FORK|_TIF_IA32); ++ if (!(task_thread_info(tsk)->flags & _TIF_IA32)) { ++ ctx->tasks64++; ++ v->cpt_64bit = 1; ++ } ++#endif ++#ifdef CONFIG_IA64 ++ /* Clear ia64 specific flags */ ++ //// v->cpt_thrflags &= ~(_TIF_FORK||_TIF_IA32); ++ if (!IS_IA32_PROCESS(task_pt_regs(tsk))) { ++ ctx->tasks64++; ++ v->cpt_64bit = 1; ++ } ++#endif ++ v->cpt_thrstatus = task_thread_info(tsk)->status; ++ v->cpt_addr_limit = -1; ++ ++ v->cpt_personality = tsk->personality; ++ ++#ifdef CONFIG_X86 ++ for (i=0; i=3) { ++ eprintk_ctx("too many tls descs\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++#ifndef CONFIG_X86_64 ++ v->cpt_tls[i] = (((u64)tsk->thread.tls_array[i].b)<<32) + tsk->thread.tls_array[i].a; ++#else ++ v->cpt_tls[i] = tsk->thread.tls_array[i]; ++#endif ++ } ++#endif ++ ++ v->cpt_restart.fn = CPT_RBL_0; ++ if (task_thread_info(tsk)->restart_block.fn != task_thread_info(current)->restart_block.fn) { ++ struct restart_block *rb = &task_thread_info(tsk)->restart_block; ++ ktime_t e; ++ ++ if (rb->fn == hrtimer_nanosleep_restart) { ++ v->cpt_restart.fn = CPT_RBL_NANOSLEEP; ++ ++ e.tv64 = ((u64)rb->arg3 << 32) | (u64)rb->arg2; ++ e = ktime_sub(e, timespec_to_ktime(ctx->cpt_monotonic_time)); ++ v->cpt_restart.arg0 = rb->arg0; ++ v->cpt_restart.arg1 = rb->arg1; ++ v->cpt_restart.arg2 = ktime_to_ns(e); ++ v->cpt_restart.arg3 = 0; ++ dprintk_ctx(CPT_FID " %Lu\n", CPT_TID(tsk), (unsigned long long)v->cpt_restart.arg0); ++ goto continue_dump; ++ } ++#if defined(CONFIG_X86_64) && defined(CONFIG_COMPAT) ++ if (rb->fn == compat_nanosleep_restart) { ++ v->cpt_restart.fn = CPT_RBL_COMPAT_NANOSLEEP; ++ ++ e.tv64 = ((u64)rb->arg3 << 32) | (u64)rb->arg2; ++ e = ktime_sub(e, timespec_to_ktime(ctx->cpt_monotonic_time)); ++ v->cpt_restart.arg0 = rb->arg0; ++ v->cpt_restart.arg1 = rb->arg1; ++ v->cpt_restart.arg2 = ktime_to_ns(e); ++ v->cpt_restart.arg3 = 0; ++ dprintk_ctx(CPT_FID " %Lu\n", CPT_TID(tsk), (unsigned long long)v->cpt_restart.arg0); ++ goto continue_dump; ++ } ++#endif ++ if (rb->fn == do_restart_poll) { ++ u64 timeout_jiffies; ++ ++ timeout_jiffies = ((u64)rb->arg3 << 32)|(u64)rb->arg2; ++ e.tv64 = timeout_jiffies * TICK_NSEC; ++ ++ v->cpt_restart.fn = CPT_RBL_POLL; ++ v->cpt_restart.arg0 = rb->arg0; ++ v->cpt_restart.arg1 = rb->arg1; ++ v->cpt_restart.arg2 = ktime_to_ns(e); ++ v->cpt_restart.arg3 = 0; ++ dprintk_ctx(CPT_FID " %Lu\n", CPT_TID(tsk), (unsigned long long)v->cpt_restart.arg0); ++ goto continue_dump; ++ } ++ if (rb->fn == futex_wait_restart) { ++ v->cpt_restart.fn = CPT_RBL_FUTEX_WAIT; ++ ++ e.tv64 = rb->futex.time; ++ e = ktime_sub(e, timespec_to_ktime(ctx->cpt_monotonic_time)); ++ v->cpt_restart.arg0 = (unsigned long)rb->futex.uaddr; ++ v->cpt_restart.arg1 = rb->futex.val; ++ v->cpt_restart.arg2 = ktime_to_ns(e); ++ v->cpt_restart.arg3 = rb->futex.flags; ++ goto continue_dump; ++ } ++ eprintk_ctx("unknown restart block %p\n", rb->fn); ++ return -EINVAL; ++ } ++ ++continue_dump: ++ v->cpt_it_real_incr = 0; ++ v->cpt_it_prof_incr = 0; ++ v->cpt_it_virt_incr = 0; ++ v->cpt_it_real_value = 0; ++ v->cpt_it_prof_value = 0; ++ v->cpt_it_virt_value = 0; ++ if (thread_group_leader(tsk) && tsk->exit_state == 0) { ++ ktime_t rem; ++ ++ v->cpt_it_real_incr = ktime_to_ns(tsk->signal->it_real_incr); ++ v->cpt_it_prof_incr = tsk->signal->it_prof_incr; ++ v->cpt_it_virt_incr = tsk->signal->it_virt_incr; ++ ++ rem = hrtimer_get_remaining(&tsk->signal->real_timer); ++ ++ if (hrtimer_active(&tsk->signal->real_timer)) { ++ if (rem.tv64 <= 0) ++ rem.tv64 = NSEC_PER_USEC; ++ v->cpt_it_real_value = ktime_to_ns(rem); ++ dprintk("cpt itimer " CPT_FID " %Lu\n", CPT_TID(tsk), (unsigned long long)v->cpt_it_real_value); ++ } ++ v->cpt_it_prof_value = tsk->signal->it_prof_expires; ++ v->cpt_it_virt_value = tsk->signal->it_virt_expires; ++ } ++ v->cpt_used_math = (tsk_used_math(tsk) != 0); ++ ++ if (tsk->notifier) { ++ eprintk_ctx("task notifier is in use: process %d/%d(%s)\n", task_pid_vnr(tsk), tsk->pid, tsk->comm); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ ++ v->cpt_utime = tsk->utime; ++ v->cpt_stime = tsk->stime; ++ delta = tsk->start_time; ++ _set_normalized_timespec(&delta, ++ delta.tv_sec - get_exec_env()->start_timespec.tv_sec, ++ delta.tv_nsec - get_exec_env()->start_timespec.tv_nsec); ++ v->cpt_starttime = cpt_timespec_export(&delta); ++ v->cpt_nvcsw = tsk->nvcsw; ++ v->cpt_nivcsw = tsk->nivcsw; ++ v->cpt_min_flt = tsk->min_flt; ++ v->cpt_maj_flt = tsk->maj_flt; ++ ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,8) ++ v->cpt_cutime = tsk->cutime; ++ v->cpt_cstime = tsk->cstime; ++ v->cpt_cnvcsw = tsk->cnvcsw; ++ v->cpt_cnivcsw = tsk->cnivcsw; ++ v->cpt_cmin_flt = tsk->cmin_flt; ++ v->cpt_cmaj_flt = tsk->cmaj_flt; ++ ++ if (RLIM_NLIMITS > CPT_RLIM_NLIMITS) ++ __asm__("undefined\n"); ++ ++ for (i=0; icpt_rlim_cur[i] = tsk->rlim[i].rlim_cur; ++ v->cpt_rlim_max[i] = tsk->rlim[i].rlim_max; ++ } else { ++ v->cpt_rlim_cur[i] = CPT_NULL; ++ v->cpt_rlim_max[i] = CPT_NULL; ++ } ++ } ++#else ++ v->cpt_cutime = tsk->signal->cutime; ++ v->cpt_cstime = tsk->signal->cstime; ++ v->cpt_cnvcsw = tsk->signal->cnvcsw; ++ v->cpt_cnivcsw = tsk->signal->cnivcsw; ++ v->cpt_cmin_flt = tsk->signal->cmin_flt; ++ v->cpt_cmaj_flt = tsk->signal->cmaj_flt; ++ ++ if (RLIM_NLIMITS > CPT_RLIM_NLIMITS) ++ __asm__("undefined\n"); ++ ++ for (i=0; icpt_rlim_cur[i] = tsk->signal->rlim[i].rlim_cur; ++ v->cpt_rlim_max[i] = tsk->signal->rlim[i].rlim_max; ++ } else { ++ v->cpt_rlim_cur[i] = CPT_NULL; ++ v->cpt_rlim_max[i] = CPT_NULL; ++ } ++ } ++#endif ++ ++#ifdef CONFIG_BEANCOUNTERS ++ if (tsk->mm) ++ v->cpt_mm_ub = cpt_lookup_ubc(tsk->mm->mm_ub, ctx); ++ else ++ v->cpt_mm_ub = CPT_NULL; ++ v->cpt_task_ub = cpt_lookup_ubc(tsk->task_bc.task_ub, ctx); ++ v->cpt_exec_ub = cpt_lookup_ubc(tsk->task_bc.exec_ub, ctx); ++ v->cpt_fork_sub = cpt_lookup_ubc(tsk->task_bc.fork_sub, ctx); ++#endif ++ ++ v->cpt_ptrace_message = tsk->ptrace_message; ++ v->cpt_pn_state = tsk->pn_state; ++ v->cpt_stopped_state = tsk->stopped_state; ++ v->cpt_sigsuspend_state = 0; ++ ++#ifdef CONFIG_X86_32 ++ if (tsk->thread.vm86_info) { ++ eprintk_ctx("vm86 task is running\n"); ++ cpt_release_buf(ctx); ++ return -EBUSY; ++ } ++#endif ++ ++ v->cpt_sigpending = cpt_sigset_export(&tsk->pending.signal); ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ dump_kstack(tsk, ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ err = dump_registers(tsk, ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ if (err) ++ return err; ++ ++ if (tsk_used_math(tsk)) { ++ cpt_push_object(&saved_obj, ctx); ++ dump_fpustate(tsk, ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ ++ if (tsk->last_siginfo) { ++ struct cpt_siginfo_image si; ++ cpt_push_object(&saved_obj, ctx); ++ ++ si.cpt_next = sizeof(si); ++ si.cpt_object = CPT_OBJ_LASTSIGINFO; ++ si.cpt_hdrlen = sizeof(si); ++ si.cpt_content = CPT_CONTENT_VOID; ++ ++ if (encode_siginfo(&si, tsk->last_siginfo)) ++ return -EINVAL; ++ ++ ctx->write(&si, sizeof(si), ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ ++ if (tsk->sas_ss_size) { ++ struct cpt_sigaltstack_image si; ++ cpt_push_object(&saved_obj, ctx); ++ ++ si.cpt_next = sizeof(si); ++ si.cpt_object = CPT_OBJ_SIGALTSTACK; ++ si.cpt_hdrlen = sizeof(si); ++ si.cpt_content = CPT_CONTENT_VOID; ++ ++ si.cpt_stack = tsk->sas_ss_sp; ++ si.cpt_stacksize = tsk->sas_ss_size; ++ ++ ctx->write(&si, sizeof(si), ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ ++ if (tsk->robust_list ++#ifdef CONFIG_COMPAT ++ || tsk->compat_robust_list ++#endif ++ ) { ++ struct cpt_task_aux_image ai; ++ cpt_push_object(&saved_obj, ctx); ++ ++ ai.cpt_next = sizeof(ai); ++ ai.cpt_object = CPT_OBJ_TASK_AUX; ++ ai.cpt_hdrlen = sizeof(ai); ++ ai.cpt_content = CPT_CONTENT_VOID; ++ ++ ai.cpt_robust_list = (unsigned long)tsk->robust_list; ++#ifdef CONFIG_X86_64 ++#ifdef CONFIG_COMPAT ++ if (task_thread_info(tsk)->flags & _TIF_IA32) ++ ai.cpt_robust_list = (unsigned long)tsk->compat_robust_list; ++#endif ++#endif ++ ctx->write(&ai, sizeof(ai), ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ ++ dump_sigqueue(&tsk->pending, ctx); ++ ++ last_thread = 1; ++ read_lock(&tasklist_lock); ++ do { ++ struct task_struct * next = next_thread(tsk); ++ if (next != tsk && !thread_group_leader(next)) ++ last_thread = 0; ++ } while (0); ++ read_unlock(&tasklist_lock); ++ ++ if (last_thread) { ++ struct task_struct *prev_tsk; ++ int err; ++ loff_t pos = ctx->file->f_pos; ++ ++ cpt_push_object(&saved_obj, ctx); ++ err = dump_one_signal_struct(tg_obj, ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ if (err) ++ return err; ++ ++ prev_tsk = tsk; ++ for (;;) { ++ if (prev_tsk->tgid == tsk->tgid) { ++ loff_t tg_pos; ++ ++ tg_pos = obj->o_pos + offsetof(struct cpt_task_image, cpt_signal); ++ ctx->pwrite(&pos, sizeof(pos), ctx, tg_pos); ++ if (thread_group_leader(prev_tsk)) ++ break; ++ } ++ ++ if (obj->o_list.prev == &ctx->object_array[CPT_OBJ_TASK]) { ++ eprintk_ctx("bug: thread group leader is lost\n"); ++ return -EINVAL; ++ } ++ ++ obj = list_entry(obj->o_list.prev, cpt_object_t, o_list); ++ prev_tsk = obj->o_obj; ++ } ++ } ++ ++ cpt_close_object(ctx); ++ return 0; ++} ++ ++int cpt_dump_tasks(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ cpt_open_section(ctx, CPT_SECT_TASKS); ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ int err; ++ ++ if ((err = dump_one_process(obj, ctx)) != 0) ++ return err; ++ } ++ ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++int cpt_collect_signals(cpt_context_t *ctx) ++{ ++ cpt_object_t *obj; ++ ++ /* Collect process fd sets */ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ if (tsk->signal && !list_empty(&tsk->signal->posix_timers)) { ++ eprintk_ctx("task %d/%d(%s) uses posix timers\n", tsk->pid, task_pid_vnr(tsk), tsk->comm); ++ return -EBUSY; ++ } ++ if (tsk->signal && cpt_object_add(CPT_OBJ_SIGNAL_STRUCT, tsk->signal, ctx) == NULL) ++ return -ENOMEM; ++ if (tsk->sighand && cpt_object_add(CPT_OBJ_SIGHAND_STRUCT, tsk->sighand, ctx) == NULL) ++ return -ENOMEM; ++ } ++ return 0; ++} ++ ++ ++static int dump_one_sighand_struct(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct sighand_struct *sig = obj->o_obj; ++ struct cpt_sighand_image *v = cpt_get_buf(ctx); ++ int i; ++ ++ cpt_open_object(obj, ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_SIGHAND_STRUCT; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ for (i=0; i< _NSIG; i++) { ++ if (sig->action[i].sa.sa_handler != SIG_DFL || ++ sig->action[i].sa.sa_flags) { ++ loff_t saved_obj; ++ struct cpt_sighandler_image *o = cpt_get_buf(ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ cpt_open_object(NULL, ctx); ++ ++ o->cpt_next = CPT_NULL; ++ o->cpt_object = CPT_OBJ_SIGHANDLER; ++ o->cpt_hdrlen = sizeof(*o); ++ o->cpt_content = CPT_CONTENT_VOID; ++ ++ o->cpt_signo = i; ++ o->cpt_handler = (unsigned long)sig->action[i].sa.sa_handler; ++ o->cpt_restorer = 0; ++#ifdef CONFIG_X86 ++ o->cpt_restorer = (unsigned long)sig->action[i].sa.sa_restorer; ++#endif ++ o->cpt_flags = sig->action[i].sa.sa_flags; ++ memcpy(&o->cpt_mask, &sig->action[i].sa.sa_mask, 8); ++ ctx->write(o, sizeof(*o), ctx); ++ cpt_release_buf(ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ } ++ ++ cpt_close_object(ctx); ++ return 0; ++} ++ ++int cpt_dump_sighand(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ cpt_open_section(ctx, CPT_SECT_SIGHAND_STRUCT); ++ ++ for_each_object(obj, CPT_OBJ_SIGHAND_STRUCT) { ++ int err; ++ ++ if ((err = dump_one_sighand_struct(obj, ctx)) != 0) ++ return err; ++ } ++ ++ cpt_close_section(ctx); ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_process.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_process.h +--- ./kernel/cpt/cpt_process.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_process.h 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,13 @@ ++int cpt_collect_signals(cpt_context_t *); ++int cpt_dump_signal(struct cpt_context *); ++int cpt_dump_sighand(struct cpt_context *); ++int cpt_dump_tasks(struct cpt_context *); ++ ++int rst_signal_complete(struct cpt_task_image *ti, int *exiting, struct cpt_context *ctx); ++__u32 rst_signal_flag(struct cpt_task_image *ti, struct cpt_context *ctx); ++ ++int rst_restore_process(struct cpt_context *ctx); ++int rst_process_linkage(struct cpt_context *ctx); ++ ++int check_task_state(struct task_struct *tsk, struct cpt_context *ctx); ++struct pid *alloc_vpid_safe(pid_t vnr); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_socket.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_socket.c +--- ./kernel/cpt/cpt_socket.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_socket.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,787 @@ ++/* ++ * ++ * kernel/cpt/cpt_socket.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_socket.h" ++#include "cpt_files.h" ++#include "cpt_kernel.h" ++ ++static int dump_rqueue(int owner, struct sock *sk, struct cpt_context *ctx); ++ ++ ++/* Sockets are quite different of another kinds of files. ++ * There is one simplification: only one struct file can refer to a socket, ++ * so we could store information about socket directly in section FILES as ++ * a description of a file and append f.e. array of not-yet-accepted ++ * connections of listening socket as array of auxiliary data. ++ * ++ * Complications are: ++ * 1. TCP sockets can be orphans. We have to relocate orphans as well, ++ * so we have to create special section for orphans. ++ * 2. AF_UNIX sockets are distinguished objects: set of links between ++ * AF_UNIX sockets is quite arbitrary. ++ * A. Each socket can refers to many of files due to FD passing. ++ * B. Each socket except for connected ones can have in queue skbs ++ * sent by any of sockets. ++ * ++ * 2A is relatively easy: after our tasks are frozen we make an additional ++ * recursive pass throgh set of collected files and get referenced to ++ * FD passed files. After end of recursion, all the files are treated ++ * in the same way. All they will be stored in section FILES. ++ * ++ * 2B. We have to resolve all those references at some point. ++ * It is the place where pipe-like approach to image fails. ++ * ++ * All this makes socket checkpointing quite chumbersome. ++ * Right now we collect all the sockets and assign some numeric index value ++ * to each of them. The socket section is separate and put after section FILES, ++ * so section FILES refers to sockets by index, section SOCKET refers to FILES ++ * as usual by position in image. All the refs inside socket section are ++ * by index. When restoring we read socket section, create objects to hold ++ * mappings index <-> pos. At the second pass we open sockets (simultaneosly ++ * with their pairs) and create FILE objects. ++ */ ++ ++ ++/* ====== FD passing ====== */ ++ ++/* Almost nobody does FD passing via AF_UNIX sockets, nevertheless we ++ * have to implement this. A problem is that in general case we receive ++ * skbs from an unknown context, so new files can arrive to checkpointed ++ * set of processes even after they are stopped. Well, we are going just ++ * to ignore unknown fds while doing real checkpointing. It is fair because ++ * links outside checkpointed set are going to fail anyway. ++ * ++ * ATTN: the procedure is recursive. We linearize the recursion adding ++ * newly found files to the end of file list, so they will be analyzed ++ * in the same loop. ++ */ ++ ++static int collect_one_passedfd(struct file *file, cpt_context_t * ctx) ++{ ++ struct inode *inode = file->f_dentry->d_inode; ++ struct socket *sock; ++ struct sock *sk; ++ struct sk_buff *skb; ++ ++ if (!S_ISSOCK(inode->i_mode)) ++ return -ENOTSOCK; ++ ++ sock = &container_of(inode, struct socket_alloc, vfs_inode)->socket; ++ ++ if (sock->ops->family != AF_UNIX) ++ return 0; ++ ++ sk = sock->sk; ++ ++ /* Subtle locking issue. skbs cannot be removed while ++ * we are scanning, because all the processes are stopped. ++ * They still can be added to tail of queue. Locking while ++ * we dereference skb->next is enough to resolve this. ++ * See above about collision with skbs added after we started ++ * checkpointing. ++ */ ++ ++ skb = skb_peek(&sk->sk_receive_queue); ++ while (skb && skb != (struct sk_buff*)&sk->sk_receive_queue) { ++ if (UNIXCB(skb).fp && skb->sk && ++ (!sock_flag(skb->sk, SOCK_DEAD) || unix_peer(sk) == skb->sk)) { ++ struct scm_fp_list *fpl = UNIXCB(skb).fp; ++ int i; ++ ++ for (i = fpl->count-1; i >= 0; i--) { ++ if (cpt_object_add(CPT_OBJ_FILE, fpl->fp[i], ctx) == NULL) ++ return -ENOMEM; ++ } ++ } ++ ++ spin_lock_irq(&sk->sk_receive_queue.lock); ++ skb = skb->next; ++ spin_unlock_irq(&sk->sk_receive_queue.lock); ++ } ++ ++ return 0; ++} ++ ++int cpt_collect_passedfds(cpt_context_t * ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file = obj->o_obj; ++ ++ if (S_ISSOCK(file->f_dentry->d_inode->i_mode)) { ++ int err; ++ ++ if ((err = collect_one_passedfd(file, ctx)) < 0) ++ return err; ++ } ++ } ++ ++ return 0; ++} ++ ++/* ====== End of FD passing ====== */ ++ ++/* Must be called under bh_lock_sock() */ ++ ++void clear_backlog(struct sock *sk) ++{ ++ struct sk_buff *skb = sk->sk_backlog.head; ++ ++ sk->sk_backlog.head = sk->sk_backlog.tail = NULL; ++ while (skb) { ++ struct sk_buff *next = skb->next; ++ ++ skb->next = NULL; ++ kfree_skb(skb); ++ skb = next; ++ } ++} ++ ++void release_sock_nobacklog(struct sock *sk) ++{ ++ spin_lock_bh(&(sk->sk_lock.slock)); ++ clear_backlog(sk); ++ sk->sk_lock.owned = 0; ++ if (waitqueue_active(&(sk->sk_lock.wq))) ++ wake_up(&(sk->sk_lock.wq)); ++ spin_unlock_bh(&(sk->sk_lock.slock)); ++} ++ ++int cpt_dump_skb(int type, int owner, struct sk_buff *skb, ++ struct cpt_context *ctx) ++{ ++ struct cpt_skb_image *v = cpt_get_buf(ctx); ++ loff_t saved_obj; ++ struct timeval tmptv; ++ ++ cpt_push_object(&saved_obj, ctx); ++ cpt_open_object(NULL, ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_SKB; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_owner = owner; ++ v->cpt_queue = type; ++ skb_get_timestamp(skb, &tmptv); ++ v->cpt_stamp = cpt_timeval_export(&tmptv); ++ v->cpt_hspace = skb->data - skb->head; ++ v->cpt_tspace = skb->end - skb->tail; ++ v->cpt_h = skb_transport_header(skb) - skb->head; ++ v->cpt_nh = skb_network_header(skb) - skb->head; ++ v->cpt_mac = skb_mac_header(skb) - skb->head; ++ BUILD_BUG_ON(sizeof(skb->cb) < sizeof(v->cpt_cb)); ++ memcpy(v->cpt_cb, skb->cb, sizeof(v->cpt_cb)); ++ if (sizeof(skb->cb) > sizeof(v->cpt_cb)) { ++ int i; ++ for (i=sizeof(v->cpt_cb); icb); i++) { ++ if (skb->cb[i]) { ++ wprintk_ctx("dirty skb cb"); ++ break; ++ } ++ } ++ } ++ v->cpt_len = skb->len; ++ v->cpt_mac_len = skb->mac_len; ++ v->cpt_csum = skb->csum; ++ v->cpt_local_df = skb->local_df; ++ v->cpt_pkt_type = skb->pkt_type; ++ v->cpt_ip_summed = skb->ip_summed; ++ v->cpt_priority = skb->priority; ++ v->cpt_protocol = skb->protocol; ++ v->cpt_security = 0; ++ v->cpt_gso_segs = skb_shinfo(skb)->gso_segs; ++ v->cpt_gso_size = skb_shinfo(skb)->gso_size; ++ if (skb_shinfo(skb)->gso_type) { ++ eprintk_ctx("skb ufo is not supported\n"); ++ return -EINVAL; ++ } ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ if (skb->len + (skb->data - skb->head) > 0) { ++ struct cpt_obj_bits ob; ++ loff_t saved_obj2; ++ ++ cpt_push_object(&saved_obj2, ctx); ++ cpt_open_object(NULL, ctx); ++ ob.cpt_next = CPT_NULL; ++ ob.cpt_object = CPT_OBJ_BITS; ++ ob.cpt_hdrlen = sizeof(ob); ++ ob.cpt_content = CPT_CONTENT_DATA; ++ ob.cpt_size = skb->len + v->cpt_hspace; ++ ++ ctx->write(&ob, sizeof(ob), ctx); ++ ++ ctx->write(skb->head, (skb->data-skb->head) + (skb->len-skb->data_len), ctx); ++ if (skb->data_len) { ++ int offset = skb->len - skb->data_len; ++ while (offset < skb->len) { ++ int copy = skb->len - offset; ++ if (copy > PAGE_SIZE) ++ copy = PAGE_SIZE; ++ (void)cpt_get_buf(ctx); ++ if (skb_copy_bits(skb, offset, ctx->tmpbuf, copy)) ++ BUG(); ++ ctx->write(ctx->tmpbuf, copy, ctx); ++ __cpt_release_buf(ctx); ++ offset += copy; ++ } ++ } ++ ++ ctx->align(ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_obj2, ctx); ++ } ++ ++ if (skb->sk && skb->sk->sk_family == AF_UNIX) { ++ struct scm_fp_list *fpl = UNIXCB(skb).fp; ++ ++ if (fpl) { ++ int i; ++ ++ for (i = 0; i < fpl->count; i++) { ++ struct cpt_fd_image v; ++ cpt_object_t *obj; ++ loff_t saved_obj2; ++ ++ obj = lookup_cpt_object(CPT_OBJ_FILE, fpl->fp[i], ctx); ++ ++ if (!obj) { ++ eprintk_ctx("lost passed FD\n"); ++ return -EINVAL; ++ } ++ ++ cpt_push_object(&saved_obj2, ctx); ++ cpt_open_object(NULL, ctx); ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_FILEDESC; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_VOID; ++ ++ v.cpt_fd = i; ++ v.cpt_file = obj->o_pos; ++ v.cpt_flags = 0; ++ ctx->write(&v, sizeof(v), ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_obj2, ctx); ++ } ++ } ++ } ++ ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ return 0; ++} ++ ++static int dump_rqueue(int idx, struct sock *sk, struct cpt_context *ctx) ++{ ++ struct sk_buff *skb; ++ struct sock *sk_cache = NULL; ++ ++ skb = skb_peek(&sk->sk_receive_queue); ++ while (skb && skb != (struct sk_buff*)&sk->sk_receive_queue) { ++ int err; ++ ++ if (sk->sk_family == AF_UNIX) { ++ cpt_object_t *obj; ++ if (skb->sk != sk_cache) { ++ idx = -1; ++ sk_cache = NULL; ++ obj = lookup_cpt_object(CPT_OBJ_SOCKET, skb->sk, ctx); ++ if (obj) { ++ idx = obj->o_index; ++ sk_cache = skb->sk; ++ } else if (unix_peer(sk) != skb->sk) ++ goto next_skb; ++ } ++ } ++ ++ err = cpt_dump_skb(CPT_SKB_RQ, idx, skb, ctx); ++ if (err) ++ return err; ++ ++next_skb: ++ spin_lock_irq(&sk->sk_receive_queue.lock); ++ skb = skb->next; ++ spin_unlock_irq(&sk->sk_receive_queue.lock); ++ } ++ return 0; ++} ++ ++static int dump_wqueue(int idx, struct sock *sk, struct cpt_context *ctx) ++{ ++ struct sk_buff *skb; ++ ++ skb = skb_peek(&sk->sk_write_queue); ++ while (skb && skb != (struct sk_buff*)&sk->sk_write_queue) { ++ int err = cpt_dump_skb(CPT_SKB_WQ, idx, skb, ctx); ++ if (err) ++ return err; ++ ++ spin_lock_irq(&sk->sk_write_queue.lock); ++ skb = skb->next; ++ spin_unlock_irq(&sk->sk_write_queue.lock); ++ } ++ return 0; ++} ++ ++void cpt_dump_sock_attr(struct sock *sk, cpt_context_t *ctx) ++{ ++ loff_t saved_obj; ++ if (sk->sk_filter) { ++ struct cpt_obj_bits v; ++ ++ cpt_push_object(&saved_obj, ctx); ++ cpt_open_object(NULL, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_SKFILTER; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_DATA; ++ v.cpt_size = sk->sk_filter->len*sizeof(struct sock_filter); ++ ++ ctx->write(&v, sizeof(v), ctx); ++ ctx->write(sk->sk_filter->insns, v.cpt_size, ctx); ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ if (sk->sk_family == AF_INET || sk->sk_family == AF_INET6) { ++ cpt_push_object(&saved_obj, ctx); ++ cpt_dump_mcfilter(sk, ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++} ++ ++/* Dump socket content */ ++ ++int cpt_dump_socket(cpt_object_t *obj, struct sock *sk, int index, int parent, struct cpt_context *ctx) ++{ ++ struct cpt_sock_image *v = cpt_get_buf(ctx); ++ struct socket *sock; ++ struct timeval tmptv; ++ ++ cpt_open_object(obj, ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_SOCKET; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_file = CPT_NULL; ++ sock = sk->sk_socket; ++ if (sock && sock->file) { ++ cpt_object_t *tobj; ++ tobj = lookup_cpt_object(CPT_OBJ_FILE, sock->file, ctx); ++ if (tobj) ++ v->cpt_file = tobj->o_pos; ++ } ++ v->cpt_index = index; ++ v->cpt_parent = parent; ++ ++ if (sk->sk_family == AF_INET || sk->sk_family == AF_INET6) { ++ if (sock && !obj->o_lock) { ++ lockdep_off(); ++ lock_sock(sk); ++ lockdep_on(); ++ obj->o_lock = 1; ++ } ++ } ++ ++ /* Some bits stored in inode */ ++ v->cpt_ssflags = sock ? sock->flags : 0; ++ v->cpt_sstate = sock ? sock->state : 0; ++ v->cpt_passcred = sock ? test_bit(SOCK_PASSCRED, &sock->flags) : 0; ++ ++ /* Common data */ ++ v->cpt_family = sk->sk_family; ++ v->cpt_type = sk->sk_type; ++ v->cpt_state = sk->sk_state; ++ v->cpt_reuse = sk->sk_reuse; ++ v->cpt_zapped = sock_flag(sk, SOCK_ZAPPED); ++ v->cpt_shutdown = sk->sk_shutdown; ++ v->cpt_userlocks = sk->sk_userlocks; ++ v->cpt_no_check = sk->sk_no_check; ++ v->cpt_zapped = sock_flag(sk, SOCK_DBG); ++ v->cpt_rcvtstamp = sock_flag(sk, SOCK_RCVTSTAMP); ++ v->cpt_localroute = sock_flag(sk, SOCK_LOCALROUTE); ++ v->cpt_protocol = sk->sk_protocol; ++ v->cpt_err = sk->sk_err; ++ v->cpt_err_soft = sk->sk_err_soft; ++ v->cpt_max_ack_backlog = sk->sk_max_ack_backlog; ++ v->cpt_priority = sk->sk_priority; ++ v->cpt_rcvlowat = sk->sk_rcvlowat; ++ v->cpt_rcvtimeo = CPT_NULL; ++ if (sk->sk_rcvtimeo != MAX_SCHEDULE_TIMEOUT) ++ v->cpt_rcvtimeo = sk->sk_rcvtimeo > INT_MAX ? INT_MAX : sk->sk_rcvtimeo; ++ v->cpt_sndtimeo = CPT_NULL; ++ if (sk->sk_sndtimeo != MAX_SCHEDULE_TIMEOUT) ++ v->cpt_sndtimeo = sk->sk_sndtimeo > INT_MAX ? INT_MAX : sk->sk_sndtimeo; ++ v->cpt_rcvbuf = sk->sk_rcvbuf; ++ v->cpt_sndbuf = sk->sk_sndbuf; ++ v->cpt_bound_dev_if = sk->sk_bound_dev_if; ++ v->cpt_flags = sk->sk_flags; ++ v->cpt_lingertime = CPT_NULL; ++ if (sk->sk_lingertime != MAX_SCHEDULE_TIMEOUT) ++ v->cpt_lingertime = sk->sk_lingertime > INT_MAX ? INT_MAX : sk->sk_lingertime; ++ v->cpt_peer_pid = sk->sk_peercred.pid; ++ v->cpt_peer_uid = sk->sk_peercred.uid; ++ v->cpt_peer_gid = sk->sk_peercred.gid; ++ tmptv = ktime_to_timeval(sk->sk_stamp); ++ v->cpt_stamp = cpt_timeval_export(&tmptv); ++ ++ v->cpt_peer = -1; ++ v->cpt_socketpair = 0; ++ v->cpt_deleted = 0; ++ ++ v->cpt_laddrlen = 0; ++ if (sock) { ++ int alen = sizeof(v->cpt_laddr); ++ int err = sock->ops->getname(sock, (struct sockaddr*)&v->cpt_laddr, &alen, 0); ++ if (err) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++ v->cpt_laddrlen = alen; ++ } ++ v->cpt_raddrlen = 0; ++ if (sock) { ++ int alen = sizeof(v->cpt_raddr); ++ int err = sock->ops->getname(sock, (struct sockaddr*)&v->cpt_raddr, &alen, 2); ++ if (!err) ++ v->cpt_raddrlen = alen; ++ } ++ ++ if (sk->sk_family == AF_UNIX) { ++ if (unix_sk(sk)->dentry) { ++ struct dentry *d = unix_sk(sk)->dentry; ++ v->cpt_deleted = !IS_ROOT(d) && d_unhashed(d); ++ if (!v->cpt_deleted) { ++ int err = 0; ++ char *path; ++ unsigned long pg = __get_free_page(GFP_KERNEL); ++ ++ if (!pg) { ++ cpt_release_buf(ctx); ++ return -ENOMEM; ++ } ++ ++ path = d_path(d, unix_sk(sk)->mnt, (char *)pg, PAGE_SIZE); ++ ++ if (!IS_ERR(path)) { ++ int len = strlen(path); ++ if (len < 126) { ++ strcpy(((char*)v->cpt_laddr)+2, path); ++ v->cpt_laddrlen = len + 2; ++ } else { ++ wprintk_ctx("af_unix path is too long: %s (%s)\n", path, ((char*)v->cpt_laddr)+2); ++ } ++ err = cpt_verify_overmount(path, d, unix_sk(sk)->mnt, 1, ctx); ++ } else { ++ eprintk_ctx("cannot get path of an af_unix socket\n"); ++ err = PTR_ERR(path); ++ } ++ free_page(pg); ++ if (err) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++ } ++ } ++ ++ /* If the socket is connected, find its peer. If peer is not ++ * in our table, the socket is connected to external process ++ * and we consider it disconnected. ++ */ ++ if (unix_peer(sk)) { ++ cpt_object_t *pobj; ++ pobj = lookup_cpt_object(CPT_OBJ_SOCKET, unix_peer(sk), ctx); ++ if (pobj) ++ v->cpt_peer = pobj->o_index; ++ else ++ v->cpt_shutdown = SHUTDOWN_MASK; ++ ++ if (unix_peer(unix_peer(sk)) == sk) ++ v->cpt_socketpair = 1; ++ } ++ ++ /* If the socket shares address with another socket it is ++ * child of some listening socket. Find and record it. */ ++ if (unix_sk(sk)->addr && ++ atomic_read(&unix_sk(sk)->addr->refcnt) > 1 && ++ sk->sk_state != TCP_LISTEN) { ++ cpt_object_t *pobj; ++ for_each_object(pobj, CPT_OBJ_SOCKET) { ++ struct sock *psk = pobj->o_obj; ++ if (psk->sk_family == AF_UNIX && ++ psk->sk_state == TCP_LISTEN && ++ unix_sk(psk)->addr == unix_sk(sk)->addr) { ++ v->cpt_parent = pobj->o_index; ++ break; ++ } ++ } ++ } ++ } ++ ++ if (sk->sk_family == AF_INET || sk->sk_family == AF_INET6) ++ cpt_dump_socket_in(v, sk, ctx); ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ cpt_dump_sock_attr(sk, ctx); ++ ++ dump_rqueue(index, sk, ctx); ++ if (sk->sk_family == AF_INET || sk->sk_family == AF_INET6) { ++ dump_wqueue(index, sk, ctx); ++ cpt_dump_ofo_queue(index, sk, ctx); ++ } ++ ++ if ((sk->sk_family == AF_INET || sk->sk_family == AF_INET6) ++ && sk->sk_state == TCP_LISTEN) ++ cpt_dump_synwait_queue(sk, index, ctx); ++ ++ cpt_close_object(ctx); ++ ++ if ((sk->sk_family == AF_INET || sk->sk_family == AF_INET6) ++ && sk->sk_state == TCP_LISTEN) ++ cpt_dump_accept_queue(sk, index, ctx); ++ ++ return 0; ++} ++ ++int cpt_dump_orphaned_sockets(struct cpt_context *ctx) ++{ ++ int i; ++ ++ cpt_open_section(ctx, CPT_SECT_ORPHANS); ++ ++ for (i = 0; i < tcp_hashinfo.ehash_size; i++) { ++ struct sock *sk; ++ struct hlist_node *node; ++ rwlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, i); ++retry: ++ read_lock_bh(lock); ++ sk_for_each(sk, node, &tcp_hashinfo.ehash[i].chain) { ++ ++ if (sk->owner_env != get_exec_env()) ++ continue; ++ if (sk->sk_socket) ++ continue; ++ if (!sock_flag(sk, SOCK_DEAD)) ++ continue; ++ if (lookup_cpt_object(CPT_OBJ_SOCKET, sk, ctx)) ++ continue; ++ sock_hold(sk); ++ read_unlock_bh(lock); ++ ++ local_bh_disable(); ++ bh_lock_sock(sk); ++ if (sock_owned_by_user(sk)) ++ eprintk_ctx("BUG: sk locked by whom?\n"); ++ sk->sk_lock.owned = 1; ++ bh_unlock_sock(sk); ++ local_bh_enable(); ++ ++ cpt_dump_socket(NULL, sk, -1, -1, ctx); ++ ++ local_bh_disable(); ++ bh_lock_sock(sk); ++ sk->sk_lock.owned = 0; ++ clear_backlog(sk); ++ tcp_done(sk); ++ bh_unlock_sock(sk); ++ local_bh_enable(); ++ sock_put(sk); ++ ++ goto retry; ++ } ++ read_unlock_bh(lock); ++ } ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++static int can_dump(struct sock *sk, cpt_context_t *ctx) ++{ ++ switch (sk->sk_family) { ++ case AF_NETLINK: ++ if (((struct netlink_sock *)sk)->cb) { ++ eprintk_ctx("netlink socket has active callback\n"); ++ return 0; ++ } ++ break; ++ } ++ return 1; ++} ++ ++/* We are not going to block suspend when we have external AF_UNIX connections. ++ * But we cannot stop feed of new packets/connections to our environment ++ * from outside. Taking into account that it is intrincically unreliable, ++ * we collect some amount of data, but when checkpointing/restoring we ++ * are going to drop everything, which does not make sense: skbs sent ++ * by outside processes, connections from outside etc. etc. ++ */ ++ ++/* The first pass. When we see socket referenced by a file, we just ++ * add it to socket table */ ++int cpt_collect_socket(struct file *file, cpt_context_t * ctx) ++{ ++ cpt_object_t *obj; ++ struct socket *sock; ++ struct sock *sk; ++ ++ if (!S_ISSOCK(file->f_dentry->d_inode->i_mode)) ++ return -ENOTSOCK; ++ sock = &container_of(file->f_dentry->d_inode, struct socket_alloc, vfs_inode)->socket; ++ sk = sock->sk; ++ if (!can_dump(sk, ctx)) ++ return -EAGAIN; ++ if ((obj = cpt_object_add(CPT_OBJ_SOCKET, sk, ctx)) == NULL) ++ return -ENOMEM; ++ obj->o_parent = file; ++ ++ return 0; ++} ++ ++/* ++ * We should end with table containing: ++ * * all sockets opened by our processes in the table. ++ * * all the sockets queued in listening queues on _our_ listening sockets, ++ * which are connected to our opened sockets. ++ */ ++ ++static int collect_one_unix_listening_sock(cpt_object_t *obj, cpt_context_t * ctx) ++{ ++ struct sock *sk = obj->o_obj; ++ cpt_object_t *cobj; ++ struct sk_buff *skb; ++ ++ skb = skb_peek(&sk->sk_receive_queue); ++ while (skb && skb != (struct sk_buff*)&sk->sk_receive_queue) { ++ struct sock *lsk = skb->sk; ++ if (unix_peer(lsk) && ++ lookup_cpt_object(CPT_OBJ_SOCKET, unix_peer(lsk), ctx)) { ++ if ((cobj = cpt_object_add(CPT_OBJ_SOCKET, lsk, ctx)) == NULL) ++ return -ENOMEM; ++ cobj->o_parent = obj->o_parent; ++ } ++ spin_lock_irq(&sk->sk_receive_queue.lock); ++ skb = skb->next; ++ spin_unlock_irq(&sk->sk_receive_queue.lock); ++ } ++ ++ return 0; ++} ++ ++int cpt_index_sockets(cpt_context_t * ctx) ++{ ++ cpt_object_t *obj; ++ unsigned long index = 0; ++ ++ /* Collect not-yet-accepted children of listening sockets. */ ++ for_each_object(obj, CPT_OBJ_SOCKET) { ++ struct sock *sk = obj->o_obj; ++ ++ if (sk->sk_state != TCP_LISTEN) ++ continue; ++ ++ if (sk->sk_family == AF_UNIX) ++ collect_one_unix_listening_sock(obj, ctx); ++ } ++ ++ /* Assign indices to all the sockets. */ ++ for_each_object(obj, CPT_OBJ_SOCKET) { ++ struct sock *sk = obj->o_obj; ++ cpt_obj_setindex(obj, index++, ctx); ++ ++ if (sk->sk_socket && sk->sk_socket->file) { ++ cpt_object_t *tobj; ++ tobj = lookup_cpt_object(CPT_OBJ_FILE, sk->sk_socket->file, ctx); ++ if (tobj) ++ cpt_obj_setindex(tobj, obj->o_index, ctx); ++ } ++ } ++ ++ return 0; ++} ++ ++void cpt_unlock_sockets(cpt_context_t * ctx) ++{ ++ cpt_object_t *obj; ++ ++ lockdep_off(); ++ for_each_object(obj, CPT_OBJ_SOCKET) { ++ struct sock *sk = obj->o_obj; ++ if (sk && obj->o_lock) { ++ if (sk->sk_socket) ++ release_sock(sk); ++ } ++ } ++ lockdep_on(); ++} ++ ++void cpt_kill_sockets(cpt_context_t * ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_SOCKET) { ++ struct sock *sk = obj->o_obj; ++ if (sk && obj->o_lock) { ++ struct ve_struct *old_env; ++ old_env = set_exec_env(sk->owner_env); ++ cpt_kill_socket(sk, ctx); ++ if (sk->sk_socket) ++ release_sock_nobacklog(sk); ++ set_exec_env(old_env); ++ } ++ } ++} ++ ++__u32 cpt_socket_fasync(struct file *file, struct cpt_context *ctx) ++{ ++ struct fasync_struct *fa; ++ struct inode *inode = file->f_dentry->d_inode; ++ struct socket *sock; ++ ++ sock = &container_of(inode, struct socket_alloc, vfs_inode)->socket; ++ ++ for (fa = sock->fasync_list; fa; fa = fa->fa_next) { ++ if (fa->fa_file == file) ++ return fa->fa_fd; ++ } ++ return -1; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_socket.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_socket.h +--- ./kernel/cpt/cpt_socket.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_socket.h 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,33 @@ ++struct sock; ++ ++int cpt_collect_passedfds(cpt_context_t *); ++int cpt_index_sockets(cpt_context_t *); ++int cpt_collect_socket(struct file *, cpt_context_t *); ++int cpt_dump_socket(cpt_object_t *obj, struct sock *sk, int index, int parent, struct cpt_context *ctx); ++int cpt_dump_accept_queue(struct sock *sk, int index, struct cpt_context *ctx); ++int cpt_dump_synwait_queue(struct sock *sk, int index, struct cpt_context *ctx); ++int rst_sockets(struct cpt_context *ctx); ++int rst_sockets_complete(struct cpt_context *ctx); ++int cpt_dump_orphaned_sockets(struct cpt_context *ctx); ++ ++int rst_sock_attr(loff_t *pos_p, struct sock *sk, cpt_context_t *ctx); ++struct sk_buff * rst_skb(loff_t *pos_p, __u32 *owner, __u32 *queue, struct cpt_context *ctx); ++ ++void cpt_unlock_sockets(cpt_context_t *); ++void cpt_kill_sockets(cpt_context_t *); ++ ++ ++int cpt_kill_socket(struct sock *, cpt_context_t *); ++int cpt_dump_socket_in(struct cpt_sock_image *, struct sock *, struct cpt_context*); ++int rst_socket_in(struct cpt_sock_image *si, loff_t pos, struct sock *, struct cpt_context *ctx); ++__u32 cpt_socket_fasync(struct file *file, struct cpt_context *ctx); ++int cpt_attach_accept(struct sock *lsk, struct sock *sk, cpt_context_t *); ++int rst_restore_synwait_queue(struct sock *sk, struct cpt_sock_image *si, loff_t pos, struct cpt_context *ctx); ++int cpt_dump_ofo_queue(int idx, struct sock *sk, struct cpt_context *ctx); ++int cpt_dump_skb(int type, int owner, struct sk_buff *skb, struct cpt_context *ctx); ++int cpt_dump_mcfilter(struct sock *sk, struct cpt_context *ctx); ++ ++int rst_sk_mcfilter_in(struct sock *sk, struct cpt_sockmc_image *v, ++ loff_t pos, cpt_context_t *ctx); ++int rst_sk_mcfilter_in6(struct sock *sk, struct cpt_sockmc_image *v, ++ loff_t pos, cpt_context_t *ctx); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_socket_in.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_socket_in.c +--- ./kernel/cpt/cpt_socket_in.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_socket_in.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,449 @@ ++/* ++ * ++ * kernel/cpt/cpt_socket_in.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_socket.h" ++#include "cpt_kernel.h" ++ ++static inline __u32 jiffies_export(unsigned long tmo) ++{ ++ __s32 delta = (long)(tmo - jiffies); ++ return delta; ++} ++ ++static inline __u32 tcp_jiffies_export(__u32 tmo) ++{ ++ __s32 delta = tmo - tcp_time_stamp; ++ return delta; ++} ++ ++int cpt_dump_ofo_queue(int idx, struct sock *sk, struct cpt_context *ctx) ++{ ++ struct sk_buff *skb; ++ struct tcp_sock *tp; ++ ++ if (sk->sk_type != SOCK_STREAM || sk->sk_protocol != IPPROTO_TCP) ++ return 0; ++ ++ tp = tcp_sk(sk); ++ ++ skb = skb_peek(&tp->out_of_order_queue); ++ while (skb && skb != (struct sk_buff*)&tp->out_of_order_queue) { ++ int err; ++ ++ err = cpt_dump_skb(CPT_SKB_OFOQ, idx, skb, ctx); ++ if (err) ++ return err; ++ ++ spin_lock_irq(&tp->out_of_order_queue.lock); ++ skb = skb->next; ++ spin_unlock_irq(&tp->out_of_order_queue.lock); ++ } ++ return 0; ++} ++ ++static int cpt_dump_socket_tcp(struct cpt_sock_image *si, struct sock *sk, ++ struct cpt_context *ctx) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ ++ si->cpt_pred_flags = tp->pred_flags; ++ si->cpt_rcv_nxt = tp->rcv_nxt; ++ si->cpt_snd_nxt = tp->snd_nxt; ++ si->cpt_snd_una = tp->snd_una; ++ si->cpt_snd_sml = tp->snd_sml; ++ si->cpt_rcv_tstamp = tcp_jiffies_export(tp->rcv_tstamp); ++ si->cpt_lsndtime = tcp_jiffies_export(tp->lsndtime); ++ si->cpt_tcp_header_len = tp->tcp_header_len; ++ si->cpt_ack_pending = inet_csk(sk)->icsk_ack.pending; ++ si->cpt_quick = inet_csk(sk)->icsk_ack.quick; ++ si->cpt_pingpong = inet_csk(sk)->icsk_ack.pingpong; ++ si->cpt_blocked = inet_csk(sk)->icsk_ack.blocked; ++ si->cpt_ato = inet_csk(sk)->icsk_ack.ato; ++ si->cpt_ack_timeout = jiffies_export(inet_csk(sk)->icsk_ack.timeout); ++ si->cpt_lrcvtime = tcp_jiffies_export(inet_csk(sk)->icsk_ack.lrcvtime); ++ si->cpt_last_seg_size = inet_csk(sk)->icsk_ack.last_seg_size; ++ si->cpt_rcv_mss = inet_csk(sk)->icsk_ack.rcv_mss; ++ si->cpt_snd_wl1 = tp->snd_wl1; ++ si->cpt_snd_wnd = tp->snd_wnd; ++ si->cpt_max_window = tp->max_window; ++ si->cpt_pmtu_cookie = inet_csk(sk)->icsk_pmtu_cookie; ++ si->cpt_mss_cache = tp->mss_cache; ++ si->cpt_mss_cache_std = tp->mss_cache; /* FIXMW was tp->mss_cache_std */ ++ si->cpt_mss_clamp = tp->rx_opt.mss_clamp; ++ si->cpt_ext_header_len = inet_csk(sk)->icsk_ext_hdr_len; ++ si->cpt_ext2_header_len = 0; ++ si->cpt_ca_state = inet_csk(sk)->icsk_ca_state; ++ si->cpt_retransmits = inet_csk(sk)->icsk_retransmits; ++ si->cpt_reordering = tp->reordering; ++ si->cpt_frto_counter = tp->frto_counter; ++ si->cpt_frto_highmark = tp->frto_highmark; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9) ++ // // si->cpt_adv_cong = tp->adv_cong; ++#endif ++ si->cpt_defer_accept = inet_csk(sk)->icsk_accept_queue.rskq_defer_accept; ++ si->cpt_backoff = inet_csk(sk)->icsk_backoff; ++ si->cpt_srtt = tp->srtt; ++ si->cpt_mdev = tp->mdev; ++ si->cpt_mdev_max = tp->mdev_max; ++ si->cpt_rttvar = tp->rttvar; ++ si->cpt_rtt_seq = tp->rtt_seq; ++ si->cpt_rto = inet_csk(sk)->icsk_rto; ++ si->cpt_packets_out = tp->packets_out; ++ si->cpt_left_out = tp->sacked_out + tp->lost_out; ++ si->cpt_retrans_out = tp->retrans_out; ++ si->cpt_lost_out = tp->lost_out; ++ si->cpt_sacked_out = tp->sacked_out; ++ si->cpt_fackets_out = tp->fackets_out; ++ si->cpt_snd_ssthresh = tp->snd_ssthresh; ++ si->cpt_snd_cwnd = tp->snd_cwnd; ++ si->cpt_snd_cwnd_cnt = tp->snd_cwnd_cnt; ++ si->cpt_snd_cwnd_clamp = tp->snd_cwnd_clamp; ++ si->cpt_snd_cwnd_used = tp->snd_cwnd_used; ++ si->cpt_snd_cwnd_stamp = tcp_jiffies_export(tp->snd_cwnd_stamp); ++ si->cpt_timeout = jiffies_export(inet_csk(sk)->icsk_timeout); ++ si->cpt_ka_timeout = 0; ++ si->cpt_rcv_wnd = tp->rcv_wnd; ++ si->cpt_rcv_wup = tp->rcv_wup; ++ si->cpt_write_seq = tp->write_seq; ++ si->cpt_pushed_seq = tp->pushed_seq; ++ si->cpt_copied_seq = tp->copied_seq; ++ si->cpt_tstamp_ok = tp->rx_opt.tstamp_ok; ++ si->cpt_wscale_ok = tp->rx_opt.wscale_ok; ++ si->cpt_sack_ok = tp->rx_opt.sack_ok; ++ si->cpt_saw_tstamp = tp->rx_opt.saw_tstamp; ++ si->cpt_snd_wscale = tp->rx_opt.snd_wscale; ++ si->cpt_rcv_wscale = tp->rx_opt.rcv_wscale; ++ si->cpt_nonagle = tp->nonagle; ++ si->cpt_keepalive_probes = tp->keepalive_probes; ++ si->cpt_rcv_tsval = tp->rx_opt.rcv_tsval; ++ si->cpt_rcv_tsecr = tp->rx_opt.rcv_tsecr; ++ si->cpt_ts_recent = tp->rx_opt.ts_recent; ++ si->cpt_ts_recent_stamp = tp->rx_opt.ts_recent_stamp; ++ si->cpt_user_mss = tp->rx_opt.user_mss; ++ si->cpt_dsack = tp->rx_opt.dsack; ++ si->cpt_eff_sacks = tp->rx_opt.eff_sacks; ++ si->cpt_sack_array[0] = tp->duplicate_sack[0].start_seq; ++ si->cpt_sack_array[1] = tp->duplicate_sack[0].end_seq; ++ si->cpt_sack_array[2] = tp->selective_acks[0].start_seq; ++ si->cpt_sack_array[3] = tp->selective_acks[0].end_seq; ++ si->cpt_sack_array[4] = tp->selective_acks[1].start_seq; ++ si->cpt_sack_array[5] = tp->selective_acks[1].end_seq; ++ si->cpt_sack_array[6] = tp->selective_acks[2].start_seq; ++ si->cpt_sack_array[7] = tp->selective_acks[2].end_seq; ++ si->cpt_sack_array[8] = tp->selective_acks[3].start_seq; ++ si->cpt_sack_array[9] = tp->selective_acks[3].end_seq; ++ si->cpt_window_clamp = tp->window_clamp; ++ si->cpt_rcv_ssthresh = tp->rcv_ssthresh; ++ si->cpt_probes_out = inet_csk(sk)->icsk_probes_out; ++ si->cpt_num_sacks = tp->rx_opt.num_sacks; ++ si->cpt_advmss = tp->advmss; ++ si->cpt_syn_retries = inet_csk(sk)->icsk_syn_retries; ++ si->cpt_ecn_flags = tp->ecn_flags; ++ si->cpt_prior_ssthresh = tp->prior_ssthresh; ++ si->cpt_high_seq = tp->high_seq; ++ si->cpt_retrans_stamp = tp->retrans_stamp; ++ si->cpt_undo_marker = tp->undo_marker; ++ si->cpt_undo_retrans = tp->undo_retrans; ++ si->cpt_urg_seq = tp->urg_seq; ++ si->cpt_urg_data = tp->urg_data; ++ si->cpt_pending = inet_csk(sk)->icsk_pending; ++ si->cpt_urg_mode = tp->urg_mode; ++ si->cpt_snd_up = tp->snd_up; ++ si->cpt_keepalive_time = tp->keepalive_time; ++ si->cpt_keepalive_intvl = tp->keepalive_intvl; ++ si->cpt_linger2 = tp->linger2; ++ ++ if (sk->sk_state != TCP_LISTEN && ++ sk->sk_state != TCP_CLOSE && ++ sock_flag(sk, SOCK_KEEPOPEN)) { ++ si->cpt_ka_timeout = jiffies_export(sk->sk_timer.expires); ++ } ++ ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++ { ++ extern struct inet_connection_sock_af_ops ipv6_mapped; ++ if (sk->sk_family == AF_INET6 && ++ inet_csk(sk)->icsk_af_ops == &ipv6_mapped) ++ si->cpt_mapped = 1; ++ } ++#endif ++ ++ return 0; ++} ++ ++ ++int cpt_dump_socket_in(struct cpt_sock_image *si, struct sock *sk, ++ struct cpt_context *ctx) ++{ ++ struct inet_sock *inet = inet_sk(sk); ++ struct ipv6_pinfo *np = inet6_sk(sk); ++ ++ if (sk->sk_family == AF_INET) { ++ struct sockaddr_in *sin = ((struct sockaddr_in*)si->cpt_laddr); ++ sin->sin_family = AF_INET; ++ sin->sin_port = inet->sport; ++ sin->sin_addr.s_addr = inet->rcv_saddr; ++ si->cpt_laddrlen = sizeof(*sin); ++ } else if (sk->sk_family == AF_INET6) { ++ struct sockaddr_in6 *sin6 = ((struct sockaddr_in6*)si->cpt_laddr); ++ sin6->sin6_family = AF_INET6; ++ sin6->sin6_port = inet->sport; ++ memcpy(&sin6->sin6_addr, &np->rcv_saddr, 16); ++ si->cpt_laddrlen = sizeof(*sin6); ++ } ++ if (!inet->num) ++ si->cpt_laddrlen = 0; ++ ++ si->cpt_daddr = inet->daddr; ++ si->cpt_dport = inet->dport; ++ si->cpt_saddr = inet->saddr; ++ si->cpt_rcv_saddr = inet->rcv_saddr; ++ si->cpt_sport = inet->sport; ++ si->cpt_uc_ttl = inet->uc_ttl; ++ si->cpt_tos = inet->tos; ++ si->cpt_cmsg_flags = inet->cmsg_flags; ++ si->cpt_mc_index = inet->mc_index; ++ si->cpt_mc_addr = inet->mc_addr; ++ si->cpt_hdrincl = inet->hdrincl; ++ si->cpt_mc_ttl = inet->mc_ttl; ++ si->cpt_mc_loop = inet->mc_loop; ++ si->cpt_pmtudisc = inet->pmtudisc; ++ si->cpt_recverr = inet->recverr; ++ si->cpt_freebind = inet->freebind; ++ si->cpt_idcounter = inet->id; ++ ++ si->cpt_cork_flags = inet->cork.flags; ++ si->cpt_cork_fragsize = 0; ++ si->cpt_cork_length = inet->cork.length; ++ si->cpt_cork_addr = inet->cork.addr; ++ si->cpt_cork_saddr = inet->cork.fl.fl4_src; ++ si->cpt_cork_daddr = inet->cork.fl.fl4_dst; ++ si->cpt_cork_oif = inet->cork.fl.oif; ++ if (inet->cork.rt) { ++ si->cpt_cork_fragsize = inet->cork.fragsize; ++ si->cpt_cork_saddr = inet->cork.rt->fl.fl4_src; ++ si->cpt_cork_daddr = inet->cork.rt->fl.fl4_dst; ++ si->cpt_cork_oif = inet->cork.rt->fl.oif; ++ } ++ ++ if (sk->sk_type == SOCK_DGRAM && sk->sk_protocol == IPPROTO_UDP) { ++ struct udp_sock *up = udp_sk(sk); ++ si->cpt_udp_pending = up->pending; ++ si->cpt_udp_corkflag = up->corkflag; ++ si->cpt_udp_encap = up->encap_type; ++ si->cpt_udp_len = up->len; ++ } ++ ++ if (sk->sk_family == AF_INET6) { ++ memcpy(si->cpt_saddr6, &np->saddr, 16); ++ memcpy(si->cpt_rcv_saddr6, &np->rcv_saddr, 16); ++ memcpy(si->cpt_daddr6, &np->daddr, 16); ++ si->cpt_flow_label6 = np->flow_label; ++ si->cpt_frag_size6 = np->frag_size; ++ si->cpt_hop_limit6 = np->hop_limit; ++ si->cpt_mcast_hops6 = np->mcast_hops; ++ si->cpt_mcast_oif6 = np->mcast_oif; ++ si->cpt_rxopt6 = np->rxopt.all; ++ si->cpt_mc_loop6 = np->mc_loop; ++ si->cpt_recverr6 = np->recverr; ++ si->cpt_sndflow6 = np->sndflow; ++ si->cpt_pmtudisc6 = np->pmtudisc; ++ si->cpt_ipv6only6 = np->ipv6only; ++ si->cpt_mapped = 0; ++ } ++ ++ if (sk->sk_type == SOCK_STREAM && sk->sk_protocol == IPPROTO_TCP) ++ cpt_dump_socket_tcp(si, sk, ctx); ++ ++ return 0; ++} ++ ++int cpt_dump_accept_queue(struct sock *sk, int index, struct cpt_context *ctx) ++{ ++ struct request_sock *req; ++ ++ for (req=inet_csk(sk)->icsk_accept_queue.rskq_accept_head; req; req=req->dl_next) ++ cpt_dump_socket(NULL, req->sk, -1, index, ctx); ++ return 0; ++} ++ ++ ++static int dump_openreq(struct request_sock *req, struct sock *sk, int index, ++ struct cpt_context *ctx) ++{ ++ struct cpt_openreq_image *v = cpt_get_buf(ctx); ++ ++ cpt_open_object(NULL, ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_OPENREQ; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_VOID; ++ ++ v->cpt_rcv_isn = tcp_rsk(req)->rcv_isn; ++ v->cpt_snt_isn = tcp_rsk(req)->snt_isn; ++ v->cpt_rmt_port = inet_rsk(req)->rmt_port; ++ v->cpt_mss = req->mss; ++ v->cpt_family = req->rsk_ops->family; ++ v->cpt_retrans = req->retrans; ++ v->cpt_snd_wscale = inet_rsk(req)->snd_wscale; ++ v->cpt_rcv_wscale = inet_rsk(req)->rcv_wscale; ++ v->cpt_tstamp_ok = inet_rsk(req)->tstamp_ok; ++ v->cpt_sack_ok = inet_rsk(req)->sack_ok; ++ v->cpt_wscale_ok = inet_rsk(req)->wscale_ok; ++ v->cpt_ecn_ok = inet_rsk(req)->ecn_ok; ++ v->cpt_acked = inet_rsk(req)->acked; ++ v->cpt_window_clamp = req->window_clamp; ++ v->cpt_rcv_wnd = req->rcv_wnd; ++ v->cpt_ts_recent = req->ts_recent; ++ v->cpt_expires = jiffies_export(req->expires); ++ ++ if (v->cpt_family == AF_INET) { ++ memcpy(v->cpt_loc_addr, &inet_rsk(req)->loc_addr, 4); ++ memcpy(v->cpt_rmt_addr, &inet_rsk(req)->rmt_addr, 4); ++ } else { ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++ memcpy(v->cpt_loc_addr, &inet6_rsk(req)->loc_addr, 16); ++ memcpy(v->cpt_rmt_addr, &inet6_rsk(req)->rmt_addr, 16); ++ v->cpt_iif = inet6_rsk(req)->iif; ++#endif ++ } ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ cpt_close_object(ctx); ++ return 0; ++} ++ ++int cpt_dump_synwait_queue(struct sock *sk, int index, struct cpt_context *ctx) ++{ ++ struct inet_connection_sock *icsk; ++ struct listen_sock *lopt; ++ struct request_sock *req; ++ int nr_entries; ++ int i; ++ ++ icsk = inet_csk(sk); ++ lopt = icsk->icsk_accept_queue.listen_opt; ++ nr_entries = icsk->icsk_accept_queue.listen_opt->nr_table_entries; ++ ++ for (i=0; i < nr_entries; i++) { ++ for (req=lopt->syn_table[i]; req; req=req->dl_next) { ++ loff_t saved_obj; ++ cpt_push_object(&saved_obj, ctx); ++ dump_openreq(req, sk, index, ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ } ++ } ++ return 0; ++} ++ ++ ++int cpt_kill_socket(struct sock *sk, cpt_context_t * ctx) ++{ ++ if (sk->sk_state != TCP_CLOSE && ++ (sk->sk_family == AF_INET || sk->sk_family == AF_INET6) && ++ sk->sk_protocol == IPPROTO_TCP) { ++ if (sk->sk_state != TCP_LISTEN) ++ tcp_set_state(sk, TCP_CLOSE); ++ else ++ sk->sk_prot->disconnect(sk, 0); ++ } ++ return 0; ++} ++ ++int cpt_dump_mcfilter(struct sock *sk, cpt_context_t *ctx) ++{ ++ struct inet_sock *inet = inet_sk(sk); ++ struct ip_mc_socklist *iml; ++ ++ for (iml = inet->mc_list; iml; iml = iml->next) { ++ struct cpt_sockmc_image smi; ++ int scnt = 0; ++ int i; ++ ++ if (iml->sflist) ++ scnt = iml->sflist->sl_count*16; ++ ++ smi.cpt_next = sizeof(smi) + scnt; ++ smi.cpt_object = CPT_OBJ_SOCK_MCADDR; ++ smi.cpt_hdrlen = sizeof(smi); ++ smi.cpt_content = CPT_CONTENT_DATA; ++ ++ smi.cpt_family = AF_INET; ++ smi.cpt_mode = iml->sfmode; ++ smi.cpt_ifindex = iml->multi.imr_ifindex; ++ memset(&smi.cpt_mcaddr, 0, sizeof(smi.cpt_mcaddr)); ++ smi.cpt_mcaddr[0] = iml->multi.imr_multiaddr.s_addr; ++ ++ ctx->write(&smi, sizeof(smi), ctx); ++ ++ for (i = 0; i < scnt; i++) { ++ u32 addr[4]; ++ memset(&addr, 0, sizeof(addr)); ++ addr[0] = iml->sflist->sl_addr[i]; ++ ctx->write(&addr, sizeof(addr), ctx); ++ } ++ } ++ ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++ if (sk->sk_family == AF_INET6) { ++ struct ipv6_mc_socklist *mcl; ++ struct ipv6_pinfo *np = inet6_sk(sk); ++ ++ for (mcl = np->ipv6_mc_list; mcl; mcl = mcl->next) { ++ struct cpt_sockmc_image smi; ++ int scnt = 0; ++ int i; ++ ++ if (mcl->sflist) ++ scnt = mcl->sflist->sl_count*16; ++ ++ smi.cpt_next = sizeof(smi) + scnt; ++ smi.cpt_object = CPT_OBJ_SOCK_MCADDR; ++ smi.cpt_hdrlen = sizeof(smi); ++ smi.cpt_content = CPT_CONTENT_DATA; ++ ++ smi.cpt_family = AF_INET6; ++ smi.cpt_mode = mcl->sfmode; ++ smi.cpt_ifindex = mcl->ifindex; ++ memcpy(&smi.cpt_mcaddr, &mcl->addr, sizeof(smi.cpt_mcaddr)); ++ ++ ctx->write(&smi, sizeof(smi), ctx); ++ for (i = 0; i < scnt; i++) ++ ctx->write(&mcl->sflist->sl_addr[i], 16, ctx); ++ } ++ } ++#endif ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_syscalls.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_syscalls.h +--- ./kernel/cpt/cpt_syscalls.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_syscalls.h 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,100 @@ ++#include ++#include ++#include ++ ++#define WRAP(c, args) return sys_##c args ++#define WRAP2(c, args) int err; mm_segment_t oldfs; \ ++ oldfs = get_fs(); set_fs(KERNEL_DS); \ ++ err = sys_##c args ;\ ++ set_fs(oldfs); \ ++ return err ++ ++static inline int sc_close(int fd) ++{ ++ WRAP(close, (fd)); ++} ++ ++static inline int sc_dup2(int fd1, int fd2) ++{ ++ WRAP(dup2, (fd1, fd2)); ++} ++ ++static inline int sc_unlink(char *name) ++{ ++ WRAP2(unlink, (name)); ++} ++ ++static inline int sc_pipe(int *pfd) ++{ ++ return do_pipe(pfd); ++} ++ ++static inline int sc_mknod(char *name, int mode, int dev) ++{ ++ WRAP2(mknod, (name, mode, dev)); ++} ++ ++static inline int sc_chmod(char *name, int mode) ++{ ++ WRAP2(mkdir, (name, mode)); ++} ++ ++static inline int sc_chown(char *name, int uid, int gid) ++{ ++ WRAP2(chown, (name, uid, gid)); ++} ++ ++static inline int sc_mkdir(char *name, int mode) ++{ ++ WRAP2(mkdir, (name, mode)); ++} ++ ++static inline int sc_rmdir(char *name) ++{ ++ WRAP2(rmdir, (name)); ++} ++ ++static inline int sc_mount(char *mntdev, char *mntpnt, char *type, unsigned long flags) ++{ ++ WRAP2(mount, (mntdev ? : "none", mntpnt, type, flags, NULL)); ++} ++ ++static inline int sc_mprotect(unsigned long start, size_t len, ++ unsigned long prot) ++{ ++ WRAP(mprotect, (start, len, prot)); ++} ++ ++static inline int sc_mlock(unsigned long start, size_t len) ++{ ++ WRAP(mlock, (start, len)); ++} ++ ++static inline int sc_munlock(unsigned long start, size_t len) ++{ ++ WRAP(munlock, (start, len)); ++} ++ ++static inline int sc_remap_file_pages(unsigned long start, size_t len, ++ unsigned long prot, unsigned long pgoff, ++ unsigned long flags) ++{ ++ WRAP(remap_file_pages, (start, len, prot, pgoff, flags)); ++} ++ ++static inline int sc_waitx(int pid, int opt, int *stat_addr) ++{ ++ WRAP(wait4, (pid, stat_addr, opt, NULL)); ++} ++ ++static inline int sc_flock(int fd, int flags) ++{ ++ WRAP(flock, (fd, flags)); ++} ++ ++static inline int sc_open(char* path, int flags, int mode) ++{ ++ WRAP(open, (path, flags, mode)); ++} ++ ++extern int sc_execve(char *cms, char **argv, char **env); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_sysvipc.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_sysvipc.c +--- ./kernel/cpt/cpt_sysvipc.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_sysvipc.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,403 @@ ++/* ++ * ++ * kernel/cpt/cpt_sysvipc.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_kernel.h" ++ ++struct _warg { ++ struct file *file; ++ struct cpt_sysvshm_image *v; ++}; ++ ++static int dump_one_shm(struct shmid_kernel *shp, void *arg) ++{ ++ struct _warg *warg = arg; ++ struct cpt_sysvshm_image *v = (struct cpt_sysvshm_image *)warg->v; ++ ++ if (shp->shm_file != warg->file) ++ return 0; ++ ++ v->cpt_key = shp->shm_perm.key; ++ v->cpt_uid = shp->shm_perm.uid; ++ v->cpt_gid = shp->shm_perm.gid; ++ v->cpt_cuid = shp->shm_perm.cuid; ++ v->cpt_cgid = shp->shm_perm.cgid; ++ v->cpt_mode = shp->shm_perm.mode; ++ v->cpt_seq = shp->shm_perm.seq; ++ ++ v->cpt_id = shp->shm_perm.id; ++ v->cpt_segsz = shp->shm_segsz; ++ v->cpt_atime = shp->shm_atim; ++ v->cpt_ctime = shp->shm_ctim; ++ v->cpt_dtime = shp->shm_dtim; ++ v->cpt_creator = shp->shm_cprid; ++ v->cpt_last = shp->shm_lprid; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9) ++ v->cpt_mlockuser = shp->mlock_user ? shp->mlock_user->uid : -1; ++#else ++ v->cpt_mlockuser = -1; ++#endif ++ return 1; ++} ++ ++int cpt_dump_content_sysvshm(struct file *file, struct cpt_context *ctx) ++{ ++ struct cpt_sysvshm_image *v = cpt_get_buf(ctx); ++ struct _warg warg; ++ ++ v->cpt_next = sizeof(*v); ++ v->cpt_object = CPT_OBJ_SYSV_SHM; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_VOID; ++ ++ warg.file = file; ++ warg.v = v; ++ if (sysvipc_walk_shm(dump_one_shm, &warg) == 0) { ++ cpt_release_buf(ctx); ++ return -ESRCH; ++ } ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ return 0; ++} ++ ++ ++int match_sem(int id, struct sem_array *sema, void *arg) ++{ ++ if (id != (unsigned long)arg) ++ return 0; ++ return sema->sem_nsems + 1; ++} ++ ++static int get_sem_nsem(int id, cpt_context_t *ctx) ++{ ++ int res; ++ res = sysvipc_walk_sem(match_sem, (void*)(unsigned long)id); ++ if (res > 0) ++ return res - 1; ++ eprintk_ctx("get_sem_nsem: SYSV semaphore %d not found\n", id); ++ return -ESRCH; ++} ++ ++static int dump_one_semundo(struct sem_undo *su, struct cpt_context *ctx) ++{ ++ struct cpt_sysvsem_undo_image v; ++ loff_t saved_obj; ++ ++ cpt_open_object(NULL, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_SYSVSEM_UNDO_REC; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_SEMUNDO; ++ v.cpt_id = su->semid; ++ v.cpt_nsem = get_sem_nsem(su->semid, ctx); ++ if ((int)v.cpt_nsem < 0) ++ return -ESRCH; ++ ++ ctx->write(&v, sizeof(v), ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ ctx->write(su->semadj, v.cpt_nsem*sizeof(short), ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ ++ cpt_close_object(ctx); ++ return 0; ++} ++ ++struct sem_warg { ++ int last_id; ++ struct cpt_sysvsem_image *v; ++}; ++ ++static int dump_one_sem(int id, struct sem_array *sma, void *arg) ++{ ++ struct sem_warg * warg = (struct sem_warg *)arg; ++ struct cpt_sysvsem_image *v = warg->v; ++ int i; ++ ++ if (warg->last_id != -1) { ++ if ((id % IPCMNI) <= warg->last_id) ++ return 0; ++ } ++ ++ v->cpt_next = sizeof(*v); ++ v->cpt_object = CPT_OBJ_SYSV_SEM; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_SEMARRAY; ++ ++ v->cpt_key = sma->sem_perm.key; ++ v->cpt_uid = sma->sem_perm.uid; ++ v->cpt_gid = sma->sem_perm.gid; ++ v->cpt_cuid = sma->sem_perm.cuid; ++ v->cpt_cgid = sma->sem_perm.cgid; ++ v->cpt_mode = sma->sem_perm.mode; ++ v->cpt_seq = sma->sem_perm.seq; ++ ++ v->cpt_id = id; ++ v->cpt_ctime = sma->sem_ctime; ++ v->cpt_otime = sma->sem_otime; ++ ++ for (i=0; isem_nsems; i++) { ++ struct { ++ __u32 semval; ++ __u32 sempid; ++ } *s = (void*)v + v->cpt_next; ++ if (v->cpt_next >= PAGE_SIZE - sizeof(*s)) ++ return -EINVAL; ++ s->semval = sma->sem_base[i].semval; ++ s->sempid = sma->sem_base[i].sempid; ++ v->cpt_next += sizeof(*s); ++ } ++ ++ warg->last_id = id % IPCMNI; ++ return 1; ++} ++ ++ ++int cpt_dump_sysvsem(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ struct sem_warg warg; ++ ++ /* Dumping semaphores is quite tricky because we cannot ++ * write to dump file under lock inside sysvipc_walk_sem(). ++ */ ++ cpt_open_section(ctx, CPT_SECT_SYSV_SEM); ++ warg.last_id = -1; ++ warg.v = cpt_get_buf(ctx); ++ for (;;) { ++ if (sysvipc_walk_sem(dump_one_sem, &warg) <= 0) ++ break; ++ ctx->write(warg.v, warg.v->cpt_next, ctx); ++ } ++ cpt_release_buf(ctx); ++ cpt_close_section(ctx); ++ ++ cpt_open_section(ctx, CPT_SECT_SYSVSEM_UNDO); ++ for_each_object(obj, CPT_OBJ_SYSVSEM_UNDO) { ++ struct sem_undo_list *semu = obj->o_obj; ++ struct sem_undo *su; ++ struct cpt_object_hdr v; ++ loff_t saved_obj; ++ ++ cpt_open_object(obj, ctx); ++ ++ v.cpt_next = CPT_NULL; ++ v.cpt_object = CPT_OBJ_SYSVSEM_UNDO; ++ v.cpt_hdrlen = sizeof(v); ++ v.cpt_content = CPT_CONTENT_ARRAY; ++ ++ ctx->write(&v, sizeof(v), ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ for (su = semu->proc_list; su; su = su->proc_next) { ++ if (su->semid != -1) { ++ int err; ++ err = dump_one_semundo(su, ctx); ++ if (err < 0) ++ return err; ++ } ++ } ++ cpt_pop_object(&saved_obj, ctx); ++ ++ cpt_close_object(ctx); ++ } ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++struct msg_warg { ++ int last_id; ++ struct msg_queue *msq; ++ struct cpt_sysvmsg_image *v; ++}; ++ ++static int dump_one_msg(int id, struct msg_queue *msq, void *arg) ++{ ++ struct msg_warg * warg = (struct msg_warg *)arg; ++ struct cpt_sysvmsg_image *v = warg->v; ++ ++ if (warg->last_id != -1) { ++ if ((id % IPCMNI) <= warg->last_id) ++ return 0; ++ } ++ ++ v->cpt_next = sizeof(*v); ++ v->cpt_object = CPT_OBJ_SYSVMSG; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_key = msq->q_perm.key; ++ v->cpt_uid = msq->q_perm.uid; ++ v->cpt_gid = msq->q_perm.gid; ++ v->cpt_cuid = msq->q_perm.cuid; ++ v->cpt_cgid = msq->q_perm.cgid; ++ v->cpt_mode = msq->q_perm.mode; ++ v->cpt_seq = msq->q_perm.seq; ++ ++ v->cpt_id = id; ++ v->cpt_stime = msq->q_stime; ++ v->cpt_rtime = msq->q_rtime; ++ v->cpt_ctime = msq->q_ctime; ++ v->cpt_last_sender = msq->q_lspid; ++ v->cpt_last_receiver = msq->q_lrpid; ++ v->cpt_qbytes = msq->q_qbytes; ++ ++ warg->msq = msq; ++ warg->last_id = id % IPCMNI; ++ return 1; ++} ++ ++static int do_store(void * src, int len, int offset, void * data) ++{ ++ cpt_context_t * ctx = data; ++ ctx->write(src, len, ctx); ++ return 0; ++} ++ ++static void cpt_dump_one_sysvmsg(struct msg_msg *m, cpt_context_t * ctx) ++{ ++ loff_t saved_obj; ++ struct cpt_sysvmsg_msg_image mv; ++ ++ cpt_open_object(NULL, ctx); ++ mv.cpt_next = CPT_NULL; ++ mv.cpt_object = CPT_OBJ_SYSVMSG_MSG; ++ mv.cpt_hdrlen = sizeof(mv); ++ mv.cpt_content = CPT_CONTENT_DATA; ++ ++ mv.cpt_type = m->m_type; ++ mv.cpt_size = m->m_ts; ++ ++ ctx->write(&mv, sizeof(mv), ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ sysv_msg_store(m, do_store, m->m_ts, ctx); ++ cpt_pop_object(&saved_obj, ctx); ++ cpt_close_object(ctx); ++} ++ ++int cpt_dump_sysvmsg(struct cpt_context *ctx) ++{ ++ struct msg_warg warg; ++ ++ /* Dumping msg queues is tricky because we cannot ++ * write to dump file under lock inside sysvipc_walk_msg(). ++ * ++ * And even worse, we have to access msg list in an unserialized ++ * context. It is fragile. But VE is still frozen, remember? ++ */ ++ cpt_open_section(ctx, CPT_SECT_SYSV_MSG); ++ warg.last_id = -1; ++ warg.v = cpt_get_buf(ctx); ++ for (;;) { ++ loff_t saved_obj; ++ struct msg_msg * m; ++ ++ if (sysvipc_walk_msg(dump_one_msg, &warg) <= 0) ++ break; ++ ++ cpt_open_object(NULL, ctx); ++ ++ ctx->write(warg.v, warg.v->cpt_next, ctx); ++ ++ cpt_push_object(&saved_obj, ctx); ++ list_for_each_entry(m, &warg.msq->q_messages, m_list) { ++ cpt_dump_one_sysvmsg(m, ctx); ++ } ++ cpt_pop_object(&saved_obj, ctx); ++ ++ cpt_close_object(ctx); ++ } ++ cpt_release_buf(ctx); ++ cpt_close_section(ctx); ++ return 0; ++} ++ ++static int cpt_collect_sysvsem_undo(cpt_context_t *ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ if (tsk->exit_state) { ++ /* ipc/sem.c forgets to clear tsk->sysvsem.undo_list ++ * on exit. Grrr... */ ++ continue; ++ } ++ if (tsk->sysvsem.undo_list && ++ cpt_object_add(CPT_OBJ_SYSVSEM_UNDO, tsk->sysvsem.undo_list, ctx) == NULL) ++ return -ENOMEM; ++ } ++ ++ for_each_object(obj, CPT_OBJ_SYSVSEM_UNDO) { ++ struct sem_undo_list *semu = obj->o_obj; ++ ++ if (atomic_read(&semu->refcnt) != obj->o_count) { ++ eprintk_ctx("sem_undo_list is referenced outside %d %d\n", obj->o_count, atomic_read(&semu->refcnt)); ++ return -EBUSY; ++ } ++ } ++ return 0; ++} ++ ++static int collect_one_shm(struct shmid_kernel *shp, void *arg) ++{ ++ cpt_context_t *ctx = arg; ++ ++ if (__cpt_object_add(CPT_OBJ_FILE, shp->shm_file, GFP_ATOMIC, ctx) == NULL) ++ return -ENOMEM; ++ return 0; ++} ++ ++int cpt_collect_sysvshm(cpt_context_t * ctx) ++{ ++ int err; ++ ++ err = sysvipc_walk_shm(collect_one_shm, ctx); ++ ++ return err < 0 ? err : 0; ++} ++ ++int cpt_collect_sysv(cpt_context_t * ctx) ++{ ++ int err; ++ ++ err = cpt_collect_sysvsem_undo(ctx); ++ if (err) ++ return err; ++ err = cpt_collect_sysvshm(ctx); ++ if (err) ++ return err; ++ ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_tty.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_tty.c +--- ./kernel/cpt/cpt_tty.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_tty.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,215 @@ ++/* ++ * ++ * kernel/cpt/cpt_tty.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++ ++/* We must support at least N_TTY. */ ++ ++int cpt_dump_content_tty(struct file *file, struct cpt_context *ctx) ++{ ++ struct tty_struct *tty = file->private_data; ++ cpt_object_t *obj; ++ struct cpt_obj_ref o; ++ loff_t saved_pos; ++ ++ obj = lookup_cpt_object(CPT_OBJ_TTY, tty, ctx); ++ if (!obj) ++ return -EINVAL; ++ ++ cpt_push_object(&saved_pos, ctx); ++ ++ o.cpt_next = sizeof(o); ++ o.cpt_object = CPT_OBJ_REF; ++ o.cpt_hdrlen = sizeof(o); ++ o.cpt_content = CPT_CONTENT_VOID; ++ o.cpt_pos = obj->o_pos; ++ ctx->write(&o, sizeof(o), ctx); ++ ++ cpt_pop_object(&saved_pos, ctx); ++ ++ return 0; ++} ++ ++int cpt_collect_tty(struct file *file, cpt_context_t * ctx) ++{ ++ struct tty_struct *tty = file->private_data; ++ ++ if (tty) { ++ if (cpt_object_add(CPT_OBJ_TTY, tty, ctx) == NULL) ++ return -ENOMEM; ++ if (tty->link) { ++ cpt_object_t *obj; ++ ++ obj = cpt_object_add(CPT_OBJ_TTY, tty->link, ctx); ++ if (obj == NULL) ++ return -ENOMEM; ++ /* Undo o_count, tty->link is not a reference */ ++ obj->o_count--; ++ } ++ } ++ return 0; ++} ++ ++int cpt_dump_tty(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct tty_struct *tty = obj->o_obj; ++ struct cpt_tty_image *v; ++ ++ if (tty->link) { ++ if (lookup_cpt_object(CPT_OBJ_TTY, tty->link, ctx) == NULL) { ++ eprintk_ctx("orphan pty %s %d\n", tty->name, tty->driver->subtype == PTY_TYPE_SLAVE); ++ return -EINVAL; ++ } ++ if (tty->link->link != tty) { ++ eprintk_ctx("bad pty pair\n"); ++ return -EINVAL; ++ } ++ if (tty->driver->type == TTY_DRIVER_TYPE_PTY && ++ tty->driver->subtype == PTY_TYPE_SLAVE && ++ tty->link->count) ++ obj->o_count++; ++ } ++ if (obj->o_count != tty->count) { ++ eprintk_ctx("tty %s is referenced outside %d %d\n", tty->name, obj->o_count, tty->count); ++ return -EBUSY; ++ } ++ ++ cpt_open_object(obj, ctx); ++ ++ v = cpt_get_buf(ctx); ++ v->cpt_next = -1; ++ v->cpt_object = CPT_OBJ_TTY; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_ARRAY; ++ ++ v->cpt_index = tty->index; ++ v->cpt_link = -1; ++ if (tty->link) ++ v->cpt_link = tty->link->index; ++ v->cpt_drv_type = tty->driver->type; ++ v->cpt_drv_subtype = tty->driver->subtype; ++ v->cpt_drv_flags = tty->driver->flags; ++ v->cpt_packet = tty->packet; ++ v->cpt_stopped = tty->stopped; ++ v->cpt_hw_stopped = tty->hw_stopped; ++ v->cpt_flow_stopped = tty->flow_stopped; ++ v->cpt_flags = tty->flags; ++ v->cpt_ctrl_status = tty->ctrl_status; ++ v->cpt_canon_data = tty->canon_data; ++ v->cpt_canon_head = tty->canon_head - tty->read_tail; ++ v->cpt_canon_column = tty->canon_column; ++ v->cpt_column = tty->column; ++ v->cpt_erasing = tty->erasing; ++ v->cpt_lnext = tty->lnext; ++ v->cpt_icanon = tty->icanon; ++ v->cpt_raw = tty->raw; ++ v->cpt_real_raw = tty->real_raw; ++ v->cpt_closing = tty->closing; ++ v->cpt_minimum_to_wake = tty->minimum_to_wake; ++ v->cpt_pgrp = 0; ++ if (tty->pgrp) { ++ v->cpt_pgrp = pid_vnr(tty->pgrp); ++ if ((int)v->cpt_pgrp < 0) { ++ dprintk_ctx("cannot map tty->pgrp %d -> %d\n", pid_vnr(tty->pgrp), (int)v->cpt_pgrp); ++ v->cpt_pgrp = -1; ++ } ++ } ++ v->cpt_session = 0; ++ if (tty->session) { ++ v->cpt_session = pid_vnr(tty->session); ++ if ((int)v->cpt_session < 0) { ++ eprintk_ctx("cannot map tty->session %d -> %d\n", pid_nr(tty->session), (int)v->cpt_session); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ } ++ memcpy(v->cpt_name, tty->name, 64); ++ v->cpt_ws_row = tty->winsize.ws_row; ++ v->cpt_ws_col = tty->winsize.ws_col; ++ v->cpt_ws_prow = tty->winsize.ws_ypixel; ++ v->cpt_ws_pcol = tty->winsize.ws_xpixel; ++ if (tty->termios == NULL) { ++ eprintk_ctx("NULL termios"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ v->cpt_c_line = tty->termios->c_line; ++ v->cpt_c_iflag = tty->termios->c_iflag; ++ v->cpt_c_oflag = tty->termios->c_oflag; ++ v->cpt_c_cflag = tty->termios->c_cflag; ++ v->cpt_c_lflag = tty->termios->c_lflag; ++ memcpy(v->cpt_c_cc, tty->termios->c_cc, NCCS); ++ if (NCCS < 32) ++ memset(v->cpt_c_cc + NCCS, 255, 32 - NCCS); ++ memcpy(v->cpt_read_flags, tty->read_flags, sizeof(v->cpt_read_flags)); ++ ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ if (tty->read_buf && tty->read_cnt) { ++ struct cpt_obj_bits *v = cpt_get_buf(ctx); ++ loff_t saved_pos; ++ ++ cpt_push_object(&saved_pos, ctx); ++ cpt_open_object(NULL, ctx); ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_BITS; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_DATA; ++ v->cpt_size = tty->read_cnt; ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_release_buf(ctx); ++ ++ if (tty->read_cnt) { ++ int n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail); ++ ctx->write(tty->read_buf + tty->read_tail, n, ctx); ++ if (tty->read_cnt > n) ++ ctx->write(tty->read_buf, tty->read_cnt-n, ctx); ++ ctx->align(ctx); ++ } ++ ++ cpt_close_object(ctx); ++ cpt_pop_object(&saved_pos, ctx); ++ } ++ ++ cpt_close_object(ctx); ++ ++ return 0; ++} ++ ++__u32 cpt_tty_fasync(struct file *file, struct cpt_context *ctx) ++{ ++ struct tty_struct * tty; ++ struct fasync_struct *fa; ++ ++ tty = (struct tty_struct *)file->private_data; ++ ++ for (fa = tty->fasync; fa; fa = fa->fa_next) { ++ if (fa->fa_file == file) ++ return fa->fa_fd; ++ } ++ return -1; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_ubc.c debian/binary-custom.d/openvz/src/kernel/cpt/cpt_ubc.c +--- ./kernel/cpt/cpt_ubc.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_ubc.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,132 @@ ++/* ++ * ++ * kernel/cpt/cpt_ubc.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++ ++cpt_object_t *cpt_add_ubc(struct user_beancounter *bc, struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ obj = cpt_object_add(CPT_OBJ_UBC, bc, ctx); ++ if (obj != NULL) { ++ if (obj->o_count == 1) ++ get_beancounter(bc); ++ if (bc->parent != NULL && obj->o_parent == NULL) ++ obj->o_parent = cpt_add_ubc(bc->parent, ctx); ++ } ++ return obj; ++} ++ ++__u64 cpt_lookup_ubc(struct user_beancounter *bc, struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ obj = lookup_cpt_object(CPT_OBJ_UBC, bc, ctx); ++ if (obj == NULL) { ++ char buf[48]; ++ print_ub_uid(bc, buf, sizeof(buf)); ++ eprintk("CPT: unknown ub %s (%p)\n", buf, bc); ++ dump_stack(); ++ return CPT_NULL; ++ } ++ return obj->o_pos; ++} ++ ++static void dump_one_bc_parm(struct cpt_ubparm *dmp, struct ubparm *prm, ++ int held) ++{ ++ dmp->barrier = (prm->barrier < UB_MAXVALUE ? prm->barrier : CPT_NULL); ++ dmp->limit = (prm->limit < UB_MAXVALUE ? prm->limit : CPT_NULL); ++ dmp->held = (held ? prm->held : CPT_NULL); ++ dmp->maxheld = prm->maxheld; ++ dmp->minheld = prm->minheld; ++ dmp->failcnt = prm->failcnt; ++} ++ ++static int dump_one_bc(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct user_beancounter *bc; ++ struct cpt_beancounter_image *v; ++ int i; ++ ++ bc = obj->o_obj; ++ v = cpt_get_buf(ctx); ++ ++ v->cpt_next = CPT_NULL; ++ v->cpt_object = CPT_OBJ_UBC; ++ v->cpt_hdrlen = sizeof(*v); ++ v->cpt_content = CPT_CONTENT_VOID; ++ ++ if (obj->o_parent != NULL) ++ v->cpt_parent = ((cpt_object_t *)obj->o_parent)->o_pos; ++ else ++ v->cpt_parent = CPT_NULL; ++ v->cpt_id = (obj->o_parent != NULL) ? bc->ub_uid : 0; ++ for (i = 0; i < UB_RESOURCES; i++) { ++ dump_one_bc_parm(v->cpt_parms + i * 2, bc->ub_parms + i, 0); ++ dump_one_bc_parm(v->cpt_parms + i * 2 + 1, bc->ub_store + i, 1); ++ } ++ memset(v->cpt_parms + UB_RESOURCES * 2, 0, ++ sizeof(v->cpt_parms) ++ - UB_RESOURCES * 2 * sizeof(v->cpt_parms[0])); ++ ++ cpt_open_object(obj, ctx); ++ ctx->write(v, sizeof(*v), ctx); ++ cpt_close_object(ctx); ++ ++ cpt_release_buf(ctx); ++ return 0; ++} ++ ++int cpt_dump_ubc(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ int skipped; ++ int top; ++ ++ cpt_open_section(ctx, CPT_SECT_UBC); ++ ++ do { ++ skipped = 0; ++ top = 0; ++ for_each_object(obj, CPT_OBJ_UBC) { ++ if (obj->o_parent == NULL) ++ top++; ++ if (obj->o_pos != CPT_NULL) ++ continue; ++ if (obj->o_parent != NULL && ++ ((cpt_object_t *)obj->o_parent)->o_pos == CPT_NULL) ++ skipped++; ++ else ++ dump_one_bc(obj, ctx); ++ } ++ } while (skipped && (top < 2)); ++ ++ cpt_close_section(ctx); ++ if (top > 1) { ++ eprintk_ctx("More than one top level ub exist"); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++void cpt_finish_ubc(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_UBC) ++ put_beancounter(obj->o_obj); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_ubc.h debian/binary-custom.d/openvz/src/kernel/cpt/cpt_ubc.h +--- ./kernel/cpt/cpt_ubc.h 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_ubc.h 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,23 @@ ++#ifdef CONFIG_BEANCOUNTERS ++cpt_object_t *cpt_add_ubc(struct user_beancounter *bc, struct cpt_context *ctx); ++__u64 cpt_lookup_ubc(struct user_beancounter *bc, struct cpt_context *ctx); ++int cpt_dump_ubc(struct cpt_context *ctx); ++ ++struct user_beancounter *rst_lookup_ubc(__u64 pos, struct cpt_context *ctx); ++int rst_undump_ubc(struct cpt_context *ctx); ++ ++void cpt_finish_ubc(struct cpt_context *ctx); ++void rst_finish_ubc(struct cpt_context *ctx); ++void copy_one_ubparm(struct ubparm *from, struct ubparm *to, int bc_parm_id); ++void set_one_ubparm_to_max(struct ubparm *ubprm, int bc_parm_id); ++#else ++static int inline cpt_dump_ubc(struct cpt_context *ctx) ++{ return 0; } ++static int inline rst_undump_ubc(struct cpt_context *ctx) ++{ return 0; } ++static void inline cpt_finish_ubc(struct cpt_context *ctx) ++{ return; } ++static void inline rst_finish_ubc(struct cpt_context *ctx) ++{ return; } ++#endif ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/cpt_x8664.S debian/binary-custom.d/openvz/src/kernel/cpt/cpt_x8664.S +--- ./kernel/cpt/cpt_x8664.S 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/cpt_x8664.S 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,67 @@ ++#define ASSEMBLY 1 ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ .code64 ++ ++ .macro FAKE_STACK_FRAME child_rip ++ /* push in order ss, rsp, eflags, cs, rip */ ++ xorq %rax, %rax ++ pushq %rax /* ss */ ++ pushq %rax /* rsp */ ++ pushq $(1<<9) /* eflags - interrupts on */ ++ pushq $__KERNEL_CS /* cs */ ++ pushq \child_rip /* rip */ ++ pushq %rax /* orig rax */ ++ .endm ++ ++ .macro UNFAKE_STACK_FRAME ++ addq $8*6, %rsp ++ .endm ++ ++ENTRY(asm_kernel_thread) ++ CFI_STARTPROC ++ FAKE_STACK_FRAME $child_rip ++ SAVE_ALL ++ ++ # rdi: flags, rsi: usp, rdx: will be &pt_regs ++ movq %rdx,%rdi ++ orq $0x00800000,%rdi ++ movq $-1, %rsi ++ movq %rsp, %rdx ++ ++ xorl %r8d,%r8d ++ xorl %r9d,%r9d ++ pushq %rcx ++ call do_fork_pid ++ addq $8, %rsp ++ /* call do_fork */ ++ movq %rax,RAX(%rsp) ++ xorl %edi,%edi ++ RESTORE_ALL ++ UNFAKE_STACK_FRAME ++ ret ++ CFI_ENDPROC ++ENDPROC(asm_kernel_thread) ++ ++child_rip: ++ pushq $0 # fake return address ++ CFI_STARTPROC ++ movq %rdi, %rax ++ movq %rsi, %rdi ++ call *%rax ++ movq %rax, %rdi ++ call do_exit ++ CFI_ENDPROC ++ENDPROC(child_rip) ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_conntrack.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_conntrack.c +--- ./kernel/cpt/rst_conntrack.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_conntrack.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,279 @@ ++/* ++ * ++ * kernel/cpt/rst_conntrack.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#if defined(CONFIG_VE_IPTABLES) && \ ++ (defined(CONFIG_IP_NF_CONNTRACK) || defined(CONFIG_IP_NF_CONNTRACK_MODULE)) ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define ASSERT_READ_LOCK(x) do { } while (0) ++#define ASSERT_WRITE_LOCK(x) do { } while (0) ++ ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++ ++struct ct_holder ++{ ++ struct ct_holder *next; ++ struct ip_conntrack *ct; ++ int index; ++}; ++ ++static void decode_tuple(struct cpt_ipct_tuple *v, struct ip_conntrack_tuple *tuple, int dir) ++{ ++ tuple->dst.ip = v->cpt_dst; ++ tuple->dst.u.all = v->cpt_dstport; ++ tuple->dst.protonum = v->cpt_protonum; ++ tuple->dst.dir = v->cpt_dir; ++ if (dir != tuple->dst.dir) ++ wprintk("dir != tuple->dst.dir\n"); ++ ++ tuple->src.ip = v->cpt_src; ++ tuple->src.u.all = v->cpt_srcport; ++} ++ ++ ++static int undump_expect_list(struct ip_conntrack *ct, ++ struct cpt_ip_conntrack_image *ci, ++ loff_t pos, struct ct_holder *ct_list, ++ cpt_context_t *ctx) ++{ ++ loff_t end; ++ int err; ++ ++ end = pos + ci->cpt_next; ++ pos += ci->cpt_hdrlen; ++ while (pos < end) { ++ struct cpt_ip_connexpect_image v; ++ struct ip_conntrack_expect *exp; ++ struct ip_conntrack *sibling; ++ ++ err = rst_get_object(CPT_OBJ_NET_CONNTRACK_EXPECT, pos, &v, ctx); ++ if (err) ++ return err; ++ ++ sibling = NULL; ++ if (v.cpt_sibling_conntrack) { ++ struct ct_holder *c; ++ ++ for (c = ct_list; c; c = c->next) { ++ if (c->index == v.cpt_sibling_conntrack) { ++ sibling = c->ct; ++ break; ++ } ++ } ++ if (!sibling) { ++ eprintk_ctx("lost sibling of expectation\n"); ++ return -EINVAL; ++ } ++ } ++ ++ write_lock_bh(&ip_conntrack_lock); ++ ++ /* It is possible. Helper module could be just unregistered, ++ * if expectation were on the list, it would be destroyed. */ ++ if (ct->helper == NULL) { ++ write_unlock_bh(&ip_conntrack_lock); ++ dprintk_ctx("conntrack: no helper and non-trivial expectation\n"); ++ continue; ++ } ++ ++ exp = ip_conntrack_expect_alloc(NULL); ++ if (exp == NULL) { ++ write_unlock_bh(&ip_conntrack_lock); ++ return -ENOMEM; ++ } ++ ++ decode_tuple(&v.cpt_tuple, &exp->tuple, 0); ++ decode_tuple(&v.cpt_mask, &exp->mask, 0); ++ ++ exp->master = ct; ++ nf_conntrack_get(&ct->ct_general); ++ ip_conntrack_expect_insert(exp); ++#if 0 ++ if (sibling) { ++ exp->sibling = sibling; ++ sibling->master = exp; ++ LIST_DELETE(&ve_ip_conntrack_expect_list, exp); ++ ct->expecting--; ++ nf_conntrack_get(&master_ct(sibling)->infos[0]); ++ } else ++#endif ++ if (ct->helper->timeout) { ++ mod_timer(&exp->timeout, jiffies + v.cpt_timeout); ++ } ++ write_unlock_bh(&ip_conntrack_lock); ++ ++ pos += v.cpt_next; ++ } ++ return 0; ++} ++ ++static int undump_one_ct(struct cpt_ip_conntrack_image *ci, loff_t pos, ++ struct ct_holder **ct_list, cpt_context_t *ctx) ++{ ++ int err = 0; ++ struct ip_conntrack *conntrack; ++ struct ct_holder *c; ++ struct ip_conntrack_tuple orig, repl; ++ ++ c = kmalloc(sizeof(struct ct_holder), GFP_KERNEL); ++ if (c == NULL) ++ return -ENOMEM; ++ ++ decode_tuple(&ci->cpt_tuple[0], &orig, 0); ++ decode_tuple(&ci->cpt_tuple[1], &repl, 1); ++ ++ conntrack = ip_conntrack_alloc(&orig, &repl, get_exec_env()->_ip_conntrack->ub); ++ if (!conntrack || IS_ERR(conntrack)) { ++ kfree(c); ++ return -ENOMEM; ++ } ++ ++ c->ct = conntrack; ++ c->next = *ct_list; ++ *ct_list = c; ++ c->index = ci->cpt_index; ++ ++ decode_tuple(&ci->cpt_tuple[0], &conntrack->tuplehash[0].tuple, 0); ++ decode_tuple(&ci->cpt_tuple[1], &conntrack->tuplehash[1].tuple, 1); ++ ++ conntrack->status = ci->cpt_status; ++ ++ memcpy(&conntrack->proto, ci->cpt_proto_data, sizeof(conntrack->proto)); ++ memcpy(&conntrack->help, ci->cpt_help_data, sizeof(conntrack->help)); ++ ++#if defined(CONFIG_IP_NF_CONNTRACK_MARK) ++ conntrack->mark = ci->cpt_mark; ++#endif ++ ++#ifdef CONFIG_IP_NF_NAT_NEEDED ++#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ ++ defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) ++ conntrack->nat.masq_index = ci->cpt_masq_index; ++#endif ++ if (ci->cpt_initialized) { ++ conntrack->nat.info.seq[0].correction_pos = ci->cpt_nat_seq[0].cpt_correction_pos; ++ conntrack->nat.info.seq[0].offset_before = ci->cpt_nat_seq[0].cpt_offset_before; ++ conntrack->nat.info.seq[0].offset_after = ci->cpt_nat_seq[0].cpt_offset_after; ++ conntrack->nat.info.seq[1].correction_pos = ci->cpt_nat_seq[1].cpt_correction_pos; ++ conntrack->nat.info.seq[1].offset_before = ci->cpt_nat_seq[1].cpt_offset_before; ++ conntrack->nat.info.seq[1].offset_after = ci->cpt_nat_seq[1].cpt_offset_after; ++ } ++ if (conntrack->status & IPS_NAT_DONE_MASK) ++ ip_nat_hash_conntrack(conntrack); ++#endif ++ ++ if (ci->cpt_ct_helper) { ++ conntrack->helper = ip_conntrack_helper_find_get(&conntrack->tuplehash[1].tuple); ++ if (conntrack->helper == NULL) { ++ eprintk_ctx("conntrack: cannot find helper, some module is not loaded\n"); ++ err = -EINVAL; ++ } ++ } ++ ++ ip_conntrack_hash_insert(conntrack); ++ conntrack->timeout.expires = jiffies + ci->cpt_timeout; ++ ++ if (err == 0 && ci->cpt_next > ci->cpt_hdrlen) ++ err = undump_expect_list(conntrack, ci, pos, *ct_list, ctx); ++ ++ return err; ++} ++ ++int rst_restore_ip_conntrack(struct cpt_context * ctx) ++{ ++ int err = 0; ++ loff_t sec = ctx->sections[CPT_SECT_NET_CONNTRACK]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ struct cpt_ip_conntrack_image ci; ++ struct ct_holder *c; ++ struct ct_holder *ct_list = NULL; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ if (sizeof(ci.cpt_proto_data) != sizeof(union ip_conntrack_proto)) { ++ eprintk_ctx("conntrack module ct->proto version mismatch\n"); ++ return -EINVAL; ++ } ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_NET_CONNTRACK || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ err = rst_get_object(CPT_OBJ_NET_CONNTRACK, sec, &ci, ctx); ++ if (err) ++ break; ++ err = undump_one_ct(&ci, sec, &ct_list, ctx); ++ if (err) ++ break; ++ sec += ci.cpt_next; ++ } ++ ++ while ((c = ct_list) != NULL) { ++ ct_list = c->next; ++ if (c->ct) ++ add_timer(&c->ct->timeout); ++ kfree(c); ++ } ++ ++ return err; ++} ++ ++#else ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++ ++int rst_restore_ip_conntrack(struct cpt_context * ctx) ++{ ++ if (ctx->sections[CPT_SECT_NET_CONNTRACK] != CPT_NULL) ++ return -EINVAL; ++ return 0; ++} ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_context.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_context.c +--- ./kernel/cpt/rst_context.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_context.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,323 @@ ++/* ++ * ++ * kernel/cpt/rst_context.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++ ++static ssize_t file_read(void *addr, size_t count, struct cpt_context *ctx) ++{ ++ mm_segment_t oldfs; ++ ssize_t err = -EBADF; ++ struct file *file = ctx->file; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if (file) ++ err = file->f_op->read(file, addr, count, &file->f_pos); ++ set_fs(oldfs); ++ if (err != count) ++ return err >= 0 ? -EIO : err; ++ return 0; ++} ++ ++static ssize_t file_pread(void *addr, size_t count, struct cpt_context *ctx, loff_t pos) ++{ ++ mm_segment_t oldfs; ++ ssize_t err = -EBADF; ++ struct file *file = ctx->file; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if (file) ++ err = file->f_op->read(file, addr, count, &pos); ++ set_fs(oldfs); ++ if (err != count) ++ return err >= 0 ? -EIO : err; ++ return 0; ++} ++ ++static void file_align(struct cpt_context *ctx) ++{ ++ struct file *file = ctx->file; ++ ++ if (file) ++ file->f_pos = CPT_ALIGN(file->f_pos); ++} ++ ++int rst_get_section(int type, struct cpt_context *ctx, loff_t *start, loff_t *end) ++{ ++ struct cpt_section_hdr hdr; ++ int err; ++ loff_t pos; ++ ++ pos = ctx->sections[type]; ++ *start = *end = pos; ++ ++ if (pos != CPT_NULL) { ++ if ((err = ctx->pread(&hdr, sizeof(hdr), ctx, pos)) != 0) ++ return err; ++ if (hdr.cpt_section != type || hdr.cpt_hdrlen < sizeof(hdr)) ++ return -EINVAL; ++ *start = pos + hdr.cpt_hdrlen; ++ *end = pos + hdr.cpt_next; ++ } ++ return 0; ++} ++EXPORT_SYMBOL(rst_get_section); ++ ++void rst_context_init(struct cpt_context *ctx) ++{ ++ int i; ++ ++ memset(ctx, 0, sizeof(*ctx)); ++ ++ init_MUTEX(&ctx->main_sem); ++ ctx->refcount = 1; ++ ++ ctx->current_section = -1; ++ ctx->current_object = -1; ++ ctx->pagesize = PAGE_SIZE; ++ ctx->read = file_read; ++ ctx->pread = file_pread; ++ ctx->align = file_align; ++ for (i=0; i < CPT_SECT_MAX; i++) ++ ctx->sections[i] = CPT_NULL; ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ init_completion(&ctx->pgin_notify); ++#endif ++ cpt_object_init(ctx); ++} ++ ++static int parse_sections(loff_t start, loff_t end, cpt_context_t *ctx) ++{ ++ struct cpt_section_hdr h; ++ ++ while (start < end) { ++ int err; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, start); ++ if (err) ++ return err; ++ if (h.cpt_hdrlen < sizeof(h) || ++ h.cpt_next < h.cpt_hdrlen || ++ start + h.cpt_next > end) ++ return -EINVAL; ++ if (h.cpt_section >= CPT_SECT_MAX) ++ return -EINVAL; ++ ctx->sections[h.cpt_section] = start; ++ start += h.cpt_next; ++ } ++ return 0; ++} ++ ++int rst_open_dumpfile(struct cpt_context *ctx) ++{ ++ int err; ++ struct cpt_major_tail *v; ++ struct cpt_major_hdr h; ++ unsigned long size; ++ ++ err = -EBADF; ++ if (!ctx->file) ++ goto err_out; ++ ++ err = -ENOMEM; ++ ctx->tmpbuf = (char*)__get_free_page(GFP_KERNEL); ++ if (ctx->tmpbuf == NULL) ++ goto err_out; ++ __cpt_release_buf(ctx); ++ ++ size = ctx->file->f_dentry->d_inode->i_size; ++ ++ if (size & 7) { ++ err = -EINVAL; ++ goto err_out; ++ } ++ if (size < sizeof(struct cpt_major_hdr) + ++ sizeof(struct cpt_major_tail)) { ++ err = -EINVAL; ++ goto err_out; ++ } ++ err = ctx->pread(&h, sizeof(h), ctx, 0); ++ if (err) { ++ eprintk_ctx("too short image 1 %d\n", err); ++ goto err_out; ++ } ++ if (h.cpt_signature[0] != CPT_SIGNATURE0 || ++ h.cpt_signature[1] != CPT_SIGNATURE1 || ++ h.cpt_signature[2] != CPT_SIGNATURE2 || ++ h.cpt_signature[3] != CPT_SIGNATURE3) { ++ err = -EINVAL; ++ goto err_out; ++ } ++ if (h.cpt_hz != HZ) { ++ err = -EINVAL; ++ eprintk_ctx("HZ mismatch: %d != %d\n", h.cpt_hz, HZ); ++ goto err_out; ++ } ++ ctx->virt_jiffies64 = h.cpt_start_jiffies64; ++ ctx->start_time.tv_sec = h.cpt_start_sec; ++ ctx->start_time.tv_nsec = h.cpt_start_nsec; ++ ctx->kernel_config_flags = h.cpt_kernel_config[0]; ++ ctx->iptables_mask = h.cpt_iptables_mask; ++ if (h.cpt_image_version > CPT_VERSION_20 || ++ CPT_VERSION_MINOR(h.cpt_image_version) > 1) { ++ eprintk_ctx("Unknown image version: %x. Can't restore.\n", ++ h.cpt_image_version); ++ err = -EINVAL; ++ goto err_out; ++ } ++ ctx->image_version = h.cpt_image_version; ++ ctx->features = (__u64)((__u64)h.cpt_ve_features2<<32 | h.cpt_ve_features); ++ ctx->image_arch = h.cpt_os_arch; ++ ++ v = cpt_get_buf(ctx); ++ err = ctx->pread(v, sizeof(*v), ctx, size - sizeof(*v)); ++ if (err) { ++ eprintk_ctx("too short image 2 %d\n", err); ++ cpt_release_buf(ctx); ++ goto err_out; ++ } ++ if (v->cpt_signature[0] != CPT_SIGNATURE0 || ++ v->cpt_signature[1] != CPT_SIGNATURE1 || ++ v->cpt_signature[2] != CPT_SIGNATURE2 || ++ v->cpt_signature[3] != CPT_SIGNATURE3 || ++ v->cpt_nsect != CPT_SECT_MAX_INDEX) { ++ err = -EINVAL; ++ cpt_release_buf(ctx); ++ goto err_out; ++ } ++ if ((err = parse_sections(h.cpt_hdrlen, size - sizeof(*v) - sizeof(struct cpt_section_hdr), ctx)) < 0) { ++ cpt_release_buf(ctx); ++ goto err_out; ++ } ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ ctx->lazypages = v->cpt_lazypages; ++#endif ++ ctx->tasks64 = v->cpt_64bit; ++ cpt_release_buf(ctx); ++ return 0; ++ ++err_out: ++ if (ctx->tmpbuf) { ++ free_page((unsigned long)ctx->tmpbuf); ++ ctx->tmpbuf = NULL; ++ } ++ return err; ++} ++ ++void rst_close_dumpfile(struct cpt_context *ctx) ++{ ++ if (ctx->file) { ++ fput(ctx->file); ++ ctx->file = NULL; ++ } ++ if (ctx->tmpbuf) { ++ free_page((unsigned long)ctx->tmpbuf); ++ ctx->tmpbuf = NULL; ++ } ++} ++ ++int _rst_get_object(int type, loff_t pos, void *tmp, int size, struct cpt_context *ctx) ++{ ++ int err; ++ struct cpt_object_hdr *hdr = tmp; ++ err = ctx->pread(hdr, sizeof(struct cpt_object_hdr), ctx, pos); ++ if (err) ++ return err; ++ if (type > 0 && type != hdr->cpt_object) ++ return -EINVAL; ++ if (hdr->cpt_hdrlen > hdr->cpt_next) ++ return -EINVAL; ++ if (hdr->cpt_hdrlen < sizeof(struct cpt_object_hdr)) ++ return -EINVAL; ++ if (size < sizeof(*hdr)) ++ return -EINVAL; ++ if (size > hdr->cpt_hdrlen) ++ size = hdr->cpt_hdrlen; ++ if (size > sizeof(*hdr)) ++ err = ctx->pread(hdr+1, size - sizeof(*hdr), ++ ctx, pos + sizeof(*hdr)); ++ return err; ++} ++EXPORT_SYMBOL(_rst_get_object); ++ ++void * __rst_get_object(int type, loff_t pos, struct cpt_context *ctx) ++{ ++ int err; ++ void *tmp; ++ struct cpt_object_hdr hdr; ++ err = ctx->pread(&hdr, sizeof(hdr), ctx, pos); ++ if (err) ++ return NULL; ++ if (type > 0 && type != hdr.cpt_object) ++ return NULL; ++ if (hdr.cpt_hdrlen > hdr.cpt_next) ++ return NULL; ++ if (hdr.cpt_hdrlen < sizeof(struct cpt_object_hdr)) ++ return NULL; ++ tmp = kmalloc(hdr.cpt_hdrlen, GFP_KERNEL); ++ if (!tmp) ++ return NULL; ++ err = ctx->pread(tmp, hdr.cpt_hdrlen, ctx, pos); ++ if (!err) ++ return tmp; ++ kfree(tmp); ++ return NULL; ++} ++EXPORT_SYMBOL(__rst_get_object); ++ ++__u8 *__rst_get_name(loff_t *pos_p, struct cpt_context *ctx) ++{ ++ int err; ++ struct cpt_object_hdr hdr; ++ __u8 *name; ++ ++ err = rst_get_object(CPT_OBJ_NAME, *pos_p, &hdr, ctx); ++ if (err) ++ return NULL; ++ if (hdr.cpt_next - hdr.cpt_hdrlen > PAGE_SIZE) ++ return NULL; ++ name = (void*)__get_free_page(GFP_KERNEL); ++ if (!name) ++ return NULL; ++ err = ctx->pread(name, hdr.cpt_next - hdr.cpt_hdrlen, ++ ctx, *pos_p + hdr.cpt_hdrlen); ++ if (err) { ++ free_page((unsigned long)name); ++ return NULL; ++ } ++ *pos_p += hdr.cpt_next; ++ return name; ++} ++ ++__u8 *rst_get_name(loff_t pos, struct cpt_context *ctx) ++{ ++ return __rst_get_name(&pos, ctx); ++} ++ ++void rst_put_name(__u8 *name, struct cpt_context *ctx) ++{ ++ unsigned long addr = (unsigned long)name; ++ ++ if (addr) ++ free_page(addr&~(PAGE_SIZE-1)); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_epoll.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_epoll.c +--- ./kernel/cpt/rst_epoll.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_epoll.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,169 @@ ++/* ++ * ++ * kernel/cpt/rst_epoll.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_files.h" ++#include "cpt_kernel.h" ++#include "cpt_fsmagic.h" ++#include "cpt_syscalls.h" ++ ++/* Those funcations are static in fs/eventpoll.c */ ++extern int ep_insert(struct eventpoll *ep, struct epoll_event *event, ++ struct file *tfile, int fd); ++extern struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd); ++extern void ep_release_epitem(struct epitem *epi); ++ ++ ++struct file *cpt_open_epolldev(struct cpt_file_image *fi, ++ unsigned flags, ++ struct cpt_context *ctx) ++{ ++ struct file *file; ++ int efd; ++ ++ /* Argument "size" is ignored, use just 1 */ ++ efd = sys_epoll_create(1); ++ if (efd < 0) ++ return ERR_PTR(efd); ++ ++ file = fget(efd); ++ sys_close(efd); ++ return file; ++} ++ ++static int restore_one_epoll(cpt_object_t *obj, ++ loff_t pos, ++ struct cpt_epoll_image *ebuf, ++ cpt_context_t *ctx) ++{ ++ int err = 0; ++ loff_t endpos; ++ struct file *file = obj->o_obj; ++ struct eventpoll *ep; ++ ++ if (file->f_op != &eventpoll_fops) { ++ eprintk_ctx("bad epoll file\n"); ++ return -EINVAL; ++ } ++ ++ ep = file->private_data; ++ ++ if (unlikely(ep == NULL)) { ++ eprintk_ctx("bad epoll device\n"); ++ return -EINVAL; ++ } ++ ++ endpos = pos + ebuf->cpt_next; ++ pos += ebuf->cpt_hdrlen; ++ while (pos < endpos) { ++ struct cpt_epoll_file_image efi; ++ struct epoll_event epds; ++ ++ cpt_object_t *tobj; ++ ++ err = rst_get_object(CPT_OBJ_EPOLL_FILE, pos, &efi, ctx); ++ if (err) ++ return err; ++ tobj = lookup_cpt_obj_bypos(CPT_OBJ_FILE, efi.cpt_file, ctx); ++ if (!tobj) { ++ eprintk_ctx("epoll file not found\n"); ++ return -EINVAL; ++ } ++ epds.events = efi.cpt_events; ++ epds.data = efi.cpt_data; ++ mutex_lock(&ep->mtx); ++ err = ep_insert(ep, &epds, tobj->o_obj, efi.cpt_fd); ++ if (!err) { ++ struct epitem *epi; ++ epi = ep_find(ep, tobj->o_obj, efi.cpt_fd); ++ if (epi) { ++ if (efi.cpt_ready) { ++ unsigned long flags; ++ spin_lock_irqsave(&ep->lock, flags); ++ if (list_empty(&epi->rdllink)) ++ list_add_tail(&epi->rdllink, &ep->rdllist); ++ spin_unlock_irqrestore(&ep->lock, flags); ++ } ++ } ++ } ++ mutex_unlock(&ep->mtx); ++ if (err) ++ break; ++ pos += efi.cpt_next; ++ } ++ return err; ++} ++ ++int rst_eventpoll(cpt_context_t *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_EPOLL]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_EPOLL || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ cpt_object_t *obj; ++ struct cpt_epoll_image *ebuf = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_EPOLL, sec, ebuf, ctx); ++ if (err) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_FILE, ebuf->cpt_file, ctx); ++ if (obj == NULL) { ++ eprintk_ctx("cannot find epoll file object\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ err = restore_one_epoll(obj, sec, ebuf, ctx); ++ cpt_release_buf(ctx); ++ if (err) ++ return err; ++ sec += ebuf->cpt_next; ++ } ++ ++ return 0; ++ ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_files.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_files.c +--- ./kernel/cpt/rst_files.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_files.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,1680 @@ ++/* ++ * ++ * kernel/cpt/rst_files.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_files.h" ++#include "cpt_kernel.h" ++#include "cpt_fsmagic.h" ++ ++#include "cpt_syscalls.h" ++ ++ ++struct filejob { ++ struct filejob *next; ++ int pid; ++ loff_t fdi; ++}; ++ ++static int rst_filejob_queue(loff_t pos, cpt_context_t *ctx) ++{ ++ struct filejob *j; ++ ++ j = kmalloc(sizeof(*j), GFP_KERNEL); ++ if (j == NULL) ++ return -ENOMEM; ++ j->pid = current->pid; ++ j->fdi = pos; ++ j->next = ctx->filejob_queue; ++ ctx->filejob_queue = j; ++ return 0; ++} ++ ++static void _anon_pipe_buf_release(struct pipe_inode_info *pipe, ++ struct pipe_buffer *buf) ++{ ++ struct page *page = buf->page; ++ ++ /* ++ * If nobody else uses this page, and we don't already have a ++ * temporary page, let's keep track of it as a one-deep ++ * allocation cache. (Otherwise just release our reference to it) ++ */ ++ if (page_count(page) == 1 && !pipe->tmp_page) ++ pipe->tmp_page = page; ++ else ++ page_cache_release(page); ++ ++ module_put(THIS_MODULE); ++} ++ ++static void *_anon_pipe_buf_map(struct pipe_inode_info *pipe, ++ struct pipe_buffer *buf, int atomic) ++{ ++ if (atomic) { ++ buf->flags |= PIPE_BUF_FLAG_ATOMIC; ++ return kmap_atomic(buf->page, KM_USER0); ++ } ++ ++ return kmap(buf->page); ++} ++ ++static void _anon_pipe_buf_unmap(struct pipe_inode_info *pipe, ++ struct pipe_buffer *buf, void *map_data) ++{ ++ if (buf->flags & PIPE_BUF_FLAG_ATOMIC) { ++ buf->flags &= ~PIPE_BUF_FLAG_ATOMIC; ++ kunmap_atomic(map_data, KM_USER0); ++ } else ++ kunmap(buf->page); ++} ++ ++static int _anon_pipe_buf_steal(struct pipe_inode_info *pipe, ++ struct pipe_buffer *buf) ++{ ++ struct page *page = buf->page; ++ ++ if (page_count(page) == 1) { ++ lock_page(page); ++ return 0; ++ } ++ ++ return 1; ++} ++ ++static void _anon_pipe_buf_get(struct pipe_inode_info *info, struct pipe_buffer *buf) ++{ ++ page_cache_get(buf->page); ++} ++ ++static int _anon_pipe_buf_confirm(struct pipe_inode_info *info, struct pipe_buffer *buf) ++{ ++ return 0; ++} ++ ++static struct pipe_buf_operations _anon_pipe_buf_ops = { ++ .can_merge = 1, ++ .map = _anon_pipe_buf_map, ++ .unmap = _anon_pipe_buf_unmap, ++ .release = _anon_pipe_buf_release, ++ .confirm = _anon_pipe_buf_confirm, ++ .get = _anon_pipe_buf_get, ++ .steal = _anon_pipe_buf_steal, ++}; ++ ++/* Sorta ugly... Multiple readers/writers of named pipe rewrite buffer ++ * many times. We need to mark it in CPT_OBJ_INODE table in some way. ++ */ ++static int fixup_pipe_data(struct file *file, struct cpt_file_image *fi, ++ struct cpt_context *ctx) ++{ ++ struct inode *ino = file->f_dentry->d_inode; ++ struct cpt_inode_image ii; ++ struct cpt_obj_bits b; ++ struct pipe_inode_info *info; ++ int err; ++ int count; ++ ++ if (!S_ISFIFO(ino->i_mode)) { ++ eprintk_ctx("fixup_pipe_data: not a pipe %Ld\n", (long long)fi->cpt_inode); ++ return -EINVAL; ++ } ++ if (fi->cpt_inode == CPT_NULL) ++ return 0; ++ ++ err = rst_get_object(CPT_OBJ_INODE, fi->cpt_inode, &ii, ctx); ++ if (err) ++ return err; ++ ++ if (ii.cpt_next <= ii.cpt_hdrlen) ++ return 0; ++ ++ err = rst_get_object(CPT_OBJ_BITS, fi->cpt_inode + ii.cpt_hdrlen, &b, ctx); ++ if (err) ++ return err; ++ ++ if (b.cpt_size == 0) ++ return 0; ++ ++ mutex_lock(&ino->i_mutex); ++ info = ino->i_pipe; ++ if (info->nrbufs) { ++ mutex_unlock(&ino->i_mutex); ++ eprintk("pipe buffer is restored already\n"); ++ return -EINVAL; ++ } ++ info->curbuf = 0; ++ count = 0; ++ while (count < b.cpt_size) { ++ struct pipe_buffer *buf = info->bufs + info->nrbufs; ++ void * addr; ++ int chars; ++ ++ chars = b.cpt_size - count; ++ if (chars > PAGE_SIZE) ++ chars = PAGE_SIZE; ++ if (!try_module_get(THIS_MODULE)) { ++ err = -EBUSY; ++ break; ++ } ++ ++ buf->page = alloc_page(GFP_HIGHUSER); ++ if (buf->page == NULL) { ++ err = -ENOMEM; ++ break; ++ } ++ buf->ops = &_anon_pipe_buf_ops; ++ buf->offset = 0; ++ buf->len = chars; ++ info->nrbufs++; ++ addr = kmap(buf->page); ++ err = ctx->pread(addr, chars, ctx, ++ fi->cpt_inode + ii.cpt_hdrlen + b.cpt_hdrlen + count); ++ if (err) ++ break; ++ count += chars; ++ } ++ mutex_unlock(&ino->i_mutex); ++ ++ return err; ++} ++ ++static int make_flags(struct cpt_file_image *fi) ++{ ++ int flags = O_NOFOLLOW; ++ switch (fi->cpt_mode&(FMODE_READ|FMODE_WRITE)) { ++ case FMODE_READ|FMODE_WRITE: ++ flags |= O_RDWR; break; ++ case FMODE_WRITE: ++ flags |= O_WRONLY; break; ++ case FMODE_READ: ++ flags |= O_RDONLY; break; ++ default: break; ++ } ++ flags |= fi->cpt_flags&~(O_ACCMODE|O_CREAT|O_TRUNC|O_EXCL|FASYNC); ++ flags |= O_NONBLOCK|O_NOCTTY; ++ return flags; ++} ++ ++static struct file *open_pipe(char *name, ++ struct cpt_file_image *fi, ++ unsigned flags, ++ struct cpt_context *ctx) ++{ ++ int err; ++ cpt_object_t *obj; ++ struct cpt_inode_image ii; ++ struct file *rf, *wf; ++ ++ err = rst_get_object(CPT_OBJ_INODE, fi->cpt_inode, &ii, ctx); ++ if (err) ++ return ERR_PTR(err); ++ ++ if (ii.cpt_sb == FSMAGIC_PIPEFS) { ++ int pfd[2]; ++ ++ if ((err = sc_pipe(pfd)) < 0) ++ return ERR_PTR(err); ++ ++ rf = fcheck(pfd[0]); ++ wf = fcheck(pfd[1]); ++ get_file(rf); ++ get_file(wf); ++ sc_close(pfd[0]); ++ sc_close(pfd[1]); ++ ++ if (fi->cpt_mode&FMODE_READ) { ++ struct file *tf; ++ tf = wf; wf = rf; rf = tf; ++ } ++ } else { ++ if (fi->cpt_mode&FMODE_READ) { ++ rf = filp_open(name, flags, 0); ++ if (IS_ERR(rf)) { ++ dprintk_ctx("filp_open\n"); ++ return rf; ++ } ++ dprintk_ctx(CPT_FID "open RDONLY fifo ino %Ld %p %x\n", CPT_TID(current), ++ (long long)fi->cpt_inode, rf, rf->f_dentry->d_inode->i_mode); ++ return rf; ++ } ++ ++ dprintk_ctx(CPT_FID "open WRONLY fifo ino %Ld\n", CPT_TID(current), (long long)fi->cpt_inode); ++ ++ rf = filp_open(name, O_RDWR|O_NONBLOCK, 0); ++ if (IS_ERR(rf)) ++ return rf; ++ wf = dentry_open(dget(rf->f_dentry), ++ mntget(rf->f_vfsmnt), flags); ++ } ++ ++ /* Add pipe inode to obj table. */ ++ obj = cpt_object_add(CPT_OBJ_INODE, wf->f_dentry->d_inode, ctx); ++ if (obj == NULL) { ++ fput(rf); fput(wf); ++ return ERR_PTR(-ENOMEM); ++ } ++ cpt_obj_setpos(obj, fi->cpt_inode, ctx); ++ obj->o_parent = rf; ++ ++ /* Add another side of pipe to obj table, it will not be used ++ * (o_pos = PT_NULL), another processes opeining pipe will find ++ * inode and open it with dentry_open(). */ ++ obj = cpt_object_add(CPT_OBJ_FILE, rf, ctx); ++ if (obj == NULL) { ++ fput(wf); ++ return ERR_PTR(-ENOMEM); ++ } ++ return wf; ++} ++ ++static struct file *open_special(struct cpt_file_image *fi, ++ unsigned flags, ++ int deleted, ++ struct cpt_context *ctx) ++{ ++ struct cpt_inode_image *ii; ++ struct file *file; ++ ++ /* Directories and named pipes are not special actually */ ++ if (S_ISDIR(fi->cpt_i_mode) || S_ISFIFO(fi->cpt_i_mode)) ++ return NULL; ++ ++ /* No support for block devices at the moment. */ ++ if (S_ISBLK(fi->cpt_i_mode)) ++ return ERR_PTR(-EINVAL); ++ ++ if (S_ISSOCK(fi->cpt_i_mode)) { ++ eprintk_ctx("bug: socket is not open\n"); ++ return ERR_PTR(-EINVAL); ++ } ++ ++ /* Support only (some) character devices at the moment. */ ++ if (!S_ISCHR(fi->cpt_i_mode)) ++ return ERR_PTR(-EINVAL); ++ ++ ii = __rst_get_object(CPT_OBJ_INODE, fi->cpt_inode, ctx); ++ if (ii == NULL) ++ return ERR_PTR(-ENOMEM); ++ ++ /* Do not worry about this right now. /dev/null,zero,*random are here. ++ * To prohibit at least /dev/mem? ++ */ ++ if (MAJOR(ii->cpt_rdev) == MEM_MAJOR) { ++ kfree(ii); ++ return NULL; ++ } ++ ++ /* /dev/net/tun will be opened by caller */ ++ if (fi->cpt_lflags & CPT_DENTRY_TUNTAP) { ++ kfree(ii); ++ return NULL; ++ } ++ ++ file = rst_open_tty(fi, ii, flags, ctx); ++ kfree(ii); ++ return file; ++} ++ ++static int restore_posix_lock(struct file *file, struct cpt_flock_image *fli, cpt_context_t *ctx) ++{ ++ struct file_lock lock; ++ cpt_object_t *obj; ++ ++ memset(&lock, 0, sizeof(lock)); ++ lock.fl_type = fli->cpt_type; ++ lock.fl_flags = fli->cpt_flags & ~FL_SLEEP; ++ lock.fl_start = fli->cpt_start; ++ lock.fl_end = fli->cpt_end; ++ obj = lookup_cpt_obj_byindex(CPT_OBJ_FILES, fli->cpt_owner, ctx); ++ if (!obj) { ++ eprintk_ctx("unknown lock owner %d\n", (int)fli->cpt_owner); ++ return -EINVAL; ++ } ++ lock.fl_owner = obj->o_obj; ++ lock.fl_pid = vpid_to_pid(fli->cpt_pid); ++ if (lock.fl_pid < 0) { ++ eprintk_ctx("unknown lock pid %d\n", lock.fl_pid); ++ return -EINVAL; ++ } ++ lock.fl_file = file; ++ ++ if (lock.fl_owner == NULL) ++ eprintk_ctx("no lock owner\n"); ++ return posix_lock_file(file, &lock, NULL); ++} ++ ++static int restore_flock(struct file *file, struct cpt_flock_image *fli, ++ cpt_context_t *ctx) ++{ ++ int cmd, err, fd; ++ fd = get_unused_fd(); ++ if (fd < 0) { ++ eprintk_ctx("BSD flock cannot be restored\n"); ++ return fd; ++ } ++ get_file(file); ++ fd_install(fd, file); ++ if (fli->cpt_type == F_RDLCK) { ++ cmd = LOCK_SH; ++ } else if (fli->cpt_type == F_WRLCK) { ++ cmd = LOCK_EX; ++ } else { ++ eprintk_ctx("flock flavor is unknown: %u\n", fli->cpt_type); ++ sc_close(fd); ++ return -EINVAL; ++ } ++ ++ err = sc_flock(fd, LOCK_NB | cmd); ++ sc_close(fd); ++ return err; ++} ++ ++ ++static int fixup_posix_locks(struct file *file, ++ struct cpt_file_image *fi, ++ loff_t pos, struct cpt_context *ctx) ++{ ++ int err; ++ loff_t end; ++ struct cpt_flock_image fli; ++ ++ end = pos + fi->cpt_next; ++ pos += fi->cpt_hdrlen; ++ while (pos < end) { ++ err = rst_get_object(-1, pos, &fli, ctx); ++ if (err) ++ return err; ++ if (fli.cpt_object == CPT_OBJ_FLOCK && ++ (fli.cpt_flags&FL_POSIX)) { ++ err = restore_posix_lock(file, &fli, ctx); ++ if (err) ++ return err; ++ dprintk_ctx("posix lock restored\n"); ++ } ++ pos += fli.cpt_next; ++ } ++ return 0; ++} ++ ++int rst_posix_locks(struct cpt_context *ctx) ++{ ++ int err; ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file = obj->o_obj; ++ struct cpt_file_image fi; ++ ++ if (obj->o_pos == CPT_NULL) ++ continue; ++ ++ err = rst_get_object(CPT_OBJ_FILE, obj->o_pos, &fi, ctx); ++ if (err < 0) ++ return err; ++ if (fi.cpt_next > fi.cpt_hdrlen) ++ fixup_posix_locks(file, &fi, obj->o_pos, ctx); ++ } ++ return 0; ++} ++ ++static int fixup_flocks(struct file *file, ++ struct cpt_file_image *fi, ++ loff_t pos, struct cpt_context *ctx) ++{ ++ int err; ++ loff_t end; ++ struct cpt_flock_image fli; ++ ++ end = pos + fi->cpt_next; ++ pos += fi->cpt_hdrlen; ++ while (pos < end) { ++ err = rst_get_object(-1, pos, &fli, ctx); ++ if (err) ++ return err; ++ if (fli.cpt_object == CPT_OBJ_FLOCK && ++ (fli.cpt_flags&FL_FLOCK)) { ++ err = restore_flock(file, &fli, ctx); ++ if (err) ++ return err; ++ dprintk_ctx("bsd lock restored\n"); ++ } ++ pos += fli.cpt_next; ++ } ++ return 0; ++} ++ ++ ++static int fixup_reg_data(struct file *file, loff_t pos, loff_t end, ++ struct cpt_context *ctx) ++{ ++ int err; ++ struct cpt_page_block pgb; ++ ssize_t (*do_write)(struct file *, const char __user *, size_t, loff_t *ppos); ++ ++ do_write = file->f_op->write; ++ if (do_write == NULL) { ++ eprintk_ctx("no write method. Cannot restore contents of the file.\n"); ++ return -EINVAL; ++ } ++ ++ atomic_inc(&file->f_count); ++ ++ while (pos < end) { ++ loff_t opos; ++ loff_t ipos; ++ int count; ++ ++ err = rst_get_object(CPT_OBJ_PAGES, pos, &pgb, ctx); ++ if (err) ++ goto out; ++ dprintk_ctx("restoring file data block: %08x-%08x\n", ++ (__u32)pgb.cpt_start, (__u32)pgb.cpt_end); ++ ipos = pos + pgb.cpt_hdrlen; ++ opos = pgb.cpt_start; ++ count = pgb.cpt_end-pgb.cpt_start; ++ while (count > 0) { ++ mm_segment_t oldfs; ++ int copy = count; ++ ++ if (copy > PAGE_SIZE) ++ copy = PAGE_SIZE; ++ (void)cpt_get_buf(ctx); ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ err = ctx->pread(ctx->tmpbuf, copy, ctx, ipos); ++ set_fs(oldfs); ++ if (err) { ++ __cpt_release_buf(ctx); ++ goto out; ++ } ++ if (!(file->f_mode & FMODE_WRITE) || ++ (file->f_flags&O_DIRECT)) { ++ fput(file); ++ file = dentry_open(dget(file->f_dentry), ++ mntget(file->f_vfsmnt), ++ O_WRONLY | O_LARGEFILE); ++ if (IS_ERR(file)) { ++ __cpt_release_buf(ctx); ++ return PTR_ERR(file); ++ } ++ } ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ ipos += copy; ++ err = do_write(file, ctx->tmpbuf, copy, &opos); ++ set_fs(oldfs); ++ __cpt_release_buf(ctx); ++ if (err != copy) { ++ if (err >= 0) ++ err = -EIO; ++ goto out; ++ } ++ count -= copy; ++ } ++ pos += pgb.cpt_next; ++ } ++ err = 0; ++ ++out: ++ fput(file); ++ return err; ++} ++ ++ ++static int fixup_file_content(struct file **file_p, struct cpt_file_image *fi, ++ struct cpt_inode_image *ii, ++ struct cpt_context *ctx) ++{ ++ int err; ++ struct file *file = *file_p; ++ struct iattr newattrs; ++ ++ if (!S_ISREG(fi->cpt_i_mode)) ++ return 0; ++ ++ if (file == NULL) { ++ file = shmem_file_setup("dev/zero", ii->cpt_size, 0); ++ if (IS_ERR(file)) ++ return PTR_ERR(file); ++ *file_p = file; ++ } ++ ++ if (ii->cpt_next > ii->cpt_hdrlen) { ++ struct cpt_object_hdr hdr; ++ err = ctx->pread(&hdr, sizeof(struct cpt_object_hdr), ctx, fi->cpt_inode+ii->cpt_hdrlen); ++ if (err) ++ return err; ++ if (hdr.cpt_object == CPT_OBJ_PAGES) { ++ err = fixup_reg_data(file, fi->cpt_inode+ii->cpt_hdrlen, ++ fi->cpt_inode+ii->cpt_next, ctx); ++ if (err) ++ return err; ++ } ++ } ++ ++ mutex_lock(&file->f_dentry->d_inode->i_mutex); ++ /* stage 1 - update size like do_truncate does */ ++ newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; ++ newattrs.ia_size = ii->cpt_size; ++ cpt_timespec_import(&newattrs.ia_ctime, ii->cpt_ctime); ++ err = notify_change(file->f_dentry, NULL, &newattrs); ++ if (err) ++ goto out; ++ ++ /* stage 2 - update times, owner and mode */ ++ newattrs.ia_valid = ATTR_MTIME | ATTR_ATIME | ++ ATTR_ATIME_SET | ATTR_MTIME_SET | ++ ATTR_MODE | ATTR_UID | ATTR_GID; ++ newattrs.ia_uid = ii->cpt_uid; ++ newattrs.ia_gid = ii->cpt_gid; ++ newattrs.ia_mode = file->f_dentry->d_inode->i_mode & S_IFMT; ++ newattrs.ia_mode |= (ii->cpt_mode & ~S_IFMT); ++ cpt_timespec_import(&newattrs.ia_atime, ii->cpt_atime); ++ cpt_timespec_import(&newattrs.ia_mtime, ii->cpt_mtime); ++ err = notify_change(file->f_dentry, NULL, &newattrs); ++ ++out: ++ mutex_unlock(&file->f_dentry->d_inode->i_mutex); ++ return err; ++} ++ ++static int fixup_file_flags(struct file *file, struct cpt_file_image *fi, ++ int was_dentry_open, loff_t pos, ++ cpt_context_t *ctx) ++{ ++ if (fi->cpt_pos != file->f_pos) { ++ int err = -ESPIPE; ++ if (file->f_op->llseek) ++ err = file->f_op->llseek(file, fi->cpt_pos, 0); ++ if (err < 0) { ++ dprintk_ctx("file %Ld lseek %Ld - %Ld\n", ++ (long long)pos, ++ (long long)file->f_pos, ++ (long long)fi->cpt_pos); ++ file->f_pos = fi->cpt_pos; ++ } ++ } ++ file->f_uid = fi->cpt_uid; ++ file->f_gid = fi->cpt_gid; ++ file->f_owner.pid = 0; ++ if (fi->cpt_fown_pid != CPT_FOWN_STRAY_PID) { ++ file->f_owner.pid = find_get_pid(fi->cpt_fown_pid); ++ if (file->f_owner.pid == NULL) { ++ wprintk_ctx("fixup_file_flags: owner %d does not exist anymore\n", ++ fi->cpt_fown_pid); ++ return -EINVAL; ++ } ++ } ++ file->f_owner.uid = fi->cpt_fown_uid; ++ file->f_owner.euid = fi->cpt_fown_euid; ++ file->f_owner.signum = fi->cpt_fown_signo; ++ ++ if (file->f_mode != fi->cpt_mode) { ++ if (was_dentry_open && ++ ((file->f_mode^fi->cpt_mode)&(FMODE_PREAD|FMODE_LSEEK))) { ++ file->f_mode &= ~(FMODE_PREAD|FMODE_LSEEK); ++ file->f_mode |= fi->cpt_mode&(FMODE_PREAD|FMODE_LSEEK); ++ } ++ if (file->f_mode != fi->cpt_mode) ++ wprintk_ctx("file %ld mode mismatch %08x %08x\n", (long)pos, file->f_mode, fi->cpt_mode); ++ } ++ if (file->f_flags != fi->cpt_flags) { ++ if (!(fi->cpt_flags&O_NOFOLLOW)) ++ file->f_flags &= ~O_NOFOLLOW; ++ if ((file->f_flags^fi->cpt_flags)&O_NONBLOCK) { ++ file->f_flags &= ~O_NONBLOCK; ++ file->f_flags |= fi->cpt_flags&O_NONBLOCK; ++ } ++ if (fi->cpt_flags&FASYNC) { ++ if (fi->cpt_fown_fd == -1) { ++ wprintk_ctx("No fd for FASYNC\n"); ++ return -EINVAL; ++ } else if (file->f_op && file->f_op->fasync) { ++ if (file->f_op->fasync(fi->cpt_fown_fd, file, 1) < 0) { ++ wprintk_ctx("FASYNC problem\n"); ++ return -EINVAL; ++ } else { ++ file->f_flags |= FASYNC; ++ } ++ } ++ } ++ if (file->f_flags != fi->cpt_flags) { ++ eprintk_ctx("file %ld flags mismatch %08x %08x\n", (long)pos, file->f_flags, fi->cpt_flags); ++ return -EINVAL; ++ } ++ } ++ return 0; ++} ++ ++static struct file * ++open_deleted(char *name, unsigned flags, struct cpt_file_image *fi, ++ struct cpt_inode_image *ii, cpt_context_t *ctx) ++{ ++ struct file * file; ++ char *suffix = NULL; ++ int attempt = 0; ++ int tmp_pass = 0; ++ mode_t mode = fi->cpt_i_mode; ++ ++ /* Strip (deleted) part... */ ++ if (strlen(name) > strlen(" (deleted)")) { ++ if (strcmp(name + strlen(name) - strlen(" (deleted)"), " (deleted)") == 0) { ++ suffix = &name[strlen(name) - strlen(" (deleted)")]; ++ *suffix = 0; ++ } else if (memcmp(name, "(deleted) ", strlen("(deleted) ")) == 0) { ++ memmove(name, name + strlen("(deleted) "), strlen(name) - strlen(" (deleted)") + 1); ++ suffix = name + strlen(name); ++ } ++ } ++ ++try_again: ++ for (;;) { ++ if (attempt) { ++ if (attempt > 1000) { ++ eprintk_ctx("open_deleted: failed after %d attempts\n", attempt); ++ return ERR_PTR(-EEXIST); ++ } ++ if (suffix == NULL) { ++ eprintk_ctx("open_deleted: no suffix\n"); ++ return ERR_PTR(-EEXIST); ++ } ++ sprintf(suffix, ".%08x", (unsigned)((xtime.tv_nsec>>10)+attempt)); ++ } ++ attempt++; ++ ++ if (S_ISFIFO(mode)) { ++ int err; ++ err = sc_mknod(name, S_IFIFO|(mode&017777), 0); ++ if (err == -EEXIST) ++ continue; ++ if (err < 0 && !tmp_pass) ++ goto change_dir; ++ if (err < 0) ++ return ERR_PTR(err); ++ file = open_pipe(name, fi, flags, ctx); ++ sc_unlink(name); ++ } else if (S_ISCHR(mode)) { ++ int err; ++ err = sc_mknod(name, S_IFCHR|(mode&017777), new_encode_dev(ii->cpt_rdev)); ++ if (err == -EEXIST) ++ continue; ++ if (err < 0 && !tmp_pass) ++ goto change_dir; ++ if (err < 0) ++ return ERR_PTR(err); ++ file = filp_open(name, flags, mode&017777); ++ sc_unlink(name); ++ } else if (S_ISDIR(mode)) { ++ int err; ++ err = sc_mkdir(name, mode&017777); ++ if (err == -EEXIST) ++ continue; ++ if (err < 0 && !tmp_pass) ++ goto change_dir; ++ if (err < 0) ++ return ERR_PTR(err); ++ file = filp_open(name, flags, mode&017777); ++ sc_rmdir(name); ++ } else { ++ file = filp_open(name, O_CREAT|O_EXCL|flags, mode&017777); ++ if (IS_ERR(file)) { ++ if (PTR_ERR(file) == -EEXIST) ++ continue; ++ if (!tmp_pass) ++ goto change_dir; ++ } else { ++ sc_unlink(name); ++ } ++ } ++ break; ++ } ++ ++ if (IS_ERR(file)) { ++ eprintk_ctx("filp_open %s: %ld\n", name, PTR_ERR(file)); ++ return file; ++ } else { ++ dprintk_ctx("deleted file created as %s, %p, %x\n", name, file, file->f_dentry->d_inode->i_mode); ++ } ++ return file; ++ ++change_dir: ++ sprintf(name, "/tmp/rst%u", current->pid); ++ suffix = name + strlen(name); ++ attempt = 1; ++ tmp_pass = 1; ++ goto try_again; ++} ++ ++struct file *rst_file(loff_t pos, int fd, struct cpt_context *ctx) ++{ ++ int err; ++ int was_dentry_open = 0; ++ cpt_object_t *obj; ++ cpt_object_t *iobj; ++ struct cpt_file_image fi; ++ __u8 *name = NULL; ++ struct file *file; ++ int flags; ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_FILE, pos, ctx); ++ if (obj) { ++ file = obj->o_obj; ++ if (obj->o_index >= 0) { ++ dprintk_ctx("file is attached to a socket\n"); ++ err = rst_get_object(CPT_OBJ_FILE, pos, &fi, ctx); ++ if (err < 0) ++ goto err_out; ++ fixup_file_flags(file, &fi, 0, pos, ctx); ++ } ++ get_file(file); ++ return file; ++ } ++ ++ err = rst_get_object(CPT_OBJ_FILE, pos, &fi, ctx); ++ if (err < 0) ++ goto err_out; ++ ++ flags = make_flags(&fi); ++ ++ /* Easy way, inode has been already open. */ ++ if (fi.cpt_inode != CPT_NULL && ++ !(fi.cpt_lflags & CPT_DENTRY_CLONING) && ++ (iobj = lookup_cpt_obj_bypos(CPT_OBJ_INODE, fi.cpt_inode, ctx)) != NULL && ++ iobj->o_parent) { ++ struct file *filp = iobj->o_parent; ++ file = dentry_open(dget(filp->f_dentry), ++ mntget(filp->f_vfsmnt), flags); ++ dprintk_ctx("rst_file: file obtained by dentry_open\n"); ++ was_dentry_open = 1; ++ goto map_file; ++ } ++ ++ if (fi.cpt_next > fi.cpt_hdrlen) ++ name = rst_get_name(pos + sizeof(fi), ctx); ++ ++ if (!name) { ++ eprintk_ctx("no name for file?\n"); ++ err = -EINVAL; ++ goto err_out; ++ } ++ ++ if (fi.cpt_lflags & CPT_DENTRY_DELETED) { ++ struct cpt_inode_image ii; ++ if (fi.cpt_inode == CPT_NULL) { ++ eprintk_ctx("deleted file and no inode.\n"); ++ err = -EINVAL; ++ goto err_out; ++ } ++ ++ err = rst_get_object(CPT_OBJ_INODE, fi.cpt_inode, &ii, ctx); ++ if (err) ++ goto err_out; ++ ++ if (ii.cpt_next > ii.cpt_hdrlen) { ++ struct cpt_object_hdr hdr; ++ err = ctx->pread(&hdr, sizeof(hdr), ctx, ++ fi.cpt_inode + ii.cpt_hdrlen); ++ if (err) ++ goto err_out; ++ if (hdr.cpt_object == CPT_OBJ_NAME) { ++ rst_put_name(name, ctx); ++ name = rst_get_name(fi.cpt_inode+ii.cpt_hdrlen, ++ ctx); ++ if (!name) { ++ eprintk_ctx("no name for link?\n"); ++ err = -EINVAL; ++ goto err_out; ++ } ++ goto open_file; ++ } ++ } ++ ++ /* One very special case... */ ++ if (S_ISREG(fi.cpt_i_mode) && ++ (!name[0] || strcmp(name, "/dev/zero (deleted)") == 0)) { ++ /* MAP_ANON|MAP_SHARED mapping. ++ * kernel makes this damn ugly way, when file which ++ * is passed to mmap by user does not match ++ * file finally attached to VMA. Ok, rst_mm ++ * has to take care of this. Otherwise, it will fail. ++ */ ++ file = NULL; ++ } else if (S_ISREG(fi.cpt_i_mode) || ++ S_ISCHR(fi.cpt_i_mode) || ++ S_ISFIFO(fi.cpt_i_mode) || ++ S_ISDIR(fi.cpt_i_mode)) { ++ if (S_ISCHR(fi.cpt_i_mode)) { ++ file = open_special(&fi, flags, 1, ctx); ++ if (file != NULL) ++ goto map_file; ++ } ++ file = open_deleted(name, flags, &fi, &ii, ctx); ++ if (IS_ERR(file)) ++ goto out; ++ } else { ++ eprintk_ctx("not a regular deleted file.\n"); ++ err = -EINVAL; ++ goto err_out; ++ } ++ ++ err = fixup_file_content(&file, &fi, &ii, ctx); ++ if (err) ++ goto err_put; ++ goto map_file; ++ } else { ++open_file: ++ if (!name[0]) { ++ eprintk_ctx("empty name for file?\n"); ++ err = -EINVAL; ++ goto err_out; ++ } ++ if ((fi.cpt_lflags & CPT_DENTRY_EPOLL) && ++ (file = cpt_open_epolldev(&fi, flags, ctx)) != NULL) ++ goto map_file; ++#ifdef CONFIG_INOTIFY_USER ++ if ((fi.cpt_lflags & CPT_DENTRY_INOTIFY) && ++ (file = rst_open_inotify(&fi, flags, ctx)) != NULL) ++ goto map_file; ++#else ++ if (fi.cpt_lflags & CPT_DENTRY_INOTIFY) { ++ err = -EINVAL; ++ goto err_out; ++ } ++#endif ++ if (S_ISFIFO(fi.cpt_i_mode) && ++ (file = open_pipe(name, &fi, flags, ctx)) != NULL) ++ goto map_file; ++ if (!S_ISREG(fi.cpt_i_mode) && ++ (file = open_special(&fi, flags, 0, ctx)) != NULL) ++ goto map_file; ++ } ++ ++ file = filp_open(name, flags, 0); ++ ++map_file: ++ if (!IS_ERR(file)) { ++ fixup_file_flags(file, &fi, was_dentry_open, pos, ctx); ++ ++ if (S_ISFIFO(fi.cpt_i_mode) && !was_dentry_open) { ++ err = fixup_pipe_data(file, &fi, ctx); ++ if (err) ++ goto err_put; ++ } ++ ++ /* This is very special hack. Logically, cwd/root are ++ * nothing but open directories. Nevertheless, this causes ++ * failures of restores, when number of open files in VE ++ * is close to limit. So, if it is rst_file() of cwd/root ++ * (fd = -2) and the directory is not deleted, we skip ++ * adding files to object table. If the directory is ++ * not unlinked, this cannot cause any problems. ++ */ ++ if (fd != -2 || ++ !S_ISDIR(file->f_dentry->d_inode->i_mode) || ++ (fi.cpt_lflags & CPT_DENTRY_DELETED)) { ++ obj = cpt_object_get(CPT_OBJ_FILE, file, ctx); ++ if (!obj) { ++ obj = cpt_object_add(CPT_OBJ_FILE, file, ctx); ++ if (obj) ++ get_file(file); ++ } ++ if (obj) ++ cpt_obj_setpos(obj, pos, ctx); ++ ++ obj = cpt_object_add(CPT_OBJ_INODE, file->f_dentry->d_inode, ctx); ++ if (obj) { ++ cpt_obj_setpos(obj, fi.cpt_inode, ctx); ++ if (!obj->o_parent || !(fi.cpt_lflags & CPT_DENTRY_DELETED)) ++ obj->o_parent = file; ++ } ++ } ++ ++ if (fi.cpt_next > fi.cpt_hdrlen) { ++ err = fixup_flocks(file, &fi, pos, ctx); ++ if (err) ++ goto err_put; ++ } ++ } else { ++ if (fi.cpt_lflags & CPT_DENTRY_PROC) { ++ dprintk_ctx("rst_file /proc delayed\n"); ++ file = NULL; ++ } else if (name) ++ eprintk_ctx("can't open file %s\n", name); ++ } ++ ++out: ++ if (name) ++ rst_put_name(name, ctx); ++ return file; ++ ++err_put: ++ if (file) ++ fput(file); ++err_out: ++ if (name) ++ rst_put_name(name, ctx); ++ return ERR_PTR(err); ++} ++ ++ ++__u32 rst_files_flag(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ __u32 flag = 0; ++ ++ if (ti->cpt_files == CPT_NULL || ++ lookup_cpt_obj_bypos(CPT_OBJ_FILES, ti->cpt_files, ctx)) ++ flag |= CLONE_FILES; ++ if (ti->cpt_fs == CPT_NULL || ++ lookup_cpt_obj_bypos(CPT_OBJ_FS, ti->cpt_fs, ctx)) ++ flag |= CLONE_FS; ++ return flag; ++} ++ ++static void local_close_files(struct files_struct * files) ++{ ++ int i, j; ++ ++ j = 0; ++ for (;;) { ++ unsigned long set; ++ i = j * __NFDBITS; ++ if (i >= files->fdt->max_fds) ++ break; ++ set = files->fdt->open_fds->fds_bits[j]; ++ while (set) { ++ if (set & 1) { ++ struct file * file = xchg(&files->fdt->fd[i], NULL); ++ if (file) ++ filp_close(file, files); ++ } ++ i++; ++ set >>= 1; ++ } ++ files->fdt->open_fds->fds_bits[j] = 0; ++ files->fdt->close_on_exec->fds_bits[j] = 0; ++ j++; ++ } ++} ++ ++extern int expand_fdtable(struct files_struct *files, int nr); ++ ++ ++int rst_files_complete(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ struct cpt_files_struct_image fi; ++ struct files_struct *f = current->files; ++ cpt_object_t *obj; ++ loff_t pos, endpos; ++ int err; ++ ++ if (ti->cpt_files == CPT_NULL) { ++ current->files = NULL; ++ if (f) ++ put_files_struct(f); ++ return 0; ++ } ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_FILES, ti->cpt_files, ctx); ++ if (obj) { ++ if (obj->o_obj != f) { ++ put_files_struct(f); ++ f = obj->o_obj; ++ atomic_inc(&f->count); ++ current->files = f; ++ } ++ return 0; ++ } ++ ++ err = rst_get_object(CPT_OBJ_FILES, ti->cpt_files, &fi, ctx); ++ if (err) ++ return err; ++ ++ local_close_files(f); ++ ++ if (fi.cpt_max_fds > f->fdt->max_fds) { ++ spin_lock(&f->file_lock); ++ err = expand_fdtable(f, fi.cpt_max_fds-1); ++ spin_unlock(&f->file_lock); ++ if (err < 0) ++ return err; ++ } ++ ++ pos = ti->cpt_files + fi.cpt_hdrlen; ++ endpos = ti->cpt_files + fi.cpt_next; ++ while (pos < endpos) { ++ struct cpt_fd_image fdi; ++ struct file *filp; ++ ++ err = rst_get_object(CPT_OBJ_FILEDESC, pos, &fdi, ctx); ++ if (err) ++ return err; ++ filp = rst_file(fdi.cpt_file, fdi.cpt_fd, ctx); ++ if (IS_ERR(filp)) { ++ eprintk_ctx("rst_file: %ld %Lu\n", PTR_ERR(filp), ++ (long long)fdi.cpt_file); ++ return PTR_ERR(filp); ++ } ++ if (filp == NULL) { ++ int err = rst_filejob_queue(pos, ctx); ++ if (err) ++ return err; ++ } else { ++ if (fdi.cpt_fd >= f->fdt->max_fds) BUG(); ++ f->fdt->fd[fdi.cpt_fd] = filp; ++ FD_SET(fdi.cpt_fd, f->fdt->open_fds); ++ if (fdi.cpt_flags&CPT_FD_FLAG_CLOSEEXEC) ++ FD_SET(fdi.cpt_fd, f->fdt->close_on_exec); ++ } ++ pos += fdi.cpt_next; ++ } ++ f->next_fd = fi.cpt_next_fd; ++ ++ obj = cpt_object_add(CPT_OBJ_FILES, f, ctx); ++ if (obj) { ++ cpt_obj_setpos(obj, ti->cpt_files, ctx); ++ cpt_obj_setindex(obj, fi.cpt_index, ctx); ++ } ++ return 0; ++} ++ ++int rst_do_filejobs(cpt_context_t *ctx) ++{ ++ struct filejob *j; ++ ++ while ((j = ctx->filejob_queue) != NULL) { ++ int err; ++ struct task_struct *tsk; ++ struct cpt_fd_image fdi; ++ struct file *filp; ++ ++ read_lock(&tasklist_lock); ++ tsk = find_task_by_vpid(j->pid); ++ if (tsk) ++ get_task_struct(tsk); ++ read_unlock(&tasklist_lock); ++ if (!tsk) ++ return -EINVAL; ++ ++ err = rst_get_object(CPT_OBJ_FILEDESC, j->fdi, &fdi, ctx); ++ if (err) { ++ put_task_struct(tsk); ++ return err; ++ } ++ ++ if (fdi.cpt_fd >= tsk->files->fdt->max_fds) BUG(); ++ if (tsk->files->fdt->fd[fdi.cpt_fd] || ++ FD_ISSET(fdi.cpt_fd, tsk->files->fdt->open_fds)) { ++ eprintk_ctx("doing filejob %Ld: fd is busy\n", j->fdi); ++ put_task_struct(tsk); ++ return -EBUSY; ++ } ++ ++ filp = rst_file(fdi.cpt_file, fdi.cpt_fd, ctx); ++ if (IS_ERR(filp)) { ++ eprintk_ctx("rst_do_filejobs: 1: %ld %Lu\n", PTR_ERR(filp), (unsigned long long)fdi.cpt_file); ++ put_task_struct(tsk); ++ return PTR_ERR(filp); ++ } ++ if (fdi.cpt_fd >= tsk->files->fdt->max_fds) BUG(); ++ tsk->files->fdt->fd[fdi.cpt_fd] = filp; ++ FD_SET(fdi.cpt_fd, tsk->files->fdt->open_fds); ++ if (fdi.cpt_flags&CPT_FD_FLAG_CLOSEEXEC) ++ FD_SET(fdi.cpt_fd, tsk->files->fdt->close_on_exec); ++ ++ dprintk_ctx("filejob %Ld done\n", j->fdi); ++ ++ put_task_struct(tsk); ++ ctx->filejob_queue = j->next; ++ kfree(j); ++ } ++ return 0; ++} ++ ++void rst_flush_filejobs(cpt_context_t *ctx) ++{ ++ struct filejob *j; ++ ++ while ((j = ctx->filejob_queue) != NULL) { ++ ctx->filejob_queue = j->next; ++ kfree(j); ++ } ++} ++ ++int rst_fs_complete(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ struct fs_struct *f = current->fs; ++ cpt_object_t *obj; ++ ++ if (ti->cpt_fs == CPT_NULL) { ++ exit_fs(current); ++ return 0; ++ } ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_FS, ti->cpt_fs, ctx); ++ if (obj) { ++ if (obj->o_obj != f) { ++ exit_fs(current); ++ f = obj->o_obj; ++ atomic_inc(&f->count); ++ current->fs = f; ++ } ++ return 0; ++ } ++ ++ /* Do _not_ restore root. Image contains absolute pathnames. ++ * So, we fix it in context of rst process. ++ */ ++ ++ obj = cpt_object_add(CPT_OBJ_FS, f, ctx); ++ if (obj) ++ cpt_obj_setpos(obj, ti->cpt_fs, ctx); ++ ++ return 0; ++} ++ ++int cpt_get_dentry(struct dentry **dp, struct vfsmount **mp, ++ loff_t *pos, struct cpt_context *ctx) ++{ ++ struct cpt_file_image fi; ++ struct file * file; ++ int err; ++ ++ err = rst_get_object(CPT_OBJ_FILE, *pos, &fi, ctx); ++ if (err) ++ return err; ++ ++ file = rst_file(*pos, -2, ctx); ++ if (IS_ERR(file)) { ++ if (PTR_ERR(file) == -EINVAL && S_ISLNK(fi.cpt_i_mode)) { ++ /* One special case: inotify on symlink */ ++ struct nameidata nd; ++ __u8 *name = NULL; ++ ++ if (fi.cpt_next > fi.cpt_hdrlen) ++ name = rst_get_name(*pos + sizeof(fi), ctx); ++ if (!name) { ++ eprintk_ctx("can't get name for file\n"); ++ return -EINVAL; ++ } ++ if ((err = path_lookup(name, 0, &nd)) != 0) { ++ eprintk_ctx("path_lookup %s: %d\n", name, err); ++ rst_put_name(name, ctx); ++ return -EINVAL; ++ } ++ *dp = nd.dentry; ++ *mp = nd.mnt; ++ *pos += fi.cpt_next; ++ rst_put_name(name, ctx); ++ return 0; ++ } ++ return PTR_ERR(file); ++ } ++ ++ *dp = dget(file->f_dentry); ++ *mp = mntget(file->f_vfsmnt); ++ *pos += fi.cpt_next; ++ fput(file); ++ return 0; ++} ++ ++static void __set_fs_root(struct fs_struct *fs, struct vfsmount *mnt, ++ struct dentry *dentry) ++{ ++ struct dentry *old_root; ++ struct vfsmount *old_rootmnt; ++ write_lock(&fs->lock); ++ old_root = fs->root; ++ old_rootmnt = fs->rootmnt; ++ fs->rootmnt = mnt; ++ fs->root = dentry; ++ write_unlock(&fs->lock); ++ if (old_root) { ++ dput(old_root); ++ mntput(old_rootmnt); ++ } ++} ++ ++static void __set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, ++ struct dentry *dentry) ++{ ++ struct dentry *old_pwd; ++ struct vfsmount *old_pwdmnt; ++ ++ write_lock(&fs->lock); ++ old_pwd = fs->pwd; ++ old_pwdmnt = fs->pwdmnt; ++ fs->pwdmnt = mnt; ++ fs->pwd = dentry; ++ write_unlock(&fs->lock); ++ ++ if (old_pwd) { ++ dput(old_pwd); ++ mntput(old_pwdmnt); ++ } ++} ++ ++ ++int rst_restore_fs(struct cpt_context *ctx) ++{ ++ loff_t pos; ++ cpt_object_t *obj; ++ int err = 0; ++ ++ for_each_object(obj, CPT_OBJ_FS) { ++ struct cpt_fs_struct_image fi; ++ struct fs_struct *fs = obj->o_obj; ++ int i; ++ struct dentry *d[3]; ++ struct vfsmount *m[3]; ++ ++ err = rst_get_object(CPT_OBJ_FS, obj->o_pos, &fi, ctx); ++ if (err) ++ return err; ++ ++ fs->umask = fi.cpt_umask; ++ ++ pos = obj->o_pos + fi.cpt_hdrlen; ++ d[0] = d[1] = d[2] = NULL; ++ m[0] = m[1] = m[2] = NULL; ++ i = 0; ++ while (pos < obj->o_pos + fi.cpt_next && i<3) { ++ err = cpt_get_dentry(d+i, m+i, &pos, ctx); ++ if (err) { ++ eprintk_ctx("cannot get_dir: %d", err); ++ for (--i; i >= 0; i--) { ++ if (d[i]) ++ dput(d[i]); ++ if (m[i]) ++ mntput(m[i]); ++ } ++ return err; ++ } ++ i++; ++ } ++ if (d[0]) ++ __set_fs_root(fs, m[0], d[0]); ++ if (d[1]) ++ __set_fs_pwd(fs, m[1], d[1]); ++ if (d[2]) { ++ struct dentry *olddentry; ++ struct vfsmount *oldmnt; ++ write_lock(&fs->lock); ++ oldmnt = fs->altrootmnt; ++ olddentry = fs->altroot; ++ fs->altrootmnt = m[2]; ++ fs->altroot = d[2]; ++ write_unlock(&fs->lock); ++ ++ if (olddentry) { ++ dput(olddentry); ++ mntput(oldmnt); ++ } ++ } ++ } ++ return err; ++} ++ ++int do_one_mount(char *mntpnt, char *mnttype, char *mntbind, ++ unsigned long flags, unsigned long mnt_flags, ++ struct cpt_context *ctx) ++{ ++ int err; ++ ++ if (mntbind && (strcmp(mntbind, "/") == 0 || strcmp(mntbind, "") == 0)) ++ mntbind = NULL; ++ ++ if (mntbind) ++ flags |= MS_BIND; ++ /* Join per-mountpoint flags with global flags */ ++ if (mnt_flags & MNT_NOSUID) ++ flags |= MS_NOSUID; ++ if (mnt_flags & MNT_NODEV) ++ flags |= MS_NODEV; ++ if (mnt_flags & MNT_NOEXEC) ++ flags |= MS_NOEXEC; ++ ++ err = sc_mount(mntbind, mntpnt, mnttype, flags); ++ if (err < 0) { ++ eprintk_ctx("%d mounting %s %s %08lx\n", err, mntpnt, mnttype, flags); ++ return err; ++ } ++ return 0; ++} ++ ++static int undumptmpfs(void *arg) ++{ ++ int i; ++ int *pfd = arg; ++ int fd1, fd2, err; ++ char *argv[] = { "tar", "x", "-C", "/", "-S", NULL }; ++ ++ if (pfd[0] != 0) ++ sc_dup2(pfd[0], 0); ++ ++ set_fs(KERNEL_DS); ++ fd1 = sc_open("/dev/null", O_WRONLY, 0); ++ fd2 = sc_open("/dev/null", O_WRONLY, 0); ++try: ++ if (fd1 < 0 || fd2 < 0) { ++ if (fd1 == -ENOENT && fd2 == -ENOENT) { ++ err = sc_mknod("/dev/null", S_IFCHR|0666, ++ new_encode_dev((MEM_MAJOR<files->fdt->max_fds; i++) ++ sc_close(i); ++ ++ module_put(THIS_MODULE); ++ ++ i = sc_execve("/bin/tar", argv, NULL); ++ eprintk("failed to exec /bin/tar: %d\n", i); ++ return 255 << 8; ++} ++ ++static int rst_restore_tmpfs(loff_t *pos, struct cpt_context * ctx) ++{ ++ int err; ++ int pfd[2]; ++ struct file *f; ++ struct cpt_object_hdr v; ++ int n; ++ loff_t end; ++ int pid; ++ int status; ++ mm_segment_t oldfs; ++ sigset_t ignore, blocked; ++ ++ err = rst_get_object(CPT_OBJ_NAME, *pos, &v, ctx); ++ if (err < 0) ++ return err; ++ ++ err = sc_pipe(pfd); ++ if (err < 0) ++ return err; ++ ignore.sig[0] = CPT_SIG_IGNORE_MASK; ++ sigprocmask(SIG_BLOCK, &ignore, &blocked); ++ pid = err = local_kernel_thread(undumptmpfs, (void*)pfd, SIGCHLD, 0); ++ if (err < 0) { ++ eprintk_ctx("tmpfs local_kernel_thread: %d\n", err); ++ goto out; ++ } ++ f = fget(pfd[1]); ++ sc_close(pfd[1]); ++ sc_close(pfd[0]); ++ ++ ctx->file->f_pos = *pos + v.cpt_hdrlen; ++ end = *pos + v.cpt_next; ++ *pos += v.cpt_next; ++ do { ++ char buf[16]; ++ ++ n = end - ctx->file->f_pos; ++ if (n > sizeof(buf)) ++ n = sizeof(buf); ++ ++ if (ctx->read(buf, n, ctx)) ++ break; ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ f->f_op->write(f, buf, n, &f->f_pos); ++ set_fs(oldfs); ++ } while (ctx->file->f_pos < end); ++ ++ fput(f); ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if ((err = sc_waitx(pid, 0, &status)) < 0) ++ eprintk_ctx("wait4: %d\n", err); ++ else if ((status & 0x7f) == 0) { ++ err = (status & 0xff00) >> 8; ++ if (err != 0) { ++ eprintk_ctx("tar exited with %d\n", err); ++ err = -EINVAL; ++ } ++ } else { ++ eprintk_ctx("tar terminated\n"); ++ err = -EINVAL; ++ } ++ set_fs(oldfs); ++ sigprocmask(SIG_SETMASK, &blocked, NULL); ++ ++ return err; ++ ++out: ++ if (pfd[1] >= 0) ++ sc_close(pfd[1]); ++ if (pfd[0] >= 0) ++ sc_close(pfd[0]); ++ sigprocmask(SIG_SETMASK, &blocked, NULL); ++ return err; ++} ++ ++int check_ext_mount(char *mntpnt, char *mnttype, struct cpt_context *ctx) ++{ ++ struct mnt_namespace *n; ++ struct list_head *p; ++ struct vfsmount *t; ++ char *path, *path_buf; ++ int ret; ++ ++ n = current->nsproxy->mnt_ns; ++ ret = -ENOENT; ++ path_buf = cpt_get_buf(ctx); ++ down_read(&namespace_sem); ++ list_for_each(p, &n->list) { ++ t = list_entry(p, struct vfsmount, mnt_list); ++ path = d_path(t->mnt_root, t, path_buf, PAGE_SIZE); ++ if (IS_ERR(path)) ++ continue; ++ if (!strcmp(path, mntpnt) && ++ !strcmp(t->mnt_sb->s_type->name, mnttype)) { ++ ret = 0; ++ break; ++ } ++ } ++ up_read(&namespace_sem); ++ __cpt_release_buf(ctx); ++ return ret; ++} ++ ++int restore_one_vfsmount(struct cpt_vfsmount_image *mi, loff_t pos, struct cpt_context *ctx) ++{ ++ int err; ++ loff_t endpos; ++ ++ endpos = pos + mi->cpt_next; ++ pos += mi->cpt_hdrlen; ++ ++ while (pos < endpos) { ++ char *mntdev; ++ char *mntpnt; ++ char *mnttype; ++ char *mntbind; ++ ++ mntdev = __rst_get_name(&pos, ctx); ++ mntpnt = __rst_get_name(&pos, ctx); ++ mnttype = __rst_get_name(&pos, ctx); ++ mntbind = NULL; ++ if (mi->cpt_mntflags & CPT_MNT_BIND) ++ mntbind = __rst_get_name(&pos, ctx); ++ err = -EINVAL; ++ if (mnttype && mntpnt) { ++ err = 0; ++ if (!(mi->cpt_mntflags & CPT_MNT_EXT) && ++ strcmp(mntpnt, "/")) { ++ err = do_one_mount(mntpnt, mnttype, mntbind, ++ mi->cpt_flags, ++ mi->cpt_mntflags, ctx); ++ if (!err && ++ strcmp(mnttype, "tmpfs") == 0 && ++ !(mi->cpt_mntflags & (CPT_MNT_BIND))) ++ err = rst_restore_tmpfs(&pos, ctx); ++ } else if (mi->cpt_mntflags & CPT_MNT_EXT) { ++ err = check_ext_mount(mntpnt, mnttype, ctx); ++ if (err) ++ eprintk_ctx("mount point is missing: %s\n", mntpnt); ++ } ++ } ++ if (mntdev) ++ rst_put_name(mntdev, ctx); ++ if (mntpnt) ++ rst_put_name(mntpnt, ctx); ++ if (mnttype) ++ rst_put_name(mnttype, ctx); ++ if (mntbind) ++ rst_put_name(mntbind, ctx); ++ if (err) ++ return err; ++ } ++ return 0; ++} ++ ++int restore_one_namespace(loff_t pos, loff_t endpos, struct cpt_context *ctx) ++{ ++ int err; ++ struct cpt_vfsmount_image mi; ++ ++ while (pos < endpos) { ++ err = rst_get_object(CPT_OBJ_VFSMOUNT, pos, &mi, ctx); ++ if (err) ++ return err; ++ err = restore_one_vfsmount(&mi, pos, ctx); ++ if (err) ++ return err; ++ pos += mi.cpt_next; ++ } ++ return 0; ++} ++ ++int rst_root_namespace(struct cpt_context *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_NAMESPACE]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ struct cpt_object_hdr sbuf; ++ int done = 0; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_NAMESPACE || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ err = rst_get_object(CPT_OBJ_NAMESPACE, sec, &sbuf, ctx); ++ if (err) ++ return err; ++ if (done) { ++ eprintk_ctx("multiple namespaces are not supported\n"); ++ break; ++ } ++ done++; ++ err = restore_one_namespace(sec+sbuf.cpt_hdrlen, sec+sbuf.cpt_next, ctx); ++ if (err) ++ return err; ++ sec += sbuf.cpt_next; ++ } ++ ++ return 0; ++} ++ ++int rst_stray_files(struct cpt_context *ctx) ++{ ++ int err = 0; ++ loff_t sec = ctx->sections[CPT_SECT_FILES]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_FILES || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ struct cpt_object_hdr sbuf; ++ cpt_object_t *obj; ++ ++ err = _rst_get_object(CPT_OBJ_FILE, sec, &sbuf, sizeof(sbuf), ctx); ++ if (err) ++ break; ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_FILE, sec, ctx); ++ if (!obj) { ++ struct file *file; ++ ++ dprintk_ctx("stray file %Ld\n", sec); ++ ++ file = rst_sysv_shm_itself(sec, ctx); ++ ++ if (IS_ERR(file)) { ++ eprintk_ctx("rst_stray_files: %ld\n", PTR_ERR(file)); ++ return PTR_ERR(file); ++ } else { ++ fput(file); ++ } ++ } ++ sec += sbuf.cpt_next; ++ } ++ ++ return err; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_inotify.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_inotify.c +--- ./kernel/cpt/rst_inotify.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_inotify.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,198 @@ ++/* ++ * ++ * kernel/cpt/rst_inotify.c ++ * ++ * Copyright (C) 2000-2007 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_files.h" ++#include "cpt_kernel.h" ++#include "cpt_fsmagic.h" ++#include "cpt_syscalls.h" ++ ++extern struct file_operations inotify_fops; ++ ++struct file *rst_open_inotify(struct cpt_file_image *fi, ++ unsigned flags, ++ struct cpt_context *ctx) ++{ ++ struct file *file; ++ int fd; ++ ++ fd = sys_inotify_init(); ++ if (fd < 0) ++ return ERR_PTR(fd); ++ ++ file = fget(fd); ++ sys_close(fd); ++ return file; ++} ++ ++static int restore_one_inotify(cpt_object_t *obj, ++ loff_t pos, ++ struct cpt_inotify_image *ibuf, ++ cpt_context_t *ctx) ++{ ++ int err = 0; ++ loff_t endpos; ++ struct file *file = obj->o_obj; ++ struct inotify_device *dev; ++ ++ if (file->f_op != &inotify_fops) { ++ eprintk_ctx("bad inotify file\n"); ++ return -EINVAL; ++ } ++ ++ dev = file->private_data; ++ ++ if (unlikely(dev == NULL)) { ++ eprintk_ctx("bad inotify device\n"); ++ return -EINVAL; ++ } ++ ++ endpos = pos + ibuf->cpt_next; ++ pos += ibuf->cpt_hdrlen; ++ while (pos < endpos) { ++ union { ++ struct cpt_inotify_wd_image wi; ++ struct cpt_inotify_ev_image ei; ++ } u; ++ ++ err = rst_get_object(-1, pos, &u, ctx); ++ if (err) { ++ eprintk_ctx("rst_get_object: %d\n", err); ++ return err; ++ } ++ if (u.wi.cpt_object == CPT_OBJ_INOTIFY_WATCH) { ++ struct dentry *d; ++ struct vfsmount *mnt; ++ loff_t fpos = pos + u.wi.cpt_hdrlen; ++ ++ err = cpt_get_dentry(&d, &mnt, &fpos, ctx); ++ if (err) { ++ eprintk_ctx("cpt_get_dentry: %d\n", err); ++ return err; ++ } ++ ++ mutex_lock(&dev->up_mutex); ++ dev->ih->last_wd = u.wi.cpt_wd - 1; ++ err = inotify_create_watch(dev, d, mnt, u.wi.cpt_mask); ++ dev->ih->last_wd = ibuf->cpt_last_wd; ++ if (err != u.wi.cpt_wd) { ++ eprintk_ctx("wrong inotify descriptor %u %u\n", err, u.wi.cpt_wd); ++ if (err >= 0) ++ err = -EINVAL; ++ } else ++ err = 0; ++ mutex_unlock(&dev->up_mutex); ++ dput(d); ++ mntput(mnt); ++ if (err) ++ break; ++ } else if (u.wi.cpt_object == CPT_OBJ_INOTIFY_EVENT) { ++ struct inotify_user_watch dummy_watch; ++ struct inotify_watch *w; ++ char *name = NULL; ++ ++ if (u.ei.cpt_namelen) { ++ name = kmalloc(u.ei.cpt_namelen+1, GFP_KERNEL); ++ if (name == NULL) { ++ err = -ENOMEM; ++ break; ++ } ++ name[u.ei.cpt_namelen] = 0; ++ err = ctx->pread(name, u.ei.cpt_namelen, ctx, pos + u.ei.cpt_hdrlen); ++ if (err) { ++ kfree(name); ++ break; ++ } ++ } ++ ++ w = &dummy_watch.wdata; ++ dummy_watch.dev = dev; ++ atomic_set(&w->count, 2); ++ ++ /* Trick to avoid destruction due to exit event */ ++ if (u.ei.cpt_mask & (IN_IGNORED | IN_ONESHOT)) ++ atomic_inc(&w->count); ++ dev->ih->in_ops->handle_event(w, u.ei.cpt_wd, u.ei.cpt_mask, ++ u.ei.cpt_cookie, name, NULL); ++ if (name) ++ kfree(name); ++ } else { ++ eprintk_ctx("bad object: %u\n", u.wi.cpt_object); ++ err = -EINVAL; ++ break; ++ } ++ pos += u.wi.cpt_next; ++ } ++ return err; ++} ++ ++int rst_inotify(cpt_context_t *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_INOTIFY]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_INOTIFY || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ cpt_object_t *obj; ++ struct cpt_inotify_image ibuf; ++ ++ err = rst_get_object(CPT_OBJ_INOTIFY, sec, &ibuf, ctx); ++ if (err) ++ return err; ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_FILE, ibuf.cpt_file, ctx); ++ if (obj == NULL) { ++ eprintk_ctx("cannot find inotify file object\n"); ++ return -EINVAL; ++ } ++ err = restore_one_inotify(obj, sec, &ibuf, ctx); ++ if (err) ++ return err; ++ sec += ibuf.cpt_next; ++ } ++ ++ return 0; ++ ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_mm.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_mm.c +--- ./kernel/cpt/rst_mm.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_mm.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,1144 @@ ++/* ++ * ++ * kernel/cpt/rst_mm.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_X86 ++#include ++#include ++#endif ++#include ++#include ++#include ++#include ++ ++#ifdef CONFIG_VE ++#include ++#include ++#endif ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_files.h" ++#include "cpt_ubc.h" ++#include "cpt_mm.h" ++#include "cpt_kernel.h" ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++#include "cpt_pagein.h" ++#endif ++ ++#include "cpt_syscalls.h" ++ ++#define __PAGE_NX (1ULL<<63) ++ ++static unsigned long make_prot(struct cpt_vma_image *vmai) ++{ ++ unsigned long prot = 0; ++ ++ if (vmai->cpt_flags&VM_READ) ++ prot |= PROT_READ; ++ if (vmai->cpt_flags&VM_WRITE) ++ prot |= PROT_WRITE; ++ if (vmai->cpt_flags&VM_EXEC) ++ prot |= PROT_EXEC; ++ if (vmai->cpt_flags&VM_GROWSDOWN) ++ prot |= PROT_GROWSDOWN; ++ if (vmai->cpt_flags&VM_GROWSUP) ++ prot |= PROT_GROWSUP; ++ return prot; ++} ++ ++static unsigned long make_flags(struct cpt_vma_image *vmai) ++{ ++ unsigned long flags = MAP_FIXED; ++ ++ if (vmai->cpt_flags&(VM_SHARED|VM_MAYSHARE)) ++ flags |= MAP_SHARED; ++ else ++ flags |= MAP_PRIVATE; ++ ++ if (vmai->cpt_file == CPT_NULL) ++ flags |= MAP_ANONYMOUS; ++ if (vmai->cpt_flags&VM_GROWSDOWN) ++ flags |= MAP_GROWSDOWN; ++#ifdef MAP_GROWSUP ++ if (vmai->cpt_flags&VM_GROWSUP) ++ flags |= MAP_GROWSUP; ++#endif ++ if (vmai->cpt_flags&VM_DENYWRITE) ++ flags |= MAP_DENYWRITE; ++ if (vmai->cpt_flags&VM_EXECUTABLE) ++ flags |= MAP_EXECUTABLE; ++ if (!(vmai->cpt_flags&VM_ACCOUNT)) ++ flags |= MAP_NORESERVE; ++ return flags; ++} ++ ++#ifdef CONFIG_X86 ++#if !defined(CONFIG_X86_64) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) \ ++ && !defined(CONFIG_XEN) ++static int __alloc_ldt(mm_context_t *pc, int mincount) ++{ ++ int oldsize, newsize, nr; ++ ++ if (mincount <= pc->size) ++ return 0; ++ /* ++ * LDT got larger - reallocate if necessary. ++ */ ++ oldsize = pc->size; ++ mincount = (mincount+511)&(~511); ++ newsize = mincount*LDT_ENTRY_SIZE; ++ for (nr = 0; nr * PAGE_SIZE < newsize; nr++) { ++ BUG_ON(nr * PAGE_SIZE >= 64*1024); ++ if (!pc->ldt_pages[nr]) { ++ pc->ldt_pages[nr] = alloc_page(GFP_HIGHUSER|__GFP_UBC); ++ if (!pc->ldt_pages[nr]) ++ goto nomem; ++ clear_highpage(pc->ldt_pages[nr]); ++ } ++ } ++ pc->size = mincount; ++ return 0; ++ ++nomem: ++ while (--nr >= 0) ++ __free_page(pc->ldt_pages[nr]); ++ pc->size = 0; ++ return -ENOMEM; ++} ++ ++static int do_rst_ldt(struct cpt_obj_bits *li, loff_t pos, struct cpt_context *ctx) ++{ ++ struct mm_struct *mm = current->mm; ++ int i; ++ int err; ++ int size; ++ ++ err = __alloc_ldt(&mm->context, li->cpt_size/LDT_ENTRY_SIZE); ++ if (err) ++ return err; ++ ++ size = mm->context.size*LDT_ENTRY_SIZE; ++ ++ for (i = 0; i < size; i += PAGE_SIZE) { ++ int nr = i / PAGE_SIZE, bytes; ++ char *kaddr = kmap(mm->context.ldt_pages[nr]); ++ ++ bytes = size - i; ++ if (bytes > PAGE_SIZE) ++ bytes = PAGE_SIZE; ++ err = ctx->pread(kaddr, bytes, ctx, pos + li->cpt_hdrlen + i); ++ kunmap(mm->context.ldt_pages[nr]); ++ if (err) ++ return err; ++ } ++ ++ load_LDT(&mm->context); ++ return 0; ++} ++ ++#else ++ ++static int do_rst_ldt(struct cpt_obj_bits *li, loff_t pos, struct cpt_context *ctx) ++{ ++ struct mm_struct *mm = current->mm; ++ int oldsize = mm->context.size; ++ void *oldldt; ++ void *newldt; ++ int err; ++ ++ if (li->cpt_size > PAGE_SIZE) ++ newldt = vmalloc(li->cpt_size); ++ else ++ newldt = kmalloc(li->cpt_size, GFP_KERNEL); ++ ++ if (!newldt) ++ return -ENOMEM; ++ ++ err = ctx->pread(newldt, li->cpt_size, ctx, pos + li->cpt_hdrlen); ++ if (err) ++ return err; ++ ++ oldldt = mm->context.ldt; ++ mm->context.ldt = newldt; ++ mm->context.size = li->cpt_size/LDT_ENTRY_SIZE; ++ ++ load_LDT(&mm->context); ++ ++ if (oldsize) { ++ if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE) ++ vfree(oldldt); ++ else ++ kfree(oldldt); ++ } ++ return 0; ++} ++#endif ++#endif ++ ++static int ++restore_aio_ring(struct kioctx *aio_ctx, struct cpt_aio_ctx_image *aimg) ++{ ++ struct aio_ring_info *info = &aio_ctx->ring_info; ++ unsigned nr_events = aio_ctx->max_reqs; ++ unsigned long size; ++ int nr_pages; ++ ++ /* We recalculate parameters of the ring exactly like ++ * fs/aio.c does and then compare calculated values ++ * with ones, stored in dump. They must be the same. */ ++ ++ nr_events += 2; ++ ++ size = sizeof(struct aio_ring); ++ size += sizeof(struct io_event) * nr_events; ++ nr_pages = (size + PAGE_SIZE-1) >> PAGE_SHIFT; ++ ++ if (nr_pages != aimg->cpt_ring_pages) ++ return -EINVAL; ++ ++ info->nr_pages = nr_pages; ++ ++ nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring)) / sizeof(struct io_event); ++ ++ if (nr_events != aimg->cpt_nr) ++ return -EINVAL; ++ ++ info->nr = 0; ++ info->ring_pages = info->internal_pages; ++ if (nr_pages > AIO_RING_PAGES) { ++ info->ring_pages = kmalloc(sizeof(struct page *) * nr_pages, GFP_KERNEL); ++ if (!info->ring_pages) ++ return -ENOMEM; ++ memset(info->ring_pages, 0, sizeof(struct page *) * nr_pages); ++ } ++ ++ info->mmap_size = nr_pages * PAGE_SIZE; ++ ++ /* This piece of shit is not entirely my fault. Kernel aio.c makes ++ * something odd mmap()ping some pages and then pinning them. ++ * I guess it is just some mud remained of failed attempt to show ring ++ * to user space. The result is odd. :-) Immediately after ++ * creation of AIO context, kernel shares those pages with user ++ * and user can read and even write there. But after the first ++ * fork, pages are marked COW with evident consequences. ++ * I remember, I did the same mistake in the first version ++ * of mmapped packet socket, luckily that crap never reached ++ * mainstream. ++ * ++ * So, what are we going to do? I can simulate this odd behaviour ++ * exactly, but I am not insane yet. For now just take the pages ++ * from user space. Alternatively, we could keep kernel copy ++ * in AIO context image, which would be more correct. ++ * ++ * What is wrong now? If the pages are COWed, ring is transferred ++ * incorrectly. ++ */ ++ down_read(¤t->mm->mmap_sem); ++ info->mmap_base = aimg->cpt_mmap_base; ++ info->nr_pages = get_user_pages(current, current->mm, ++ info->mmap_base, nr_pages, ++ 1, 0, info->ring_pages, NULL); ++ up_read(¤t->mm->mmap_sem); ++ ++ if (unlikely(info->nr_pages != nr_pages)) { ++ int i; ++ ++ for (i=0; inr_pages; i++) ++ put_page(info->ring_pages[i]); ++ if (info->ring_pages && info->ring_pages != info->internal_pages) ++ kfree(info->ring_pages); ++ return -EFAULT; ++ } ++ ++ aio_ctx->user_id = info->mmap_base; ++ ++ info->nr = nr_events; ++ info->tail = aimg->cpt_tail; ++ ++ return 0; ++} ++ ++static int do_rst_aio(struct cpt_aio_ctx_image *aimg, loff_t pos, cpt_context_t *ctx) ++{ ++ int err; ++ struct kioctx *aio_ctx; ++ extern spinlock_t aio_nr_lock; ++ ++ aio_ctx = kmem_cache_alloc(kioctx_cachep, GFP_KERNEL); ++ if (!aio_ctx) ++ return -ENOMEM; ++ ++ memset(aio_ctx, 0, sizeof(*aio_ctx)); ++ aio_ctx->max_reqs = aimg->cpt_max_reqs; ++ ++ if ((err = restore_aio_ring(aio_ctx, aimg)) < 0) { ++ kmem_cache_free(kioctx_cachep, aio_ctx); ++ eprintk_ctx("AIO %Ld restore_aio_ring: %d\n", pos, err); ++ return err; ++ } ++ ++ aio_ctx->mm = current->mm; ++ atomic_inc(&aio_ctx->mm->mm_count); ++ atomic_set(&aio_ctx->users, 1); ++ spin_lock_init(&aio_ctx->ctx_lock); ++ spin_lock_init(&aio_ctx->ring_info.ring_lock); ++ init_waitqueue_head(&aio_ctx->wait); ++ INIT_LIST_HEAD(&aio_ctx->active_reqs); ++ INIT_LIST_HEAD(&aio_ctx->run_list); ++ INIT_WORK(&aio_ctx->wq.work, aio_kick_handler); ++ ++ spin_lock(&aio_nr_lock); ++ aio_nr += aio_ctx->max_reqs; ++ spin_unlock(&aio_nr_lock); ++ ++ write_lock(&aio_ctx->mm->ioctx_list_lock); ++ aio_ctx->next = aio_ctx->mm->ioctx_list; ++ aio_ctx->mm->ioctx_list = aio_ctx; ++ write_unlock(&aio_ctx->mm->ioctx_list_lock); ++ ++ return 0; ++} ++ ++struct anonvma_map ++{ ++ struct hlist_node list; ++ struct anon_vma *avma; ++ __u64 id; ++}; ++ ++static int verify_create_anonvma(struct mm_struct *mm, ++ struct cpt_vma_image *vmai, ++ cpt_context_t *ctx) ++{ ++ struct anon_vma *avma = NULL; ++ struct anon_vma *new_avma; ++ struct vm_area_struct *vma; ++ int h; ++ ++ if (!ctx->anonvmas) { ++ if (CPT_ANONVMA_HSIZE*sizeof(struct hlist_head) > PAGE_SIZE) ++ return -EINVAL; ++ if ((ctx->anonvmas = (void*)__get_free_page(GFP_KERNEL)) == NULL) ++ return -ENOMEM; ++ for (h = 0; h < CPT_ANONVMA_HSIZE; h++) ++ INIT_HLIST_HEAD(&ctx->anonvmas[h]); ++ } else { ++ struct anonvma_map *map; ++ struct hlist_node *elem; ++ ++ h = hash_long((unsigned long)vmai->cpt_anonvmaid, CPT_ANONVMA_HBITS); ++ hlist_for_each_entry(map, elem, &ctx->anonvmas[h], list) { ++ if (map->id == vmai->cpt_anonvmaid) { ++ avma = map->avma; ++ break; ++ } ++ } ++ } ++ ++ down_read(&mm->mmap_sem); ++ if ((vma = find_vma(mm, vmai->cpt_start)) == NULL) { ++ up_read(&mm->mmap_sem); ++ return -ESRCH; ++ } ++ if (vma->vm_start != vmai->cpt_start) { ++ up_read(&mm->mmap_sem); ++ eprintk_ctx("vma start mismatch\n"); ++ return -EINVAL; ++ } ++ if (vma->vm_pgoff != vmai->cpt_pgoff) { ++ dprintk_ctx("vma pgoff mismatch, fixing\n"); ++ if (vma->vm_file || (vma->vm_flags&(VM_SHARED|VM_MAYSHARE))) { ++ eprintk_ctx("cannot fixup vma pgoff\n"); ++ up_read(&mm->mmap_sem); ++ return -EINVAL; ++ } ++ vma->vm_pgoff = vmai->cpt_pgoff; ++ } ++ ++ if (!vma->anon_vma) { ++ if (avma) { ++ vma->anon_vma = avma; ++ anon_vma_link(vma); ++ } else { ++ int err; ++ ++ err = anon_vma_prepare(vma); ++ ++ if (err) { ++ up_read(&mm->mmap_sem); ++ return err; ++ } ++ } ++ } else { ++ /* Note, we _can_ arrive to the situation, when two ++ * different anonvmaid's point to one anon_vma, this happens ++ * f.e. when mmap() merged new area to previous one and ++ * they will share one anon_vma even if they did not on ++ * original host. ++ * ++ * IT IS OK. To all that I understand, we may merge all ++ * the anon_vma's and rmap can scan all the huge list of vmas ++ * searching for page. It is just "suboptimal". ++ * ++ * Real disaster would happen, if vma already got an anon_vma ++ * with different id. It is very rare case, kernel does the ++ * best efforts to merge anon_vmas when some attributes are ++ * different. In this case we will fall to copying memory. ++ */ ++ if (avma && vma->anon_vma != avma) { ++ up_read(&mm->mmap_sem); ++ wprintk_ctx("anon_vma mismatch\n"); ++ return 0; ++ } ++ } ++ ++ new_avma = vma->anon_vma; ++ up_read(&mm->mmap_sem); ++ ++ if (!avma) { ++ struct anonvma_map *map; ++ ++ if (!new_avma) ++ return -EINVAL; ++ ++ if ((map = kmalloc(sizeof(*map), GFP_KERNEL)) == NULL) ++ return -ENOMEM; ++ ++ map->id = vmai->cpt_anonvmaid; ++ map->avma = new_avma; ++ h = hash_long((unsigned long)vmai->cpt_anonvmaid, CPT_ANONVMA_HBITS); ++ hlist_add_head(&map->list, &ctx->anonvmas[h]); ++ } ++ return 0; ++} ++ ++static int copy_mm_pages(struct mm_struct *src, unsigned long start, ++ unsigned long end) ++{ ++ int err; ++ ++ for (; start < end; start += PAGE_SIZE) { ++ struct page *page; ++ struct page *spage; ++ void *maddr, *srcaddr; ++ ++ err = get_user_pages(current, current->mm, ++ start, 1, 1, 1, &page, NULL); ++ if (err == 0) ++ err = -EFAULT; ++ if (err < 0) ++ return err; ++ ++ err = get_user_pages(current, src, ++ start, 1, 0, 1, &spage, NULL); ++ ++ if (err == 0) ++ err = -EFAULT; ++ if (err < 0) { ++ page_cache_release(page); ++ return err; ++ } ++ ++ srcaddr = kmap(spage); ++ maddr = kmap(page); ++ memcpy(maddr, srcaddr, PAGE_SIZE); ++ set_page_dirty_lock(page); ++ kunmap(page); ++ kunmap(spage); ++ page_cache_release(page); ++ page_cache_release(spage); ++ } ++ return 0; ++} ++ ++static int do_rst_vma(struct cpt_vma_image *vmai, loff_t vmapos, loff_t mmpos, struct cpt_context *ctx) ++{ ++ int err = 0; ++ unsigned long addr; ++ struct mm_struct *mm = current->mm; ++ struct vm_area_struct *vma; ++ struct file *file = NULL; ++ unsigned long prot; ++ int checked = 0; ++ ++ if (vmai->cpt_type == CPT_VMA_VDSO) { ++ if (ctx->vdso == NULL) { ++#ifdef ARCH_HAS_SETUP_ADDITIONAL_PAGES ++ err = arch_setup_additional_pages(NULL, 0, ++ vmai->cpt_start); ++#endif ++ goto out; ++ } ++ } ++ ++ prot = make_prot(vmai); ++ ++ if (vmai->cpt_file != CPT_NULL) { ++ if (vmai->cpt_type == CPT_VMA_TYPE_0) { ++ file = rst_file(vmai->cpt_file, -1, ctx); ++ if (IS_ERR(file)) { ++ eprintk_ctx("do_rst_vma: rst_file: %Ld\n", (unsigned long long)vmai->cpt_file); ++ return PTR_ERR(file); ++ } ++ } else if (vmai->cpt_type == CPT_VMA_TYPE_SHM) { ++ file = rst_sysv_shm_vma(vmai, ctx); ++ if (IS_ERR(file)) ++ return PTR_ERR(file); ++ } ++ } ++ ++ down_write(&mm->mmap_sem); ++ addr = do_mmap_pgoff(file, vmai->cpt_start, ++ vmai->cpt_end-vmai->cpt_start, ++ prot, make_flags(vmai), ++ vmai->cpt_pgoff); ++ ++ if (addr != vmai->cpt_start) { ++ up_write(&mm->mmap_sem); ++ ++ err = -EINVAL; ++ if (IS_ERR((void*)addr)) ++ err = addr; ++ goto out; ++ } ++ ++ vma = find_vma(mm, vmai->cpt_start); ++ if (vma == NULL) { ++ up_write(&mm->mmap_sem); ++ eprintk_ctx("cannot find mmapped vma\n"); ++ err = -ESRCH; ++ goto out; ++ } ++ ++ /* do_mmap_pgoff() can merge new area to previous one (not to the next, ++ * we mmap in order, the rest of mm is still unmapped). This can happen ++ * f.e. if flags are to be adjusted later, or if we had different ++ * anon_vma on two adjacent regions. Split it by brute force. */ ++ if (vma->vm_start != vmai->cpt_start) { ++ dprintk_ctx("vma %Ld merged, split\n", vmapos); ++ err = split_vma(mm, vma, (unsigned long)vmai->cpt_start, 0); ++ if (err) { ++ up_write(&mm->mmap_sem); ++ eprintk_ctx("cannot split vma\n"); ++ goto out; ++ } ++ } ++ up_write(&mm->mmap_sem); ++ ++ if (vmai->cpt_anonvma && vmai->cpt_anonvmaid) { ++ err = verify_create_anonvma(mm, vmai, ctx); ++ if (err) { ++ eprintk_ctx("cannot verify_create_anonvma %Ld\n", vmapos); ++ goto out; ++ } ++ } ++ ++ if (vmai->cpt_type == CPT_VMA_VDSO) { ++ struct page *page; ++ void *maddr; ++ ++ err = get_user_pages(current, current->mm, ++ (unsigned long)vmai->cpt_start, ++ 1, 1, 1, &page, NULL); ++ if (err == 0) ++ err = -EFAULT; ++ if (err < 0) { ++ eprintk_ctx("can't get vdso: get_user_pages: %d\n", err); ++ goto out; ++ } ++ err = 0; ++ maddr = kmap(page); ++ memcpy(maddr, ctx->vdso, PAGE_SIZE); ++ set_page_dirty_lock(page); ++ kunmap(page); ++ page_cache_release(page); ++ goto out; ++ } ++ ++ if (vmai->cpt_next > vmai->cpt_hdrlen) { ++ loff_t offset = vmapos + vmai->cpt_hdrlen; ++ ++ do { ++ union { ++ struct cpt_page_block pb; ++ struct cpt_remappage_block rpb; ++ struct cpt_copypage_block cpb; ++ struct cpt_lazypage_block lpb; ++ struct cpt_iterpage_block ipb; ++ } u; ++ loff_t pos; ++ ++ err = rst_get_object(-1, offset, &u, ctx); ++ if (err) { ++ eprintk_ctx("vma fix object: %d\n", err); ++ goto out; ++ } ++ if (u.rpb.cpt_object == CPT_OBJ_REMAPPAGES) { ++ err = sc_remap_file_pages(u.rpb.cpt_start, ++ u.rpb.cpt_end-u.rpb.cpt_start, ++ 0, u.rpb.cpt_pgoff, 0); ++ if (err < 0) { ++ eprintk_ctx("remap_file_pages: %d (%08x,%u,%u)\n", err, ++ (__u32)u.rpb.cpt_start, (__u32)(u.rpb.cpt_end-u.rpb.cpt_start), ++ (__u32)u.rpb.cpt_pgoff); ++ goto out; ++ } ++ offset += u.rpb.cpt_next; ++ continue; ++ } else if (u.cpb.cpt_object == CPT_OBJ_LAZYPAGES) { ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ unsigned long ptr = u.lpb.cpt_start; ++ ++ down_read(&mm->mmap_sem); ++ if ((vma = find_vma(mm, u.lpb.cpt_start)) == NULL) { ++ up_read(&mm->mmap_sem); ++ eprintk_ctx("lost vm_area_struct\n"); ++ err = -ESRCH; ++ goto out; ++ } ++ err = anon_vma_prepare(vma); ++ if (err) { ++ up_read(&mm->mmap_sem); ++ goto out; ++ } ++ while (ptr < u.lpb.cpt_end) { ++ err = rst_pagein(vma, u.lpb.cpt_index + (ptr-u.lpb.cpt_start)/PAGE_SIZE, ++ ptr, ctx); ++ if (err) ++ break; ++ ptr += PAGE_SIZE; ++ } ++ up_read(&mm->mmap_sem); ++#else ++ err = -EINVAL; ++#endif ++ if (err) ++ goto out; ++ offset += u.cpb.cpt_next; ++ continue; ++ } else if (u.cpb.cpt_object == CPT_OBJ_COPYPAGES) { ++ struct vm_area_struct *vma, *vma1; ++ struct mm_struct *src; ++ struct anon_vma *src_anon; ++ cpt_object_t *mobj; ++ ++ if (!vmai->cpt_anonvmaid) { ++ err = -EINVAL; ++ eprintk_ctx("CPT_OBJ_COPYPAGES in !anonvma\n"); ++ goto out; ++ } ++ ++ mobj = lookup_cpt_obj_bypos(CPT_OBJ_MM, u.cpb.cpt_source, ctx); ++ if (!mobj) { ++ eprintk_ctx("lost mm_struct to clone pages from\n"); ++ err = -ESRCH; ++ goto out; ++ } ++ src = mobj->o_obj; ++ ++ down_read(&src->mmap_sem); ++ src_anon = NULL; ++ vma1 = find_vma(src, u.cpb.cpt_start); ++ if (vma1) ++ src_anon = vma1->anon_vma; ++ up_read(&src->mmap_sem); ++ ++ if (!vma1) { ++ eprintk_ctx("lost src vm_area_struct\n"); ++ err = -ESRCH; ++ goto out; ++ } ++ ++ down_read(&mm->mmap_sem); ++ if ((vma = find_vma(mm, u.cpb.cpt_start)) == NULL) { ++ up_read(&mm->mmap_sem); ++ eprintk_ctx("lost vm_area_struct\n"); ++ err = -ESRCH; ++ goto out; ++ } ++ ++ if (!src_anon || ++ !vma->anon_vma || ++ vma->anon_vma != src_anon || ++ vma->vm_start - vma1->vm_start != ++ (vma->vm_pgoff - vma1->vm_pgoff) << PAGE_SHIFT) { ++ up_read(&mm->mmap_sem); ++ wprintk_ctx("anon_vma mismatch in vm_area_struct %Ld\n", vmapos); ++ err = copy_mm_pages(mobj->o_obj, ++ u.cpb.cpt_start, ++ u.cpb.cpt_end); ++ } else { ++ err = __copy_page_range(vma, vma1, ++ u.cpb.cpt_start, ++ u.cpb.cpt_end-u.cpb.cpt_start); ++ up_read(&mm->mmap_sem); ++ } ++ if (err) { ++ eprintk_ctx("clone_page_range: %d (%08x,%u,%ld)\n", err, ++ (__u32)u.cpb.cpt_start, (__u32)(u.cpb.cpt_end-u.cpb.cpt_start), ++ (long)u.cpb.cpt_source); ++ goto out; ++ } ++ ++ offset += u.cpb.cpt_next; ++ continue; ++ } else if (u.pb.cpt_object == CPT_OBJ_ITERPAGES || ++ u.pb.cpt_object == CPT_OBJ_ITERYOUNGPAGES ++ ) { ++#ifdef CONFIG_VZ_CHECKPOINT_ITER ++ unsigned long ptr = u.lpb.cpt_start; ++ u64 page_pos[16]; ++ pos = offset + sizeof(u.pb); ++ ++ err = ctx->pread(&page_pos, ++ 8*(u.lpb.cpt_end-ptr)/PAGE_SIZE, ++ ctx, ++ pos); ++ if (err) { ++ eprintk_ctx("Oops\n"); ++ goto out; ++ } ++ ++ down_read(&mm->mmap_sem); ++ if ((vma = find_vma(mm, u.lpb.cpt_start)) == NULL) { ++ up_read(&mm->mmap_sem); ++ eprintk_ctx("lost vm_area_struct\n"); ++ err = -ESRCH; ++ goto out; ++ } ++ err = anon_vma_prepare(vma); ++ if (err) { ++ up_read(&mm->mmap_sem); ++ goto out; ++ } ++ while (ptr < u.lpb.cpt_end) { ++ err = rst_iter(vma, ++ page_pos[(ptr-u.lpb.cpt_start)/PAGE_SIZE], ++ ptr, ++ ctx); ++ if (err) ++ break; ++ ptr += PAGE_SIZE; ++ } ++ if (u.pb.cpt_object == CPT_OBJ_ITERYOUNGPAGES) { ++ make_pages_present((unsigned long)u.lpb.cpt_start, ++ (unsigned long)u.lpb.cpt_end); ++ } ++ up_read(&mm->mmap_sem); ++#else ++ err = -EINVAL; ++#endif ++ if (err) ++ goto out; ++ offset += u.cpb.cpt_next; ++ continue; ++ } ++ if (u.pb.cpt_object != CPT_OBJ_PAGES) { ++ eprintk_ctx("unknown vma fix object %d\n", u.pb.cpt_object); ++ err = -EINVAL; ++ goto out; ++ } ++ pos = offset + sizeof(u.pb); ++ if (!(vmai->cpt_flags&VM_ACCOUNT) && !(prot&PROT_WRITE)) { ++ /* I guess this is get_user_pages() messed things, ++ * this happens f.e. when gdb inserts breakpoints. ++ */ ++ int i; ++ for (i=0; i<(u.pb.cpt_end-u.pb.cpt_start)/PAGE_SIZE; i++) { ++ struct page *page; ++ void *maddr; ++ err = get_user_pages(current, current->mm, ++ (unsigned long)u.pb.cpt_start + i*PAGE_SIZE, ++ 1, 1, 1, &page, NULL); ++ if (err == 0) ++ err = -EFAULT; ++ if (err < 0) { ++ eprintk_ctx("get_user_pages: %d\n", err); ++ goto out; ++ } ++ err = 0; ++ maddr = kmap(page); ++ if (u.pb.cpt_content == CPT_CONTENT_VOID) { ++ memset(maddr, 0, PAGE_SIZE); ++ } else if (u.pb.cpt_content == CPT_CONTENT_DATA) { ++ err = ctx->pread(maddr, PAGE_SIZE, ++ ctx, pos + i*PAGE_SIZE); ++ if (err) { ++ kunmap(page); ++ goto out; ++ } ++ } else { ++ err = -EINVAL; ++ kunmap(page); ++ goto out; ++ } ++ set_page_dirty_lock(page); ++ kunmap(page); ++ page_cache_release(page); ++ } ++ } else { ++ if (!(prot&PROT_WRITE)) ++ sc_mprotect(vmai->cpt_start, vmai->cpt_end-vmai->cpt_start, prot | PROT_WRITE); ++ if (u.pb.cpt_content == CPT_CONTENT_VOID) { ++ int i; ++ for (i=0; i<(u.pb.cpt_end-u.pb.cpt_start)/sizeof(unsigned long); i++) { ++ err = __put_user(0UL, ((unsigned long __user*)(unsigned long)u.pb.cpt_start) + i); ++ if (err) { ++ eprintk_ctx("__put_user 2 %d\n", err); ++ goto out; ++ } ++ } ++ } else if (u.pb.cpt_content == CPT_CONTENT_DATA) { ++ loff_t tpos = pos; ++ err = ctx->file->f_op->read(ctx->file, cpt_ptr_import(u.pb.cpt_start), ++ u.pb.cpt_end-u.pb.cpt_start, ++ &tpos); ++ if (err != u.pb.cpt_end-u.pb.cpt_start) { ++ if (err >= 0) ++ err = -EIO; ++ goto out; ++ } ++ } else { ++ err = -EINVAL; ++ goto out; ++ } ++ if (!(prot&PROT_WRITE)) ++ sc_mprotect(vmai->cpt_start, vmai->cpt_end-vmai->cpt_start, prot); ++ } ++ err = 0; ++ offset += u.pb.cpt_next; ++ } while (offset < vmapos + vmai->cpt_next); ++ } ++ ++check: ++ do { ++ struct vm_area_struct *vma; ++ down_read(&mm->mmap_sem); ++ vma = find_vma(mm, addr); ++ if (vma) { ++ if ((vma->vm_flags^vmai->cpt_flags)&VM_READHINTMASK) { ++ VM_ClearReadHint(vma); ++ vma->vm_flags |= vmai->cpt_flags&VM_READHINTMASK; ++ } ++ if ((vma->vm_flags^vmai->cpt_flags)&VM_LOCKED) { ++ dprintk_ctx("fixing up VM_LOCKED %Ld\n", vmapos); ++ up_read(&mm->mmap_sem); ++ if (vma->vm_flags&VM_LOCKED) ++ err = sc_munlock(vmai->cpt_start, vmai->cpt_end-vmai->cpt_start); ++ else ++ err = sc_mlock(vmai->cpt_start, vmai->cpt_end-vmai->cpt_start); ++ /* When mlock fails with EFAULT, it means ++ * that it could not bring in pages. ++ * It can happen after mlock() on unreadable ++ * VMAs. But VMA is correctly locked, ++ * so that this error can be ignored. */ ++ if (err == -EFAULT) ++ err = 0; ++ if (err) ++ goto out; ++ goto check; ++ } ++ if ((vma->vm_page_prot.pgprot^vmai->cpt_pgprot)&~__PAGE_NX) ++ wprintk_ctx("VMA %08lx@%ld pgprot mismatch %08Lx %08Lx\n", addr, (long)vmapos, ++ (unsigned long long)vma->vm_page_prot.pgprot, ++ (unsigned long long)vmai->cpt_pgprot); ++#if defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64) ++ if (((vma->vm_page_prot.pgprot^vmai->cpt_pgprot)&__PAGE_NX) && ++ (ctx->kernel_config_flags&CPT_KERNEL_CONFIG_PAE)) ++ wprintk_ctx("VMA %08lx@%ld pgprot mismatch %08Lx %08Lx\n", addr, (long)vmapos, ++ (__u64)vma->vm_page_prot.pgprot, (__u64)vmai->cpt_pgprot); ++#endif ++ if (vma->vm_flags != vmai->cpt_flags) { ++ unsigned long x = vma->vm_flags ^ vmai->cpt_flags; ++ if (x & VM_EXEC) { ++ /* Crap. On i386 this is OK. ++ * It is impossible to make via mmap/mprotect ++ * exec.c clears VM_EXEC on stack. */ ++ vma->vm_flags &= ~VM_EXEC; ++ } else if ((x & VM_ACCOUNT) && !checked) { ++ checked = 1; ++ if (!(prot&PROT_WRITE)) { ++ up_read(&mm->mmap_sem); ++ sc_mprotect(vmai->cpt_start, vmai->cpt_end-vmai->cpt_start, prot | PROT_WRITE); ++ sc_mprotect(vmai->cpt_start, vmai->cpt_end-vmai->cpt_start, prot); ++ goto check; ++ } ++ wprintk_ctx("VMA %08lx@%ld flag mismatch %08x %08x\n", addr, (long)vmapos, ++ (__u32)vma->vm_flags, (__u32)vmai->cpt_flags); ++ } else { ++ wprintk_ctx("VMA %08lx@%ld flag mismatch %08x %08x\n", addr, (long)vmapos, ++ (__u32)vma->vm_flags, (__u32)vmai->cpt_flags); ++ } ++ } ++ } else { ++ wprintk_ctx("no VMA for %08lx@%ld\n", addr, (long)vmapos); ++ } ++ up_read(&mm->mmap_sem); ++ } while (0); ++ ++out: ++ if (file) ++ fput(file); ++ return err; ++} ++ ++#ifndef CONFIG_IA64 ++#define TASK_UNMAP_START 0 ++#else ++/* On IA64 the first page is a special VM_IO|VM_RESERVED mapping ++ * used to accelerate speculative dereferences of NULL pointer. */ ++#define TASK_UNMAP_START PAGE_SIZE ++#endif ++ ++static int do_rst_mm(struct cpt_mm_image *vmi, loff_t pos, struct cpt_context *ctx) ++{ ++ int err = 0; ++ unsigned int def_flags; ++ struct mm_struct *mm = current->mm; ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *bc; ++#endif ++ ++ down_write(&mm->mmap_sem); ++ do_munmap(mm, TASK_UNMAP_START, TASK_SIZE-TASK_UNMAP_START); ++ ++#ifdef CONFIG_BEANCOUNTERS ++ /* ++ * MM beancounter is usually correct from the fork time, ++ * but not for init, for example. ++ * Luckily, mm_ub can be changed for a completely empty MM. ++ */ ++ bc = rst_lookup_ubc(vmi->cpt_mmub, ctx); ++ err = virtinfo_notifier_call(VITYPE_SCP, VIRTINFO_SCP_RSTMM, bc); ++ if (err & NOTIFY_FAIL) { ++ up_write(&mm->mmap_sem); ++ return -ECHRNG; ++ } ++ if ((err & VIRTNOTIFY_CHANGE) && bc != mm->mm_ub) { ++ struct user_beancounter *old_bc; ++ ++ old_bc = mm->mm_ub; ++ mm->mm_ub = bc; ++ bc = old_bc; ++ } ++ err = 0; ++ put_beancounter(bc); ++#endif ++ ++ mm->start_code = vmi->cpt_start_code; ++ mm->end_code = vmi->cpt_end_code; ++ mm->start_data = vmi->cpt_start_data; ++ mm->end_data = vmi->cpt_end_data; ++ mm->start_brk = vmi->cpt_start_brk; ++ mm->brk = vmi->cpt_brk; ++ mm->start_stack = vmi->cpt_start_stack; ++ mm->arg_start = vmi->cpt_start_arg; ++ mm->arg_end = vmi->cpt_end_arg; ++ mm->env_start = vmi->cpt_start_env; ++ mm->env_end = vmi->cpt_end_env; ++ mm->def_flags = 0; ++ def_flags = vmi->cpt_def_flags; ++ ++ mm->flags = vmi->cpt_dumpable; ++ if (ctx->image_version < CPT_VERSION_24) ++ mm->flags |= MMF_DUMP_FILTER_DEFAULT << MMF_DUMPABLE_BITS; ++ ++ mm->vps_dumpable = vmi->cpt_vps_dumpable; ++#ifndef CONFIG_IA64 ++ if (ctx->image_version >= CPT_VERSION_9) { ++ mm->context.vdso = cpt_ptr_import(vmi->cpt_vdso); ++ current_thread_info()->sysenter_return = CPT_SYSENTER_RETURN; ++ } ++#endif ++ ++#if 0 /* def CONFIG_HUGETLB_PAGE*/ ++/* NB: ? */ ++ int used_hugetlb; ++#endif ++ up_write(&mm->mmap_sem); ++ ++ if (vmi->cpt_next > vmi->cpt_hdrlen) { ++ loff_t offset = pos + vmi->cpt_hdrlen; ++ do { ++ union { ++ struct cpt_vma_image vmai; ++ struct cpt_aio_ctx_image aioi; ++ struct cpt_obj_bits bits; ++ } u; ++ err = rst_get_object(-1, offset, &u, ctx); ++ if (err) ++ goto out; ++ if (u.vmai.cpt_object == CPT_OBJ_VMA) { ++#ifdef CONFIG_IA64 ++ //// Later... ++ if (u.vmai.cpt_start) ++#endif ++ err = do_rst_vma(&u.vmai, offset, pos, ctx); ++ if (err) ++ goto out; ++#ifdef CONFIG_X86 ++ } else if (u.bits.cpt_object == CPT_OBJ_BITS && ++ u.bits.cpt_content == CPT_CONTENT_MM_CONTEXT) { ++ err = do_rst_ldt(&u.bits, offset, ctx); ++ if (err) ++ goto out; ++#endif ++ } else if (u.aioi.cpt_object == CPT_OBJ_AIO_CONTEXT) { ++ err = do_rst_aio(&u.aioi, offset, ctx); ++ if (err) ++ goto out; ++ } else { ++ eprintk_ctx("unknown object %u in mm image\n", u.vmai.cpt_object); ++ err = -EINVAL; ++ goto out; ++ } ++ offset += u.vmai.cpt_next; ++ } while (offset < pos + vmi->cpt_next); ++ } ++ ++ down_write(&mm->mmap_sem); ++ mm->def_flags = def_flags; ++ up_write(&mm->mmap_sem); ++ ++ ++out: ++ return err; ++} ++ ++extern void exit_mm(struct task_struct * tsk); ++ ++int rst_mm_complete(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ int err = 0; ++ cpt_object_t *mobj; ++ void *tmp = (void*)__get_free_page(GFP_KERNEL); ++ struct cpt_mm_image *vmi = (struct cpt_mm_image *)tmp; ++ ++ if (!tmp) ++ return -ENOMEM; ++ ++ if (ti->cpt_mm == CPT_NULL) { ++ if (current->mm) { ++ virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_EXIT, ++ current); ++ exit_mm(current); ++ } ++ goto out; ++ } ++ ++ mobj = lookup_cpt_obj_bypos(CPT_OBJ_MM, ti->cpt_mm, ctx); ++ if (mobj) { ++ if (current->mm != mobj->o_obj) BUG(); ++ goto out; ++ } ++ ++ if (current->mm == NULL) { ++ struct mm_struct *mm = mm_alloc(); ++ if (mm == NULL) { ++ err = -ENOMEM; ++ goto out; ++ } ++ err = init_new_context(current, mm); ++ if (err) { ++ mmdrop(mm); ++ goto out; ++ } ++ current->mm = mm; ++ } ++ ++ if ((err = rst_get_object(CPT_OBJ_MM, ti->cpt_mm, vmi, ctx)) != 0) ++ goto out; ++ if ((err = do_rst_mm(vmi, ti->cpt_mm, ctx)) != 0) { ++ eprintk_ctx("do_rst_mm %Ld\n", (unsigned long long)ti->cpt_mm); ++ goto out; ++ } ++ err = -ENOMEM; ++ mobj = cpt_object_add(CPT_OBJ_MM, current->mm, ctx); ++ if (mobj != NULL) { ++ err = 0; ++ cpt_obj_setpos(mobj, ti->cpt_mm, ctx); ++ } ++ ++out: ++ if (tmp) ++ free_page((unsigned long)tmp); ++ return err; ++} ++ ++/* This is part of mm setup, made in parent context. Mostly, it is the place, ++ * where we graft mm of another process to child. ++ */ ++ ++int rst_mm_basic(cpt_object_t *obj, struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ struct task_struct *tsk = obj->o_obj; ++ cpt_object_t *mobj; ++ ++ /* Task without mm. Just get rid of this. */ ++ if (ti->cpt_mm == CPT_NULL) { ++ if (tsk->mm) { ++ virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_EXIT, ++ tsk); ++ mmput(tsk->mm); ++ tsk->mm = NULL; ++ } ++ return 0; ++ } ++ ++ mobj = lookup_cpt_obj_bypos(CPT_OBJ_MM, ti->cpt_mm, ctx); ++ if (mobj) { ++ struct mm_struct *newmm = mobj->o_obj; ++ /* Good, the MM is already created. */ ++ if (newmm == tsk->mm) { ++ /* Already done by clone(). */ ++ return 0; ++ } ++ mmput(tsk->mm); ++ atomic_inc(&newmm->mm_users); ++ tsk->mm = newmm; ++ tsk->active_mm = newmm; ++ } ++ return 0; ++} ++ ++/* We use CLONE_VM when mm of child is going to be shared with parent. ++ * Otherwise mm is copied. ++ */ ++ ++__u32 rst_mm_flag(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ if (ti->cpt_mm == CPT_NULL || ++ lookup_cpt_obj_bypos(CPT_OBJ_MM, ti->cpt_mm, ctx)) ++ return CLONE_VM; ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_net.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_net.c +--- ./kernel/cpt/rst_net.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_net.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,736 @@ ++/* ++ * ++ * kernel/cpt/rst_net.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_kernel.h" ++#include "cpt_net.h" ++#include "cpt_files.h" ++ ++#include "cpt_syscalls.h" ++ ++extern struct in_ifaddr *inet_alloc_ifa(void); ++extern int inet_insert_ifa(struct in_ifaddr *ifa); ++extern struct in_device *inetdev_init(struct net_device *dev); ++ ++int rst_restore_ifaddr(struct cpt_context *ctx) ++{ ++ struct net *net = get_exec_env()->ve_netns; ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_NET_IFADDR]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ struct cpt_ifaddr_image di; ++ struct net_device *dev; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_NET_IFADDR || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ int cindex = -1; ++ int err; ++ err = rst_get_object(CPT_OBJ_NET_IFADDR, sec, &di, ctx); ++ if (err) ++ return err; ++ cindex = di.cpt_index; ++ rtnl_lock(); ++ dev = __dev_get_by_index(net, cindex); ++ if (dev && di.cpt_family == AF_INET) { ++ struct in_device *in_dev; ++ struct in_ifaddr *ifa; ++ if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) ++ in_dev = inetdev_init(dev); ++ ifa = inet_alloc_ifa(); ++ if (ifa) { ++ ifa->ifa_local = di.cpt_address[0]; ++ ifa->ifa_address = di.cpt_peer[0]; ++ ifa->ifa_broadcast = di.cpt_broadcast[0]; ++ ifa->ifa_prefixlen = di.cpt_masklen; ++ ifa->ifa_mask = inet_make_mask(ifa->ifa_prefixlen); ++ ifa->ifa_flags = di.cpt_flags; ++ ifa->ifa_scope = di.cpt_scope; ++ memcpy(ifa->ifa_label, di.cpt_label, IFNAMSIZ); ++ in_dev_hold(in_dev); ++ ifa->ifa_dev = in_dev; ++ err = inet_insert_ifa(ifa); ++ if (err && err != -EEXIST) { ++ rtnl_unlock(); ++ eprintk_ctx("add ifaddr err %d for %d %s\n", err, di.cpt_index, di.cpt_label); ++ return err; ++ } ++ } ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++ } else if (dev && di.cpt_family == AF_INET6) { ++ __u32 prefered_lft; ++ __u32 valid_lft; ++ prefered_lft = (di.cpt_flags & IFA_F_DEPRECATED) ? ++ 0 : di.cpt_prefered_lft; ++ valid_lft = (di.cpt_flags & IFA_F_PERMANENT) ? ++ 0xFFFFFFFF : di.cpt_valid_lft; ++ err = inet6_addr_add(dev->ifindex, ++ (struct in6_addr *)di.cpt_address, ++ di.cpt_masklen, 0, ++ prefered_lft, ++ valid_lft); ++ if (err && err != -EEXIST) { ++ rtnl_unlock(); ++ eprintk_ctx("add ifaddr err %d for %d %s\n", err, di.cpt_index, di.cpt_label); ++ return err; ++ } ++#endif ++ } else { ++ rtnl_unlock(); ++ eprintk_ctx("unknown ifaddr 2 for %d\n", di.cpt_index); ++ return -EINVAL; ++ } ++ rtnl_unlock(); ++ sec += di.cpt_next; ++ } ++ return 0; ++} ++ ++static int rewrite_rtmsg(struct nlmsghdr *nlh, struct cpt_context *ctx) ++{ ++ int min_len = NLMSG_LENGTH(sizeof(struct rtmsg)); ++ struct rtmsg *rtm = NLMSG_DATA(nlh); ++ __u32 prefix0 = 0; ++ ++ if (nlh->nlmsg_len > min_len) { ++ int attrlen = nlh->nlmsg_len - NLMSG_ALIGN(min_len); ++ struct rtattr *rta = (void*)nlh + NLMSG_ALIGN(min_len); ++ ++ while (RTA_OK(rta, attrlen)) { ++ if (rta->rta_type == RTA_DST) { ++ prefix0 = *(__u32*)RTA_DATA(rta); ++ } ++ rta = RTA_NEXT(rta, attrlen); ++ } ++ } ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++ if (rtm->rtm_family == AF_INET6) { ++ if (rtm->rtm_type == RTN_LOCAL) ++ return 2; ++ if (rtm->rtm_flags & RTM_F_CLONED) ++ return 2; ++ if (rtm->rtm_protocol == RTPROT_UNSPEC || ++ rtm->rtm_protocol == RTPROT_RA || ++ rtm->rtm_protocol == RTPROT_REDIRECT || ++ rtm->rtm_protocol == RTPROT_KERNEL) ++ return 2; ++ if (rtm->rtm_protocol == RTPROT_BOOT && ++ ((rtm->rtm_dst_len == 8 && prefix0 == htonl(0xFF000000)) || ++ (rtm->rtm_dst_len == 64 && prefix0 == htonl(0xFE800000)))) ++ return 2; ++ } ++#endif ++ return rtm->rtm_protocol == RTPROT_KERNEL; ++} ++ ++int rst_restore_route(struct cpt_context *ctx) ++{ ++ int err; ++ struct socket *sock; ++ struct msghdr msg; ++ struct iovec iov; ++ struct sockaddr_nl nladdr; ++ mm_segment_t oldfs; ++ loff_t sec = ctx->sections[CPT_SECT_NET_ROUTE]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ struct cpt_object_hdr v; ++ char *pg; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_NET_ROUTE || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ if (h.cpt_hdrlen >= h.cpt_next) ++ return 0; ++ ++ sec += h.cpt_hdrlen; ++ err = rst_get_object(CPT_OBJ_NET_ROUTE, sec, &v, ctx); ++ if (err < 0) ++ return err; ++ ++ err = sock_create_kern(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE, &sock); ++ if (err) ++ return err; ++ ++ pg = (char*)__get_free_page(GFP_KERNEL); ++ if (pg == NULL) { ++ err = -ENOMEM; ++ goto out_sock; ++ } ++ ++ memset(&nladdr, 0, sizeof(nladdr)); ++ nladdr.nl_family = AF_NETLINK; ++ ++ endsec = sec + v.cpt_next; ++ sec += v.cpt_hdrlen; ++ ++ while (sec < endsec) { ++ struct nlmsghdr *n; ++ struct nlmsghdr nh; ++ int kernel_flag; ++ ++ if (endsec - sec < sizeof(nh)) ++ break; ++ ++ err = ctx->pread(&nh, sizeof(nh), ctx, sec); ++ if (err) ++ goto out_sock_pg; ++ if (nh.nlmsg_len < sizeof(nh) || nh.nlmsg_len > PAGE_SIZE || ++ endsec - sec < nh.nlmsg_len) { ++ err = -EINVAL; ++ goto out_sock_pg; ++ } ++ err = ctx->pread(pg, nh.nlmsg_len, ctx, sec); ++ if (err) ++ goto out_sock_pg; ++ ++ n = (struct nlmsghdr*)pg; ++ n->nlmsg_flags = NLM_F_REQUEST|NLM_F_APPEND|NLM_F_CREATE; ++ ++ err = rewrite_rtmsg(n, ctx); ++ if (err < 0) ++ goto out_sock_pg; ++ kernel_flag = err; ++ ++ if (kernel_flag == 2) ++ goto do_next; ++ ++ iov.iov_base=n; ++ iov.iov_len=nh.nlmsg_len; ++ msg.msg_name=&nladdr; ++ msg.msg_namelen=sizeof(nladdr); ++ msg.msg_iov=&iov; ++ msg.msg_iovlen=1; ++ msg.msg_control=NULL; ++ msg.msg_controllen=0; ++ msg.msg_flags=MSG_DONTWAIT; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ err = sock_sendmsg(sock, &msg, nh.nlmsg_len); ++ set_fs(oldfs); ++ ++ if (err < 0) ++ goto out_sock_pg; ++ err = 0; ++ ++ iov.iov_base=pg; ++ iov.iov_len=PAGE_SIZE; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ err = sock_recvmsg(sock, &msg, PAGE_SIZE, MSG_DONTWAIT); ++ set_fs(oldfs); ++ if (err != -EAGAIN) { ++ if (err == NLMSG_LENGTH(sizeof(struct nlmsgerr)) && ++ n->nlmsg_type == NLMSG_ERROR) { ++ struct nlmsgerr *e = NLMSG_DATA(n); ++ if (e->error != -EEXIST || !kernel_flag) ++ eprintk_ctx("NLMERR: %d\n", e->error); ++ } else { ++ eprintk_ctx("Res: %d %d\n", err, n->nlmsg_type); ++ } ++ } ++do_next: ++ err = 0; ++ sec += NLMSG_ALIGN(nh.nlmsg_len); ++ } ++ ++out_sock_pg: ++ free_page((unsigned long)pg); ++out_sock: ++ sock_release(sock); ++ return err; ++} ++ ++int rst_resume_network(struct cpt_context *ctx) ++{ ++ struct ve_struct *env; ++ ++ env = get_ve_by_id(ctx->ve_id); ++ if (!env) ++ return -ESRCH; ++ env->disable_net = 0; ++ put_ve(env); ++ return 0; ++} ++ ++/* We do not restore skb queue, just reinit it */ ++static int rst_restore_tuntap(loff_t start, struct cpt_netdev_image *di, ++ struct cpt_context *ctx) ++{ ++ int err = -ENODEV; ++#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) ++ struct cpt_tuntap_image ti; ++ struct net_device *dev; ++ struct file *bind_file = NULL; ++ struct tun_struct *tun; ++ loff_t pos; ++ ++ pos = start + di->cpt_hdrlen; ++ err = rst_get_object(CPT_OBJ_NET_TUNTAP, pos, &ti, ctx); ++ if (err) ++ return err; ++ ++ pos += ti.cpt_next; ++ if (ti.cpt_bindfile) { ++ bind_file = rst_file(ti.cpt_bindfile, -1, ctx); ++ if (IS_ERR(bind_file)) { ++ eprintk_ctx("rst_restore_tuntap:" ++ "rst_file: %Ld\n", ++ (unsigned long long)ti.cpt_bindfile); ++ return PTR_ERR(bind_file); ++ } ++ } ++ ++ rtnl_lock(); ++ err = -ENOMEM; ++ dev = alloc_netdev(sizeof(struct tun_struct), di->cpt_name, tun_setup); ++ if (!dev) ++ goto out; ++ dev->nd_net = get_exec_env()->ve_netns; ++ ++ tun = netdev_priv(dev); ++ ++ tun->dev = dev; ++ tun->owner = ti.cpt_owner; ++ tun->flags = ti.cpt_flags; ++ tun->attached = ti.cpt_attached; ++ tun->if_flags = ti.cpt_if_flags; ++ tun_net_init(dev); ++ BUG_ON(sizeof(ti.cpt_dev_addr) != sizeof(tun->dev_addr)); ++ memcpy(tun->dev_addr, ti.cpt_dev_addr, sizeof(ti.cpt_dev_addr)); ++ BUG_ON(sizeof(ti.cpt_chr_filter) != sizeof(tun->chr_filter)); ++ memcpy(tun->chr_filter, ti.cpt_chr_filter, sizeof(ti.cpt_chr_filter)); ++ BUG_ON(sizeof(ti.cpt_net_filter) != sizeof(tun->net_filter)); ++ memcpy(tun->net_filter, ti.cpt_net_filter, sizeof(ti.cpt_net_filter)); ++ ++ err = register_netdevice(dev); ++ if (err < 0) { ++ free_netdev(dev); ++ eprintk_ctx("failed to register tun/tap net device\n"); ++ goto out; ++ } ++ if (pos < start + di->cpt_next) { ++ struct cpt_hwaddr_image hw; ++ /* Restore hardware address */ ++ err = rst_get_object(CPT_OBJ_NET_HWADDR, pos, ++ &hw, ctx); ++ if (err) ++ goto out; ++ BUG_ON(sizeof(hw.cpt_dev_addr) != sizeof(dev->dev_addr)); ++ memcpy(dev->dev_addr, hw.cpt_dev_addr, ++ sizeof(hw.cpt_dev_addr)); ++ } ++ list_add(&tun->list, &tun_dev_list); ++ ++ bind_file->private_data = tun; ++ tun->bind_file = bind_file; ++ ++out: ++ fput(bind_file); ++ rtnl_unlock(); ++#endif ++ return err; ++} ++ ++static int rst_restore_veth(loff_t pos, struct net_device *dev, ++ struct cpt_context *ctx) ++{ ++ int err = -ENODEV; ++#if defined(CONFIG_VE_ETHDEV) || defined(CONFIG_VE_ETHDEV_MODULE) ++ struct cpt_veth_image vi; ++ struct veth_struct *veth; ++ ++ if (!KSYMREF(veth_open) || dev->open != KSYMREF(veth_open)) { ++ eprintk_ctx("Module vzethdev is not loaded, " ++ "or device %s is not a veth device\n", dev->name); ++ return -EINVAL; ++ } ++ err = rst_get_object(CPT_OBJ_NET_VETH, pos, &vi, ctx); ++ if (err) ++ return err; ++ veth = veth_from_netdev(dev); ++ veth->allow_mac_change = vi.cpt_allow_mac_change; ++#endif ++ return err; ++} ++ ++static int rst_restore_netstats(loff_t pos, struct net_device *dev, ++ struct cpt_context * ctx) ++{ ++ struct cpt_netstats_image *n; ++ struct net_device_stats *stats = NULL; ++ struct net_device *lo = get_exec_env()->ve_netns->loopback_dev; ++ int err; ++ ++ if (!dev->get_stats) ++ return 0; ++ ++ n = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_NET_STATS, pos, n, ctx); ++ if (err) ++ goto out; ++ BUG_ON(sizeof(struct cpt_netstats_image) != n->cpt_hdrlen); ++ preempt_disable(); ++ if (dev == lo) ++ stats = &lo->stats; ++#if defined(CONFIG_VE_ETHDEV) || defined(CONFIG_VE_ETHDEV_MODULE) ++ else if (KSYMREF(veth_open) && dev->open == KSYMREF(veth_open)) ++ stats = veth_stats(dev, smp_processor_id()); ++#endif ++#if defined(CONFIG_VE_NETDEV) || defined(CONFIG_VE_NETDEV_MODULE) ++ else if (dev == get_exec_env()->_venet_dev) ++ stats = venet_stats(dev, smp_processor_id()); ++#endif ++#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) ++ if (dev->open == tun_net_open) ++ stats = &dev->stats; ++#endif ++ if (!stats) { ++ err = -ENODEV; ++ eprintk_ctx("Network device %s is not supported\n", dev->name); ++ goto out; ++ } ++ ++ stats->rx_packets = n->cpt_rx_packets; ++ stats->tx_packets = n->cpt_tx_packets; ++ stats->rx_bytes = n->cpt_rx_bytes; ++ stats->tx_bytes = n->cpt_tx_bytes; ++ stats->rx_errors = n->cpt_rx_errors; ++ stats->tx_errors = n->cpt_tx_errors; ++ stats->rx_dropped = n->cpt_rx_dropped; ++ stats->tx_dropped = n->cpt_tx_dropped; ++ stats->multicast = n->cpt_multicast; ++ stats->collisions = n->cpt_collisions; ++ stats->rx_length_errors = n->cpt_rx_length_errors; ++ stats->rx_over_errors = n->cpt_rx_over_errors; ++ stats->rx_crc_errors = n->cpt_rx_crc_errors; ++ stats->rx_frame_errors = n->cpt_rx_frame_errors; ++ stats->rx_fifo_errors = n->cpt_rx_fifo_errors; ++ stats->rx_missed_errors = n->cpt_rx_missed_errors; ++ stats->tx_aborted_errors = n->cpt_tx_aborted_errors; ++ stats->tx_carrier_errors = n->cpt_tx_carrier_errors; ++ stats->tx_fifo_errors = n->cpt_tx_fifo_errors; ++ stats->tx_heartbeat_errors = n->cpt_tx_heartbeat_errors; ++ stats->tx_window_errors = n->cpt_tx_window_errors; ++ stats->rx_compressed = n->cpt_rx_compressed; ++ stats->tx_compressed = n->cpt_tx_compressed; ++ ++out: ++ preempt_enable(); ++ cpt_release_buf(ctx); ++ return err; ++} ++ ++int rst_restore_netdev(struct cpt_context *ctx) ++{ ++ struct net *net = get_exec_env()->ve_netns; ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_NET_DEVICE]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ struct cpt_netdev_image di; ++ struct net_device *dev; ++ ++ get_exec_env()->disable_net = 1; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_NET_DEVICE || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ loff_t pos; ++ struct net_device *dev_new; ++ err = rst_get_object(CPT_OBJ_NET_DEVICE, sec, &di, ctx); ++ if (err) ++ return err; ++ ++ pos = sec + di.cpt_hdrlen; ++ if (di.cpt_next > sizeof(di)) { ++ struct cpt_object_hdr hdr; ++ err = ctx->pread(&hdr, sizeof(struct cpt_object_hdr), ++ ctx, sec + di.cpt_hdrlen); ++ if (err) ++ return err; ++ if (hdr.cpt_object == CPT_OBJ_NET_TUNTAP) { ++ err = rst_restore_tuntap(sec, &di, ctx); ++ if (err) { ++ eprintk_ctx("restore tuntap %s: %d\n", ++ di.cpt_name, err); ++ return err; ++ } ++ pos += hdr.cpt_next; ++ } ++ } ++ ++ rtnl_lock(); ++ dev = __dev_get_by_name(net, di.cpt_name); ++ if (dev) { ++ if (dev->ifindex != di.cpt_index) { ++ dev_new = __dev_get_by_index(net, di.cpt_index); ++ if (!dev_new) { ++ write_lock_bh(&dev_base_lock); ++ hlist_del(&dev->index_hlist); ++ if (dev->iflink == dev->ifindex) ++ dev->iflink = di.cpt_index; ++ dev->ifindex = di.cpt_index; ++ hlist_add_head(&dev->index_hlist, ++ dev_index_hash(net, dev->ifindex)); ++ write_unlock_bh(&dev_base_lock); ++ } else { ++ write_lock_bh(&dev_base_lock); ++ hlist_del(&dev->index_hlist); ++ hlist_del(&dev_new->index_hlist); ++ if (dev_new->iflink == dev_new->ifindex) ++ dev_new->iflink = dev->ifindex; ++ dev_new->ifindex = dev->ifindex; ++ if (dev->iflink == dev->ifindex) ++ dev->iflink = di.cpt_index; ++ dev->ifindex = di.cpt_index; ++ hlist_add_head(&dev->index_hlist, ++ dev_index_hash(net, dev->ifindex)); ++ hlist_add_head(&dev_new->index_hlist, ++ dev_index_hash(net, dev_new->ifindex)); ++ write_unlock_bh(&dev_base_lock); ++ } ++ } ++ if (di.cpt_flags^dev->flags) { ++ err = dev_change_flags(dev, di.cpt_flags); ++ if (err) ++ eprintk_ctx("dev_change_flags err: %d\n", err); ++ } ++ while (pos < sec + di.cpt_next) { ++ struct cpt_object_hdr hdr; ++ err = ctx->pread(&hdr, sizeof(struct cpt_object_hdr), ++ ctx, pos); ++ if (err) ++ goto out; ++ if (hdr.cpt_object == CPT_OBJ_NET_VETH) { ++ err = rst_restore_veth(pos, dev, ctx); ++ if (err) { ++ eprintk_ctx("restore veth %s: %d\n", ++ di.cpt_name, err); ++ goto out; ++ } ++ } else if (hdr.cpt_object == CPT_OBJ_NET_HWADDR) { ++ /* Restore hardware address */ ++ struct cpt_hwaddr_image hw; ++ err = rst_get_object(CPT_OBJ_NET_HWADDR, ++ pos, &hw, ctx); ++ if (err) ++ goto out; ++ BUG_ON(sizeof(hw.cpt_dev_addr) != ++ sizeof(dev->dev_addr)); ++ memcpy(dev->dev_addr, hw.cpt_dev_addr, ++ sizeof(hw.cpt_dev_addr)); ++ } else if (hdr.cpt_object == CPT_OBJ_NET_STATS) { ++ err = rst_restore_netstats(pos, dev, ctx); ++ if (err) { ++ eprintk_ctx("rst stats %s: %d\n", ++ di.cpt_name, err); ++ goto out; ++ } ++ } ++ pos += hdr.cpt_next; ++ } ++ } else { ++ eprintk_ctx("unknown interface 2 %s\n", di.cpt_name); ++ } ++ rtnl_unlock(); ++ sec += di.cpt_next; ++ } ++ return 0; ++out: ++ rtnl_unlock(); ++ return err; ++} ++ ++static int dumpfn(void *arg) ++{ ++ int i; ++ int *pfd = arg; ++ char *argv[] = { "iptables-restore", "-c", NULL }; ++ ++ if (pfd[0] != 0) ++ sc_dup2(pfd[0], 0); ++ ++ for (i=1; ifiles->fdt->max_fds; i++) ++ sc_close(i); ++ ++ module_put(THIS_MODULE); ++ ++ set_fs(KERNEL_DS); ++ i = sc_execve("/sbin/iptables-restore", argv, NULL); ++ if (i == -ENOENT) ++ i = sc_execve("/usr/sbin/iptables-restore", argv, NULL); ++ eprintk("failed to exec iptables-restore: %d\n", i); ++ return 255 << 8; ++} ++ ++static int rst_restore_iptables(struct cpt_context * ctx) ++{ ++ int err; ++ int pfd[2]; ++ struct file *f; ++ struct cpt_object_hdr v; ++ int n; ++ struct cpt_section_hdr h; ++ loff_t sec = ctx->sections[CPT_SECT_NET_IPTABLES]; ++ loff_t end; ++ int pid; ++ int status; ++ mm_segment_t oldfs; ++ sigset_t ignore, blocked; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_NET_IPTABLES || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ if (h.cpt_hdrlen == h.cpt_next) ++ return 0; ++ if (h.cpt_hdrlen > h.cpt_next) ++ return -EINVAL; ++ sec += h.cpt_hdrlen; ++ err = rst_get_object(CPT_OBJ_NAME, sec, &v, ctx); ++ if (err < 0) ++ return err; ++ ++ err = sc_pipe(pfd); ++ if (err < 0) ++ return err; ++ ignore.sig[0] = CPT_SIG_IGNORE_MASK; ++ sigprocmask(SIG_BLOCK, &ignore, &blocked); ++ pid = err = local_kernel_thread(dumpfn, (void*)pfd, SIGCHLD, 0); ++ if (err < 0) { ++ eprintk_ctx("iptables local_kernel_thread: %d\n", err); ++ goto out; ++ } ++ f = fget(pfd[1]); ++ sc_close(pfd[1]); ++ sc_close(pfd[0]); ++ ++ ctx->file->f_pos = sec + v.cpt_hdrlen; ++ end = sec + v.cpt_next; ++ do { ++ char *p; ++ char buf[16]; ++ ++ n = end - ctx->file->f_pos; ++ if (n > sizeof(buf)) ++ n = sizeof(buf); ++ ++ if (ctx->read(buf, n, ctx)) ++ break; ++ if ((p = memchr(buf, 0, n)) != NULL) ++ n = p - buf; ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ f->f_op->write(f, buf, n, &f->f_pos); ++ set_fs(oldfs); ++ } while (ctx->file->f_pos < end); ++ ++ fput(f); ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if ((err = sc_waitx(pid, 0, &status)) < 0) ++ eprintk_ctx("wait4: %d\n", err); ++ else if ((status & 0x7f) == 0) { ++ err = (status & 0xff00) >> 8; ++ if (err != 0) { ++ eprintk_ctx("iptables-restore exited with %d\n", err); ++ eprintk_ctx("Most probably some iptables modules are not loaded\n"); ++ err = -EINVAL; ++ } ++ } else { ++ eprintk_ctx("iptables-restore terminated\n"); ++ err = -EINVAL; ++ } ++ set_fs(oldfs); ++ sigprocmask(SIG_SETMASK, &blocked, NULL); ++ ++ return err; ++ ++out: ++ if (pfd[1] >= 0) ++ sc_close(pfd[1]); ++ if (pfd[0] >= 0) ++ sc_close(pfd[0]); ++ sigprocmask(SIG_SETMASK, &blocked, NULL); ++ return err; ++} ++ ++int rst_restore_net(struct cpt_context *ctx) ++{ ++ int err; ++ ++ err = rst_restore_netdev(ctx); ++ if (!err) ++ err = rst_restore_ifaddr(ctx); ++ if (!err) ++ err = rst_restore_route(ctx); ++ if (!err) ++ err = rst_restore_iptables(ctx); ++ if (!err) ++ err = rst_restore_ip_conntrack(ctx); ++ return err; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_proc.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_proc.c +--- ./kernel/cpt/rst_proc.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_proc.c 2012-11-13 15:20:15.372569067 +0000 +@@ -0,0 +1,581 @@ ++/* ++ * ++ * kernel/cpt/rst_proc.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_dump.h" ++#include "cpt_files.h" ++#include "cpt_mm.h" ++#include "cpt_kernel.h" ++ ++MODULE_AUTHOR("Alexey Kuznetsov "); ++MODULE_LICENSE("GPL"); ++ ++/* List of contexts and lock protecting the list */ ++static struct list_head cpt_context_list; ++static spinlock_t cpt_context_lock; ++ ++static int proc_read(char *buffer, char **start, off_t offset, ++ int length, int *eof, void *data) ++{ ++ off_t pos = 0; ++ off_t begin = 0; ++ int len = 0; ++ cpt_context_t *ctx; ++ ++ len += sprintf(buffer, "Ctx Id VE State\n"); ++ ++ spin_lock(&cpt_context_lock); ++ ++ list_for_each_entry(ctx, &cpt_context_list, ctx_list) { ++ len += sprintf(buffer+len,"%p %08x %-8u %d", ++ ctx, ++ ctx->contextid, ++ ctx->ve_id, ++ ctx->ctx_state ++ ); ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ len += pagein_info_printf(buffer+len, ctx); ++#endif ++ ++ buffer[len++] = '\n'; ++ ++ pos = begin+len; ++ if (pos < offset) { ++ len = 0; ++ begin = pos; ++ } ++ if (pos > offset+length) ++ goto done; ++ } ++ *eof = 1; ++ ++done: ++ spin_unlock(&cpt_context_lock); ++ *start = buffer + (offset - begin); ++ len -= (offset - begin); ++ if(len > length) ++ len = length; ++ if(len < 0) ++ len = 0; ++ return len; ++} ++ ++void rst_context_release(cpt_context_t *ctx) ++{ ++ list_del(&ctx->ctx_list); ++ spin_unlock(&cpt_context_lock); ++ ++ if (ctx->ctx_state > 0) ++ rst_resume(ctx); ++ ctx->ctx_state = CPT_CTX_ERROR; ++ ++ rst_close_dumpfile(ctx); ++ ++ if (ctx->anonvmas) { ++ int h; ++ for (h = 0; h < CPT_ANONVMA_HSIZE; h++) { ++ while (!hlist_empty(&ctx->anonvmas[h])) { ++ struct hlist_node *elem = ctx->anonvmas[h].first; ++ hlist_del(elem); ++ kfree(elem); ++ } ++ } ++ free_page((unsigned long)ctx->anonvmas); ++ } ++ cpt_flush_error(ctx); ++ if (ctx->errorfile) { ++ fput(ctx->errorfile); ++ ctx->errorfile = NULL; ++ } ++ if (ctx->error_msg) { ++ free_page((unsigned long)ctx->error_msg); ++ ctx->error_msg = NULL; ++ } ++#ifdef CONFIG_VZ_CHECKPOINT_ITER ++ rst_drop_iter_dir(ctx); ++#endif ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ if (ctx->pagein_file_out) ++ fput(ctx->pagein_file_out); ++ if (ctx->pagein_file_in) ++ fput(ctx->pagein_file_in); ++ if (ctx->pgin_task) ++ put_task_struct(ctx->pgin_task); ++#endif ++ if (ctx->filejob_queue) ++ rst_flush_filejobs(ctx); ++ if (ctx->vdso) ++ free_page((unsigned long)ctx->vdso); ++ if (ctx->objcount) ++ eprintk_ctx("%d objects leaked\n", ctx->objcount); ++ kfree(ctx); ++ ++ spin_lock(&cpt_context_lock); ++} ++ ++static void __cpt_context_put(cpt_context_t *ctx) ++{ ++ if (!--ctx->refcount) ++ rst_context_release(ctx); ++} ++ ++static void cpt_context_put(cpt_context_t *ctx) ++{ ++ spin_lock(&cpt_context_lock); ++ __cpt_context_put(ctx); ++ spin_unlock(&cpt_context_lock); ++} ++ ++cpt_context_t * rst_context_open(void) ++{ ++ cpt_context_t *ctx; ++ ++ if ((ctx = kmalloc(sizeof(*ctx), GFP_KERNEL)) != NULL) { ++ rst_context_init(ctx); ++ spin_lock(&cpt_context_lock); ++ list_add_tail(&ctx->ctx_list, &cpt_context_list); ++ spin_unlock(&cpt_context_lock); ++ ctx->error_msg = (char*)__get_free_page(GFP_KERNEL); ++ if (ctx->error_msg != NULL) ++ ctx->error_msg[0] = 0; ++ } ++ return ctx; ++} ++ ++void rst_report_error(int err, cpt_context_t *ctx) ++{ ++ if (ctx->statusfile) { ++ mm_segment_t oldfs; ++ int status = 7 /* VZ_ENVCREATE_ERROR */; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if (ctx->statusfile->f_op && ctx->statusfile->f_op->write) ++ ctx->statusfile->f_op->write(ctx->statusfile, (char*)&status, sizeof(status), &ctx->statusfile->f_pos); ++ set_fs(oldfs); ++ fput(ctx->statusfile); ++ ctx->statusfile = NULL; ++ } ++} ++ ++ ++static cpt_context_t * cpt_context_lookup(unsigned int ctxid) ++{ ++ cpt_context_t *ctx; ++ ++ spin_lock(&cpt_context_lock); ++ list_for_each_entry(ctx, &cpt_context_list, ctx_list) { ++ if (ctx->contextid == ctxid) { ++ ctx->refcount++; ++ spin_unlock(&cpt_context_lock); ++ return ctx; ++ } ++ } ++ spin_unlock(&cpt_context_lock); ++ return NULL; ++} ++ ++static int rst_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg) ++{ ++ int err = 0; ++ cpt_context_t *ctx; ++ struct file *dfile = NULL; ++ ++ unlock_kernel(); ++ ++ if (cmd == CPT_TEST_CAPS) { ++ err = test_cpu_caps(); ++ goto out_lock; ++ } ++ ++ if (cmd == CPT_JOIN_CONTEXT || cmd == CPT_PUT_CONTEXT) { ++ cpt_context_t *old_ctx; ++ ++ ctx = NULL; ++ if (cmd == CPT_JOIN_CONTEXT) { ++ err = -ENOENT; ++ ctx = cpt_context_lookup(arg); ++ if (!ctx) ++ goto out_lock; ++ } ++ ++ spin_lock(&cpt_context_lock); ++ old_ctx = (cpt_context_t*)file->private_data; ++ file->private_data = ctx; ++ ++ if (old_ctx) { ++ if (cmd == CPT_PUT_CONTEXT && old_ctx->sticky) { ++ old_ctx->sticky = 0; ++ old_ctx->refcount--; ++ } ++ __cpt_context_put(old_ctx); ++ } ++ spin_unlock(&cpt_context_lock); ++ err = 0; ++ goto out_lock; ++ } ++ ++ spin_lock(&cpt_context_lock); ++ ctx = (cpt_context_t*)file->private_data; ++ if (ctx) ++ ctx->refcount++; ++ spin_unlock(&cpt_context_lock); ++ ++ if (!ctx) { ++ cpt_context_t *old_ctx; ++ ++ err = -ENOMEM; ++ ctx = rst_context_open(); ++ if (!ctx) ++ goto out_lock; ++ ++ spin_lock(&cpt_context_lock); ++ old_ctx = (cpt_context_t*)file->private_data; ++ if (!old_ctx) { ++ ctx->refcount++; ++ file->private_data = ctx; ++ } else { ++ old_ctx->refcount++; ++ } ++ if (old_ctx) { ++ __cpt_context_put(ctx); ++ ctx = old_ctx; ++ } ++ spin_unlock(&cpt_context_lock); ++ } ++ ++ if (cmd == CPT_GET_CONTEXT) { ++ unsigned int contextid = (unsigned int)arg; ++ ++ err = -EINVAL; ++ if (ctx->contextid && ctx->contextid != contextid) ++ goto out_nosem; ++ if (!ctx->contextid) { ++ cpt_context_t *c1 = cpt_context_lookup(contextid); ++ if (c1) { ++ cpt_context_put(c1); ++ err = -EEXIST; ++ goto out_nosem; ++ } ++ ctx->contextid = contextid; ++ } ++ spin_lock(&cpt_context_lock); ++ if (!ctx->sticky) { ++ ctx->sticky = 1; ++ ctx->refcount++; ++ } ++ spin_unlock(&cpt_context_lock); ++ err = 0; ++ goto out_nosem; ++ } ++ ++ down(&ctx->main_sem); ++ ++ err = -EBUSY; ++ if (ctx->ctx_state < 0) ++ goto out; ++ ++ err = 0; ++ switch (cmd) { ++ case CPT_SET_DUMPFD: ++ if (ctx->ctx_state > 0) { ++ err = -EBUSY; ++ break; ++ } ++ if (arg >= 0) { ++ err = -EBADF; ++ dfile = fget(arg); ++ if (dfile == NULL) ++ break; ++ if (dfile->f_op == NULL || ++ dfile->f_op->read == NULL) { ++ fput(dfile); ++ break; ++ } ++ err = 0; ++ } ++ if (ctx->file) ++ fput(ctx->file); ++ ctx->file = dfile; ++ break; ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ case CPT_SET_PAGEINFDIN: ++ if (ctx->ctx_state > 0) { ++ err = -EBUSY; ++ break; ++ } ++ if (arg >= 0) { ++ dfile = fget(arg); ++ if (dfile == NULL) { ++ err = -EBADF; ++ break; ++ } ++ } ++ if (ctx->pagein_file_in) ++ fput(ctx->pagein_file_in); ++ ctx->pagein_file_in = dfile; ++ break; ++ case CPT_SET_PAGEINFDOUT: ++ if (ctx->ctx_state > 0) { ++ err = -EBUSY; ++ break; ++ } ++ if (arg >= 0) { ++ dfile = fget(arg); ++ if (dfile == NULL) { ++ err = -EBADF; ++ break; ++ } ++ } ++ if (ctx->pagein_file_out) ++ fput(ctx->pagein_file_out); ++ ctx->pagein_file_out = dfile; ++ break; ++ case CPT_PAGEIND: ++ err = rst_pageind(ctx); ++ break; ++#endif ++#ifdef CONFIG_VZ_CHECKPOINT_ITER ++ case CPT_ITER: ++ err = rst_iteration(ctx); ++ break; ++#endif ++ case CPT_SET_LOCKFD: ++ if (ctx->ctx_state > 0) { ++ err = -EBUSY; ++ break; ++ } ++ if (arg >= 0) { ++ dfile = fget(arg); ++ if (dfile == NULL) { ++ err = -EBADF; ++ break; ++ } ++ } ++ if (ctx->lockfile) ++ fput(ctx->lockfile); ++ ctx->lockfile = dfile; ++ break; ++ case CPT_SET_STATUSFD: ++ if (ctx->ctx_state > 0) { ++ err = -EBUSY; ++ break; ++ } ++ if (arg >= 0) { ++ dfile = fget(arg); ++ if (dfile == NULL) { ++ err = -EBADF; ++ break; ++ } ++ } ++ if (ctx->statusfile) ++ fput(ctx->statusfile); ++ ctx->statusfile = dfile; ++ break; ++ case CPT_SET_ERRORFD: ++ if (arg >= 0) { ++ dfile = fget(arg); ++ if (dfile == NULL) { ++ err = -EBADF; ++ break; ++ } ++ } ++ if (ctx->errorfile) ++ fput(ctx->errorfile); ++ ctx->errorfile = dfile; ++ break; ++ case CPT_SET_VEID: ++ if (ctx->ctx_state > 0) { ++ err = -EBUSY; ++ break; ++ } ++ ctx->ve_id = arg; ++ break; ++ case CPT_UNDUMP: ++ if (ctx->ctx_state > 0) { ++ err = -ENOENT; ++ break; ++ } ++ ctx->ctx_state = CPT_CTX_UNDUMPING; ++ err = vps_rst_undump(ctx); ++ if (err) { ++ rst_report_error(err, ctx); ++ if (rst_kill(ctx) == 0) ++ ctx->ctx_state = CPT_CTX_IDLE; ++ } else { ++ ctx->ctx_state = CPT_CTX_UNDUMPED; ++ } ++ break; ++ case CPT_RESUME: ++ if (!ctx->ctx_state) { ++ err = -ENOENT; ++ break; ++ } ++ err = rst_resume(ctx); ++ if (!err) ++ ctx->ctx_state = CPT_CTX_IDLE; ++ break; ++ case CPT_KILL: ++ if (!ctx->ctx_state) { ++ err = -ENOENT; ++ break; ++ } ++ err = rst_kill(ctx); ++ if (!err) ++ ctx->ctx_state = CPT_CTX_IDLE; ++ break; ++ default: ++ err = -EINVAL; ++ break; ++ } ++ ++out: ++ cpt_flush_error(ctx); ++ up(&ctx->main_sem); ++out_nosem: ++ cpt_context_put(ctx); ++out_lock: ++ lock_kernel(); ++ if (err == -ERESTARTSYS || err == -ERESTARTNOINTR || ++ err == -ERESTARTNOHAND || err == -ERESTART_RESTARTBLOCK) ++ err = -EINTR; ++ return err; ++} ++ ++static int rst_open(struct inode * inode, struct file * file) ++{ ++ if (!try_module_get(THIS_MODULE)) ++ return -EBUSY; ++ ++ return 0; ++} ++ ++static int rst_release(struct inode * inode, struct file * file) ++{ ++ cpt_context_t *ctx; ++ ++ spin_lock(&cpt_context_lock); ++ ctx = (cpt_context_t*)file->private_data; ++ file->private_data = NULL; ++ if (ctx) ++ __cpt_context_put(ctx); ++ spin_unlock(&cpt_context_lock); ++ ++ ++ module_put(THIS_MODULE); ++ return 0; ++} ++ ++static struct file_operations rst_fops = ++{ ++ .owner = THIS_MODULE, ++ .ioctl = rst_ioctl, ++ .open = rst_open, ++ .release = rst_release, ++}; ++ ++ ++static struct proc_dir_entry *proc_ent; ++extern void *schedule_tail_p; ++extern void schedule_tail_hook(void); ++ ++static struct ctl_table_header *ctl_header; ++ ++static ctl_table debug_table[] = { ++ { ++ .ctl_name = 9476, ++ .procname = "rst", ++ .data = &debug_level, ++ .maxlen = sizeof(debug_level), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec, ++ }, ++ { .ctl_name = 0 } ++}; ++static ctl_table root_table[] = { ++ { ++ .ctl_name = CTL_DEBUG, ++ .procname = "debug", ++ .mode = 0555, ++ .child = debug_table, ++ }, ++ { .ctl_name = 0 } ++}; ++ ++static int __init init_rst(void) ++{ ++ int err; ++ ++ err = -ENOMEM; ++ ctl_header = register_sysctl_table(root_table); ++ if (!ctl_header) ++ goto err_mon; ++ ++ spin_lock_init(&cpt_context_lock); ++ INIT_LIST_HEAD(&cpt_context_list); ++ ++ err = -EINVAL; ++ proc_ent = create_proc_entry_mod("rst", 0600, NULL, THIS_MODULE); ++ if (!proc_ent) ++ goto err_out; ++ ++ rst_fops.read = proc_ent->proc_fops->read; ++ rst_fops.write = proc_ent->proc_fops->write; ++ rst_fops.llseek = proc_ent->proc_fops->llseek; ++ proc_ent->proc_fops = &rst_fops; ++ ++ proc_ent->read_proc = proc_read; ++ proc_ent->data = NULL; ++ proc_ent->owner = THIS_MODULE; ++ return 0; ++ ++err_out: ++ unregister_sysctl_table(ctl_header); ++err_mon: ++ return err; ++} ++module_init(init_rst); ++ ++static void __exit exit_rst(void) ++{ ++ remove_proc_entry("rst", NULL); ++ unregister_sysctl_table(ctl_header); ++ ++ spin_lock(&cpt_context_lock); ++ while (!list_empty(&cpt_context_list)) { ++ cpt_context_t *ctx; ++ ctx = list_entry(cpt_context_list.next, cpt_context_t, ctx_list); ++ ++ if (!ctx->sticky) ++ ctx->refcount++; ++ ctx->sticky = 0; ++ ++ BUG_ON(ctx->refcount != 1); ++ ++ __cpt_context_put(ctx); ++ } ++ spin_unlock(&cpt_context_lock); ++} ++module_exit(exit_rst); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_process.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_process.c +--- ./kernel/cpt/rst_process.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_process.c 2012-11-13 15:20:15.376569065 +0000 +@@ -0,0 +1,1672 @@ ++/* ++ * ++ * kernel/cpt/rst_process.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_X86 ++#include ++#endif ++#include ++ ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_files.h" ++#include "cpt_mm.h" ++#include "cpt_ubc.h" ++#include "cpt_process.h" ++#include "cpt_kernel.h" ++ ++ ++#define HOOK_RESERVE 256 ++ ++struct resume_info ++{ ++ asmlinkage void (*hook)(struct resume_info *); ++ unsigned long hooks; ++#define HOOK_TID 0 ++#define HOOK_CONT 1 ++#define HOOK_LSI 2 ++#define HOOK_RESTART 3 ++ unsigned long tid_ptrs[2]; ++ siginfo_t last_siginfo; ++}; ++ ++#ifdef CONFIG_X86_32 ++ ++#define IN_SYSCALL(regs) ((long)(regs)->orig_eax >= 0) ++#define IN_ERROR(regs) ((long)(regs)->eax < 0) ++#define SYSCALL_ERRNO(regs) (-(long)((regs)->eax)) ++#define SYSCALL_RETVAL(regs) ((regs)->eax) ++#define SYSCALL_NR(regs) ((regs)->orig_eax) ++ ++#define SYSCALL_SETRET(regs,val) do { (regs)->eax = (val); } while (0) ++ ++#define SYSCALL_RESTART2(regs,new) do { (regs)->eax = (new); \ ++ (regs)->eip -= 2; } while (0) ++ ++#define syscall_is(tsk,regs,name) (SYSCALL_NR(regs) == __NR_##name) ++ ++/* In new kernels task_pt_regs() is define to something inappropriate */ ++#undef task_pt_regs ++#define task_pt_regs(t) ((struct pt_regs *)((t)->thread.esp0) - 1) ++ ++#elif defined(CONFIG_X86_64) ++ ++#define IN_SYSCALL(regs) ((long)(regs)->orig_rax >= 0) ++#define IN_ERROR(regs) ((long)(regs)->rax < 0) ++#define SYSCALL_ERRNO(regs) (-(long)((regs)->rax)) ++#define SYSCALL_RETVAL(regs) ((regs)->rax) ++#define SYSCALL_NR(regs) ((regs)->orig_rax) ++ ++#define SYSCALL_SETRET(regs,val) do { (regs)->rax = (val); } while (0) ++ ++#define SYSCALL_RESTART2(regs,new) do { (regs)->rax = (new); \ ++ (regs)->rip -= 2; } while (0) ++ ++#define __NR32_restart_syscall 0 ++#define __NR32_rt_sigtimedwait 177 ++#define __NR32_pause 29 ++#define __NR32_futex 240 ++ ++#define syscall_is(tsk,regs,name) ((!(task_thread_info(tsk)->flags&_TIF_IA32) && \ ++ SYSCALL_NR(regs) == __NR_##name) || \ ++ ((task_thread_info(tsk)->flags&_TIF_IA32) && \ ++ SYSCALL_NR(regs) == __NR32_##name)) ++ ++#elif defined (CONFIG_IA64) ++ ++#define IN_SYSCALL(regs) ((long)(regs)->cr_ifs >= 0) ++#define IN_ERROR(regs) ((long)(regs)->r10 == -1) ++#define SYSCALL_ERRNO(regs) ((regs)->r10 == -1 ? (long)((regs)->r8) : 0) ++#define SYSCALL_RETVAL(regs) ((regs)->r8) ++#define SYSCALL_NR(regs) ((regs)->cr_ifs >= 0 ? (regs)->r15 : -1) ++ ++#define SYSCALL_SETRET(regs,val) do { (regs)->r8 = (val); } while (0) ++ ++#define SYSCALL_RESTART2(regs,new) do { (regs)->r15 = (new); \ ++ (regs)->r10 = 0; \ ++ ia64_decrement_ip(regs); } while (0) ++ ++#define syscall_is(tsk,regs,name) (SYSCALL_NR(regs) == __NR_##name) ++ ++#else ++ ++#error This arch is not supported ++ ++#endif ++ ++#define SYSCALL_RESTART(regs) SYSCALL_RESTART2(regs, SYSCALL_NR(regs)) ++ ++pid_t vpid_to_pid(pid_t nr) ++{ ++ pid_t vnr; ++ struct pid *pid; ++ ++ rcu_read_lock(); ++ pid = find_vpid(nr); ++ vnr = (pid == NULL ? -1 : pid->numbers[0].nr); ++ rcu_read_unlock(); ++ return vnr; ++} ++ ++static void decode_siginfo(siginfo_t *info, struct cpt_siginfo_image *si) ++{ ++ memset(info, 0, sizeof(*info)); ++ switch(si->cpt_code & __SI_MASK) { ++ case __SI_TIMER: ++ info->si_tid = si->cpt_pid; ++ info->si_overrun = si->cpt_uid; ++ info->_sifields._timer._sigval.sival_ptr = cpt_ptr_import(si->cpt_sigval); ++ info->si_sys_private = si->cpt_utime; ++ break; ++ case __SI_POLL: ++ info->si_band = si->cpt_pid; ++ info->si_fd = si->cpt_uid; ++ break; ++ case __SI_FAULT: ++ info->si_addr = cpt_ptr_import(si->cpt_sigval); ++#ifdef __ARCH_SI_TRAPNO ++ info->si_trapno = si->cpt_pid; ++#endif ++ break; ++ case __SI_CHLD: ++ info->si_pid = si->cpt_pid; ++ info->si_uid = si->cpt_uid; ++ info->si_status = si->cpt_sigval; ++ info->si_stime = si->cpt_stime; ++ info->si_utime = si->cpt_utime; ++ break; ++ case __SI_KILL: ++ case __SI_RT: ++ case __SI_MESGQ: ++ default: ++ info->si_pid = si->cpt_pid; ++ info->si_uid = si->cpt_uid; ++ info->si_ptr = cpt_ptr_import(si->cpt_sigval); ++ break; ++ } ++ info->si_signo = si->cpt_signo; ++ info->si_errno = si->cpt_errno; ++ info->si_code = si->cpt_code; ++} ++ ++static int restore_sigqueue(struct task_struct *tsk, ++ struct sigpending *queue, unsigned long start, ++ unsigned long end) ++{ ++ while (start < end) { ++ struct cpt_siginfo_image *si = (struct cpt_siginfo_image *)start; ++ if (si->cpt_object == CPT_OBJ_SIGINFO) { ++ struct sigqueue *q = NULL; ++ struct user_struct *up; ++ ++ up = alloc_uid(get_exec_env()->ve_ns->user_ns, si->cpt_user); ++ if (!up) ++ return -ENOMEM; ++ q = kmem_cache_alloc(sigqueue_cachep, GFP_ATOMIC); ++ if (!q) { ++ free_uid(up); ++ return -ENOMEM; ++ } ++ if (ub_siginfo_charge(q, get_exec_ub())) { ++ kmem_cache_free(sigqueue_cachep, q); ++ free_uid(up); ++ return -ENOMEM; ++ } ++ ++ INIT_LIST_HEAD(&q->list); ++ /* Preallocated elements (posix timers) are not ++ * supported yet. It is safe to replace them with ++ * a private one. */ ++ q->flags = 0; ++ q->user = up; ++ atomic_inc(&q->user->sigpending); ++ ++ decode_siginfo(&q->info, si); ++ list_add_tail(&q->list, &queue->list); ++ } ++ start += si->cpt_next; ++ } ++ return 0; ++} ++ ++int rst_process_linkage(cpt_context_t *ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ struct cpt_task_image *ti = obj->o_image; ++ ++ if (tsk == NULL) { ++ eprintk_ctx("task %u(%s) is missing\n", ti->cpt_pid, ti->cpt_comm); ++ return -EINVAL; ++ } ++ ++ if (task_pgrp_vnr(tsk) != ti->cpt_pgrp) { ++ struct pid *pid; ++ ++ rcu_read_lock(); ++ pid = find_vpid(ti->cpt_pgrp); ++ if (!pid) { ++ eprintk_ctx("illegal PGRP " CPT_FID "\n", CPT_TID(tsk)); ++ return -EINVAL; ++ } ++ ++ write_lock_irq(&tasklist_lock); ++ if (task_pgrp_nr(tsk) != pid_nr(pid)) { ++ detach_pid(tsk, PIDTYPE_PGID); ++ set_task_pgrp(tsk, pid_nr(pid)); ++ if (thread_group_leader(tsk)) ++ attach_pid(tsk, PIDTYPE_PGID, pid); ++ } ++ write_unlock_irq(&tasklist_lock); ++ if (task_pgrp_nr(tsk) != pid_nr(pid)) { ++ eprintk_ctx("cannot set PGRP " CPT_FID "\n", CPT_TID(tsk)); ++ return -EINVAL; ++ } ++ rcu_read_unlock(); ++ } ++ if (task_session_vnr(tsk) != ti->cpt_session) { ++ struct pid *pid; ++ ++ rcu_read_lock(); ++ pid = find_vpid(ti->cpt_session); ++ if (!pid) { ++ eprintk_ctx("illegal SID " CPT_FID "\n", CPT_TID(tsk)); ++ return -EINVAL; ++ } ++ ++ write_lock_irq(&tasklist_lock); ++ if (task_session_nr(tsk) != pid_nr(pid)) { ++ detach_pid(tsk, PIDTYPE_SID); ++ set_task_session(tsk, pid_nr(pid)); ++ if (thread_group_leader(tsk)) ++ attach_pid(tsk, PIDTYPE_SID, pid); ++ } ++ write_unlock_irq(&tasklist_lock); ++ if (task_session_nr(tsk) != pid_nr(pid)) { ++ eprintk_ctx("cannot set SID " CPT_FID "\n", CPT_TID(tsk)); ++ return -EINVAL; ++ } ++ rcu_read_unlock(); ++ } ++ if (ti->cpt_old_pgrp > 0 && !tsk->signal->tty_old_pgrp) { ++ struct pid *pid; ++ ++ rcu_read_lock(); ++ pid = get_pid(find_vpid(ti->cpt_old_pgrp)); ++ if (!pid) { ++ eprintk_ctx("illegal OLD_PGRP " CPT_FID "\n", CPT_TID(tsk)); ++ return -EINVAL; ++ } ++ tsk->signal->tty_old_pgrp = pid; ++ rcu_read_unlock(); ++ } ++ } ++ ++ return 0; ++} ++ ++struct pid *alloc_vpid_safe(pid_t vnr) ++{ ++ struct pid *pid; ++ ++ pid = alloc_pid(current->nsproxy->pid_ns, vnr); ++ if (!pid) ++ pid = find_vpid(vnr); ++ return pid; ++} ++ ++static int ++restore_one_signal_struct(struct cpt_task_image *ti, int *exiting, cpt_context_t *ctx) ++{ ++ int err; ++ struct cpt_signal_image *si = cpt_get_buf(ctx); ++ ++ current->signal->tty = NULL; ++ ++ err = rst_get_object(CPT_OBJ_SIGNAL_STRUCT, ti->cpt_signal, si, ctx); ++ if (err) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++ ++ if (task_pgrp_vnr(current) != si->cpt_pgrp) { ++ struct pid * pid = NULL, *free = NULL; ++ ++ rcu_read_lock(); ++ if (si->cpt_pgrp_type == CPT_PGRP_ORPHAN) { ++#if 0 ++ if (!is_virtual_pid(si->cpt_pgrp)) { ++ eprintk_ctx("external process group " CPT_FID, CPT_TID(current)); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++#endif ++ pid = alloc_vpid_safe(si->cpt_pgrp); ++ free = pid; ++ } ++ write_lock_irq(&tasklist_lock); ++ if (pid != NULL) { ++ if (task_pgrp_nr(current) != pid_nr(pid)) { ++ detach_pid(current, PIDTYPE_PGID); ++ set_task_pgrp(current, pid_nr(pid)); ++ if (thread_group_leader(current)) { ++ attach_pid(current, PIDTYPE_PGID, pid); ++ free = NULL; ++ } ++ } ++ } ++ write_unlock_irq(&tasklist_lock); ++ if (free != NULL) ++ free_pid(free); ++ rcu_read_unlock(); ++ } ++ ++ current->signal->tty_old_pgrp = NULL; ++ if ((int)si->cpt_old_pgrp > 0) { ++ if (si->cpt_old_pgrp_type == CPT_PGRP_STRAY) { ++ current->signal->tty_old_pgrp = ++ alloc_pid(current->nsproxy->pid_ns, 0); ++ if (!current->signal->tty_old_pgrp) { ++ eprintk_ctx("failed to allocate stray tty_old_pgrp\n"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ } else { ++ rcu_read_lock(); ++ current->signal->tty_old_pgrp = ++ get_pid(alloc_vpid_safe(si->cpt_old_pgrp)); ++ rcu_read_unlock(); ++ if (!current->signal->tty_old_pgrp) { ++ dprintk_ctx("forward old tty PGID\n"); ++ current->signal->tty_old_pgrp = NULL; ++ } ++ } ++ } ++ ++ if (task_session_vnr(current) != si->cpt_session) { ++ struct pid * pid = NULL, *free = NULL; ++ ++ rcu_read_lock(); ++ if (si->cpt_session_type == CPT_PGRP_ORPHAN) { ++#if 0 ++ if (!is_virtual_pid(si->cpt_session)) { ++ eprintk_ctx("external process session " CPT_FID, CPT_TID(current)); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++#endif ++ pid = alloc_vpid_safe(si->cpt_session); ++ free = pid; ++ } ++ write_lock_irq(&tasklist_lock); ++ if (pid == NULL) ++ pid = find_vpid(si->cpt_session); ++ if (pid != NULL) { ++ if (task_session_nr(current) != pid_nr(pid)) { ++ detach_pid(current, PIDTYPE_SID); ++ set_task_session(current, pid_nr(pid)); ++ if (thread_group_leader(current)) { ++ attach_pid(current, PIDTYPE_SID, pid); ++ free = NULL; ++ } ++ } ++ } ++ write_unlock_irq(&tasklist_lock); ++ if (free != NULL) ++ free_pid(free); ++ rcu_read_unlock(); ++ } ++ ++ cpt_sigset_import(¤t->signal->shared_pending.signal, si->cpt_sigpending); ++ current->signal->leader = si->cpt_leader; ++ if (si->cpt_ctty != CPT_NULL) { ++ cpt_object_t *obj = lookup_cpt_obj_bypos(CPT_OBJ_TTY, si->cpt_ctty, ctx); ++ if (obj) { ++ struct tty_struct *tty = obj->o_obj; ++ if (!tty->session || tty->session == ++ task_session(current)) { ++ tty->session = task_session(current); ++ current->signal->tty = tty; ++ } else { ++ wprintk_ctx("tty session mismatch\n"); ++ } ++ } ++ } ++ ++ if (si->cpt_curr_target) ++ current->signal->curr_target = find_task_by_vpid(si->cpt_curr_target); ++ current->signal->flags = 0; ++ *exiting = si->cpt_group_exit; ++ current->signal->group_exit_code = si->cpt_group_exit_code; ++ if (si->cpt_group_exit_task) { ++ current->signal->group_exit_task = find_task_by_vpid(si->cpt_group_exit_task); ++ if (current->signal->group_exit_task == NULL) { ++ eprintk_ctx("oops, group_exit_task=NULL, pid=%u\n", si->cpt_group_exit_task); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ } ++ current->signal->notify_count = si->cpt_notify_count; ++ current->signal->group_stop_count = si->cpt_group_stop_count; ++ ++ if (si->cpt_next > si->cpt_hdrlen) { ++ char *buf = kmalloc(si->cpt_next - si->cpt_hdrlen, GFP_KERNEL); ++ if (buf == NULL) { ++ cpt_release_buf(ctx); ++ return -ENOMEM; ++ } ++ err = ctx->pread(buf, si->cpt_next - si->cpt_hdrlen, ctx, ++ ti->cpt_signal + si->cpt_hdrlen); ++ if (err) { ++ kfree(buf); ++ cpt_release_buf(ctx); ++ return err; ++ } ++ restore_sigqueue(current, ++ ¤t->signal->shared_pending, (unsigned long)buf, ++ (unsigned long)buf + si->cpt_next - si->cpt_hdrlen); ++ kfree(buf); ++ } ++ cpt_release_buf(ctx); ++ return 0; ++} ++ ++int restore_one_sighand_struct(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ int err; ++ struct cpt_sighand_image si; ++ int i; ++ loff_t pos, endpos; ++ ++ err = rst_get_object(CPT_OBJ_SIGHAND_STRUCT, ti->cpt_sighand, &si, ctx); ++ if (err) ++ return err; ++ ++ for (i=0; i<_NSIG; i++) { ++ current->sighand->action[i].sa.sa_handler = SIG_DFL; ++#ifndef CONFIG_IA64 ++ current->sighand->action[i].sa.sa_restorer = 0; ++#endif ++ current->sighand->action[i].sa.sa_flags = 0; ++ memset(¤t->sighand->action[i].sa.sa_mask, 0, sizeof(sigset_t)); ++ } ++ ++ pos = ti->cpt_sighand + si.cpt_hdrlen; ++ endpos = ti->cpt_sighand + si.cpt_next; ++ while (pos < endpos) { ++ struct cpt_sighandler_image shi; ++ ++ err = rst_get_object(CPT_OBJ_SIGHANDLER, pos, &shi, ctx); ++ if (err) ++ return err; ++ current->sighand->action[shi.cpt_signo].sa.sa_handler = (void*)(unsigned long)shi.cpt_handler; ++#ifndef CONFIG_IA64 ++ current->sighand->action[shi.cpt_signo].sa.sa_restorer = (void*)(unsigned long)shi.cpt_restorer; ++#endif ++ current->sighand->action[shi.cpt_signo].sa.sa_flags = shi.cpt_flags; ++ cpt_sigset_import(¤t->sighand->action[shi.cpt_signo].sa.sa_mask, shi.cpt_mask); ++ pos += shi.cpt_next; ++ } ++ ++ return 0; ++} ++ ++ ++__u32 rst_signal_flag(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ __u32 flag = 0; ++ ++ if (lookup_cpt_obj_bypos(CPT_OBJ_SIGNAL_STRUCT, ti->cpt_signal, ctx)) ++ flag |= CLONE_THREAD; ++ if (ti->cpt_sighand == CPT_NULL || ++ lookup_cpt_obj_bypos(CPT_OBJ_SIGHAND_STRUCT, ti->cpt_sighand, ctx)) ++ flag |= CLONE_SIGHAND; ++ return flag; ++} ++ ++int ++rst_signal_complete(struct cpt_task_image *ti, int * exiting, cpt_context_t *ctx) ++{ ++ int err; ++ cpt_object_t *obj; ++ ++ if (ti->cpt_signal == CPT_NULL || ti->cpt_sighand == CPT_NULL) { ++ return -EINVAL; ++ } ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_SIGHAND_STRUCT, ti->cpt_sighand, ctx); ++ if (obj) { ++ struct sighand_struct *sig = current->sighand; ++ if (obj->o_obj != sig) { ++ return -EINVAL; ++ } ++ } else { ++ obj = cpt_object_add(CPT_OBJ_SIGHAND_STRUCT, current->sighand, ctx); ++ if (obj == NULL) ++ return -ENOMEM; ++ cpt_obj_setpos(obj, ti->cpt_sighand, ctx); ++ err = restore_one_sighand_struct(ti, ctx); ++ if (err) ++ return err; ++ } ++ ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_SIGNAL_STRUCT, ti->cpt_signal, ctx); ++ if (obj) { ++ struct signal_struct *sig = current->signal; ++ if (obj->o_obj != sig) { ++ return -EINVAL; ++ } ++/* if (current->signal) { ++ pid_t session; ++ ++ session = process_session(current); ++ set_process_vgroup(current, session); ++ set_signal_vsession(current->signal, session); ++ }*/ ++ } else { ++ obj = cpt_object_add(CPT_OBJ_SIGNAL_STRUCT, current->signal, ctx); ++ if (obj == NULL) ++ return -ENOMEM; ++ cpt_obj_setpos(obj, ti->cpt_signal, ctx); ++ err = restore_one_signal_struct(ti, exiting, ctx); ++ if (err) ++ return err; ++ } ++ ++ return 0; ++} ++ ++#ifdef CONFIG_X86 ++static u32 decode_segment(u32 segid) ++{ ++ if (segid == CPT_SEG_ZERO) ++ return 0; ++ ++ /* TLS descriptors */ ++ if (segid <= CPT_SEG_TLS3) ++ return ((GDT_ENTRY_TLS_MIN + segid-CPT_SEG_TLS1)<<3) + 3; ++ ++ /* LDT descriptor, it is just an index to LDT array */ ++ if (segid >= CPT_SEG_LDT) ++ return ((segid - CPT_SEG_LDT) << 3) | 7; ++ ++ /* Check for one of standard descriptors */ ++#ifdef CONFIG_X86_64 ++ if (segid == CPT_SEG_USER32_DS) ++ return __USER32_DS; ++ if (segid == CPT_SEG_USER32_CS) ++ return __USER32_CS; ++ if (segid == CPT_SEG_USER64_DS) ++ return __USER_DS; ++ if (segid == CPT_SEG_USER64_CS) ++ return __USER_CS; ++#else ++ if (segid == CPT_SEG_USER32_DS) ++ return __USER_DS; ++ if (segid == CPT_SEG_USER32_CS) ++ return __USER_CS; ++#endif ++ wprintk("Invalid segment reg %d\n", segid); ++ return 0; ++} ++#endif ++ ++#if defined (CONFIG_IA64) ++void ia64_decrement_ip (struct pt_regs *regs) ++{ ++ unsigned long w0, ri = ia64_psr(regs)->ri - 1; ++ ++ if (ia64_psr(regs)->ri == 0) { ++ regs->cr_iip -= 16; ++ ri = 2; ++ get_user(w0, (char __user *) regs->cr_iip + 0); ++ if (((w0 >> 1) & 0xf) == 2) { ++ /* ++ * rfi'ing to slot 2 of an MLX bundle causes ++ * an illegal operation fault. We don't want ++ * that to happen... ++ */ ++ ri = 1; ++ } ++ } ++ ia64_psr(regs)->ri = ri; ++} ++#endif ++ ++static void rst_child_tid(unsigned long *child_tids) ++{ ++ dprintk("rct: " CPT_FID "\n", CPT_TID(current)); ++ current->clear_child_tid = (void*)child_tids[0]; ++ current->set_child_tid = (void*)child_tids[1]; ++} ++ ++static void rst_last_siginfo(void) ++{ ++ int signr; ++ siginfo_t *info = current->last_siginfo; ++ struct pt_regs *regs = task_pt_regs(current); ++ struct k_sigaction *ka; ++ int ptrace_id; ++ ++ dprintk("rlsi: " CPT_FID "\n", CPT_TID(current)); ++ ++ spin_lock_irq(¤t->sighand->siglock); ++ current->last_siginfo = NULL; ++ recalc_sigpending(); ++ ++ ptrace_id = current->pn_state; ++ clear_pn_state(current); ++ ++ switch (ptrace_id) { ++ case PN_STOP_TF: ++ case PN_STOP_TF_RT: ++ /* frame_*signal */ ++ dprintk("SIGTRAP %u/%u(%s) %u/%u %u %ld %u %lu\n", ++ task_pid_vnr(current), current->pid, current->comm, ++ info->si_signo, info->si_code, ++ current->exit_code, SYSCALL_NR(regs), ++ current->ptrace, current->ptrace_message); ++ goto out; ++ case PN_STOP_ENTRY: ++ case PN_STOP_LEAVE: ++ /* do_syscall_trace */ ++ spin_unlock_irq(¤t->sighand->siglock); ++ dprintk("ptrace do_syscall_trace: %d %d\n", ptrace_id, current->exit_code); ++ if (current->exit_code) { ++ send_sig(current->exit_code, current, 1); ++ current->exit_code = 0; ++ } ++ if (IN_SYSCALL(regs)) { ++ if (ptrace_id == PN_STOP_ENTRY ++#ifdef CONFIG_X86 ++ && SYSCALL_ERRNO(regs) == ENOSYS ++#endif ++ ) ++ SYSCALL_RESTART(regs); ++ else if (IN_ERROR(regs) && ++ syscall_is(current, regs, rt_sigtimedwait) && ++ (SYSCALL_ERRNO(regs) == EAGAIN || ++ SYSCALL_ERRNO(regs) == EINTR)) ++ SYSCALL_RESTART(regs); ++ } ++ return; ++ case PN_STOP_FORK: ++ /* fork */ ++ SYSCALL_SETRET(regs, current->ptrace_message); ++ dprintk("ptrace fork returns pid %ld\n", SYSCALL_RETVAL(regs)); ++ goto out; ++ case PN_STOP_VFORK: ++ /* after vfork */ ++ SYSCALL_SETRET(regs, current->ptrace_message); ++ dprintk("ptrace after vfork returns pid %ld\n", SYSCALL_RETVAL(regs)); ++ goto out; ++ case PN_STOP_SIGNAL: ++ /* normal case : dequeue signal */ ++ break; ++ case PN_STOP_EXIT: ++ dprintk("ptrace exit caught\n"); ++ current->ptrace &= ~PT_TRACE_EXIT; ++ spin_unlock_irq(¤t->sighand->siglock); ++ module_put(THIS_MODULE); ++ complete_and_exit(NULL, current->ptrace_message); ++ BUG(); ++ case PN_STOP_EXEC: ++ eprintk("ptrace after exec caught: must not happen\n"); ++ BUG(); ++ default: ++ eprintk("ptrace with unknown identity %d\n", ptrace_id); ++ BUG(); ++ } ++ ++ signr = current->exit_code; ++ if (signr == 0) { ++ dprintk("rlsi: canceled signal %d\n", info->si_signo); ++ goto out; ++ } ++ current->exit_code = 0; ++ ++ if (signr != info->si_signo) { ++ info->si_signo = signr; ++ info->si_errno = 0; ++ info->si_code = SI_USER; ++ info->si_pid = task_pid_vnr(current->parent); ++ info->si_uid = current->parent->uid; ++ } ++ ++ /* If the (new) signal is now blocked, requeue it. */ ++ if (sigismember(¤t->blocked, signr)) { ++ dprintk("going to requeue signal %d\n", signr); ++ goto out_resend_sig; ++ } ++ ++ ka = ¤t->sighand->action[signr-1]; ++ if (ka->sa.sa_handler == SIG_IGN) { ++ dprintk("going to resend signal %d (ignored)\n", signr); ++ goto out; ++ } ++ if (ka->sa.sa_handler != SIG_DFL) { ++ dprintk("going to resend signal %d (not SIG_DFL)\n", signr); ++ goto out_resend_sig; ++ } ++ if (signr == SIGCONT || ++ signr == SIGCHLD || ++ signr == SIGWINCH || ++ signr == SIGURG || ++ current->pid == 1) ++ goto out; ++ ++ /* All the rest, which we cannot handle are requeued. */ ++ dprintk("going to resend signal %d (sigh)\n", signr); ++out_resend_sig: ++ spin_unlock_irq(¤t->sighand->siglock); ++ send_sig_info(signr, info, current); ++ return; ++ ++out: ++ spin_unlock_irq(¤t->sighand->siglock); ++} ++ ++static void rst_finish_stop(void) ++{ ++ /* ... ++ * do_signal() -> ++ * get_signal_to_deliver() -> ++ * do_signal_stop() -> ++ * finish_stop() ++ * ++ * Normally after SIGCONT it will dequeue the next signal. If no signal ++ * is found, do_signal restarts syscall unconditionally. ++ * Otherwise signal handler is pushed on user stack. ++ */ ++ ++ dprintk("rfs: " CPT_FID "\n", CPT_TID(current)); ++ ++ clear_stop_state(current); ++ current->exit_code = 0; ++} ++ ++static void rst_restart_sys(void) ++{ ++ struct pt_regs *regs = task_pt_regs(current); ++ ++ /* This hook is supposed to be executed, when we have ++ * to complete some interrupted syscall. ++ */ ++ dprintk("rrs: " CPT_FID "\n", CPT_TID(current)); ++ ++ if (!IN_SYSCALL(regs) || !IN_ERROR(regs)) ++ return; ++ ++#ifdef __NR_pause ++ if (syscall_is(current,regs,pause)) { ++ if (SYSCALL_ERRNO(regs) == ERESTARTNOHAND) { ++ current->state = TASK_INTERRUPTIBLE; ++ schedule(); ++ } ++ } else ++#else ++ /* On this arch pause() is simulated with sigsuspend(). */ ++ if (syscall_is(current,regs,rt_sigsuspend)) { ++ if (SYSCALL_ERRNO(regs) == ERESTARTNOHAND) { ++ current->state = TASK_INTERRUPTIBLE; ++ schedule(); ++ } ++ } else ++#endif ++ if (syscall_is(current,regs,rt_sigtimedwait)) { ++ if (SYSCALL_ERRNO(regs) == EAGAIN || ++ SYSCALL_ERRNO(regs) == EINTR) { ++ SYSCALL_RESTART(regs); ++ } ++ } else if (syscall_is(current,regs,futex)) { ++ if (SYSCALL_ERRNO(regs) == EINTR && ++ !signal_pending(current)) { ++ SYSCALL_RESTART(regs); ++ } ++ } ++ ++ if (!signal_pending(current) && ++ !test_thread_flag(TIF_RESTORE_SIGMASK)) { ++ if (SYSCALL_ERRNO(regs) == ERESTARTSYS || ++ SYSCALL_ERRNO(regs) == ERESTARTNOINTR || ++ SYSCALL_ERRNO(regs) == ERESTARTNOHAND) { ++ SYSCALL_RESTART(regs); ++ } else if (SYSCALL_ERRNO(regs) == ERESTART_RESTARTBLOCK) { ++ int new = __NR_restart_syscall; ++#ifdef CONFIG_X86_64 ++ if (task_thread_info(current)->flags&_TIF_IA32) ++ new = __NR32_restart_syscall; ++#endif ++ SYSCALL_RESTART2(regs, new); ++ } ++ } ++} ++ ++#ifdef CONFIG_X86_32 ++ ++static int restore_registers(struct task_struct *tsk, struct pt_regs *regs, ++ struct cpt_task_image *ti, struct cpt_x86_regs *b, ++ struct resume_info **rip, struct cpt_context *ctx) ++{ ++ extern char i386_ret_from_resume; ++ ++ if (b->cpt_object != CPT_OBJ_X86_REGS) ++ return -EINVAL; ++ ++ tsk->thread.esp = (unsigned long) regs; ++ tsk->thread.esp0 = (unsigned long) (regs+1); ++ tsk->thread.eip = (unsigned long) &i386_ret_from_resume; ++ ++ tsk->thread.gs = decode_segment(b->cpt_gs); ++ tsk->thread.debugreg[0] = b->cpt_debugreg[0]; ++ tsk->thread.debugreg[1] = b->cpt_debugreg[1]; ++ tsk->thread.debugreg[2] = b->cpt_debugreg[2]; ++ tsk->thread.debugreg[3] = b->cpt_debugreg[3]; ++ tsk->thread.debugreg[4] = b->cpt_debugreg[4]; ++ tsk->thread.debugreg[5] = b->cpt_debugreg[5]; ++ tsk->thread.debugreg[6] = b->cpt_debugreg[6]; ++ tsk->thread.debugreg[7] = b->cpt_debugreg[7]; ++ ++ regs->ebx = b->cpt_ebx; ++ regs->ecx = b->cpt_ecx; ++ regs->edx = b->cpt_edx; ++ regs->esi = b->cpt_esi; ++ regs->edi = b->cpt_edi; ++ regs->ebp = b->cpt_ebp; ++ regs->eax = b->cpt_eax; ++ regs->xds = b->cpt_xds; ++ regs->xes = b->cpt_xes; ++ regs->orig_eax = b->cpt_orig_eax; ++ regs->eip = b->cpt_eip; ++ regs->xcs = b->cpt_xcs; ++ regs->eflags = b->cpt_eflags; ++ regs->esp = b->cpt_esp; ++ regs->xss = b->cpt_xss; ++ ++ regs->xcs = decode_segment(b->cpt_xcs); ++ regs->xss = decode_segment(b->cpt_xss); ++ regs->xds = decode_segment(b->cpt_xds); ++ regs->xes = decode_segment(b->cpt_xes); ++ regs->xfs = decode_segment(b->cpt_fs); ++ ++ tsk->thread.esp -= HOOK_RESERVE; ++ memset((void*)tsk->thread.esp, 0, HOOK_RESERVE); ++ *rip = (void*)tsk->thread.esp; ++ ++ return 0; ++} ++ ++#elif defined(CONFIG_X86_64) ++ ++static void xlate_ptregs_32_to_64(struct pt_regs *d, struct cpt_x86_regs *s) ++{ ++ memset(d, 0, sizeof(struct pt_regs)); ++ d->rbp = s->cpt_ebp; ++ d->rbx = s->cpt_ebx; ++ d->rax = (s32)s->cpt_eax; ++ d->rcx = s->cpt_ecx; ++ d->rdx = s->cpt_edx; ++ d->rsi = s->cpt_esi; ++ d->rdi = s->cpt_edi; ++ d->orig_rax = (s32)s->cpt_orig_eax; ++ d->rip = s->cpt_eip; ++ d->cs = s->cpt_xcs; ++ d->eflags = s->cpt_eflags; ++ d->rsp = s->cpt_esp; ++ d->ss = s->cpt_xss; ++} ++ ++static int restore_registers(struct task_struct *tsk, struct pt_regs *regs, ++ struct cpt_task_image *ti, struct cpt_obj_bits *hdr, ++ struct resume_info **rip, struct cpt_context *ctx) ++{ ++ if (hdr->cpt_object == CPT_OBJ_X86_64_REGS) { ++ struct cpt_x86_64_regs *b = (void*)hdr; ++ ++ tsk->thread.rsp = (unsigned long) regs; ++ tsk->thread.rsp0 = (unsigned long) (regs+1); ++ ++ tsk->thread.fs = b->cpt_fsbase; ++ tsk->thread.gs = b->cpt_gsbase; ++ tsk->thread.fsindex = decode_segment(b->cpt_fsindex); ++ tsk->thread.gsindex = decode_segment(b->cpt_gsindex); ++ tsk->thread.ds = decode_segment(b->cpt_ds); ++ tsk->thread.es = decode_segment(b->cpt_es); ++ tsk->thread.debugreg0 = b->cpt_debugreg[0]; ++ tsk->thread.debugreg1 = b->cpt_debugreg[1]; ++ tsk->thread.debugreg2 = b->cpt_debugreg[2]; ++ tsk->thread.debugreg3 = b->cpt_debugreg[3]; ++ tsk->thread.debugreg6 = b->cpt_debugreg[6]; ++ tsk->thread.debugreg7 = b->cpt_debugreg[7]; ++ ++ memcpy(regs, &b->cpt_r15, sizeof(struct pt_regs)); ++ ++ tsk->thread.userrsp = regs->rsp; ++ regs->cs = decode_segment(b->cpt_cs); ++ regs->ss = decode_segment(b->cpt_ss); ++ } else if (hdr->cpt_object == CPT_OBJ_X86_REGS) { ++ struct cpt_x86_regs *b = (void*)hdr; ++ ++ tsk->thread.rsp = (unsigned long) regs; ++ tsk->thread.rsp0 = (unsigned long) (regs+1); ++ ++ tsk->thread.fs = 0; ++ tsk->thread.gs = 0; ++ tsk->thread.fsindex = decode_segment(b->cpt_fs); ++ tsk->thread.gsindex = decode_segment(b->cpt_gs); ++ tsk->thread.debugreg0 = b->cpt_debugreg[0]; ++ tsk->thread.debugreg1 = b->cpt_debugreg[1]; ++ tsk->thread.debugreg2 = b->cpt_debugreg[2]; ++ tsk->thread.debugreg3 = b->cpt_debugreg[3]; ++ tsk->thread.debugreg6 = b->cpt_debugreg[6]; ++ tsk->thread.debugreg7 = b->cpt_debugreg[7]; ++ ++ xlate_ptregs_32_to_64(regs, b); ++ ++ tsk->thread.userrsp = regs->rsp; ++ regs->cs = decode_segment(b->cpt_xcs); ++ regs->ss = decode_segment(b->cpt_xss); ++ tsk->thread.ds = decode_segment(b->cpt_xds); ++ tsk->thread.es = decode_segment(b->cpt_xes); ++ } else { ++ return -EINVAL; ++ } ++ ++ tsk->thread.rsp -= HOOK_RESERVE; ++ memset((void*)tsk->thread.rsp, 0, HOOK_RESERVE); ++ *rip = (void*)tsk->thread.rsp; ++ return 0; ++} ++ ++#elif defined(CONFIG_IA64) ++ ++#define MASK(nbits) ((1UL << (nbits)) - 1) /* mask with NBITS bits set */ ++ ++#define PUT_BITS(first, last, nat) \ ++ ({ \ ++ unsigned long bit = ia64_unat_pos(&pt->r##first); \ ++ unsigned long nbits = (last - first + 1); \ ++ unsigned long mask = MASK(nbits) << first; \ ++ long dist; \ ++ if (bit < first) \ ++ dist = 64 + bit - first; \ ++ else \ ++ dist = bit - first; \ ++ ia64_rotl(nat & mask, dist); \ ++ }) ++ ++unsigned long ++ia64_put_scratch_nat_bits (struct pt_regs *pt, unsigned long nat) ++{ ++ unsigned long scratch_unat; ++ ++ /* ++ * Registers that are stored consecutively in struct pt_regs ++ * can be handled in parallel. If the register order in ++ * struct_pt_regs changes, this code MUST be updated. ++ */ ++ scratch_unat = PUT_BITS( 1, 1, nat); ++ scratch_unat |= PUT_BITS( 2, 3, nat); ++ scratch_unat |= PUT_BITS(12, 13, nat); ++ scratch_unat |= PUT_BITS(14, 14, nat); ++ scratch_unat |= PUT_BITS(15, 15, nat); ++ scratch_unat |= PUT_BITS( 8, 11, nat); ++ scratch_unat |= PUT_BITS(16, 31, nat); ++ ++ return scratch_unat; ++ ++} ++ ++static unsigned long ++ia64_put_saved_nat_bits (struct switch_stack *pt, unsigned long nat) ++{ ++ unsigned long scratch_unat; ++ ++ scratch_unat = PUT_BITS( 4, 7, nat); ++ ++ return scratch_unat; ++ ++} ++ ++#undef PUT_BITS ++ ++ ++static int restore_registers(struct task_struct *tsk, struct pt_regs *pt, ++ struct cpt_task_image *ti, ++ struct cpt_ia64_regs *r, ++ struct resume_info **rip, ++ struct cpt_context *ctx) ++{ ++ extern char ia64_ret_from_resume; ++ struct switch_stack *sw; ++ struct resume_info *ri; ++ struct ia64_psr *psr = ia64_psr(pt); ++ void *krbs = (void *)tsk + IA64_RBS_OFFSET; ++ unsigned long reg; ++ ++ if (r->cpt_object != CPT_OBJ_IA64_REGS) ++ return -EINVAL; ++ ++ if (r->num_regs > 96) { ++ eprintk(CPT_FID " too much RSE regs %lu\n", ++ CPT_TID(tsk), r->num_regs); ++ return -EINVAL; ++ } ++ ++ *rip = ri = ((void*)pt) - HOOK_RESERVE; ++ sw = ((struct switch_stack *) ri) - 1; ++ ++ memmove(sw, (void*)tsk->thread.ksp + 16, sizeof(struct switch_stack)); ++ memset(ri, 0, HOOK_RESERVE); ++ ++ /* gr 1,2-3,8-11,12-13,14,15,16-31 are on pt_regs */ ++ memcpy(&pt->r1, &r->gr[1], 8*(2-1)); ++ memcpy(&pt->r2, &r->gr[2], 8*(4-2)); ++ memcpy(&pt->r8, &r->gr[8], 8*(12-8)); ++ memcpy(&pt->r12, &r->gr[12], 8*(14-12)); ++ memcpy(&pt->r14, &r->gr[14], 8*(15-14)); ++ memcpy(&pt->r15, &r->gr[15], 8*(16-15)); ++ memcpy(&pt->r16, &r->gr[16], 8*(32-16)); ++ ++ pt->b0 = r->br[0]; ++ pt->b6 = r->br[6]; ++ pt->b7 = r->br[7]; ++ ++ pt->ar_bspstore = r->ar_bspstore; ++ pt->ar_unat = r->ar_unat; ++ pt->ar_pfs = r->ar_pfs; ++ pt->ar_ccv = r->ar_ccv; ++ pt->ar_fpsr = r->ar_fpsr; ++ pt->ar_csd = r->ar_csd; ++ pt->ar_ssd = r->ar_ssd; ++ pt->ar_rsc = r->ar_rsc; ++ ++ pt->cr_iip = r->cr_iip; ++ pt->cr_ipsr = r->cr_ipsr; ++ ++ pt->pr = r->pr; ++ ++ pt->cr_ifs = r->cfm; ++ ++ /* fpregs 6..9,10..11 are in pt_regs */ ++ memcpy(&pt->f6, &r->fr[2*6], 16*(10-6)); ++ memcpy(&pt->f10, &r->fr[2*10], 16*(12-10)); ++ /* fpreg 12..15 are on switch stack */ ++ memcpy(&sw->f12, &r->fr[2*12], 16*(16-12)); ++ /* fpregs 32...127 */ ++ tsk->thread.flags |= IA64_THREAD_FPH_VALID; ++ memcpy(tsk->thread.fph, &r->fr[32*2], 16*(128-32)); ++ ia64_drop_fpu(tsk); ++ psr->dfh = 1; ++ ++ memcpy(&sw->r4, &r->gr[4], 8*(8-4)); ++ memcpy(&sw->b1, &r->br[1], 8*(6-1)); ++ sw->ar_lc = r->ar_lc; ++ ++ memcpy(&sw->f2, &r->fr[2*2], 16*(6-2)); ++ memcpy(&sw->f16, &r->fr[2*16], 16*(32-16)); ++ ++ sw->caller_unat = 0; ++ sw->ar_fpsr = pt->ar_fpsr; ++ sw->ar_unat = 0; ++ if (r->nat[0] & 0xFFFFFF0FUL) ++ sw->caller_unat = ia64_put_scratch_nat_bits(pt, r->nat[0]); ++ if (r->nat[0] & 0xF0) ++ sw->ar_unat = ia64_put_saved_nat_bits(sw, r->nat[0]); ++ ++ sw->ar_bspstore = (unsigned long)ia64_rse_skip_regs(krbs, r->num_regs); ++ memset(krbs, 0, (void*)sw->ar_bspstore - krbs); ++ sw->ar_rnat = 0; ++ sw->ar_pfs = 0; ++ ++ /* This is tricky. When we are in syscall, we have frame ++ * of output register (sometimes, plus one input reg sometimes). ++ * It is not so easy to restore such frame, RSE optimizes ++ * and does not fetch those regs from backstore. So, we restore ++ * the whole frame as local registers, and then repartition it ++ * in ia64_ret_from_resume(). ++ */ ++ if ((long)pt->cr_ifs >= 0) { ++ unsigned long out = (r->cfm&0x7F) - ((r->cfm>>7)&0x7F); ++ sw->ar_pfs = out | (out<<7); ++ } ++ if (r->ar_ec) ++ sw->ar_pfs |= (r->ar_ec & 0x3F) << 52; ++ ++ for (reg = 0; reg < r->num_regs; reg++) { ++ unsigned long *ptr = ia64_rse_skip_regs(krbs, reg); ++ unsigned long *rnatp; ++ unsigned long set_rnat = 0; ++ ++ *ptr = r->gr[32+reg]; ++ ++ if (reg < 32) ++ set_rnat = (r->nat[0] & (1UL<<(reg+32))); ++ else ++ set_rnat = (r->nat[1] & (1UL<<(reg-32))); ++ ++ if (set_rnat) { ++ rnatp = ia64_rse_rnat_addr(ptr); ++ if ((unsigned long)rnatp >= sw->ar_bspstore) ++ rnatp = &sw->ar_rnat; ++ *rnatp |= (1UL<b0 = (unsigned long) &ia64_ret_from_resume; ++ tsk->thread.ksp = (unsigned long) sw - 16; ++ ++#define PRED_LEAVE_SYSCALL 1 /* TRUE iff leave from syscall */ ++#define PRED_KERNEL_STACK 2 /* returning to kernel-stacks? */ ++#define PRED_USER_STACK 3 /* returning to user-stacks? */ ++#define PRED_SYSCALL 4 /* inside a system call? */ ++#define PRED_NON_SYSCALL 5 /* complement of PRED_SYSCALL */ ++ ++ pt->loadrs = r->loadrs; ++ sw->pr = 0; ++ sw->pr &= ~(1UL << PRED_LEAVE_SYSCALL); ++ sw->pr &= ~((1UL << PRED_SYSCALL) | (1UL << PRED_NON_SYSCALL)); ++ sw->pr &= ~(1UL << PRED_KERNEL_STACK); ++ sw->pr |= (1UL << PRED_USER_STACK); ++ if ((long)pt->cr_ifs < 0) { ++ sw->pr |= (1UL << PRED_NON_SYSCALL); ++ } else { ++ sw->pr |= ((1UL << PRED_SYSCALL) | (1UL << PRED_LEAVE_SYSCALL)); ++ } ++ ++ return 0; ++} ++#endif ++ ++asmlinkage void rst_resume_work(struct resume_info *ri) ++{ ++ if (ri->hooks & (1<tid_ptrs); ++ if (ri->hooks & (1<hooks & (1<hooks & (1<thread.i387.fxsave.mxcsr &= 0x0000ffbf; ++#endif ++} ++ ++#define RLIM_INFINITY32 0xffffffff ++#define RLIM_INFINITY64 (~0ULL) ++ ++#ifdef CONFIG_X86_64 ++#define rst_rlim_32_to_64(a, i, t, im) \ ++do { \ ++ if (im->cpt_rlim_##a[i] == RLIM_INFINITY32) \ ++ t->signal->rlim[i].rlim_##a = RLIM_INFINITY64; \ ++ else \ ++ t->signal->rlim[i].rlim_##a = im->cpt_rlim_##a[i]; \ ++} while (0) ++#elif defined(CONFIG_X86_32) ++#define rst_rlim_64_to_32(a, i, t, im) \ ++do { \ ++ if (im->cpt_rlim_##a[i] == RLIM_INFINITY64) \ ++ t->signal->rlim[i].rlim_##a = RLIM_INFINITY32; \ ++ else if (im->cpt_rlim_##a[i] > RLIM_INFINITY32) { \ ++ eprintk_ctx("rlimit %Lu is too high for 32-bit task, " \ ++ "dump file is corrupted\n", \ ++ im->cpt_rlim_##a[i]); \ ++ return -EINVAL; \ ++ } else \ ++ t->signal->rlim[i].rlim_##a = im->cpt_rlim_##a[i]; \ ++} while (0) ++#endif ++ ++int rst_restore_process(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ struct cpt_task_image *ti = obj->o_image; ++ struct pt_regs * regs; ++ struct cpt_object_hdr *b; ++ struct cpt_siginfo_image *lsi = NULL; ++ struct group_info *gids, *ogids; ++ struct resume_info *ri = NULL; ++ int i; ++ int err = 0; ++#ifdef CONFIG_BEANCOUNTERS ++ struct task_beancounter *tbc; ++ struct user_beancounter *new_bc, *old_bc; ++#endif ++ ++ if (tsk == NULL) { ++ eprintk_ctx("oops, task %d/%s is missing\n", ti->cpt_pid, ti->cpt_comm); ++ return -EFAULT; ++ } ++ ++ wait_task_inactive(tsk); ++#ifdef CONFIG_BEANCOUNTERS ++ tbc = &tsk->task_bc; ++ new_bc = rst_lookup_ubc(ti->cpt_exec_ub, ctx); ++ err = virtinfo_notifier_call(VITYPE_SCP, ++ VIRTINFO_SCP_RSTTSK, new_bc); ++ if (err & NOTIFY_FAIL) { ++ put_beancounter(new_bc); ++ return -ECHRNG; ++ } ++ old_bc = tbc->exec_ub; ++ if ((err & VIRTNOTIFY_CHANGE) && old_bc != new_bc) { ++ dprintk(" *** replacing ub %p by %p for %p (%d %s)\n", ++ old_bc, new_bc, tsk, ++ tsk->pid, tsk->comm); ++ tbc->exec_ub = new_bc; ++ new_bc = old_bc; ++ } ++ put_beancounter(new_bc); ++#endif ++ regs = task_pt_regs(tsk); ++ ++ if (!tsk->exit_state) { ++ tsk->lock_depth = -1; ++#ifdef CONFIG_PREEMPT ++ task_thread_info(tsk)->preempt_count--; ++#endif ++ } ++ ++ if (tsk->static_prio != ti->cpt_static_prio) ++ set_user_nice(tsk, PRIO_TO_NICE((s32)ti->cpt_static_prio)); ++ ++ cpt_sigset_import(&tsk->blocked, ti->cpt_sigblocked); ++ cpt_sigset_import(&tsk->real_blocked, ti->cpt_sigrblocked); ++ cpt_sigset_import(&tsk->saved_sigmask, ti->cpt_sigsuspend_blocked); ++ cpt_sigset_import(&tsk->pending.signal, ti->cpt_sigpending); ++ ++ tsk->uid = ti->cpt_uid; ++ tsk->euid = ti->cpt_euid; ++ tsk->suid = ti->cpt_suid; ++ tsk->fsuid = ti->cpt_fsuid; ++ tsk->gid = ti->cpt_gid; ++ tsk->egid = ti->cpt_egid; ++ tsk->sgid = ti->cpt_sgid; ++ tsk->fsgid = ti->cpt_fsgid; ++#ifdef CONFIG_IA64 ++ SET_UNALIGN_CTL(tsk, ti->cpt_prctl_uac); ++ SET_FPEMU_CTL(tsk, ti->cpt_prctl_fpemu); ++#endif ++ memcpy(&tsk->cap_effective, &ti->cpt_ecap, sizeof(tsk->cap_effective)); ++ memcpy(&tsk->cap_inheritable, &ti->cpt_icap, sizeof(tsk->cap_inheritable)); ++ memcpy(&tsk->cap_permitted, &ti->cpt_pcap, sizeof(tsk->cap_permitted)); ++ tsk->keep_capabilities = (ti->cpt_keepcap != 0); ++ tsk->did_exec = (ti->cpt_did_exec != 0); ++ gids = groups_alloc(ti->cpt_ngids); ++ ogids = tsk->group_info; ++ if (gids) { ++ int i; ++ for (i=0; i<32; i++) ++ gids->small_block[i] = ti->cpt_gids[i]; ++ tsk->group_info = gids; ++ } ++ if (ogids) ++ put_group_info(ogids); ++ tsk->utime = ti->cpt_utime; ++ tsk->stime = ti->cpt_stime; ++ if (ctx->image_version == CPT_VERSION_8) ++ tsk->start_time = _ns_to_timespec(ti->cpt_starttime*TICK_NSEC); ++ else ++ cpt_timespec_import(&tsk->start_time, ti->cpt_starttime); ++ _set_normalized_timespec(&tsk->start_time, ++ tsk->start_time.tv_sec + ++ VE_TASK_INFO(tsk)->owner_env->start_timespec.tv_sec, ++ tsk->start_time.tv_nsec + ++ VE_TASK_INFO(tsk)->owner_env->start_timespec.tv_nsec); ++ ++ tsk->nvcsw = ti->cpt_nvcsw; ++ tsk->nivcsw = ti->cpt_nivcsw; ++ tsk->min_flt = ti->cpt_min_flt; ++ tsk->maj_flt = ti->cpt_maj_flt; ++ ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,8) ++ tsk->cutime = ti->cpt_cutime; ++ tsk->cstime = ti->cpt_cstime; ++ tsk->cnvcsw = ti->cpt_cnvcsw; ++ tsk->cnivcsw = ti->cpt_cnivcsw; ++ tsk->cmin_flt = ti->cpt_cmin_flt; ++ tsk->cmaj_flt = ti->cpt_cmaj_flt; ++ ++ BUILD_BUG_ON(RLIM_NLIMITS > CPT_RLIM_NLIMITS); ++ ++ for (i=0; irlim[i].rlim_cur = ti->cpt_rlim_cur[i]; ++ tsk->rlim[i].rlim_max = ti->cpt_rlim_max[i]; ++ } ++#else ++ if (thread_group_leader(tsk) && tsk->signal) { ++ tsk->signal->utime = ti->cpt_utime; ++ tsk->signal->stime = ti->cpt_stime; ++ tsk->signal->cutime = ti->cpt_cutime; ++ tsk->signal->cstime = ti->cpt_cstime; ++ tsk->signal->nvcsw = ti->cpt_nvcsw; ++ tsk->signal->nivcsw = ti->cpt_nivcsw; ++ tsk->signal->cnvcsw = ti->cpt_cnvcsw; ++ tsk->signal->cnivcsw = ti->cpt_cnivcsw; ++ tsk->signal->min_flt = ti->cpt_min_flt; ++ tsk->signal->maj_flt = ti->cpt_maj_flt; ++ tsk->signal->cmin_flt = ti->cpt_cmin_flt; ++ tsk->signal->cmaj_flt = ti->cpt_cmaj_flt; ++ ++ for (i=0; iimage_arch == CPT_OS_ARCH_I386) { ++ rst_rlim_32_to_64(cur, i, tsk, ti); ++ rst_rlim_32_to_64(max, i, tsk, ti); ++ } else ++#elif defined(CONFIG_X86_32) ++ if (ctx->image_arch == CPT_OS_ARCH_EMT64) { ++ rst_rlim_64_to_32(cur, i, tsk, ti); ++ rst_rlim_64_to_32(max, i, tsk, ti); ++ } else ++#endif ++ { ++ tsk->signal->rlim[i].rlim_cur = ++ ti->cpt_rlim_cur[i]; ++ tsk->signal->rlim[i].rlim_max = ++ ti->cpt_rlim_max[i]; ++ } ++ } ++ } ++#endif ++ ++#ifdef CONFIG_X86 ++ for (i=0; i<3; i++) { ++ if (i >= GDT_ENTRY_TLS_ENTRIES) { ++ eprintk_ctx("too many tls descs\n"); ++ } else { ++#ifndef CONFIG_X86_64 ++ tsk->thread.tls_array[i].a = ti->cpt_tls[i]&0xFFFFFFFF; ++ tsk->thread.tls_array[i].b = ti->cpt_tls[i]>>32; ++#else ++ tsk->thread.tls_array[i] = ti->cpt_tls[i]; ++#endif ++ } ++ } ++#endif ++ ++ clear_stopped_child_used_math(tsk); ++ ++ b = (void *)(ti+1); ++ while ((void*)b < ((void*)ti) + ti->cpt_next) { ++ /* Siginfo objects are at the end of obj array */ ++ if (b->cpt_object == CPT_OBJ_SIGINFO) { ++ struct ve_struct *env = set_exec_env(VE_TASK_INFO(tsk)->owner_env); ++ restore_sigqueue(tsk, &tsk->pending, (unsigned long)b, (unsigned long)ti + ti->cpt_next); ++ set_exec_env(env); ++ break; ++ } ++ ++ switch (b->cpt_object) { ++#ifdef CONFIG_X86 ++ case CPT_OBJ_BITS: ++ if (b->cpt_content == CPT_CONTENT_X86_FPUSTATE && ++ cpu_has_fxsr) { ++ memcpy(&tsk->thread.i387, ++ (void*)b + b->cpt_hdrlen, ++ sizeof(struct i387_fxsave_struct)); ++ rst_apply_mxcsr_mask(tsk); ++ if (ti->cpt_used_math) ++ set_stopped_child_used_math(tsk); ++ } ++#ifndef CONFIG_X86_64 ++ else if (b->cpt_content == CPT_CONTENT_X86_FPUSTATE_OLD && ++ !cpu_has_fxsr) { ++ memcpy(&tsk->thread.i387, ++ (void*)b + b->cpt_hdrlen, ++ sizeof(struct i387_fsave_struct)); ++ if (ti->cpt_used_math) ++ set_stopped_child_used_math(tsk); ++ } ++#endif ++ break; ++#endif ++ case CPT_OBJ_LASTSIGINFO: ++ lsi = (void*)b; ++ break; ++ case CPT_OBJ_X86_REGS: ++ case CPT_OBJ_X86_64_REGS: ++ case CPT_OBJ_IA64_REGS: ++ if (restore_registers(tsk, regs, ti, (void*)b, &ri, ctx)) { ++ eprintk_ctx("cannot restore registers: image is corrupted\n"); ++ return -EINVAL; ++ } ++ break; ++ case CPT_OBJ_SIGALTSTACK: { ++ struct cpt_sigaltstack_image *sas; ++ sas = (struct cpt_sigaltstack_image *)b; ++ tsk->sas_ss_sp = sas->cpt_stack; ++ tsk->sas_ss_size = sas->cpt_stacksize; ++ break; ++ } ++ case CPT_OBJ_TASK_AUX: { ++ struct cpt_task_aux_image *ai; ++ ai = (struct cpt_task_aux_image *)b; ++ tsk->robust_list = cpt_ptr_import(ai->cpt_robust_list); ++#ifdef CONFIG_X86_64 ++#ifdef CONFIG_COMPAT ++ if (task_thread_info(tsk)->flags&_TIF_IA32) { ++ tsk->robust_list = (void __user *)NULL; ++ tsk->compat_robust_list = cpt_ptr_import(ai->cpt_robust_list); ++ } ++#endif ++#endif ++ break; ++ } ++ } ++ b = ((void*)b) + b->cpt_next; ++ } ++ ++ if (ri == NULL && !(ti->cpt_state & (EXIT_ZOMBIE|EXIT_DEAD))) { ++ eprintk_ctx("missing register info\n"); ++ return -EINVAL; ++ } ++ ++ if (ti->cpt_ppid != ti->cpt_rppid) { ++ struct task_struct *parent; ++ struct ve_struct *env = set_exec_env(VE_TASK_INFO(tsk)->owner_env); ++ write_lock_irq(&tasklist_lock); ++ parent = find_task_by_vpid(ti->cpt_ppid); ++ if (parent && parent != tsk->parent) { ++ list_add(&tsk->ptrace_list, &tsk->parent->ptrace_children); ++ remove_parent(tsk); ++ tsk->parent = parent; ++ add_parent(tsk); ++ } ++ write_unlock_irq(&tasklist_lock); ++ set_exec_env(env); ++ } ++ ++ tsk->ptrace_message = ti->cpt_ptrace_message; ++ tsk->pn_state = ti->cpt_pn_state; ++ tsk->stopped_state = ti->cpt_stopped_state; ++ task_thread_info(tsk)->flags = ti->cpt_thrflags; ++ ++ /* The image was created with kernel < 2.6.16, while ++ * task hanged in sigsuspend -> do_signal. ++ * ++ * FIXME! This needs more brain efforts... ++ */ ++ if (ti->cpt_sigsuspend_state) { ++ task_thread_info(tsk)->flags |= _TIF_RESTORE_SIGMASK; ++ } ++ ++#ifdef CONFIG_X86_64 ++ task_thread_info(tsk)->flags |= _TIF_FORK | _TIF_RESUME; ++ if (!ti->cpt_64bit) ++ task_thread_info(tsk)->flags |= _TIF_IA32; ++#endif ++ ++#ifdef CONFIG_X86_32 ++ do { ++ if (regs->orig_eax == __NR__newselect && regs->edi) { ++ struct timeval tv; ++ if (access_process_vm(tsk, regs->edi, &tv, ++ sizeof(tv), 0) != sizeof(tv)) { ++ wprintk_ctx("task %d/%d(%s): Error 1 in access_process_vm: edi %ld\n", ++ task_pid_vnr(tsk), tsk->pid, tsk->comm, ++ regs->edi); ++ break; ++ } ++ dprintk_ctx("task %d/%d(%s): Old timeval in newselect: %ld.%ld\n", ++ task_pid_vnr(tsk), tsk->pid, tsk->comm, ++ tv.tv_sec, tv.tv_usec); ++ tv.tv_sec -= ctx->delta_time.tv_sec; ++ if (tv.tv_usec < ctx->delta_time.tv_nsec / 1000) { ++ tv.tv_usec += 1000000 - ctx->delta_time.tv_nsec / 1000; ++ tv.tv_sec--; ++ } else { ++ tv.tv_usec -= ctx->delta_time.tv_nsec / 1000; ++ } ++ if (tv.tv_sec < 0) { ++ tv.tv_sec = 0; ++ tv.tv_usec = 0; ++ } ++ dprintk_ctx("task %d/%d(%s): New timeval in newselect: %ld.%ld\n", ++ task_pid_vnr(tsk), tsk->pid, tsk->comm, ++ tv.tv_sec, tv.tv_usec); ++ if (access_process_vm(tsk, regs->edi, &tv, ++ sizeof(tv), 1) != sizeof(tv)) { ++ wprintk_ctx("task %d/%d(%s): Error 1 in access_process_vm write: edi %ld\n", ++ task_pid_vnr(tsk), tsk->pid, tsk->comm, regs->edi); ++ } ++ ++ } else if (regs->orig_eax == __NR_select && regs->edi) { ++ struct { ++ unsigned long n; ++ fd_set __user *inp, *outp, *exp; ++ struct timeval __user *tvp; ++ } a; ++ struct timeval tv; ++ if (access_process_vm(tsk, regs->ebx, &a, ++ sizeof(a), 0) != sizeof(a)) { ++ wprintk_ctx("task %d: Error 2 in access_process_vm\n", tsk->pid); ++ break; ++ } ++ if (access_process_vm(tsk, (unsigned long)a.tvp, ++ &tv, sizeof(tv), 0) != sizeof(tv)) { ++ wprintk_ctx("task %d: Error 3 in access_process_vm\n", tsk->pid); ++ break; ++ } ++ dprintk_ctx("task %d: Old timeval in select: %ld.%ld\n", ++ tsk->pid, tv.tv_sec, tv.tv_usec); ++ tv.tv_sec -= ctx->delta_time.tv_sec; ++ if (tv.tv_usec < ctx->delta_time.tv_nsec / 1000) { ++ tv.tv_usec += 1000000 - ctx->delta_time.tv_nsec / 1000; ++ tv.tv_sec--; ++ } else { ++ tv.tv_usec -= ctx->delta_time.tv_nsec / 1000; ++ } ++ if (tv.tv_sec < 0) { ++ tv.tv_sec = 0; ++ tv.tv_usec = 0; ++ } ++ dprintk_ctx("task %d: New timeval in select: %ld.%ld\n", ++ tsk->pid, tv.tv_sec, tv.tv_usec); ++ if (access_process_vm(tsk, (unsigned long)a.tvp, ++ &tv, sizeof(tv), 1) != sizeof(tv)) { ++ wprintk_ctx("task %d: Error 3 in access_process_vm write\n", tsk->pid); ++ } ++ } ++ } while (0); ++#endif ++ ++ if (ri && IN_SYSCALL(regs) && IN_ERROR(regs)) { ++ switch (SYSCALL_ERRNO(regs)) { ++ case ERESTARTSYS: ++ case ERESTARTNOINTR: ++ case ERESTARTNOHAND: ++ case ERESTART_RESTARTBLOCK: ++ case EAGAIN: ++ case EINTR: ++ ri->hooks |= (1<pn_state)) { ++ /* ... -> ptrace_notify() ++ * or ++ * ... -> do_signal() -> get_signal_to_deliver() -> ++ * ptrace stop ++ */ ++ tsk->last_siginfo = &ri->last_siginfo; ++ ri->hooks |= (1<last_siginfo, lsi); ++ } ++ ++ tsk->ptrace = ti->cpt_ptrace; ++ tsk->flags = ti->cpt_flags & ~PF_FROZEN; ++ clear_tsk_thread_flag(tsk, TIF_FREEZE); ++ tsk->exit_signal = ti->cpt_exit_signal; ++ ++ if (ri && tsk->stopped_state) { ++ dprintk_ctx("finish_stop\n"); ++ if (ti->cpt_state != TASK_STOPPED) ++ eprintk_ctx("Hellooo, state is %u\n", (unsigned)ti->cpt_state); ++ ri->hooks |= (1<cpt_set_tid || ti->cpt_clear_tid)) { ++ ri->hooks |= (1<tid_ptrs[0] = ti->cpt_clear_tid; ++ ri->tid_ptrs[1] = ti->cpt_set_tid; ++ dprintk_ctx("settids\n"); ++ } ++ ++ if (ri && ri->hooks && ++ !(ti->cpt_state & (EXIT_ZOMBIE|EXIT_DEAD))) { ++ if (try_module_get(THIS_MODULE)) ++ ri->hook = rst_resume_work; ++ } ++ ++ if (ti->cpt_state == TASK_TRACED) ++ tsk->state = TASK_TRACED; ++ else if (ti->cpt_state & (EXIT_ZOMBIE|EXIT_DEAD)) { ++ tsk->signal->it_virt_expires = 0; ++ tsk->signal->it_prof_expires = 0; ++ if (tsk->state != TASK_DEAD) ++ eprintk_ctx("oops, schedule() did not make us dead\n"); ++ } ++ ++ if (thread_group_leader(tsk) && ++ ti->cpt_it_real_value && ++ !(ti->cpt_state & (EXIT_ZOMBIE|EXIT_DEAD))) { ++ ktime_t val; ++ s64 nsec; ++ ++ nsec = ti->cpt_it_real_value; ++ val.tv64 = 0; ++ ++ if (ctx->image_version < CPT_VERSION_9) ++ nsec *= TICK_NSEC; ++ ++ val = ktime_add_ns(val, nsec - ctx->delta_nsec); ++ if (val.tv64 <= 0) ++ val.tv64 = NSEC_PER_USEC; ++ dprintk("rst itimer " CPT_FID " +%Ld %Lu\n", CPT_TID(tsk), ++ (long long)val.tv64, ++ (unsigned long long)ti->cpt_it_real_value); ++ ++ spin_lock_irq(&tsk->sighand->siglock); ++ if (hrtimer_try_to_cancel(&tsk->signal->real_timer) >= 0) { ++ /* FIXME. Check!!!! */ ++ hrtimer_start(&tsk->signal->real_timer, val, HRTIMER_MODE_REL); ++ } else { ++ wprintk_ctx("Timer clash. Impossible?\n"); ++ } ++ spin_unlock_irq(&tsk->sighand->siglock); ++ ++ dprintk_ctx("itimer " CPT_FID " +%Lu\n", CPT_TID(tsk), ++ (unsigned long long)val.tv64); ++ } ++ ++ module_put(THIS_MODULE); ++ } ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_socket.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_socket.c +--- ./kernel/cpt/rst_socket.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_socket.c 2012-11-13 15:20:15.376569065 +0000 +@@ -0,0 +1,918 @@ ++/* ++ * ++ * kernel/cpt/rst_socket.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_files.h" ++#include "cpt_socket.h" ++#include "cpt_kernel.h" ++ ++#include "cpt_syscalls.h" ++ ++ ++static int setup_sock_common(struct sock *sk, struct cpt_sock_image *si, ++ loff_t pos, struct cpt_context *ctx) ++{ ++ struct timeval tmptv; ++ ++ if (sk->sk_socket) { ++ sk->sk_socket->flags = si->cpt_ssflags; ++ sk->sk_socket->state = si->cpt_sstate; ++ } ++ sk->sk_reuse = si->cpt_reuse; ++ sk->sk_shutdown = si->cpt_shutdown; ++ sk->sk_userlocks = si->cpt_userlocks; ++ sk->sk_no_check = si->cpt_no_check; ++ sock_reset_flag(sk, SOCK_DBG); ++ if (si->cpt_debug) ++ sock_set_flag(sk, SOCK_DBG); ++ sock_reset_flag(sk, SOCK_RCVTSTAMP); ++ if (si->cpt_rcvtstamp) ++ sock_set_flag(sk, SOCK_RCVTSTAMP); ++ sock_reset_flag(sk, SOCK_LOCALROUTE); ++ if (si->cpt_localroute) ++ sock_set_flag(sk, SOCK_LOCALROUTE); ++ sk->sk_protocol = si->cpt_protocol; ++ sk->sk_err = si->cpt_err; ++ sk->sk_err_soft = si->cpt_err_soft; ++ sk->sk_priority = si->cpt_priority; ++ sk->sk_rcvlowat = si->cpt_rcvlowat; ++ sk->sk_rcvtimeo = si->cpt_rcvtimeo; ++ if (si->cpt_rcvtimeo == CPT_NULL) ++ sk->sk_rcvtimeo = MAX_SCHEDULE_TIMEOUT; ++ sk->sk_sndtimeo = si->cpt_sndtimeo; ++ if (si->cpt_sndtimeo == CPT_NULL) ++ sk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; ++ sk->sk_rcvbuf = si->cpt_rcvbuf; ++ sk->sk_sndbuf = si->cpt_sndbuf; ++ sk->sk_bound_dev_if = si->cpt_bound_dev_if; ++ sk->sk_flags = si->cpt_flags; ++ sk->sk_lingertime = si->cpt_lingertime; ++ if (si->cpt_lingertime == CPT_NULL) ++ sk->sk_lingertime = MAX_SCHEDULE_TIMEOUT; ++ sk->sk_peercred.pid = si->cpt_peer_pid; ++ sk->sk_peercred.uid = si->cpt_peer_uid; ++ sk->sk_peercred.gid = si->cpt_peer_gid; ++ cpt_timeval_import(&tmptv, si->cpt_stamp); ++ sk->sk_stamp = timeval_to_ktime(tmptv); ++ return 0; ++} ++ ++static struct file *sock_mapfile(struct socket *sock) ++{ ++ int fd = sock_map_fd(sock); ++ ++ if (fd >= 0) { ++ struct file *file = sock->file; ++ get_file(file); ++ sc_close(fd); ++ return file; ++ } ++ return ERR_PTR(fd); ++} ++ ++/* Assumption is that /tmp exists and writable. ++ * In previous versions we assumed that listen() will autobind ++ * the socket. It does not do this for AF_UNIX by evident reason: ++ * socket in abstract namespace is accessible, unlike socket bound ++ * to deleted FS object. ++ */ ++ ++static int ++select_deleted_name(char * name, cpt_context_t *ctx) ++{ ++ int i; ++ ++ for (i=0; i<100; i++) { ++ struct nameidata nd; ++ unsigned int rnd = net_random(); ++ ++ sprintf(name, "/tmp/SOCK.%08x", rnd); ++ ++ if (path_lookup(name, 0, &nd) != 0) ++ return 0; ++ ++ path_release(&nd); ++ } ++ ++ eprintk_ctx("failed to allocate deleted socket inode\n"); ++ return -ELOOP; ++} ++ ++static int ++bind_unix_socket(struct socket *sock, struct cpt_sock_image *si, ++ cpt_context_t *ctx) ++{ ++ int err; ++ char *name; ++ struct sockaddr* addr; ++ int addrlen; ++ struct sockaddr_un sun; ++ struct nameidata nd; ++ ++ if ((addrlen = si->cpt_laddrlen) <= 2) ++ return 0; ++ ++ nd.dentry = NULL; ++ name = ((char*)si->cpt_laddr) + 2; ++ addr = (struct sockaddr *)si->cpt_laddr; ++ ++ if (name[0]) { ++ if (path_lookup(name, 0, &nd)) ++ nd.dentry = NULL; ++ ++ if (si->cpt_deleted) { ++ if (nd.dentry == NULL && ++ sock->ops->bind(sock, addr, addrlen) == 0) { ++ sc_unlink(name); ++ return 0; ++ } ++ ++ addr = (struct sockaddr*)&sun; ++ addr->sa_family = AF_UNIX; ++ name = ((char*)addr) + 2; ++ err = select_deleted_name(name, ctx); ++ if (err) ++ goto out; ++ addrlen = 2 + strlen(name); ++ } else if (nd.dentry) { ++ if (!S_ISSOCK(nd.dentry->d_inode->i_mode)) { ++ eprintk_ctx("bind_unix_socket: not a socket dentry\n"); ++ err = -EINVAL; ++ goto out; ++ } ++ sc_unlink(name); ++ } ++ } ++ ++ err = sock->ops->bind(sock, addr, addrlen); ++ ++ if (!err && name[0]) { ++ if (nd.dentry) { ++ sc_chown(name, nd.dentry->d_inode->i_uid, ++ nd.dentry->d_inode->i_gid); ++ sc_chmod(name, nd.dentry->d_inode->i_mode); ++ } ++ if (si->cpt_deleted) ++ sc_unlink(name); ++ } ++ ++out: ++ if (nd.dentry) ++ path_release(&nd); ++ return err; ++} ++ ++static int fixup_unix_address(struct socket *sock, struct cpt_sock_image *si, ++ struct cpt_context *ctx) ++{ ++ struct sock *sk = sock->sk; ++ cpt_object_t *obj; ++ struct sock *parent; ++ ++ if (sk->sk_family != AF_UNIX || sk->sk_state == TCP_LISTEN) ++ return 0; ++ ++ if (si->cpt_parent == -1) ++ return bind_unix_socket(sock, si, ctx); ++ ++ obj = lookup_cpt_obj_byindex(CPT_OBJ_SOCKET, si->cpt_parent, ctx); ++ if (!obj) ++ return 0; ++ ++ parent = obj->o_obj; ++ if (unix_sk(parent)->addr) { ++ if (unix_sk(sk)->addr && ++ atomic_dec_and_test(&unix_sk(sk)->addr->refcnt)) ++ kfree(unix_sk(sk)->addr); ++ atomic_inc(&unix_sk(parent)->addr->refcnt); ++ unix_sk(sk)->addr = unix_sk(parent)->addr; ++ } ++ return 0; ++} ++ ++static int generic_restore_queues(struct sock *sk, struct cpt_sock_image *si, ++ loff_t pos, struct cpt_context *ctx) ++{ ++ loff_t endpos; ++ ++ pos = pos + si->cpt_hdrlen; ++ endpos = pos + si->cpt_next; ++ while (pos < endpos) { ++ struct sk_buff *skb; ++ __u32 type; ++ ++ skb = rst_skb(&pos, NULL, &type, ctx); ++ if (IS_ERR(skb)) { ++ if (PTR_ERR(skb) == -EINVAL) { ++ int err; ++ ++ err = rst_sock_attr(&pos, sk, ctx); ++ if (err) ++ return err; ++ } ++ return PTR_ERR(skb); ++ } ++ ++ if (type == CPT_SKB_RQ) { ++ skb_set_owner_r(skb, sk); ++ skb_queue_tail(&sk->sk_receive_queue, skb); ++ } else { ++ wprintk_ctx("strange socket queue type %u\n", type); ++ kfree_skb(skb); ++ } ++ } ++ return 0; ++} ++ ++static int open_socket(cpt_object_t *obj, struct cpt_sock_image *si, ++ struct cpt_context *ctx) ++{ ++ int err; ++ struct socket *sock; ++ struct socket *sock2 = NULL; ++ struct file *file; ++ cpt_object_t *fobj; ++ cpt_object_t *pobj = NULL; ++ ++ err = sock_create_kern(si->cpt_family, si->cpt_type, si->cpt_protocol, ++ &sock); ++ if (err) ++ return err; ++ ++ if (si->cpt_socketpair) { ++ err = sock_create_kern(si->cpt_family, si->cpt_type, ++ si->cpt_protocol, &sock2); ++ if (err) ++ goto err_out; ++ ++ err = sock->ops->socketpair(sock, sock2); ++ if (err < 0) ++ goto err_out; ++ ++ /* Socketpair with a peer outside our environment. ++ * So, we create real half-open pipe and do not worry ++ * about dead end anymore. */ ++ if (si->cpt_peer == -1) { ++ sock_release(sock2); ++ sock2 = NULL; ++ } ++ } ++ ++ cpt_obj_setobj(obj, sock->sk, ctx); ++ ++ if (si->cpt_file != CPT_NULL) { ++ file = sock_mapfile(sock); ++ err = PTR_ERR(file); ++ if (IS_ERR(file)) ++ goto err_out; ++ ++ err = -ENOMEM; ++ ++ obj->o_parent = file; ++ ++ if ((fobj = cpt_object_add(CPT_OBJ_FILE, file, ctx)) == NULL) ++ goto err_out; ++ cpt_obj_setpos(fobj, si->cpt_file, ctx); ++ cpt_obj_setindex(fobj, si->cpt_index, ctx); ++ } ++ ++ if (sock2) { ++ struct file *file2; ++ ++ pobj = lookup_cpt_obj_byindex(CPT_OBJ_SOCKET, si->cpt_peer, ctx); ++ if (!pobj) BUG(); ++ if (pobj->o_obj) BUG(); ++ cpt_obj_setobj(pobj, sock2->sk, ctx); ++ ++ if (pobj->o_ppos != CPT_NULL) { ++ file2 = sock_mapfile(sock2); ++ err = PTR_ERR(file2); ++ if (IS_ERR(file2)) ++ goto err_out; ++ ++ err = -ENOMEM; ++ if ((fobj = cpt_object_add(CPT_OBJ_FILE, file2, ctx)) == NULL) ++ goto err_out; ++ cpt_obj_setpos(fobj, pobj->o_ppos, ctx); ++ cpt_obj_setindex(fobj, si->cpt_peer, ctx); ++ ++ pobj->o_parent = file2; ++ } ++ } ++ ++ setup_sock_common(sock->sk, si, obj->o_pos, ctx); ++ if (sock->sk->sk_family == AF_INET || sock->sk->sk_family == AF_INET6) { ++ int saved_reuse = sock->sk->sk_reuse; ++ ++ inet_sk(sock->sk)->freebind = 1; ++ sock->sk->sk_reuse = 2; ++ if (si->cpt_laddrlen) { ++ err = sock->ops->bind(sock, (struct sockaddr *)&si->cpt_laddr, si->cpt_laddrlen); ++ if (err) { ++ dprintk_ctx("binding failed: %d, do not worry\n", err); ++ } ++ } ++ sock->sk->sk_reuse = saved_reuse; ++ rst_socket_in(si, obj->o_pos, sock->sk, ctx); ++ } else if (sock->sk->sk_family == AF_NETLINK) { ++ struct sockaddr_nl *nl = (struct sockaddr_nl *)&si->cpt_laddr; ++ if (nl->nl_pid) { ++ err = sock->ops->bind(sock, (struct sockaddr *)&si->cpt_laddr, si->cpt_laddrlen); ++ if (err) { ++ eprintk_ctx("AF_NETLINK binding failed: %d\n", err); ++ } ++ } ++ if (si->cpt_raddrlen && nl->nl_pid) { ++ err = sock->ops->connect(sock, (struct sockaddr *)&si->cpt_raddr, si->cpt_raddrlen, O_NONBLOCK); ++ if (err) { ++ eprintk_ctx("oops, AF_NETLINK connect failed: %d\n", err); ++ } ++ } ++ generic_restore_queues(sock->sk, si, obj->o_pos, ctx); ++ } else if (sock->sk->sk_family == PF_PACKET) { ++ struct sockaddr_ll *ll = (struct sockaddr_ll *)&si->cpt_laddr; ++ if (ll->sll_protocol || ll->sll_ifindex) { ++ int alen = si->cpt_laddrlen; ++ if (alen < sizeof(struct sockaddr_ll)) ++ alen = sizeof(struct sockaddr_ll); ++ err = sock->ops->bind(sock, (struct sockaddr *)&si->cpt_laddr, alen); ++ if (err) { ++ eprintk_ctx("AF_PACKET binding failed: %d\n", err); ++ } ++ } ++ generic_restore_queues(sock->sk, si, obj->o_pos, ctx); ++ } ++ fixup_unix_address(sock, si, ctx); ++ ++ if (sock2) { ++ err = rst_get_object(CPT_OBJ_SOCKET, pobj->o_pos, si, ctx); ++ if (err) ++ return err; ++ setup_sock_common(sock2->sk, si, pobj->o_pos, ctx); ++ fixup_unix_address(sock2, si, ctx); ++ } ++ ++ if ((sock->sk->sk_family == AF_INET || sock->sk->sk_family == AF_INET6) ++ && (int)si->cpt_parent != -1) { ++ cpt_object_t *lobj = lookup_cpt_obj_byindex(CPT_OBJ_SOCKET, si->cpt_parent, ctx); ++ if (lobj && cpt_attach_accept(lobj->o_obj, sock->sk, ctx) == 0) ++ sock->sk = NULL; ++ } ++ ++ ++ if (si->cpt_file == CPT_NULL && sock->sk && ++ sock->sk->sk_family == AF_INET) { ++ struct sock *sk = sock->sk; ++ ++ if (sk) { ++ sock->sk = NULL; ++ ++ local_bh_disable(); ++ bh_lock_sock(sk); ++ if (sock_owned_by_user(sk)) ++ eprintk_ctx("oops, sock is locked by user\n"); ++ ++ sock_hold(sk); ++ sock_orphan(sk); ++ ub_inc_orphan_count(sk); ++ bh_unlock_sock(sk); ++ local_bh_enable(); ++ sock_put(sk); ++ dprintk_ctx("orphaning socket %p\n", sk); ++ } ++ } ++ ++ if (si->cpt_file == CPT_NULL && sock->sk == NULL) ++ sock_release(sock); ++ ++ return 0; ++ ++err_out: ++ if (sock2) ++ sock_release(sock2); ++ sock_release(sock); ++ return err; ++} ++ ++static int open_listening_socket(loff_t pos, struct cpt_sock_image *si, ++ struct cpt_context *ctx) ++{ ++ int err; ++ struct socket *sock; ++ struct file *file; ++ cpt_object_t *obj, *fobj; ++ ++ err = sock_create_kern(si->cpt_family, si->cpt_type, si->cpt_protocol, ++ &sock); ++ if (err) { ++ eprintk_ctx("open_listening_socket: sock_create_kern: %d\n", err); ++ return err; ++ } ++ ++ sock->sk->sk_reuse = 2; ++ sock->sk->sk_bound_dev_if = si->cpt_bound_dev_if; ++ ++ if (sock->sk->sk_family == AF_UNIX) { ++ err = bind_unix_socket(sock, si, ctx); ++ } else if (si->cpt_laddrlen) { ++ if (sock->sk->sk_family == AF_INET || sock->sk->sk_family == AF_INET6) ++ inet_sk(sock->sk)->freebind = 1; ++ ++ err = sock->ops->bind(sock, (struct sockaddr *)&si->cpt_laddr, si->cpt_laddrlen); ++ ++ if (err) { ++ eprintk_ctx("open_listening_socket: bind: %d\n", err); ++ goto err_out; ++ } ++ } ++ ++ err = sock->ops->listen(sock, si->cpt_max_ack_backlog); ++ if (err) { ++ eprintk_ctx("open_listening_socket: listen: %d, %Ld, %d\n", err, pos, si->cpt_deleted); ++ goto err_out; ++ } ++ ++ /* Now we may access socket body directly and fixup all the things. */ ++ ++ file = sock_mapfile(sock); ++ err = PTR_ERR(file); ++ if (IS_ERR(file)) { ++ eprintk_ctx("open_listening_socket: map: %d\n", err); ++ goto err_out; ++ } ++ ++ err = -ENOMEM; ++ if ((fobj = cpt_object_add(CPT_OBJ_FILE, file, ctx)) == NULL) ++ goto err_out; ++ if ((obj = cpt_object_add(CPT_OBJ_SOCKET, sock->sk, ctx)) == NULL) ++ goto err_out; ++ cpt_obj_setpos(obj, pos, ctx); ++ cpt_obj_setindex(obj, si->cpt_index, ctx); ++ obj->o_parent = file; ++ cpt_obj_setpos(fobj, si->cpt_file, ctx); ++ cpt_obj_setindex(fobj, si->cpt_index, ctx); ++ ++ setup_sock_common(sock->sk, si, pos, ctx); ++ ++ if (si->cpt_family == AF_INET || si->cpt_family == AF_INET6) ++ rst_restore_synwait_queue(sock->sk, si, pos, ctx); ++ ++ return 0; ++ ++err_out: ++ sock_release(sock); ++ return err; ++} ++ ++static int ++rst_sock_attr_mcfilter(loff_t *pos_p, struct sock *sk, cpt_context_t *ctx) ++{ ++ int err; ++ loff_t pos = *pos_p; ++ struct cpt_sockmc_image v; ++ ++ err = rst_get_object(CPT_OBJ_SOCK_MCADDR, pos, &v, ctx); ++ if (err) ++ return err; ++ ++ *pos_p += v.cpt_next; ++ ++ if (v.cpt_family == AF_INET) ++ return rst_sk_mcfilter_in(sk, &v, pos, ctx); ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++ else if (v.cpt_family == AF_INET6) ++ return rst_sk_mcfilter_in6(sk, &v, pos, ctx); ++#endif ++ else ++ return -EAFNOSUPPORT; ++} ++ ++ ++static int ++rst_sock_attr_skfilter(loff_t *pos_p, struct sock *sk, cpt_context_t *ctx) ++{ ++ int err; ++ struct sk_filter *fp, *old_fp; ++ loff_t pos = *pos_p; ++ struct cpt_obj_bits v; ++ ++ err = rst_get_object(CPT_OBJ_SKFILTER, pos, &v, ctx); ++ if (err) ++ return err; ++ ++ *pos_p += v.cpt_next; ++ ++ if (v.cpt_size % sizeof(struct sock_filter)) ++ return -EINVAL; ++ ++ fp = sock_kmalloc(sk, v.cpt_size+sizeof(*fp), GFP_KERNEL_UBC); ++ if (fp == NULL) ++ return -ENOMEM; ++ atomic_set(&fp->refcnt, 1); ++ fp->len = v.cpt_size/sizeof(struct sock_filter); ++ ++ err = ctx->pread(fp->insns, v.cpt_size, ctx, pos+v.cpt_hdrlen); ++ if (err) { ++ sk_filter_uncharge(sk, fp); ++ return err; ++ } ++ ++ old_fp = sk->sk_filter; ++ sk->sk_filter = fp; ++ if (old_fp) ++ sk_filter_uncharge(sk, old_fp); ++ return 0; ++} ++ ++ ++int rst_sock_attr(loff_t *pos_p, struct sock *sk, cpt_context_t *ctx) ++{ ++ int err; ++ loff_t pos = *pos_p; ++ ++ err = rst_sock_attr_skfilter(pos_p, sk, ctx); ++ if (err && pos == *pos_p) ++ err = rst_sock_attr_mcfilter(pos_p, sk, ctx); ++ return err; ++} ++ ++struct sk_buff * rst_skb(loff_t *pos_p, __u32 *owner, __u32 *queue, struct cpt_context *ctx) ++{ ++ int err; ++ struct sk_buff *skb; ++ struct cpt_skb_image v; ++ loff_t pos = *pos_p; ++ struct scm_fp_list *fpl = NULL; ++ struct timeval tmptv; ++ ++ err = rst_get_object(CPT_OBJ_SKB, pos, &v, ctx); ++ if (err) ++ return ERR_PTR(err); ++ *pos_p = pos + v.cpt_next; ++ ++ if (owner) ++ *owner = v.cpt_owner; ++ if (queue) ++ *queue = v.cpt_queue; ++ ++ skb = alloc_skb(v.cpt_len + v.cpt_hspace + v.cpt_tspace, GFP_KERNEL); ++ if (skb == NULL) ++ return ERR_PTR(-ENOMEM); ++ skb_reserve(skb, v.cpt_hspace); ++ skb_put(skb, v.cpt_len); ++#ifdef NET_SKBUFF_DATA_USES_OFFSET ++ skb->transport_header = v.cpt_h; ++ skb->network_header = v.cpt_nh; ++ skb->mac_header = v.cpt_mac; ++#else ++ skb->transport_header = skb->head + v.cpt_h; ++ skb->network_header = skb->head + v.cpt_nh; ++ skb->mac_header = skb->head + v.cpt_mac; ++#endif ++ BUILD_BUG_ON(sizeof(skb->cb) < sizeof(v.cpt_cb)); ++ memcpy(skb->cb, v.cpt_cb, sizeof(v.cpt_cb)); ++ skb->mac_len = v.cpt_mac_len; ++ ++ skb->csum = v.cpt_csum; ++ skb->local_df = v.cpt_local_df; ++ skb->pkt_type = v.cpt_pkt_type; ++ skb->ip_summed = v.cpt_ip_summed; ++ skb->priority = v.cpt_priority; ++ skb->protocol = v.cpt_protocol; ++ cpt_timeval_import(&tmptv, v.cpt_stamp); ++ skb->tstamp = timeval_to_ktime(tmptv); ++ ++ skb_shinfo(skb)->gso_segs = v.cpt_gso_segs; ++ skb_shinfo(skb)->gso_size = v.cpt_gso_size; ++ if (ctx->image_version == 0) { ++ skb_shinfo(skb)->gso_segs = 1; ++ skb_shinfo(skb)->gso_size = 0; ++ } ++ ++ if (v.cpt_next > v.cpt_hdrlen) { ++ pos = pos + v.cpt_hdrlen; ++ while (pos < *pos_p) { ++ union { ++ struct cpt_obj_bits b; ++ struct cpt_fd_image f; ++ } u; ++ ++ err = rst_get_object(-1, pos, &u, ctx); ++ if (err) { ++ kfree_skb(skb); ++ return ERR_PTR(err); ++ } ++ if (u.b.cpt_object == CPT_OBJ_BITS) { ++ if (u.b.cpt_size != v.cpt_hspace + skb->len) { ++ eprintk_ctx("invalid skb image %u != %u + %u\n", u.b.cpt_size, v.cpt_hspace, skb->len); ++ kfree_skb(skb); ++ return ERR_PTR(-EINVAL); ++ } ++ ++ err = ctx->pread(skb->head, u.b.cpt_size, ctx, pos+u.b.cpt_hdrlen); ++ if (err) { ++ kfree_skb(skb); ++ return ERR_PTR(err); ++ } ++ } else if (u.f.cpt_object == CPT_OBJ_FILEDESC) { ++ if (!fpl) { ++ fpl = kmalloc(sizeof(struct scm_fp_list), ++ GFP_KERNEL_UBC); ++ if (!fpl) { ++ kfree_skb(skb); ++ return ERR_PTR(-ENOMEM); ++ } ++ fpl->count = 0; ++ UNIXCB(skb).fp = fpl; ++ } ++ fpl->fp[fpl->count] = rst_file(u.f.cpt_file, -1, ctx); ++ if (!IS_ERR(fpl->fp[fpl->count])) ++ fpl->count++; ++ } ++ pos += u.b.cpt_next; ++ } ++ } ++ ++ return skb; ++} ++ ++static int restore_unix_rqueue(struct sock *sk, struct cpt_sock_image *si, ++ loff_t pos, struct cpt_context *ctx) ++{ ++ loff_t endpos; ++ ++ pos = pos + si->cpt_hdrlen; ++ endpos = pos + si->cpt_next; ++ while (pos < endpos) { ++ struct sk_buff *skb; ++ struct sock *owner_sk; ++ __u32 owner; ++ ++ skb = rst_skb(&pos, &owner, NULL, ctx); ++ if (IS_ERR(skb)) { ++ if (PTR_ERR(skb) == -EINVAL) { ++ int err; ++ ++ err = rst_sock_attr(&pos, sk, ctx); ++ if (err) ++ return err; ++ } ++ return PTR_ERR(skb); ++ } ++ ++ owner_sk = unix_peer(sk); ++ if (owner != -1) { ++ cpt_object_t *pobj; ++ pobj = lookup_cpt_obj_byindex(CPT_OBJ_SOCKET, owner, ctx); ++ if (pobj == NULL) { ++ eprintk_ctx("orphan af_unix skb?\n"); ++ kfree_skb(skb); ++ continue; ++ } ++ owner_sk = pobj->o_obj; ++ } ++ if (owner_sk == NULL) { ++ dprintk_ctx("orphan af_unix skb 2?\n"); ++ kfree_skb(skb); ++ continue; ++ } ++ skb_set_owner_w(skb, owner_sk); ++ if (UNIXCB(skb).fp) ++ skb->destructor = unix_destruct_fds; ++ skb_queue_tail(&sk->sk_receive_queue, skb); ++ if (sk->sk_state == TCP_LISTEN) { ++ struct socket *sock = skb->sk->sk_socket; ++ if (sock == NULL) BUG(); ++ if (sock->file) BUG(); ++ skb->sk->sk_socket = NULL; ++ skb->sk->sk_sleep = NULL; ++ sock->sk = NULL; ++ sock_release(sock); ++ } ++ } ++ return 0; ++} ++ ++ ++/* All the sockets are created before we start to open files */ ++ ++int rst_sockets(struct cpt_context *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_SOCKET]; ++ loff_t endsec; ++ cpt_object_t *obj; ++ struct cpt_section_hdr h; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) { ++ eprintk_ctx("rst_sockets: ctx->pread: %d\n", err); ++ return err; ++ } ++ if (h.cpt_section != CPT_SECT_SOCKET || h.cpt_hdrlen < sizeof(h)) { ++ eprintk_ctx("rst_sockets: hdr err\n"); ++ return -EINVAL; ++ } ++ ++ /* The first pass: we create socket index and open listening sockets. */ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ struct cpt_sock_image *sbuf = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_SOCKET, sec, sbuf, ctx); ++ if (err) { ++ eprintk_ctx("rst_sockets: rst_get_object: %d\n", err); ++ cpt_release_buf(ctx); ++ return err; ++ } ++ if (sbuf->cpt_state == TCP_LISTEN) { ++ err = open_listening_socket(sec, sbuf, ctx); ++ cpt_release_buf(ctx); ++ if (err) { ++ eprintk_ctx("rst_sockets: open_listening_socket: %d\n", err); ++ return err; ++ } ++ } else { ++ cpt_release_buf(ctx); ++ obj = alloc_cpt_object(GFP_KERNEL, ctx); ++ if (obj == NULL) ++ return -ENOMEM; ++ cpt_obj_setindex(obj, sbuf->cpt_index, ctx); ++ cpt_obj_setpos(obj, sec, ctx); ++ obj->o_ppos = sbuf->cpt_file; ++ intern_cpt_object(CPT_OBJ_SOCKET, obj, ctx); ++ } ++ sec += sbuf->cpt_next; ++ } ++ ++ /* Pass 2: really restore sockets */ ++ for_each_object(obj, CPT_OBJ_SOCKET) { ++ struct cpt_sock_image *sbuf; ++ if (obj->o_obj != NULL) ++ continue; ++ sbuf = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_SOCKET, obj->o_pos, sbuf, ctx); ++ if (err) { ++ eprintk_ctx("rst_sockets: rst_get_object: %d\n", err); ++ cpt_release_buf(ctx); ++ return err; ++ } ++ if (sbuf->cpt_state == TCP_LISTEN) BUG(); ++ err = open_socket(obj, sbuf, ctx); ++ cpt_release_buf(ctx); ++ if (err) { ++ eprintk_ctx("rst_sockets: open_socket: %d\n", err); ++ return err; ++ } ++ } ++ ++ return 0; ++} ++ ++int rst_orphans(struct cpt_context *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_ORPHANS]; ++ loff_t endsec; ++ cpt_object_t *obj; ++ struct cpt_section_hdr h; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_ORPHANS || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ struct cpt_sock_image *sbuf = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_SOCKET, sec, sbuf, ctx); ++ if (err) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++ obj = alloc_cpt_object(GFP_KERNEL, ctx); ++ if (obj == NULL) { ++ cpt_release_buf(ctx); ++ return -ENOMEM; ++ } ++ obj->o_pos = sec; ++ obj->o_ppos = sbuf->cpt_file; ++ err = open_socket(obj, sbuf, ctx); ++ dprintk_ctx("Restoring orphan: %d\n", err); ++ free_cpt_object(obj, ctx); ++ cpt_release_buf(ctx); ++ if (err) ++ return err; ++ sec += sbuf->cpt_next; ++ } ++ ++ return 0; ++} ++ ++ ++/* Pass 3: I understand, this is not funny already :-), ++ * but we have to do another pass to establish links between ++ * not-paired AF_UNIX SOCK_DGRAM sockets and to restore AF_UNIX ++ * skb queues with proper skb->sk links. ++ * ++ * This could be made at the end of rst_sockets(), but we defer ++ * restoring af_unix queues up to the end of restoring files to ++ * make restoring passed FDs cleaner. ++ */ ++ ++int rst_sockets_complete(struct cpt_context *ctx) ++{ ++ int err; ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_SOCKET) { ++ struct cpt_sock_image *sbuf; ++ struct sock *sk = obj->o_obj; ++ struct sock *peer; ++ ++ if (!sk) BUG(); ++ ++ if (sk->sk_family != AF_UNIX) ++ continue; ++ ++ sbuf = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_SOCKET, obj->o_pos, sbuf, ctx); ++ if (err) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++ ++ if (sbuf->cpt_next > sbuf->cpt_hdrlen) ++ restore_unix_rqueue(sk, sbuf, obj->o_pos, ctx); ++ ++ cpt_release_buf(ctx); ++ ++ if (sk->sk_type == SOCK_DGRAM && unix_peer(sk) == NULL) { ++ cpt_object_t *pobj; ++ ++ sbuf = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_SOCKET, obj->o_pos, sbuf, ctx); ++ if (err) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++ ++ if (sbuf->cpt_peer != -1) { ++ pobj = lookup_cpt_obj_byindex(CPT_OBJ_SOCKET, sbuf->cpt_peer, ctx); ++ if (pobj) { ++ peer = pobj->o_obj; ++ sock_hold(peer); ++ unix_peer(sk) = peer; ++ } ++ } ++ cpt_release_buf(ctx); ++ } ++ } ++ ++ rst_orphans(ctx); ++ ++ return 0; ++} ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_socket_in.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_socket_in.c +--- ./kernel/cpt/rst_socket_in.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_socket_in.c 2012-11-13 15:20:15.376569065 +0000 +@@ -0,0 +1,502 @@ ++/* ++ * ++ * kernel/cpt/rst_socket_in.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_socket.h" ++#include "cpt_kernel.h" ++ ++static inline unsigned long jiffies_import(__u32 tmo) ++{ ++ __s32 delta = tmo; ++ return jiffies + (long)delta; ++} ++ ++static inline __u32 tcp_jiffies_import(__u32 tmo) ++{ ++ return ((__u32)jiffies) + tmo; ++} ++ ++ ++static int restore_queues(struct sock *sk, struct cpt_sock_image *si, ++ loff_t pos, struct cpt_context *ctx) ++{ ++ loff_t endpos; ++ ++ pos = pos + si->cpt_hdrlen; ++ endpos = pos + si->cpt_next; ++ while (pos < endpos) { ++ struct sk_buff *skb; ++ __u32 type; ++ ++ skb = rst_skb(&pos, NULL, &type, ctx); ++ if (IS_ERR(skb)) { ++ if (PTR_ERR(skb) == -EINVAL) { ++ int err; ++ ++ err = rst_sock_attr(&pos, sk, ctx); ++ if (err) ++ return err; ++ } ++ return PTR_ERR(skb); ++ } ++ ++ if (sk->sk_type == SOCK_STREAM) { ++ if (type == CPT_SKB_RQ) { ++ sk_stream_set_owner_r(skb, sk); ++ ub_tcprcvbuf_charge_forced(sk, skb); ++ skb_queue_tail(&sk->sk_receive_queue, skb); ++ } else if (type == CPT_SKB_OFOQ) { ++ struct tcp_sock *tp = tcp_sk(sk); ++ sk_stream_set_owner_r(skb, sk); ++ ub_tcprcvbuf_charge_forced(sk, skb); ++ skb_queue_tail(&tp->out_of_order_queue, skb); ++ } else if (type == CPT_SKB_WQ) { ++ sk->sk_wmem_queued += skb->truesize; ++ sk->sk_forward_alloc -= skb->truesize; ++ ub_tcpsndbuf_charge_forced(sk, skb); ++ skb_queue_tail(&sk->sk_write_queue, skb); ++ } else { ++ wprintk_ctx("strange stream queue type %u\n", type); ++ kfree_skb(skb); ++ } ++ } else { ++ if (type == CPT_SKB_RQ) { ++ skb_set_owner_r(skb, sk); ++ skb_queue_tail(&sk->sk_receive_queue, skb); ++ } else if (type == CPT_SKB_WQ) { ++ struct inet_sock *inet = inet_sk(sk); ++ if (inet->cork.fragsize) { ++ skb_set_owner_w(skb, sk); ++ skb_queue_tail(&sk->sk_write_queue, skb); ++ } else { ++ eprintk_ctx("cork skb is dropped\n"); ++ kfree_skb(skb); ++ } ++ } else { ++ wprintk_ctx("strange dgram queue type %u\n", type); ++ kfree_skb(skb); ++ } ++ } ++ } ++ return 0; ++} ++ ++static struct sock *find_parent(__u16 sport, cpt_context_t *ctx) ++{ ++ cpt_object_t *obj; ++ for_each_object(obj, CPT_OBJ_SOCKET) { ++ struct sock *sk = obj->o_obj; ++ if (sk && ++ sk->sk_state == TCP_LISTEN && ++ (sk->sk_family == AF_INET || sk->sk_family == AF_INET6) && ++ inet_sk(sk)->sport == sport) ++ return sk; ++ } ++ return NULL; ++} ++ ++static int rst_socket_tcp(struct cpt_sock_image *si, loff_t pos, struct sock *sk, ++ struct cpt_context *ctx) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct sk_buff *skb; ++ tp->pred_flags = si->cpt_pred_flags; ++ tp->rcv_nxt = si->cpt_rcv_nxt; ++ tp->snd_nxt = si->cpt_snd_nxt; ++ tp->snd_una = si->cpt_snd_una; ++ tp->snd_sml = si->cpt_snd_sml; ++ tp->rcv_tstamp = tcp_jiffies_import(si->cpt_rcv_tstamp); ++ tp->lsndtime = tcp_jiffies_import(si->cpt_lsndtime); ++ tp->tcp_header_len = si->cpt_tcp_header_len; ++ inet_csk(sk)->icsk_ack.pending = si->cpt_ack_pending; ++ inet_csk(sk)->icsk_ack.quick = si->cpt_quick; ++ inet_csk(sk)->icsk_ack.pingpong = si->cpt_pingpong; ++ inet_csk(sk)->icsk_ack.blocked = si->cpt_blocked; ++ inet_csk(sk)->icsk_ack.ato = si->cpt_ato; ++ inet_csk(sk)->icsk_ack.timeout = jiffies_import(si->cpt_ack_timeout); ++ inet_csk(sk)->icsk_ack.lrcvtime = tcp_jiffies_import(si->cpt_lrcvtime); ++ inet_csk(sk)->icsk_ack.last_seg_size = si->cpt_last_seg_size; ++ inet_csk(sk)->icsk_ack.rcv_mss = si->cpt_rcv_mss; ++ tp->snd_wl1 = si->cpt_snd_wl1; ++ tp->snd_wnd = si->cpt_snd_wnd; ++ tp->max_window = si->cpt_max_window; ++ inet_csk(sk)->icsk_pmtu_cookie = si->cpt_pmtu_cookie; ++ tp->mss_cache = si->cpt_mss_cache; ++ tp->rx_opt.mss_clamp = si->cpt_mss_clamp; ++ inet_csk(sk)->icsk_ext_hdr_len = si->cpt_ext_header_len; ++ inet_csk(sk)->icsk_ca_state = si->cpt_ca_state; ++ inet_csk(sk)->icsk_retransmits = si->cpt_retransmits; ++ tp->reordering = si->cpt_reordering; ++ tp->frto_counter = si->cpt_frto_counter; ++ tp->frto_highmark = si->cpt_frto_highmark; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) ++ // // tp->adv_cong = si->cpt_adv_cong; ++#endif ++ inet_csk(sk)->icsk_accept_queue.rskq_defer_accept = si->cpt_defer_accept; ++ inet_csk(sk)->icsk_backoff = si->cpt_backoff; ++ tp->srtt = si->cpt_srtt; ++ tp->mdev = si->cpt_mdev; ++ tp->mdev_max = si->cpt_mdev_max; ++ tp->rttvar = si->cpt_rttvar; ++ tp->rtt_seq = si->cpt_rtt_seq; ++ inet_csk(sk)->icsk_rto = si->cpt_rto; ++ tp->packets_out = si->cpt_packets_out; ++ tp->retrans_out = si->cpt_retrans_out; ++ tp->lost_out = si->cpt_lost_out; ++ tp->sacked_out = si->cpt_sacked_out; ++ tp->fackets_out = si->cpt_fackets_out; ++ tp->snd_ssthresh = si->cpt_snd_ssthresh; ++ tp->snd_cwnd = si->cpt_snd_cwnd; ++ tp->snd_cwnd_cnt = si->cpt_snd_cwnd_cnt; ++ tp->snd_cwnd_clamp = si->cpt_snd_cwnd_clamp; ++ tp->snd_cwnd_used = si->cpt_snd_cwnd_used; ++ tp->snd_cwnd_stamp = tcp_jiffies_import(si->cpt_snd_cwnd_stamp); ++ inet_csk(sk)->icsk_timeout = tcp_jiffies_import(si->cpt_timeout); ++ tp->rcv_wnd = si->cpt_rcv_wnd; ++ tp->rcv_wup = si->cpt_rcv_wup; ++ tp->write_seq = si->cpt_write_seq; ++ tp->pushed_seq = si->cpt_pushed_seq; ++ tp->copied_seq = si->cpt_copied_seq; ++ tp->rx_opt.tstamp_ok = si->cpt_tstamp_ok; ++ tp->rx_opt.wscale_ok = si->cpt_wscale_ok; ++ tp->rx_opt.sack_ok = si->cpt_sack_ok; ++ tp->rx_opt.saw_tstamp = si->cpt_saw_tstamp; ++ tp->rx_opt.snd_wscale = si->cpt_snd_wscale; ++ tp->rx_opt.rcv_wscale = si->cpt_rcv_wscale; ++ tp->nonagle = si->cpt_nonagle; ++ tp->keepalive_probes = si->cpt_keepalive_probes; ++ tp->rx_opt.rcv_tsval = si->cpt_rcv_tsval; ++ tp->rx_opt.rcv_tsecr = si->cpt_rcv_tsecr; ++ tp->rx_opt.ts_recent = si->cpt_ts_recent; ++ tp->rx_opt.ts_recent_stamp = si->cpt_ts_recent_stamp; ++ tp->rx_opt.user_mss = si->cpt_user_mss; ++ tp->rx_opt.dsack = si->cpt_dsack; ++ tp->rx_opt.eff_sacks = si->cpt_num_sacks; ++ tp->duplicate_sack[0].start_seq = si->cpt_sack_array[0]; ++ tp->duplicate_sack[0].end_seq = si->cpt_sack_array[1]; ++ tp->selective_acks[0].start_seq = si->cpt_sack_array[2]; ++ tp->selective_acks[0].end_seq = si->cpt_sack_array[3]; ++ tp->selective_acks[1].start_seq = si->cpt_sack_array[4]; ++ tp->selective_acks[1].end_seq = si->cpt_sack_array[5]; ++ tp->selective_acks[2].start_seq = si->cpt_sack_array[6]; ++ tp->selective_acks[2].end_seq = si->cpt_sack_array[7]; ++ tp->selective_acks[3].start_seq = si->cpt_sack_array[8]; ++ tp->selective_acks[3].end_seq = si->cpt_sack_array[9]; ++ ++ tp->window_clamp = si->cpt_window_clamp; ++ tp->rcv_ssthresh = si->cpt_rcv_ssthresh; ++ inet_csk(sk)->icsk_probes_out = si->cpt_probes_out; ++ tp->rx_opt.num_sacks = si->cpt_num_sacks; ++ tp->advmss = si->cpt_advmss; ++ inet_csk(sk)->icsk_syn_retries = si->cpt_syn_retries; ++ tp->ecn_flags = si->cpt_ecn_flags; ++ tp->prior_ssthresh = si->cpt_prior_ssthresh; ++ tp->high_seq = si->cpt_high_seq; ++ tp->retrans_stamp = si->cpt_retrans_stamp; ++ tp->undo_marker = si->cpt_undo_marker; ++ tp->undo_retrans = si->cpt_undo_retrans; ++ tp->urg_seq = si->cpt_urg_seq; ++ tp->urg_data = si->cpt_urg_data; ++ inet_csk(sk)->icsk_pending = si->cpt_pending; ++ tp->urg_mode = si->cpt_urg_mode; ++ tp->snd_up = si->cpt_snd_up; ++ tp->keepalive_time = si->cpt_keepalive_time; ++ tp->keepalive_intvl = si->cpt_keepalive_intvl; ++ tp->linger2 = si->cpt_linger2; ++ ++ sk->sk_send_head = NULL; ++ for (skb = skb_peek(&sk->sk_write_queue); ++ skb && skb != (struct sk_buff*)&sk->sk_write_queue; ++ skb = skb->next) { ++ if (!after(tp->snd_nxt, TCP_SKB_CB(skb)->seq)) { ++ sk->sk_send_head = skb; ++ break; ++ } ++ } ++ ++ if (sk->sk_state != TCP_CLOSE && sk->sk_state != TCP_LISTEN) { ++ struct inet_sock *inet = inet_sk(sk); ++ if (inet->num == 0) { ++ cpt_object_t *lobj = NULL; ++ ++ if ((int)si->cpt_parent != -1) ++ lobj = lookup_cpt_obj_byindex(CPT_OBJ_SOCKET, si->cpt_parent, ctx); ++ ++ if (lobj && lobj->o_obj) { ++ inet->num = ntohs(inet->sport); ++ local_bh_disable(); ++ __inet_inherit_port(&tcp_hashinfo, lobj->o_obj, sk); ++ local_bh_enable(); ++ dprintk_ctx("port inherited from parent\n"); ++ } else { ++ struct sock *lsk = find_parent(inet->sport, ctx); ++ if (lsk) { ++ inet->num = ntohs(inet->sport); ++ local_bh_disable(); ++ __inet_inherit_port(&tcp_hashinfo, lsk, sk); ++ local_bh_enable(); ++ dprintk_ctx("port inherited\n"); ++ } else { ++ eprintk_ctx("we are kinda lost...\n"); ++ } ++ } ++ } ++ ++ sk->sk_prot->hash(sk); ++ ++ if (inet_csk(sk)->icsk_ack.pending&ICSK_ACK_TIMER) ++ sk_reset_timer(sk, &inet_csk(sk)->icsk_delack_timer, inet_csk(sk)->icsk_ack.timeout); ++ if (inet_csk(sk)->icsk_pending) ++ sk_reset_timer(sk, &inet_csk(sk)->icsk_retransmit_timer, ++ inet_csk(sk)->icsk_timeout); ++ if (sock_flag(sk, SOCK_KEEPOPEN)) { ++ unsigned long expires = jiffies_import(si->cpt_ka_timeout); ++ if (time_after(jiffies, expires)) ++ expires = jiffies + HZ; ++ sk_reset_timer(sk, &sk->sk_timer, expires); ++ } ++ } ++ ++ return 0; ++} ++ ++ ++int rst_socket_in(struct cpt_sock_image *si, loff_t pos, struct sock *sk, ++ struct cpt_context *ctx) ++{ ++ struct inet_sock *inet = inet_sk(sk); ++ ++ lock_sock(sk); ++ ++ sk->sk_state = si->cpt_state; ++ ++ inet->daddr = si->cpt_daddr; ++ inet->dport = si->cpt_dport; ++ inet->saddr = si->cpt_saddr; ++ inet->rcv_saddr = si->cpt_rcv_saddr; ++ inet->sport = si->cpt_sport; ++ inet->uc_ttl = si->cpt_uc_ttl; ++ inet->tos = si->cpt_tos; ++ inet->cmsg_flags = si->cpt_cmsg_flags; ++ inet->mc_index = si->cpt_mc_index; ++ inet->mc_addr = si->cpt_mc_addr; ++ inet->hdrincl = si->cpt_hdrincl; ++ inet->mc_ttl = si->cpt_mc_ttl; ++ inet->mc_loop = si->cpt_mc_loop; ++ inet->pmtudisc = si->cpt_pmtudisc; ++ inet->recverr = si->cpt_recverr; ++ inet->freebind = si->cpt_freebind; ++ inet->id = si->cpt_idcounter; ++ ++ inet->cork.flags = si->cpt_cork_flags; ++ inet->cork.fragsize = si->cpt_cork_fragsize; ++ inet->cork.length = si->cpt_cork_length; ++ inet->cork.addr = si->cpt_cork_addr; ++ inet->cork.fl.fl4_src = si->cpt_cork_saddr; ++ inet->cork.fl.fl4_dst = si->cpt_cork_daddr; ++ inet->cork.fl.oif = si->cpt_cork_oif; ++ if (inet->cork.fragsize) { ++ if (ip_route_output_key(&inet->cork.rt, &inet->cork.fl)) { ++ eprintk_ctx("failed to restore cork route\n"); ++ inet->cork.fragsize = 0; ++ } ++ } ++ ++ if (sk->sk_type == SOCK_DGRAM && sk->sk_protocol == IPPROTO_UDP) { ++ struct udp_sock *up = udp_sk(sk); ++ up->pending = si->cpt_udp_pending; ++ up->corkflag = si->cpt_udp_corkflag; ++ up->encap_type = si->cpt_udp_encap; ++ up->len = si->cpt_udp_len; ++ } ++ ++ if (sk->sk_family == AF_INET6) { ++ struct ipv6_pinfo *np = inet6_sk(sk); ++ ++ memcpy(&np->saddr, si->cpt_saddr6, 16); ++ memcpy(&np->rcv_saddr, si->cpt_rcv_saddr6, 16); ++ memcpy(&np->daddr, si->cpt_daddr6, 16); ++ np->flow_label = si->cpt_flow_label6; ++ np->frag_size = si->cpt_frag_size6; ++ np->hop_limit = si->cpt_hop_limit6; ++ np->mcast_hops = si->cpt_mcast_hops6; ++ np->mcast_oif = si->cpt_mcast_oif6; ++ np->rxopt.all = si->cpt_rxopt6; ++ np->mc_loop = si->cpt_mc_loop6; ++ np->recverr = si->cpt_recverr6; ++ np->sndflow = si->cpt_sndflow6; ++ np->pmtudisc = si->cpt_pmtudisc6; ++ np->ipv6only = si->cpt_ipv6only6; ++ ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++ if (si->cpt_mapped) { ++ extern struct inet_connection_sock_af_ops ipv6_mapped; ++ if (sk->sk_type == SOCK_STREAM && ++ sk->sk_protocol == IPPROTO_TCP) { ++ inet_csk(sk)->icsk_af_ops = &ipv6_mapped; ++ sk->sk_backlog_rcv = tcp_v4_do_rcv; ++ } ++ } ++#endif ++ } ++ ++ restore_queues(sk, si, pos, ctx); ++ ++ if (sk->sk_type == SOCK_STREAM && sk->sk_protocol == IPPROTO_TCP) ++ rst_socket_tcp(si, pos, sk, ctx); ++ ++ release_sock(sk); ++ return 0; ++} ++ ++int cpt_attach_accept(struct sock *lsk, struct sock *sk, cpt_context_t *ctx) ++{ ++ struct request_sock *req; ++ ++ if (lsk->sk_state != TCP_LISTEN) ++ return -EINVAL; ++ ++ req = reqsk_alloc(&tcp_request_sock_ops); ++ if (!req) ++ return -ENOMEM; ++ ++ sk->sk_socket = NULL; ++ sk->sk_sleep = NULL; ++ inet_csk_reqsk_queue_add(lsk, req, sk); ++ return 0; ++} ++ ++int rst_restore_synwait_queue(struct sock *sk, struct cpt_sock_image *si, ++ loff_t pos, struct cpt_context *ctx) ++{ ++ int err; ++ loff_t end = pos + si->cpt_next; ++ ++ pos += si->cpt_hdrlen; ++ while (pos < end) { ++ struct cpt_openreq_image oi; ++ ++ err = rst_get_object(CPT_OBJ_OPENREQ, pos, &oi, ctx); ++ if (err) { ++ err = rst_sock_attr(&pos, sk, ctx); ++ if (err) ++ return err; ++ continue; ++ } ++ ++ if (oi.cpt_object == CPT_OBJ_OPENREQ) { ++ struct request_sock *req; ++ ++ if (oi.cpt_family == AF_INET6) { ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++ req = reqsk_alloc(&tcp6_request_sock_ops); ++#else ++ return -EINVAL; ++#endif ++ } else { ++ req = reqsk_alloc(&tcp_request_sock_ops); ++ } ++ ++ if (req == NULL) ++ return -ENOMEM; ++ ++ tcp_rsk(req)->rcv_isn = oi.cpt_rcv_isn; ++ tcp_rsk(req)->snt_isn = oi.cpt_snt_isn; ++ inet_rsk(req)->rmt_port = oi.cpt_rmt_port; ++ req->mss = oi.cpt_mss; ++ req->retrans = oi.cpt_retrans; ++ inet_rsk(req)->snd_wscale = oi.cpt_snd_wscale; ++ inet_rsk(req)->rcv_wscale = oi.cpt_rcv_wscale; ++ inet_rsk(req)->tstamp_ok = oi.cpt_tstamp_ok; ++ inet_rsk(req)->sack_ok = oi.cpt_sack_ok; ++ inet_rsk(req)->wscale_ok = oi.cpt_wscale_ok; ++ inet_rsk(req)->ecn_ok = oi.cpt_ecn_ok; ++ inet_rsk(req)->acked = oi.cpt_acked; ++ inet_rsk(req)->opt = NULL; ++ req->window_clamp = oi.cpt_window_clamp; ++ req->rcv_wnd = oi.cpt_rcv_wnd; ++ req->ts_recent = oi.cpt_ts_recent; ++ req->expires = jiffies_import(oi.cpt_expires); ++ req->sk = NULL; ++ req->secid = 0; ++ req->peer_secid = 0; ++ ++ if (oi.cpt_family == AF_INET) { ++ memcpy(&inet_rsk(req)->loc_addr, oi.cpt_loc_addr, 4); ++ memcpy(&inet_rsk(req)->rmt_addr, oi.cpt_rmt_addr, 4); ++ inet_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT); ++ } else { ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++ inet6_rsk(req)->pktopts = NULL; ++ memcpy(&inet6_rsk(req)->loc_addr, oi.cpt_loc_addr, 16); ++ memcpy(&inet6_rsk(req)->rmt_addr, oi.cpt_rmt_addr, 16); ++ inet6_rsk(req)->iif = oi.cpt_iif; ++ inet6_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT); ++#endif ++ } ++ } ++ pos += oi.cpt_next; ++ } ++ return 0; ++} ++ ++int rst_sk_mcfilter_in(struct sock *sk, struct cpt_sockmc_image *v, ++ loff_t pos, cpt_context_t *ctx) ++{ ++ struct ip_mreqn imr; ++ ++ if (v->cpt_mode || v->cpt_next != v->cpt_hdrlen) { ++ eprintk_ctx("IGMPv3 is still not supported\n"); ++ return -EINVAL; ++ } ++ ++ memset(&imr, 0, sizeof(imr)); ++ imr.imr_ifindex = v->cpt_ifindex; ++ imr.imr_multiaddr.s_addr = v->cpt_mcaddr[0]; ++ return ip_mc_join_group(sk, &imr); ++} ++ ++#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) ++int rst_sk_mcfilter_in6(struct sock *sk, struct cpt_sockmc_image *v, ++ loff_t pos, cpt_context_t *ctx) ++{ ++ ++ if (v->cpt_mode || v->cpt_next != v->cpt_hdrlen) { ++ eprintk_ctx("IGMPv3 is still not supported\n"); ++ return -EINVAL; ++ } ++ ++ return ipv6_sock_mc_join(sk, v->cpt_ifindex, ++ (struct in6_addr*)v->cpt_mcaddr); ++} ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_sysvipc.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_sysvipc.c +--- ./kernel/cpt/rst_sysvipc.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_sysvipc.c 2012-11-13 15:20:15.376569065 +0000 +@@ -0,0 +1,636 @@ ++/* ++ * ++ * kernel/cpt/rst_sysvipc.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_kernel.h" ++ ++struct _warg { ++ struct file *file; ++ struct cpt_sysvshm_image *v; ++}; ++ ++static int fixup_one_shm(struct shmid_kernel *shp, void *arg) ++{ ++ struct _warg *warg = arg; ++ ++ if (shp->shm_file != warg->file) ++ return 0; ++ if (shp->shm_nattch) ++ return -EEXIST; ++ ++ shp->shm_perm.uid = warg->v->cpt_uid; ++ shp->shm_perm.gid = warg->v->cpt_gid; ++ shp->shm_perm.cuid = warg->v->cpt_cuid; ++ shp->shm_perm.cgid = warg->v->cpt_cgid; ++ shp->shm_perm.mode = warg->v->cpt_mode; ++ ++ shp->shm_atim = warg->v->cpt_atime; ++ shp->shm_dtim = warg->v->cpt_dtime; ++ shp->shm_ctim = warg->v->cpt_ctime; ++ shp->shm_cprid = warg->v->cpt_creator; ++ shp->shm_lprid = warg->v->cpt_last; ++ ++ /* TODO: fix shp->mlock_user? */ ++ return 1; ++} ++ ++static int fixup_shm(struct file *file, struct cpt_sysvshm_image *v) ++{ ++ struct _warg warg; ++ ++ warg.file = file; ++ warg.v = v; ++ ++ return sysvipc_walk_shm(fixup_one_shm, &warg); ++} ++ ++static int fixup_shm_data(struct file *file, loff_t pos, loff_t end, ++ struct cpt_context *ctx) ++{ ++ struct cpt_page_block pgb; ++ ssize_t (*do_write)(struct file *, const char __user *, size_t, loff_t *ppos); ++ ++ do_write = file->f_dentry->d_inode->i_fop->write; ++ if (do_write == NULL) { ++ eprintk_ctx("No TMPFS? Cannot restore content of SYSV SHM\n"); ++ return -EINVAL; ++ } ++ ++ while (pos < end) { ++ loff_t opos; ++ loff_t ipos; ++ int count; ++ int err; ++ ++ err = rst_get_object(CPT_OBJ_PAGES, pos, &pgb, ctx); ++ if (err) ++ return err; ++ dprintk_ctx("restoring SHM block: %08x-%08x\n", ++ (__u32)pgb.cpt_start, (__u32)pgb.cpt_end); ++ ipos = pos + pgb.cpt_hdrlen; ++ opos = pgb.cpt_start; ++ count = pgb.cpt_end-pgb.cpt_start; ++ while (count > 0) { ++ mm_segment_t oldfs; ++ int copy = count; ++ ++ if (copy > PAGE_SIZE) ++ copy = PAGE_SIZE; ++ (void)cpt_get_buf(ctx); ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ err = ctx->pread(ctx->tmpbuf, copy, ctx, ipos); ++ set_fs(oldfs); ++ if (err) { ++ __cpt_release_buf(ctx); ++ return err; ++ } ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ ipos += copy; ++ err = do_write(file, ctx->tmpbuf, copy, &opos); ++ set_fs(oldfs); ++ __cpt_release_buf(ctx); ++ if (err != copy) { ++ eprintk_ctx("write() failure\n"); ++ if (err >= 0) ++ err = -EIO; ++ return err; ++ } ++ count -= copy; ++ } ++ pos += pgb.cpt_next; ++ } ++ return 0; ++} ++ ++struct file * rst_sysv_shm_itself(loff_t pos, struct cpt_context *ctx) ++{ ++ struct file *file; ++ int err; ++ loff_t dpos, epos; ++ union { ++ struct cpt_file_image fi; ++ struct cpt_sysvshm_image shmi; ++ struct cpt_inode_image ii; ++ } u; ++ ++ err = rst_get_object(CPT_OBJ_FILE, pos, &u.fi, ctx); ++ if (err < 0) ++ goto err_out; ++ pos = u.fi.cpt_inode; ++ err = rst_get_object(CPT_OBJ_INODE, pos, &u.ii, ctx); ++ if (err < 0) ++ goto err_out; ++ dpos = pos + u.ii.cpt_hdrlen; ++ epos = pos + u.ii.cpt_next; ++ err = rst_get_object(CPT_OBJ_SYSV_SHM, pos + u.ii.cpt_hdrlen, &u.shmi, ctx); ++ if (err < 0) ++ goto err_out; ++ dpos += u.shmi.cpt_next; ++ ++ file = sysvipc_setup_shm(u.shmi.cpt_key, u.shmi.cpt_id, ++ u.shmi.cpt_segsz, u.shmi.cpt_mode); ++ if (!IS_ERR(file)) { ++ err = fixup_shm(file, &u.shmi); ++ if (err != -EEXIST && dpos < epos) ++ err = fixup_shm_data(file, dpos, epos, ctx); ++ } else if (IS_ERR(file) && PTR_ERR(file) == -EEXIST) { ++ struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns; ++ struct shmid_kernel *shp; ++ ++ shp = shm_lock(ipc_ns, u.shmi.cpt_id); ++ BUG_ON(IS_ERR(shp)); ++ get_file(shp->shm_file); ++ file = shp->shm_file; ++ shm_unlock(shp); ++ } ++ return file; ++ ++err_out: ++ return ERR_PTR(err); ++} ++ ++struct file * rst_sysv_shm_vma(struct cpt_vma_image *vmai, struct cpt_context *ctx) ++{ ++ struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns; ++ struct file *file; ++ union { ++ struct cpt_file_image fi; ++ struct cpt_inode_image ii; ++ struct cpt_sysvshm_image shmi; ++ } u; ++ struct shmid_kernel *shp; ++ struct shm_file_data *sfd; ++ struct path path; ++ mode_t f_mode; ++ loff_t pos; ++ int err; ++ ++ pos = vmai->cpt_file; ++ file = rst_sysv_shm_itself(pos, ctx); ++ if (IS_ERR(file) && PTR_ERR(file) != -EEXIST) ++ return file; ++ fput(file); ++ ++ err = rst_get_object(CPT_OBJ_FILE, pos, &u.fi, ctx); ++ if (err < 0) ++ goto err_out; ++ pos = u.fi.cpt_inode; ++ err = rst_get_object(CPT_OBJ_INODE, pos, &u.ii, ctx); ++ if (err < 0) ++ goto err_out; ++ err = rst_get_object(CPT_OBJ_SYSV_SHM, pos + u.ii.cpt_hdrlen, &u.shmi, ctx); ++ if (err < 0) ++ goto err_out; ++ ++ shp = shm_lock(ipc_ns, u.shmi.cpt_id); ++ BUG_ON(IS_ERR(shp)); ++ path.dentry = dget(shp->shm_file->f_path.dentry); ++ path.mnt = shp->shm_file->f_path.mnt; ++ shm_unlock(shp); ++ ++ err = -ENOMEM; ++ sfd = kzalloc(sizeof(*sfd), GFP_KERNEL); ++ if (!sfd) ++ goto out_put_dentry; ++ ++ f_mode = 0; ++ if (vmai->cpt_flags & VM_READ) ++ f_mode |= FMODE_READ; ++ if (vmai->cpt_flags & VM_WRITE) ++ f_mode |= FMODE_WRITE; ++ if (vmai->cpt_flags & VM_EXEC) ++ f_mode |= FMODE_EXEC; ++ ++ err = -ENOMEM; ++ file = alloc_file(path.mnt, path.dentry, f_mode, &shm_file_operations); ++ if (!file) ++ goto out_free; ++ ++ file->private_data = sfd; ++ file->f_mapping = shp->shm_file->f_mapping; ++ sfd->id = shp->shm_perm.id; ++ sfd->ns = get_ipc_ns(ipc_ns); ++ sfd->file = shp->shm_file; ++ sfd->vm_ops = NULL; ++ ++ return file; ++ ++out_free: ++ kfree(sfd); ++out_put_dentry: ++ dput(path.dentry); ++err_out: ++ return ERR_PTR(err); ++} ++ ++static int attach_one_undo(int semid, struct sem_array *sma, void *arg) ++{ ++ struct sem_undo *su = arg; ++ struct sem_undo_list *undo_list = current->sysvsem.undo_list; ++ ++ if (semid != su->semid) ++ return 0; ++ ++ su->proc_next = undo_list->proc_list; ++ undo_list->proc_list = su; ++ ++ su->id_next = sma->undo; ++ sma->undo = su; ++ ++ return 1; ++} ++ ++static int attach_undo(struct sem_undo *su) ++{ ++ return sysvipc_walk_sem(attach_one_undo, su); ++} ++ ++static int do_rst_semundo(struct cpt_object_hdr *sui, loff_t pos, struct cpt_context *ctx) ++{ ++ int err; ++ struct sem_undo_list *undo_list; ++ ++ if (current->sysvsem.undo_list) { ++ eprintk_ctx("Funny undo_list\n"); ++ return 0; ++ } ++ ++ undo_list = kzalloc(sizeof(struct sem_undo_list), GFP_KERNEL_UBC); ++ if (undo_list == NULL) ++ return -ENOMEM; ++ ++ atomic_set(&undo_list->refcnt, 1); ++ spin_lock_init(&undo_list->lock); ++ current->sysvsem.undo_list = undo_list; ++ ++ if (sui->cpt_next > sui->cpt_hdrlen) { ++ loff_t offset = pos + sui->cpt_hdrlen; ++ do { ++ struct sem_undo *new; ++ struct cpt_sysvsem_undo_image spi; ++ err = rst_get_object(CPT_OBJ_SYSVSEM_UNDO_REC, offset, &spi, ctx); ++ if (err) ++ goto out; ++ new = kmalloc(sizeof(struct sem_undo) + ++ sizeof(short)*spi.cpt_nsem, ++ GFP_KERNEL_UBC); ++ if (!new) { ++ err = -ENOMEM; ++ goto out; ++ } ++ ++ memset(new, 0, sizeof(struct sem_undo) + sizeof(short)*spi.cpt_nsem); ++ new->semadj = (short *) &new[1]; ++ new->semid = spi.cpt_id; ++ err = ctx->pread(new->semadj, spi.cpt_nsem*sizeof(short), ctx, offset + spi.cpt_hdrlen); ++ if (err) { ++ kfree(new); ++ goto out; ++ } ++ err = attach_undo(new); ++ if (err <= 0) { ++ if (err == 0) ++ err = -ENOENT; ++ kfree(new); ++ goto out; ++ } ++ offset += spi.cpt_next; ++ } while (offset < pos + sui->cpt_next); ++ } ++ err = 0; ++ ++out: ++ return err; ++} ++ ++__u32 rst_semundo_flag(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ __u32 flag = 0; ++ ++#if 0 ++ if (ti->cpt_sysvsem_undo == CPT_NULL || ++ lookup_cpt_obj_bypos(CPT_OBJ_SYSVSEM_UNDO, ti->cpt_sysvsem_undo)) ++ flag |= CLONE_SYSVSEM; ++#endif ++ return flag; ++} ++ ++int rst_semundo_complete(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ int err; ++ struct sem_undo_list *f = current->sysvsem.undo_list; ++ cpt_object_t *obj; ++ struct cpt_object_hdr sui; ++ ++ if (ti->cpt_sysvsem_undo == CPT_NULL) { ++ exit_sem(current); ++ return 0; ++ } ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_SYSVSEM_UNDO, ti->cpt_sysvsem_undo, ctx); ++ if (obj) { ++ if (obj->o_obj != f) { ++ exit_sem(current); ++ f = obj->o_obj; ++ atomic_inc(&f->refcnt); ++ current->sysvsem.undo_list = f; ++ } ++ return 0; ++ } ++ ++ if ((err = rst_get_object(CPT_OBJ_SYSVSEM_UNDO, ti->cpt_sysvsem_undo, &sui, ctx)) != 0) ++ goto out; ++ ++ if ((err = do_rst_semundo(&sui, ti->cpt_sysvsem_undo, ctx)) != 0) ++ goto out; ++ ++ err = -ENOMEM; ++ obj = cpt_object_add(CPT_OBJ_SYSVSEM_UNDO, f, ctx); ++ if (obj) { ++ err = 0; ++ cpt_obj_setpos(obj, ti->cpt_sysvsem_undo, ctx); ++ } ++ ++ return 0; ++ ++out: ++ return err; ++} ++ ++struct _sarg { ++ int semid; ++ struct cpt_sysvsem_image *v; ++ __u32 *arr; ++}; ++ ++static int fixup_one_sem(int semid, struct sem_array *sma, void *arg) ++{ ++ struct _sarg *warg = arg; ++ ++ if (semid != warg->semid) ++ return 0; ++ ++ sma->sem_perm.uid = warg->v->cpt_uid; ++ sma->sem_perm.gid = warg->v->cpt_gid; ++ sma->sem_perm.cuid = warg->v->cpt_cuid; ++ sma->sem_perm.cgid = warg->v->cpt_cgid; ++ sma->sem_perm.mode = warg->v->cpt_mode; ++ sma->sem_perm.seq = warg->v->cpt_seq; ++ ++ sma->sem_ctime = warg->v->cpt_ctime; ++ sma->sem_otime = warg->v->cpt_otime; ++ memcpy(sma->sem_base, warg->arr, sma->sem_nsems*8); ++ return 1; ++} ++ ++static int fixup_sem(int semid, struct cpt_sysvsem_image *v, __u32 *arr) ++{ ++ struct _sarg warg; ++ ++ warg.semid = semid; ++ warg.v = v; ++ warg.arr = arr; ++ ++ return sysvipc_walk_sem(fixup_one_sem, &warg); ++} ++ ++ ++static int restore_sem(loff_t pos, struct cpt_sysvsem_image *si, ++ struct cpt_context *ctx) ++{ ++ int err; ++ __u32 *arr; ++ int nsems = (si->cpt_next - si->cpt_hdrlen)/8; ++ ++ arr = kmalloc(nsems*8, GFP_KERNEL); ++ if (!arr) ++ return -ENOMEM; ++ ++ err = ctx->pread(arr, nsems*8, ctx, pos+si->cpt_hdrlen); ++ if (err) ++ goto out; ++ err = sysvipc_setup_sem(si->cpt_key, si->cpt_id, nsems, si->cpt_mode); ++ if (err < 0) { ++ eprintk_ctx("SEM 3\n"); ++ goto out; ++ } ++ err = fixup_sem(si->cpt_id, si, arr); ++ if (err == 0) ++ err = -ESRCH; ++ if (err > 0) ++ err = 0; ++out: ++ kfree(arr); ++ return err; ++} ++ ++static int rst_sysv_sem(struct cpt_context *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_SYSV_SEM]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ struct cpt_sysvsem_image sbuf; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_SYSV_SEM || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ int err; ++ err = rst_get_object(CPT_OBJ_SYSV_SEM, sec, &sbuf, ctx); ++ if (err) ++ return err; ++ err = restore_sem(sec, &sbuf, ctx); ++ if (err) ++ return err; ++ sec += sbuf.cpt_next; ++ } ++ return 0; ++} ++ ++struct _marg { ++ int msqid; ++ struct cpt_sysvmsg_image *v; ++ struct msg_queue *m; ++}; ++ ++static int fixup_one_msg(int msqid, struct msg_queue *msq, void *arg) ++{ ++ struct _marg *warg = arg; ++ ++ if (msqid != warg->msqid) ++ return 0; ++ ++ msq->q_perm.uid = warg->v->cpt_uid; ++ msq->q_perm.gid = warg->v->cpt_gid; ++ msq->q_perm.cuid = warg->v->cpt_cuid; ++ msq->q_perm.cgid = warg->v->cpt_cgid; ++ msq->q_perm.mode = warg->v->cpt_mode; ++ msq->q_perm.seq = warg->v->cpt_seq; ++ ++ msq->q_stime = warg->v->cpt_stime; ++ msq->q_rtime = warg->v->cpt_rtime; ++ msq->q_ctime = warg->v->cpt_ctime; ++ msq->q_lspid = warg->v->cpt_last_sender; ++ msq->q_lrpid = warg->v->cpt_last_receiver; ++ msq->q_qbytes = warg->v->cpt_qbytes; ++ ++ warg->m = msq; ++ return 1; ++} ++ ++struct _larg ++{ ++ cpt_context_t * ctx; ++ loff_t pos; ++}; ++ ++static int do_load_msg(void * dst, int len, int offset, void * data) ++{ ++ struct _larg * arg = data; ++ return arg->ctx->pread(dst, len, arg->ctx, arg->pos + offset); ++} ++ ++static int fixup_msg(int msqid, struct cpt_sysvmsg_image *v, loff_t pos, ++ cpt_context_t * ctx) ++{ ++ int err; ++ struct _marg warg; ++ loff_t endpos = pos + v->cpt_next; ++ struct ipc_namespace *ns = current->nsproxy->ipc_ns; ++ ++ pos += v->cpt_hdrlen; ++ ++ warg.msqid = msqid; ++ warg.v = v; ++ ++ err = sysvipc_walk_msg(fixup_one_msg, &warg); ++ if (err <= 0) ++ return err; ++ ++ while (pos < endpos) { ++ struct cpt_sysvmsg_msg_image mi; ++ struct msg_msg *m; ++ struct _larg data = { ++ .ctx = ctx ++ }; ++ ++ err = rst_get_object(CPT_OBJ_SYSVMSG_MSG, pos, &mi, ctx); ++ if (err) ++ return err; ++ data.pos = pos + mi.cpt_hdrlen; ++ m = sysv_msg_load(do_load_msg, mi.cpt_size, &data); ++ if (IS_ERR(m)) ++ return PTR_ERR(m); ++ m->m_type = mi.cpt_type; ++ m->m_ts = mi.cpt_size; ++ list_add_tail(&m->m_list, &warg.m->q_messages); ++ warg.m->q_cbytes += m->m_ts; ++ warg.m->q_qnum++; ++ atomic_add(m->m_ts, &ns->msg_bytes); ++ atomic_inc(&ns->msg_hdrs); ++ ++ pos += mi.cpt_next; ++ } ++ return 1; ++} ++ ++static int restore_msg(loff_t pos, struct cpt_sysvmsg_image *si, ++ struct cpt_context *ctx) ++{ ++ int err; ++ ++ err = sysvipc_setup_msg(si->cpt_key, si->cpt_id, si->cpt_mode); ++ if (err < 0) { ++ eprintk_ctx("MSG 3\n"); ++ goto out; ++ } ++ err = fixup_msg(si->cpt_id, si, pos, ctx); ++ if (err == 0) ++ err = -ESRCH; ++ if (err > 0) ++ err = 0; ++out: ++ return err; ++} ++ ++static int rst_sysv_msg(struct cpt_context *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_SYSV_MSG]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ struct cpt_sysvmsg_image sbuf; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_SYSV_MSG || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ int err; ++ err = rst_get_object(CPT_OBJ_SYSVMSG, sec, &sbuf, ctx); ++ if (err) ++ return err; ++ err = restore_msg(sec, &sbuf, ctx); ++ if (err) ++ return err; ++ sec += sbuf.cpt_next; ++ } ++ return 0; ++} ++ ++ ++int rst_sysv_ipc(struct cpt_context *ctx) ++{ ++ int err; ++ ++ err = rst_sysv_sem(ctx); ++ if (!err) ++ err = rst_sysv_msg(ctx); ++ ++ return err; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_tty.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_tty.c +--- ./kernel/cpt/rst_tty.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_tty.c 2012-11-13 15:20:15.376569065 +0000 +@@ -0,0 +1,384 @@ ++/* ++ * ++ * kernel/cpt/rst_tty.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_mm.h" ++#include "cpt_process.h" ++#include "cpt_files.h" ++#include "cpt_kernel.h" ++ ++static int pty_setup(struct tty_struct *stty, loff_t pos, ++ struct cpt_tty_image *pi, struct cpt_context *ctx) ++{ ++ unsigned long flags; ++ ++ stty->pgrp = NULL; ++ stty->session = NULL; ++ stty->packet = pi->cpt_packet; ++ stty->stopped = pi->cpt_stopped; ++ stty->hw_stopped = pi->cpt_hw_stopped; ++ stty->flow_stopped = pi->cpt_flow_stopped; ++#define DONOT_CHANGE ((1<flags & DONOT_CHANGE; ++ stty->flags = flags | (pi->cpt_flags & ~DONOT_CHANGE); ++ stty->ctrl_status = pi->cpt_ctrl_status; ++ stty->winsize.ws_row = pi->cpt_ws_row; ++ stty->winsize.ws_col = pi->cpt_ws_col; ++ stty->winsize.ws_ypixel = pi->cpt_ws_prow; ++ stty->winsize.ws_xpixel = pi->cpt_ws_pcol; ++ stty->canon_column = pi->cpt_canon_column; ++ stty->column = pi->cpt_column; ++ stty->raw = pi->cpt_raw; ++ stty->real_raw = pi->cpt_real_raw; ++ stty->erasing = pi->cpt_erasing; ++ stty->lnext = pi->cpt_lnext; ++ stty->icanon = pi->cpt_icanon; ++ stty->closing = pi->cpt_closing; ++ stty->minimum_to_wake = pi->cpt_minimum_to_wake; ++ ++ stty->termios->c_iflag = pi->cpt_c_iflag; ++ stty->termios->c_oflag = pi->cpt_c_oflag; ++ stty->termios->c_lflag = pi->cpt_c_lflag; ++ stty->termios->c_cflag = pi->cpt_c_cflag; ++ memcpy(&stty->termios->c_cc, &pi->cpt_c_cc, NCCS); ++ memcpy(stty->read_flags, pi->cpt_read_flags, sizeof(stty->read_flags)); ++ ++ if (pi->cpt_next > pi->cpt_hdrlen) { ++ int err; ++ struct cpt_obj_bits b; ++ err = rst_get_object(CPT_OBJ_BITS, pos + pi->cpt_hdrlen, &b, ctx); ++ if (err) ++ return err; ++ if (b.cpt_size == 0) ++ return 0; ++ err = ctx->pread(stty->read_buf, b.cpt_size, ctx, pos + pi->cpt_hdrlen + b.cpt_hdrlen); ++ if (err) ++ return err; ++ ++ spin_lock_irq(&stty->read_lock); ++ stty->read_tail = 0; ++ stty->read_cnt = b.cpt_size; ++ stty->read_head = b.cpt_size; ++ stty->canon_head = stty->read_tail + pi->cpt_canon_head; ++ stty->canon_data = pi->cpt_canon_data; ++ spin_unlock_irq(&stty->read_lock); ++ } ++ ++ return 0; ++} ++ ++/* Find slave/master tty in image, when we already know master/slave. ++ * It might be optimized, of course. */ ++static loff_t find_pty_pair(struct tty_struct *stty, loff_t pos, struct cpt_tty_image *pi, struct cpt_context *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_TTY]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ struct cpt_tty_image *pibuf; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return CPT_NULL; ++ if (h.cpt_section != CPT_SECT_TTY || h.cpt_hdrlen < sizeof(h)) ++ return CPT_NULL; ++ pibuf = kmalloc(sizeof(*pibuf), GFP_KERNEL); ++ if (pibuf == NULL) { ++ eprintk_ctx("cannot allocate buffer\n"); ++ return CPT_NULL; ++ } ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ if (rst_get_object(CPT_OBJ_TTY, sec, pibuf, ctx)) ++ return CPT_NULL; ++ if (pibuf->cpt_index == pi->cpt_index && ++ !((pi->cpt_drv_flags^pibuf->cpt_drv_flags)&TTY_DRIVER_DEVPTS_MEM) && ++ pos != sec) { ++ pty_setup(stty, sec, pibuf, ctx); ++ return sec; ++ } ++ sec += pibuf->cpt_next; ++ } ++ kfree(pibuf); ++ return CPT_NULL; ++} ++ ++static int fixup_tty_attrs(struct cpt_inode_image *ii, struct file *master, ++ struct cpt_context *ctx) ++{ ++ int err; ++ struct iattr newattrs; ++ struct dentry *d = master->f_dentry; ++ ++ newattrs.ia_valid = ATTR_UID|ATTR_GID|ATTR_MODE; ++ newattrs.ia_uid = ii->cpt_uid; ++ newattrs.ia_gid = ii->cpt_gid; ++ newattrs.ia_mode = ii->cpt_mode; ++ ++ mutex_lock(&d->d_inode->i_mutex); ++ err = notify_change(d, NULL, &newattrs); ++ mutex_unlock(&d->d_inode->i_mutex); ++ ++ return err; ++} ++ ++/* NOTE: "portable", but ugly thing. To allocate /dev/pts/N, we open ++ * /dev/ptmx until we get pty with desired index. ++ */ ++ ++struct file *ptmx_open(int index, unsigned int flags) ++{ ++ struct file *file; ++ struct file **stack = NULL; ++ int depth = 0; ++ ++ for (;;) { ++ struct tty_struct *tty; ++ ++ file = filp_open("/dev/ptmx", flags|O_NONBLOCK|O_NOCTTY|O_RDWR, 0); ++ if (IS_ERR(file)) ++ break; ++ tty = file->private_data; ++ if (tty->index == index) ++ break; ++ ++ if (depth == PAGE_SIZE/sizeof(struct file *)) { ++ fput(file); ++ file = ERR_PTR(-EBUSY); ++ break; ++ } ++ if (stack == NULL) { ++ stack = (struct file **)__get_free_page(GFP_KERNEL); ++ if (!stack) { ++ fput(file); ++ file = ERR_PTR(-ENOMEM); ++ break; ++ } ++ } ++ stack[depth] = file; ++ depth++; ++ } ++ while (depth > 0) { ++ depth--; ++ fput(stack[depth]); ++ } ++ if (stack) ++ free_page((unsigned long)stack); ++ return file; ++} ++ ++ ++struct file * rst_open_tty(struct cpt_file_image *fi, struct cpt_inode_image *ii, ++ unsigned flags, struct cpt_context *ctx) ++{ ++ int err; ++ cpt_object_t *obj; ++ struct file *master, *slave; ++ struct tty_struct *stty; ++ struct cpt_tty_image *pi; ++ static char *a = "pqrstuvwxyzabcde"; ++ static char *b = "0123456789abcdef"; ++ char pairname[16]; ++ unsigned master_flags, slave_flags; ++ ++ if (fi->cpt_priv == CPT_NULL) ++ return ERR_PTR(-EINVAL); ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_TTY, fi->cpt_priv, ctx); ++ if (obj && obj->o_parent) { ++ dprintk_ctx("obtained pty as pair to existing\n"); ++ master = obj->o_parent; ++ stty = master->private_data; ++ ++ if (stty->driver->subtype == PTY_TYPE_MASTER && ++ (stty->driver->flags&TTY_DRIVER_DEVPTS_MEM)) { ++ wprintk_ctx("cloning ptmx\n"); ++ get_file(master); ++ return master; ++ } ++ ++ master = dentry_open(dget(master->f_dentry), ++ mntget(master->f_vfsmnt), flags); ++ if (!IS_ERR(master)) { ++ stty = master->private_data; ++ if (stty->driver->subtype != PTY_TYPE_MASTER) ++ fixup_tty_attrs(ii, master, ctx); ++ } ++ return master; ++ } ++ ++ pi = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_TTY, fi->cpt_priv, pi, ctx); ++ if (err) { ++ cpt_release_buf(ctx); ++ return ERR_PTR(err); ++ } ++ ++ master_flags = slave_flags = 0; ++ if (pi->cpt_drv_subtype == PTY_TYPE_MASTER) ++ master_flags = flags; ++ else ++ slave_flags = flags; ++ ++ /* ++ * Open pair master/slave. ++ */ ++ if (pi->cpt_drv_flags&TTY_DRIVER_DEVPTS_MEM) { ++ master = ptmx_open(pi->cpt_index, master_flags); ++ } else { ++ sprintf(pairname, "/dev/pty%c%c", a[pi->cpt_index/16], b[pi->cpt_index%16]); ++ master = filp_open(pairname, master_flags|O_NONBLOCK|O_NOCTTY|O_RDWR, 0); ++ } ++ if (IS_ERR(master)) { ++ eprintk_ctx("filp_open master: %Ld %ld\n", (long long)fi->cpt_priv, PTR_ERR(master)); ++ cpt_release_buf(ctx); ++ return master; ++ } ++ stty = master->private_data; ++ clear_bit(TTY_PTY_LOCK, &stty->flags); ++ if (pi->cpt_drv_flags&TTY_DRIVER_DEVPTS_MEM) ++ sprintf(pairname, "/dev/pts/%d", stty->index); ++ else ++ sprintf(pairname, "/dev/tty%c%c", a[stty->index/16], b[stty->index%16]); ++ slave = filp_open(pairname, slave_flags|O_NONBLOCK|O_NOCTTY|O_RDWR, 0); ++ if (IS_ERR(slave)) { ++ eprintk_ctx("filp_open slave %s: %ld\n", pairname, PTR_ERR(slave)); ++ fput(master); ++ cpt_release_buf(ctx); ++ return slave; ++ } ++ ++ if (pi->cpt_drv_subtype != PTY_TYPE_MASTER) ++ fixup_tty_attrs(ii, slave, ctx); ++ ++ cpt_object_add(CPT_OBJ_TTY, master->private_data, ctx); ++ cpt_object_add(CPT_OBJ_TTY, slave->private_data, ctx); ++ cpt_object_add(CPT_OBJ_FILE, master, ctx); ++ cpt_object_add(CPT_OBJ_FILE, slave, ctx); ++ ++ if (pi->cpt_drv_subtype == PTY_TYPE_MASTER) { ++ loff_t pos; ++ obj = lookup_cpt_object(CPT_OBJ_TTY, master->private_data, ctx); ++ obj->o_parent = master; ++ cpt_obj_setpos(obj, fi->cpt_priv, ctx); ++ pty_setup(stty, fi->cpt_priv, pi, ctx); ++ ++ obj = lookup_cpt_object(CPT_OBJ_TTY, slave->private_data, ctx); ++ obj->o_parent = slave; ++ pos = find_pty_pair(stty->link, fi->cpt_priv, pi, ctx); ++ cpt_obj_setpos(obj, pos, ctx); ++ ++ obj = lookup_cpt_object(CPT_OBJ_FILE, slave, ctx); ++ cpt_obj_setpos(obj, CPT_NULL, ctx); ++ get_file(master); ++ cpt_release_buf(ctx); ++ return master; ++ } else { ++ loff_t pos; ++ obj = lookup_cpt_object(CPT_OBJ_TTY, slave->private_data, ctx); ++ obj->o_parent = slave; ++ cpt_obj_setpos(obj, fi->cpt_priv, ctx); ++ pty_setup(stty->link, fi->cpt_priv, pi, ctx); ++ ++ obj = lookup_cpt_object(CPT_OBJ_TTY, master->private_data, ctx); ++ obj->o_parent = master; ++ pos = find_pty_pair(stty, fi->cpt_priv, pi, ctx); ++ cpt_obj_setpos(obj, pos, ctx); ++ ++ obj = lookup_cpt_object(CPT_OBJ_FILE, master, ctx); ++ cpt_obj_setpos(obj, CPT_NULL, ctx); ++ get_file(slave); ++ cpt_release_buf(ctx); ++ return slave; ++ } ++} ++ ++int rst_tty_jobcontrol(struct cpt_context *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_TTY]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_TTY || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ cpt_object_t *obj; ++ struct cpt_tty_image *pibuf = cpt_get_buf(ctx); ++ ++ if (rst_get_object(CPT_OBJ_TTY, sec, pibuf, ctx)) { ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_TTY, sec, ctx); ++ if (obj) { ++ struct tty_struct *stty = obj->o_obj; ++ if ((int)pibuf->cpt_pgrp > 0) { ++ rcu_read_lock(); ++ stty->pgrp = get_pid(alloc_vpid_safe(pibuf->cpt_pgrp)); ++ rcu_read_unlock(); ++ if (!stty->pgrp) ++ dprintk_ctx("unknown tty pgrp %d\n", pibuf->cpt_pgrp); ++ } else if (pibuf->cpt_pgrp) { ++ stty->pgrp = alloc_pid(current->nsproxy->pid_ns, ++ 0); ++ if (!stty->pgrp) { ++ eprintk_ctx("cannot allocate stray tty->pgrp"); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++ } ++ if ((int)pibuf->cpt_session > 0) { ++ struct pid *sess; ++ ++ rcu_read_lock(); ++ sess = get_pid(alloc_vpid_safe(pibuf->cpt_session)); ++ rcu_read_unlock(); ++ if (!sess) { ++ dprintk_ctx("unknown tty session %d\n", pibuf->cpt_session); ++ } else if (!stty->session) { ++ stty->session = sess; ++ } ++ } ++ } ++ sec += pibuf->cpt_next; ++ cpt_release_buf(ctx); ++ } ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_ubc.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_ubc.c +--- ./kernel/cpt/rst_ubc.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_ubc.c 2012-11-13 15:20:15.376569065 +0000 +@@ -0,0 +1,131 @@ ++/* ++ * ++ * kernel/cpt/rst_ubc.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++ ++struct user_beancounter *rst_lookup_ubc(__u64 pos, struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ obj = lookup_cpt_obj_bypos(CPT_OBJ_UBC, pos, ctx); ++ if (obj == NULL) { ++ eprintk("RST: unknown ub @%Ld\n", (long long)pos); ++ return get_beancounter(get_exec_ub()); ++ } ++ return get_beancounter(obj->o_obj); ++} ++ ++void copy_one_ubparm(struct ubparm *from, struct ubparm *to, int bc_parm_id) ++{ ++ to[bc_parm_id].barrier = from[bc_parm_id].barrier; ++ to[bc_parm_id].limit = from[bc_parm_id].limit; ++} ++ ++void set_one_ubparm_to_max(struct ubparm *ubprm, int bc_parm_id) ++{ ++ ubprm[bc_parm_id].barrier = UB_MAXVALUE; ++ ubprm[bc_parm_id].limit = UB_MAXVALUE; ++} ++ ++static void restore_one_bc_parm(struct cpt_ubparm *dmp, struct ubparm *prm, ++ int held) ++{ ++ prm->barrier = (dmp->barrier == CPT_NULL ? UB_MAXVALUE : dmp->barrier); ++ prm->limit = (dmp->limit == CPT_NULL ? UB_MAXVALUE : dmp->limit); ++ if (held) ++ prm->held = dmp->held; ++ prm->maxheld = dmp->maxheld; ++ prm->minheld = dmp->minheld; ++ prm->failcnt = dmp->failcnt; ++} ++ ++static int restore_one_bc(struct cpt_beancounter_image *v, ++ cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct user_beancounter *bc; ++ cpt_object_t *pobj; ++ int i; ++ ++ if (v->cpt_parent != CPT_NULL) { ++ pobj = lookup_cpt_obj_bypos(CPT_OBJ_UBC, v->cpt_parent, ctx); ++ if (pobj == NULL) ++ return -ESRCH; ++ bc = get_subbeancounter_byid(pobj->o_obj, v->cpt_id, 1); ++ } else { ++ bc = get_exec_ub(); ++ while (bc->parent) ++ bc = bc->parent; ++ get_beancounter(bc); ++ } ++ if (bc == NULL) ++ return -ENOMEM; ++ obj->o_obj = bc; ++ ++ if (ctx->image_version < CPT_VERSION_18 && ++ CPT_VERSION_MINOR(ctx->image_version) < 1) ++ goto out; ++ ++ for (i = 0; i < UB_RESOURCES; i++) { ++ restore_one_bc_parm(v->cpt_parms + i * 2, bc->ub_parms + i, 0); ++ restore_one_bc_parm(v->cpt_parms + i * 2 + 1, ++ bc->ub_store + i, 1); ++ } ++ ++out: ++ if (!bc->parent) ++ for (i = 0; i < UB_RESOURCES; i++) ++ copy_one_ubparm(bc->ub_parms, ctx->saved_ubc, i); ++ ++ return 0; ++} ++ ++int rst_undump_ubc(struct cpt_context *ctx) ++{ ++ loff_t start, end; ++ struct cpt_beancounter_image *v; ++ cpt_object_t *obj; ++ int err; ++ ++ err = rst_get_section(CPT_SECT_UBC, ctx, &start, &end); ++ if (err) ++ return err; ++ ++ while (start < end) { ++ v = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_UBC, start, v, ctx); ++ if (err) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++ ++ obj = alloc_cpt_object(GFP_KERNEL, ctx); ++ cpt_obj_setpos(obj, start, ctx); ++ intern_cpt_object(CPT_OBJ_UBC, obj, ctx); ++ ++ restore_one_bc(v, obj, ctx); ++ ++ cpt_release_buf(ctx); ++ start += v->cpt_next; ++ } ++ return 0; ++} ++ ++void rst_finish_ubc(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ ++ for_each_object(obj, CPT_OBJ_UBC) ++ put_beancounter(obj->o_obj); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpt/rst_undump.c debian/binary-custom.d/openvz/src/kernel/cpt/rst_undump.c +--- ./kernel/cpt/rst_undump.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpt/rst_undump.c 2012-11-13 15:20:15.376569065 +0000 +@@ -0,0 +1,1005 @@ ++/* ++ * ++ * kernel/cpt/rst_undump.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_X86 ++#include ++#endif ++#include ++#include ++#include ++#include ++ ++#include "cpt_obj.h" ++#include "cpt_context.h" ++#include "cpt_files.h" ++#include "cpt_mm.h" ++#include "cpt_process.h" ++#include "cpt_socket.h" ++#include "cpt_net.h" ++#include "cpt_ubc.h" ++#include "cpt_kernel.h" ++ ++static int rst_utsname(cpt_context_t *ctx); ++ ++ ++struct thr_context { ++ struct completion init_complete; ++ struct completion task_done; ++ int error; ++ struct cpt_context *ctx; ++ cpt_object_t *tobj; ++}; ++ ++static int rst_clone_children(cpt_object_t *obj, struct cpt_context *ctx); ++ ++static int vps_rst_veinfo(struct cpt_context *ctx) ++{ ++ int err; ++ struct cpt_veinfo_image *i; ++ struct ve_struct *ve; ++ struct timespec delta; ++ loff_t start, end; ++ struct ipc_namespace *ns; ++ ++ err = rst_get_section(CPT_SECT_VEINFO, ctx, &start, &end); ++ if (err) ++ goto out; ++ ++ i = cpt_get_buf(ctx); ++ memset(i, 0, sizeof(*i)); ++ err = rst_get_object(CPT_OBJ_VEINFO, start, i, ctx); ++ if (err) ++ goto out_rel; ++ ++ ve = get_exec_env(); ++ ns = ve->ve_ns->ipc_ns; ++ ++ /* Damn. Fatal mistake, these two values are size_t! */ ++ ns->shm_ctlall = i->shm_ctl_all ? : 0xFFFFFFFFU; ++ ns->shm_ctlmax = i->shm_ctl_max ? : 0xFFFFFFFFU; ++ ns->shm_ctlmni = i->shm_ctl_mni; ++ ++ ns->msg_ctlmax = i->msg_ctl_max; ++ ns->msg_ctlmni = i->msg_ctl_mni; ++ ns->msg_ctlmnb = i->msg_ctl_mnb; ++ ++ BUILD_BUG_ON(sizeof(ns->sem_ctls) != sizeof(i->sem_ctl_arr)); ++ ns->sem_ctls[0] = i->sem_ctl_arr[0]; ++ ns->sem_ctls[1] = i->sem_ctl_arr[1]; ++ ns->sem_ctls[2] = i->sem_ctl_arr[2]; ++ ns->sem_ctls[3] = i->sem_ctl_arr[3]; ++ ++ cpt_timespec_import(&delta, i->start_timespec_delta); ++ _set_normalized_timespec(&ve->start_timespec, ++ ve->start_timespec.tv_sec - delta.tv_sec, ++ ve->start_timespec.tv_nsec - delta.tv_nsec); ++ ve->start_jiffies -= i->start_jiffies_delta; ++ // // FIXME: what??? ++ // // ve->start_cycles -= (s64)i->start_jiffies_delta * cycles_per_jiffy; ++ ++ ctx->last_vpid = i->last_pid; ++ ++ err = 0; ++out_rel: ++ cpt_release_buf(ctx); ++out: ++ return err; ++} ++ ++static int vps_rst_reparent_root(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ int err; ++ struct env_create_param3 param; ++ ++ do_posix_clock_monotonic_gettime(&ctx->cpt_monotonic_time); ++ do_gettimespec(&ctx->delta_time); ++ ++ _set_normalized_timespec(&ctx->delta_time, ++ ctx->delta_time.tv_sec - ctx->start_time.tv_sec, ++ ctx->delta_time.tv_nsec - ctx->start_time.tv_nsec); ++ ctx->delta_nsec = (s64)ctx->delta_time.tv_sec*NSEC_PER_SEC + ctx->delta_time.tv_nsec; ++ if (ctx->delta_nsec < 0) { ++ wprintk_ctx("Wall time is behind source by %Ld ns, " ++ "time sensitive applications can misbehave\n", (long long)-ctx->delta_nsec); ++ } ++ ++ _set_normalized_timespec(&ctx->cpt_monotonic_time, ++ ctx->cpt_monotonic_time.tv_sec - ctx->delta_time.tv_sec, ++ ctx->cpt_monotonic_time.tv_nsec - ctx->delta_time.tv_nsec); ++ ++ memset(¶m, 0, sizeof(param)); ++ param.iptables_mask = ctx->iptables_mask; ++ param.feature_mask = ctx->features; ++ ++ /* feature_mask is set as required - pretend we know everything */ ++ param.known_features = (ctx->image_version < CPT_VERSION_18) ? ++ VE_FEATURES_OLD : ~(__u64)0; ++ ++ err = real_env_create(ctx->ve_id, VE_CREATE|VE_LOCK|VE_EXCLUSIVE, 2, ++ ¶m, sizeof(param)); ++ if (err < 0) ++ eprintk_ctx("real_env_create: %d\n", err); ++ ++ get_exec_env()->jiffies_fixup = ++ (ctx->delta_time.tv_sec < 0 ? ++ 0 : timespec_to_jiffies(&ctx->delta_time)) - ++ (unsigned long)(get_jiffies_64() - ctx->virt_jiffies64); ++ dprintk_ctx("JFixup %ld %Ld\n", get_exec_env()->jiffies_fixup, ++ (long long)ctx->delta_nsec); ++ return err < 0 ? err : 0; ++} ++ ++static int hook(void *arg) ++{ ++ struct thr_context *thr_ctx = arg; ++ struct cpt_context *ctx; ++ cpt_object_t *tobj; ++ struct cpt_task_image *ti; ++ int err = 0; ++ int exiting = 0; ++ ++ current->state = TASK_UNINTERRUPTIBLE; ++ complete(&thr_ctx->init_complete); ++ schedule(); ++ ++ ctx = thr_ctx->ctx; ++ tobj = thr_ctx->tobj; ++ ti = tobj->o_image; ++ ++ current->fs->umask = 0; ++ ++ if (ti->cpt_pid == 1) { ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *bc; ++#endif ++ ++ err = vps_rst_reparent_root(tobj, ctx); ++ ++ if (err) { ++ rst_report_error(err, ctx); ++ goto out; ++ } ++ ++ memcpy(&cap_bset, &ti->cpt_ecap, sizeof(kernel_cap_t)); ++ ++ if (ctx->statusfile) { ++ fput(ctx->statusfile); ++ ctx->statusfile = NULL; ++ } ++ ++ if (ctx->lockfile) { ++ char b; ++ mm_segment_t oldfs; ++ err = -EINVAL; ++ ++ oldfs = get_fs(); set_fs(KERNEL_DS); ++ if (ctx->lockfile->f_op && ctx->lockfile->f_op->read) ++ err = ctx->lockfile->f_op->read(ctx->lockfile, &b, 1, &ctx->lockfile->f_pos); ++ set_fs(oldfs); ++ fput(ctx->lockfile); ++ ctx->lockfile = NULL; ++ } ++ ++ if (err) { ++ eprintk_ctx("CPT: lock fd is closed incorrectly: %d\n", err); ++ goto out; ++ } ++ err = vps_rst_veinfo(ctx); ++ if (err) { ++ eprintk_ctx("rst_veinfo: %d\n", err); ++ goto out; ++ } ++ ++ err = rst_utsname(ctx); ++ if (err) { ++ eprintk_ctx("rst_utsname: %d\n", err); ++ goto out; ++ } ++ ++ err = rst_root_namespace(ctx); ++ if (err) { ++ eprintk_ctx("rst_namespace: %d\n", err); ++ goto out; ++ } ++ ++ if ((err = rst_restore_net(ctx)) != 0) { ++ eprintk_ctx("rst_restore_net: %d\n", err); ++ goto out; ++ } ++ ++ err = rst_sockets(ctx); ++ if (err) { ++ eprintk_ctx("rst_sockets: %d\n", err); ++ goto out; ++ } ++ err = rst_sysv_ipc(ctx); ++ if (err) { ++ eprintk_ctx("rst_sysv_ipc: %d\n", err); ++ goto out; ++ } ++#ifdef CONFIG_BEANCOUNTERS ++ bc = get_exec_ub(); ++ set_one_ubparm_to_max(bc->ub_parms, UB_KMEMSIZE); ++ set_one_ubparm_to_max(bc->ub_parms, UB_NUMPROC); ++ set_one_ubparm_to_max(bc->ub_parms, UB_NUMFILE); ++ set_one_ubparm_to_max(bc->ub_parms, UB_DCACHESIZE); ++#endif ++ } ++ ++ do { ++ if (current->user->uid != ti->cpt_user) { ++ struct user_struct *u; ++ ++ u = alloc_uid(get_exec_env()->ve_ns->user_ns, ti->cpt_user); ++ if (!u) { ++ eprintk_ctx("alloc_user\n"); ++ } else { ++ switch_uid(u); ++ } ++ } ++ } while (0); ++ ++ if ((err = rst_mm_complete(ti, ctx)) != 0) { ++ eprintk_ctx("rst_mm: %d\n", err); ++ goto out; ++ } ++ ++ if ((err = rst_files_complete(ti, ctx)) != 0) { ++ eprintk_ctx("rst_files: %d\n", err); ++ goto out; ++ } ++ ++ if ((err = rst_fs_complete(ti, ctx)) != 0) { ++ eprintk_ctx("rst_fs: %d\n", err); ++ goto out; ++ } ++ ++ if ((err = rst_semundo_complete(ti, ctx)) != 0) { ++ eprintk_ctx("rst_semundo: %d\n", err); ++ goto out; ++ } ++ ++ if ((err = rst_signal_complete(ti, &exiting, ctx)) != 0) { ++ eprintk_ctx("rst_signal: %d\n", err); ++ goto out; ++ } ++ ++ if (ti->cpt_personality != 0) ++ __set_personality(ti->cpt_personality); ++ ++#ifdef CONFIG_X86_64 ++ /* 32bit app from 32bit OS, won't have PER_LINUX32 set... :/ */ ++ if (!ti->cpt_64bit) ++ __set_personality(PER_LINUX32); ++#endif ++ ++ current->set_child_tid = NULL; ++ current->clear_child_tid = NULL; ++ current->flags &= ~(PF_FORKNOEXEC|PF_SUPERPRIV); ++ current->flags |= ti->cpt_flags&(PF_FORKNOEXEC|PF_SUPERPRIV); ++ current->exit_code = ti->cpt_exit_code; ++ current->pdeath_signal = ti->cpt_pdeath_signal; ++ ++ if (ti->cpt_restart.fn != CPT_RBL_0) { ++ if (ti->cpt_restart.fn == CPT_RBL_NANOSLEEP ++#ifdef CONFIG_COMPAT ++ || ti->cpt_restart.fn == CPT_RBL_COMPAT_NANOSLEEP ++#endif ++ ) { ++ struct restart_block *rb; ++ ktime_t e; ++ ++ e.tv64 = 0; ++ ++ if (ctx->image_version >= CPT_VERSION_20) ++ e = ktime_add_ns(e, ti->cpt_restart.arg2); ++ else if (ctx->image_version >= CPT_VERSION_9) ++ e = ktime_add_ns(e, ti->cpt_restart.arg0); ++ else ++ e = ktime_add_ns(e, ti->cpt_restart.arg0*TICK_NSEC); ++ if (e.tv64 < 0) ++ e.tv64 = TICK_NSEC; ++ e = ktime_add(e, timespec_to_ktime(ctx->cpt_monotonic_time)); ++ ++ rb = &task_thread_info(current)->restart_block; ++ if (ti->cpt_restart.fn == CPT_RBL_NANOSLEEP) ++ rb->fn = hrtimer_nanosleep_restart; ++#ifdef CONFIG_COMPAT ++ else ++ rb->fn = compat_nanosleep_restart; ++#endif ++ if (ctx->image_version >= CPT_VERSION_20) { ++ rb->arg0 = ti->cpt_restart.arg0; ++ rb->arg1 = ti->cpt_restart.arg1; ++ rb->arg2 = e.tv64 & 0xFFFFFFFF; ++ rb->arg3 = e.tv64 >> 32; ++ } else if (ctx->image_version >= CPT_VERSION_9) { ++ rb->arg0 = ti->cpt_restart.arg2; ++ rb->arg1 = ti->cpt_restart.arg3; ++ rb->arg2 = e.tv64 & 0xFFFFFFFF; ++ rb->arg3 = e.tv64 >> 32; ++ } else { ++ rb->arg0 = ti->cpt_restart.arg1; ++ rb->arg1 = CLOCK_MONOTONIC; ++ rb->arg2 = e.tv64 & 0xFFFFFFFF; ++ rb->arg3 = e.tv64 >> 32; ++ } ++ } else if (ti->cpt_restart.fn == CPT_RBL_POLL) { ++ struct restart_block *rb; ++ ktime_t e; ++ struct timespec ts; ++ unsigned long timeout_jiffies; ++ ++ e.tv64 = 0; ++ e = ktime_add_ns(e, ti->cpt_restart.arg2); ++ e = ktime_sub(e, timespec_to_ktime(ctx->delta_time)); ++ ts = ns_to_timespec(ktime_to_ns(e)); ++ timeout_jiffies = timespec_to_jiffies(&ts); ++ ++ rb = &task_thread_info(current)->restart_block; ++ rb->fn = do_restart_poll; ++ rb->arg0 = ti->cpt_restart.arg0; ++ rb->arg1 = ti->cpt_restart.arg1; ++ rb->arg2 = timeout_jiffies & 0xFFFFFFFF; ++ rb->arg3 = (u64)timeout_jiffies >> 32; ++ } else if (ti->cpt_restart.fn == CPT_RBL_FUTEX_WAIT) { ++ struct restart_block *rb; ++ ktime_t e; ++ ++ e.tv64 = 0; ++ e = ktime_add_ns(e, ti->cpt_restart.arg2); ++ e = ktime_add(e, timespec_to_ktime(ctx->cpt_monotonic_time)); ++ ++ rb = &task_thread_info(current)->restart_block; ++ rb->fn = futex_wait_restart; ++ rb->futex.uaddr = (void *)(unsigned long)ti->cpt_restart.arg0; ++ rb->futex.val = ti->cpt_restart.arg1; ++ rb->futex.time = e.tv64; ++ rb->futex.flags = ti->cpt_restart.arg3; ++ } else ++ eprintk_ctx("unknown restart block\n"); ++ } ++ ++ if (thread_group_leader(current)) { ++ current->signal->it_real_incr.tv64 = 0; ++ if (ctx->image_version >= CPT_VERSION_9) { ++ current->signal->it_real_incr = ++ ktime_add_ns(current->signal->it_real_incr, ti->cpt_it_real_incr); ++ } else { ++ current->signal->it_real_incr = ++ ktime_add_ns(current->signal->it_real_incr, ti->cpt_it_real_incr*TICK_NSEC); ++ } ++ current->signal->it_prof_incr = ti->cpt_it_prof_incr; ++ current->signal->it_virt_incr = ti->cpt_it_virt_incr; ++ current->signal->it_prof_expires = ti->cpt_it_prof_value; ++ current->signal->it_virt_expires = ti->cpt_it_virt_value; ++ } ++ ++ err = rst_clone_children(tobj, ctx); ++ if (err) { ++ eprintk_ctx("rst_clone_children\n"); ++ goto out; ++ } ++ ++ if (exiting) ++ current->signal->flags |= SIGNAL_GROUP_EXIT; ++ ++ if (ti->cpt_pid == 1) { ++ if ((err = rst_process_linkage(ctx)) != 0) { ++ eprintk_ctx("rst_process_linkage: %d\n", err); ++ goto out; ++ } ++ if ((err = rst_do_filejobs(ctx)) != 0) { ++ eprintk_ctx("rst_do_filejobs: %d\n", err); ++ goto out; ++ } ++ if ((err = rst_eventpoll(ctx)) != 0) { ++ eprintk_ctx("rst_eventpoll: %d\n", err); ++ goto out; ++ } ++#ifdef CONFIG_INOTIFY_USER ++ if ((err = rst_inotify(ctx)) != 0) { ++ eprintk_ctx("rst_inotify: %d\n", err); ++ goto out; ++ } ++#endif ++ if ((err = rst_sockets_complete(ctx)) != 0) { ++ eprintk_ctx("rst_sockets_complete: %d\n", err); ++ goto out; ++ } ++ if ((err = rst_stray_files(ctx)) != 0) { ++ eprintk_ctx("rst_stray_files: %d\n", err); ++ goto out; ++ } ++ if ((err = rst_posix_locks(ctx)) != 0) { ++ eprintk_ctx("rst_posix_locks: %d\n", err); ++ goto out; ++ } ++ if ((err = rst_tty_jobcontrol(ctx)) != 0) { ++ eprintk_ctx("rst_tty_jobcontrol: %d\n", err); ++ goto out; ++ } ++ if ((err = rst_restore_fs(ctx)) != 0) { ++ eprintk_ctx("rst_restore_fs: %d\n", err); ++ goto out; ++ } ++ if (virtinfo_notifier_call(VITYPE_SCP, ++ VIRTINFO_SCP_RESTORE, ctx) & NOTIFY_FAIL) { ++ err = -ECHRNG; ++ eprintk_ctx("scp_restore failed\n"); ++ goto out; ++ } ++ if (ctx->last_vpid) ++ get_exec_env()->ve_ns->pid_ns->last_pid = ++ ctx->last_vpid; ++ } ++ ++out: ++ thr_ctx->error = err; ++ complete(&thr_ctx->task_done); ++ ++ if (!err && (ti->cpt_state & (EXIT_ZOMBIE|EXIT_DEAD))) { ++ current->flags |= PF_EXIT_RESTART; ++ do_exit(ti->cpt_exit_code); ++ } else { ++ __set_current_state(TASK_UNINTERRUPTIBLE); ++ } ++ ++ schedule(); ++ ++ dprintk_ctx("leaked through %d/%d %p\n", task_pid_nr(current), task_pid_vnr(current), current->mm); ++ ++ module_put(THIS_MODULE); ++ complete_and_exit(NULL, 0); ++ return 0; ++} ++ ++#if 0 ++static void set_task_ubs(struct cpt_task_image *ti, struct cpt_context *ctx) ++{ ++ struct task_beancounter *tbc; ++ ++ tbc = task_bc(current); ++ ++ put_beancounter(tbc->fork_sub); ++ tbc->fork_sub = rst_lookup_ubc(ti->cpt_task_ub, ctx); ++ if (ti->cpt_mm_ub != CPT_NULL) { ++ put_beancounter(tbc->exec_ub); ++ tbc->exec_ub = rst_lookup_ubc(ti->cpt_mm_ub, ctx); ++ } ++} ++#endif ++ ++static int create_root_task(cpt_object_t *obj, struct cpt_context *ctx, ++ struct thr_context *thr_ctx) ++{ ++ struct task_struct *tsk; ++ int pid; ++ ++ thr_ctx->ctx = ctx; ++ thr_ctx->error = 0; ++ init_completion(&thr_ctx->init_complete); ++ init_completion(&thr_ctx->task_done); ++#if 0 ++ set_task_ubs(obj->o_image, ctx); ++#endif ++ ++ pid = local_kernel_thread(hook, thr_ctx, 0, 0); ++ if (pid < 0) ++ return pid; ++ read_lock(&tasklist_lock); ++ tsk = find_task_by_vpid(pid); ++ if (tsk) ++ get_task_struct(tsk); ++ read_unlock(&tasklist_lock); ++ if (tsk == NULL) ++ return -ESRCH; ++ cpt_obj_setobj(obj, tsk, ctx); ++ thr_ctx->tobj = obj; ++ return 0; ++} ++ ++static int rst_basic_init_task(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ struct task_struct *tsk = obj->o_obj; ++ struct cpt_task_image *ti = obj->o_image; ++ ++ memcpy(tsk->comm, ti->cpt_comm, sizeof(tsk->comm)); ++ rst_mm_basic(obj, ti, ctx); ++ return 0; ++} ++ ++static int make_baby(cpt_object_t *cobj, ++ struct cpt_task_image *pi, ++ struct cpt_context *ctx) ++{ ++ unsigned long flags; ++ struct cpt_task_image *ci = cobj->o_image; ++ struct thr_context thr_ctx; ++ struct task_struct *tsk; ++ pid_t pid; ++ struct fs_struct *tfs = NULL; ++ ++ flags = rst_mm_flag(ci, ctx) | rst_files_flag(ci, ctx) ++ | rst_signal_flag(ci, ctx) | rst_semundo_flag(ci, ctx); ++ if (ci->cpt_rppid != pi->cpt_pid) { ++ flags |= CLONE_THREAD|CLONE_PARENT; ++ if (ci->cpt_signal != pi->cpt_signal || ++ !(flags&CLONE_SIGHAND) || ++ (!(flags&CLONE_VM) && pi->cpt_mm != CPT_NULL)) { ++ eprintk_ctx("something is wrong with threads: %d %d %d %Ld %Ld %08lx\n", ++ (int)ci->cpt_pid, (int)ci->cpt_rppid, (int)pi->cpt_pid, ++ (long long)ci->cpt_signal, (long long)pi->cpt_signal, flags ++ ); ++ return -EINVAL; ++ } ++ } ++ ++ thr_ctx.ctx = ctx; ++ thr_ctx.error = 0; ++ init_completion(&thr_ctx.init_complete); ++ init_completion(&thr_ctx.task_done); ++ thr_ctx.tobj = cobj; ++ ++#if 0 ++ set_task_ubs(ci, ctx); ++#endif ++ ++ if (current->fs == NULL) { ++ tfs = get_exec_env()->ve_ns->pid_ns->child_reaper->fs; ++ if (tfs == NULL) ++ return -EINVAL; ++ atomic_inc(&tfs->count); ++ current->fs = tfs; ++ } ++ pid = local_kernel_thread(hook, &thr_ctx, flags, ci->cpt_pid); ++ if (tfs) { ++ current->fs = NULL; ++ atomic_dec(&tfs->count); ++ } ++ if (pid < 0) ++ return pid; ++ ++ read_lock(&tasklist_lock); ++ tsk = find_task_by_vpid(pid); ++ if (tsk) ++ get_task_struct(tsk); ++ read_unlock(&tasklist_lock); ++ if (tsk == NULL) ++ return -ESRCH; ++ cpt_obj_setobj(cobj, tsk, ctx); ++ thr_ctx.tobj = cobj; ++ wait_for_completion(&thr_ctx.init_complete); ++ wait_task_inactive(cobj->o_obj); ++ rst_basic_init_task(cobj, ctx); ++ ++ /* clone() increases group_stop_count if it was not zero and ++ * CLONE_THREAD was asked. Undo. ++ */ ++ if (current->signal->group_stop_count && (flags & CLONE_THREAD)) { ++ if (tsk->signal != current->signal) BUG(); ++ current->signal->group_stop_count--; ++ } ++ ++ wake_up_process(tsk); ++ wait_for_completion(&thr_ctx.task_done); ++ wait_task_inactive(tsk); ++ ++ return thr_ctx.error; ++} ++ ++static int rst_clone_children(cpt_object_t *obj, struct cpt_context *ctx) ++{ ++ int err = 0; ++ struct cpt_task_image *ti = obj->o_image; ++ cpt_object_t *cobj; ++ ++ for_each_object(cobj, CPT_OBJ_TASK) { ++ struct cpt_task_image *ci = cobj->o_image; ++ if (cobj == obj) ++ continue; ++ if ((ci->cpt_rppid == ti->cpt_pid && ci->cpt_tgid == ci->cpt_pid) || ++ (ci->cpt_leader == ti->cpt_pid && ++ ci->cpt_tgid != ci->cpt_pid && ci->cpt_pid != 1)) { ++ err = make_baby(cobj, ti, ctx); ++ if (err) { ++ eprintk_ctx("make_baby: %d\n", err); ++ return err; ++ } ++ } ++ } ++ return 0; ++} ++ ++static int read_task_images(struct cpt_context *ctx) ++{ ++ int err; ++ loff_t start, end; ++ ++ err = rst_get_section(CPT_SECT_TASKS, ctx, &start, &end); ++ if (err) ++ return err; ++ ++ while (start < end) { ++ cpt_object_t *obj; ++ struct cpt_task_image *ti = cpt_get_buf(ctx); ++ ++ err = rst_get_object(CPT_OBJ_TASK, start, ti, ctx); ++ if (err) { ++ cpt_release_buf(ctx); ++ return err; ++ } ++#if 0 ++ if (ti->cpt_pid != 1 && !__is_virtual_pid(ti->cpt_pid)) { ++ eprintk_ctx("BUG: pid %d is not virtual\n", ti->cpt_pid); ++ cpt_release_buf(ctx); ++ return -EINVAL; ++ } ++#endif ++ obj = alloc_cpt_object(GFP_KERNEL, ctx); ++ cpt_obj_setpos(obj, start, ctx); ++ intern_cpt_object(CPT_OBJ_TASK, obj, ctx); ++ obj->o_image = kmalloc(ti->cpt_next, GFP_KERNEL); ++ if (obj->o_image == NULL) { ++ cpt_release_buf(ctx); ++ return -ENOMEM; ++ } ++ memcpy(obj->o_image, ti, sizeof(*ti)); ++ err = ctx->pread(obj->o_image + sizeof(*ti), ++ ti->cpt_next - sizeof(*ti), ctx, start + sizeof(*ti)); ++ cpt_release_buf(ctx); ++ if (err) ++ return err; ++ start += ti->cpt_next; ++ } ++ return 0; ++} ++ ++ ++static int vps_rst_restore_tree(struct cpt_context *ctx) ++{ ++ int err; ++ cpt_object_t *obj; ++ struct thr_context thr_ctx_root; ++ ++ err = read_task_images(ctx); ++ if (err) ++ return err; ++ ++ err = rst_undump_ubc(ctx); ++ if (err) ++ return err; ++ ++ if (virtinfo_notifier_call(VITYPE_SCP, ++ VIRTINFO_SCP_RSTCHECK, ctx) & NOTIFY_FAIL) ++ return -ECHRNG; ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ err = rst_setup_pagein(ctx); ++ if (err) ++ return err; ++#endif ++ for_each_object(obj, CPT_OBJ_TASK) { ++ err = create_root_task(obj, ctx, &thr_ctx_root); ++ if (err) ++ return err; ++ ++ wait_for_completion(&thr_ctx_root.init_complete); ++ wait_task_inactive(obj->o_obj); ++ rst_basic_init_task(obj, ctx); ++ ++ wake_up_process(obj->o_obj); ++ wait_for_completion(&thr_ctx_root.task_done); ++ wait_task_inactive(obj->o_obj); ++ err = thr_ctx_root.error; ++ if (err) ++ return err; ++ break; ++ } ++ ++ return err; ++} ++ ++#ifndef CONFIG_IA64 ++int rst_read_vdso(struct cpt_context *ctx) ++{ ++ int err; ++ loff_t start, end; ++ struct cpt_page_block *pgb; ++ ++ ctx->vdso = NULL; ++ err = rst_get_section(CPT_SECT_VSYSCALL, ctx, &start, &end); ++ if (err) ++ return err; ++ if (start == CPT_NULL) ++ return 0; ++ if (end < start + sizeof(*pgb) + PAGE_SIZE) ++ return -EINVAL; ++ ++ pgb = cpt_get_buf(ctx); ++ err = rst_get_object(CPT_OBJ_VSYSCALL, start, pgb, ctx); ++ if (err) { ++ goto err_buf; ++ } ++ ctx->vdso = (char*)__get_free_page(GFP_KERNEL); ++ if (ctx->vdso == NULL) { ++ err = -ENOMEM; ++ goto err_buf; ++ } ++ err = ctx->pread(ctx->vdso, PAGE_SIZE, ctx, start + sizeof(*pgb)); ++ if (err) ++ goto err_page; ++ if (!memcmp(ctx->vdso, vsyscall_addr, PAGE_SIZE)) { ++ free_page((unsigned long)ctx->vdso); ++ ctx->vdso = NULL; ++ } ++ ++ cpt_release_buf(ctx); ++ return 0; ++err_page: ++ free_page((unsigned long)ctx->vdso); ++ ctx->vdso = NULL; ++err_buf: ++ cpt_release_buf(ctx); ++ return err; ++} ++#endif ++ ++int vps_rst_undump(struct cpt_context *ctx) ++{ ++ int err; ++ unsigned long umask; ++ ++ err = rst_open_dumpfile(ctx); ++ if (err) ++ return err; ++ ++ if (ctx->tasks64) { ++#if defined(CONFIG_IA64) ++ if (ctx->image_arch != CPT_OS_ARCH_IA64) ++#elif defined(CONFIG_X86_64) ++ if (ctx->image_arch != CPT_OS_ARCH_EMT64) ++#else ++ if (1) ++#endif ++ { ++ eprintk_ctx("Cannot restore 64 bit container on this architecture\n"); ++ return -EINVAL; ++ } ++ } ++ ++ umask = current->fs->umask; ++ current->fs->umask = 0; ++ ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ err = rst_setup_pagein(ctx); ++#endif ++#ifndef CONFIG_IA64 ++ if (err == 0) ++ err = rst_read_vdso(ctx); ++#endif ++ if (err == 0) ++ err = vps_rst_restore_tree(ctx); ++ ++ if (err == 0) ++ err = rst_restore_process(ctx); ++ ++ if (err) ++ virtinfo_notifier_call(VITYPE_SCP, ++ VIRTINFO_SCP_RSTFAIL, ctx); ++ ++ current->fs->umask = umask; ++ ++ return err; ++} ++ ++static int rst_unlock_ve(struct cpt_context *ctx) ++{ ++ struct ve_struct *env; ++ ++ env = get_ve_by_id(ctx->ve_id); ++ if (!env) ++ return -ESRCH; ++ down_write(&env->op_sem); ++ env->is_locked = 0; ++ up_write(&env->op_sem); ++ put_ve(env); ++ return 0; ++} ++ ++int recalc_sigpending_tsk(struct task_struct *t); ++ ++int rst_resume(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ int err = 0; ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *bc; ++#endif ++ ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file = obj->o_obj; ++ ++ fput(file); ++ } ++ ++#ifdef CONFIG_BEANCOUNTERS ++ bc = get_beancounter_byuid(ctx->ve_id, 0); ++ BUG_ON(!bc); ++ copy_one_ubparm(ctx->saved_ubc, bc->ub_parms, UB_KMEMSIZE); ++ copy_one_ubparm(ctx->saved_ubc, bc->ub_parms, UB_NUMPROC); ++ copy_one_ubparm(ctx->saved_ubc, bc->ub_parms, UB_NUMFILE); ++ copy_one_ubparm(ctx->saved_ubc, bc->ub_parms, UB_DCACHESIZE); ++ put_beancounter(bc); ++#endif ++ ++ rst_resume_network(ctx); ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ struct cpt_task_image *ti = obj->o_image; ++ ++ if (!tsk) ++ continue; ++ ++ if (ti->cpt_state == TASK_UNINTERRUPTIBLE) { ++ dprintk_ctx("task %d/%d(%s) is started\n", task_pid_vnr(tsk), tsk->pid, tsk->comm); ++ ++ /* Weird... If a signal is sent to stopped task, ++ * nobody makes recalc_sigpending(). We have to do ++ * this by hands after wake_up_process(). ++ * if we did this before a signal could arrive before ++ * wake_up_process() and stall. ++ */ ++ spin_lock_irq(&tsk->sighand->siglock); ++ if (!signal_pending(tsk)) ++ recalc_sigpending_tsk(tsk); ++ spin_unlock_irq(&tsk->sighand->siglock); ++ ++ wake_up_process(tsk); ++ } else { ++ if (ti->cpt_state == TASK_STOPPED || ++ ti->cpt_state == TASK_TRACED) { ++ set_task_state(tsk, ti->cpt_state); ++ } ++ } ++ put_task_struct(tsk); ++ } ++ ++ rst_unlock_ve(ctx); ++ ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ rst_complete_pagein(ctx, 0); ++#endif ++ ++ rst_finish_ubc(ctx); ++ cpt_object_destroy(ctx); ++ ++ return err; ++} ++ ++int rst_kill(struct cpt_context *ctx) ++{ ++ cpt_object_t *obj; ++ int err = 0; ++ ++ for_each_object(obj, CPT_OBJ_FILE) { ++ struct file *file = obj->o_obj; ++ ++ fput(file); ++ } ++ ++ for_each_object(obj, CPT_OBJ_TASK) { ++ struct task_struct *tsk = obj->o_obj; ++ ++ if (tsk == NULL) ++ continue; ++ ++ if (tsk->exit_state == 0) { ++ send_sig(SIGKILL, tsk, 1); ++ ++ spin_lock_irq(&tsk->sighand->siglock); ++ sigfillset(&tsk->blocked); ++ sigdelsetmask(&tsk->blocked, sigmask(SIGKILL)); ++ set_tsk_thread_flag(tsk, TIF_SIGPENDING); ++ clear_tsk_thread_flag(tsk, TIF_FREEZE); ++ if (tsk->flags & PF_FROZEN) ++ tsk->flags &= ~PF_FROZEN; ++ spin_unlock_irq(&tsk->sighand->siglock); ++ ++ wake_up_process(tsk); ++ } ++ ++ put_task_struct(tsk); ++ } ++ ++#ifdef CONFIG_VZ_CHECKPOINT_LAZY ++ rst_complete_pagein(ctx, 1); ++#endif ++ ++ rst_finish_ubc(ctx); ++ cpt_object_destroy(ctx); ++ ++ return err; ++} ++ ++static int rst_utsname(cpt_context_t *ctx) ++{ ++ int err; ++ loff_t sec = ctx->sections[CPT_SECT_UTSNAME]; ++ loff_t endsec; ++ struct cpt_section_hdr h; ++ struct cpt_object_hdr o; ++ struct ve_struct *ve; ++ struct uts_namespace *ns; ++ int i; ++ ++ if (sec == CPT_NULL) ++ return 0; ++ ++ err = ctx->pread(&h, sizeof(h), ctx, sec); ++ if (err) ++ return err; ++ if (h.cpt_section != CPT_SECT_UTSNAME || h.cpt_hdrlen < sizeof(h)) ++ return -EINVAL; ++ ++ ve = get_exec_env(); ++ ns = ve->ve_ns->uts_ns; ++ ++ i = 0; ++ endsec = sec + h.cpt_next; ++ sec += h.cpt_hdrlen; ++ while (sec < endsec) { ++ int len; ++ char *ptr; ++ err = rst_get_object(CPT_OBJ_NAME, sec, &o, ctx); ++ if (err) ++ return err; ++ len = o.cpt_next - o.cpt_hdrlen; ++ if (len > __NEW_UTS_LEN + 1) ++ return -ENAMETOOLONG; ++ switch (i) { ++ case 0: ++ ptr = ns->name.nodename; break; ++ case 1: ++ ptr = ns->name.domainname; break; ++ default: ++ return -EINVAL; ++ } ++ err = ctx->pread(ptr, len, ctx, sec+o.cpt_hdrlen); ++ if (err) ++ return err; ++ i++; ++ sec += o.cpt_next; ++ } ++ ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/cpu.c debian/binary-custom.d/openvz/src/kernel/cpu.c +--- ./kernel/cpu.c 2012-06-12 16:25:24.238312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/cpu.c 2012-11-13 15:20:15.376569065 +0000 +@@ -92,7 +92,7 @@ + struct task_struct *p; + + write_lock_irq(&tasklist_lock); +- for_each_process(p) { ++ for_each_process_all(p) { + if (task_cpu(p) == cpu && + (!cputime_eq(p->utime, cputime_zero) || + !cputime_eq(p->stime, cputime_zero))) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/exit.c debian/binary-custom.d/openvz/src/kernel/exit.c +--- ./kernel/exit.c 2012-06-12 16:25:24.238312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/exit.c 2012-11-13 15:20:15.376569065 +0000 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -41,8 +42,14 @@ + #include + #include /* for audit_free() */ + #include ++#include + #include + #include ++#include ++#include ++ ++#include ++#include + + #include + #include +@@ -51,7 +58,7 @@ + + extern void sem_exit (void); + +-static void exit_mm(struct task_struct * tsk); ++void exit_mm(struct task_struct * tsk); + + static void __unhash_process(struct task_struct *p) + { +@@ -62,6 +69,9 @@ + detach_pid(p, PIDTYPE_SID); + + list_del_rcu(&p->tasks); ++#ifdef CONFIG_VE ++ list_del_rcu(&p->ve_task_info.vetask_list); ++#endif + __get_cpu_var(process_counts)--; + } + list_del_rcu(&p->thread_group); +@@ -160,6 +170,8 @@ + ptrace_unlink(p); + BUG_ON(!list_empty(&p->ptrace_list) || !list_empty(&p->ptrace_children)); + __exit_signal(p); ++ nr_zombie--; ++ atomic_inc(&nr_dead); + + /* + * If we are the last non-leader member of the thread +@@ -181,9 +193,12 @@ + */ + zap_leader = (leader->exit_signal == -1); + } ++ put_task_fairsched_node(p); + + write_unlock_irq(&tasklist_lock); + release_thread(p); ++ ub_task_uncharge(p); ++ pput_ve(p->ve_task_info.owner_env); + call_rcu(&p->rcu, delayed_put_task_struct); + + p = leader; +@@ -302,28 +317,30 @@ + switch_uid(INIT_USER); + } + +-void __set_special_pids(pid_t session, pid_t pgrp) ++void __set_special_pids(struct pid *pid) + { + struct task_struct *curr = current->group_leader; ++ pid_t nr = pid_nr(pid); + +- if (task_session_nr(curr) != session) { ++ if (task_session(curr) != pid) { + detach_pid(curr, PIDTYPE_SID); +- set_task_session(curr, session); +- attach_pid(curr, PIDTYPE_SID, find_pid(session)); ++ attach_pid(curr, PIDTYPE_SID, pid); ++ set_task_session(curr, nr); + } +- if (task_pgrp_nr(curr) != pgrp) { ++ if (task_pgrp(curr) != pid) { + detach_pid(curr, PIDTYPE_PGID); +- set_task_pgrp(curr, pgrp); +- attach_pid(curr, PIDTYPE_PGID, find_pid(pgrp)); ++ attach_pid(curr, PIDTYPE_PGID, pid); ++ set_task_pgrp(curr, nr); + } + } + +-static void set_special_pids(pid_t session, pid_t pgrp) ++void set_special_pids(struct pid *pid) + { + write_lock_irq(&tasklist_lock); +- __set_special_pids(session, pgrp); ++ __set_special_pids(pid); + write_unlock_irq(&tasklist_lock); + } ++EXPORT_SYMBOL(set_special_pids); + + /* + * Let kernel threads use this to say that they +@@ -392,7 +409,7 @@ + */ + current->flags |= PF_NOFREEZE; + +- set_special_pids(1, 1); ++ set_special_pids(&init_struct_pid); + proc_clear_tty(current); + + /* Block and flush all signals */ +@@ -561,13 +578,17 @@ + * Turn us into a lazy TLB process if we + * aren't already.. + */ +-static void exit_mm(struct task_struct * tsk) ++void exit_mm(struct task_struct * tsk) + { + struct mm_struct *mm = tsk->mm; + + mm_release(tsk, mm); + if (!mm) + return; ++ ++ if (test_tsk_thread_flag(tsk, TIF_MEMDIE)) ++ mm->oom_killed = 1; ++ + /* + * Serialize with any possible pending coredump. + * We must hold mmap_sem around checking core_waiters +@@ -598,6 +619,7 @@ + task_unlock(tsk); + mmput(mm); + } ++EXPORT_SYMBOL_GPL(exit_mm); + + static void + reparent_thread(struct task_struct *p, struct task_struct *father, int traced) +@@ -823,6 +845,9 @@ + tsk->self_exec_id != tsk->parent_exec_id)) + tsk->exit_signal = SIGCHLD; + ++ if (tsk->exit_signal != -1 && t == init_pid_ns.child_reaper) ++ /* We dont want people slaying init. */ ++ tsk->exit_signal = SIGCHLD; + + /* If something other than our normal parent is ptracing us, then + * send it a SIGCHLD instead of honoring exit_signal. exit_signal +@@ -839,6 +864,7 @@ + if (tsk->exit_signal == -1 && likely(!tsk->ptrace)) + state = EXIT_DEAD; + tsk->exit_state = state; ++ nr_zombie++; + + if (thread_group_leader(tsk) && + tsk->signal->notify_count < 0 && +@@ -887,7 +913,6 @@ + + if (tsk->nsproxy->pid_ns == &init_pid_ns) + panic("Attempted to kill init!"); +- + /* + * @tsk is the last thread in the 'cgroup-init' and is exiting. + * Terminate all remaining processes in the namespace and reap them +@@ -911,6 +936,7 @@ + * perform the role of the child_reaper. + */ + zap_pid_ns_processes(tsk->nsproxy->pid_ns); ++ (void)virtinfo_gencall(VIRTINFO_DOEXIT, NULL); + } + + fastcall NORET_TYPE void do_exit(long code) +@@ -1016,8 +1042,16 @@ + if (tsk->binfmt) + module_put(tsk->binfmt->module); + +- proc_exit_connector(tsk); +- exit_notify(tsk); ++ if (!(tsk->flags & PF_EXIT_RESTART)) { ++ proc_exit_connector(tsk); ++ exit_notify(tsk); ++ } else { ++ write_lock_irq(&tasklist_lock); ++ tsk->exit_state = EXIT_ZOMBIE; ++ nr_zombie++; ++ write_unlock_irq(&tasklist_lock); ++ exit_task_namespaces(tsk); ++ } + #ifdef CONFIG_NUMA + mpol_free(tsk->mempolicy); + tsk->mempolicy = NULL; +@@ -1747,6 +1781,7 @@ + prevent_tail_call(ret); + return ret; + } ++EXPORT_SYMBOL_GPL(sys_wait4); + + #ifdef __ARCH_WANT_SYS_WAITPID + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/fairsched.c debian/binary-custom.d/openvz/src/kernel/fairsched.c +--- ./kernel/fairsched.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/fairsched.c 2012-11-13 15:20:15.376569065 +0000 +@@ -0,0 +1,648 @@ ++/* ++ * Fair Scheduler ++ * ++ * Copyright (C) 2000-2008 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++struct fairsched_node fairsched_init_node = { ++ .id = FAIRSCHED_INIT_NODE_ID, ++ .tg = &init_task_group, ++#ifdef CONFIG_VE ++ .owner_env = get_ve0(), ++#endif ++ .weight = 1, ++}; ++ ++static DEFINE_MUTEX(fairsched_mutex); ++ ++/* list protected with fairsched_mutex */ ++static LIST_HEAD(fairsched_node_head); ++static int fairsched_nr_nodes; ++ ++void __init fairsched_init_early(void) ++{ ++ list_add(&fairsched_init_node.nodelist, &fairsched_node_head); ++ fairsched_nr_nodes++; ++} ++ ++#define FSCHWEIGHT_BASE 512000 ++ ++/****************************************************************************** ++ * cfs group shares = FSCHWEIGHT_BASE / fairsched weight ++ * ++ * vzctl cpuunits default 1000 ++ * cfs shares default value is 1024 (see init_task_group_load in sched.c) ++ * cpuunits = 1000 --> weight = 500000 / cpuunits = 500 --> shares = 1024 ++ * ^--- from vzctl ++ * weight in 1..65535 --> shares in 7..512000 ++ * shares should be >1 (see comment in sched_group_set_shares function) ++ *****************************************************************************/ ++ ++static struct fairsched_node *fairsched_find(unsigned int id) ++{ ++ struct fairsched_node *p; ++ list_for_each_entry(p, &fairsched_node_head, nodelist) { ++ if (p->id == id) ++ return p; ++ } ++ return NULL; ++} ++ ++/****************************************************************************** ++ * System calls ++ * ++ * All do_xxx functions are called under fairsched mutex and after ++ * capability check. ++ * ++ * The binary interfaces follow some other Fair Scheduler implementations ++ * (although some system call arguments are not needed for our implementation). ++ *****************************************************************************/ ++ ++static int do_fairsched_mknod(unsigned int parent, unsigned int weight, ++ unsigned int newid) ++{ ++ struct fairsched_node *node; ++ int retval; ++ ++ retval = -EINVAL; ++ if (weight < 1 || weight > FSCHWEIGHT_MAX) ++ goto out; ++ if (newid < 0 || newid > INT_MAX) ++ goto out; ++ ++ retval = -EBUSY; ++ if (fairsched_find(newid) != NULL) ++ goto out; ++ ++ retval = -ENOMEM; ++ node = kzalloc(sizeof(*node), GFP_KERNEL); ++ if (node == NULL) ++ goto out; ++ ++ node->tg = sched_create_group(); ++ if (IS_ERR(node->tg)) ++ goto out_free; ++ ++ node->id = newid; ++ node->weight = weight; ++ sched_group_set_shares(node->tg, FSCHWEIGHT_BASE / weight); ++#ifdef CONFIG_VE ++ node->owner_env = get_exec_env(); ++#endif ++ list_add(&node->nodelist, &fairsched_node_head); ++ fairsched_nr_nodes++; ++ ++ retval = newid; ++out: ++ return retval; ++ ++out_free: ++ kfree(node); ++ return retval; ++} ++ ++asmlinkage int sys_fairsched_mknod(unsigned int parent, unsigned int weight, ++ unsigned int newid) ++{ ++ int retval; ++ ++ if (!capable(CAP_SETVEID)) ++ return -EPERM; ++ ++ mutex_lock(&fairsched_mutex); ++ retval = do_fairsched_mknod(parent, weight, newid); ++ mutex_unlock(&fairsched_mutex); ++ ++ return retval; ++} ++EXPORT_SYMBOL(sys_fairsched_mknod); ++ ++static int do_fairsched_rmnod(unsigned int id) ++{ ++ struct fairsched_node *node; ++ int retval; ++ ++ retval = -EINVAL; ++ node = fairsched_find(id); ++ if (node == NULL) ++ goto out; ++ if (node == &fairsched_init_node) ++ goto out; ++ ++ retval = -EBUSY; ++ if (node->refcnt) ++ goto out; ++ ++ list_del(&node->nodelist); ++ fairsched_nr_nodes--; ++ ++ sched_destroy_group(node->tg); ++ kfree(node); ++ retval = 0; ++out: ++ return retval; ++} ++ ++asmlinkage int sys_fairsched_rmnod(unsigned int id) ++{ ++ int retval; ++ ++ if (!capable(CAP_SETVEID)) ++ return -EPERM; ++ ++ mutex_lock(&fairsched_mutex); ++ retval = do_fairsched_rmnod(id); ++ mutex_unlock(&fairsched_mutex); ++ ++ return retval; ++} ++EXPORT_SYMBOL(sys_fairsched_rmnod); ++ ++static int do_fairsched_chwt(unsigned int id, unsigned weight) ++{ ++ struct fairsched_node *node; ++ ++ if (id == 0) ++ return -EINVAL; ++ if (weight < 1 || weight > FSCHWEIGHT_MAX) ++ return -EINVAL; ++ ++ node = fairsched_find(id); ++ if (node == NULL) ++ return -ENOENT; ++ ++ node->weight = weight; ++ sched_group_set_shares(node->tg, FSCHWEIGHT_BASE / weight); ++ ++ return 0; ++} ++ ++asmlinkage int sys_fairsched_chwt(unsigned int id, unsigned weight) ++{ ++ int retval; ++ ++ if (!capable(CAP_SETVEID)) ++ return -EPERM; ++ ++ mutex_lock(&fairsched_mutex); ++ retval = do_fairsched_chwt(id, weight); ++ mutex_unlock(&fairsched_mutex); ++ ++ return retval; ++} ++ ++static int do_fairsched_vcpus(unsigned int id, unsigned int vcpus) ++{ ++ struct fairsched_node *node; ++ ++ if (id == 0) ++ return -EINVAL; ++ ++ node = fairsched_find(id); ++ if (node == NULL) ++ return -ENOENT; ++ ++ return 0; ++} ++ ++asmlinkage int sys_fairsched_vcpus(unsigned int id, unsigned int vcpus) ++{ ++ int retval; ++ ++ if (!capable(CAP_SETVEID)) ++ return -EPERM; ++ ++ mutex_lock(&fairsched_mutex); ++ retval = do_fairsched_vcpus(id, vcpus); ++ mutex_unlock(&fairsched_mutex); ++ ++ return retval; ++} ++EXPORT_SYMBOL(sys_fairsched_vcpus); ++ ++static int do_fairsched_rate(unsigned int id, int op, unsigned rate) ++{ ++ struct fairsched_node *node; ++ int retval; ++ ++ if (id == 0) ++ return -EINVAL; ++ if (op == FAIRSCHED_SET_RATE && (rate < 1 || rate >= (1UL << 31))) ++ return -EINVAL; ++ ++ node = fairsched_find(id); ++ if (node == NULL) ++ return -ENOENT; ++ ++ retval = -EINVAL; ++ switch (op) { ++ case FAIRSCHED_SET_RATE: ++ node->rate = rate; ++ node->rate_limited = 1; ++ retval = rate; ++ break; ++ case FAIRSCHED_DROP_RATE: ++ node->rate = 0; ++ node->rate_limited = 0; ++ retval = 0; ++ break; ++ case FAIRSCHED_GET_RATE: ++ if (node->rate_limited) ++ retval = node->rate; ++ else ++ retval = -ENODATA; ++ break; ++ } ++ return retval; ++} ++ ++asmlinkage int sys_fairsched_rate(unsigned int id, int op, unsigned rate) ++{ ++ int retval; ++ ++ if (!capable(CAP_SETVEID)) ++ return -EPERM; ++ ++ mutex_lock(&fairsched_mutex); ++ retval = do_fairsched_rate(id, op, rate); ++ mutex_unlock(&fairsched_mutex); ++ ++ return retval; ++} ++ ++static int do_fairsched_mvpr(pid_t pid, unsigned int nodeid) ++{ ++ struct task_struct *p; ++ struct fairsched_node *node; ++ int retval; ++ unsigned flags; ++ ++ retval = -ENOENT; ++ node = fairsched_find(nodeid); ++ if (node == NULL) ++ goto out; ++ ++ write_lock_irqsave(&tasklist_lock, flags); ++ retval = -ESRCH; ++ p = find_task_by_pid(pid); ++ if (p == NULL) ++ goto out_unlock; ++ ++ get_task_struct(p); ++ put_task_fairsched_node(p); ++ p->fsched_node = node; ++ get_task_fairsched_node(p); ++ write_unlock_irqrestore(&tasklist_lock, flags); ++ ++ smp_wmb(); ++ sched_move_task(p); ++ put_task_struct(p); ++ return 0; ++ ++out_unlock: ++ write_unlock_irqrestore(&tasklist_lock, flags); ++out: ++ return retval; ++} ++ ++asmlinkage int sys_fairsched_mvpr(pid_t pid, unsigned int nodeid) ++{ ++ int retval; ++ ++ if (!capable(CAP_SETVEID)) ++ return -EPERM; ++ ++ mutex_lock(&fairsched_mutex); ++ retval = do_fairsched_mvpr(pid, nodeid); ++ mutex_unlock(&fairsched_mutex); ++ ++ return retval; ++} ++EXPORT_SYMBOL(sys_fairsched_mvpr); ++ ++#ifdef CONFIG_PROC_FS ++ ++/*********************************************************************/ ++/* ++ * proc interface ++ */ ++/*********************************************************************/ ++ ++#include ++#include ++#include ++ ++struct fairsched_node_dump { ++ int id; ++ unsigned weight; ++ unsigned rate; ++ int rate_limited; ++ int nr_pcpu; ++ int nr_tasks, nr_runtasks; ++}; ++ ++struct fairsched_dump { ++ int len; ++ struct fairsched_node_dump nodes[0]; ++}; ++ ++static struct fairsched_dump *fairsched_do_dump(int compat) ++{ ++ int nr_nodes; ++ int len; ++ struct fairsched_dump *dump; ++ struct fairsched_node *node; ++ struct fairsched_node_dump *p; ++ ++start: ++ nr_nodes = (ve_is_super(get_exec_env()) ? fairsched_nr_nodes + 16 : 1); ++ len = sizeof(*dump) + nr_nodes * sizeof(dump->nodes[0]); ++ dump = ub_vmalloc(len); ++ if (dump == NULL) ++ goto out; ++ ++ mutex_lock(&fairsched_mutex); ++ if (ve_is_super(get_exec_env()) && nr_nodes < fairsched_nr_nodes) ++ goto repeat; ++ p = dump->nodes; ++ list_for_each_entry_reverse(node, &fairsched_node_head, nodelist) { ++ if ((char *)p - (char *)dump >= len) ++ break; ++ p->nr_tasks = 0; ++ p->nr_runtasks = 0; ++#ifdef CONFIG_VE ++ if (!ve_accessible(node->owner_env, get_exec_env())) ++ continue; ++ p->nr_tasks = atomic_read(&node->owner_env->pcounter); ++ p->nr_runtasks = nr_running_ve(node->owner_env); ++#endif ++ p->id = node->id; ++ p->weight = node->weight; ++ p->rate = node->rate; ++ p->rate_limited = node->rate_limited; ++ p->nr_pcpu = num_online_cpus(); ++ p++; ++ } ++ dump->len = p - dump->nodes; ++ mutex_unlock(&fairsched_mutex); ++ ++out: ++ return dump; ++ ++repeat: ++ mutex_unlock(&fairsched_mutex); ++ vfree(dump); ++ goto start; ++} ++ ++#define FAIRSCHED_PROC_HEADLINES 2 ++ ++#define FAIRSHED_DEBUG " debug" ++ ++#ifdef CONFIG_VE ++/* ++ * File format is dictated by compatibility reasons. ++ */ ++static int fairsched_seq_show(struct seq_file *m, void *v) ++{ ++ struct fairsched_dump *dump; ++ struct fairsched_node_dump *p; ++ unsigned vid, nid, pid, r; ++ ++ dump = m->private; ++ p = (struct fairsched_node_dump *)((unsigned long)v & ~3UL); ++ if (p - dump->nodes < FAIRSCHED_PROC_HEADLINES) { ++ if (p == dump->nodes) ++ seq_printf(m, "Version: 2.6 debug\n"); ++ else if (p == dump->nodes + 1) ++ seq_printf(m, ++ " veid " ++ " id " ++ " parent " ++ "weight " ++ " rate " ++ "tasks " ++ " run " ++ "cpus" ++ " " ++ "flg " ++ "ready " ++ " start_tag " ++ " value " ++ " delay" ++ "\n"); ++ } else { ++ p -= FAIRSCHED_PROC_HEADLINES; ++ vid = nid = pid = 0; ++ r = (unsigned long)v & 3; ++ if (p == dump->nodes) { ++ if (r == 2) ++ nid = p->id; ++ } else { ++ if (!r) ++ nid = p->id; ++ else if (r == 1) ++ vid = pid = p->id; ++ else ++ vid = p->id, nid = 1; ++ } ++ seq_printf(m, ++ "%10u " ++ "%10u %10u %6u %5u %5u %5u %4u" ++ " " ++ " %c%c %5u %20Lu %20Lu %20Lu" ++ "\n", ++ vid, ++ nid, ++ pid, ++ p->weight, ++ p->rate, ++ p->nr_tasks, ++ p->nr_runtasks, ++ p->nr_pcpu, ++ p->rate_limited ? 'L' : '.', ++ '.', ++ p->nr_runtasks, ++ 0ll, 0ll, 0ll); ++ } ++ ++ return 0; ++} ++ ++static void *fairsched_seq_start(struct seq_file *m, loff_t *pos) ++{ ++ struct fairsched_dump *dump; ++ unsigned long l; ++ ++ dump = m->private; ++ if (*pos >= dump->len * 3 - 1 + FAIRSCHED_PROC_HEADLINES) ++ return NULL; ++ if (*pos < FAIRSCHED_PROC_HEADLINES) ++ return dump->nodes + *pos; ++ /* guess why... */ ++ l = (unsigned long)(dump->nodes + ++ ((unsigned long)*pos + FAIRSCHED_PROC_HEADLINES * 2 + 1) / 3); ++ l |= ((unsigned long)*pos + FAIRSCHED_PROC_HEADLINES * 2 + 1) % 3; ++ return (void *)l; ++} ++static void *fairsched_seq_next(struct seq_file *m, void *v, loff_t *pos) ++{ ++ ++*pos; ++ return fairsched_seq_start(m, pos); ++} ++#endif /* CONFIG_VE */ ++ ++static int fairsched2_seq_show(struct seq_file *m, void *v) ++{ ++ struct fairsched_dump *dump; ++ struct fairsched_node_dump *p; ++ ++ dump = m->private; ++ p = v; ++ if (p - dump->nodes < FAIRSCHED_PROC_HEADLINES) { ++ if (p == dump->nodes) ++ seq_printf(m, "Version: 2.7" FAIRSHED_DEBUG "\n"); ++ else if (p == dump->nodes + 1) ++ seq_printf(m, ++ " id " ++ "weight " ++ " rate " ++ " run " ++ "cpus" ++#ifdef FAIRSHED_DEBUG ++ " " ++ "flg " ++ "ready " ++ " start_tag " ++ " value " ++ " delay" ++#endif ++ "\n"); ++ } else { ++ p -= FAIRSCHED_PROC_HEADLINES; ++ seq_printf(m, ++ "%10u %6u %5u %5u %4u" ++#ifdef FAIRSHED_DEBUG ++ " " ++ " %c%c %5u %20Lu %20Lu %20Lu" ++#endif ++ "\n", ++ p->id, ++ p->weight, ++ p->rate, ++ p->nr_runtasks, ++ p->nr_pcpu ++#ifdef FAIRSHED_DEBUG ++ , ++ p->rate_limited ? 'L' : '.', ++ '.', ++ p->nr_runtasks, ++ 0ll, 0ll, 0ll ++#endif ++ ); ++ } ++ ++ return 0; ++} ++ ++static void *fairsched2_seq_start(struct seq_file *m, loff_t *pos) ++{ ++ struct fairsched_dump *dump; ++ ++ dump = m->private; ++ if (*pos >= dump->len + FAIRSCHED_PROC_HEADLINES) ++ return NULL; ++ return dump->nodes + *pos; ++} ++static void *fairsched2_seq_next(struct seq_file *m, void *v, loff_t *pos) ++{ ++ ++*pos; ++ return fairsched2_seq_start(m, pos); ++} ++static void fairsched2_seq_stop(struct seq_file *m, void *v) ++{ ++} ++ ++#ifdef CONFIG_VE ++static struct seq_operations fairsched_seq_op = { ++ .start = fairsched_seq_start, ++ .next = fairsched_seq_next, ++ .stop = fairsched2_seq_stop, ++ .show = fairsched_seq_show ++}; ++#endif ++static struct seq_operations fairsched2_seq_op = { ++ .start = fairsched2_seq_start, ++ .next = fairsched2_seq_next, ++ .stop = fairsched2_seq_stop, ++ .show = fairsched2_seq_show ++}; ++static int fairsched_seq_open(struct inode *inode, struct file *file) ++{ ++ int ret; ++ struct seq_file *m; ++ int compat; ++ ++#ifdef CONFIG_VE ++ compat = (file->f_dentry->d_name.len == sizeof("fairsched") - 1); ++ ret = seq_open(file, compat ? &fairsched_seq_op : &fairsched2_seq_op); ++#else ++ compat = 0; ++ ret = seq_open(file, &fairsched2_seq_op); ++#endif ++ if (ret) ++ return ret; ++ m = file->private_data; ++ m->private = fairsched_do_dump(compat); ++ if (m->private == NULL) { ++ seq_release(inode, file); ++ ret = -ENOMEM; ++ } ++ return ret; ++} ++static int fairsched_seq_release(struct inode *inode, struct file *file) ++{ ++ struct seq_file *m; ++ struct fairsched_dump *dump; ++ ++ m = file->private_data; ++ dump = m->private; ++ m->private = NULL; ++ vfree(dump); ++ seq_release(inode, file); ++ return 0; ++} ++static struct file_operations proc_fairsched_operations = { ++ .open = fairsched_seq_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = fairsched_seq_release ++}; ++ ++void __init fairsched_init_late(void) ++{ ++ struct proc_dir_entry *entry; ++#ifdef CONFIG_VE ++ entry = create_proc_glob_entry("fairsched", S_IRUGO, NULL); ++ if (entry) ++ entry->proc_fops = &proc_fairsched_operations; ++#endif ++ entry = create_proc_glob_entry("fairsched2", S_IRUGO, NULL); ++ if (entry) ++ entry->proc_fops = &proc_fairsched_operations; ++} ++ ++#else ++ ++void __init fairsched_init_late(void) { } ++ ++#endif /* CONFIG_PROC_FS */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/fork.c debian/binary-custom.d/openvz/src/kernel/fork.c +--- ./kernel/fork.c 2012-06-12 16:25:24.242312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/fork.c 2012-11-13 15:20:15.376569065 +0000 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -25,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -52,6 +54,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -60,11 +63,16 @@ + #include + #include + ++#include ++#include ++#include ++ + /* + * Protected counters by write_lock_irq(&tasklist_lock) + */ + unsigned long total_forks; /* Handle normal Linux uptimes. */ + int nr_threads; /* The idle threads do not count.. */ ++EXPORT_SYMBOL(nr_threads); + + int max_threads; /* tunable limit on nr_threads */ + +@@ -72,6 +80,8 @@ + + __cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */ + ++EXPORT_SYMBOL(tasklist_lock); ++ + int nr_processes(void) + { + int cpu; +@@ -122,15 +132,22 @@ + WARN_ON(atomic_read(&tsk->usage)); + WARN_ON(tsk == current); + ++ ub_task_put(tsk); + security_task_free(tsk); + free_uid(tsk->user); + put_group_info(tsk->group_info); + delayacct_tsk_free(tsk); + ++#ifdef CONFIG_VE ++ put_ve(VE_TASK_INFO(tsk)->owner_env); ++ atomic_dec(&nr_dead); ++#endif + if (!profile_handoff_task(tsk)) + free_task(tsk); + } + ++EXPORT_SYMBOL_GPL(__put_task_struct); ++ + void __init fork_init(unsigned long mempages) + { + #ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR +@@ -140,7 +157,7 @@ + /* create a slab on which task_structs can be allocated */ + task_struct_cachep = + kmem_cache_create("task_struct", sizeof(struct task_struct), +- ARCH_MIN_TASKALIGN, SLAB_PANIC, NULL); ++ ARCH_MIN_TASKALIGN, SLAB_PANIC|SLAB_UBC, NULL); + #endif + + /* +@@ -244,7 +261,12 @@ + -pages); + continue; + } ++ + charge = 0; ++ if (ub_memory_charge(mm, mpnt->vm_end - mpnt->vm_start, ++ mpnt->vm_flags & ~VM_LOCKED, ++ mpnt->vm_file, UB_HARD)) ++ goto fail_noch; + if (mpnt->vm_flags & VM_ACCOUNT) { + unsigned int len = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + if (security_vm_enough_memory(len)) +@@ -291,7 +313,7 @@ + rb_parent = &tmp->vm_rb; + + mm->map_count++; +- retval = copy_page_range(mm, oldmm, mpnt); ++ retval = copy_page_range(mm, oldmm, tmp, mpnt); + + if (tmp->vm_ops && tmp->vm_ops->open) + tmp->vm_ops->open(tmp); +@@ -310,6 +332,9 @@ + fail_nomem_policy: + kmem_cache_free(vm_area_cachep, tmp); + fail_nomem: ++ ub_memory_uncharge(mm, mpnt->vm_end - mpnt->vm_start, ++ mpnt->vm_flags & ~VM_LOCKED, mpnt->vm_file); ++fail_noch: + retval = -ENOMEM; + vm_unacct_memory(charge); + goto out; +@@ -340,7 +365,8 @@ + + #include + +-static struct mm_struct * mm_init(struct mm_struct * mm) ++static struct mm_struct * mm_init(struct mm_struct * mm, ++ struct task_struct *tsk) + { + atomic_set(&mm->mm_users, 1); + atomic_set(&mm->mm_count, 1); +@@ -357,11 +383,14 @@ + mm->ioctx_list = NULL; + mm->free_area_cache = TASK_UNMAPPED_BASE; + mm->cached_hole_size = ~0UL; ++ set_mm_ub(mm, tsk); + + if (likely(!mm_alloc_pgd(mm))) { + mm->def_flags = 0; + return mm; + } ++ ++ put_mm_ub(mm); + free_mm(mm); + return NULL; + } +@@ -376,10 +405,11 @@ + mm = allocate_mm(); + if (mm) { + memset(mm, 0, sizeof(*mm)); +- mm = mm_init(mm); ++ mm = mm_init(mm, NULL); + } + return mm; + } ++EXPORT_SYMBOL_GPL(mm_alloc); + + /* + * Called when the last reference to the mm +@@ -391,6 +421,7 @@ + BUG_ON(mm == &init_mm); + mm_free_pgd(mm); + destroy_context(mm); ++ put_mm_ub(mm); + free_mm(mm); + } + EXPORT_SYMBOL_GPL(__mmdrop); +@@ -411,6 +442,9 @@ + spin_unlock(&mmlist_lock); + } + put_swap_token(mm); ++ (void) virtinfo_gencall(VIRTINFO_EXITMMAP, mm); ++ if (mm->oom_killed) ++ ub_oom_task_dead(current); + mmdrop(mm); + } + } +@@ -525,7 +559,7 @@ + mm->token_priority = 0; + mm->last_interval = 0; + +- if (!mm_init(mm)) ++ if (!mm_init(mm, tsk)) + goto fail_nomem; + + if (init_new_context(tsk, mm)) +@@ -552,6 +586,7 @@ + * because it calls destroy_context() + */ + mm_free_pgd(mm); ++ put_mm_ub(mm); + free_mm(mm); + return NULL; + } +@@ -991,14 +1026,19 @@ + struct pt_regs *regs, + unsigned long stack_size, + int __user *child_tidptr, +- struct pid *pid) ++ struct pid *pid, pid_t vpid) + { + int retval; + struct task_struct *p; + int cgroup_callbacks_done = 0; + ++#ifdef CONFIG_VE ++ if (clone_flags & CLONE_NAMESPACES_MASK) ++ return ERR_PTR(-EINVAL); ++#else + if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS)) + return ERR_PTR(-EINVAL); ++#endif + + /* + * Thread groups must share signals as well, and detached threads +@@ -1026,6 +1066,9 @@ + + rt_mutex_init_task(p); + ++ if (ub_task_charge(current, p)) ++ goto bad_fork_charge; ++ + #ifdef CONFIG_TRACE_IRQFLAGS + DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled); + DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled); +@@ -1169,7 +1212,7 @@ + + if (pid != &init_struct_pid) { + retval = -ENOMEM; +- pid = alloc_pid(task_active_pid_ns(p)); ++ pid = alloc_pid(task_active_pid_ns(p), vpid); + if (!pid) + goto bad_fork_cleanup_namespaces; + +@@ -1177,6 +1220,8 @@ + retval = pid_ns_prepare_proc(task_active_pid_ns(p)); + if (retval < 0) + goto bad_fork_free_pid; ++ if (task_active_pid_ns(current)->flags & PID_NS_HIDE_CHILD) ++ task_active_pid_ns(p)->flags |= PID_NS_HIDDEN; + } + } + +@@ -1275,7 +1320,7 @@ + * thread can't slip out of an OOM kill (or normal SIGKILL). + */ + recalc_sigpending(); +- if (signal_pending(current)) { ++ if (signal_pending(current) && !vpid) { + spin_unlock(¤t->sighand->siglock); + write_unlock_irq(&tasklist_lock); + retval = -ERESTARTNOINTR; +@@ -1316,15 +1361,26 @@ + set_task_session(p, task_session_nr(current)); + attach_pid(p, PIDTYPE_PGID, task_pgrp(current)); + attach_pid(p, PIDTYPE_SID, task_session(current)); ++ + list_add_tail_rcu(&p->tasks, &init_task.tasks); ++#ifdef CONFIG_VE ++ list_add_tail_rcu(&p->ve_task_info.vetask_list, ++ &p->ve_task_info.owner_env->vetask_lh); ++#endif + __get_cpu_var(process_counts)++; + } + attach_pid(p, PIDTYPE_PID, pid); + nr_threads++; + } ++ (void)get_ve(p->ve_task_info.owner_env); ++ pget_ve(p->ve_task_info.owner_env); + ++#ifdef CONFIG_VE ++ seqcount_init(&p->ve_task_info.wakeup_lock); ++#endif + total_forks++; + spin_unlock(¤t->sighand->siglock); ++ get_task_fairsched_node(p); + write_unlock_irq(&tasklist_lock); + proc_fork_connector(p); + cgroup_post_fork(p); +@@ -1370,6 +1426,9 @@ + atomic_dec(&p->user->processes); + free_uid(p->user); + bad_fork_free: ++ ub_task_uncharge(p); ++ ub_task_put(p); ++bad_fork_charge: + free_task(p); + fork_out: + return ERR_PTR(retval); +@@ -1387,7 +1446,7 @@ + struct pt_regs regs; + + task = copy_process(CLONE_VM, 0, idle_regs(®s), 0, NULL, +- &init_struct_pid); ++ &init_struct_pid, 0); + if (!IS_ERR(task)) + init_idle(task, cpu); + +@@ -1416,17 +1475,22 @@ + * It copies the process, and if successful kick-starts + * it and waits for it to finish using the VM if required. + */ +-long do_fork(unsigned long clone_flags, ++long do_fork_pid(unsigned long clone_flags, + unsigned long stack_start, + struct pt_regs *regs, + unsigned long stack_size, + int __user *parent_tidptr, +- int __user *child_tidptr) ++ int __user *child_tidptr, ++ long vpid) + { + struct task_struct *p; + int trace = 0; + long nr; + ++ nr = virtinfo_gencall(VIRTINFO_DOFORK, (void *)clone_flags); ++ if (nr) ++ return nr; ++ + if (unlikely(current->ptrace)) { + trace = fork_traceflag (clone_flags); + if (trace) +@@ -1434,7 +1498,7 @@ + } + + p = copy_process(clone_flags, stack_start, regs, stack_size, +- child_tidptr, NULL); ++ child_tidptr, NULL, vpid); + /* + * Do this prior waking up the new thread - the thread pointer + * might get invalid after that point, if the thread exits quickly. +@@ -1466,6 +1530,8 @@ + set_tsk_thread_flag(p, TIF_SIGPENDING); + } + ++ (void)virtinfo_gencall(VIRTINFO_DOFORKRET, p); ++ + if (!(clone_flags & CLONE_STOPPED)) + wake_up_new_task(p, clone_flags); + else +@@ -1488,6 +1554,8 @@ + } else { + nr = PTR_ERR(p); + } ++ ++ (void)virtinfo_gencall(VIRTINFO_DOFORKPOST, (void *)(long)nr); + return nr; + } + +@@ -1503,27 +1571,40 @@ + init_waitqueue_head(&sighand->signalfd_wqh); + } + ++EXPORT_SYMBOL(do_fork_pid); ++ ++long do_fork(unsigned long clone_flags, ++ unsigned long stack_start, ++ struct pt_regs *regs, ++ unsigned long stack_size, ++ int __user *parent_tidptr, ++ int __user *child_tidptr) ++{ ++ return do_fork_pid(clone_flags, stack_start, regs, stack_size, ++ parent_tidptr, child_tidptr, 0); ++} ++ + void __init proc_caches_init(void) + { + sighand_cachep = kmem_cache_create("sighand_cache", + sizeof(struct sighand_struct), 0, +- SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_DESTROY_BY_RCU, ++ SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_DESTROY_BY_RCU|SLAB_UBC, + sighand_ctor); + signal_cachep = kmem_cache_create("signal_cache", + sizeof(struct signal_struct), 0, +- SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); ++ SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_UBC, NULL); + files_cachep = kmem_cache_create("files_cache", + sizeof(struct files_struct), 0, +- SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); ++ SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_UBC, NULL); + fs_cachep = kmem_cache_create("fs_cache", + sizeof(struct fs_struct), 0, +- SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); ++ SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_UBC, NULL); + vm_area_cachep = kmem_cache_create("vm_area_struct", + sizeof(struct vm_area_struct), 0, +- SLAB_PANIC, NULL); ++ SLAB_PANIC|SLAB_UBC, NULL); + mm_cachep = kmem_cache_create("mm_struct", + sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN, +- SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); ++ SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_UBC, NULL); + } + + /* +@@ -1673,6 +1754,10 @@ + CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER| + CLONE_NEWNET)) + goto bad_unshare_out; ++#ifdef CONFIG_VE ++ if (unshare_flags & CLONE_NAMESPACES_MASK) ++ goto bad_unshare_out; ++#endif + + if ((err = unshare_thread(unshare_flags))) + goto bad_unshare_out; +@@ -1686,9 +1771,11 @@ + goto bad_unshare_cleanup_vm; + if ((err = unshare_semundo(unshare_flags, &new_ulist))) + goto bad_unshare_cleanup_fd; ++#ifndef CONFIG_VE + if ((err = unshare_nsproxy_namespaces(unshare_flags, &new_nsproxy, + new_fs))) + goto bad_unshare_cleanup_semundo; ++#endif + + if (new_fs || new_mm || new_fd || new_ulist || new_nsproxy) { + +@@ -1726,7 +1813,9 @@ + if (new_nsproxy) + put_nsproxy(new_nsproxy); + ++#ifndef CONFIG_VE + bad_unshare_cleanup_semundo: ++#endif + bad_unshare_cleanup_fd: + if (new_fd) + put_files_struct(new_fd); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/futex.c debian/binary-custom.d/openvz/src/kernel/futex.c +--- ./kernel/futex.c 2012-06-12 16:25:24.242312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/futex.c 2012-11-13 15:20:15.380569064 +0000 +@@ -1164,8 +1164,6 @@ + */ + #define FLAGS_SHARED 1 + +-static long futex_wait_restart(struct restart_block *restart); +- + static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared, + u32 val, ktime_t *abs_time) + { +@@ -1320,7 +1318,7 @@ + } + + +-static long futex_wait_restart(struct restart_block *restart) ++long futex_wait_restart(struct restart_block *restart) + { + u32 __user *uaddr = (u32 __user *)restart->futex.uaddr; + struct rw_semaphore *fshared = NULL; +@@ -1332,6 +1330,7 @@ + fshared = ¤t->mm->mmap_sem; + return (long)futex_wait(uaddr, fshared, restart->futex.val, &t); + } ++EXPORT_SYMBOL_GPL(futex_wait_restart); + + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/futex_compat.c debian/binary-custom.d/openvz/src/kernel/futex_compat.c +--- ./kernel/futex_compat.c 2012-06-12 16:25:24.242312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/futex_compat.c 2012-11-13 15:20:15.380569064 +0000 +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/hrtimer.c debian/binary-custom.d/openvz/src/kernel/hrtimer.c +--- ./kernel/hrtimer.c 2012-06-12 16:25:24.242312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/hrtimer.c 2012-11-13 15:20:15.380569064 +0000 +@@ -1347,6 +1347,7 @@ + /* The other values in restart are already filled in */ + return -ERESTART_RESTARTBLOCK; + } ++EXPORT_SYMBOL_GPL(hrtimer_nanosleep_restart); + + long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp, + const enum hrtimer_mode mode, const clockid_t clockid) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/kmod.c debian/binary-custom.d/openvz/src/kernel/kmod.c +--- ./kernel/kmod.c 2012-06-12 16:25:24.246312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/kmod.c 2012-11-13 15:20:15.388569067 +0000 +@@ -77,6 +77,10 @@ + #define MAX_KMOD_CONCURRENT 50 /* Completely arbitrary value - KAO */ + static int kmod_loop_msg; + ++ /* Don't allow request_module() inside VE. */ ++ if (!ve_is_super(get_exec_env())) ++ return -EPERM; ++ + va_start(args, fmt); + ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args); + va_end(args); +@@ -453,6 +457,9 @@ + DECLARE_COMPLETION_ONSTACK(done); + int retval = 0; + ++ if (!ve_is_super(get_exec_env())) ++ return -EPERM; ++ + helper_lock(); + if (sub_info->path[0] == '\0') + goto out; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/kprobes.c debian/binary-custom.d/openvz/src/kernel/kprobes.c +--- ./kernel/kprobes.c 2012-06-12 16:25:24.246312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/kprobes.c 2012-11-13 15:20:15.388569067 +0000 +@@ -106,14 +106,14 @@ + ret = freeze_processes(); + if (ret == 0) { + struct task_struct *p, *q; +- do_each_thread(p, q) { ++ do_each_thread_all(p, q) { + if (p != current && p->state == TASK_RUNNING && + p->pid != 0) { + printk("Check failed: %s is running\n",p->comm); + ret = -1; + goto loop_end; + } +- } while_each_thread(p, q); ++ } while_each_thread_all(p, q); + } + loop_end: + thaw_processes(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/lockdep.c debian/binary-custom.d/openvz/src/kernel/lockdep.c +--- ./kernel/lockdep.c 2012-06-12 16:25:24.250312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/lockdep.c 2012-11-13 15:20:15.392569068 +0000 +@@ -3182,7 +3182,7 @@ + if (count != 10) + printk(" locked it.\n"); + +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + /* + * It's not reliable to print a task's held locks + * if it's not sleeping (or if it's not the current +@@ -3195,7 +3195,7 @@ + if (!unlock) + if (read_trylock(&tasklist_lock)) + unlock = 1; +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + + printk("\n"); + printk("=============================================\n\n"); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/module.c debian/binary-custom.d/openvz/src/kernel/module.c +--- ./kernel/module.c 2012-06-12 16:25:24.254312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/module.c 2012-11-13 15:20:15.392569068 +0000 +@@ -2135,6 +2135,14 @@ + mutex_unlock(&module_mutex); + return ret; + } ++ if (ret > 0) { ++ printk(KERN_WARNING "%s: '%s'->init suspiciously returned %d, " ++ "it should follow 0/-E convention\n" ++ KERN_WARNING "%s: loading module anyway...\n", ++ __func__, mod->name, ret, ++ __func__); ++ dump_stack(); ++ } + + /* Now it's a first class citizen! */ + mutex_lock(&module_mutex); +@@ -2349,6 +2357,8 @@ + static void *m_start(struct seq_file *m, loff_t *pos) + { + mutex_lock(&module_mutex); ++ if (!ve_is_super(get_exec_env())) ++ return NULL; + return seq_list_start(&modules, *pos); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/nsproxy.c debian/binary-custom.d/openvz/src/kernel/nsproxy.c +--- ./kernel/nsproxy.c 2012-06-12 16:25:24.254312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/nsproxy.c 2012-11-13 15:20:15.392569068 +0000 +@@ -26,6 +26,14 @@ + + struct nsproxy init_nsproxy = INIT_NSPROXY(init_nsproxy); + ++void get_task_namespaces(struct task_struct *tsk) ++{ ++ struct nsproxy *ns = tsk->nsproxy; ++ if (ns) { ++ get_nsproxy(ns); ++ } ++} ++ + /* + * creates a copy of "orig" with refcount 1. + */ +@@ -132,12 +140,12 @@ + if (!(flags & (CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC | + CLONE_NEWUSER | CLONE_NEWPID | CLONE_NEWNET))) + return 0; +- ++#ifndef CONFIG_VE + if (!capable(CAP_SYS_ADMIN)) { + err = -EPERM; + goto out; + } +- ++#endif + new_ns = create_new_namespaces(flags, tsk, tsk->fs); + if (IS_ERR(new_ns)) { + err = PTR_ERR(new_ns); +@@ -156,6 +164,7 @@ + put_nsproxy(old_ns); + return err; + } ++EXPORT_SYMBOL_GPL(copy_namespaces); + + void free_nsproxy(struct nsproxy *ns) + { +@@ -172,6 +181,22 @@ + put_net(ns->net_ns); + kmem_cache_free(nsproxy_cachep, ns); + } ++EXPORT_SYMBOL_GPL(free_nsproxy); ++ ++struct mnt_namespace * get_task_mnt_ns(struct task_struct *tsk) ++{ ++ struct mnt_namespace *mnt_ns = NULL; ++ ++ task_lock(tsk); ++ if (tsk->nsproxy) ++ mnt_ns = tsk->nsproxy->mnt_ns; ++ if (mnt_ns) ++ get_mnt_ns(mnt_ns); ++ task_unlock(tsk); ++ ++ return mnt_ns; ++} ++EXPORT_SYMBOL(get_task_mnt_ns); + + /* + * Called from unshare. Unshare all the namespaces part of nsproxy. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/panic.c debian/binary-custom.d/openvz/src/kernel/panic.c +--- ./kernel/panic.c 2012-06-12 16:25:24.254312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/panic.c 2012-11-13 15:20:15.392569068 +0000 +@@ -28,6 +28,8 @@ + static DEFINE_SPINLOCK(pause_on_oops_lock); + + int panic_timeout; ++int kernel_text_csum_broken; ++EXPORT_SYMBOL(kernel_text_csum_broken); + + ATOMIC_NOTIFIER_HEAD(panic_notifier_list); + +@@ -160,7 +162,8 @@ + { + static char buf[20]; + if (tainted) { +- snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c%c", ++ snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c%c%c", ++ kernel_text_csum_broken ? 'B' : ' ', + tainted & TAINT_PROPRIETARY_MODULE ? 'P' : 'G', + tainted & TAINT_FORCED_MODULE ? 'F' : ' ', + tainted & TAINT_UNSAFE_SMP ? 'S' : ' ', +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/pid.c debian/binary-custom.d/openvz/src/kernel/pid.c +--- ./kernel/pid.c 2012-06-12 16:25:24.254312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/pid.c 2012-11-13 15:20:15.396569067 +0000 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -39,6 +40,7 @@ + #define pid_hashfn(nr, ns) \ + hash_long((unsigned long)nr + (unsigned long)ns, pidhash_shift) + static struct hlist_head *pid_hash; ++ + static int pidhash_shift; + struct pid init_struct_pid = INIT_STRUCT_PID; + static struct kmem_cache *pid_ns_cachep; +@@ -120,6 +122,7 @@ + clear_bit(offset, map->page); + atomic_inc(&map->nr_free); + } ++EXPORT_SYMBOL_GPL(free_pidmap); + + static int alloc_pidmap(struct pid_namespace *pid_ns) + { +@@ -181,6 +184,36 @@ + return -1; + } + ++static int set_pidmap(struct pid_namespace *pid_ns, pid_t pid) ++{ ++ int offset; ++ struct pidmap *map; ++ ++ offset = pid & BITS_PER_PAGE_MASK; ++ map = &pid_ns->pidmap[pid/BITS_PER_PAGE]; ++ if (unlikely(!map->page)) { ++ void *page = kzalloc(PAGE_SIZE, GFP_KERNEL); ++ /* ++ * Free the page if someone raced with us ++ * installing it: ++ */ ++ spin_lock_irq(&pidmap_lock); ++ if (map->page) ++ kfree(page); ++ else ++ map->page = page; ++ spin_unlock_irq(&pidmap_lock); ++ if (unlikely(!map->page)) ++ return -ENOMEM; ++ } ++ ++ if (test_and_set_bit(offset, map->page)) ++ return -EBUSY; ++ ++ atomic_dec(&map->nr_free); ++ return pid; ++} ++ + static int next_pidmap(struct pid_namespace *pid_ns, unsigned int last) + { + int offset; +@@ -201,6 +234,7 @@ + } + return -1; + } ++EXPORT_SYMBOL_GPL(alloc_pidmap); + + fastcall void put_pid(struct pid *pid) + { +@@ -229,25 +263,34 @@ + /* We can be called with write_lock_irq(&tasklist_lock) held */ + int i; + unsigned long flags; ++ struct upid *upid; + + spin_lock_irqsave(&pidmap_lock, flags); +- for (i = 0; i <= pid->level; i++) +- hlist_del_rcu(&pid->numbers[i].pid_chain); +- spin_unlock_irqrestore(&pidmap_lock, flags); ++ for (i = 0; i <= pid->level; i++) { ++ upid = &pid->numbers[i]; ++ if (!hlist_unhashed(&upid->pid_chain)) ++ hlist_del_rcu(&upid->pid_chain); ++ } ++ spin_unlock(&pidmap_lock); ++ ub_kmemsize_uncharge(pid->ub, CHARGE_SIZE(pid->numbers[pid->level].ns-> ++ pid_cachep->objuse)); ++ local_irq_restore(flags); + + for (i = 0; i <= pid->level; i++) + free_pidmap(pid->numbers[i].ns, pid->numbers[i].nr); +- ++ put_beancounter(pid->ub); + call_rcu(&pid->rcu, delayed_put_pid); + } ++EXPORT_SYMBOL_GPL(free_pid); + +-struct pid *alloc_pid(struct pid_namespace *ns) ++struct pid *alloc_pid(struct pid_namespace *ns, pid_t vpid) + { + struct pid *pid; + enum pid_type type; + int i, nr; + struct pid_namespace *tmp; + struct upid *upid; ++ struct user_beancounter *ub; + + pid = kmem_cache_alloc(ns->pid_cachep, GFP_KERNEL); + if (!pid) +@@ -255,7 +298,10 @@ + + tmp = ns; + for (i = ns->level; i >= 0; i--) { +- nr = alloc_pidmap(tmp); ++ if (vpid != 0 && i == ns->level) ++ nr = set_pidmap(tmp, vpid); ++ else ++ nr = alloc_pidmap(tmp); + if (nr < 0) + goto out_free; + +@@ -270,17 +316,32 @@ + for (type = 0; type < PIDTYPE_MAX; ++type) + INIT_HLIST_HEAD(&pid->tasks[type]); + ++ local_irq_disable(); ++#ifdef CONFIG_BEANCOUNTERS ++ ub = get_exec_ub(); ++ if (ub_kmemsize_charge(ub, CHARGE_SIZE(ns->pid_cachep->objuse), UB_HARD)) ++ goto out_enable; ++ pid->ub = get_beancounter(ub); ++ spin_lock(&pidmap_lock); ++#else + spin_lock_irq(&pidmap_lock); ++#endif + for (i = ns->level; i >= 0; i--) { + upid = &pid->numbers[i]; + hlist_add_head_rcu(&upid->pid_chain, + &pid_hash[pid_hashfn(upid->nr, upid->ns)]); ++ if (upid->ns->flags & PID_NS_HIDDEN) ++ while (i--) ++ INIT_HLIST_NODE(&pid->numbers[i].pid_chain); + } + spin_unlock_irq(&pidmap_lock); + + out: + return pid; + ++out_enable: ++ local_irq_enable(); ++ put_pid_ns(ns); + out_free: + for (i++; i <= ns->level; i++) + free_pidmap(pid->numbers[i].ns, pid->numbers[i].nr); +@@ -289,6 +350,7 @@ + pid = NULL; + goto out; + } ++EXPORT_SYMBOL_GPL(alloc_pid); + + struct pid * fastcall find_pid_ns(int nr, struct pid_namespace *ns) + { +@@ -331,6 +393,7 @@ + + return 0; + } ++EXPORT_SYMBOL_GPL(attach_pid); + + void fastcall detach_pid(struct task_struct *task, enum pid_type type) + { +@@ -350,6 +413,7 @@ + + free_pid(pid); + } ++EXPORT_SYMBOL_GPL(detach_pid); + + /* transfer_pid is an optimization of attach_pid(new), detach_pid(old) */ + void fastcall transfer_pid(struct task_struct *old, struct task_struct *new, +@@ -371,6 +435,7 @@ + } + return result; + } ++EXPORT_SYMBOL_GPL(pid_task); + + /* + * Must be called under rcu_read_lock() or with tasklist_lock read-held. +@@ -562,6 +627,7 @@ + ns->last_pid = 0; + ns->child_reaper = NULL; + ns->level = level; ++ ns->flags = 0; + + set_bit(0, ns->pidmap[0].page); + atomic_set(&ns->pidmap[0].nr_free, BITS_PER_PAGE - 1); +@@ -627,6 +693,197 @@ + } + #endif /* CONFIG_PID_NS */ + ++/* ++ * this is a dirty ugly hack. ++ */ ++ ++static void reattach_pid(struct task_struct *tsk, enum pid_type type, ++ struct pid *pid) ++{ ++ int i; ++ struct pid *old_pid; ++ struct pid_link *link; ++ struct upid *upid; ++ ++ link = &tsk->pids[type]; ++ old_pid = link->pid; ++ ++ hlist_del_rcu(&link->node); ++ link->pid = pid; ++ hlist_add_head_rcu(&link->node, &pid->tasks[type]); ++ ++ if (type != PIDTYPE_PID) { ++ for (i = PIDTYPE_MAX; --i >= 0; ) ++ if (!hlist_empty(&old_pid->tasks[i])) ++ return; ++ ++ for (i = 0; i < pid->level; i++) ++ hlist_del_rcu(&old_pid->numbers[i].pid_chain); ++ } else { ++ for (i = PIDTYPE_MAX; --i >= 0; ) ++ if (!hlist_empty(&old_pid->tasks[i])) ++ BUG(); ++ ++ for (i = 0; i < pid->level; i++) ++ hlist_replace_rcu(&old_pid->numbers[i].pid_chain, ++ &pid->numbers[i].pid_chain); ++ ++ upid = &pid->numbers[pid->level]; ++ hlist_add_head_rcu(&upid->pid_chain, ++ &pid_hash[pid_hashfn(upid->nr, upid->ns)]); ++ } ++ ++ call_rcu(&old_pid->rcu, delayed_put_pid); ++} ++ ++static int __pid_ns_attach_task(struct pid_namespace *ns, ++ struct task_struct *tsk, pid_t nr) ++{ ++ struct pid *pid; ++ enum pid_type type; ++ unsigned long old_size, new_size; ++ ++ pid = kmem_cache_alloc(ns->pid_cachep, GFP_KERNEL); ++ if (!pid) ++ goto out; ++ ++ if (nr == 0) ++ nr = alloc_pidmap(ns); ++ else ++ nr = set_pidmap(ns, nr); ++ ++ if (nr < 0) ++ goto out_free; ++ ++ memcpy(pid, task_pid(tsk), ++ sizeof(struct pid) + (ns->level - 1) * sizeof(struct upid)); ++ get_pid_ns(ns); ++ pid->level++; ++ BUG_ON(pid->level != ns->level); ++ pid->numbers[pid->level].nr = nr; ++ pid->numbers[pid->level].ns = ns; ++ atomic_set(&pid->count, 1); ++ for (type = 0; type < PIDTYPE_MAX; ++type) ++ INIT_HLIST_HEAD(&pid->tasks[type]); ++ ++ old_size = pid->numbers[pid->level - 1].ns->pid_cachep->objuse; ++ new_size = pid->numbers[pid->level].ns->pid_cachep->objuse; ++ local_irq_disable(); ++ /* ++ * Depending on sizeof(struct foo), cache flags (redzoning, etc) ++ * and actual CPU (cacheline_size() jump from 64 to 128 bytes after ++ * CPU detection) new size can very well be smaller than old size. ++ */ ++ if (new_size > old_size) { ++ if (ub_kmemsize_charge(pid->ub, new_size - old_size, UB_HARD) < 0) ++ goto out_enable; ++ } else ++ ub_kmemsize_uncharge(pid->ub, old_size - new_size); ++ ++ write_lock(&tasklist_lock); ++ ++ spin_lock(&pidmap_lock); ++ reattach_pid(tsk, PIDTYPE_SID, pid); ++ set_task_session(tsk, pid_nr(pid)); ++ reattach_pid(tsk, PIDTYPE_PGID, pid); ++ tsk->signal->__pgrp = pid_nr(pid); ++ current->signal->tty_old_pgrp = NULL; ++ ++ reattach_pid(tsk, PIDTYPE_PID, pid); ++ spin_unlock(&pidmap_lock); ++ ++ write_unlock_irq(&tasklist_lock); ++ ++ return 0; ++ ++out_enable: ++ local_irq_enable(); ++ put_pid_ns(ns); ++out_free: ++ kmem_cache_free(ns->pid_cachep, pid); ++out: ++ return -ENOMEM; ++} ++ ++int pid_ns_attach_task(struct pid_namespace *ns, struct task_struct *tsk) ++{ ++ return __pid_ns_attach_task(ns, tsk, 0); ++} ++EXPORT_SYMBOL_GPL(pid_ns_attach_task); ++ ++int pid_ns_attach_init(struct pid_namespace *ns, struct task_struct *tsk) ++{ ++ int err; ++ ++ err = __pid_ns_attach_task(ns, tsk, 1); ++ if (err < 0) ++ return err; ++ ++ ns->child_reaper = tsk; ++ return 0; ++} ++EXPORT_SYMBOL_GPL(pid_ns_attach_init); ++ ++#ifdef CONFIG_VE ++static noinline void show_lost_task(struct task_struct *p) ++{ ++ extern char * task_sig(struct task_struct *p, char *buffer); ++ char buf[512]; ++ ++ task_sig(p, buf); ++ printk("Lost task: %d/%s/%p\nSignals:%s\n", p->pid, p->comm, p, buf); ++} ++ ++static void zap_ve_processes(struct ve_struct *env) ++{ ++ /* ++ * Here the VE changes its state into "not running". ++ * op_sem taken for write is a barrier to all VE manipulations from ++ * ioctl: it waits for operations currently in progress and blocks all ++ * subsequent operations until is_running is set to 0 and op_sem is ++ * released. ++ */ ++ down_write(&env->op_sem); ++ env->is_running = 0; ++ up_write(&env->op_sem); ++ ++ /* wait for all init childs exit */ ++ while (atomic_read(&env->pcounter) > 1) { ++ struct task_struct *g, *p; ++ long delay = 1; ++ ++ if (sys_wait4(-1, NULL, __WALL | WNOHANG, NULL) > 0) ++ continue; ++ /* it was ENOCHLD or no more children somehow */ ++ if (atomic_read(&env->pcounter) == 1) ++ break; ++ ++ /* clear all signals to avoid wakeups */ ++ if (signal_pending(current)) ++ flush_signals(current); ++ /* we have child without signal sent */ ++ __set_current_state(TASK_INTERRUPTIBLE); ++ schedule_timeout(delay); ++ delay = (delay < HZ) ? (delay << 1) : HZ; ++ read_lock(&tasklist_lock); ++ do_each_thread_ve(g, p) { ++ if (p != current) { ++ /* ++ * by that time no processes other then entered ++ * may exist in the VE. if some were missed by ++ * zap_pid_ns_processes() this was a BUG ++ */ ++ if (!p->did_ve_enter) ++ show_lost_task(p); ++ ++ force_sig_specific(SIGKILL, p); ++ } ++ } while_each_thread_ve(g, p); ++ read_unlock(&tasklist_lock); ++ } ++} ++#endif ++ + void zap_pid_ns_processes(struct pid_namespace *pid_ns) + { + int nr; +@@ -658,12 +915,25 @@ + rc = sys_wait4(-1, NULL, __WALL, NULL); + } while (rc != -ECHILD); + +- ++#ifdef CONFIG_VE ++ zap_ve_processes(get_exec_env()); ++#endif + /* Child reaper for the pid namespace is going away */ + pid_ns->child_reaper = NULL; + return; + } + ++pid_t pid_to_vpid(pid_t nr) ++{ ++ struct pid *pid; ++ ++ pid = find_pid(nr); ++ if (pid) ++ return pid->numbers[pid->level].nr; ++ return -1; ++} ++EXPORT_SYMBOL_GPL(pid_to_vpid); ++ + /* + * The pid hash table is scaled according to the amount of memory in the + * machine. From a minimum of 16 slots up to 4096 slots at one gigabyte or +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/posix-cpu-timers.c debian/binary-custom.d/openvz/src/kernel/posix-cpu-timers.c +--- ./kernel/posix-cpu-timers.c 2012-06-12 16:25:24.254312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/posix-cpu-timers.c 2012-11-13 15:20:15.396569067 +0000 +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + + static int check_clock(const clockid_t which_clock) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/posix-timers.c debian/binary-custom.d/openvz/src/kernel/posix-timers.c +--- ./kernel/posix-timers.c 2012-06-12 16:25:24.254312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/posix-timers.c 2012-11-13 15:20:15.396569067 +0000 +@@ -31,6 +31,8 @@ + * POSIX clocks & timers + */ + #include ++#include ++#include + #include + #include + #include +@@ -47,6 +49,9 @@ + #include + #include + #include ++#include ++ ++#include + + /* + * Management arrays for POSIX timers. Timers are kept in slab memory +@@ -241,8 +246,8 @@ + register_posix_clock(CLOCK_MONOTONIC, &clock_monotonic); + + posix_timers_cache = kmem_cache_create("posix_timers_cache", +- sizeof (struct k_itimer), 0, SLAB_PANIC, +- NULL); ++ sizeof (struct k_itimer), 0, ++ SLAB_PANIC|SLAB_UBC, NULL); + idr_init(&posix_timers_id); + return 0; + } +@@ -298,6 +303,13 @@ + + int posix_timer_event(struct k_itimer *timr,int si_private) + { ++ int ret; ++ struct ve_struct *ve; ++ struct user_beancounter *ub; ++ ++ ve = set_exec_env(timr->it_process->ve_task_info.owner_env); ++ ub = set_exec_ub(timr->it_process->task_bc.task_ub); ++ + memset(&timr->sigq->info, 0, sizeof(siginfo_t)); + timr->sigq->info.si_sys_private = si_private; + /* Send signal to the process that owns this timer.*/ +@@ -310,11 +322,11 @@ + + if (timr->it_sigev_notify & SIGEV_THREAD_ID) { + struct task_struct *leader; +- int ret = send_sigqueue(timr->it_sigev_signo, timr->sigq, ++ ret = send_sigqueue(timr->it_sigev_signo, timr->sigq, + timr->it_process); + + if (likely(ret >= 0)) +- return ret; ++ goto out; + + timr->it_sigev_notify = SIGEV_SIGNAL; + leader = timr->it_process->group_leader; +@@ -322,8 +334,12 @@ + timr->it_process = leader; + } + +- return send_group_sigqueue(timr->it_sigev_signo, timr->sigq, ++ ret = send_group_sigqueue(timr->it_sigev_signo, timr->sigq, + timr->it_process); ++out: ++ (void)set_exec_ub(ub); ++ (void)set_exec_env(ve); ++ return ret; + } + EXPORT_SYMBOL_GPL(posix_timer_event); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/power/process.c debian/binary-custom.d/openvz/src/kernel/power/process.c +--- ./kernel/power/process.c 2012-06-12 16:25:24.258312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/power/process.c 2012-11-13 15:20:15.396569067 +0000 +@@ -14,6 +14,8 @@ + #include + #include + ++static atomic_t global_suspend = ATOMIC_INIT(0); ++ + /* + * Timeout for stopping processes + */ +@@ -26,7 +28,9 @@ + { + if ((p == current) || + (p->flags & PF_NOFREEZE) || +- (p->exit_state != 0)) ++ (p->exit_state != 0) || ++ (p->state == TASK_STOPPED) || ++ (p->state == TASK_TRACED)) + return 0; + return 1; + } +@@ -50,6 +54,24 @@ + processes around? */ + long save; + ++#if defined(CONFIG_VZ_CHECKPOINT) || defined(CONFIG_VZ_CHECKPOINT_MODULE) ++ save = current->state; ++ current->state = TASK_UNINTERRUPTIBLE; ++ ++ spin_lock_irq(¤t->sighand->siglock); ++ if (test_and_clear_thread_flag(TIF_FREEZE)) { ++ recalc_sigpending(); /* We sent fake signal, clean it up */ ++ current->flags |= PF_FROZEN; ++ } else { ++ /* Freeze request could be canceled before we entered ++ * refrigerator(). In this case we do nothing. */ ++ current->state = save; ++ } ++ spin_unlock_irq(¤t->sighand->siglock); ++ ++ while (current->flags & PF_FROZEN) ++ schedule(); ++#else + task_lock(current); + if (freezing(current)) { + frozen_process(); +@@ -71,6 +93,7 @@ + break; + schedule(); + } ++#endif + pr_debug("%s left refrigerator\n", current->comm); + __set_current_state(save); + } +@@ -178,7 +201,7 @@ + do { + todo = 0; + read_lock(&tasklist_lock); +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + if (frozen(p) || !freezeable(p)) + continue; + +@@ -192,7 +215,7 @@ + + if (!freezer_should_skip(p)) + todo++; +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + read_unlock(&tasklist_lock); + yield(); /* Yield is okay here */ + if (time_after(jiffies, end_time)) +@@ -216,13 +239,13 @@ + elapsed_csecs / 100, elapsed_csecs % 100, todo); + show_state(); + read_lock(&tasklist_lock); +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + task_lock(p); + if (freezing(p) && !freezer_should_skip(p)) + printk(KERN_ERR " %s\n", p->comm); + cancel_freezing(p); + task_unlock(p); +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + read_unlock(&tasklist_lock); + } else { + printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100, +@@ -239,6 +262,7 @@ + { + int error; + ++ atomic_inc(&global_suspend); + printk("Freezing user space processes ... "); + error = try_to_freeze_tasks(FREEZER_USER_SPACE); + if (error) +@@ -253,6 +277,7 @@ + Exit: + BUG_ON(in_atomic()); + printk("\n"); ++ atomic_dec(&global_suspend); + return error; + } + +@@ -261,15 +286,17 @@ + struct task_struct *g, *p; + + read_lock(&tasklist_lock); +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + if (!freezeable(p)) + continue; + + if (!p->mm == thaw_user_space) + continue; + +- thaw_process(p); +- } while_each_thread(g, p); ++ if (!thaw_process(p)) ++ printk(KERN_WARNING " Strange, %s not stopped\n", ++ p->comm ); ++ } while_each_thread_all(g, p); + read_unlock(&tasklist_lock); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/printk.c debian/binary-custom.d/openvz/src/kernel/printk.c +--- ./kernel/printk.c 2012-06-12 16:25:24.258312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/printk.c 2012-11-13 15:20:15.400569066 +0000 +@@ -31,7 +31,9 @@ + #include + #include + #include ++#include + #include ++#include + #include + + #include +@@ -54,6 +56,9 @@ + DEFAULT_CONSOLE_LOGLEVEL, /* default_console_loglevel */ + }; + ++struct printk_aligned printk_no_wake_var[NR_CPUS]; ++EXPORT_SYMBOL(printk_no_wake_var); ++ + /* + * Low level drivers may need that to know if they can schedule in + * their unblank() callback or not. So let's export it. +@@ -84,7 +89,7 @@ + * It is also used in interesting ways to provide interlocking in + * release_console_sem(). + */ +-static DEFINE_SPINLOCK(logbuf_lock); ++DEFINE_SPINLOCK(logbuf_lock); + + #define LOG_BUF_MASK (log_buf_len-1) + #define LOG_BUF(idx) (log_buf[(idx) & LOG_BUF_MASK]) +@@ -115,6 +120,7 @@ + + /* Flag: console code may call schedule() */ + static int console_may_schedule; ++int console_silence_loglevel; + + #ifdef CONFIG_PRINTK + +@@ -123,6 +129,19 @@ + static int log_buf_len = __LOG_BUF_LEN; + static unsigned long logged_chars; /* Number of chars produced since last read+clear operation */ + ++static int __init setup_console_silencelevel(char *str) ++{ ++ int level; ++ ++ if (get_option(&str, &level) != 1) ++ return 0; ++ ++ console_silence_loglevel = level; ++ return 1; ++} ++ ++__setup("silencelevel=", setup_console_silencelevel); ++ + static int __init log_buf_len_setup(char *str) + { + unsigned long size = memparse(str, &str); +@@ -293,6 +312,9 @@ + char c; + int error = 0; + ++ if (!ve_is_super(get_exec_env()) && (type == 6 || type == 7)) ++ goto out; ++ + error = security_syslog(type); + if (error) + return error; +@@ -313,15 +335,15 @@ + error = -EFAULT; + goto out; + } +- error = wait_event_interruptible(log_wait, +- (log_start - log_end)); ++ error = wait_event_interruptible(ve_log_wait, ++ (ve_log_start - ve_log_end)); + if (error) + goto out; + i = 0; + spin_lock_irq(&logbuf_lock); +- while (!error && (log_start != log_end) && i < len) { +- c = LOG_BUF(log_start); +- log_start++; ++ while (!error && (ve_log_start != ve_log_end) && i < len) { ++ c = VE_LOG_BUF(ve_log_start); ++ ve_log_start++; + spin_unlock_irq(&logbuf_lock); + error = __put_user(c,buf); + buf++; +@@ -347,15 +369,17 @@ + error = -EFAULT; + goto out; + } ++ if (ve_log_buf == NULL) ++ goto out; + count = len; +- if (count > log_buf_len) +- count = log_buf_len; ++ if (count > ve_log_buf_len) ++ count = ve_log_buf_len; + spin_lock_irq(&logbuf_lock); +- if (count > logged_chars) +- count = logged_chars; ++ if (count > ve_logged_chars) ++ count = ve_logged_chars; + if (do_clear) +- logged_chars = 0; +- limit = log_end; ++ ve_logged_chars = 0; ++ limit = ve_log_end; + /* + * __put_user() could sleep, and while we sleep + * printk() could overwrite the messages +@@ -364,9 +388,9 @@ + */ + for (i = 0; i < count && !error; i++) { + j = limit-1-i; +- if (j + log_buf_len < log_end) ++ if (j + ve_log_buf_len < ve_log_end) + break; +- c = LOG_BUF(j); ++ c = VE_LOG_BUF(j); + spin_unlock_irq(&logbuf_lock); + error = __put_user(c,&buf[count-1-i]); + cond_resched(); +@@ -390,7 +414,7 @@ + } + break; + case 5: /* Clear ring buffer */ +- logged_chars = 0; ++ ve_logged_chars = 0; + break; + case 6: /* Disable logging to console */ + console_loglevel = minimum_console_loglevel; +@@ -402,16 +426,19 @@ + error = -EINVAL; + if (len < 1 || len > 8) + goto out; ++ error = 0; ++ /* VE has no console, so return success */ ++ if (!ve_is_super(get_exec_env())) ++ goto out; + if (len < minimum_console_loglevel) + len = minimum_console_loglevel; + console_loglevel = len; +- error = 0; + break; + case 9: /* Number of chars in the log buffer */ +- error = log_end - log_start; ++ error = ve_log_end - ve_log_start; + break; + case 10: /* Size of the log buffer */ +- error = log_buf_len; ++ error = ve_log_buf_len; + break; + default: + error = -EINVAL; +@@ -522,16 +549,18 @@ + + static void emit_log_char(char c) + { +- LOG_BUF(log_end) = c; +- log_end++; +- if (log_end - log_start > log_buf_len) +- log_start = log_end - log_buf_len; +- if (log_end - con_start > log_buf_len) +- con_start = log_end - log_buf_len; +- if (logged_chars < log_buf_len) +- logged_chars++; ++ VE_LOG_BUF(ve_log_end) = c; ++ ve_log_end++; ++ if (ve_log_end - ve_log_start > ve_log_buf_len) ++ ve_log_start = ve_log_end - ve_log_buf_len; ++ if (ve_is_super(get_exec_env()) && ve_log_end - con_start > ve_log_buf_len) ++ con_start = ve_log_end - ve_log_buf_len; ++ if (ve_logged_chars < ve_log_buf_len) ++ ve_logged_chars++; + } + ++static unsigned long do_release_console_sem(unsigned long *flags); ++ + /* + * Zap console related locks when oopsing. Only zap at most once + * every 10 seconds, to leave time for slow consoles to print a +@@ -613,6 +642,30 @@ + * printf(3) + */ + ++static inline int ve_log_init(void) ++{ ++#ifdef CONFIG_VE ++ if (ve_log_buf != NULL) ++ return 0; ++ ++ if (ve_is_super(get_exec_env())) { ++ ve0._log_wait = &log_wait; ++ ve0._log_start = &log_start; ++ ve0._log_end = &log_end; ++ ve0._logged_chars = &logged_chars; ++ ve0.log_buf = log_buf; ++ return 0; ++ } ++ ++ ve_log_buf = kmalloc(ve_log_buf_len, GFP_ATOMIC); ++ if (!ve_log_buf) ++ return -ENOMEM; ++ ++ memset(ve_log_buf, 0, ve_log_buf_len); ++#endif ++ return 0; ++} ++ + asmlinkage int printk(const char *fmt, ...) + { + va_list args; +@@ -628,13 +681,14 @@ + /* cpu currently holding logbuf_lock */ + static volatile unsigned int printk_cpu = UINT_MAX; + +-asmlinkage int vprintk(const char *fmt, va_list args) ++asmlinkage int __vprintk(const char *fmt, va_list args) + { + unsigned long flags; + int printed_len; + char *p; + static char printk_buf[1024]; + static int log_level_unknown = 1; ++ int err, need_wake; + + boot_delay_msec(); + +@@ -650,6 +704,12 @@ + spin_lock(&logbuf_lock); + printk_cpu = smp_processor_id(); + ++ err = ve_log_init(); ++ if (err) { ++ spin_unlock_irqrestore(&logbuf_lock, flags); ++ return err; ++ } ++ + /* Emit the output into the temporary buffer */ + printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args); + +@@ -710,7 +770,26 @@ + log_level_unknown = 1; + } + +- if (!down_trylock(&console_sem)) { ++ if (!ve_is_super(get_exec_env())) { ++ need_wake = (ve_log_start != ve_log_end); ++ spin_unlock_irqrestore(&logbuf_lock, flags); ++ if (!oops_in_progress && need_wake) ++ wake_up_interruptible(&ve_log_wait); ++ } else if (__printk_no_wake) { ++ /* ++ * A difficult case, created by the console semaphore mess... ++ * All wakeups are omitted. ++ */ ++ if (!atomic_add_negative(-1, &console_sem.count)) { ++ console_locked = 1; ++ console_may_schedule = 0; ++ do_release_console_sem(&flags); ++ console_locked = 0; ++ console_may_schedule = 0; ++ } ++ atomic_inc(&console_sem.count); ++ spin_unlock_irqrestore(&logbuf_lock, flags); ++ } else if (!down_trylock(&console_sem)) { + /* + * We own the drivers. We can drop the spinlock and + * let release_console_sem() print the text, maybe ... +@@ -753,6 +832,63 @@ + EXPORT_SYMBOL(printk); + EXPORT_SYMBOL(vprintk); + ++static struct timer_list conswakeup_timer; ++static void conswakeup_timer_call(unsigned long dumy) ++{ ++ if (!down_trylock(&console_sem)) { ++ console_locked = 1; ++ console_may_schedule = 0; ++ release_console_sem(); ++ } ++ mod_timer(&conswakeup_timer, jiffies + 5 * HZ); ++} ++ ++static int __init conswakeup_init(void) ++{ ++ init_timer(&conswakeup_timer); ++ conswakeup_timer.function = &conswakeup_timer_call; ++ conswakeup_timer.expires = jiffies + 5 * HZ; ++ add_timer(&conswakeup_timer); ++ return 0; ++} ++console_initcall(conswakeup_init); ++ ++asmlinkage int vprintk(const char *fmt, va_list args) ++{ ++ int i; ++ struct ve_struct *env; ++ ++ env = set_exec_env(get_ve0()); ++ i = __vprintk(fmt, args); ++ (void)set_exec_env(env); ++ return i; ++} ++ ++asmlinkage int ve_vprintk(int dst, const char *fmt, va_list args) ++{ ++ int printed_len; ++ ++ printed_len = 0; ++ if (ve_is_super(get_exec_env()) || (dst & VE0_LOG)) ++ printed_len = vprintk(fmt, args); ++ if (!ve_is_super(get_exec_env()) && (dst & VE_LOG)) ++ printed_len = __vprintk(fmt, args); ++ return printed_len; ++} ++ ++asmlinkage int ve_printk(int dst, const char *fmt, ...) ++{ ++ va_list args; ++ int printed_len; ++ ++ va_start(args, fmt); ++ printed_len = ve_vprintk(dst, fmt, args); ++ va_end(args); ++ return printed_len; ++} ++EXPORT_SYMBOL(ve_printk); ++ ++ + #else + + asmlinkage long sys_syslog(int type, char __user *buf, int len) +@@ -950,21 +1086,19 @@ + * + * release_console_sem() may be called from any context. + */ +-void release_console_sem(void) ++static unsigned long do_release_console_sem(unsigned long *flags) + { +- unsigned long flags; + unsigned long _con_start, _log_end; + unsigned long wake_klogd = 0; + + if (console_suspended) { + up(&secondary_console_sem); +- return; ++ goto out; + } + + console_may_schedule = 0; + + for ( ; ; ) { +- spin_lock_irqsave(&logbuf_lock, flags); + wake_klogd |= log_start - log_end; + if (con_start == log_end) + break; /* Nothing to print */ +@@ -973,8 +1107,19 @@ + con_start = log_end; /* Flush */ + spin_unlock(&logbuf_lock); + call_console_drivers(_con_start, _log_end); +- local_irq_restore(flags); ++ spin_lock(&logbuf_lock); + } ++out: ++ return wake_klogd; ++} ++ ++void release_console_sem(void) ++{ ++ unsigned long flags; ++ unsigned long wake_klogd; ++ ++ spin_lock_irqsave(&logbuf_lock, flags); ++ wake_klogd = do_release_console_sem(&flags); + console_locked = 0; + up(&console_sem); + spin_unlock_irqrestore(&logbuf_lock, flags); +@@ -1285,6 +1430,36 @@ + } + EXPORT_SYMBOL(printk_ratelimit); + ++/* ++ * Rate limiting stuff. ++ */ ++int vz_ratelimit(struct vz_rate_info *p) ++{ ++ unsigned long cjif, djif; ++ unsigned long flags; ++ static spinlock_t ratelimit_lock = SPIN_LOCK_UNLOCKED; ++ long new_bucket; ++ ++ spin_lock_irqsave(&ratelimit_lock, flags); ++ cjif = jiffies; ++ djif = cjif - p->last; ++ if (djif < p->interval) { ++ if (p->bucket >= p->burst) { ++ spin_unlock_irqrestore(&ratelimit_lock, flags); ++ return 0; ++ } ++ p->bucket++; ++ } else { ++ new_bucket = p->bucket - (djif / (unsigned)p->interval); ++ if (new_bucket < 0) ++ new_bucket = 0; ++ p->bucket = new_bucket + 1; ++ } ++ p->last = cjif; ++ spin_unlock_irqrestore(&ratelimit_lock, flags); ++ return 1; ++} ++ + /** + * printk_timed_ratelimit - caller-controlled printk ratelimiting + * @caller_jiffies: pointer to caller's state +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ptrace.c debian/binary-custom.d/openvz/src/kernel/ptrace.c +--- ./kernel/ptrace.c 2012-06-12 16:25:24.258312488 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ptrace.c 2012-11-13 15:20:15.408569063 +0000 +@@ -131,6 +131,8 @@ + * or halting the specified task is impossible. + */ + int dumpable = 0; ++ int vps_dumpable = 0; ++ + /* Don't let security modules deny introspection */ + if (task == current) + return 0; +@@ -142,11 +144,17 @@ + (current->gid != task->gid)) && !capable(CAP_SYS_PTRACE)) + return -EPERM; + smp_rmb(); +- if (task->mm) ++ if (task->mm) { + dumpable = get_dumpable(task->mm); ++ vps_dumpable = (task->mm->vps_dumpable == 1); ++ } ++ + if (!dumpable && !capable(CAP_SYS_PTRACE)) + return -EPERM; +- ++ if (!vps_dumpable && !ve_is_super(get_exec_env())) ++ return -EPERM; ++ if (!ve_accessible(VE_TASK_INFO(task)->owner_env, get_exec_env())) ++ return -EPERM; + return security_ptrace(current, task); + } + +@@ -199,6 +207,8 @@ + retval = __ptrace_may_attach(task); + if (retval) + goto bad; ++ if (task->mm->vps_dumpable == 2) ++ goto bad; + + /* Go */ + task->ptrace |= PT_PTRACED | ((task->real_parent != current) +@@ -294,6 +304,7 @@ + } + return copied; + } ++EXPORT_SYMBOL_GPL(access_process_vm); + + static int ptrace_setoptions(struct task_struct *child, long data) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/sched.c debian/binary-custom.d/openvz/src/kernel/sched.c +--- ./kernel/sched.c 2012-06-12 16:25:24.266312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/sched.c 2012-11-13 15:20:15.412569064 +0000 +@@ -63,6 +63,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -208,6 +209,8 @@ + #elif defined(CONFIG_FAIR_CGROUP_SCHED) + tg = container_of(task_subsys_state(p, cpu_cgroup_subsys_id), + struct task_group, css); ++#elif defined(CONFIG_VZ_FAIRSCHED) ++ tg = p->fsched_node->tg; + #else + tg = &init_task_group; + #endif +@@ -310,6 +313,9 @@ + */ + unsigned long nr_uninterruptible; + ++ unsigned long nr_sleeping; ++ unsigned long nr_stopped; ++ + struct task_struct *curr, *idle; + unsigned long next_balance; + struct mm_struct *prev_mm; +@@ -379,6 +385,13 @@ + #endif + } + ++DEFINE_PER_CPU_STATIC(struct kstat_lat_pcpu_snap_struct, kstat_lat); ++struct kernel_stat_glob kstat_glob; ++ ++DEFINE_SPINLOCK(kstat_glb_lock); ++EXPORT_SYMBOL(kstat_glob); ++EXPORT_SYMBOL(kstat_glb_lock); ++ + /* + * Update the per-runqueue clock, as finegrained as the platform can give + * us, but without assuming monotonicity, etc.: +@@ -631,6 +644,217 @@ + spin_unlock_irqrestore(&rq->lock, *flags); + } + ++#ifdef CONFIG_VE ++static inline void ve_nr_iowait_inc(struct ve_struct *ve, int cpu) ++{ ++ VE_CPU_STATS(ve, cpu)->nr_iowait++; ++} ++ ++static inline void ve_nr_iowait_dec(struct ve_struct *ve, int cpu) ++{ ++ VE_CPU_STATS(ve, cpu)->nr_iowait--; ++} ++ ++static inline void ve_nr_unint_inc(struct ve_struct *ve, int cpu) ++{ ++ VE_CPU_STATS(ve, cpu)->nr_unint++; ++} ++ ++static inline void ve_nr_unint_dec(struct ve_struct *ve, int cpu) ++{ ++ VE_CPU_STATS(ve, cpu)->nr_unint--; ++} ++ ++#define cycles_after(a, b) ((long long)(b) - (long long)(a) < 0) ++ ++cycles_t ve_sched_get_idle_time(struct ve_struct *ve, int cpu) ++{ ++ struct ve_cpu_stats *ve_stat; ++ unsigned v; ++ cycles_t strt, ret, cycles; ++ ++ ve_stat = VE_CPU_STATS(ve, cpu); ++ do { ++ v = read_seqcount_begin(&ve_stat->stat_lock); ++ ret = ve_stat->idle_time; ++ strt = ve_stat->strt_idle_time; ++ if (strt && nr_uninterruptible_ve(ve) == 0) { ++ cycles = get_cycles(); ++ if (cycles_after(cycles, strt)) ++ ret += cycles - strt; ++ } ++ } while (read_seqcount_retry(&ve_stat->stat_lock, v)); ++ return ret; ++} ++EXPORT_SYMBOL(ve_sched_get_idle_time); ++ ++cycles_t ve_sched_get_iowait_time(struct ve_struct *ve, int cpu) ++{ ++ struct ve_cpu_stats *ve_stat; ++ unsigned v; ++ cycles_t strt, ret, cycles; ++ ++ ve_stat = VE_CPU_STATS(ve, cpu); ++ do { ++ v = read_seqcount_begin(&ve_stat->stat_lock); ++ ret = ve_stat->iowait_time; ++ strt = ve_stat->strt_idle_time; ++ if (strt && nr_iowait_ve(ve) > 0) { ++ cycles = get_cycles(); ++ if (cycles_after(cycles, strt)) ++ ret += cycles - strt; ++ } ++ } while (read_seqcount_retry(&ve_stat->stat_lock, v)); ++ return ret; ++} ++EXPORT_SYMBOL(ve_sched_get_iowait_time); ++ ++static void ve_stop_idle(struct ve_struct *ve, unsigned int cpu, cycles_t cycles) ++{ ++ struct ve_cpu_stats *ve_stat; ++ ++ ve_stat = VE_CPU_STATS(ve, cpu); ++ ++ write_seqcount_begin(&ve_stat->stat_lock); ++ if (ve_stat->strt_idle_time) { ++ if (cycles_after(cycles, ve_stat->strt_idle_time)) { ++ if (nr_iowait_ve(ve) == 0) ++ ve_stat->idle_time += ++ cycles - ve_stat->strt_idle_time; ++ else ++ ve_stat->iowait_time += ++ cycles - ve_stat->strt_idle_time; ++ } ++ ve_stat->strt_idle_time = 0; ++ } ++ write_seqcount_end(&ve_stat->stat_lock); ++} ++ ++static void ve_strt_idle(struct ve_struct *ve, unsigned int cpu, cycles_t cycles) ++{ ++ struct ve_cpu_stats *ve_stat; ++ ++ ve_stat = VE_CPU_STATS(ve, cpu); ++ ++ write_seqcount_begin(&ve_stat->stat_lock); ++ ve_stat->strt_idle_time = cycles; ++ write_seqcount_end(&ve_stat->stat_lock); ++} ++ ++static inline void ve_nr_running_inc(struct ve_struct *ve, int cpu, cycles_t cycles) ++{ ++ if (++VE_CPU_STATS(ve, cpu)->nr_running == 1) ++ ve_stop_idle(ve, cpu, cycles); ++} ++ ++static inline void ve_nr_running_dec(struct ve_struct *ve, int cpu, cycles_t cycles) ++{ ++ if (--VE_CPU_STATS(ve, cpu)->nr_running == 0) ++ ve_strt_idle(ve, cpu, cycles); ++} ++ ++void ve_sched_attach(struct ve_struct *target_ve) ++{ ++ struct task_struct *tsk; ++ unsigned int cpu; ++ cycles_t cycles; ++ ++ tsk = current; ++ preempt_disable(); ++ cycles = get_cycles(); ++ cpu = task_cpu(tsk); ++ ve_nr_running_dec(VE_TASK_INFO(tsk)->owner_env, cpu, cycles); ++ ve_nr_running_inc(target_ve, cpu, cycles); ++ preempt_enable(); ++} ++EXPORT_SYMBOL(ve_sched_attach); ++ ++static inline void write_wakeup_stamp(struct task_struct *p, cycles_t cyc) ++{ ++ struct ve_task_info *ti; ++ ++ ti = VE_TASK_INFO(p); ++ write_seqcount_begin(&ti->wakeup_lock); ++ ti->wakeup_stamp = cyc; ++ write_seqcount_end(&ti->wakeup_lock); ++} ++ ++static inline void update_sched_lat(struct task_struct *t, cycles_t cycles) ++{ ++ int cpu; ++ cycles_t ve_wstamp; ++ ++ /* safe due to runqueue lock */ ++ cpu = smp_processor_id(); ++ ve_wstamp = t->ve_task_info.wakeup_stamp; ++ ++ if (ve_wstamp && cycles > ve_wstamp) { ++ KSTAT_LAT_PCPU_ADD(&kstat_glob.sched_lat, ++ cpu, cycles - ve_wstamp); ++ KSTAT_LAT_PCPU_ADD(&t->ve_task_info.exec_env->sched_lat_ve, ++ cpu, cycles - ve_wstamp); ++ } ++} ++ ++static inline void update_ve_task_info(struct task_struct *prev, cycles_t cycles) ++{ ++#ifdef CONFIG_FAIRSCHED ++ if (prev != this_pcpu()->idle) { ++#else ++ if (prev != this_rq()->idle) { ++#endif ++ VE_CPU_STATS(prev->ve_task_info.owner_env, ++ smp_processor_id())->used_time += ++ cycles - prev->ve_task_info.sched_time; ++ ++ prev->ve_task_info.sched_time = cycles; ++ } ++} ++#else ++static inline void ve_nr_running_inc(struct ve_struct, int cpu, cycles_t cycles) ++{ ++} ++ ++static inline void ve_nr_running_dec(struct ve_struct, int cpu, cycles_t cycles) ++{ ++} ++ ++static inline void ve_nr_iowait_inc(struct ve_struct *ve, int cpu) ++{ ++} ++ ++static inline void ve_nr_iowait_dec(struct ve_struct *ve, int cpu) ++{ ++} ++ ++static inline void ve_nr_unint_inc(struct ve_struct *ve, int cpu) ++{ ++} ++ ++static inline void ve_nr_unint_dec(struct ve_struct *ve, int cpu) ++{ ++} ++ ++static inline void update_ve_task_info(struct task_struct *prev, cycles_t cycles) ++{ ++} ++#endif ++ ++struct task_nrs_struct { ++ long nr_running; ++ long nr_unint; ++ long nr_stopped; ++ long nr_sleeping; ++ long nr_iowait; ++ long long nr_switches; ++} ____cacheline_aligned_in_smp; ++ ++unsigned long nr_zombie = 0; /* protected by tasklist_lock */ ++EXPORT_SYMBOL(nr_zombie); ++ ++atomic_t nr_dead = ATOMIC_INIT(0); ++EXPORT_SYMBOL(nr_dead); ++ + /* + * this_rq_lock - lock this runqueue and disable interrupts. + */ +@@ -1046,11 +1270,21 @@ + */ + static void activate_task(struct rq *rq, struct task_struct *p, int wakeup) + { +- if (p->state == TASK_UNINTERRUPTIBLE) ++ cycles_t cycles; ++ ++#ifdef CONFIG_VE ++ cycles = get_cycles(); ++ write_wakeup_stamp(p, cycles); ++ p->ve_task_info.sleep_time += cycles; ++#endif ++ if (p->state == TASK_UNINTERRUPTIBLE) { + rq->nr_uninterruptible--; ++ ve_nr_unint_dec(VE_TASK_INFO(p)->owner_env, task_cpu(p)); ++ } + + enqueue_task(rq, p, wakeup); + inc_nr_running(p, rq); ++ ve_nr_running_inc(VE_TASK_INFO(p)->owner_env, task_cpu(p), cycles); + } + + /* +@@ -1058,6 +1292,30 @@ + */ + static void deactivate_task(struct rq *rq, struct task_struct *p, int sleep) + { ++ cycles_t cycles; ++#ifdef CONFIG_VE ++ unsigned int cpu, pcpu; ++ struct ve_struct *ve; ++ ++ cycles = get_cycles(); ++ cpu = task_cpu(p); ++ pcpu = smp_processor_id(); ++ ve = p->ve_task_info.owner_env; ++ ++ p->ve_task_info.sleep_time -= cycles; ++#endif ++ if (p->state == TASK_UNINTERRUPTIBLE) { ++ ve_nr_unint_inc(ve, cpu); ++ } ++ if (p->state == TASK_INTERRUPTIBLE) { ++ rq->nr_sleeping++; ++ } ++ if (p->state == TASK_STOPPED) { ++ rq->nr_stopped++; ++ } ++ ++ ve_nr_running_dec(VE_TASK_INFO(p)->owner_env, cpu, cycles); ++ + if (p->state == TASK_UNINTERRUPTIBLE) + rq->nr_uninterruptible++; + +@@ -1263,6 +1521,7 @@ + break; + } + } ++EXPORT_SYMBOL_GPL(wait_task_inactive); + + /*** + * kick_process - kick a running thread to enter/exit the kernel +@@ -1782,6 +2041,10 @@ + /* Want to start with kernel preemption disabled. */ + task_thread_info(p)->preempt_count = 1; + #endif ++#ifdef CONFIG_VE ++ /* cosmetic: sleep till wakeup below */ ++ p->ve_task_info.sleep_time -= get_cycles(); ++#endif + put_cpu(); + } + +@@ -1812,6 +2075,8 @@ + */ + p->sched_class->task_new(rq, p); + inc_nr_running(p, rq); ++ ve_nr_running_inc(VE_TASK_INFO(p)->owner_env, task_cpu(p), ++ get_cycles()); + } + check_preempt_curr(rq, p); + task_rq_unlock(rq, &flags); +@@ -1964,6 +2229,7 @@ + if (current->set_child_tid) + put_user(task_pid_vnr(current), current->set_child_tid); + } ++EXPORT_SYMBOL_GPL(schedule_tail); + + /* + * context_switch - switch to the new MM and the new +@@ -2034,6 +2300,7 @@ + + return sum; + } ++EXPORT_SYMBOL(nr_running); + + unsigned long nr_uninterruptible(void) + { +@@ -2051,6 +2318,7 @@ + + return sum; + } ++EXPORT_SYMBOL(nr_uninterruptible); + + unsigned long long nr_context_switches(void) + { +@@ -2062,6 +2330,7 @@ + + return sum; + } ++EXPORT_SYMBOL(nr_context_switches); + + unsigned long nr_iowait(void) + { +@@ -2072,6 +2341,7 @@ + + return sum; + } ++EXPORT_SYMBOL(nr_iowait); + + unsigned long nr_active(void) + { +@@ -2088,6 +2358,72 @@ + return running + uninterruptible; + } + ++unsigned long nr_stopped(void) ++{ ++ unsigned long i, sum = 0; ++ ++ for_each_online_cpu(i) ++ sum += cpu_rq(i)->nr_stopped; ++ if (unlikely((long)sum < 0)) ++ sum = 0; ++ return sum; ++} ++EXPORT_SYMBOL(nr_stopped); ++ ++unsigned long nr_sleeping(void) ++{ ++ unsigned long i, sum = 0; ++ ++ for_each_online_cpu(i) ++ sum += cpu_rq(i)->nr_sleeping; ++ if (unlikely((long)sum < 0)) ++ sum = 0; ++ return sum; ++} ++EXPORT_SYMBOL(nr_sleeping); ++ ++#ifdef CONFIG_VE ++unsigned long nr_running_ve(struct ve_struct *ve) ++{ ++ int i; ++ long sum = 0; ++ cpumask_t ve_cpus; ++ ++ ve_cpu_online_map(ve, &ve_cpus); ++ for_each_cpu_mask(i, ve_cpus) ++ sum += VE_CPU_STATS(ve, i)->nr_running; ++ return (unsigned long)(sum < 0 ? 0 : sum); ++} ++EXPORT_SYMBOL(nr_running_ve); ++ ++unsigned long nr_uninterruptible_ve(struct ve_struct *ve) ++{ ++ int i; ++ long sum = 0; ++ cpumask_t ve_cpus; ++ ++ sum = 0; ++ ve_cpu_online_map(ve, &ve_cpus); ++ for_each_cpu_mask(i, ve_cpus) ++ sum += VE_CPU_STATS(ve, i)->nr_unint; ++ return (unsigned long)(sum < 0 ? 0 : sum); ++} ++EXPORT_SYMBOL(nr_uninterruptible_ve); ++ ++unsigned long nr_iowait_ve(struct ve_struct *ve) ++{ ++ int i; ++ long sum = 0; ++ cpumask_t ve_cpus; ++ ++ ve_cpu_online_map(ve, &ve_cpus); ++ for_each_cpu_mask(i, ve_cpus) ++ sum += VE_CPU_STATS(ve, i)->nr_iowait; ++ return (unsigned long)(sum < 0 ? 0 : sum); ++} ++EXPORT_SYMBOL(nr_iowait_ve); ++#endif ++ + /* + * Update rq->cpu_load[] statistics. This function is usually called every + * scheduler tick (TICK_NSEC). +@@ -2118,6 +2454,16 @@ + } + } + ++#ifdef CONFIG_VE ++#define update_ve_cpu_time(p, time, tick) \ ++ do { \ ++ VE_CPU_STATS((p)->ve_task_info.owner_env, \ ++ task_cpu(p))->time += tick; \ ++ } while (0) ++#else ++#define update_ve_cpu_time(p, time, tick) do { } while (0) ++#endif ++ + #ifdef CONFIG_SMP + + /* +@@ -2241,8 +2587,15 @@ + static void pull_task(struct rq *src_rq, struct task_struct *p, + struct rq *this_rq, int this_cpu) + { ++ struct ve_struct *ve; ++ cycles_t cycles = get_cycles(); ++ ++ ve = VE_TASK_INFO(p)->owner_env; ++ + deactivate_task(src_rq, p, 0); ++ ve_nr_running_dec(ve, task_cpu(p), cycles); + set_task_cpu(p, this_cpu); ++ ve_nr_running_inc(ve, task_cpu(p), cycles); + activate_task(this_rq, p, 0); + /* + * Note that idle threads have a prio of MAX_PRIO, for this test +@@ -3408,10 +3761,13 @@ + + /* Add user time to cpustat. */ + tmp = cputime_to_cputime64(cputime); +- if (TASK_NICE(p) > 0) ++ if (TASK_NICE(p) > 0) { + cpustat->nice = cputime64_add(cpustat->nice, tmp); +- else ++ update_ve_cpu_time(p, nice, tmp); ++ } else { + cpustat->user = cputime64_add(cpustat->user, tmp); ++ update_ve_cpu_time(p, user, tmp); ++ } + } + + /* +@@ -3463,6 +3819,7 @@ + + /* Add system time to cpustat. */ + tmp = cputime_to_cputime64(cputime); ++ update_ve_cpu_time(p, system, tmp); + if (hardirq_count() - hardirq_offset) + cpustat->irq = cputime64_add(cpustat->irq, tmp); + else if (softirq_count()) +@@ -3706,13 +4063,33 @@ + sched_info_switch(prev, next); + + if (likely(prev != next)) { ++ cycles_t cycles = get_cycles(); ++ + rq->nr_switches++; + rq->curr = next; + ++*switch_count; + ++#ifdef CONFIG_VE ++ prev->ve_task_info.sleep_stamp = cycles; ++ if (prev->state == TASK_RUNNING && prev != this_rq()->idle) ++ write_wakeup_stamp(prev, cycles); ++ update_sched_lat(next, cycles); ++ ++ /* because next & prev are protected with ++ * runqueue lock we may not worry about ++ * wakeup_stamp and sched_time protection ++ * (same thing in 'else' branch below) ++ */ ++ update_ve_task_info(prev, cycles); ++ next->ve_task_info.sched_time = cycles; ++ write_wakeup_stamp(next, 0); ++#endif ++ + context_switch(rq, prev, next); /* unlocks the rq */ +- } else ++ } else { ++ update_ve_task_info(prev, get_cycles()); + spin_unlock_irq(&rq->lock); ++ } + + if (unlikely(reacquire_kernel_lock(current) < 0)) { + cpu = smp_processor_id(); +@@ -4327,7 +4704,7 @@ + /* + * Allow unprivileged RT tasks to decrease priority: + */ +- if (!capable(CAP_SYS_NICE)) { ++ if (!capable(CAP_SYS_ADMIN)) { + if (rt_policy(policy)) { + unsigned long rlim_rtprio; + +@@ -4802,10 +5179,15 @@ + void __sched io_schedule(void) + { + struct rq *rq = &__raw_get_cpu_var(runqueues); ++#ifdef CONFIG_VE ++ struct ve_struct *ve = current->ve_task_info.owner_env; ++#endif + + delayacct_blkio_start(); + atomic_inc(&rq->nr_iowait); ++ ve_nr_iowait_inc(ve, task_cpu(current)); + schedule(); ++ ve_nr_iowait_dec(ve, task_cpu(current)); + atomic_dec(&rq->nr_iowait); + delayacct_blkio_end(); + } +@@ -4815,10 +5197,15 @@ + { + struct rq *rq = &__raw_get_cpu_var(runqueues); + long ret; ++#ifdef CONFIG_VE ++ struct ve_struct *ve = current->ve_task_info.owner_env; ++#endif + + delayacct_blkio_start(); + atomic_inc(&rq->nr_iowait); ++ ve_nr_iowait_inc(ve, task_cpu(current)); + ret = schedule_timeout(timeout); ++ ve_nr_iowait_dec(ve, task_cpu(current)); + atomic_dec(&rq->nr_iowait); + delayacct_blkio_end(); + return ret; +@@ -4939,17 +5326,7 @@ + state = p->state ? __ffs(p->state) + 1 : 0; + printk(KERN_INFO "%-13.13s %c", p->comm, + state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?'); +-#if BITS_PER_LONG == 32 +- if (state == TASK_RUNNING) +- printk(KERN_CONT " running "); +- else +- printk(KERN_CONT " %08lx ", thread_saved_pc(p)); +-#else +- if (state == TASK_RUNNING) +- printk(KERN_CONT " running task "); +- else +- printk(KERN_CONT " %016lx ", thread_saved_pc(p)); +-#endif ++ printk(KERN_CONT " %p ", p); + #ifdef CONFIG_DEBUG_STACK_USAGE + { + unsigned long *n = end_of_stack(p); +@@ -4971,13 +5348,13 @@ + + #if BITS_PER_LONG == 32 + printk(KERN_INFO +- " task PC stack pid father\n"); ++ " task taskaddr stack pid father\n"); + #else + printk(KERN_INFO +- " task PC stack pid father\n"); ++ " task taskaddr stack pid father\n"); + #endif + read_lock(&tasklist_lock); +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + /* + * reset the NMI-timeout, listing all files on a slow + * console might take alot of time: +@@ -4985,7 +5362,7 @@ + touch_nmi_watchdog(); + if (!state_filter || (p->state & state_filter)) + show_task(p); +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + + touch_all_softlockup_watchdogs(); + +@@ -5333,13 +5710,13 @@ + + read_lock(&tasklist_lock); + +- do_each_thread(t, p) { ++ do_each_thread_all(t, p) { + if (p == current) + continue; + + if (task_cpu(p) == src_cpu) + move_task_off_dead_cpu(src_cpu, p); +- } while_each_thread(t, p); ++ } while_each_thread_all(t, p); + + read_unlock(&tasklist_lock); + } +@@ -6792,6 +7169,7 @@ + int highest_cpu = 0; + int i, j; + ++ kstat_glob.sched_lat.cur = percpu_static_init(kstat_lat); + for_each_possible_cpu(i) { + struct rt_prio_array *array; + struct rq *rq; +@@ -6882,6 +7260,7 @@ + * During early bootup we pretend to be a normal task: + */ + current->sched_class = &fair_sched_class; ++ fairsched_init_early(); + } + + #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP +@@ -6931,7 +7310,7 @@ + struct rq *rq; + + read_lock_irq(&tasklist_lock); +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + /* + * Only normalize user tasks: + */ +@@ -6963,7 +7342,7 @@ + + __task_rq_unlock(rq); + spin_unlock_irqrestore(&p->pi_lock, flags); +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + + read_unlock_irq(&tasklist_lock); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/sched_debug.c debian/binary-custom.d/openvz/src/kernel/sched_debug.c +--- ./kernel/sched_debug.c 2012-06-12 16:25:24.266312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/sched_debug.c 2012-11-13 15:20:15.412569064 +0000 +@@ -91,12 +91,12 @@ + + read_lock_irqsave(&tasklist_lock, flags); + +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + if (!p->se.on_rq || task_cpu(p) != rq_cpu) + continue; + + print_task(m, rq, p); +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + + read_unlock_irqrestore(&tasklist_lock, flags); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/signal.c debian/binary-custom.d/openvz/src/kernel/signal.c +--- ./kernel/signal.c 2012-06-12 16:25:24.266312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/signal.c 2012-11-13 15:20:15.420569067 +0000 +@@ -31,15 +31,34 @@ + #include + #include + #include ++#include + #include "audit.h" /* audit_signal_info() */ + + /* + * SLAB caches for signal bits. + */ + +-static struct kmem_cache *sigqueue_cachep; ++struct kmem_cache *sigqueue_cachep; ++EXPORT_SYMBOL(sigqueue_cachep); + + ++static int sig_ve_ignored(int sig, struct siginfo *info, struct task_struct *t) ++{ ++ struct ve_struct *ve; ++ ++ /* always allow signals from the kernel */ ++ if (info == SEND_SIG_FORCED || ++ (!is_si_special(info) && SI_FROMKERNEL(info))) ++ return 0; ++ ++ ve = current->ve_task_info.owner_env; ++ if (ve->ve_ns->pid_ns->child_reaper != t) ++ return 0; ++ if (ve_is_super(get_exec_env())) ++ return 0; ++ return !sig_user_defined(t, sig) || sig_kernel_only(sig); ++} ++ + static int sig_ignored(struct task_struct *t, int sig) + { + void __user * handler; +@@ -96,7 +115,7 @@ + + #define PENDING(p,b) has_pending_signals(&(p)->signal, (b)) + +-static int recalc_sigpending_tsk(struct task_struct *t) ++int recalc_sigpending_tsk(struct task_struct *t) + { + if (t->signal->group_stop_count > 0 || + PENDING(&t->pending, &t->blocked) || +@@ -121,6 +140,7 @@ + if (recalc_sigpending_tsk(t)) + signal_wake_up(t, 0); + } ++EXPORT_SYMBOL_GPL(recalc_sigpending_tsk); + + void recalc_sigpending(void) + { +@@ -179,8 +199,13 @@ + atomic_inc(&user->sigpending); + if (override_rlimit || + atomic_read(&user->sigpending) <= +- t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur) ++ t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur) { + q = kmem_cache_alloc(sigqueue_cachep, flags); ++ if (q && ub_siginfo_charge(q, get_task_ub(t))) { ++ kmem_cache_free(sigqueue_cachep, q); ++ q = NULL; ++ } ++ } + if (unlikely(q == NULL)) { + atomic_dec(&user->sigpending); + } else { +@@ -197,6 +222,7 @@ + return; + atomic_dec(&q->user->sigpending); + free_uid(q->user); ++ ub_siginfo_uncharge(q); + kmem_cache_free(sigqueue_cachep, q); + } + +@@ -345,7 +371,18 @@ + static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, + siginfo_t *info) + { +- int sig = next_signal(pending, mask); ++ int sig = 0; ++ ++ /* SIGKILL must have priority, otherwise it is quite easy ++ * to create an unkillable process, sending sig < SIGKILL ++ * to self */ ++ if (unlikely(sigismember(&pending->signal, SIGKILL))) { ++ if (!sigismember(mask, SIGKILL)) ++ sig = SIGKILL; ++ } ++ ++ if (likely(!sig)) ++ sig = next_signal(pending, mask); + + if (sig) { + if (current->notifier) { +@@ -468,6 +505,7 @@ + if (!wake_up_state(t, mask)) + kick_process(t); + } ++EXPORT_SYMBOL_GPL(signal_wake_up); + + /* + * Remove signals in mask from the pending set and queue. +@@ -909,7 +947,7 @@ + do { + sigaddset(&t->pending.signal, SIGKILL); + signal_wake_up(t, 1); +- } while_each_thread(p, t); ++ } while_each_thread_all(p, t); + return; + } + +@@ -931,7 +969,7 @@ + do { + p->signal->group_stop_count++; + signal_wake_up(t, t == p); +- } while_each_thread(p, t); ++ } while_each_thread_all(p, t); + return; + } + +@@ -1026,7 +1064,8 @@ + if (!ret && sig) { + ret = -ESRCH; + if (lock_task_sighand(p, &flags)) { +- ret = __group_send_sig_info(sig, info, p); ++ ret = sig_ve_ignored(sig, info, p) ? 0 : ++ __group_send_sig_info(sig, info, p); + unlock_task_sighand(p, &flags); + } + } +@@ -1150,7 +1189,7 @@ + struct task_struct * p; + + read_lock(&tasklist_lock); +- for_each_process(p) { ++ for_each_process_ve(p) { + if (task_pid_vnr(p) > 1 && + !same_thread_group(p, current)) { + int err = group_send_sig_info(sig, info, p); +@@ -1448,6 +1487,14 @@ + BUG_ON(!tsk->ptrace && + (tsk->group_leader != tsk || !thread_group_empty(tsk))); + ++#ifdef CONFIG_VE ++ /* Allow to send only SIGCHLD from VE */ ++ if (sig != SIGCHLD && ++ tsk->ve_task_info.owner_env != ++ tsk->parent->ve_task_info.owner_env) ++ sig = SIGCHLD; ++#endif ++ + info.si_signo = sig; + info.si_errno = 0; + /* +@@ -1686,7 +1733,9 @@ + } + + do { ++ set_stop_state(current); + schedule(); ++ clear_stop_state(current); + } while (try_to_freeze()); + /* + * Now we don't run again until continued. +@@ -1775,6 +1824,7 @@ + */ + return 0; + ++ clear_pn_state(current); + /* + * There is a group stop in progress. We stop + * without any associated signal being in our queue. +@@ -1795,8 +1845,6 @@ + sigset_t *mask = ¤t->blocked; + int signr = 0; + +- try_to_freeze(); +- + relock: + spin_lock_irq(¤t->sighand->siglock); + for (;;) { +@@ -2248,8 +2296,10 @@ + */ + if (!error && sig && p->sighand) { + spin_lock_irq(&p->sighand->siglock); +- handle_stop_signal(sig, p); +- error = specific_send_sig_info(sig, &info, p); ++ if (!sig_ve_ignored(sig, &info, p)) { ++ handle_stop_signal(sig, p); ++ error = specific_send_sig_info(sig, &info, p); ++ } + spin_unlock_irq(&p->sighand->siglock); + } + } +@@ -2607,5 +2657,5 @@ + + void __init signals_init(void) + { +- sigqueue_cachep = KMEM_CACHE(sigqueue, SLAB_PANIC); ++ sigqueue_cachep = KMEM_CACHE(sigqueue, SLAB_PANIC|SLAB_UBC); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/softirq.c debian/binary-custom.d/openvz/src/kernel/softirq.c +--- ./kernel/softirq.c 2012-06-12 16:25:24.266312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/softirq.c 2012-11-13 15:20:15.420569067 +0000 +@@ -20,6 +20,8 @@ + #include + #include + ++#include ++ + #include + /* + - No shared variables, all the data are CPU local. +@@ -207,10 +209,14 @@ + + asmlinkage void __do_softirq(void) + { ++ struct user_beancounter *ub; + struct softirq_action *h; + __u32 pending; + int max_restart = MAX_SOFTIRQ_RESTART; + int cpu; ++ struct ve_struct *envid; ++ ++ envid = set_exec_env(get_ve0()); + + pending = local_softirq_pending(); + account_system_vtime(current); +@@ -227,6 +233,7 @@ + + h = softirq_vec; + ++ ub = set_exec_ub(get_ub0()); + do { + if (pending & 1) { + h->action(h); +@@ -235,6 +242,7 @@ + h++; + pending >>= 1; + } while (pending); ++ (void)set_exec_ub(ub); + + local_irq_disable(); + +@@ -248,6 +256,7 @@ + trace_softirq_exit(); + + account_system_vtime(current); ++ (void)set_exec_env(envid); + _local_bh_enable(); + } + +@@ -298,6 +307,7 @@ + { + account_system_vtime(current); + trace_hardirq_exit(); ++ restore_context(); + sub_preempt_count(IRQ_EXIT_OFFSET); + if (!in_interrupt() && local_softirq_pending()) + invoke_softirq(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/stop_machine.c debian/binary-custom.d/openvz/src/kernel/stop_machine.c +--- ./kernel/stop_machine.c 2012-06-12 16:25:24.270312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/stop_machine.c 2012-11-13 15:20:15.424569066 +0000 +@@ -9,7 +9,7 @@ + #include + #include + #include +- ++#include + #include + #include + #include +@@ -63,7 +63,7 @@ + /* Yield in first stage: migration threads need to + * help our sisters onto their CPUs. */ + if (!prepared && !irqs_disabled) +- yield(); ++ msleep(10); + else + cpu_relax(); + } +@@ -109,7 +109,7 @@ + + /* Wait for them all to come to life. */ + while (atomic_read(&stopmachine_thread_ack) != stopmachine_num_threads) +- yield(); ++ msleep(10); + + /* If some failed, kill them all. */ + if (ret < 0) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/sys.c debian/binary-custom.d/openvz/src/kernel/sys.c +--- ./kernel/sys.c 2012-06-12 16:25:24.270312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/sys.c 2012-11-13 15:20:15.424569066 +0000 +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -33,6 +34,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -106,6 +108,102 @@ + + void (*pm_power_off_prepare)(void); + ++DECLARE_MUTEX(virtinfo_sem); ++EXPORT_SYMBOL(virtinfo_sem); ++static struct vnotifier_block *virtinfo_chain[VIRT_TYPES]; ++ ++void __virtinfo_notifier_register(int type, struct vnotifier_block *nb) ++{ ++ struct vnotifier_block **p; ++ ++ for (p = &virtinfo_chain[type]; ++ *p != NULL && nb->priority < (*p)->priority; ++ p = &(*p)->next); ++ nb->next = *p; ++ smp_wmb(); ++ *p = nb; ++} ++ ++EXPORT_SYMBOL(__virtinfo_notifier_register); ++ ++void virtinfo_notifier_register(int type, struct vnotifier_block *nb) ++{ ++ down(&virtinfo_sem); ++ __virtinfo_notifier_register(type, nb); ++ up(&virtinfo_sem); ++} ++ ++EXPORT_SYMBOL(virtinfo_notifier_register); ++ ++struct virtinfo_cnt_struct { ++ volatile unsigned long exit[NR_CPUS]; ++ volatile unsigned long entry; ++}; ++static DEFINE_PER_CPU(struct virtinfo_cnt_struct, virtcnt); ++ ++void virtinfo_notifier_unregister(int type, struct vnotifier_block *nb) ++{ ++ struct vnotifier_block **p; ++ int entry_cpu, exit_cpu; ++ unsigned long cnt, ent; ++ ++ down(&virtinfo_sem); ++ for (p = &virtinfo_chain[type]; *p != nb; p = &(*p)->next); ++ *p = nb->next; ++ smp_mb(); ++ ++ for_each_cpu_mask(entry_cpu, cpu_possible_map) { ++ while (1) { ++ cnt = 0; ++ for_each_cpu_mask(exit_cpu, cpu_possible_map) ++ cnt += ++ per_cpu(virtcnt, entry_cpu).exit[exit_cpu]; ++ smp_rmb(); ++ ent = per_cpu(virtcnt, entry_cpu).entry; ++ if (cnt == ent) ++ break; ++ __set_current_state(TASK_UNINTERRUPTIBLE); ++ schedule_timeout(HZ / 100); ++ } ++ } ++ up(&virtinfo_sem); ++} ++ ++EXPORT_SYMBOL(virtinfo_notifier_unregister); ++ ++int virtinfo_notifier_call(int type, unsigned long n, void *data) ++{ ++ int ret; ++ int entry_cpu, exit_cpu; ++ struct vnotifier_block *nb; ++ ++ entry_cpu = get_cpu(); ++ per_cpu(virtcnt, entry_cpu).entry++; ++ smp_wmb(); ++ put_cpu(); ++ ++ nb = virtinfo_chain[type]; ++ ret = NOTIFY_DONE; ++ while (nb) ++ { ++ ret = nb->notifier_call(nb, n, data, ret); ++ if(ret & NOTIFY_STOP_MASK) { ++ ret &= ~NOTIFY_STOP_MASK; ++ break; ++ } ++ nb = nb->next; ++ } ++ ++ exit_cpu = get_cpu(); ++ smp_wmb(); ++ per_cpu(virtcnt, entry_cpu).exit[exit_cpu]++; ++ put_cpu(); ++ ++ return ret; ++} ++ ++EXPORT_SYMBOL(virtinfo_notifier_call); ++ + static int set_one_prio(struct task_struct *p, int niceval, int error) + { + int no_nice; +@@ -165,7 +263,7 @@ + pgrp = task_pgrp(current); + do_each_pid_task(pgrp, PIDTYPE_PGID, p) { + error = set_one_prio(p, niceval, error); +- } while_each_pid_task(pgrp, PIDTYPE_PGID, p); ++ } while_each_pid_task(who, PIDTYPE_PGID, p); + break; + case PRIO_USER: + user = current->user; +@@ -175,10 +273,10 @@ + if ((who != current->uid) && !(user = find_user(who))) + goto out_unlock; /* No processes for this user */ + +- do_each_thread(g, p) ++ do_each_thread_ve(g, p) + if (p->uid == who) + error = set_one_prio(p, niceval, error); +- while_each_thread(g, p); ++ while_each_thread_ve(g, p); + if (who != current->uid) + free_uid(user); /* For find_user() */ + break; +@@ -227,7 +325,7 @@ + niceval = 20 - task_nice(p); + if (niceval > retval) + retval = niceval; +- } while_each_pid_task(pgrp, PIDTYPE_PGID, p); ++ } while_each_pid_task(who, PIDTYPE_PGID, p); + break; + case PRIO_USER: + user = current->user; +@@ -237,13 +335,13 @@ + if ((who != current->uid) && !(user = find_user(who))) + goto out_unlock; /* No processes for this user */ + +- do_each_thread(g, p) ++ do_each_thread_ve(g, p) + if (p->uid == who) { + niceval = 20 - task_nice(p); + if (niceval > retval) + retval = niceval; + } +- while_each_thread(g, p); ++ while_each_thread_ve(g, p); + if (who != current->uid) + free_uid(user); /* for find_user() */ + break; +@@ -377,6 +475,25 @@ + magic2 != LINUX_REBOOT_MAGIC2C)) + return -EINVAL; + ++#ifdef CONFIG_VE ++ if (!ve_is_super(get_exec_env())) ++ switch (cmd) { ++ case LINUX_REBOOT_CMD_RESTART: ++ case LINUX_REBOOT_CMD_HALT: ++ case LINUX_REBOOT_CMD_POWER_OFF: ++ case LINUX_REBOOT_CMD_RESTART2: ++ force_sig(SIGKILL, ++ get_exec_env()->ve_ns->pid_ns->child_reaper); ++ ++ case LINUX_REBOOT_CMD_CAD_ON: ++ case LINUX_REBOOT_CMD_CAD_OFF: ++ return 0; ++ ++ default: ++ return -EINVAL; ++ } ++#endif ++ + /* Instead of trying to make the power_off code look like + * halt when pm_power_off is not set do it the easy way. + */ +@@ -558,7 +675,7 @@ + return 0; + } + +-static int set_user(uid_t new_ruid, int dumpclear) ++int set_user(uid_t new_ruid, int dumpclear) + { + struct user_struct *new_user; + +@@ -582,6 +699,7 @@ + current->uid = new_ruid; + return 0; + } ++EXPORT_SYMBOL(set_user); + + /* + * Unprivileged users may change the real uid to the effective uid +@@ -862,8 +980,27 @@ + return old_fsgid; + } + ++#ifdef CONFIG_VE ++unsigned long long ve_relative_clock(struct timespec * ts) ++{ ++ unsigned long long offset = 0; ++ ++ if (ts->tv_sec > get_exec_env()->start_timespec.tv_sec || ++ (ts->tv_sec == get_exec_env()->start_timespec.tv_sec && ++ ts->tv_nsec >= get_exec_env()->start_timespec.tv_nsec)) ++ offset = (unsigned long long)(ts->tv_sec - ++ get_exec_env()->start_timespec.tv_sec) * NSEC_PER_SEC ++ + ts->tv_nsec - get_exec_env()->start_timespec.tv_nsec; ++ return nsec_to_clock_t(offset); ++} ++#endif ++ + asmlinkage long sys_times(struct tms __user * tbuf) + { ++#ifdef CONFIG_VE ++ struct timespec now; ++#endif ++ + /* + * In the SMP world we might just be unlucky and have one of + * the times increment as we use it. Since the value is an +@@ -897,7 +1034,13 @@ + if (copy_to_user(tbuf, &tmp, sizeof(struct tms))) + return -EFAULT; + } ++#ifndef CONFIG_VE + return (long) jiffies_64_to_clock_t(get_jiffies_64()); ++#else ++ /* Compare to calculation in fs/proc/array.c */ ++ do_posix_clock_monotonic_gettime(&now); ++ return ve_relative_clock(&now); ++#endif + } + + /* +@@ -1049,6 +1192,7 @@ + { + struct task_struct *group_leader = current->group_leader; + pid_t session; ++ struct pid *sid; + int err = -EPERM; + + write_lock_irq(&tasklist_lock); +@@ -1057,7 +1201,8 @@ + if (group_leader->signal->leader) + goto out; + +- session = group_leader->pid; ++ sid = task_pid(group_leader); ++ session = pid_vnr(sid); + /* Fail if a process group id already exists that equals the + * proposed session id. + * +@@ -1065,18 +1210,18 @@ + * session id and so the check will always fail and make it so + * init cannot successfully call setsid. + */ +- if (session > 1 && find_task_by_pid_type_ns(PIDTYPE_PGID, +- session, &init_pid_ns)) ++ if (session > 1 && pid_task(sid, PIDTYPE_PGID)) + goto out; + + group_leader->signal->leader = 1; +- __set_special_pids(session, session); ++ __set_special_pids(sid); + + spin_lock(&group_leader->sighand->siglock); + group_leader->signal->tty = NULL; ++ group_leader->signal->tty_old_pgrp = 0; + spin_unlock(&group_leader->sighand->siglock); + +- err = task_pgrp_vnr(group_leader); ++ err = session; + out: + write_unlock_irq(&tasklist_lock); + return err; +@@ -1358,7 +1503,7 @@ + int errno; + char tmp[__NEW_UTS_LEN]; + +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + if (len < 0 || len > __NEW_UTS_LEN) + return -EINVAL; +@@ -1403,7 +1548,7 @@ + int errno; + char tmp[__NEW_UTS_LEN]; + +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + if (len < 0 || len > __NEW_UTS_LEN) + return -EINVAL; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/sys_ni.c debian/binary-custom.d/openvz/src/kernel/sys_ni.c +--- ./kernel/sys_ni.c 2012-06-12 16:25:24.270312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/sys_ni.c 2012-11-13 15:20:15.424569066 +0000 +@@ -157,3 +157,15 @@ + cond_syscall(compat_sys_signalfd); + cond_syscall(compat_sys_timerfd); + cond_syscall(sys_eventfd); ++cond_syscall(sys_getluid); ++cond_syscall(sys_setluid); ++cond_syscall(sys_setublimit); ++cond_syscall(sys_ubstat); ++ ++/* fairsched compat */ ++cond_syscall(sys_fairsched_mknod); ++cond_syscall(sys_fairsched_rmnod); ++cond_syscall(sys_fairsched_mvpr); ++cond_syscall(sys_fairsched_vcpus); ++cond_syscall(sys_fairsched_chwt); ++cond_syscall(sys_fairsched_rate); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/sysctl.c debian/binary-custom.d/openvz/src/kernel/sysctl.c +--- ./kernel/sysctl.c 2012-06-12 16:25:24.270312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/sysctl.c 2012-11-13 15:20:15.424569066 +0000 +@@ -25,6 +25,9 @@ + #include + #include + #include ++#include ++#include ++#include + #include + #include + #include +@@ -60,6 +63,8 @@ + static int deprecated_sysctl_warning(struct __sysctl_args *args); + + #if defined(CONFIG_SYSCTL) ++extern int gr_handle_sysctl_mod(const char *dirname, const char *name, ++ const int op); + + /* External variables not in a header file. */ + extern int C_A_D; +@@ -71,6 +76,7 @@ + extern int max_threads; + extern int core_uses_pid; + extern int suid_dumpable; ++extern int sysctl_at_vsyscall; + extern char core_pattern[]; + extern int pid_max; + extern int min_free_kbytes; +@@ -82,6 +88,7 @@ + extern int compat_log; + extern int maps_protect; + extern int sysctl_stat_interval; ++extern int ve_area_access_check; /* fs/namei.c */ + extern int audit_argv_kb; + extern int latencytop_enabled; + +@@ -105,6 +112,8 @@ + + static int ngroups_max = NGROUPS_MAX; + ++int ve_allow_kthreads = 1; ++EXPORT_SYMBOL(ve_allow_kthreads); + #ifdef CONFIG_KMOD + extern char modprobe_path[]; + #endif +@@ -118,6 +127,8 @@ + extern int scons_pwroff; + #endif + ++extern int alloc_fail_warn; ++ + #ifdef __hppa__ + extern int pwrsw_enabled; + extern int unaligned_enabled; +@@ -132,6 +143,7 @@ + #endif + + extern int sysctl_hz_timer; ++int decode_call_traces = 1; + + #ifdef CONFIG_BSD_PROCESS_ACCT + extern int acct_parm[]; +@@ -140,6 +152,10 @@ + #ifdef CONFIG_IA64 + extern int no_unaligned_warning; + #endif ++#ifdef CONFIG_VE ++int glob_ve_meminfo = 0; ++EXPORT_SYMBOL(glob_ve_meminfo); ++#endif + + #ifdef CONFIG_RT_MUTEXES + extern int max_lock_depth; +@@ -175,6 +191,7 @@ + #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT + int sysctl_legacy_va_layout; + #endif ++extern ctl_table grsecurity_table[]; + + extern int prove_locking; + extern int lock_stat; +@@ -397,7 +414,7 @@ + #ifdef CONFIG_SECURITY_CAPABILITIES + { + .procname = "cap-bound", +- .data = &cap_bset, ++ .data = NULL, + .maxlen = sizeof(kernel_cap_t), + .mode = 0600, + .proc_handler = &proc_dointvec_bset, +@@ -448,6 +465,20 @@ + .proc_handler = &proc_dointvec, + }, + #endif ++ { ++ .procname = "silence-level", ++ .data = &console_silence_loglevel, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++ { ++ .procname = "alloc_fail_warn", ++ .data = &alloc_fail_warn, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, + #ifdef __hppa__ + { + .ctl_name = KERN_HPPA_PWRSW, +@@ -620,6 +651,15 @@ + .extra1 = &pid_max_min, + .extra2 = &pid_max_max, + }, ++#ifdef CONFIG_VE ++ { ++ .procname = "ve_meminfo", ++ .data = &glob_ve_meminfo, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec, ++ }, ++#endif + { + .ctl_name = KERN_PANIC_ON_OOPS, + .procname = "panic_on_oops", +@@ -795,6 +835,14 @@ + .proc_handler = &proc_dostring, + .strategy = &sysctl_string, + }, ++#ifdef CONFIG_GRKERNSEC_SYSCTL ++ { ++ .ctl_name = KERN_GRSECURITY, ++ .procname = "grsecurity", ++ .mode = 0500, ++ .child = grsecurity_table, ++ }, ++#endif + /* + * NOTE: do not add new entries to this table unless you have read + * Documentation/sysctl/ctl_unnumbered.txt +@@ -1261,6 +1309,20 @@ + .child = binfmt_misc_table, + }, + #endif ++ { ++ .procname = "vsyscall", ++ .data = &sysctl_at_vsyscall, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec, ++ }, ++ { ++ .procname = "odirect_enable", ++ .data = &odirect_enable, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, + /* + * NOTE: do not add new entries to this table unless you have read + * Documentation/sysctl/ctl_unnumbered.txt +@@ -1269,6 +1331,13 @@ + }; + + static struct ctl_table debug_table[] = { ++ { ++ .procname = "decode_call_traces", ++ .data = &decode_call_traces, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, + #if defined(CONFIG_X86) || defined(CONFIG_PPC) + { + .ctl_name = CTL_UNNUMBERED, +@@ -1340,14 +1409,26 @@ + { + struct ctl_table_header *head; + struct list_head *tmp; ++ struct ve_struct *ve; ++ ++ ve = get_exec_env(); + spin_lock(&sysctl_lock); + if (prev) { + tmp = &prev->ctl_entry; + unuse_table(prev); + goto next; + } ++#ifdef CONFIG_VE ++ tmp = ve->sysctl_lh.next; ++#else + tmp = &root_table_header.ctl_entry; ++#endif + for (;;) { ++#ifdef CONFIG_VE ++ if (tmp == &ve->sysctl_lh) ++ /* second pass over global variables */ ++ tmp = &root_table_header.ctl_entry; ++#endif + head = list_entry(tmp, struct ctl_table_header, ctl_entry); + + if (!use_table(head)) +@@ -1457,10 +1538,17 @@ + int sysctl_perm(struct ctl_table *table, int op) + { + int error; ++ int mode = table->mode; ++ ++ if (table->procname && table->parent && gr_handle_sysctl_mod(table->parent->procname, table->procname, op)) ++ return -EACCES; + error = security_sysctl(table, op); + if (error) + return error; +- return test_perm(table->mode, op); ++ if (!ve_accessible(table->owner_env, get_exec_env()) && ++ !table->virt_handler) ++ mode &= ~0222; /* disable write access */ ++ return test_perm(mode, op); + } + + #ifdef CONFIG_SYSCTL_SYSCALL +@@ -1497,6 +1585,36 @@ + return -ENOTDIR; + } + ++int __do_sysctl_strategy (void *data, ctl_table *table, ++ int __user *name, int nlen, ++ void __user *oldval, size_t __user *oldlenp, ++ void __user *newval, size_t newlen) { ++ size_t len; ++ ++ if (oldval && oldlenp) { ++ if (get_user(len, oldlenp)) ++ return -EFAULT; ++ if (len) { ++ if (len > table->maxlen) ++ len = table->maxlen; ++ if (copy_to_user(oldval, data, len)) ++ return -EFAULT; ++ if (put_user(len, oldlenp)) ++ return -EFAULT; ++ } ++ } ++ ++ if (newval && newlen) { ++ len = newlen; ++ if (len > table->maxlen) ++ len = table->maxlen; ++ if (copy_from_user(data, newval, len)) ++ return -EFAULT; ++ } ++ ++ return 0; ++} ++ + /* Perform the actual read/write of a sysctl table entry. */ + int do_sysctl_strategy (struct ctl_table *table, + int __user *name, int nlen, +@@ -1620,9 +1738,11 @@ + * This routine returns %NULL on a failure to register, and a pointer + * to the table header on success. + */ +-struct ctl_table_header *register_sysctl_table(struct ctl_table * table) ++static struct ctl_table_header *__register_sysctl_table(struct list_head *lh, ++ struct ctl_table * table) + { + struct ctl_table_header *tmp; ++ + tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL); + if (!tmp) + return NULL; +@@ -1636,11 +1756,76 @@ + return NULL; + } + spin_lock(&sysctl_lock); +- list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry); ++ list_add_tail(&tmp->ctl_entry, lh); + spin_unlock(&sysctl_lock); + return tmp; + } + ++struct ctl_table_header *register_sysctl_table(struct ctl_table * table) ++{ ++ struct list_head *lh; ++ ++#ifdef CONFIG_VE ++ lh = &get_exec_env()->sysctl_lh; ++#else ++ lh = &root_table_header.ctl_entry; ++#endif ++ return __register_sysctl_table(lh, table); ++} ++ ++#ifdef CONFIG_VE ++struct ctl_table_header *register_glob_sysctl_table(struct ctl_table *table) ++{ ++ return __register_sysctl_table(&root_table_header.ctl_entry, table); ++} ++EXPORT_SYMBOL(register_glob_sysctl_table); ++#endif ++ ++void free_sysctl_clone(ctl_table *clone) ++{ ++ int i; ++ ++ for (i = 0; clone[i].ctl_name != 0; i++) ++ if (clone[i].child != NULL) ++ free_sysctl_clone(clone[i].child); ++ ++ kfree(clone); ++} ++ ++ctl_table *clone_sysctl_template(ctl_table *tmpl) ++{ ++ int i, nr; ++ ctl_table *clone; ++ ++ nr = 0; ++ while (tmpl[nr].ctl_name != 0 || tmpl[nr].procname) ++ nr++; ++ nr++; ++ ++ clone = kmemdup(tmpl, nr * sizeof(ctl_table), GFP_KERNEL); ++ if (clone == NULL) ++ return NULL; ++ ++ for (i = 0; i < nr; i++) { ++ clone[i].owner_env = get_exec_env(); ++ if (tmpl[i].child == NULL) ++ continue; ++ ++ clone[i].child = clone_sysctl_template(tmpl[i].child); ++ if (clone[i].child == NULL) ++ goto unroll; ++ } ++ return clone; ++ ++unroll: ++ for (i--; i >= 0; i--) ++ if (clone[i].child != NULL) ++ free_sysctl_clone(clone[i].child); ++ ++ kfree(clone); ++ return NULL; ++} ++ + /** + * unregister_sysctl_table - unregister a sysctl table hierarchy + * @header: the header returned from register_sysctl_table +@@ -1671,6 +1856,14 @@ + { + } + ++ctl_table * clone_sysctl_template(ctl_table *tmpl, int nr) ++{ ++ return NULL; ++} ++ ++void free_sysctl_clone(ctl_table *tmpl) ++{ ++} + #endif /* CONFIG_SYSCTL */ + + /* +@@ -1962,13 +2155,12 @@ + { + int op; + +- if (write && !capable(CAP_SYS_MODULE)) { ++ if (write && !capable(CAP_SYS_MODULE)) + return -EPERM; +- } + + op = is_global_init(current) ? OP_SET : OP_AND; +- return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, +- do_proc_dointvec_bset_conv,&op); ++ return __do_proc_dointvec(&cap_bset, table, write, filp, ++ buffer, lenp, ppos, do_proc_dointvec_bset_conv, &op); + } + #endif /* def CONFIG_SECURITY_CAPABILITIES */ + +@@ -2712,6 +2904,57 @@ + return 0; + } + ++#ifdef CONFIG_PID_NS ++#include ++ ++static int proc_pid_ns_hide_child(struct ctl_table *table, int write, ++ struct file *filp, void __user *buffer, ++ size_t *lenp, loff_t *ppos) ++{ ++ int tmp, res; ++ ++ tmp = (current->nsproxy->pid_ns->flags & PID_NS_HIDE_CHILD) ? 1 : 0; ++ ++ res = __do_proc_dointvec(&tmp, table, write, filp, buffer, ++ lenp, ppos, NULL, NULL); ++ if (res || !write) ++ return res; ++ ++ if (tmp) ++ current->nsproxy->pid_ns->flags |= PID_NS_HIDE_CHILD; ++ else ++ current->nsproxy->pid_ns->flags &= ~PID_NS_HIDE_CHILD; ++ return 0; ++} ++ ++static struct ctl_table pid_ns_kern_table[] = { ++ { ++ .procname = "pid_ns_hide_child", ++ .maxlen = sizeof(int), ++ .mode = 0600, ++ .proc_handler = proc_pid_ns_hide_child, ++ }, ++ {} ++}; ++ ++static struct ctl_table pid_ns_root_table[] = { ++ { ++ .ctl_name = CTL_KERN, ++ .procname = "kernel", ++ .mode = 0555, ++ .child = pid_ns_kern_table, ++ }, ++ {} ++}; ++ ++static __init int pid_ns_sysctl_init(void) ++{ ++ register_sysctl_table(pid_ns_root_table); ++ return 0; ++} ++postcore_initcall(pid_ns_sysctl_init); ++#endif /* CONFIG_PID_NS */ ++ + /* + * No sense putting this after each symbol definition, twice, + * exception granted :-) +@@ -2731,3 +2974,5 @@ + EXPORT_SYMBOL(sysctl_string); + EXPORT_SYMBOL(sysctl_data); + EXPORT_SYMBOL(unregister_sysctl_table); ++EXPORT_SYMBOL(clone_sysctl_template); ++EXPORT_SYMBOL(free_sysctl_clone); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/sysctl_check.c debian/binary-custom.d/openvz/src/kernel/sysctl_check.c +--- ./kernel/sysctl_check.c 2012-06-12 16:25:24.270312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/sysctl_check.c 2012-11-13 15:20:15.424569066 +0000 +@@ -1459,6 +1459,7 @@ + int sysctl_check_table(struct ctl_table *table) + { + int error = 0; ++ return 0; + for (; table->ctl_name || table->procname; table++) { + const char *fail = NULL; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/taskstats.c debian/binary-custom.d/openvz/src/kernel/taskstats.c +--- ./kernel/taskstats.c 2012-06-12 16:25:24.270312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/taskstats.c 2012-11-13 15:20:15.424569066 +0000 +@@ -183,7 +183,7 @@ + + if (!tsk) { + rcu_read_lock(); +- tsk = find_task_by_pid(pid); ++ tsk = find_task_by_vpid(pid); + if (tsk) + get_task_struct(tsk); + rcu_read_unlock(); +@@ -230,7 +230,7 @@ + */ + rcu_read_lock(); + if (!first) +- first = find_task_by_pid(tgid); ++ first = find_task_by_vpid(tgid); + + if (!first || !lock_task_sighand(first, &flags)) + goto out; +@@ -254,7 +254,7 @@ + + stats->nvcsw += tsk->nvcsw; + stats->nivcsw += tsk->nivcsw; +- } while_each_thread(first, tsk); ++ } while_each_thread_all(first, tsk); + + unlock_task_sighand(first, &flags); + rc = 0; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/time/timekeeping.c debian/binary-custom.d/openvz/src/kernel/time/timekeeping.c +--- ./kernel/time/timekeeping.c 2012-06-12 16:25:24.274312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/time/timekeeping.c 2012-11-13 15:20:15.428569065 +0000 +@@ -43,6 +43,7 @@ + * used instead. + */ + struct timespec xtime __attribute__ ((aligned (16))); ++EXPORT_SYMBOL_GPL(xtime); + struct timespec wall_to_monotonic __attribute__ ((aligned (16))); + static unsigned long total_sleep_time; /* seconds */ + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/timer.c debian/binary-custom.d/openvz/src/kernel/timer.c +--- ./kernel/timer.c 2012-06-12 16:25:24.274312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/timer.c 2012-11-13 15:20:15.428569065 +0000 +@@ -37,6 +37,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include +@@ -663,7 +665,11 @@ + spin_unlock_irq(&base->lock); + { + int preempt_count = preempt_count(); ++ struct ve_struct *ve; ++ ++ ve = set_exec_env(get_ve0()); + fn(data); ++ (void)set_exec_env(ve); + if (preempt_count != preempt_count()) { + printk(KERN_WARNING "huh, entered %p " + "with preempt_count %08x, exited" +@@ -880,6 +886,37 @@ + * calc_load - given tick count, update the avenrun load estimates. + * This is called while holding a write_lock on xtime_lock. + */ ++ ++ ++#ifdef CONFIG_VE ++static void calc_load_ve(void) ++{ ++ unsigned long flags, nr_unint, nr_active; ++ struct ve_struct *ve; ++ ++ read_lock(&ve_list_lock); ++ for_each_ve(ve) { ++ nr_active = nr_running_ve(ve) + nr_uninterruptible_ve(ve); ++ nr_active *= FIXED_1; ++ ++ CALC_LOAD(ve->avenrun[0], EXP_1, nr_active); ++ CALC_LOAD(ve->avenrun[1], EXP_5, nr_active); ++ CALC_LOAD(ve->avenrun[2], EXP_15, nr_active); ++ } ++ read_unlock(&ve_list_lock); ++ ++ nr_unint = nr_uninterruptible() * FIXED_1; ++ spin_lock_irqsave(&kstat_glb_lock, flags); ++ CALC_LOAD(kstat_glob.nr_unint_avg[0], EXP_1, nr_unint); ++ CALC_LOAD(kstat_glob.nr_unint_avg[1], EXP_5, nr_unint); ++ CALC_LOAD(kstat_glob.nr_unint_avg[2], EXP_15, nr_unint); ++ spin_unlock_irqrestore(&kstat_glb_lock, flags); ++ ++} ++#else ++#define calc_load_ve() do { } while (0) ++#endif ++ + static inline void calc_load(unsigned long ticks) + { + unsigned long active_tasks; /* fixed-point */ +@@ -892,6 +929,7 @@ + CALC_LOAD(avenrun[0], EXP_1, active_tasks); + CALC_LOAD(avenrun[1], EXP_5, active_tasks); + CALC_LOAD(avenrun[2], EXP_15, active_tasks); ++ calc_load_ve(); + count += LOAD_FREQ; + } while (count < 0); + } +@@ -1130,11 +1168,12 @@ + unsigned long mem_total, sav_total; + unsigned int mem_unit, bitcount; + unsigned long seq; ++ unsigned long *__avenrun; ++ struct timespec tp; + + memset(info, 0, sizeof(struct sysinfo)); + + do { +- struct timespec tp; + seq = read_seqbegin(&xtime_lock); + + /* +@@ -1152,18 +1191,34 @@ + tp.tv_nsec = tp.tv_nsec - NSEC_PER_SEC; + tp.tv_sec++; + } +- info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0); +- +- info->loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT); +- info->loads[1] = avenrun[1] << (SI_LOAD_SHIFT - FSHIFT); +- info->loads[2] = avenrun[2] << (SI_LOAD_SHIFT - FSHIFT); ++ } while (read_seqretry(&xtime_lock, seq)); + ++ if (ve_is_super(get_exec_env())) { ++ info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0); ++ __avenrun = &avenrun[0]; + info->procs = nr_threads; +- } while (read_seqretry(&xtime_lock, seq)); ++ } ++#ifdef CONFIG_VE ++ else { ++ struct ve_struct *ve; ++ ve = get_exec_env(); ++ __avenrun = &ve->avenrun[0]; ++ info->procs = atomic_read(&ve->pcounter); ++ info->uptime = tp.tv_sec - ve->start_timespec.tv_sec; ++ } ++#endif ++ info->loads[0] = __avenrun[0] << (SI_LOAD_SHIFT - FSHIFT); ++ info->loads[1] = __avenrun[1] << (SI_LOAD_SHIFT - FSHIFT); ++ info->loads[2] = __avenrun[2] << (SI_LOAD_SHIFT - FSHIFT); + + si_meminfo(info); + si_swapinfo(info); + ++#ifdef CONFIG_BEANCOUNTERS ++ if (virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_SYSINFO, info) ++ & NOTIFY_FAIL) ++ return -ENOMSG; ++#endif + /* + * If the sum of all the available memory (i.e. ram + swap) + * is less than can be stored in a 32 bit unsigned long then +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/user.c debian/binary-custom.d/openvz/src/kernel/user.c +--- ./kernel/user.c 2012-06-12 16:25:24.274312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/user.c 2012-11-13 15:20:15.432569063 +0000 +@@ -318,6 +318,7 @@ + else + local_irq_restore(flags); + } ++EXPORT_SYMBOL_GPL(free_uid); + + struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid) + { +@@ -406,6 +407,7 @@ + + return up; + } ++EXPORT_SYMBOL_GPL(alloc_uid); + + void switch_uid(struct user_struct *new_user) + { +@@ -436,6 +438,7 @@ + free_uid(old_user); + suid_keys(current); + } ++EXPORT_SYMBOL_GPL(switch_uid); + + void release_uids(struct user_namespace *ns) + { +@@ -467,7 +470,7 @@ + int n; + + uid_cachep = kmem_cache_create("uid_cache", sizeof(struct user_struct), +- 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); ++ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_UBC, NULL); + + for(n = 0; n < UIDHASH_SZ; ++n) + INIT_HLIST_HEAD(init_user_ns.uidhash_table + n); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/utsname_sysctl.c debian/binary-custom.d/openvz/src/kernel/utsname_sysctl.c +--- ./kernel/utsname_sysctl.c 2012-06-12 16:25:24.274312487 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/utsname_sysctl.c 2012-11-13 15:20:15.432569063 +0000 +@@ -27,6 +27,10 @@ + down_read(&uts_sem); + else + down_write(&uts_sem); ++ ++ if (strcmp(table->procname, "virt_osrelease") == 0) ++ return virt_utsname.release; ++ + return which; + } + +@@ -115,6 +119,7 @@ + .mode = 0644, + .proc_handler = proc_do_uts_string, + .strategy = sysctl_uts_string, ++ .virt_handler = 1, + }, + { + .ctl_name = KERN_DOMAINNAME, +@@ -124,6 +129,14 @@ + .mode = 0644, + .proc_handler = proc_do_uts_string, + .strategy = sysctl_uts_string, ++ .virt_handler = 1, ++ }, { ++ .procname = "virt_osrelease", ++ .data = virt_utsname.release, ++ .maxlen = sizeof(virt_utsname.release), ++ .mode = 0644, ++ .proc_handler = &proc_do_uts_string, ++ .strategy = sysctl_uts_string, + }, + {} + }; +@@ -140,7 +153,7 @@ + + static int __init utsname_sysctl_init(void) + { +- register_sysctl_table(uts_root_table); ++ register_glob_sysctl_table(uts_root_table); + return 0; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ve/Makefile debian/binary-custom.d/openvz/src/kernel/ve/Makefile +--- ./kernel/ve/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ve/Makefile 2012-11-13 15:20:15.432569063 +0000 +@@ -0,0 +1,16 @@ ++# ++# ++# kernel/ve/Makefile ++# ++# Copyright (C) 2000-2005 SWsoft ++# All rights reserved. ++# ++# Licensing governed by "linux/COPYING.SWsoft" file. ++ ++obj-$(CONFIG_VE) = ve.o veowner.o hooks.o devperms.o ++obj-$(CONFIG_VZ_WDOG) += vzwdog.o ++obj-$(CONFIG_VE_CALLS) += vzmon.o ++ ++vzmon-objs = vecalls.o ++ ++obj-$(CONFIG_VZ_DEV) += vzdev.o +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ve/devperms.c debian/binary-custom.d/openvz/src/kernel/ve/devperms.c +--- ./kernel/ve/devperms.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ve/devperms.c 2012-11-13 15:20:15.432569063 +0000 +@@ -0,0 +1,418 @@ ++/* ++ * linux/kernel/ve/devperms.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ * Devices permissions routines, ++ * character and block devices separately ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * Rules applied in the following order: ++ * MAJOR!=0, MINOR!=0 ++ * MAJOR!=0, MINOR==0 ++ * MAJOR==0, MINOR==0 ++ */ ++ ++struct devperms_struct { ++ dev_t dev; /* device id */ ++ unsigned char mask; ++ unsigned type; ++ envid_t veid; ++ ++ struct hlist_node hash; ++ struct rcu_head rcu; ++}; ++ ++static struct devperms_struct default_major_perms[] = { ++ { ++ MKDEV(UNIX98_PTY_MASTER_MAJOR, 0), ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ }, ++ { ++ MKDEV(UNIX98_PTY_SLAVE_MAJOR, 0), ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ }, ++ { ++ MKDEV(PTY_MASTER_MAJOR, 0), ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ }, ++ { ++ MKDEV(PTY_SLAVE_MAJOR, 0), ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ }, ++}; ++ ++static struct devperms_struct default_minor_perms[] = { ++ { ++ MKDEV(MEM_MAJOR, 3), /* null */ ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ }, ++ { ++ MKDEV(MEM_MAJOR, 5), /* zero */ ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ }, ++ { ++ MKDEV(MEM_MAJOR, 7), /* full */ ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ }, ++ { ++ MKDEV(TTYAUX_MAJOR, 0), /* tty */ ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ }, ++ { ++ MKDEV(TTYAUX_MAJOR, 2), /* ptmx */ ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ }, ++ { ++ MKDEV(MEM_MAJOR, 8), /* random */ ++ S_IROTH, ++ S_IFCHR, ++ }, ++ { ++ MKDEV(MEM_MAJOR, 9), /* urandom */ ++ S_IROTH, ++ S_IFCHR ++ }, ++}; ++ ++static struct devperms_struct default_deny_perms = { ++ MKDEV(0, 0), ++ 0, ++ S_IFCHR, ++}; ++ ++static inline struct devperms_struct *find_default_devperms(int type, dev_t dev) ++{ ++ int i; ++ ++ /* XXX all defaults perms are S_IFCHR */ ++ if (type != S_IFCHR) ++ return &default_deny_perms; ++ ++ for (i = 0; i < ARRAY_SIZE(default_minor_perms); i++) ++ if (MAJOR(dev) == MAJOR(default_minor_perms[i].dev) && ++ MINOR(dev) == MINOR(default_minor_perms[i].dev)) ++ return &default_minor_perms[i]; ++ ++ for (i = 0; i < ARRAY_SIZE(default_major_perms); i++) ++ if (MAJOR(dev) == MAJOR(default_major_perms[i].dev)) ++ return &default_major_perms[i]; ++ ++ return &default_deny_perms; ++} ++ ++#define DEVPERMS_HASH_SZ 512 ++#define devperms_hashfn(id, dev) \ ++ ( (id << 5) ^ (id >> 5) ^ (MAJOR(dev)) ^ MINOR(dev) ) & \ ++ (DEVPERMS_HASH_SZ - 1) ++ ++static DEFINE_SPINLOCK(devperms_hash_lock); ++static struct hlist_head devperms_hash[DEVPERMS_HASH_SZ]; ++ ++static inline struct devperms_struct *find_devperms(envid_t veid, ++ int type, ++ dev_t dev) ++{ ++ struct hlist_head *table; ++ struct devperms_struct *perms; ++ struct hlist_node *h; ++ ++ table = &devperms_hash[devperms_hashfn(veid, dev)]; ++ hlist_for_each_entry_rcu (perms, h, table, hash) ++ if (perms->type == type && perms->veid == veid && ++ MAJOR(perms->dev) == MAJOR(dev) && ++ MINOR(perms->dev) == MINOR(dev)) ++ return perms; ++ ++ return NULL; ++} ++ ++static void free_devperms(struct rcu_head *rcu) ++{ ++ struct devperms_struct *perms; ++ ++ perms = container_of(rcu, struct devperms_struct, rcu); ++ kfree(perms); ++} ++ ++/* API calls */ ++ ++void clean_device_perms_ve(envid_t veid) ++{ ++ int i; ++ struct devperms_struct *p; ++ struct hlist_node *n, *tmp; ++ ++ spin_lock(&devperms_hash_lock); ++ for (i = 0; i < DEVPERMS_HASH_SZ; i++) ++ hlist_for_each_entry_safe (p, n, tmp, &devperms_hash[i], hash) ++ if (p->veid == veid) { ++ hlist_del_rcu(&p->hash); ++ call_rcu(&p->rcu, free_devperms); ++ } ++ spin_unlock(&devperms_hash_lock); ++} ++ ++EXPORT_SYMBOL(clean_device_perms_ve); ++ ++/* ++ * Mode is a mask of ++ * FMODE_READ for read access (configurable by S_IROTH) ++ * FMODE_WRITE for write access (configurable by S_IWOTH) ++ * FMODE_QUOTACTL for quotactl access (configurable by S_IXGRP) ++ */ ++ ++int get_device_perms_ve(int dev_type, dev_t dev, int access_mode) ++{ ++ struct devperms_struct *p; ++ struct ve_struct *ve; ++ envid_t veid; ++ char mask; ++ ++ ve = get_exec_env(); ++ veid = ve->veid; ++ rcu_read_lock(); ++ ++ p = find_devperms(veid, dev_type | VE_USE_MINOR, dev); ++ if (p != NULL) ++ goto end; ++ ++ p = find_devperms(veid, dev_type | VE_USE_MAJOR, MKDEV(MAJOR(dev),0)); ++ if (p != NULL) ++ goto end; ++ ++ p = find_devperms(veid, dev_type, MKDEV(0,0)); ++ if (p != NULL) ++ goto end; ++ ++ if (ve->features & VE_FEATURE_DEF_PERMS) { ++ p = find_default_devperms(dev_type, dev); ++ if (p != NULL) ++ goto end; ++ } ++ ++ rcu_read_unlock(); ++ return -ENODEV; ++ ++end: ++ mask = p->mask; ++ rcu_read_unlock(); ++ ++ access_mode = "\000\004\002\006\010\014\012\016"[access_mode]; ++ return ((mask & access_mode) == access_mode) ? 0 : -EACCES; ++} ++ ++EXPORT_SYMBOL(get_device_perms_ve); ++ ++int set_device_perms_ve(envid_t veid, unsigned type, dev_t dev, unsigned mask) ++{ ++ struct devperms_struct *perms, *new_perms; ++ struct hlist_head *htable; ++ ++ new_perms = kmalloc(sizeof(struct devperms_struct), GFP_KERNEL); ++ ++ spin_lock(&devperms_hash_lock); ++ perms = find_devperms(veid, type, dev); ++ if (perms != NULL) { ++ kfree(new_perms); ++ perms->mask = mask & S_IALLUGO; ++ } else { ++ switch (type & VE_USE_MASK) { ++ case 0: ++ dev = 0; ++ break; ++ case VE_USE_MAJOR: ++ dev = MKDEV(MAJOR(dev),0); ++ break; ++ } ++ ++ new_perms->veid = veid; ++ new_perms->dev = dev; ++ new_perms->type = type; ++ new_perms->mask = mask & S_IALLUGO; ++ ++ htable = &devperms_hash[devperms_hashfn(new_perms->veid, ++ new_perms->dev)]; ++ hlist_add_head_rcu(&new_perms->hash, htable); ++ } ++ spin_unlock(&devperms_hash_lock); ++ return 0; ++} ++ ++EXPORT_SYMBOL(set_device_perms_ve); ++ ++#ifdef CONFIG_PROC_FS ++static int devperms_seq_show(struct seq_file *m, void *v) ++{ ++ struct devperms_struct *dp; ++ char dev_s[32], type_c; ++ unsigned use, type; ++ dev_t dev; ++ ++ dp = (struct devperms_struct *)v; ++ if (dp == (struct devperms_struct *)1L) { ++ seq_printf(m, "Version: 2.7\n"); ++ return 0; ++ } ++ ++ use = dp->type & VE_USE_MASK; ++ type = dp->type & S_IFMT; ++ dev = dp->dev; ++ ++ if ((use | VE_USE_MINOR) == use) ++ snprintf(dev_s, sizeof(dev_s), "%d:%d", MAJOR(dev), MINOR(dev)); ++ else if ((use | VE_USE_MAJOR) == use) ++ snprintf(dev_s, sizeof(dev_s), "%d:*", MAJOR(dp->dev)); ++ else ++ snprintf(dev_s, sizeof(dev_s), "*:*"); ++ ++ if (type == S_IFCHR) ++ type_c = 'c'; ++ else if (type == S_IFBLK) ++ type_c = 'b'; ++ else ++ type_c = '?'; ++ ++ seq_printf(m, "%10u %c %03o %s\n", dp->veid, type_c, dp->mask, dev_s); ++ return 0; ++} ++ ++static void *devperms_seq_start(struct seq_file *m, loff_t *pos) ++{ ++ loff_t cpos; ++ long slot; ++ struct devperms_struct *dp; ++ struct hlist_node *h; ++ ++ cpos = *pos; ++ rcu_read_lock(); ++ ++ if (cpos-- == 0) ++ return (void *)1L; ++ ++ for (slot = 0; slot < DEVPERMS_HASH_SZ; slot++) ++ hlist_for_each_entry_rcu (dp, h, &devperms_hash[slot], hash) ++ if (cpos-- == 0) { ++ m->private = (void *)slot; ++ return dp; ++ } ++ return NULL; ++} ++ ++static void *devperms_seq_next(struct seq_file *m, void *v, loff_t *pos) ++{ ++ long slot; ++ struct hlist_node *next; ++ struct devperms_struct *dp; ++ ++ dp = (struct devperms_struct *)v; ++ ++ if (unlikely(dp == (struct devperms_struct *)1L)) ++ slot = 0; ++ else { ++ next = rcu_dereference(dp->hash.next); ++ if (next != NULL) ++ goto out; ++ ++ slot = (long)m->private + 1; ++ } ++ ++ for (; slot < DEVPERMS_HASH_SZ; slot++) { ++ next = rcu_dereference(devperms_hash[slot].first); ++ if (next == NULL) ++ continue; ++ ++ m->private = (void *)slot; ++ goto out; ++ } ++ return NULL; ++ ++out: ++ (*pos)++; ++ return hlist_entry(next, struct devperms_struct, hash); ++} ++ ++static void devperms_seq_stop(struct seq_file *m, void *v) ++{ ++ rcu_read_unlock(); ++} ++ ++static struct seq_operations devperms_seq_op = { ++ .start = devperms_seq_start, ++ .next = devperms_seq_next, ++ .stop = devperms_seq_stop, ++ .show = devperms_seq_show, ++}; ++ ++static int devperms_open(struct inode *inode, struct file *file) ++{ ++ return seq_open(file, &devperms_seq_op); ++} ++ ++struct file_operations proc_devperms_ops = { ++ .open = devperms_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = seq_release, ++}; ++ ++EXPORT_SYMBOL(proc_devperms_ops); ++#endif ++ ++/* Initialisation */ ++ ++static struct devperms_struct original_perms[] = ++{ ++ { ++ MKDEV(0,0), ++ S_IROTH | S_IWOTH, ++ S_IFCHR, ++ 0, ++ }, ++ { ++ MKDEV(0,0), ++ S_IXGRP | S_IROTH | S_IWOTH, ++ S_IFBLK, ++ 0, ++ }, ++}; ++ ++static int __init init_devperms_hash(void) ++{ ++ hlist_add_head(&original_perms[0].hash, ++ &devperms_hash[devperms_hashfn(0, ++ original_perms[0].dev)]); ++ hlist_add_head(&original_perms[1].hash, ++ &devperms_hash[devperms_hashfn(0, ++ original_perms[1].dev)]); ++ return 0; ++} ++ ++core_initcall(init_devperms_hash); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ve/hooks.c debian/binary-custom.d/openvz/src/kernel/ve/hooks.c +--- ./kernel/ve/hooks.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ve/hooks.c 2012-11-13 15:20:15.432569063 +0000 +@@ -0,0 +1,114 @@ ++/* ++ * linux/kernel/ve/hooks.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct list_head ve_hooks[VE_MAX_CHAINS]; ++static DECLARE_RWSEM(ve_hook_sem); ++ ++void ve_hook_register(int chain, struct ve_hook *vh) ++{ ++ struct list_head *lh; ++ struct ve_hook *tmp; ++ ++ BUG_ON(chain > VE_MAX_CHAINS); ++ ++ down_write(&ve_hook_sem); ++ list_for_each(lh, &ve_hooks[chain]) { ++ tmp = list_entry(lh, struct ve_hook, list); ++ if (vh->priority < tmp->priority) ++ break; ++ } ++ ++ list_add_tail(&vh->list, lh); ++ up_write(&ve_hook_sem); ++} ++ ++EXPORT_SYMBOL(ve_hook_register); ++ ++void ve_hook_unregister(struct ve_hook *vh) ++{ ++ down_write(&ve_hook_sem); ++ list_del(&vh->list); ++ up_write(&ve_hook_sem); ++} ++ ++EXPORT_SYMBOL(ve_hook_unregister); ++ ++static inline int ve_hook_init(struct ve_hook *vh, struct ve_struct *ve) ++{ ++ int err; ++ ++ err = 0; ++ if (try_module_get(vh->owner)) { ++ err = vh->init(ve); ++ module_put(vh->owner); ++ } ++ return err; ++} ++ ++static inline void ve_hook_fini(struct ve_hook *vh, struct ve_struct *ve) ++{ ++ if (vh->fini != NULL && try_module_get(vh->owner)) { ++ vh->fini(ve); ++ module_put(vh->owner); ++ } ++} ++ ++int ve_hook_iterate_init(int chain, void *ve) ++{ ++ struct ve_hook *vh; ++ int err; ++ ++ err = 0; ++ ++ down_read(&ve_hook_sem); ++ list_for_each_entry(vh, &ve_hooks[chain], list) ++ if ((err = ve_hook_init(vh, ve)) < 0) ++ break; ++ ++ if (err) ++ list_for_each_entry_continue_reverse(vh, &ve_hooks[chain], list) ++ ve_hook_fini(vh, ve); ++ ++ up_read(&ve_hook_sem); ++ return err; ++} ++ ++EXPORT_SYMBOL(ve_hook_iterate_init); ++ ++void ve_hook_iterate_fini(int chain, void *ve) ++{ ++ struct ve_hook *vh; ++ ++ down_read(&ve_hook_sem); ++ list_for_each_entry_reverse(vh, &ve_hooks[chain], list) ++ ve_hook_fini(vh, ve); ++ up_read(&ve_hook_sem); ++} ++ ++EXPORT_SYMBOL(ve_hook_iterate_fini); ++ ++static int __init ve_hooks_init(void) ++{ ++ int i; ++ ++ for (i = 0; i < VE_MAX_CHAINS; i++) ++ INIT_LIST_HEAD(&ve_hooks[i]); ++ return 0; ++} ++ ++core_initcall(ve_hooks_init); ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ve/ve.c debian/binary-custom.d/openvz/src/kernel/ve/ve.c +--- ./kernel/ve/ve.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ve/ve.c 2012-11-13 15:20:15.432569063 +0000 +@@ -0,0 +1,160 @@ ++/* ++ * linux/kernel/ve/ve.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++/* ++ * 've.c' helper file performing VE sub-system initialization ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++unsigned long vz_rstamp = 0x37e0f59d; ++ ++#ifdef CONFIG_MODULES ++struct module no_module = { .state = MODULE_STATE_GOING }; ++EXPORT_SYMBOL(no_module); ++#endif ++ ++INIT_KSYM_MODULE(ip_tables); ++INIT_KSYM_MODULE(ip6_tables); ++INIT_KSYM_MODULE(iptable_filter); ++INIT_KSYM_MODULE(ip6table_filter); ++INIT_KSYM_MODULE(iptable_mangle); ++INIT_KSYM_MODULE(ip6table_mangle); ++INIT_KSYM_MODULE(ip_conntrack); ++INIT_KSYM_MODULE(nf_conntrack); ++INIT_KSYM_MODULE(nf_conntrack_ipv4); ++INIT_KSYM_MODULE(nf_conntrack_ipv6); ++INIT_KSYM_MODULE(ip_nat); ++INIT_KSYM_MODULE(nf_nat); ++INIT_KSYM_MODULE(iptable_nat); ++ ++INIT_KSYM_CALL(int, init_netfilter, (void)); ++INIT_KSYM_CALL(int, init_iptables, (void)); ++INIT_KSYM_CALL(int, init_ip6tables, (void)); ++INIT_KSYM_CALL(int, init_iptable_filter, (void)); ++INIT_KSYM_CALL(int, init_ip6table_filter, (void)); ++INIT_KSYM_CALL(int, init_iptable_mangle, (void)); ++INIT_KSYM_CALL(int, init_ip6table_mangle, (void)); ++INIT_KSYM_CALL(int, init_iptable_conntrack, (void)); ++INIT_KSYM_CALL(int, nf_conntrack_init_ve, (void)); ++INIT_KSYM_CALL(int, init_nf_ct_l3proto_ipv4, (void)); ++INIT_KSYM_CALL(int, init_nf_ct_l3proto_ipv6, (void)); ++INIT_KSYM_CALL(int, nf_nat_init, (void)); ++INIT_KSYM_CALL(int, init_iptable_nat, (void)); ++INIT_KSYM_CALL(void, fini_iptable_nat, (void)); ++INIT_KSYM_CALL(int, init_nftable_nat, (void)); ++INIT_KSYM_CALL(void, fini_nftable_nat, (void)); ++INIT_KSYM_CALL(void, nf_nat_cleanup, (void)); ++INIT_KSYM_CALL(void, fini_iptable_conntrack, (void)); ++INIT_KSYM_CALL(void, nf_conntrack_cleanup_ve, (void)); ++INIT_KSYM_CALL(void, fini_nf_ct_l3proto_ipv4, (void)); ++INIT_KSYM_CALL(void, fini_nf_ct_l3proto_ipv6, (void)); ++INIT_KSYM_CALL(void, fini_ip6table_filter, (void)); ++INIT_KSYM_CALL(void, fini_iptable_filter, (void)); ++INIT_KSYM_CALL(void, fini_ip6table_mangle, (void)); ++INIT_KSYM_CALL(void, fini_iptable_mangle, (void)); ++INIT_KSYM_CALL(void, fini_ip6tables, (void)); ++INIT_KSYM_CALL(void, fini_iptables, (void)); ++INIT_KSYM_CALL(void, fini_netfilter, (void)); ++ ++#if defined(CONFIG_VE_CALLS_MODULE) || defined(CONFIG_VE_CALLS) ++INIT_KSYM_MODULE(vzmon); ++INIT_KSYM_CALL(void, real_do_env_free, (struct ve_struct *env)); ++ ++void do_env_free(struct ve_struct *env) ++{ ++ KSYMSAFECALL_VOID(vzmon, real_do_env_free, (env)); ++} ++EXPORT_SYMBOL(do_env_free); ++#endif ++ ++#if defined(CONFIG_VE_ETHDEV) || defined(CONFIG_VE_ETHDEV_MODULE) ++INIT_KSYM_MODULE(vzethdev); ++INIT_KSYM_CALL(int, veth_open, (struct net_device *dev)); ++#endif ++ ++struct ve_struct ve0 = { ++ .ve_list = LIST_HEAD_INIT(ve0.ve_list), ++ .vetask_lh = LIST_HEAD_INIT(ve0.vetask_lh), ++ .start_jiffies = INITIAL_JIFFIES, ++#ifdef CONFIG_UNIX98_PTYS ++ .devpts_config = &devpts_config, ++#endif ++ .ve_ns = &init_nsproxy, ++ .ve_netns = &init_net, ++ .is_running = 1, ++ .op_sem = __RWSEM_INITIALIZER(ve0.op_sem), ++}; ++ ++EXPORT_SYMBOL(ve0); ++ ++DEFINE_PER_CPU_STATIC(struct ve_cpu_stats, ve0_cpu_stats); ++DEFINE_PER_CPU_STATIC(struct kstat_lat_pcpu_snap_struct, ve0_lat_stats); ++ ++LIST_HEAD(ve_list_head); ++rwlock_t ve_list_lock = RW_LOCK_UNLOCKED; ++ ++LIST_HEAD(ve_cleanup_list); ++DEFINE_SPINLOCK(ve_cleanup_lock); ++struct task_struct *ve_cleanup_thread; ++ ++EXPORT_SYMBOL(ve_list_lock); ++EXPORT_SYMBOL(ve_list_head); ++EXPORT_SYMBOL(ve_cleanup_lock); ++EXPORT_SYMBOL(ve_cleanup_list); ++EXPORT_SYMBOL(ve_cleanup_thread); ++ ++void init_ve0(void) ++{ ++ struct ve_struct *ve; ++ ++ ve = get_ve0(); ++ (void)get_ve(ve); ++ atomic_set(&ve->pcounter, 1); ++ ++ ve->cpu_stats = percpu_static_init(ve0_cpu_stats); ++ ve->sched_lat_ve.cur = percpu_static_init(ve0_lat_stats); ++ ++ list_add(&ve->ve_list, &ve_list_head); ++} ++ ++void ve_cleanup_schedule(struct ve_struct *ve) ++{ ++ BUG_ON(ve_cleanup_thread == NULL); ++ ++ spin_lock(&ve_cleanup_lock); ++ list_add_tail(&ve->cleanup_list, &ve_cleanup_list); ++ spin_unlock(&ve_cleanup_lock); ++ ++ wake_up_process(ve_cleanup_thread); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ve/vecalls.c debian/binary-custom.d/openvz/src/kernel/ve/vecalls.c +--- ./kernel/ve/vecalls.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ve/vecalls.c 2012-11-13 15:20:15.432569063 +0000 +@@ -0,0 +1,2916 @@ ++/* ++ * linux/kernel/ve/vecalls.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ */ ++ ++/* ++ * 'vecalls.c' is file with basic VE support. It provides basic primities ++ * along with initialization script ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#ifdef CONFIG_VZ_FAIRSCHED ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++ ++int nr_ve = 1; /* One VE always exists. Compatibility with vestat */ ++EXPORT_SYMBOL(nr_ve); ++ ++static int do_env_enter(struct ve_struct *ve, unsigned int flags); ++static int alloc_ve_tty_drivers(struct ve_struct* ve); ++static void free_ve_tty_drivers(struct ve_struct* ve); ++static int register_ve_tty_drivers(struct ve_struct* ve); ++static void unregister_ve_tty_drivers(struct ve_struct* ve); ++static int init_ve_tty_drivers(struct ve_struct *); ++static void fini_ve_tty_drivers(struct ve_struct *); ++static void clear_termios(struct tty_driver* driver ); ++#ifdef CONFIG_INET ++static void ve_mapped_devs_cleanup(struct ve_struct *ve); ++#endif ++ ++static void vecalls_exit(void); ++extern void grsecurity_setup(void); ++ ++struct ve_struct *__find_ve_by_id(envid_t veid) ++{ ++ struct ve_struct *ve; ++ ++ for_each_ve(ve) { ++ if (ve->veid == veid) ++ return ve; ++ } ++ return NULL; ++} ++EXPORT_SYMBOL(__find_ve_by_id); ++ ++struct ve_struct *get_ve_by_id(envid_t veid) ++{ ++ struct ve_struct *ve; ++ read_lock(&ve_list_lock); ++ ve = __find_ve_by_id(veid); ++ get_ve(ve); ++ read_unlock(&ve_list_lock); ++ return ve; ++} ++EXPORT_SYMBOL(get_ve_by_id); ++ ++/* ++ * real_put_ve() MUST be used instead of put_ve() inside vecalls. ++ */ ++void real_do_env_free(struct ve_struct *ve); ++static inline void real_put_ve(struct ve_struct *ve) ++{ ++ if (ve && atomic_dec_and_test(&ve->counter)) { ++ if (atomic_read(&ve->pcounter) > 0) ++ BUG(); ++ if (ve->is_running) ++ BUG(); ++ real_do_env_free(ve); ++ } ++} ++ ++static int ve_get_cpu_stat(envid_t veid, struct vz_cpu_stat __user *buf) ++{ ++ struct ve_struct *ve; ++ struct vz_cpu_stat *vstat; ++ int retval; ++ int i, cpu; ++ unsigned long tmp; ++ ++ if (!ve_is_super(get_exec_env()) && (veid != get_exec_env()->veid)) ++ return -EPERM; ++ if (veid == 0) ++ return -ESRCH; ++ ++ vstat = kzalloc(sizeof(*vstat), GFP_KERNEL); ++ if (!vstat) ++ return -ENOMEM; ++ ++ retval = -ESRCH; ++ read_lock(&ve_list_lock); ++ ve = __find_ve_by_id(veid); ++ if (ve == NULL) ++ goto out_unlock; ++ for_each_online_cpu(cpu) { ++ struct ve_cpu_stats *st; ++ ++ st = VE_CPU_STATS(ve, cpu); ++ vstat->user_jif += (unsigned long)cputime64_to_clock_t(st->user); ++ vstat->nice_jif += (unsigned long)cputime64_to_clock_t(st->nice); ++ vstat->system_jif += (unsigned long)cputime64_to_clock_t(st->system); ++ vstat->idle_clk += ve_sched_get_idle_time(ve, cpu); ++ } ++ vstat->uptime_clk = get_cycles() - ve->start_cycles; ++ vstat->uptime_jif = (unsigned long)cputime64_to_clock_t( ++ get_jiffies_64() - ve->start_jiffies); ++ for (i = 0; i < 3; i++) { ++ tmp = ve->avenrun[i] + (FIXED_1/200); ++ vstat->avenrun[i].val_int = LOAD_INT(tmp); ++ vstat->avenrun[i].val_frac = LOAD_FRAC(tmp); ++ } ++ read_unlock(&ve_list_lock); ++ ++ retval = 0; ++ if (copy_to_user(buf, vstat, sizeof(*vstat))) ++ retval = -EFAULT; ++out_free: ++ kfree(vstat); ++ return retval; ++ ++out_unlock: ++ read_unlock(&ve_list_lock); ++ goto out_free; ++} ++ ++static int real_setdevperms(envid_t veid, unsigned type, ++ dev_t dev, unsigned mask) ++{ ++ struct ve_struct *ve; ++ int err; ++ ++ if (!capable(CAP_SETVEID) || veid == 0) ++ return -EPERM; ++ ++ if ((ve = get_ve_by_id(veid)) == NULL) ++ return -ESRCH; ++ ++ down_read(&ve->op_sem); ++ err = -ESRCH; ++ if (ve->is_running) ++ err = set_device_perms_ve(veid, type, dev, mask); ++ up_read(&ve->op_sem); ++ real_put_ve(ve); ++ return err; ++} ++ ++/********************************************************************** ++ ********************************************************************** ++ * ++ * VE start: subsystems ++ * ++ ********************************************************************** ++ **********************************************************************/ ++ ++#ifdef CONFIG_INET ++#include ++#include ++#include ++#include ++ ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++static int init_fini_ve_mibs6(struct ve_struct *ve, int fini) ++{ ++ if (fini) ++ goto fini; ++ ++ if (!(ve->_ipv6_statistics[0] = alloc_percpu(struct ipstats_mib))) ++ goto out1; ++ if (!(ve->_ipv6_statistics[1] = alloc_percpu(struct ipstats_mib))) ++ goto out2; ++ if (!(ve->_icmpv6_statistics[0] = alloc_percpu(struct icmpv6_mib))) ++ goto out3; ++ if (!(ve->_icmpv6_statistics[1] = alloc_percpu(struct icmpv6_mib))) ++ goto out4; ++ if (!(ve->_icmpv6msg_statistics[0] = alloc_percpu(struct icmpv6msg_mib))) ++ goto out5; ++ if (!(ve->_icmpv6msg_statistics[1] = alloc_percpu(struct icmpv6msg_mib))) ++ goto out6; ++ if (!(ve->_udp_stats_in6[0] = alloc_percpu(struct udp_mib))) ++ goto out7; ++ if (!(ve->_udp_stats_in6[1] = alloc_percpu(struct udp_mib))) ++ goto out8; ++ if (!(ve->_udplite_stats_in6[0] = alloc_percpu(struct udp_mib))) ++ goto out9; ++ if (!(ve->_udplite_stats_in6[1] = alloc_percpu(struct udp_mib))) ++ goto out10; ++ return 0; ++ ++fini: ++ free_percpu(ve->_udplite_stats_in6[1]); ++out10: ++ free_percpu(ve->_udplite_stats_in6[0]); ++out9: ++ free_percpu(ve->_udp_stats_in6[1]); ++out8: ++ free_percpu(ve->_udp_stats_in6[0]); ++out7: ++ free_percpu(ve->_icmpv6msg_statistics[1]); ++out6: ++ free_percpu(ve->_icmpv6msg_statistics[0]); ++out5: ++ free_percpu(ve->_icmpv6_statistics[1]); ++out4: ++ free_percpu(ve->_icmpv6_statistics[0]); ++out3: ++ free_percpu(ve->_ipv6_statistics[1]); ++out2: ++ free_percpu(ve->_ipv6_statistics[0]); ++out1: ++ return -ENOMEM; ++} ++#else ++static int init_fini_ve_mibs6(struct ve_struct *ve, int fini) { return 0; } ++#endif ++ ++static int init_fini_ve_mibs(struct ve_struct *ve, int fini) ++{ ++ if (fini) ++ goto fini; ++ if (!(ve->_net_statistics[0] = alloc_percpu(struct linux_mib))) ++ goto out1; ++ if (!(ve->_net_statistics[1] = alloc_percpu(struct linux_mib))) ++ goto out2; ++ if (!(ve->_ip_statistics[0] = alloc_percpu(struct ipstats_mib))) ++ goto out3; ++ if (!(ve->_ip_statistics[1] = alloc_percpu(struct ipstats_mib))) ++ goto out4; ++ if (!(ve->_icmp_statistics[0] = alloc_percpu(struct icmp_mib))) ++ goto out5; ++ if (!(ve->_icmp_statistics[1] = alloc_percpu(struct icmp_mib))) ++ goto out6; ++ if (!(ve->_icmpmsg_statistics[0] = alloc_percpu(struct icmpmsg_mib))) ++ goto out7; ++ if (!(ve->_icmpmsg_statistics[1] = alloc_percpu(struct icmpmsg_mib))) ++ goto out8; ++ if (!(ve->_tcp_statistics[0] = alloc_percpu(struct tcp_mib))) ++ goto out9; ++ if (!(ve->_tcp_statistics[1] = alloc_percpu(struct tcp_mib))) ++ goto out10; ++ if (!(ve->_udp_statistics[0] = alloc_percpu(struct udp_mib))) ++ goto out11; ++ if (!(ve->_udp_statistics[1] = alloc_percpu(struct udp_mib))) ++ goto out12; ++ if (!(ve->_udplite_statistics[0] = alloc_percpu(struct udp_mib))) ++ goto out13; ++ if (!(ve->_udplite_statistics[1] = alloc_percpu(struct udp_mib))) ++ goto out14; ++ if (init_fini_ve_mibs6(ve, fini)) ++ goto out15; ++ return 0; ++ ++fini: ++ init_fini_ve_mibs6(ve, fini); ++out15: ++ free_percpu(ve->_udplite_statistics[1]); ++out14: ++ free_percpu(ve->_udplite_statistics[0]); ++out13: ++ free_percpu(ve->_udp_statistics[1]); ++out12: ++ free_percpu(ve->_udp_statistics[0]); ++out11: ++ free_percpu(ve->_tcp_statistics[1]); ++out10: ++ free_percpu(ve->_tcp_statistics[0]); ++out9: ++ free_percpu(ve->_icmpmsg_statistics[1]); ++out8: ++ free_percpu(ve->_icmpmsg_statistics[0]); ++out7: ++ free_percpu(ve->_icmp_statistics[1]); ++out6: ++ free_percpu(ve->_icmp_statistics[0]); ++out5: ++ free_percpu(ve->_ip_statistics[1]); ++out4: ++ free_percpu(ve->_ip_statistics[0]); ++out3: ++ free_percpu(ve->_net_statistics[1]); ++out2: ++ free_percpu(ve->_net_statistics[0]); ++out1: ++ return -ENOMEM; ++} ++ ++static inline int init_ve_mibs(struct ve_struct *ve) ++{ ++ return init_fini_ve_mibs(ve, 0); ++} ++ ++static inline void fini_ve_mibs(struct ve_struct *ve) ++{ ++ (void)init_fini_ve_mibs(ve, 1); ++} ++#else ++#define init_ve_mibs(ve) (0) ++#define fini_ve_mibs(ve) do { } while (0) ++#endif ++ ++static int prepare_proc_root(struct ve_struct *ve) ++{ ++ struct proc_dir_entry *de; ++ ++ de = kzalloc(sizeof(struct proc_dir_entry) + 6, GFP_KERNEL); ++ if (de == NULL) ++ return -ENOMEM; ++ ++ memcpy(de + 1, "/proc", 6); ++ de->name = (char *)(de + 1); ++ de->namelen = 5; ++ de->mode = S_IFDIR | S_IRUGO | S_IXUGO; ++ de->nlink = 2; ++ atomic_set(&de->count, 1); ++ ++ ve->proc_root = de; ++ return 0; ++} ++ ++#ifdef CONFIG_PROC_FS ++static int init_ve_proc(struct ve_struct *ve) ++{ ++ int err; ++ struct proc_dir_entry *de; ++ ++ err = prepare_proc_root(ve); ++ if (err) ++ goto out_root; ++ ++ err = register_ve_fs_type(ve, &proc_fs_type, ++ &ve->proc_fstype, &ve->proc_mnt); ++ if (err) ++ goto out_reg; ++ ++ err = -ENOMEM; ++ de = create_proc_entry("kmsg", S_IRUSR, NULL); ++ if (!de) ++ goto out_kmsg; ++ de->proc_fops = &proc_kmsg_operations; ++ ++ /* create necessary /proc subdirs in VE local proc tree */ ++ err = -ENOMEM; ++ de = create_proc_entry("vz", S_IFDIR|S_IRUGO|S_IXUGO, NULL); ++ if (!de) ++ goto out_vz; ++ ++ ve->_proc_net = proc_mkdir("net", NULL); ++ if (!ve->_proc_net) ++ goto out_net; ++ ve->_proc_net_stat = proc_mkdir("stat", ve->_proc_net); ++ if (!ve->_proc_net_stat) ++ goto out_net_stat; ++ ++ if (ve_snmp_proc_init(ve)) ++ goto out_snmp; ++ ++ ve->ve_ns->pid_ns->proc_mnt = mntget(ve->proc_mnt); ++ return 0; ++ ++out_snmp: ++ remove_proc_entry("stat", ve->_proc_net); ++out_net_stat: ++ remove_proc_entry("net", NULL); ++out_net: ++ remove_proc_entry("vz", NULL); ++out_vz: ++ remove_proc_entry("kmsg", NULL); ++out_kmsg: ++ unregister_ve_fs_type(ve->proc_fstype, ve->proc_mnt); ++ ve->proc_mnt = NULL; ++out_reg: ++ /* proc_fstype and proc_root are freed in real_put_ve -> free_ve_proc */ ++ ; ++out_root: ++ return err; ++} ++ ++static void fini_ve_proc(struct ve_struct *ve) ++{ ++ ve_snmp_proc_fini(ve); ++ remove_proc_entry("stat", ve->_proc_net); ++ remove_proc_entry("net", NULL); ++ remove_proc_entry("vz", NULL); ++ remove_proc_entry("kmsg", NULL); ++ unregister_ve_fs_type(ve->proc_fstype, ve->proc_mnt); ++ ve->proc_mnt = NULL; ++} ++ ++static void free_ve_proc(struct ve_struct *ve) ++{ ++ /* proc filesystem frees proc_dir_entries on remove_proc_entry() only, ++ so we check that everything was removed and not lost */ ++ if (ve->proc_root && ve->proc_root->subdir) { ++ struct proc_dir_entry *p = ve->proc_root; ++ printk(KERN_WARNING "CT: %d: proc entry /proc", ve->veid); ++ while ((p = p->subdir) != NULL) ++ printk("/%s", p->name); ++ printk(" is not removed!\n"); ++ } ++ ++ kfree(ve->proc_root); ++ kfree(ve->proc_fstype); ++ ++ ve->proc_fstype = NULL; ++ ve->proc_root = NULL; ++} ++#else ++#define init_ve_proc(ve) (0) ++#define fini_ve_proc(ve) do { } while (0) ++#define free_ve_proc(ve) do { } while (0) ++#endif ++ ++extern const struct file_operations proc_sys_file_operations; ++extern struct inode_operations proc_sys_inode_operations; ++ ++#ifdef CONFIG_SYSCTL ++static int init_ve_sysctl(struct ve_struct *ve) ++{ ++ int err; ++ ++#ifdef CONFIG_PROC_FS ++ err = -ENOMEM; ++ ve->proc_sys_root = proc_mkdir("sys", NULL); ++ if (ve->proc_sys_root == NULL) ++ goto out_proc; ++ ve->proc_sys_root->proc_iops = &proc_sys_inode_operations; ++ ve->proc_sys_root->proc_fops = &proc_sys_file_operations; ++ ve->proc_sys_root->nlink = 0; ++#endif ++ INIT_LIST_HEAD(&ve->sysctl_lh); ++ ++ err = devinet_sysctl_init(ve); ++ if (err) ++ goto out_dev; ++ ++ err = addrconf_sysctl_init(ve); ++ if (err) ++ goto out_dev6; ++ ++ return 0; ++ ++out_dev6: ++ devinet_sysctl_fini(ve); ++out_dev: ++#ifdef CONFIG_PROC_FS ++ remove_proc_entry("sys", NULL); ++out_proc: ++#endif ++ return err; ++} ++ ++static void fini_ve_sysctl(struct ve_struct *ve) ++{ ++ addrconf_sysctl_fini(ve); ++ devinet_sysctl_fini(ve); ++ remove_proc_entry("sys", NULL); ++} ++ ++static void free_ve_sysctl(struct ve_struct *ve) ++{ ++ addrconf_sysctl_free(ve); ++ devinet_sysctl_free(ve); ++} ++#else ++#define init_ve_sysctl(ve) (0) ++#define fini_ve_sysctl(ve) do { } while (0) ++#define free_ve_sysctl(ve) do { } while (0) ++#endif ++ ++#ifdef CONFIG_UNIX98_PTYS ++#include ++ ++/* ++ * DEVPTS needs a virtualization: each environment should see each own list of ++ * pseudo-terminals. ++ * To implement it we need to have separate devpts superblocks for each ++ * VE, and each VE should mount its own one. ++ * Thus, separate vfsmount structures are required. ++ * To minimize intrusion into vfsmount lookup code, separate file_system_type ++ * structures are created. ++ * ++ * In addition to this, patch fo character device itself is required, as file ++ * system itself is used only for MINOR/MAJOR lookup. ++ */ ++ ++static int init_ve_devpts(struct ve_struct *ve) ++{ ++ int err; ++ ++ err = -ENOMEM; ++ ve->devpts_config = kzalloc(sizeof(struct devpts_config), GFP_KERNEL); ++ if (ve->devpts_config == NULL) ++ goto out; ++ ++ ve->devpts_config->mode = 0600; ++ err = register_ve_fs_type(ve, &devpts_fs_type, ++ &ve->devpts_fstype, &ve->devpts_mnt); ++ if (err) { ++ kfree(ve->devpts_config); ++ ve->devpts_config = NULL; ++ } ++out: ++ return err; ++} ++ ++static void fini_ve_devpts(struct ve_struct *ve) ++{ ++ unregister_ve_fs_type(ve->devpts_fstype, ve->devpts_mnt); ++ /* devpts_fstype is freed in real_put_ve -> free_ve_filesystems */ ++ ve->devpts_mnt = NULL; ++ kfree(ve->devpts_config); ++ ve->devpts_config = NULL; ++} ++#else ++#define init_ve_devpts(ve) (0) ++#define fini_ve_devpts(ve) do { } while (0) ++#endif ++ ++static int init_ve_shmem(struct ve_struct *ve) ++{ ++ return register_ve_fs_type(ve, ++ &tmpfs_fs_type, ++ &ve->shmem_fstype, ++ &ve->shmem_mnt); ++} ++ ++static void fini_ve_shmem(struct ve_struct *ve) ++{ ++ unregister_ve_fs_type(ve->shmem_fstype, ve->shmem_mnt); ++ /* shmem_fstype is freed in real_put_ve -> free_ve_filesystems */ ++ ve->shmem_mnt = NULL; ++} ++ ++#ifdef CONFIG_SYSFS ++static int init_ve_sysfs_root(struct ve_struct *ve) ++{ ++ struct sysfs_dirent *sysfs_root; ++ ++ sysfs_root = kzalloc(sizeof(struct sysfs_dirent), GFP_KERNEL); ++ if (sysfs_root == NULL) ++ return -ENOMEM; ++ sysfs_root->s_name = ""; ++ atomic_set(&sysfs_root->s_count, 1); ++ sysfs_root->s_flags = SYSFS_DIR; ++ sysfs_root->s_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO; ++ sysfs_root->s_ino = 1; ++ ++ ve->_sysfs_root = sysfs_root; ++ return 0; ++} ++#endif ++ ++#if defined(CONFIG_NET) && defined(CONFIG_SYSFS) ++extern struct device_attribute ve_net_class_attributes[]; ++static inline int init_ve_netclass(struct ve_struct *ve) ++{ ++ struct class *nc; ++ int err; ++ ++ nc = kzalloc(sizeof(*nc), GFP_KERNEL); ++ if (!nc) ++ return -ENOMEM; ++ ++ nc->name = net_class.name; ++ nc->dev_release = net_class.dev_release; ++ nc->uevent = net_class.uevent; ++ nc->dev_attrs = ve_net_class_attributes; ++ ++ err = class_register(nc); ++ if (!err) { ++ ve->net_class = nc; ++ return 0; ++ } ++ kfree(nc); ++ return err; ++} ++ ++static inline void fini_ve_netclass(struct ve_struct *ve) ++{ ++ class_unregister(ve->net_class); ++ kfree(ve->net_class); ++ ve->net_class = NULL; ++} ++#else ++static inline int init_ve_netclass(struct ve_struct *ve) { return 0; } ++static inline void fini_ve_netclass(struct ve_struct *ve) { ; } ++#endif ++ ++extern struct kset devices_subsys; ++ ++static const struct { ++ unsigned minor; ++ char *name; ++} mem_class_devices [] = { ++ {3, "null"}, ++ {5, "zero"}, ++ {7, "full"}, ++ {8, "random"}, ++ {9, "urandom"}, ++ {0, NULL}, ++}; ++ ++static struct class *init_ve_mem_class(void) ++{ ++ int i; ++ struct class *ve_mem_class; ++ ++ ve_mem_class = class_create(THIS_MODULE, "mem"); ++ if (IS_ERR(ve_mem_class)) ++ return ve_mem_class; ++ for (i = 0; mem_class_devices[i].name; i++) ++ class_device_create(ve_mem_class, NULL, ++ MKDEV(MEM_MAJOR, mem_class_devices[i].minor), ++ NULL, mem_class_devices[i].name); ++ return ve_mem_class; ++} ++ ++ ++void fini_ve_mem_class(struct class *ve_mem_class) ++{ ++ int i; ++ ++ for (i = 0; mem_class_devices[i].name; i++) ++ class_device_destroy(ve_mem_class, ++ MKDEV(MEM_MAJOR, mem_class_devices[i].minor)); ++ class_destroy(ve_mem_class); ++} ++ ++static int init_ve_sysfs(struct ve_struct *ve) ++{ ++ struct kset *subsys; ++ int err; ++ ++#ifdef CONFIG_SYSFS ++ err = 0; ++ if (ve->features & VE_FEATURE_SYSFS) { ++ err = init_ve_sysfs_root(ve); ++ if (err != 0) ++ goto out; ++ err = register_ve_fs_type(ve, ++ &sysfs_fs_type, ++ &ve->sysfs_fstype, ++ &ve->sysfs_mnt); ++ } ++ if (err != 0) ++ goto out_fs_type; ++#endif ++ err = -ENOMEM; ++ subsys = kzalloc(sizeof(*subsys), GFP_KERNEL); ++ ve->class_obj_subsys = subsys; ++ if (subsys == NULL) ++ goto out_class_obj; ++ /* ick, this is ugly, the things we go through to keep from showing up ++ * in sysfs... */ ++ subsys->kobj.k_name = kstrdup(class_obj_subsys.kobj.k_name, GFP_KERNEL); ++ if (!subsys->kobj.k_name) ++ goto out_subsys1; ++ subsys->ktype = class_obj_subsys.ktype; ++ subsys->uevent_ops = class_obj_subsys.uevent_ops; ++ kset_init(subsys); ++ if (!subsys->kobj.parent) ++ subsys->kobj.parent = &subsys->kobj; ++ ++ subsys = kzalloc(sizeof(*subsys), GFP_KERNEL); ++ ve->class_subsys = subsys; ++ if (subsys == NULL) ++ goto out_class_subsys; ++ /* ick, this is ugly, the things we go through to keep from showing up ++ * in sysfs... */ ++ subsys->kobj.k_name = kstrdup(class_subsys.kobj.k_name, GFP_KERNEL); ++ if (!subsys->kobj.k_name) ++ goto out_subsys2; ++ subsys->ktype = class_subsys.ktype; ++ subsys->uevent_ops = class_subsys.uevent_ops; ++ ++ err = subsystem_register(subsys); ++ if (err != 0) ++ goto out_register; ++ ++ subsys = kzalloc(sizeof(*subsys), GFP_KERNEL); ++ ve->devices_subsys = subsys; ++ if (!subsys) ++ goto out_subsys3; ++ subsys->kobj.k_name = kstrdup(devices_subsys.kobj.k_name, GFP_KERNEL); ++ if (!subsys->kobj.k_name) ++ goto out_subsys4; ++ subsys->ktype = devices_subsys.ktype; ++ subsys->uevent_ops = devices_subsys.uevent_ops; ++ ++ err = subsystem_register(subsys); ++ if (err < 0) ++ goto out_register2; ++ ++ err = init_ve_netclass(ve); ++ if (err) ++ goto out_nc; ++ ++ ve->tty_class = init_ve_tty_class(); ++ if (IS_ERR(ve->tty_class)) { ++ err = PTR_ERR(ve->tty_class); ++ ve->tty_class = NULL; ++ goto out_tty_class_register; ++ } ++ ++ ve->mem_class = init_ve_mem_class(); ++ if (IS_ERR(ve->mem_class)) { ++ err = PTR_ERR(ve->mem_class); ++ ve->mem_class = NULL; ++ goto out_mem_class_register; ++ } ++ ++ return err; ++ ++out_mem_class_register: ++ fini_ve_tty_class(ve->tty_class); ++out_tty_class_register: ++ fini_ve_netclass(ve); ++out_nc: ++ subsystem_unregister(ve->devices_subsys); ++out_register2: ++ kfree(ve->devices_subsys->kobj.k_name); ++out_subsys4: ++ kfree(ve->devices_subsys); ++out_subsys3: ++ subsystem_unregister(ve->class_subsys); ++out_register: ++ kfree(ve->class_subsys->kobj.k_name); ++out_subsys2: ++ kfree(ve->class_subsys); ++out_class_subsys: ++ kfree(ve->class_obj_subsys->kobj.k_name); ++out_subsys1: ++ kfree(ve->class_obj_subsys); ++out_class_obj: ++#ifdef CONFIG_SYSFS ++ unregister_ve_fs_type(ve->sysfs_fstype, ve->sysfs_mnt); ++ /* sysfs_fstype is freed in real_put_ve -> free_ve_filesystems */ ++out_fs_type: ++ kfree(ve->_sysfs_root); ++ ve->_sysfs_root = NULL; ++#endif ++ ve->class_subsys = NULL; ++ ve->class_obj_subsys = NULL; ++#ifdef CONFIG_SYSFS ++out: ++#endif ++ return err; ++} ++ ++static void fini_ve_sysfs(struct ve_struct *ve) ++{ ++ fini_ve_mem_class(ve->mem_class); ++ fini_ve_tty_class(ve->tty_class); ++ fini_ve_netclass(ve); ++ subsystem_unregister(ve->devices_subsys); ++ subsystem_unregister(ve->class_subsys); ++ kfree(ve->devices_subsys->kobj.k_name); ++ kfree(ve->class_subsys->kobj.k_name); ++ kfree(ve->class_obj_subsys->kobj.k_name); ++ kfree(ve->devices_subsys); ++ kfree(ve->class_subsys); ++ kfree(ve->class_obj_subsys); ++ ++ ve->class_subsys = NULL; ++ ve->class_obj_subsys = NULL; ++#ifdef CONFIG_SYSFS ++ unregister_ve_fs_type(ve->sysfs_fstype, ve->sysfs_mnt); ++ ve->sysfs_mnt = NULL; ++ kfree(ve->_sysfs_root); ++ ve->_sysfs_root = NULL; ++ /* sysfs_fstype is freed in real_put_ve -> free_ve_filesystems */ ++#endif ++} ++ ++static void free_ve_filesystems(struct ve_struct *ve) ++{ ++#ifdef CONFIG_SYSFS ++ kfree(ve->sysfs_fstype); ++ ve->sysfs_fstype = NULL; ++#endif ++ kfree(ve->shmem_fstype); ++ ve->shmem_fstype = NULL; ++ ++ kfree(ve->devpts_fstype); ++ ve->devpts_fstype = NULL; ++ ++ free_ve_proc(ve); ++} ++ ++static int init_printk(struct ve_struct *ve) ++{ ++ struct ve_prep_printk { ++ wait_queue_head_t log_wait; ++ unsigned long log_start; ++ unsigned long log_end; ++ unsigned long logged_chars; ++ } *tmp; ++ ++ tmp = kzalloc(sizeof(struct ve_prep_printk), GFP_KERNEL); ++ if (!tmp) ++ return -ENOMEM; ++ ++ init_waitqueue_head(&tmp->log_wait); ++ ve->_log_wait = &tmp->log_wait; ++ ve->_log_start = &tmp->log_start; ++ ve->_log_end = &tmp->log_end; ++ ve->_logged_chars = &tmp->logged_chars; ++ /* ve->log_buf will be initialized later by ve_log_init() */ ++ return 0; ++} ++ ++static void fini_printk(struct ve_struct *ve) ++{ ++ /* ++ * there is no spinlock protection here because nobody can use ++ * log_buf at the moments when this code is called. ++ */ ++ kfree(ve->log_buf); ++ kfree(ve->_log_wait); ++} ++ ++static void fini_venet(struct ve_struct *ve) ++{ ++#ifdef CONFIG_INET ++ tcp_v4_kill_ve_sockets(ve); ++ ve_mapped_devs_cleanup(ve); ++ synchronize_net(); ++#endif ++} ++ ++static int init_ve_sched(struct ve_struct *ve) ++{ ++#ifdef CONFIG_VZ_FAIRSCHED ++ int err; ++ ++ /* ++ * We refuse to switch to an already existing node since nodes ++ * keep a pointer to their ve_struct... ++ */ ++ err = sys_fairsched_mknod(0, 1, ve->veid); ++ if (err < 0) { ++ printk(KERN_WARNING "Can't create fairsched node %d\n", ++ ve->veid); ++ return err; ++ } ++ err = sys_fairsched_mvpr(current->pid, ve->veid); ++ if (err) { ++ printk(KERN_WARNING "Can't switch to fairsched node %d\n", ++ ve->veid); ++ if (sys_fairsched_rmnod(ve->veid)) ++ printk(KERN_ERR "Can't clean fairsched node %d\n", ++ ve->veid); ++ return err; ++ } ++#endif ++ ve_sched_attach(ve); ++ return 0; ++} ++ ++static void fini_ve_sched(struct ve_struct *ve) ++{ ++#ifdef CONFIG_VZ_FAIRSCHED ++ if (task_fairsched_node_id(current) == ve->veid) ++ if (sys_fairsched_mvpr(current->pid, FAIRSCHED_INIT_NODE_ID)) ++ printk(KERN_WARNING "Can't leave fairsched node %d\n", ++ ve->veid); ++ if (sys_fairsched_rmnod(ve->veid)) ++ printk(KERN_ERR "Can't remove fairsched node %d\n", ++ ve->veid); ++#endif ++} ++ ++/* ++ * Namespaces ++ */ ++ ++static inline int init_ve_namespaces(struct ve_struct *ve, ++ struct nsproxy **old) ++{ ++ int err; ++ struct task_struct *tsk; ++ struct nsproxy *cur; ++ ++ tsk = current; ++ cur = tsk->nsproxy; ++ ++ err = copy_namespaces(CLONE_NAMESPACES_MASK & ~CLONE_NEWNET, tsk); ++ if (err < 0) ++ return err; ++ ++ ve->ve_ns = get_nsproxy(tsk->nsproxy); ++ memcpy(ve->ve_ns->uts_ns->name.release, virt_utsname.release, ++ sizeof(virt_utsname.release)); ++ ++ if (cur->pid_ns->flags & PID_NS_HIDE_CHILD) ++ ve->ve_ns->pid_ns->flags |= PID_NS_HIDDEN; ++ ++ *old = cur; ++ return 0; ++} ++ ++static inline void fini_ve_namespaces(struct ve_struct *ve, ++ struct nsproxy *old) ++{ ++ struct task_struct *tsk = current; ++ struct nsproxy *tmp; ++ ++ if (old) { ++ tmp = tsk->nsproxy; ++ tsk->nsproxy = get_nsproxy(old); ++ put_nsproxy(tmp); ++ tmp = ve->ve_ns; ++ ve->ve_ns = get_nsproxy(old); ++ put_nsproxy(tmp); ++ } else ++ put_nsproxy(ve->ve_ns); ++} ++ ++static int init_ve_netns(struct ve_struct *ve, struct nsproxy **old) ++{ ++ int err; ++ struct task_struct *tsk; ++ struct nsproxy *cur; ++ ++ tsk = current; ++ cur = tsk->nsproxy; ++ ++ err = copy_namespaces(CLONE_NEWNET, tsk); ++ if (err < 0) ++ return err; ++ ++ put_nsproxy(ve->ve_ns); ++ ve->ve_ns = get_nsproxy(tsk->nsproxy); ++ ve->ve_netns = get_net(ve->ve_ns->net_ns); ++ *old = cur; ++ return 0; ++} ++ ++static inline void switch_ve_namespaces(struct ve_struct *ve, ++ struct task_struct *tsk) ++{ ++ struct nsproxy *old_ns; ++ struct nsproxy *new_ns; ++ ++ BUG_ON(tsk != current); ++ old_ns = tsk->nsproxy; ++ new_ns = ve->ve_ns; ++ ++ if (old_ns != new_ns) { ++ tsk->nsproxy = get_nsproxy(new_ns); ++ put_nsproxy(old_ns); ++ } ++} ++ ++static __u64 get_ve_features(env_create_param_t *data, int datalen) ++{ ++ __u64 known_features; ++ ++ if (datalen < sizeof(struct env_create_param3)) ++ /* this version of vzctl is aware of VE_FEATURES_OLD only */ ++ known_features = VE_FEATURES_OLD; ++ else ++ known_features = data->known_features; ++ ++ /* ++ * known features are set as required ++ * yet unknown features are set as in VE_FEATURES_DEF ++ */ ++ return (data->feature_mask & known_features) | ++ (VE_FEATURES_DEF & ~known_features); ++} ++ ++static int init_ve_struct(struct ve_struct *ve, envid_t veid, ++ u32 class_id, env_create_param_t *data, int datalen) ++{ ++ (void)get_ve(ve); ++ ve->veid = veid; ++ ve->class_id = class_id; ++ ve->features = get_ve_features(data, datalen); ++ INIT_LIST_HEAD(&ve->vetask_lh); ++ init_rwsem(&ve->op_sem); ++ ++ ve->start_timespec = current->start_time; ++ /* The value is wrong, but it is never compared to process ++ * start times */ ++ ve->start_jiffies = get_jiffies_64(); ++ ve->start_cycles = get_cycles(); ++ ++ return 0; ++} ++ ++/********************************************************************** ++ ********************************************************************** ++ * ++ * /proc/meminfo virtualization ++ * ++ ********************************************************************** ++ **********************************************************************/ ++static int ve_set_meminfo(envid_t veid, unsigned long val) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ struct ve_struct *ve; ++ ++ ve = get_ve_by_id(veid); ++ if (!ve) ++ return -EINVAL; ++ ++ ve->meminfo_val = val; ++ real_put_ve(ve); ++ return 0; ++#else ++ return -ENOTTY; ++#endif ++} ++ ++static int init_ve_meminfo(struct ve_struct *ve) ++{ ++ ve->meminfo_val = 0; ++ return 0; ++} ++ ++static inline void fini_ve_meminfo(struct ve_struct *ve) ++{ ++} ++ ++static void set_ve_root(struct ve_struct *ve, struct task_struct *tsk) ++{ ++ read_lock(&tsk->fs->lock); ++ ve->fs_rootmnt = tsk->fs->rootmnt; ++ ve->fs_root = tsk->fs->root; ++ read_unlock(&tsk->fs->lock); ++ mark_tree_virtual(ve->fs_rootmnt, ve->fs_root); ++} ++ ++static void set_ve_caps(struct ve_struct *ve, struct task_struct *tsk) ++{ ++ /* required for real_setdevperms from register_ve_ above */ ++ memcpy(&ve->ve_cap_bset, &tsk->cap_effective, sizeof(kernel_cap_t)); ++ cap_lower(ve->ve_cap_bset, CAP_SETVEID); ++} ++ ++static int ve_list_add(struct ve_struct *ve) ++{ ++ write_lock_irq(&ve_list_lock); ++ if (__find_ve_by_id(ve->veid) != NULL) ++ goto err_exists; ++ ++ list_add(&ve->ve_list, &ve_list_head); ++ nr_ve++; ++ write_unlock_irq(&ve_list_lock); ++ return 0; ++ ++err_exists: ++ write_unlock_irq(&ve_list_lock); ++ return -EEXIST; ++} ++ ++static void ve_list_del(struct ve_struct *ve) ++{ ++ write_lock_irq(&ve_list_lock); ++ list_del(&ve->ve_list); ++ nr_ve--; ++ write_unlock_irq(&ve_list_lock); ++} ++ ++static void set_task_ve_caps(struct task_struct *tsk, struct ve_struct *ve) ++{ ++ spin_lock(&task_capability_lock); ++ cap_mask(tsk->cap_effective, ve->ve_cap_bset); ++ cap_mask(tsk->cap_inheritable, ve->ve_cap_bset); ++ cap_mask(tsk->cap_permitted, ve->ve_cap_bset); ++ spin_unlock(&task_capability_lock); ++} ++ ++void ve_move_task(struct task_struct *tsk, struct ve_struct *new) ++{ ++ struct ve_struct *old; ++ ++ might_sleep(); ++ BUG_ON(tsk != current); ++ BUG_ON(!(thread_group_leader(tsk) && thread_group_empty(tsk))); ++ ++ /* this probihibts ptracing of task entered to VE from host system */ ++ tsk->mm->vps_dumpable = 0; ++ /* setup capabilities before enter */ ++ set_task_ve_caps(tsk, new); ++ ++ old = tsk->ve_task_info.owner_env; ++ tsk->ve_task_info.owner_env = new; ++ tsk->ve_task_info.exec_env = new; ++ ++ write_lock_irq(&tasklist_lock); ++ list_del_rcu(&tsk->ve_task_info.vetask_list); ++ write_unlock_irq(&tasklist_lock); ++ ++ synchronize_rcu(); ++ ++ write_lock_irq(&tasklist_lock); ++ list_add_tail_rcu(&tsk->ve_task_info.vetask_list, ++ &new->vetask_lh); ++ write_unlock_irq(&tasklist_lock); ++ ++ atomic_dec(&old->pcounter); ++ real_put_ve(old); ++ ++ atomic_inc(&new->pcounter); ++ get_ve(new); ++} ++ ++EXPORT_SYMBOL(ve_move_task); ++ ++#ifdef CONFIG_VE_IPTABLES ++extern int init_netfilter(void); ++extern void fini_netfilter(void); ++#define init_ve_netfilter() init_netfilter() ++#define fini_ve_netfilter() fini_netfilter() ++ ++#define KSYMIPTINIT(mask, ve, full_mask, mod, name, args) \ ++({ \ ++ int ret = 0; \ ++ if (VE_IPT_CMP(mask, full_mask) && \ ++ VE_IPT_CMP((ve)->_iptables_modules, \ ++ full_mask & ~(full_mask##_MOD))) { \ ++ ret = KSYMERRCALL(1, mod, name, args); \ ++ if (ret == 0) \ ++ (ve)->_iptables_modules |= \ ++ full_mask##_MOD; \ ++ if (ret == 1) \ ++ ret = 0; \ ++ } \ ++ ret; \ ++}) ++ ++#define KSYMIPTFINI(mask, full_mask, mod, name, args) \ ++({ \ ++ if (VE_IPT_CMP(mask, full_mask##_MOD)) \ ++ KSYMSAFECALL_VOID(mod, name, args); \ ++}) ++ ++ ++static int do_ve_iptables(struct ve_struct *ve, __u64 init_mask, ++ int init_or_cleanup) ++{ ++ int err; ++ ++ /* Remove when userspace will start supplying IPv6-related bits. */ ++ init_mask &= ~VE_IP_IPTABLES6; ++ init_mask &= ~VE_IP_FILTER6; ++ init_mask &= ~VE_IP_MANGLE6; ++ init_mask &= ~VE_IP_IPTABLE_NAT_MOD; ++ init_mask &= ~VE_NF_CONNTRACK_MOD; ++ if ((init_mask & VE_IP_IPTABLES) == VE_IP_IPTABLES) ++ init_mask |= VE_IP_IPTABLES6; ++ if ((init_mask & VE_IP_FILTER) == VE_IP_FILTER) ++ init_mask |= VE_IP_FILTER6; ++ if ((init_mask & VE_IP_MANGLE) == VE_IP_MANGLE) ++ init_mask |= VE_IP_MANGLE6; ++ if ((init_mask & VE_IP_NAT) == VE_IP_NAT) ++ init_mask |= VE_IP_IPTABLE_NAT; ++ ++ if ((init_mask & VE_IP_CONNTRACK) == VE_IP_CONNTRACK) ++ init_mask |= VE_NF_CONNTRACK; ++ ++ err = 0; ++ if (!init_or_cleanup) ++ goto cleanup; ++ ++ /* init part */ ++#if defined(CONFIG_IP_NF_IPTABLES) || \ ++ defined(CONFIG_IP_NF_IPTABLES_MODULE) ++ err = KSYMIPTINIT(init_mask, ve, VE_IP_IPTABLES, ++ ip_tables, init_iptables, ()); ++ if (err < 0) ++ goto err_iptables; ++#endif ++#if defined(CONFIG_IP6_NF_IPTABLES) || \ ++ defined(CONFIG_IP6_NF_IPTABLES_MODULE) ++ err = KSYMIPTINIT(init_mask, ve, VE_IP_IPTABLES6, ++ ip6_tables, init_ip6tables, ()); ++ if (err < 0) ++ goto err_ip6tables; ++#endif ++#if defined(CONFIG_NF_CONNTRACK_IPV4) || \ ++ defined(CONFIG_NF_CONNTRACK_IPV4_MODULE) ++ err = KSYMIPTINIT(init_mask, ve, VE_NF_CONNTRACK, ++ nf_conntrack, nf_conntrack_init_ve, ()); ++ if (err < 0) ++ goto err_nf_conntrack; ++ ++ err = KSYMIPTINIT(init_mask, ve, VE_IP_CONNTRACK, ++ nf_conntrack_ipv4, init_nf_ct_l3proto_ipv4, ()); ++ if (err < 0) ++ goto err_nf_conntrack_ipv4; ++#endif ++#if defined(CONFIG_NF_NAT) || \ ++ defined(CONFIG_NF_NAT_MODULE) ++ err = KSYMIPTINIT(init_mask, ve, VE_IP_NAT, ++ nf_nat, nf_nat_init, ()); ++ if (err < 0) ++ goto err_nftable_nat; ++ err = KSYMIPTINIT(init_mask, ve, VE_IP_IPTABLE_NAT, ++ iptable_nat, init_nftable_nat, ()); ++ if (err < 0) ++ goto err_nftable_nat2; ++#endif ++#if defined(CONFIG_IP_NF_FILTER) || \ ++ defined(CONFIG_IP_NF_FILTER_MODULE) ++ err = KSYMIPTINIT(init_mask, ve, VE_IP_FILTER, ++ iptable_filter, init_iptable_filter, ()); ++ if (err < 0) ++ goto err_iptable_filter; ++#endif ++#if defined(CONFIG_IP6_NF_FILTER) || \ ++ defined(CONFIG_IP6_NF_FILTER_MODULE) ++ err = KSYMIPTINIT(init_mask, ve, VE_IP_FILTER6, ++ ip6table_filter, init_ip6table_filter, ()); ++ if (err < 0) ++ goto err_ip6table_filter; ++#endif ++#if defined(CONFIG_IP_NF_MANGLE) || \ ++ defined(CONFIG_IP_NF_MANGLE_MODULE) ++ err = KSYMIPTINIT(init_mask, ve, VE_IP_MANGLE, ++ iptable_mangle, init_iptable_mangle, ()); ++ if (err < 0) ++ goto err_iptable_mangle; ++#endif ++#if defined(CONFIG_IP6_NF_MANGLE) || \ ++ defined(CONFIG_IP6_NF_MANGLE_MODULE) ++ err = KSYMIPTINIT(init_mask, ve, VE_IP_MANGLE6, ++ ip6table_mangle, init_ip6table_mangle, ()); ++ if (err < 0) ++ goto err_ip6table_mangle; ++#endif ++ return 0; ++ ++/* ------------------------------------------------------------------------- */ ++ ++cleanup: ++#if defined(CONFIG_IP6_NF_MANGLE) || \ ++ defined(CONFIG_IP6_NF_MANGLE_MODULE) ++ KSYMIPTFINI(ve->_iptables_modules, VE_IP_MANGLE6, ++ ip6table_mangle, fini_ip6table_mangle, ()); ++err_ip6table_mangle: ++#endif ++#if defined(CONFIG_IP_NF_MANGLE) || \ ++ defined(CONFIG_IP_NF_MANGLE_MODULE) ++ KSYMIPTFINI(ve->_iptables_modules, VE_IP_MANGLE, ++ iptable_mangle, fini_iptable_mangle, ()); ++err_iptable_mangle: ++#endif ++#if defined(CONFIG_IP6_NF_FILTER) || \ ++ defined(CONFIG_IP6_NF_FILTER_MODULE) ++ KSYMIPTFINI(ve->_iptables_modules, VE_IP_FILTER6, ++ ip6table_filter, fini_ip6table_filter, ()); ++err_ip6table_filter: ++#endif ++#if defined(CONFIG_IP_NF_FILTER) || \ ++ defined(CONFIG_IP_NF_FILTER_MODULE) ++ KSYMIPTFINI(ve->_iptables_modules, VE_IP_FILTER, ++ iptable_filter, fini_iptable_filter, ()); ++err_iptable_filter: ++#endif ++#if defined(CONFIG_NF_NAT) || \ ++ defined(CONFIG_NF_NAT_MODULE) ++ KSYMIPTFINI(ve->_iptables_modules, VE_IP_IPTABLE_NAT, ++ iptable_nat, fini_nftable_nat, ()); ++err_nftable_nat2: ++ KSYMIPTFINI(ve->_iptables_modules, VE_IP_NAT, ++ nf_nat, nf_nat_cleanup, ()); ++err_nftable_nat: ++#endif ++#if defined(CONFIG_NF_CONNTRACK_IPV4) || \ ++ defined(CONFIG_NF_CONNTRACK_IPV4_MODULE) ++ KSYMIPTFINI(ve->_iptables_modules, VE_IP_CONNTRACK, ++ nf_conntrack_ipv4, fini_nf_ct_l3proto_ipv4, ()); ++err_nf_conntrack_ipv4: ++ KSYMIPTFINI(ve->_iptables_modules, VE_NF_CONNTRACK, ++ nf_conntrack, nf_conntrack_cleanup_ve, ()); ++err_nf_conntrack: ++#endif ++#if defined(CONFIG_IP6_NF_IPTABLES) || \ ++ defined(CONFIG_IP6_NF_IPTABLES_MODULE) ++ KSYMIPTFINI(ve->_iptables_modules, VE_IP_IPTABLES6, ++ ip6_tables, fini_ip6tables, ()); ++err_ip6tables: ++#endif ++#if defined(CONFIG_IP_NF_IPTABLES) || \ ++ defined(CONFIG_IP_NF_IPTABLES_MODULE) ++ KSYMIPTFINI(ve->_iptables_modules, VE_IP_IPTABLES, ++ ip_tables, fini_iptables, ()); ++err_iptables: ++#endif ++ ve->_iptables_modules = 0; ++ ++ return err; ++} ++ ++static inline int init_ve_iptables(struct ve_struct *ve, __u64 init_mask) ++{ ++ return do_ve_iptables(ve, init_mask, 1); ++} ++ ++static inline void fini_ve_iptables(struct ve_struct *ve, __u64 init_mask) ++{ ++ (void)do_ve_iptables(ve, init_mask, 0); ++} ++ ++#else ++#define init_ve_iptables(x, y) (0) ++#define fini_ve_iptables(x, y) do { } while (0) ++#define init_ve_netfilter() (0) ++#define fini_ve_netfilter() do { } while (0) ++#endif ++ ++static inline int init_ve_cpustats(struct ve_struct *ve) ++{ ++ ve->cpu_stats = alloc_percpu(struct ve_cpu_stats); ++ if (ve->cpu_stats == NULL) ++ return -ENOMEM; ++ ve->sched_lat_ve.cur = alloc_percpu(struct kstat_lat_pcpu_snap_struct); ++ if (ve->sched_lat_ve.cur == NULL) ++ goto fail; ++ return 0; ++ ++fail: ++ free_percpu(ve->cpu_stats); ++ return -ENOMEM; ++} ++ ++static inline void free_ve_cpustats(struct ve_struct *ve) ++{ ++ free_percpu(ve->cpu_stats); ++ ve->cpu_stats = NULL; ++ free_percpu(ve->sched_lat_ve.cur); ++ ve->sched_lat_ve.cur = NULL; ++} ++ ++static int alone_in_pgrp(struct task_struct *tsk) ++{ ++ struct task_struct *p; ++ int alone = 0; ++ ++ read_lock(&tasklist_lock); ++ do_each_pid_task(task_pid(tsk), PIDTYPE_PGID, p) { ++ if (p != tsk) ++ goto out; ++ } while_each_pid_task(task_pid(tsk), PIDTYPE_PGID, p); ++ do_each_pid_task(task_pid(tsk), PIDTYPE_SID, p) { ++ if (p != tsk) ++ goto out; ++ } while_each_pid_task(task_pid(tsk), PIDTYPE_SID, p); ++ alone = 1; ++out: ++ read_unlock(&tasklist_lock); ++ return alone; ++} ++ ++static int do_env_create(envid_t veid, unsigned int flags, u32 class_id, ++ env_create_param_t *data, int datalen) ++{ ++ struct task_struct *tsk; ++ struct ve_struct *old; ++ struct ve_struct *old_exec; ++ struct ve_struct *ve; ++ __u64 init_mask; ++ int err; ++ struct nsproxy *old_ns, *old_ns_net; ++ DECLARE_COMPLETION_ONSTACK(sysfs_completion); ++ ++ tsk = current; ++ old = VE_TASK_INFO(tsk)->owner_env; ++ ++ if (!thread_group_leader(tsk) || !thread_group_empty(tsk)) ++ return -EINVAL; ++ ++ if (tsk->signal->tty) { ++ printk("ERR: CT init has controlling terminal\n"); ++ return -EINVAL; ++ } ++ if (task_pgrp(tsk) != task_pid(tsk) || ++ task_session(tsk) != task_pid(tsk)) { ++ int may_setsid; ++ ++ read_lock(&tasklist_lock); ++ may_setsid = !tsk->signal->leader && ++ !find_task_by_pid_type_ns(PIDTYPE_PGID, task_pid_nr(tsk), &init_pid_ns); ++ read_unlock(&tasklist_lock); ++ ++ if (!may_setsid) { ++ printk("ERR: CT init is process group leader\n"); ++ return -EINVAL; ++ } ++ } ++ /* Check that the process is not a leader of non-empty group/session. ++ * If it is, we cannot virtualize its PID and must fail. */ ++ if (!alone_in_pgrp(tsk)) { ++ printk("ERR: CT init is not alone in process group\n"); ++ return -EINVAL; ++ } ++ ++ ++ VZTRACE("%s: veid=%d classid=%d pid=%d\n", ++ __FUNCTION__, veid, class_id, current->pid); ++ ++ err = -ENOMEM; ++ ve = kzalloc(sizeof(struct ve_struct), GFP_KERNEL); ++ if (ve == NULL) ++ goto err_struct; ++ ++ init_ve_struct(ve, veid, class_id, data, datalen); ++ __module_get(THIS_MODULE); ++ down_write(&ve->op_sem); ++ if (flags & VE_LOCK) ++ ve->is_locked = 1; ++ ++ /* ++ * this should be done before adding to list ++ * because if calc_load_ve finds this ve in ++ * list it will be very surprised ++ */ ++ if ((err = init_ve_cpustats(ve)) < 0) ++ goto err_cpu_stats; ++ ++ if ((err = ve_list_add(ve)) < 0) ++ goto err_exist; ++ ++ /* this should be done before context switching */ ++ if ((err = init_printk(ve)) < 0) ++ goto err_log_wait; ++ ++ old_exec = set_exec_env(ve); ++ ++ if ((err = init_ve_sched(ve)) < 0) ++ goto err_sched; ++ ++ set_ve_root(ve, tsk); ++ ++ if ((err = init_ve_sysfs(ve))) ++ goto err_sysfs; ++ ++ if ((err = init_ve_mibs(ve))) ++ goto err_mibs; ++ ++ if ((err = init_ve_namespaces(ve, &old_ns))) ++ goto err_ns; ++ ++ if ((err = init_ve_proc(ve))) ++ goto err_proc; ++ ++ if ((err = init_ve_sysctl(ve))) ++ goto err_sysctl; ++ ++ if ((err = init_ve_route(ve)) < 0) ++ goto err_route; ++ ++ if ((err = init_ve_route6(ve)) < 0) ++ goto err_route6; ++ ++ if ((err = init_ve_netns(ve, &old_ns_net))) ++ goto err_netns; ++ ++ if ((err = init_ve_tty_drivers(ve)) < 0) ++ goto err_tty; ++ ++ if ((err = init_ve_shmem(ve))) ++ goto err_shmem; ++ ++ if ((err = init_ve_devpts(ve))) ++ goto err_devpts; ++ ++ if((err = init_ve_meminfo(ve))) ++ goto err_meminf; ++ ++ set_ve_caps(ve, tsk); ++ ++ /* It is safe to initialize netfilter here as routing initialization and ++ interface setup will be done below. This means that NO skb can be ++ passed inside. Den */ ++ /* iptables ve initialization for non ve0; ++ ve0 init is in module_init */ ++ if ((err = init_ve_netfilter()) < 0) ++ goto err_netfilter; ++ ++ init_mask = data ? data->iptables_mask : VE_IP_DEFAULT; ++ if ((err = init_ve_iptables(ve, init_mask)) < 0) ++ goto err_iptables; ++ ++ if ((err = pid_ns_attach_init(ve->ve_ns->pid_ns, tsk)) < 0) ++ goto err_vpid; ++ ++ if ((err = ve_hook_iterate_init(VE_SS_CHAIN, ve)) < 0) ++ goto err_ve_hook; ++ ++ put_nsproxy(old_ns); ++ put_nsproxy(old_ns_net); ++ ++ /* finally: set vpids and move inside */ ++ ve_move_task(tsk, ve); ++ grsecurity_setup(); ++ ++ ve->is_running = 1; ++ up_write(&ve->op_sem); ++ ++ printk(KERN_INFO "CT: %d: started\n", veid); ++ return veid; ++ ++err_ve_hook: ++ mntget(ve->proc_mnt); ++err_vpid: ++ fini_venet(ve); ++ fini_ve_iptables(ve, init_mask); ++err_iptables: ++ fini_ve_netfilter(); ++err_netfilter: ++ fini_ve_meminfo(ve); ++err_meminf: ++ fini_ve_devpts(ve); ++err_devpts: ++ fini_ve_shmem(ve); ++err_shmem: ++ fini_ve_tty_drivers(ve); ++err_tty: ++ fini_ve_namespaces(ve, old_ns_net); ++ put_nsproxy(old_ns_net); ++ ve->ve_netns->sysfs_completion = &sysfs_completion; ++ put_net(ve->ve_netns); ++ wait_for_completion(&sysfs_completion); ++err_netns: ++ fini_ve_route6(ve); ++err_route6: ++ fini_ve_route(ve); ++err_route: ++ fini_ve_sysctl(ve); ++err_sysctl: ++ /* ++ * If process hasn't become VE's init, proc_mnt won't be put during ++ * pidns death, so this mntput by hand is needed. If it has, we ++ * compensate with mntget above. ++ */ ++ mntput(ve->proc_mnt); ++ fini_ve_proc(ve); ++err_proc: ++ /* free_ve_utsname() is called inside real_put_ve() */ ++ fini_ve_namespaces(ve, old_ns); ++ put_nsproxy(old_ns); ++ /* ++ * We need to compensate, because fini_ve_namespaces() assumes ++ * ve->ve_ns will continue to be used after, but VE will be freed soon ++ * (in kfree() sense). ++ */ ++ put_nsproxy(ve->ve_ns); ++err_ns: ++ clean_device_perms_ve(ve->veid); ++ fini_ve_mibs(ve); ++err_mibs: ++ fini_ve_sysfs(ve); ++err_sysfs: ++ /* It is safe to restore current->envid here because ++ * ve_fairsched_detach does not use current->envid. */ ++ /* Really fairsched code uses current->envid in sys_fairsched_mknod ++ * only. It is correct if sys_fairsched_mknod is called from ++ * userspace. If sys_fairsched_mknod is called from ++ * ve_fairsched_attach, then node->envid and node->parent_node->envid ++ * are explicitly set to valid value after the call. */ ++ /* FIXME */ ++ VE_TASK_INFO(tsk)->owner_env = old; ++ VE_TASK_INFO(tsk)->exec_env = old_exec; ++ ++ fini_ve_sched(ve); ++err_sched: ++ (void)set_exec_env(old_exec); ++ ++ /* we can jump here having incorrect envid */ ++ VE_TASK_INFO(tsk)->owner_env = old; ++ fini_printk(ve); ++err_log_wait: ++ /* cpustats will be freed in do_env_free */ ++ ve_list_del(ve); ++ up_write(&ve->op_sem); ++ ++ real_put_ve(ve); ++err_struct: ++ printk(KERN_INFO "CT: %d: failed to start with err=%d\n", veid, err); ++ return err; ++ ++err_exist: ++ free_ve_cpustats(ve); ++err_cpu_stats: ++ kfree(ve); ++ goto err_struct; ++} ++ ++ ++/********************************************************************** ++ ********************************************************************** ++ * ++ * VE start/stop callbacks ++ * ++ ********************************************************************** ++ **********************************************************************/ ++ ++int real_env_create(envid_t veid, unsigned flags, u32 class_id, ++ env_create_param_t *data, int datalen) ++{ ++ int status; ++ struct ve_struct *ve; ++ ++ if (!flags) { ++ status = get_exec_env()->veid; ++ goto out; ++ } ++ ++ status = -EPERM; ++ if (!capable(CAP_SETVEID)) ++ goto out; ++ ++ status = -EINVAL; ++ if ((flags & VE_TEST) && (flags & (VE_ENTER|VE_CREATE))) ++ goto out; ++ ++ status = -EINVAL; ++ ve = get_ve_by_id(veid); ++ if (ve) { ++ if (flags & VE_TEST) { ++ status = 0; ++ goto out_put; ++ } ++ if (flags & VE_EXCLUSIVE) { ++ status = -EACCES; ++ goto out_put; ++ } ++ if (flags & VE_CREATE) { ++ flags &= ~VE_CREATE; ++ flags |= VE_ENTER; ++ } ++ } else { ++ if (flags & (VE_TEST|VE_ENTER)) { ++ status = -ESRCH; ++ goto out; ++ } ++ } ++ ++ if (flags & VE_CREATE) { ++ status = do_env_create(veid, flags, class_id, data, datalen); ++ goto out; ++ } else if (flags & VE_ENTER) ++ status = do_env_enter(ve, flags); ++ ++ /* else: returning EINVAL */ ++ ++out_put: ++ real_put_ve(ve); ++out: ++ return status; ++} ++EXPORT_SYMBOL(real_env_create); ++ ++static int do_env_enter(struct ve_struct *ve, unsigned int flags) ++{ ++ struct task_struct *tsk = current; ++ int err; ++ ++ VZTRACE("%s: veid=%d\n", __FUNCTION__, ve->veid); ++ ++ err = -EBUSY; ++ down_read(&ve->op_sem); ++ if (!ve->is_running) ++ goto out_up; ++ if (ve->is_locked && !(flags & VE_SKIPLOCK)) ++ goto out_up; ++ err = -EINVAL; ++ if (!thread_group_leader(tsk) || !thread_group_empty(tsk)) ++ goto out_up; ++ ++#ifdef CONFIG_VZ_FAIRSCHED ++ err = sys_fairsched_mvpr(current->pid, ve->veid); ++ if (err) ++ goto out_up; ++#endif ++ ve_sched_attach(ve); ++ switch_ve_namespaces(ve, tsk); ++ ve_move_task(current, ve); ++ ++ /* Check that the process is not a leader of non-empty group/session. ++ * If it is, we cannot virtualize its PID. Do not fail, just leave ++ * it non-virtual. ++ */ ++ if (alone_in_pgrp(tsk) && !(flags & VE_SKIPLOCK)) ++ pid_ns_attach_task(ve->ve_ns->pid_ns, tsk); ++ ++ /* Unlike VE_CREATE, we do not setsid() in VE_ENTER. ++ * Process is allowed to be in an external group/session. ++ * If user space callers wants, it will do setsid() after ++ * VE_ENTER. ++ */ ++ err = VE_TASK_INFO(tsk)->owner_env->veid; ++ tsk->did_ve_enter = 1; ++ ++out_up: ++ up_read(&ve->op_sem); ++ return err; ++} ++ ++static void env_cleanup(struct ve_struct *ve) ++{ ++ struct ve_struct *old_ve; ++ DECLARE_COMPLETION_ONSTACK(sysfs_completion); ++ ++ VZTRACE("real_do_env_cleanup\n"); ++ ++ down_read(&ve->op_sem); ++ old_ve = set_exec_env(ve); ++ ++ ve_hook_iterate_fini(VE_SS_CHAIN, ve); ++ ++ fini_venet(ve); ++ ++ /* no new packets in flight beyond this point */ ++ /* skb hold dst_entry, and in turn lies in the ip fragment queue */ ++ ip_fragment_cleanup(ve); ++ ++ /* kill iptables */ ++ /* No skb belonging to VE can exist at this point as unregister_netdev ++ is an operation awaiting until ALL skb's gone */ ++ fini_ve_iptables(ve, ve->_iptables_modules); ++ fini_ve_netfilter(); ++ ++ fini_ve_sched(ve); ++ clean_device_perms_ve(ve->veid); ++ ++ fini_ve_devpts(ve); ++ fini_ve_shmem(ve); ++ unregister_ve_tty_drivers(ve); ++ fini_ve_meminfo(ve); ++ ++ fini_ve_namespaces(ve, NULL); ++ ve->ve_netns->sysfs_completion = &sysfs_completion; ++ put_net(ve->ve_netns); ++ wait_for_completion(&sysfs_completion); ++ fini_ve_route(ve); ++ fini_ve_route6(ve); ++ fini_ve_mibs(ve); ++ fini_ve_sysctl(ve); ++ fini_ve_proc(ve); ++ fini_ve_sysfs(ve); ++ ++ (void)set_exec_env(old_ve); ++ fini_printk(ve); /* no printk can happen in ve context anymore */ ++ ++ ve_list_del(ve); ++ up_read(&ve->op_sem); ++ ++ real_put_ve(ve); ++} ++ ++static DECLARE_COMPLETION(vzmond_complete); ++static volatile int stop_vzmond; ++ ++static int vzmond_helper(void *arg) ++{ ++ char name[18]; ++ struct ve_struct *ve; ++ ++ ve = (struct ve_struct *)arg; ++ snprintf(name, sizeof(name), "vzmond/%d", ve->veid); ++ daemonize(name); ++ env_cleanup(ve); ++ module_put_and_exit(0); ++} ++ ++static void do_pending_env_cleanups(void) ++{ ++ int err; ++ struct ve_struct *ve; ++ ++ spin_lock(&ve_cleanup_lock); ++ while (1) { ++ if (list_empty(&ve_cleanup_list) || need_resched()) ++ break; ++ ++ ve = list_first_entry(&ve_cleanup_list, ++ struct ve_struct, cleanup_list); ++ list_del(&ve->cleanup_list); ++ spin_unlock(&ve_cleanup_lock); ++ ++ __module_get(THIS_MODULE); ++ err = kernel_thread(vzmond_helper, (void *)ve, 0); ++ if (err < 0) { ++ env_cleanup(ve); ++ module_put(THIS_MODULE); ++ } ++ ++ spin_lock(&ve_cleanup_lock); ++ } ++ spin_unlock(&ve_cleanup_lock); ++} ++ ++static inline int have_pending_cleanups(void) ++{ ++ return !list_empty(&ve_cleanup_list); ++} ++ ++static int vzmond(void *arg) ++{ ++ daemonize("vzmond"); ++ set_current_state(TASK_INTERRUPTIBLE); ++ ++ while (!stop_vzmond || have_pending_cleanups()) { ++ schedule(); ++ try_to_freeze(); ++ if (signal_pending(current)) ++ flush_signals(current); ++ ++ do_pending_env_cleanups(); ++ set_current_state(TASK_INTERRUPTIBLE); ++ if (have_pending_cleanups()) ++ __set_current_state(TASK_RUNNING); ++ } ++ ++ __set_task_state(current, TASK_RUNNING); ++ complete_and_exit(&vzmond_complete, 0); ++} ++ ++static int __init init_vzmond(void) ++{ ++ int pid; ++ struct task_struct *tsk; ++ ++ pid = kernel_thread(vzmond, NULL, 0); ++ if (pid > 0) { ++ tsk = find_task_by_pid(pid); ++ BUG_ON(tsk == NULL); ++ ve_cleanup_thread = tsk; ++ } ++ return pid; ++} ++ ++static void fini_vzmond(void) ++{ ++ stop_vzmond = 1; ++ wake_up_process(ve_cleanup_thread); ++ wait_for_completion(&vzmond_complete); ++ ve_cleanup_thread = NULL; ++ WARN_ON(!list_empty(&ve_cleanup_list)); ++} ++ ++void real_do_env_free(struct ve_struct *ve) ++{ ++ VZTRACE("real_do_env_free\n"); ++ ++ free_ve_tty_drivers(ve); ++ free_ve_sysctl(ve); /* free per ve sysctl data */ ++ free_ve_filesystems(ve); ++ free_ve_cpustats(ve); ++ printk(KERN_INFO "CT: %d: stopped\n", VEID(ve)); ++ kfree(ve); ++ ++ module_put(THIS_MODULE); ++} ++EXPORT_SYMBOL(real_do_env_free); ++ ++ ++/********************************************************************** ++ ********************************************************************** ++ * ++ * VE TTY handling ++ * ++ ********************************************************************** ++ **********************************************************************/ ++ ++static struct tty_driver *alloc_ve_tty_driver(struct tty_driver *base, ++ struct ve_struct *ve) ++{ ++ size_t size; ++ struct tty_driver *driver; ++ ++ driver = kmalloc(sizeof(struct tty_driver), GFP_KERNEL_UBC); ++ if (!driver) ++ goto out; ++ ++ memcpy(driver, base, sizeof(struct tty_driver)); ++ ++ driver->driver_state = NULL; ++ ++ size = base->num * 3 * sizeof(void *); ++ if (!(driver->flags & TTY_DRIVER_DEVPTS_MEM)) { ++ void **p; ++ p = kzalloc(size, GFP_KERNEL_UBC); ++ if (!p) ++ goto out_free; ++ ++ driver->ttys = (struct tty_struct **)p; ++ driver->termios = (struct ktermios **)(p + driver->num); ++ driver->termios_locked = (struct ktermios **) ++ (p + driver->num * 2); ++ } else { ++ driver->ttys = NULL; ++ driver->termios = NULL; ++ driver->termios_locked = NULL; ++ } ++ ++ driver->owner_env = ve; ++ driver->flags |= TTY_DRIVER_INSTALLED; ++ driver->refcount = 0; ++ ++ return driver; ++ ++out_free: ++ kfree(driver); ++out: ++ return NULL; ++} ++ ++static void free_ve_tty_driver(struct tty_driver *driver) ++{ ++ if (!driver) ++ return; ++ ++ clear_termios(driver); ++ kfree(driver->ttys); ++ kfree(driver); ++} ++ ++static int alloc_ve_tty_drivers(struct ve_struct* ve) ++{ ++#ifdef CONFIG_LEGACY_PTYS ++ /* Traditional BSD devices */ ++ ve->pty_driver = alloc_ve_tty_driver(pty_driver, ve); ++ if (!ve->pty_driver) ++ goto out_mem; ++ ++ ve->pty_slave_driver = alloc_ve_tty_driver(pty_slave_driver, ve); ++ if (!ve->pty_slave_driver) ++ goto out_mem; ++ ++ ve->pty_driver->other = ve->pty_slave_driver; ++ ve->pty_slave_driver->other = ve->pty_driver; ++#endif ++ ++#ifdef CONFIG_UNIX98_PTYS ++ ve->ptm_driver = alloc_ve_tty_driver(ptm_driver, ve); ++ if (!ve->ptm_driver) ++ goto out_mem; ++ ++ ve->pts_driver = alloc_ve_tty_driver(pts_driver, ve); ++ if (!ve->pts_driver) ++ goto out_mem; ++ ++ ve->ptm_driver->other = ve->pts_driver; ++ ve->pts_driver->other = ve->ptm_driver; ++ ++ ve->allocated_ptys = kmalloc(sizeof(*ve->allocated_ptys), ++ GFP_KERNEL_UBC); ++ if (!ve->allocated_ptys) ++ goto out_mem; ++ idr_init(ve->allocated_ptys); ++#endif ++ return 0; ++ ++out_mem: ++ free_ve_tty_drivers(ve); ++ return -ENOMEM; ++} ++ ++static void free_ve_tty_drivers(struct ve_struct* ve) ++{ ++#ifdef CONFIG_LEGACY_PTYS ++ free_ve_tty_driver(ve->pty_driver); ++ free_ve_tty_driver(ve->pty_slave_driver); ++ ve->pty_driver = ve->pty_slave_driver = NULL; ++#endif ++#ifdef CONFIG_UNIX98_PTYS ++ free_ve_tty_driver(ve->ptm_driver); ++ free_ve_tty_driver(ve->pts_driver); ++ kfree(ve->allocated_ptys); ++ ve->ptm_driver = ve->pts_driver = NULL; ++ ve->allocated_ptys = NULL; ++#endif ++} ++ ++static inline void __register_tty_driver(struct tty_driver *driver) ++{ ++ list_add(&driver->tty_drivers, &tty_drivers); ++} ++ ++static inline void __unregister_tty_driver(struct tty_driver *driver) ++{ ++ if (!driver) ++ return; ++ list_del(&driver->tty_drivers); ++} ++ ++static int register_ve_tty_drivers(struct ve_struct* ve) ++{ ++ mutex_lock(&tty_mutex); ++#ifdef CONFIG_UNIX98_PTYS ++ __register_tty_driver(ve->ptm_driver); ++ __register_tty_driver(ve->pts_driver); ++#endif ++#ifdef CONFIG_LEGACY_PTYS ++ __register_tty_driver(ve->pty_driver); ++ __register_tty_driver(ve->pty_slave_driver); ++#endif ++ mutex_unlock(&tty_mutex); ++ ++ return 0; ++} ++ ++static void unregister_ve_tty_drivers(struct ve_struct* ve) ++{ ++ VZTRACE("unregister_ve_tty_drivers\n"); ++ ++ mutex_lock(&tty_mutex); ++#ifdef CONFIG_LEGACY_PTYS ++ __unregister_tty_driver(ve->pty_driver); ++ __unregister_tty_driver(ve->pty_slave_driver); ++#endif ++#ifdef CONFIG_UNIX98_PTYS ++ __unregister_tty_driver(ve->ptm_driver); ++ __unregister_tty_driver(ve->pts_driver); ++#endif ++ mutex_unlock(&tty_mutex); ++} ++ ++static int init_ve_tty_drivers(struct ve_struct *ve) ++{ ++ int err; ++ ++ if ((err = alloc_ve_tty_drivers(ve))) ++ goto err_ttyalloc; ++ if ((err = register_ve_tty_drivers(ve))) ++ goto err_ttyreg; ++ return 0; ++ ++err_ttyreg: ++ free_ve_tty_drivers(ve); ++err_ttyalloc: ++ return err; ++} ++ ++static void fini_ve_tty_drivers(struct ve_struct *ve) ++{ ++ unregister_ve_tty_drivers(ve); ++ free_ve_tty_drivers(ve); ++} ++ ++/* ++ * Free the termios and termios_locked structures because ++ * we don't want to get memory leaks when modular tty ++ * drivers are removed from the kernel. ++ */ ++static void clear_termios(struct tty_driver *driver) ++{ ++ int i; ++ struct ktermios *tp; ++ ++ if (driver->termios == NULL) ++ return; ++ for (i = 0; i < driver->num; i++) { ++ tp = driver->termios[i]; ++ if (tp) { ++ driver->termios[i] = NULL; ++ kfree(tp); ++ } ++ tp = driver->termios_locked[i]; ++ if (tp) { ++ driver->termios_locked[i] = NULL; ++ kfree(tp); ++ } ++ } ++} ++ ++ ++/********************************************************************** ++ ********************************************************************** ++ * ++ * Pieces of VE network ++ * ++ ********************************************************************** ++ **********************************************************************/ ++ ++#ifdef CONFIG_NET ++#include ++#include ++#include ++#include ++#include ++#include ++#endif ++ ++static int ve_dev_add(envid_t veid, char *dev_name) ++{ ++ struct net_device *dev; ++ struct ve_struct *dst_ve; ++ struct net *dst_net; ++ int err = -ESRCH; ++ ++ dst_ve = get_ve_by_id(veid); ++ if (dst_ve == NULL) ++ goto out; ++ ++ dst_net = dst_ve->ve_netns; ++ ++ rtnl_lock(); ++ read_lock(&dev_base_lock); ++ dev = __dev_get_by_name(&init_net, dev_name); ++ read_unlock(&dev_base_lock); ++ if (dev == NULL) ++ goto out_unlock; ++ ++ err = __dev_change_net_namespace(dev, dst_net, dev_name, ++ get_ve0(), dst_ve, get_exec_ub()); ++out_unlock: ++ rtnl_unlock(); ++ real_put_ve(dst_ve); ++ ++ if (dev == NULL) ++ printk(KERN_WARNING "%s: device %s not found\n", ++ __func__, dev_name); ++out: ++ return err; ++} ++ ++static int ve_dev_del(envid_t veid, char *dev_name) ++{ ++ struct net_device *dev; ++ struct ve_struct *src_ve; ++ struct net *src_net; ++ int err = -ESRCH; ++ ++ src_ve = get_ve_by_id(veid); ++ if (src_ve == NULL) ++ goto out; ++ ++ src_net = src_ve->ve_netns; ++ ++ rtnl_lock(); ++ ++ read_lock(&dev_base_lock); ++ dev = __dev_get_by_name(src_net, dev_name); ++ read_unlock(&dev_base_lock); ++ if (dev == NULL) ++ goto out_unlock; ++ ++ err = __dev_change_net_namespace(dev, &init_net, dev_name, ++ src_ve, get_ve0(), netdev_bc(dev)->owner_ub); ++out_unlock: ++ rtnl_unlock(); ++ real_put_ve(src_ve); ++ ++ if (dev == NULL) ++ printk(KERN_WARNING "%s: device %s not found\n", ++ __func__, dev_name); ++out: ++ return err; ++} ++ ++int real_ve_dev_map(envid_t veid, int op, char *dev_name) ++{ ++ if (!capable(CAP_SETVEID)) ++ return -EPERM; ++ switch (op) { ++ case VE_NETDEV_ADD: ++ return ve_dev_add(veid, dev_name); ++ case VE_NETDEV_DEL: ++ return ve_dev_del(veid, dev_name); ++ default: ++ return -EINVAL; ++ } ++} ++ ++static void ve_mapped_devs_cleanup(struct ve_struct *ve) ++{ ++ struct net *net = ve->ve_netns; ++ struct net_device *dev, *next; ++ int rv; ++ ++ rtnl_lock(); ++ for_each_netdev_safe(net, dev, next) { ++ /* Ignore unmoveable devices (i.e. loopback) */ ++ if (dev->features & NETIF_F_NETNS_LOCAL) ++ continue; ++ ++ rv = __dev_change_net_namespace(dev, &init_net, dev->name, ++ ve, get_ve0(), netdev_bc(dev)->owner_ub); ++ if (rv < 0) ++ unregister_netdevice(dev); ++ } ++ rtnl_unlock(); ++} ++ ++ ++/********************************************************************** ++ ********************************************************************** ++ * ++ * VE information via /proc ++ * ++ ********************************************************************** ++ **********************************************************************/ ++#ifdef CONFIG_PROC_FS ++#if BITS_PER_LONG == 32 ++#define VESTAT_LINE_WIDTH (6 * 11 + 6 * 21) ++#define VESTAT_LINE_FMT "%10u %10lu %10lu %10lu %10Lu %20Lu %20Lu %20Lu %20Lu %20Lu %20Lu %10lu\n" ++#define VESTAT_HEAD_FMT "%10s %10s %10s %10s %10s %20s %20s %20s %20s %20s %20s %10s\n" ++#else ++#define VESTAT_LINE_WIDTH (12 * 21) ++#define VESTAT_LINE_FMT "%20u %20lu %20lu %20lu %20Lu %20Lu %20Lu %20Lu %20Lu %20Lu %20Lu %20lu\n" ++#define VESTAT_HEAD_FMT "%20s %20s %20s %20s %20s %20s %20s %20s %20s %20s %20s %20s\n" ++#endif ++ ++static int vestat_seq_show(struct seq_file *m, void *v) ++{ ++ struct list_head *entry; ++ struct ve_struct *ve; ++ struct ve_struct *curve; ++ int cpu; ++ unsigned long user_ve, nice_ve, system_ve; ++ unsigned long long uptime; ++ cycles_t uptime_cycles, idle_time, strv_time, used; ++ ++ entry = (struct list_head *)v; ++ ve = list_entry(entry, struct ve_struct, ve_list); ++ ++ curve = get_exec_env(); ++ if (entry == ve_list_head.next || ++ (!ve_is_super(curve) && ve == curve)) { ++ /* print header */ ++ seq_printf(m, "%-*s\n", ++ VESTAT_LINE_WIDTH - 1, ++ "Version: 2.2"); ++ seq_printf(m, VESTAT_HEAD_FMT, "VEID", ++ "user", "nice", "system", ++ "uptime", "idle", ++ "strv", "uptime", "used", ++ "maxlat", "totlat", "numsched"); ++ } ++ ++ if (ve == get_ve0()) ++ return 0; ++ ++ user_ve = nice_ve = system_ve = 0; ++ idle_time = strv_time = used = 0; ++ ++ for_each_online_cpu(cpu) { ++ struct ve_cpu_stats *st; ++ ++ st = VE_CPU_STATS(ve, cpu); ++ user_ve += st->user; ++ nice_ve += st->nice; ++ system_ve += st->system; ++ used += st->used_time; ++ idle_time += ve_sched_get_idle_time(ve, cpu); ++ } ++ uptime_cycles = get_cycles() - ve->start_cycles; ++ uptime = get_jiffies_64() - ve->start_jiffies; ++ ++ seq_printf(m, VESTAT_LINE_FMT, ve->veid, ++ user_ve, nice_ve, system_ve, ++ (unsigned long long)uptime, ++ (unsigned long long)idle_time, ++ (unsigned long long)strv_time, ++ (unsigned long long)uptime_cycles, ++ (unsigned long long)used, ++ (unsigned long long)ve->sched_lat_ve.last.maxlat, ++ (unsigned long long)ve->sched_lat_ve.last.totlat, ++ ve->sched_lat_ve.last.count); ++ return 0; ++} ++ ++static void *ve_seq_start(struct seq_file *m, loff_t *pos) ++{ ++ struct ve_struct *curve; ++ struct list_head *entry; ++ loff_t l; ++ ++ curve = get_exec_env(); ++ read_lock(&ve_list_lock); ++ if (!ve_is_super(curve)) { ++ if (*pos != 0) ++ return NULL; ++ return curve; ++ } ++ ++ l = *pos; ++ list_for_each(entry, &ve_list_head) { ++ if (l == 0) ++ return entry; ++ l--; ++ } ++ return NULL; ++} ++ ++static void *ve_seq_next(struct seq_file *m, void *v, loff_t *pos) ++{ ++ struct list_head *entry; ++ ++ entry = (struct list_head *)v; ++ if (!ve_is_super(get_exec_env())) ++ return NULL; ++ (*pos)++; ++ return entry->next == &ve_list_head ? NULL : entry->next; ++} ++ ++static void ve_seq_stop(struct seq_file *m, void *v) ++{ ++ read_unlock(&ve_list_lock); ++} ++ ++static struct seq_operations vestat_seq_op = { ++ .start = ve_seq_start, ++ .next = ve_seq_next, ++ .stop = ve_seq_stop, ++ .show = vestat_seq_show ++}; ++ ++static int vestat_open(struct inode *inode, struct file *file) ++{ ++ return seq_open(file, &vestat_seq_op); ++} ++ ++static struct file_operations proc_vestat_operations = { ++ .open = vestat_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = seq_release ++}; ++ ++static int vz_version_show(struct seq_file *file, void* v) ++{ ++ static const char ver[] = VZVERSION "\n"; ++ ++ return seq_puts(file, ver); ++} ++ ++static int vz_version_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, vz_version_show, NULL); ++} ++ ++static struct file_operations proc_vz_version_oparations = { ++ .open = vz_version_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++static inline unsigned long ve_used_mem(struct user_beancounter *ub) ++{ ++ extern int glob_ve_meminfo; ++ return glob_ve_meminfo ? ub->ub_parms[UB_OOMGUARPAGES].held : ++ ub->ub_parms[UB_PRIVVMPAGES].held ; ++} ++ ++static inline void ve_mi_replace(struct meminfo *mi) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ struct user_beancounter *ub; ++ unsigned long meminfo_val; ++ unsigned long nodettram; ++ unsigned long usedmem; ++ ++ meminfo_val = get_exec_env()->meminfo_val; ++ ++ if(!meminfo_val) ++ return; /* No virtualization */ ++ ++ nodettram = mi->si.totalram; ++ ub = current->mm->mm_ub; ++ usedmem = ve_used_mem(ub); ++ ++ memset(mi, 0, sizeof(*mi)); ++ ++ mi->si.totalram = (meminfo_val > nodettram) ? ++ nodettram : meminfo_val; ++ mi->si.freeram = (mi->si.totalram > usedmem) ? ++ (mi->si.totalram - usedmem) : 0; ++#else ++ return; ++#endif ++} ++ ++static int meminfo_call(struct vnotifier_block *self, ++ unsigned long event, void *arg, int old_ret) ++{ ++ if (event != VIRTINFO_MEMINFO) ++ return old_ret; ++ ++ ve_mi_replace((struct meminfo *)arg); ++ ++ return NOTIFY_OK; ++} ++ ++ ++static struct vnotifier_block meminfo_notifier_block = { ++ .notifier_call = meminfo_call ++}; ++ ++/* /proc/vz/veinfo */ ++ ++static ve_seq_print_t veaddr_seq_print_cb; ++ ++void vzmon_register_veaddr_print_cb(ve_seq_print_t cb) ++{ ++ rcu_assign_pointer(veaddr_seq_print_cb, cb); ++} ++EXPORT_SYMBOL(vzmon_register_veaddr_print_cb); ++ ++void vzmon_unregister_veaddr_print_cb(ve_seq_print_t cb) ++{ ++ rcu_assign_pointer(veaddr_seq_print_cb, NULL); ++ synchronize_rcu(); ++} ++EXPORT_SYMBOL(vzmon_unregister_veaddr_print_cb); ++ ++static int veinfo_seq_show(struct seq_file *m, void *v) ++{ ++ struct ve_struct *ve; ++ ve_seq_print_t veaddr_seq_print; ++ ++ ve = list_entry((struct list_head *)v, struct ve_struct, ve_list); ++ ++ seq_printf(m, "%10u %5u %5u", ve->veid, ++ ve->class_id, atomic_read(&ve->pcounter)); ++ ++ veaddr_seq_print = m->private; ++ if (veaddr_seq_print) ++ veaddr_seq_print(m, ve); ++ ++ seq_putc(m, '\n'); ++ return 0; ++} ++ ++static void *veinfo_seq_start(struct seq_file *m, loff_t *pos) ++{ ++ struct ve_struct *curve; ++ struct list_head *entry; ++ loff_t l; ++ ++ rcu_read_lock(); ++ m->private = rcu_dereference(veaddr_seq_print_cb); ++ curve = get_exec_env(); ++ read_lock(&ve_list_lock); ++ if (!ve_is_super(curve)) { ++ if (*pos != 0) ++ return NULL; ++ return curve; ++ } ++ ++ l = *pos; ++ list_for_each(entry, &ve_list_head) { ++ if (l == 0) ++ return entry; ++ l--; ++ } ++ return NULL; ++} ++ ++static void *veinfo_seq_next(struct seq_file *m, void *v, loff_t *pos) ++{ ++ struct list_head *entry; ++ ++ entry = (struct list_head *)v; ++ if (!ve_is_super(get_exec_env())) ++ return NULL; ++ (*pos)++; ++ return entry->next == &ve_list_head ? NULL : entry->next; ++} ++ ++static void veinfo_seq_stop(struct seq_file *m, void *v) ++{ ++ read_unlock(&ve_list_lock); ++ rcu_read_unlock(); ++} ++ ++ ++static struct seq_operations veinfo_seq_op = { ++ .start = veinfo_seq_start, ++ .next = veinfo_seq_next, ++ .stop = veinfo_seq_stop, ++ .show = veinfo_seq_show, ++}; ++ ++static int veinfo_open(struct inode *inode, struct file *file) ++{ ++ return seq_open(file, &veinfo_seq_op); ++} ++ ++static struct file_operations proc_veinfo_operations = { ++ .open = veinfo_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = seq_release, ++}; ++ ++static int __init init_vecalls_proc(void) ++{ ++ struct proc_dir_entry *de; ++ ++ de = create_proc_glob_entry_mod("vz/vestat", ++ S_IFREG|S_IRUSR, NULL, THIS_MODULE); ++ if (de == NULL) { ++ /* create "vz" subdirectory, if not exist */ ++ (void) create_proc_glob_entry("vz", ++ S_IFDIR|S_IRUGO|S_IXUGO, NULL); ++ de = create_proc_glob_entry_mod("vz/vestat", ++ S_IFREG|S_IRUSR, NULL, THIS_MODULE); ++ } ++ if (de) ++ de->proc_fops = &proc_vestat_operations; ++ else ++ printk(KERN_WARNING ++ "VZMON: can't make vestat proc entry\n"); ++ ++ de = create_proc_entry_mod("vz/devperms", S_IFREG | S_IRUSR, NULL, ++ THIS_MODULE); ++ if (de) ++ de->proc_fops = &proc_devperms_ops; ++ else ++ printk(KERN_WARNING ++ "VZMON: can't make devperms proc entry\n"); ++ ++ ++ de = create_proc_entry_mod("vz/version", S_IFREG | 0444, NULL, ++ THIS_MODULE); ++ if (de) ++ de->proc_fops = &proc_vz_version_oparations; ++ else ++ printk(KERN_WARNING ++ "VZMON: can't make version proc entry\n"); ++ ++ de = create_proc_glob_entry_mod("vz/veinfo", S_IFREG | S_IRUSR, NULL, ++ THIS_MODULE); ++ if (de) ++ de->proc_fops = &proc_veinfo_operations; ++ else ++ printk(KERN_WARNING "VZMON: can't make veinfo proc entry\n"); ++ ++ virtinfo_notifier_register(VITYPE_GENERAL, &meminfo_notifier_block); ++ ++ return 0; ++} ++ ++static void fini_vecalls_proc(void) ++{ ++ remove_proc_entry("vz/version", NULL); ++ remove_proc_entry("vz/devperms", NULL); ++ remove_proc_entry("vz/vestat", NULL); ++ remove_proc_entry("vz/veinfo", NULL); ++ virtinfo_notifier_unregister(VITYPE_GENERAL, &meminfo_notifier_block); ++} ++#else ++#define init_vecalls_proc() (0) ++#define fini_vecalls_proc() do { } while (0) ++#endif /* CONFIG_PROC_FS */ ++ ++ ++/********************************************************************** ++ ********************************************************************** ++ * ++ * User ctl ++ * ++ ********************************************************************** ++ **********************************************************************/ ++ ++int vzcalls_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ int err; ++ ++ err = -ENOTTY; ++ switch(cmd) { ++ case VZCTL_MARK_ENV_TO_DOWN: { ++ /* Compatibility issue */ ++ err = 0; ++ } ++ break; ++ case VZCTL_SETDEVPERMS: { ++ /* Device type was mistakenly declared as dev_t ++ * in the old user-kernel interface. ++ * That's wrong, dev_t is a kernel internal type. ++ * I use `unsigned' not having anything better in mind. ++ * 2001/08/11 SAW */ ++ struct vzctl_setdevperms s; ++ err = -EFAULT; ++ if (copy_from_user(&s, (void __user *)arg, sizeof(s))) ++ break; ++ err = real_setdevperms(s.veid, s.type, ++ new_decode_dev(s.dev), s.mask); ++ } ++ break; ++#ifdef CONFIG_INET ++ case VZCTL_VE_NETDEV: { ++ struct vzctl_ve_netdev d; ++ char *s; ++ err = -EFAULT; ++ if (copy_from_user(&d, (void __user *)arg, sizeof(d))) ++ break; ++ err = -ENOMEM; ++ s = kmalloc(IFNAMSIZ+1, GFP_KERNEL); ++ if (s == NULL) ++ break; ++ err = -EFAULT; ++ if (strncpy_from_user(s, d.dev_name, IFNAMSIZ) > 0) { ++ s[IFNAMSIZ] = 0; ++ err = real_ve_dev_map(d.veid, d.op, s); ++ } ++ kfree(s); ++ } ++ break; ++#endif ++ case VZCTL_ENV_CREATE: { ++ struct vzctl_env_create s; ++ err = -EFAULT; ++ if (copy_from_user(&s, (void __user *)arg, sizeof(s))) ++ break; ++ err = real_env_create(s.veid, s.flags, s.class_id, ++ NULL, 0); ++ } ++ break; ++ case VZCTL_ENV_CREATE_DATA: { ++ struct vzctl_env_create_data s; ++ env_create_param_t *data; ++ err = -EFAULT; ++ if (copy_from_user(&s, (void __user *)arg, sizeof(s))) ++ break; ++ err=-EINVAL; ++ if (s.datalen < VZCTL_ENV_CREATE_DATA_MINLEN || ++ s.datalen > VZCTL_ENV_CREATE_DATA_MAXLEN || ++ s.data == 0) ++ break; ++ err = -ENOMEM; ++ data = kzalloc(sizeof(*data), GFP_KERNEL); ++ if (!data) ++ break; ++ ++ err = -EFAULT; ++ if (copy_from_user(data, (void __user *)s.data, ++ s.datalen)) ++ goto free_data; ++ err = real_env_create(s.veid, s.flags, s.class_id, ++ data, s.datalen); ++free_data: ++ kfree(data); ++ } ++ break; ++ case VZCTL_GET_CPU_STAT: { ++ struct vzctl_cpustatctl s; ++ err = -EFAULT; ++ if (copy_from_user(&s, (void __user *)arg, sizeof(s))) ++ break; ++ err = ve_get_cpu_stat(s.veid, s.cpustat); ++ } ++ break; ++ case VZCTL_VE_MEMINFO: { ++ struct vzctl_ve_meminfo s; ++ err = -EFAULT; ++ if (copy_from_user(&s, (void __user *)arg, sizeof(s))) ++ break; ++ err = ve_set_meminfo(s.veid, s.val); ++ } ++ break; ++ } ++ return err; ++} ++ ++#ifdef CONFIG_COMPAT ++int compat_vzcalls_ioctl(struct file *file, unsigned int cmd, ++ unsigned long arg) ++{ ++ int err; ++ ++ switch(cmd) { ++ case VZCTL_GET_CPU_STAT: { ++ /* FIXME */ ++ } ++ case VZCTL_COMPAT_ENV_CREATE_DATA: { ++ struct compat_vzctl_env_create_data cs; ++ struct vzctl_env_create_data __user *s; ++ ++ s = compat_alloc_user_space(sizeof(*s)); ++ err = -EFAULT; ++ if (copy_from_user(&cs, (void *)arg, sizeof(cs))) ++ break; ++ ++ if (put_user(cs.veid, &s->veid) || ++ put_user(cs.flags, &s->flags) || ++ put_user(cs.class_id, &s->class_id) || ++ put_user(compat_ptr(cs.data), &s->data) || ++ put_user(cs.datalen, &s->datalen)) ++ break; ++ err = vzcalls_ioctl(file, VZCTL_ENV_CREATE_DATA, ++ (unsigned long)s); ++ break; ++ } ++#ifdef CONFIG_NET ++ case VZCTL_COMPAT_VE_NETDEV: { ++ struct compat_vzctl_ve_netdev cs; ++ struct vzctl_ve_netdev __user *s; ++ ++ s = compat_alloc_user_space(sizeof(*s)); ++ err = -EFAULT; ++ if (copy_from_user(&cs, (void *)arg, sizeof(cs))) ++ break; ++ ++ if (put_user(cs.veid, &s->veid) || ++ put_user(cs.op, &s->op) || ++ put_user(compat_ptr(cs.dev_name), &s->dev_name)) ++ break; ++ err = vzcalls_ioctl(file, VZCTL_VE_NETDEV, (unsigned long)s); ++ break; ++ } ++#endif ++ case VZCTL_COMPAT_VE_MEMINFO: { ++ struct compat_vzctl_ve_meminfo cs; ++ err = -EFAULT; ++ if (copy_from_user(&cs, (void *)arg, sizeof(cs))) ++ break; ++ err = ve_set_meminfo(cs.veid, cs.val); ++ break; ++ } ++ default: ++ err = vzcalls_ioctl(file, cmd, arg); ++ break; ++ } ++ return err; ++} ++#endif ++ ++static struct vzioctlinfo vzcalls = { ++ .type = VZCTLTYPE, ++ .ioctl = vzcalls_ioctl, ++#ifdef CONFIG_COMPAT ++ .compat_ioctl = compat_vzcalls_ioctl, ++#endif ++ .owner = THIS_MODULE, ++}; ++ ++ ++/********************************************************************** ++ ********************************************************************** ++ * ++ * Init/exit stuff ++ * ++ ********************************************************************** ++ **********************************************************************/ ++ ++static int __init init_vecalls_symbols(void) ++{ ++ KSYMRESOLVE(real_do_env_free); ++ KSYMMODRESOLVE(vzmon); ++ return 0; ++} ++ ++static void fini_vecalls_symbols(void) ++{ ++ KSYMMODUNRESOLVE(vzmon); ++ KSYMUNRESOLVE(real_do_env_free); ++} ++ ++static inline __init int init_vecalls_ioctls(void) ++{ ++ vzioctl_register(&vzcalls); ++ return 0; ++} ++ ++static inline void fini_vecalls_ioctls(void) ++{ ++ vzioctl_unregister(&vzcalls); ++} ++ ++#ifdef CONFIG_SYSCTL ++static struct ctl_table_header *table_header; ++ ++static ctl_table kernel_table[] = { ++ { ++ .procname = "ve_allow_kthreads", ++ .data = &ve_allow_kthreads, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec, ++ }, ++ { 0 } ++}; ++ ++static ctl_table root_table[] = { ++ {CTL_KERN, "kernel", NULL, 0, 0555, kernel_table}, ++ { 0 } ++}; ++ ++static int init_vecalls_sysctl(void) ++{ ++ table_header = register_sysctl_table(root_table); ++ if (!table_header) ++ return -ENOMEM ; ++ return 0; ++} ++ ++static void fini_vecalls_sysctl(void) ++{ ++ unregister_sysctl_table(table_header); ++} ++#else ++static int init_vecalls_sysctl(void) { return 0; } ++static void fini_vecalls_sysctl(void) { ; } ++#endif ++ ++static int __init vecalls_init(void) ++{ ++ int err; ++ ++ err = init_vecalls_sysctl(); ++ if (err) ++ goto out_vzmond; ++ ++ err = init_vzmond(); ++ if (err < 0) ++ goto out_sysctl; ++ ++ err = init_vecalls_symbols(); ++ if (err < 0) ++ goto out_sym; ++ ++ err = init_vecalls_proc(); ++ if (err < 0) ++ goto out_proc; ++ ++ err = init_vecalls_ioctls(); ++ if (err < 0) ++ goto out_ioctls; ++ ++ return 0; ++ ++out_ioctls: ++ fini_vecalls_proc(); ++out_proc: ++ fini_vecalls_symbols(); ++out_sym: ++ fini_vzmond(); ++out_sysctl: ++ fini_vecalls_sysctl(); ++out_vzmond: ++ return err; ++} ++ ++static void vecalls_exit(void) ++{ ++ fini_vecalls_ioctls(); ++ fini_vecalls_proc(); ++ fini_vecalls_symbols(); ++ fini_vzmond(); ++ fini_vecalls_sysctl(); ++} ++ ++MODULE_AUTHOR("SWsoft "); ++MODULE_DESCRIPTION("Virtuozzo Control"); ++MODULE_LICENSE("GPL v2"); ++ ++module_init(vecalls_init) ++module_exit(vecalls_exit) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ve/veowner.c debian/binary-custom.d/openvz/src/kernel/ve/veowner.c +--- ./kernel/ve/veowner.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ve/veowner.c 2012-11-13 15:20:15.432569063 +0000 +@@ -0,0 +1,257 @@ ++/* ++ * kernel/ve/veowner.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++void prepare_ve0_process(struct task_struct *tsk) ++{ ++ VE_TASK_INFO(tsk)->exec_env = get_ve0(); ++ VE_TASK_INFO(tsk)->owner_env = get_ve0(); ++ VE_TASK_INFO(tsk)->sleep_time = 0; ++ VE_TASK_INFO(tsk)->wakeup_stamp = 0; ++ VE_TASK_INFO(tsk)->sched_time = 0; ++ seqcount_init(&VE_TASK_INFO(tsk)->wakeup_lock); ++ ++ if (tsk->pid) { ++ list_add_rcu(&tsk->ve_task_info.vetask_list, ++ &get_ve0()->vetask_lh); ++ atomic_inc(&get_ve0()->pcounter); ++ } ++} ++ ++/* ++ * ------------------------------------------------------------------------ ++ * proc entries ++ * ------------------------------------------------------------------------ ++ */ ++ ++#ifdef CONFIG_PROC_FS ++static void proc_move(struct proc_dir_entry *ddir, ++ struct proc_dir_entry *sdir, ++ const char *name) ++{ ++ struct proc_dir_entry **p, *q; ++ int len; ++ ++ len = strlen(name); ++ for (p = &sdir->subdir, q = *p; q != NULL; p = &q->next, q = *p) ++ if (proc_match(len, name, q)) ++ break; ++ if (q == NULL) ++ return; ++ *p = q->next; ++ q->parent = ddir; ++ q->next = ddir->subdir; ++ ddir->subdir = q; ++ if (S_ISDIR(q->mode)) { ++ sdir->nlink--; ++ ddir->nlink++; ++ } ++} ++static void prepare_proc_misc(void) ++{ ++ static char *table[] = { ++ "loadavg", ++ "uptime", ++ "meminfo", ++ "version", ++ "stat", ++ "filesystems", ++ "locks", ++ "swaps", ++ "mounts", ++ "net", ++ "cpuinfo", ++ "sysvipc", ++ "sys", ++ "fs", ++ "vz", ++ "cmdline", ++ "vmstat", ++ "modules", ++ "devices", ++ NULL, ++ }; ++ char **p; ++ ++ for (p = table; *p != NULL; p++) ++ proc_move(&proc_root, ve0.proc_root, *p); ++} ++int prepare_proc(void) ++{ ++ struct ve_struct *envid; ++ struct proc_dir_entry *de; ++ struct proc_dir_entry *ve_root; ++ ++ envid = set_exec_env(&ve0); ++ ve_root = ve0.proc_root->subdir; ++ /* move the whole tree to be visible in VE0 only */ ++ ve0.proc_root->subdir = proc_root.subdir; ++ ve0.proc_root->nlink += proc_root.nlink - 2; ++ for (de = ve0.proc_root->subdir; de->next != NULL; de = de->next) ++ de->parent = ve0.proc_root; ++ de->parent = ve0.proc_root; ++ de->next = ve_root; ++ ++ /* move back into the global scope some specific entries */ ++ proc_root.subdir = NULL; ++ proc_root.nlink = 2; ++ prepare_proc_misc(); ++ proc_mkdir("vz", NULL); ++#ifdef CONFIG_SYSVIPC ++ proc_mkdir("sysvipc", NULL); ++#endif ++ proc_root_fs = proc_mkdir("fs", NULL); ++ /* XXX proc_tty_init(); */ ++ ++ /* XXX process inodes */ ++ ++ (void)set_exec_env(envid); ++ ++ (void)create_proc_glob_entry("vz", S_IFDIR|S_IRUGO|S_IXUGO, NULL); ++ return 0; ++} ++ ++static struct proc_dir_entry ve0_proc_root = { ++ .name = "/proc", ++ .namelen = 5, ++ .mode = S_IFDIR | S_IRUGO | S_IXUGO, ++ .nlink = 2 ++}; ++ ++void prepare_ve0_proc_root(void) ++{ ++ ve0.proc_root = &ve0_proc_root; ++} ++#endif ++ ++/* ++ * ------------------------------------------------------------------------ ++ * Virtualized sysctl ++ * ------------------------------------------------------------------------ ++ */ ++extern int ve_area_access_check; ++#ifdef CONFIG_INET ++static ctl_table vz_ipv4_route_table[] = { ++ { ++ .procname = "src_check", ++ .data = &ip_rt_src_check, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++ { 0 } ++}; ++static ctl_table vz_ipv4_table[] = { ++ {NET_IPV4_ROUTE, "route", NULL, 0, 0555, vz_ipv4_route_table}, ++ { 0 } ++}; ++static ctl_table vz_net_table[] = { ++ {NET_IPV4, "ipv4", NULL, 0, 0555, vz_ipv4_table}, ++ { 0 } ++}; ++#endif ++static ctl_table vz_fs_table[] = { ++ { ++ .procname = "ve-area-access-check", ++ .data = &ve_area_access_check, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++ { 0 } ++}; ++static int dummy_pde_data = 0; ++static ctl_table dummy_kern_table[] = { ++ { ++ .ctl_name = 23571113, ++ .procname = ".dummy-pde", ++ .data = &dummy_pde_data, ++ .maxlen = sizeof(int), ++ .mode = 0400, ++ .proc_handler = proc_dointvec, ++ }, ++ {} ++}; ++static ctl_table root_table2[] = { ++#ifdef CONFIG_INET ++ {CTL_NET, "net", NULL, 0, 0555, vz_net_table}, ++#endif ++ {CTL_FS, "fs", NULL, 0, 0555, vz_fs_table}, ++ {CTL_KERN, "kernel", NULL, 0, 0555, dummy_kern_table}, ++ { 0 } ++}; ++int prepare_sysctl(void) ++{ ++ struct ve_struct *envid; ++ ++ envid = set_exec_env(&ve0); ++ register_sysctl_table(root_table2); ++ (void)set_exec_env(envid); ++ return 0; ++} ++ ++void prepare_ve0_sysctl(void) ++{ ++ INIT_LIST_HEAD(&ve0.sysctl_lh); ++} ++ ++/* ++ * ------------------------------------------------------------------------ ++ * XXX init_ve_system ++ * ------------------------------------------------------------------------ ++ */ ++ ++void init_ve_system(void) ++{ ++ struct task_struct *init_entry; ++ struct ve_struct *ve; ++ ++ ve = get_ve0(); ++ ++ init_entry = init_pid_ns.child_reaper; ++ /* if ve_move_task to VE0 (e.g. in cpt code) * ++ * occurs, ve_cap_bset on VE0 is required */ ++ ve->ve_cap_bset = CAP_INIT_EFF_SET; ++ ++#ifdef CONFIG_INET ++ ve->_ipv4_devconf = &ipv4_devconf; ++ ve->_ipv4_devconf_dflt = &ipv4_devconf_dflt; ++#endif ++ ++ read_lock(&init_entry->fs->lock); ++ ve->fs_rootmnt = init_entry->fs->rootmnt; ++ ve->fs_root = init_entry->fs->root; ++ read_unlock(&init_entry->fs->lock); ++ ++ /* common prepares */ ++#ifdef CONFIG_PROC_FS ++ prepare_proc(); ++#endif ++ prepare_sysctl(); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ve/vzdev.c debian/binary-custom.d/openvz/src/kernel/ve/vzdev.c +--- ./kernel/ve/vzdev.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ve/vzdev.c 2012-11-13 15:20:15.432569063 +0000 +@@ -0,0 +1,154 @@ ++/* ++ * kernel/ve/vzdev.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define VZCTL_MAJOR 126 ++#define VZCTL_NAME "vzctl" ++ ++MODULE_AUTHOR("SWsoft "); ++MODULE_DESCRIPTION("Virtuozzo Interface"); ++MODULE_LICENSE("GPL v2"); ++ ++static LIST_HEAD(ioctls); ++static spinlock_t ioctl_lock = SPIN_LOCK_UNLOCKED; ++ ++static struct vzioctlinfo *vzctl_get_handler(unsigned int cmd) ++{ ++ struct vzioctlinfo *h; ++ ++ spin_lock(&ioctl_lock); ++ list_for_each_entry(h, &ioctls, list) { ++ if (h->type == _IOC_TYPE(cmd)) ++ goto found; ++ } ++ h = NULL; ++found: ++ if (h && !try_module_get(h->owner)) ++ h = NULL; ++ spin_unlock(&ioctl_lock); ++ return h; ++} ++ ++static void vzctl_put_handler(struct vzioctlinfo *h) ++{ ++ if (!h) ++ return; ++ ++ module_put(h->owner); ++} ++ ++long vzctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ struct vzioctlinfo *h; ++ int err; ++ ++ err = -ENOTTY; ++ h = vzctl_get_handler(cmd); ++ if (h && h->ioctl) ++ err = (*h->ioctl)(file, cmd, arg); ++ vzctl_put_handler(h); ++ ++ return err; ++} ++ ++long compat_vzctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ struct vzioctlinfo *h; ++ int err; ++ ++ err = -ENOIOCTLCMD; ++ h = vzctl_get_handler(cmd); ++ if (h && h->compat_ioctl) ++ err = (*h->compat_ioctl)(file, cmd, arg); ++ vzctl_put_handler(h); ++ ++ return err; ++} ++ ++void vzioctl_register(struct vzioctlinfo *inf) ++{ ++ spin_lock(&ioctl_lock); ++ list_add(&inf->list, &ioctls); ++ spin_unlock(&ioctl_lock); ++} ++EXPORT_SYMBOL(vzioctl_register); ++ ++void vzioctl_unregister(struct vzioctlinfo *inf) ++{ ++ spin_lock(&ioctl_lock); ++ list_del_init(&inf->list); ++ spin_unlock(&ioctl_lock); ++} ++EXPORT_SYMBOL(vzioctl_unregister); ++ ++/* ++ * Init/exit stuff. ++ */ ++static struct file_operations vzctl_fops = { ++ .owner = THIS_MODULE, ++ .unlocked_ioctl = vzctl_ioctl, ++ .compat_ioctl = compat_vzctl_ioctl, ++}; ++ ++static struct class *vzctl_class; ++ ++static void __exit vzctl_exit(void) ++{ ++ class_device_destroy(vzctl_class, MKDEV(VZCTL_MAJOR, 0)); ++ class_destroy(vzctl_class); ++ unregister_chrdev(VZCTL_MAJOR, VZCTL_NAME); ++} ++ ++static int __init vzctl_init(void) ++{ ++ int ret; ++ struct class_device *class_err; ++ ++ ret = register_chrdev(VZCTL_MAJOR, VZCTL_NAME, &vzctl_fops); ++ if (ret < 0) ++ goto out; ++ ++ vzctl_class = class_create(THIS_MODULE, "vzctl"); ++ if (IS_ERR(vzctl_class)) { ++ ret = PTR_ERR(vzctl_class); ++ goto out_cleandev; ++ } ++ ++ class_err = class_device_create(vzctl_class, NULL, MKDEV(VZCTL_MAJOR, 0), ++ NULL, VZCTL_NAME); ++ if (IS_ERR(class_err)) { ++ ret = PTR_ERR(class_err); ++ goto out_rmclass; ++ } ++ ++ goto out; ++ ++out_rmclass: ++ class_destroy(vzctl_class); ++out_cleandev: ++ unregister_chrdev(VZCTL_MAJOR, VZCTL_NAME); ++out: ++ return ret; ++} ++ ++module_init(vzctl_init) ++module_exit(vzctl_exit); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ve/vzevent.c debian/binary-custom.d/openvz/src/kernel/ve/vzevent.c +--- ./kernel/ve/vzevent.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ve/vzevent.c 2012-11-13 15:20:15.432569063 +0000 +@@ -0,0 +1,125 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define NETLINK_UEVENT 31 ++#define VZ_EVGRP_ALL 0x01 ++ ++/* ++ * NOTE: the original idea was to send events via kobject_uevent(), ++ * however, it turns out that it has negative consequences like ++ * start of /sbin/hotplug which tries to react on our events in inadequate manner. ++ */ ++ ++static struct sock *vzev_sock; ++ ++static char *action_to_string(int action) ++{ ++ switch (action) { ++ case KOBJ_MOUNT: ++ return "ve-mount"; ++ case KOBJ_UMOUNT: ++ return "ve-umount"; ++ case KOBJ_START: ++ return "ve-start"; ++ case KOBJ_STOP: ++ return "ve-stop"; ++ default: ++ return NULL; ++ } ++} ++ ++static int do_vzevent_send(int event, char *msg, int len) ++{ ++ struct sk_buff *skb; ++ char *buf, *action; ++ int alen; ++ ++ action = action_to_string(event); ++ alen = strlen(action); ++ ++ skb = alloc_skb(len + 1 + alen, GFP_KERNEL); ++ if (!skb) ++ return -ENOMEM; ++ ++ buf = skb_put(skb, len + 1 + alen); ++ memcpy(buf, action, alen); ++ buf[alen] = '@'; ++ memcpy(buf + alen + 1, msg, len); ++ (void)netlink_broadcast(vzev_sock, skb, 0, VZ_EVGRP_ALL, GFP_KERNEL); ++ return 0; ++} ++ ++int vzevent_send(int event, const char *attrs_fmt, ...) ++{ ++ va_list args; ++ int len, err; ++ struct ve_struct *ve; ++ char *page; ++ ++ err = -ENOMEM; ++ page = (char *)__get_free_page(GFP_KERNEL); ++ if (!page) ++ goto out; ++ ++ va_start(args, attrs_fmt); ++ len = vscnprintf(page, PAGE_SIZE, attrs_fmt, args); ++ va_end(args); ++ ++ ve = set_exec_env(get_ve0()); ++ err = do_vzevent_send(event, page, len); ++ (void)set_exec_env(ve); ++ free_page((unsigned long)page); ++out: ++ return err; ++} ++EXPORT_SYMBOL(vzevent_send); ++ ++static int ve_start(void *data) ++{ ++ struct ve_struct *ve; ++ ++ ve = (struct ve_struct *)data; ++ vzevent_send(KOBJ_START, "%d", ve->veid); ++ return 0; ++} ++ ++static void ve_stop(void *data) ++{ ++ struct ve_struct *ve; ++ ++ ve = (struct ve_struct *)data; ++ vzevent_send(KOBJ_STOP, "%d", ve->veid); ++} ++ ++static struct ve_hook ve_start_stop_hook = { ++ .init = ve_start, ++ .fini = ve_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_AFTERALL, ++}; ++ ++static int __init init_vzevent(void) ++{ ++ vzev_sock = netlink_kernel_create(NETLINK_UEVENT, 0, NULL, THIS_MODULE); ++ if (vzev_sock == NULL) ++ return -ENOMEM; ++ ve_hook_register(VE_SS_CHAIN, &ve_start_stop_hook); ++ return 0; ++} ++ ++static void __exit exit_vzevent(void) ++{ ++ ve_hook_unregister(&ve_start_stop_hook); ++ sock_release(vzev_sock->sk_socket); ++} ++ ++MODULE_LICENSE("GPL"); ++ ++module_init(init_vzevent); ++module_exit(exit_vzevent); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./kernel/ve/vzwdog.c debian/binary-custom.d/openvz/src/kernel/ve/vzwdog.c +--- ./kernel/ve/vzwdog.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/openvz/src/kernel/ve/vzwdog.c 2012-11-13 15:20:15.432569063 +0000 +@@ -0,0 +1,281 @@ ++/* ++ * kernel/ve/vzwdog.c ++ * ++ * Copyright (C) 2000-2005 SWsoft ++ * All rights reserved. ++ * ++ * Licensing governed by "linux/COPYING.SWsoft" file. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Staff regading kernel thread polling VE validity */ ++static int sleep_timeout = 60; ++static struct task_struct *wdog_thread_tsk; ++ ++extern void show_mem(void); ++ ++static struct file *intr_file; ++static char page[PAGE_SIZE]; ++ ++static void parse_irq_list(int len) ++{ ++ int i, k, skip; ++ for (i = 0; i < len; ) { ++ k = i; ++ while (i < len && page[i] != '\n' && page[i] != ':') ++ i++; ++ skip = 0; ++ if (i < len && page[i] != '\n') { ++ i++; /* skip ':' */ ++ while (i < len && (page[i] == ' ' || page[i] == '0')) ++ i++; ++ skip = (i < len && (page[i] < '0' || page[i] > '9')); ++ while (i < len && page[i] != '\n') ++ i++; ++ } ++ if (!skip) ++ printk("%.*s\n", i - k, page + k); ++ if (i < len) ++ i++; /* skip '\n' */ ++ } ++} ++ ++extern loff_t vfs_llseek(struct file *file, loff_t, int); ++extern ssize_t vfs_read(struct file *file, char __user *, size_t, loff_t *); ++extern struct file *filp_open(const char *filename, int flags, int mode); ++extern int filp_close(struct file *filp, fl_owner_t id); ++static void show_irq_list(void) ++{ ++ mm_segment_t fs; ++ int r; ++ ++ fs = get_fs(); ++ set_fs(KERNEL_DS); ++ vfs_llseek(intr_file, 0, 0); ++ r = vfs_read(intr_file, (void __user *)page, sizeof(page), ++ &intr_file->f_pos); ++ set_fs(fs); ++ ++ if (r > 0) ++ parse_irq_list(r); ++} ++ ++static void show_alloc_latency(void) ++{ ++ static const char *alloc_descr[KSTAT_ALLOCSTAT_NR] = { ++ "A0", ++ "L0", ++ "H0", ++ "L1", ++ "H1" ++ }; ++ int i; ++ ++ printk("lat: "); ++ for (i = 0; i < KSTAT_ALLOCSTAT_NR; i++) { ++ struct kstat_lat_struct *p; ++ cycles_t maxlat, avg0, avg1, avg2; ++ ++ p = &kstat_glob.alloc_lat[i]; ++ spin_lock_irq(&kstat_glb_lock); ++ maxlat = p->last.maxlat; ++ avg0 = p->avg[0]; ++ avg1 = p->avg[1]; ++ avg2 = p->avg[2]; ++ spin_unlock_irq(&kstat_glb_lock); ++ ++ printk("%s %Lu (%Lu %Lu %Lu)", ++ alloc_descr[i], ++ (unsigned long long)maxlat, ++ (unsigned long long)avg0, ++ (unsigned long long)avg1, ++ (unsigned long long)avg2); ++ } ++ printk("\n"); ++} ++ ++static void show_schedule_latency(void) ++{ ++ struct kstat_lat_pcpu_struct *p; ++ cycles_t maxlat, totlat, avg0, avg1, avg2; ++ unsigned long count; ++ ++ p = &kstat_glob.sched_lat; ++ spin_lock_irq(&kstat_glb_lock); ++ maxlat = p->last.maxlat; ++ totlat = p->last.totlat; ++ count = p->last.count; ++ avg0 = p->avg[0]; ++ avg1 = p->avg[1]; ++ avg2 = p->avg[2]; ++ spin_unlock_irq(&kstat_glb_lock); ++ ++ printk("sched lat: %Lu/%Lu/%lu (%Lu %Lu %Lu)\n", ++ (unsigned long long)maxlat, ++ (unsigned long long)totlat, ++ count, ++ (unsigned long long)avg0, ++ (unsigned long long)avg1, ++ (unsigned long long)avg2); ++} ++ ++static void show_header(void) ++{ ++ struct timeval tv; ++ ++ do_gettimeofday(&tv); ++ preempt_disable(); ++ printk("*** VZWDOG 1.14: time %lu.%06lu uptime %Lu CPU %d ***\n", ++ tv.tv_sec, (long)tv.tv_usec, ++ (unsigned long long)get_jiffies_64(), ++ smp_processor_id()); ++#ifdef CONFIG_FAIRSCHED ++ printk("*** cycles_per_jiffy %lu jiffies_per_second %u ***\n", ++ cycles_per_jiffy, HZ); ++#else ++ printk("*** jiffies_per_second %u ***\n", HZ); ++#endif ++ preempt_enable(); ++} ++ ++static void show_pgdatinfo(void) ++{ ++ pg_data_t *pgdat; ++ ++ printk("pgdat:"); ++ for_each_online_pgdat(pgdat) { ++ printk(" %d: %lu,%lu,%lu", ++ pgdat->node_id, ++ pgdat->node_start_pfn, ++ pgdat->node_present_pages, ++ pgdat->node_spanned_pages); ++#ifdef CONFIG_FLAT_NODE_MEM_MAP ++ printk(",%p", pgdat->node_mem_map); ++#endif ++ } ++ printk("\n"); ++} ++ ++static void show_diskio(void) ++{ ++ struct gendisk *gd; ++ char buf[BDEVNAME_SIZE]; ++ ++ printk("disk_io: "); ++ ++ list_for_each_entry(gd, &block_subsys.list, kobj.entry) { ++ char *name; ++ name = disk_name(gd, 0, buf); ++ if ((strlen(name) > 4) && (strncmp(name, "loop", 4) == 0) && ++ isdigit(name[4])) ++ continue; ++ if ((strlen(name) > 3) && (strncmp(name, "ram", 3) == 0) && ++ isdigit(name[3])) ++ continue; ++ printk("(%u,%u) %s r(%lu %lu %lu) w(%lu %lu %lu)\n", ++ gd->major, gd->first_minor, ++ name, ++ disk_stat_read(gd, ios[READ]), ++ disk_stat_read(gd, sectors[READ]), ++ disk_stat_read(gd, merges[READ]), ++ disk_stat_read(gd, ios[WRITE]), ++ disk_stat_read(gd, sectors[WRITE]), ++ disk_stat_read(gd, merges[WRITE])); ++ } ++ ++ printk("\n"); ++} ++ ++static void show_nrprocs(void) ++{ ++ unsigned long _nr_running, _nr_sleeping, ++ _nr_unint, _nr_zombie, _nr_dead, _nr_stopped; ++ ++ _nr_running = nr_running(); ++ _nr_unint = nr_uninterruptible(); ++ _nr_sleeping = nr_sleeping(); ++ _nr_zombie = nr_zombie; ++ _nr_dead = atomic_read(&nr_dead); ++ _nr_stopped = nr_stopped(); ++ ++ printk("VEnum: %d, proc R %lu, S %lu, D %lu, " ++ "Z %lu, X %lu, T %lu (tot %d)\n", ++ nr_ve, _nr_running, _nr_sleeping, _nr_unint, ++ _nr_zombie, _nr_dead, _nr_stopped, nr_threads); ++} ++ ++static void wdog_print(void) ++{ ++ show_header(); ++ show_irq_list(); ++ show_pgdatinfo(); ++ show_mem(); ++ show_diskio(); ++ show_schedule_latency(); ++ show_alloc_latency(); ++ show_nrprocs(); ++} ++ ++static int wdog_loop(void* data) ++{ ++ while (1) { ++ wdog_print(); ++ try_to_freeze(); ++ ++ set_current_state(TASK_UNINTERRUPTIBLE); ++ if (kthread_should_stop()) ++ break; ++ schedule_timeout(sleep_timeout*HZ); ++ } ++ return 0; ++} ++ ++static int __init wdog_init(void) ++{ ++ struct file *file; ++ ++ file = filp_open("/proc/interrupts", 0, 0); ++ if (IS_ERR(file)) ++ return PTR_ERR(file); ++ intr_file = file; ++ ++ wdog_thread_tsk = kthread_run(wdog_loop, NULL, "vzwdog"); ++ if (IS_ERR(wdog_thread_tsk)) { ++ filp_close(intr_file, NULL); ++ return -EBUSY; ++ } ++ return 0; ++} ++ ++static void __exit wdog_exit(void) ++{ ++ kthread_stop(wdog_thread_tsk); ++ filp_close(intr_file, NULL); ++} ++ ++module_param(sleep_timeout, int, 0660); ++MODULE_AUTHOR("SWsoft "); ++MODULE_DESCRIPTION("Virtuozzo WDOG"); ++MODULE_LICENSE("GPL v2"); ++ ++module_init(wdog_init) ++module_exit(wdog_exit) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./lib/Kconfig.debug debian/binary-custom.d/openvz/src/lib/Kconfig.debug +--- ./lib/Kconfig.debug 2012-06-12 16:25:24.278312487 +0100 ++++ debian/binary-custom.d/openvz/src/lib/Kconfig.debug 2012-11-13 15:20:15.440569063 +0000 +@@ -79,6 +79,14 @@ + exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in + your build tree), to make sure they're suitable. + ++config SYSRQ_DEBUG ++ bool "Debugging via sysrq keys" ++ depends on MAGIC_SYSRQ ++ help ++ Say Y if you want to extend functionality of magic key. It will ++ provide you with some debugging facilities such as dumping and ++ writing memory, resolving symbols and some other. ++ + config DEBUG_KERNEL + bool "Kernel debugging" + help +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./lib/bust_spinlocks.c debian/binary-custom.d/openvz/src/lib/bust_spinlocks.c +--- ./lib/bust_spinlocks.c 2012-06-12 16:25:24.278312487 +0100 ++++ debian/binary-custom.d/openvz/src/lib/bust_spinlocks.c 2012-11-13 15:20:15.444569065 +0000 +@@ -12,10 +12,13 @@ + #include + #include + #include +- ++#include + + void __attribute__((weak)) bust_spinlocks(int yes) + { ++ if (printk_no_wake) ++ return; ++ + if (yes) { + ++oops_in_progress; + } else { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./lib/kobject.c debian/binary-custom.d/openvz/src/lib/kobject.c +--- ./lib/kobject.c 2012-06-12 16:25:24.282312487 +0100 ++++ debian/binary-custom.d/openvz/src/lib/kobject.c 2012-11-13 15:20:15.456569064 +0000 +@@ -558,7 +558,7 @@ + INIT_LIST_HEAD(&k->list); + spin_lock_init(&k->list_lock); + } +- ++EXPORT_SYMBOL(kset_init); + + /** + * kset_add - add a kset object to the hierarchy. +@@ -632,6 +632,14 @@ + return ret; + } + ++/** ++ * subsystem_register - register a subsystem. ++ * @s: the subsystem we're registering. ++ * ++ * Once we register the subsystem, we want to make sure that ++ * the kset points back to this subsystem for correct usage of ++ * the rwsem. ++ */ + int subsystem_register(struct kset *s) + { + return kset_register(s); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./lib/kobject_uevent.c debian/binary-custom.d/openvz/src/lib/kobject_uevent.c +--- ./lib/kobject_uevent.c 2012-06-12 16:25:24.282312487 +0100 ++++ debian/binary-custom.d/openvz/src/lib/kobject_uevent.c 2012-11-13 15:20:15.456569064 +0000 +@@ -36,6 +36,8 @@ + [KOBJ_REMOVE] = "remove", + [KOBJ_CHANGE] = "change", + [KOBJ_MOVE] = "move", ++ [KOBJ_START] = "start", ++ [KOBJ_STOP] = "stop", + [KOBJ_ONLINE] = "online", + [KOBJ_OFFLINE] = "offline", + }; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/filemap.c debian/binary-custom.d/openvz/src/mm/filemap.c +--- ./mm/filemap.c 2012-06-12 16:25:24.294312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/filemap.c 2012-11-13 15:20:15.476569065 +0000 +@@ -42,6 +42,8 @@ + + #include + ++#include ++ + static ssize_t + generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, + loff_t offset, unsigned long nr_segs); +@@ -121,6 +123,7 @@ + + radix_tree_delete(&mapping->page_tree, page->index); + page->mapping = NULL; ++ ub_io_release_debug(page); + mapping->nrpages--; + __dec_zone_page_state(page, NR_FILE_PAGES); + BUG_ON(page_mapped(page)); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/filemap_xip.c debian/binary-custom.d/openvz/src/mm/filemap_xip.c +--- ./mm/filemap_xip.c 2012-06-12 16:25:24.294312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/filemap_xip.c 2012-11-13 15:20:15.476569065 +0000 +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + /* + * We do use our own empty page to avoid interference with other users +@@ -195,6 +196,8 @@ + flush_cache_page(vma, address, pte_pfn(*pte)); + pteval = ptep_clear_flush(vma, address, pte); + page_remove_rmap(page, vma); ++ pb_remove_ref(page, mm); ++ ub_unused_privvm_inc(mm, vma); + dec_mm_counter(mm, file_rss); + BUG_ON(pte_dirty(pteval)); + pte_unmap_unlock(pte, ptl); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/fremap.c debian/binary-custom.d/openvz/src/mm/fremap.c +--- ./mm/fremap.c 2012-06-12 16:25:24.294312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/fremap.c 2012-11-13 15:20:15.476569065 +0000 +@@ -20,6 +20,8 @@ + #include + #include + ++#include ++ + static void zap_pte(struct mm_struct *mm, struct vm_area_struct *vma, + unsigned long addr, pte_t *ptep) + { +@@ -35,6 +37,7 @@ + if (pte_dirty(pte)) + set_page_dirty(page); + page_remove_rmap(page, vma); ++ pb_remove_ref(page, mm); + page_cache_release(page); + update_hiwater_rss(mm); + dec_mm_counter(mm, file_rss); +@@ -61,8 +64,10 @@ + if (!pte) + goto out; + +- if (!pte_none(*pte)) ++ if (!pte_none(*pte)) { + zap_pte(mm, vma, addr, pte); ++ ub_unused_privvm_inc(mm, vma); ++ } + + set_pte_at(mm, addr, pte, pgoff_to_pte(pgoff)); + /* +@@ -237,4 +242,5 @@ + + return err; + } ++EXPORT_SYMBOL_GPL(sys_remap_file_pages); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/memory.c debian/binary-custom.d/openvz/src/mm/memory.c +--- ./mm/memory.c 2012-06-12 16:25:24.298312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/memory.c 2012-11-13 15:20:15.480569064 +0000 +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -50,6 +51,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -60,6 +62,11 @@ + #include + #include + ++#include ++#include ++#include ++#include ++ + #ifndef CONFIG_NEED_MULTIPLE_NODES + /* use the per-pgdat data instead for discontigmem - mbligh */ + unsigned long max_mapnr; +@@ -103,18 +110,21 @@ + pgd_ERROR(*pgd); + pgd_clear(pgd); + } ++EXPORT_SYMBOL_GPL(pgd_clear_bad); + + void pud_clear_bad(pud_t *pud) + { + pud_ERROR(*pud); + pud_clear(pud); + } ++EXPORT_SYMBOL_GPL(pud_clear_bad); + + void pmd_clear_bad(pmd_t *pmd) + { + pmd_ERROR(*pmd); + pmd_clear(pmd); + } ++EXPORT_SYMBOL_GPL(pmd_clear_bad); + + /* + * Note: this doesn't free the actual pages themselves. That +@@ -314,6 +324,7 @@ + spin_unlock(&mm->page_table_lock); + return 0; + } ++EXPORT_SYMBOL_GPL(__pte_alloc); + + int __pte_alloc_kernel(pmd_t *pmd, unsigned long address) + { +@@ -414,6 +425,7 @@ + */ + return pfn_to_page(pfn); + } ++EXPORT_SYMBOL_GPL(vm_normal_page); + + /* + * copy one vm_area from one task to the other. Assumes the page tables +@@ -424,7 +436,7 @@ + static inline void + copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, + pte_t *dst_pte, pte_t *src_pte, struct vm_area_struct *vma, +- unsigned long addr, int *rss) ++ unsigned long addr, int *rss, struct page_beancounter **pbc) + { + unsigned long vm_flags = vma->vm_flags; + pte_t pte = *src_pte; +@@ -479,6 +491,7 @@ + if (page) { + get_page(page); + page_dup_rmap(page, vma, addr); ++ pb_dup_ref(page, dst_mm, pbc); + rss[!!PageAnon(page)]++; + } + +@@ -486,20 +499,35 @@ + set_pte_at(dst_mm, addr, dst_pte, pte); + } + ++#define pte_ptrs(a) (PTRS_PER_PTE - ((a >> PAGE_SHIFT)&(PTRS_PER_PTE - 1))) ++#ifdef CONFIG_BEANCOUNTERS ++#define same_ub(mm1, mm2) ((mm1)->mm_ub == (mm2)->mm_ub) ++#else ++#define same_ub(mm1, mm2) 1 ++#endif ++ + static int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, +- pmd_t *dst_pmd, pmd_t *src_pmd, struct vm_area_struct *vma, ++ pmd_t *dst_pmd, pmd_t *src_pmd, ++ struct vm_area_struct *dst_vma, ++ struct vm_area_struct *vma, + unsigned long addr, unsigned long end) + { + pte_t *src_pte, *dst_pte; + spinlock_t *src_ptl, *dst_ptl; + int progress = 0; +- int rss[2]; ++ int rss[2], rss_tot; ++ struct page_beancounter *pbc; ++ int err; + ++ err = -ENOMEM; ++ pbc = same_ub(src_mm, dst_mm) ? PBC_COPY_SAME : NULL; + again: ++ if (pbc != PBC_COPY_SAME && pb_alloc_list(&pbc, pte_ptrs(addr))) ++ goto out; + rss[1] = rss[0] = 0; + dst_pte = pte_alloc_map_lock(dst_mm, dst_pmd, addr, &dst_ptl); + if (!dst_pte) +- return -ENOMEM; ++ goto out; + src_pte = pte_offset_map_nested(src_pmd, addr); + src_ptl = pte_lockptr(src_mm, src_pmd); + spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING); +@@ -521,23 +549,32 @@ + progress++; + continue; + } +- copy_one_pte(dst_mm, src_mm, dst_pte, src_pte, vma, addr, rss); ++ copy_one_pte(dst_mm, src_mm, dst_pte, src_pte, vma, addr, rss, ++ &pbc); + progress += 8; + } while (dst_pte++, src_pte++, addr += PAGE_SIZE, addr != end); + + arch_leave_lazy_mmu_mode(); + spin_unlock(src_ptl); + pte_unmap_nested(src_pte - 1); ++ rss_tot = rss[0] + rss[1]; ++ ub_unused_privvm_sub(dst_mm, dst_vma, rss_tot); + add_mm_rss(dst_mm, rss[0], rss[1]); + pte_unmap_unlock(dst_pte - 1, dst_ptl); + cond_resched(); + if (addr != end) + goto again; +- return 0; ++ ++ err = 0; ++out: ++ pb_free_list(&pbc); ++ return err; + } + + static inline int copy_pmd_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, +- pud_t *dst_pud, pud_t *src_pud, struct vm_area_struct *vma, ++ pud_t *dst_pud, pud_t *src_pud, ++ struct vm_area_struct *dst_vma, ++ struct vm_area_struct *vma, + unsigned long addr, unsigned long end) + { + pmd_t *src_pmd, *dst_pmd; +@@ -552,14 +589,16 @@ + if (pmd_none_or_clear_bad(src_pmd)) + continue; + if (copy_pte_range(dst_mm, src_mm, dst_pmd, src_pmd, +- vma, addr, next)) ++ dst_vma, vma, addr, next)) + return -ENOMEM; + } while (dst_pmd++, src_pmd++, addr = next, addr != end); + return 0; + } + + static inline int copy_pud_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, +- pgd_t *dst_pgd, pgd_t *src_pgd, struct vm_area_struct *vma, ++ pgd_t *dst_pgd, pgd_t *src_pgd, ++ struct vm_area_struct *dst_vma, ++ struct vm_area_struct *vma, + unsigned long addr, unsigned long end) + { + pud_t *src_pud, *dst_pud; +@@ -574,19 +613,21 @@ + if (pud_none_or_clear_bad(src_pud)) + continue; + if (copy_pmd_range(dst_mm, src_mm, dst_pud, src_pud, +- vma, addr, next)) ++ dst_vma, vma, addr, next)) + return -ENOMEM; + } while (dst_pud++, src_pud++, addr = next, addr != end); + return 0; + } + +-int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, +- struct vm_area_struct *vma) ++int __copy_page_range(struct vm_area_struct *dst_vma, ++ struct vm_area_struct *vma, ++ unsigned long addr, size_t size) + { ++ struct mm_struct *dst_mm = dst_vma->vm_mm; ++ struct mm_struct *src_mm = vma->vm_mm; + pgd_t *src_pgd, *dst_pgd; + unsigned long next; +- unsigned long addr = vma->vm_start; +- unsigned long end = vma->vm_end; ++ unsigned long end = addr + size; + + /* + * Don't copy ptes where a page fault will fill them correctly. +@@ -609,11 +650,22 @@ + if (pgd_none_or_clear_bad(src_pgd)) + continue; + if (copy_pud_range(dst_mm, src_mm, dst_pgd, src_pgd, +- vma, addr, next)) ++ dst_vma, vma, addr, next)) + return -ENOMEM; + } while (dst_pgd++, src_pgd++, addr = next, addr != end); + return 0; + } ++EXPORT_SYMBOL_GPL(__copy_page_range); ++ ++int copy_page_range(struct mm_struct *dst, struct mm_struct *src, ++ struct vm_area_struct *dst_vma, struct vm_area_struct *vma) ++{ ++ if (dst_vma->vm_mm != dst) ++ BUG(); ++ if (vma->vm_mm != src) ++ BUG(); ++ return __copy_page_range(dst_vma, vma, vma->vm_start, vma->vm_end-vma->vm_start); ++} + + static unsigned long zap_pte_range(struct mmu_gather *tlb, + struct vm_area_struct *vma, pmd_t *pmd, +@@ -625,6 +677,7 @@ + spinlock_t *ptl; + int file_rss = 0; + int anon_rss = 0; ++ int rss; + + pte = pte_offset_map_lock(mm, pmd, addr, &ptl); + arch_enter_lazy_mmu_mode(); +@@ -679,6 +732,7 @@ + file_rss--; + } + page_remove_rmap(page, vma); ++ pb_remove_ref(page, mm); + tlb_remove_page(tlb, page); + continue; + } +@@ -693,6 +747,8 @@ + pte_clear_not_present_full(mm, addr, pte, tlb->fullmm); + } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0)); + ++ rss = -(file_rss + anon_rss); ++ ub_unused_privvm_add(mm, vma, rss); + add_mm_rss(mm, file_rss, anon_rss); + arch_leave_lazy_mmu_mode(); + pte_unmap_unlock(pte - 1, ptl); +@@ -1581,6 +1637,7 @@ + int reuse = 0, ret = 0; + int page_mkwrite = 0; + struct page *dirty_page = NULL; ++ struct page_beancounter *pbc; + + old_page = vm_normal_page(vma, address, orig_pte); + if (!old_page) +@@ -1640,6 +1697,7 @@ + flush_cache_page(vma, address, pte_pfn(orig_pte)); + entry = pte_mkyoung(orig_pte); + entry = maybe_mkwrite(pte_mkdirty(entry), vma); ++ ClearPageCheckpointed(old_page); + if (ptep_set_access_flags(vma, address, page_table, entry,1)) + update_mmu_cache(vma, address, entry); + ret |= VM_FAULT_WRITE; +@@ -1653,6 +1711,9 @@ + gotten: + pte_unmap_unlock(page_table, ptl); + ++ if (unlikely(pb_alloc(&pbc))) ++ goto oom_nopb; ++ + if (unlikely(anon_vma_prepare(vma))) + goto oom; + VM_BUG_ON(old_page == ZERO_PAGE(0)); +@@ -1668,12 +1729,15 @@ + if (likely(pte_same(*page_table, orig_pte))) { + if (old_page) { + page_remove_rmap(old_page, vma); ++ pb_remove_ref(old_page, mm); + if (!PageAnon(old_page)) { + dec_mm_counter(mm, file_rss); + inc_mm_counter(mm, anon_rss); + } +- } else ++ } else { ++ ub_unused_privvm_dec(mm, vma); + inc_mm_counter(mm, anon_rss); ++ } + flush_cache_page(vma, address, pte_pfn(orig_pte)); + entry = mk_pte(new_page, vma->vm_page_prot); + entry = maybe_mkwrite(pte_mkdirty(entry), vma); +@@ -1688,6 +1752,7 @@ + update_mmu_cache(vma, address, entry); + lru_cache_add_active(new_page); + page_add_new_anon_rmap(new_page, vma, address); ++ pb_add_ref(new_page, mm, &pbc); + + /* Free the old page.. */ + new_page = old_page; +@@ -1697,6 +1762,7 @@ + page_cache_release(new_page); + if (old_page) + page_cache_release(old_page); ++ pb_free(&pbc); + unlock: + pte_unmap_unlock(page_table, ptl); + if (dirty_page) { +@@ -1717,6 +1783,8 @@ + } + return ret; + oom: ++ pb_free(&pbc); ++oom_nopb: + if (old_page) + page_cache_release(old_page); + return VM_FAULT_OOM; +@@ -2087,10 +2155,16 @@ + swp_entry_t entry; + pte_t pte; + int ret = 0; ++ struct page_beancounter *pbc; ++ cycles_t start; + + if (!pte_unmap_same(mm, pmd, page_table, orig_pte)) +- goto out; ++ goto out_nostat; ++ ++ if (unlikely(pb_alloc(&pbc))) ++ return VM_FAULT_OOM; + ++ start = get_cycles(); + entry = pte_to_swp_entry(orig_pte); + if (is_migration_entry(entry)) { + migration_entry_wait(mm, pmd, address); +@@ -2138,6 +2212,7 @@ + /* The page isn't present yet, go ahead with the fault. */ + + inc_mm_counter(mm, anon_rss); ++ ub_percpu_inc(mm->mm_ub, swapin); + pte = mk_pte(page, vma->vm_page_prot); + if (write_access && can_share_swap_page(page)) { + pte = maybe_mkwrite(pte_mkdirty(pte), vma); +@@ -2147,10 +2222,11 @@ + flush_icache_page(vma, page); + set_pte_at(mm, address, page_table, pte); + page_add_anon_rmap(page, vma, address); ++ pb_add_ref(page, mm, &pbc); ++ ub_unused_privvm_dec(mm, vma); + + swap_free(entry); +- if (vm_swap_full()) +- remove_exclusive_swap_page(page); ++ try_to_remove_exclusive_swap_page(page); + unlock_page(page); + + if (write_access) { +@@ -2166,9 +2242,15 @@ + unlock: + pte_unmap_unlock(page_table, ptl); + out: ++ pb_free(&pbc); ++ spin_lock_irq(&kstat_glb_lock); ++ KSTAT_LAT_ADD(&kstat_glob.swap_in, get_cycles() - start); ++ spin_unlock_irq(&kstat_glb_lock); ++out_nostat: + return ret; + out_nomap: + pte_unmap_unlock(page_table, ptl); ++ pb_free(&pbc); + unlock_page(page); + page_cache_release(page); + return ret; +@@ -2211,6 +2293,7 @@ + struct page *page; + spinlock_t *ptl; + pte_t entry; ++ struct page_beancounter *pbc; + + pte_unmap(page_table); + +@@ -2218,6 +2301,9 @@ + if (check_stack_guard_page(vma, address) < 0) + return VM_FAULT_SIGBUS; + ++ if (unlikely(pb_alloc(&pbc))) ++ goto oom_nopb; ++ + /* Allocate our own private page. */ + if (unlikely(anon_vma_prepare(vma))) + goto oom; +@@ -2234,17 +2320,22 @@ + inc_mm_counter(mm, anon_rss); + lru_cache_add_active(page); + page_add_new_anon_rmap(page, vma, address); ++ pb_add_ref(page, mm, &pbc); ++ ub_unused_privvm_dec(mm, vma); + set_pte_at(mm, address, page_table, entry); + + /* No need to invalidate - it was non-present before */ + update_mmu_cache(vma, address, entry); + unlock: ++ pb_free(&pbc); + pte_unmap_unlock(page_table, ptl); + return 0; + release: + page_cache_release(page); + goto unlock; + oom: ++ pb_free(&pbc); ++oom_nopb: + return VM_FAULT_OOM; + } + +@@ -2271,6 +2362,7 @@ + pte_t entry; + int anon = 0; + struct page *dirty_page = NULL; ++ struct page_beancounter *pbc; + struct vm_fault vmf; + int ret; + int page_mkwrite = 0; +@@ -2282,6 +2374,9 @@ + + BUG_ON(vma->vm_flags & VM_PFNMAP); + ++ if (unlikely(pb_alloc(&pbc))) ++ goto oom_nopb; ++ + if (likely(vma->vm_ops->fault)) { + ret = vma->vm_ops->fault(vma, &vmf); + if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) +@@ -2292,9 +2387,9 @@ + vmf.page = vma->vm_ops->nopage(vma, address & PAGE_MASK, &ret); + /* no page was available -- either SIGBUS or OOM */ + if (unlikely(vmf.page == NOPAGE_SIGBUS)) +- return VM_FAULT_SIGBUS; ++ goto bus_nopg; + else if (unlikely(vmf.page == NOPAGE_OOM)) +- return VM_FAULT_OOM; ++ goto oom_nopg; + } + + /* +@@ -2370,6 +2465,8 @@ + */ + /* Only go through if we didn't race with anybody else... */ + if (likely(pte_same(*page_table, orig_pte))) { ++ struct user_beancounter *ub; ++ + flush_icache_page(vma, page); + entry = mk_pte(page, vma->vm_page_prot); + if (flags & FAULT_FLAG_WRITE) +@@ -2387,6 +2484,25 @@ + get_page(dirty_page); + } + } ++ ub = page_ub(page); ++ if (ub != NULL && ++#ifdef CONFIG_BC_IO_ACCOUNTING ++ !((unsigned long)ub & PAGE_IO_MARK) && ++#endif ++ ub->ub_magic == UB_MAGIC) { ++ /* ++ * WOW: Page was already charged as page_ub. This may ++ * happens for example then some driver export its low ++ * memory pages to user space. We can't account page as ++ * page_ub and page_bp at the same time. So uncharge ++ * page from UB counter. ++ */ ++ WARN_ON_ONCE(1); ++ ub_page_uncharge(page, 0); ++ } ++ ++ pb_add_ref(page, mm, &pbc); ++ ub_unused_privvm_dec(mm, vma); + + /* no need to invalidate: a not-present page won't be cached */ + update_mmu_cache(vma, address, entry); +@@ -2411,8 +2527,15 @@ + set_page_dirty_balance(dirty_page, page_mkwrite); + put_page(dirty_page); + } +- ++ pb_free(&pbc); + return ret; ++bus_nopg: ++ pb_free(&pbc); ++ return VM_FAULT_SIGBUS; ++oom_nopg: ++ pb_free(&pbc); ++oom_nopb: ++ return VM_FAULT_OOM; + } + + static int do_linear_fault(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2590,6 +2713,27 @@ + pmd_t *pmd; + pte_t *pte; + ++#ifdef CONFIG_VZ_GENCALLS ++ do { ++ int ret; ++#ifdef CONFIG_BEANCOUNTERS ++ struct task_beancounter *tbc; ++ ++ tbc = ¤t->task_bc; ++ if (!test_bit(UB_AFLAG_NOTIF_PAGEIN, &mm->mm_ub->ub_aflags) && ++ tbc->pgfault_allot) { ++ tbc->pgfault_allot--; ++ break; /* skip notifier */ ++ } ++#endif ++ ret = virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_PAGEIN, ++ (void *)1); ++ if (ret & NOTIFY_FAIL) ++ return VM_FAULT_SIGBUS; ++ if (ret & NOTIFY_OK) ++ return VM_FAULT_MINOR; /* retry */ ++ } while (0); ++#endif + __set_current_state(TASK_RUNNING); + + count_vm_event(PGFAULT); +@@ -2632,6 +2776,8 @@ + } + #endif /* __PAGETABLE_PUD_FOLDED */ + ++EXPORT_SYMBOL_GPL(__pud_alloc); ++ + #ifndef __PAGETABLE_PMD_FOLDED + /* + * Allocate page middle directory. +@@ -2660,6 +2806,8 @@ + } + #endif /* __PAGETABLE_PMD_FOLDED */ + ++EXPORT_SYMBOL_GPL(__pmd_alloc); ++ + int make_pages_present(unsigned long addr, unsigned long end) + { + int ret, len, write; +@@ -2679,6 +2827,8 @@ + return ret == len ? 0 : -1; + } + ++EXPORT_SYMBOL(make_pages_present); ++ + /* + * Map a vmalloc()-space virtual address to the physical page. + */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/mempolicy.c debian/binary-custom.d/openvz/src/mm/mempolicy.c +--- ./mm/mempolicy.c 2012-06-12 16:25:24.298312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/mempolicy.c 2012-11-13 15:20:15.480569064 +0000 +@@ -89,6 +89,7 @@ + #include + #include + #include ++#include + + #include + #include +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/mempool.c debian/binary-custom.d/openvz/src/mm/mempool.c +--- ./mm/mempool.c 2012-06-12 16:25:24.298312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/mempool.c 2012-11-13 15:20:15.480569064 +0000 +@@ -77,6 +77,8 @@ + init_waitqueue_head(&pool->wait); + pool->alloc = alloc_fn; + pool->free = free_fn; ++ if (alloc_fn == mempool_alloc_slab) ++ kmem_mark_nocharge((struct kmem_cache *)pool_data); + + /* + * First pre-allocate the guaranteed number of buffers. +@@ -118,6 +120,7 @@ + unsigned long flags; + + BUG_ON(new_min_nr <= 0); ++ gfp_mask &= ~__GFP_UBC; + + spin_lock_irqsave(&pool->lock, flags); + if (new_min_nr <= pool->min_nr) { +@@ -211,6 +214,7 @@ + gfp_mask |= __GFP_NOMEMALLOC; /* don't allocate emergency reserves */ + gfp_mask |= __GFP_NORETRY; /* don't loop in __alloc_pages */ + gfp_mask |= __GFP_NOWARN; /* failures are OK */ ++ gfp_mask &= ~__GFP_UBC; + + gfp_temp = gfp_mask & ~(__GFP_WAIT|__GFP_IO); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/mlock.c debian/binary-custom.d/openvz/src/mm/mlock.c +--- ./mm/mlock.c 2012-06-12 16:25:24.298312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/mlock.c 2012-11-13 15:20:15.484569063 +0000 +@@ -8,10 +8,12 @@ + #include + #include + #include ++#include + #include + #include + #include + #include ++#include + + int can_do_mlock(void) + { +@@ -36,6 +38,14 @@ + goto out; + } + ++ if (newflags & VM_LOCKED) { ++ ret = ub_locked_charge(mm, end - start); ++ if (ret < 0) { ++ *prev = vma; ++ goto out; ++ } ++ } ++ + pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT); + *prev = vma_merge(mm, *prev, start, end, newflags, vma->anon_vma, + vma->vm_file, pgoff, vma_policy(vma)); +@@ -49,13 +59,13 @@ + if (start != vma->vm_start) { + ret = split_vma(mm, vma, start, 1); + if (ret) +- goto out; ++ goto out_uncharge; + } + + if (end != vma->vm_end) { + ret = split_vma(mm, vma, end, 0); + if (ret) +- goto out; ++ goto out_uncharge; + } + + success: +@@ -82,13 +92,19 @@ + + ret = make_pages_present(start, end); + } +- } ++ } else ++ ub_locked_uncharge(mm, end - start); + + mm->locked_vm -= pages; + out: + if (ret == -ENOMEM) + ret = -EAGAIN; + return ret; ++ ++out_uncharge: ++ if (newflags & VM_LOCKED) ++ ub_locked_uncharge(mm, end - start); ++ goto out; + } + + static int do_mlock(unsigned long start, size_t len, int on) +@@ -165,6 +181,7 @@ + up_write(¤t->mm->mmap_sem); + return error; + } ++EXPORT_SYMBOL_GPL(sys_mlock); + + asmlinkage long sys_munlock(unsigned long start, size_t len) + { +@@ -177,6 +194,7 @@ + up_write(¤t->mm->mmap_sem); + return ret; + } ++EXPORT_SYMBOL_GPL(sys_munlock); + + static int do_mlockall(int flags) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/mmap.c debian/binary-custom.d/openvz/src/mm/mmap.c +--- ./mm/mmap.c 2012-06-12 16:25:24.298312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/mmap.c 2012-11-13 15:20:15.484569063 +0000 +@@ -26,6 +26,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include +@@ -36,9 +38,12 @@ + #define arch_mmap_check(addr, len, flags) (0) + #endif + ++#include ++ + static void unmap_region(struct mm_struct *mm, + struct vm_area_struct *vma, struct vm_area_struct *prev, + unsigned long start, unsigned long end); ++static unsigned long __do_brk(unsigned long addr, unsigned long len, int soft); + + /* + * WARNING: the debugging will use recursive algorithms so never enable this +@@ -100,6 +105,18 @@ + + vm_acct_memory(pages); + ++#ifdef CONFIG_BEANCOUNTERS ++ switch (virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_ENOUGHMEM, ++ (void *)pages) ++ & (NOTIFY_OK | NOTIFY_FAIL)) { ++ case NOTIFY_OK: ++ return 0; ++ case NOTIFY_FAIL: ++ vm_unacct_memory(pages); ++ return -ENOMEM; ++ } ++#endif ++ + /* + * Sometimes we want to use more memory than we have + */ +@@ -225,6 +242,9 @@ + struct vm_area_struct *next = vma->vm_next; + + might_sleep(); ++ ++ ub_memory_uncharge(vma->vm_mm, vma->vm_end - vma->vm_start, ++ vma->vm_flags, vma->vm_file); + if (vma->vm_ops && vma->vm_ops->close) + vma->vm_ops->close(vma); + if (vma->vm_file) +@@ -272,7 +292,7 @@ + goto out; + + /* Ok, looks good - let it rip. */ +- if (do_brk(oldbrk, newbrk-oldbrk) != oldbrk) ++ if (__do_brk(oldbrk, newbrk-oldbrk, UB_HARD) != oldbrk) + goto out; + set_brk: + mm->brk = brk; +@@ -1023,6 +1043,9 @@ + if (error) + return error; + ++ if (!gr_acl_handle_mmap(file, prot)) ++ return -EACCES; ++ + return mmap_region(file, addr, len, flags, vm_flags, pgoff, + accountable); + } +@@ -1073,6 +1096,7 @@ + struct rb_node **rb_link, *rb_parent; + unsigned long charged = 0; + struct inode *inode = file ? file->f_path.dentry->d_inode : NULL; ++ unsigned long ub_charged = 0; + + /* Clear old maps */ + error = -ENOMEM; +@@ -1104,6 +1128,11 @@ + } + } + ++ if (ub_memory_charge(mm, len, vm_flags, file, ++ (flags & MAP_EXECPRIO ? UB_SOFT : UB_HARD))) ++ goto charge_error; ++ ub_charged = 1; ++ + /* + * Can we just expand an old private anonymous mapping? + * The VM_SHARED test is necessary because shmem_zero_setup +@@ -1119,7 +1148,8 @@ + * specific mapper. the address has already been validated, but + * not unmapped, but the maps are removed from the list. + */ +- vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); ++ vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL | ++ (flags & MAP_EXECPRIO ? __GFP_SOFT_UBC : 0)); + if (!vma) { + error = -ENOMEM; + goto unacct_error; +@@ -1147,6 +1177,19 @@ + error = file->f_op->mmap(file, vma); + if (error) + goto unmap_and_free_vma; ++ if (vm_flags != vma->vm_flags) { ++ /* ++ * ->vm_flags has been changed in f_op->mmap method. ++ * We have to recharge ub memory. ++ */ ++ ub_memory_uncharge(mm, len, vm_flags, file); ++ if (ub_memory_charge(mm, len, vma->vm_flags, file, ++ (flags & MAP_EXECPRIO ? UB_SOFT : UB_HARD))) { ++ ub_charged = 0; ++ error = -ENOMEM; ++ goto unmap_and_free_vma; ++ } ++ } + } else if (vm_flags & VM_SHARED) { + error = shmem_zero_setup(vma); + if (error) +@@ -1211,6 +1254,9 @@ + free_vma: + kmem_cache_free(vm_area_cachep, vma); + unacct_error: ++ if (ub_charged) ++ ub_memory_uncharge(mm, len, vm_flags, file); ++charge_error: + if (charged) + vm_unacct_memory(charged); + return error; +@@ -1541,12 +1587,16 @@ + if (is_hugepage_only_range(vma->vm_mm, new_start, size)) + return -EFAULT; + ++ if (ub_memory_charge(mm, grow << PAGE_SHIFT, vma->vm_flags, ++ vma->vm_file, UB_SOFT)) ++ goto fail_charge; ++ + /* + * Overcommit.. This must be the final test, as it will + * update security statistics. + */ + if (security_vm_enough_memory_mm(mm, grow)) +- return -ENOMEM; ++ goto fail_sec; + + /* Ok, everything looks good - let it rip */ + mm->total_vm += grow; +@@ -1554,6 +1604,11 @@ + mm->locked_vm += grow; + vm_stat_account(mm, vma->vm_flags, vma->vm_file, grow); + return 0; ++ ++fail_sec: ++ ub_memory_uncharge(mm, grow << PAGE_SHIFT, vma->vm_flags, vma->vm_file); ++fail_charge: ++ return -ENOMEM; + } + + #if defined(CONFIG_STACK_GROWSUP) || defined(CONFIG_IA64) +@@ -1841,6 +1896,7 @@ + + return 0; + } ++EXPORT_SYMBOL_GPL(split_vma); + + /* Munmap is split into 2 main parts -- this part which finds + * what needs doing, and the areas themselves, which do the +@@ -1934,7 +1990,7 @@ + * anonymous maps. eventually we may be able to do some + * brk-specific accounting here. + */ +-unsigned long do_brk(unsigned long addr, unsigned long len) ++static unsigned long __do_brk(unsigned long addr, unsigned long len, int soft) + { + struct mm_struct * mm = current->mm; + struct vm_area_struct * vma, * prev; +@@ -2000,8 +2056,11 @@ + if (mm->map_count > sysctl_max_map_count) + return -ENOMEM; + ++ if (ub_memory_charge(mm, len, flags, NULL, soft)) ++ goto fail_charge; ++ + if (security_vm_enough_memory(len >> PAGE_SHIFT)) +- return -ENOMEM; ++ goto fail_sec; + + /* Can we just expand an old private anonymous mapping? */ + if (vma_merge(mm, prev, addr, addr + len, flags, +@@ -2011,11 +2070,10 @@ + /* + * create a vma struct for an anonymous mapping + */ +- vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); +- if (!vma) { +- vm_unacct_memory(len >> PAGE_SHIFT); +- return -ENOMEM; +- } ++ vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL | ++ (soft == UB_SOFT ? __GFP_SOFT_UBC : 0)); ++ if (!vma) ++ goto fail_alloc; + + vma->vm_mm = mm; + vma->vm_start = addr; +@@ -2031,8 +2089,19 @@ + make_pages_present(addr, addr + len); + } + return addr; ++ ++fail_alloc: ++ vm_unacct_memory(len >> PAGE_SHIFT); ++fail_sec: ++ ub_memory_uncharge(mm, len, flags, NULL); ++fail_charge: ++ return -ENOMEM; + } + ++unsigned long do_brk(unsigned long addr, unsigned long len) ++{ ++ return __do_brk(addr, len, UB_SOFT); ++} + EXPORT_SYMBOL(do_brk); + + /* Release all mmaps. */ +@@ -2199,10 +2268,11 @@ + { + } + +-static struct vm_operations_struct special_mapping_vmops = { ++struct vm_operations_struct special_mapping_vmops = { + .close = special_mapping_close, + .nopage = special_mapping_nopage, + }; ++EXPORT_SYMBOL_GPL(special_mapping_vmops); + + /* + * Called with mm->mmap_sem held for writing. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/mmzone.c debian/binary-custom.d/openvz/src/mm/mmzone.c +--- ./mm/mmzone.c 2012-06-12 16:25:24.298312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/mmzone.c 2012-11-13 15:20:15.484569063 +0000 +@@ -13,6 +13,7 @@ + { + return NODE_DATA(first_online_node); + } ++EXPORT_SYMBOL(first_online_pgdat); /* June 2006 */ + + struct pglist_data *next_online_pgdat(struct pglist_data *pgdat) + { +@@ -22,6 +23,7 @@ + return NULL; + return NODE_DATA(nid); + } ++EXPORT_SYMBOL(next_online_pgdat); /* June 2006 */ + + /* + * next_zone - helper magic for for_each_zone() +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/mprotect.c debian/binary-custom.d/openvz/src/mm/mprotect.c +--- ./mm/mprotect.c 2012-06-12 16:25:24.298312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/mprotect.c 2012-11-13 15:20:15.484569063 +0000 +@@ -9,6 +9,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -21,11 +22,14 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + ++#include ++ + static void change_pte_range(struct mm_struct *mm, pmd_t *pmd, + unsigned long addr, unsigned long end, pgprot_t newprot, + int dirty_accountable) +@@ -137,6 +141,8 @@ + unsigned long charged = 0; + pgoff_t pgoff; + int error; ++ unsigned long ch_size; ++ int ch_dir; + int dirty_accountable = 0; + + if (newflags == oldflags) { +@@ -144,6 +150,12 @@ + return 0; + } + ++ error = -ENOMEM; ++ ch_size = nrpages - pages_in_vma_range(vma, start, end); ++ ch_dir = ub_protected_charge(mm, ch_size, newflags, vma); ++ if (ch_dir == PRIVVM_ERROR) ++ goto fail_ch; ++ + /* + * If we make a private mapping writable we increase our commit; + * but (without finer accounting) cannot reduce our commit if we +@@ -156,7 +168,7 @@ + if (!(oldflags & (VM_ACCOUNT|VM_WRITE|VM_SHARED))) { + charged = nrpages; + if (security_vm_enough_memory(charged)) +- return -ENOMEM; ++ goto fail_sec; + newflags |= VM_ACCOUNT; + } + } +@@ -204,10 +216,16 @@ + change_protection(vma, start, end, vma->vm_page_prot, dirty_accountable); + vm_stat_account(mm, oldflags, vma->vm_file, -nrpages); + vm_stat_account(mm, newflags, vma->vm_file, nrpages); ++ if (ch_dir == PRIVVM_TO_SHARED) ++ __ub_unused_privvm_dec(mm, ch_size); + return 0; + + fail: + vm_unacct_memory(charged); ++fail_sec: ++ if (ch_dir == PRIVVM_TO_PRIVATE) ++ __ub_unused_privvm_dec(mm, ch_size); ++fail_ch: + return error; + } + +@@ -269,6 +287,11 @@ + if (start > vma->vm_start) + prev = vma; + ++ if (!gr_acl_handle_mprotect(vma->vm_file, prot)) { ++ error = -EACCES; ++ goto out; ++ } ++ + for (nstart = start ; ; ) { + unsigned long newflags; + +@@ -309,3 +332,4 @@ + up_write(¤t->mm->mmap_sem); + return error; + } ++EXPORT_SYMBOL_GPL(sys_mprotect); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/mremap.c debian/binary-custom.d/openvz/src/mm/mremap.c +--- ./mm/mremap.c 2012-06-12 16:25:24.302312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/mremap.c 2012-11-13 15:20:15.484569063 +0000 +@@ -23,6 +23,8 @@ + #include + #include + ++#include ++ + static pmd_t *get_old_pmd(struct mm_struct *mm, unsigned long addr) + { + pgd_t *pgd; +@@ -167,17 +169,21 @@ + unsigned long hiwater_vm; + int split = 0; + ++ if (ub_memory_charge(mm, new_len, vm_flags, ++ vma->vm_file, UB_HARD)) ++ goto err; ++ + /* + * We'd prefer to avoid failure later on in do_munmap: + * which may split one vma into three before unmapping. + */ + if (mm->map_count >= sysctl_max_map_count - 3) +- return -ENOMEM; ++ goto err_nomem; + + new_pgoff = vma->vm_pgoff + ((old_addr - vma->vm_start) >> PAGE_SHIFT); + new_vma = copy_vma(&vma, new_addr, new_len, new_pgoff); + if (!new_vma) +- return -ENOMEM; ++ goto err_nomem; + + moved_len = move_page_tables(vma, old_addr, new_vma, new_addr, old_len); + if (moved_len < old_len) { +@@ -236,7 +242,13 @@ + new_addr + new_len); + } + +- return new_addr; ++ if (new_addr != -ENOMEM) ++ return new_addr; ++ ++err_nomem: ++ ub_memory_uncharge(mm, new_len, vm_flags, vma->vm_file); ++err: ++ return -ENOMEM; + } + + static struct vm_area_struct *vma_to_resize(unsigned long addr, +@@ -443,7 +455,15 @@ + if (old_len == vma->vm_end - addr) { + /* can we just expand the current mapping? */ + if (vma_expandable(vma, new_len - old_len)) { +- int pages = (new_len - old_len) >> PAGE_SHIFT; ++ unsigned long len; ++ int pages; ++ ++ len = new_len - old_len; ++ pages = len >> PAGE_SHIFT; ++ ret = -ENOMEM; ++ if (ub_memory_charge(mm, len, vma->vm_flags, ++ vma->vm_file, UB_HARD)) ++ goto out; + + vma_adjust(vma, vma->vm_start, + addr + new_len, vma->vm_pgoff, NULL); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/oom_kill.c debian/binary-custom.d/openvz/src/mm/oom_kill.c +--- ./mm/oom_kill.c 2012-06-12 16:25:24.302312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/oom_kill.c 2012-11-13 15:20:15.484569063 +0000 +@@ -19,6 +19,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -26,6 +28,9 @@ + #include + #include + ++#include ++#include ++ + int sysctl_panic_on_oom; + int sysctl_oom_kill_allocating_task; + static DEFINE_SPINLOCK(zone_scan_mutex); +@@ -194,15 +199,15 @@ + * + * (not docbooked, we don't want this one cluttering up the manual) + */ +-static struct task_struct *select_bad_process(unsigned long *ppoints) ++struct task_struct *oom_select_bad_process(struct user_beancounter *ub) + { + struct task_struct *g, *p; + struct task_struct *chosen = NULL; + struct timespec uptime; +- *ppoints = 0; ++ unsigned long chosen_points = 0; + + do_posix_clock_monotonic_gettime(&uptime); +- do_each_thread(g, p) { ++ do_each_thread_all(g, p) { + unsigned long points; + + /* +@@ -214,6 +219,8 @@ + /* skip the init task */ + if (is_global_init(p)) + continue; ++ if (ub_oom_task_skip(ub, p)) ++ continue; + + /* + * This task already has access to memory reserves and is +@@ -242,18 +249,18 @@ + return ERR_PTR(-1UL); + + chosen = p; +- *ppoints = ULONG_MAX; ++ chosen_points = ULONG_MAX; + } + + if (p->oomkilladj == OOM_DISABLE) + continue; + + points = badness(p, uptime.tv_sec); +- if (points > *ppoints || !chosen) { ++ if (points > chosen_points || !chosen) { + chosen = p; +- *ppoints = points; ++ chosen_points = points; + } +- } while_each_thread(g, p); ++ } while_each_thread_all(g, p); + + return chosen; + } +@@ -290,13 +297,16 @@ + set_tsk_thread_flag(p, TIF_MEMDIE); + + force_sig(SIGKILL, p); ++ ub_oom_task_killed(p); + } + + static int oom_kill_task(struct task_struct *p) + { + struct mm_struct *mm; ++ struct user_beancounter *ub; + struct task_struct *g, *q; + ++ task_lock(p); + mm = p->mm; + + /* WARNING: mm may not be dereferenced since we did not obtain its +@@ -308,16 +318,21 @@ + * However, this is of no concern to us. + */ + +- if (mm == NULL) ++ if (mm == NULL) { ++ task_unlock(p); + return 1; ++ } ++ ++ ub = get_beancounter(mm_ub(mm)); ++ task_unlock(p); + + /* + * Don't kill the process if any threads are set to OOM_DISABLE + */ +- do_each_thread(g, q) { ++ do_each_thread_all(g, q) { + if (q->mm == mm && q->oomkilladj == OOM_DISABLE) + return 1; +- } while_each_thread(g, q); ++ } while_each_thread_all(g, q); + + __oom_kill_task(p, 1); + +@@ -326,16 +341,18 @@ + * but are in a different thread group. Don't let them have access + * to memory reserves though, otherwise we might deplete all memory. + */ +- do_each_thread(g, q) { ++ do_each_thread_all(g, q) { + if (q->mm == mm && !same_thread_group(q, p)) + force_sig(SIGKILL, q); +- } while_each_thread(g, q); ++ } while_each_thread_all(g, q); + ++ ub_oom_mm_killed(ub); ++ put_beancounter(ub); + return 0; + } + +-static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, +- unsigned long points, const char *message) ++int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, ++ const char *message) + { + struct task_struct *c; + +@@ -356,8 +373,8 @@ + return 0; + } + +- printk(KERN_ERR "%s: kill process %d (%s) score %li or a child\n", +- message, task_pid_nr(p), p->comm, points); ++ printk(KERN_ERR "%s: kill process %d (%s) or a child\n", ++ message, task_pid_nr(p), p->comm); + + /* Try to kill a child first */ + list_for_each_entry(c, &p->children, sibling) { +@@ -445,9 +462,9 @@ + void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order) + { + struct task_struct *p; +- unsigned long points = 0; + unsigned long freed = 0; + enum oom_constraint constraint; ++ struct user_beancounter *ub; + + blocking_notifier_call_chain(&oom_notify_list, 0, &freed); + if (freed > 0) +@@ -457,16 +474,34 @@ + if (sysctl_panic_on_oom == 2) + panic("out of memory. Compulsory panic_on_oom is selected.\n"); + ++ if (virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_OUTOFMEM, NULL) ++ & (NOTIFY_OK | NOTIFY_FAIL)) ++ return; ++ ++ ub = NULL; ++ if (ub_oom_lock()) ++ goto out_oom_lock; ++ ++ read_lock(&tasklist_lock); ++ ++ if (printk_ratelimit()) { ++ printk(KERN_WARNING "%s invoked oom-killer: " ++ "gfp_mask=0x%x, order=%d, oomkilladj=%d\n", ++ current->comm, gfp_mask, order, current->oomkilladj); ++ dump_stack(); ++ show_mem(); ++ show_slab_info(); ++ } ++ + /* + * Check if there were limitations on the allocation (only relevant for + * NUMA) that may require different handling. + */ + constraint = constrained_alloc(zonelist, gfp_mask); +- read_lock(&tasklist_lock); + + switch (constraint) { + case CONSTRAINT_MEMORY_POLICY: +- oom_kill_process(current, gfp_mask, order, points, ++ oom_kill_process(current, gfp_mask, order, + "No available memory (MPOL_BIND)"); + break; + +@@ -476,27 +511,33 @@ + /* Fall-through */ + case CONSTRAINT_CPUSET: + if (sysctl_oom_kill_allocating_task) { +- oom_kill_process(current, gfp_mask, order, points, ++ oom_kill_process(current, gfp_mask, order, + "Out of memory (oom_kill_allocating_task)"); + break; + } + retry: ++ put_beancounter(ub); ++ + /* + * Rambo mode: Shoot down a process and hope it solves whatever + * issues we may have. + */ +- p = select_bad_process(&points); ++ ub = ub_oom_select_worst(); ++ p = oom_select_bad_process(ub); + + if (PTR_ERR(p) == -1UL) + goto out; + + /* Found nothing?!?! Either we hang forever, or we panic. */ + if (!p) { ++ if (ub != NULL) ++ goto retry; + read_unlock(&tasklist_lock); ++ ub_oom_unlock(); + panic("Out of memory and no killable processes...\n"); + } + +- if (oom_kill_process(p, gfp_mask, order, points, ++ if (oom_kill_process(p, gfp_mask, order, + "Out of memory")) + goto retry; + +@@ -505,7 +546,10 @@ + + out: + read_unlock(&tasklist_lock); ++ ub_oom_unlock(); ++ put_beancounter(ub); + ++out_oom_lock: + /* + * Give "p" a good chance of killing itself before we + * retry to allocate memory unless "p" is current +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/page-writeback.c debian/binary-custom.d/openvz/src/mm/page-writeback.c +--- ./mm/page-writeback.c 2012-06-12 16:25:24.302312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/page-writeback.c 2012-11-13 15:20:15.484569063 +0000 +@@ -35,6 +35,9 @@ + #include + #include + ++#include ++#include ++ + /* + * The maximum number of pages to writeout in a single bdflush/kupdate + * operation. We do this so we don't hold I_SYNC against an inode for +@@ -822,6 +825,7 @@ + scanned = 1; + for (i = 0; i < nr_pages; i++) { + struct page *page = pvec.pages[i]; ++ struct user_beancounter *old_ub; + + /* + * At this point we hold neither mapping->tree_lock nor +@@ -852,7 +856,9 @@ + continue; + } + ++ old_ub = bc_io_switch_context(page); + ret = (*writepage)(page, wbc, data); ++ bc_io_restore_context(old_ub); + + if (unlikely(ret == AOP_WRITEPAGE_ACTIVATE)) { + unlock_page(page); +@@ -948,12 +954,15 @@ + .sync_mode = WB_SYNC_ALL, + .nr_to_write = 1, + }; ++ struct user_beancounter *old_ub; + + BUG_ON(!PageLocked(page)); + + if (wait) + wait_on_page_writeback(page); + ++ old_ub = bc_io_switch_context(page); ++ + if (clear_page_dirty_for_io(page)) { + page_cache_get(page); + ret = mapping->a_ops->writepage(page, &wbc); +@@ -966,6 +975,9 @@ + } else { + unlock_page(page); + } ++ ++ bc_io_restore_context(old_ub); ++ + return ret; + } + EXPORT_SYMBOL(write_one_page); +@@ -997,6 +1009,9 @@ + */ + int __set_page_dirty_nobuffers(struct page *page) + { ++ int acct; ++ ++ acct = 0; + if (!TestSetPageDirty(page)) { + struct address_space *mapping = page_mapping(page); + struct address_space *mapping2; +@@ -1004,6 +1019,7 @@ + if (!mapping) + return 1; + ++ acct = 0; + write_lock_irq(&mapping->tree_lock); + mapping2 = page_mapping(page); + if (mapping2) { /* Race with truncate? */ +@@ -1013,12 +1029,14 @@ + __inc_zone_page_state(page, NR_FILE_DIRTY); + __inc_bdi_stat(mapping->backing_dev_info, + BDI_RECLAIMABLE); +- task_io_account_write(PAGE_CACHE_SIZE); ++ acct = 1; + } + radix_tree_tag_set(&mapping->page_tree, + page_index(page), PAGECACHE_TAG_DIRTY); + } + write_unlock_irq(&mapping->tree_lock); ++ if (acct) ++ task_io_account_write(page, PAGE_CACHE_SIZE, 0); + if (mapping->host) { + /* !PageAnon && !swapper_space */ + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); +@@ -1157,6 +1175,7 @@ + dec_zone_page_state(page, NR_FILE_DIRTY); + dec_bdi_stat(mapping->backing_dev_info, + BDI_RECLAIMABLE); ++ ub_io_release_context(page, PAGE_CACHE_SIZE); + return 1; + } + return 0; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/page_alloc.c debian/binary-custom.d/openvz/src/mm/page_alloc.c +--- ./mm/page_alloc.c 2012-06-12 16:25:24.306312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/page_alloc.c 2012-11-13 15:20:15.484569063 +0000 +@@ -48,6 +48,9 @@ + #include + #include "internal.h" + ++#include ++#include ++ + /* + * Array of node states. + */ +@@ -99,6 +102,7 @@ + 32, + }; + ++EXPORT_SYMBOL(nr_swap_pages); + EXPORT_SYMBOL(totalram_pages); + + static char * const zone_names[MAX_NR_ZONES] = { +@@ -464,8 +468,11 @@ + 1 << PG_reserved | + 1 << PG_buddy )))) + bad_page(page); +- if (PageDirty(page)) ++ if (PageDirty(page)) { ++ ub_io_release_context(page, 0); + __ClearPageDirty(page); ++ } else ++ ub_io_release_debug(page); + /* + * For now, we report if PG_reserved was found set, but do not + * clear it, and do not free the page. But we shall soon need +@@ -528,6 +535,7 @@ + arch_free_page(page, order); + kernel_map_pages(page, 1 << order, 0); + ++ ub_page_uncharge(page, order); + local_irq_save(flags); + __count_vm_events(PGFREE, 1 << order); + free_one_page(page_zone(page), page, order); +@@ -624,7 +632,8 @@ + + page->flags &= ~(1 << PG_uptodate | 1 << PG_error | 1 << PG_readahead | + 1 << PG_referenced | 1 << PG_arch_1 | +- 1 << PG_owner_priv_1 | 1 << PG_mappedtodisk); ++ 1 << PG_owner_priv_1 | 1 << PG_mappedtodisk | ++ 1 << PG_checkpointed); + set_page_private(page, 0); + set_page_refcounted(page); + +@@ -1002,6 +1011,7 @@ + kernel_map_pages(page, 1, 0); + + pcp = &zone_pcp(zone, get_cpu())->pcp[cold]; ++ ub_page_uncharge(page, 0); + local_irq_save(flags); + __count_vm_event(PGFREE); + list_add(&page->lru, &pcp->list); +@@ -1448,6 +1458,31 @@ + return page; + } + ++extern unsigned long cycles_per_jiffy; ++static void __alloc_collect_stats(gfp_t gfp_mask, unsigned int order, ++ struct page *page, cycles_t time) ++{ ++#ifdef CONFIG_VE ++ int ind; ++ unsigned long flags; ++ ++ time = (jiffies - time) * cycles_per_jiffy; ++ if (!(gfp_mask & __GFP_WAIT)) ++ ind = 0; ++ else if (!(gfp_mask & __GFP_HIGHMEM)) ++ ind = (order > 0 ? 2 : 1); ++ else ++ ind = (order > 0 ? 4 : 3); ++ spin_lock_irqsave(&kstat_glb_lock, flags); ++ KSTAT_LAT_ADD(&kstat_glob.alloc_lat[ind], time); ++ if (!page) ++ kstat_glob.alloc_fails[ind]++; ++ spin_unlock_irqrestore(&kstat_glb_lock, flags); ++#endif ++} ++ ++int alloc_fail_warn; ++ + /* + * This is the 'heart' of the zoned buddy allocator. + */ +@@ -1463,6 +1498,7 @@ + int do_retry; + int alloc_flags; + int did_some_progress; ++ cycles_t start; + + might_sleep_if(wait); + +@@ -1480,6 +1516,7 @@ + return NULL; + } + ++ start = jiffies; + page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order, + zonelist, ALLOC_WMARK_LOW|ALLOC_CPUSET); + if (page) +@@ -1622,19 +1659,32 @@ + do_retry = 1; + } + if (do_retry) { ++ if (total_swap_pages > 0 && nr_swap_pages == 0) { ++ out_of_memory(zonelist, gfp_mask, order); ++ goto restart; ++ } + congestion_wait(WRITE, HZ/50); + goto rebalance; + } + + nopage: +- if (!(gfp_mask & __GFP_NOWARN) && printk_ratelimit()) { ++ __alloc_collect_stats(gfp_mask, order, NULL, start); ++ if (alloc_fail_warn && !(gfp_mask & __GFP_NOWARN) && ++ printk_ratelimit()) { + printk(KERN_WARNING "%s: page allocation failure." + " order:%d, mode:0x%x\n", + p->comm, order, gfp_mask); + dump_stack(); + show_mem(); + } ++ return NULL; ++ + got_pg: ++ __alloc_collect_stats(gfp_mask, order, page, start); ++ if (ub_page_charge(page, order, gfp_mask)) { ++ __free_pages(page, order); ++ page = NULL; ++ } + return page; + } + +@@ -1702,6 +1752,18 @@ + + EXPORT_SYMBOL(free_pages); + ++unsigned int nr_free_lowpages (void) ++{ ++ pg_data_t *pgdat; ++ unsigned int pages = 0; ++ ++ for_each_online_pgdat(pgdat) ++ pages += zone_page_state(&pgdat->node_zones[ZONE_NORMAL], NR_FREE_PAGES); ++ ++ return pages; ++} ++EXPORT_SYMBOL(nr_free_lowpages); ++ + static unsigned int nr_free_zone_pages(int offset) + { + /* Just pick one node, since fallback list is circular */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/rmap.c debian/binary-custom.d/openvz/src/mm/rmap.c +--- ./mm/rmap.c 2012-06-12 16:25:24.306312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/rmap.c 2012-11-13 15:20:15.488569061 +0000 +@@ -50,6 +50,9 @@ + #include + #include + ++#include ++#include ++ + #include + + struct kmem_cache *anon_vma_cachep; +@@ -93,6 +96,7 @@ + } + return 0; + } ++EXPORT_SYMBOL_GPL(anon_vma_prepare); + + void __anon_vma_merge(struct vm_area_struct *vma, struct vm_area_struct *next) + { +@@ -118,6 +122,7 @@ + spin_unlock(&anon_vma->lock); + } + } ++EXPORT_SYMBOL_GPL(anon_vma_link); + + void anon_vma_unlink(struct vm_area_struct *vma) + { +@@ -149,14 +154,14 @@ + void __init anon_vma_init(void) + { + anon_vma_cachep = kmem_cache_create("anon_vma", sizeof(struct anon_vma), +- 0, SLAB_DESTROY_BY_RCU|SLAB_PANIC, anon_vma_ctor); ++ 0, SLAB_DESTROY_BY_RCU|SLAB_PANIC|SLAB_UBC, anon_vma_ctor); + } + + /* + * Getting a lock on a stable anon_vma from a page off the LRU is + * tricky: page_lock_anon_vma rely on RCU to guard against the races. + */ +-static struct anon_vma *page_lock_anon_vma(struct page *page) ++struct anon_vma *page_lock_anon_vma(struct page *page) + { + struct anon_vma *anon_vma; + unsigned long anon_mapping; +@@ -175,12 +180,14 @@ + rcu_read_unlock(); + return NULL; + } ++EXPORT_SYMBOL_GPL(page_lock_anon_vma); + +-static void page_unlock_anon_vma(struct anon_vma *anon_vma) ++void page_unlock_anon_vma(struct anon_vma *anon_vma) + { + spin_unlock(&anon_vma->lock); + rcu_read_unlock(); + } ++EXPORT_SYMBOL_GPL(page_unlock_anon_vma); + + /* + * At what user virtual address is page expected in @vma? +@@ -644,6 +651,13 @@ + page_clear_dirty(page); + set_page_dirty(page); + } ++ ++ /* ++ * Well, when a page is unmapped, we cannot keep PG_checkpointed ++ * flag, it is not accessible via process VM and we have no way ++ * to reset its state ++ */ ++ ClearPageCheckpointed(page); + __dec_zone_page_state(page, + PageAnon(page) ? NR_ANON_PAGES : NR_FILE_MAPPED); + } +@@ -735,6 +749,9 @@ + + + page_remove_rmap(page, vma); ++ ub_unused_privvm_inc(mm, vma); ++ ub_percpu_inc(mm->mm_ub, unmap); ++ pb_remove_ref(page, mm); + page_cache_release(page); + + out_unmap: +@@ -825,6 +842,9 @@ + set_page_dirty(page); + + page_remove_rmap(page, vma); ++ ub_percpu_inc(mm->mm_ub, unmap); ++ pb_remove_ref(page, mm); ++ ub_unused_privvm_inc(mm, vma); + page_cache_release(page); + dec_mm_counter(mm, file_rss); + (*mapcount)--; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/shmem.c debian/binary-custom.d/openvz/src/mm/shmem.c +--- ./mm/shmem.c 2012-06-12 16:25:24.306312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/shmem.c 2012-11-13 15:20:15.488569061 +0000 +@@ -54,6 +54,8 @@ + #include + #include + ++#include ++ + /* This magic number is used in glibc for posix shared memory */ + #define TMPFS_MAGIC 0x01021994 + +@@ -181,7 +183,7 @@ + + static const struct super_operations shmem_ops; + static const struct address_space_operations shmem_aops; +-static const struct file_operations shmem_file_operations; ++const struct file_operations shmem_file_operations; + static const struct inode_operations shmem_inode_operations; + static const struct inode_operations shmem_dir_inode_operations; + static const struct inode_operations shmem_special_inode_operations; +@@ -220,7 +222,7 @@ + * + * It has to be called with the spinlock held. + */ +-static void shmem_recalc_inode(struct inode *inode) ++static void shmem_recalc_inode(struct inode *inode, long swp_freed) + { + struct shmem_inode_info *info = SHMEM_I(inode); + long freed; +@@ -230,6 +232,8 @@ + info->alloced -= freed; + shmem_unacct_blocks(info->flags, freed); + shmem_free_blocks(inode, freed); ++ if (freed > swp_freed) ++ ub_tmpfs_respages_sub(info, freed - swp_freed); + } + } + +@@ -335,6 +339,11 @@ + struct page *page = kmap_atomic_to_page(entry); + set_page_private(page, page_private(page) + incdec); + } ++ ++ if (incdec == 1) ++ ub_tmpfs_respages_dec(info); ++ else ++ ub_tmpfs_respages_inc(info); + } + + /* +@@ -351,14 +360,24 @@ + struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); + struct page *page = NULL; + swp_entry_t *entry; ++ unsigned long ub_val; + + if (sgp != SGP_WRITE && + ((loff_t) index << PAGE_CACHE_SHIFT) >= i_size_read(inode)) + return ERR_PTR(-EINVAL); + ++ ub_val = 0; ++ if (info->next_index <= index) { ++ ub_val = index + 1 - info->next_index; ++ if (ub_shmpages_charge(info, ub_val)) ++ return ERR_PTR(-ENOSPC); ++ } ++ + while (!(entry = shmem_swp_entry(info, index, &page))) { +- if (sgp == SGP_READ) +- return shmem_swp_map(ZERO_PAGE(0)); ++ if (sgp == SGP_READ) { ++ entry = shmem_swp_map(ZERO_PAGE(0)); ++ goto out; ++ } + /* + * Test free_blocks against 1 not 0, since we have 1 data + * page (and perhaps indirect index pages) yet to allocate: +@@ -368,7 +387,8 @@ + spin_lock(&sbinfo->stat_lock); + if (sbinfo->free_blocks <= 1) { + spin_unlock(&sbinfo->stat_lock); +- return ERR_PTR(-ENOSPC); ++ entry = ERR_PTR(-ENOSPC); ++ goto out; + } + sbinfo->free_blocks--; + inode->i_blocks += BLOCKS_PER_PAGE; +@@ -376,31 +396,43 @@ + } + + spin_unlock(&info->lock); +- page = shmem_dir_alloc(mapping_gfp_mask(inode->i_mapping)); ++ page = shmem_dir_alloc(mapping_gfp_mask(inode->i_mapping) | ++ __GFP_UBC); + if (page) + set_page_private(page, 0); + spin_lock(&info->lock); + + if (!page) { +- shmem_free_blocks(inode, 1); +- return ERR_PTR(-ENOMEM); ++ entry = ERR_PTR(-ENOMEM); ++ goto out_block; + } + if (sgp != SGP_WRITE && + ((loff_t) index << PAGE_CACHE_SHIFT) >= i_size_read(inode)) { + entry = ERR_PTR(-EINVAL); +- break; ++ goto out_dir; + } +- if (info->next_index <= index) ++ if (info->next_index <= index) { ++ ub_val = 0; + info->next_index = index + 1; ++ } + } + if (page) { + /* another task gave its page, or truncated the file */ + shmem_free_blocks(inode, 1); + shmem_dir_free(page); + } +- if (info->next_index <= index && !IS_ERR(entry)) ++ if (info->next_index <= index) + info->next_index = index + 1; + return entry; ++ ++out_dir: ++ shmem_dir_free(page); ++out_block: ++ shmem_free_blocks(inode, 1); ++out: ++ if (ub_val) ++ ub_shmpages_uncharge(info, ub_val); ++ return entry; + } + + /* +@@ -509,6 +541,7 @@ + return; + + spin_lock(&info->lock); ++ ub_shmpages_uncharge(info, info->next_index - idx); + info->flags |= SHMEM_TRUNCATE; + if (likely(end == (loff_t) -1)) { + limit = info->next_index; +@@ -695,7 +728,7 @@ + info->swapped -= nr_swaps_freed; + if (nr_pages_to_free) + shmem_free_blocks(inode, nr_pages_to_free); +- shmem_recalc_inode(inode); ++ shmem_recalc_inode(inode, nr_swaps_freed); + spin_unlock(&info->lock); + + /* +@@ -782,6 +815,7 @@ + sbinfo->free_inodes++; + spin_unlock(&sbinfo->stat_lock); + } ++ shmi_ub_put(info); + clear_inode(inode); + } + +@@ -903,6 +937,12 @@ + return found; + } + ++#ifdef CONFIG_BEANCOUNTERS ++#define shm_get_swap_page(info) (get_swap_page((info)->shmi_ub)) ++#else ++#define shm_get_swap_page(info) (get_swap_page(NULL)) ++#endif ++ + /* + * Move the page from the page cache to the swap cache. + */ +@@ -938,12 +978,12 @@ + info = SHMEM_I(inode); + if (info->flags & VM_LOCKED) + goto redirty; +- swap = get_swap_page(); ++ swap = shm_get_swap_page(info); + if (!swap.val) + goto redirty; + + spin_lock(&info->lock); +- shmem_recalc_inode(inode); ++ shmem_recalc_inode(inode, 0); + if (index >= info->next_index) { + BUG_ON(!(info->flags & SHMEM_TRUNCATE)); + goto unlock; +@@ -1140,7 +1180,7 @@ + goto failed; + + spin_lock(&info->lock); +- shmem_recalc_inode(inode); ++ shmem_recalc_inode(inode, 0); + entry = shmem_swp_alloc(info, idx, sgp); + if (IS_ERR(entry)) { + spin_unlock(&info->lock); +@@ -1309,6 +1349,7 @@ + clear_highpage(filepage); + flush_dcache_page(filepage); + SetPageUptodate(filepage); ++ ub_tmpfs_respages_inc(info); + } + done: + if (*pagep != filepage) { +@@ -1420,6 +1461,7 @@ + inode->i_generation = get_seconds(); + info = SHMEM_I(inode); + memset(info, 0, (char *)inode - (char *)info); ++ shmi_ub_set(info, get_exec_ub()); + spin_lock_init(&info->lock); + INIT_LIST_HEAD(&info->swaplist); + +@@ -2371,7 +2413,7 @@ + .migratepage = migrate_page, + }; + +-static const struct file_operations shmem_file_operations = { ++const struct file_operations shmem_file_operations = { + .mmap = shmem_mmap, + #ifdef CONFIG_TMPFS + .llseek = generic_file_llseek, +@@ -2382,6 +2424,7 @@ + .splice_write = generic_file_splice_write, + #endif + }; ++EXPORT_SYMBOL_GPL(shmem_file_operations); + + static const struct inode_operations shmem_inode_operations = { + .truncate = shmem_truncate, +@@ -2450,6 +2493,10 @@ + #endif + }; + ++int is_shmem_mapping(struct address_space *map) ++{ ++ return (map != NULL && map->a_ops == &shmem_aops); ++} + + static int shmem_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *data, struct vfsmount *mnt) +@@ -2457,13 +2504,19 @@ + return get_sb_nodev(fs_type, flags, data, shmem_fill_super, mnt); + } + +-static struct file_system_type tmpfs_fs_type = { ++struct file_system_type tmpfs_fs_type = { + .owner = THIS_MODULE, + .name = "tmpfs", + .get_sb = shmem_get_sb, + .kill_sb = kill_litter_super, + }; ++EXPORT_SYMBOL(tmpfs_fs_type); ++ ++#ifdef CONFIG_VE ++#define shm_mnt (get_exec_env()->shmem_mnt) ++#else + static struct vfsmount *shm_mnt; ++#endif + + static int __init init_tmpfs(void) + { +@@ -2504,6 +2557,36 @@ + } + module_init(init_tmpfs) + ++static inline int shm_charge_ahead(struct inode *inode) ++{ ++#ifdef CONFIG_BEANCOUNTERS ++ struct shmem_inode_info *info = SHMEM_I(inode); ++ unsigned long idx; ++ swp_entry_t *entry; ++ ++ if (!inode->i_size) ++ return 0; ++ idx = (inode->i_size - 1) >> PAGE_CACHE_SHIFT; ++ /* ++ * Just touch info to allocate space for entry and ++ * make all UBC checks ++ */ ++ spin_lock(&info->lock); ++ entry = shmem_swp_alloc(info, idx, SGP_CACHE); ++ if (IS_ERR(entry)) ++ goto err; ++ shmem_swp_unmap(entry); ++ spin_unlock(&info->lock); ++ return 0; ++ ++err: ++ spin_unlock(&info->lock); ++ return PTR_ERR(entry); ++#else ++ return 0; ++#endif ++} ++ + /* + * shmem_file_setup - get an unlinked file living in tmpfs + * +@@ -2551,6 +2634,9 @@ + d_instantiate(dentry, inode); + inode->i_size = size; + inode->i_nlink = 0; /* It is unlinked */ ++ error = shm_charge_ahead(inode); ++ if (error) ++ goto close_file; + init_file(file, shm_mnt, dentry, FMODE_WRITE | FMODE_READ, + &shmem_file_operations); + return file; +@@ -2563,6 +2649,7 @@ + shmem_unacct_size(flags, size); + return ERR_PTR(error); + } ++EXPORT_SYMBOL_GPL(shmem_file_setup); + + /* + * shmem_zero_setup - setup a shared anonymous mapping +@@ -2580,6 +2667,8 @@ + + if (vma->vm_file) + fput(vma->vm_file); ++ else if (vma->vm_flags & VM_WRITE) ++ __ub_unused_privvm_dec(vma->vm_mm, size >> PAGE_SHIFT); + vma->vm_file = file; + vma->vm_ops = &shmem_vm_ops; + return 0; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/slab.c debian/binary-custom.d/openvz/src/mm/slab.c +--- ./mm/slab.c 2012-06-12 16:25:24.310312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/slab.c 2012-11-13 15:20:15.488569061 +0000 +@@ -110,30 +110,14 @@ + #include + #include + #include ++#include ++#include + + #include + #include + #include + +-/* +- * DEBUG - 1 for kmem_cache_create() to honour; SLAB_RED_ZONE & SLAB_POISON. +- * 0 for faster, smaller code (especially in the critical paths). +- * +- * STATS - 1 to collect stats for /proc/slabinfo. +- * 0 for faster, smaller code (especially in the critical paths). +- * +- * FORCED_DEBUG - 1 enables SLAB_RED_ZONE and SLAB_POISON (if possible) +- */ +- +-#ifdef CONFIG_DEBUG_SLAB +-#define DEBUG 1 +-#define STATS 1 +-#define FORCED_DEBUG 1 +-#else +-#define DEBUG 0 +-#define STATS 0 +-#define FORCED_DEBUG 0 +-#endif ++#include + + /* Shouldn't this be in a header file somewhere? */ + #define BYTES_PER_WORD sizeof(void *) +@@ -172,18 +156,20 @@ + #endif + + /* Legal flag mask for kmem_cache_create(). */ +-#if DEBUG ++#if SLAB_DEBUG + # define CREATE_MASK (SLAB_RED_ZONE | \ + SLAB_POISON | SLAB_HWCACHE_ALIGN | \ + SLAB_CACHE_DMA | \ + SLAB_STORE_USER | \ + SLAB_RECLAIM_ACCOUNT | SLAB_PANIC | \ +- SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD) ++ SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD | \ ++ SLAB_UBC | SLAB_NO_CHARGE) + #else + # define CREATE_MASK (SLAB_HWCACHE_ALIGN | \ + SLAB_CACHE_DMA | \ + SLAB_RECLAIM_ACCOUNT | SLAB_PANIC | \ +- SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD) ++ SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD | \ ++ SLAB_UBC | SLAB_NO_CHARGE) + #endif + + /* +@@ -372,87 +358,6 @@ + MAKE_LIST((cachep), (&(ptr)->slabs_free), slabs_free, nodeid); \ + } while (0) + +-/* +- * struct kmem_cache +- * +- * manages a cache. +- */ +- +-struct kmem_cache { +-/* 1) per-cpu data, touched during every alloc/free */ +- struct array_cache *array[NR_CPUS]; +-/* 2) Cache tunables. Protected by cache_chain_mutex */ +- unsigned int batchcount; +- unsigned int limit; +- unsigned int shared; +- +- unsigned int buffer_size; +- u32 reciprocal_buffer_size; +-/* 3) touched by every alloc & free from the backend */ +- +- unsigned int flags; /* constant flags */ +- unsigned int num; /* # of objs per slab */ +- +-/* 4) cache_grow/shrink */ +- /* order of pgs per slab (2^n) */ +- unsigned int gfporder; +- +- /* force GFP flags, e.g. GFP_DMA */ +- gfp_t gfpflags; +- +- size_t colour; /* cache colouring range */ +- unsigned int colour_off; /* colour offset */ +- struct kmem_cache *slabp_cache; +- unsigned int slab_size; +- unsigned int dflags; /* dynamic flags */ +- +- /* constructor func */ +- void (*ctor)(struct kmem_cache *, void *); +- +-/* 5) cache creation/removal */ +- const char *name; +- struct list_head next; +- +-/* 6) statistics */ +-#if STATS +- unsigned long num_active; +- unsigned long num_allocations; +- unsigned long high_mark; +- unsigned long grown; +- unsigned long reaped; +- unsigned long errors; +- unsigned long max_freeable; +- unsigned long node_allocs; +- unsigned long node_frees; +- unsigned long node_overflow; +- atomic_t allochit; +- atomic_t allocmiss; +- atomic_t freehit; +- atomic_t freemiss; +-#endif +-#if DEBUG +- /* +- * If debugging is enabled, then the allocator can add additional +- * fields and/or padding to every object. buffer_size contains the total +- * object size including these internal fields, the following two +- * variables contain the offset to the user object and its size. +- */ +- int obj_offset; +- int obj_size; +-#endif +- /* +- * We put nodelists[] at the end of kmem_cache, because we want to size +- * this array to nr_node_ids slots instead of MAX_NUMNODES +- * (see kmem_cache_init()) +- * We still use [MAX_NUMNODES] and not [1] or [0] because cache_cache +- * is statically defined, so we reserve the max number of nodes. +- */ +- struct kmem_list3 *nodelists[MAX_NUMNODES]; +- /* +- * Do not add fields after nodelists[] +- */ +-}; +- + #define CFLGS_OFF_SLAB (0x80000000UL) + #define OFF_SLAB(x) ((x)->flags & CFLGS_OFF_SLAB) + +@@ -467,12 +372,14 @@ + #define REAPTIMEOUT_CPUC (2*HZ) + #define REAPTIMEOUT_LIST3 (4*HZ) + +-#if STATS ++#define STATS_INC_GROWN(x) ((x)->grown++) ++#define STATS_ADD_REAPED(x,y) ((x)->reaped += (y)) ++#define STATS_INC_SHRUNK(x) ((x)->shrunk++) ++ ++#if SLAB_STATS + #define STATS_INC_ACTIVE(x) ((x)->num_active++) + #define STATS_DEC_ACTIVE(x) ((x)->num_active--) + #define STATS_INC_ALLOCED(x) ((x)->num_allocations++) +-#define STATS_INC_GROWN(x) ((x)->grown++) +-#define STATS_ADD_REAPED(x,y) ((x)->reaped += (y)) + #define STATS_SET_HIGH(x) \ + do { \ + if ((x)->num_active > (x)->high_mark) \ +@@ -495,8 +402,6 @@ + #define STATS_INC_ACTIVE(x) do { } while (0) + #define STATS_DEC_ACTIVE(x) do { } while (0) + #define STATS_INC_ALLOCED(x) do { } while (0) +-#define STATS_INC_GROWN(x) do { } while (0) +-#define STATS_ADD_REAPED(x,y) do { } while (0) + #define STATS_SET_HIGH(x) do { } while (0) + #define STATS_INC_ERR(x) do { } while (0) + #define STATS_INC_NODEALLOCS(x) do { } while (0) +@@ -509,7 +414,7 @@ + #define STATS_INC_FREEMISS(x) do { } while (0) + #endif + +-#if DEBUG ++#if SLAB_DEBUG + + /* + * memory layout of objects: +@@ -641,6 +546,8 @@ + #define CACHE(x) { .cs_size = (x) }, + #include + CACHE(ULONG_MAX) ++#include ++ CACHE(ULONG_MAX) + #undef CACHE + }; + EXPORT_SYMBOL(malloc_sizes); +@@ -654,10 +561,17 @@ + static struct cache_names __initdata cache_names[] = { + #define CACHE(x) { .name = "size-" #x, .name_dma = "size-" #x "(DMA)" }, + #include ++ {NULL,}, ++#undef CACHE ++#define CACHE(x) { .name = "size-" #x "(UBC)", .name_dma = "size-" #x "(DMA,UBC)" }, ++#include + {NULL,} + #undef CACHE + }; + ++int malloc_cache_num; ++EXPORT_SYMBOL(malloc_cache_num); ++ + static struct arraycache_init initarray_cache __initdata = + { {0, BOOT_CPUCACHE_ENTRIES, 1, 0} }; + static struct arraycache_init initarray_generic = +@@ -735,6 +649,7 @@ + */ + static DEFINE_MUTEX(cache_chain_mutex); + static struct list_head cache_chain; ++static spinlock_t cache_chain_lock; + + /* + * chicken and egg problem: delay the per-cpu array allocation +@@ -767,7 +682,9 @@ + { + struct cache_sizes *csizep = malloc_sizes; + +-#if DEBUG ++ if (gfpflags & __GFP_UBC) ++ csizep += malloc_cache_num; ++#if SLAB_DEBUG + /* This happens if someone tries to call + * kmem_cache_create(), or __kmalloc(), before + * the generic caches are initialized. +@@ -797,9 +714,98 @@ + return __find_general_cachep(size, gfpflags); + } + +-static size_t slab_mgmt_size(size_t nr_objs, size_t align) ++static inline kmem_bufctl_t *slab_bufctl(struct slab *slabp) + { +- return ALIGN(sizeof(struct slab)+nr_objs*sizeof(kmem_bufctl_t), align); ++ return (kmem_bufctl_t *) (slabp + 1); ++} ++ ++#ifdef CONFIG_BEANCOUNTERS ++#define init_slab_ubps(cachep, slabp) do { \ ++ if (!((cachep)->flags & SLAB_UBC)) \ ++ break; \ ++ memset(slab_ubcs(cachep, slabp), 0, \ ++ (cachep)->num * sizeof(void *)); \ ++ } while (0) ++ ++#define UB_ALIGN(flags) (flags & SLAB_UBC ? sizeof(void *) : 1) ++#define UB_EXTRA(flags) (flags & SLAB_UBC ? sizeof(void *) : 0) ++#define set_cache_objuse(cachep) do { \ ++ (cachep)->objuse = ((PAGE_SIZE << (cachep)->gfporder) + \ ++ (cachep)->num - 1) / (cachep)->num; \ ++ if (!OFF_SLAB(cachep)) \ ++ break; \ ++ (cachep)->objuse += ((cachep)->slabp_cache->objuse + \ ++ (cachep)->num - 1) / (cachep)->num; \ ++ } while (0) ++ ++void kmem_mark_nocharge(struct kmem_cache *cachep) ++{ ++ cachep->flags |= SLAB_NO_CHARGE; ++} ++ ++int kmem_cache_objuse(struct kmem_cache *cachep) ++{ ++ return cachep->objuse; ++} ++ ++EXPORT_SYMBOL(kmem_cache_objuse); ++ ++int kmem_obj_objuse(void *obj) ++{ ++ return virt_to_cache(obj)->objuse; ++} ++ ++int kmem_dname_objuse(void *obj) ++{ ++ return virt_to_cache(obj)->objuse; ++} ++ ++unsigned long ub_cache_growth(struct kmem_cache *cachep) ++{ ++ return (cachep->grown - cachep->reaped - cachep->shrunk) ++ << cachep->gfporder; ++} ++ ++#define slab_ubcs(cachep, slabp) ((struct user_beancounter **)\ ++ (ALIGN((unsigned long)(slab_bufctl(slabp) + (cachep)->num),\ ++ sizeof(void *)))) ++ ++struct user_beancounter **ub_slab_ptr(struct kmem_cache *cachep, void *obj) ++{ ++ struct slab *slabp; ++ int objnr; ++ ++ BUG_ON(!(cachep->flags & SLAB_UBC)); ++ slabp = virt_to_slab(obj); ++ objnr = (obj - slabp->s_mem) / cachep->buffer_size; ++ return slab_ubcs(cachep, slabp) + objnr; ++} ++ ++struct user_beancounter *slab_ub(void *obj) ++{ ++ return *ub_slab_ptr(virt_to_cache(obj), obj); ++} ++ ++EXPORT_SYMBOL(slab_ub); ++ ++#else ++#define UB_ALIGN(flags) 1 ++#define UB_EXTRA(flags) 0 ++#define set_cache_objuse(c) do { } while (0) ++#define init_slab_ubps(c, s) do { } while (0) ++#endif ++ ++static size_t slab_mgmt_size_noalign(size_t nr_objs, int flags) ++{ ++ size_t size_noub; ++ ++ size_noub = sizeof(struct slab) + nr_objs * sizeof(kmem_bufctl_t); ++ return ALIGN(size_noub, UB_ALIGN(flags)) + nr_objs * UB_EXTRA(flags); ++} ++ ++static size_t slab_mgmt_size(size_t nr_objs, size_t align, int flags) ++{ ++ return ALIGN(slab_mgmt_size_noalign(nr_objs, flags), align); + } + + /* +@@ -844,20 +850,23 @@ + * into account. + */ + nr_objs = (slab_size - sizeof(struct slab)) / +- (buffer_size + sizeof(kmem_bufctl_t)); ++ (buffer_size + sizeof(kmem_bufctl_t) + ++ UB_EXTRA(flags)); + + /* + * This calculated number will be either the right + * amount, or one greater than what we want. + */ +- if (slab_mgmt_size(nr_objs, align) + nr_objs*buffer_size +- > slab_size) ++ if (slab_mgmt_size(nr_objs, align, flags) + ++ nr_objs * buffer_size > slab_size) + nr_objs--; ++ BUG_ON(slab_mgmt_size(nr_objs, align, flags) + ++ nr_objs * buffer_size > slab_size); + + if (nr_objs > SLAB_LIMIT) + nr_objs = SLAB_LIMIT; + +- mgmt_size = slab_mgmt_size(nr_objs, align); ++ mgmt_size = slab_mgmt_size(nr_objs, align, flags); + } + *num = nr_objs; + *left_over = slab_size - nr_objs*buffer_size - mgmt_size; +@@ -1408,6 +1417,7 @@ + cachep->nodelists[nodeid] = ptr; + local_irq_enable(); + } ++static int offslab_limit; + + /* + * For setting up all the kmem_list3s for cache whose buffer_size is same as +@@ -1481,6 +1491,7 @@ + + /* 1) create the cache_cache */ + INIT_LIST_HEAD(&cache_chain); ++ spin_lock_init(&cache_chain_lock); + list_add(&cache_cache.next, &cache_chain); + cache_cache.colour_off = cache_line_size(); + cache_cache.array[smp_processor_id()] = &initarray_cache.cache; +@@ -1492,7 +1503,7 @@ + */ + cache_cache.buffer_size = offsetof(struct kmem_cache, nodelists) + + nr_node_ids * sizeof(struct kmem_list3 *); +-#if DEBUG ++#if SLAB_DEBUG + cache_cache.obj_size = cache_cache.buffer_size; + #endif + cache_cache.buffer_size = ALIGN(cache_cache.buffer_size, +@@ -1539,6 +1550,7 @@ + + slab_early_init = 0; + ++ for (i = 0; i < 2; i++) { + while (sizes->cs_size != ULONG_MAX) { + /* + * For performance, all the general caches are L1 aligned. +@@ -1551,21 +1563,30 @@ + sizes->cs_cachep = kmem_cache_create(names->name, + sizes->cs_size, + ARCH_KMALLOC_MINALIGN, +- ARCH_KMALLOC_FLAGS|SLAB_PANIC, ++ ARCH_KMALLOC_FLAGS|SLAB_PANIC| ++ (i ? SLAB_UBC : 0)|SLAB_NO_CHARGE, + NULL); + } ++ if (!(OFF_SLAB(sizes->cs_cachep))) ++ offslab_limit = sizes->cs_size; + #ifdef CONFIG_ZONE_DMA +- sizes->cs_dmacachep = kmem_cache_create( +- names->name_dma, ++ sizes->cs_dmacachep = kmem_cache_create(names->name_dma, + sizes->cs_size, + ARCH_KMALLOC_MINALIGN, + ARCH_KMALLOC_FLAGS|SLAB_CACHE_DMA| ++ (i ? SLAB_UBC : 0) | SLAB_NO_CHARGE| + SLAB_PANIC, + NULL); + #endif + sizes++; + names++; + } ++ ++ sizes++; ++ names++; ++ if (!i) ++ malloc_cache_num = sizes - malloc_sizes; ++ } + /* 4) Replace the bootstrap head arrays */ + { + struct array_cache *ptr; +@@ -1735,7 +1756,7 @@ + kmem_cache_free(cachep->slabp_cache, slab_rcu); + } + +-#if DEBUG ++#if SLAB_DEBUG + + #ifdef CONFIG_DEBUG_PAGEALLOC + static void store_stackinfo(struct kmem_cache *cachep, unsigned long *addr, +@@ -1812,7 +1833,7 @@ + } + #endif + +-#if DEBUG ++#if SLAB_DEBUG + + static void print_objinfo(struct kmem_cache *cachep, void *objp, int lines) + { +@@ -1905,7 +1926,7 @@ + } + #endif + +-#if DEBUG ++#if SLAB_DEBUG + /** + * slab_destroy_objs - destroy a slab and its objects + * @cachep: cache pointer being destroyed +@@ -2013,7 +2034,6 @@ + static size_t calculate_slab_order(struct kmem_cache *cachep, + size_t size, size_t align, unsigned long flags) + { +- unsigned long offslab_limit; + size_t left_over = 0; + int gfporder; + +@@ -2026,15 +2046,10 @@ + continue; + + if (flags & CFLGS_OFF_SLAB) { +- /* +- * Max number of objs-per-slab for caches which +- * use off-slab slabs. Needed to avoid a possible +- * looping condition in cache_grow(). +- */ +- offslab_limit = size - sizeof(struct slab); +- offslab_limit /= sizeof(kmem_bufctl_t); ++ int slab_size; + +- if (num > offslab_limit) ++ slab_size = slab_mgmt_size_noalign(num, flags); ++ if (slab_size > offslab_limit) + break; + } + +@@ -2197,9 +2212,9 @@ + } + } + +-#if DEBUG ++#if SLAB_DEBUG + WARN_ON(strchr(name, ' ')); /* It confuses parsers */ +-#if FORCED_DEBUG ++#if SLAB_FORCED_DEBUG + /* + * Enable redzoning and last user accounting, except for caches with + * large objects, if the increased size would increase the object size +@@ -2284,7 +2299,7 @@ + if (!cachep) + goto oops; + +-#if DEBUG ++#if SLAB_DEBUG + cachep->obj_size = size; + + /* +@@ -2306,7 +2321,7 @@ + else + size += BYTES_PER_WORD; + } +-#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC) ++#if SLAB_FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC) + if (size >= malloc_sizes[INDEX_L3 + 1].cs_size + && cachep->obj_size > cache_line_size() && size < PAGE_SIZE) { + cachep->obj_offset += PAGE_SIZE - size; +@@ -2338,8 +2353,7 @@ + cachep = NULL; + goto oops; + } +- slab_size = ALIGN(cachep->num * sizeof(kmem_bufctl_t) +- + sizeof(struct slab), align); ++ slab_size = slab_mgmt_size(cachep->num, align, flags); + + /* + * If the slab has been placed off-slab, and we have enough space then +@@ -2352,8 +2366,7 @@ + + if (flags & CFLGS_OFF_SLAB) { + /* really off slab. No need for manual alignment */ +- slab_size = +- cachep->num * sizeof(kmem_bufctl_t) + sizeof(struct slab); ++ slab_size = slab_mgmt_size_noalign(cachep->num, flags); + } + + cachep->colour_off = cache_line_size(); +@@ -2390,7 +2403,10 @@ + } + + /* cache setup completed, link it into the list */ ++ spin_lock(&cache_chain_lock); + list_add(&cachep->next, &cache_chain); ++ spin_unlock(&cache_chain_lock); ++ set_cache_objuse(cachep); + oops: + if (!cachep && (flags & SLAB_PANIC)) + panic("kmem_cache_create(): failed to create slab `%s'\n", +@@ -2400,7 +2416,7 @@ + } + EXPORT_SYMBOL(kmem_cache_create); + +-#if DEBUG ++#if SLAB_DEBUG + static void check_irq_off(void) + { + BUG_ON(!irqs_disabled()); +@@ -2496,10 +2512,11 @@ + } + + slabp = list_entry(p, struct slab, list); +-#if DEBUG ++#if SLAB_DEBUG + BUG_ON(slabp->inuse); + #endif + list_del(&slabp->list); ++ STATS_INC_SHRUNK(cache); + /* + * Safe to drop the lock. The slab is no longer linked + * to the cache. +@@ -2579,10 +2596,14 @@ + /* + * the chain is never empty, cache_cache is never destroyed + */ ++ spin_lock(&cache_chain_lock); + list_del(&cachep->next); ++ spin_unlock(&cache_chain_lock); + if (__cache_shrink(cachep)) { + slab_error(cachep, "Can't free all objects"); ++ spin_lock(&cache_chain_lock); + list_add(&cachep->next, &cache_chain); ++ spin_unlock(&cache_chain_lock); + mutex_unlock(&cache_chain_mutex); + return; + } +@@ -2590,6 +2611,8 @@ + if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU)) + synchronize_rcu(); + ++ ++ ub_kmemcache_free(cachep); + __kmem_cache_destroy(cachep); + mutex_unlock(&cache_chain_mutex); + } +@@ -2615,7 +2638,8 @@ + if (OFF_SLAB(cachep)) { + /* Slab management obj is off-slab. */ + slabp = kmem_cache_alloc_node(cachep->slabp_cache, +- local_flags & ~GFP_THISNODE, nodeid); ++ local_flags & (~(__GFP_UBC | GFP_THISNODE)), ++ nodeid); + if (!slabp) + return NULL; + } else { +@@ -2626,14 +2650,10 @@ + slabp->colouroff = colour_off; + slabp->s_mem = objp + colour_off; + slabp->nodeid = nodeid; ++ init_slab_ubps(cachep, slabp); + return slabp; + } + +-static inline kmem_bufctl_t *slab_bufctl(struct slab *slabp) +-{ +- return (kmem_bufctl_t *) (slabp + 1); +-} +- + static void cache_init_objs(struct kmem_cache *cachep, + struct slab *slabp) + { +@@ -2641,7 +2661,7 @@ + + for (i = 0; i < cachep->num; i++) { + void *objp = index_to_obj(cachep, slabp, i); +-#if DEBUG ++#if SLAB_DEBUG + /* need to poison the objs? */ + if (cachep->flags & SLAB_POISON) + poison_obj(cachep, objp, POISON_FREE); +@@ -2700,7 +2720,7 @@ + + slabp->inuse++; + next = slab_bufctl(slabp)[slabp->free]; +-#if DEBUG ++#if SLAB_DEBUG + slab_bufctl(slabp)[slabp->free] = BUFCTL_FREE; + WARN_ON(slabp->nodeid != nodeid); + #endif +@@ -2714,7 +2734,7 @@ + { + unsigned int objnr = obj_to_index(cachep, slabp, objp); + +-#if DEBUG ++#if SLAB_DEBUG + /* Verify that the slab belongs to the intended node */ + WARN_ON(slabp->nodeid != nodeid); + +@@ -2802,7 +2822,7 @@ + * 'nodeid'. + */ + if (!objp) +- objp = kmem_getpages(cachep, local_flags, nodeid); ++ objp = kmem_getpages(cachep, local_flags & ~__GFP_UBC, nodeid); + if (!objp) + goto failed; + +@@ -2836,7 +2856,7 @@ + return 0; + } + +-#if DEBUG ++#if SLAB_DEBUG + + /* + * Perform extra freeing checks: +@@ -3049,12 +3069,12 @@ + gfp_t flags) + { + might_sleep_if(flags & __GFP_WAIT); +-#if DEBUG ++#if SLAB_DEBUG + kmem_flagcheck(cachep, flags); + #endif + } + +-#if DEBUG ++#if SLAB_DEBUG + static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep, + gfp_t flags, void *objp, void *caller) + { +@@ -3466,9 +3486,14 @@ + cache_alloc_debugcheck_before(cachep, flags); + local_irq_save(save_flags); + objp = __do_cache_alloc(cachep, flags); +- local_irq_restore(save_flags); + objp = cache_alloc_debugcheck_after(cachep, flags, objp, caller); + prefetchw(objp); ++ if (objp && should_charge(cachep, flags) && ++ ub_slab_charge(cachep, objp, flags)) { ++ kmem_cache_free(cachep, objp); ++ objp = NULL; ++ } ++ local_irq_restore(save_flags); + + if (unlikely((flags & __GFP_ZERO) && objp)) + memset(objp, 0, obj_size(cachep)); +@@ -3502,6 +3527,7 @@ + /* fixup slab chains */ + if (slabp->inuse == 0) { + if (l3->free_objects > l3->free_limit) { ++ STATS_INC_SHRUNK(cachep); + l3->free_objects -= cachep->num; + /* No need to drop any previously held + * lock here, even if we have a off-slab slab +@@ -3530,7 +3556,7 @@ + int node = numa_node_id(); + + batchcount = ac->batchcount; +-#if DEBUG ++#if SLAB_DEBUG + BUG_ON(!batchcount || batchcount > ac->avail); + #endif + check_irq_off(); +@@ -3551,7 +3577,7 @@ + + free_block(cachep, ac->entry, batchcount, node); + free_done: +-#if STATS ++#if SLAB_STATS + { + int i = 0; + struct list_head *p; +@@ -3585,6 +3611,9 @@ + check_irq_off(); + objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0)); + ++ if (should_uncharge(cachep)) ++ ub_slab_uncharge(cachep, objp); ++ + /* + * Skip calling cache_free_alien() when the platform is not numa. + * This will avoid cache misses that happen while accessing slabp (which +@@ -3991,7 +4020,7 @@ + if (cachep->buffer_size <= PAGE_SIZE && num_possible_cpus() > 1) + shared = 8; + +-#if DEBUG ++#if SLAB_DEBUG + /* + * With debugging enabled, large batchcount lead to excessively long + * periods with disabled local interrupts. Limit the batchcount +@@ -4059,6 +4088,7 @@ + /* Give up. Setup the next iteration. */ + goto out; + ++ {KSTAT_PERF_ENTER(cache_reap) + list_for_each_entry(searchp, &cache_chain, next) { + check_irq_on(); + +@@ -4099,6 +4129,7 @@ + check_irq_on(); + mutex_unlock(&cache_chain_mutex); + next_reap_node(); ++ KSTAT_PERF_LEAVE(cache_reap)} + out: + /* Set up the next iteration */ + schedule_delayed_work(work, round_jiffies_relative(REAPTIMEOUT_CPUC)); +@@ -4112,7 +4143,7 @@ + * Output format version, so at least we can change it + * without _too_ many complaints. + */ +-#if STATS ++#if SLAB_STATS + seq_puts(m, "slabinfo - version: 2.1 (statistics)\n"); + #else + seq_puts(m, "slabinfo - version: 2.1\n"); +@@ -4121,14 +4152,82 @@ + " "); + seq_puts(m, " : tunables "); + seq_puts(m, " : slabdata "); +-#if STATS ++#if SLAB_STATS + seq_puts(m, " : globalstat " +- " "); ++ " "); + seq_puts(m, " : cpustat "); + #endif + seq_putc(m, '\n'); + } + ++#define SHOW_TOP_SLABS 10 ++ ++static unsigned long get_cache_size(struct kmem_cache *cachep) ++{ ++ unsigned long flags; ++ unsigned long slabs; ++ struct kmem_list3 *l3; ++ struct list_head *lh; ++ int node; ++ ++ slabs = 0; ++ ++ for_each_online_node (node) { ++ l3 = cachep->nodelists[node]; ++ if (l3 == NULL) ++ continue; ++ ++ spin_lock_irqsave(&l3->list_lock, flags); ++ list_for_each (lh, &l3->slabs_full) ++ slabs++; ++ list_for_each (lh, &l3->slabs_partial) ++ slabs++; ++ list_for_each (lh, &l3->slabs_free) ++ slabs++; ++ spin_unlock_irqrestore(&l3->list_lock, flags); ++ } ++ ++ return slabs * (PAGE_SIZE << cachep->gfporder) + ++ (OFF_SLAB(cachep) ? ++ cachep->slabp_cache->buffer_size * slabs : 0); ++} ++ ++void show_slab_info(void) ++{ ++ int i, j; ++ unsigned long size; ++ struct kmem_cache *ptr; ++ unsigned long sizes[SHOW_TOP_SLABS]; ++ struct kmem_cache *top[SHOW_TOP_SLABS]; ++ ++ memset(top, 0, sizeof(top)); ++ memset(sizes, 0, sizeof(sizes)); ++ ++ printk("Top %d caches:\n", SHOW_TOP_SLABS); ++ ++ spin_lock(&cache_chain_lock); ++ list_for_each_entry (ptr, &cache_chain, next) { ++ size = get_cache_size(ptr); ++ ++ j = 0; ++ for (i = 1; i < SHOW_TOP_SLABS; i++) ++ if (sizes[i] < sizes[j]) ++ j = i; ++ ++ if (size > sizes[j]) { ++ sizes[j] = size; ++ top[j] = ptr; ++ } ++ } ++ ++ for (i = 0; i < SHOW_TOP_SLABS; i++) ++ if (top[i]) ++ printk("%-21s: size %10lu objsize %10u\n", ++ top[i]->name, sizes[i], ++ top[i]->buffer_size); ++ spin_unlock(&cache_chain_lock); ++} ++ + static void *s_start(struct seq_file *m, loff_t *pos) + { + loff_t n = *pos; +@@ -4207,19 +4306,20 @@ + if (error) + printk(KERN_ERR "slab: cache %s error: %s\n", name, error); + +- seq_printf(m, "%-17s %6lu %6lu %6u %4u %4d", ++ seq_printf(m, "%-21s %6lu %6lu %6u %4u %4d", + name, active_objs, num_objs, cachep->buffer_size, + cachep->num, (1 << cachep->gfporder)); + seq_printf(m, " : tunables %4u %4u %4u", + cachep->limit, cachep->batchcount, cachep->shared); + seq_printf(m, " : slabdata %6lu %6lu %6lu", + active_slabs, num_slabs, shared_avail); +-#if STATS ++#if SLAB_STATS + { /* list3 stats */ + unsigned long high = cachep->high_mark; + unsigned long allocs = cachep->num_allocations; + unsigned long grown = cachep->grown; + unsigned long reaped = cachep->reaped; ++ unsigned long shrunk = cachep->shrunk; + unsigned long errors = cachep->errors; + unsigned long max_freeable = cachep->max_freeable; + unsigned long node_allocs = cachep->node_allocs; +@@ -4227,9 +4327,10 @@ + unsigned long overflows = cachep->node_overflow; + + seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu \ +- %4lu %4lu %4lu %4lu %4lu", allocs, high, grown, ++ %4lu %4lu %4lu %4lu %4lu %4lu", ++ allocs, high, grown, + reaped, errors, max_freeable, node_allocs, +- node_frees, overflows); ++ node_frees, overflows, shrunk); + } + /* cpu stats */ + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/slub.c debian/binary-custom.d/openvz/src/mm/slub.c +--- ./mm/slub.c 2012-06-12 16:25:24.310312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/slub.c 2012-11-13 15:20:15.492569060 +0000 +@@ -23,6 +23,8 @@ + #include + #include + ++#include ++ + /* + * Lock order: + * 1. slab_lock(page) +@@ -187,9 +189,11 @@ + + /* + * Set of flags that will prevent slab merging ++ * ++ * FIXME - think over how to allow merging accountable slubs + */ + #define SLUB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \ +- SLAB_TRACE | SLAB_DESTROY_BY_RCU) ++ SLAB_TRACE | SLAB_DESTROY_BY_RCU | SLAB_UBC) + + #define SLUB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \ + SLAB_CACHE_DMA) +@@ -327,6 +331,95 @@ + return (p - addr) / s->size; + } + ++#ifdef CONFIG_BEANCOUNTERS ++static inline void inc_cache_grown(struct kmem_cache *s) ++{ ++ atomic_inc(&s->grown); ++} ++ ++static inline void dec_cache_grown(struct kmem_cache *s) ++{ ++ atomic_dec(&s->grown); ++} ++ ++unsigned long ub_cache_growth(struct kmem_cache *cachep) ++{ ++ return atomic_read(&cachep->grown) << cachep->order; ++} ++ ++static void __flush_cpu_slab(struct kmem_cache *s, int cpu); ++ ++int kmem_cache_objuse(struct kmem_cache *cachep) ++{ ++ return cachep->objuse; ++} ++ ++EXPORT_SYMBOL(kmem_cache_objuse); ++ ++int kmem_obj_objuse(void *obj) ++{ ++ return kmem_cache_objuse(virt_to_head_page(obj)->slab); ++} ++ ++EXPORT_SYMBOL(kmem_obj_objuse); ++ ++int kmem_dname_objuse(void *obj) ++{ ++ struct kmem_cache *s; ++ ++ /* ++ * Allocations larger than PAGE_SIZE/2 go directly through ++ * __get_free_pages() and aren't associated with any cache. ++ */ ++ s = virt_to_head_page(obj)->slab; ++ if (!s) ++ return PAGE_SIZE; ++ return kmem_cache_objuse(s); ++} ++ ++#define page_ubs(pg) (pg->bc.slub_ubs) ++ ++struct user_beancounter **ub_slab_ptr(struct kmem_cache *s, void *obj) ++{ ++ struct page *pg; ++ ++ BUG_ON(!(s->flags & SLAB_UBC)); ++ pg = virt_to_head_page(obj); ++ return page_ubs(pg) + slab_index(obj, s, page_address(pg)); ++} ++ ++EXPORT_SYMBOL(ub_slab_ptr); ++ ++struct user_beancounter *slab_ub(void *obj) ++{ ++ struct page *pg; ++ ++ pg = virt_to_head_page(obj); ++ BUG_ON(!(pg->slab->flags & SLAB_UBC)); ++ return page_ubs(pg)[slab_index(obj, pg->slab, page_address(pg))]; ++} ++ ++EXPORT_SYMBOL(slab_ub); ++ ++void kmem_mark_nocharge(struct kmem_cache *cachep) ++{ ++ cachep->flags |= SLAB_NO_CHARGE; ++} ++#else ++static inline void inc_cache_grown(struct kmem_cache *s) ++{ ++} ++ ++static inline void dec_cache_grown(struct kmem_cache *s) ++{ ++} ++#endif ++ ++void show_slab_info(void) ++{ ++ /* FIXME - show it */ ++} ++ + #ifdef CONFIG_SLUB_DEBUG + /* + * Debug settings: +@@ -1043,6 +1136,8 @@ + struct page * page; + int pages = 1 << s->order; + ++ flags &= ~__GFP_UBC; ++ + if (s->order) + flags |= __GFP_COMP; + +@@ -1065,9 +1160,12 @@ + NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE, + pages); + ++ inc_cache_grown(s); + return page; + } + ++static void __free_slab(struct kmem_cache *s, struct page *page); ++ + static void setup_object(struct kmem_cache *s, struct page *page, + void *object) + { +@@ -1091,6 +1189,18 @@ + if (!page) + goto out; + ++#ifdef CONFIG_BEANCOUNTERS ++ if (s->flags & SLAB_UBC) { ++ BUG_ON(page_ubs(page) != NULL); ++ page_ubs(page) = kzalloc(s->objects * sizeof(void *), ++ flags & ~__GFP_UBC); ++ if (page_ubs(page) == NULL) { ++ __free_slab(s, page); ++ page = NULL; ++ goto out; ++ } ++ } ++#endif + n = get_node(s, page_to_nid(page)); + if (n) + atomic_long_inc(&n->nr_slabs); +@@ -1138,6 +1248,13 @@ + NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE, + - pages); + ++#ifdef CONFIG_BEANCOUNTERS ++ if (page_ubs(page) != NULL) { ++ BUG_ON(!(s->flags & SLAB_UBC)); ++ kfree(page_ubs(page)); ++ page_ubs(page) = NULL; ++ } ++#endif + __free_pages(page, s->order); + } + +@@ -1160,6 +1277,8 @@ + call_rcu(head, rcu_free_slab); + } else + __free_slab(s, page); ++ ++ dec_cache_grown(s); + } + + static void discard_slab(struct kmem_cache *s, struct page *page) +@@ -1557,6 +1676,13 @@ + object = c->freelist; + c->freelist = object[c->offset]; + } ++ ++ if (object && should_charge(s, gfpflags) && ++ ub_slab_charge(s, object, gfpflags)) { ++ kmem_cache_free(s, object); ++ object = NULL; ++ } ++ + local_irq_restore(flags); + + if (unlikely((gfpflags & __GFP_ZERO) && object)) +@@ -1657,6 +1783,10 @@ + + local_irq_save(flags); + debug_check_no_locks_freed(object, s->objsize); ++ ++ if (should_uncharge(s)) ++ ub_slab_uncharge(s, x); ++ + c = get_cpu_slab(s, smp_processor_id()); + if (likely(page == c->page && c->node >= 0)) { + object[c->offset] = c->freelist; +@@ -1998,6 +2128,7 @@ + { + struct page *page; + struct kmem_cache_node *n; ++ unsigned long flags; + + BUG_ON(kmalloc_caches->size < sizeof(struct kmem_cache_node)); + +@@ -2022,7 +2153,14 @@ + #endif + init_kmem_cache_node(n); + atomic_long_inc(&n->nr_slabs); ++ /* ++ * lockdep requires consistent irq usage for each lock ++ * so even though there cannot be a race this early in ++ * the boot sequence, we still disable irqs. ++ */ ++ local_irq_save(flags); + add_partial(n, page); ++ local_irq_restore(flags); + return n; + } + +@@ -2209,6 +2347,9 @@ + #ifdef CONFIG_NUMA + s->defrag_ratio = 100; + #endif ++#ifdef CONFIG_BEANCOUNTERS ++ s->objuse = s->size + (sizeof(struct page) / s->objects); ++#endif + if (!init_kmem_cache_nodes(s, gfpflags & ~SLUB_DMA)) + goto error; + +@@ -2335,6 +2476,10 @@ + + struct kmem_cache kmalloc_caches[PAGE_SHIFT] __cacheline_aligned; + EXPORT_SYMBOL(kmalloc_caches); ++#ifdef CONFIG_BEANCOUNTERS ++struct kmem_cache ub_kmalloc_caches[KMALLOC_SHIFT_HIGH + 1] __cacheline_aligned; ++EXPORT_SYMBOL(ub_kmalloc_caches); ++#endif + + #ifdef CONFIG_ZONE_DMA + static struct kmem_cache *kmalloc_caches_dma[PAGE_SHIFT]; +@@ -2380,6 +2525,11 @@ + { + unsigned int flags = 0; + ++ if (gfp_flags & __GFP_UBC) { ++ flags = SLAB_UBC | SLAB_NO_CHARGE; ++ gfp_flags &= ~__GFP_UBC; ++ } ++ + if (gfp_flags & SLUB_DMA) + flags = SLAB_CACHE_DMA; + +@@ -2507,11 +2657,14 @@ + index = fls(size - 1); + + #ifdef CONFIG_ZONE_DMA +- if (unlikely((flags & SLUB_DMA))) ++ if (unlikely((flags & SLUB_DMA))) { ++ BUG_ON(flags & __GFP_UBC); + return dma_kmalloc_cache(index, flags); ++ } + + #endif +- return &kmalloc_caches[index]; ++ ++ return __kmalloc_cache(flags, index); + } + + void *__kmalloc(size_t size, gfp_t flags) +@@ -2816,6 +2969,11 @@ + create_kmalloc_cache(&kmalloc_caches[0], "kmem_cache_node", + sizeof(struct kmem_cache_node), GFP_KERNEL); + kmalloc_caches[0].refcount = -1; ++#ifdef CONFIG_BEANCOUNTERS ++ create_kmalloc_cache(&ub_kmalloc_caches[0], "kmem_cache_node_ubc", ++ sizeof(struct kmem_cache_node), GFP_KERNEL_UBC); ++ ub_kmalloc_caches[0].refcount = -1; ++#endif + caches++; + + hotplug_memory_notifier(slab_memory_callback, 1); +@@ -2828,17 +2986,29 @@ + if (KMALLOC_MIN_SIZE <= 64) { + create_kmalloc_cache(&kmalloc_caches[1], + "kmalloc-96", 96, GFP_KERNEL); ++#ifdef CONFIG_BEANCOUNTERS ++ create_kmalloc_cache(&ub_kmalloc_caches[1], ++ "kmalloc-96-ubc", 96, GFP_KERNEL_UBC); ++#endif + caches++; + } + if (KMALLOC_MIN_SIZE <= 128) { + create_kmalloc_cache(&kmalloc_caches[2], + "kmalloc-192", 192, GFP_KERNEL); ++#ifdef CONFIG_BEANCOUNTERS ++ create_kmalloc_cache(&ub_kmalloc_caches[2], ++ "kmalloc-192-ubc", 192, GFP_KERNEL_UBC); ++#endif + caches++; + } + + for (i = KMALLOC_SHIFT_LOW; i < PAGE_SHIFT; i++) { + create_kmalloc_cache(&kmalloc_caches[i], + "kmalloc", 1 << i, GFP_KERNEL); ++#ifdef CONFIG_BEANCOUNTERS ++ create_kmalloc_cache(&ub_kmalloc_caches[i], ++ "kmalloc-ubc", 1 << i, GFP_KERNEL_UBC); ++#endif + caches++; + } + +@@ -2863,9 +3033,14 @@ + slab_state = UP; + + /* Provide the correct kmalloc names now that the caches are up */ +- for (i = KMALLOC_SHIFT_LOW; i < PAGE_SHIFT; i++) ++ for (i = KMALLOC_SHIFT_LOW; i < PAGE_SHIFT; i++) { + kmalloc_caches[i]. name = + kasprintf(GFP_KERNEL, "kmalloc-%d", 1 << i); ++#ifdef CONFIG_BEANCOUNTERS ++ ub_kmalloc_caches[i].name = ++ kasprintf(GFP_KERNEL, "kmalloc-%d-ubc", 1 << i); ++#endif ++ } + + #ifdef CONFIG_SMP + register_cpu_notifier(&slab_notifier); +@@ -3991,6 +4166,8 @@ + *p++ = 'a'; + if (s->flags & SLAB_DEBUG_FREE) + *p++ = 'F'; ++ if (s->flags & SLAB_UBC) ++ *p++ = 'b'; + if (p != name + 1) + *p++ = '-'; + p += sprintf(p, "%07d", s->size); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/swap.c debian/binary-custom.d/openvz/src/mm/swap.c +--- ./mm/swap.c 2012-06-12 16:25:24.310312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/swap.c 2012-11-13 15:20:15.492569060 +0000 +@@ -221,6 +221,7 @@ + __pagevec_lru_add_active(pvec); + put_cpu_var(lru_add_active_pvecs); + } ++EXPORT_SYMBOL(lru_cache_add_active); + + /* + * Drain pages out of the cpu's pagevecs. +@@ -256,6 +257,8 @@ + put_cpu(); + } + ++EXPORT_SYMBOL(lru_add_drain); ++ + #ifdef CONFIG_NUMA + static void lru_add_drain_per_cpu(struct work_struct *dummy) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/swap_state.c debian/binary-custom.d/openvz/src/mm/swap_state.c +--- ./mm/swap_state.c 2012-06-12 16:25:24.310312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/swap_state.c 2012-11-13 15:20:15.492569060 +0000 +@@ -19,6 +19,9 @@ + + #include + ++#include ++#include ++ + /* + * swapper_space is a fiction, retained to simplify the path through + * vmscan's shrink_page_list, to make sync_page look nicer, and to allow +@@ -43,6 +46,7 @@ + .i_mmap_nonlinear = LIST_HEAD_INIT(swapper_space.i_mmap_nonlinear), + .backing_dev_info = &swap_backing_dev_info, + }; ++EXPORT_SYMBOL(swapper_space); + + #define INC_CACHE_INFO(x) do { swap_cache_info.x++; } while (0) + +@@ -53,14 +57,18 @@ + unsigned long find_total; + unsigned long noent_race; + unsigned long exist_race; ++ unsigned long remove_race; + } swap_cache_info; ++EXPORT_SYMBOL(swap_cache_info); + + void show_swap_cache_info(void) + { +- printk("Swap cache: add %lu, delete %lu, find %lu/%lu, race %lu+%lu\n", ++ printk("Swap cache: add %lu, delete %lu, find %lu/%lu, " ++ "race %lu+%lu+%lu\n", + swap_cache_info.add_total, swap_cache_info.del_total, + swap_cache_info.find_success, swap_cache_info.find_total, +- swap_cache_info.noent_race, swap_cache_info.exist_race); ++ swap_cache_info.noent_race, swap_cache_info.exist_race, ++ swap_cache_info.remove_race); + printk("Free swap = %lukB\n", nr_swap_pages << (PAGE_SHIFT - 10)); + printk("Total swap = %lukB\n", total_swap_pages << (PAGE_SHIFT - 10)); + } +@@ -69,8 +77,7 @@ + * __add_to_swap_cache resembles add_to_page_cache on swapper_space, + * but sets SwapCache flag and private instead of mapping and index. + */ +-static int __add_to_swap_cache(struct page *page, swp_entry_t entry, +- gfp_t gfp_mask) ++int __add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask) + { + int error; + +@@ -95,7 +102,9 @@ + return error; + } + +-static int add_to_swap_cache(struct page *page, swp_entry_t entry) ++EXPORT_SYMBOL(__add_to_swap_cache); ++ ++int add_to_swap_cache(struct page *page, swp_entry_t entry) + { + int error; + +@@ -120,6 +129,8 @@ + return 0; + } + ++EXPORT_SYMBOL(add_to_swap_cache); ++ + /* + * This must be called only on pages that have + * been verified to be in the swap cache. +@@ -154,7 +165,14 @@ + BUG_ON(!PageLocked(page)); + + for (;;) { +- entry = get_swap_page(); ++ struct user_beancounter *ub; ++ ++ ub = pb_grab_page_ub(page); ++ if (IS_ERR(ub)) ++ return 0; ++ ++ entry = get_swap_page(ub); ++ put_beancounter(ub); + if (!entry.val) + return 0; + +@@ -240,6 +258,7 @@ + delete_from_swap_cache(page); + /* shift page from clean_pages to dirty_pages list */ + ClearPageDirty(page); ++ ub_io_release_debug(page); + set_page_dirty(page); + } + return err; +@@ -255,10 +274,13 @@ + */ + static inline void free_swap_cache(struct page *page) + { +- if (PageSwapCache(page) && !TestSetPageLocked(page)) { ++ if (!PageSwapCache(page)) ++ return; ++ if (!TestSetPageLocked(page)) { + remove_exclusive_swap_page(page); + unlock_page(page); +- } ++ } else ++ INC_CACHE_INFO(remove_race); + } + + /* +@@ -368,3 +390,5 @@ + page_cache_release(new_page); + return found_page; + } ++ ++EXPORT_SYMBOL(read_swap_cache_async); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/swapfile.c debian/binary-custom.d/openvz/src/mm/swapfile.c +--- ./mm/swapfile.c 2012-06-12 16:25:24.314312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/swapfile.c 2012-11-13 15:20:15.492569060 +0000 +@@ -32,6 +32,8 @@ + #include + #include + ++#include ++ + DEFINE_SPINLOCK(swap_lock); + unsigned int nr_swapfiles; + long total_swap_pages; +@@ -43,8 +45,12 @@ + static const char Unused_offset[] = "Unused swap offset entry "; + + struct swap_list_t swap_list = {-1, -1}; ++struct swap_info_struct swap_info[MAX_SWAPFILES]; + +-static struct swap_info_struct swap_info[MAX_SWAPFILES]; ++EXPORT_SYMBOL(total_swap_pages); ++EXPORT_SYMBOL(swap_lock); ++EXPORT_SYMBOL(swap_list); ++EXPORT_SYMBOL(swap_info); + + static DEFINE_MUTEX(swapon_mutex); + +@@ -171,7 +177,7 @@ + return 0; + } + +-swp_entry_t get_swap_page(void) ++swp_entry_t get_swap_page(struct user_beancounter *ub) + { + struct swap_info_struct *si; + pgoff_t offset; +@@ -192,6 +198,8 @@ + wrapped++; + } + ++ if (si->flags & SWP_READONLY) ++ continue; + if (!si->highest_bit) + continue; + if (!(si->flags & SWP_WRITEOK)) +@@ -201,6 +209,7 @@ + offset = scan_swap_map(si); + if (offset) { + spin_unlock(&swap_lock); ++ ub_swapentry_inc(si, offset, ub); + return swp_entry(type, offset); + } + next = swap_list.next; +@@ -212,6 +221,8 @@ + return (swp_entry_t) {0}; + } + ++EXPORT_SYMBOL(get_swap_page); ++ + swp_entry_t get_swap_page_of_type(int type) + { + struct swap_info_struct *si; +@@ -219,7 +230,7 @@ + + spin_lock(&swap_lock); + si = swap_info + type; +- if (si->flags & SWP_WRITEOK) { ++ if (si->flags & SWP_WRITEOK && !(si->flags & SWP_READONLY)) { + nr_swap_pages--; + offset = scan_swap_map(si); + if (offset) { +@@ -276,6 +287,7 @@ + count--; + p->swap_map[offset] = count; + if (!count) { ++ ub_swapentry_dec(p, offset); + if (offset < p->lowest_bit) + p->lowest_bit = offset; + if (offset > p->highest_bit) +@@ -304,6 +316,8 @@ + } + } + ++EXPORT_SYMBOL(swap_free); ++ + /* + * How many references to page are currently swapped out? + */ +@@ -385,6 +399,55 @@ + return retval; + } + ++int try_to_remove_exclusive_swap_page(struct page *page) ++{ ++ int retval; ++ struct swap_info_struct * p; ++ swp_entry_t entry; ++ ++ BUG_ON(PagePrivate(page)); ++ BUG_ON(!PageLocked(page)); ++ ++ if (!PageSwapCache(page)) ++ return 0; ++ if (PageWriteback(page)) ++ return 0; ++ if (page_count(page) != 2) /* 2: us + cache */ ++ return 0; ++ ++ entry.val = page->private; ++ p = swap_info_get(entry); ++ if (!p) ++ return 0; ++ ++ if (!vm_swap_full() && ++ (p->flags & (SWP_ACTIVE|SWP_READONLY)) == SWP_ACTIVE) { ++ spin_unlock(&swap_lock); ++ return 0; ++ } ++ ++ /* Is the only swap cache user the cache itself? */ ++ retval = 0; ++ if (p->swap_map[swp_offset(entry)] == 1) { ++ /* Recheck the page count with the swapcache lock held.. */ ++ write_lock_irq(&swapper_space.tree_lock); ++ if ((page_count(page) == 2) && !PageWriteback(page)) { ++ __delete_from_swap_cache(page); ++ SetPageDirty(page); ++ retval = 1; ++ } ++ write_unlock_irq(&swapper_space.tree_lock); ++ } ++ spin_unlock(&swap_lock); ++ ++ if (retval) { ++ swap_free(entry); ++ page_cache_release(page); ++ } ++ ++ return retval; ++} ++ + /* + * Free the swap entry like above, but also try to + * free the page cache entry if it is the last user. +@@ -424,6 +487,7 @@ + page_cache_release(page); + } + } ++EXPORT_SYMBOL(free_swap_and_cache); + + #ifdef CONFIG_HIBERNATION + /* +@@ -507,11 +571,17 @@ + * force COW, vm_page_prot omits write permission from any private vma. + */ + static void unuse_pte(struct vm_area_struct *vma, pte_t *pte, +- unsigned long addr, swp_entry_t entry, struct page *page) ++ unsigned long addr, swp_entry_t entry, struct page *page, ++ struct page_beancounter **pb) + { +- inc_mm_counter(vma->vm_mm, anon_rss); ++ struct mm_struct *mm; ++ ++ mm = vma->vm_mm; ++ inc_mm_counter(mm, anon_rss); ++ ub_unused_privvm_dec(mm, vma); ++ pb_add_ref(page, mm, pb); + get_page(page); +- set_pte_at(vma->vm_mm, addr, pte, ++ set_pte_at(mm, addr, pte, + pte_mkold(mk_pte(page, vma->vm_page_prot))); + page_add_anon_rmap(page, vma, addr); + swap_free(entry); +@@ -524,7 +594,8 @@ + + static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd, + unsigned long addr, unsigned long end, +- swp_entry_t entry, struct page *page) ++ swp_entry_t entry, struct page *page, ++ struct page_beancounter **pb) + { + pte_t swp_pte = swp_entry_to_pte(entry); + pte_t *pte; +@@ -538,7 +609,7 @@ + * Test inline before going to call unuse_pte. + */ + if (unlikely(pte_same(*pte, swp_pte))) { +- unuse_pte(vma, pte++, addr, entry, page); ++ unuse_pte(vma, pte++, addr, entry, page, pb); + found = 1; + break; + } +@@ -549,7 +620,8 @@ + + static inline int unuse_pmd_range(struct vm_area_struct *vma, pud_t *pud, + unsigned long addr, unsigned long end, +- swp_entry_t entry, struct page *page) ++ swp_entry_t entry, struct page *page, ++ struct page_beancounter **pb) + { + pmd_t *pmd; + unsigned long next; +@@ -559,7 +631,7 @@ + next = pmd_addr_end(addr, end); + if (pmd_none_or_clear_bad(pmd)) + continue; +- if (unuse_pte_range(vma, pmd, addr, next, entry, page)) ++ if (unuse_pte_range(vma, pmd, addr, next, entry, page, pb)) + return 1; + } while (pmd++, addr = next, addr != end); + return 0; +@@ -567,7 +639,8 @@ + + static inline int unuse_pud_range(struct vm_area_struct *vma, pgd_t *pgd, + unsigned long addr, unsigned long end, +- swp_entry_t entry, struct page *page) ++ swp_entry_t entry, struct page *page, ++ struct page_beancounter **pb) + { + pud_t *pud; + unsigned long next; +@@ -577,14 +650,15 @@ + next = pud_addr_end(addr, end); + if (pud_none_or_clear_bad(pud)) + continue; +- if (unuse_pmd_range(vma, pud, addr, next, entry, page)) ++ if (unuse_pmd_range(vma, pud, addr, next, entry, page, pb)) + return 1; + } while (pud++, addr = next, addr != end); + return 0; + } + + static int unuse_vma(struct vm_area_struct *vma, +- swp_entry_t entry, struct page *page) ++ swp_entry_t entry, struct page *page, ++ struct page_beancounter **pb) + { + pgd_t *pgd; + unsigned long addr, end, next; +@@ -605,14 +679,15 @@ + next = pgd_addr_end(addr, end); + if (pgd_none_or_clear_bad(pgd)) + continue; +- if (unuse_pud_range(vma, pgd, addr, next, entry, page)) ++ if (unuse_pud_range(vma, pgd, addr, next, entry, page, pb)) + return 1; + } while (pgd++, addr = next, addr != end); + return 0; + } + + static int unuse_mm(struct mm_struct *mm, +- swp_entry_t entry, struct page *page) ++ swp_entry_t entry, struct page *page, ++ struct page_beancounter **pb) + { + struct vm_area_struct *vma; + +@@ -627,7 +702,7 @@ + lock_page(page); + } + for (vma = mm->mmap; vma; vma = vma->vm_next) { +- if (vma->anon_vma && unuse_vma(vma, entry, page)) ++ if (vma->anon_vma && unuse_vma(vma, entry, page, pb)) + break; + } + up_read(&mm->mmap_sem); +@@ -693,6 +768,7 @@ + int retval = 0; + int reset_overflow = 0; + int shmem; ++ struct page_beancounter *pb; + + /* + * When searching mms for an entry, a good strategy is to +@@ -744,6 +820,13 @@ + break; + } + ++ pb = NULL; ++ if (pb_alloc_all(&pb)) { ++ page_cache_release(page); ++ retval = -ENOMEM; ++ break; ++ } ++ + /* + * Don't hold on to start_mm if it looks like exiting. + */ +@@ -766,6 +849,20 @@ + lock_page(page); + wait_on_page_writeback(page); + ++ /* If read failed we cannot map not-uptodate page to ++ * user space. Actually, we are in serious troubles, ++ * we do not even know what process to kill. So, the only ++ * variant remains: to stop swapoff() and allow someone ++ * to kill processes to zap invalid pages. ++ */ ++ if (unlikely(!PageUptodate(page))) { ++ pb_free_list(&pb); ++ unlock_page(page); ++ page_cache_release(page); ++ retval = -EIO; ++ break; ++ } ++ + /* + * Remove all references to entry. + * Whenever we reach init_mm, there's no address space +@@ -777,7 +874,7 @@ + if (start_mm == &init_mm) + shmem = shmem_unuse(entry, page); + else +- retval = unuse_mm(start_mm, entry, page); ++ retval = unuse_mm(start_mm, entry, page, &pb); + } + if (*swap_map > 1) { + int set_start_mm = (*swap_map >= swcount); +@@ -807,7 +904,7 @@ + set_start_mm = 1; + shmem = shmem_unuse(entry, page); + } else +- retval = unuse_mm(mm, entry, page); ++ retval = unuse_mm(mm, entry, page, &pb); + if (set_start_mm && *swap_map < swcount) { + mmput(new_start_mm); + atomic_inc(&mm->mm_users); +@@ -821,6 +918,8 @@ + mmput(start_mm); + start_mm = new_start_mm; + } ++ ++ pb_free_list(&pb); + if (retval) { + unlock_page(page); + page_cache_release(page); +@@ -1183,6 +1282,10 @@ + int i, type, prev; + int err; + ++ /* VE admin check is just to be on the safe side, the admin may affect ++ * swaps only if he has access to special, i.e. if he has been granted ++ * access to the block device or if the swap file is in the area ++ * visible to him. */ + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + +@@ -1282,6 +1385,7 @@ + spin_unlock(&swap_lock); + mutex_unlock(&swapon_mutex); + vfree(swap_map); ++ ub_swap_fini(p); + inode = mapping->host; + if (S_ISBLK(inode->i_mode)) { + struct block_device *bdev = I_BDEV(inode); +@@ -1301,6 +1405,8 @@ + return err; + } + ++EXPORT_SYMBOL(sys_swapoff); ++ + #ifdef CONFIG_PROC_FS + /* iterator */ + static void *swap_start(struct seq_file *swap, loff_t *pos) +@@ -1635,9 +1741,16 @@ + goto bad_swap; + } + ++ if (ub_swap_init(p, maxpages)) { ++ error = -ENOMEM; ++ goto bad_swap; ++ } ++ + mutex_lock(&swapon_mutex); + spin_lock(&swap_lock); + p->flags = SWP_ACTIVE; ++ if (swap_flags & SWAP_FLAG_READONLY) ++ p->flags |= SWP_READONLY; + nr_swap_pages += nr_good_pages; + total_swap_pages += nr_good_pages; + +@@ -1697,6 +1810,8 @@ + return error; + } + ++EXPORT_SYMBOL(sys_swapon); ++ + void si_swapinfo(struct sysinfo *val) + { + unsigned int i; +@@ -1756,6 +1871,8 @@ + goto out; + } + ++EXPORT_SYMBOL(swap_duplicate); ++ + struct swap_info_struct * + get_swap_info_struct(unsigned type) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/truncate.c debian/binary-custom.d/openvz/src/mm/truncate.c +--- ./mm/truncate.c 2012-06-12 16:25:24.314312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/truncate.c 2012-11-13 15:20:15.496569061 +0000 +@@ -77,6 +77,7 @@ + BDI_RECLAIMABLE); + if (account_size) + task_io_account_cancelled_write(account_size); ++ ub_io_release_context(page, account_size); + } + } + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/vmalloc.c debian/binary-custom.d/openvz/src/mm/vmalloc.c +--- ./mm/vmalloc.c 2012-06-12 16:25:24.314312486 +0100 ++++ debian/binary-custom.d/openvz/src/mm/vmalloc.c 2012-11-13 15:20:15.496569061 +0000 +@@ -20,6 +20,9 @@ + #include + #include + ++#include ++#include ++ + + DEFINE_RWLOCK(vmlist_lock); + struct vm_struct *vmlist; +@@ -280,6 +283,70 @@ + return tmp; + } + ++struct vm_struct * get_vm_area_best(unsigned long size, unsigned long flags) ++{ ++ unsigned long addr, best_addr, delta, best_delta; ++ struct vm_struct **p, **best_p, *tmp, *area; ++ ++ area = kmalloc(sizeof(*area), GFP_KERNEL); ++ if (!area) ++ return NULL; ++ ++ size += PAGE_SIZE; /* one-page gap at the end */ ++ addr = VMALLOC_START; ++ best_addr = 0UL; ++ best_p = NULL; ++ best_delta = PAGE_ALIGN(VMALLOC_END) - VMALLOC_START; ++ ++ write_lock(&vmlist_lock); ++ for (p = &vmlist; (tmp = *p) && ++ (tmp->addr <= (void *)PAGE_ALIGN(VMALLOC_END)); ++ p = &tmp->next) { ++ if ((unsigned long)tmp->addr < addr) ++ continue; ++ if ((size + addr) < addr) ++ break; ++ delta = (unsigned long) tmp->addr - (size + addr); ++ if (delta < best_delta) { ++ best_delta = delta; ++ best_addr = addr; ++ best_p = p; ++ } ++ addr = tmp->size + (unsigned long)tmp->addr; ++ if (addr > VMALLOC_END-size) ++ break; ++ } ++ ++ if (!tmp || (tmp->addr > (void *)PAGE_ALIGN(VMALLOC_END))) { ++ /* check free area after list end */ ++ delta = (unsigned long) PAGE_ALIGN(VMALLOC_END) - (size + addr); ++ if (delta < best_delta) { ++ best_delta = delta; ++ best_addr = addr; ++ best_p = p; ++ } ++ } ++ if (best_addr) { ++ area->flags = flags; ++ /* allocate at the end of this area */ ++ area->addr = (void *)(best_addr + best_delta); ++ area->size = size; ++ area->next = *best_p; ++ area->pages = NULL; ++ area->nr_pages = 0; ++ area->phys_addr = 0; ++ *best_p = area; ++ /* check like in __vunmap */ ++ WARN_ON((PAGE_SIZE - 1) & (unsigned long)area->addr); ++ } else { ++ kfree(area); ++ area = NULL; ++ } ++ write_unlock(&vmlist_lock); ++ ++ return area; ++} ++ + /* Caller must hold vmlist_lock */ + static struct vm_struct *__remove_vm_area(void *addr) + { +@@ -319,7 +386,7 @@ + return v; + } + +-static void __vunmap(void *addr, int deallocate_pages) ++static void __vunmap(void *addr, int deallocate_pages, int uncharge) + { + struct vm_struct *area; + +@@ -345,6 +412,8 @@ + if (deallocate_pages) { + int i; + ++ if (uncharge) ++ dec_vmalloc_charged(area); + for (i = 0; i < area->nr_pages; i++) { + BUG_ON(!area->pages[i]); + __free_page(area->pages[i]); +@@ -373,7 +442,7 @@ + void vfree(void *addr) + { + BUG_ON(in_interrupt()); +- __vunmap(addr, 1); ++ __vunmap(addr, 1, 1); + } + EXPORT_SYMBOL(vfree); + +@@ -389,7 +458,7 @@ + void vunmap(void *addr) + { + BUG_ON(in_interrupt()); +- __vunmap(addr, 0); ++ __vunmap(addr, 0, 0); + } + EXPORT_SYMBOL(vunmap); + +@@ -464,10 +533,12 @@ + + if (map_vm_area(area, prot, &pages)) + goto fail; ++ ++ inc_vmalloc_charged(area, gfp_mask); + return area->addr; + + fail: +- vfree(area->addr); ++ __vunmap(area->addr, 1, 0); + return NULL; + } + +@@ -509,6 +580,21 @@ + } + EXPORT_SYMBOL(__vmalloc); + ++static void *____vmalloc(unsigned long size, gfp_t mask, pgprot_t prot) ++{ ++ struct vm_struct *area; ++ ++ size = PAGE_ALIGN(size); ++ if (!size || (size >> PAGE_SHIFT) > num_physpages) ++ return NULL; ++ ++ area = get_vm_area_best(size, VM_ALLOC); ++ if (!area) ++ return NULL; ++ ++ return __vmalloc_area_node(area, mask, prot, -1); ++} ++ + /** + * vmalloc - allocate virtually contiguous memory + * @size: allocation size +@@ -524,6 +610,26 @@ + } + EXPORT_SYMBOL(vmalloc); + ++void *ub_vmalloc(unsigned long size) ++{ ++ return __vmalloc(size, GFP_KERNEL_UBC | __GFP_HIGHMEM, PAGE_KERNEL); ++} ++EXPORT_SYMBOL(ub_vmalloc); ++ ++void *vmalloc_best(unsigned long size) ++{ ++ return ____vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL); ++} ++ ++EXPORT_SYMBOL(vmalloc_best); ++ ++void *ub_vmalloc_best(unsigned long size) ++{ ++ return ____vmalloc(size, GFP_KERNEL_UBC | __GFP_HIGHMEM, PAGE_KERNEL); ++} ++ ++EXPORT_SYMBOL(ub_vmalloc_best); ++ + /** + * vmalloc_user - allocate zeroed virtually contiguous memory for userspace + * @size: allocation size +@@ -564,6 +670,12 @@ + } + EXPORT_SYMBOL(vmalloc_node); + ++void *ub_vmalloc_node(unsigned long size, int node) ++{ ++ return __vmalloc_node(size, GFP_KERNEL_UBC | __GFP_HIGHMEM, PAGE_KERNEL, node); ++} ++EXPORT_SYMBOL(ub_vmalloc_node); ++ + #ifndef PAGE_KERNEL_EXEC + # define PAGE_KERNEL_EXEC PAGE_KERNEL + #endif +@@ -823,3 +935,37 @@ + kfree(area); + } + EXPORT_SYMBOL_GPL(free_vm_area); ++ ++void vprintstat(void) ++{ ++ struct vm_struct *p, *last_p = NULL; ++ unsigned long addr, size, free_size, max_free_size; ++ int num; ++ ++ addr = VMALLOC_START; ++ size = max_free_size = 0; ++ num = 0; ++ ++ read_lock(&vmlist_lock); ++ for (p = vmlist; p; p = p->next) { ++ free_size = (unsigned long)p->addr - addr; ++ if (free_size > max_free_size) ++ max_free_size = free_size; ++ addr = (unsigned long)p->addr + p->size; ++ size += p->size; ++ ++num; ++ last_p = p; ++ } ++ if (last_p) { ++ free_size = VMALLOC_END - ++ ((unsigned long)last_p->addr + last_p->size); ++ if (free_size > max_free_size) ++ max_free_size = free_size; ++ } ++ read_unlock(&vmlist_lock); ++ ++ printk("VMALLOC Used: %luKB Total: %luKB Entries: %d\n" ++ " Max_Free: %luKB Start: %lx End: %lx\n", ++ size/1024, (VMALLOC_END - VMALLOC_START)/1024, num, ++ max_free_size/1024, VMALLOC_START, VMALLOC_END); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/vmscan.c debian/binary-custom.d/openvz/src/mm/vmscan.c +--- ./mm/vmscan.c 2012-06-12 16:25:24.318312485 +0100 ++++ debian/binary-custom.d/openvz/src/mm/vmscan.c 2012-11-13 15:20:15.496569061 +0000 +@@ -38,10 +38,14 @@ + #include + #include + ++#include ++#include ++ + #include + #include + + #include ++#include + + #include "internal.h" + +@@ -161,6 +165,9 @@ + if (scanned == 0) + scanned = SWAP_CLUSTER_MAX; + ++ if (unlikely(test_tsk_thread_flag(current, TIF_MEMDIE))) ++ return 1; ++ + if (!down_read_trylock(&shrinker_rwsem)) + return 1; /* Assume we'll be able to shrink next time */ + +@@ -195,6 +202,9 @@ + int shrink_ret; + int nr_before; + ++ if (unlikely(test_tsk_thread_flag(current, TIF_MEMDIE))) ++ goto done; ++ + nr_before = (*shrinker->shrink)(0, gfp_mask); + shrink_ret = (*shrinker->shrink)(this_scan, gfp_mask); + if (shrink_ret == -1) +@@ -209,6 +219,7 @@ + + shrinker->nr += total_scan; + } ++done: + up_read(&shrinker_rwsem); + return ret; + } +@@ -322,6 +333,7 @@ + */ + if (PagePrivate(page)) { + if (try_to_free_buffers(page)) { ++ ub_io_release_context(page, 0); + ClearPageDirty(page); + printk("%s: orphaned page\n", __FUNCTION__); + return PAGE_CLEAN; +@@ -1016,6 +1028,7 @@ + reclaim_mapped = 1; + } + ++ {KSTAT_PERF_ENTER(refill_inact) + lru_add_drain(); + spin_lock_irq(&zone->lru_lock); + pgmoved = isolate_lru_pages(nr_pages, &zone->active_list, +@@ -1095,6 +1108,7 @@ + spin_unlock_irq(&zone->lru_lock); + + pagevec_release(&pvec); ++ KSTAT_PERF_LEAVE(refill_inact)} + } + + /* +@@ -1133,6 +1147,8 @@ + nr_to_scan = min(nr_active, + (unsigned long)sc->swap_cluster_max); + nr_active -= nr_to_scan; ++ if (unlikely(test_tsk_thread_flag(current, TIF_MEMDIE))) ++ goto done; + shrink_active_list(nr_to_scan, zone, sc, priority); + } + +@@ -1140,12 +1156,15 @@ + nr_to_scan = min(nr_inactive, + (unsigned long)sc->swap_cluster_max); + nr_inactive -= nr_to_scan; ++ if (unlikely(test_tsk_thread_flag(current, TIF_MEMDIE))) ++ goto done; + nr_reclaimed += shrink_inactive_list(nr_to_scan, zone, + sc); + } + } + + throttle_vm_writeout(sc->gfp_mask); ++done: + return nr_reclaimed; + } + +@@ -1189,6 +1208,9 @@ + sc->all_unreclaimable = 0; + + nr_reclaimed += shrink_zone(priority, zone, sc); ++ ++ if (unlikely(test_tsk_thread_flag(current, TIF_MEMDIE))) ++ break; + } + return nr_reclaimed; + } +@@ -1224,8 +1246,10 @@ + .order = order, + }; + ++ KSTAT_PERF_ENTER(ttfp); + count_vm_event(ALLOCSTALL); + ++ ub_oom_start(); + for (i = 0; zones[i] != NULL; i++) { + struct zone *zone = zones[i]; + +@@ -1265,6 +1289,11 @@ + sc.may_writepage = 1; + } + ++ if (unlikely(test_tsk_thread_flag(current, TIF_MEMDIE))) { ++ ret = 1; ++ goto out; ++ } ++ + /* Take a nap, wait for some writeback to complete */ + if (sc.nr_scanned && priority < DEF_PRIORITY - 2) + congestion_wait(WRITE, HZ/10); +@@ -1290,6 +1319,7 @@ + + zone->prev_priority = priority; + } ++ KSTAT_PERF_LEAVE(ttfp); + return ret; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./mm/vmstat.c debian/binary-custom.d/openvz/src/mm/vmstat.c +--- ./mm/vmstat.c 2012-06-12 16:25:24.318312485 +0100 ++++ debian/binary-custom.d/openvz/src/mm/vmstat.c 2012-11-13 15:20:15.496569061 +0000 +@@ -14,6 +14,40 @@ + #include + #include + #include ++#include ++ ++void __get_zone_counts(unsigned long *active, unsigned long *inactive, ++ unsigned long *free, struct pglist_data *pgdat) ++{ ++ struct zone *zones = pgdat->node_zones; ++ int i; ++ ++ *active = 0; ++ *inactive = 0; ++ *free = 0; ++ for (i = 0; i < MAX_NR_ZONES; i++) { ++ *active += zone_page_state(&zones[i], NR_ACTIVE); ++ *inactive += zone_page_state(&zones[i], NR_INACTIVE); ++ *free += zone_page_state(&zones[i], NR_FREE_PAGES); ++ } ++} ++ ++void get_zone_counts(unsigned long *active, ++ unsigned long *inactive, unsigned long *free) ++{ ++ struct pglist_data *pgdat; ++ ++ *active = 0; ++ *inactive = 0; ++ *free = 0; ++ for_each_online_pgdat(pgdat) { ++ unsigned long l, m, n; ++ __get_zone_counts(&l, &m, &n, pgdat); ++ *active += l; ++ *inactive += m; ++ *free += n; ++ } ++} + + #ifdef CONFIG_VM_EVENT_COUNTERS + DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}}; +@@ -41,6 +75,20 @@ + } + } + ++unsigned long vm_events(enum vm_event_item i) ++{ ++ int cpu; ++ unsigned long sum; ++ struct vm_event_state *st; ++ ++ sum = 0; ++ for_each_online_cpu(cpu) { ++ st = &per_cpu(vm_event_states, cpu); ++ sum += st->event[i]; ++ } ++ ++ return (sum < 0 ? 0 : sum); ++} + /* + * Accumulate the vm event counters across all CPUs. + * The result is unavoidably approximate - it can change +@@ -733,30 +781,40 @@ + unsigned long *v; + #ifdef CONFIG_VM_EVENT_COUNTERS + unsigned long *e; ++#define VMSTAT_BUFSIZE (NR_VM_ZONE_STAT_ITEMS * sizeof(unsigned long) + \ ++ sizeof(struct vm_event_state)) ++#else ++#define VMSTAT_BUFSIZE (NR_VM_ZONE_STAT_ITEMS * sizeof(unsigned long)) + #endif + int i; + + if (*pos >= ARRAY_SIZE(vmstat_text)) + return NULL; + +-#ifdef CONFIG_VM_EVENT_COUNTERS +- v = kmalloc(NR_VM_ZONE_STAT_ITEMS * sizeof(unsigned long) +- + sizeof(struct vm_event_state), GFP_KERNEL); +-#else +- v = kmalloc(NR_VM_ZONE_STAT_ITEMS * sizeof(unsigned long), +- GFP_KERNEL); +-#endif ++ v = kmalloc(VMSTAT_BUFSIZE, GFP_KERNEL); + m->private = v; + if (!v) + return ERR_PTR(-ENOMEM); +- for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) +- v[i] = global_page_state(i); ++ ++ if (ve_is_super(get_exec_env())) { ++ for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) ++ v[i] = global_page_state(i); + #ifdef CONFIG_VM_EVENT_COUNTERS +- e = v + NR_VM_ZONE_STAT_ITEMS; +- all_vm_events(e); +- e[PGPGIN] /= 2; /* sectors -> kbytes */ +- e[PGPGOUT] /= 2; +-#endif ++ e = v + NR_VM_ZONE_STAT_ITEMS; ++ all_vm_events(e); ++ e[PGPGIN] /= 2; /* sectors -> kbytes */ ++ e[PGPGOUT] /= 2; ++#endif ++ } else ++ memset(v, 0, VMSTAT_BUFSIZE); ++ ++ if (virtinfo_notifier_call(VITYPE_GENERAL, ++ VIRTINFO_VMSTAT, v) & NOTIFY_FAIL) { ++ kfree(v); ++ m->private = NULL; ++ return ERR_PTR(-ENOMSG); ++ } ++ + return v + *pos; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/8021q/vlan.c debian/binary-custom.d/openvz/src/net/8021q/vlan.c +--- ./net/8021q/vlan.c 2012-06-12 16:25:24.318312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/8021q/vlan.c 2012-11-13 15:20:15.504569063 +0000 +@@ -21,6 +21,7 @@ + #include /* for copy_from_user */ + #include + #include ++#include + #include + #include + #include +@@ -33,6 +34,9 @@ + #include + #include + ++#include ++#include ++ + #include + #include "vlan.h" + #include "vlanproc.h" +@@ -68,6 +72,44 @@ + .func = vlan_skb_recv, /* VLAN receive method */ + }; + ++#ifdef CONFIG_VE ++static int vlan_start(void *data) ++{ ++ int err; ++ ++ err = vlan_proc_init(); ++ if (err < 0) ++ goto out_proc; ++ ++ __module_get(THIS_MODULE); ++ return 0; ++ ++out_proc: ++ return err; ++} ++ ++static void vlan_stop(void *data) ++{ ++ struct ve_struct *ve; ++ ++ ve = (struct ve_struct *)data; ++ if (ve->_proc_vlan_dir == NULL) ++ return; ++ ++ vlan_proc_cleanup(); ++ ve->_proc_vlan_conf = NULL; ++ ve->_proc_vlan_dir = NULL; ++ module_put(THIS_MODULE); ++} ++ ++static struct ve_hook vlan_ve_hook = { ++ .init = vlan_start, ++ .fini = vlan_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_NET_POST, ++}; ++#endif ++ + /* End of global variables definitions. */ + + /* +@@ -106,6 +148,7 @@ + goto err2; + + vlan_ioctl_set(vlan_ioctl_handler); ++ ve_hook_register(VE_SS_CHAIN, &vlan_ve_hook); + return 0; + + err2: +@@ -124,6 +167,7 @@ + { + int i; + ++ ve_hook_unregister(&vlan_ve_hook); + vlan_ioctl_set(NULL); + vlan_netlink_fini(); + +@@ -147,14 +191,16 @@ + module_exit(vlan_cleanup_module); + + /* Must be invoked with RCU read lock (no preempt) */ +-static struct vlan_group *__vlan_find_group(int real_dev_ifindex) ++static struct vlan_group *__vlan_find_group(int real_dev_ifindex, ++ struct ve_struct *ve) + { + struct vlan_group *grp; + struct hlist_node *n; + int hash = vlan_grp_hashfn(real_dev_ifindex); + + hlist_for_each_entry_rcu(grp, n, &vlan_group_hash[hash], hlist) { +- if (grp->real_dev_ifindex == real_dev_ifindex) ++ if (grp->real_dev_ifindex == real_dev_ifindex && ++ ve_accessible_strict(ve, grp->owner)) + return grp; + } + +@@ -168,7 +214,8 @@ + struct net_device *__find_vlan_dev(struct net_device *real_dev, + unsigned short VID) + { +- struct vlan_group *grp = __vlan_find_group(real_dev->ifindex); ++ struct vlan_group *grp = __vlan_find_group(real_dev->ifindex, ++ real_dev->owner_env); + + if (grp) + return vlan_group_get_device(grp, VID); +@@ -185,25 +232,27 @@ + kfree(grp); + } + +-static struct vlan_group *vlan_group_alloc(int ifindex) ++static struct vlan_group *vlan_group_alloc(struct net_device *real_dev) + { ++ int ifindex = real_dev->ifindex; + struct vlan_group *grp; + unsigned int size; + unsigned int i; + +- grp = kzalloc(sizeof(struct vlan_group), GFP_KERNEL); ++ grp = kzalloc(sizeof(struct vlan_group), GFP_KERNEL_UBC); + if (!grp) + return NULL; + + size = sizeof(struct net_device *) * VLAN_GROUP_ARRAY_PART_LEN; + + for (i = 0; i < VLAN_GROUP_ARRAY_SPLIT_PARTS; i++) { +- grp->vlan_devices_arrays[i] = kzalloc(size, GFP_KERNEL); ++ grp->vlan_devices_arrays[i] = kzalloc(size, GFP_KERNEL_UBC); + if (!grp->vlan_devices_arrays[i]) + goto err; + } + + grp->real_dev_ifindex = ifindex; ++ grp->owner = get_ve(real_dev->owner_env); + hlist_add_head_rcu(&grp->hlist, + &vlan_group_hash[vlan_grp_hashfn(ifindex)]); + return grp; +@@ -242,7 +291,7 @@ + return -EINVAL; + + ASSERT_RTNL(); +- grp = __vlan_find_group(real_dev_ifindex); ++ grp = __vlan_find_group(real_dev_ifindex, real_dev->owner_env); + + ret = 0; + +@@ -282,6 +331,9 @@ + + hlist_del_rcu(&grp->hlist); + ++ put_ve(grp->owner); ++ grp->owner = NULL; ++ + /* Free the group, after all cpu's are done. */ + call_rcu(&grp->rcu, vlan_rcu_free); + +@@ -388,6 +440,8 @@ + new_dev->do_ioctl = vlan_dev_ioctl; + + memset(new_dev->broadcast, 0, ETH_ALEN); ++ if (!ve_is_super(get_exec_env())) ++ new_dev->features |= NETIF_F_VIRTUAL; + } + + static void vlan_transfer_operstate(const struct net_device *dev, struct net_device *vlandev) +@@ -455,9 +509,9 @@ + struct vlan_group *grp, *ngrp = NULL; + int err; + +- grp = __vlan_find_group(real_dev->ifindex); ++ grp = __vlan_find_group(real_dev->ifindex, real_dev->owner_env); + if (!grp) { +- ngrp = grp = vlan_group_alloc(real_dev->ifindex); ++ ngrp = grp = vlan_group_alloc(real_dev); + if (!grp) + return -ENOBUFS; + } +@@ -550,6 +604,7 @@ + if (new_dev == NULL) + return -ENOBUFS; + ++ new_dev->nd_net = get_exec_env()->ve_netns; + /* need 4 bytes for extra VLAN header info, + * hope the underlying device can handle it. + */ +@@ -609,13 +664,12 @@ + static int vlan_device_event(struct notifier_block *unused, unsigned long event, void *ptr) + { + struct net_device *dev = ptr; +- struct vlan_group *grp = __vlan_find_group(dev->ifindex); ++ struct vlan_group *grp; + int i, flgs; + struct net_device *vlandev; ++ struct ve_struct *env; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- ++ grp = __vlan_find_group(dev->ifindex, dev->owner_env); + if (!grp) + goto out; + +@@ -692,7 +746,9 @@ + ret = unregister_vlan_dev(dev, + VLAN_DEV_INFO(vlandev)->vlan_id); + ++ env = set_exec_env(vlandev->owner_env); + unregister_netdevice(vlandev); ++ set_exec_env(env); + + /* Group was destroyed? */ + if (ret == 1) +@@ -705,6 +761,17 @@ + return NOTIFY_DONE; + } + ++static inline int vlan_check_caps(void) ++{ ++ if (capable(CAP_NET_ADMIN)) ++ return 1; ++#ifdef CONFIG_VE ++ if (capable(CAP_VE_NET_ADMIN)) ++ return 1; ++#endif ++ return 0; ++} ++ + /* + * VLAN IOCTL handler. + * o execute requested action or pass command to the device driver +@@ -739,7 +806,7 @@ + case GET_VLAN_REALDEV_NAME_CMD: + case GET_VLAN_VID_CMD: + err = -ENODEV; +- dev = __dev_get_by_name(&init_net, args.device1); ++ dev = __dev_get_by_name(net, args.device1); + if (!dev) + goto out; + +@@ -752,7 +819,7 @@ + switch (args.cmd) { + case SET_VLAN_INGRESS_PRIORITY_CMD: + err = -EPERM; +- if (!capable(CAP_NET_ADMIN)) ++ if (!vlan_check_caps()) + break; + vlan_dev_set_ingress_priority(dev, + args.u.skb_priority, +@@ -762,7 +829,7 @@ + + case SET_VLAN_EGRESS_PRIORITY_CMD: + err = -EPERM; +- if (!capable(CAP_NET_ADMIN)) ++ if (!vlan_check_caps()) + break; + err = vlan_dev_set_egress_priority(dev, + args.u.skb_priority, +@@ -771,7 +838,7 @@ + + case SET_VLAN_FLAG_CMD: + err = -EPERM; +- if (!capable(CAP_NET_ADMIN)) ++ if (!vlan_check_caps()) + break; + err = vlan_dev_set_vlan_flag(dev, + args.u.flag, +@@ -780,7 +847,7 @@ + + case SET_VLAN_NAME_TYPE_CMD: + err = -EPERM; +- if (!capable(CAP_NET_ADMIN)) ++ if (!vlan_check_caps()) + break; + if ((args.u.name_type >= 0) && + (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) { +@@ -793,14 +860,14 @@ + + case ADD_VLAN_CMD: + err = -EPERM; +- if (!capable(CAP_NET_ADMIN)) ++ if (!vlan_check_caps()) + break; + err = register_vlan_device(dev, args.u.VID); + break; + + case DEL_VLAN_CMD: + err = -EPERM; +- if (!capable(CAP_NET_ADMIN)) ++ if (!vlan_check_caps()) + break; + err = unregister_vlan_device(dev); + break; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/8021q/vlan_dev.c debian/binary-custom.d/openvz/src/net/8021q/vlan_dev.c +--- ./net/8021q/vlan_dev.c 2012-06-12 16:25:24.318312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/8021q/vlan_dev.c 2012-11-13 15:20:15.504569063 +0000 +@@ -122,11 +122,6 @@ + unsigned short vlan_TCI; + __be16 proto; + +- if (dev->nd_net != &init_net) { +- kfree_skb(skb); +- return -1; +- } +- + if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) + return -1; + +@@ -453,6 +448,7 @@ + + int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) + { ++ struct ve_struct *env; + struct net_device_stats *stats = vlan_dev_get_stats(dev); + struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data); + +@@ -507,13 +503,17 @@ + stats->tx_bytes += skb->len; + + skb->dev = VLAN_DEV_INFO(dev)->real_dev; ++ skb->owner_env = skb->dev->owner_env; ++ env = set_exec_env(skb->owner_env); + dev_queue_xmit(skb); ++ set_exec_env(env); + + return 0; + } + + int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) + { ++ struct ve_struct *env; + struct net_device_stats *stats = vlan_dev_get_stats(dev); + unsigned short veth_TCI; + +@@ -531,7 +531,10 @@ + stats->tx_bytes += skb->len; + + skb->dev = VLAN_DEV_INFO(dev)->real_dev; ++ skb->owner_env = skb->dev->owner_env; ++ env = set_exec_env(skb->owner_env); + dev_queue_xmit(skb); ++ set_exec_env(env); + + return 0; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/8021q/vlan_netlink.c debian/binary-custom.d/openvz/src/net/8021q/vlan_netlink.c +--- ./net/8021q/vlan_netlink.c 2012-06-12 16:25:24.318312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/8021q/vlan_netlink.c 2012-11-13 15:20:15.504569063 +0000 +@@ -113,7 +113,7 @@ + + if (!tb[IFLA_LINK]) + return -EINVAL; +- real_dev = __dev_get_by_index(&init_net, nla_get_u32(tb[IFLA_LINK])); ++ real_dev = __dev_get_by_index(dev->nd_net, nla_get_u32(tb[IFLA_LINK])); + if (!real_dev) + return -ENODEV; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/8021q/vlanproc.c debian/binary-custom.d/openvz/src/net/8021q/vlanproc.c +--- ./net/8021q/vlanproc.c 2012-06-12 16:25:24.318312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/8021q/vlanproc.c 2012-11-13 15:20:15.504569063 +0000 +@@ -23,6 +23,7 @@ + #include + #include /* kmalloc(), kfree() */ + #include ++#include + #include /* inline mem*, str* functions */ + #include /* __initfunc et al. */ + #include /* htons(), etc. */ +@@ -79,7 +80,24 @@ + + static int vlan_seq_open(struct inode *inode, struct file *file) + { +- return seq_open(file, &vlan_seq_ops); ++ struct seq_file *m; ++ int rv; ++ ++ rv = seq_open(file, &vlan_seq_ops); ++ if (rv < 0) ++ return rv; ++ m = file->private_data; ++ m->private = get_proc_net(inode); ++ return 0; ++} ++ ++static int vlan_seq_release(struct inode *inode, struct file *file) ++{ ++ struct seq_file *m = file->private_data; ++ struct net *net = m->private; ++ ++ put_net(net); ++ return seq_release(inode, file); + } + + static const struct file_operations vlan_fops = { +@@ -87,7 +105,7 @@ + .open = vlan_seq_open, + .read = seq_read, + .llseek = seq_lseek, +- .release = seq_release, ++ .release = vlan_seq_release, + }; + + /* +@@ -115,13 +133,21 @@ + * /proc/net/vlan + */ + ++#ifdef CONFIG_VE ++#define proc_vlan_dir (get_exec_env()->_proc_vlan_dir) ++#else + static struct proc_dir_entry *proc_vlan_dir; ++#endif + + /* + * /proc/net/vlan/config + */ + ++#ifdef CONFIG_VE ++#define proc_vlan_conf (get_exec_env()->_proc_vlan_conf) ++#else + static struct proc_dir_entry *proc_vlan_conf; ++#endif + + /* Strings */ + static const char *vlan_name_type_str[VLAN_NAME_TYPE_HIGHEST] = { +@@ -140,11 +166,13 @@ + + void vlan_proc_cleanup(void) + { ++ struct net *net = get_exec_env()->ve_netns; ++ + if (proc_vlan_conf) + remove_proc_entry(name_conf, proc_vlan_dir); + + if (proc_vlan_dir) +- proc_net_remove(&init_net, name_root); ++ proc_net_remove(net, name_root); + + /* Dynamically added entries should be cleaned up as their vlan_device + * is removed, so we should not have to take care of it here... +@@ -155,10 +183,13 @@ + * Create /proc/net/vlan entries + */ + +-int __init vlan_proc_init(void) ++int vlan_proc_init(void) + { +- proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net); ++ struct net *net = get_exec_env()->ve_netns; ++ ++ proc_vlan_dir = proc_mkdir(name_root, net->proc_net); + if (proc_vlan_dir) { ++ proc_vlan_dir->data = net; + proc_vlan_conf = create_proc_entry(name_conf, + S_IFREG|S_IRUSR|S_IWUSR, + proc_vlan_dir); +@@ -246,6 +277,7 @@ + /* start read of /proc/net/vlan/config */ + static void *vlan_seq_start(struct seq_file *seq, loff_t *pos) + { ++ struct net *net = seq->private; + struct net_device *dev; + loff_t i = 1; + +@@ -254,7 +286,7 @@ + if (*pos == 0) + return SEQ_START_TOKEN; + +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(net, dev) { + if (!is_vlan_dev(dev)) + continue; + +@@ -267,15 +299,16 @@ + + static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) + { ++ struct net *net = seq->private; + struct net_device *dev; + + ++*pos; + + dev = (struct net_device *)v; + if (v == SEQ_START_TOKEN) +- dev = net_device_entry(&init_net.dev_base_head); ++ dev = net_device_entry(&net->dev_base_head); + +- for_each_netdev_continue(&init_net, dev) { ++ for_each_netdev_continue(net, dev) { + if (!is_vlan_dev(dev)) + continue; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/9p/trans_fd.c debian/binary-custom.d/openvz/src/net/9p/trans_fd.c +--- ./net/9p/trans_fd.c 2012-06-12 16:25:24.322312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/9p/trans_fd.c 2012-11-13 15:20:15.508569064 +0000 +@@ -459,14 +459,7 @@ + + return 1; + } +- +-static void __exit p9_trans_fd_exit(void) { +- printk(KERN_ERR "Removal of 9p transports not implemented\n"); +- BUG(); +-} +- + module_init(p9_trans_fd_init); +-module_exit(p9_trans_fd_exit); + + MODULE_AUTHOR("Latchesar Ionkov "); + MODULE_AUTHOR("Eric Van Hensbergen "); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/Kconfig debian/binary-custom.d/openvz/src/net/Kconfig +--- ./net/Kconfig 2012-06-12 16:25:24.322312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/Kconfig 2012-11-13 15:20:15.508569064 +0000 +@@ -30,7 +30,7 @@ + config NET_NS + bool "Network namespace support" + default n +- depends on EXPERIMENTAL && !SYSFS ++ depends on EXPERIMENTAL + help + Allow user space to create what appear to be multiple instances + of the network stack. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br.c debian/binary-custom.d/openvz/src/net/bridge/br.c +--- ./net/bridge/br.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br.c 2012-11-13 15:20:15.544569063 +0000 +@@ -55,6 +55,7 @@ + + brioctl_set(br_ioctl_deviceless_stub); + br_handle_frame_hook = br_handle_frame; ++ br_hard_xmit_hook = br_xmit; + + br_fdb_get_hook = br_fdb_get; + br_fdb_put_hook = br_fdb_put; +@@ -89,6 +90,7 @@ + br_fdb_put_hook = NULL; + + br_handle_frame_hook = NULL; ++ br_hard_xmit_hook = NULL; + br_fdb_fini(); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_device.c debian/binary-custom.d/openvz/src/net/bridge/br_device.c +--- ./net/bridge/br_device.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_device.c 2012-11-13 15:20:15.544569063 +0000 +@@ -40,15 +40,46 @@ + skb_reset_mac_header(skb); + skb_pull(skb, ETH_HLEN); + ++ skb->brmark = BR_ALREADY_SEEN; ++ + if (dest[0] & 1) + br_flood_deliver(br, skb); + else if ((dst = __br_fdb_get(br, dest)) != NULL) +- br_deliver(dst->dst, skb); ++ br_deliver(dst->dst, skb, 1); + else + br_flood_deliver(br, skb); + + return 0; + } ++ ++int br_xmit(struct sk_buff *skb, struct net_bridge_port *port) ++{ ++ struct net_bridge *br = port->br; ++ const unsigned char *dest = skb->data; ++ struct net_bridge_fdb_entry *dst; ++ ++ if (!br->via_phys_dev) ++ return 0; ++ ++ br->statistics.tx_packets++; ++ br->statistics.tx_bytes += skb->len; ++ ++ skb_reset_mac_header(skb); ++ skb_pull(skb, ETH_HLEN); ++ ++ skb->brmark = BR_ALREADY_SEEN; ++ ++ if (dest[0] & 1) ++ br_xmit_deliver(br, port, skb); ++ else if ((dst = __br_fdb_get(br, dest)) != NULL) ++ br_deliver(dst->dst, skb, 0); ++ else ++ br_xmit_deliver(br, port, skb); ++ ++ skb_push(skb, ETH_HLEN); ++ ++ return 0; ++} + + static int br_dev_open(struct net_device *dev) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_forward.c debian/binary-custom.d/openvz/src/net/bridge/br_forward.c +--- ./net/bridge/br_forward.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_forward.c 2012-11-13 15:20:15.548569063 +0000 +@@ -78,14 +78,24 @@ + } + + /* called with rcu_read_lock */ +-void br_deliver(const struct net_bridge_port *to, struct sk_buff *skb) ++void br_deliver(const struct net_bridge_port *to, struct sk_buff *skb, int free) + { + if (should_deliver(to, skb)) { ++ if (!free) { ++ struct sk_buff *skb2; ++ ++ if ((skb2 = skb_clone(skb, GFP_ATOMIC)) == NULL) { ++ to->br->statistics.tx_dropped++; ++ return; ++ } ++ skb = skb2; ++ } + __br_deliver(to, skb); + return; + } + +- kfree_skb(skb); ++ if (free) ++ kfree_skb(skb); + } + + /* called with rcu_read_lock */ +@@ -101,6 +111,7 @@ + + /* called under bridge lock */ + static void br_flood(struct net_bridge *br, struct sk_buff *skb, ++ int free, + void (*__packet_hook)(const struct net_bridge_port *p, + struct sk_buff *skb)) + { +@@ -132,18 +143,41 @@ + return; + } + +- kfree_skb(skb); ++ if (free) ++ kfree_skb(skb); + } + + + /* called with rcu_read_lock */ + void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb) + { +- br_flood(br, skb, __br_deliver); ++ br_flood(br, skb, 1, __br_deliver); ++} ++ ++/* called with rcu_read_lock */ ++void br_xmit_deliver(struct net_bridge *br, struct net_bridge_port *port, ++ struct sk_buff *skb) ++{ ++ struct net_bridge_port *p; ++ ++ list_for_each_entry_rcu(p, &br->port_list, list) { ++ if (p == port) ++ continue; ++ if (should_deliver(p, skb)) { ++ struct sk_buff *skb2; ++ ++ if ((skb2 = skb_clone(skb, GFP_ATOMIC)) == NULL) { ++ br->statistics.tx_dropped++; ++ return; ++ } ++ __br_deliver(p, skb2); ++ } ++ } + } + + /* called under bridge lock */ + void br_flood_forward(struct net_bridge *br, struct sk_buff *skb) + { +- br_flood(br, skb, __br_forward); ++ skb->brmark = BR_ALREADY_SEEN; ++ br_flood(br, skb, 1, __br_forward); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_if.c debian/binary-custom.d/openvz/src/net/bridge/br_if.c +--- ./net/bridge/br_if.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_if.c 2012-11-13 15:20:15.548569063 +0000 +@@ -14,6 +14,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -160,6 +161,11 @@ + { + struct net_bridge_port *p, *n; + ++ if (br->master_dev) { ++ dev_put(br->master_dev); ++ br->master_dev = NULL; ++ } ++ + list_for_each_entry_safe(p, n, &br->port_list, list) { + del_nbp(p); + } +@@ -303,7 +309,7 @@ + int ret = 0; + + rtnl_lock(); +- dev = __dev_get_by_name(&init_net, name); ++ dev = __dev_get_by_name(current->nsproxy->net_ns, name); + if (dev == NULL) + ret = -ENXIO; /* Could not find device */ + +@@ -403,6 +409,10 @@ + if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) && + (br->dev->flags & IFF_UP)) + br_stp_enable_port(p); ++ if (!(dev->features & NETIF_F_VIRTUAL)) { ++ dev_hold(dev); ++ br->master_dev = dev; ++ } + spin_unlock_bh(&br->lock); + + br_ifinfo_notify(RTM_NEWLINK, p); +@@ -434,6 +444,16 @@ + spin_lock_bh(&br->lock); + br_stp_recalculate_bridge_id(br); + br_features_recompute(br); ++ if (br->master_dev == dev) { ++ br->master_dev = NULL; ++ dev_put(dev); ++ list_for_each_entry(p, &br->port_list, list) ++ if (!(p->dev->features & NETIF_F_VIRTUAL)) { ++ dev_hold(p->dev); ++ br->master_dev = p->dev; ++ break; ++ } ++ } + spin_unlock_bh(&br->lock); + + return 0; +@@ -444,7 +464,7 @@ + struct net_device *dev, *nxt; + + rtnl_lock(); +- for_each_netdev_safe(&init_net, dev, nxt) ++ for_each_netdev_safe(current->nsproxy->net_ns, dev, nxt) + if (dev->priv_flags & IFF_EBRIDGE) + del_br(dev->priv); + rtnl_unlock(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_input.c debian/binary-custom.d/openvz/src/net/bridge/br_input.c +--- ./net/bridge/br_input.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_input.c 2012-11-13 15:20:15.548569063 +0000 +@@ -24,13 +24,20 @@ + + static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb) + { +- struct net_device *indev; ++ struct net_device *indev, *outdev; + + br->statistics.rx_packets++; + br->statistics.rx_bytes += skb->len; + + indev = skb->dev; +- skb->dev = br->dev; ++ if (!br->via_phys_dev) ++ skb->dev = br->dev; ++ else { ++ skb->brmark = BR_ALREADY_SEEN; ++ outdev = br->master_dev; ++ if (outdev) ++ skb->dev = outdev; ++ } + + NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL, + netif_receive_skb); +@@ -58,7 +65,7 @@ + /* The packet skb2 goes to the local host (NULL to skip). */ + skb2 = NULL; + +- if (br->dev->flags & IFF_PROMISC) ++ if ((br->dev->flags & IFF_PROMISC) && !br->via_phys_dev) + skb2 = skb; + + dst = NULL; +@@ -144,6 +151,8 @@ + } + + switch (p->state) { ++ struct net_device *out; ++ + case BR_STATE_FORWARDING: + rhook = rcu_dereference(br_should_route_hook); + if (rhook != NULL) { +@@ -153,7 +162,12 @@ + } + /* fall through */ + case BR_STATE_LEARNING: +- if (!compare_ether_addr(p->br->dev->dev_addr, dest)) ++ if (skb->brmark == BR_ALREADY_SEEN) ++ return 0; ++ ++ out = p->br->via_phys_dev ? p->br->master_dev : p->br->dev; ++ ++ if (out && !compare_ether_addr(p->br->dev->dev_addr, dest)) + skb->pkt_type = PACKET_HOST; + + NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_ioctl.c debian/binary-custom.d/openvz/src/net/bridge/br_ioctl.c +--- ./net/bridge/br_ioctl.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_ioctl.c 2012-11-13 15:20:15.548569063 +0000 +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -28,7 +29,7 @@ + struct net_device *dev; + int i = 0; + +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(current->nsproxy->net_ns, dev) { + if (i >= num) + break; + if (dev->priv_flags & IFF_EBRIDGE) +@@ -91,7 +92,7 @@ + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + +- dev = dev_get_by_index(&init_net, ifindex); ++ dev = dev_get_by_index(current->nsproxy->net_ns, ifindex); + if (dev == NULL) + return -EINVAL; + +@@ -142,6 +143,7 @@ + b.root_port = br->root_port; + + b.stp_enabled = (br->stp_enabled != BR_NO_STP); ++ b.via_phys_dev = br->via_phys_dev; + b.ageing_time = jiffies_to_clock_t(br->ageing_time); + b.hello_timer_value = br_timer_value(&br->hello_timer); + b.tcn_timer_value = br_timer_value(&br->tcn_timer); +@@ -258,6 +260,13 @@ + br_stp_set_enabled(br, args[1]); + return 0; + ++ case BRCTL_SET_VIA_ORIG_DEV: ++ if (!capable(CAP_NET_ADMIN)) ++ return -EPERM; ++ ++ br->via_phys_dev = args[1] ? 1 : 0; ++ return 0; ++ + case BRCTL_SET_BRIDGE_PRIORITY: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_netlink.c debian/binary-custom.d/openvz/src/net/bridge/br_netlink.c +--- ./net/bridge/br_netlink.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_netlink.c 2012-11-13 15:20:15.548569063 +0000 +@@ -11,6 +11,7 @@ + */ + + #include ++#include + #include + #include + #include "br_private.h" +@@ -81,6 +82,7 @@ + */ + void br_ifinfo_notify(int event, struct net_bridge_port *port) + { ++ struct net *net = get_exec_env()->ve_netns; + struct sk_buff *skb; + int err = -ENOBUFS; + +@@ -96,10 +98,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); ++ err = rtnl_notify(skb, net,0, RTNLGRP_LINK, NULL, GFP_ATOMIC); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_LINK, err); ++ rtnl_set_sk_err(net, RTNLGRP_LINK, err); + } + + /* +@@ -111,7 +113,7 @@ + int idx; + + idx = 0; +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(current->nsproxy->net_ns, dev) { + /* not a bridge port */ + if (dev->br_port == NULL || idx < cb->args[0]) + goto skip; +@@ -156,7 +158,7 @@ + if (new_state > BR_STATE_BLOCKING) + return -EINVAL; + +- dev = __dev_get_by_index(&init_net, ifm->ifi_index); ++ dev = __dev_get_by_index(current->nsproxy->net_ns, ifm->ifi_index); + if (!dev) + return -ENODEV; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_notify.c debian/binary-custom.d/openvz/src/net/bridge/br_notify.c +--- ./net/bridge/br_notify.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_notify.c 2012-11-13 15:20:15.548569063 +0000 +@@ -37,9 +37,6 @@ + struct net_bridge_port *p = dev->br_port; + struct net_bridge *br; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + /* not a port of a bridge */ + if (p == NULL) + return NOTIFY_DONE; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_private.h debian/binary-custom.d/openvz/src/net/bridge/br_private.h +--- ./net/bridge/br_private.h 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_private.h 2012-11-13 15:20:15.548569063 +0000 +@@ -90,6 +90,8 @@ + spinlock_t lock; + struct list_head port_list; + struct net_device *dev; ++ struct net_device *master_dev; ++ unsigned char via_phys_dev; + struct net_device_stats statistics; + spinlock_t hash_lock; + struct hlist_head hash[BR_HASH_SIZE]; +@@ -139,6 +141,7 @@ + /* br_device.c */ + extern void br_dev_setup(struct net_device *dev); + extern int br_dev_xmit(struct sk_buff *skb, struct net_device *dev); ++extern int br_xmit(struct sk_buff *skb, struct net_bridge_port *port); + + /* br_fdb.c */ + extern int br_fdb_init(void); +@@ -165,12 +168,13 @@ + + /* br_forward.c */ + extern void br_deliver(const struct net_bridge_port *to, +- struct sk_buff *skb); ++ struct sk_buff *skb, int free); + extern int br_dev_queue_push_xmit(struct sk_buff *skb); + extern void br_forward(const struct net_bridge_port *to, + struct sk_buff *skb); + extern int br_forward_finish(struct sk_buff *skb); + extern void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb); ++extern void br_xmit_deliver(struct net_bridge *br, struct net_bridge_port *port, struct sk_buff *skb); + extern void br_flood_forward(struct net_bridge *br, struct sk_buff *skb); + + /* br_if.c */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_stp_bpdu.c debian/binary-custom.d/openvz/src/net/bridge/br_stp_bpdu.c +--- ./net/bridge/br_stp_bpdu.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_stp_bpdu.c 2012-11-13 15:20:15.552569061 +0000 +@@ -142,9 +142,6 @@ + struct net_bridge *br; + const unsigned char *buf; + +- if (dev->nd_net != &init_net) +- goto err; +- + if (!p) + goto err; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/br_sysfs_br.c debian/binary-custom.d/openvz/src/net/bridge/br_sysfs_br.c +--- ./net/bridge/br_sysfs_br.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/br_sysfs_br.c 2012-11-13 15:20:15.552569061 +0000 +@@ -172,6 +172,27 @@ + static DEVICE_ATTR(stp_state, S_IRUGO | S_IWUSR, show_stp_state, + store_stp_state); + ++static ssize_t show_via_phys_dev_state(struct device *cd, ++ struct device_attribute *attr, char *buf) ++{ ++ struct net_bridge *br = to_bridge(cd); ++ return sprintf(buf, "%d\n", br->via_phys_dev); ++} ++ ++static void set_via_phys_dev_state(struct net_bridge *br, unsigned long val) ++{ ++ br->via_phys_dev = val; ++} ++ ++static ssize_t store_via_phys_dev_state(struct device *cd, ++ struct device_attribute *attr, const char *buf, size_t len) ++{ ++ return store_bridge_parm(cd, buf, len, set_via_phys_dev_state); ++} ++ ++static DEVICE_ATTR(via_phys_dev, S_IRUGO | S_IWUSR, show_via_phys_dev_state, ++ store_via_phys_dev_state); ++ + static ssize_t show_priority(struct device *d, struct device_attribute *attr, + char *buf) + { +@@ -340,6 +361,7 @@ + &dev_attr_max_age.attr, + &dev_attr_ageing_time.attr, + &dev_attr_stp_state.attr, ++ &dev_attr_via_phys_dev.attr, + &dev_attr_priority.attr, + &dev_attr_bridge_id.attr, + &dev_attr_root_id.attr, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/netfilter/ebt_among.c debian/binary-custom.d/openvz/src/net/bridge/netfilter/ebt_among.c +--- ./net/bridge/netfilter/ebt_among.c 2012-06-12 16:25:24.342312485 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/netfilter/ebt_among.c 2012-11-13 15:20:15.552569061 +0000 +@@ -176,7 +176,7 @@ + unsigned int datalen) + { + struct ebt_among_info *info = (struct ebt_among_info *) data; +- int expected_length = sizeof(struct ebt_among_info); ++ int expected_length = EBT_ALIGN(sizeof(struct ebt_among_info)); + const struct ebt_mac_wormhash *wh_dst, *wh_src; + int err; + +@@ -185,7 +185,7 @@ + expected_length += ebt_mac_wormhash_size(wh_dst); + expected_length += ebt_mac_wormhash_size(wh_src); + +- if (datalen != EBT_ALIGN(expected_length)) { ++ if (datalen != expected_length) { + printk(KERN_WARNING + "ebtables: among: wrong size: %d " + "against expected %d, rounded to %Zd\n", +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/bridge/netfilter/ebt_ulog.c debian/binary-custom.d/openvz/src/net/bridge/netfilter/ebt_ulog.c +--- ./net/bridge/netfilter/ebt_ulog.c 2012-06-12 16:25:24.346312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/bridge/netfilter/ebt_ulog.c 2012-11-13 15:20:15.552569061 +0000 +@@ -306,7 +306,7 @@ + if (!ebtulognl) + ret = -ENOMEM; + else if ((ret = ebt_register_watcher(&ulog))) +- sock_release(ebtulognl->sk_socket); ++ netlink_kernel_release(ebtulognl); + + if (ret == 0) + nf_log_register(PF_BRIDGE, &ebt_ulog_logger); +@@ -332,7 +332,7 @@ + } + spin_unlock_bh(&ub->lock); + } +- sock_release(ebtulognl->sk_socket); ++ netlink_kernel_release(ebtulognl); + } + + module_init(ebt_ulog_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/datagram.c debian/binary-custom.d/openvz/src/net/core/datagram.c +--- ./net/core/datagram.c 2012-06-12 16:25:24.346312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/datagram.c 2012-11-13 15:20:15.556569059 +0000 +@@ -56,6 +56,8 @@ + #include + #include + ++#include ++ + /* + * Is a socket 'connection oriented' ? + */ +@@ -502,6 +504,7 @@ + { + struct sock *sk = sock->sk; + unsigned int mask; ++ int no_ubc_space; + + poll_wait(file, sk->sk_sleep, wait); + mask = 0; +@@ -511,8 +514,14 @@ + mask |= POLLERR; + if (sk->sk_shutdown & RCV_SHUTDOWN) + mask |= POLLRDHUP; +- if (sk->sk_shutdown == SHUTDOWN_MASK) ++ if (sk->sk_shutdown == SHUTDOWN_MASK) { ++ no_ubc_space = 0; + mask |= POLLHUP; ++ } else { ++ no_ubc_space = ub_sock_makewres_other(sk, SOCK_MIN_UBCSPACE_CH); ++ if (no_ubc_space) ++ ub_sock_sndqueueadd_other(sk, SOCK_MIN_UBCSPACE_CH); ++ } + + /* readable? */ + if (!skb_queue_empty(&sk->sk_receive_queue) || +@@ -529,7 +538,7 @@ + } + + /* writable? */ +- if (sock_writeable(sk)) ++ if (!no_ubc_space && sock_writeable(sk)) + mask |= POLLOUT | POLLWRNORM | POLLWRBAND; + else + set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/dev.c debian/binary-custom.d/openvz/src/net/core/dev.c +--- ./net/core/dev.c 2012-06-12 16:25:24.350312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/dev.c 2012-11-13 15:20:15.556569059 +0000 +@@ -122,6 +122,9 @@ + + #include "net-sysfs.h" + ++#include ++#include ++ + /* + * The list of packet types we will receive (as opposed to discard) + * and the routines to invoke. +@@ -196,20 +199,6 @@ + + EXPORT_SYMBOL(dev_base_lock); + +-#define NETDEV_HASHBITS 8 +-#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) +- +-static inline struct hlist_head *dev_name_hash(struct net *net, const char *name) +-{ +- unsigned hash = full_name_hash(name, strnlen(name, IFNAMSIZ)); +- return &net->dev_name_head[hash & ((1 << NETDEV_HASHBITS) - 1)]; +-} +- +-static inline struct hlist_head *dev_index_hash(struct net *net, int ifindex) +-{ +- return &net->dev_index_head[ifindex & ((1 << NETDEV_HASHBITS) - 1)]; +-} +- + /* Device list insertion */ + static int list_netdevice(struct net_device *dev) + { +@@ -672,7 +661,7 @@ + + ASSERT_RTNL(); + +- for_each_netdev(&init_net, dev) ++ for_each_netdev(net, dev) + if (dev->type == type && + !memcmp(dev->dev_addr, ha, dev->addr_len)) + return dev; +@@ -1210,6 +1199,8 @@ + return raw_notifier_call_chain(&netdev_chain, val, dev); + } + ++EXPORT_SYMBOL(call_netdevice_notifiers); ++ + /* When > 0 there are consumers of rx skb time stamps */ + static atomic_t netstamp_needed = ATOMIC_INIT(0); + +@@ -1530,6 +1521,23 @@ + return 0; + } + ++#if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE) ++int (*br_hard_xmit_hook)(struct sk_buff *skb, struct net_bridge_port *port); ++static __inline__ int bridge_hard_start_xmit(struct sk_buff *skb, ++ struct net_device *dev) ++{ ++ struct net_bridge_port *port; ++ ++ if (((port = rcu_dereference(dev->br_port)) == NULL) || ++ (skb->brmark == BR_ALREADY_SEEN)) ++ return 0; ++ ++ return br_hard_xmit_hook(skb, port); ++} ++#else ++#define bridge_hard_start_xmit(skb, dev) (0) ++#endif ++ + int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) + { + if (likely(!skb->next)) { +@@ -1543,6 +1551,8 @@ + goto gso; + } + ++ bridge_hard_start_xmit(skb, dev); ++ + return dev->hard_start_xmit(skb, dev); + } + +@@ -1553,6 +1563,9 @@ + + skb->next = nskb->next; + nskb->next = NULL; ++ ++ bridge_hard_start_xmit(skb, dev); ++ + rc = dev->hard_start_xmit(nskb, dev); + if (unlikely(rc)) { + nskb->next = skb->next; +@@ -2021,6 +2034,7 @@ + struct net_device *orig_dev; + int ret = NET_RX_DROP; + __be16 type; ++ struct ve_struct *old_ve; + + /* if we've gotten here through NAPI, check netpoll */ + if (netpoll_receive_skb(skb)) +@@ -2043,6 +2057,16 @@ + skb_reset_transport_header(skb); + skb->mac_len = skb->network_header - skb->mac_header; + ++#ifdef CONFIG_VE ++ /* ++ * Skb might be alloced in another VE context, than its device works. ++ * So, set the correct owner_env. ++ */ ++ skb->owner_env = skb->dev->owner_env; ++ BUG_ON(skb->owner_env == NULL); ++#endif ++ old_ve = set_exec_env(skb->owner_env); ++ + pt_prev = NULL; + + rcu_read_lock(); +@@ -2098,6 +2122,7 @@ + + out: + rcu_read_unlock(); ++ (void)set_exec_env(old_ve); + return ret; + } + +@@ -2757,8 +2782,11 @@ + dev->flags &= ~IFF_PROMISC; + else + dev->flags |= IFF_PROMISC; ++ /* Promiscous mode on these devices does not mean anything */ ++ if (dev->flags & (IFF_LOOPBACK|IFF_POINTOPOINT)) ++ return; + if (dev->flags != old_flags) { +- printk(KERN_INFO "device %s %s promiscuous mode\n", ++ ve_printk(VE_LOG, KERN_INFO "device %s %s promiscuous mode\n", + dev->name, (dev->flags & IFF_PROMISC) ? "entered" : + "left"); + audit_log(current->audit_context, GFP_ATOMIC, +@@ -3423,11 +3451,20 @@ + * - require strict serialization. + * - do not return a value + */ ++ case SIOCSIFMTU: ++ case SIOCSIFHWADDR: + case SIOCSIFFLAGS: ++ if (!capable(CAP_NET_ADMIN) && ++ !capable(CAP_VE_NET_ADMIN)) ++ return -EPERM; ++ dev_load(net, ifr.ifr_name); ++ rtnl_lock(); ++ ret = dev_ifsioc(net, &ifr, cmd); ++ rtnl_unlock(); ++ return ret; ++ + case SIOCSIFMETRIC: +- case SIOCSIFMTU: + case SIOCSIFMAP: +- case SIOCSIFHWADDR: + case SIOCSIFSLAVE: + case SIOCADDMULTI: + case SIOCDELMULTI: +@@ -3494,12 +3531,11 @@ + */ + static int dev_new_index(struct net *net) + { +- static int ifindex; + for (;;) { +- if (++ifindex <= 0) +- ifindex = 1; +- if (!__dev_get_by_index(net, ifindex)) +- return ifindex; ++ if (++net->ifindex <= 0) ++ net->ifindex = 1; ++ if (!__dev_get_by_index(net, net->ifindex)) ++ return net->ifindex; + } + } + +@@ -3602,6 +3638,10 @@ + BUG_ON(!dev->nd_net); + net = dev->nd_net; + ++ ret = -EPERM; ++ if (!ve_is_super(get_exec_env()) && ve_is_dev_movable(dev)) ++ goto out; ++ + spin_lock_init(&dev->queue_lock); + spin_lock_init(&dev->_xmit_lock); + netdev_set_lockdep_class(&dev->_xmit_lock, dev->type); +@@ -3698,6 +3738,10 @@ + + set_bit(__LINK_STATE_PRESENT, &dev->state); + ++ dev->owner_env = get_exec_env(); ++ netdev_bc(dev)->owner_ub = get_beancounter(get_exec_ub()); ++ netdev_bc(dev)->exec_ub = get_beancounter(get_exec_ub()); ++ + dev_init_scheduler(dev); + dev_hold(dev); + list_netdevice(dev); +@@ -3831,6 +3875,7 @@ + void netdev_run_todo(void) + { + struct list_head list; ++ struct ve_struct *old_ve; + + /* Need to guard against multiple cpu's getting out of order. */ + mutex_lock(&net_todo_run_mutex); +@@ -3848,6 +3893,7 @@ + list_replace_init(&net_todo_list, &list); + spin_unlock(&net_todo_list_lock); + ++ old_ve = get_exec_env(); + while (!list_empty(&list)) { + struct net_device *dev + = list_entry(list.next, struct net_device, todo_list); +@@ -3860,6 +3906,7 @@ + continue; + } + ++ (void)set_exec_env(dev->owner_env); + dev->reg_state = NETREG_UNREGISTERED; + + netdev_wait_allrefs(dev); +@@ -3870,13 +3917,21 @@ + BUG_TRAP(!dev->ip6_ptr); + BUG_TRAP(!dev->dn_ptr); + ++ put_beancounter(netdev_bc(dev)->exec_ub); ++ put_beancounter(netdev_bc(dev)->owner_ub); ++ netdev_bc(dev)->exec_ub = NULL; ++ netdev_bc(dev)->owner_ub = NULL; ++ ++ /* It must be the very last action, ++ * after this 'dev' may point to freed up memory. ++ */ + if (dev->destructor) + dev->destructor(dev); + + /* Free network device */ + kobject_put(&dev->dev.kobj); + } +- ++ (void)set_exec_env(old_ve); + out: + mutex_unlock(&net_todo_run_mutex); + } +@@ -3912,7 +3967,7 @@ + ~NETDEV_ALIGN_CONST; + alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; + +- p = kzalloc(alloc_size, GFP_KERNEL); ++ p = kzalloc(alloc_size, GFP_KERNEL_UBC); + if (!p) { + printk(KERN_ERR "alloc_netdev: Unable to allocate device.\n"); + return NULL; +@@ -4023,11 +4078,15 @@ + * Callers must hold the rtnl semaphore. + */ + +-int dev_change_net_namespace(struct net_device *dev, struct net *net, const char *pat) ++int __dev_change_net_namespace(struct net_device *dev, struct net *net, const char *pat, ++ struct ve_struct *src_ve, struct ve_struct *dst_ve, ++ struct user_beancounter *exec_ub) + { + char buf[IFNAMSIZ]; + const char *destname; + int err; ++ struct ve_struct *cur_ve; ++ struct user_beancounter *tmp_ub; + + ASSERT_RTNL(); + +@@ -4078,6 +4137,11 @@ + err = -ENODEV; + unlist_netdevice(dev); + ++ dev->owner_env = dst_ve; ++ tmp_ub = netdev_bc(dev)->exec_ub; ++ netdev_bc(dev)->exec_ub = get_beancounter(exec_ub); ++ put_beancounter(tmp_ub); ++ + synchronize_net(); + + /* Shutdown queueing discipline. */ +@@ -4086,7 +4150,9 @@ + /* Notify protocols, that we are about to destroy + this device. They should clean all the things. + */ ++ cur_ve = set_exec_env(src_ve); + call_netdevice_notifiers(NETDEV_UNREGISTER, dev); ++ (void)set_exec_env(cur_ve); + + /* + * Flush the unicast and multicast chains +@@ -4116,7 +4182,9 @@ + list_netdevice(dev); + + /* Notify protocols, that a new device appeared. */ ++ cur_ve = set_exec_env(dst_ve); + call_netdevice_notifiers(NETDEV_REGISTER, dev); ++ (void)set_exec_env(cur_ve); + + synchronize_net(); + err = 0; +@@ -4124,6 +4192,14 @@ + return err; + } + ++int dev_change_net_namespace(struct net_device *dev, struct net *net, const char *pat) ++{ ++ struct ve_struct *ve = get_exec_env(); ++ struct user_beancounter *ub = get_exec_ub(); ++ ++ return __dev_change_net_namespace(dev, net, pat, ve, ve, ub); ++} ++ + static int dev_cpu_callback(struct notifier_block *nfb, + unsigned long action, + void *ocpu) +@@ -4322,7 +4398,7 @@ + int i; + struct hlist_head *hash; + +- hash = kmalloc(sizeof(*hash) * NETDEV_HASHENTRIES, GFP_KERNEL); ++ hash = kmalloc(sizeof(*hash) * NETDEV_HASHENTRIES, GFP_KERNEL_UBC); + if (hash != NULL) + for (i = 0; i < NETDEV_HASHENTRIES; i++) + INIT_HLIST_HEAD(&hash[i]); +@@ -4464,6 +4540,7 @@ + EXPORT_SYMBOL(dev_valid_name); + EXPORT_SYMBOL(dev_add_pack); + EXPORT_SYMBOL(dev_alloc_name); ++EXPORT_SYMBOL(__dev_change_net_namespace); + EXPORT_SYMBOL(dev_close); + EXPORT_SYMBOL(dev_get_by_flags); + EXPORT_SYMBOL(dev_get_by_index); +@@ -4495,6 +4572,7 @@ + + #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) + EXPORT_SYMBOL(br_handle_frame_hook); ++EXPORT_SYMBOL(br_hard_xmit_hook); + EXPORT_SYMBOL(br_fdb_get_hook); + EXPORT_SYMBOL(br_fdb_put_hook); + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/dst.c debian/binary-custom.d/openvz/src/net/core/dst.c +--- ./net/core/dst.c 2012-06-12 16:25:24.350312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/dst.c 2012-11-13 15:20:15.556569059 +0000 +@@ -278,11 +278,11 @@ + if (!unregister) { + dst->input = dst->output = dst_discard; + } else { +- dst->dev = init_net.loopback_dev; ++ dst->dev = dst->dev->nd_net->loopback_dev; + dev_hold(dst->dev); + dev_put(dev); + if (dst->neighbour && dst->neighbour->dev == dev) { +- dst->neighbour->dev = init_net.loopback_dev; ++ dst->neighbour->dev = dst->dev; + dev_put(dev); + dev_hold(dst->neighbour->dev); + } +@@ -294,12 +294,10 @@ + struct net_device *dev = ptr; + struct dst_entry *dst, *last = NULL; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + switch (event) { + case NETDEV_UNREGISTER: + case NETDEV_DOWN: ++ dst_gc_task(NULL); + mutex_lock(&dst_gc_mutex); + for (dst = dst_busy_list; dst; dst = dst->next) { + last = dst; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/ethtool.c debian/binary-custom.d/openvz/src/net/core/ethtool.c +--- ./net/core/ethtool.c 2012-06-12 16:25:24.350312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/ethtool.c 2012-11-13 15:20:15.560569058 +0000 +@@ -815,7 +815,7 @@ + case ETHTOOL_GPFLAGS: + break; + default: +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) + return -EPERM; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/fib_rules.c debian/binary-custom.d/openvz/src/net/core/fib_rules.c +--- ./net/core/fib_rules.c 2012-06-12 16:25:24.350312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/fib_rules.c 2012-11-13 15:20:15.560569058 +0000 +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -23,7 +24,7 @@ + { + struct fib_rule *r; + +- r = kzalloc(ops->rule_size, GFP_KERNEL); ++ r = kzalloc(ops->rule_size, GFP_KERNEL_UBC); + if (r == NULL) + return -ENOMEM; + +@@ -245,7 +246,7 @@ + if (err < 0) + goto errout; + +- rule = kzalloc(ops->rule_size, GFP_KERNEL); ++ rule = kzalloc(ops->rule_size, GFP_KERNEL_UBC); + if (rule == NULL) { + err = -ENOMEM; + goto errout; +@@ -574,6 +575,7 @@ + struct fib_rules_ops *ops, struct nlmsghdr *nlh, + u32 pid) + { ++ struct net *net = get_exec_env()->ve_netns; + struct sk_buff *skb; + int err = -ENOBUFS; + +@@ -588,10 +590,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, pid, ops->nlgroup, nlh, GFP_KERNEL); ++ err = rtnl_notify(skb, net, pid, ops->nlgroup, nlh, GFP_KERNEL); + errout: + if (err < 0) +- rtnl_set_sk_err(ops->nlgroup, err); ++ rtnl_set_sk_err(net, ops->nlgroup, err); + } + + static void attach_rules(struct list_head *rules, struct net_device *dev) +@@ -621,9 +623,6 @@ + struct net_device *dev = ptr; + struct fib_rules_ops *ops; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + ASSERT_RTNL(); + rcu_read_lock(); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/filter.c debian/binary-custom.d/openvz/src/net/core/filter.c +--- ./net/core/filter.c 2012-06-12 16:25:24.350312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/filter.c 2012-11-13 15:20:15.560569058 +0000 +@@ -431,7 +431,7 @@ + if (fprog->filter == NULL) + return -EINVAL; + +- fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL); ++ fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL_UBC); + if (!fp) + return -ENOMEM; + if (copy_from_user(fp->insns, fprog->filter, fsize)) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/neighbour.c debian/binary-custom.d/openvz/src/net/core/neighbour.c +--- ./net/core/neighbour.c 2012-06-12 16:25:24.350312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/neighbour.c 2012-11-13 15:20:15.568569061 +0000 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #ifdef CONFIG_SYSCTL + #include + #endif +@@ -35,6 +36,7 @@ + #include + #include + #include ++#include + + #define NEIGH_DEBUG 1 + +@@ -252,6 +254,7 @@ + int entries; + + entries = atomic_inc_return(&tbl->entries) - 1; ++ n = ERR_PTR(-ENOBUFS); + if (entries >= tbl->gc_thresh3 || + (entries >= tbl->gc_thresh2 && + time_after(now, tbl->last_flush + 5 * HZ))) { +@@ -262,7 +265,7 @@ + + n = kmem_cache_zalloc(tbl->kmem_cachep, GFP_ATOMIC); + if (!n) +- goto out_entries; ++ goto out_nomem; + + skb_queue_head_init(&n->arp_queue); + rwlock_init(&n->lock); +@@ -281,6 +284,8 @@ + out: + return n; + ++out_nomem: ++ n = ERR_PTR(-ENOMEM); + out_entries: + atomic_dec(&tbl->entries); + goto out; +@@ -393,12 +398,11 @@ + u32 hash_val; + int key_len = tbl->key_len; + int error; +- struct neighbour *n1, *rc, *n = neigh_alloc(tbl); ++ struct neighbour *n1, *rc, *n; + +- if (!n) { +- rc = ERR_PTR(-ENOBUFS); ++ rc = n = neigh_alloc(tbl); ++ if (IS_ERR(n)) + goto out; +- } + + memcpy(n->primary_key, pkey, key_len); + n->dev = dev; +@@ -644,6 +648,8 @@ + struct neigh_table *tbl = (struct neigh_table *)arg; + struct neighbour *n, **np; + unsigned long expire, now = jiffies; ++ struct ve_struct *env = set_exec_env(tbl->owner_env); ++ struct user_beancounter *ub = set_exec_ub(tbl->owner_ub); + + NEIGH_CACHE_STAT_INC(tbl, periodic_gc_runs); + +@@ -708,6 +714,8 @@ + mod_timer(&tbl->gc_timer, now + expire); + + write_unlock(&tbl->lock); ++ set_exec_ub(ub); ++ set_exec_env(env); + } + + static __inline__ int neigh_max_probes(struct neighbour *n) +@@ -735,6 +743,11 @@ + struct neighbour *neigh = (struct neighbour *)arg; + unsigned state; + int notify = 0; ++ struct ve_struct *env; ++ struct user_beancounter *ub; ++ ++ env = set_exec_env(neigh->dev->owner_env); ++ ub = set_exec_ub(netdev_bc(neigh->dev)->exec_ub); + + write_lock(&neigh->lock); + +@@ -838,6 +851,8 @@ + neigh_update_notify(neigh); + + neigh_release(neigh); ++ (void)set_exec_ub(ub); ++ (void)set_exec_env(env); + } + + int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) +@@ -1212,6 +1227,9 @@ + unsigned long now = jiffies; + struct sk_buff *skb; + ++ struct ve_struct *env = set_exec_env(tbl->owner_env); ++ struct user_beancounter *ub = set_exec_ub(tbl->owner_ub); ++ + spin_lock(&tbl->proxy_queue.lock); + + skb = tbl->proxy_queue.next; +@@ -1223,6 +1241,7 @@ + skb = skb->next; + if (tdif <= 0) { + struct net_device *dev = back->dev; ++ + __skb_unlink(back, &tbl->proxy_queue); + if (tbl->proxy_redo && netif_running(dev)) + tbl->proxy_redo(back); +@@ -1230,6 +1249,7 @@ + kfree_skb(back); + + dev_put(dev); ++ + } else if (!sched_next || tdif < sched_next) + sched_next = tdif; + } +@@ -1237,6 +1257,8 @@ + if (sched_next) + mod_timer(&tbl->proxy_timer, jiffies + sched_next); + spin_unlock(&tbl->proxy_queue.lock); ++ (void)set_exec_ub(ub); ++ (void)set_exec_env(env); + } + + void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, +@@ -1333,12 +1355,15 @@ + + static struct lock_class_key neigh_table_proxy_queue_class; + +-void neigh_table_init_no_netlink(struct neigh_table *tbl) ++int neigh_table_init_no_netlink(struct neigh_table *tbl) + { + unsigned long now = jiffies; + unsigned long phsize; + ++ atomic_set(&tbl->entries, 0); ++ tbl->hash_chain_gc = 0; + atomic_set(&tbl->parms.refcnt, 1); ++ tbl->parms.next = NULL; + INIT_RCU_HEAD(&tbl->parms.rcu_head); + tbl->parms.reachable_time = + neigh_rand_reach_time(tbl->parms.base_reachable_time); +@@ -1346,18 +1371,26 @@ + if (!tbl->kmem_cachep) + tbl->kmem_cachep = + kmem_cache_create(tbl->id, tbl->entry_size, 0, +- SLAB_HWCACHE_ALIGN|SLAB_PANIC, ++ SLAB_HWCACHE_ALIGN|SLAB_UBC, + NULL); ++ if (!tbl->kmem_cachep) ++ return -ENOMEM; ++ + tbl->stats = alloc_percpu(struct neigh_statistics); + if (!tbl->stats) +- panic("cannot create neighbour cache statistics"); ++ return -ENOMEM; ++ ++ tbl->owner_env = get_ve(get_exec_env()); ++ tbl->owner_ub = get_beancounter(get_exec_ub()); + + #ifdef CONFIG_PROC_FS +- tbl->pde = create_proc_entry(tbl->id, 0, init_net.proc_net_stat); +- if (!tbl->pde) +- panic("cannot create neighbour proc dir entry"); +- tbl->pde->proc_fops = &neigh_stat_seq_fops; +- tbl->pde->data = tbl; ++ if (ve_is_super(get_exec_env())) { ++ tbl->pde = create_proc_entry(tbl->id, 0, init_net.proc_net_stat); ++ if (!tbl->pde) ++ panic("cannot create neighbour proc dir entry"); ++ tbl->pde->proc_fops = &neigh_stat_seq_fops; ++ tbl->pde->data = tbl; ++ } + #endif + + tbl->hash_mask = 1; +@@ -1367,7 +1400,7 @@ + tbl->phash_buckets = kzalloc(phsize, GFP_KERNEL); + + if (!tbl->hash_buckets || !tbl->phash_buckets) +- panic("cannot allocate neighbour cache hashes"); ++ goto nomem; + + get_random_bytes(&tbl->hash_rnd, sizeof(tbl->hash_rnd)); + +@@ -1386,15 +1419,38 @@ + + tbl->last_flush = now; + tbl->last_rand = now + tbl->parms.reachable_time * 20; ++ return 0; ++ ++nomem: ++ if (tbl->hash_buckets) { ++ neigh_hash_free(tbl->hash_buckets, tbl->hash_mask + 1); ++ tbl->hash_buckets = NULL; ++ } ++ if (tbl->phash_buckets) { ++ kfree(tbl->phash_buckets); ++ tbl->phash_buckets = NULL; ++ } ++ if (tbl->stats) { ++ free_percpu(tbl->stats); ++ tbl->stats = NULL; ++ } ++ put_beancounter(tbl->owner_ub); ++ put_ve(tbl->owner_env); ++ return -ENOMEM; + } + +-void neigh_table_init(struct neigh_table *tbl) ++int neigh_table_init(struct neigh_table *tbl) + { + struct neigh_table *tmp; ++ int err; + +- neigh_table_init_no_netlink(tbl); ++ err = neigh_table_init_no_netlink(tbl); ++ if (err) ++ return err; + write_lock(&neigh_tbl_lock); + for (tmp = neigh_tables; tmp; tmp = tmp->next) { ++ if (!ve_accessible_strict(tmp->owner_env, get_exec_env())) ++ continue; + if (tmp->family == tbl->family) + break; + } +@@ -1407,6 +1463,7 @@ + "family %d\n", tbl->family); + dump_stack(); + } ++ return 0; + } + + int neigh_table_clear(struct neigh_table *tbl) +@@ -1420,6 +1477,15 @@ + neigh_ifdown(tbl, NULL); + if (atomic_read(&tbl->entries)) + printk(KERN_CRIT "neighbour leakage\n"); ++#ifdef CONFIG_PROC_FS ++ if (ve_is_super(get_exec_env())) { ++ char name[strlen(tbl->id) + sizeof("net/stat/")]; ++ strcpy(name, "net/stat/"); ++ strcat(name, tbl->id); ++ remove_proc_glob_entry(name, NULL); ++ } ++#endif ++ + write_lock(&neigh_tbl_lock); + for (tp = &neigh_tables; *tp; tp = &(*tp)->next) { + if (*tp == tbl) { +@@ -1440,8 +1506,13 @@ + free_percpu(tbl->stats); + tbl->stats = NULL; + +- kmem_cache_destroy(tbl->kmem_cachep); +- tbl->kmem_cachep = NULL; ++ if (ve_is_super(get_exec_env())) { ++ kmem_cache_destroy(tbl->kmem_cachep); ++ tbl->kmem_cachep = NULL; ++ } ++ ++ put_beancounter(tbl->owner_ub); ++ put_ve(tbl->owner_env); + + return 0; + } +@@ -1477,6 +1548,8 @@ + + if (tbl->family != ndm->ndm_family) + continue; ++ if (!ve_accessible_strict(tbl->owner_env, get_exec_env())) ++ continue; + read_unlock(&neigh_tbl_lock); + + if (nla_len(dst_attr) < tbl->key_len) +@@ -1549,6 +1622,8 @@ + + if (tbl->family != ndm->ndm_family) + continue; ++ if (!ve_accessible_strict(tbl->owner_env, get_exec_env())) ++ continue; + read_unlock(&neigh_tbl_lock); + + if (nla_len(tb[NDA_DST]) < tbl->key_len) +@@ -1816,6 +1891,9 @@ + if (ndtmsg->ndtm_family && tbl->family != ndtmsg->ndtm_family) + continue; + ++ if (!ve_accessible_strict(tbl->owner_env, get_exec_env())) ++ continue; ++ + if (nla_strcmp(tb[NDTA_NAME], tbl->id) == 0) + break; + } +@@ -2056,6 +2134,8 @@ + s_t = cb->args[0]; + + for (tbl = neigh_tables, t = 0; tbl; tbl = tbl->next, t++) { ++ if (!ve_accessible_strict(tbl->owner_env, get_exec_env())) ++ continue; + if (t < s_t || (family && tbl->family != family)) + continue; + if (t > s_t) +@@ -2441,6 +2521,7 @@ + + static void __neigh_notify(struct neighbour *n, int type, int flags) + { ++ struct net *net = n->dev->nd_net; + struct sk_buff *skb; + int err = -ENOBUFS; + +@@ -2455,10 +2536,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC); ++ err = rtnl_notify(skb, net, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_NEIGH, err); ++ rtnl_set_sk_err(net, RTNLGRP_NEIGH, err); + } + + #ifdef CONFIG_ARPD +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/net-sysfs.c debian/binary-custom.d/openvz/src/net/core/net-sysfs.c +--- ./net/core/net-sysfs.c 2012-06-12 16:25:24.354312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/net-sysfs.c 2012-11-13 15:20:15.568569061 +0000 +@@ -238,6 +238,27 @@ + {} + }; + ++#ifdef CONFIG_VE ++struct device_attribute ve_net_class_attributes[] = { ++ __ATTR(addr_len, S_IRUGO, show_addr_len, NULL), ++ __ATTR(iflink, S_IRUGO, show_iflink, NULL), ++ __ATTR(ifindex, S_IRUGO, show_ifindex, NULL), ++ __ATTR(features, S_IRUGO, show_features, NULL), ++ __ATTR(type, S_IRUGO, show_type, NULL), ++ __ATTR(link_mode, S_IRUGO, show_link_mode, NULL), ++ __ATTR(address, S_IRUGO, show_address, NULL), ++ __ATTR(broadcast, S_IRUGO, show_broadcast, NULL), ++ __ATTR(carrier, S_IRUGO, show_carrier, NULL), ++ __ATTR(dormant, S_IRUGO, show_dormant, NULL), ++ __ATTR(operstate, S_IRUGO, show_operstate, NULL), ++ __ATTR(mtu, S_IRUGO, show_mtu, NULL), ++ __ATTR(flags, S_IRUGO, show_flags, NULL), ++ __ATTR(tx_queue_len, S_IRUGO, show_tx_queue_len, NULL), ++ {} ++}; ++EXPORT_SYMBOL(ve_net_class_attributes); ++#endif ++ + /* Show a given an attribute in the statistics group */ + static ssize_t netstat_show(const struct device *d, + struct device_attribute *attr, char *buf, +@@ -431,7 +452,7 @@ + kfree((char *)dev - dev->padded); + } + +-static struct class net_class = { ++struct class net_class = { + .name = "net", + .dev_release = netdev_release, + #ifdef CONFIG_SYSFS +@@ -441,6 +462,13 @@ + .dev_uevent = netdev_uevent, + #endif + }; ++EXPORT_SYMBOL(net_class); ++ ++#ifndef CONFIG_VE ++#define visible_net_class net_class ++#else ++#define visible_net_class (*get_exec_env()->net_class) ++#endif + + /* Delete sysfs entries but hold kobject reference until after all + * netdev references are gone. +@@ -460,7 +488,7 @@ + struct attribute_group **groups = net->sysfs_groups; + + device_initialize(dev); +- dev->class = &net_class; ++ dev->class = &visible_net_class; + dev->platform_data = net; + dev->groups = groups; + +@@ -480,7 +508,15 @@ + return device_add(dev); + } + ++void prepare_sysfs_netdev(void) ++{ ++#ifdef CONFIG_VE ++ get_ve0()->net_class = &net_class; ++#endif ++} ++ + int netdev_kobject_init(void) + { ++ prepare_sysfs_netdev(); + return class_register(&net_class); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/net_namespace.c debian/binary-custom.d/openvz/src/net/core/net_namespace.c +--- ./net/core/net_namespace.c 2012-06-12 16:25:24.354312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/net_namespace.c 2012-11-13 15:20:15.568569061 +0000 +@@ -1,6 +1,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -66,6 +67,8 @@ + + static void net_free(struct net *net) + { ++ struct completion *sysfs_completion; ++ + if (!net) + return; + +@@ -75,7 +78,10 @@ + return; + } + ++ sysfs_completion = net->sysfs_completion; + kmem_cache_free(net_cachep, net); ++ if (sysfs_completion) ++ complete(sysfs_completion); + } + + struct net *copy_net_ns(unsigned long flags, struct net *old_net) +@@ -92,7 +98,13 @@ + new_net = net_alloc(); + if (!new_net) + goto out; +- ++#ifdef CONFIG_VE ++ new_net->owner_ve = get_exec_env(); ++ new_net->proc_net = get_exec_env()->_proc_net; ++ new_net->proc_net->data = new_net; ++ new_net->proc_net_stat = get_exec_env()->_proc_net_stat; ++ new_net->proc_net_stat->data = new_net; ++#endif + mutex_lock(&net_mutex); + err = setup_net(new_net); + if (err) +@@ -118,6 +130,7 @@ + { + struct pernet_operations *ops; + struct net *net; ++ struct ve_struct *old_ve; + + net = container_of(work, struct net, work); + +@@ -128,11 +141,13 @@ + list_del(&net->list); + rtnl_unlock(); + ++ old_ve = set_exec_env(net->owner_ve); + /* Run all of the network namespace exit methods */ + list_for_each_entry_reverse(ops, &pernet_list, list) { + if (ops->exit) + ops->exit(net); + } ++ (void)set_exec_env(old_ve); + + mutex_unlock(&net_mutex); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/rtnetlink.c debian/binary-custom.d/openvz/src/net/core/rtnetlink.c +--- ./net/core/rtnetlink.c 2012-06-12 16:25:24.354312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/rtnetlink.c 2012-11-13 15:20:15.584569059 +0000 +@@ -60,7 +60,6 @@ + }; + + static DEFINE_MUTEX(rtnl_mutex); +-static struct sock *rtnl; + + void rtnl_lock(void) + { +@@ -458,8 +457,9 @@ + return ret; + } + +-int rtnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo) ++int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, int echo) + { ++ struct sock *rtnl = net->rtnl; + int err = 0; + + NETLINK_CB(skb).dst_group = group; +@@ -471,14 +471,17 @@ + return err; + } + +-int rtnl_unicast(struct sk_buff *skb, u32 pid) ++int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid) + { ++ struct sock *rtnl = net->rtnl; ++ + return nlmsg_unicast(rtnl, skb, pid); + } + +-int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, ++int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, + struct nlmsghdr *nlh, gfp_t flags) + { ++ struct sock *rtnl = net->rtnl; + int report = 0; + + if (nlh) +@@ -487,8 +490,10 @@ + return nlmsg_notify(rtnl, skb, pid, group, report, flags); + } + +-void rtnl_set_sk_err(u32 group, int error) ++void rtnl_set_sk_err(struct net *net, u32 group, int error) + { ++ struct sock *rtnl = net->rtnl; ++ + netlink_set_err(rtnl, 0, group, error); + } + +@@ -1186,7 +1191,7 @@ + kfree_skb(nskb); + goto errout; + } +- err = rtnl_unicast(nskb, NETLINK_CB(skb).pid); ++ err = rtnl_unicast(nskb, net, NETLINK_CB(skb).pid); + errout: + dev_put(dev); + +@@ -1207,6 +1212,8 @@ + if (rtnl_msg_handlers[idx] == NULL || + rtnl_msg_handlers[idx][type].dumpit == NULL) + continue; ++ if (vz_security_family_check(idx)) ++ continue; + if (idx > s_idx) + memset(&cb->args[0], 0, sizeof(cb->args)); + if (rtnl_msg_handlers[idx][type].dumpit(skb, cb)) +@@ -1219,6 +1226,7 @@ + + void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) + { ++ struct net *net = dev->nd_net; + struct sk_buff *skb; + int err = -ENOBUFS; + +@@ -1233,10 +1241,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_KERNEL); ++ err = rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_KERNEL); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_LINK, err); ++ rtnl_set_sk_err(net, RTNLGRP_LINK, err); + } + + /* Protected by RTNL sempahore. */ +@@ -1247,6 +1255,7 @@ + + static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) + { ++ struct net *net = skb->sk->sk_net; + rtnl_doit_func doit; + int sz_idx, kind; + int min_len; +@@ -1265,16 +1274,17 @@ + return 0; + + family = ((struct rtgenmsg*)NLMSG_DATA(nlh))->rtgen_family; +- if (family >= NPROTO) ++ if (family >= NPROTO || vz_security_family_check(family)) + return -EAFNOSUPPORT; + + sz_idx = type>>2; + kind = type&3; + +- if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN)) ++ if (kind != 2 && security_netlink_recv(skb, CAP_VE_NET_ADMIN)) + return -EPERM; + + if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) { ++ struct sock *rtnl; + rtnl_dumpit_func dumpit; + + dumpit = rtnl_get_dumpit(family, type); +@@ -1282,6 +1292,7 @@ + return -EOPNOTSUPP; + + __rtnl_unlock(); ++ rtnl = net->rtnl; + err = netlink_dump_start(rtnl, skb, nlh, dumpit, NULL); + rtnl_lock(); + return err; +@@ -1326,9 +1337,6 @@ + { + struct net_device *dev = ptr; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + switch (event) { + case NETDEV_UNREGISTER: + rtmsg_ifinfo(RTM_DELLINK, dev, ~0U); +@@ -1354,6 +1362,29 @@ + .notifier_call = rtnetlink_event, + }; + ++ ++static int rtnetlink_net_init(struct net *net) ++{ ++ struct sock *sk; ++ sk = netlink_kernel_create(net, NETLINK_ROUTE, RTNLGRP_MAX, ++ rtnetlink_rcv, &rtnl_mutex, THIS_MODULE); ++ if (!sk) ++ return -ENOMEM; ++ net->rtnl = sk; ++ return 0; ++} ++ ++static void rtnetlink_net_exit(struct net *net) ++{ ++ netlink_kernel_release(net->rtnl); ++ net->rtnl = NULL; ++} ++ ++static struct pernet_operations rtnetlink_net_ops = { ++ .init = rtnetlink_net_init, ++ .exit = rtnetlink_net_exit, ++}; ++ + void __init rtnetlink_init(void) + { + int i; +@@ -1366,10 +1397,9 @@ + if (!rta_buf) + panic("rtnetlink_init: cannot allocate rta_buf\n"); + +- rtnl = netlink_kernel_create(&init_net, NETLINK_ROUTE, RTNLGRP_MAX, +- rtnetlink_rcv, &rtnl_mutex, THIS_MODULE); +- if (rtnl == NULL) ++ if (register_pernet_subsys(&rtnetlink_net_ops)) + panic("rtnetlink_init: cannot initialize rtnetlink\n"); ++ + netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV); + register_netdevice_notifier(&rtnetlink_dev_notifier); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/scm.c debian/binary-custom.d/openvz/src/net/core/scm.c +--- ./net/core/scm.c 2012-06-12 16:25:24.354312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/scm.c 2012-11-13 15:20:15.584569059 +0000 +@@ -36,6 +36,7 @@ + #include + #include + ++#include + + /* + * Only allow a user to send credentials, that they could set with +@@ -44,7 +45,9 @@ + + static __inline__ int scm_check_creds(struct ucred *creds) + { +- if ((creds->pid == task_tgid_vnr(current) || capable(CAP_SYS_ADMIN)) && ++ if ((creds->pid == task_tgid_vnr(current) || ++ creds->pid == current->tgid || ++ capable(CAP_VE_SYS_ADMIN)) && + ((creds->uid == current->uid || creds->uid == current->euid || + creds->uid == current->suid) || capable(CAP_SETUID)) && + ((creds->gid == current->gid || creds->gid == current->egid || +@@ -71,7 +74,7 @@ + + if (!fpl) + { +- fpl = kmalloc(sizeof(struct scm_fp_list), GFP_KERNEL); ++ fpl = kmalloc(sizeof(struct scm_fp_list), GFP_KERNEL_UBC); + if (!fpl) + return -ENOMEM; + *fplp = fpl; +@@ -299,7 +302,7 @@ + if (!fpl) + return NULL; + +- new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL); ++ new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL_UBC); + if (new_fpl) { + INIT_LIST_HEAD(&new_fpl->list); + for (i=fpl->count-1; i>=0; i--) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/skbuff.c debian/binary-custom.d/openvz/src/net/core/skbuff.c +--- ./net/core/skbuff.c 2012-06-12 16:25:24.354312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/skbuff.c 2012-11-13 15:20:15.592569059 +0000 +@@ -66,6 +66,8 @@ + #include + #include + ++#include ++ + #include "kmap_skb.h" + + static struct kmem_cache *skbuff_head_cache __read_mostly; +@@ -158,6 +160,10 @@ + if (!skb) + goto out; + ++ if (ub_skb_alloc_bc(skb, gfp_mask & ~__GFP_DMA)) ++ goto nobc; ++ ++ /* Get the DATA. Size must match skb_add_mtu(). */ + size = SKB_DATA_ALIGN(size); + data = kmalloc_node_track_caller(size + sizeof(struct skb_shared_info), + gfp_mask, node); +@@ -174,6 +180,7 @@ + skb->data = data; + skb_reset_tail_pointer(skb); + skb->end = skb->tail + size; ++ skb->owner_env = get_exec_env(); + /* make sure we initialize shinfo sequentially */ + shinfo = skb_shinfo(skb); + atomic_set(&shinfo->dataref, 1); +@@ -196,6 +203,8 @@ + out: + return skb; + nodata: ++ ub_skb_free_bc(skb); ++nobc: + kmem_cache_free(cache, skb); + skb = NULL; + goto out; +@@ -280,6 +289,7 @@ + struct sk_buff *other; + atomic_t *fclone_ref; + ++ ub_skb_free_bc(skb); + switch (skb->fclone) { + case SKB_FCLONE_UNAVAILABLE: + kmem_cache_free(skbuff_head_cache, skb); +@@ -313,6 +323,7 @@ + #ifdef CONFIG_XFRM + secpath_put(skb->sp); + #endif ++ ub_skb_uncharge(skb); + if (skb->destructor) { + WARN_ON(in_irq()); + skb->destructor(skb); +@@ -402,6 +413,11 @@ + new->tc_verd = old->tc_verd; + #endif + #endif ++#ifdef CONFIG_VE ++ new->accounted = old->accounted; ++ new->redirected = old->redirected; ++#endif ++ skb_copy_brmark(new, old); + skb_copy_secmark(new, old); + } + +@@ -419,6 +435,10 @@ + n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len; + n->cloned = 1; + n->nohdr = 0; ++ C(owner_env); ++#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) ++ C(brmark); ++#endif + n->destructor = NULL; + C(iif); + C(tail); +@@ -428,6 +448,11 @@ + C(truesize); + atomic_set(&n->users, 1); + ++#ifdef CONFIG_VE ++ C(accounted); ++ C(redirected); ++#endif ++ + atomic_inc(&(skb_shinfo(skb)->dataref)); + skb->cloned = 1; + +@@ -483,6 +508,10 @@ + n->fclone = SKB_FCLONE_UNAVAILABLE; + } + ++ if (ub_skb_alloc_bc(n, gfp_mask)) { ++ kmem_cache_free(skbuff_head_cache, n); ++ return NULL; ++ } + return __skb_clone(n, skb); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/sock.c debian/binary-custom.d/openvz/src/net/core/sock.c +--- ./net/core/sock.c 2012-09-25 17:01:48.183146849 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/sock.c 2012-11-13 15:20:15.592569059 +0000 +@@ -125,6 +125,9 @@ + #include + #include + ++#include ++#include ++ + #include + + #ifdef CONFIG_INET +@@ -249,7 +252,7 @@ + static char warncomm[TASK_COMM_LEN]; + if (strcmp(warncomm, current->comm) && warned < 5) { + strcpy(warncomm, current->comm); +- printk(KERN_WARNING "process `%s' is using obsolete " ++ ve_printk(VE_LOG, KERN_WARNING "process `%s' is using obsolete " + "%s SO_BSDCOMPAT\n", warncomm, name); + warned++; + } +@@ -278,6 +281,10 @@ + goto out; + } + ++ err = ub_sockrcvbuf_charge(sk, skb); ++ if (err < 0) ++ goto out; ++ + err = sk_filter(sk, skb); + if (err) + goto out; +@@ -913,6 +920,7 @@ + slab = prot->slab; + + security_sk_free(sk); ++ ub_sock_uncharge(sk); + if (slab != NULL) + kmem_cache_free(slab, sk); + else +@@ -942,6 +950,7 @@ + */ + sk->sk_prot = sk->sk_prot_creator = prot; + sock_lock_init(sk); ++ sk->owner_env = get_exec_env(); + sk->sk_net = get_net(net); + } + +@@ -971,6 +980,25 @@ + sk_prot_free(sk->sk_prot_creator, sk); + } + ++/* ++ * Last sock_put should drop referrence to sk->sk_net. It has already ++ * been dropped in sk_change_net. Taking referrence to stopping namespace ++ * is not an option. ++ * Take referrence to a socket to remove it from hash _alive_ and after that ++ * destroy it in the context of init_net. ++ */ ++void sk_release_kernel(struct sock *sk) ++{ ++ if (sk == NULL || sk->sk_socket == NULL) ++ return; ++ ++ sock_hold(sk); ++ sock_release(sk->sk_socket); ++ sk->sk_net = get_net(&init_net); ++ sock_put(sk); ++} ++EXPORT_SYMBOL(sk_release_kernel); ++ + struct sock *sk_clone(const struct sock *sk, const gfp_t priority) + { + struct sock *newsk; +@@ -1016,14 +1044,11 @@ + if (filter != NULL) + sk_filter_charge(newsk, filter); + +- if (unlikely(xfrm_sk_clone_policy(newsk))) { +- /* It is still raw copy of parent, so invalidate +- * destructor and make plain sk_free() */ +- newsk->sk_destruct = NULL; +- sk_free(newsk); +- newsk = NULL; +- goto out; +- } ++ if (ub_sock_charge(newsk, newsk->sk_family, newsk->sk_type) < 0) ++ goto out_err; ++ ++ if (unlikely(xfrm_sk_clone_policy(newsk))) ++ goto out_err; + + newsk->sk_err = 0; + newsk->sk_priority = 0; +@@ -1047,14 +1072,23 @@ + if (newsk->sk_prot->sockets_allocated) + atomic_inc(newsk->sk_prot->sockets_allocated); + } +-out: + return newsk; ++ ++out_err: ++ /* It is still raw copy of parent, so invalidate ++ * destructor and make plain sk_free() */ ++ sock_reset_flag(newsk, SOCK_TIMESTAMP); ++ newsk->sk_destruct = NULL; ++ sk_free(newsk); ++ return NULL; + } + + EXPORT_SYMBOL_GPL(sk_clone); + + void sk_setup_caps(struct sock *sk, struct dst_entry *dst) + { ++ extern int sysctl_tcp_use_sg; ++ + __sk_dst_set(sk, dst); + sk->sk_route_caps = dst->dev->features; + if (sk->sk_route_caps & NETIF_F_GSO) +@@ -1065,6 +1099,8 @@ + else + sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM; + } ++ if (!sysctl_tcp_use_sg) ++ sk->sk_route_caps &= ~NETIF_F_SG; + } + EXPORT_SYMBOL_GPL(sk_setup_caps); + +@@ -1223,17 +1259,15 @@ + /* + * Generic send/receive buffer handlers + */ +- +-static struct sk_buff *sock_alloc_send_pskb(struct sock *sk, +- unsigned long header_len, +- unsigned long data_len, +- int noblock, int *errcode) ++struct sk_buff *sock_alloc_send_skb2(struct sock *sk, unsigned long size, ++ unsigned long size2, int noblock, ++ int *errcode) + { + struct sk_buff *skb; + gfp_t gfp_mask; + long timeo; + int err; +- int npages = (data_len + (PAGE_SIZE - 1)) >> PAGE_SHIFT; ++ int npages = (size + (PAGE_SIZE - 1)) >> PAGE_SHIFT; + + err = -EMSGSIZE; + if (npages > MAX_SKB_FRAGS) +@@ -1253,44 +1287,35 @@ + if (sk->sk_shutdown & SEND_SHUTDOWN) + goto failure; + +- if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) { +- skb = alloc_skb(header_len, gfp_mask); +- if (skb) { +- int i; +- +- /* No pages, we're done... */ +- if (!data_len) +- break; +- +- skb->truesize += data_len; +- skb_shinfo(skb)->nr_frags = npages; +- for (i = 0; i < npages; i++) { +- struct page *page; +- skb_frag_t *frag; +- +- page = alloc_pages(sk->sk_allocation, 0); +- if (!page) { +- err = -ENOBUFS; +- skb_shinfo(skb)->nr_frags = i; +- kfree_skb(skb); +- goto failure; +- } +- +- frag = &skb_shinfo(skb)->frags[i]; +- frag->page = page; +- frag->page_offset = 0; +- frag->size = (data_len >= PAGE_SIZE ? +- PAGE_SIZE : +- data_len); +- data_len -= PAGE_SIZE; +- } ++ if (ub_sock_getwres_other(sk, skb_charge_size(size))) { ++ if (size2 < size) { ++ size = size2; ++ continue; ++ } ++ set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); ++ err = -EAGAIN; ++ if (!timeo) ++ goto failure; ++ if (signal_pending(current)) ++ goto interrupted; ++ timeo = ub_sock_wait_for_space(sk, timeo, ++ skb_charge_size(size)); ++ continue; ++ } + ++ if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) { ++ skb = alloc_skb(size, gfp_mask); ++ if (skb) + /* Full success... */ + break; +- } ++ ub_sock_retwres_other(sk, skb_charge_size(size), ++ SOCK_MIN_UBCSPACE_CH); + err = -ENOBUFS; + goto failure; + } ++ ub_sock_retwres_other(sk, ++ skb_charge_size(size), ++ SOCK_MIN_UBCSPACE_CH); + set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); + set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); + err = -EAGAIN; +@@ -1301,6 +1326,7 @@ + timeo = sock_wait_for_wmem(sk, timeo); + } + ++ ub_skb_set_charge(skb, sk, skb_charge_size(size), UB_OTHERSOCKBUF); + skb_set_owner_w(skb, sk); + return skb; + +@@ -1310,11 +1336,12 @@ + *errcode = err; + return NULL; + } ++EXPORT_SYMBOL(sock_alloc_send_skb2); + + struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, + int noblock, int *errcode) + { +- return sock_alloc_send_pskb(sk, size, 0, noblock, errcode); ++ return sock_alloc_send_skb2(sk, size, size, noblock, errcode); + } + + static void __lock_sock(struct sock *sk) +@@ -1626,10 +1653,12 @@ + __lock_sock(sk); + sk->sk_lock.owned = 1; + spin_unlock(&sk->sk_lock.slock); ++#if !defined(CONFIG_VZ_CHECKPOINT) && !defined(CONFIG_VZ_CHECKPOINT_MODULE) + /* + * The sk_lock has mutex_lock() semantics here: + */ + mutex_acquire(&sk->sk_lock.dep_map, subclass, 0, _RET_IP_); ++#endif + local_bh_enable(); + } + +@@ -1637,11 +1666,12 @@ + + void fastcall release_sock(struct sock *sk) + { ++#if !defined(CONFIG_VZ_CHECKPOINT) && !defined(CONFIG_VZ_CHECKPOINT_MODULE) + /* + * The sk_lock has mutex_unlock() semantics: + */ + mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_); +- ++#endif + spin_lock_bh(&sk->sk_lock.slock); + if (sk->sk_backlog.tail) + __release_sock(sk); +@@ -1868,7 +1898,7 @@ + + if (alloc_slab) { + prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, +- SLAB_HWCACHE_ALIGN, NULL); ++ SLAB_HWCACHE_ALIGN|SLAB_UBC, NULL); + + if (prot->slab == NULL) { + printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n", +@@ -1886,7 +1916,7 @@ + sprintf(request_sock_slab_name, mask, prot->name); + prot->rsk_prot->slab = kmem_cache_create(request_sock_slab_name, + prot->rsk_prot->obj_size, 0, +- SLAB_HWCACHE_ALIGN, NULL); ++ SLAB_HWCACHE_ALIGN|SLAB_UBC, NULL); + + if (prot->rsk_prot->slab == NULL) { + printk(KERN_CRIT "%s: Can't create request sock SLAB cache!\n", +@@ -1907,7 +1937,7 @@ + prot->twsk_prot->twsk_slab = + kmem_cache_create(timewait_sock_slab_name, + prot->twsk_prot->twsk_obj_size, +- 0, SLAB_HWCACHE_ALIGN, ++ 0, SLAB_HWCACHE_ALIGN|SLAB_UBC, + NULL); + if (prot->twsk_prot->twsk_slab == NULL) + goto out_free_timewait_sock_slab_name; +@@ -2063,10 +2093,26 @@ + .release = seq_release, + }; + ++static int proto_net_init(struct net *net) ++{ ++ if (!proc_net_fops_create(net, "protocols", S_IRUGO, &proto_seq_fops)) ++ return -ENOBUFS; ++ return 0; ++} ++ ++static void proto_net_exit(struct net *net) ++{ ++ proc_net_remove(net, "protocols"); ++} ++ ++static struct pernet_operations proto_net_ops = { ++ .init = proto_net_init, ++ .exit = proto_net_exit, ++}; ++ + static int __init proto_init(void) + { +- /* register /proc/net/protocols */ +- return proc_net_fops_create(&init_net, "protocols", S_IRUGO, &proto_seq_fops) == NULL ? -ENOBUFS : 0; ++ return register_pernet_subsys(&proto_net_ops); + } + + subsys_initcall(proto_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/core/stream.c debian/binary-custom.d/openvz/src/net/core/stream.c +--- ./net/core/stream.c 2012-06-12 16:25:24.358312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/core/stream.c 2012-11-13 15:20:15.592569059 +0000 +@@ -111,8 +111,10 @@ + * sk_stream_wait_memory - Wait for more memory for a socket + * @sk: socket to wait for memory + * @timeo_p: for how long ++ * @amount - amount of memory to wait for (in UB space!) + */ +-int sk_stream_wait_memory(struct sock *sk, long *timeo_p) ++int __sk_stream_wait_memory(struct sock *sk, long *timeo_p, ++ unsigned long amount) + { + int err = 0; + long vm_wait = 0; +@@ -134,7 +136,10 @@ + if (signal_pending(current)) + goto do_interrupted; + clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); +- if (sk_stream_memory_free(sk) && !vm_wait) ++ if (amount == 0) { ++ if (sk_stream_memory_free(sk) && !vm_wait) ++ break; ++ } else if (!ub_sock_sndqueueadd_tcp(sk, amount)) + break; + + set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); +@@ -144,6 +149,8 @@ + sk_stream_memory_free(sk) && + vm_wait); + sk->sk_write_pending--; ++ if (amount > 0) ++ ub_sock_sndqueuedel(sk); + + if (vm_wait) { + vm_wait -= current_timeo; +@@ -170,6 +177,10 @@ + goto out; + } + ++int sk_stream_wait_memory(struct sock *sk, long *timeo_p) ++{ ++ return __sk_stream_wait_memory(sk, timeo_p, 0); ++} + EXPORT_SYMBOL(sk_stream_wait_memory); + + void sk_stream_rfree(struct sk_buff *skb) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/dccp/ipv6.c debian/binary-custom.d/openvz/src/net/dccp/ipv6.c +--- ./net/dccp/ipv6.c 2012-06-12 16:25:24.362312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/dccp/ipv6.c 2012-11-13 15:20:15.600569060 +0000 +@@ -569,6 +569,8 @@ + __ip6_dst_store(newsk, dst, NULL, NULL); + newsk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM | + NETIF_F_TSO); ++ if (!sysctl_tcp_use_sg) ++ newsk->sk_route_caps &= ~NETIF_F_SG; + newdp6 = (struct dccp6_sock *)newsk; + newinet = inet_sk(newsk); + newinet->pinet6 = &newdp6->inet6; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/dccp/minisocks.c debian/binary-custom.d/openvz/src/net/dccp/minisocks.c +--- ./net/dccp/minisocks.c 2012-06-12 16:25:24.362312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/dccp/minisocks.c 2012-11-13 15:20:15.600569060 +0000 +@@ -19,6 +19,8 @@ + #include + #include + ++#include ++ + #include "ackvec.h" + #include "ccid.h" + #include "dccp.h" +@@ -56,7 +58,8 @@ + { + struct inet_timewait_sock *tw = NULL; + +- if (dccp_death_row.tw_count < dccp_death_row.sysctl_max_tw_buckets) ++ if (dccp_death_row.tw_count < dccp_death_row.sysctl_max_tw_buckets && ++ ub_timewait_check(sk, &dccp_death_row)) + tw = inet_twsk_alloc(sk, state); + + if (tw != NULL) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/decnet/dn_dev.c debian/binary-custom.d/openvz/src/net/decnet/dn_dev.c +--- ./net/decnet/dn_dev.c 2012-06-12 16:25:24.366312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/decnet/dn_dev.c 2012-11-13 15:20:15.604569059 +0000 +@@ -785,10 +785,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, 0, RTNLGRP_DECnet_IFADDR, NULL, GFP_KERNEL); ++ err = rtnl_notify(skb, &init_net, 0, RTNLGRP_DECnet_IFADDR, NULL, GFP_KERNEL); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_DECnet_IFADDR, err); ++ rtnl_set_sk_err(&init_net, RTNLGRP_DECnet_IFADDR, err); + } + + static int dn_nl_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/decnet/dn_route.c debian/binary-custom.d/openvz/src/net/decnet/dn_route.c +--- ./net/decnet/dn_route.c 2012-06-12 16:25:24.366312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/decnet/dn_route.c 2012-11-13 15:20:15.608569057 +0000 +@@ -1594,7 +1594,7 @@ + goto out_free; + } + +- return rtnl_unicast(skb, NETLINK_CB(in_skb).pid); ++ return rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).pid); + + out_free: + kfree_skb(skb); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/decnet/dn_table.c debian/binary-custom.d/openvz/src/net/decnet/dn_table.c +--- ./net/decnet/dn_table.c 2012-06-12 16:25:24.370312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/decnet/dn_table.c 2012-11-13 15:20:15.608569057 +0000 +@@ -375,10 +375,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, pid, RTNLGRP_DECnet_ROUTE, nlh, GFP_KERNEL); ++ err = rtnl_notify(skb, &init_net, pid, RTNLGRP_DECnet_ROUTE, nlh, GFP_KERNEL); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_DECnet_ROUTE, err); ++ rtnl_set_sk_err(&init_net, RTNLGRP_DECnet_ROUTE, err); + } + + static __inline__ int dn_hash_dump_bucket(struct sk_buff *skb, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/decnet/netfilter/dn_rtmsg.c debian/binary-custom.d/openvz/src/net/decnet/netfilter/dn_rtmsg.c +--- ./net/decnet/netfilter/dn_rtmsg.c 2012-06-12 16:25:24.370312484 +0100 ++++ debian/binary-custom.d/openvz/src/net/decnet/netfilter/dn_rtmsg.c 2012-11-13 15:20:15.608569057 +0000 +@@ -107,7 +107,7 @@ + if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len) + return; + +- if (security_netlink_recv(skb, CAP_NET_ADMIN)) ++ if (security_netlink_recv(skb, CAP_VE_NET_ADMIN)) + RCV_SKB_FAIL(-EPERM); + + /* Eventually we might send routing messages too */ +@@ -137,7 +137,7 @@ + + rv = nf_register_hook(&dnrmg_ops); + if (rv) { +- sock_release(dnrmg->sk_socket); ++ netlink_kernel_release(dnrmg); + } + + return rv; +@@ -146,7 +146,7 @@ + static void __exit dn_rtmsg_fini(void) + { + nf_unregister_hook(&dnrmg_ops); +- sock_release(dnrmg->sk_socket); ++ netlink_kernel_release(dnrmg); + } + + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/af_inet.c debian/binary-custom.d/openvz/src/net/ipv4/af_inet.c +--- ./net/ipv4/af_inet.c 2012-06-12 16:25:24.378312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/af_inet.c 2012-11-13 15:20:15.632569059 +0000 +@@ -115,6 +115,7 @@ + #ifdef CONFIG_IP_MROUTE + #include + #endif ++#include + + DEFINE_SNMP_STAT(struct linux_mib, net_statistics) __read_mostly; + +@@ -253,9 +254,6 @@ + int try_loading_module = 0; + int err; + +- if (net != &init_net) +- return -EAFNOSUPPORT; +- + if (sock->type != SOCK_RAW && + sock->type != SOCK_DGRAM && + !inet_ehash_secret) +@@ -310,6 +308,10 @@ + goto out_rcu_unlock; + } + ++ err = vz_security_protocol_check(answer->protocol); ++ if (err < 0) ++ goto out_rcu_unlock; ++ + err = -EPERM; + if (answer->capability > 0 && !capable(answer->capability)) + goto out_rcu_unlock; +@@ -327,6 +329,13 @@ + if (sk == NULL) + goto out; + ++ err = -ENOBUFS; ++ if (ub_sock_charge(sk, PF_INET, sock->type)) ++ goto out_sk_free; ++ /* if charge was successful, sock_init_data() MUST be called to ++ * set sk->sk_type. otherwise sk will be uncharged to wrong resource ++ */ ++ + err = 0; + sk->sk_no_check = answer_no_check; + if (INET_PROTOSW_REUSE & answer_flags) +@@ -384,6 +393,9 @@ + out_rcu_unlock: + rcu_read_unlock(); + goto out; ++out_sk_free: ++ sk_free(sk); ++ return err; + } + + +@@ -398,6 +410,9 @@ + + if (sk) { + long timeout; ++ struct ve_struct *saved_env; ++ ++ saved_env = set_exec_env(sk->owner_env); + + /* Applications forget to leave groups before exiting */ + ip_mc_drop_socket(sk); +@@ -415,6 +430,8 @@ + timeout = sk->sk_lingertime; + sock->sk = NULL; + sk->sk_prot->close(sk, timeout); ++ ++ (void)set_exec_env(saved_env); + } + return 0; + } +@@ -1290,31 +1307,31 @@ + + static int __init init_ipv4_mibs(void) + { +- if (snmp_mib_init((void **)net_statistics, ++ if (snmp_mib_init((void **)ve_net_statistics, + sizeof(struct linux_mib), + __alignof__(struct linux_mib)) < 0) + goto err_net_mib; +- if (snmp_mib_init((void **)ip_statistics, ++ if (snmp_mib_init((void **)ve_ip_statistics, + sizeof(struct ipstats_mib), + __alignof__(struct ipstats_mib)) < 0) + goto err_ip_mib; +- if (snmp_mib_init((void **)icmp_statistics, ++ if (snmp_mib_init((void **)ve_icmp_statistics, + sizeof(struct icmp_mib), + __alignof__(struct icmp_mib)) < 0) + goto err_icmp_mib; +- if (snmp_mib_init((void **)icmpmsg_statistics, ++ if (snmp_mib_init((void **)ve_icmpmsg_statistics, + sizeof(struct icmpmsg_mib), + __alignof__(struct icmpmsg_mib)) < 0) + goto err_icmpmsg_mib; +- if (snmp_mib_init((void **)tcp_statistics, ++ if (snmp_mib_init((void **)ve_tcp_statistics, + sizeof(struct tcp_mib), + __alignof__(struct tcp_mib)) < 0) + goto err_tcp_mib; +- if (snmp_mib_init((void **)udp_statistics, ++ if (snmp_mib_init((void **)ve_udp_statistics, + sizeof(struct udp_mib), + __alignof__(struct udp_mib)) < 0) + goto err_udp_mib; +- if (snmp_mib_init((void **)udplite_statistics, ++ if (snmp_mib_init((void **)ve_udplite_statistics, + sizeof(struct udp_mib), + __alignof__(struct udp_mib)) < 0) + goto err_udplite_mib; +@@ -1324,17 +1341,17 @@ + return 0; + + err_udplite_mib: +- snmp_mib_free((void **)udp_statistics); ++ snmp_mib_free((void **)ve_udp_statistics); + err_udp_mib: +- snmp_mib_free((void **)tcp_statistics); ++ snmp_mib_free((void **)ve_tcp_statistics); + err_tcp_mib: +- snmp_mib_free((void **)icmpmsg_statistics); ++ snmp_mib_free((void **)ve_icmpmsg_statistics); + err_icmpmsg_mib: +- snmp_mib_free((void **)icmp_statistics); ++ snmp_mib_free((void **)ve_icmp_statistics); + err_icmp_mib: +- snmp_mib_free((void **)ip_statistics); ++ snmp_mib_free((void **)ve_ip_statistics); + err_ip_mib: +- snmp_mib_free((void **)net_statistics); ++ snmp_mib_free((void **)ve_net_statistics); + err_net_mib: + return -ENOMEM; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/arp.c debian/binary-custom.d/openvz/src/net/ipv4/arp.c +--- ./net/ipv4/arp.c 2012-06-12 16:25:24.378312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/arp.c 2012-11-13 15:20:15.632569059 +0000 +@@ -84,6 +84,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -170,7 +171,7 @@ + .queue_xmit = dev_queue_xmit, + }; + +-struct neigh_table arp_tbl = { ++struct neigh_table global_arp_tbl = { + .family = AF_INET, + .entry_size = sizeof(struct neighbour) + 4, + .key_len = 4, +@@ -179,7 +180,7 @@ + .proxy_redo = parp_redo, + .id = "arp_cache", + .parms = { +- .tbl = &arp_tbl, ++ .tbl = &global_arp_tbl, + .base_reachable_time = 30 * HZ, + .retrans_time = 1 * HZ, + .gc_staletime = 60 * HZ, +@@ -914,9 +915,6 @@ + { + struct arphdr *arp; + +- if (dev->nd_net != &init_net) +- goto freeskb; +- + /* ARP header, plus 2 device addresses, plus 2 IP addresses. */ + if (!pskb_may_pull(skb, (sizeof(struct arphdr) + + (2 * dev->addr_len) + +@@ -963,7 +961,7 @@ + if (mask && mask != htonl(0xFFFFFFFF)) + return -EINVAL; + if (!dev && (r->arp_flags & ATF_COM)) { +- dev = dev_getbyhwaddr(&init_net, r->arp_ha.sa_family, r->arp_ha.sa_data); ++ dev = dev_getbyhwaddr(get_exec_env()->ve_netns, r->arp_ha.sa_family, r->arp_ha.sa_data); + if (!dev) + return -ENODEV; + } +@@ -1128,7 +1126,8 @@ + switch (cmd) { + case SIOCDARP: + case SIOCSARP: +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_NET_ADMIN) && ++ !capable(CAP_VE_NET_ADMIN)) + return -EPERM; + case SIOCGARP: + err = copy_from_user(&r, arg, sizeof(struct arpreq)); +@@ -1151,7 +1150,7 @@ + rtnl_lock(); + if (r.arp_dev[0]) { + err = -ENODEV; +- if ((dev = __dev_get_by_name(&init_net, r.arp_dev)) == NULL) ++ if ((dev = __dev_get_by_name(get_exec_env()->ve_netns, r.arp_dev)) == NULL) + goto out; + + /* Mmmm... It is wrong... ARPHRD_NETROM==0 */ +@@ -1187,9 +1186,6 @@ + { + struct net_device *dev = ptr; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + switch (event) { + case NETDEV_CHANGEADDR: + neigh_changeaddr(&arp_tbl, dev); +@@ -1225,18 +1221,69 @@ + .func = arp_rcv, + }; + +-static int arp_proc_init(void); ++static const struct file_operations arp_seq_fops; + +-void __init arp_init(void) ++static int arp_net_init(struct net *net) + { +- neigh_table_init(&arp_tbl); ++ struct ve_struct *ve = get_exec_env(); ++ int err; + +- dev_add_pack(&arp_packet_type); +- arp_proc_init(); ++ ve->ve_arp_tbl = kmemdup(ve0.ve_arp_tbl, sizeof(struct neigh_table), ++ GFP_KERNEL); ++ if (ve->ve_arp_tbl == NULL) ++ return -ENOMEM; ++ ++ ve->ve_arp_tbl->parms.tbl = ve->ve_arp_tbl; ++ err = neigh_table_init(ve->ve_arp_tbl); ++ if (err) ++ goto out_free; + #ifdef CONFIG_SYSCTL +- neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, ++ err = neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, + NET_IPV4_NEIGH, "ipv4", NULL, NULL); ++ if (err) ++ goto out_uninit; ++#endif ++ if (!proc_net_fops_create(net, "arp", S_IRUGO, &arp_seq_fops)) ++ goto out_deregister; ++ err = 0; ++out: ++ return err; ++ ++out_deregister: ++#ifdef CONFIG_SYSCTL ++ neigh_sysctl_unregister(&ve->ve_arp_tbl->parms); ++out_uninit: ++#endif ++ neigh_table_clear(ve->ve_arp_tbl); ++out_free: ++ kfree(ve->ve_arp_tbl); ++ ve->ve_arp_tbl = NULL; ++ goto out; ++} ++ ++static void arp_net_exit(struct net *net) ++{ ++ struct ve_struct *ve = get_exec_env(); ++ ++ proc_net_remove(net, "arp"); ++#ifdef CONFIG_SYSCTL ++ neigh_sysctl_unregister(&ve->ve_arp_tbl->parms); + #endif ++ neigh_table_clear(ve->ve_arp_tbl); ++ kfree(ve->ve_arp_tbl); ++ ve->ve_arp_tbl = NULL; ++} ++ ++static struct pernet_operations arp_net_ops = { ++ .init = arp_net_init, ++ .exit = arp_net_exit, ++}; ++ ++void __init arp_init(void) ++{ ++ get_ve0()->ve_arp_tbl = &global_arp_tbl; ++ register_pernet_subsys(&arp_net_ops); ++ dev_add_pack(&arp_packet_type); + register_netdevice_notifier(&arp_netdev_notifier); + } + +@@ -1370,21 +1417,6 @@ + .llseek = seq_lseek, + .release = seq_release_private, + }; +- +-static int __init arp_proc_init(void) +-{ +- if (!proc_net_fops_create(&init_net, "arp", S_IRUGO, &arp_seq_fops)) +- return -ENOMEM; +- return 0; +-} +- +-#else /* CONFIG_PROC_FS */ +- +-static int __init arp_proc_init(void) +-{ +- return 0; +-} +- + #endif /* CONFIG_PROC_FS */ + + EXPORT_SYMBOL(arp_broken_ops); +@@ -1392,7 +1424,7 @@ + EXPORT_SYMBOL(arp_create); + EXPORT_SYMBOL(arp_xmit); + EXPORT_SYMBOL(arp_send); +-EXPORT_SYMBOL(arp_tbl); ++EXPORT_SYMBOL(global_arp_tbl); + + #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) + EXPORT_SYMBOL(clip_tbl_hook); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/devinet.c debian/binary-custom.d/openvz/src/net/ipv4/devinet.c +--- ./net/ipv4/devinet.c 2012-06-12 16:25:24.378312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/devinet.c 2012-11-13 15:20:15.636569058 +0000 +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -72,7 +73,7 @@ + }, + }; + +-static struct ipv4_devconf ipv4_devconf_dflt = { ++struct ipv4_devconf ipv4_devconf_dflt = { + .data = { + [NET_IPV4_CONF_ACCEPT_REDIRECTS - 1] = 1, + [NET_IPV4_CONF_SEND_REDIRECTS - 1] = 1, +@@ -82,7 +83,7 @@ + }, + }; + +-#define IPV4_DEVCONF_DFLT(attr) IPV4_DEVCONF(ipv4_devconf_dflt, attr) ++#define IPV4_DEVCONF_DFLT(attr) IPV4_DEVCONF(ve_ipv4_devconf_dflt, attr) + + static const struct nla_policy ifa_ipv4_policy[IFA_MAX+1] = { + [IFA_LOCAL] = { .type = NLA_U32 }, +@@ -94,8 +95,14 @@ + + static void rtmsg_ifa(int event, struct in_ifaddr *, struct nlmsghdr *, u32); + ++#ifdef CONFIG_VE ++#define ve_ipv4_devconf_dflt (*(get_exec_env()->_ipv4_devconf_dflt)) ++#else ++#define ve_ipv4_devconf_dflt ipv4_devconf_dflt ++#endif ++ + static BLOCKING_NOTIFIER_HEAD(inetaddr_chain); +-static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, ++void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, + int destroy); + #ifdef CONFIG_SYSCTL + static void devinet_sysctl_register(struct in_device *in_dev, +@@ -105,9 +112,9 @@ + + /* Locks all the inet devices. */ + +-static struct in_ifaddr *inet_alloc_ifa(void) ++struct in_ifaddr *inet_alloc_ifa(void) + { +- struct in_ifaddr *ifa = kzalloc(sizeof(*ifa), GFP_KERNEL); ++ struct in_ifaddr *ifa = kzalloc(sizeof(*ifa), GFP_KERNEL_UBC); + + if (ifa) { + INIT_RCU_HEAD(&ifa->rcu_head); +@@ -115,6 +122,7 @@ + + return ifa; + } ++EXPORT_SYMBOL_GPL(inet_alloc_ifa); + + static void inet_rcu_free_ifa(struct rcu_head *head) + { +@@ -147,7 +155,7 @@ + } + } + +-static struct in_device *inetdev_init(struct net_device *dev) ++struct in_device *inetdev_init(struct net_device *dev) + { + struct in_device *in_dev; + +@@ -157,7 +165,7 @@ + if (!in_dev) + goto out; + INIT_RCU_HEAD(&in_dev->rcu_head); +- memcpy(&in_dev->cnf, &ipv4_devconf_dflt, sizeof(in_dev->cnf)); ++ memcpy(&in_dev->cnf, &ve_ipv4_devconf_dflt, sizeof(in_dev->cnf)); + in_dev->cnf.sysctl = NULL; + in_dev->dev = dev; + if ((in_dev->arp_parms = neigh_parms_alloc(dev, &arp_tbl)) == NULL) +@@ -188,6 +196,7 @@ + in_dev = NULL; + goto out; + } ++EXPORT_SYMBOL_GPL(inetdev_init); + + static void in_dev_rcu_put(struct rcu_head *head) + { +@@ -329,7 +338,7 @@ + inet_free_ifa(ifa1); + } + +-static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, ++void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, + int destroy) + { + __inet_del_ifa(in_dev, ifap, destroy, NULL, 0); +@@ -387,7 +396,7 @@ + return 0; + } + +-static int inet_insert_ifa(struct in_ifaddr *ifa) ++int inet_insert_ifa(struct in_ifaddr *ifa) + { + return __inet_insert_ifa(ifa, NULL, 0); + } +@@ -418,7 +427,7 @@ + struct net_device *dev; + struct in_device *in_dev = NULL; + read_lock(&dev_base_lock); +- dev = __dev_get_by_index(&init_net, ifindex); ++ dev = __dev_get_by_index(get_exec_env()->ve_netns, ifindex); + if (dev) + in_dev = in_dev_get(dev); + read_unlock(&dev_base_lock); +@@ -438,6 +447,7 @@ + } endfor_ifa(in_dev); + return NULL; + } ++EXPORT_SYMBOL_GPL(inet_insert_ifa); + + static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) + { +@@ -504,7 +514,7 @@ + goto errout; + } + +- dev = __dev_get_by_index(&init_net, ifm->ifa_index); ++ dev = __dev_get_by_index(get_exec_env()->ve_netns, ifm->ifa_index); + if (dev == NULL) { + err = -ENODEV; + goto errout; +@@ -608,6 +618,7 @@ + char *colon; + int ret = -EFAULT; + int tryaddrmatch = 0; ++ struct net *net = get_exec_env()->ve_netns; + + /* + * Fetch the caller's info block into kernel space +@@ -625,7 +636,7 @@ + *colon = 0; + + #ifdef CONFIG_KMOD +- dev_load(&init_net, ifr.ifr_name); ++ dev_load(net, ifr.ifr_name); + #endif + + switch (cmd) { +@@ -644,7 +655,7 @@ + + case SIOCSIFFLAGS: + ret = -EACCES; +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_VE_NET_ADMIN)) + goto out; + break; + case SIOCSIFADDR: /* Set interface address (and family) */ +@@ -652,7 +663,7 @@ + case SIOCSIFDSTADDR: /* Set the destination address */ + case SIOCSIFNETMASK: /* Set the netmask for the interface */ + ret = -EACCES; +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_VE_NET_ADMIN)) + goto out; + ret = -EINVAL; + if (sin->sin_family != AF_INET) +@@ -666,7 +677,7 @@ + rtnl_lock(); + + ret = -ENODEV; +- if ((dev = __dev_get_by_name(&init_net, ifr.ifr_name)) == NULL) ++ if ((dev = __dev_get_by_name(net, ifr.ifr_name)) == NULL) + goto done; + + if (colon) +@@ -906,7 +917,7 @@ + */ + read_lock(&dev_base_lock); + rcu_read_lock(); +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + if ((in_dev = __in_dev_get_rcu(dev)) == NULL) + continue; + +@@ -985,7 +996,7 @@ + + read_lock(&dev_base_lock); + rcu_read_lock(); +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + if ((in_dev = __in_dev_get_rcu(dev))) { + addr = confirm_addr_indev(in_dev, dst, local, scope); + if (addr) +@@ -1048,9 +1059,6 @@ + struct net_device *dev = ptr; + struct in_device *in_dev = __in_dev_get_rtnl(dev); + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + ASSERT_RTNL(); + + if (!in_dev) { +@@ -1182,7 +1190,7 @@ + + s_ip_idx = ip_idx = cb->args[1]; + idx = 0; +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + if (idx < s_idx) + goto cont; + if (idx > s_idx) +@@ -1213,6 +1221,7 @@ + static void rtmsg_ifa(int event, struct in_ifaddr* ifa, struct nlmsghdr *nlh, + u32 pid) + { ++ struct net *net = ifa->ifa_dev->dev->nd_net; + struct sk_buff *skb; + u32 seq = nlh ? nlh->nlmsg_seq : 0; + int err = -ENOBUFS; +@@ -1228,10 +1237,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, pid, RTNLGRP_IPV4_IFADDR, nlh, GFP_KERNEL); ++ err = rtnl_notify(skb, net, pid, RTNLGRP_IPV4_IFADDR, nlh, GFP_KERNEL); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_IPV4_IFADDR, err); ++ rtnl_set_sk_err(net, RTNLGRP_IPV4_IFADDR, err); + } + + #ifdef CONFIG_SYSCTL +@@ -1241,7 +1250,7 @@ + struct net_device *dev; + + read_lock(&dev_base_lock); +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + struct in_device *in_dev; + rcu_read_lock(); + in_dev = __in_dev_get_rcu(dev); +@@ -1326,11 +1335,10 @@ + struct net_device *dev; + int on = IPV4_DEVCONF_ALL(FORWARDING); + +- IPV4_DEVCONF_ALL(ACCEPT_REDIRECTS) = !on; + IPV4_DEVCONF_DFLT(FORWARDING) = on; + + read_lock(&dev_base_lock); +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + struct in_device *in_dev; + rcu_read_lock(); + in_dev = __in_dev_get_rcu(dev); +@@ -1489,28 +1497,19 @@ + }, + }; + +-static void devinet_sysctl_register(struct in_device *in_dev, +- struct ipv4_devconf *p) ++static struct devinet_sysctl_table *__devinet_sysctl_register(char *dev_name, ++ int ifindex, struct ipv4_devconf *p) + { + int i; +- struct net_device *dev = in_dev ? in_dev->dev : NULL; +- struct devinet_sysctl_table *t = kmemdup(&devinet_sysctl, sizeof(*t), +- GFP_KERNEL); +- char *dev_name = NULL; ++ struct devinet_sysctl_table *t; + ++ t = kmemdup(&devinet_sysctl, sizeof(*t), GFP_KERNEL); + if (!t) +- return; ++ goto out; + for (i = 0; i < ARRAY_SIZE(t->devinet_vars) - 1; i++) { + t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf; + t->devinet_vars[i].extra1 = p; +- } +- +- if (dev) { +- dev_name = dev->name; +- t->devinet_dev[0].ctl_name = dev->ifindex; +- } else { +- dev_name = "default"; +- t->devinet_dev[0].ctl_name = NET_PROTO_CONF_DEFAULT; ++ t->devinet_vars[i].owner_env = get_exec_env(); + } + + /* +@@ -1520,8 +1519,9 @@ + */ + dev_name = kstrdup(dev_name, GFP_KERNEL); + if (!dev_name) +- goto free; ++ goto out_free_table; + ++ t->devinet_dev[0].ctl_name = ifindex; + t->devinet_dev[0].procname = dev_name; + t->devinet_dev[0].child = t->devinet_vars; + t->devinet_conf_dir[0].child = t->devinet_dev; +@@ -1530,17 +1530,37 @@ + + t->sysctl_header = register_sysctl_table(t->devinet_root_dir); + if (!t->sysctl_header) +- goto free_procname; ++ goto out_free_procname; + +- p->sysctl = t; +- return; ++ return t; + + /* error path */ +- free_procname: ++out_free_procname: + kfree(dev_name); +- free: ++out_free_table: + kfree(t); +- return; ++out: ++ return NULL; ++} ++ ++static void devinet_sysctl_register(struct in_device *in_dev, ++ struct ipv4_devconf *p) ++{ ++ struct net_device *dev; ++ char *dev_name; ++ int ifindex; ++ ++ dev = in_dev ? in_dev->dev : NULL; ++ ++ if (dev) { ++ dev_name = dev->name; ++ ifindex = dev->ifindex; ++ } else { ++ dev_name = "default"; ++ ifindex = NET_PROTO_CONF_DEFAULT; ++ } ++ ++ p->sysctl = __devinet_sysctl_register(dev_name, ifindex, p); + } + + static void devinet_sysctl_unregister(struct ipv4_devconf *p) +@@ -1553,8 +1573,176 @@ + kfree(t); + } + } ++ ++#ifdef CONFIG_VE ++static ctl_table net_sysctl_tables[] = { ++ /* 0: net */ ++ { ++ .ctl_name = CTL_NET, ++ .procname = "net", ++ .mode = 0555, ++ .child = &net_sysctl_tables[2], ++ }, ++ { .ctl_name = 0, }, ++ /* 2: net/ipv4 */ ++ { ++ .ctl_name = NET_IPV4, ++ .procname = "ipv4", ++ .mode = 0555, ++ .child = &net_sysctl_tables[4], ++ }, ++ { .ctl_name = 0, }, ++ /* 4, 5: net/ipv4/[vars] */ ++ { ++ .ctl_name = NET_IPV4_FORWARD, ++ .procname = "ip_forward", ++ .data = &ipv4_devconf.data[NET_IPV4_CONF_FORWARDING-1], ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = &ipv4_sysctl_forward, ++ .strategy = &ipv4_sysctl_forward_strategy, ++ }, ++ { ++ .ctl_name = NET_IPV4_ROUTE, ++ .procname = "route", ++ .maxlen = 0, ++ .mode = 0555, ++ .child = &net_sysctl_tables[7], ++ }, ++ { .ctl_name = 0 }, ++ /* 7: net/ipv4/route/flush */ ++ { ++ .ctl_name = NET_IPV4_ROUTE_FLUSH, ++ .procname = "flush", ++ .data = NULL, /* setuped below */ ++ .maxlen = sizeof(int), ++ .mode = 0200, ++ .proc_handler = &ipv4_sysctl_rtcache_flush, ++ .strategy = &ipv4_sysctl_rtcache_flush_strategy, ++ }, ++ { .ctl_name = 0 }, ++}; ++ ++static int ip_forward_sysctl_register(struct ve_struct *ve, ++ struct ipv4_devconf *p) ++{ ++ struct ctl_table_header *hdr; ++ ctl_table *root, *ipv4_table, *route_table; ++ ++ root = clone_sysctl_template(net_sysctl_tables); ++ if (root == NULL) ++ goto out; ++ ++ ipv4_table = root->child->child; ++ ipv4_table[0].data = &p->data[NET_IPV4_CONF_FORWARDING - 1]; ++ ++ route_table = ipv4_table[1].child; ++ route_table[0].data = &ipv4_flush_delay; ++ ++ hdr = register_sysctl_table(root); ++ if (hdr == NULL) ++ goto out_free; ++ ++ ve->forward_header = hdr; ++ ve->forward_table = root; ++ return 0; ++ ++out_free: ++ free_sysctl_clone(root); ++out: ++ return -ENOMEM; ++} ++ ++static inline void ip_forward_sysctl_unregister(struct ve_struct *ve) ++{ ++ unregister_sysctl_table(ve->forward_header); ++ ve->forward_header = NULL; ++} ++ ++static inline void ip_forward_sysctl_free(struct ve_struct *ve) ++{ ++ if (ve->forward_table == NULL) ++ return; ++ ++ free_sysctl_clone(ve->forward_table); ++ ve->forward_table = NULL; ++} ++#endif + #endif + ++int devinet_sysctl_init(struct ve_struct *ve) ++{ ++ int err = 0; ++#ifdef CONFIG_SYSCTL ++#ifdef CONFIG_VE ++ struct ipv4_devconf *conf, *conf_def; ++ ++ err = -ENOMEM; ++ ++ conf = kmalloc(sizeof(*conf), GFP_KERNEL); ++ if (!conf) ++ goto err1; ++ ++ memcpy(conf, &ipv4_devconf, sizeof(*conf)); ++ conf->sysctl = __devinet_sysctl_register("all", ++ NET_PROTO_CONF_ALL, conf); ++ if (!conf->sysctl) ++ goto err2; ++ ++ conf_def = kmalloc(sizeof(*conf_def), GFP_KERNEL); ++ if (!conf_def) ++ goto err3; ++ ++ memcpy(conf_def, &ipv4_devconf_dflt, sizeof(*conf_def)); ++ conf_def->sysctl = __devinet_sysctl_register("default", ++ NET_PROTO_CONF_DEFAULT, conf_def); ++ if (!conf_def->sysctl) ++ goto err4; ++ ++ err = ip_forward_sysctl_register(ve, conf); ++ if (err) ++ goto err5; ++ ++ ve->_ipv4_devconf = conf; ++ ve->_ipv4_devconf_dflt = conf_def; ++ return 0; ++ ++err5: ++ devinet_sysctl_unregister(conf_def); ++err4: ++ kfree(conf_def); ++err3: ++ devinet_sysctl_unregister(conf); ++err2: ++ kfree(conf); ++err1: ++#endif ++#endif ++ return err; ++} ++ ++void devinet_sysctl_fini(struct ve_struct *ve) ++{ ++#ifdef CONFIG_SYSCTL ++#ifdef CONFIG_VE ++ ip_forward_sysctl_unregister(ve); ++ devinet_sysctl_unregister(ve->_ipv4_devconf); ++ devinet_sysctl_unregister(ve->_ipv4_devconf_dflt); ++#endif ++#endif ++} ++ ++void devinet_sysctl_free(struct ve_struct *ve) ++{ ++#ifdef CONFIG_SYSCTL ++#ifdef CONFIG_VE ++ ip_forward_sysctl_free(ve); ++ kfree(ve->_ipv4_devconf); ++ kfree(ve->_ipv4_devconf_dflt); ++#endif ++#endif ++} ++ + void __init devinet_init(void) + { + register_gifconf(PF_INET, inet_gifconf); +@@ -1566,7 +1754,8 @@ + #ifdef CONFIG_SYSCTL + devinet_sysctl.sysctl_header = + register_sysctl_table(devinet_sysctl.devinet_root_dir); +- devinet_sysctl_register(NULL, &ipv4_devconf_dflt); ++ __devinet_sysctl_register("default", NET_PROTO_CONF_DEFAULT, ++ &ipv4_devconf_dflt); + #endif + } + +@@ -1575,3 +1764,7 @@ + EXPORT_SYMBOL(inetdev_by_index); + EXPORT_SYMBOL(register_inetaddr_notifier); + EXPORT_SYMBOL(unregister_inetaddr_notifier); ++EXPORT_SYMBOL(inet_del_ifa); ++EXPORT_SYMBOL(devinet_sysctl_init); ++EXPORT_SYMBOL(devinet_sysctl_fini); ++EXPORT_SYMBOL(devinet_sysctl_free); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/fib_frontend.c debian/binary-custom.d/openvz/src/net/ipv4/fib_frontend.c +--- ./net/ipv4/fib_frontend.c 2012-06-12 16:25:24.378312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/fib_frontend.c 2012-11-13 15:20:15.636569058 +0000 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -51,13 +52,18 @@ + + static struct sock *fibnl; + ++#ifdef CONFIG_VE ++#define fib_table_hash (get_exec_env()->_fib_table_hash) ++#else ++static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; ++#endif ++ + #ifndef CONFIG_IP_MULTIPLE_TABLES + +-struct fib_table *ip_fib_local_table; +-struct fib_table *ip_fib_main_table; ++struct fib_table *__ip_fib_local_table; ++struct fib_table *__ip_fib_main_table; + + #define FIB_TABLE_HASHSZ 1 +-static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; + + static void __init fib4_rules_init(void) + { +@@ -67,10 +73,10 @@ + hlist_add_head_rcu(&ip_fib_main_table->tb_hlist, &fib_table_hash[0]); + } + #else +- + #define FIB_TABLE_HASHSZ 256 +-static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; ++#endif + ++#ifdef CONFIG_IP_MULTIPLE_TABLES + struct fib_table *fib_new_table(u32 id) + { + struct fib_table *tb; +@@ -217,7 +223,8 @@ + + if (fib_lookup(&fl, &res)) + goto last_resort; +- if (res.type != RTN_UNICAST) ++ if (res.type != RTN_UNICAST && ++ (!(dev->features & NETIF_F_VENET) || res.type != RTN_LOCAL)) + goto e_inval_res; + *spec_dst = FIB_RES_PREFSRC(res); + fib_combine_itag(itag, &res); +@@ -345,7 +352,7 @@ + colon = strchr(devname, ':'); + if (colon) + *colon = 0; +- dev = __dev_get_by_name(&init_net, devname); ++ dev = __dev_get_by_name(get_exec_env()->ve_netns, devname); + if (!dev) + return -ENODEV; + cfg->fc_oif = dev->ifindex; +@@ -418,7 +425,7 @@ + switch (cmd) { + case SIOCADDRT: /* Add a route */ + case SIOCDELRT: /* Delete a route */ +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_VE_NET_ADMIN)) + return -EPERM; + + if (copy_from_user(&rt, arg, sizeof(rt))) +@@ -869,9 +876,6 @@ + struct net_device *dev = ptr; + struct in_device *in_dev = __in_dev_get_rtnl(dev); + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + if (event == NETDEV_UNREGISTER) { + fib_disable_ip(dev, 2); + return NOTIFY_DONE; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/fib_hash.c debian/binary-custom.d/openvz/src/net/ipv4/fib_hash.c +--- ./net/ipv4/fib_hash.c 2012-06-12 16:25:24.382312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/fib_hash.c 2012-11-13 15:20:15.636569058 +0000 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -72,11 +73,6 @@ + * can be cheaper than memory lookup, so that FZ_* macros are used. + */ + +-struct fn_hash { +- struct fn_zone *fn_zones[33]; +- struct fn_zone *fn_zone_list; +-}; +- + static inline u32 fn_hash(__be32 key, struct fn_zone *fz) + { + u32 h = ntohl(key)>>(32 - fz->fz_order); +@@ -635,7 +631,7 @@ + return -ESRCH; + } + +-static int fn_flush_list(struct fn_zone *fz, int idx) ++static int fn_flush_list(struct fn_zone *fz, int idx, int destroy) + { + struct hlist_head *head = &fz->fz_hash[idx]; + struct hlist_node *node, *n; +@@ -650,7 +646,9 @@ + list_for_each_entry_safe(fa, fa_node, &f->fn_alias, fa_list) { + struct fib_info *fi = fa->fa_info; + +- if (fi && (fi->fib_flags&RTNH_F_DEAD)) { ++ if (fi == NULL) ++ continue; ++ if (destroy || (fi->fib_flags&RTNH_F_DEAD)) { + write_lock_bh(&fib_hash_lock); + list_del(&fa->fa_list); + if (list_empty(&f->fn_alias)) { +@@ -672,7 +670,7 @@ + return found; + } + +-static int fn_hash_flush(struct fib_table *tb) ++static int __fn_hash_flush(struct fib_table *tb, int destroy) + { + struct fn_hash *table = (struct fn_hash *) tb->tb_data; + struct fn_zone *fz; +@@ -682,11 +680,85 @@ + int i; + + for (i = fz->fz_divisor - 1; i >= 0; i--) +- found += fn_flush_list(fz, i); ++ found += fn_flush_list(fz, i, destroy); + } + return found; + } + ++static int fn_hash_flush(struct fib_table *tb) ++{ ++ return __fn_hash_flush(tb, 0); ++} ++ ++#ifdef CONFIG_VE ++static void fn_free_zones(struct fib_table *tb) ++{ ++ struct fn_hash *table = (struct fn_hash *) tb->tb_data; ++ struct fn_zone *fz; ++ ++ while ((fz = table->fn_zone_list) != NULL) { ++ table->fn_zone_list = fz->fz_next; ++ fz_hash_free(fz->fz_hash, fz->fz_divisor); ++ kfree(fz); ++ } ++} ++ ++void fib_hash_destroy(struct fib_table *tb) ++{ ++ __fn_hash_flush(tb, 1); ++ fn_free_zones(tb); ++ kfree(tb); ++} ++ ++/* ++ * Initialization of virtualized networking subsystem. ++ */ ++int init_ve_route(struct ve_struct *ve) ++{ ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE(ve->_fib_table_hash); i++) ++ INIT_HLIST_HEAD(&ve->_fib_table_hash[i]); ++ ++#ifdef CONFIG_IP_MULTIPLE_TABLES ++ return fib_rules_create(); ++#else ++ ve->_local_table = fib_hash_init(RT_TABLE_LOCAL); ++ if (!ve->_local_table) ++ return -ENOMEM; ++ ve->_main_table = fib_hash_init(RT_TABLE_MAIN); ++ if (!ve->_main_table) { ++ fib_hash_destroy(ve->_local_table); ++ return -ENOMEM; ++ } ++ ++ hlist_add_head_rcu(&ve->_local_table->tb_hlist, ++ &ve->_fib_table_hash[0]); ++ hlist_add_head_rcu(&ve->_main_table->tb_hlist, ++ &ve->_fib_table_hash[0]); ++ return 0; ++#endif ++} ++ ++void fini_ve_route(struct ve_struct *ve) ++{ ++ unsigned int bytes; ++#ifdef CONFIG_IP_MULTIPLE_TABLES ++ fib_rules_destroy(); ++#else ++ fib_hash_destroy(ve->_local_table); ++ fib_hash_destroy(ve->_main_table); ++#endif ++ bytes = ve->_fib_hash_size * sizeof(struct hlist_head *); ++ fib_hash_free(ve->_fib_info_hash, bytes); ++ fib_hash_free(ve->_fib_info_laddrhash, bytes); ++ ve->_fib_info_hash = ve->_fib_info_laddrhash = NULL; ++} ++ ++EXPORT_SYMBOL(init_ve_route); ++EXPORT_SYMBOL(fini_ve_route); ++#endif ++ + + static inline int + fn_hash_dump_bucket(struct sk_buff *skb, struct netlink_callback *cb, +@@ -776,7 +848,7 @@ + return skb->len; + } + +-#ifdef CONFIG_IP_MULTIPLE_TABLES ++#if defined(CONFIG_IP_MULTIPLE_TABLES) || defined(CONFIG_VE) + struct fib_table * fib_hash_init(u32 id) + #else + struct fib_table * __init fib_hash_init(u32 id) +@@ -786,14 +858,14 @@ + + if (fn_hash_kmem == NULL) + fn_hash_kmem = kmem_cache_create("ip_fib_hash", +- sizeof(struct fib_node), +- 0, SLAB_HWCACHE_ALIGN, ++ sizeof(struct fib_node), 0, ++ SLAB_HWCACHE_ALIGN|SLAB_UBC, + NULL); + + if (fn_alias_kmem == NULL) + fn_alias_kmem = kmem_cache_create("ip_fib_alias", +- sizeof(struct fib_alias), +- 0, SLAB_HWCACHE_ALIGN, ++ sizeof(struct fib_alias), 0, ++ SLAB_HWCACHE_ALIGN|SLAB_UBC, + NULL); + + tb = kmalloc(sizeof(struct fib_table) + sizeof(struct fn_hash), +@@ -1067,13 +1139,28 @@ + .release = seq_release_private, + }; + +-int __init fib_proc_init(void) ++static int fib_proc_net_init(struct net *net) + { +- if (!proc_net_fops_create(&init_net, "route", S_IRUGO, &fib_seq_fops)) ++ if (!proc_net_fops_create(net, "route", S_IRUGO, &fib_seq_fops)) + return -ENOMEM; + return 0; + } + ++static void fib_proc_net_exit(struct net *net) ++{ ++ proc_net_remove(net, "route"); ++} ++ ++static struct pernet_operations fib_proc_net_ops = { ++ .init = fib_proc_net_init, ++ .exit = fib_proc_net_exit, ++}; ++ ++int __init fib_proc_init(void) ++{ ++ return register_pernet_subsys(&fib_proc_net_ops); ++} ++ + void __init fib_proc_exit(void) + { + proc_net_remove(&init_net, "route"); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/fib_lookup.h debian/binary-custom.d/openvz/src/net/ipv4/fib_lookup.h +--- ./net/ipv4/fib_lookup.h 2012-06-12 16:25:24.382312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/fib_lookup.h 2012-11-13 15:20:15.636569058 +0000 +@@ -37,5 +37,6 @@ + extern int fib_detect_death(struct fib_info *fi, int order, + struct fib_info **last_resort, + int *last_idx, int *dflt); ++void fib_hash_free(struct hlist_head *hash, int bytes); + + #endif /* _FIB_LOOKUP_H */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/fib_rules.c debian/binary-custom.d/openvz/src/net/ipv4/fib_rules.c +--- ./net/ipv4/fib_rules.c 2012-06-12 16:25:24.382312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/fib_rules.c 2012-11-13 15:20:15.636569058 +0000 +@@ -49,6 +49,85 @@ + #endif + }; + ++#ifdef CONFIG_VE ++#define local_rule (*(get_exec_env()->_local_rule)) ++#define fib4_rules (get_exec_env()->_fib_rules) ++#else ++#define local_rule loc_rule ++static LIST_HEAD(fib4_rules); ++#endif ++ ++#if defined(CONFIG_VE_CALLS) || defined(CONFIG_VE_CALLS_MODULE) ++#ifdef CONFIG_VE ++static inline void init_rule_struct(struct fib_rule *r, ++ u32 pref, unsigned char table, unsigned char action) ++{ ++ memset(r, 0, sizeof(struct fib_rule)); ++ atomic_set(&r->refcnt, 1); ++ r->pref = pref; ++ r->table = table; ++ r->action = action; ++} ++#endif ++ ++int fib_rules_create(void) ++{ ++#ifdef CONFIG_VE ++ struct fib_rule *default_rule, *main_rule, *loc_rule; ++ ++ default_rule = kmalloc(sizeof(struct fib_rule), GFP_KERNEL_UBC); ++ if (default_rule == NULL) ++ goto out_def; ++ ++ main_rule = kmalloc(sizeof(struct fib_rule), GFP_KERNEL_UBC); ++ if (main_rule == NULL) ++ goto out_main; ++ ++ loc_rule = kmalloc(sizeof(struct fib_rule), GFP_KERNEL_UBC); ++ if (loc_rule == NULL) ++ goto out_loc; ++ ++ init_rule_struct(default_rule, 0x7FFF, RT_TABLE_DEFAULT, RTN_UNICAST); ++ init_rule_struct(main_rule, 0x7FFE, RT_TABLE_MAIN, RTN_UNICAST); ++ init_rule_struct(loc_rule, 0, RT_TABLE_LOCAL, RTN_UNICAST); ++ ++ INIT_LIST_HEAD(&fib4_rules); ++ list_add_tail(&loc_rule->list, &fib4_rules); ++ list_add_tail(&main_rule->list, &fib4_rules); ++ list_add_tail(&default_rule->list, &fib4_rules); ++ get_exec_env()->_local_rule = loc_rule; ++ ++ return 0; ++ ++out_loc: ++ kfree(main_rule); ++out_main: ++ kfree(default_rule); ++out_def: ++ return -1; ++#else ++ return 0; ++#endif ++} ++ ++void fib_rules_destroy(void) ++{ ++#ifdef CONFIG_VE ++ struct fib_rule *r; ++ struct list_head *pos, *tmp; ++ ++ rtnl_lock(); ++ list_for_each_safe (pos, tmp, &fib4_rules) { ++ r = list_entry(pos, struct fib_rule, list); ++ ++ list_del_rcu(pos); ++ fib_rule_put(r); ++ } ++ rtnl_unlock(); ++#endif ++} ++#endif ++ + #ifdef CONFIG_NET_CLS_ROUTE + u32 fib_rules_tclass(struct fib_result *res) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/fib_semantics.c debian/binary-custom.d/openvz/src/net/ipv4/fib_semantics.c +--- ./net/ipv4/fib_semantics.c 2012-06-12 16:25:24.382312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/fib_semantics.c 2012-11-13 15:20:15.636569058 +0000 +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -32,6 +33,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -55,6 +57,24 @@ + static unsigned int fib_hash_size; + static unsigned int fib_info_cnt; + ++void prepare_fib_info(void) ++{ ++#ifdef CONFIG_VE ++ get_ve0()->_fib_info_hash = fib_info_hash; ++ get_ve0()->_fib_info_laddrhash = fib_info_laddrhash; ++ get_ve0()->_fib_hash_size = fib_hash_size; ++ get_ve0()->_fib_info_cnt = fib_info_cnt; ++#endif ++} ++ ++#ifdef CONFIG_VE ++#define fib_info_hash (get_exec_env()->_fib_info_hash) ++#define fib_info_laddrhash (get_exec_env()->_fib_info_laddrhash) ++#define fib_hash_size (get_exec_env()->_fib_hash_size) ++#define fib_info_cnt (get_exec_env()->_fib_info_cnt) ++#endif ++ ++ + #define DEVINDEX_HASHBITS 8 + #define DEVINDEX_HASHSIZE (1U << DEVINDEX_HASHBITS) + static struct hlist_head fib_info_devhash[DEVINDEX_HASHSIZE]; +@@ -234,13 +254,15 @@ + return NULL; + } + +-static inline unsigned int fib_devindex_hashfn(unsigned int val) ++static inline unsigned int fib_devindex_hashfn(unsigned int val, ++ envid_t veid) + { + unsigned int mask = DEVINDEX_HASHSIZE - 1; + + return (val ^ + (val >> DEVINDEX_HASHBITS) ^ +- (val >> (DEVINDEX_HASHBITS * 2))) & mask; ++ (val >> (DEVINDEX_HASHBITS * 2)) ^ ++ (veid ^ (veid >> 16))) & mask; + } + + /* Check, that the gateway is already configured. +@@ -256,7 +278,7 @@ + + spin_lock(&fib_info_lock); + +- hash = fib_devindex_hashfn(dev->ifindex); ++ hash = fib_devindex_hashfn(dev->ifindex, VEID(dev->owner_env)); + head = &fib_info_devhash[hash]; + hlist_for_each_entry(nh, node, head, nh_hash) { + if (nh->nh_dev == dev && +@@ -303,6 +325,7 @@ + int dst_len, u32 tb_id, struct nl_info *info, + unsigned int nlm_flags) + { ++ struct net *net = get_exec_env()->ve_netns; + struct sk_buff *skb; + u32 seq = info->nlh ? info->nlh->nlmsg_seq : 0; + int err = -ENOBUFS; +@@ -320,11 +343,11 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, info->pid, RTNLGRP_IPV4_ROUTE, ++ err = rtnl_notify(skb, net, info->pid, RTNLGRP_IPV4_ROUTE, + info->nlh, GFP_KERNEL); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_IPV4_ROUTE, err); ++ rtnl_set_sk_err(net, RTNLGRP_IPV4_ROUTE, err); + } + + /* Return the first fib alias matching TOS with +@@ -533,7 +556,7 @@ + return -EINVAL; + if (inet_addr_type(nh->nh_gw) != RTN_UNICAST) + return -EINVAL; +- if ((dev = __dev_get_by_index(&init_net, nh->nh_oif)) == NULL) ++ if ((dev = __dev_get_by_index(get_exec_env()->ve_netns, nh->nh_oif)) == NULL) + return -ENODEV; + if (!(dev->flags&IFF_UP)) + return -ENETDOWN; +@@ -611,7 +634,7 @@ + __get_free_pages(GFP_KERNEL, get_order(bytes)); + } + +-static void fib_hash_free(struct hlist_head *hash, int bytes) ++void fib_hash_free(struct hlist_head *hash, int bytes) + { + if (!hash) + return; +@@ -799,7 +822,7 @@ + if (nhs != 1 || nh->nh_gw) + goto err_inval; + nh->nh_scope = RT_SCOPE_NOWHERE; +- nh->nh_dev = dev_get_by_index(&init_net, fi->fib_nh->nh_oif); ++ nh->nh_dev = dev_get_by_index(get_exec_env()->ve_netns, fi->fib_nh->nh_oif); + err = -ENODEV; + if (nh->nh_dev == NULL) + goto failure; +@@ -842,7 +865,8 @@ + + if (!nh->nh_dev) + continue; +- hash = fib_devindex_hashfn(nh->nh_dev->ifindex); ++ hash = fib_devindex_hashfn(nh->nh_dev->ifindex, ++ VEID(nh->nh_dev->owner_env)); + head = &fib_info_devhash[hash]; + hlist_add_head(&nh->nh_hash, head); + } endfor_nexthops(fi) +@@ -1054,7 +1078,8 @@ + + if (dev) { + struct fib_info *prev_fi = NULL; +- unsigned int hash = fib_devindex_hashfn(dev->ifindex); ++ unsigned int hash = fib_devindex_hashfn(dev->ifindex, ++ VEID(dev->owner_env)); + struct hlist_head *head = &fib_info_devhash[hash]; + struct hlist_node *node; + struct fib_nh *nh; +@@ -1119,7 +1144,7 @@ + return 0; + + prev_fi = NULL; +- hash = fib_devindex_hashfn(dev->ifindex); ++ hash = fib_devindex_hashfn(dev->ifindex, VEID(dev->owner_env)); + head = &fib_info_devhash[hash]; + ret = 0; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/icmp.c debian/binary-custom.d/openvz/src/net/ipv4/icmp.c +--- ./net/ipv4/icmp.c 2012-06-12 16:25:24.382312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/icmp.c 2012-11-13 15:20:15.636569058 +0000 +@@ -69,6 +69,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -513,7 +514,7 @@ + struct net_device *dev = NULL; + + if (rt->fl.iif && sysctl_icmp_errors_use_inbound_ifaddr) +- dev = dev_get_by_index(&init_net, rt->fl.iif); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, rt->fl.iif); + + if (dev) { + saddr = inet_select_addr(dev, 0, RT_SCOPE_LINK); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/igmp.c debian/binary-custom.d/openvz/src/net/ipv4/igmp.c +--- ./net/ipv4/igmp.c 2012-06-12 16:25:24.382312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/igmp.c 2012-11-13 15:20:15.636569058 +0000 +@@ -83,6 +83,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -702,22 +703,28 @@ + static void igmp_gq_timer_expire(unsigned long data) + { + struct in_device *in_dev = (struct in_device *)data; ++ struct ve_struct *old_env; + ++ old_env = set_exec_env(in_dev->dev->owner_env); + in_dev->mr_gq_running = 0; + igmpv3_send_report(in_dev, NULL); + __in_dev_put(in_dev); ++ (void)set_exec_env(old_env); + } + + static void igmp_ifc_timer_expire(unsigned long data) + { + struct in_device *in_dev = (struct in_device *)data; ++ struct ve_struct *old_env; + ++ old_env = set_exec_env(in_dev->dev->owner_env); + igmpv3_send_cr(in_dev); + if (in_dev->mr_ifc_count) { + in_dev->mr_ifc_count--; + igmp_ifc_start_timer(in_dev, IGMP_Unsolicited_Report_Interval); + } + __in_dev_put(in_dev); ++ (void)set_exec_env(old_env); + } + + static void igmp_ifc_event(struct in_device *in_dev) +@@ -734,6 +741,7 @@ + { + struct ip_mc_list *im=(struct ip_mc_list *)data; + struct in_device *in_dev = im->interface; ++ struct ve_struct *old_env; + + spin_lock(&im->lock); + im->tm_running=0; +@@ -745,6 +753,7 @@ + im->reporter = 1; + spin_unlock(&im->lock); + ++ old_env = set_exec_env(in_dev->dev->owner_env); + if (IGMP_V1_SEEN(in_dev)) + igmp_send_report(in_dev, im, IGMP_HOST_MEMBERSHIP_REPORT); + else if (IGMP_V2_SEEN(in_dev)) +@@ -753,6 +762,7 @@ + igmp_send_report(in_dev, im, IGMPV3_HOST_MEMBERSHIP_REPORT); + + ip_ma_put(im); ++ (void)set_exec_env(old_env); + } + + /* mark EXCLUDE-mode sources */ +@@ -2291,8 +2301,9 @@ + struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq); + + state->in_dev = NULL; +- for_each_netdev(&init_net, state->dev) { ++ for_each_netdev(get_exec_env()->ve_netns, state->dev) { + struct in_device *in_dev; ++ + in_dev = in_dev_get(state->dev); + if (!in_dev) + continue; +@@ -2438,8 +2449,9 @@ + + state->idev = NULL; + state->im = NULL; +- for_each_netdev(&init_net, state->dev) { ++ for_each_netdev(get_exec_env()->ve_netns, state->dev) { + struct in_device *idev; ++ + idev = in_dev_get(state->dev); + if (unlikely(idev == NULL)) + continue; +@@ -2581,11 +2593,34 @@ + .release = seq_release_private, + }; + +-int __init igmp_mc_proc_init(void) ++static int igmp_net_init(struct net *net) + { +- proc_net_fops_create(&init_net, "igmp", S_IRUGO, &igmp_mc_seq_fops); +- proc_net_fops_create(&init_net, "mcfilter", S_IRUGO, &igmp_mcf_seq_fops); ++ if (!proc_net_fops_create(net, "igmp", S_IRUGO, &igmp_mc_seq_fops)) ++ goto out_igmp; ++ if (!proc_net_fops_create(net, "mcfilter", S_IRUGO, &igmp_mcf_seq_fops)) ++ goto out_mcfilter; + return 0; ++ ++out_mcfilter: ++ proc_net_remove(net, "igmp"); ++out_igmp: ++ return -ENOMEM; ++} ++ ++static void igmp_net_exit(struct net *net) ++{ ++ proc_net_remove(net, "igmp"); ++ proc_net_remove(net, "mcfilter"); ++} ++ ++static struct pernet_operations igmp_net_ops = { ++ .init = igmp_net_init, ++ .exit = igmp_net_exit, ++}; ++ ++int __init igmp_mc_proc_init(void) ++{ ++ return register_pernet_subsys(&igmp_net_ops); + } + #endif + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/inet_connection_sock.c debian/binary-custom.d/openvz/src/net/ipv4/inet_connection_sock.c +--- ./net/ipv4/inet_connection_sock.c 2012-06-12 16:25:24.382312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/inet_connection_sock.c 2012-11-13 15:20:15.640569056 +0000 +@@ -24,6 +24,9 @@ + #include + #include + ++#include ++#include ++ + #ifdef INET_CSK_DEBUG + const char inet_csk_timer_bug_msg[] = "inet_csk BUG: unknown timer value\n"; + EXPORT_SYMBOL(inet_csk_timer_bug_msg); +@@ -58,6 +61,7 @@ + sk_for_each_bound(sk2, node, &tb->owners) { + if (sk != sk2 && + !inet_v6_ipv6only(sk2) && ++ ve_accessible_strict(sk->owner_env, sk2->owner_env) && + (!sk->sk_bound_dev_if || + !sk2->sk_bound_dev_if || + sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) { +@@ -87,7 +91,9 @@ + struct hlist_node *node; + struct inet_bind_bucket *tb; + int ret; ++ struct ve_struct *env; + ++ env = sk->owner_env; + local_bh_disable(); + if (!snum) { + int remaining, rover, low, high; +@@ -97,11 +103,15 @@ + rover = net_random() % remaining + low; + + do { +- head = &hashinfo->bhash[inet_bhashfn(rover, hashinfo->bhash_size)]; ++ head = &hashinfo->bhash[inet_bhashfn(rover, ++ hashinfo->bhash_size, VEID(env))]; + spin_lock(&head->lock); +- inet_bind_bucket_for_each(tb, node, &head->chain) ++ inet_bind_bucket_for_each(tb, node, &head->chain) { ++ if (!ve_accessible_strict(tb->owner_env, env)) ++ continue; + if (tb->port == rover) + goto next; ++ } + break; + next: + spin_unlock(&head->lock); +@@ -124,11 +134,15 @@ + */ + snum = rover; + } else { +- head = &hashinfo->bhash[inet_bhashfn(snum, hashinfo->bhash_size)]; ++ head = &hashinfo->bhash[inet_bhashfn(snum, ++ hashinfo->bhash_size, VEID(env))]; + spin_lock(&head->lock); +- inet_bind_bucket_for_each(tb, node, &head->chain) ++ inet_bind_bucket_for_each(tb, node, &head->chain) { ++ if (!ve_accessible_strict(tb->owner_env, env)) ++ continue; + if (tb->port == snum) + goto tb_found; ++ } + } + tb = NULL; + goto tb_not_found; +@@ -147,7 +161,7 @@ + } + tb_not_found: + ret = 1; +- if (!tb && (tb = inet_bind_bucket_create(hashinfo->bind_bucket_cachep, head, snum)) == NULL) ++ if (!tb && (tb = inet_bind_bucket_create(hashinfo->bind_bucket_cachep, head, snum, env)) == NULL) + goto fail_unlock; + if (hlist_empty(&tb->owners)) { + if (sk->sk_reuse && sk->sk_state != TCP_LISTEN) +@@ -555,7 +569,7 @@ + + sk_refcnt_debug_release(sk); + +- atomic_dec(sk->sk_prot->orphan_count); ++ ub_dec_orphan_count(sk); + sock_put(sk); + } + +@@ -635,7 +649,7 @@ + + sock_orphan(child); + +- atomic_inc(sk->sk_prot->orphan_count); ++ ub_inc_orphan_count(sk); + + inet_csk_destroy_sock(child); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/inet_diag.c debian/binary-custom.d/openvz/src/net/ipv4/inet_diag.c +--- ./net/ipv4/inet_diag.c 2012-06-12 16:25:24.382312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/inet_diag.c 2012-11-13 15:20:15.640569056 +0000 +@@ -711,7 +711,9 @@ + struct inet_diag_req *r = NLMSG_DATA(cb->nlh); + const struct inet_diag_handler *handler; + struct inet_hashinfo *hashinfo; ++ struct ve_struct *ve; + ++ ve = get_exec_env(); + handler = inet_diag_lock_handler(cb->nlh->nlmsg_type); + if (IS_ERR(handler)) + goto unlock; +@@ -734,6 +736,8 @@ + sk_for_each(sk, node, &hashinfo->listening_hash[i]) { + struct inet_sock *inet = inet_sk(sk); + ++ if (!ve_accessible(sk->owner_env, ve)) ++ continue; + if (num < s_num) { + num++; + continue; +@@ -795,6 +799,8 @@ + sk_for_each(sk, node, &head->chain) { + struct inet_sock *inet = inet_sk(sk); + ++ if (!ve_accessible(sk->owner_env, ve)) ++ continue; + if (num < s_num) + goto next_normal; + if (!(r->idiag_states & (1 << sk->sk_state))) +@@ -819,6 +825,8 @@ + inet_twsk_for_each(tw, node, + &head->twchain) { + ++ if (!ve_accessible_veid(tw->tw_owner_env, VEID(ve))) ++ continue; + if (num < s_num) + goto next_dying; + if (r->id.idiag_sport != tw->tw_sport && +@@ -939,7 +947,7 @@ + + static void __exit inet_diag_exit(void) + { +- sock_release(idiagnl->sk_socket); ++ netlink_kernel_release(idiagnl); + kfree(inet_diag_table); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/inet_fragment.c debian/binary-custom.d/openvz/src/net/ipv4/inet_fragment.c +--- ./net/ipv4/inet_fragment.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/inet_fragment.c 2012-11-13 15:20:15.640569056 +0000 +@@ -224,7 +224,9 @@ + setup_timer(&q->timer, f->frag_expire, (unsigned long)q); + spin_lock_init(&q->lock); + atomic_set(&q->refcnt, 1); +- ++#ifdef CONFIG_VE ++ q->owner_ve = get_exec_env(); ++#endif + return q; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/inet_hashtables.c debian/binary-custom.d/openvz/src/net/ipv4/inet_hashtables.c +--- ./net/ipv4/inet_hashtables.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/inet_hashtables.c 2012-11-13 15:20:15.640569056 +0000 +@@ -30,7 +30,8 @@ + */ + struct inet_bind_bucket *inet_bind_bucket_create(struct kmem_cache *cachep, + struct inet_bind_hashbucket *head, +- const unsigned short snum) ++ const unsigned short snum, ++ struct ve_struct *ve) + { + struct inet_bind_bucket *tb = kmem_cache_alloc(cachep, GFP_ATOMIC); + +@@ -38,6 +39,7 @@ + tb->port = snum; + tb->fastreuse = 0; + INIT_HLIST_HEAD(&tb->owners); ++ tb->owner_env = ve; + hlist_add_head(&tb->node, &head->chain); + } + return tb; +@@ -67,10 +69,13 @@ + */ + static void __inet_put_port(struct inet_hashinfo *hashinfo, struct sock *sk) + { +- const int bhash = inet_bhashfn(inet_sk(sk)->num, hashinfo->bhash_size); +- struct inet_bind_hashbucket *head = &hashinfo->bhash[bhash]; ++ int bhash; ++ struct inet_bind_hashbucket *head; + struct inet_bind_bucket *tb; + ++ bhash = inet_bhashfn(inet_sk(sk)->num, hashinfo->bhash_size, ++ VEID(sk->owner_env)); ++ head = &hashinfo->bhash[bhash]; + spin_lock(&head->lock); + tb = inet_csk(sk)->icsk_bind_hash; + __sk_del_bind_node(sk); +@@ -133,10 +138,14 @@ + struct sock *result = NULL, *sk; + const struct hlist_node *node; + int hiscore = -1; ++ struct ve_struct *env; + ++ env = get_exec_env(); + sk_for_each(sk, node, head) { + const struct inet_sock *inet = inet_sk(sk); + ++ if (!ve_accessible_strict(sk->owner_env, env)) ++ continue; + if (inet->num == hnum && !ipv6_only_sock(sk)) { + const __be32 rcv_saddr = inet->rcv_saddr; + int score = sk->sk_family == PF_INET ? 1 : 0; +@@ -169,13 +178,16 @@ + { + struct sock *sk = NULL; + const struct hlist_head *head; ++ struct ve_struct *env; + ++ env = get_exec_env(); + read_lock(&hashinfo->lhash_lock); +- head = &hashinfo->listening_hash[inet_lhashfn(hnum)]; ++ head = &hashinfo->listening_hash[inet_lhashfn(hnum, VEID(env))]; + if (!hlist_empty(head)) { + const struct inet_sock *inet = inet_sk((sk = __sk_head(head))); + + if (inet->num == hnum && !sk->sk_node.next && ++ ve_accessible_strict(sk->owner_env, env) && + (!inet->rcv_saddr || inet->rcv_saddr == daddr) && + (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) && + !sk->sk_bound_dev_if) +@@ -194,7 +206,8 @@ + /* called with local bh disabled */ + static int __inet_check_established(struct inet_timewait_death_row *death_row, + struct sock *sk, __u16 lport, +- struct inet_timewait_sock **twp) ++ struct inet_timewait_sock **twp, ++ struct ve_struct *ve) + { + struct inet_hashinfo *hinfo = death_row->hashinfo; + struct inet_sock *inet = inet_sk(sk); +@@ -203,7 +216,7 @@ + int dif = sk->sk_bound_dev_if; + INET_ADDR_COOKIE(acookie, saddr, daddr) + const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport); +- unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport); ++ unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport, VEID(ve)); + struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); + rwlock_t *lock = inet_ehash_lockp(hinfo, hash); + struct sock *sk2; +@@ -217,7 +230,8 @@ + sk_for_each(sk2, node, &head->twchain) { + tw = inet_twsk(sk2); + +- if (INET_TW_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif)) { ++ if (INET_TW_MATCH(sk2, hash, acookie, saddr, daddr, ++ ports, dif, ve)) { + if (twsk_unique(sk, sk2, twp)) + goto unique; + else +@@ -228,7 +242,8 @@ + + /* And established part... */ + sk_for_each(sk2, node, &head->chain) { +- if (INET_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif)) ++ if (INET_MATCH(sk2, hash, acookie, saddr, daddr, ++ ports, dif, ve)) + goto not_unique; + } + +@@ -279,7 +294,9 @@ + struct inet_bind_hashbucket *head; + struct inet_bind_bucket *tb; + int ret; ++ struct ve_struct *ve; + ++ ve = sk->owner_env; + if (!snum) { + int i, remaining, low, high, port; + static u32 hint; +@@ -293,7 +310,7 @@ + local_bh_disable(); + for (i = 1; i <= remaining; i++) { + port = low + (i + offset) % remaining; +- head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size)]; ++ head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size, VEID(ve))]; + spin_lock(&head->lock); + + /* Does not bother with rcv_saddr checks, +@@ -301,19 +318,21 @@ + * unique enough. + */ + inet_bind_bucket_for_each(tb, node, &head->chain) { +- if (tb->port == port) { ++ if (tb->port == port && ++ ve_accessible_strict(tb->owner_env, ve)) { + BUG_TRAP(!hlist_empty(&tb->owners)); + if (tb->fastreuse >= 0) + goto next_port; + if (!__inet_check_established(death_row, + sk, port, +- &tw)) ++ &tw, ve)) + goto ok; + goto next_port; + } + } + +- tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep, head, port); ++ tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep, ++ head, port, ve); + if (!tb) { + spin_unlock(&head->lock); + break; +@@ -321,7 +340,7 @@ + tb->fastreuse = -1; + goto ok; + +- next_port: ++ next_port: + spin_unlock(&head->lock); + } + local_bh_enable(); +@@ -348,7 +367,7 @@ + goto out; + } + +- head = &hinfo->bhash[inet_bhashfn(snum, hinfo->bhash_size)]; ++ head = &hinfo->bhash[inet_bhashfn(snum, hinfo->bhash_size, VEID(ve))]; + tb = inet_csk(sk)->icsk_bind_hash; + spin_lock_bh(&head->lock); + if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { +@@ -358,7 +377,7 @@ + } else { + spin_unlock(&head->lock); + /* No definite answer... Walk to established hash table */ +- ret = __inet_check_established(death_row, sk, snum, NULL); ++ ret = __inet_check_established(death_row, sk, snum, NULL, ve); + out: + local_bh_enable(); + return ret; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/inet_timewait_sock.c debian/binary-custom.d/openvz/src/net/ipv4/inet_timewait_sock.c +--- ./net/ipv4/inet_timewait_sock.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/inet_timewait_sock.c 2012-11-13 15:20:15.640569056 +0000 +@@ -13,6 +13,8 @@ + #include + #include + ++#include ++ + /* Must be called with locally disabled BHs. */ + static void __inet_twsk_kill(struct inet_timewait_sock *tw, + struct inet_hashinfo *hashinfo) +@@ -32,7 +34,8 @@ + write_unlock(lock); + + /* Disassociate with bind bucket. */ +- bhead = &hashinfo->bhash[inet_bhashfn(tw->tw_num, hashinfo->bhash_size)]; ++ bhead = &hashinfo->bhash[inet_bhashfn(tw->tw_num, ++ hashinfo->bhash_size, tw->tw_owner_env)]; + spin_lock(&bhead->lock); + tb = tw->tw_tb; + __hlist_del(&tw->tw_bind_node); +@@ -65,7 +68,8 @@ + Note, that any socket with inet->num != 0 MUST be bound in + binding cache, even if it is closed. + */ +- bhead = &hashinfo->bhash[inet_bhashfn(inet->num, hashinfo->bhash_size)]; ++ bhead = &hashinfo->bhash[inet_bhashfn(inet->num, ++ hashinfo->bhash_size, tw->tw_owner_env)]; + spin_lock(&bhead->lock); + tw->tw_tb = icsk->icsk_bind_hash; + BUG_TRAP(icsk->icsk_bind_hash); +@@ -89,9 +93,14 @@ + + struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int state) + { +- struct inet_timewait_sock *tw = +- kmem_cache_alloc(sk->sk_prot_creator->twsk_prot->twsk_slab, +- GFP_ATOMIC); ++ struct user_beancounter *ub; ++ struct inet_timewait_sock *tw; ++ ++ ub = set_exec_ub(sock_bc(sk)->ub); ++ tw = kmem_cache_alloc(sk->sk_prot_creator->twsk_prot->twsk_slab, ++ GFP_ATOMIC); ++ (void)set_exec_ub(ub); ++ + if (tw != NULL) { + const struct inet_sock *inet = inet_sk(sk); + +@@ -139,6 +148,7 @@ + rescan: + inet_twsk_for_each_inmate(tw, node, &twdr->cells[slot]) { + __inet_twsk_del_dead_node(tw); ++ ub_timewait_dec(tw, twdr); + spin_unlock(&twdr->death_lock); + __inet_twsk_kill(tw, twdr->hashinfo); + inet_twsk_put(tw); +@@ -237,6 +247,7 @@ + { + spin_lock(&twdr->death_lock); + if (inet_twsk_del_dead_node(tw)) { ++ ub_timewait_dec(tw, twdr); + inet_twsk_put(tw); + if (--twdr->tw_count == 0) + del_timer(&twdr->tw_timer); +@@ -283,9 +294,10 @@ + spin_lock(&twdr->death_lock); + + /* Unlink it, if it was scheduled */ +- if (inet_twsk_del_dead_node(tw)) ++ if (inet_twsk_del_dead_node(tw)) { ++ ub_timewait_dec(tw, twdr); + twdr->tw_count--; +- else ++ } else + atomic_inc(&tw->tw_refcnt); + + if (slot >= INET_TWDR_RECYCLE_SLOTS) { +@@ -321,6 +333,7 @@ + + hlist_add_head(&tw->tw_death_node, list); + ++ ub_timewait_inc(tw, twdr); + if (twdr->tw_count++ == 0) + mod_timer(&twdr->tw_timer, jiffies + twdr->period); + spin_unlock(&twdr->death_lock); +@@ -355,6 +368,7 @@ + &twdr->twcal_row[slot]) { + __inet_twsk_del_dead_node(tw); + __inet_twsk_kill(tw, twdr->hashinfo); ++ ub_timewait_dec(tw, twdr); + inet_twsk_put(tw); + killed++; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ip_forward.c debian/binary-custom.d/openvz/src/net/ipv4/ip_forward.c +--- ./net/ipv4/ip_forward.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ip_forward.c 2012-11-13 15:20:15.640569056 +0000 +@@ -93,6 +93,24 @@ + goto drop; + } + ++ /* ++ * We try to optimize forwarding of VE packets: ++ * do not decrement TTL (and so save skb_cow) ++ * during forwarding of outgoing pkts from VE. ++ * For incoming pkts we still do ttl decr, ++ * since such skb is not cloned and does not require ++ * actual cow. So, there is at least one place ++ * in pkts path with mandatory ttl decr, that is ++ * sufficient to prevent routing loops. ++ */ ++ iph = ip_hdr(skb); ++ if ( ++#ifdef CONFIG_IP_ROUTE_NAT ++ (rt->rt_flags & RTCF_NAT) == 0 && /* no NAT mangling expected */ ++#endif /* and */ ++ (skb->dev->features & NETIF_F_VENET)) /* src is VENET device */ ++ goto no_ttl_decr; ++ + /* We are about to mangle packet. Copy it! */ + if (skb_cow(skb, LL_RESERVED_SPACE(rt->u.dst.dev)+rt->u.dst.header_len)) + goto drop; +@@ -101,6 +119,8 @@ + /* Decrease ttl after skb cow done */ + ip_decrease_ttl(iph); + ++no_ttl_decr: ++ + /* + * We now generate an ICMP HOST REDIRECT giving the route + * we calculated. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ip_fragment.c debian/binary-custom.d/openvz/src/net/ipv4/ip_fragment.c +--- ./net/ipv4/ip_fragment.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ip_fragment.c 2012-11-13 15:20:15.640569056 +0000 +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -138,7 +139,8 @@ + qp->saddr == arg->iph->saddr && + qp->daddr == arg->iph->daddr && + qp->protocol == arg->iph->protocol && +- qp->user == arg->user); ++ qp->user == arg->user && ++ q->owner_ve == get_exec_env()); + } + + /* Memory Tracking Functions. */ +@@ -206,9 +208,12 @@ + */ + static void ip_expire(unsigned long arg) + { ++ struct inet_frag_queue *q = (struct inet_frag_queue *)arg; + struct ipq *qp; ++ struct ve_struct *old_ve; + +- qp = container_of((struct inet_frag_queue *) arg, struct ipq, q); ++ qp = container_of(q, struct ipq, q); ++ old_ve = set_exec_env(q->owner_ve); + + spin_lock(&qp->q.lock); + +@@ -223,7 +228,7 @@ + if ((qp->q.last_in&FIRST_IN) && qp->q.fragments != NULL) { + struct sk_buff *head = qp->q.fragments; + /* Send an ICMP "Fragment Reassembly Timeout" message. */ +- if ((head->dev = dev_get_by_index(&init_net, qp->iif)) != NULL) { ++ if ((head->dev = dev_get_by_index(get_exec_env()->ve_netns, qp->iif)) != NULL) { + icmp_send(head, ICMP_TIME_EXCEEDED, ICMP_EXC_FRAGTIME, 0); + dev_put(head->dev); + } +@@ -231,6 +236,8 @@ + out: + spin_unlock(&qp->q.lock); + ipq_put(qp); ++ ++ (void)set_exec_env(old_ve); + } + + /* Find the correct entry in the "incomplete datagrams" queue for +@@ -535,6 +542,7 @@ + clone->csum = 0; + clone->ip_summed = head->ip_summed; + atomic_add(clone->truesize, &ip4_frags.mem); ++ clone->owner_env = head->owner_env; + } + + skb_shinfo(head)->frag_list = head->next; +@@ -607,6 +615,49 @@ + return -ENOMEM; + } + ++#ifdef CONFIG_VE ++/* XXX */ ++void ip_fragment_cleanup(struct ve_struct *ve) ++{ ++ int i, progress; ++ ++ /* All operations with fragment queues are performed from NET_RX/TX ++ * soft interrupts or from timer context. --Den */ ++ local_bh_disable(); ++ do { ++ progress = 0; ++ for (i = 0; i < INETFRAGS_HASHSZ; i++) { ++ struct ipq *qp; ++ struct hlist_node *p, *n; ++ ++ if (hlist_empty(&ip4_frags.hash[i])) ++ continue; ++inner_restart: ++ read_lock(&ip4_frags.lock); ++ hlist_for_each_entry_safe(qp, p, n, ++ &ip4_frags.hash[i], q.list) { ++ if (!ve_accessible_strict(qp->q.owner_ve, ve)) ++ continue; ++ atomic_inc(&qp->q.refcnt); ++ read_unlock(&ip4_frags.lock); ++ ++ spin_lock(&qp->q.lock); ++ if (!(qp->q.last_in & COMPLETE)) ++ ipq_kill(qp); ++ spin_unlock(&qp->q.lock); ++ ++ ipq_put(qp); ++ progress = 1; ++ goto inner_restart; ++ } ++ read_unlock(&ip4_frags.lock); ++ } ++ } while (progress); ++ local_bh_enable(); ++} ++EXPORT_SYMBOL(ip_fragment_cleanup); ++#endif ++ + void __init ipfrag_init(void) + { + ip4_frags.ctl = &ip4_frags_ctl; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ip_gre.c debian/binary-custom.d/openvz/src/net/ipv4/ip_gre.c +--- ./net/ipv4/ip_gre.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ip_gre.c 2012-11-13 15:20:15.640569056 +0000 +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -262,7 +263,7 @@ + int i; + for (i=1; i<100; i++) { + sprintf(name, "gre%d", i); +- if (__dev_get_by_name(&init_net, name) == NULL) ++ if (__dev_get_by_name(get_exec_env()->ve_netns, name) == NULL) + break; + } + if (i==100) +@@ -1210,7 +1211,7 @@ + } + + if (!tdev && tunnel->parms.link) +- tdev = __dev_get_by_index(&init_net, tunnel->parms.link); ++ tdev = __dev_get_by_index(get_exec_env()->ve_netns, tunnel->parms.link); + + if (tdev) { + hlen = tdev->hard_header_len; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ip_input.c debian/binary-custom.d/openvz/src/net/ipv4/ip_input.c +--- ./net/ipv4/ip_input.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ip_input.c 2012-11-13 15:20:15.640569056 +0000 +@@ -197,6 +197,8 @@ + + static int ip_local_deliver_finish(struct sk_buff *skb) + { ++ if (skb->destructor) ++ skb_orphan(skb); + __skb_pull(skb, ip_hdrlen(skb)); + + /* Point into the IP datagram, just past the header. */ +@@ -380,9 +382,6 @@ + struct iphdr *iph; + u32 len; + +- if (dev->nd_net != &init_net) +- goto drop; +- + /* When the interface is in promisc. mode, drop all the crap + * that it receives, do not try to analyse it. + */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ip_output.c debian/binary-custom.d/openvz/src/net/ipv4/ip_output.c +--- ./net/ipv4/ip_output.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ip_output.c 2012-11-13 15:20:15.640569056 +0000 +@@ -1344,12 +1344,13 @@ + char data[40]; + } replyopts; + struct ipcm_cookie ipc; +- __be32 daddr; ++ __be32 saddr, daddr; + struct rtable *rt = (struct rtable*)skb->dst; + + if (ip_options_echo(&replyopts.opt, skb)) + return; + ++ saddr = ip_hdr(skb)->daddr; + daddr = ipc.addr = rt->rt_src; + ipc.opt = NULL; + +@@ -1364,7 +1365,7 @@ + struct flowi fl = { .oif = arg->bound_dev_if, + .nl_u = { .ip4_u = + { .daddr = daddr, +- .saddr = rt->rt_spec_dst, ++ .saddr = saddr, + .tos = RT_TOS(ip_hdr(skb)->tos) } }, + /* Not quite clean, but right. */ + .uli_u = { .ports = +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ip_sockglue.c debian/binary-custom.d/openvz/src/net/ipv4/ip_sockglue.c +--- ./net/ipv4/ip_sockglue.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ip_sockglue.c 2012-11-13 15:20:15.640569056 +0000 +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -595,7 +596,7 @@ + dev_put(dev); + } + } else +- dev = __dev_get_by_index(&init_net, mreq.imr_ifindex); ++ dev = __dev_get_by_index(get_exec_env()->ve_netns, mreq.imr_ifindex); + + + err = -EADDRNOTAVAIL; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ipconfig.c debian/binary-custom.d/openvz/src/net/ipv4/ipconfig.c +--- ./net/ipv4/ipconfig.c 2012-06-12 16:25:24.386312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ipconfig.c 2012-11-13 15:20:15.644569055 +0000 +@@ -185,19 +185,20 @@ + struct ic_device *d, **last; + struct net_device *dev; + unsigned short oflags; ++ struct net *net = get_exec_env()->ve_netns; + + last = &ic_first_dev; + rtnl_lock(); + + /* bring loopback device up first */ +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(net, dev) { + if (!(dev->flags & IFF_LOOPBACK)) + continue; + if (dev_change_flags(dev, dev->flags | IFF_UP) < 0) + printk(KERN_ERR "IP-Config: Failed to open %s\n", dev->name); + } + +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(net, dev) { + if (dev->flags & IFF_LOOPBACK) + continue; + if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) : +@@ -430,9 +431,6 @@ + unsigned char *sha, *tha; /* s for "source", t for "target" */ + struct ic_device *d; + +- if (dev->nd_net != &init_net) +- goto drop; +- + if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) + return NET_RX_DROP; + +@@ -842,9 +840,6 @@ + struct ic_device *d; + int len, ext_len; + +- if (dev->nd_net != &init_net) +- goto drop; +- + /* Perform verifications before taking the lock. */ + if (skb->pkt_type == PACKET_OTHERHOST) + goto drop; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ipip.c debian/binary-custom.d/openvz/src/net/ipv4/ipip.c +--- ./net/ipv4/ipip.c 2012-06-12 16:25:24.390312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ipip.c 2012-11-13 15:20:15.644569055 +0000 +@@ -100,6 +100,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -225,7 +226,7 @@ + int i; + for (i=1; i<100; i++) { + sprintf(name, "tunl%d", i); +- if (__dev_get_by_name(&init_net, name) == NULL) ++ if (__dev_get_by_name(get_exec_env()->ve_netns, name) == NULL) + break; + } + if (i==100) +@@ -820,7 +821,7 @@ + } + + if (!tdev && tunnel->parms.link) +- tdev = __dev_get_by_index(&init_net, tunnel->parms.link); ++ tdev = __dev_get_by_index(get_exec_env()->ve_netns, tunnel->parms.link); + + if (tdev) { + dev->hard_header_len = tdev->hard_header_len + sizeof(struct iphdr); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ipmr.c debian/binary-custom.d/openvz/src/net/ipv4/ipmr.c +--- ./net/ipv4/ipmr.c 2012-06-12 16:25:24.390312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ipmr.c 2012-11-13 15:20:15.644569055 +0000 +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -123,9 +124,10 @@ + static + struct net_device *ipmr_new_tunnel(struct vifctl *v) + { ++ struct net *net = get_exec_env()->ve_netns; + struct net_device *dev; + +- dev = __dev_get_by_name(&init_net, "tunl0"); ++ dev = __dev_get_by_name(net, "tunl0"); + + if (dev) { + int err; +@@ -149,7 +151,7 @@ + + dev = NULL; + +- if (err == 0 && (dev = __dev_get_by_name(&init_net, p.name)) != NULL) { ++ if (err == 0 && (dev = __dev_get_by_name(net, p.name)) != NULL) { + dev->flags |= IFF_MULTICAST; + + in_dev = __in_dev_get_rtnl(dev); +@@ -321,7 +323,7 @@ + e->error = -ETIMEDOUT; + memset(&e->msg, 0, sizeof(e->msg)); + +- rtnl_unicast(skb, NETLINK_CB(skb).pid); ++ rtnl_unicast(skb, &init_net, NETLINK_CB(skb).pid); + } else + kfree_skb(skb); + } +@@ -533,7 +535,7 @@ + memset(&e->msg, 0, sizeof(e->msg)); + } + +- rtnl_unicast(skb, NETLINK_CB(skb).pid); ++ rtnl_unicast(skb, &init_net, NETLINK_CB(skb).pid); + } else + ip_mr_forward(skb, c, 0); + } +@@ -1087,9 +1089,6 @@ + struct vif_device *v; + int ct; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + if (event != NETDEV_UNREGISTER) + return NOTIFY_DONE; + v=&vif_table[0]; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ipvs/ip_vs_conn.c debian/binary-custom.d/openvz/src/net/ipv4/ipvs/ip_vs_conn.c +--- ./net/ipv4/ipvs/ip_vs_conn.c 2012-06-12 16:25:24.390312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ipvs/ip_vs_conn.c 2012-11-13 15:20:15.648569056 +0000 +@@ -920,7 +920,7 @@ + /* Allocate ip_vs_conn slab cache */ + ip_vs_conn_cachep = kmem_cache_create("ip_vs_conn", + sizeof(struct ip_vs_conn), 0, +- SLAB_HWCACHE_ALIGN, NULL); ++ SLAB_HWCACHE_ALIGN|SLAB_UBC, NULL); + if (!ip_vs_conn_cachep) { + vfree(ip_vs_conn_tab); + return -ENOMEM; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ipvs/ip_vs_core.c debian/binary-custom.d/openvz/src/net/ipv4/ipvs/ip_vs_core.c +--- ./net/ipv4/ipvs/ip_vs_core.c 2012-06-12 16:25:24.390312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ipvs/ip_vs_core.c 2012-11-13 15:20:15.648569056 +0000 +@@ -909,6 +909,10 @@ + * Big tappo: only PACKET_HOST (neither loopback nor mcasts) + * ... don't know why 1st test DOES NOT include 2nd (?) + */ ++ /* ++ * VZ: the question above is right. ++ * The second test is superfluous. ++ */ + if (unlikely(skb->pkt_type != PACKET_HOST + || skb->dev->flags & IFF_LOOPBACK || skb->sk)) { + IP_VS_DBG(12, "packet type=%d proto=%d daddr=%d.%d.%d.%d ignored\n", +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/ipvs/ip_vs_sync.c debian/binary-custom.d/openvz/src/net/ipv4/ipvs/ip_vs_sync.c +--- ./net/ipv4/ipvs/ip_vs_sync.c 2012-06-12 16:25:24.398312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/ipvs/ip_vs_sync.c 2012-11-13 15:20:15.656569059 +0000 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -404,7 +405,7 @@ + struct net_device *dev; + struct inet_sock *inet = inet_sk(sk); + +- if ((dev = __dev_get_by_name(&init_net, ifname)) == NULL) ++ if ((dev = __dev_get_by_name(get_exec_env()->ve_netns, ifname)) == NULL) + return -ENODEV; + + if (sk->sk_bound_dev_if && dev->ifindex != sk->sk_bound_dev_if) +@@ -425,11 +426,12 @@ + */ + static int set_sync_mesg_maxlen(int sync_state) + { ++ struct net *net = get_exec_env()->ve_netns; + struct net_device *dev; + int num; + + if (sync_state == IP_VS_STATE_MASTER) { +- if ((dev = __dev_get_by_name(&init_net, ip_vs_master_mcast_ifn)) == NULL) ++ if ((dev = __dev_get_by_name(net, ip_vs_master_mcast_ifn)) == NULL) + return -ENODEV; + + num = (dev->mtu - sizeof(struct iphdr) - +@@ -440,7 +442,7 @@ + IP_VS_DBG(7, "setting the maximum length of sync sending " + "message %d.\n", sync_send_mesg_maxlen); + } else if (sync_state == IP_VS_STATE_BACKUP) { +- if ((dev = __dev_get_by_name(&init_net, ip_vs_backup_mcast_ifn)) == NULL) ++ if ((dev = __dev_get_by_name(net, ip_vs_backup_mcast_ifn)) == NULL) + return -ENODEV; + + sync_recv_mesg_maxlen = dev->mtu - +@@ -468,7 +470,7 @@ + memset(&mreq, 0, sizeof(mreq)); + memcpy(&mreq.imr_multiaddr, addr, sizeof(struct in_addr)); + +- if ((dev = __dev_get_by_name(&init_net, ifname)) == NULL) ++ if ((dev = __dev_get_by_name(get_exec_env()->ve_netns, ifname)) == NULL) + return -ENODEV; + if (sk->sk_bound_dev_if && dev->ifindex != sk->sk_bound_dev_if) + return -EINVAL; +@@ -489,7 +491,7 @@ + __be32 addr; + struct sockaddr_in sin; + +- if ((dev = __dev_get_by_name(&init_net, ifname)) == NULL) ++ if ((dev = __dev_get_by_name(get_exec_env()->ve_netns, ifname)) == NULL) + return -ENODEV; + + addr = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ip_queue.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ip_queue.c +--- ./net/ipv4/netfilter/ip_queue.c 2012-06-12 16:25:24.398312483 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ip_queue.c 2012-11-13 15:20:15.660569059 +0000 +@@ -502,7 +502,7 @@ + if (type <= IPQM_BASE) + return; + +- if (security_netlink_recv(skb, CAP_NET_ADMIN)) ++ if (security_netlink_recv(skb, CAP_VE_NET_ADMIN)) + RCV_SKB_FAIL(-EPERM); + + write_lock_bh(&queue_lock); +@@ -532,8 +532,12 @@ + static void + ipq_rcv_skb(struct sk_buff *skb) + { ++ struct ve_struct *old_ve; ++ + mutex_lock(&ipqnl_mutex); ++ old_ve = set_exec_env(skb->owner_env); + __ipq_rcv_skb(skb); ++ (void)set_exec_env(old_ve); + mutex_unlock(&ipqnl_mutex); + } + +@@ -543,9 +547,6 @@ + { + struct net_device *dev = ptr; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + /* Drop any packets associated with the downed device */ + if (event == NETDEV_DOWN) + ipq_dev_drop(dev->ifindex); +@@ -565,7 +566,7 @@ + if (event == NETLINK_URELEASE && + n->protocol == NETLINK_FIREWALL && n->pid) { + write_lock_bh(&queue_lock); +- if ((n->net == &init_net) && (n->pid == peer_pid)) ++ if (n->pid == peer_pid) + __ipq_reset(); + write_unlock_bh(&queue_lock); + } +@@ -689,7 +690,7 @@ + unregister_netdevice_notifier(&ipq_dev_notifier); + proc_net_remove(&init_net, IPQ_PROC_FS_NAME); + cleanup_ipqnl: +- sock_release(ipqnl->sk_socket); ++ netlink_kernel_release(ipqnl); + mutex_lock(&ipqnl_mutex); + mutex_unlock(&ipqnl_mutex); + +@@ -708,7 +709,7 @@ + unregister_netdevice_notifier(&ipq_dev_notifier); + proc_net_remove(&init_net, IPQ_PROC_FS_NAME); + +- sock_release(ipqnl->sk_socket); ++ netlink_kernel_release(ipqnl); + mutex_lock(&ipqnl_mutex); + mutex_unlock(&ipqnl_mutex); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ip_tables.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ip_tables.c +--- ./net/ipv4/netfilter/ip_tables.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ip_tables.c 2012-11-13 15:20:15.660569059 +0000 +@@ -23,9 +23,11 @@ + #include + #include + #include ++#include + + #include + #include ++#include + + MODULE_LICENSE("GPL"); + MODULE_AUTHOR("Netfilter Core Team "); +@@ -482,8 +484,8 @@ + int visited = e->comefrom & (1 << hook); + + if (e->comefrom & (1 << NF_IP_NUMHOOKS)) { +- printk("iptables: loop hook %u pos %u %08X.\n", +- hook, pos, e->comefrom); ++ ve_printk(VE_LOG, "iptables: loop hook %u pos " ++ "%u %08X.\n", hook, pos, e->comefrom); + return 0; + } + e->comefrom +@@ -925,7 +927,7 @@ + (other than comefrom, which userspace doesn't care + about). */ + countersize = sizeof(struct xt_counters) * private->number; +- counters = vmalloc_node(countersize, numa_node_id()); ++ counters = ub_vmalloc_node(countersize, numa_node_id()); + + if (counters == NULL) + return ERR_PTR(-ENOMEM); +@@ -1254,7 +1256,7 @@ + void *loc_cpu_old_entry; + + ret = 0; +- counters = vmalloc(num_counters * sizeof(struct xt_counters)); ++ counters = ub_vmalloc_best(num_counters * sizeof(struct xt_counters)); + if (!counters) { + ret = -ENOMEM; + goto out; +@@ -1434,7 +1436,7 @@ + if (len != size + num_counters * sizeof(struct xt_counters)) + return -EINVAL; + +- paddc = vmalloc_node(len - size, numa_node_id()); ++ paddc = ub_vmalloc_node(len - size, numa_node_id()); + if (!paddc) + return -ENOMEM; + +@@ -1779,18 +1781,18 @@ + } + + /* Check hooks all assigned */ +- for (i = 0; i < NF_IP_NUMHOOKS; i++) { ++ for (j = 0; j < NF_IP_NUMHOOKS; j++) { + /* Only hooks which are valid */ +- if (!(valid_hooks & (1 << i))) ++ if (!(valid_hooks & (1 << j))) + continue; +- if (info->hook_entry[i] == 0xFFFFFFFF) { ++ if (info->hook_entry[j] == 0xFFFFFFFF) { + duprintf("Invalid hook entry %u %u\n", +- i, hook_entries[i]); ++ j, hook_entries[j]); + goto out_unlock; + } +- if (info->underflow[i] == 0xFFFFFFFF) { ++ if (info->underflow[j] == 0xFFFFFFFF) { + duprintf("Invalid underflow %u %u\n", +- i, underflows[i]); ++ j, underflows[j]); + goto out_unlock; + } + } +@@ -1801,9 +1803,9 @@ + goto out_unlock; + + newinfo->number = number; +- for (i = 0; i < NF_IP_NUMHOOKS; i++) { +- newinfo->hook_entry[i] = info->hook_entry[i]; +- newinfo->underflow[i] = info->underflow[i]; ++ for (j = 0; j < NF_IP_NUMHOOKS; j++) { ++ newinfo->hook_entry[j] = info->hook_entry[j]; ++ newinfo->underflow[j] = info->underflow[j]; + } + entry1 = newinfo->entries[raw_smp_processor_id()]; + pos = entry1; +@@ -1910,15 +1912,22 @@ + return ret; + } + ++static int do_ipt_set_ctl(struct sock *, int, void __user *, unsigned int); ++ + static int + compat_do_ipt_set_ctl(struct sock *sk, int cmd, void __user *user, + unsigned int len) + { + int ret; + +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) + return -EPERM; + ++#ifdef CONFIG_VE_IPTABLES ++ if (!get_exec_env()->_xt_tables[AF_INET].next) ++ return -ENOENT; ++#endif ++ + switch (cmd) { + case IPT_SO_SET_REPLACE: + ret = compat_do_replace(user, len); +@@ -1929,8 +1938,7 @@ + break; + + default: +- duprintf("do_ipt_set_ctl: unknown request %i\n", cmd); +- ret = -EINVAL; ++ ret = do_ipt_set_ctl(sk, cmd, user, len); + } + + return ret; +@@ -2031,9 +2039,14 @@ + { + int ret; + +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) + return -EPERM; + ++#ifdef CONFIG_VE_IPTABLES ++ if (!get_exec_env()->_xt_tables[AF_INET].next) ++ return -ENOENT; ++#endif ++ + switch (cmd) { + case IPT_SO_GET_INFO: + ret = get_info(user, len, 1); +@@ -2053,9 +2066,14 @@ + { + int ret; + +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) + return -EPERM; + ++#ifdef CONFIG_VE_IPTABLES ++ if (!get_exec_env()->_xt_tables[AF_INET].next) ++ return -ENOENT; ++#endif ++ + switch (cmd) { + case IPT_SO_SET_REPLACE: + ret = do_replace(user, len); +@@ -2078,9 +2096,14 @@ + { + int ret; + +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) + return -EPERM; + ++#ifdef CONFIG_VE_IPTABLES ++ if (!get_exec_env()->_xt_tables[AF_INET].next) ++ return -ENOENT; ++#endif ++ + switch (cmd) { + case IPT_SO_GET_INFO: + ret = get_info(user, len, 0); +@@ -2125,17 +2148,18 @@ + return ret; + } + +-int ipt_register_table(struct xt_table *table, const struct ipt_replace *repl) ++struct xt_table *ipt_register_table(struct xt_table *table, ++ const struct ipt_replace *repl) + { + int ret; + struct xt_table_info *newinfo; + static struct xt_table_info bootstrap +- = { 0, 0, 0, { 0 }, { 0 }, { } }; ++ = { 0, 0, 0, 0, { 0 }, { 0 }, { } }; + void *loc_cpu_entry; + + newinfo = xt_alloc_table_info(repl->size); + if (!newinfo) +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + + /* choose the copy on our node/cpu + * but dont care of preemption +@@ -2150,28 +2174,30 @@ + repl->underflow); + if (ret != 0) { + xt_free_table_info(newinfo); +- return ret; ++ return ERR_PTR(ret); + } + +- ret = xt_register_table(table, &bootstrap, newinfo); +- if (ret != 0) { ++ table = virt_xt_register_table(table, &bootstrap, newinfo); ++ if (IS_ERR(table)) + xt_free_table_info(newinfo); +- return ret; +- } + +- return 0; ++ return table; + } + + void ipt_unregister_table(struct xt_table *table) + { + struct xt_table_info *private; + void *loc_cpu_entry; ++ struct module *me; + +- private = xt_unregister_table(table); ++ me = table->me; ++ private = virt_xt_unregister_table(table); + + /* Decrease module usage counts and free resources */ + loc_cpu_entry = private->entries[raw_smp_processor_id()]; + IPT_ENTRY_ITERATE(loc_cpu_entry, private->size, cleanup_entry, NULL); ++ if (private->number > private->initial_entries) ++ module_put(me); + xt_free_table_info(private); + } + +@@ -2278,12 +2304,30 @@ + .checkentry = icmp_checkentry, + }; + ++static int init_iptables(void) ++{ ++#ifdef CONFIG_VE_IPTABLES ++ if (get_exec_env()->_xt_tables[AF_INET].next != NULL) ++ return -EEXIST; ++#endif ++ ++ return xt_proto_init(AF_INET); ++} ++ ++static void fini_iptables(void) ++{ ++#ifdef CONFIG_VE_IPTABLES ++ get_exec_env()->_xt_tables[AF_INET].next = NULL; ++#endif ++ xt_proto_fini(AF_INET); ++} ++ + static int __init ip_tables_init(void) + { + int ret; + +- ret = xt_proto_init(AF_INET); +- if (ret < 0) ++ ret = init_iptables(); ++ if (ret) + goto err1; + + /* Noone else will be downing sem now, so we won't sleep */ +@@ -2302,6 +2346,10 @@ + if (ret < 0) + goto err5; + ++ KSYMRESOLVE(init_iptables); ++ KSYMRESOLVE(fini_iptables); ++ KSYMMODRESOLVE(ip_tables); ++ + printk(KERN_INFO "ip_tables: (C) 2000-2006 Netfilter Core Team\n"); + return 0; + +@@ -2312,24 +2360,25 @@ + err3: + xt_unregister_target(&ipt_standard_target); + err2: +- xt_proto_fini(AF_INET); ++ fini_iptables(); + err1: + return ret; + } + + static void __exit ip_tables_fini(void) + { ++ KSYMMODUNRESOLVE(ip_tables); ++ KSYMUNRESOLVE(init_iptables); ++ KSYMUNRESOLVE(fini_iptables); + nf_unregister_sockopt(&ipt_sockopts); +- + xt_unregister_match(&icmp_matchstruct); + xt_unregister_target(&ipt_error_target); + xt_unregister_target(&ipt_standard_target); +- +- xt_proto_fini(AF_INET); ++ fini_iptables(); + } + + EXPORT_SYMBOL(ipt_register_table); + EXPORT_SYMBOL(ipt_unregister_table); + EXPORT_SYMBOL(ipt_do_table); +-module_init(ip_tables_init); ++subsys_initcall(ip_tables_init); + module_exit(ip_tables_fini); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ipt_CLUSTERIP.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_CLUSTERIP.c +--- ./net/ipv4/netfilter/ipt_CLUSTERIP.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_CLUSTERIP.c 2012-11-13 15:20:15.660569059 +0000 +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -401,7 +402,7 @@ + return false; + } + +- dev = dev_get_by_name(&init_net, e->ip.iniface); ++ dev = dev_get_by_name(get_exec_env()->ve_netns, e->ip.iniface); + if (!dev) { + printk(KERN_WARNING "CLUSTERIP: no such interface %s\n", e->ip.iniface); + return false; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ipt_LOG.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_LOG.c +--- ./net/ipv4/netfilter/ipt_LOG.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_LOG.c 2012-11-13 15:20:15.660569059 +0000 +@@ -46,32 +46,32 @@ + + ih = skb_header_pointer(skb, iphoff, sizeof(_iph), &_iph); + if (ih == NULL) { +- printk("TRUNCATED"); ++ ve_printk(VE_LOG, "TRUNCATED"); + return; + } + + /* Important fields: + * TOS, len, DF/MF, fragment offset, TTL, src, dst, options. */ + /* Max length: 40 "SRC=255.255.255.255 DST=255.255.255.255 " */ +- printk("SRC=%u.%u.%u.%u DST=%u.%u.%u.%u ", ++ ve_printk(VE_LOG, "SRC=%u.%u.%u.%u DST=%u.%u.%u.%u ", + NIPQUAD(ih->saddr), NIPQUAD(ih->daddr)); + + /* Max length: 46 "LEN=65535 TOS=0xFF PREC=0xFF TTL=255 ID=65535 " */ +- printk("LEN=%u TOS=0x%02X PREC=0x%02X TTL=%u ID=%u ", ++ ve_printk(VE_LOG, "LEN=%u TOS=0x%02X PREC=0x%02X TTL=%u ID=%u ", + ntohs(ih->tot_len), ih->tos & IPTOS_TOS_MASK, + ih->tos & IPTOS_PREC_MASK, ih->ttl, ntohs(ih->id)); + + /* Max length: 6 "CE DF MF " */ + if (ntohs(ih->frag_off) & IP_CE) +- printk("CE "); ++ ve_printk(VE_LOG, "CE "); + if (ntohs(ih->frag_off) & IP_DF) +- printk("DF "); ++ ve_printk(VE_LOG, "DF "); + if (ntohs(ih->frag_off) & IP_MF) +- printk("MF "); ++ ve_printk(VE_LOG, "MF "); + + /* Max length: 11 "FRAG:65535 " */ + if (ntohs(ih->frag_off) & IP_OFFSET) +- printk("FRAG:%u ", ntohs(ih->frag_off) & IP_OFFSET); ++ ve_printk(VE_LOG, "FRAG:%u ", ntohs(ih->frag_off) & IP_OFFSET); + + if ((logflags & IPT_LOG_IPOPT) + && ih->ihl * 4 > sizeof(struct iphdr)) { +@@ -82,15 +82,15 @@ + op = skb_header_pointer(skb, iphoff+sizeof(_iph), + optsize, _opt); + if (op == NULL) { +- printk("TRUNCATED"); ++ ve_printk(VE_LOG, "TRUNCATED"); + return; + } + + /* Max length: 127 "OPT (" 15*4*2chars ") " */ +- printk("OPT ("); ++ ve_printk(VE_LOG, "OPT ("); + for (i = 0; i < optsize; i++) +- printk("%02X", op[i]); +- printk(") "); ++ ve_printk(VE_LOG, "%02X", op[i]); ++ ve_printk(VE_LOG, ") "); + } + + switch (ih->protocol) { +@@ -99,7 +99,7 @@ + const struct tcphdr *th; + + /* Max length: 10 "PROTO=TCP " */ +- printk("PROTO=TCP "); ++ ve_printk(VE_LOG, "PROTO=TCP "); + + if (ntohs(ih->frag_off) & IP_OFFSET) + break; +@@ -108,41 +108,41 @@ + th = skb_header_pointer(skb, iphoff + ih->ihl * 4, + sizeof(_tcph), &_tcph); + if (th == NULL) { +- printk("INCOMPLETE [%u bytes] ", ++ ve_printk(VE_LOG, "INCOMPLETE [%u bytes] ", + skb->len - iphoff - ih->ihl*4); + break; + } + + /* Max length: 20 "SPT=65535 DPT=65535 " */ +- printk("SPT=%u DPT=%u ", ++ ve_printk(VE_LOG, "SPT=%u DPT=%u ", + ntohs(th->source), ntohs(th->dest)); + /* Max length: 30 "SEQ=4294967295 ACK=4294967295 " */ + if (logflags & IPT_LOG_TCPSEQ) +- printk("SEQ=%u ACK=%u ", ++ ve_printk(VE_LOG, "SEQ=%u ACK=%u ", + ntohl(th->seq), ntohl(th->ack_seq)); + /* Max length: 13 "WINDOW=65535 " */ +- printk("WINDOW=%u ", ntohs(th->window)); ++ ve_printk(VE_LOG, "WINDOW=%u ", ntohs(th->window)); + /* Max length: 9 "RES=0x3F " */ +- printk("RES=0x%02x ", (u8)(ntohl(tcp_flag_word(th) & TCP_RESERVED_BITS) >> 22)); ++ ve_printk(VE_LOG, "RES=0x%02x ", (u8)(ntohl(tcp_flag_word(th) & TCP_RESERVED_BITS) >> 22)); + /* Max length: 32 "CWR ECE URG ACK PSH RST SYN FIN " */ + if (th->cwr) +- printk("CWR "); ++ ve_printk(VE_LOG, "CWR "); + if (th->ece) +- printk("ECE "); ++ ve_printk(VE_LOG, "ECE "); + if (th->urg) +- printk("URG "); ++ ve_printk(VE_LOG, "URG "); + if (th->ack) +- printk("ACK "); ++ ve_printk(VE_LOG, "ACK "); + if (th->psh) +- printk("PSH "); ++ ve_printk(VE_LOG, "PSH "); + if (th->rst) +- printk("RST "); ++ ve_printk(VE_LOG, "RST "); + if (th->syn) +- printk("SYN "); ++ ve_printk(VE_LOG, "SYN "); + if (th->fin) +- printk("FIN "); ++ ve_printk(VE_LOG, "FIN "); + /* Max length: 11 "URGP=65535 " */ +- printk("URGP=%u ", ntohs(th->urg_ptr)); ++ ve_printk(VE_LOG, "URGP=%u ", ntohs(th->urg_ptr)); + + if ((logflags & IPT_LOG_TCPOPT) + && th->doff * 4 > sizeof(struct tcphdr)) { +@@ -155,15 +155,15 @@ + iphoff+ih->ihl*4+sizeof(_tcph), + optsize, _opt); + if (op == NULL) { +- printk("TRUNCATED"); ++ ve_printk(VE_LOG, "TRUNCATED"); + return; + } + + /* Max length: 127 "OPT (" 15*4*2chars ") " */ +- printk("OPT ("); ++ ve_printk(VE_LOG, "OPT ("); + for (i = 0; i < optsize; i++) +- printk("%02X", op[i]); +- printk(") "); ++ ve_printk(VE_LOG, "%02X", op[i]); ++ ve_printk(VE_LOG, ") "); + } + break; + } +@@ -174,9 +174,9 @@ + + if (ih->protocol == IPPROTO_UDP) + /* Max length: 10 "PROTO=UDP " */ +- printk("PROTO=UDP " ); ++ ve_printk(VE_LOG, "PROTO=UDP " ); + else /* Max length: 14 "PROTO=UDPLITE " */ +- printk("PROTO=UDPLITE "); ++ ve_printk(VE_LOG, "PROTO=UDPLITE "); + + if (ntohs(ih->frag_off) & IP_OFFSET) + break; +@@ -185,13 +185,13 @@ + uh = skb_header_pointer(skb, iphoff+ih->ihl*4, + sizeof(_udph), &_udph); + if (uh == NULL) { +- printk("INCOMPLETE [%u bytes] ", ++ ve_printk(VE_LOG, "INCOMPLETE [%u bytes] ", + skb->len - iphoff - ih->ihl*4); + break; + } + + /* Max length: 20 "SPT=65535 DPT=65535 " */ +- printk("SPT=%u DPT=%u LEN=%u ", ++ ve_printk(VE_LOG, "SPT=%u DPT=%u LEN=%u ", + ntohs(uh->source), ntohs(uh->dest), + ntohs(uh->len)); + break; +@@ -218,7 +218,7 @@ + [ICMP_ADDRESSREPLY] = 12 }; + + /* Max length: 11 "PROTO=ICMP " */ +- printk("PROTO=ICMP "); ++ ve_printk(VE_LOG, "PROTO=ICMP "); + + if (ntohs(ih->frag_off) & IP_OFFSET) + break; +@@ -227,19 +227,19 @@ + ich = skb_header_pointer(skb, iphoff + ih->ihl * 4, + sizeof(_icmph), &_icmph); + if (ich == NULL) { +- printk("INCOMPLETE [%u bytes] ", ++ ve_printk(VE_LOG, "INCOMPLETE [%u bytes] ", + skb->len - iphoff - ih->ihl*4); + break; + } + + /* Max length: 18 "TYPE=255 CODE=255 " */ +- printk("TYPE=%u CODE=%u ", ich->type, ich->code); ++ ve_printk(VE_LOG, "TYPE=%u CODE=%u ", ich->type, ich->code); + + /* Max length: 25 "INCOMPLETE [65535 bytes] " */ + if (ich->type <= NR_ICMP_TYPES + && required_len[ich->type] + && skb->len-iphoff-ih->ihl*4 < required_len[ich->type]) { +- printk("INCOMPLETE [%u bytes] ", ++ ve_printk(VE_LOG, "INCOMPLETE [%u bytes] ", + skb->len - iphoff - ih->ihl*4); + break; + } +@@ -248,19 +248,19 @@ + case ICMP_ECHOREPLY: + case ICMP_ECHO: + /* Max length: 19 "ID=65535 SEQ=65535 " */ +- printk("ID=%u SEQ=%u ", ++ ve_printk(VE_LOG, "ID=%u SEQ=%u ", + ntohs(ich->un.echo.id), + ntohs(ich->un.echo.sequence)); + break; + + case ICMP_PARAMETERPROB: + /* Max length: 14 "PARAMETER=255 " */ +- printk("PARAMETER=%u ", ++ ve_printk(VE_LOG, "PARAMETER=%u ", + ntohl(ich->un.gateway) >> 24); + break; + case ICMP_REDIRECT: + /* Max length: 24 "GATEWAY=255.255.255.255 " */ +- printk("GATEWAY=%u.%u.%u.%u ", ++ ve_printk(VE_LOG, "GATEWAY=%u.%u.%u.%u ", + NIPQUAD(ich->un.gateway)); + /* Fall through */ + case ICMP_DEST_UNREACH: +@@ -268,16 +268,16 @@ + case ICMP_TIME_EXCEEDED: + /* Max length: 3+maxlen */ + if (!iphoff) { /* Only recurse once. */ +- printk("["); ++ ve_printk(VE_LOG, "["); + dump_packet(info, skb, + iphoff + ih->ihl*4+sizeof(_icmph)); +- printk("] "); ++ ve_printk(VE_LOG, "] "); + } + + /* Max length: 10 "MTU=65535 " */ + if (ich->type == ICMP_DEST_UNREACH + && ich->code == ICMP_FRAG_NEEDED) +- printk("MTU=%u ", ntohs(ich->un.frag.mtu)); ++ ve_printk(VE_LOG, "MTU=%u ", ntohs(ich->un.frag.mtu)); + } + break; + } +@@ -290,19 +290,19 @@ + break; + + /* Max length: 9 "PROTO=AH " */ +- printk("PROTO=AH "); ++ ve_printk(VE_LOG, "PROTO=AH "); + + /* Max length: 25 "INCOMPLETE [65535 bytes] " */ + ah = skb_header_pointer(skb, iphoff+ih->ihl*4, + sizeof(_ahdr), &_ahdr); + if (ah == NULL) { +- printk("INCOMPLETE [%u bytes] ", ++ ve_printk(VE_LOG, "INCOMPLETE [%u bytes] ", + skb->len - iphoff - ih->ihl*4); + break; + } + + /* Length: 15 "SPI=0xF1234567 " */ +- printk("SPI=0x%x ", ntohl(ah->spi)); ++ ve_printk(VE_LOG, "SPI=0x%x ", ntohl(ah->spi)); + break; + } + case IPPROTO_ESP: { +@@ -310,7 +310,7 @@ + const struct ip_esp_hdr *eh; + + /* Max length: 10 "PROTO=ESP " */ +- printk("PROTO=ESP "); ++ ve_printk(VE_LOG, "PROTO=ESP "); + + if (ntohs(ih->frag_off) & IP_OFFSET) + break; +@@ -319,25 +319,25 @@ + eh = skb_header_pointer(skb, iphoff+ih->ihl*4, + sizeof(_esph), &_esph); + if (eh == NULL) { +- printk("INCOMPLETE [%u bytes] ", ++ ve_printk(VE_LOG, "INCOMPLETE [%u bytes] ", + skb->len - iphoff - ih->ihl*4); + break; + } + + /* Length: 15 "SPI=0xF1234567 " */ +- printk("SPI=0x%x ", ntohl(eh->spi)); ++ ve_printk(VE_LOG, "SPI=0x%x ", ntohl(eh->spi)); + break; + } + /* Max length: 10 "PROTO 255 " */ + default: +- printk("PROTO=%u ", ih->protocol); ++ ve_printk(VE_LOG, "PROTO=%u ", ih->protocol); + } + + /* Max length: 15 "UID=4294967295 " */ + if ((logflags & IPT_LOG_UID) && !iphoff && skb->sk) { + read_lock_bh(&skb->sk->sk_callback_lock); + if (skb->sk->sk_socket && skb->sk->sk_socket->file) +- printk("UID=%u ", skb->sk->sk_socket->file->f_uid); ++ ve_printk(VE_LOG, "UID=%u ", skb->sk->sk_socket->file->f_uid); + read_unlock_bh(&skb->sk->sk_callback_lock); + } + +@@ -379,7 +379,7 @@ + loginfo = &default_loginfo; + + spin_lock_bh(&log_lock); +- printk("<%d>%sIN=%s OUT=%s ", loginfo->u.log.level, ++ ve_printk(VE_LOG, "<%d>%sIN=%s OUT=%s ", loginfo->u.log.level, + prefix, + in ? in->name : "", + out ? out->name : ""); +@@ -390,30 +390,30 @@ + + physindev = skb->nf_bridge->physindev; + if (physindev && in != physindev) +- printk("PHYSIN=%s ", physindev->name); ++ ve_printk(VE_LOG, "PHYSIN=%s ", physindev->name); + physoutdev = skb->nf_bridge->physoutdev; + if (physoutdev && out != physoutdev) +- printk("PHYSOUT=%s ", physoutdev->name); ++ ve_printk(VE_LOG, "PHYSOUT=%s ", physoutdev->name); + } + #endif + + if (in && !out) { + /* MAC logging for input chain only. */ +- printk("MAC="); ++ ve_printk(VE_LOG, "MAC="); + if (skb->dev && skb->dev->hard_header_len + && skb->mac_header != skb->network_header) { + int i; + const unsigned char *p = skb_mac_header(skb); + for (i = 0; i < skb->dev->hard_header_len; i++,p++) +- printk("%02x%c", *p, ++ ve_printk(VE_LOG, "%02x%c", *p, + i==skb->dev->hard_header_len - 1 + ? ' ':':'); + } else +- printk(" "); ++ ve_printk(VE_LOG, " "); + } + + dump_packet(loginfo, skb, 0); +- printk("\n"); ++ ve_printk(VE_LOG, "\n"); + spin_unlock_bh(&log_lock); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ipt_MASQUERADE.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_MASQUERADE.c +--- ./net/ipv4/netfilter/ipt_MASQUERADE.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_MASQUERADE.c 2012-11-13 15:20:15.660569059 +0000 +@@ -103,6 +103,7 @@ + return nf_nat_setup_info(ct, &newrange, hooknum); + } + ++#if 0 + static int + device_cmp(struct nf_conn *i, void *ifindex) + { +@@ -125,9 +126,6 @@ + { + const struct net_device *dev = ptr; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + if (event == NETDEV_DOWN) { + /* Device was downed. Search entire table for + conntracks which were associated with that device, +@@ -165,6 +163,7 @@ + static struct notifier_block masq_inet_notifier = { + .notifier_call = masq_inet_event, + }; ++#endif + + static struct xt_target masquerade __read_mostly = { + .name = "MASQUERADE", +@@ -183,12 +182,16 @@ + + ret = xt_register_target(&masquerade); + ++#if 0 ++/* These notifiers are unnecessary and may ++ lead to oops in virtual environments */ + if (ret == 0) { + /* Register for device down reports */ + register_netdevice_notifier(&masq_dev_notifier); + /* Register IP address change reports */ + register_inetaddr_notifier(&masq_inet_notifier); + } ++#endif + + return ret; + } +@@ -196,8 +199,8 @@ + static void __exit ipt_masquerade_fini(void) + { + xt_unregister_target(&masquerade); +- unregister_netdevice_notifier(&masq_dev_notifier); +- unregister_inetaddr_notifier(&masq_inet_notifier); ++/* unregister_netdevice_notifier(&masq_dev_notifier); ++ unregister_inetaddr_notifier(&masq_inet_notifier);*/ + } + + module_init(ipt_masquerade_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ipt_REDIRECT.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_REDIRECT.c +--- ./net/ipv4/netfilter/ipt_REDIRECT.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_REDIRECT.c 2012-11-13 15:20:15.660569059 +0000 +@@ -77,8 +77,13 @@ + + rcu_read_lock(); + indev = __in_dev_get_rcu(skb->dev); +- if (indev && (ifa = indev->ifa_list)) ++ if (indev && (ifa = indev->ifa_list)) { ++ /* because of venet device specific, we should use ++ * second ifa in the list */ ++ if (IN_LOOPBACK(ntohl(ifa->ifa_local)) && ifa->ifa_next) ++ ifa = ifa->ifa_next; + newdst = ifa->ifa_local; ++ } + rcu_read_unlock(); + + if (!newdst) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ipt_REJECT.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_REJECT.c +--- ./net/ipv4/netfilter/ipt_REJECT.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_REJECT.c 2012-11-13 15:20:15.660569059 +0000 +@@ -221,13 +221,13 @@ + const struct ipt_entry *e = e_void; + + if (rejinfo->with == IPT_ICMP_ECHOREPLY) { +- printk("ipt_REJECT: ECHOREPLY no longer supported.\n"); ++ ve_printk(VE_LOG, "ipt_REJECT: ECHOREPLY no longer supported.\n"); + return false; + } else if (rejinfo->with == IPT_TCP_RESET) { + /* Must specify that it's a TCP packet */ + if (e->ip.proto != IPPROTO_TCP + || (e->ip.invflags & XT_INV_PROTO)) { +- printk("ipt_REJECT: TCP_RESET invalid for non-tcp\n"); ++ ve_printk(VE_LOG, "ipt_REJECT: TCP_RESET invalid for non-tcp\n"); + return false; + } + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ipt_TOS.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_TOS.c +--- ./net/ipv4/netfilter/ipt_TOS.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_TOS.c 2012-11-13 15:20:15.660569059 +0000 +@@ -57,7 +57,7 @@ + && tos != IPTOS_RELIABILITY + && tos != IPTOS_MINCOST + && tos != IPTOS_NORMALSVC) { +- printk(KERN_WARNING "TOS: bad tos value %#x\n", tos); ++ ve_printk(VE_LOG, KERN_WARNING "TOS: bad tos value %#x\n", tos); + return false; + } + return true; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ipt_ULOG.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_ULOG.c +--- ./net/ipv4/netfilter/ipt_ULOG.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_ULOG.c 2012-11-13 15:20:15.660569059 +0000 +@@ -417,7 +417,7 @@ + + ret = xt_register_target(&ipt_ulog_reg); + if (ret < 0) { +- sock_release(nflognl->sk_socket); ++ netlink_kernel_release(nflognl); + return ret; + } + if (nflog) +@@ -436,7 +436,7 @@ + if (nflog) + nf_log_unregister(&ipt_ulog_logger); + xt_unregister_target(&ipt_ulog_reg); +- sock_release(nflognl->sk_socket); ++ netlink_kernel_release(nflognl); + + /* remove pending timers and free allocated skb's */ + for (i = 0; i < ULOG_MAXNLGROUPS; i++) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/ipt_recent.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_recent.c +--- ./net/ipv4/netfilter/ipt_recent.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/ipt_recent.c 2012-11-13 15:20:15.664569057 +0000 +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -52,6 +53,19 @@ + MODULE_PARM_DESC(ip_list_uid,"owner of /proc/net/ipt_recent/* files"); + MODULE_PARM_DESC(ip_list_gid,"owning group of /proc/net/ipt_recent/* files"); + ++#include ++ ++#if defined(CONFIG_VE_IPTABLES) ++#define tables (get_exec_env()->_ipt_recent->tables) ++#define proc_dir (get_exec_env()->_ipt_recent->proc_dir) ++#else ++static LIST_HEAD(tables); ++static struct proc_dir_entry *proc_dir; ++#endif /* CONFIG_VE_IPTABLES */ ++ ++static int init_ipt_recent(struct ve_struct *ve); ++static void fini_ipt_recent(struct ve_struct *ve); ++ + struct recent_entry { + struct list_head list; + struct list_head lru_list; +@@ -74,12 +88,10 @@ + struct list_head iphash[0]; + }; + +-static LIST_HEAD(tables); + static DEFINE_SPINLOCK(recent_lock); + static DEFINE_MUTEX(recent_mutex); + + #ifdef CONFIG_PROC_FS +-static struct proc_dir_entry *proc_dir; + static const struct file_operations recent_fops; + #endif + +@@ -256,6 +268,9 @@ + strnlen(info->name, IPT_RECENT_NAME_LEN) == IPT_RECENT_NAME_LEN) + return false; + ++ if (init_ipt_recent(get_exec_env())) ++ return 0; ++ + mutex_lock(&recent_mutex); + t = recent_table_lookup(info->name); + if (t != NULL) { +@@ -298,6 +313,13 @@ + { + const struct ipt_recent_info *info = matchinfo; + struct recent_table *t; ++ struct ve_struct *ve; ++ ++ ve = get_exec_env(); ++#ifdef CONFIG_VE_IPTABLES ++ if (!ve->_ipt_recent) ++ return; ++#endif + + mutex_lock(&recent_mutex); + t = recent_table_lookup(info->name); +@@ -312,6 +334,8 @@ + kfree(t); + } + mutex_unlock(&recent_mutex); ++ if (!ve_is_super(ve) && list_empty(&tables)) ++ fini_ipt_recent(ve); + } + + #ifdef CONFIG_PROC_FS +@@ -465,6 +489,49 @@ + .me = THIS_MODULE, + }; + ++static int init_ipt_recent(struct ve_struct *ve) ++{ ++ int err = 0; ++ ++#ifdef CONFIG_VE_IPTABLES ++ if (ve->_ipt_recent) ++ return 0; ++ ++ ve->_ipt_recent = kzalloc(sizeof(struct ve_ipt_recent), GFP_KERNEL); ++ if (!ve->_ipt_recent) { ++ err = -ENOMEM; ++ goto out; ++ } ++ ++ INIT_LIST_HEAD(&tables); ++#endif ++#ifdef CONFIG_PROC_FS ++ if (err) ++ return err; ++ proc_dir = proc_mkdir("ipt_recent", ve->ve_netns->proc_net); ++ if (proc_dir == NULL) { ++ err = -ENOMEM; ++ goto out_mem; ++ } ++#endif ++out: ++ return err; ++out_mem: ++#ifdef CONFIG_VE_IPTABLES ++ kfree(ve->_ipt_recent); ++#endif ++ goto out; ++} ++ ++static void fini_ipt_recent(struct ve_struct *ve) ++{ ++ remove_proc_entry("ipt_recent", ve->ve_netns->proc_net); ++#ifdef CONFIG_VE_IPTABLES ++ kfree(ve->_ipt_recent); ++ ve->_ipt_recent = NULL; ++#endif ++} ++ + static int __init ipt_recent_init(void) + { + int err; +@@ -474,25 +541,24 @@ + ip_list_hash_size = 1 << fls(ip_list_tot); + + err = xt_register_match(&recent_match); +-#ifdef CONFIG_PROC_FS + if (err) + return err; +- proc_dir = proc_mkdir("ipt_recent", init_net.proc_net); +- if (proc_dir == NULL) { ++ ++ err = init_ipt_recent(&ve0); ++ if (err) { + xt_unregister_match(&recent_match); +- err = -ENOMEM; ++ return err; + } +-#endif +- return err; ++ ++ return 0; + } + + static void __exit ipt_recent_exit(void) + { + BUG_ON(!list_empty(&tables)); ++ ++ fini_ipt_recent(&ve0); + xt_unregister_match(&recent_match); +-#ifdef CONFIG_PROC_FS +- remove_proc_entry("ipt_recent", init_net.proc_net); +-#endif + } + + module_init(ipt_recent_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/iptable_filter.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/iptable_filter.c +--- ./net/ipv4/netfilter/iptable_filter.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/iptable_filter.c 2012-11-13 15:20:15.664569057 +0000 +@@ -12,6 +12,7 @@ + + #include + #include ++#include + #include + #include + +@@ -19,6 +20,13 @@ + MODULE_AUTHOR("Netfilter Core Team "); + MODULE_DESCRIPTION("iptables filter table"); + ++#ifdef CONFIG_VE_IPTABLES ++#include ++#define ve_packet_filter (get_exec_env()->_ve_ipt_filter_pf) ++#else ++#define ve_packet_filter &packet_filter ++#endif ++ + #define FILTER_VALID_HOOKS ((1 << NF_IP_LOCAL_IN) | (1 << NF_IP_FORWARD) | (1 << NF_IP_LOCAL_OUT)) + + static struct +@@ -26,7 +34,7 @@ + struct ipt_replace repl; + struct ipt_standard entries[3]; + struct ipt_error term; +-} initial_table __initdata = { ++} initial_table = { + .repl = { + .name = "filter", + .valid_hooks = FILTER_VALID_HOOKS, +@@ -67,7 +75,7 @@ + const struct net_device *out, + int (*okfn)(struct sk_buff *)) + { +- return ipt_do_table(skb, hook, in, out, &packet_filter); ++ return ipt_do_table(skb, hook, in, out, ve_packet_filter); + } + + static unsigned int +@@ -86,7 +94,7 @@ + return NF_ACCEPT; + } + +- return ipt_do_table(skb, hook, in, out, &packet_filter); ++ return ipt_do_table(skb, hook, in, out, ve_packet_filter); + } + + static struct nf_hook_ops ipt_ops[] = { +@@ -117,22 +125,19 @@ + static int forward = NF_ACCEPT; + module_param(forward, bool, 0000); + +-static int __init iptable_filter_init(void) ++int init_iptable_filter(void) + { + int ret; +- +- if (forward < 0 || forward > NF_MAX_VERDICT) { +- printk("iptables forward must be 0 or 1\n"); +- return -EINVAL; +- } +- +- /* Entry 1 is the FORWARD hook */ +- initial_table.entries[1].target.verdict = -forward - 1; ++ struct ipt_table *tmp_filter; + + /* Register table */ +- ret = ipt_register_table(&packet_filter, &initial_table.repl); +- if (ret < 0) +- return ret; ++ tmp_filter = ipt_register_table(&packet_filter, ++ &initial_table.repl); ++ if (IS_ERR(tmp_filter)) ++ return PTR_ERR(tmp_filter); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_filter = tmp_filter; ++#endif + + /* Register hooks */ + ret = nf_register_hooks(ipt_ops, ARRAY_SIZE(ipt_ops)); +@@ -142,14 +147,50 @@ + return ret; + + cleanup_table: +- ipt_unregister_table(&packet_filter); ++ ipt_unregister_table(ve_packet_filter); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_filter = NULL; ++#endif + return ret; + } + +-static void __exit iptable_filter_fini(void) ++void fini_iptable_filter(void) + { + nf_unregister_hooks(ipt_ops, ARRAY_SIZE(ipt_ops)); +- ipt_unregister_table(&packet_filter); ++ ipt_unregister_table(ve_packet_filter); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_filter = NULL; ++#endif ++} ++ ++static int __init iptable_filter_init(void) ++{ ++ int err; ++ ++ if (forward < 0 || forward > NF_MAX_VERDICT) { ++ printk("iptables forward must be 0 or 1\n"); ++ return -EINVAL; ++ } ++ ++ /* Entry 1 is the FORWARD hook */ ++ initial_table.entries[1].target.verdict = -forward - 1; ++ ++ err = init_iptable_filter(); ++ if (err < 0) ++ return err; ++ ++ KSYMRESOLVE(init_iptable_filter); ++ KSYMRESOLVE(fini_iptable_filter); ++ KSYMMODRESOLVE(iptable_filter); ++ return 0; ++} ++ ++static void __exit iptable_filter_fini(void) ++{ ++ KSYMMODUNRESOLVE(iptable_filter); ++ KSYMUNRESOLVE(init_iptable_filter); ++ KSYMUNRESOLVE(fini_iptable_filter); ++ fini_iptable_filter(); + } + + module_init(iptable_filter_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/iptable_mangle.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/iptable_mangle.c +--- ./net/ipv4/netfilter/iptable_mangle.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/iptable_mangle.c 2012-11-13 15:20:15.664569057 +0000 +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -33,7 +34,7 @@ + struct ipt_replace repl; + struct ipt_standard entries[5]; + struct ipt_error term; +-} initial_table __initdata = { ++} initial_table = { + .repl = { + .name = "mangle", + .valid_hooks = MANGLE_VALID_HOOKS, +@@ -72,6 +73,13 @@ + .af = AF_INET, + }; + ++#ifdef CONFIG_VE_IPTABLES ++#include ++#define ve_packet_mangler (get_exec_env()->_ipt_mangle_table) ++#else ++#define ve_packet_mangler &packet_mangler ++#endif ++ + /* The work comes in here from netfilter.c. */ + static unsigned int + ipt_route_hook(unsigned int hook, +@@ -80,7 +88,7 @@ + const struct net_device *out, + int (*okfn)(struct sk_buff *)) + { +- return ipt_do_table(skb, hook, in, out, &packet_mangler); ++ return ipt_do_table(skb, hook, in, out, ve_packet_mangler); + } + + static unsigned int +@@ -112,7 +120,7 @@ + daddr = iph->daddr; + tos = iph->tos; + +- ret = ipt_do_table(skb, hook, in, out, &packet_mangler); ++ ret = ipt_do_table(skb, hook, in, out, ve_packet_mangler); + /* Reroute for ANY change. */ + if (ret != NF_DROP && ret != NF_STOLEN && ret != NF_QUEUE) { + iph = ip_hdr(skb); +@@ -166,14 +174,19 @@ + }, + }; + +-static int __init iptable_mangle_init(void) ++int init_iptable_mangle(void) + { + int ret; ++ struct ipt_table *tmp_mangler; + + /* Register table */ +- ret = ipt_register_table(&packet_mangler, &initial_table.repl); +- if (ret < 0) +- return ret; ++ tmp_mangler = ipt_register_table(&packet_mangler, ++ &initial_table.repl); ++ if (IS_ERR(tmp_mangler)) ++ return PTR_ERR(tmp_mangler); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_mangler = tmp_mangler; ++#endif + + /* Register hooks */ + ret = nf_register_hooks(ipt_ops, ARRAY_SIZE(ipt_ops)); +@@ -183,14 +196,42 @@ + return ret; + + cleanup_table: +- ipt_unregister_table(&packet_mangler); ++ ipt_unregister_table(ve_packet_mangler); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_mangler = NULL; ++#endif + return ret; + } + +-static void __exit iptable_mangle_fini(void) ++void fini_iptable_mangle(void) + { + nf_unregister_hooks(ipt_ops, ARRAY_SIZE(ipt_ops)); +- ipt_unregister_table(&packet_mangler); ++ ipt_unregister_table(ve_packet_mangler); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_mangler = NULL; ++#endif ++} ++ ++static int __init iptable_mangle_init(void) ++{ ++ int err; ++ ++ err = init_iptable_mangle(); ++ if (err < 0) ++ return err; ++ ++ KSYMRESOLVE(init_iptable_mangle); ++ KSYMRESOLVE(fini_iptable_mangle); ++ KSYMMODRESOLVE(iptable_mangle); ++ return 0; ++} ++ ++static void __exit iptable_mangle_fini(void) ++{ ++ KSYMMODUNRESOLVE(iptable_mangle); ++ KSYMUNRESOLVE(init_iptable_mangle); ++ KSYMUNRESOLVE(fini_iptable_mangle); ++ fini_iptable_mangle(); + } + + module_init(iptable_mangle_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/iptable_raw.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/iptable_raw.c +--- ./net/ipv4/netfilter/iptable_raw.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/iptable_raw.c 2012-11-13 15:20:15.664569057 +0000 +@@ -93,12 +93,13 @@ + + static int __init iptable_raw_init(void) + { ++ struct xt_table *tmp; + int ret; + + /* Register table */ +- ret = ipt_register_table(&packet_raw, &initial_table.repl); +- if (ret < 0) +- return ret; ++ tmp = ipt_register_table(&packet_raw, &initial_table.repl); ++ if (IS_ERR(tmp)) ++ return PTR_ERR(tmp); + + /* Register hooks */ + ret = nf_register_hooks(ipt_ops, ARRAY_SIZE(ipt_ops)); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +--- ./net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c 2012-11-13 15:20:15.664569057 +0000 +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -426,66 +427,204 @@ + MODULE_ALIAS("ip_conntrack"); + MODULE_LICENSE("GPL"); + +-static int __init nf_conntrack_l3proto_ipv4_init(void) ++#ifdef CONFIG_VE_IPTABLES ++#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) ++static int nf_ct_proto_ipv4_sysctl_init(void) + { +- int ret = 0; ++ struct nf_conntrack_l3proto *ipv4 = ve_nf_conntrack_l3proto_ipv4; + +- need_conntrack(); ++ ipv4->ctl_table_header = NULL; ++ ipv4->ctl_table_path = nf_net_ipv4_netfilter_sysctl_path; ++ ipv4->ctl_table = clone_sysctl_template(ip_ct_sysctl_table); ++ if (ipv4->ctl_table == NULL) ++ return -ENOMEM; ++ ++ ipv4->ctl_table[0].data = &ve_nf_conntrack_max; ++ ipv4->ctl_table[1].data = &ve_nf_conntrack_count; ++ ipv4->ctl_table[3].data = &ve_nf_conntrack_checksum; ++ ipv4->ctl_table[4].data = &ve_nf_ct_log_invalid; + +- ret = nf_register_sockopt(&so_getorigdst); +- if (ret < 0) { +- printk(KERN_ERR "Unable to register netfilter socket option\n"); +- return ret; +- } ++ return 0; ++} ++ ++static void nf_ct_proto_ipv4_sysctl_cleanup(void) ++{ ++ if (!ve_is_super(get_exec_env())) ++ free_sysctl_clone(ve_nf_conntrack_l3proto_ipv4->ctl_table); ++} ++#else ++static inline int nf_ct_proto_ipv4_sysctl_init(void) ++{ ++ return 0; ++} ++static inline void nf_ct_proto_ipv4_sysctl_cleanup(void) ++{ ++} ++#endif /* SYSCTL && NF_CONNTRACK_PROC_COMPAT */ ++ ++/* ++ * Functions init/fini_nf_ct_l3proto_ipv4 glue distributed nf_conntrack ++ * virtualization efforts. They are to be called from 2 places: ++ * ++ * 1) on loading/unloading module nf_conntrack_ipv4 from ++ * nf_conntrack_l3proto_ipv4_init/fini ++ * 2) on start/stop ve - from do_ve_iptables ++ */ ++static int nf_ct_proto_ipv4_init(void) ++{ ++ struct nf_conntrack_l3proto *ipv4; ++ ++ if (ve_is_super(get_exec_env())) { ++ ipv4 = &nf_conntrack_l3proto_ipv4; ++ goto out; ++ } ++ ipv4 = kmemdup(&nf_conntrack_l3proto_ipv4, ++ sizeof(struct nf_conntrack_l3proto), GFP_KERNEL); ++ if (!ipv4) ++ return -ENOMEM; ++out: ++ ve_nf_conntrack_l3proto_ipv4 = ipv4; ++ return 0; ++} ++ ++static void nf_ct_proto_ipv4_fini(void) ++{ ++ if (!ve_is_super(get_exec_env())) ++ kfree(ve_nf_conntrack_l3proto_ipv4); ++} ++#endif ++ ++int init_nf_ct_l3proto_ipv4(void) ++{ ++ int ret = -ENOMEM; ++ ++#ifdef CONFIG_VE_IPTABLES ++ if (!ve_is_super(get_exec_env())) ++ __module_get(THIS_MODULE); ++ ++ ret = nf_ct_proto_ipv4_init(); ++ if (ret < 0) ++ goto err_out; ++ ret = nf_ct_proto_ipv4_sysctl_init(); ++ if (ret < 0) ++ goto no_mem_ipv4; ++ ret = nf_ct_proto_tcp_sysctl_init(); ++ if (ret < 0) ++ goto no_mem_tcp; ++ ret = nf_ct_proto_udp_sysctl_init(); ++ if (ret < 0) ++ goto no_mem_udp; ++ ret = nf_ct_proto_icmp_sysctl_init(); ++ if (ret < 0) ++ goto no_mem_icmp; ++#endif /* CONFIG_VE_IPTABLES */ + +- ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_tcp4); ++ ret = nf_conntrack_l4proto_register(ve_nf_conntrack_l4proto_tcp4); + if (ret < 0) { + printk("nf_conntrack_ipv4: can't register tcp.\n"); +- goto cleanup_sockopt; ++ goto cleanup_sys; + } + +- ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_udp4); ++ ret = nf_conntrack_l4proto_register(ve_nf_conntrack_l4proto_udp4); + if (ret < 0) { + printk("nf_conntrack_ipv4: can't register udp.\n"); +- goto cleanup_tcp; ++ goto unreg_tcp; + } + +- ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_icmp); ++ ret = nf_conntrack_l4proto_register(ve_nf_conntrack_l4proto_icmp); + if (ret < 0) { + printk("nf_conntrack_ipv4: can't register icmp.\n"); +- goto cleanup_udp; ++ goto unreg_udp; + } + +- ret = nf_conntrack_l3proto_register(&nf_conntrack_l3proto_ipv4); ++ ret = nf_conntrack_l3proto_register(ve_nf_conntrack_l3proto_ipv4); + if (ret < 0) { + printk("nf_conntrack_ipv4: can't register ipv4\n"); +- goto cleanup_icmp; ++ goto unreg_icmp; + } + + ret = nf_register_hooks(ipv4_conntrack_ops, + ARRAY_SIZE(ipv4_conntrack_ops)); + if (ret < 0) { + printk("nf_conntrack_ipv4: can't register hooks.\n"); +- goto cleanup_ipv4; ++ goto unreg_ipv4; + } +-#if defined(CONFIG_PROC_FS) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) + ret = nf_conntrack_ipv4_compat_init(); + if (ret < 0) +- goto cleanup_hooks; +-#endif ++ goto unreg_hooks; ++ return 0; ++ ++unreg_hooks: ++ nf_unregister_hooks(ipv4_conntrack_ops, ARRAY_SIZE(ipv4_conntrack_ops)); ++unreg_ipv4: ++ nf_conntrack_l3proto_unregister(ve_nf_conntrack_l3proto_ipv4); ++unreg_icmp: ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_icmp); ++unreg_udp: ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_udp4); ++unreg_tcp: ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_tcp4); ++cleanup_sys: ++#ifdef CONFIG_VE_IPTABLES ++no_mem_icmp: ++ nf_ct_proto_udp_sysctl_cleanup(); ++no_mem_udp: ++ nf_ct_proto_tcp_sysctl_cleanup(); ++no_mem_tcp: ++ nf_ct_proto_ipv4_sysctl_cleanup(); ++no_mem_ipv4: ++ nf_ct_proto_ipv4_fini(); ++err_out: ++ if (!ve_is_super(get_exec_env())) ++ module_put(THIS_MODULE); ++#endif /* CONFIG_VE_IPTABLES */ + return ret; +-#if defined(CONFIG_PROC_FS) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) +- cleanup_hooks: ++} ++EXPORT_SYMBOL(init_nf_ct_l3proto_ipv4); ++ ++void fini_nf_ct_l3proto_ipv4(void) ++{ ++ nf_conntrack_ipv4_compat_fini(); + nf_unregister_hooks(ipv4_conntrack_ops, ARRAY_SIZE(ipv4_conntrack_ops)); +-#endif +- cleanup_ipv4: +- nf_conntrack_l3proto_unregister(&nf_conntrack_l3proto_ipv4); +- cleanup_icmp: +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_icmp); +- cleanup_udp: +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_udp4); +- cleanup_tcp: +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_tcp4); ++ nf_conntrack_l3proto_unregister(ve_nf_conntrack_l3proto_ipv4); ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_icmp); ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_udp4); ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_tcp4); ++ ++#ifdef CONFIG_VE_IPTABLES ++ nf_ct_proto_icmp_sysctl_cleanup(); ++ nf_ct_proto_udp_sysctl_cleanup(); ++ nf_ct_proto_tcp_sysctl_cleanup(); ++ nf_ct_proto_ipv4_sysctl_cleanup(); ++ nf_ct_proto_ipv4_fini(); ++ if (!ve_is_super(get_exec_env())) ++ module_put(THIS_MODULE); ++#endif /* CONFIG_VE_IPTABLES */ ++} ++EXPORT_SYMBOL(fini_nf_ct_l3proto_ipv4); ++ ++static int __init nf_conntrack_l3proto_ipv4_init(void) ++{ ++ int ret = 0; ++ ++ need_conntrack(); ++ ++ ret = nf_register_sockopt(&so_getorigdst); ++ if (ret < 0) { ++ printk(KERN_ERR "Unable to register netfilter socket option\n"); ++ return ret; ++ } ++ ++ ret = init_nf_ct_l3proto_ipv4(); ++ if (ret < 0) { ++ printk(KERN_ERR "Unable to initialize netfilter protocols\n"); ++ goto cleanup_sockopt; ++ } ++ KSYMRESOLVE(init_nf_ct_l3proto_ipv4); ++ KSYMRESOLVE(fini_nf_ct_l3proto_ipv4); ++ KSYMMODRESOLVE(nf_conntrack_ipv4); ++ return ret; ++ + cleanup_sockopt: + nf_unregister_sockopt(&so_getorigdst); + return ret; +@@ -494,14 +633,12 @@ + static void __exit nf_conntrack_l3proto_ipv4_fini(void) + { + synchronize_net(); +-#if defined(CONFIG_PROC_FS) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) +- nf_conntrack_ipv4_compat_fini(); +-#endif +- nf_unregister_hooks(ipv4_conntrack_ops, ARRAY_SIZE(ipv4_conntrack_ops)); +- nf_conntrack_l3proto_unregister(&nf_conntrack_l3proto_ipv4); +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_icmp); +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_udp4); +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_tcp4); ++ ++ KSYMMODUNRESOLVE(nf_conntrack_ipv4); ++ KSYMUNRESOLVE(init_nf_ct_l3proto_ipv4); ++ KSYMUNRESOLVE(fini_nf_ct_l3proto_ipv4); ++ ++ fini_nf_ct_l3proto_ipv4(); + nf_unregister_sockopt(&so_getorigdst); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +--- ./net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c 2012-06-12 16:25:24.402312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c 2012-11-13 15:20:15.664569057 +0000 +@@ -9,7 +9,9 @@ + */ + #include + #include ++#include + #include ++#include + #include + #include + +@@ -43,8 +45,8 @@ + for (st->bucket = 0; + st->bucket < nf_conntrack_htable_size; + st->bucket++) { +- if (!hlist_empty(&nf_conntrack_hash[st->bucket])) +- return nf_conntrack_hash[st->bucket].first; ++ if (!hlist_empty(&ve_nf_conntrack_hash[st->bucket])) ++ return ve_nf_conntrack_hash[st->bucket].first; + } + return NULL; + } +@@ -58,7 +60,7 @@ + while (head == NULL) { + if (++st->bucket >= nf_conntrack_htable_size) + return NULL; +- head = nf_conntrack_hash[st->bucket].first; ++ head = ve_nf_conntrack_hash[st->bucket].first; + } + return head; + } +@@ -196,8 +198,8 @@ + struct ct_expect_iter_state *st = seq->private; + + for (st->bucket = 0; st->bucket < nf_ct_expect_hsize; st->bucket++) { +- if (!hlist_empty(&nf_ct_expect_hash[st->bucket])) +- return nf_ct_expect_hash[st->bucket].first; ++ if (!hlist_empty(&ve_nf_ct_expect_hash[st->bucket])) ++ return ve_nf_ct_expect_hash[st->bucket].first; + } + return NULL; + } +@@ -211,7 +213,7 @@ + while (head == NULL) { + if (++st->bucket >= nf_ct_expect_hsize) + return NULL; +- head = nf_ct_expect_hash[st->bucket].first; ++ head = ve_nf_ct_expect_hash[st->bucket].first; + } + return head; + } +@@ -326,7 +328,7 @@ + + static int ct_cpu_seq_show(struct seq_file *seq, void *v) + { +- unsigned int nr_conntracks = atomic_read(&nf_conntrack_count); ++ unsigned int nr_conntracks = atomic_read(&ve_nf_conntrack_count); + struct ip_conntrack_stat *st = v; + + if (v == SEQ_START_TOKEN) { +@@ -377,39 +379,104 @@ + .release = seq_release_private, + }; + +-int __init nf_conntrack_ipv4_compat_init(void) ++#ifdef CONFIG_VE_IPTABLES ++#define ve_ip_ct_net_table (get_exec_env()->_nf_conntrack->_ip_ct_net_table) ++#define ve_ip_ct_netfilter_table (get_exec_env()->_nf_conntrack->_ip_ct_netfilter_table) ++#define ve_ip_ct_sysctl_header (get_exec_env()->_nf_conntrack->_ip_ct_sysctl_header) ++#else ++#define ve_ip_ct_net_table ip_ct_net_table ++#define ve_ip_ct_netfilter_table ip_ct_netfilter_table ++#define ve_ip_ct_sysctl_header ip_ct_sysctl_header ++#endif ++ ++static ctl_table ip_ct_netfilter_table[] = { ++ { ++ .procname = "ip_conntrack_max", ++ .data = &nf_conntrack_max, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++ {} ++}; ++ ++static ctl_table ip_ct_ipv4_table[] = { ++ { ++ .ctl_name = NET_IPV4, ++ .procname = "ipv4", ++ .mode = 0555, ++ .child = ip_ct_netfilter_table, ++ }, ++ {} ++}; ++ ++static ctl_table ip_ct_net_table[] = { ++ { ++ .ctl_name = CTL_NET, ++ .procname = "net", ++ .mode = 0555, ++ .child = ip_ct_ipv4_table, ++ }, ++ {} ++}; ++ ++int nf_conntrack_ipv4_compat_init(void) + { ++ struct net *net = get_exec_env()->ve_netns; + struct proc_dir_entry *proc, *proc_exp, *proc_stat; + +- proc = proc_net_fops_create(&init_net, "ip_conntrack", 0440, &ct_file_ops); ++ proc = proc_net_fops_create(net, "ip_conntrack", 0440, &ct_file_ops); + if (!proc) + goto err1; + +- proc_exp = proc_net_fops_create(&init_net, "ip_conntrack_expect", 0440, ++ proc_exp = proc_net_fops_create(net, "ip_conntrack_expect", 0440, + &ip_exp_file_ops); + if (!proc_exp) + goto err2; + +- proc_stat = create_proc_entry("ip_conntrack", S_IRUGO, init_net.proc_net_stat); ++ proc_stat = create_proc_entry("ip_conntrack", S_IRUGO, net->proc_net_stat); + if (!proc_stat) + goto err3; + + proc_stat->proc_fops = &ct_cpu_seq_fops; + proc_stat->owner = THIS_MODULE; + ++ if (ve_is_super(get_exec_env())) { ++ ve_ip_ct_net_table = ip_ct_net_table; ++ } else { ++ ve_ip_ct_net_table = clone_sysctl_template(ip_ct_net_table); ++ if (!ve_ip_ct_net_table) ++ goto err4; ++ } ++ ve_ip_ct_netfilter_table = ve_ip_ct_net_table[0].child[0].child; ++ ve_ip_ct_netfilter_table[0].data = &ve_nf_conntrack_max; ++ ve_ip_ct_sysctl_header = register_sysctl_table(ve_ip_ct_net_table); ++ if (!ve_ip_ct_sysctl_header) ++ goto err5; ++ + return 0; + ++err5: ++ if (!ve_is_super(get_exec_env())) ++ free_sysctl_clone(ve_ip_ct_net_table); ++err4: ++ remove_proc_entry("ip_conntrack", net->proc_net_stat); + err3: +- proc_net_remove(&init_net, "ip_conntrack_expect"); ++ proc_net_remove(net, "ip_conntrack_expect"); + err2: +- proc_net_remove(&init_net, "ip_conntrack"); ++ proc_net_remove(net, "ip_conntrack"); + err1: + return -ENOMEM; + } + +-void __exit nf_conntrack_ipv4_compat_fini(void) ++void nf_conntrack_ipv4_compat_fini(void) + { +- remove_proc_entry("ip_conntrack", init_net.proc_net_stat); +- proc_net_remove(&init_net, "ip_conntrack_expect"); +- proc_net_remove(&init_net, "ip_conntrack"); ++ struct net *net = get_exec_env()->ve_netns; ++ ++ unregister_sysctl_table(ve_ip_ct_sysctl_header); ++ if (!ve_is_super(get_exec_env())) ++ free_sysctl_clone(ve_ip_ct_net_table); ++ remove_proc_entry("ip_conntrack", net->proc_net_stat); ++ proc_net_remove(net, "ip_conntrack_expect"); ++ proc_net_remove(net, "ip_conntrack"); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/nf_conntrack_proto_icmp.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_conntrack_proto_icmp.c +--- ./net/ipv4/netfilter/nf_conntrack_proto_icmp.c 2012-06-12 16:25:24.406312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_conntrack_proto_icmp.c 2012-11-13 15:20:15.664569057 +0000 +@@ -7,6 +7,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -19,7 +20,7 @@ + #include + #include + +-static unsigned long nf_ct_icmp_timeout __read_mostly = 30*HZ; ++unsigned long nf_ct_icmp_timeout __read_mostly = 30*HZ; + + static int icmp_pkt_to_tuple(const struct sk_buff *skb, + unsigned int dataoff, +@@ -99,7 +100,7 @@ + } else { + atomic_inc(&ct->proto.icmp.count); + nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, skb); +- nf_ct_refresh_acct(ct, ctinfo, skb, nf_ct_icmp_timeout); ++ nf_ct_refresh_acct(ct, ctinfo, skb, ve_nf_ct_icmp_timeout); + } + + return NF_ACCEPT; +@@ -156,7 +157,7 @@ + /* Ordinarily, we'd expect the inverted tupleproto, but it's + been preserved inside the ICMP. */ + if (!nf_ct_invert_tuple(&innertuple, &origtuple, +- &nf_conntrack_l3proto_ipv4, innerproto)) { ++ ve_nf_conntrack_l3proto_ipv4, innerproto)) { + pr_debug("icmp_error_message: no match\n"); + return -NF_ACCEPT; + } +@@ -334,3 +335,63 @@ + #endif + #endif + }; ++ ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++int nf_ct_proto_icmp_sysctl_init(void) ++{ ++ struct nf_conntrack_l4proto *icmp; ++ ++ if (ve_is_super(get_exec_env())) { ++ icmp = &nf_conntrack_l4proto_icmp; ++ goto out; ++ } ++ ++ icmp = kmemdup(&nf_conntrack_l4proto_icmp, ++ sizeof(struct nf_conntrack_l4proto), GFP_KERNEL); ++ if (!icmp) ++ goto no_mem_ct; ++ ++ icmp->ctl_table_header = &ve_icmp_sysctl_header; ++ icmp->ctl_table = clone_sysctl_template(icmp_sysctl_table); ++ if (icmp->ctl_table == NULL) ++ goto no_mem_sys; ++ icmp->ctl_table[0].data = &ve_nf_ct_icmp_timeout; ++ ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ icmp->ctl_compat_table_header = ve_icmp_compat_sysctl_header; ++ icmp->ctl_compat_table = ++ clone_sysctl_template(icmp_compat_sysctl_table); ++ if (icmp->ctl_compat_table == NULL) ++ goto no_mem_compat; ++ icmp->ctl_compat_table[0].data = &ve_nf_ct_icmp_timeout; ++#endif ++out: ++ ve_nf_ct_icmp_timeout = nf_ct_icmp_timeout; ++ ++ ve_nf_conntrack_l4proto_icmp = icmp; ++ return 0; ++ ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++no_mem_compat: ++ free_sysctl_clone(icmp->ctl_table); ++#endif ++no_mem_sys: ++ kfree(icmp); ++no_mem_ct: ++ return -ENOMEM; ++} ++EXPORT_SYMBOL(nf_ct_proto_icmp_sysctl_init); ++ ++void nf_ct_proto_icmp_sysctl_cleanup(void) ++{ ++ if (!ve_is_super(get_exec_env())) { ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ free_sysctl_clone( ++ ve_nf_conntrack_l4proto_icmp->ctl_compat_table); ++#endif ++ free_sysctl_clone(ve_nf_conntrack_l4proto_icmp->ctl_table); ++ kfree(ve_nf_conntrack_l4proto_icmp); ++ } ++} ++EXPORT_SYMBOL(nf_ct_proto_icmp_sysctl_cleanup); ++#endif /* CONFIG_VE_IPTABLES && CONFIG_SYSCTL */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/nf_nat_core.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_nat_core.c +--- ./net/ipv4/netfilter/nf_nat_core.c 2012-06-12 16:25:24.406312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_nat_core.c 2012-11-13 15:20:15.664569057 +0000 +@@ -19,6 +19,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include +@@ -33,6 +35,9 @@ + + static DEFINE_RWLOCK(nf_nat_lock); + ++#define MAX_IP_NAT_PROTO 256 ++ ++static struct nf_nat_protocol *nf_nat_protos[MAX_IP_NAT_PROTO]; + static struct nf_conntrack_l3proto *l3proto = NULL; + + /* Calculated at init based on memory size */ +@@ -41,13 +46,22 @@ + + static struct hlist_head *bysource; + +-#define MAX_IP_NAT_PROTO 256 +-static struct nf_nat_protocol *nf_nat_protos[MAX_IP_NAT_PROTO]; ++#ifdef CONFIG_VE_IPTABLES ++#define ve_nf_nat_protos (get_exec_env()->_nf_conntrack->_nf_nat_protos) ++#define ve_nf_nat_l3proto (get_exec_env()->_nf_conntrack->_nf_nat_l3proto) ++#define ve_bysource (get_exec_env()->_nf_conntrack->_bysource) ++#define ve_nf_nat_vmalloced (get_exec_env()->_nf_conntrack->_nf_nat_vmalloced) ++#else ++#define ve_nf_nat_protos nf_nat_protos ++#define ve_nf_nat_l3proto l3proto ++#define ve_bysource bysource ++#define ve_nf_nat_vmalloced nf_nat_vmalloced ++#endif + + static inline struct nf_nat_protocol * + __nf_nat_proto_find(u_int8_t protonum) + { +- return rcu_dereference(nf_nat_protos[protonum]); ++ return rcu_dereference(ve_nf_nat_protos[protonum]); + } + + struct nf_nat_protocol * +@@ -151,7 +165,7 @@ + struct hlist_node *n; + + read_lock_bh(&nf_nat_lock); +- hlist_for_each_entry(nat, n, &bysource[h], bysource) { ++ hlist_for_each_entry(nat, n, &ve_bysource[h], bysource) { + ct = nat->ct; + if (same_src(ct, tuple)) { + /* Copy source part from reply tuple. */ +@@ -332,7 +346,7 @@ + /* nf_conntrack_alter_reply might re-allocate exntension aera */ + nat = nfct_nat(ct); + nat->ct = ct; +- hlist_add_head(&nat->bysource, &bysource[srchash]); ++ hlist_add_head(&nat->bysource, &ve_bysource[srchash]); + write_unlock_bh(&nf_nat_lock); + } + +@@ -424,7 +438,6 @@ + struct icmphdr icmp; + struct iphdr ip; + } *inside; +- struct nf_conntrack_l4proto *l4proto; + struct nf_conntrack_tuple inner, target; + int hdrlen = ip_hdrlen(skb); + enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); +@@ -461,16 +474,14 @@ + "dir %s\n", skb, manip, + dir == IP_CT_DIR_ORIGINAL ? "ORIG" : "REPLY"); + +- /* rcu_read_lock()ed by nf_hook_slow */ +- l4proto = __nf_ct_l4proto_find(PF_INET, inside->ip.protocol); +- + if (!nf_ct_get_tuple(skb, + ip_hdrlen(skb) + sizeof(struct icmphdr), + (ip_hdrlen(skb) + + sizeof(struct icmphdr) + inside->ip.ihl * 4), + (u_int16_t)AF_INET, + inside->ip.protocol, +- &inner, l3proto, l4proto)) ++ &inner, ve_nf_nat_l3proto, ++ __nf_ct_l4proto_find(PF_INET, inside->ip.protocol))) + return 0; + + /* Change inner back to look like incoming packet. We do the +@@ -520,11 +531,11 @@ + int ret = 0; + + write_lock_bh(&nf_nat_lock); +- if (nf_nat_protos[proto->protonum] != &nf_nat_unknown_protocol) { ++ if (ve_nf_nat_protos[proto->protonum] != &nf_nat_unknown_protocol) { + ret = -EBUSY; + goto out; + } +- rcu_assign_pointer(nf_nat_protos[proto->protonum], proto); ++ rcu_assign_pointer(ve_nf_nat_protos[proto->protonum], proto); + out: + write_unlock_bh(&nf_nat_lock); + return ret; +@@ -535,7 +546,7 @@ + void nf_nat_protocol_unregister(struct nf_nat_protocol *proto) + { + write_lock_bh(&nf_nat_lock); +- rcu_assign_pointer(nf_nat_protos[proto->protonum], ++ rcu_assign_pointer(ve_nf_nat_protos[proto->protonum], + &nf_nat_unknown_protocol); + write_unlock_bh(&nf_nat_lock); + synchronize_rcu(); +@@ -626,46 +637,60 @@ + .flags = NF_CT_EXT_F_PREALLOC, + }; + +-static int __init nf_nat_init(void) ++int nf_nat_init(void) + { + size_t i; + int ret; + +- ret = nf_ct_extend_register(&nat_extend); +- if (ret < 0) { +- printk(KERN_ERR "nf_nat_core: Unable to register extension\n"); +- return ret; ++ if (ve_is_super(get_exec_env())) { ++ ret = nf_ct_extend_register(&nat_extend); ++ if (ret < 0) { ++ printk(KERN_ERR "nf_nat_core: Unable to register extension\n"); ++ return ret; ++ } + } + + /* Leave them the same for the moment. */ + nf_nat_htable_size = nf_conntrack_htable_size; + +- bysource = nf_ct_alloc_hashtable(&nf_nat_htable_size, +- &nf_nat_vmalloced); +- if (!bysource) { ++ ve_bysource = nf_ct_alloc_hashtable(&nf_nat_htable_size, ++ &ve_nf_nat_vmalloced); ++ if (!ve_bysource) { + ret = -ENOMEM; + goto cleanup_extend; + } +- ++#ifdef CONFIG_VE_IPTABLES ++ ve_nf_nat_protos = kcalloc(MAX_IP_NAT_PROTO, sizeof(void *), GFP_KERNEL); ++ if (!ve_nf_nat_protos) { ++ ret = -ENOMEM; ++ goto cleanup_hash; ++ } ++#endif + /* Sew in builtin protocols. */ + write_lock_bh(&nf_nat_lock); + for (i = 0; i < MAX_IP_NAT_PROTO; i++) +- rcu_assign_pointer(nf_nat_protos[i], &nf_nat_unknown_protocol); +- rcu_assign_pointer(nf_nat_protos[IPPROTO_TCP], &nf_nat_protocol_tcp); +- rcu_assign_pointer(nf_nat_protos[IPPROTO_UDP], &nf_nat_protocol_udp); +- rcu_assign_pointer(nf_nat_protos[IPPROTO_ICMP], &nf_nat_protocol_icmp); ++ rcu_assign_pointer(ve_nf_nat_protos[i], &nf_nat_unknown_protocol); ++ rcu_assign_pointer(ve_nf_nat_protos[IPPROTO_TCP], &nf_nat_protocol_tcp); ++ rcu_assign_pointer(ve_nf_nat_protos[IPPROTO_UDP], &nf_nat_protocol_udp); ++ rcu_assign_pointer(ve_nf_nat_protos[IPPROTO_ICMP], &nf_nat_protocol_icmp); + write_unlock_bh(&nf_nat_lock); + + for (i = 0; i < nf_nat_htable_size; i++) { +- INIT_HLIST_HEAD(&bysource[i]); ++ INIT_HLIST_HEAD(&ve_bysource[i]); + } + +- /* Initialize fake conntrack so that NAT will skip it */ +- nf_conntrack_untracked.status |= IPS_NAT_DONE_MASK; ++ if (ve_is_super(get_exec_env())) { ++ /* Initialize fake conntrack so that NAT will skip it */ ++ nf_conntrack_untracked.status |= IPS_NAT_DONE_MASK; ++ } + +- l3proto = nf_ct_l3proto_find_get((u_int16_t)AF_INET); ++ ve_nf_nat_l3proto = nf_ct_l3proto_find_get((u_int16_t)AF_INET); + return 0; + ++#ifdef CONFIG_VE_IPTABLES ++cleanup_hash: ++#endif ++ nf_ct_free_hashtable(ve_bysource, ve_nf_nat_vmalloced, nf_nat_htable_size); + cleanup_extend: + nf_ct_extend_unregister(&nat_extend); + return ret; +@@ -683,16 +708,43 @@ + return 0; + } + +-static void __exit nf_nat_cleanup(void) ++void nf_nat_cleanup(void) + { + nf_ct_iterate_cleanup(&clean_nat, NULL); + synchronize_rcu(); +- nf_ct_free_hashtable(bysource, nf_nat_vmalloced, nf_nat_htable_size); +- nf_ct_l3proto_put(l3proto); +- nf_ct_extend_unregister(&nat_extend); ++ nf_ct_free_hashtable(ve_bysource, ve_nf_nat_vmalloced, nf_nat_htable_size); ++ nf_ct_l3proto_put(ve_nf_nat_l3proto); ++#ifdef CONFIG_VE_IPTABLES ++ kfree(ve_nf_nat_protos); ++#endif ++ if (ve_is_super(get_exec_env())) ++ nf_ct_extend_unregister(&nat_extend); ++} ++ ++static int __init init(void) ++{ ++ int rv; ++ ++ rv = nf_nat_init(); ++ if (rv < 0) ++ return rv; ++ ++ KSYMRESOLVE(nf_nat_init); ++ KSYMRESOLVE(nf_nat_cleanup); ++ KSYMMODRESOLVE(nf_nat); ++ return 0; ++} ++ ++static void __exit fini(void) ++{ ++ KSYMMODUNRESOLVE(nf_nat); ++ KSYMUNRESOLVE(nf_nat_cleanup); ++ KSYMUNRESOLVE(nf_nat_init); ++ ++ nf_nat_cleanup(); + } + + MODULE_LICENSE("GPL"); + +-module_init(nf_nat_init); +-module_exit(nf_nat_cleanup); ++module_init(init); ++module_exit(fini); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/netfilter/nf_nat_rule.c debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_nat_rule.c +--- ./net/ipv4/netfilter/nf_nat_rule.c 2012-06-12 16:25:24.406312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/netfilter/nf_nat_rule.c 2012-11-13 15:20:15.668569055 +0000 +@@ -24,6 +24,13 @@ + #include + #include + ++#ifdef CONFIG_VE_IPTABLES ++#define ve_nf_nat_table \ ++ (get_exec_env()->_nf_conntrack->_nf_nat_table) ++#else ++#define ve_nf_nat_table &nat_table ++#endif ++ + #define NAT_VALID_HOOKS ((1< + #include + #include ++#include + + #include + #include +@@ -324,30 +325,64 @@ + }, + }; + +-static int __init nf_nat_standalone_init(void) ++int init_nftable_nat(void) + { +- int ret = 0; ++ int ret; + +- need_ipv4_conntrack(); ++ if (!ve_is_super(get_exec_env())) ++ __module_get(THIS_MODULE); + +-#ifdef CONFIG_XFRM +- BUG_ON(ip_nat_decode_session != NULL); +- ip_nat_decode_session = nat_decode_session; +-#endif + ret = nf_nat_rule_init(); + if (ret < 0) { + printk("nf_nat_init: can't setup rules.\n"); +- goto cleanup_decode_session; ++ goto out_modput; + } + ret = nf_register_hooks(nf_nat_ops, ARRAY_SIZE(nf_nat_ops)); + if (ret < 0) { + printk("nf_nat_init: can't register hooks.\n"); + goto cleanup_rule_init; + } ++ return 0; ++ ++cleanup_rule_init: ++ nf_nat_rule_cleanup(); ++out_modput: ++ if (!ve_is_super(get_exec_env())) ++ module_put(THIS_MODULE); + return ret; ++} + +- cleanup_rule_init: ++void fini_nftable_nat(void) ++{ ++ nf_unregister_hooks(nf_nat_ops, ARRAY_SIZE(nf_nat_ops)); + nf_nat_rule_cleanup(); ++ if (!ve_is_super(get_exec_env())) ++ module_put(THIS_MODULE); ++} ++ ++static int __init nf_nat_standalone_init(void) ++{ ++ int ret = 0; ++ ++ need_ipv4_conntrack(); ++ ++#ifdef CONFIG_XFRM ++ BUG_ON(ip_nat_decode_session != NULL); ++ ip_nat_decode_session = nat_decode_session; ++#endif ++ ++ if (!ip_conntrack_disable_ve0) { ++ ret = init_nftable_nat(); ++ if (ret < 0) ++ goto cleanup_decode_session; ++ } ++ ++ KSYMRESOLVE(init_nftable_nat); ++ KSYMRESOLVE(fini_nftable_nat); ++ KSYMMODRESOLVE(iptable_nat); ++ ++ return ret; ++ + cleanup_decode_session: + #ifdef CONFIG_XFRM + ip_nat_decode_session = NULL; +@@ -358,8 +393,12 @@ + + static void __exit nf_nat_standalone_fini(void) + { +- nf_unregister_hooks(nf_nat_ops, ARRAY_SIZE(nf_nat_ops)); +- nf_nat_rule_cleanup(); ++ KSYMMODUNRESOLVE(iptable_nat); ++ KSYMUNRESOLVE(init_nftable_nat); ++ KSYMUNRESOLVE(fini_nftable_nat); ++ ++ if (!ip_conntrack_disable_ve0) ++ fini_nftable_nat(); + #ifdef CONFIG_XFRM + ip_nat_decode_session = NULL; + synchronize_net(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/proc.c debian/binary-custom.d/openvz/src/net/ipv4/proc.c +--- ./net/ipv4/proc.c 2012-06-12 16:25:24.406312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/proc.c 2012-11-13 15:20:15.668569055 +0000 +@@ -51,6 +51,9 @@ + */ + static int sockstat_seq_show(struct seq_file *seq, void *v) + { ++ if (!ve_is_super(get_exec_env())) ++ return 0; ++ + socket_seq_show(seq); + seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %d\n", + sock_prot_inuse(&tcp_prot), atomic_read(&tcp_orphan_count), +@@ -240,7 +243,7 @@ + count = 0; + for (i = 0; i < ICMPMSG_MIB_MAX; i++) { + +- if (snmp_fold_field((void **) icmpmsg_statistics, i)) ++ if (snmp_fold_field((void **) ve_icmpmsg_statistics, i)) + out[count++] = i; + if (count < PERLINE) + continue; +@@ -252,7 +255,7 @@ + seq_printf(seq, "\nIcmpMsg: "); + for (j = 0; j < PERLINE; ++j) + seq_printf(seq, " %lu", +- snmp_fold_field((void **) icmpmsg_statistics, ++ snmp_fold_field((void **) ve_icmpmsg_statistics, + out[j])); + seq_putc(seq, '\n'); + } +@@ -264,7 +267,7 @@ + seq_printf(seq, "\nIcmpMsg:"); + for (j = 0; j < count; ++j) + seq_printf(seq, " %lu", snmp_fold_field((void **) +- icmpmsg_statistics, out[j])); ++ ve_icmpmsg_statistics, out[j])); + } + + #undef PERLINE +@@ -281,18 +284,18 @@ + for (i=0; icmpmibmap[i].name != NULL; i++) + seq_printf(seq, " Out%s", icmpmibmap[i].name); + seq_printf(seq, "\nIcmp: %lu %lu", +- snmp_fold_field((void **) icmp_statistics, ICMP_MIB_INMSGS), +- snmp_fold_field((void **) icmp_statistics, ICMP_MIB_INERRORS)); ++ snmp_fold_field((void **) ve_icmp_statistics, ICMP_MIB_INMSGS), ++ snmp_fold_field((void **) ve_icmp_statistics, ICMP_MIB_INERRORS)); + for (i=0; icmpmibmap[i].name != NULL; i++) + seq_printf(seq, " %lu", +- snmp_fold_field((void **) icmpmsg_statistics, ++ snmp_fold_field((void **) ve_icmpmsg_statistics, + icmpmibmap[i].index)); + seq_printf(seq, " %lu %lu", +- snmp_fold_field((void **) icmp_statistics, ICMP_MIB_OUTMSGS), +- snmp_fold_field((void **) icmp_statistics, ICMP_MIB_OUTERRORS)); ++ snmp_fold_field((void **) ve_icmp_statistics, ICMP_MIB_OUTMSGS), ++ snmp_fold_field((void **) ve_icmp_statistics, ICMP_MIB_OUTERRORS)); + for (i=0; icmpmibmap[i].name != NULL; i++) + seq_printf(seq, " %lu", +- snmp_fold_field((void **) icmpmsg_statistics, ++ snmp_fold_field((void **) ve_icmpmsg_statistics, + icmpmibmap[i].index | 0x100)); + } + +@@ -313,7 +316,7 @@ + + for (i = 0; snmp4_ipstats_list[i].name != NULL; i++) + seq_printf(seq, " %lu", +- snmp_fold_field((void **)ip_statistics, ++ snmp_fold_field((void **)ve_ip_statistics, + snmp4_ipstats_list[i].entry)); + + icmp_put(seq); /* RFC 2011 compatibility */ +@@ -328,11 +331,11 @@ + /* MaxConn field is signed, RFC 2012 */ + if (snmp4_tcp_list[i].entry == TCP_MIB_MAXCONN) + seq_printf(seq, " %ld", +- snmp_fold_field((void **)tcp_statistics, ++ snmp_fold_field((void **)ve_tcp_statistics, + snmp4_tcp_list[i].entry)); + else + seq_printf(seq, " %lu", +- snmp_fold_field((void **)tcp_statistics, ++ snmp_fold_field((void **)ve_tcp_statistics, + snmp4_tcp_list[i].entry)); + } + +@@ -343,7 +346,7 @@ + seq_puts(seq, "\nUdp:"); + for (i = 0; snmp4_udp_list[i].name != NULL; i++) + seq_printf(seq, " %lu", +- snmp_fold_field((void **)udp_statistics, ++ snmp_fold_field((void **)ve_udp_statistics, + snmp4_udp_list[i].entry)); + + /* the UDP and UDP-Lite MIBs are the same */ +@@ -354,7 +357,7 @@ + seq_puts(seq, "\nUdpLite:"); + for (i = 0; snmp4_udp_list[i].name != NULL; i++) + seq_printf(seq, " %lu", +- snmp_fold_field((void **)udplite_statistics, ++ snmp_fold_field((void **)ve_udplite_statistics, + snmp4_udp_list[i].entry)); + + seq_putc(seq, '\n'); +@@ -390,7 +393,7 @@ + seq_puts(seq, "\nTcpExt:"); + for (i = 0; snmp4_net_list[i].name != NULL; i++) + seq_printf(seq, " %lu", +- snmp_fold_field((void **)net_statistics, ++ snmp_fold_field((void **)ve_net_statistics, + snmp4_net_list[i].entry)); + + seq_puts(seq, "\nIpExt:"); +@@ -400,7 +403,7 @@ + seq_puts(seq, "\nIpExt:"); + for (i = 0; snmp4_ipextstats_list[i].name != NULL; i++) + seq_printf(seq, " %lu", +- snmp_fold_field((void **)ip_statistics, ++ snmp_fold_field((void **)ve_ip_statistics, + snmp4_ipextstats_list[i].entry)); + + seq_putc(seq, '\n'); +@@ -420,26 +423,38 @@ + .release = single_release, + }; + +-int __init ip_misc_proc_init(void) ++static int ipv4_proc_net_init(struct net *net) + { +- int rc = 0; +- +- if (!proc_net_fops_create(&init_net, "netstat", S_IRUGO, &netstat_seq_fops)) ++ if (!proc_net_fops_create(net, "netstat", S_IRUGO, &netstat_seq_fops)) + goto out_netstat; +- +- if (!proc_net_fops_create(&init_net, "snmp", S_IRUGO, &snmp_seq_fops)) ++ if (!proc_net_fops_create(net, "snmp", S_IRUGO, &snmp_seq_fops)) + goto out_snmp; +- +- if (!proc_net_fops_create(&init_net, "sockstat", S_IRUGO, &sockstat_seq_fops)) +- goto out_sockstat; +-out: +- return rc; +-out_sockstat: +- proc_net_remove(&init_net, "snmp"); ++ return 0; + out_snmp: +- proc_net_remove(&init_net, "netstat"); ++ proc_net_remove(net, "netstat"); + out_netstat: +- rc = -ENOMEM; +- goto out; ++ return -ENOMEM; + } + ++static void ipv4_proc_net_exit(struct net *net) ++{ ++ proc_net_remove(net, "snmp"); ++ proc_net_remove(net, "netstat"); ++} ++ ++static struct pernet_operations ipv4_proc_net_ops = { ++ .init = ipv4_proc_net_init, ++ .exit = ipv4_proc_net_exit, ++}; ++ ++int __init ip_misc_proc_init(void) ++{ ++ int rv; ++ ++ if (!proc_net_fops_create(&init_net, "sockstat", S_IRUGO, &sockstat_seq_fops)) ++ return -ENOMEM; ++ rv = register_pernet_subsys(&ipv4_proc_net_ops); ++ if (rv < 0) ++ proc_net_remove(&init_net, "sockstat"); ++ return rv; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/raw.c debian/binary-custom.d/openvz/src/net/ipv4/raw.c +--- ./net/ipv4/raw.c 2012-06-12 16:25:24.410312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/raw.c 2012-11-13 15:20:15.668569055 +0000 +@@ -114,7 +114,8 @@ + if (inet->num == num && + !(inet->daddr && inet->daddr != raddr) && + !(inet->rcv_saddr && inet->rcv_saddr != laddr) && +- !(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)) ++ !(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif) && ++ ve_accessible_strict(sk->owner_env, get_exec_env())) + goto found; /* gotcha */ + } + sk = NULL; +@@ -804,8 +805,12 @@ + struct hlist_node *node; + + sk_for_each(sk, node, &raw_v4_htable[state->bucket]) +- if (sk->sk_family == PF_INET) ++ if (sk->sk_family == PF_INET) { ++ if (!ve_accessible(sk->owner_env, ++ get_exec_env())) ++ continue; + goto found; ++ } + } + sk = NULL; + found: +@@ -819,8 +824,13 @@ + do { + sk = sk_next(sk); + try_again: +- ; +- } while (sk && sk->sk_family != PF_INET); ++ if (!sk) ++ break; ++ if (sk->sk_family != PF_INET) ++ continue; ++ if (ve_accessible(sk->owner_env, get_exec_env())) ++ break; ++ } while (1); + + if (!sk && ++state->bucket < RAWV4_HTABLE_SIZE) { + sk = sk_head(&raw_v4_htable[state->bucket]); +@@ -919,15 +929,30 @@ + .release = seq_release_private, + }; + +-int __init raw_proc_init(void) ++static int raw_net_init(struct net *net) + { +- if (!proc_net_fops_create(&init_net, "raw", S_IRUGO, &raw_seq_fops)) ++ if (!proc_net_fops_create(net, "raw", S_IRUGO, &raw_seq_fops)) + return -ENOMEM; + return 0; + } + ++static void raw_net_exit(struct net *net) ++{ ++ proc_net_remove(net, "raw"); ++} ++ ++static struct pernet_operations raw_net_ops = { ++ .init = raw_net_init, ++ .exit = raw_net_exit, ++}; ++ ++int __init raw_proc_init(void) ++{ ++ return register_pernet_subsys(&raw_net_ops); ++} ++ + void __init raw_proc_exit(void) + { +- proc_net_remove(&init_net, "raw"); ++ unregister_pernet_subsys(&raw_net_ops); + } + #endif /* CONFIG_PROC_FS */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/route.c debian/binary-custom.d/openvz/src/net/ipv4/route.c +--- ./net/ipv4/route.c 2012-06-12 16:25:24.410312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/route.c 2012-11-13 15:20:15.672569054 +0000 +@@ -71,6 +71,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -117,6 +118,8 @@ + + #define RT_GC_TIMEOUT (300*HZ) + ++int ip_rt_src_check = 1; ++ + static int ip_rt_min_delay = 2 * HZ; + static int ip_rt_max_delay = 10 * HZ; + static int ip_rt_max_size; +@@ -267,11 +270,28 @@ + rt_hash_code((__force u32)(__be32)(daddr),\ + (__force u32)(__be32)(saddr) ^ ((idx) << 5)) + ++void prepare_rt_cache(void) ++{ ++#ifdef CONFIG_VE ++ struct rtable *r; ++ int i; ++ ++ for (i = rt_hash_mask; i >= 0; i--) { ++ spin_lock_bh(rt_hash_lock_addr(i)); ++ for (r = rt_hash_table[i].chain; r; r = r->u.dst.rt_next) { ++ r->fl.owner_env = get_ve0(); ++ } ++ spin_unlock_bh(rt_hash_lock_addr(i)); ++ } ++#endif ++} ++ + #ifdef CONFIG_PROC_FS + struct rt_cache_iter_state { + int bucket; + }; + ++static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r); + static struct rtable *rt_cache_get_first(struct seq_file *seq) + { + struct rtable *r = NULL; +@@ -284,6 +304,8 @@ + break; + rcu_read_unlock_bh(); + } ++ if (r && !ve_accessible_strict(r->fl.owner_env, get_exec_env())) ++ return rt_cache_get_next(seq, r); + return rcu_dereference(r); + } + +@@ -291,6 +313,7 @@ + { + struct rt_cache_iter_state *st = seq->private; + ++loop: + r = r->u.dst.rt_next; + while (!r) { + rcu_read_unlock_bh(); +@@ -299,6 +322,8 @@ + rcu_read_lock_bh(); + r = rt_hash_table[st->bucket].chain; + } ++ if (r && !ve_accessible_strict(r->fl.owner_env, get_exec_env())) ++ goto loop; + return rcu_dereference(r); + } + +@@ -557,7 +582,8 @@ + (*(u16 *)&fl1->nl_u.ip4_u.tos ^ + *(u16 *)&fl2->nl_u.ip4_u.tos) | + (fl1->oif ^ fl2->oif) | +- (fl1->iif ^ fl2->iif)) == 0; ++ (fl1->iif ^ fl2->iif)) == 0 && ++ ve_accessible_strict(fl1->owner_env, fl2->owner_env); + } + + static void rt_check_expire(struct work_struct *work) +@@ -609,26 +635,105 @@ + schedule_delayed_work(&expires_work, ip_rt_gc_interval); + } + ++typedef unsigned long rt_flush_gen_t; ++ ++#ifdef CONFIG_VE ++ ++static rt_flush_gen_t rt_flush_gen; ++ ++/* called under rt_flush_lock */ ++static void set_rt_flush_required(struct ve_struct *env) ++{ ++ /* ++ * If the global generation rt_flush_gen is equal to G, then ++ * the pass considering entries labelled by G is yet to come. ++ */ ++ env->rt_flush_required = rt_flush_gen; ++} ++ ++static spinlock_t rt_flush_lock; ++static rt_flush_gen_t reset_rt_flush_required(void) ++{ ++ rt_flush_gen_t g; ++ ++ spin_lock_bh(&rt_flush_lock); ++ g = rt_flush_gen++; ++ spin_unlock_bh(&rt_flush_lock); ++ return g; ++} ++ ++static int check_rt_flush_required(struct ve_struct *env, rt_flush_gen_t gen) ++{ ++ /* can be checked without the lock */ ++ return env->rt_flush_required >= gen; ++} ++ ++#else ++ ++static void set_rt_flush_required(struct ve_struct *env) ++{ ++} ++ ++static rt_flush_gen_t reset_rt_flush_required(void) ++{ ++ return 0; ++} ++ ++#endif ++ + /* This can run from both BH and non-BH contexts, the latter + * in the case of a forced flush event. + */ + static void rt_run_flush(unsigned long dummy) + { + int i; +- struct rtable *rth, *next; ++ struct rtable * rth, * next; ++ struct rtable * tail; ++ rt_flush_gen_t gen; + + rt_deadline = 0; + + get_random_bytes(&rt_hash_rnd, 4); + ++ gen = reset_rt_flush_required(); ++ + for (i = rt_hash_mask; i >= 0; i--) { ++#ifdef CONFIG_VE ++ struct rtable ** prev, * p; ++ ++ spin_lock_bh(rt_hash_lock_addr(i)); ++ rth = rt_hash_table[i].chain; ++ ++ /* defer releasing the head of the list after spin_unlock */ ++ for (tail = rth; tail; tail = tail->u.dst.rt_next) ++ if (!check_rt_flush_required(tail->fl.owner_env, gen)) ++ break; ++ if (rth != tail) ++ rt_hash_table[i].chain = tail; ++ ++ /* call rt_free on entries after the tail requiring flush */ ++ prev = &rt_hash_table[i].chain; ++ for (p = *prev; p; p = next) { ++ next = p->u.dst.rt_next; ++ if (!check_rt_flush_required(p->fl.owner_env, gen)) { ++ prev = &p->u.dst.rt_next; ++ } else { ++ *prev = next; ++ rt_free(p); ++ } ++ } ++ ++#else + spin_lock_bh(rt_hash_lock_addr(i)); + rth = rt_hash_table[i].chain; + if (rth) + rt_hash_table[i].chain = NULL; ++ tail = NULL; ++ ++#endif + spin_unlock_bh(rt_hash_lock_addr(i)); + +- for (; rth; rth = next) { ++ for (; rth != tail; rth = next) { + next = rth->u.dst.rt_next; + rt_free(rth); + } +@@ -664,6 +769,8 @@ + delay = tmo; + } + ++ set_rt_flush_required(get_exec_env()); ++ + if (delay <= 0) { + spin_unlock_bh(&rt_flush_lock); + rt_run_flush(0); +@@ -679,9 +786,30 @@ + + static void rt_secret_rebuild(unsigned long dummy) + { ++ int i; ++ struct rtable *rth, *next; + unsigned long now = jiffies; + +- rt_cache_flush(0); ++ spin_lock_bh(&rt_flush_lock); ++ del_timer(&rt_flush_timer); ++ spin_unlock_bh(&rt_flush_lock); ++ ++ rt_deadline = 0; ++ get_random_bytes(&rt_hash_rnd, 4); ++ ++ for (i = rt_hash_mask; i >= 0; i--) { ++ spin_lock_bh(rt_hash_lock_addr(i)); ++ rth = rt_hash_table[i].chain; ++ if (rth) ++ rt_hash_table[i].chain = NULL; ++ spin_unlock_bh(rt_hash_lock_addr(i)); ++ ++ for (; rth; rth = next) { ++ next = rth->u.dst.rt_next; ++ rt_free(rth); ++ } ++ } ++ + mod_timer(&rt_secret_timer, now + ip_rt_secret_interval); + } + +@@ -1027,6 +1155,9 @@ + __be32 skeys[2] = { saddr, 0 }; + int ikeys[2] = { dev->ifindex, 0 }; + struct netevent_redirect netevent; ++ struct ve_struct *ve; ++ ++ ve = get_exec_env(); + + if (!in_dev) + return; +@@ -1058,6 +1189,10 @@ + if (rth->fl.fl4_dst != daddr || + rth->fl.fl4_src != skeys[i] || + rth->fl.oif != ikeys[k] || ++#ifdef CONFIG_VE ++ !ve_accessible_strict(rth->fl.owner_env, ++ ve) || ++#endif + rth->fl.iif != 0) { + rthp = &rth->u.dst.rt_next; + continue; +@@ -1096,6 +1231,9 @@ + rt->u.dst.neighbour = NULL; + rt->u.dst.hh = NULL; + rt->u.dst.xfrm = NULL; ++#ifdef CONFIG_VE ++ rt->fl.owner_env = ve; ++#endif + + rt->rt_flags |= RTCF_REDIRECTED; + +@@ -1390,8 +1528,9 @@ + { + struct rtable *rt = (struct rtable *) dst; + struct in_device *idev = rt->idev; +- if (dev != init_net.loopback_dev && idev && idev->dev == dev) { +- struct in_device *loopback_idev = in_dev_get(init_net.loopback_dev); ++ if (dev != dev->nd_net->loopback_dev && idev && idev->dev == dev) { ++ struct in_device *loopback_idev = ++ in_dev_get(dev->nd_net->loopback_dev); + if (loopback_idev) { + rt->idev = loopback_idev; + in_dev_put(idev); +@@ -1541,9 +1680,12 @@ + #ifdef CONFIG_NET_CLS_ROUTE + rth->u.dst.tclassid = itag; + #endif ++#ifdef CONFIG_VE ++ rth->fl.owner_env = get_exec_env(); ++#endif + rth->rt_iif = + rth->fl.iif = dev->ifindex; +- rth->u.dst.dev = init_net.loopback_dev; ++ rth->u.dst.dev = get_exec_env()->ve_netns->loopback_dev; + dev_hold(rth->u.dst.dev); + rth->idev = in_dev_get(rth->u.dst.dev); + rth->fl.oif = 0; +@@ -1679,6 +1821,9 @@ + rth->fl.fl4_src = saddr; + rth->rt_src = saddr; + rth->rt_gateway = daddr; ++#ifdef CONFIG_VE ++ rth->fl.owner_env = get_exec_env(); ++#endif + rth->rt_iif = + rth->fl.iif = in_dev->dev->ifindex; + rth->u.dst.dev = (out_dev)->dev; +@@ -1800,7 +1945,7 @@ + if (res.type == RTN_LOCAL) { + int result; + result = fib_validate_source(saddr, daddr, tos, +- init_net.loopback_dev->ifindex, ++ get_exec_env()->ve_netns->loopback_dev->ifindex, + dev, &spec_dst, &itag); + if (result < 0) + goto martian_source; +@@ -1862,11 +2007,14 @@ + #endif + rth->rt_iif = + rth->fl.iif = dev->ifindex; +- rth->u.dst.dev = init_net.loopback_dev; ++ rth->u.dst.dev = get_exec_env()->ve_netns->loopback_dev; + dev_hold(rth->u.dst.dev); + rth->idev = in_dev_get(rth->u.dst.dev); + rth->rt_gateway = daddr; + rth->rt_spec_dst= spec_dst; ++#ifdef CONFIG_VE ++ rth->fl.owner_env = get_exec_env(); ++#endif + rth->u.dst.input= ip_local_deliver; + rth->rt_flags = flags|RTCF_LOCAL; + if (res.type == RTN_UNREACHABLE) { +@@ -1934,6 +2082,9 @@ + rth->fl.iif == iif && + rth->fl.oif == 0 && + rth->fl.mark == skb->mark && ++#ifdef CONFIG_VE ++ rth->fl.owner_env == get_exec_env() && ++#endif + rth->fl.fl4_tos == tos) { + dst_use(&rth->u.dst, jiffies); + RT_CACHE_STAT_INC(in_hit); +@@ -2051,6 +2202,9 @@ + rth->fl.mark = oldflp->mark; + rth->rt_dst = fl->fl4_dst; + rth->rt_src = fl->fl4_src; ++#ifdef CONFIG_VE ++ rth->fl.owner_env = get_exec_env(); ++#endif + rth->rt_iif = oldflp->oif ? : dev_out->ifindex; + /* get references to the devices that are to be hold by the routing + cache entry */ +@@ -2122,6 +2276,8 @@ + + static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp) + { ++ struct net *net = get_exec_env()->ve_netns; ++ struct net_device * loopback_dev = net->loopback_dev; + u32 tos = RT_FL_TOS(oldflp); + struct flowi fl = { .nl_u = { .ip4_u = + { .daddr = oldflp->fl4_dst, +@@ -2132,7 +2288,7 @@ + RT_SCOPE_UNIVERSE), + } }, + .mark = oldflp->mark, +- .iif = init_net.loopback_dev->ifindex, ++ .iif = loopback_dev->ifindex, + .oif = oldflp->oif }; + struct fib_result res; + unsigned flags = 0; +@@ -2153,10 +2309,13 @@ + ZERONET(oldflp->fl4_src)) + goto out; + +- /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */ +- dev_out = ip_dev_find(oldflp->fl4_src); +- if (dev_out == NULL) +- goto out; ++ if (ip_rt_src_check) { ++ /* It is equivalent to ++ inet_addr_type(saddr) == RTN_LOCAL */ ++ dev_out = ip_dev_find(oldflp->fl4_src); ++ if (dev_out == NULL) ++ goto out; ++ } + + /* I removed check for oif == dev_out->oif here. + It was wrong for two reasons: +@@ -2183,6 +2342,12 @@ + Luckily, this hack is good workaround. + */ + ++ if (dev_out == NULL) { ++ dev_out = ip_dev_find(oldflp->fl4_src); ++ if (dev_out == NULL) ++ goto out; ++ } ++ + fl.oif = dev_out->ifindex; + goto make_route; + } +@@ -2193,7 +2358,7 @@ + + + if (oldflp->oif) { +- dev_out = dev_get_by_index(&init_net, oldflp->oif); ++ dev_out = dev_get_by_index(net, oldflp->oif); + err = -ENODEV; + if (dev_out == NULL) + goto out; +@@ -2226,9 +2391,9 @@ + fl.fl4_dst = fl.fl4_src = htonl(INADDR_LOOPBACK); + if (dev_out) + dev_put(dev_out); +- dev_out = init_net.loopback_dev; ++ dev_out = loopback_dev; + dev_hold(dev_out); +- fl.oif = init_net.loopback_dev->ifindex; ++ fl.oif = loopback_dev->ifindex; + res.type = RTN_LOCAL; + flags |= RTCF_LOCAL; + goto make_route; +@@ -2273,7 +2438,7 @@ + fl.fl4_src = fl.fl4_dst; + if (dev_out) + dev_put(dev_out); +- dev_out = init_net.loopback_dev; ++ dev_out = loopback_dev; + dev_hold(dev_out); + fl.oif = dev_out->ifindex; + if (res.fi) +@@ -2327,6 +2492,7 @@ + rth->fl.iif == 0 && + rth->fl.oif == flp->oif && + rth->fl.mark == flp->mark && ++ ve_accessible_strict(rth->fl.owner_env, get_exec_env()) && + !((rth->fl.fl4_tos ^ flp->fl4_tos) & + (IPTOS_RT_MASK | RTO_ONLINK))) { + dst_use(&rth->u.dst, jiffies); +@@ -2532,6 +2698,7 @@ + + static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) + { ++ struct net *net = in_skb->sk->sk_net; + struct rtmsg *rtm; + struct nlattr *tb[RTA_MAX+1]; + struct rtable *rt = NULL; +@@ -2570,7 +2737,7 @@ + if (iif) { + struct net_device *dev; + +- dev = __dev_get_by_index(&init_net, iif); ++ dev = __dev_get_by_index(get_exec_env()->ve_netns, iif); + if (dev == NULL) { + err = -ENODEV; + goto errout_free; +@@ -2611,7 +2778,7 @@ + if (err <= 0) + goto errout_free; + +- err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid); ++ err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).pid); + errout: + return err; + +@@ -2662,22 +2829,22 @@ + } + + #ifdef CONFIG_SYSCTL +-static int flush_delay; ++int ipv4_flush_delay; + +-static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write, ++int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write, + struct file *filp, void __user *buffer, + size_t *lenp, loff_t *ppos) + { + if (write) { + proc_dointvec(ctl, write, filp, buffer, lenp, ppos); +- rt_cache_flush(flush_delay); ++ rt_cache_flush(ipv4_flush_delay); + return 0; + } + + return -EINVAL; + } + +-static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, ++int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, + int __user *name, + int nlen, + void __user *oldval, +@@ -2698,7 +2865,7 @@ + { + .ctl_name = NET_IPV4_ROUTE_FLUSH, + .procname = "flush", +- .data = &flush_delay, ++ .data = &ipv4_flush_delay, + .maxlen = sizeof(int), + .mode = 0200, + .proc_handler = &ipv4_sysctl_rtcache_flush, +@@ -2985,7 +3152,7 @@ + struct proc_dir_entry *rtstat_pde = NULL; /* keep gcc happy */ + if (!proc_net_fops_create(&init_net, "rt_cache", S_IRUGO, &rt_cache_seq_fops) || + !(rtstat_pde = create_proc_entry("rt_cache", S_IRUGO, +- init_net.proc_net_stat))) { ++ init_net.proc_net_stat))) { + return -ENOMEM; + } + rtstat_pde->proc_fops = &rt_cpu_seq_fops; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/sysctl_net_ipv4.c debian/binary-custom.d/openvz/src/net/ipv4/sysctl_net_ipv4.c +--- ./net/ipv4/sysctl_net_ipv4.c 2012-06-12 16:25:24.410312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/sysctl_net_ipv4.c 2012-11-13 15:20:15.672569054 +0000 +@@ -24,6 +24,9 @@ + /* From af_inet.c */ + extern int sysctl_ip_nonlocal_bind; + ++int sysctl_tcp_use_sg = 1; ++EXPORT_SYMBOL(sysctl_tcp_use_sg); ++ + #ifdef CONFIG_SYSCTL + static int zero; + static int tcp_retr1_max = 255; +@@ -35,7 +38,6 @@ + + #ifdef CONFIG_SYSCTL + +-static + int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +@@ -50,7 +52,7 @@ + return ret; + } + +-static int ipv4_sysctl_forward_strategy(ctl_table *table, ++int ipv4_sysctl_forward_strategy(ctl_table *table, + int __user *name, int nlen, + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen) +@@ -292,7 +294,7 @@ + { + .ctl_name = NET_IPV4_FORWARD, + .procname = "ip_forward", +- .data = &IPV4_DEVCONF_ALL(FORWARDING), ++ .data = &IPV4_DEVCONF(ipv4_devconf, FORWARDING), + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &ipv4_sysctl_forward, +@@ -548,6 +550,13 @@ + .mode = 0644, + .proc_handler = &proc_dointvec + }, ++ { ++ .procname = "tcp_use_sg", ++ .data = &sysctl_tcp_use_sg, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, + + #endif + { +@@ -748,6 +757,20 @@ + .extra1 = &zero + }, + { ++ .procname = "tcp_max_tw_kmem_fraction", ++ .data = &sysctl_tcp_max_tw_kmem_fraction, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++ { ++ .procname = "tcp_max_tw_buckets_ub", ++ .data = &sysctl_tcp_max_tw_buckets_ub, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++ { + .ctl_name = NET_TCP_NO_METRICS_SAVE, + .procname = "tcp_no_metrics_save", + .data = &sysctl_tcp_nometrics_save, +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/tcp.c debian/binary-custom.d/openvz/src/net/ipv4/tcp.c +--- ./net/ipv4/tcp.c 2012-06-12 16:25:24.410312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/tcp.c 2012-11-13 15:20:15.672569054 +0000 +@@ -266,6 +266,10 @@ + #include + #include + ++#include ++#include ++#include ++ + #include + #include + +@@ -323,6 +327,7 @@ + unsigned int mask; + struct sock *sk = sock->sk; + struct tcp_sock *tp = tcp_sk(sk); ++ int check_send_space; + + poll_wait(file, sk->sk_sleep, wait); + if (sk->sk_state == TCP_LISTEN) +@@ -337,6 +342,21 @@ + if (sk->sk_err) + mask = POLLERR; + ++ check_send_space = 1; ++#ifdef CONFIG_BEANCOUNTERS ++ if (!(sk->sk_shutdown & SEND_SHUTDOWN) && sock_has_ubc(sk)) { ++ unsigned long size; ++ size = MAX_TCP_HEADER + tp->mss_cache; ++ if (size > SOCK_MIN_UBCSPACE) ++ size = SOCK_MIN_UBCSPACE; ++ size = skb_charge_size(size); ++ if (ub_sock_makewres_tcp(sk, size)) { ++ check_send_space = 0; ++ ub_sock_sndqueueadd_tcp(sk, size); ++ } ++ } ++#endif ++ + /* + * POLLHUP is certainly not done right. But poll() doesn't + * have a notion of HUP in just one direction, and for a +@@ -380,7 +400,7 @@ + sock_flag(sk, SOCK_URGINLINE) || !tp->urg_data)) + mask |= POLLIN | POLLRDNORM; + +- if (!(sk->sk_shutdown & SEND_SHUTDOWN)) { ++ if (check_send_space && !(sk->sk_shutdown & SEND_SHUTDOWN)) { + if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) { + mask |= POLLOUT | POLLWRNORM; + } else { /* send SIGIO later */ +@@ -531,16 +551,24 @@ + int copy, i, can_coalesce; + int offset = poffset % PAGE_SIZE; + int size = min_t(size_t, psize, PAGE_SIZE - offset); ++ unsigned long chargesize = 0; + + if (!tcp_send_head(sk) || (copy = size_goal - skb->len) <= 0) { + new_segment: ++ chargesize = 0; + if (!sk_stream_memory_free(sk)) + goto wait_for_sndbuf; + ++ chargesize = skb_charge_size(MAX_TCP_HEADER + ++ tp->mss_cache); ++ if (ub_sock_getwres_tcp(sk, chargesize) < 0) ++ goto wait_for_ubspace; + skb = sk_stream_alloc_pskb(sk, 0, 0, + sk->sk_allocation); + if (!skb) + goto wait_for_memory; ++ ub_skb_set_charge(skb, sk, chargesize, UB_TCPSNDBUF); ++ chargesize = 0; + + skb_entail(sk, skb); + copy = size_goal; +@@ -596,10 +624,15 @@ + wait_for_sndbuf: + set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); + wait_for_memory: ++ ub_sock_retwres_tcp(sk, chargesize, ++ skb_charge_size(MAX_TCP_HEADER + tp->mss_cache)); ++ chargesize = 0; ++wait_for_ubspace: + if (copied) + tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH); + +- if ((err = sk_stream_wait_memory(sk, &timeo)) != 0) ++ err = __sk_stream_wait_memory(sk, &timeo, chargesize); ++ if (err != 0) + goto do_error; + + mss_now = tcp_current_mss(sk, !(flags&MSG_OOB)); +@@ -636,12 +669,8 @@ + return res; + } + +-#define TCP_PAGE(sk) (sk->sk_sndmsg_page) +-#define TCP_OFF(sk) (sk->sk_sndmsg_off) +- +-static inline int select_size(struct sock *sk) ++static inline int select_size(struct sock *sk, struct tcp_sock *tp) + { +- struct tcp_sock *tp = tcp_sk(sk); + int tmp = tp->mss_cache; + + if (sk->sk_route_caps & NETIF_F_SG) { +@@ -700,6 +729,7 @@ + while (--iovlen >= 0) { + int seglen = iov->iov_len; + unsigned char __user *from = iov->iov_base; ++ unsigned long chargesize = 0; + + iov++; + +@@ -710,18 +740,28 @@ + + if (!tcp_send_head(sk) || + (copy = size_goal - skb->len) <= 0) { ++ unsigned long size; + + new_segment: + /* Allocate new segment. If the interface is SG, + * allocate skb fitting to single page. + */ ++ chargesize = 0; + if (!sk_stream_memory_free(sk)) + goto wait_for_sndbuf; + +- skb = sk_stream_alloc_pskb(sk, select_size(sk), +- 0, sk->sk_allocation); ++ size = select_size(sk, tp); ++ chargesize = skb_charge_size(MAX_TCP_HEADER + ++ size); ++ if (ub_sock_getwres_tcp(sk, chargesize) < 0) ++ goto wait_for_ubspace; ++ skb = sk_stream_alloc_pskb(sk, size, 0, ++ sk->sk_allocation); + if (!skb) + goto wait_for_memory; ++ ub_skb_set_charge(skb, sk, chargesize, ++ UB_TCPSNDBUF); ++ chargesize = 0; + + /* + * Check whether we can use HW checksum. +@@ -767,6 +807,7 @@ + } else if (page) { + if (off == PAGE_SIZE) { + put_page(page); ++ ub_sock_tcp_detachpage(sk); + TCP_PAGE(sk) = page = NULL; + off = 0; + } +@@ -780,6 +821,9 @@ + goto wait_for_memory; + + if (!page) { ++ chargesize = PAGE_SIZE; ++ if (ub_sock_tcp_chargepage(sk) < 0) ++ goto wait_for_ubspace; + /* Allocate new cache page. */ + if (!(page = sk_stream_alloc_page(sk))) + goto wait_for_memory; +@@ -811,7 +855,8 @@ + } else if (off + copy < PAGE_SIZE) { + get_page(page); + TCP_PAGE(sk) = page; +- } ++ } else ++ ub_sock_tcp_detachpage(sk); + } + + TCP_OFF(sk) = off + copy; +@@ -842,10 +887,15 @@ + wait_for_sndbuf: + set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); + wait_for_memory: ++ ub_sock_retwres_tcp(sk, chargesize, ++ skb_charge_size(MAX_TCP_HEADER+tp->mss_cache)); ++ chargesize = 0; ++wait_for_ubspace: + if (copied) + tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH); + +- if ((err = sk_stream_wait_memory(sk, &timeo)) != 0) ++ err = __sk_stream_wait_memory(sk, &timeo, chargesize); ++ if (err != 0) + goto do_error; + + mss_now = tcp_current_mss(sk, !(flags&MSG_OOB)); +@@ -945,7 +995,18 @@ + #if TCP_DEBUG + struct sk_buff *skb = skb_peek(&sk->sk_receive_queue); + +- BUG_TRAP(!skb || before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq)); ++ if (!(skb==NULL || before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq))) { ++ printk("KERNEL: assertion: skb==NULL || " ++ "before(tp->copied_seq, skb->end_seq)\n"); ++ printk("VE%u pid %d comm %.16s\n", ++ (get_exec_env() ? VEID(get_exec_env()) : 0), ++ current->pid, current->comm); ++ printk("copied=%d, copied_seq=%d, rcv_nxt=%d\n", copied, ++ tp->copied_seq, tp->rcv_nxt); ++ printk("skb->len=%d, skb->seq=%d, skb->end_seq=%d\n", ++ skb->len, TCP_SKB_CB(skb)->seq, ++ TCP_SKB_CB(skb)->end_seq); ++ } + #endif + + if (inet_csk_ack_scheduled(sk)) { +@@ -1199,7 +1260,23 @@ + goto found_ok_skb; + if (tcp_hdr(skb)->fin) + goto found_fin_ok; +- BUG_TRAP(flags & MSG_PEEK); ++ if (!(flags & MSG_PEEK)) { ++ printk("KERNEL: assertion: flags&MSG_PEEK\n"); ++ printk("VE%u pid %d comm %.16s\n", ++ (get_exec_env() ? ++ VEID(get_exec_env()) : 0), ++ current->pid, current->comm); ++ printk("flags=0x%x, len=%d, copied_seq=%d, " ++ "rcv_nxt=%d\n", flags, ++ (int)len, tp->copied_seq, ++ tp->rcv_nxt); ++ printk("skb->len=%d, *seq=%d, skb->seq=%d, " ++ "skb->end_seq=%d, offset=%d\n", ++ skb->len, *seq, ++ TCP_SKB_CB(skb)->seq, ++ TCP_SKB_CB(skb)->end_seq, ++ offset); ++ } + skb = skb->next; + } while (skb != (struct sk_buff *)&sk->sk_receive_queue); + +@@ -1262,8 +1339,19 @@ + + tp->ucopy.len = len; + +- BUG_TRAP(tp->copied_seq == tp->rcv_nxt || +- (flags & (MSG_PEEK | MSG_TRUNC))); ++ if (!(tp->copied_seq == tp->rcv_nxt || ++ (flags&(MSG_PEEK|MSG_TRUNC)))) { ++ printk("KERNEL: assertion: tp->copied_seq == " ++ "tp->rcv_nxt || ...\n"); ++ printk("VE%u pid %d comm %.16s\n", ++ (get_exec_env() ? ++ VEID(get_exec_env()) : 0), ++ current->pid, current->comm); ++ printk("flags=0x%x, len=%d, copied_seq=%d, " ++ "rcv_nxt=%d\n", flags, ++ (int)len, tp->copied_seq, ++ tp->rcv_nxt); ++ } + + /* Ugly... If prequeue is not empty, we have to + * process it before releasing socket, otherwise +@@ -1639,7 +1727,7 @@ + state = sk->sk_state; + sock_hold(sk); + sock_orphan(sk); +- atomic_inc(sk->sk_prot->orphan_count); ++ ub_inc_orphan_count(sk); + + /* It is the last release_sock in its life. It will remove backlog. */ + release_sock(sk); +@@ -1689,12 +1777,19 @@ + } + } + if (sk->sk_state != TCP_CLOSE) { ++ int orphans = ub_get_orphan_count(sk); ++ + sk_stream_mem_reclaim(sk); +- if (tcp_too_many_orphans(sk, +- atomic_read(sk->sk_prot->orphan_count))) { +- if (net_ratelimit()) ++ if (ub_too_many_orphans(sk, orphans)) { ++ if (net_ratelimit()) { ++ int ubid = 0; ++#ifdef CONFIG_USER_RESOURCE ++ ubid = sock_has_ubc(sk) ? ++ top_beancounter(sock_bc(sk)->ub)->ub_uid : 0; ++#endif + printk(KERN_INFO "TCP: too many of orphaned " +- "sockets\n"); ++ "sockets (%d in CT%d)\n", orphans, ubid); ++ } + tcp_set_state(sk, TCP_CLOSE); + tcp_send_active_reset(sk, GFP_ATOMIC); + NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY); +@@ -1770,6 +1865,7 @@ + tp->snd_ssthresh = 0x7fffffff; + tp->snd_cwnd_cnt = 0; + tp->bytes_acked = 0; ++ tp->advmss = 65535; + tcp_set_ca_state(sk, TCP_CA_Open); + tcp_clear_retrans(tp); + inet_csk_delack_init(sk); +@@ -2412,6 +2508,7 @@ + EXPORT_SYMBOL_GPL(tcp_done); + + extern void __skb_cb_too_small_for_tcp(int, int); ++extern unsigned int nr_free_lowpages(void); + extern struct tcp_congestion_ops tcp_reno; + + static __initdata unsigned long thash_entries; +@@ -2437,7 +2534,7 @@ + tcp_hashinfo.bind_bucket_cachep = + kmem_cache_create("tcp_bind_bucket", + sizeof(struct inet_bind_bucket), 0, +- SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); ++ SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_UBC, NULL); + + /* Size and allocate the main established and bind bucket + * hash tables. +@@ -2505,6 +2602,11 @@ + sysctl_tcp_mem[1] = limit; + sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2; + ++ if (sysctl_tcp_mem[2] - sysctl_tcp_mem[1] > 4096) ++ sysctl_tcp_mem[1] = sysctl_tcp_mem[2] - 4096; ++ if (sysctl_tcp_mem[1] - sysctl_tcp_mem[0] > 4096) ++ sysctl_tcp_mem[0] = sysctl_tcp_mem[1] - 4096; ++ + /* Set per-socket limits to no more than 1/128 the pressure threshold */ + limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7); + max_share = min(4UL*1024*1024, limit); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/tcp_input.c debian/binary-custom.d/openvz/src/net/ipv4/tcp_input.c +--- ./net/ipv4/tcp_input.c 2012-06-12 16:25:24.414312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/tcp_input.c 2012-11-13 15:20:15.676569055 +0000 +@@ -72,6 +72,8 @@ + #include + #include + ++#include ++ + int sysctl_tcp_timestamps __read_mostly = 1; + int sysctl_tcp_window_scaling __read_mostly = 1; + int sysctl_tcp_sack __read_mostly = 1; +@@ -308,7 +310,7 @@ + /* Check #1 */ + if (tp->rcv_ssthresh < tp->window_clamp && + (int)tp->rcv_ssthresh < tcp_space(sk) && +- !tcp_memory_pressure) { ++ ub_tcp_rmem_allows_expand(sk)) { + int incr; + + /* Check #2. Increase window, if skb with such overhead +@@ -377,6 +379,8 @@ + + tp->rcv_ssthresh = min(tp->rcv_ssthresh, tp->window_clamp); + tp->snd_cwnd_stamp = tcp_time_stamp; ++ ++ ub_tcp_update_maxadvmss(sk); + } + + /* 5. Recalculate window clamp after socket hit its memory bounds. */ +@@ -389,7 +393,7 @@ + + if (sk->sk_rcvbuf < sysctl_tcp_rmem[2] && + !(sk->sk_userlocks & SOCK_RCVBUF_LOCK) && +- !tcp_memory_pressure && ++ !ub_tcp_memory_pressure(sk) && + atomic_read(&tcp_memory_allocated) < sysctl_tcp_mem[0]) { + sk->sk_rcvbuf = min(atomic_read(&sk->sk_rmem_alloc), + sysctl_tcp_rmem[2]); +@@ -3757,7 +3761,7 @@ + !sk_stream_rmem_schedule(sk, skb))) { + if (tcp_prune_queue(sk) < 0 || + !sk_stream_rmem_schedule(sk, skb)) +- goto drop; ++ goto drop_part; + } + sk_stream_set_owner_r(skb, sk); + __skb_queue_tail(&sk->sk_receive_queue, skb); +@@ -3801,6 +3805,12 @@ + drop: + __kfree_skb(skb); + return; ++ ++drop_part: ++ if (after(tp->copied_seq, tp->rcv_nxt)) ++ tp->rcv_nxt = tp->copied_seq; ++ __kfree_skb(skb); ++ return; + } + + /* Out of window. F.e. zero window probe. */ +@@ -3972,6 +3982,10 @@ + nskb = alloc_skb(copy+header, GFP_ATOMIC); + if (!nskb) + return; ++ if (ub_tcprcvbuf_charge_forced(skb->sk, nskb) < 0) { ++ kfree_skb(nskb); ++ return; ++ } + + skb_set_mac_header(nskb, skb_mac_header(skb) - skb->head); + skb_set_network_header(nskb, (skb_network_header(skb) - +@@ -4073,7 +4087,7 @@ + + if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) + tcp_clamp_window(sk); +- else if (tcp_memory_pressure) ++ else if (ub_tcp_memory_pressure(sk)) + tp->rcv_ssthresh = min(tp->rcv_ssthresh, 4U * tp->advmss); + + tcp_collapse_ofo_queue(sk); +@@ -4152,7 +4166,7 @@ + return 0; + + /* If we are under global TCP memory pressure, do not expand. */ +- if (tcp_memory_pressure) ++ if (ub_tcp_memory_pressure(sk)) + return 0; + + /* If we are under soft global TCP memory pressure, do not expand. */ +@@ -4597,6 +4611,10 @@ + + if ((int)skb->truesize > sk->sk_forward_alloc) + goto step5; ++ /* This is OK not to try to free memory here. ++ * Do this below on slow path. Den */ ++ if (ub_tcprcvbuf_charge(sk, skb) < 0) ++ goto step5; + + NET_INC_STATS_BH(LINUX_MIB_TCPHPHITS); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/tcp_ipv4.c debian/binary-custom.d/openvz/src/net/ipv4/tcp_ipv4.c +--- ./net/ipv4/tcp_ipv4.c 2012-06-12 16:25:24.414312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/tcp_ipv4.c 2012-11-13 15:20:15.676569055 +0000 +@@ -56,6 +56,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -74,6 +75,8 @@ + #include + #include + ++#include ++ + #include + #include + #include +@@ -721,7 +724,8 @@ + struct tcp_timewait_sock *tcptw = tcp_twsk(sk); + + tcp_v4_send_ack(tcptw, skb, tcptw->tw_snd_nxt, tcptw->tw_rcv_nxt, +- tcptw->tw_rcv_wnd >> tw->tw_rcv_wscale, ++ tcptw->tw_rcv_wnd >> ++ (tw->tw_rcv_wscale & TW_WSCALE_MASK), + tcptw->tw_ts_recent); + + inet_twsk_put(tw); +@@ -1246,6 +1250,7 @@ + .destructor = tcp_v4_reqsk_destructor, + .send_reset = tcp_v4_send_reset, + }; ++EXPORT_SYMBOL_GPL(tcp_request_sock_ops); + + #ifdef CONFIG_TCP_MD5SIG + static struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = { +@@ -1556,6 +1561,10 @@ + int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) + { + struct sock *rsk; ++ struct user_beancounter *ub; ++ ++ ub = set_exec_ub(sock_bc(sk)->ub); ++ + #ifdef CONFIG_TCP_MD5SIG + /* + * We really want to reject the packet as early as possible +@@ -1574,7 +1583,7 @@ + goto reset; + } + TCP_CHECK_TIMER(sk); +- return 0; ++ goto restore_context; + } + + if (skb->len < tcp_hdrlen(skb) || tcp_checksum_complete(skb)) +@@ -1590,7 +1599,7 @@ + rsk = nsk; + goto reset; + } +- return 0; ++ goto restore_context; + } + } + +@@ -1600,6 +1609,9 @@ + goto reset; + } + TCP_CHECK_TIMER(sk); ++ ++restore_context: ++ (void)set_exec_ub(ub); + return 0; + + reset: +@@ -1611,7 +1623,7 @@ + * might be destroyed here. This current version compiles correctly, + * but you have been warned. + */ +- return 0; ++ goto restore_context; + + csum_err: + TCP_INC_STATS_BH(TCP_MIB_INERRS); +@@ -1871,6 +1883,8 @@ + tp->snd_cwnd_clamp = ~0; + tp->mss_cache = 536; + ++ tp->advmss = 65535; /* max value */ ++ + tp->reordering = sysctl_tcp_reordering; + icsk->icsk_ca_ops = &tcp_init_congestion_ops; + +@@ -1932,6 +1946,8 @@ + * If sendmsg cached page exists, toss it. + */ + if (sk->sk_sndmsg_page) { ++ /* queue is empty, uncharge */ ++ ub_sock_tcp_detachpage(sk); + __free_page(sk->sk_sndmsg_page); + sk->sk_sndmsg_page = NULL; + } +@@ -1946,16 +1962,34 @@ + #ifdef CONFIG_PROC_FS + /* Proc filesystem TCP sock list dumping. */ + +-static inline struct inet_timewait_sock *tw_head(struct hlist_head *head) ++static inline struct inet_timewait_sock *tw_head(struct hlist_head *head, ++ envid_t veid) + { +- return hlist_empty(head) ? NULL : +- list_entry(head->first, struct inet_timewait_sock, tw_node); ++ struct inet_timewait_sock *tw; ++ struct hlist_node *pos; ++ ++ if (hlist_empty(head)) ++ return NULL; ++ hlist_for_each_entry(tw, pos, head, tw_node) { ++ if (!ve_accessible_veid(tw->tw_owner_env, veid)) ++ continue; ++ return tw; ++ } ++ return NULL; + } + +-static inline struct inet_timewait_sock *tw_next(struct inet_timewait_sock *tw) ++static inline struct inet_timewait_sock * ++ tw_next(struct inet_timewait_sock *tw, envid_t veid) + { +- return tw->tw_node.next ? +- hlist_entry(tw->tw_node.next, typeof(*tw), tw_node) : NULL; ++ while (1) { ++ if (tw->tw_node.next == NULL) ++ return NULL; ++ tw = hlist_entry(tw->tw_node.next, typeof(*tw), tw_node); ++ if (!ve_accessible_veid(tw->tw_owner_env, veid)) ++ continue; ++ return tw; ++ } ++ return NULL; /* make compiler happy */ + } + + static void *listening_get_next(struct seq_file *seq, void *cur) +@@ -1964,7 +1998,9 @@ + struct hlist_node *node; + struct sock *sk = cur; + struct tcp_iter_state* st = seq->private; ++ struct ve_struct *ve; + ++ ve = get_exec_env(); + if (!sk) { + st->bucket = 0; + sk = sk_head(&tcp_hashinfo.listening_hash[0]); +@@ -2004,6 +2040,8 @@ + } + get_sk: + sk_for_each_from(sk, node) { ++ if (!ve_accessible(sk->owner_env, ve)) ++ continue; + if (sk->sk_family == st->family) { + cur = sk; + goto out; +@@ -2044,7 +2082,9 @@ + { + struct tcp_iter_state* st = seq->private; + void *rc = NULL; ++ struct ve_struct *ve; + ++ ve = get_exec_env(); + for (st->bucket = 0; st->bucket < tcp_hashinfo.ehash_size; ++st->bucket) { + struct sock *sk; + struct hlist_node *node; +@@ -2053,6 +2093,8 @@ + + read_lock_bh(lock); + sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) { ++ if (!ve_accessible(sk->owner_env, ve)) ++ continue; + if (sk->sk_family != st->family) { + continue; + } +@@ -2062,6 +2104,8 @@ + st->state = TCP_SEQ_STATE_TIME_WAIT; + inet_twsk_for_each(tw, node, + &tcp_hashinfo.ehash[st->bucket].twchain) { ++ if (!ve_accessible_veid(tw->tw_owner_env, VEID(ve))) ++ continue; + if (tw->tw_family != st->family) { + continue; + } +@@ -2081,16 +2125,17 @@ + struct inet_timewait_sock *tw; + struct hlist_node *node; + struct tcp_iter_state* st = seq->private; ++ struct ve_struct *ve; + ++ ve = get_exec_env(); + ++st->num; + + if (st->state == TCP_SEQ_STATE_TIME_WAIT) { + tw = cur; +- tw = tw_next(tw); ++ tw = tw_next(tw, VEID(ve)); + get_tw: +- while (tw && tw->tw_family != st->family) { +- tw = tw_next(tw); +- } ++ while (tw && tw->tw_family != st->family) ++ tw = tw_next(tw, VEID(ve)); + if (tw) { + cur = tw; + goto out; +@@ -2109,12 +2154,14 @@ + sk = sk_next(sk); + + sk_for_each_from(sk, node) { ++ if (!ve_accessible(sk->owner_env, ve)) ++ continue; + if (sk->sk_family == st->family) + goto found; + } + + st->state = TCP_SEQ_STATE_TIME_WAIT; +- tw = tw_head(&tcp_hashinfo.ehash[st->bucket].twchain); ++ tw = tw_head(&tcp_hashinfo.ehash[st->bucket].twchain, VEID(ve)); + goto get_tw; + found: + cur = sk; +@@ -2243,7 +2290,7 @@ + goto out; + } + +-int tcp_proc_register(struct tcp_seq_afinfo *afinfo) ++int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo) + { + int rc = 0; + struct proc_dir_entry *p; +@@ -2256,7 +2303,7 @@ + afinfo->seq_fops->llseek = seq_lseek; + afinfo->seq_fops->release = seq_release_private; + +- p = proc_net_fops_create(&init_net, afinfo->name, S_IRUGO, afinfo->seq_fops); ++ p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops); + if (p) + p->data = afinfo; + else +@@ -2264,12 +2311,12 @@ + return rc; + } + +-void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo) ++void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo) + { + if (!afinfo) + return; +- proc_net_remove(&init_net, afinfo->name); +- memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops)); ++ ++ proc_net_remove(net, afinfo->name); + } + + static void get_openreq4(struct sock *sk, struct request_sock *req, +@@ -2407,14 +2454,29 @@ + .seq_fops = &tcp4_seq_fops, + }; + ++static int tcp4_proc_net_init(struct net *net) ++{ ++ return tcp_proc_register(net, &tcp4_seq_afinfo); ++} ++ ++static void tcp4_proc_net_exit(struct net *net) ++{ ++ tcp_proc_unregister(net, &tcp4_seq_afinfo); ++} ++ ++static struct pernet_operations tcp4_proc_net_ops = { ++ .init = tcp4_proc_net_init, ++ .exit = tcp4_proc_net_exit, ++}; ++ + int __init tcp4_proc_init(void) + { +- return tcp_proc_register(&tcp4_seq_afinfo); ++ return register_pernet_subsys(&tcp4_proc_net_ops); + } + + void tcp4_proc_exit(void) + { +- tcp_proc_unregister(&tcp4_seq_afinfo); ++ unregister_pernet_subsys(&tcp4_proc_net_ops); + } + #endif /* CONFIG_PROC_FS */ + +@@ -2464,6 +2526,87 @@ + panic("Failed to create the TCP control socket.\n"); + } + ++#ifdef CONFIG_VE ++static void tcp_kill_ve_onesk(struct sock *sk) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ ++ /* Check the assumed state of the socket. */ ++ if (!sock_flag(sk, SOCK_DEAD)) { ++ static int printed; ++invalid: ++ if (!printed) ++ printk(KERN_DEBUG "Killing sk: dead %d, state %d, " ++ "wrseq %u unseq %u, wrqu %d.\n", ++ sock_flag(sk, SOCK_DEAD), sk->sk_state, ++ tp->write_seq, tp->snd_una, ++ !skb_queue_empty(&sk->sk_write_queue)); ++ printed = 1; ++ return; ++ } ++ ++ tcp_send_active_reset(sk, GFP_ATOMIC); ++ switch (sk->sk_state) { ++ case TCP_FIN_WAIT1: ++ case TCP_CLOSING: ++ /* In these 2 states the peer may want us to retransmit ++ * some data and/or FIN. Entering "resetting mode" ++ * instead. ++ */ ++ tcp_time_wait(sk, TCP_CLOSE, 0); ++ break; ++ case TCP_FIN_WAIT2: ++ /* By some reason the socket may stay in this state ++ * without turning into a TW bucket. Fix it. ++ */ ++ tcp_time_wait(sk, TCP_FIN_WAIT2, 0); ++ break; ++ case TCP_LAST_ACK: ++ /* Just jump into CLOSED state. */ ++ tcp_done(sk); ++ break; ++ default: ++ /* The socket must be already close()d. */ ++ goto invalid; ++ } ++} ++ ++void tcp_v4_kill_ve_sockets(struct ve_struct *envid) ++{ ++ struct inet_ehash_bucket *head; ++ int i; ++ ++ /* alive */ ++ local_bh_disable(); ++ head = tcp_hashinfo.ehash; ++ for (i = 0; i < tcp_hashinfo.ehash_size; i++) { ++ struct sock *sk; ++ struct hlist_node *node; ++ rwlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, i); ++more_work: ++ write_lock(lock); ++ sk_for_each(sk, node, &head[i].chain) { ++ if (ve_accessible_strict(sk->owner_env, envid)) { ++ sock_hold(sk); ++ write_unlock(lock); ++ ++ bh_lock_sock(sk); ++ /* sk might have disappeared from the hash before ++ * we got the lock */ ++ if (sk->sk_state != TCP_CLOSE) ++ tcp_kill_ve_onesk(sk); ++ bh_unlock_sock(sk); ++ sock_put(sk); ++ goto more_work; ++ } ++ } ++ write_unlock(lock); ++ } ++ local_bh_enable(); ++} ++EXPORT_SYMBOL(tcp_v4_kill_ve_sockets); ++#endif ++ + EXPORT_SYMBOL(ipv4_specific); + EXPORT_SYMBOL(tcp_hashinfo); + EXPORT_SYMBOL(tcp_prot); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/tcp_minisocks.c debian/binary-custom.d/openvz/src/net/ipv4/tcp_minisocks.c +--- ./net/ipv4/tcp_minisocks.c 2012-06-12 16:25:24.414312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/tcp_minisocks.c 2012-11-13 15:20:15.676569055 +0000 +@@ -28,6 +28,9 @@ + #include + #include + ++#include ++#include ++ + #ifdef CONFIG_SYSCTL + #define SYNC_INIT 0 /* let the user enable it */ + #else +@@ -36,6 +39,11 @@ + + int sysctl_tcp_syncookies __read_mostly = SYNC_INIT; + int sysctl_tcp_abort_on_overflow __read_mostly; ++int sysctl_tcp_max_tw_kmem_fraction __read_mostly = 384; ++int sysctl_tcp_max_tw_buckets_ub __read_mostly = 16536; ++ ++EXPORT_SYMBOL(sysctl_tcp_max_tw_kmem_fraction); ++EXPORT_SYMBOL(sysctl_tcp_max_tw_buckets_ub); + + struct inet_timewait_death_row tcp_death_row = { + .sysctl_max_tw_buckets = NR_FILE * 2, +@@ -51,6 +59,7 @@ + .twcal_hand = -1, + .twcal_timer = TIMER_INITIALIZER(inet_twdr_twcal_tick, 0, + (unsigned long)&tcp_death_row), ++ .ub_managed = 1, + }; + + EXPORT_SYMBOL_GPL(tcp_death_row); +@@ -279,7 +288,8 @@ + if (tcp_death_row.sysctl_tw_recycle && tp->rx_opt.ts_recent_stamp) + recycle_ok = icsk->icsk_af_ops->remember_stamp(sk); + +- if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets) ++ if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets && ++ ub_timewait_check(sk, &tcp_death_row)) + tw = inet_twsk_alloc(sk, state); + + if (tw != NULL) { +@@ -292,6 +302,8 @@ + tcptw->tw_rcv_wnd = tcp_receive_window(tp); + tcptw->tw_ts_recent = tp->rx_opt.ts_recent; + tcptw->tw_ts_recent_stamp = tp->rx_opt.ts_recent_stamp; ++ if (sk->sk_user_data != NULL) ++ tw->tw_rcv_wscale |= TW_WSCALE_SPEC; + + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) + if (tw->tw_family == PF_INET6) { +@@ -326,6 +338,7 @@ + } + } while (0); + #endif ++ tw->tw_owner_env = VEID(sk->owner_env); + + /* Linkage updates. */ + __inet_twsk_hashdance(tw, sk, &tcp_hashinfo); +@@ -346,11 +359,16 @@ + TCP_TIMEWAIT_LEN); + inet_twsk_put(tw); + } else { ++ int ubid = 0; + /* Sorry, if we're out of memory, just CLOSE this + * socket up. We've got bigger problems than + * non-graceful socket closings. + */ +- LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow\n"); ++#ifdef CONFIG_BEANCOUNTERS ++ if (sock_has_ubc(sk)) ++ ubid = top_beancounter(sock_bc(sk)->ub)->ub_uid; ++#endif ++ LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow (CT%d)\n", ubid); + } + + tcp_update_metrics(sk); +@@ -391,6 +409,8 @@ + struct tcp_sock *newtp; + + /* Now setup tcp_sock */ ++ newsk->owner_env = sk->owner_env; ++ + newtp = tcp_sk(newsk); + newtp->pred_flags = 0; + newtp->rcv_wup = newtp->copied_seq = newtp->rcv_nxt = treq->rcv_isn + 1; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/tcp_output.c debian/binary-custom.d/openvz/src/net/ipv4/tcp_output.c +--- ./net/ipv4/tcp_output.c 2012-06-12 16:25:24.418312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/tcp_output.c 2012-11-13 15:20:15.676569055 +0000 +@@ -41,6 +41,9 @@ + #include + #include + ++#include ++#include ++ + /* People can turn this off for buggy TCP's found in printers etc. */ + int sysctl_tcp_retrans_collapse __read_mostly = 1; + +@@ -439,6 +442,13 @@ + #endif + } + ++static int skb_header_size(struct sock *sk, int tcp_hlen) ++{ ++ struct ip_options *opt = inet_sk(sk)->opt; ++ return tcp_hlen + sizeof(struct iphdr) + ++ (opt ? opt->optlen : 0) + ETH_HLEN /* For hard header */; ++} ++ + /* This routine actually transmits TCP packets queued in by + * tcp_do_sendmsg(). This is used by both the initial + * transmission and possible later retransmissions. +@@ -457,6 +467,7 @@ + struct tcp_sock *tp; + struct tcp_skb_cb *tcb; + int tcp_header_size; ++ int header_size; + #ifdef CONFIG_TCP_MD5SIG + struct tcp_md5sig_key *md5; + __u8 *md5_hash_location; +@@ -516,6 +527,20 @@ + TCPOLEN_SACK_PERBLOCK)); + } + ++ /* Unfortunately, we can have skb from outside world here ++ * with size insufficient for header. It is impossible to make ++ * guess when we queue skb, so the decision should be made ++ * here. Den ++ */ ++ header_size = skb_header_size(sk, tcp_header_size); ++ if (skb->data - header_size < skb->head) { ++ int delta = header_size - skb_headroom(skb); ++ err = pskb_expand_head(skb, SKB_DATA_ALIGN(delta), ++ 0, GFP_ATOMIC); ++ if (err) ++ return err; ++ } ++ + if (tcp_packets_in_flight(tp) == 0) + tcp_ca_event(sk, CA_EVENT_TX_START); + +@@ -692,15 +717,21 @@ + if (nsize < 0) + nsize = 0; + +- if (skb_cloned(skb) && +- skb_is_nonlinear(skb) && +- pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) +- return -ENOMEM; ++ if (skb_cloned(skb) && skb_is_nonlinear(skb)) { ++ if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) ++ return -ENOMEM; ++ ub_skb_uncharge(skb); ++ ub_tcpsndbuf_charge_forced(sk, skb); ++ } + + /* Get a new skb... force flag on. */ + buff = sk_stream_alloc_skb(sk, nsize, GFP_ATOMIC); + if (buff == NULL) + return -ENOMEM; /* We'll just try again later. */ ++ if (ub_tcpsndbuf_charge(sk, buff) < 0) { ++ kfree_skb(buff); ++ return -ENOMEM; ++ } + + sk_charge_skb(sk, buff); + nlen = skb->len - len - nsize; +@@ -1000,6 +1031,8 @@ + return mss_now; + } + ++EXPORT_SYMBOL(tcp_current_mss); ++ + /* Congestion window validation. (RFC2861) */ + + static void tcp_cwnd_validate(struct sock *sk) +@@ -1186,6 +1219,11 @@ + if (unlikely(buff == NULL)) + return -ENOMEM; + ++ if (ub_tcpsndbuf_charge(sk, buff) < 0) { ++ kfree_skb(buff); ++ return -ENOMEM; ++ } ++ + sk_charge_skb(sk, buff); + buff->truesize += nlen; + skb->truesize -= nlen; +@@ -1516,6 +1554,8 @@ + } + } + ++EXPORT_SYMBOL(__tcp_push_pending_frames); ++ + /* Send _single_ skb sitting at the send head. This function requires + * true push pending frames to setup probe timer etc. + */ +@@ -1636,7 +1676,7 @@ + if (free_space < full_space/2) { + icsk->icsk_ack.quick = 0; + +- if (tcp_memory_pressure) ++ if (ub_tcp_shrink_rcvbuf(sk)) + tp->rcv_ssthresh = min(tp->rcv_ssthresh, 4U*tp->advmss); + + if (free_space < mss) +@@ -2080,6 +2120,7 @@ + break; + yield(); + } ++ ub_tcpsndbuf_charge_forced(sk, skb); + + /* Reserve space for headers and prepare control bits. */ + skb_reserve(skb, MAX_TCP_HEADER); +@@ -2150,6 +2191,10 @@ + struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC); + if (nskb == NULL) + return -ENOMEM; ++ if (ub_tcpsndbuf_charge(sk, skb) < 0) { ++ kfree_skb(nskb); ++ return -ENOMEM; ++ } + tcp_unlink_write_queue(skb, sk); + skb_header_release(nskb); + __tcp_add_write_queue_head(sk, nskb); +@@ -2275,6 +2320,7 @@ + struct dst_entry *dst = __sk_dst_get(sk); + struct tcp_sock *tp = tcp_sk(sk); + __u8 rcv_wscale; ++ static int once = 0; + + /* We'll fix this up when we get a response from the other end. + * See tcp_input.c:tcp_rcv_state_process case TCP_SYN_SENT. +@@ -2294,9 +2340,23 @@ + tcp_mtup_init(sk); + tcp_sync_mss(sk, dst_mtu(dst)); + ++ if (!once && dst_metric(dst, RTAX_ADVMSS) == 0) { ++ once = 1; ++ ++ printk("Oops in connect_init! dst->advmss=%d\n", ++ dst_metric(dst, RTAX_ADVMSS)); ++ printk("dst: pmtu=%u\n", dst_metric(dst, RTAX_MTU)); ++ printk("sk->state=%d, tp: ack.rcv_mss=%d, mss_cache=%d, " ++ "advmss=%d, user_mss=%d\n", ++ sk->sk_state, inet_csk(sk)->icsk_ack.rcv_mss, ++ tp->mss_cache, tp->advmss, tp->rx_opt.user_mss); ++ } ++ + if (!tp->window_clamp) + tp->window_clamp = dst_metric(dst, RTAX_WINDOW); + tp->advmss = dst_metric(dst, RTAX_ADVMSS); ++ if (tp->advmss == 0) ++ tp->advmss = 1460; + tcp_initialize_rcv_mss(sk); + + tcp_select_initial_window(tcp_full_space(sk), +@@ -2337,6 +2397,10 @@ + buff = alloc_skb_fclone(MAX_TCP_HEADER + 15, sk->sk_allocation); + if (unlikely(buff == NULL)) + return -ENOBUFS; ++ if (ub_tcpsndbuf_charge(sk, buff) < 0) { ++ kfree_skb(buff); ++ return -ENOBUFS; ++ } + + /* Reserve space for headers. */ + skb_reserve(buff, MAX_TCP_HEADER); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/tcp_timer.c debian/binary-custom.d/openvz/src/net/ipv4/tcp_timer.c +--- ./net/ipv4/tcp_timer.c 2012-06-12 16:25:24.418312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/tcp_timer.c 2012-11-13 15:20:15.684569057 +0000 +@@ -22,6 +22,8 @@ + + #include + #include ++#include ++#include + + int sysctl_tcp_syn_retries __read_mostly = TCP_SYN_RETRIES; + int sysctl_tcp_synack_retries __read_mostly = TCP_SYNACK_RETRIES; +@@ -67,7 +69,8 @@ + static int tcp_out_of_resources(struct sock *sk, int do_reset) + { + struct tcp_sock *tp = tcp_sk(sk); +- int orphans = atomic_read(&tcp_orphan_count); ++ int orphans = ub_get_orphan_count(sk); ++ int orph = orphans; + + /* If peer does not open window for long time, or did not transmit + * anything for long time, penalize it. */ +@@ -78,10 +81,16 @@ + if (sk->sk_err_soft) + orphans <<= 1; + +- if (tcp_too_many_orphans(sk, orphans)) { +- if (net_ratelimit()) +- printk(KERN_INFO "Out of socket memory\n"); +- ++ if (ub_too_many_orphans(sk, orphans)) { ++ if (net_ratelimit()) { ++ int ubid = 0; ++#ifdef CONFIG_USER_RESOURCE ++ ubid = sock_has_ubc(sk) ? ++ top_beancounter(sock_bc(sk)->ub)->ub_uid : 0; ++#endif ++ printk(KERN_INFO "Orphaned socket dropped " ++ "(%d,%d in CT%d)\n", orph, orphans, ubid); ++ } + /* Catch exceptional cases, when connection requires reset. + * 1. Last segment was sent recently. */ + if ((s32)(tcp_time_stamp - tp->lsndtime) <= TCP_TIMEWAIT_LEN || +@@ -167,9 +176,12 @@ + static void tcp_delack_timer(unsigned long data) + { + struct sock *sk = (struct sock*)data; ++ struct ve_struct *env; + struct tcp_sock *tp = tcp_sk(sk); + struct inet_connection_sock *icsk = inet_csk(sk); + ++ env = set_exec_env(sk->owner_env); ++ + bh_lock_sock(sk); + if (sock_owned_by_user(sk)) { + /* Try again later. */ +@@ -218,11 +230,12 @@ + TCP_CHECK_TIMER(sk); + + out: +- if (tcp_memory_pressure) ++ if (ub_tcp_memory_pressure(sk)) + sk_stream_mem_reclaim(sk); + out_unlock: + bh_unlock_sock(sk); + sock_put(sk); ++ (void)set_exec_env(env); + } + + static void tcp_probe_timer(struct sock *sk) +@@ -277,8 +290,11 @@ + static void tcp_retransmit_timer(struct sock *sk) + { + struct tcp_sock *tp = tcp_sk(sk); ++ struct ve_struct *env; + struct inet_connection_sock *icsk = inet_csk(sk); + ++ env = set_exec_env(sk->owner_env); ++ + if (!tp->packets_out) + goto out; + +@@ -375,15 +391,19 @@ + if (icsk->icsk_retransmits > sysctl_tcp_retries1) + __sk_dst_reset(sk); + +-out:; ++out: ++ (void)set_exec_env(env); + } + + static void tcp_write_timer(unsigned long data) + { + struct sock *sk = (struct sock*)data; ++ struct ve_struct *env; + struct inet_connection_sock *icsk = inet_csk(sk); + int event; + ++ env = set_exec_env(sk->owner_env); ++ + bh_lock_sock(sk); + if (sock_owned_by_user(sk)) { + /* Try again later */ +@@ -417,6 +437,7 @@ + out_unlock: + bh_unlock_sock(sk); + sock_put(sk); ++ (void)set_exec_env(env); + } + + /* +@@ -444,10 +465,13 @@ + static void tcp_keepalive_timer (unsigned long data) + { + struct sock *sk = (struct sock *) data; ++ struct ve_struct *env; + struct inet_connection_sock *icsk = inet_csk(sk); + struct tcp_sock *tp = tcp_sk(sk); + __u32 elapsed; + ++ env = set_exec_env(sk->owner_env); ++ + /* Only process if socket is not in use. */ + bh_lock_sock(sk); + if (sock_owned_by_user(sk)) { +@@ -519,4 +543,5 @@ + out: + bh_unlock_sock(sk); + sock_put(sk); ++ (void)set_exec_env(env); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/udp.c debian/binary-custom.d/openvz/src/net/ipv4/udp.c +--- ./net/ipv4/udp.c 2012-06-12 16:25:24.418312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/udp.c 2012-11-13 15:20:15.684569057 +0000 +@@ -115,13 +115,15 @@ + DEFINE_RWLOCK(udp_hash_lock); + + static inline int __udp_lib_lport_inuse(__u16 num, +- const struct hlist_head udptable[]) ++ const struct hlist_head udptable[], ++ struct ve_struct *ve) + { + struct sock *sk; + struct hlist_node *node; + +- sk_for_each(sk, node, &udptable[num & (UDP_HTABLE_SIZE - 1)]) +- if (sk->sk_hash == num) ++ sk_for_each(sk, node, &udptable[udp_hashfn(num, VEID(ve))]) ++ if (sk->sk_hash == num && ++ ve_accessible_strict(sk->owner_env, ve)) + return 1; + return 0; + } +@@ -143,7 +145,9 @@ + struct hlist_head *head; + struct sock *sk2; + int error = 1; ++ struct ve_struct *ve; + ++ ve = get_exec_env(); + write_lock_bh(&udp_hash_lock); + + if (!snum) { +@@ -160,7 +164,7 @@ + for (i = 0; i < UDP_HTABLE_SIZE; i++) { + int size = 0; + +- head = &udptable[rover & (UDP_HTABLE_SIZE - 1)]; ++ head = &udptable[udp_hashfn(rover, VEID(ve))]; + if (hlist_empty(head)) + goto gotit; + +@@ -182,7 +186,7 @@ + /* 2nd pass: find hole in shortest hash chain */ + rover = best; + for (i = 0; i < (1 << 16) / UDP_HTABLE_SIZE; i++) { +- if (! __udp_lib_lport_inuse(rover, udptable)) ++ if (! __udp_lib_lport_inuse(rover, udptable, ve)) + goto gotit; + rover += UDP_HTABLE_SIZE; + if (rover > high) +@@ -197,12 +201,13 @@ + gotit: + snum = rover; + } else { +- head = &udptable[snum & (UDP_HTABLE_SIZE - 1)]; ++ head = &udptable[udp_hashfn(snum, VEID(ve))]; + + sk_for_each(sk2, node, head) + if (sk2->sk_hash == snum && + sk2 != sk && +- (!sk2->sk_reuse || !sk->sk_reuse) && ++ (sk->sk_reuse != 2 && (!sk2->sk_reuse || !sk->sk_reuse)) && ++ ve_accessible_strict(sk2->owner_env, ve) && + (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if + || sk2->sk_bound_dev_if == sk->sk_bound_dev_if) && + (*saddr_comp)(sk, sk2) ) +@@ -212,7 +217,7 @@ + inet_sk(sk)->num = snum; + sk->sk_hash = snum; + if (sk_unhashed(sk)) { +- head = &udptable[snum & (UDP_HTABLE_SIZE - 1)]; ++ head = &udptable[udp_hashfn(snum, VEID(ve))]; + sk_add_node(sk, head); + sock_prot_inc_use(sk->sk_prot); + } +@@ -253,12 +258,15 @@ + struct hlist_node *node; + unsigned short hnum = ntohs(dport); + int badness = -1; ++ struct ve_struct *ve; + ++ ve = get_exec_env(); + read_lock(&udp_hash_lock); +- sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) { ++ sk_for_each(sk, node, &udptable[udp_hashfn(hnum, VEID(ve))]) { + struct inet_sock *inet = inet_sk(sk); + +- if (sk->sk_hash == hnum && !ipv6_only_sock(sk)) { ++ if (sk->sk_hash == hnum && !ipv6_only_sock(sk) && ++ ve_accessible_strict(sk->owner_env, ve)) { + int score = (sk->sk_family == PF_INET ? 1 : 0); + if (inet->rcv_saddr) { + if (inet->rcv_saddr != daddr) +@@ -1047,7 +1055,8 @@ + int dif; + + read_lock(&udp_hash_lock); +- sk = sk_head(&udptable[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]); ++ sk = sk_head(&udptable[udp_hashfn(ntohs(uh->dest), ++ VEID(skb->owner_env))]); + dif = skb->dev->ifindex; + sk = udp_v4_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif); + if (sk) { +@@ -1464,10 +1473,14 @@ + { + struct sock *sk; + struct udp_iter_state *state = seq->private; ++ struct ve_struct *env; + ++ env = get_exec_env(); + for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) { + struct hlist_node *node; + sk_for_each(sk, node, state->hashtable + state->bucket) { ++ if (!ve_accessible(sk->owner_env, env)) ++ continue; + if (sk->sk_family == state->family) + goto found; + } +@@ -1484,8 +1497,13 @@ + do { + sk = sk_next(sk); + try_again: +- ; +- } while (sk && sk->sk_family != state->family); ++ if (!sk) ++ break; ++ if (sk->sk_family != state->family) ++ continue; ++ if (ve_accessible(sk->owner_env, get_exec_env())) ++ break; ++ } while (1); + + if (!sk && ++state->bucket < UDP_HTABLE_SIZE) { + sk = sk_head(state->hashtable + state->bucket); +@@ -1558,7 +1576,7 @@ + } + + /* ------------------------------------------------------------------------ */ +-int udp_proc_register(struct udp_seq_afinfo *afinfo) ++int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo) + { + struct proc_dir_entry *p; + int rc = 0; +@@ -1571,7 +1589,7 @@ + afinfo->seq_fops->llseek = seq_lseek; + afinfo->seq_fops->release = seq_release_private; + +- p = proc_net_fops_create(&init_net, afinfo->name, S_IRUGO, afinfo->seq_fops); ++ p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops); + if (p) + p->data = afinfo; + else +@@ -1579,12 +1597,11 @@ + return rc; + } + +-void udp_proc_unregister(struct udp_seq_afinfo *afinfo) ++void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo) + { + if (!afinfo) + return; +- proc_net_remove(&init_net, afinfo->name); +- memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops)); ++ proc_net_remove(net, afinfo->name); + } + + /* ------------------------------------------------------------------------ */ +@@ -1633,14 +1650,29 @@ + .seq_fops = &udp4_seq_fops, + }; + ++static int udp4_proc_net_init(struct net *net) ++{ ++ return udp_proc_register(net, &udp4_seq_afinfo); ++} ++ ++static void udp4_proc_net_exit(struct net *net) ++{ ++ udp_proc_unregister(net, &udp4_seq_afinfo); ++} ++ ++static struct pernet_operations udp4_proc_net_ops = { ++ .init = udp4_proc_net_init, ++ .exit = udp4_proc_net_exit, ++}; ++ + int __init udp4_proc_init(void) + { +- return udp_proc_register(&udp4_seq_afinfo); ++ return register_pernet_subsys(&udp4_proc_net_ops); + } + + void udp4_proc_exit(void) + { +- udp_proc_unregister(&udp4_seq_afinfo); ++ unregister_pernet_subsys(&udp4_proc_net_ops); + } + #endif /* CONFIG_PROC_FS */ + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/udplite.c debian/binary-custom.d/openvz/src/net/ipv4/udplite.c +--- ./net/ipv4/udplite.c 2012-06-12 16:25:24.418312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/udplite.c 2012-11-13 15:20:15.684569057 +0000 +@@ -92,6 +92,21 @@ + .seq_show = udp4_seq_show, + .seq_fops = &udplite4_seq_fops, + }; ++ ++static int udplite4_proc_net_init(struct net *net) ++{ ++ return udp_proc_register(net, &udplite4_seq_afinfo); ++} ++ ++static void udplite4_proc_net_exit(struct net *net) ++{ ++ udp_proc_unregister(net, &udplite4_seq_afinfo); ++} ++ ++static struct pernet_operations udplite4_proc_net_ops = { ++ .init = udplite4_proc_net_init, ++ .exit = udplite4_proc_net_exit, ++}; + #endif + + void __init udplite4_register(void) +@@ -105,7 +120,7 @@ + inet_register_protosw(&udplite4_protosw); + + #ifdef CONFIG_PROC_FS +- if (udp_proc_register(&udplite4_seq_afinfo)) /* udplite4_proc_init() */ ++ if (register_pernet_subsys(&udplite4_proc_net_ops)) /* udplite4_proc_init() */ + printk(KERN_ERR "%s: Cannot register /proc!\n", __FUNCTION__); + #endif + return; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv4/xfrm4_policy.c debian/binary-custom.d/openvz/src/net/ipv4/xfrm4_policy.c +--- ./net/ipv4/xfrm4_policy.c 2012-06-12 16:25:24.422312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv4/xfrm4_policy.c 2012-11-13 15:20:15.684569057 +0000 +@@ -295,7 +295,8 @@ + + xdst = (struct xfrm_dst *)dst; + if (xdst->u.rt.idev->dev == dev) { +- struct in_device *loopback_idev = in_dev_get(init_net.loopback_dev); ++ struct in_device *loopback_idev = ++ in_dev_get(dev->nd_net->loopback_dev); + BUG_ON(!loopback_idev); + + do { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/addrconf.c debian/binary-custom.d/openvz/src/net/ipv6/addrconf.c +--- ./net/ipv6/addrconf.c 2012-06-12 16:25:24.422312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/addrconf.c 2012-11-13 15:20:15.688569058 +0000 +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -101,6 +102,7 @@ + #define TIME_DELTA(a,b) ((unsigned long)((long)(a) - (long)(b))) + + #ifdef CONFIG_SYSCTL ++static struct addrconf_sysctl_table * __addrconf_sysctl_register(struct inet6_dev *idev, char *devname, int ifindex, struct ipv6_devconf *p); + static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p); + static void addrconf_sysctl_unregister(struct ipv6_devconf *p); + #endif +@@ -129,8 +131,6 @@ + static void addrconf_join_anycast(struct inet6_ifaddr *ifp); + static void addrconf_leave_anycast(struct inet6_ifaddr *ifp); + +-static int addrconf_ifdown(struct net_device *dev, int how); +- + static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); + static void addrconf_dad_timer(unsigned long data); + static void addrconf_dad_completed(struct inet6_ifaddr *ifp); +@@ -145,7 +145,7 @@ + + static ATOMIC_NOTIFIER_HEAD(inet6addr_chain); + +-struct ipv6_devconf ipv6_devconf __read_mostly = { ++struct ipv6_devconf global_ipv6_devconf __read_mostly = { + .forwarding = 0, + .hop_limit = IPV6_DEFAULT_HOPLIMIT, + .mtu6 = IPV6_MIN_MTU, +@@ -178,7 +178,7 @@ + .accept_source_route = 0, /* we do not accept RH0 by default. */ + }; + +-static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = { ++struct ipv6_devconf global_ipv6_devconf_dflt __read_mostly = { + .forwarding = 0, + .hop_limit = IPV6_DEFAULT_HOPLIMIT, + .mtu6 = IPV6_MIN_MTU, +@@ -210,6 +210,12 @@ + .accept_source_route = 0, /* we do not accept RH0 by default. */ + }; + ++#ifdef CONFIG_VE ++#define ipv6_devconf_dflt (*(get_exec_env()->_ipv6_devconf_dflt)) ++#else ++#define ipv6_devconf_dflt global_ipv6_devconf_dflt ++#endif ++ + /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ + const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; + const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; +@@ -375,9 +381,8 @@ + dev->type == ARPHRD_SIT || + #endif + dev->type == ARPHRD_NONE) { +- printk(KERN_INFO +- "%s: Disabled Privacy Extensions\n", +- dev->name); ++ ADBG((KERN_INFO "%s: Disabled Privacy Extensions\n", ++ dev->name)); + ndev->cnf.use_tempaddr = -1; + } else { + in6_dev_hold(ndev); +@@ -458,12 +463,12 @@ + struct inet6_dev *idev; + + read_lock(&dev_base_lock); +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + rcu_read_lock(); + idev = __in6_dev_get(dev); + if (idev) { +- int changed = (!idev->cnf.forwarding) ^ (!ipv6_devconf.forwarding); +- idev->cnf.forwarding = ipv6_devconf.forwarding; ++ int changed = (!idev->cnf.forwarding) ^ (!ve_ipv6_devconf.forwarding); ++ idev->cnf.forwarding = ve_ipv6_devconf.forwarding; + if (changed) + dev_forward_change(idev); + } +@@ -543,7 +548,7 @@ + goto out; + } + +- ifa = kzalloc(sizeof(struct inet6_ifaddr), GFP_ATOMIC); ++ ifa = kzalloc(sizeof(struct inet6_ifaddr), GFP_ATOMIC_UBC); + + if (ifa == NULL) { + ADBG(("ipv6_add_addr: malloc failed\n")); +@@ -936,7 +941,7 @@ + read_lock(&dev_base_lock); + rcu_read_lock(); + +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + struct inet6_dev *idev; + struct inet6_ifaddr *ifa; + +@@ -1231,9 +1236,10 @@ + read_lock_bh(&addrconf_hash_lock); + for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) { + if (ipv6_addr_equal(&ifp->addr, addr) && +- !(ifp->flags&IFA_F_TENTATIVE)) { ++ !(ifp->flags&IFA_F_TENTATIVE) && ++ ve_accessible_strict(ifp->idev->dev->owner_env, get_exec_env())) { + if (dev == NULL || ifp->idev->dev == dev || +- !(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) ++ !((ifp->scope&(IFA_LINK|IFA_HOST)) || strict)) + break; + } + } +@@ -1251,7 +1257,9 @@ + + for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) { + if (ipv6_addr_equal(&ifp->addr, addr)) { +- if (dev == NULL || ifp->idev->dev == dev) ++ if ((dev == NULL && ++ ve_accessible_strict(ifp->idev->dev->owner_env, get_exec_env())) ++ || ifp->idev->dev == dev) + break; + } + } +@@ -1265,9 +1273,10 @@ + + read_lock_bh(&addrconf_hash_lock); + for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) { +- if (ipv6_addr_equal(&ifp->addr, addr)) { ++ if (ipv6_addr_equal(&ifp->addr, addr) && ++ ve_accessible_strict(ifp->idev->dev->owner_env, get_exec_env())) { + if (dev == NULL || ifp->idev->dev == dev || +- !(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) { ++ !((ifp->scope&(IFA_LINK|IFA_HOST)) || strict)) { + in6_ifa_hold(ifp); + break; + } +@@ -1755,7 +1764,7 @@ + + #ifdef CONFIG_IPV6_OPTIMISTIC_DAD + if (in6_dev->cnf.optimistic_dad && +- !ipv6_devconf.forwarding) ++ !ve_ipv6_devconf.forwarding) + addr_flags = IFA_F_OPTIMISTIC; + #endif + +@@ -1875,6 +1884,7 @@ + */ + int addrconf_set_dstaddr(void __user *arg) + { ++ struct net *net = get_exec_env()->ve_netns; + struct in6_ifreq ireq; + struct net_device *dev; + int err = -EINVAL; +@@ -1885,7 +1895,7 @@ + if (copy_from_user(&ireq, arg, sizeof(struct in6_ifreq))) + goto err_exit; + +- dev = __dev_get_by_index(&init_net, ireq.ifr6_ifindex); ++ dev = __dev_get_by_index(net, ireq.ifr6_ifindex); + + err = -ENODEV; + if (dev == NULL) +@@ -1916,7 +1926,7 @@ + + if (err == 0) { + err = -ENOBUFS; +- if ((dev = __dev_get_by_name(&init_net, p.name)) == NULL) ++ if ((dev = __dev_get_by_name(net, p.name)) == NULL) + goto err_exit; + err = dev_open(dev); + } +@@ -1931,7 +1941,7 @@ + /* + * Manual configuration of address on an interface + */ +-static int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen, ++int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen, + __u8 ifa_flags, __u32 prefered_lft, __u32 valid_lft) + { + struct inet6_ifaddr *ifp; +@@ -1946,7 +1956,7 @@ + if (!valid_lft || prefered_lft > valid_lft) + return -EINVAL; + +- if ((dev = __dev_get_by_index(&init_net, ifindex)) == NULL) ++ if ((dev = __dev_get_by_index(get_exec_env()->ve_netns, ifindex)) == NULL) + return -ENODEV; + + if ((idev = addrconf_add_dev(dev)) == NULL) +@@ -1990,6 +2000,7 @@ + + return PTR_ERR(ifp); + } ++EXPORT_SYMBOL_GPL(inet6_addr_add); + + static int inet6_addr_del(int ifindex, struct in6_addr *pfx, int plen) + { +@@ -1997,7 +2008,7 @@ + struct inet6_dev *idev; + struct net_device *dev; + +- if ((dev = __dev_get_by_index(&init_net, ifindex)) == NULL) ++ if ((dev = __dev_get_by_index(get_exec_env()->ve_netns, ifindex)) == NULL) + return -ENODEV; + + if ((idev = __in6_dev_get(dev)) == NULL) +@@ -2030,7 +2041,7 @@ + struct in6_ifreq ireq; + int err; + +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_VE_NET_ADMIN)) + return -EPERM; + + if (copy_from_user(&ireq, arg, sizeof(struct in6_ifreq))) +@@ -2048,7 +2059,7 @@ + struct in6_ifreq ireq; + int err; + +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_VE_NET_ADMIN)) + return -EPERM; + + if (copy_from_user(&ireq, arg, sizeof(struct in6_ifreq))) +@@ -2092,7 +2103,7 @@ + return; + } + +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + struct in_device * in_dev = __in_dev_get_rtnl(dev); + if (in_dev && (dev->flags & IFF_UP)) { + struct in_ifaddr * ifa; +@@ -2162,7 +2173,7 @@ + + #ifdef CONFIG_IPV6_OPTIMISTIC_DAD + if (idev->cnf.optimistic_dad && +- !ipv6_devconf.forwarding) ++ !ve_ipv6_devconf.forwarding) + addr_flags |= IFA_F_OPTIMISTIC; + #endif + +@@ -2244,16 +2255,17 @@ + + static void ip6_tnl_add_linklocal(struct inet6_dev *idev) + { ++ struct net *net = get_exec_env()->ve_netns; + struct net_device *link_dev; + + /* first try to inherit the link-local address from the link device */ + if (idev->dev->iflink && +- (link_dev = __dev_get_by_index(&init_net, idev->dev->iflink))) { ++ (link_dev = __dev_get_by_index(net, idev->dev->iflink))) { + if (!ipv6_inherit_linklocal(idev, link_dev)) + return; + } + /* then try to inherit it from any device */ +- for_each_netdev(&init_net, link_dev) { ++ for_each_netdev(net, link_dev) { + if (!ipv6_inherit_linklocal(idev, link_dev)) + return; + } +@@ -2286,9 +2298,6 @@ + int run_pending = 0; + int err; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + switch(event) { + case NETDEV_REGISTER: + if (!idev && dev->mtu >= IPV6_MIN_MTU) { +@@ -2431,7 +2440,7 @@ + .priority = 0 + }; + +-static int addrconf_ifdown(struct net_device *dev, int how) ++int addrconf_ifdown(struct net_device *dev, int how) + { + struct inet6_dev *idev; + struct inet6_ifaddr *ifa, **bifa; +@@ -2439,7 +2448,7 @@ + + ASSERT_RTNL(); + +- if (dev == init_net.loopback_dev && how == 1) ++ if ((dev->flags & IFF_LOOPBACK) && how == 1) + how = 0; + + rt6_ifdown(dev); +@@ -2452,7 +2461,7 @@ + /* Step 1: remove reference to ipv6 device from parent device. + Do not dev_put! + */ +- if (how == 1) { ++ if (how) { + idev->dead = 1; + + /* protected by rtnl_lock */ +@@ -2484,12 +2493,12 @@ + write_lock_bh(&idev->lock); + + /* Step 3: clear flags for stateless addrconf */ +- if (how != 1) ++ if (!how) + idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); + + /* Step 4: clear address list */ + #ifdef CONFIG_IPV6_PRIVACY +- if (how == 1 && del_timer(&idev->regen_timer)) ++ if (how && del_timer(&idev->regen_timer)) + in6_dev_put(idev); + + /* clear tempaddr list */ +@@ -2526,7 +2535,7 @@ + + /* Step 5: Discard multicast list */ + +- if (how == 1) ++ if (how) + ipv6_mc_destroy_dev(idev); + else + ipv6_mc_down(idev); +@@ -2535,7 +2544,7 @@ + + /* Shot the device (if unregistered) */ + +- if (how == 1) { ++ if (how) { + #ifdef CONFIG_SYSCTL + addrconf_sysctl_unregister(&idev->cnf); + neigh_sysctl_unregister(idev->nd_parms); +@@ -2546,10 +2555,14 @@ + } + return 0; + } ++EXPORT_SYMBOL_GPL(addrconf_ifdown); + + static void addrconf_rs_timer(unsigned long data) + { + struct inet6_ifaddr *ifp = (struct inet6_ifaddr *) data; ++ struct ve_struct *old_env; ++ ++ old_env = set_exec_env(ifp->idev->dev->owner_env); + + if (ifp->idev->cnf.forwarding) + goto out; +@@ -2588,6 +2601,7 @@ + + out: + in6_ifa_put(ifp); ++ (void)set_exec_env(old_env); + } + + /* +@@ -2623,7 +2637,8 @@ + + if (dev->flags&(IFF_NOARP|IFF_LOOPBACK) || + !(ifp->flags&IFA_F_TENTATIVE) || +- ifp->flags & IFA_F_NODAD) { ++ ifp->flags & IFA_F_NODAD || ++ dev->owner_env->disable_net) { + ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC); + spin_unlock_bh(&ifp->lock); + read_unlock_bh(&idev->lock); +@@ -2664,6 +2679,9 @@ + struct inet6_dev *idev = ifp->idev; + struct in6_addr unspec; + struct in6_addr mcaddr; ++ struct ve_struct *old_env; ++ ++ old_env = set_exec_env(ifp->idev->dev->owner_env); + + read_lock_bh(&idev->lock); + if (idev->dead) { +@@ -2696,6 +2714,7 @@ + ndisc_send_ns(ifp->idev->dev, NULL, &ifp->addr, &mcaddr, &unspec); + out: + in6_ifa_put(ifp); ++ (void)set_exec_env(old_env); + } + + static void addrconf_dad_completed(struct inet6_ifaddr *ifp) +@@ -2763,8 +2782,11 @@ + + for (state->bucket = 0; state->bucket < IN6_ADDR_HSIZE; ++state->bucket) { + ifa = inet6_addr_lst[state->bucket]; +- if (ifa) +- break; ++ while (ifa) { ++ if (ve_accessible_strict(ifa->idev->dev->owner_env, get_exec_env())) ++ return ifa; ++ ifa = ifa->lst_next; ++ } + } + return ifa; + } +@@ -2775,6 +2797,11 @@ + + ifa = ifa->lst_next; + try_again: ++ while (ifa) { ++ if (ve_accessible_strict(ifa->idev->dev->owner_env, get_exec_env())) ++ break; ++ ifa = ifa->lst_next; ++ } + if (!ifa && ++state->bucket < IN6_ADDR_HSIZE) { + ifa = inet6_addr_lst[state->bucket]; + goto try_again; +@@ -2847,16 +2874,31 @@ + .release = seq_release_private, + }; + +-int __init if6_proc_init(void) ++static int ipv6_proc_net_init(struct net *net) + { +- if (!proc_net_fops_create(&init_net, "if_inet6", S_IRUGO, &if6_fops)) ++ if (!proc_net_fops_create(net, "if_inet6", S_IRUGO, &if6_fops)) + return -ENOMEM; + return 0; + } + ++static void ipv6_proc_net_exit(struct net *net) ++{ ++ proc_net_remove(net, "if_inet6"); ++} ++ ++static struct pernet_operations ipv6_proc_net_ops = { ++ .init = ipv6_proc_net_init, ++ .exit = ipv6_proc_net_exit, ++}; ++ ++int __init if6_proc_init(void) ++{ ++ return register_pernet_subsys(&ipv6_proc_net_ops); ++} ++ + void if6_proc_exit(void) + { +- proc_net_remove(&init_net, "if_inet6"); ++ unregister_pernet_subsys(&ipv6_proc_net_ops); + } + #endif /* CONFIG_PROC_FS */ + +@@ -2889,6 +2931,7 @@ + struct inet6_ifaddr *ifp; + unsigned long now, next; + int i; ++ struct ve_struct *old_env; + + spin_lock_bh(&addrconf_verify_lock); + now = jiffies; +@@ -2909,6 +2952,8 @@ + if (ifp->flags & IFA_F_PERMANENT) + continue; + ++ old_env = set_exec_env(ifp->idev->dev->owner_env); ++ + spin_lock(&ifp->lock); + age = (now - ifp->tstamp) / HZ; + +@@ -2924,9 +2969,11 @@ + in6_ifa_hold(ifp); + read_unlock(&addrconf_hash_lock); + ipv6_del_addr(ifp); ++ (void)set_exec_env(old_env); + goto restart; + } else if (ifp->prefered_lft == INFINITY_LIFE_TIME) { + spin_unlock(&ifp->lock); ++ set_exec_env(old_env); + continue; + } else if (age >= ifp->prefered_lft) { + /* jiffies - ifp->tsamp > age >= ifp->prefered_lft */ +@@ -2948,6 +2995,7 @@ + + ipv6_ifa_notify(0, ifp); + in6_ifa_put(ifp); ++ (void)set_exec_env(old_env); + goto restart; + } + #ifdef CONFIG_IPV6_PRIVACY +@@ -2969,6 +3017,7 @@ + ipv6_create_tempaddr(ifpub, ifp); + in6_ifa_put(ifpub); + in6_ifa_put(ifp); ++ (void)set_exec_env(old_env); + goto restart; + } + } else if (time_before(ifp->tstamp + ifp->prefered_lft * HZ - regen_advance * HZ, next)) +@@ -2981,6 +3030,7 @@ + next = ifp->tstamp + ifp->prefered_lft * HZ; + spin_unlock(&ifp->lock); + } ++ (void)set_exec_env(old_env); + } + read_unlock(&addrconf_hash_lock); + } +@@ -3102,7 +3152,7 @@ + valid_lft = INFINITY_LIFE_TIME; + } + +- dev = __dev_get_by_index(&init_net, ifm->ifa_index); ++ dev = __dev_get_by_index(get_exec_env()->ve_netns, ifm->ifa_index); + if (dev == NULL) + return -ENODEV; + +@@ -3286,7 +3336,7 @@ + s_ip_idx = ip_idx = cb->args[1]; + + idx = 0; +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + if (idx < s_idx) + goto cont; + if (idx > s_idx) +@@ -3375,6 +3425,7 @@ + static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr* nlh, + void *arg) + { ++ struct net *net = in_skb->sk->sk_net; + struct ifaddrmsg *ifm; + struct nlattr *tb[IFA_MAX+1]; + struct in6_addr *addr = NULL; +@@ -3395,7 +3446,7 @@ + + ifm = nlmsg_data(nlh); + if (ifm->ifa_index) +- dev = __dev_get_by_index(&init_net, ifm->ifa_index); ++ dev = __dev_get_by_index(get_exec_env()->ve_netns, ifm->ifa_index); + + if ((ifa = ipv6_get_ifaddr(addr, dev, 1)) == NULL) { + err = -EADDRNOTAVAIL; +@@ -3415,7 +3466,7 @@ + kfree_skb(skb); + goto errout_ifa; + } +- err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid); ++ err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).pid); + errout_ifa: + in6_ifa_put(ifa); + errout: +@@ -3424,6 +3475,7 @@ + + static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa) + { ++ struct net *net = ifa->idev->dev->nd_net; + struct sk_buff *skb; + int err = -ENOBUFS; + +@@ -3438,10 +3490,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); ++ err = rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err); ++ rtnl_set_sk_err(net, RTNLGRP_IPV6_IFADDR, err); + } + + static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, +@@ -3607,7 +3659,7 @@ + + read_lock(&dev_base_lock); + idx = 0; +- for_each_netdev(&init_net, dev) { ++ for_each_netdev(get_exec_env()->ve_netns, dev) { + if (idx < s_idx) + goto cont; + if ((idev = in6_dev_get(dev)) == NULL) +@@ -3628,6 +3680,7 @@ + + void inet6_ifinfo_notify(int event, struct inet6_dev *idev) + { ++ struct net *net = idev->dev->nd_net; + struct sk_buff *skb; + int err = -ENOBUFS; + +@@ -3642,10 +3695,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); ++ err = rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err); ++ rtnl_set_sk_err(net, RTNLGRP_IPV6_IFADDR, err); + } + + static inline size_t inet6_prefix_nlmsg_size(void) +@@ -3697,6 +3750,7 @@ + static void inet6_prefix_notify(int event, struct inet6_dev *idev, + struct prefix_info *pinfo) + { ++ struct net *net = idev->dev->nd_net; + struct sk_buff *skb; + int err = -ENOBUFS; + +@@ -3711,10 +3765,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, 0, RTNLGRP_IPV6_PREFIX, NULL, GFP_ATOMIC); ++ err = rtnl_notify(skb, net, 0, RTNLGRP_IPV6_PREFIX, NULL, GFP_ATOMIC); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_IPV6_PREFIX, err); ++ rtnl_set_sk_err(net, RTNLGRP_IPV6_PREFIX, err); + } + + static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) +@@ -3766,7 +3820,7 @@ + ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); + + if (write && valp != &ipv6_devconf_dflt.forwarding) { +- if (valp != &ipv6_devconf.forwarding) { ++ if (valp != &ve_ipv6_devconf.forwarding) { + if ((!*valp) ^ (!val)) { + struct inet6_dev *idev = (struct inet6_dev *)ctl->extra1; + if (idev == NULL) +@@ -3774,7 +3828,7 @@ + dev_forward_change(idev); + } + } else { +- ipv6_devconf_dflt.forwarding = ipv6_devconf.forwarding; ++ ipv6_devconf_dflt.forwarding = ve_ipv6_devconf.forwarding; + addrconf_forward_change(); + } + if (*valp) +@@ -3816,7 +3870,7 @@ + } + + if (valp != &ipv6_devconf_dflt.forwarding) { +- if (valp != &ipv6_devconf.forwarding) { ++ if (valp != &ve_ipv6_devconf.forwarding) { + struct inet6_dev *idev = (struct inet6_dev *)table->extra1; + int changed; + if (unlikely(idev == NULL)) +@@ -3852,7 +3906,7 @@ + { + .ctl_name = NET_IPV6_FORWARDING, + .procname = "forwarding", +- .data = &ipv6_devconf.forwarding, ++ .data = &global_ipv6_devconf.forwarding, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &addrconf_sysctl_forward, +@@ -3861,7 +3915,7 @@ + { + .ctl_name = NET_IPV6_HOP_LIMIT, + .procname = "hop_limit", +- .data = &ipv6_devconf.hop_limit, ++ .data = &global_ipv6_devconf.hop_limit, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec, +@@ -3869,7 +3923,7 @@ + { + .ctl_name = NET_IPV6_MTU, + .procname = "mtu", +- .data = &ipv6_devconf.mtu6, ++ .data = &global_ipv6_devconf.mtu6, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3877,7 +3931,7 @@ + { + .ctl_name = NET_IPV6_ACCEPT_RA, + .procname = "accept_ra", +- .data = &ipv6_devconf.accept_ra, ++ .data = &global_ipv6_devconf.accept_ra, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3885,7 +3939,7 @@ + { + .ctl_name = NET_IPV6_ACCEPT_REDIRECTS, + .procname = "accept_redirects", +- .data = &ipv6_devconf.accept_redirects, ++ .data = &global_ipv6_devconf.accept_redirects, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3893,7 +3947,7 @@ + { + .ctl_name = NET_IPV6_AUTOCONF, + .procname = "autoconf", +- .data = &ipv6_devconf.autoconf, ++ .data = &global_ipv6_devconf.autoconf, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3901,7 +3955,7 @@ + { + .ctl_name = NET_IPV6_DAD_TRANSMITS, + .procname = "dad_transmits", +- .data = &ipv6_devconf.dad_transmits, ++ .data = &global_ipv6_devconf.dad_transmits, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3909,7 +3963,7 @@ + { + .ctl_name = NET_IPV6_RTR_SOLICITS, + .procname = "router_solicitations", +- .data = &ipv6_devconf.rtr_solicits, ++ .data = &global_ipv6_devconf.rtr_solicits, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3917,7 +3971,7 @@ + { + .ctl_name = NET_IPV6_RTR_SOLICIT_INTERVAL, + .procname = "router_solicitation_interval", +- .data = &ipv6_devconf.rtr_solicit_interval, ++ .data = &global_ipv6_devconf.rtr_solicit_interval, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec_jiffies, +@@ -3926,7 +3980,7 @@ + { + .ctl_name = NET_IPV6_RTR_SOLICIT_DELAY, + .procname = "router_solicitation_delay", +- .data = &ipv6_devconf.rtr_solicit_delay, ++ .data = &global_ipv6_devconf.rtr_solicit_delay, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec_jiffies, +@@ -3935,7 +3989,7 @@ + { + .ctl_name = NET_IPV6_FORCE_MLD_VERSION, + .procname = "force_mld_version", +- .data = &ipv6_devconf.force_mld_version, ++ .data = &global_ipv6_devconf.force_mld_version, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3944,7 +3998,7 @@ + { + .ctl_name = NET_IPV6_USE_TEMPADDR, + .procname = "use_tempaddr", +- .data = &ipv6_devconf.use_tempaddr, ++ .data = &global_ipv6_devconf.use_tempaddr, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3952,7 +4006,7 @@ + { + .ctl_name = NET_IPV6_TEMP_VALID_LFT, + .procname = "temp_valid_lft", +- .data = &ipv6_devconf.temp_valid_lft, ++ .data = &global_ipv6_devconf.temp_valid_lft, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3960,7 +4014,7 @@ + { + .ctl_name = NET_IPV6_TEMP_PREFERED_LFT, + .procname = "temp_prefered_lft", +- .data = &ipv6_devconf.temp_prefered_lft, ++ .data = &global_ipv6_devconf.temp_prefered_lft, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3968,7 +4022,7 @@ + { + .ctl_name = NET_IPV6_REGEN_MAX_RETRY, + .procname = "regen_max_retry", +- .data = &ipv6_devconf.regen_max_retry, ++ .data = &global_ipv6_devconf.regen_max_retry, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3976,7 +4030,7 @@ + { + .ctl_name = NET_IPV6_MAX_DESYNC_FACTOR, + .procname = "max_desync_factor", +- .data = &ipv6_devconf.max_desync_factor, ++ .data = &global_ipv6_devconf.max_desync_factor, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3985,7 +4039,7 @@ + { + .ctl_name = NET_IPV6_MAX_ADDRESSES, + .procname = "max_addresses", +- .data = &ipv6_devconf.max_addresses, ++ .data = &global_ipv6_devconf.max_addresses, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -3993,7 +4047,7 @@ + { + .ctl_name = NET_IPV6_ACCEPT_RA_DEFRTR, + .procname = "accept_ra_defrtr", +- .data = &ipv6_devconf.accept_ra_defrtr, ++ .data = &global_ipv6_devconf.accept_ra_defrtr, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -4001,7 +4055,7 @@ + { + .ctl_name = NET_IPV6_ACCEPT_RA_PINFO, + .procname = "accept_ra_pinfo", +- .data = &ipv6_devconf.accept_ra_pinfo, ++ .data = &global_ipv6_devconf.accept_ra_pinfo, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -4010,7 +4064,7 @@ + { + .ctl_name = NET_IPV6_ACCEPT_RA_RTR_PREF, + .procname = "accept_ra_rtr_pref", +- .data = &ipv6_devconf.accept_ra_rtr_pref, ++ .data = &global_ipv6_devconf.accept_ra_rtr_pref, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -4018,7 +4072,7 @@ + { + .ctl_name = NET_IPV6_RTR_PROBE_INTERVAL, + .procname = "router_probe_interval", +- .data = &ipv6_devconf.rtr_probe_interval, ++ .data = &global_ipv6_devconf.rtr_probe_interval, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec_jiffies, +@@ -4028,7 +4082,7 @@ + { + .ctl_name = NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, + .procname = "accept_ra_rt_info_max_plen", +- .data = &ipv6_devconf.accept_ra_rt_info_max_plen, ++ .data = &global_ipv6_devconf.accept_ra_rt_info_max_plen, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -4038,7 +4092,7 @@ + { + .ctl_name = NET_IPV6_PROXY_NDP, + .procname = "proxy_ndp", +- .data = &ipv6_devconf.proxy_ndp, ++ .data = &global_ipv6_devconf.proxy_ndp, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -4046,7 +4100,7 @@ + { + .ctl_name = NET_IPV6_ACCEPT_SOURCE_ROUTE, + .procname = "accept_source_route", +- .data = &ipv6_devconf.accept_source_route, ++ .data = &global_ipv6_devconf.accept_source_route, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -4055,7 +4109,7 @@ + { + .ctl_name = CTL_UNNUMBERED, + .procname = "optimistic_dad", +- .data = &ipv6_devconf.optimistic_dad, ++ .data = &global_ipv6_devconf.optimistic_dad, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, +@@ -4112,27 +4166,21 @@ + }, + }; + +-static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p) ++static struct addrconf_sysctl_table *__addrconf_sysctl_register( ++ struct inet6_dev *idev, char *dev_name, ++ int ifindex, struct ipv6_devconf *p) + { + int i; +- struct net_device *dev = idev ? idev->dev : NULL; + struct addrconf_sysctl_table *t; +- char *dev_name = NULL; + + t = kmemdup(&addrconf_sysctl, sizeof(*t), GFP_KERNEL); + if (t == NULL) +- return; ++ return NULL; ++ + for (i=0; t->addrconf_vars[i].data; i++) { +- t->addrconf_vars[i].data += (char*)p - (char*)&ipv6_devconf; ++ t->addrconf_vars[i].data += (char*)p - (char*)&global_ipv6_devconf; + t->addrconf_vars[i].extra1 = idev; /* embedded; no ref */ + } +- if (dev) { +- dev_name = dev->name; +- t->addrconf_dev[0].ctl_name = dev->ifindex; +- } else { +- dev_name = "default"; +- t->addrconf_dev[0].ctl_name = NET_PROTO_CONF_DEFAULT; +- } + + /* + * Make a copy of dev_name, because '.procname' is regarded as const +@@ -4143,6 +4191,7 @@ + if (!dev_name) + goto free; + ++ t->addrconf_dev[0].ctl_name = ifindex; + t->addrconf_dev[0].procname = dev_name; + + t->addrconf_dev[0].child = t->addrconf_vars; +@@ -4153,9 +4202,7 @@ + t->sysctl_header = register_sysctl_table(t->addrconf_root_dir); + if (t->sysctl_header == NULL) + goto free_procname; +- else +- p->sysctl = t; +- return; ++ return t; + + /* error path */ + free_procname: +@@ -4163,7 +4210,26 @@ + free: + kfree(t); + +- return; ++ return NULL; ++} ++ ++static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p) ++{ ++ struct net_device *dev; ++ char *dev_name; ++ int ifindex; ++ ++ dev = idev ? idev->dev : NULL; ++ ++ if (dev) { ++ dev_name = dev->name; ++ ifindex = dev->ifindex; ++ } else { ++ dev_name = "default"; ++ ifindex = NET_PROTO_CONF_DEFAULT; ++ } ++ ++ p->sysctl = __addrconf_sysctl_register(idev, dev_name, ifindex, p); + } + + static void addrconf_sysctl_unregister(struct ipv6_devconf *p) +@@ -4177,9 +4243,64 @@ + } + } + ++#ifdef CONFIG_VE ++int addrconf_sysctl_init(struct ve_struct *ve) ++{ ++ int err = 0; ++ struct ipv6_devconf *conf, *conf_def; + +-#endif ++ err = -ENOMEM; ++ ++ conf = kmalloc(sizeof(*conf), GFP_KERNEL); ++ if (!conf) ++ goto err1; ++ ++ memcpy(conf, &global_ipv6_devconf, sizeof(*conf)); ++ conf->sysctl = __addrconf_sysctl_register(NULL, "all", ++ NET_PROTO_CONF_ALL, conf); ++ if (!conf->sysctl) ++ goto err2; ++ ++ conf_def = kmalloc(sizeof(*conf_def), GFP_KERNEL); ++ if (!conf_def) ++ goto err3; ++ ++ memcpy(conf_def, &global_ipv6_devconf_dflt, sizeof(*conf_def)); ++ conf_def->sysctl = __addrconf_sysctl_register(NULL, "default", ++ NET_PROTO_CONF_DEFAULT, conf_def); ++ if (!conf_def->sysctl) ++ goto err4; ++ ++ ve->_ipv6_devconf = conf; ++ ve->_ipv6_devconf_dflt = conf_def; ++ return 0; ++ ++err4: ++ kfree(conf_def); ++err3: ++ addrconf_sysctl_unregister(conf); ++err2: ++ kfree(conf); ++err1: ++ return err; ++} ++EXPORT_SYMBOL(addrconf_sysctl_init); ++ ++void addrconf_sysctl_fini(struct ve_struct *ve) ++{ ++ addrconf_sysctl_unregister(ve->_ipv6_devconf); ++ addrconf_sysctl_unregister(ve->_ipv6_devconf_dflt); ++} ++EXPORT_SYMBOL(addrconf_sysctl_fini); + ++void addrconf_sysctl_free(struct ve_struct *ve) ++{ ++ kfree(ve->_ipv6_devconf); ++ kfree(ve->_ipv6_devconf_dflt); ++} ++EXPORT_SYMBOL(addrconf_sysctl_free); ++#endif /* CONFIG_VE */ ++#endif /* CONFIG_SYSCTL */ + /* + * Device notifier + */ +@@ -4198,6 +4319,25 @@ + + EXPORT_SYMBOL(unregister_inet6addr_notifier); + ++static void addrconf_net_exit(struct net *net) ++{ ++ struct net_device *dev; ++ ++ rtnl_lock(); ++ /* clean dev list */ ++ for_each_netdev(net, dev) { ++ if (__in6_dev_get(dev) == NULL) ++ continue; ++ addrconf_ifdown(dev, 1); ++ } ++ addrconf_ifdown(net->loopback_dev, 2); ++ rtnl_unlock(); ++} ++ ++static struct pernet_operations addrconf_net_ops = { ++ .exit = addrconf_net_exit, ++}; ++ + /* + * Init / cleanup code + */ +@@ -4206,6 +4346,11 @@ + { + int err = 0; + ++#ifdef CONFIG_VE ++ get_ve0()->_ipv6_devconf = &global_ipv6_devconf; ++ get_ve0()->_ipv6_devconf_dflt = &global_ipv6_devconf_dflt; ++#endif ++ + /* The addrconf netdev notifier requires that loopback_dev + * has it's ipv6 private information allocated and setup + * before it can bring up and give link-local addresses +@@ -4240,6 +4385,10 @@ + ip6_blk_hole_entry.rt6i_idev = in6_dev_get(init_net.loopback_dev); + #endif + ++ err = register_pernet_device(&addrconf_net_ops); ++ if (err) ++ return err; ++ + register_netdevice_notifier(&ipv6_dev_notf); + + addrconf_verify(0); +@@ -4258,7 +4407,7 @@ + #ifdef CONFIG_SYSCTL + addrconf_sysctl.sysctl_header = + register_sysctl_table(addrconf_sysctl.addrconf_root_dir); +- addrconf_sysctl_register(NULL, &ipv6_devconf_dflt); ++ addrconf_sysctl_register(NULL, &global_ipv6_devconf_dflt); + #endif + + return 0; +@@ -4275,10 +4424,11 @@ + int i; + + unregister_netdevice_notifier(&ipv6_dev_notf); ++ unregister_pernet_device(&addrconf_net_ops); + + #ifdef CONFIG_SYSCTL +- addrconf_sysctl_unregister(&ipv6_devconf_dflt); +- addrconf_sysctl_unregister(&ipv6_devconf); ++ addrconf_sysctl_unregister(&global_ipv6_devconf_dflt); ++ addrconf_sysctl_unregister(&global_ipv6_devconf); + #endif + + rtnl_lock(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/af_inet6.c debian/binary-custom.d/openvz/src/net/ipv6/af_inet6.c +--- ./net/ipv6/af_inet6.c 2012-06-12 16:25:24.422312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/af_inet6.c 2012-11-13 15:20:15.688569058 +0000 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -58,6 +59,10 @@ + #ifdef CONFIG_IPV6_TUNNEL + #include + #endif ++#ifdef CONFIG_IPV6_MIP6 ++#include ++#endif ++#include + + #include + #include +@@ -94,9 +99,6 @@ + int try_loading_module = 0; + int err; + +- if (net != &init_net) +- return -EAFNOSUPPORT; +- + if (sock->type != SOCK_RAW && + sock->type != SOCK_DGRAM && + !inet_ehash_secret) +@@ -149,6 +151,10 @@ + goto out_rcu_unlock; + } + ++ err = vz_security_protocol_check(answer->protocol); ++ if (err < 0) ++ goto out_rcu_unlock; ++ + err = -EPERM; + if (answer->capability > 0 && !capable(answer->capability)) + goto out_rcu_unlock; +@@ -166,6 +172,13 @@ + if (sk == NULL) + goto out; + ++ err = -ENOBUFS; ++ if (ub_sock_charge(sk, PF_INET6, sock->type)) ++ goto out_sk_free; ++ /* if charge was successful, sock_init_data() MUST be called to ++ * set sk->sk_type. otherwise sk will be uncharged to wrong resource ++ */ ++ + sock_init_data(sock, sk); + + err = 0; +@@ -240,6 +253,9 @@ + out_rcu_unlock: + rcu_read_unlock(); + goto out; ++out_sk_free: ++ sk_free(sk); ++ return err; + } + + +@@ -302,7 +318,7 @@ + err = -EINVAL; + goto out; + } +- dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, sk->sk_bound_dev_if); + if (!dev) { + err = -ENODEV; + goto out; +@@ -713,31 +729,31 @@ + + static int __init init_ipv6_mibs(void) + { +- if (snmp_mib_init((void **)ipv6_statistics, sizeof (struct ipstats_mib), ++ if (snmp_mib_init((void **)ve_ipv6_statistics, sizeof (struct ipstats_mib), + __alignof__(struct ipstats_mib)) < 0) + goto err_ip_mib; +- if (snmp_mib_init((void **)icmpv6_statistics, sizeof (struct icmpv6_mib), ++ if (snmp_mib_init((void **)ve_icmpv6_statistics, sizeof (struct icmpv6_mib), + __alignof__(struct icmpv6_mib)) < 0) + goto err_icmp_mib; +- if (snmp_mib_init((void **)icmpv6msg_statistics, ++ if (snmp_mib_init((void **)ve_icmpv6msg_statistics, + sizeof (struct icmpv6msg_mib), __alignof__(struct icmpv6_mib)) < 0) + goto err_icmpmsg_mib; +- if (snmp_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib), ++ if (snmp_mib_init((void **)ve_udp_stats_in6, sizeof (struct udp_mib), + __alignof__(struct udp_mib)) < 0) + goto err_udp_mib; +- if (snmp_mib_init((void **)udplite_stats_in6, sizeof (struct udp_mib), ++ if (snmp_mib_init((void **)ve_udplite_stats_in6, sizeof (struct udp_mib), + __alignof__(struct udp_mib)) < 0) + goto err_udplite_mib; + return 0; + + err_udplite_mib: +- snmp_mib_free((void **)udp_stats_in6); ++ snmp_mib_free((void **)ve_udp_stats_in6); + err_udp_mib: +- snmp_mib_free((void **)icmpv6msg_statistics); ++ snmp_mib_free((void **)ve_icmpv6msg_statistics); + err_icmpmsg_mib: +- snmp_mib_free((void **)icmpv6_statistics); ++ snmp_mib_free((void **)ve_icmpv6_statistics); + err_icmp_mib: +- snmp_mib_free((void **)ipv6_statistics); ++ snmp_mib_free((void **)ve_ipv6_statistics); + err_ip_mib: + return -ENOMEM; + +@@ -745,11 +761,11 @@ + + static void cleanup_ipv6_mibs(void) + { +- snmp_mib_free((void **)ipv6_statistics); +- snmp_mib_free((void **)icmpv6_statistics); +- snmp_mib_free((void **)icmpv6msg_statistics); +- snmp_mib_free((void **)udp_stats_in6); +- snmp_mib_free((void **)udplite_stats_in6); ++ snmp_mib_free((void **)ve_ipv6_statistics); ++ snmp_mib_free((void **)ve_icmpv6_statistics); ++ snmp_mib_free((void **)ve_icmpv6msg_statistics); ++ snmp_mib_free((void **)ve_udp_stats_in6); ++ snmp_mib_free((void **)ve_udplite_stats_in6); + } + + static int __init inet6_init(void) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/anycast.c debian/binary-custom.d/openvz/src/net/ipv6/anycast.c +--- ./net/ipv6/anycast.c 2012-06-12 16:25:24.422312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/anycast.c 2012-11-13 15:20:15.688569058 +0000 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -83,7 +84,7 @@ + struct net_device *dev = NULL; + struct inet6_dev *idev; + struct ipv6_ac_socklist *pac; +- int ishost = !ipv6_devconf.forwarding; ++ int ishost = !ve_ipv6_devconf.forwarding; + int err = 0; + + if (!capable(CAP_NET_ADMIN)) +@@ -113,10 +114,10 @@ + } else { + /* router, no matching interface: just pick one */ + +- dev = dev_get_by_flags(&init_net, IFF_UP, IFF_UP|IFF_LOOPBACK); ++ dev = dev_get_by_flags(get_exec_env()->ve_netns, IFF_UP, IFF_UP|IFF_LOOPBACK); + } + } else +- dev = dev_get_by_index(&init_net, ifindex); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, ifindex); + + if (dev == NULL) { + err = -ENODEV; +@@ -197,7 +198,7 @@ + + write_unlock_bh(&ipv6_sk_ac_lock); + +- dev = dev_get_by_index(&init_net, pac->acl_ifindex); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, pac->acl_ifindex); + if (dev) { + ipv6_dev_ac_dec(dev, &pac->acl_addr); + dev_put(dev); +@@ -225,7 +226,7 @@ + if (pac->acl_ifindex != prev_index) { + if (dev) + dev_put(dev); +- dev = dev_get_by_index(&init_net, pac->acl_ifindex); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, pac->acl_ifindex); + prev_index = pac->acl_ifindex; + } + if (dev) +@@ -430,7 +431,7 @@ + if (dev) + return ipv6_chk_acast_dev(dev, addr); + read_lock(&dev_base_lock); +- for_each_netdev(&init_net, dev) ++ for_each_netdev(get_exec_env()->ve_netns, dev) + if (ipv6_chk_acast_dev(dev, addr)) { + found = 1; + break; +@@ -454,8 +455,9 @@ + struct ac6_iter_state *state = ac6_seq_private(seq); + + state->idev = NULL; +- for_each_netdev(&init_net, state->dev) { ++ for_each_netdev(get_exec_env()->ve_netns, state->dev) { + struct inet6_dev *idev; ++ + idev = in6_dev_get(state->dev); + if (!idev) + continue; +@@ -486,6 +488,8 @@ + state->idev = NULL; + break; + } ++ if (unlikely(!ve_accessible_strict(state->dev->owner_env, get_exec_env()))) ++ continue; + state->idev = in6_dev_get(state->dev); + if (!state->idev) + continue; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/datagram.c debian/binary-custom.d/openvz/src/net/ipv6/datagram.c +--- ./net/ipv6/datagram.c 2012-06-12 16:25:24.422312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/datagram.c 2012-11-13 15:20:15.688569058 +0000 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -544,7 +545,7 @@ + if (!src_info->ipi6_ifindex) + return -EINVAL; + else { +- dev = dev_get_by_index(&init_net, src_info->ipi6_ifindex); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, src_info->ipi6_ifindex); + if (!dev) + return -ENODEV; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/exthdrs.c debian/binary-custom.d/openvz/src/net/ipv6/exthdrs.c +--- ./net/ipv6/exthdrs.c 2012-06-12 16:25:24.422312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/exthdrs.c 2012-11-13 15:20:15.688569058 +0000 +@@ -352,7 +352,7 @@ + int n, i; + struct ipv6_rt_hdr *hdr; + struct rt0_hdr *rthdr; +- int accept_source_route = ipv6_devconf.accept_source_route; ++ int accept_source_route = ve_ipv6_devconf.accept_source_route; + + idev = in6_dev_get(skb->dev); + if (idev) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/inet6_connection_sock.c debian/binary-custom.d/openvz/src/net/ipv6/inet6_connection_sock.c +--- ./net/ipv6/inet6_connection_sock.c 2012-06-12 16:25:24.426312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/inet6_connection_sock.c 2012-11-13 15:20:15.692569058 +0000 +@@ -25,6 +25,8 @@ + #include + #include + #include ++#include ++#include + + int inet6_csk_bind_conflict(const struct sock *sk, + const struct inet_bind_bucket *tb) +@@ -35,6 +37,7 @@ + /* We must walk the whole port owner list in this case. -DaveM */ + sk_for_each_bound(sk2, node, &tb->owners) { + if (sk != sk2 && ++ ve_accessible_strict(sk->owner_env, sk2->owner_env) && + (!sk->sk_bound_dev_if || + !sk2->sk_bound_dev_if || + sk->sk_bound_dev_if == sk2->sk_bound_dev_if) && +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/inet6_hashtables.c debian/binary-custom.d/openvz/src/net/ipv6/inet6_hashtables.c +--- ./net/ipv6/inet6_hashtables.c 2012-06-12 16:25:24.426312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/inet6_hashtables.c 2012-11-13 15:20:15.692569058 +0000 +@@ -68,7 +68,8 @@ + /* Optimize here for direct hit, only listening connections can + * have wildcards anyways. + */ +- unsigned int hash = inet6_ehashfn(daddr, hnum, saddr, sport); ++ struct ve_struct *env = get_exec_env(); ++ unsigned int hash = inet6_ehashfn(daddr, hnum, saddr, sport, VEID(env)); + struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); + rwlock_t *lock = inet_ehash_lockp(hashinfo, hash); + +@@ -76,7 +77,7 @@ + read_lock(lock); + sk_for_each(sk, node, &head->chain) { + /* For IPV6 do the cheaper port and family tests first. */ +- if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif)) ++ if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif, env)) + goto hit; /* You sunk my battleship! */ + } + /* Must check for a TIME_WAIT'er before going to listener hash. */ +@@ -89,6 +90,7 @@ + + if (ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) && + ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) && ++ ve_accessible_strict(tw->tw_owner_env, VEID(env)) && + (!sk->sk_bound_dev_if || sk->sk_bound_dev_if == dif)) + goto hit; + } +@@ -111,9 +113,15 @@ + const struct hlist_node *node; + struct sock *result = NULL; + int score, hiscore = 0; ++ struct ve_struct *env; ++ ++ env = get_exec_env(); + + read_lock(&hashinfo->lhash_lock); +- sk_for_each(sk, node, &hashinfo->listening_hash[inet_lhashfn(hnum)]) { ++ sk_for_each(sk, node, &hashinfo->listening_hash[ ++ inet_lhashfn(hnum, VEID(env))]) { ++ if (!ve_accessible_strict(sk->owner_env, env)) ++ continue; + if (inet_sk(sk)->num == hnum && sk->sk_family == PF_INET6) { + const struct ipv6_pinfo *np = inet6_sk(sk); + +@@ -164,7 +172,8 @@ + + static int __inet6_check_established(struct inet_timewait_death_row *death_row, + struct sock *sk, const __u16 lport, +- struct inet_timewait_sock **twp) ++ struct inet_timewait_sock **twp, ++ struct ve_struct *ve) + { + struct inet_hashinfo *hinfo = death_row->hashinfo; + struct inet_sock *inet = inet_sk(sk); +@@ -174,7 +183,7 @@ + const int dif = sk->sk_bound_dev_if; + const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport); + const unsigned int hash = inet6_ehashfn(daddr, lport, saddr, +- inet->dport); ++ inet->dport, VEID(ve)); + struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); + rwlock_t *lock = inet_ehash_lockp(hinfo, hash); + struct sock *sk2; +@@ -194,7 +203,8 @@ + sk2->sk_family == PF_INET6 && + ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) && + ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) && +- (!sk2->sk_bound_dev_if || sk2->sk_bound_dev_if == dif)) { ++ (!sk2->sk_bound_dev_if || sk2->sk_bound_dev_if == dif) && ++ ve_accessible_strict(tw->tw_owner_env, VEID(ve))) { + if (twsk_unique(sk, sk2, twp)) + goto unique; + else +@@ -205,7 +215,7 @@ + + /* And established part... */ + sk_for_each(sk2, node, &head->chain) { +- if (INET6_MATCH(sk2, hash, saddr, daddr, ports, dif)) ++ if (INET6_MATCH(sk2, hash, saddr, daddr, ports, dif, ve)) + goto not_unique; + } + +@@ -254,7 +264,9 @@ + struct inet_bind_hashbucket *head; + struct inet_bind_bucket *tb; + int ret; ++ struct ve_struct *ve; + ++ ve = sk->owner_env; + if (snum == 0) { + int i, port, low, high, remaining; + static u32 hint; +@@ -268,7 +280,7 @@ + local_bh_disable(); + for (i = 1; i <= remaining; i++) { + port = low + (i + offset) % remaining; +- head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size)]; ++ head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size, VEID(ve))]; + spin_lock(&head->lock); + + /* Does not bother with rcv_saddr checks, +@@ -276,20 +288,21 @@ + * unique enough. + */ + inet_bind_bucket_for_each(tb, node, &head->chain) { +- if (tb->port == port) { ++ if (tb->port == port && ++ ve_accessible_strict(tb->owner_env, ve)) { + BUG_TRAP(!hlist_empty(&tb->owners)); + if (tb->fastreuse >= 0) + goto next_port; + if (!__inet6_check_established(death_row, + sk, port, +- &tw)) ++ &tw, ve)) + goto ok; + goto next_port; + } + } + + tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep, +- head, port); ++ head, port, ve); + if (!tb) { + spin_unlock(&head->lock); + break; +@@ -324,7 +337,7 @@ + goto out; + } + +- head = &hinfo->bhash[inet_bhashfn(snum, hinfo->bhash_size)]; ++ head = &hinfo->bhash[inet_bhashfn(snum, hinfo->bhash_size, VEID(ve))]; + tb = inet_csk(sk)->icsk_bind_hash; + spin_lock_bh(&head->lock); + +@@ -335,7 +348,7 @@ + } else { + spin_unlock(&head->lock); + /* No definite answer... Walk to established hash table */ +- ret = __inet6_check_established(death_row, sk, snum, NULL); ++ ret = __inet6_check_established(death_row, sk, snum, NULL, ve); + out: + local_bh_enable(); + return ret; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/ip6_fib.c debian/binary-custom.d/openvz/src/net/ipv6/ip6_fib.c +--- ./net/ipv6/ip6_fib.c 2012-06-12 16:25:24.426312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/ip6_fib.c 2012-11-13 15:20:15.692569058 +0000 +@@ -174,12 +174,29 @@ + }, + }; + ++#ifdef CONFIG_VE ++static inline void prepare_fib6_table(void) ++{ ++ fib6_main_tbl.owner_env = get_ve0(); ++ get_ve0()->_fib6_table = &fib6_main_tbl; ++} ++ ++#define fib6_main_tbl (*(get_exec_env()->_fib6_table)) ++#else ++#define prepare_fib6_table() do { } while (0) ++#endif ++ + #ifdef CONFIG_IPV6_MULTIPLE_TABLES + #define FIB_TABLE_HASHSZ 256 + #else + #define FIB_TABLE_HASHSZ 1 + #endif ++ ++#ifdef CONFIG_VE ++#define fib_table_hash (get_exec_env()->_fib6_table_hash) ++#else + static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; ++#endif + + static void fib6_link_table(struct fib6_table *tb) + { +@@ -193,11 +210,16 @@ + + h = tb->tb6_id & (FIB_TABLE_HASHSZ - 1); + +- /* +- * No protection necessary, this is the only list mutatation +- * operation, tables never disappear once they exist. +- */ ++ write_lock_bh(&tb->tb6_lock); + hlist_add_head_rcu(&tb->tb6_hlist, &fib_table_hash[h]); ++ write_unlock_bh(&tb->tb6_lock); ++} ++ ++static void fib6_unlink_table(struct fib6_table *tb) ++{ ++ write_lock_bh(&tb->tb6_lock); ++ hlist_del_rcu(&tb->tb6_hlist); ++ write_unlock_bh(&tb->tb6_lock); + } + + #ifdef CONFIG_IPV6_MULTIPLE_TABLES +@@ -209,6 +231,17 @@ + }, + }; + ++#ifdef CONFIG_VE ++static inline void prepare_fib6_local_table(void) ++{ ++ fib6_local_tbl.owner_env = get_ve0(); ++ get_ve0()->_fib6_local_table = &fib6_local_tbl; ++} ++#define fib6_local_tbl (*(get_exec_env())->_fib6_local_table) ++#else ++#define prepare_fib6_local_table() do { } while (0) ++#endif ++ + static struct fib6_table *fib6_alloc_table(u32 id) + { + struct fib6_table *table; +@@ -261,12 +294,18 @@ + return NULL; + } + +-static void __init fib6_tables_init(void) ++void fib6_tables_init(void) + { + fib6_link_table(&fib6_main_tbl); + fib6_link_table(&fib6_local_tbl); + } + ++void fib6_tables_cleanup(void) ++{ ++ fib6_unlink_table(&fib6_main_tbl); ++ fib6_unlink_table(&fib6_local_tbl); ++} ++ + #else + + struct fib6_table *fib6_new_table(u32 id) +@@ -285,11 +324,16 @@ + return (struct dst_entry *) lookup(&fib6_main_tbl, fl, flags); + } + +-static void __init fib6_tables_init(void) ++void fib6_tables_init(void) + { + fib6_link_table(&fib6_main_tbl); + } + ++void fib6_tables_cleanup(void) ++{ ++ fib6_unlink_table(&fib6_main_tbl); ++} ++ + #endif + + static int fib6_dump_node(struct fib6_walker_t *w) +@@ -1371,9 +1415,13 @@ + for (h = 0; h < FIB_TABLE_HASHSZ; h++) { + hlist_for_each_entry_rcu(table, node, &fib_table_hash[h], + tb6_hlist) { ++ struct ve_struct *old_env; ++ ++ old_env = set_exec_env(table->owner_env); + write_lock_bh(&table->tb6_lock); + fib6_clean_tree(&table->tb6_root, func, prune, arg); + write_unlock_bh(&table->tb6_lock); ++ (void)set_exec_env(old_env); + } + } + rcu_read_unlock(); +@@ -1441,6 +1489,8 @@ + + static DEFINE_SPINLOCK(fib6_gc_lock); + ++LIST_HEAD(fib6_table_list); ++ + void fib6_run_gc(unsigned long dummy) + { + if (dummy != ~0UL) { +@@ -1473,9 +1523,13 @@ + { + fib6_node_kmem = kmem_cache_create("fib6_nodes", + sizeof(struct fib6_node), +- 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, ++ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_UBC, + NULL); + ++ prepare_fib6_table(); ++#ifdef CONFIG_IPV6_MULTIPLE_TABLES ++ prepare_fib6_local_table(); ++#endif + fib6_tables_init(); + + __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/ip6_flowlabel.c debian/binary-custom.d/openvz/src/net/ipv6/ip6_flowlabel.c +--- ./net/ipv6/ip6_flowlabel.c 2012-06-12 16:25:24.426312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/ip6_flowlabel.c 2012-11-13 15:20:15.692569058 +0000 +@@ -448,6 +448,9 @@ + struct ip6_flowlabel *fl, *fl1 = NULL; + + ++ if (!ve_is_super(get_exec_env())) ++ return -EPERM; ++ + if (optlen < sizeof(freq)) + return -EINVAL; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/ip6_input.c debian/binary-custom.d/openvz/src/net/ipv6/ip6_input.c +--- ./net/ipv6/ip6_input.c 2012-06-12 16:25:24.426312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/ip6_input.c 2012-11-13 15:20:15.692569058 +0000 +@@ -61,11 +61,6 @@ + u32 pkt_len; + struct inet6_dev *idev; + +- if (dev->nd_net != &init_net) { +- kfree_skb(skb); +- return 0; +- } +- + if (skb->pkt_type == PACKET_OTHERHOST) { + kfree_skb(skb); + return 0; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/ip6_output.c debian/binary-custom.d/openvz/src/net/ipv6/ip6_output.c +--- ./net/ipv6/ip6_output.c 2012-06-12 16:25:24.426312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/ip6_output.c 2012-11-13 15:20:15.692569058 +0000 +@@ -395,7 +395,7 @@ + struct ipv6hdr *hdr = ipv6_hdr(skb); + struct inet6_skb_parm *opt = IP6CB(skb); + +- if (ipv6_devconf.forwarding == 0) ++ if (ve_ipv6_devconf.forwarding == 0) + goto error; + + if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) { +@@ -439,7 +439,7 @@ + } + + /* XXX: idev->cnf.proxy_ndp? */ +- if (ipv6_devconf.proxy_ndp && ++ if (ve_ipv6_devconf.proxy_ndp && + pneigh_lookup(&nd_tbl, &hdr->daddr, skb->dev, 0)) { + int proxied = ip6_forward_proxy_check(skb); + if (proxied > 0) +@@ -505,6 +505,20 @@ + return -EMSGSIZE; + } + ++ /* ++ * We try to optimize forwarding of VE packets: ++ * do not decrement TTL (and so save skb_cow) ++ * during forwarding of outgoing pkts from VE. ++ * For incoming pkts we still do ttl decr, ++ * since such skb is not cloned and does not require ++ * actual cow. So, there is at least one place ++ * in pkts path with mandatory ttl decr, that is ++ * sufficient to prevent routing loops. ++ */ ++ hdr = ipv6_hdr(skb); ++ if (skb->dev->features & NETIF_F_VENET) /* src is VENET device */ ++ goto no_ttl_decr; ++ + if (skb_cow(skb, dst->dev->hard_header_len)) { + IP6_INC_STATS(ip6_dst_idev(dst), IPSTATS_MIB_OUTDISCARDS); + goto drop; +@@ -516,6 +530,7 @@ + + hdr->hop_limit--; + ++no_ttl_decr: + IP6_INC_STATS_BH(ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS); + return NF_HOOK(PF_INET6,NF_IP6_FORWARD, skb, skb->dev, dst->dev, ip6_forward_finish); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/ipv6_sockglue.c debian/binary-custom.d/openvz/src/net/ipv6/ipv6_sockglue.c +--- ./net/ipv6/ipv6_sockglue.c 2012-06-12 16:25:24.426312482 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/ipv6_sockglue.c 2012-11-13 15:20:15.700569054 +0000 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -544,7 +545,7 @@ + if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val) + goto e_inval; + +- if (__dev_get_by_index(&init_net, val) == NULL) { ++ if (__dev_get_by_index(get_exec_env()->ve_netns, val) == NULL) { + retv = -ENODEV; + break; + } +@@ -1021,7 +1022,7 @@ + dst_release(dst); + } + if (val < 0) +- val = ipv6_devconf.hop_limit; ++ val = ve_ipv6_devconf.hop_limit; + break; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/mcast.c debian/binary-custom.d/openvz/src/net/ipv6/mcast.c +--- ./net/ipv6/mcast.c 2012-06-12 16:25:24.430312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/mcast.c 2012-11-13 15:20:15.700569054 +0000 +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -156,7 +157,7 @@ + #define IGMP6_UNSOLICITED_IVAL (10*HZ) + #define MLD_QRV_DEFAULT 2 + +-#define MLD_V1_SEEN(idev) (ipv6_devconf.force_mld_version == 1 || \ ++#define MLD_V1_SEEN(idev) (ve_ipv6_devconf.force_mld_version == 1 || \ + (idev)->cnf.force_mld_version == 1 || \ + ((idev)->mc_v1_seen && \ + time_before(jiffies, (idev)->mc_v1_seen))) +@@ -215,7 +216,7 @@ + dst_release(&rt->u.dst); + } + } else +- dev = dev_get_by_index(&init_net, ifindex); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, ifindex); + + if (dev == NULL) { + sock_kfree_s(sk, mc_lst, sizeof(*mc_lst)); +@@ -248,6 +249,7 @@ + + return 0; + } ++EXPORT_SYMBOL_GPL(ipv6_sock_mc_join); + + /* + * socket leave on multicast group +@@ -266,7 +268,7 @@ + *lnk = mc_lst->next; + write_unlock_bh(&ipv6_sk_mc_lock); + +- if ((dev = dev_get_by_index(&init_net, mc_lst->ifindex)) != NULL) { ++ if ((dev = dev_get_by_index(get_exec_env()->ve_netns, mc_lst->ifindex)) != NULL) { + struct inet6_dev *idev = in6_dev_get(dev); + + (void) ip6_mc_leave_src(sk, mc_lst, idev); +@@ -301,7 +303,7 @@ + dst_release(&rt->u.dst); + } + } else +- dev = dev_get_by_index(&init_net, ifindex); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, ifindex); + + if (!dev) + return NULL; +@@ -332,7 +334,7 @@ + np->ipv6_mc_list = mc_lst->next; + write_unlock_bh(&ipv6_sk_mc_lock); + +- dev = dev_get_by_index(&init_net, mc_lst->ifindex); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, mc_lst->ifindex); + if (dev) { + struct inet6_dev *idev = in6_dev_get(dev); + +@@ -2170,15 +2172,18 @@ + static void mld_gq_timer_expire(unsigned long data) + { + struct inet6_dev *idev = (struct inet6_dev *)data; ++ struct ve_struct *old_env = set_exec_env(idev->dev->owner_env); + + idev->mc_gq_running = 0; + mld_send_report(idev, NULL); + __in6_dev_put(idev); ++ set_exec_env(old_env); + } + + static void mld_ifc_timer_expire(unsigned long data) + { + struct inet6_dev *idev = (struct inet6_dev *)data; ++ struct ve_struct *old_env = set_exec_env(idev->dev->owner_env); + + mld_send_cr(idev); + if (idev->mc_ifc_count) { +@@ -2187,6 +2192,7 @@ + mld_ifc_start_timer(idev, idev->mc_maxdelay); + } + __in6_dev_put(idev); ++ set_exec_env(old_env); + } + + static void mld_ifc_event(struct inet6_dev *idev) +@@ -2201,6 +2207,7 @@ + static void igmp6_timer_handler(unsigned long data) + { + struct ifmcaddr6 *ma = (struct ifmcaddr6 *) data; ++ struct ve_struct *old_env = set_exec_env(ma->idev->dev->owner_env); + + if (MLD_V1_SEEN(ma->idev)) + igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT); +@@ -2212,6 +2219,7 @@ + ma->mca_flags &= ~MAF_TIMER_RUNNING; + spin_unlock(&ma->mca_lock); + ma_put(ma); ++ set_exec_env(old_env); + } + + /* Device going down */ +@@ -2326,8 +2334,9 @@ + struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq); + + state->idev = NULL; +- for_each_netdev(&init_net, state->dev) { ++ for_each_netdev(get_exec_env()->ve_netns, state->dev) { + struct inet6_dev *idev; ++ + idev = in6_dev_get(state->dev); + if (!idev) + continue; +@@ -2454,8 +2463,9 @@ + + state->idev = NULL; + state->im = NULL; +- for_each_netdev(&init_net, state->dev) { ++ for_each_netdev(get_exec_env()->ve_netns, state->dev) { + struct inet6_dev *idev; ++ + idev = in6_dev_get(state->dev); + if (unlikely(idev == NULL)) + continue; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/ndisc.c debian/binary-custom.d/openvz/src/net/ipv6/ndisc.c +--- ./net/ipv6/ndisc.c 2012-06-12 16:25:24.430312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/ndisc.c 2012-11-13 15:20:15.700569054 +0000 +@@ -128,7 +128,7 @@ + .queue_xmit = dev_queue_xmit, + }; + +-struct neigh_table nd_tbl = { ++struct neigh_table global_nd_tbl = { + .family = AF_INET6, + .entry_size = sizeof(struct neighbour) + sizeof(struct in6_addr), + .key_len = sizeof(struct in6_addr), +@@ -139,7 +139,7 @@ + .proxy_redo = pndisc_redo, + .id = "ndisc_cache", + .parms = { +- .tbl = &nd_tbl, ++ .tbl = &global_nd_tbl, + .base_reachable_time = 30 * HZ, + .retrans_time = 1 * HZ, + .gc_staletime = 60 * HZ, +@@ -787,7 +787,7 @@ + + if (ipv6_chk_acast_addr(dev, &msg->target) || + (idev->cnf.forwarding && +- (ipv6_devconf.proxy_ndp || idev->cnf.proxy_ndp) && ++ (ve_ipv6_devconf.proxy_ndp || idev->cnf.proxy_ndp) && + (pneigh = pneigh_lookup(&nd_tbl, + &msg->target, dev, 0)) != NULL)) { + if (!(NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED) && +@@ -928,7 +928,7 @@ + * has already sent a NA to us. + */ + if (lladdr && !memcmp(lladdr, dev->dev_addr, dev->addr_len) && +- ipv6_devconf.forwarding && ipv6_devconf.proxy_ndp && ++ ve_ipv6_devconf.forwarding && ve_ipv6_devconf.proxy_ndp && + pneigh_lookup(&nd_tbl, &msg->target, dev, 0)) { + /* XXX: idev->cnf.prixy_ndp */ + goto out; +@@ -1015,6 +1015,7 @@ + + static void ndisc_ra_useropt(struct sk_buff *ra, struct nd_opt_hdr *opt) + { ++ struct net *net = ra->dev->nd_net; + struct icmp6hdr *icmp6h = (struct icmp6hdr *)skb_transport_header(ra); + struct sk_buff *skb; + struct nlmsghdr *nlh; +@@ -1048,7 +1049,8 @@ + &ipv6_hdr(ra)->saddr); + nlmsg_end(skb, nlh); + +- err = rtnl_notify(skb, 0, RTNLGRP_ND_USEROPT, NULL, GFP_ATOMIC); ++ err = rtnl_notify(skb, net, 0, RTNLGRP_ND_USEROPT, NULL, ++ GFP_ATOMIC); + if (err < 0) + goto errout; + +@@ -1058,7 +1060,7 @@ + nlmsg_free(skb); + err = -EMSGSIZE; + errout: +- rtnl_set_sk_err(RTNLGRP_ND_USEROPT, err); ++ rtnl_set_sk_err(&init_net, RTNLGRP_ND_USEROPT, err); + } + + static void ndisc_router_discovery(struct sk_buff *skb) +@@ -1610,9 +1612,6 @@ + { + struct net_device *dev = ptr; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + switch (event) { + case NETDEV_CHANGEADDR: + neigh_changeaddr(&nd_tbl, dev); +@@ -1729,6 +1728,55 @@ + + #endif + ++static int ndisc_net_init(struct net *net) ++{ ++ struct ve_struct *ve = get_exec_env(); ++ int err; ++ ++ ve->ve_nd_tbl = kmemdup(ve0.ve_nd_tbl, sizeof(struct neigh_table), ++ GFP_KERNEL); ++ if (ve->ve_nd_tbl == NULL) ++ return -ENOMEM; ++ ve->ve_nd_tbl->parms.tbl = ve->ve_nd_tbl; ++ ++ err = neigh_table_init(ve->ve_nd_tbl); ++ if (err) ++ goto out_free; ++#ifdef CONFIG_SYSCTL ++ neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, ++ "ipv6", ++ &ndisc_ifinfo_sysctl_change, ++ &ndisc_ifinfo_sysctl_strategy); ++#endif ++ err = 0; ++out: ++ return err; ++ ++out_free: ++ kfree(ve->ve_nd_tbl); ++ ve->ve_nd_tbl = NULL; ++ goto out; ++} ++ ++static void ndisc_net_exit(struct net *net) ++{ ++ struct ve_struct *ve = get_exec_env(); ++ ++ if (ve->ve_nd_tbl) { ++#ifdef CONFIG_SYSCTL ++ neigh_sysctl_unregister(&ve->ve_nd_tbl->parms); ++#endif ++ neigh_table_clear(ve->ve_nd_tbl); ++ kfree(ve->ve_nd_tbl); ++ ve->ve_nd_tbl = NULL; ++ } ++} ++ ++static struct pernet_operations ndisc_net_ops = { ++ .init = ndisc_net_init, ++ .exit = ndisc_net_exit, ++}; ++ + int __init ndisc_init(struct net_proto_family *ops) + { + struct ipv6_pinfo *np; +@@ -1755,15 +1803,8 @@ + /* + * Initialize the neighbour table + */ +- +- neigh_table_init(&nd_tbl); +- +-#ifdef CONFIG_SYSCTL +- neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, +- "ipv6", +- &ndisc_ifinfo_sysctl_change, +- &ndisc_ifinfo_sysctl_strategy); +-#endif ++ get_ve0()->ve_nd_tbl = &global_nd_tbl; ++ register_pernet_subsys(&ndisc_net_ops); + + register_netdevice_notifier(&ndisc_netdev_notifier); + return 0; +@@ -1772,10 +1813,7 @@ + void ndisc_cleanup(void) + { + unregister_netdevice_notifier(&ndisc_netdev_notifier); +-#ifdef CONFIG_SYSCTL +- neigh_sysctl_unregister(&nd_tbl.parms); +-#endif +- neigh_table_clear(&nd_tbl); ++ unregister_pernet_subsys(&ndisc_net_ops); + sock_release(ndisc_socket); + ndisc_socket = NULL; /* For safety. */ + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/netfilter/ip6_queue.c debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6_queue.c +--- ./net/ipv6/netfilter/ip6_queue.c 2012-06-12 16:25:24.430312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6_queue.c 2012-11-13 15:20:15.704569053 +0000 +@@ -491,7 +491,7 @@ + if (type <= IPQM_BASE) + return; + +- if (security_netlink_recv(skb, CAP_NET_ADMIN)) ++ if (security_netlink_recv(skb, CAP_VE_NET_ADMIN)) + RCV_SKB_FAIL(-EPERM); + + write_lock_bh(&queue_lock); +@@ -521,8 +521,12 @@ + static void + ipq_rcv_skb(struct sk_buff *skb) + { ++ struct ve_struct *old_ve; ++ + mutex_lock(&ipqnl_mutex); ++ old_ve = set_exec_env(skb->owner_env); + __ipq_rcv_skb(skb); ++ (void)set_exec_env(old_ve); + mutex_unlock(&ipqnl_mutex); + } + +@@ -532,9 +536,6 @@ + { + struct net_device *dev = ptr; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + /* Drop any packets associated with the downed device */ + if (event == NETDEV_DOWN) + ipq_dev_drop(dev->ifindex); +@@ -554,7 +555,7 @@ + if (event == NETLINK_URELEASE && + n->protocol == NETLINK_IP6_FW && n->pid) { + write_lock_bh(&queue_lock); +- if ((n->net == &init_net) && (n->pid == peer_pid)) ++ if (n->pid == peer_pid) + __ipq_reset(); + write_unlock_bh(&queue_lock); + } +@@ -679,7 +680,7 @@ + proc_net_remove(&init_net, IPQ_PROC_FS_NAME); + + cleanup_ipqnl: +- sock_release(ipqnl->sk_socket); ++ netlink_kernel_release(ipqnl); + mutex_lock(&ipqnl_mutex); + mutex_unlock(&ipqnl_mutex); + +@@ -698,7 +699,7 @@ + unregister_netdevice_notifier(&ipq_dev_notifier); + proc_net_remove(&init_net, IPQ_PROC_FS_NAME); + +- sock_release(ipqnl->sk_socket); ++ netlink_kernel_release(ipqnl); + mutex_lock(&ipqnl_mutex); + mutex_unlock(&ipqnl_mutex); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/netfilter/ip6_tables.c debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6_tables.c +--- ./net/ipv6/netfilter/ip6_tables.c 2012-06-12 16:25:24.430312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6_tables.c 2012-11-13 15:20:15.704569053 +0000 +@@ -26,6 +26,7 @@ + + #include + #include ++#include + + MODULE_LICENSE("GPL"); + MODULE_AUTHOR("Netfilter Core Team "); +@@ -1212,9 +1213,14 @@ + { + int ret; + +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_VE_NET_ADMIN)) + return -EPERM; + ++#ifdef CONFIG_VE_IPTABLES ++ if (!get_exec_env()->_xt_tables[AF_INET6].next) ++ return -ENOENT; ++#endif ++ + switch (cmd) { + case IP6T_SO_SET_REPLACE: + ret = do_replace(user, len); +@@ -1237,9 +1243,14 @@ + { + int ret; + +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_VE_NET_ADMIN)) + return -EPERM; + ++#ifdef CONFIG_VE_IPTABLES ++ if (!get_exec_env()->_xt_tables[AF_INET6].next) ++ return -ENOENT; ++#endif ++ + switch (cmd) { + case IP6T_SO_GET_INFO: { + char name[IP6T_TABLE_MAXNAMELEN]; +@@ -1336,18 +1347,18 @@ + return ret; + } + +-int ip6t_register_table(struct xt_table *table, ++struct ip6t_table *ip6t_register_table(struct xt_table *table, + const struct ip6t_replace *repl) + { + int ret; + struct xt_table_info *newinfo; + static struct xt_table_info bootstrap +- = { 0, 0, 0, { 0 }, { 0 }, { } }; ++ = { 0, 0, 0, 0, { 0 }, { 0 }, { } }; + void *loc_cpu_entry; + + newinfo = xt_alloc_table_info(repl->size); + if (!newinfo) +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + + /* choose the copy on our node/cpu */ + loc_cpu_entry = newinfo->entries[raw_smp_processor_id()]; +@@ -1360,28 +1371,29 @@ + repl->underflow); + if (ret != 0) { + xt_free_table_info(newinfo); +- return ret; ++ return ERR_PTR(ret); + } + +- ret = xt_register_table(table, &bootstrap, newinfo); +- if (ret != 0) { ++ table = virt_xt_register_table(table, &bootstrap, newinfo); ++ if (IS_ERR(table)) + xt_free_table_info(newinfo); +- return ret; +- } +- +- return 0; ++ return table; + } + + void ip6t_unregister_table(struct xt_table *table) + { + struct xt_table_info *private; + void *loc_cpu_entry; ++ struct module *me; + +- private = xt_unregister_table(table); ++ me = table->me; ++ private = virt_xt_unregister_table(table); + + /* Decrease module usage counts and free resources */ + loc_cpu_entry = private->entries[raw_smp_processor_id()]; + IP6T_ENTRY_ITERATE(loc_cpu_entry, private->size, cleanup_entry, NULL); ++ if (private->number > private->initial_entries) ++ module_put(me); + xt_free_table_info(private); + } + +@@ -1476,12 +1488,30 @@ + .family = AF_INET6, + }; + ++static int init_ip6tables(void) ++{ ++#ifdef CONFIG_VE_IPTABLES ++ if (get_exec_env()->_xt_tables[AF_INET6].next != NULL) ++ return -EEXIST; ++#endif ++ ++ return xt_proto_init(AF_INET6); ++} ++ ++static void fini_ip6tables(void) ++{ ++#ifdef CONFIG_VE_IPTABLES ++ get_exec_env()->_xt_tables[AF_INET6].next = NULL; ++#endif ++ xt_proto_fini(AF_INET6); ++} ++ + static int __init ip6_tables_init(void) + { + int ret; + +- ret = xt_proto_init(AF_INET6); +- if (ret < 0) ++ ret = init_ip6tables(); ++ if (ret) + goto err1; + + /* Noone else will be downing sem now, so we won't sleep */ +@@ -1500,6 +1530,10 @@ + if (ret < 0) + goto err5; + ++ KSYMRESOLVE(init_ip6tables); ++ KSYMRESOLVE(fini_ip6tables); ++ KSYMMODRESOLVE(ip6_tables); ++ + printk(KERN_INFO "ip6_tables: (C) 2000-2006 Netfilter Core Team\n"); + return 0; + +@@ -1510,18 +1544,21 @@ + err3: + xt_unregister_target(&ip6t_standard_target); + err2: +- xt_proto_fini(AF_INET6); ++ fini_ip6tables(); + err1: + return ret; + } + + static void __exit ip6_tables_fini(void) + { ++ KSYMMODUNRESOLVE(ip6_tables); ++ KSYMUNRESOLVE(init_ip6tables); ++ KSYMUNRESOLVE(fini_ip6tables); + nf_unregister_sockopt(&ip6t_sockopts); + xt_unregister_match(&icmp6_matchstruct); + xt_unregister_target(&ip6t_error_target); + xt_unregister_target(&ip6t_standard_target); +- xt_proto_fini(AF_INET6); ++ fini_ip6tables(); + } + + /* +@@ -1607,5 +1644,5 @@ + EXPORT_SYMBOL(ip6t_ext_hdr); + EXPORT_SYMBOL(ipv6_find_hdr); + +-module_init(ip6_tables_init); ++subsys_initcall(ip6_tables_init); + module_exit(ip6_tables_fini); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/netfilter/ip6table_filter.c debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6table_filter.c +--- ./net/ipv6/netfilter/ip6table_filter.c 2012-06-12 16:25:24.434312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6table_filter.c 2012-11-13 15:20:15.704569053 +0000 +@@ -11,12 +11,20 @@ + + #include + #include ++#include + #include + + MODULE_LICENSE("GPL"); + MODULE_AUTHOR("Netfilter Core Team "); + MODULE_DESCRIPTION("ip6tables filter table"); + ++#ifdef CONFIG_VE_IPTABLES ++#include ++#define ve_packet_filter (get_exec_env()->_ve_ip6t_filter_pf) ++#else ++#define ve_packet_filter &packet_filter ++#endif ++ + #define FILTER_VALID_HOOKS ((1 << NF_IP6_LOCAL_IN) | (1 << NF_IP6_FORWARD) | (1 << NF_IP6_LOCAL_OUT)) + + static struct +@@ -24,7 +32,7 @@ + struct ip6t_replace repl; + struct ip6t_standard entries[3]; + struct ip6t_error term; +-} initial_table __initdata = { ++} initial_table = { + .repl = { + .name = "filter", + .valid_hooks = FILTER_VALID_HOOKS, +@@ -65,7 +73,7 @@ + const struct net_device *out, + int (*okfn)(struct sk_buff *)) + { +- return ip6t_do_table(skb, hook, in, out, &packet_filter); ++ return ip6t_do_table(skb, hook, in, out, ve_packet_filter); + } + + static unsigned int +@@ -85,7 +93,7 @@ + } + #endif + +- return ip6t_do_table(skb, hook, in, out, &packet_filter); ++ return ip6t_do_table(skb, hook, in, out, ve_packet_filter); + } + + static struct nf_hook_ops ip6t_ops[] = { +@@ -116,22 +124,19 @@ + static int forward = NF_ACCEPT; + module_param(forward, bool, 0000); + +-static int __init ip6table_filter_init(void) ++int init_ip6table_filter(void) + { + int ret; +- +- if (forward < 0 || forward > NF_MAX_VERDICT) { +- printk("iptables forward must be 0 or 1\n"); +- return -EINVAL; +- } +- +- /* Entry 1 is the FORWARD hook */ +- initial_table.entries[1].target.verdict = -forward - 1; ++ struct ip6t_table *tmp_filter; + + /* Register table */ +- ret = ip6t_register_table(&packet_filter, &initial_table.repl); +- if (ret < 0) +- return ret; ++ tmp_filter = ip6t_register_table(&packet_filter, ++ &initial_table.repl); ++ if (IS_ERR(tmp_filter)) ++ return PTR_ERR(tmp_filter); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_filter = tmp_filter; ++#endif + + /* Register hooks */ + ret = nf_register_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops)); +@@ -141,14 +146,50 @@ + return ret; + + cleanup_table: +- ip6t_unregister_table(&packet_filter); ++ ip6t_unregister_table(ve_packet_filter); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_filter = NULL; ++#endif + return ret; + } + +-static void __exit ip6table_filter_fini(void) ++void fini_ip6table_filter(void) + { + nf_unregister_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops)); +- ip6t_unregister_table(&packet_filter); ++ ip6t_unregister_table(ve_packet_filter); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_filter = NULL; ++#endif ++} ++ ++static int __init ip6table_filter_init(void) ++{ ++ int err; ++ ++ if (forward < 0 || forward > NF_MAX_VERDICT) { ++ printk("iptables forward must be 0 or 1\n"); ++ return -EINVAL; ++ } ++ ++ /* Entry 1 is the FORWARD hook */ ++ initial_table.entries[1].target.verdict = -forward - 1; ++ ++ err = init_ip6table_filter(); ++ if (err < 0) ++ return err; ++ ++ KSYMRESOLVE(init_ip6table_filter); ++ KSYMRESOLVE(fini_ip6table_filter); ++ KSYMMODRESOLVE(ip6table_filter); ++ return 0; ++} ++ ++static void __exit ip6table_filter_fini(void) ++{ ++ KSYMMODUNRESOLVE(ip6table_filter); ++ KSYMUNRESOLVE(init_ip6table_filter); ++ KSYMUNRESOLVE(fini_ip6table_filter); ++ fini_ip6table_filter(); + } + + module_init(ip6table_filter_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/netfilter/ip6table_mangle.c debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6table_mangle.c +--- ./net/ipv6/netfilter/ip6table_mangle.c 2012-06-12 16:25:24.434312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6table_mangle.c 2012-11-13 15:20:15.704569053 +0000 +@@ -10,6 +10,7 @@ + */ + #include + #include ++#include + + MODULE_LICENSE("GPL"); + MODULE_AUTHOR("Netfilter Core Team "); +@@ -26,7 +27,7 @@ + struct ip6t_replace repl; + struct ip6t_standard entries[5]; + struct ip6t_error term; +-} initial_table __initdata = { ++} initial_table = { + .repl = { + .name = "mangle", + .valid_hooks = MANGLE_VALID_HOOKS, +@@ -65,6 +66,13 @@ + .af = AF_INET6, + }; + ++#ifdef CONFIG_VE_IPTABLES ++#include ++#define ve_packet_mangler (get_exec_env()->_ip6t_mangle_table) ++#else ++#define ve_packet_mangler &packet_mangler ++#endif ++ + /* The work comes in here from netfilter.c. */ + static unsigned int + ip6t_route_hook(unsigned int hook, +@@ -73,7 +81,7 @@ + const struct net_device *out, + int (*okfn)(struct sk_buff *)) + { +- return ip6t_do_table(skb, hook, in, out, &packet_mangler); ++ return ip6t_do_table(skb, hook, in, out, ve_packet_mangler); + } + + static unsigned int +@@ -108,7 +116,7 @@ + /* flowlabel and prio (includes version, which shouldn't change either */ + flowlabel = *((u_int32_t *)ipv6_hdr(skb)); + +- ret = ip6t_do_table(skb, hook, in, out, &packet_mangler); ++ ret = ip6t_do_table(skb, hook, in, out, ve_packet_mangler); + + if (ret != NF_DROP && ret != NF_STOLEN + && (memcmp(&ipv6_hdr(skb)->saddr, &saddr, sizeof(saddr)) +@@ -158,14 +166,19 @@ + }, + }; + +-static int __init ip6table_mangle_init(void) ++int init_ip6table_mangle(void) + { + int ret; ++ struct ip6t_table *tmp_mangler; + + /* Register table */ +- ret = ip6t_register_table(&packet_mangler, &initial_table.repl); +- if (ret < 0) +- return ret; ++ tmp_mangler = ip6t_register_table(&packet_mangler, ++ &initial_table.repl); ++ if (IS_ERR(tmp_mangler)) ++ return PTR_ERR(tmp_mangler); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_mangler = tmp_mangler; ++#endif + + /* Register hooks */ + ret = nf_register_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops)); +@@ -175,14 +188,42 @@ + return ret; + + cleanup_table: +- ip6t_unregister_table(&packet_mangler); ++ ip6t_unregister_table(ve_packet_mangler); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_mangler = NULL; ++#endif + return ret; + } + +-static void __exit ip6table_mangle_fini(void) ++void fini_ip6table_mangle(void) + { + nf_unregister_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops)); +- ip6t_unregister_table(&packet_mangler); ++ ip6t_unregister_table(ve_packet_mangler); ++#ifdef CONFIG_VE_IPTABLES ++ ve_packet_mangler = NULL; ++#endif ++} ++ ++static int __init ip6table_mangle_init(void) ++{ ++ int err; ++ ++ err = init_ip6table_mangle(); ++ if (err < 0) ++ return err; ++ ++ KSYMRESOLVE(init_ip6table_mangle); ++ KSYMRESOLVE(fini_ip6table_mangle); ++ KSYMMODRESOLVE(ip6table_mangle); ++ return 0; ++} ++ ++static void __exit ip6table_mangle_fini(void) ++{ ++ KSYMMODUNRESOLVE(ip6table_mangle); ++ KSYMUNRESOLVE(init_ip6table_mangle); ++ KSYMUNRESOLVE(fini_ip6table_mangle); ++ fini_ip6table_mangle(); + } + + module_init(ip6table_mangle_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/netfilter/ip6table_raw.c debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6table_raw.c +--- ./net/ipv6/netfilter/ip6table_raw.c 2012-06-12 16:25:24.434312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/netfilter/ip6table_raw.c 2012-11-13 15:20:15.704569053 +0000 +@@ -74,11 +74,12 @@ + static int __init ip6table_raw_init(void) + { + int ret; ++ struct ip6t_table *tmp; + + /* Register table */ +- ret = ip6t_register_table(&packet_raw, &initial_table.repl); +- if (ret < 0) +- return ret; ++ tmp = ip6t_register_table(&packet_raw, &initial_table.repl); ++ if (IS_ERR(tmp)) ++ return PTR_ERR(tmp); + + /* Register hooks */ + ret = nf_register_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops)); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c debian/binary-custom.d/openvz/src/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +--- ./net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c 2012-06-12 16:25:24.434312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c 2012-11-13 15:20:15.704569053 +0000 +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -394,39 +395,101 @@ + MODULE_LICENSE("GPL"); + MODULE_AUTHOR("Yasuyuki KOZAKAI @USAGI "); + +-static int __init nf_conntrack_l3proto_ipv6_init(void) ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++static int nf_ct_proto_ipv6_sysctl_init(void) + { +- int ret = 0; ++ struct nf_conntrack_l3proto *ipv6; + +- need_conntrack(); ++ if (ve_is_super(get_exec_env())) { ++ ipv6 = &nf_conntrack_l3proto_ipv6; ++ goto out; ++ } ++ ++ ipv6 = kmemdup(&nf_conntrack_l3proto_ipv6, ++ sizeof(struct nf_conntrack_l3proto), GFP_KERNEL); ++ if (!ipv6) ++ goto no_mem_ct; ++ ++ ipv6->ctl_table_path = nf_net_netfilter_sysctl_path; ++ ipv6->ctl_table = clone_sysctl_template(nf_ct_ipv6_sysctl_table); ++ if (!ipv6->ctl_table) ++ goto no_mem_sys; ++ ++ ipv6->ctl_table[0].data = &ve_nf_ct_frag6_timeout; ++ ipv6->ctl_table[1].data = &ve_nf_ct_frag6_low_thresh; ++ ipv6->ctl_table[2].data = &ve_nf_ct_frag6_high_thresh; ++out: ++ ve_nf_ct_frag6_timeout = nf_frags_ctl.timeout; ++ ve_nf_ct_frag6_low_thresh = nf_frags_ctl.low_thresh; ++ ve_nf_ct_frag6_high_thresh = nf_frags_ctl.high_thresh; ++ ++ ve_nf_conntrack_l3proto_ipv6 = ipv6; ++ return 0; + ++no_mem_sys: ++ kfree(ipv6); ++no_mem_ct: ++ return -ENOMEM; ++} ++ ++static void nf_ct_proto_ipv6_sysctl_cleanup(void) ++{ ++ if (!ve_is_super(get_exec_env())) { ++ free_sysctl_clone(ve_nf_conntrack_l3proto_ipv6->ctl_table); ++ kfree(ve_nf_conntrack_l3proto_ipv6); ++ } ++} ++#endif /* CONFIG_VE_IPTABLES && CONFIG_SYSCTL */ ++ ++int init_nf_ct_l3proto_ipv6(void) ++{ ++ int ret = -ENOMEM; ++ ++#ifdef CONFIG_VE_IPTABLES ++ if (!ve_is_super(get_exec_env())) ++ __module_get(THIS_MODULE); ++ ++ ret = nf_ct_proto_ipv6_sysctl_init(); ++ if (ret < 0) ++ goto no_mem_ipv6; ++ ret = nf_ct_proto_tcp_sysctl_init(); ++ if (ret < 0) ++ goto no_mem_tcp; ++ ret = nf_ct_proto_udp_sysctl_init(); ++ if (ret < 0) ++ goto no_mem_udp; ++ ret = nf_ct_proto_icmpv6_sysctl_init(); ++ if (ret < 0) ++ goto no_mem_icmp; ++#endif /* CONFIG_VE_IPTABLES */ + ret = nf_ct_frag6_init(); + if (ret < 0) { + printk("nf_conntrack_ipv6: can't initialize frag6.\n"); +- return ret; ++ goto cleanup_sys; + } +- ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_tcp6); ++ ++ ret = nf_conntrack_l4proto_register(ve_nf_conntrack_l4proto_tcp6); + if (ret < 0) { + printk("nf_conntrack_ipv6: can't register tcp.\n"); + goto cleanup_frag6; + } + +- ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_udp6); ++ ret = nf_conntrack_l4proto_register(ve_nf_conntrack_l4proto_udp6); + if (ret < 0) { + printk("nf_conntrack_ipv6: can't register udp.\n"); +- goto cleanup_tcp; ++ goto unreg_tcp; + } + +- ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_icmpv6); ++ ret = nf_conntrack_l4proto_register(ve_nf_conntrack_l4proto_icmpv6); + if (ret < 0) { + printk("nf_conntrack_ipv6: can't register icmpv6.\n"); +- goto cleanup_udp; ++ goto unreg_udp; + } + +- ret = nf_conntrack_l3proto_register(&nf_conntrack_l3proto_ipv6); ++ ret = nf_conntrack_l3proto_register(ve_nf_conntrack_l3proto_ipv6); + if (ret < 0) { + printk("nf_conntrack_ipv6: can't register ipv6\n"); +- goto cleanup_icmpv6; ++ goto unreg_icmpv6; + } + + ret = nf_register_hooks(ipv6_conntrack_ops, +@@ -434,32 +497,80 @@ + if (ret < 0) { + printk("nf_conntrack_ipv6: can't register pre-routing defrag " + "hook.\n"); +- goto cleanup_ipv6; ++ goto unreg_ipv6; + } +- return ret; ++ return 0; + +- cleanup_ipv6: +- nf_conntrack_l3proto_unregister(&nf_conntrack_l3proto_ipv6); +- cleanup_icmpv6: +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_icmpv6); +- cleanup_udp: +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_udp6); +- cleanup_tcp: +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_tcp6); +- cleanup_frag6: ++unreg_ipv6: ++ nf_conntrack_l3proto_unregister(ve_nf_conntrack_l3proto_ipv6); ++unreg_icmpv6: ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_icmpv6); ++unreg_udp: ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_udp6); ++unreg_tcp: ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_tcp6); ++cleanup_frag6: + nf_ct_frag6_cleanup(); ++cleanup_sys: ++#ifdef CONFIG_VE_IPTABLES ++no_mem_icmp: ++ nf_ct_proto_udp_sysctl_cleanup(); ++no_mem_udp: ++ nf_ct_proto_tcp_sysctl_cleanup(); ++no_mem_tcp: ++ nf_ct_proto_ipv6_sysctl_cleanup(); ++no_mem_ipv6: ++ if (!ve_is_super(get_exec_env())) ++ module_put(THIS_MODULE); ++#endif /* CONFIG_VE_IPTABLES */ + return ret; + } ++EXPORT_SYMBOL(init_nf_ct_l3proto_ipv6); + +-static void __exit nf_conntrack_l3proto_ipv6_fini(void) ++void fini_nf_ct_l3proto_ipv6(void) + { +- synchronize_net(); + nf_unregister_hooks(ipv6_conntrack_ops, ARRAY_SIZE(ipv6_conntrack_ops)); +- nf_conntrack_l3proto_unregister(&nf_conntrack_l3proto_ipv6); +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_icmpv6); +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_udp6); +- nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_tcp6); ++ nf_conntrack_l3proto_unregister(ve_nf_conntrack_l3proto_ipv6); ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_icmpv6); ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_udp6); ++ nf_conntrack_l4proto_unregister(ve_nf_conntrack_l4proto_tcp6); + nf_ct_frag6_cleanup(); ++ ++#ifdef CONFIG_VE_IPTABLES ++ nf_ct_proto_icmpv6_sysctl_cleanup(); ++ nf_ct_proto_udp_sysctl_cleanup(); ++ nf_ct_proto_tcp_sysctl_cleanup(); ++ nf_ct_proto_ipv6_sysctl_cleanup(); ++ if (!ve_is_super(get_exec_env())) ++ module_put(THIS_MODULE); ++#endif /* CONFIG_VE_IPTABLES */ ++} ++EXPORT_SYMBOL(fini_nf_ct_l3proto_ipv6); ++ ++static int __init nf_conntrack_l3proto_ipv6_init(void) ++{ ++ int ret = 0; ++ ++ need_conntrack(); ++ ++ ret = init_nf_ct_l3proto_ipv6(); ++ if (ret < 0) { ++ printk(KERN_ERR "Unable to initialize netfilter protocols\n"); ++ return ret; ++ } ++ KSYMRESOLVE(init_nf_ct_l3proto_ipv6); ++ KSYMRESOLVE(fini_nf_ct_l3proto_ipv6); ++ KSYMMODRESOLVE(nf_conntrack_ipv6); ++ return 0; ++} ++ ++static void __exit nf_conntrack_l3proto_ipv6_fini(void) ++{ ++ synchronize_net(); ++ KSYMMODUNRESOLVE(nf_conntrack_ipv6); ++ KSYMUNRESOLVE(init_nf_ct_l3proto_ipv6); ++ KSYMUNRESOLVE(fini_nf_ct_l3proto_ipv6); ++ fini_nf_ct_l3proto_ipv6(); + } + + module_init(nf_conntrack_l3proto_ipv6_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c debian/binary-custom.d/openvz/src/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +--- ./net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c 2012-06-12 16:25:24.434312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c 2012-11-13 15:20:15.704569053 +0000 +@@ -10,6 +10,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -100,7 +101,7 @@ + } else { + atomic_inc(&ct->proto.icmp.count); + nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, skb); +- nf_ct_refresh_acct(ct, ctinfo, skb, nf_ct_icmpv6_timeout); ++ nf_ct_refresh_acct(ct, ctinfo, skb, ve_nf_ct_icmpv6_timeout); + } + + return NF_ACCEPT; +@@ -156,7 +157,7 @@ + /* Ordinarily, we'd expect the inverted tupleproto, but it's + been preserved inside the ICMP. */ + if (!nf_ct_invert_tuple(&intuple, &origtuple, +- &nf_conntrack_l3proto_ipv6, inproto)) { ++ ve_nf_conntrack_l3proto_ipv6, inproto)) { + pr_debug("icmpv6_error: Can't invert tuple\n"); + return -NF_ACCEPT; + } +@@ -294,3 +295,47 @@ + .ctl_table = icmpv6_sysctl_table, + #endif + }; ++ ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++int nf_ct_proto_icmpv6_sysctl_init(void) ++{ ++ struct nf_conntrack_l4proto *icmp6; ++ ++ if (ve_is_super(get_exec_env())) { ++ icmp6 = &nf_conntrack_l4proto_icmpv6; ++ goto out; ++ } ++ ++ icmp6 = kmemdup(&nf_conntrack_l4proto_icmpv6, ++ sizeof(struct nf_conntrack_l4proto), GFP_KERNEL); ++ if (!icmp6) ++ goto no_mem_ct; ++ ++ icmp6->ctl_table_header = &ve_icmpv6_sysctl_header; ++ icmp6->ctl_table = clone_sysctl_template(icmpv6_sysctl_table); ++ if (!icmp6->ctl_table) ++ goto no_mem_sys; ++ ++ icmp6->ctl_table[0].data = &ve_nf_ct_icmpv6_timeout; ++out: ++ ve_nf_ct_icmpv6_timeout = nf_ct_icmpv6_timeout; ++ ++ ve_nf_conntrack_l4proto_icmpv6 = icmp6; ++ return 0; ++ ++no_mem_sys: ++ kfree(icmp6); ++no_mem_ct: ++ return -ENOMEM; ++} ++EXPORT_SYMBOL(nf_ct_proto_icmpv6_sysctl_init); ++ ++void nf_ct_proto_icmpv6_sysctl_cleanup(void) ++{ ++ if (!ve_is_super(get_exec_env())) { ++ free_sysctl_clone(ve_nf_conntrack_l4proto_icmpv6->ctl_table); ++ kfree(ve_nf_conntrack_l4proto_icmpv6); ++ } ++} ++EXPORT_SYMBOL(nf_ct_proto_icmpv6_sysctl_cleanup); ++#endif /* CONFIG_VE_IPTABLES && CONFIG_SYSCTL */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/netfilter/nf_conntrack_reasm.c debian/binary-custom.d/openvz/src/net/ipv6/netfilter/nf_conntrack_reasm.c +--- ./net/ipv6/netfilter/nf_conntrack_reasm.c 2012-07-12 14:36:18.946805285 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/netfilter/nf_conntrack_reasm.c 2012-11-13 15:20:15.708569054 +0000 +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + + #define NF_CT_FRAG6_HIGH_THRESH 262144 /* == 256*1024 */ + #define NF_CT_FRAG6_LOW_THRESH 196608 /* == 192*1024 */ +@@ -76,9 +77,16 @@ + .timeout = IPV6_FRAG_TIMEOUT, + .secret_interval = 10 * 60 * HZ, + }; +- + static struct inet_frags nf_frags; + ++#ifdef CONFIG_VE_IPTABLES ++#define ve_nf_frags (get_exec_env()->_nf_conntrack->_nf_frags6) ++#define ve_nf_frags_ctl (get_exec_env()->_nf_conntrack->_nf_frags6_ctl) ++#else ++#define ve_nf_frags nf_frags ++#define ve_nf_frags_ctl nf_frags_ctl ++#endif ++ + static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr, + struct in6_addr *daddr) + { +@@ -90,7 +98,7 @@ + + a += JHASH_GOLDEN_RATIO; + b += JHASH_GOLDEN_RATIO; +- c += nf_frags.rnd; ++ c += ve_nf_frags.rnd; + __jhash_mix(a, b, c); + + a += (__force u32)saddr->s6_addr32[3]; +@@ -125,7 +133,7 @@ + { + if (work) + *work -= skb->truesize; +- atomic_sub(skb->truesize, &nf_frags.mem); ++ atomic_sub(skb->truesize, &ve_nf_frags.mem); + nf_skb_free(skb); + kfree_skb(skb); + } +@@ -134,7 +142,7 @@ + + static __inline__ void fq_put(struct nf_ct_frag6_queue *fq) + { +- inet_frag_put(&fq->q, &nf_frags); ++ inet_frag_put(&fq->q, &ve_nf_frags); + } + + /* Kill fq entry. It is not destroyed immediately, +@@ -142,13 +150,13 @@ + */ + static __inline__ void fq_kill(struct nf_ct_frag6_queue *fq) + { +- inet_frag_kill(&fq->q, &nf_frags); ++ inet_frag_kill(&fq->q, &ve_nf_frags); + } + + static void nf_ct_frag6_evictor(void) + { + local_bh_disable(); +- inet_frag_evictor(&nf_frags); ++ inet_frag_evictor(&ve_nf_frags); + local_bh_enable(); + } + +@@ -185,7 +193,7 @@ + arg.dst = dst; + hash = ip6qhashfn(id, src, dst); + +- q = inet_frag_find(&nf_frags, &arg, hash); ++ q = inet_frag_find(&ve_nf_frags, &arg, hash); + if (q == NULL) + goto oom; + +@@ -354,7 +362,7 @@ + skb->dev = NULL; + fq->q.stamp = skb->tstamp; + fq->q.meat += skb->len; +- atomic_add(skb->truesize, &nf_frags.mem); ++ atomic_add(skb->truesize, &ve_nf_frags.mem); + + /* The first fragment. + * nhoffset is obtained from the first fragment, of course. +@@ -363,9 +371,9 @@ + fq->nhoffset = nhoff; + fq->q.last_in |= FIRST_IN; + } +- write_lock(&nf_frags.lock); +- list_move_tail(&fq->q.lru_list, &nf_frags.lru_list); +- write_unlock(&nf_frags.lock); ++ write_lock(&ve_nf_frags.lock); ++ list_move_tail(&fq->q.lru_list, &ve_nf_frags.lru_list); ++ write_unlock(&ve_nf_frags.lock); + return 0; + + err: +@@ -431,7 +439,7 @@ + clone->ip_summed = head->ip_summed; + + NFCT_FRAG6_CB(clone)->orig = NULL; +- atomic_add(clone->truesize, &nf_frags.mem); ++ atomic_add(clone->truesize, &ve_nf_frags.mem); + } + + /* We have to remove fragment header from datagram and to relocate +@@ -445,7 +453,7 @@ + skb_shinfo(head)->frag_list = head->next; + skb_reset_transport_header(head); + skb_push(head, head->data - skb_network_header(head)); +- atomic_sub(head->truesize, &nf_frags.mem); ++ atomic_sub(head->truesize, &ve_nf_frags.mem); + + for (fp=head->next; fp; fp = fp->next) { + head->data_len += fp->len; +@@ -455,7 +463,7 @@ + else if (head->ip_summed == CHECKSUM_COMPLETE) + head->csum = csum_add(head->csum, fp->csum); + head->truesize += fp->truesize; +- atomic_sub(fp->truesize, &nf_frags.mem); ++ atomic_sub(fp->truesize, &ve_nf_frags.mem); + } + + head->next = NULL; +@@ -599,7 +607,7 @@ + hdr = ipv6_hdr(clone); + fhdr = (struct frag_hdr *)skb_transport_header(clone); + +- if (atomic_read(&nf_frags.mem) > nf_frags_ctl.high_thresh) ++ if (atomic_read(&ve_nf_frags.mem) > ve_nf_frags_ctl.high_thresh) + nf_ct_frag6_evictor(); + + fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr); +@@ -670,23 +678,24 @@ + + int nf_ct_frag6_init(void) + { +- nf_frags.ctl = &nf_frags_ctl; +- nf_frags.hashfn = nf_hashfn; +- nf_frags.constructor = ip6_frag_init; +- nf_frags.destructor = NULL; +- nf_frags.skb_free = nf_skb_free; +- nf_frags.qsize = sizeof(struct nf_ct_frag6_queue); +- nf_frags.match = ip6_frag_match; +- nf_frags.frag_expire = nf_ct_frag6_expire; +- inet_frags_init(&nf_frags); ++ memcpy(&ve_nf_frags_ctl, &nf_frags_ctl, sizeof(struct inet_frags_ctl)); ++ ve_nf_frags.ctl = &ve_nf_frags_ctl; ++ ve_nf_frags.hashfn = nf_hashfn; ++ ve_nf_frags.constructor = ip6_frag_init; ++ ve_nf_frags.destructor = NULL; ++ ve_nf_frags.skb_free = nf_skb_free; ++ ve_nf_frags.qsize = sizeof(struct nf_ct_frag6_queue); ++ ve_nf_frags.match = ip6_frag_match; ++ ve_nf_frags.frag_expire = nf_ct_frag6_expire; ++ inet_frags_init(&ve_nf_frags); + + return 0; + } + + void nf_ct_frag6_cleanup(void) + { +- inet_frags_fini(&nf_frags); ++ inet_frags_fini(&ve_nf_frags); + +- nf_frags_ctl.low_thresh = 0; ++ ve_nf_frags_ctl.low_thresh = 0; + nf_ct_frag6_evictor(); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/proc.c debian/binary-custom.d/openvz/src/net/ipv6/proc.c +--- ./net/ipv6/proc.c 2012-06-12 16:25:24.434312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/proc.c 2012-11-13 15:20:15.708569054 +0000 +@@ -22,15 +22,21 @@ + #include + #include + #include ++#include + #include + #include + #include ++#include + #include + #include + #include + #include + ++#ifdef CONFIG_VE ++#define proc_net_devsnmp6 (get_exec_env()->_proc_net_devsnmp6) ++#else + static struct proc_dir_entry *proc_net_devsnmp6; ++#endif + + static int sockstat6_seq_show(struct seq_file *seq, void *v) + { +@@ -171,11 +177,11 @@ + snmp6_seq_show_item(seq, (void **)idev->stats.icmpv6, snmp6_icmp6_list); + snmp6_seq_show_icmpv6msg(seq, (void **)idev->stats.icmpv6msg); + } else { +- snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list); +- snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list); +- snmp6_seq_show_icmpv6msg(seq, (void **)icmpv6msg_statistics); +- snmp6_seq_show_item(seq, (void **)udp_stats_in6, snmp6_udp6_list); +- snmp6_seq_show_item(seq, (void **)udplite_stats_in6, snmp6_udplite6_list); ++ snmp6_seq_show_item(seq, (void **)ve_ipv6_statistics, snmp6_ipstats_list); ++ snmp6_seq_show_item(seq, (void **)ve_icmpv6_statistics, snmp6_icmp6_list); ++ snmp6_seq_show_icmpv6msg(seq, (void **)ve_icmpv6msg_statistics); ++ snmp6_seq_show_item(seq, (void **)ve_udp_stats_in6, snmp6_udp6_list); ++ snmp6_seq_show_item(seq, (void **)ve_udplite_stats_in6, snmp6_udplite6_list); + } + return 0; + } +@@ -233,12 +239,27 @@ + return -ENOENT; + if (!idev || !idev->stats.proc_dir_entry) + return -EINVAL; +- remove_proc_entry(idev->stats.proc_dir_entry->name, ++ remove_proc_glob_entry(idev->stats.proc_dir_entry->name, + proc_net_devsnmp6); + idev->stats.proc_dir_entry = NULL; + return 0; + } + ++int ve_snmp_proc_init(struct ve_struct *ve) ++{ ++ ve->_proc_net_devsnmp6 = proc_mkdir("dev_snmp6", ve->_proc_net); ++ if (!ve->_proc_net_devsnmp6) ++ return -ENOMEM; ++ return 0; ++} ++EXPORT_SYMBOL(ve_snmp_proc_init); ++ ++void ve_snmp_proc_fini(struct ve_struct *ve) ++{ ++ remove_proc_entry("dev_snmp6", ve->_proc_net); ++} ++EXPORT_SYMBOL(ve_snmp_proc_fini); ++ + int __init ipv6_misc_proc_init(void) + { + int rc = 0; +@@ -246,8 +267,7 @@ + if (!proc_net_fops_create(&init_net, "snmp6", S_IRUGO, &snmp6_seq_fops)) + goto proc_snmp6_fail; + +- proc_net_devsnmp6 = proc_mkdir("dev_snmp6", init_net.proc_net); +- if (!proc_net_devsnmp6) ++ if (ve_snmp_proc_init(get_exec_env())) + goto proc_dev_snmp6_fail; + + if (!proc_net_fops_create(&init_net, "sockstat6", S_IRUGO, &sockstat6_seq_fops)) +@@ -256,7 +276,7 @@ + return rc; + + proc_sockstat6_fail: +- proc_net_remove(&init_net, "dev_snmp6"); ++ ve_snmp_proc_fini(get_exec_env()); + proc_dev_snmp6_fail: + proc_net_remove(&init_net, "snmp6"); + proc_snmp6_fail: +@@ -267,7 +287,7 @@ + void ipv6_misc_proc_exit(void) + { + proc_net_remove(&init_net, "sockstat6"); +- proc_net_remove(&init_net, "dev_snmp6"); ++ ve_snmp_proc_fini(get_exec_env()); + proc_net_remove(&init_net, "snmp6"); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/raw.c debian/binary-custom.d/openvz/src/net/ipv6/raw.c +--- ./net/ipv6/raw.c 2012-06-12 16:25:24.434312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/raw.c 2012-11-13 15:20:15.708569054 +0000 +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -102,6 +103,10 @@ + if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif) + continue; + ++ if (!ve_accessible_strict(sk->owner_env, ++ get_exec_env())) ++ continue; ++ + if (!ipv6_addr_any(&np->rcv_saddr)) { + if (ipv6_addr_equal(&np->rcv_saddr, loc_addr)) + goto found; +@@ -283,7 +288,7 @@ + if (!sk->sk_bound_dev_if) + goto out; + +- dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, sk->sk_bound_dev_if); + if (!dev) { + err = -ENODEV; + goto out; +@@ -1200,8 +1205,13 @@ + do { + sk = sk_next(sk); + try_again: +- ; +- } while (sk && sk->sk_family != PF_INET6); ++ if (!sk) ++ break; ++ if (sk->sk_family != PF_INET6) ++ continue; ++ if (ve_accessible(sk->owner_env, get_exec_env())) ++ break; ++ } while (1); + + if (!sk && ++state->bucket < RAWV6_HTABLE_SIZE) { + sk = sk_head(&raw_v6_htable[state->bucket]); +@@ -1304,15 +1314,30 @@ + .release = seq_release_private, + }; + +-int __init raw6_proc_init(void) ++static int raw6_net_init(struct net *net) + { +- if (!proc_net_fops_create(&init_net, "raw6", S_IRUGO, &raw6_seq_fops)) ++ if (!proc_net_fops_create(net, "raw6", S_IRUGO, &raw6_seq_fops)) + return -ENOMEM; + return 0; + } + ++static void raw6_net_exit(struct net *net) ++{ ++ proc_net_remove(net, "raw6"); ++} ++ ++static struct pernet_operations raw6_net_ops = { ++ .init = raw6_net_init, ++ .exit = raw6_net_exit, ++}; ++ ++int __init raw6_proc_init(void) ++{ ++ return register_pernet_subsys(&raw6_net_ops); ++} ++ + void raw6_proc_exit(void) + { +- proc_net_remove(&init_net, "raw6"); ++ unregister_pernet_subsys(&raw6_net_ops); + } + #endif /* CONFIG_PROC_FS */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/reassembly.c debian/binary-custom.d/openvz/src/net/ipv6/reassembly.c +--- ./net/ipv6/reassembly.c 2012-06-12 16:25:24.434312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/reassembly.c 2012-11-13 15:20:15.708569054 +0000 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -151,7 +152,8 @@ + fq = container_of(q, struct frag_queue, q); + return (fq->id == arg->id && + ipv6_addr_equal(&fq->saddr, arg->src) && +- ipv6_addr_equal(&fq->daddr, arg->dst)); ++ ipv6_addr_equal(&fq->daddr, arg->dst) && ++ q->owner_ve == get_exec_env()); + } + EXPORT_SYMBOL(ip6_frag_match); + +@@ -201,10 +203,12 @@ + + static void ip6_frag_expire(unsigned long data) + { +- struct frag_queue *fq; ++ struct inet_frag_queue *q = (struct inet_frag_queue *)data; ++ struct frag_queue *fq = container_of(q, struct frag_queue, q); + struct net_device *dev = NULL; ++ struct ve_struct *old_ve; + +- fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q); ++ old_ve = set_exec_env(q->owner_ve); + + spin_lock(&fq->q.lock); + +@@ -213,7 +217,7 @@ + + fq_kill(fq); + +- dev = dev_get_by_index(&init_net, fq->iif); ++ dev = dev_get_by_index(get_exec_env()->ve_netns, fq->iif); + if (!dev) + goto out; + +@@ -238,6 +242,8 @@ + dev_put(dev); + spin_unlock(&fq->q.lock); + fq_put(fq); ++ ++ (void)set_exec_env(old_ve); + } + + static __inline__ struct frag_queue * +@@ -511,6 +517,7 @@ + clone->csum = 0; + clone->ip_summed = head->ip_summed; + atomic_add(clone->truesize, &ip6_frags.mem); ++ clone->owner_env = head->owner_env; + } + + /* We have to remove fragment header from datagram and to relocate +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/route.c debian/binary-custom.d/openvz/src/net/ipv6/route.c +--- ./net/ipv6/route.c 2012-06-12 16:25:24.438312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/route.c 2012-11-13 15:20:15.708569054 +0000 +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -49,7 +50,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -216,9 +216,10 @@ + { + struct rt6_info *rt = (struct rt6_info *)dst; + struct inet6_dev *idev = rt->rt6i_idev; ++ struct net_device *loopback_dev = dev->nd_net->loopback_dev; + +- if (dev != init_net.loopback_dev && idev != NULL && idev->dev == dev) { +- struct inet6_dev *loopback_idev = in6_dev_get(init_net.loopback_dev); ++ if (dev != loopback_dev && idev != NULL && idev->dev == dev) { ++ struct inet6_dev *loopback_idev = in6_dev_get(loopback_dev); + if (loopback_idev != NULL) { + rt->rt6i_idev = loopback_idev; + in6_dev_put(idev); +@@ -668,8 +669,9 @@ + int strict = 0; + int attempts = 3; + int err; +- int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE; +- ++ int reachable; ++ ++ reachable = ve_ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE; + strict |= flags & RT6_LOOKUP_F_IFACE; + + relookup: +@@ -1033,7 +1035,7 @@ + + int ipv6_get_hoplimit(struct net_device *dev) + { +- int hoplimit = ipv6_devconf.hop_limit; ++ int hoplimit = ve_ipv6_devconf.hop_limit; + struct inet6_dev *idev; + + idev = in6_dev_get(dev); +@@ -1050,6 +1052,7 @@ + + int ip6_route_add(struct fib6_config *cfg) + { ++ struct net *net = get_exec_env()->ve_netns; + int err; + struct rt6_info *rt = NULL; + struct net_device *dev = NULL; +@@ -1065,7 +1068,7 @@ + #endif + if (cfg->fc_ifindex) { + err = -ENODEV; +- dev = dev_get_by_index(&init_net, cfg->fc_ifindex); ++ dev = dev_get_by_index(net, cfg->fc_ifindex); + if (!dev) + goto out; + idev = in6_dev_get(dev); +@@ -1122,13 +1125,15 @@ + */ + if ((cfg->fc_flags & RTF_REJECT) || + (dev && (dev->flags&IFF_LOOPBACK) && !(addr_type&IPV6_ADDR_LOOPBACK))) { ++ struct net *net = get_exec_env()->ve_netns; ++ + /* hold loopback dev/idev if we haven't done so. */ +- if (dev != init_net.loopback_dev) { ++ if (dev != net->loopback_dev) { + if (dev) { + dev_put(dev); + in6_dev_put(idev); + } +- dev = init_net.loopback_dev; ++ dev = net->loopback_dev; + dev_hold(dev); + idev = in6_dev_get(dev); + if (!idev) { +@@ -1827,18 +1832,19 @@ + const struct in6_addr *addr, + int anycast) + { ++ struct net *net = get_exec_env()->ve_netns; + struct rt6_info *rt = ip6_dst_alloc(); + + if (rt == NULL) + return ERR_PTR(-ENOMEM); + +- dev_hold(init_net.loopback_dev); ++ dev_hold(net->loopback_dev); + in6_dev_hold(idev); + + rt->u.dst.flags = DST_HOST; + rt->u.dst.input = ip6_input; + rt->u.dst.output = ip6_output; +- rt->rt6i_dev = init_net.loopback_dev; ++ rt->rt6i_dev = net->loopback_dev; + rt->rt6i_idev = idev; + rt->u.dst.metrics[RTAX_MTU-1] = ipv6_get_mtu(rt->rt6i_dev); + rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(dst_mtu(&rt->u.dst)); +@@ -1850,10 +1856,12 @@ + rt->rt6i_flags |= RTF_ANYCAST; + else + rt->rt6i_flags |= RTF_LOCAL; +- rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); +- if (rt->rt6i_nexthop == NULL) { +- dst_free(&rt->u.dst); +- return ERR_PTR(-ENOMEM); ++ rt->rt6i_nexthop = __neigh_lookup_errno(&nd_tbl, &rt->rt6i_gateway, rt->rt6i_dev); ++ if (IS_ERR(rt->rt6i_nexthop)) { ++ void *err = rt->rt6i_nexthop; ++ rt->rt6i_nexthop = NULL; ++ dst_free((struct dst_entry *) rt); ++ return err; + } + + ipv6_addr_copy(&rt->rt6i_dst.addr, addr); +@@ -2129,8 +2137,12 @@ + if (rt->u.dst.neighbour) + NLA_PUT(skb, RTA_GATEWAY, 16, &rt->u.dst.neighbour->primary_key); + +- if (rt->u.dst.dev) +- NLA_PUT_U32(skb, RTA_OIF, rt->rt6i_dev->ifindex); ++ if (rt->u.dst.dev) { ++ struct net_device *odev = rt->rt6i_dev; ++ if (rt == &ip6_null_entry) ++ odev = get_exec_env()->ve_netns->loopback_dev; ++ NLA_PUT_U32(skb, RTA_OIF, odev->ifindex); ++ } + + NLA_PUT_U32(skb, RTA_PRIORITY, rt->rt6i_metric); + +@@ -2164,6 +2176,7 @@ + + static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) + { ++ struct net *net = in_skb->sk->sk_net; + struct nlattr *tb[RTA_MAX+1]; + struct rt6_info *rt; + struct sk_buff *skb; +@@ -2200,7 +2213,7 @@ + + if (iif) { + struct net_device *dev; +- dev = __dev_get_by_index(&init_net, iif); ++ dev = __dev_get_by_index(net, iif); + if (!dev) { + err = -ENODEV; + goto errout; +@@ -2230,13 +2243,14 @@ + goto errout; + } + +- err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid); ++ err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).pid); + errout: + return err; + } + + void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info) + { ++ struct net *net = get_exec_env()->ve_netns; + struct sk_buff *skb; + u32 pid = 0, seq = 0; + struct nlmsghdr *nlh = NULL; +@@ -2260,10 +2274,10 @@ + kfree_skb(skb); + goto errout; + } +- err = rtnl_notify(skb, pid, RTNLGRP_IPV6_ROUTE, nlh, gfp_any()); ++ err = rtnl_notify(skb, net, pid, RTNLGRP_IPV6_ROUTE, nlh, gfp_any()); + errout: + if (err < 0) +- rtnl_set_sk_err(RTNLGRP_IPV6_ROUTE, err); ++ rtnl_set_sk_err(net, RTNLGRP_IPV6_ROUTE, err); + } + + /* +@@ -2463,6 +2477,23 @@ + + #endif + ++static int ip6_route_net_init(struct net *net) ++{ ++ if (!proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops)) ++ return -ENOMEM; ++ return 0; ++} ++ ++static void ip6_route_net_exit(struct net *net) ++{ ++ proc_net_remove(net, "ipv6_route"); ++} ++ ++static struct pernet_operations ip6_route_net_ops = { ++ .init = ip6_route_net_init, ++ .exit = ip6_route_net_exit, ++}; ++ + void __init ip6_route_init(void) + { + ip6_dst_ops.kmem_cachep = +@@ -2471,7 +2502,6 @@ + ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops.kmem_cachep; + + fib6_init(); +- proc_net_fops_create(&init_net, "ipv6_route", 0, &ipv6_route_proc_fops); + proc_net_fops_create(&init_net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops); + #ifdef CONFIG_XFRM + xfrm6_init(); +@@ -2483,15 +2513,16 @@ + __rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL); + __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL); + __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL); ++ register_pernet_subsys(&ip6_route_net_ops); + } + + void ip6_route_cleanup(void) + { ++ unregister_pernet_subsys(&ip6_route_net_ops); + #ifdef CONFIG_IPV6_MULTIPLE_TABLES + fib6_rules_cleanup(); + #endif + #ifdef CONFIG_PROC_FS +- proc_net_remove(&init_net, "ipv6_route"); + proc_net_remove(&init_net, "rt6_stats"); + #endif + #ifdef CONFIG_XFRM +@@ -2501,3 +2532,54 @@ + fib6_gc_cleanup(); + kmem_cache_destroy(ip6_dst_ops.kmem_cachep); + } ++ ++#ifdef CONFIG_VE ++int init_ve_route6(struct ve_struct *ve) ++{ ++ struct ve_struct *old_env = set_exec_env(ve); ++ ve->_fib6_table = kzalloc(sizeof(struct fib6_table), GFP_KERNEL_UBC); ++ if (!ve->_fib6_table) { ++ set_exec_env(old_env); ++ return -ENOMEM; ++ } ++ ve->_fib6_table->owner_env = ve; ++ ve->_fib6_table->tb6_id = RT6_TABLE_MAIN; ++ ve->_fib6_table->tb6_root.leaf = &ip6_null_entry; ++ ve->_fib6_table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | ++ RTN_RTINFO; ++#ifdef CONFIG_IPV6_MULTIPLE_TABLES ++ ve->_fib6_local_table = kzalloc(sizeof(struct fib6_table), ++ GFP_KERNEL_UBC); ++ if (!ve->_fib6_local_table) { ++ kfree(ve->_fib6_table); ++ set_exec_env(old_env); ++ return -ENOMEM; ++ } ++ ve->_fib6_local_table->owner_env = ve; ++ ve->_fib6_local_table->tb6_id = RT6_TABLE_LOCAL; ++ ve->_fib6_local_table->tb6_root.leaf = &ip6_null_entry; ++ ve->_fib6_local_table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | ++ RTN_RTINFO; ++#endif ++ fib6_tables_init(); ++ set_exec_env(old_env); ++ return 0; ++} ++EXPORT_SYMBOL(init_ve_route6); ++ ++void fini_ve_route6(struct ve_struct *ve) ++{ ++ struct ve_struct *old_env = set_exec_env(ve); ++ ++ if (ve->_fib6_table) { ++ rt6_ifdown(NULL); ++ fib6_tables_cleanup(); ++ kfree(ve->_fib6_table); ++#ifdef CONFIG_IPV6_MULTIPLE_TABLES ++ kfree(ve->_fib6_local_table); ++#endif ++ } ++ set_exec_env(old_env); ++} ++EXPORT_SYMBOL(fini_ve_route6); ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/sit.c debian/binary-custom.d/openvz/src/net/ipv6/sit.c +--- ./net/ipv6/sit.c 2012-06-12 16:25:24.438312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/sit.c 2012-11-13 15:20:15.708569054 +0000 +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -52,6 +53,8 @@ + #include + #include + ++#include ++ + /* + This version of net/ipv6/sit.c is cloned of net/ipv4/ip_gre.c + +@@ -65,6 +68,26 @@ + static int ipip6_tunnel_init(struct net_device *dev); + static void ipip6_tunnel_setup(struct net_device *dev); + ++#ifdef CONFIG_VE ++struct ve_sit_tunnels { ++ struct net_device *_ipip6_fb_tunnel_dev; ++ struct ip_tunnel *_tunnels_r_l[HASH_SIZE]; ++ struct ip_tunnel *_tunnels_r[HASH_SIZE]; ++ struct ip_tunnel *_tunnels_l[HASH_SIZE]; ++ struct ip_tunnel *_tunnels_wc[1]; ++ struct ip_tunnel **_tunnels[4]; ++ rwlock_t _ipip6_lock; ++}; ++ ++#define ipip6_fb_tunnel_dev \ ++ (get_exec_env()->_sit_tunnels->_ipip6_fb_tunnel_dev) ++#define tunnels_r_l (get_exec_env()->_sit_tunnels->_tunnels_r_l) ++#define tunnels_r (get_exec_env()->_sit_tunnels->_tunnels_r) ++#define tunnels_l (get_exec_env()->_sit_tunnels->_tunnels_l) ++#define tunnels_wc (get_exec_env()->_sit_tunnels->_tunnels_wc) ++#define tunnels (get_exec_env()->_sit_tunnels->_tunnels) ++#define ipip6_lock (get_exec_env()->_sit_tunnels->_ipip6_lock) ++#else + static struct net_device *ipip6_fb_tunnel_dev; + + static struct ip_tunnel *tunnels_r_l[HASH_SIZE]; +@@ -74,6 +97,7 @@ + static struct ip_tunnel **tunnels[4] = { tunnels_wc, tunnels_l, tunnels_r, tunnels_r_l }; + + static DEFINE_RWLOCK(ipip6_lock); ++#endif + + static struct ip_tunnel * ipip6_tunnel_lookup(__be32 remote, __be32 local) + { +@@ -167,7 +191,7 @@ + int i; + for (i=1; i<100; i++) { + sprintf(name, "sit%d", i); +- if (__dev_get_by_name(&init_net, name) == NULL) ++ if (__dev_get_by_name(get_exec_env()->ve_netns, name) == NULL) + break; + } + if (i==100) +@@ -177,7 +201,7 @@ + dev = alloc_netdev(sizeof(*t), name, ipip6_tunnel_setup); + if (dev == NULL) + return NULL; +- ++ dev->nd_net = get_exec_env()->ve_netns; + nt = netdev_priv(dev); + dev->init = ipip6_tunnel_init; + nt->parms = *parms; +@@ -619,9 +643,12 @@ + case SIOCADDTUNNEL: + case SIOCCHGTUNNEL: + err = -EPERM; +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_NET_ADMIN) ++#ifdef CONFIG_VE ++ && !capable(CAP_VE_NET_ADMIN) ++#endif ++ ) + goto done; +- + err = -EFAULT; + if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) + goto done; +@@ -672,7 +699,11 @@ + + case SIOCDELTUNNEL: + err = -EPERM; +- if (!capable(CAP_NET_ADMIN)) ++ if (!capable(CAP_NET_ADMIN) ++#ifdef CONFIG_VE ++ && !capable(CAP_VE_NET_ADMIN) ++#endif ++ ) + goto done; + + if (dev == ipip6_fb_tunnel_dev) { +@@ -727,6 +758,9 @@ + dev->flags = IFF_NOARP; + dev->iflink = 0; + dev->addr_len = 4; ++#ifdef CONFIG_VE ++ dev->features |= NETIF_F_VIRTUAL; ++#endif + } + + static int ipip6_tunnel_init(struct net_device *dev) +@@ -760,7 +794,7 @@ + } + + if (!tdev && tunnel->parms.link) +- tdev = __dev_get_by_index(&init_net, tunnel->parms.link); ++ tdev = __dev_get_by_index(get_exec_env()->ve_netns, tunnel->parms.link); + + if (tdev) { + dev->hard_header_len = tdev->hard_header_len + sizeof(struct iphdr); +@@ -773,7 +807,7 @@ + return 0; + } + +-static int __init ipip6_fb_tunnel_init(struct net_device *dev) ++static int ipip6_fb_tunnel_init(struct net_device *dev) + { + struct ip_tunnel *tunnel = netdev_priv(dev); + struct iphdr *iph = &tunnel->parms.iph; +@@ -797,7 +831,7 @@ + .priority = 1, + }; + +-static void __exit sit_destroy_tunnels(void) ++static void sit_destroy_tunnels(void) + { + int prio; + +@@ -811,14 +845,93 @@ + } + } + ++#ifdef CONFIG_VE ++static int sit_ve_start(void *data) ++{ ++ struct ve_struct *ve = data; ++ struct ve_sit_tunnels *st; ++ int err; ++ ++ if (!ve_is_super(ve)) ++ __module_get(THIS_MODULE); ++ ++ st = kzalloc(sizeof(struct ve_sit_tunnels), GFP_KERNEL_UBC); ++ if (!st) { ++ err = -ENOMEM; ++ goto out; ++ } ++ st->_tunnels[0] = st->_tunnels_wc; ++ st->_tunnels[1] = st->_tunnels_l; ++ st->_tunnels[2] = st->_tunnels_r; ++ st->_tunnels[3] = st->_tunnels_r_l; ++ rwlock_init(&st->_ipip6_lock); ++ ++ ve->_sit_tunnels = st; ++ if (ve_is_super(ve)) ++ goto out_ok; ++ ++ st->_ipip6_fb_tunnel_dev = alloc_netdev(sizeof(struct ip_tunnel), ++ "sit0", ipip6_tunnel_setup); ++ if (!st->_ipip6_fb_tunnel_dev) { ++ err = -ENOMEM; ++ goto free_tunnel; ++ } ++ st->_ipip6_fb_tunnel_dev->nd_net = get_exec_env()->ve_netns; ++ st->_ipip6_fb_tunnel_dev->init = ipip6_fb_tunnel_init; ++ err = register_netdev(st->_ipip6_fb_tunnel_dev); ++ if (err < 0) ++ goto free_netdev; ++out_ok: ++ return 0; ++ ++free_netdev: ++ free_netdev(st->_ipip6_fb_tunnel_dev); ++free_tunnel: ++ kfree(st); ++ if (!ve_is_super(ve)) ++ module_put(THIS_MODULE); ++out: ++ return err; ++} ++ ++static void sit_ve_stop(void *data) ++{ ++ struct ve_struct *ve = data; ++ ++ if (ve->_sit_tunnels == NULL) ++ return; ++ if (!ve_is_super(ve)) { ++ rtnl_lock(); ++ sit_destroy_tunnels(); ++ unregister_netdevice(ipip6_fb_tunnel_dev); ++ rtnl_unlock(); ++ } ++ kfree(ve->_sit_tunnels); ++ ve->_sit_tunnels = NULL; ++ if (!ve_is_super(ve)) ++ module_put(THIS_MODULE); ++} ++ ++static struct ve_hook sit_ve_hook = { ++ .init = sit_ve_start, ++ .fini = sit_ve_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_NET_POST, ++}; ++#endif ++ + static void __exit sit_cleanup(void) + { ++ ve_hook_unregister(&sit_ve_hook); + xfrm4_tunnel_deregister(&sit_handler, AF_INET6); + + rtnl_lock(); + sit_destroy_tunnels(); + unregister_netdevice(ipip6_fb_tunnel_dev); + rtnl_unlock(); ++#ifdef CONFIG_VE ++ sit_ve_stop(get_exec_env()); ++#endif + } + + static int __init sit_init(void) +@@ -827,11 +940,17 @@ + + printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n"); + ++#ifdef CONFIG_VE ++ err = sit_ve_start(get_exec_env()); ++ if (err) ++ goto out; ++#endif ++ + ipip6_fb_tunnel_dev = alloc_netdev(sizeof(struct ip_tunnel), "sit0", + ipip6_tunnel_setup); + if (!ipip6_fb_tunnel_dev) { + err = -ENOMEM; +- goto out; ++ goto err0; + } + + ipip6_fb_tunnel_dev->init = ipip6_fb_tunnel_init; +@@ -851,6 +970,10 @@ + unregister_netdev(ipip6_fb_tunnel_dev); + err1: + free_netdev(ipip6_fb_tunnel_dev); ++ err0: ++#ifdef CONFIG_VE ++ sit_ve_stop(get_exec_env()); ++#endif + goto out; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/tcp_ipv6.c debian/binary-custom.d/openvz/src/net/ipv6/tcp_ipv6.c +--- ./net/ipv6/tcp_ipv6.c 2012-06-12 16:25:24.438312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/tcp_ipv6.c 2012-11-13 15:20:15.708569054 +0000 +@@ -62,6 +62,8 @@ + #include + #include + ++#include ++ + #include + + #include +@@ -80,7 +82,7 @@ + + static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb); + +-static struct inet_connection_sock_af_ops ipv6_mapped; ++struct inet_connection_sock_af_ops ipv6_mapped; + static struct inet_connection_sock_af_ops ipv6_specific; + #ifdef CONFIG_TCP_MD5SIG + static struct tcp_sock_af_ops tcp_sock_ipv6_specific; +@@ -924,7 +926,7 @@ + } + #endif + +-static struct request_sock_ops tcp6_request_sock_ops __read_mostly = { ++struct request_sock_ops tcp6_request_sock_ops __read_mostly = { + .family = AF_INET6, + .obj_size = sizeof(struct tcp6_request_sock), + .rtx_syn_ack = tcp_v6_send_synack, +@@ -932,6 +934,7 @@ + .destructor = tcp_v6_reqsk_destructor, + .send_reset = tcp_v6_send_reset + }; ++EXPORT_SYMBOL(tcp6_request_sock_ops); + + #ifdef CONFIG_TCP_MD5SIG + static struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { +@@ -1553,6 +1556,7 @@ + struct ipv6_pinfo *np = inet6_sk(sk); + struct tcp_sock *tp; + struct sk_buff *opt_skb = NULL; ++ struct user_beancounter *ub; + + /* Imagine: socket is IPv6. IPv4 packet arrives, + goes to IPv4 receive handler and backlogged. +@@ -1565,6 +1569,8 @@ + if (skb->protocol == htons(ETH_P_IP)) + return tcp_v4_do_rcv(sk, skb); + ++ ub = set_exec_ub(sock_bc(sk)->ub); ++ + #ifdef CONFIG_TCP_MD5SIG + if (tcp_v6_inbound_md5_hash (sk, skb)) + goto discard; +@@ -1601,7 +1607,7 @@ + TCP_CHECK_TIMER(sk); + if (opt_skb) + goto ipv6_pktoptions; +- return 0; ++ goto restore_context; + } + + if (skb->len < tcp_hdrlen(skb) || tcp_checksum_complete(skb)) +@@ -1622,7 +1628,7 @@ + goto reset; + if (opt_skb) + __kfree_skb(opt_skb); +- return 0; ++ goto restore_context; + } + } + +@@ -1632,6 +1638,9 @@ + TCP_CHECK_TIMER(sk); + if (opt_skb) + goto ipv6_pktoptions; ++ ++restore_context: ++ (void)set_exec_ub(ub); + return 0; + + reset: +@@ -1640,7 +1649,7 @@ + if (opt_skb) + __kfree_skb(opt_skb); + kfree_skb(skb); +- return 0; ++ goto restore_context; + csum_err: + TCP_INC_STATS_BH(TCP_MIB_INERRS); + goto discard; +@@ -1672,7 +1681,7 @@ + + if (opt_skb) + kfree_skb(opt_skb); +- return 0; ++ goto restore_context; + } + + static int tcp_v6_rcv(struct sk_buff *skb) +@@ -1852,7 +1861,7 @@ + * TCP over IPv4 via INET6 API + */ + +-static struct inet_connection_sock_af_ops ipv6_mapped = { ++struct inet_connection_sock_af_ops ipv6_mapped = { + .queue_xmit = ip_queue_xmit, + .send_check = tcp_v4_send_check, + .rebuild_header = inet_sk_rebuild_header, +@@ -1870,6 +1879,8 @@ + #endif + }; + ++EXPORT_SYMBOL_GPL(ipv6_mapped); ++ + #ifdef CONFIG_TCP_MD5SIG + static struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific = { + .md5_lookup = tcp_v4_md5_lookup, +@@ -2098,14 +2109,29 @@ + .seq_fops = &tcp6_seq_fops, + }; + ++static int tcp6_proc_net_init(struct net *net) ++{ ++ return tcp_proc_register(net, &tcp6_seq_afinfo); ++} ++ ++static void tcp6_proc_net_exit(struct net *net) ++{ ++ tcp_proc_unregister(net, &tcp6_seq_afinfo); ++} ++ ++static struct pernet_operations tcp6_proc_net_ops = { ++ .init = tcp6_proc_net_init, ++ .exit = tcp6_proc_net_exit, ++}; ++ + int __init tcp6_proc_init(void) + { +- return tcp_proc_register(&tcp6_seq_afinfo); ++ return register_pernet_subsys(&tcp6_proc_net_ops); + } + + void tcp6_proc_exit(void) + { +- tcp_proc_unregister(&tcp6_seq_afinfo); ++ unregister_pernet_subsys(&tcp6_proc_net_ops); + } + #endif + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/udp.c debian/binary-custom.d/openvz/src/net/ipv6/udp.c +--- ./net/ipv6/udp.c 2012-06-12 16:25:24.438312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/udp.c 2012-11-13 15:20:15.712569056 +0000 +@@ -65,12 +65,15 @@ + struct hlist_node *node; + unsigned short hnum = ntohs(dport); + int badness = -1; ++ struct ve_struct *ve; + ++ ve = get_exec_env(); + read_lock(&udp_hash_lock); +- sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) { ++ sk_for_each(sk, node, &udptable[udp_hashfn(hnum, VEID(ve))]) { + struct inet_sock *inet = inet_sk(sk); + +- if (sk->sk_hash == hnum && sk->sk_family == PF_INET6) { ++ if (inet->num == hnum && sk->sk_family == PF_INET6 && ++ ve_accessible_strict(sk->owner_env, ve)) { + struct ipv6_pinfo *np = inet6_sk(sk); + int score = 0; + if (inet->dport) { +@@ -349,7 +352,7 @@ + int dif; + + read_lock(&udp_hash_lock); +- sk = sk_head(&udptable[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]); ++ sk = sk_head(&udptable[udp_hashfn(ntohs(uh->dest), VEID(skb->owner_env))]); + dif = inet6_iif(skb); + sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif); + if (!sk) { +@@ -958,13 +961,28 @@ + .seq_fops = &udp6_seq_fops, + }; + ++static int udp6_proc_net_init(struct net *net) ++{ ++ return udp_proc_register(net, &udp6_seq_afinfo); ++} ++ ++static void udp6_proc_net_exit(struct net *net) ++{ ++ udp_proc_unregister(net, &udp6_seq_afinfo); ++} ++ ++static struct pernet_operations udp6_proc_net_ops = { ++ .init = udp6_proc_net_init, ++ .exit = udp6_proc_net_exit, ++}; ++ + int __init udp6_proc_init(void) + { +- return udp_proc_register(&udp6_seq_afinfo); ++ return register_pernet_subsys(&udp6_proc_net_ops); + } + + void udp6_proc_exit(void) { +- udp_proc_unregister(&udp6_seq_afinfo); ++ unregister_pernet_subsys(&udp6_proc_net_ops); + } + #endif /* CONFIG_PROC_FS */ + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/udplite.c debian/binary-custom.d/openvz/src/net/ipv6/udplite.c +--- ./net/ipv6/udplite.c 2012-06-12 16:25:24.438312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/udplite.c 2012-11-13 15:20:15.712569056 +0000 +@@ -96,13 +96,28 @@ + .seq_fops = &udplite6_seq_fops, + }; + ++static int udplite6_proc_net_init(struct net *net) ++{ ++ return udp_proc_register(net, &udplite6_seq_afinfo); ++} ++ ++static void udplite6_proc_net_exit(struct net *net) ++{ ++ udp_proc_unregister(net, &udplite6_seq_afinfo); ++} ++ ++static struct pernet_operations udplite6_proc_net_ops = { ++ .init = udplite6_proc_net_init, ++ .exit = udplite6_proc_net_exit, ++}; ++ + int __init udplite6_proc_init(void) + { +- return udp_proc_register(&udplite6_seq_afinfo); ++ return register_pernet_subsys(&udplite6_proc_net_ops); + } + + void udplite6_proc_exit(void) + { +- udp_proc_unregister(&udplite6_seq_afinfo); ++ unregister_pernet_subsys(&udplite6_proc_net_ops); + } + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/ipv6/xfrm6_policy.c debian/binary-custom.d/openvz/src/net/ipv6/xfrm6_policy.c +--- ./net/ipv6/xfrm6_policy.c 2012-06-12 16:25:24.442312481 +0100 ++++ debian/binary-custom.d/openvz/src/net/ipv6/xfrm6_policy.c 2012-11-13 15:20:15.712569056 +0000 +@@ -362,7 +362,8 @@ + + xdst = (struct xfrm_dst *)dst; + if (xdst->u.rt6.rt6i_idev->dev == dev) { +- struct inet6_dev *loopback_idev = in6_dev_get(init_net.loopback_dev); ++ struct inet6_dev *loopback_idev = ++ in6_dev_get(dev->nd_net->loopback_dev); + BUG_ON(!loopback_idev); + + do { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/core.c debian/binary-custom.d/openvz/src/net/netfilter/core.c +--- ./net/netfilter/core.c 2012-06-12 16:25:24.474312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/core.c 2012-11-13 15:20:15.756569052 +0000 +@@ -59,16 +59,34 @@ + struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS] __read_mostly; + EXPORT_SYMBOL(nf_hooks); + static DEFINE_MUTEX(nf_hook_mutex); ++#ifdef CONFIG_VE_IPTABLES ++#define VE_NF_HOOKS(env, x, y) \ ++ ((struct list_head (*)[NF_MAX_HOOKS])(env->_nf_hooks))[x][y] ++#else ++#define VE_NF_HOOKS(env, x, y) nf_hooks[x][y] ++#endif + + int nf_register_hook(struct nf_hook_ops *reg) + { + struct list_head *i; ++ struct ve_struct *env; + int err; + ++ env = get_exec_env(); ++ if (!ve_is_super(env)) { ++ struct nf_hook_ops *tmp; ++ tmp = kmemdup(reg, sizeof(struct nf_hook_ops), GFP_KERNEL); ++ if (!tmp) ++ return -ENOMEM; ++ reg = tmp; ++ } ++ + err = mutex_lock_interruptible(&nf_hook_mutex); +- if (err < 0) ++ if (err < 0) { ++ kfree(reg); + return err; +- list_for_each(i, &nf_hooks[reg->pf][reg->hooknum]) { ++ } ++ list_for_each(i, &VE_NF_HOOKS(env, reg->pf, reg->hooknum)) { + if (reg->priority < ((struct nf_hook_ops *)i)->priority) + break; + } +@@ -80,11 +98,29 @@ + + void nf_unregister_hook(struct nf_hook_ops *reg) + { ++ struct nf_hook_ops *i; ++ struct ve_struct *env; ++ ++ env = get_exec_env(); ++ if (!ve_is_super(env)) { ++ list_for_each_entry_rcu(i, ++ &VE_NF_HOOKS(env, reg->pf, reg->hooknum), list) { ++ if (reg->hook == i->hook) { ++ reg = i; ++ break; ++ } ++ } ++ if (reg != i) ++ return; ++ } ++ + mutex_lock(&nf_hook_mutex); + list_del_rcu(®->list); + mutex_unlock(&nf_hook_mutex); + + synchronize_net(); ++ if (!ve_is_super(env)) ++ kfree(reg); + } + EXPORT_SYMBOL(nf_unregister_hook); + +@@ -169,13 +205,15 @@ + struct list_head *elem; + unsigned int verdict; + int ret = 0; ++ struct ve_struct *ve; + + /* We may already have this, but read-locks nest anyway */ + rcu_read_lock(); + +- elem = &nf_hooks[pf][hook]; ++ ve = get_exec_env(); ++ elem = &VE_NF_HOOKS(ve, pf, hook); + next_hook: +- verdict = nf_iterate(&nf_hooks[pf][hook], skb, hook, indev, ++ verdict = nf_iterate(&VE_NF_HOOKS(ve, pf, hook), skb, hook, indev, + outdev, &elem, okfn, hook_thresh); + if (verdict == NF_ACCEPT || verdict == NF_STOP) { + ret = 1; +@@ -275,13 +313,54 @@ + EXPORT_SYMBOL(proc_net_netfilter); + #endif + +-void __init netfilter_init(void) ++void init_nf_hooks(struct list_head (*nh)[NF_MAX_HOOKS]) + { + int i, h; + for (i = 0; i < NPROTO; i++) { + for (h = 0; h < NF_MAX_HOOKS; h++) +- INIT_LIST_HEAD(&nf_hooks[i][h]); ++ INIT_LIST_HEAD(&nh[i][h]); + } ++} ++ ++int init_netfilter(void) ++{ ++#ifdef CONFIG_VE_IPTABLES ++ struct ve_struct *envid; ++ ++ envid = get_exec_env(); ++ envid->_nf_hooks = kmalloc(sizeof(nf_hooks), GFP_KERNEL); ++ if (envid->_nf_hooks == NULL) ++ return -ENOMEM; ++ ++ /* FIXME: charge ubc */ ++ ++ init_nf_hooks(envid->_nf_hooks); ++ return 0; ++#else ++ init_nf_hooks(nf_hooks); ++ return 0; ++#endif ++} ++EXPORT_SYMBOL(init_netfilter); ++ ++#ifdef CONFIG_VE_IPTABLES ++void fini_netfilter(void) ++{ ++ struct ve_struct *envid; ++ ++ envid = get_exec_env(); ++ if (envid->_nf_hooks != NULL) ++ kfree(envid->_nf_hooks); ++ envid->_nf_hooks = NULL; ++ ++ /* FIXME: uncharge ubc */ ++} ++EXPORT_SYMBOL(fini_netfilter); ++#endif ++ ++void __init netfilter_init(void) ++{ ++ init_netfilter(); + + #ifdef CONFIG_PROC_FS + proc_net_netfilter = proc_mkdir("netfilter", init_net.proc_net); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_core.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_core.c +--- ./net/netfilter/nf_conntrack_core.c 2012-06-12 16:25:24.478312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_core.c 2012-11-13 15:20:15.756569052 +0000 +@@ -38,6 +38,9 @@ + #include + #include + ++#include ++#include ++ + #define NF_CONNTRACK_VERSION "0.5.0" + + DEFINE_RWLOCK(nf_conntrack_lock); +@@ -177,7 +180,14 @@ + destroy_conntrack(struct nf_conntrack *nfct) + { + struct nf_conn *ct = (struct nf_conn *)nfct; ++ struct nf_conn_help *help = nfct_help(ct); ++ struct nf_conntrack_l3proto *l3proto; + struct nf_conntrack_l4proto *l4proto; ++#ifdef CONFIG_VE_IPTABLES ++ struct ve_struct *old_ve; ++ ++ old_ve = set_exec_env(ct->ct_owner_env); ++#endif + + pr_debug("destroy_conntrack(%p)\n", ct); + NF_CT_ASSERT(atomic_read(&nfct->use) == 0); +@@ -186,10 +196,17 @@ + nf_conntrack_event(IPCT_DESTROY, ct); + set_bit(IPS_DYING_BIT, &ct->status); + ++ if (help && help->helper && help->helper->destroy) ++ help->helper->destroy(ct); ++ + /* To make sure we don't get any weird locking issues here: + * destroy_conntrack() MUST NOT be called with a write lock + * to nf_conntrack_lock!!! -HW */ + rcu_read_lock(); ++ l3proto = __nf_ct_l3proto_find(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.l3num); ++ if (l3proto && l3proto->destroy) ++ l3proto->destroy(ct); ++ + l4proto = __nf_ct_l4proto_find(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.l3num, + ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.protonum); + if (l4proto && l4proto->destroy) +@@ -220,6 +237,9 @@ + + pr_debug("destroy_conntrack: returning ct=%p to slab\n", ct); + nf_conntrack_free(ct); ++#ifdef CONFIG_VE_IPTABLES ++ (void)set_exec_env(old); ++#endif + } + + static void death_by_timeout(unsigned long ul_conntrack) +@@ -253,7 +273,7 @@ + struct hlist_node *n; + unsigned int hash = hash_conntrack(tuple); + +- hlist_for_each_entry(h, n, &nf_conntrack_hash[hash], hnode) { ++ hlist_for_each_entry(h, n, &ve_nf_conntrack_hash[hash], hnode) { + if (nf_ct_tuplehash_to_ctrack(h) != ignored_conntrack && + nf_ct_tuple_equal(tuple, &h->tuple)) { + NF_CT_STAT_INC(found); +@@ -287,9 +307,9 @@ + unsigned int repl_hash) + { + hlist_add_head(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode, +- &nf_conntrack_hash[hash]); ++ &ve_nf_conntrack_hash[hash]); + hlist_add_head(&ct->tuplehash[IP_CT_DIR_REPLY].hnode, +- &nf_conntrack_hash[repl_hash]); ++ &ve_nf_conntrack_hash[repl_hash]); + } + + void nf_conntrack_hash_insert(struct nf_conn *ct) +@@ -343,11 +363,11 @@ + /* See if there's one in the list already, including reverse: + NAT could have grabbed it without realizing, since we're + not in the hash. If there is, we lost race. */ +- hlist_for_each_entry(h, n, &nf_conntrack_hash[hash], hnode) ++ hlist_for_each_entry(h, n, &ve_nf_conntrack_hash[hash], hnode) + if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple, + &h->tuple)) + goto out; +- hlist_for_each_entry(h, n, &nf_conntrack_hash[repl_hash], hnode) ++ hlist_for_each_entry(h, n, &ve_nf_conntrack_hash[repl_hash], hnode) + if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_REPLY].tuple, + &h->tuple)) + goto out; +@@ -415,7 +435,7 @@ + + read_lock_bh(&nf_conntrack_lock); + for (i = 0; i < nf_conntrack_htable_size; i++) { +- hlist_for_each_entry(h, n, &nf_conntrack_hash[hash], hnode) { ++ hlist_for_each_entry(h, n, &ve_nf_conntrack_hash[hash], hnode) { + tmp = nf_ct_tuplehash_to_ctrack(h); + if (!test_bit(IPS_ASSURED_BIT, &tmp->status)) + ct = tmp; +@@ -442,9 +462,11 @@ + } + + struct nf_conn *nf_conntrack_alloc(const struct nf_conntrack_tuple *orig, +- const struct nf_conntrack_tuple *repl) ++ const struct nf_conntrack_tuple *repl, ++ struct user_beancounter *ub) + { + struct nf_conn *conntrack = NULL; ++ struct user_beancounter *old_ub; + + if (unlikely(!nf_conntrack_hash_rnd_initted)) { + get_random_bytes(&nf_conntrack_hash_rnd, 4); +@@ -452,25 +474,27 @@ + } + + /* We don't want any race condition at early drop stage */ +- atomic_inc(&nf_conntrack_count); ++ atomic_inc(&ve_nf_conntrack_count); + +- if (nf_conntrack_max +- && atomic_read(&nf_conntrack_count) > nf_conntrack_max) { ++ if (ve_nf_conntrack_max ++ && atomic_read(&ve_nf_conntrack_count) > ve_nf_conntrack_max) { + unsigned int hash = hash_conntrack(orig); + if (!early_drop(hash)) { +- atomic_dec(&nf_conntrack_count); ++ atomic_dec(&ve_nf_conntrack_count); + if (net_ratelimit()) +- printk(KERN_WARNING +- "nf_conntrack: table full, dropping" +- " packet.\n"); ++ ve_printk(VE_LOG_BOTH, KERN_WARNING ++ "nf_conntrack: CT %d: table full, dropping" ++ " packet.\n", VEID(get_exec_env())); + return ERR_PTR(-ENOMEM); + } + } + ++ old_ub = set_exec_ub(ub); + conntrack = kmem_cache_zalloc(nf_conntrack_cachep, GFP_ATOMIC); ++ (void)set_exec_ub(old_ub); + if (conntrack == NULL) { + pr_debug("nf_conntrack_alloc: Can't alloc conntrack.\n"); +- atomic_dec(&nf_conntrack_count); ++ atomic_dec(&ve_nf_conntrack_count); + return ERR_PTR(-ENOMEM); + } + +@@ -480,6 +504,9 @@ + /* Don't set timer yet: wait for confirmation */ + setup_timer(&conntrack->timeout, death_by_timeout, + (unsigned long)conntrack); ++#ifdef CONFIG_VE_IPTABLES ++ conntrack->ct_owner_env = get_exec_env(); ++#endif + + return conntrack; + } +@@ -489,7 +516,7 @@ + { + nf_ct_ext_free(conntrack); + kmem_cache_free(nf_conntrack_cachep, conntrack); +- atomic_dec(&nf_conntrack_count); ++ atomic_dec(&ve_nf_conntrack_count); + } + EXPORT_SYMBOL_GPL(nf_conntrack_free); + +@@ -506,13 +533,20 @@ + struct nf_conn_help *help; + struct nf_conntrack_tuple repl_tuple; + struct nf_conntrack_expect *exp; ++ struct user_beancounter *ub = NULL; + + if (!nf_ct_invert_tuple(&repl_tuple, tuple, l3proto, l4proto)) { + pr_debug("Can't invert tuple.\n"); + return NULL; + } + +- conntrack = nf_conntrack_alloc(tuple, &repl_tuple); ++#ifdef CONFIG_BEANCOUNTERS ++ if (skb->dev != NULL) /* received skb */ ++ ub = netdev_bc(skb->dev)->exec_ub; ++ else if (skb->sk != NULL) /* sent skb */ ++ ub = sock_bc(skb->sk)->ub; ++#endif ++ conntrack = nf_conntrack_alloc(tuple, &repl_tuple, ub); + if (conntrack == NULL || IS_ERR(conntrack)) { + pr_debug("Can't allocate conntrack.\n"); + return (struct nf_conntrack_tuple_hash *)conntrack; +@@ -560,7 +594,7 @@ + + /* Overload tuple linked list to put us in unconfirmed list. */ + hlist_add_head(&conntrack->tuplehash[IP_CT_DIR_ORIGINAL].hnode, +- &unconfirmed); ++ &ve_unconfirmed); + + write_unlock_bh(&nf_conntrack_lock); + +@@ -901,13 +935,13 @@ + + write_lock_bh(&nf_conntrack_lock); + for (; *bucket < nf_conntrack_htable_size; (*bucket)++) { +- hlist_for_each_entry(h, n, &nf_conntrack_hash[*bucket], hnode) { ++ hlist_for_each_entry(h, n, &ve_nf_conntrack_hash[*bucket], hnode) { + ct = nf_ct_tuplehash_to_ctrack(h); + if (iter(ct, data)) + goto found; + } + } +- hlist_for_each_entry(h, n, &unconfirmed, hnode) { ++ hlist_for_each_entry(h, n, &ve_unconfirmed, hnode) { + ct = nf_ct_tuplehash_to_ctrack(h); + if (iter(ct, data)) + set_bit(IPS_DYING_BIT, &ct->status); +@@ -962,7 +996,10 @@ + supposed to kill the mall. */ + void nf_conntrack_cleanup(void) + { +- rcu_assign_pointer(ip_ct_attach, NULL); ++ struct ve_struct *ve = get_exec_env(); ++ ++ if (ve_is_super(ve)) ++ rcu_assign_pointer(ip_ct_attach, NULL); + + /* This makes sure all current packets have passed through + netfilter framework. Roll on, two-stage module +@@ -972,23 +1009,31 @@ + nf_ct_event_cache_flush(); + i_see_dead_people: + nf_conntrack_flush(); +- if (atomic_read(&nf_conntrack_count) != 0) { ++ if (atomic_read(&ve_nf_conntrack_count) != 0) { + schedule(); + goto i_see_dead_people; + } ++ if (!ve_is_super(ve)) ++ goto skip_ct_cache; + /* wait until all references to nf_conntrack_untracked are dropped */ + while (atomic_read(&nf_conntrack_untracked.ct_general.use) > 1) + schedule(); + + rcu_assign_pointer(nf_ct_destroy, NULL); + +- kmem_cache_destroy(nf_conntrack_cachep); +- nf_ct_free_hashtable(nf_conntrack_hash, nf_conntrack_vmalloc, +- nf_conntrack_htable_size); +- +- nf_conntrack_proto_fini(); ++ if (ve_is_super(ve)) ++ kmem_cache_destroy(nf_conntrack_cachep); ++skip_ct_cache: + nf_conntrack_helper_fini(); + nf_conntrack_expect_fini(); ++ ++ nf_ct_proto_generic_sysctl_cleanup(); ++ nf_ct_free_hashtable(ve_nf_conntrack_hash, ve_nf_conntrack_vmalloc, ++ nf_conntrack_htable_size); ++ nf_conntrack_proto_fini(); ++#ifdef CONFIG_VE_IPTABLES ++ kfree(ve->_nf_conntrack); ++#endif + } + + struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced) +@@ -999,13 +1044,13 @@ + *vmalloced = 0; + + size = *sizep = roundup(*sizep, PAGE_SIZE / sizeof(struct hlist_head)); +- hash = (void*)__get_free_pages(GFP_KERNEL|__GFP_NOWARN, ++ hash = (void*)__get_free_pages(GFP_KERNEL_UBC|__GFP_NOWARN, + get_order(sizeof(struct hlist_head) + * size)); + if (!hash) { + *vmalloced = 1; + printk(KERN_WARNING "nf_conntrack: falling back to vmalloc.\n"); +- hash = vmalloc(sizeof(struct hlist_head) * size); ++ hash = ub_vmalloc(sizeof(struct hlist_head) * size); + } + + if (hash) +@@ -1042,8 +1087,8 @@ + + write_lock_bh(&nf_conntrack_lock); + for (i = 0; i < nf_conntrack_htable_size; i++) { +- while (!hlist_empty(&nf_conntrack_hash[i])) { +- h = hlist_entry(nf_conntrack_hash[i].first, ++ while (!hlist_empty(&ve_nf_conntrack_hash[i])) { ++ h = hlist_entry(ve_nf_conntrack_hash[i].first, + struct nf_conntrack_tuple_hash, hnode); + hlist_del(&h->hnode); + bucket = __hash_conntrack(&h->tuple, hashsize, rnd); +@@ -1051,12 +1096,12 @@ + } + } + old_size = nf_conntrack_htable_size; +- old_vmalloced = nf_conntrack_vmalloc; +- old_hash = nf_conntrack_hash; ++ old_vmalloced = ve_nf_conntrack_vmalloc; ++ old_hash = ve_nf_conntrack_hash; + + nf_conntrack_htable_size = hashsize; +- nf_conntrack_vmalloc = vmalloced; +- nf_conntrack_hash = hash; ++ ve_nf_conntrack_vmalloc = vmalloced; ++ ve_nf_conntrack_hash = hash; + nf_conntrack_hash_rnd = rnd; + write_unlock_bh(&nf_conntrack_lock); + +@@ -1068,52 +1113,74 @@ + module_param_call(hashsize, nf_conntrack_set_hashsize, param_get_uint, + &nf_conntrack_htable_size, 0600); + +-int __init nf_conntrack_init(void) ++int nf_conntrack_init(void) + { ++ struct ve_struct *ve = get_exec_env(); + int max_factor = 8; +- int ret; ++ int ret = 0, i; + +- /* Idea from tcp.c: use 1/16384 of memory. On i386: 32MB +- * machine has 512 buckets. >= 1GB machines have 16384 buckets. */ +- if (!nf_conntrack_htable_size) { +- nf_conntrack_htable_size +- = (((num_physpages << PAGE_SHIFT) / 16384) +- / sizeof(struct hlist_head)); +- if (num_physpages > (1024 * 1024 * 1024 / PAGE_SIZE)) +- nf_conntrack_htable_size = 16384; +- if (nf_conntrack_htable_size < 32) +- nf_conntrack_htable_size = 32; +- +- /* Use a max. factor of four by default to get the same max as +- * with the old struct list_heads. When a table size is given +- * we use the old value of 8 to avoid reducing the max. +- * entries. */ +- max_factor = 4; +- } +- nf_conntrack_hash = nf_ct_alloc_hashtable(&nf_conntrack_htable_size, +- &nf_conntrack_vmalloc); +- if (!nf_conntrack_hash) { +- printk(KERN_ERR "Unable to create nf_conntrack_hash\n"); +- goto err_out; ++ if (ve_is_super(ve)) { ++ ++ /* Idea from tcp.c: use 1/16384 of memory. On i386: 32MB ++ * machine has 512 buckets. >= 1GB machines have 16384 buckets. */ ++ if (!nf_conntrack_htable_size) { ++ nf_conntrack_htable_size ++ = (((num_physpages << PAGE_SHIFT) / 16384) ++ / sizeof(struct hlist_head)); ++ if (num_physpages > (1024 * 1024 * 1024 / PAGE_SIZE)) ++ nf_conntrack_htable_size = 16384; ++ if (nf_conntrack_htable_size < 32) ++ nf_conntrack_htable_size = 32; ++ ++ /* Use a max. factor of four by default to get the same ++ * max as with the old struct list_heads. When a table ++ * size is given we use the old value of 8 to avoid ++ * reducing the max. entries. */ ++ max_factor = 4; ++ } ++ nf_conntrack_max = max_factor * nf_conntrack_htable_size; ++ ++ printk("nf_conntrack version %s (%u buckets, %d max)\n", ++ NF_CONNTRACK_VERSION, nf_conntrack_htable_size, ++ nf_conntrack_max); + } + +- nf_conntrack_max = max_factor * nf_conntrack_htable_size; ++#ifdef CONFIG_VE_IPTABLES ++ ve->_nf_conntrack = kzalloc(sizeof(struct ve_nf_conntrack), GFP_KERNEL); ++ if (!ve->_nf_conntrack) { ++ ret = -ENOMEM; ++ goto out; ++ } + +- printk("nf_conntrack version %s (%u buckets, %d max)\n", +- NF_CONNTRACK_VERSION, nf_conntrack_htable_size, +- nf_conntrack_max); ++ ve_nf_conntrack_max = nf_conntrack_max; ++ atomic_set(&ve_nf_conntrack_count, 0); ++ INIT_HLIST_HEAD(&ve_unconfirmed); ++#endif ++ ve_nf_conntrack_hash = nf_ct_alloc_hashtable(&nf_conntrack_htable_size, ++ &ve_nf_conntrack_vmalloc); ++ if (!ve_nf_conntrack_hash) { ++ printk(KERN_ERR "Unable to create nf_conntrack_hash\n"); ++ goto err_out; ++ } + +- nf_conntrack_cachep = kmem_cache_create("nf_conntrack", ++ if (ve_is_super(ve)) { ++ nf_conntrack_cachep = kmem_cache_create("nf_conntrack", + sizeof(struct nf_conn), +- 0, 0, NULL); +- if (!nf_conntrack_cachep) { +- printk(KERN_ERR "Unable to create nf_conn slab cache\n"); +- goto err_free_hash; ++ 0, SLAB_UBC, NULL); ++ if (!nf_conntrack_cachep) { ++ printk(KERN_ERR "Unable to create nf_conn slab cache\n"); ++ goto err_free_hash; ++ } + } + +- ret = nf_conntrack_proto_init(); ++ ret = nf_ct_proto_generic_sysctl_init(); + if (ret < 0) + goto err_free_conntrack_slab; ++ /* Don't NEED lock here, but good form anyway. */ ++ write_lock_bh(&nf_conntrack_lock); ++ for (i = 0; i < AF_MAX; i++) ++ ve_nf_ct_l3protos[i] = &nf_conntrack_l3proto_generic; ++ write_unlock_bh(&nf_conntrack_lock); + + ret = nf_conntrack_expect_init(); + if (ret < 0) +@@ -1123,27 +1190,37 @@ + if (ret < 0) + goto out_fini_expect; + +- /* For use by REJECT target */ +- rcu_assign_pointer(ip_ct_attach, __nf_conntrack_attach); +- rcu_assign_pointer(nf_ct_destroy, destroy_conntrack); +- +- /* Set up fake conntrack: +- - to never be deleted, not in any hashes */ +- atomic_set(&nf_conntrack_untracked.ct_general.use, 1); +- /* - and look it like as a confirmed connection */ +- set_bit(IPS_CONFIRMED_BIT, &nf_conntrack_untracked.status); ++ if (ve_is_super(ve)) { ++ /* For use by REJECT target */ ++ rcu_assign_pointer(ip_ct_attach, __nf_conntrack_attach); ++ rcu_assign_pointer(nf_ct_destroy, destroy_conntrack); ++ ++ /* Set up fake conntrack: ++ - to never be deleted, not in any hashes */ ++ atomic_set(&nf_conntrack_untracked.ct_general.use, 1); ++ /* - and look it like as a confirmed connection */ ++ set_bit(IPS_CONFIRMED_BIT, &nf_conntrack_untracked.status); ++ } + +- return ret; ++ return 0; + ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++ nf_ct_proto_generic_sysctl_cleanup(); ++#endif + out_fini_expect: + nf_conntrack_expect_fini(); + out_fini_proto: + nf_conntrack_proto_fini(); + err_free_conntrack_slab: +- kmem_cache_destroy(nf_conntrack_cachep); ++ if (ve_is_super(ve)) ++ kmem_cache_destroy(nf_conntrack_cachep); + err_free_hash: +- nf_ct_free_hashtable(nf_conntrack_hash, nf_conntrack_vmalloc, ++ nf_ct_free_hashtable(ve_nf_conntrack_hash, nf_conntrack_vmalloc, + nf_conntrack_htable_size); + err_out: +- return -ENOMEM; ++#ifdef CONFIG_VE_IPTABLES ++ kfree(ve->_nf_conntrack); ++out: ++#endif ++ return ret; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_ecache.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_ecache.c +--- ./net/netfilter/nf_conntrack_ecache.c 2012-06-12 16:25:24.478312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_ecache.c 2012-11-13 15:20:15.756569052 +0000 +@@ -53,6 +53,9 @@ + { + struct nf_conntrack_ecache *ecache; + ++ if (!ve_is_super(get_exec_env())) ++ return; ++ + local_bh_disable(); + ecache = &__get_cpu_var(nf_conntrack_ecache); + if (ecache->ct == ct) +@@ -66,6 +69,9 @@ + { + struct nf_conntrack_ecache *ecache; + ++ if (!ve_is_super(get_exec_env())) ++ return; ++ + /* take care of delivering potentially old events */ + ecache = &__get_cpu_var(nf_conntrack_ecache); + BUG_ON(ecache->ct == ct); +@@ -84,6 +90,9 @@ + struct nf_conntrack_ecache *ecache; + int cpu; + ++ if (!ve_is_super(get_exec_env())) ++ return; ++ + for_each_possible_cpu(cpu) { + ecache = &per_cpu(nf_conntrack_ecache, cpu); + if (ecache->ct) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_expect.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_expect.c +--- ./net/netfilter/nf_conntrack_expect.c 2012-06-12 16:25:24.478312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_expect.c 2012-11-13 15:20:15.756569052 +0000 +@@ -39,6 +39,13 @@ + unsigned int nf_ct_expect_max __read_mostly; + static int nf_ct_expect_hash_rnd_initted __read_mostly; + static int nf_ct_expect_vmalloc; ++#ifdef CONFIG_VE_IPTABLES ++#define ve_nf_ct_expect_count (get_exec_env()->_nf_conntrack->_nf_ct_expect_count) ++#define ve_nf_ct_expect_vmalloc (get_exec_env()->_nf_conntrack->_nf_ct_expect_vmalloc) ++#else ++#define ve_nf_ct_expect_count nf_ct_expect_count ++#define ve_nf_ct_expect_vmalloc nf_ct_expect_vmalloc ++#endif + + static struct kmem_cache *nf_ct_expect_cachep __read_mostly; + +@@ -51,7 +58,7 @@ + NF_CT_ASSERT(!timer_pending(&exp->timeout)); + + hlist_del(&exp->hnode); +- nf_ct_expect_count--; ++ ve_nf_ct_expect_count--; + + hlist_del(&exp->lnode); + master_help->expecting--; +@@ -91,11 +98,11 @@ + struct hlist_node *n; + unsigned int h; + +- if (!nf_ct_expect_count) ++ if (!ve_nf_ct_expect_count) + return NULL; + + h = nf_ct_expect_dst_hash(tuple); +- hlist_for_each_entry(i, n, &nf_ct_expect_hash[h], hnode) { ++ hlist_for_each_entry(i, n, &ve_nf_ct_expect_hash[h], hnode) { + if (nf_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask)) + return i; + } +@@ -293,8 +300,8 @@ + hlist_add_head(&exp->lnode, &master_help->expectations); + master_help->expecting++; + +- hlist_add_head(&exp->hnode, &nf_ct_expect_hash[h]); +- nf_ct_expect_count++; ++ hlist_add_head(&exp->hnode, &ve_nf_ct_expect_hash[h]); ++ ve_nf_ct_expect_count++; + + setup_timer(&exp->timeout, nf_ct_expectation_timed_out, + (unsigned long)exp); +@@ -350,7 +357,7 @@ + goto out; + } + h = nf_ct_expect_dst_hash(&expect->tuple); +- hlist_for_each_entry(i, n, &nf_ct_expect_hash[h], hnode) { ++ hlist_for_each_entry(i, n, &ve_nf_ct_expect_hash[h], hnode) { + if (expect_matches(i, expect)) { + /* Refresh timer: if it's dying, ignore.. */ + if (refresh_timer(i)) { +@@ -367,10 +374,10 @@ + master_help->expecting >= master_help->helper->max_expected) + evict_oldest_expect(master); + +- if (nf_ct_expect_count >= nf_ct_expect_max) { ++ if (ve_nf_ct_expect_count >= ve_nf_ct_expect_max) { + if (net_ratelimit()) + printk(KERN_WARNING +- "nf_conntrack: expectation table full"); ++ "nf_conntrack: expectation table full\n"); + ret = -EMFILE; + goto out; + } +@@ -394,8 +401,8 @@ + struct ct_expect_iter_state *st = seq->private; + + for (st->bucket = 0; st->bucket < nf_ct_expect_hsize; st->bucket++) { +- if (!hlist_empty(&nf_ct_expect_hash[st->bucket])) +- return nf_ct_expect_hash[st->bucket].first; ++ if (!hlist_empty(&ve_nf_ct_expect_hash[st->bucket])) ++ return ve_nf_ct_expect_hash[st->bucket].first; + } + return NULL; + } +@@ -409,7 +416,7 @@ + while (head == NULL) { + if (++st->bucket >= nf_ct_expect_hsize) + return NULL; +- head = nf_ct_expect_hash[st->bucket].first; ++ head = ve_nf_ct_expect_hash[st->bucket].first; + } + return head; + } +@@ -485,7 +492,7 @@ + }; + #endif /* CONFIG_PROC_FS */ + +-static int __init exp_proc_init(void) ++static int exp_proc_init(void) + { + #ifdef CONFIG_PROC_FS + struct proc_dir_entry *proc; +@@ -506,7 +513,7 @@ + + module_param_named(expect_hashsize, nf_ct_expect_hsize, uint, 0600); + +-int __init nf_conntrack_expect_init(void) ++int nf_conntrack_expect_init(void) + { + int err = -ENOMEM; + +@@ -517,16 +524,20 @@ + } + nf_ct_expect_max = nf_ct_expect_hsize * 4; + +- nf_ct_expect_hash = nf_ct_alloc_hashtable(&nf_ct_expect_hsize, +- &nf_ct_expect_vmalloc); +- if (nf_ct_expect_hash == NULL) ++ ve_nf_ct_expect_count = 0; ++ ve_nf_ct_expect_max = nf_ct_expect_max; ++ ve_nf_ct_expect_hash = nf_ct_alloc_hashtable(&nf_ct_expect_hsize, ++ &ve_nf_ct_expect_vmalloc); ++ if (ve_nf_ct_expect_hash == NULL) + goto err1; + +- nf_ct_expect_cachep = kmem_cache_create("nf_conntrack_expect", ++ if (ve_is_super(get_exec_env())) { ++ nf_ct_expect_cachep = kmem_cache_create("nf_conntrack_expect", + sizeof(struct nf_conntrack_expect), +- 0, 0, NULL); +- if (!nf_ct_expect_cachep) +- goto err2; ++ 0, SLAB_UBC, NULL); ++ if (!nf_ct_expect_cachep) ++ goto err2; ++ } + + err = exp_proc_init(); + if (err < 0) +@@ -535,10 +546,11 @@ + return 0; + + err3: +- nf_ct_free_hashtable(nf_ct_expect_hash, nf_ct_expect_vmalloc, ++ nf_ct_free_hashtable(ve_nf_ct_expect_hash, ve_nf_ct_expect_vmalloc, + nf_ct_expect_hsize); + err2: +- kmem_cache_destroy(nf_ct_expect_cachep); ++ if (ve_is_super(get_exec_env())) ++ kmem_cache_destroy(nf_ct_expect_cachep); + err1: + return err; + } +@@ -546,7 +558,8 @@ + void nf_conntrack_expect_fini(void) + { + exp_proc_remove(); +- kmem_cache_destroy(nf_ct_expect_cachep); +- nf_ct_free_hashtable(nf_ct_expect_hash, nf_ct_expect_vmalloc, ++ if (ve_is_super(get_exec_env())) ++ kmem_cache_destroy(nf_ct_expect_cachep); ++ nf_ct_free_hashtable(ve_nf_ct_expect_hash, ve_nf_ct_expect_vmalloc, + nf_ct_expect_hsize); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_helper.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_helper.c +--- ./net/netfilter/nf_conntrack_helper.c 2012-06-12 16:25:24.478312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_helper.c 2012-11-13 15:20:15.764569052 +0000 +@@ -32,6 +32,13 @@ + static unsigned int nf_ct_helper_hsize __read_mostly; + static unsigned int nf_ct_helper_count __read_mostly; + static int nf_ct_helper_vmalloc; ++#ifdef CONFIG_VE_IPTABLES ++#define ve_nf_ct_helper_hash (get_exec_env()->_nf_conntrack->_nf_ct_helper_hash) ++#define ve_nf_ct_helper_vmalloc (get_exec_env()->_nf_conntrack->_nf_ct_helper_vmalloc) ++#else ++#define ve_nf_ct_helper_hash nf_ct_helper_hash ++#define ve_nf_ct_helper_vmalloc nf_ct_helper_vmalloc ++#endif + + + /* Stupid hash, but collision free for the default registrations of the +@@ -54,7 +61,7 @@ + return NULL; + + h = helper_hash(tuple); +- hlist_for_each_entry(helper, n, &nf_ct_helper_hash[h], hnode) { ++ hlist_for_each_entry(helper, n, &ve_nf_ct_helper_hash[h], hnode) { + if (nf_ct_tuple_src_mask_cmp(tuple, &helper->tuple, &mask)) + return helper; + } +@@ -99,7 +106,7 @@ + unsigned int i; + + for (i = 0; i < nf_ct_helper_hsize; i++) { +- hlist_for_each_entry(h, n, &nf_ct_helper_hash[i], hnode) { ++ hlist_for_each_entry(h, n, &ve_nf_ct_helper_hash[i], hnode) { + if (!strcmp(h->name, name)) + return h; + } +@@ -141,7 +148,7 @@ + BUG_ON(me->timeout == 0); + + write_lock_bh(&nf_conntrack_lock); +- hlist_add_head(&me->hnode, &nf_ct_helper_hash[h]); ++ hlist_add_head(&me->hnode, &ve_nf_ct_helper_hash[h]); + nf_ct_helper_count++; + write_unlock_bh(&nf_conntrack_lock); + +@@ -164,7 +171,7 @@ + /* Get rid of expectations */ + for (i = 0; i < nf_ct_expect_hsize; i++) { + hlist_for_each_entry_safe(exp, n, next, +- &nf_ct_expect_hash[i], hnode) { ++ &ve_nf_ct_expect_hash[i], hnode) { + struct nf_conn_help *help = nfct_help(exp->master); + if ((help->helper == me || exp->helper == me) && + del_timer(&exp->timeout)) { +@@ -175,10 +182,10 @@ + } + + /* Get rid of expecteds, set helpers to NULL. */ +- hlist_for_each_entry(h, n, &unconfirmed, hnode) ++ hlist_for_each_entry(h, n, &ve_unconfirmed, hnode) + unhelp(h, me); + for (i = 0; i < nf_conntrack_htable_size; i++) { +- hlist_for_each_entry(h, n, &nf_conntrack_hash[i], hnode) ++ hlist_for_each_entry(h, n, &ve_nf_conntrack_hash[i], hnode) + unhelp(h, me); + } + write_unlock_bh(&nf_conntrack_lock); +@@ -199,26 +206,29 @@ + int err; + + nf_ct_helper_hsize = 1; /* gets rounded up to use one page */ +- nf_ct_helper_hash = nf_ct_alloc_hashtable(&nf_ct_helper_hsize, +- &nf_ct_helper_vmalloc); +- if (!nf_ct_helper_hash) ++ ve_nf_ct_helper_hash = nf_ct_alloc_hashtable(&nf_ct_helper_hsize, ++ &ve_nf_ct_helper_vmalloc); ++ if (!ve_nf_ct_helper_hash) + return -ENOMEM; + +- err = nf_ct_extend_register(&helper_extend); +- if (err < 0) +- goto err1; ++ if (ve_is_super(get_exec_env())) { ++ err = nf_ct_extend_register(&helper_extend); ++ if (err < 0) ++ goto err1; ++ } + + return 0; + + err1: +- nf_ct_free_hashtable(nf_ct_helper_hash, nf_ct_helper_vmalloc, ++ nf_ct_free_hashtable(ve_nf_ct_helper_hash, ve_nf_ct_helper_vmalloc, + nf_ct_helper_hsize); + return err; + } + + void nf_conntrack_helper_fini(void) + { +- nf_ct_extend_unregister(&helper_extend); +- nf_ct_free_hashtable(nf_ct_helper_hash, nf_ct_helper_vmalloc, ++ if (ve_is_super(get_exec_env())) ++ nf_ct_extend_unregister(&helper_extend); ++ nf_ct_free_hashtable(ve_nf_ct_helper_hash, ve_nf_ct_helper_vmalloc, + nf_ct_helper_hsize); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_netlink.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_netlink.c +--- ./net/netfilter/nf_conntrack_netlink.c 2012-06-12 16:25:24.478312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_netlink.c 2012-11-13 15:20:15.764569052 +0000 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -43,6 +44,8 @@ + + #include + #include ++#include ++#include + + MODULE_LICENSE("GPL"); + +@@ -459,7 +462,7 @@ + last = (struct nf_conn *)cb->args[1]; + for (; cb->args[0] < nf_conntrack_htable_size; cb->args[0]++) { + restart: +- hlist_for_each_entry(h, n, &nf_conntrack_hash[cb->args[0]], ++ hlist_for_each_entry(h, n, &ve_nf_conntrack_hash[cb->args[0]], + hnode) { + if (NF_CT_DIRECTION(h) != IP_CT_DIR_ORIGINAL) + continue; +@@ -702,6 +705,9 @@ + u_int8_t u3 = nfmsg->nfgen_family; + int err = 0; + ++ if (!ve_nf_conntrack_initialized()) ++ return -ENOPROTOOPT; ++ + if (cda[CTA_TUPLE_ORIG]) + err = ctnetlink_parse_tuple(cda, &tuple, CTA_TUPLE_ORIG, u3); + else if (cda[CTA_TUPLE_REPLY]) +@@ -748,6 +754,9 @@ + u_int8_t u3 = nfmsg->nfgen_family; + int err = 0; + ++ if (!ve_nf_conntrack_initialized()) ++ return -ENOPROTOOPT; ++ + if (nlh->nlmsg_flags & NLM_F_DUMP) { + #ifndef CONFIG_NF_CT_ACCT + if (NFNL_MSG_TYPE(nlh->nlmsg_type) == IPCTNL_MSG_CT_GET_CTRZERO) +@@ -976,14 +985,15 @@ + ctnetlink_create_conntrack(struct nlattr *cda[], + struct nf_conntrack_tuple *otuple, + struct nf_conntrack_tuple *rtuple, +- struct nf_conn *master_ct) ++ struct nf_conn *master_ct, ++ struct user_beancounter *ub) + { + struct nf_conn *ct; + int err = -EINVAL; + struct nf_conn_help *help; + struct nf_conntrack_helper *helper; + +- ct = nf_conntrack_alloc(otuple, rtuple); ++ ct = nf_conntrack_alloc(otuple, rtuple, ub); + if (ct == NULL || IS_ERR(ct)) + return -ENOMEM; + +@@ -1052,6 +1062,9 @@ + u_int8_t u3 = nfmsg->nfgen_family; + int err = 0; + ++ if (!ve_nf_conntrack_initialized()) ++ return -ENOPROTOOPT; ++ + if (cda[CTA_TUPLE_ORIG]) { + err = ctnetlink_parse_tuple(cda, &otuple, CTA_TUPLE_ORIG, u3); + if (err < 0) +@@ -1094,11 +1107,19 @@ + + write_unlock_bh(&nf_conntrack_lock); + err = -ENOENT; +- if (nlh->nlmsg_flags & NLM_F_CREATE) ++ if (nlh->nlmsg_flags & NLM_F_CREATE) { ++ struct user_beancounter *ub = NULL; ++ ++#ifdef CONFIG_BEANCOUNTERS ++ if (skb->sk) ++ ub = sock_bc(skb->sk)->ub; ++#endif + err = ctnetlink_create_conntrack(cda, + &otuple, + &rtuple, +- master_ct); ++ master_ct, ++ ub); ++ } + if (err < 0 && master_ct) + nf_ct_put(master_ct); + +@@ -1318,7 +1339,7 @@ + last = (struct nf_conntrack_expect *)cb->args[1]; + for (; cb->args[0] < nf_ct_expect_hsize; cb->args[0]++) { + restart: +- hlist_for_each_entry(exp, n, &nf_ct_expect_hash[cb->args[0]], ++ hlist_for_each_entry(exp, n, &ve_nf_ct_expect_hash[cb->args[0]], + hnode) { + if (l3proto && exp->tuple.src.l3num != l3proto) + continue; +@@ -1365,6 +1386,9 @@ + u_int8_t u3 = nfmsg->nfgen_family; + int err = 0; + ++ if (!ve_nf_conntrack_initialized()) ++ return -ENOPROTOOPT; ++ + if (nlh->nlmsg_flags & NLM_F_DUMP) { + return netlink_dump_start(ctnl, skb, nlh, + ctnetlink_exp_dump_table, +@@ -1426,6 +1450,9 @@ + unsigned int i; + int err; + ++ if (!ve_nf_conntrack_initialized()) ++ return -ENOPROTOOPT; ++ + if (cda[CTA_EXPECT_TUPLE]) { + /* delete a single expect by tuple */ + err = ctnetlink_parse_tuple(cda, &tuple, CTA_EXPECT_TUPLE, u3); +@@ -1463,7 +1490,7 @@ + } + for (i = 0; i < nf_ct_expect_hsize; i++) { + hlist_for_each_entry_safe(exp, n, next, +- &nf_ct_expect_hash[i], ++ &ve_nf_ct_expect_hash[i], + hnode) { + m_help = nfct_help(exp->master); + if (m_help->helper == h +@@ -1479,7 +1506,7 @@ + write_lock_bh(&nf_conntrack_lock); + for (i = 0; i < nf_ct_expect_hsize; i++) { + hlist_for_each_entry_safe(exp, n, next, +- &nf_ct_expect_hash[i], ++ &ve_nf_ct_expect_hash[i], + hnode) { + if (del_timer(&exp->timeout)) { + nf_ct_unlink_expect(exp); +@@ -1564,6 +1591,9 @@ + u_int8_t u3 = nfmsg->nfgen_family; + int err = 0; + ++ if (!ve_nf_conntrack_initialized()) ++ return -ENOPROTOOPT; ++ + if (!cda[CTA_EXPECT_TUPLE] + || !cda[CTA_EXPECT_MASK] + || !cda[CTA_EXPECT_MASTER]) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_proto.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_proto.c +--- ./net/netfilter/nf_conntrack_proto.c 2012-06-12 16:25:24.482312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_proto.c 2012-11-13 15:20:15.764569052 +0000 +@@ -28,7 +28,7 @@ + #include + #include + +-static struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX] __read_mostly; ++struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX] __read_mostly; + struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX] __read_mostly; + EXPORT_SYMBOL_GPL(nf_ct_l3protos); + +@@ -63,10 +63,10 @@ + struct nf_conntrack_l4proto * + __nf_ct_l4proto_find(u_int16_t l3proto, u_int8_t l4proto) + { +- if (unlikely(l3proto >= AF_MAX || nf_ct_protos[l3proto] == NULL)) +- return &nf_conntrack_l4proto_generic; ++ if (unlikely(l3proto >= AF_MAX || ve_nf_ct_protos[l3proto] == NULL)) ++ return ve_nf_conntrack_l4proto_generic; + +- return rcu_dereference(nf_ct_protos[l3proto][l4proto]); ++ return rcu_dereference(ve_nf_ct_protos[l3proto][l4proto]); + } + EXPORT_SYMBOL_GPL(__nf_ct_l4proto_find); + +@@ -80,7 +80,7 @@ + rcu_read_lock(); + p = __nf_ct_l4proto_find(l3proto, l4proto); + if (!try_module_get(p->me)) +- p = &nf_conntrack_l4proto_generic; ++ p = ve_nf_conntrack_l4proto_generic; + rcu_read_unlock(); + + return p; +@@ -190,7 +190,8 @@ + return -EBUSY; + + mutex_lock(&nf_ct_proto_mutex); +- if (nf_ct_l3protos[proto->l3proto] != &nf_conntrack_l3proto_generic) { ++ if (ve_nf_ct_l3protos[proto->l3proto] != ++ &nf_conntrack_l3proto_generic) { + ret = -EBUSY; + goto out_unlock; + } +@@ -199,7 +200,7 @@ + if (ret < 0) + goto out_unlock; + +- rcu_assign_pointer(nf_ct_l3protos[proto->l3proto], proto); ++ rcu_assign_pointer(ve_nf_ct_l3protos[proto->l3proto], proto); + + out_unlock: + mutex_unlock(&nf_ct_proto_mutex); +@@ -212,8 +213,8 @@ + BUG_ON(proto->l3proto >= AF_MAX); + + mutex_lock(&nf_ct_proto_mutex); +- BUG_ON(nf_ct_l3protos[proto->l3proto] != proto); +- rcu_assign_pointer(nf_ct_l3protos[proto->l3proto], ++ BUG_ON(ve_nf_ct_l3protos[proto->l3proto] != proto); ++ rcu_assign_pointer(ve_nf_ct_l3protos[proto->l3proto], + &nf_conntrack_l3proto_generic); + nf_ct_l3proto_unregister_sysctl(proto); + mutex_unlock(&nf_ct_proto_mutex); +@@ -281,7 +282,7 @@ + return -EBUSY; + + mutex_lock(&nf_ct_proto_mutex); +- if (!nf_ct_protos[l4proto->l3proto]) { ++ if (!ve_nf_ct_protos[l4proto->l3proto]) { + /* l3proto may be loaded latter. */ + struct nf_conntrack_l4proto **proto_array; + int i; +@@ -295,10 +296,10 @@ + } + + for (i = 0; i < MAX_NF_CT_PROTO; i++) +- proto_array[i] = &nf_conntrack_l4proto_generic; +- nf_ct_protos[l4proto->l3proto] = proto_array; +- } else if (nf_ct_protos[l4proto->l3proto][l4proto->l4proto] != +- &nf_conntrack_l4proto_generic) { ++ proto_array[i] = ve_nf_conntrack_l4proto_generic; ++ ve_nf_ct_protos[l4proto->l3proto] = proto_array; ++ } else if (ve_nf_ct_protos[l4proto->l3proto][l4proto->l4proto] != ++ ve_nf_conntrack_l4proto_generic) { + ret = -EBUSY; + goto out_unlock; + } +@@ -307,7 +308,7 @@ + if (ret < 0) + goto out_unlock; + +- rcu_assign_pointer(nf_ct_protos[l4proto->l3proto][l4proto->l4proto], ++ rcu_assign_pointer(ve_nf_ct_protos[l4proto->l3proto][l4proto->l4proto], + l4proto); + + out_unlock: +@@ -321,9 +322,9 @@ + BUG_ON(l4proto->l3proto >= PF_MAX); + + mutex_lock(&nf_ct_proto_mutex); +- BUG_ON(nf_ct_protos[l4proto->l3proto][l4proto->l4proto] != l4proto); +- rcu_assign_pointer(nf_ct_protos[l4proto->l3proto][l4proto->l4proto], +- &nf_conntrack_l4proto_generic); ++ BUG_ON(ve_nf_ct_protos[l4proto->l3proto][l4proto->l4proto] != l4proto); ++ rcu_assign_pointer(ve_nf_ct_protos[l4proto->l3proto][l4proto->l4proto], ++ ve_nf_conntrack_l4proto_generic); + nf_ct_l4proto_unregister_sysctl(l4proto); + mutex_unlock(&nf_ct_proto_mutex); + +@@ -339,12 +340,12 @@ + unsigned int i; + int err; + +- err = nf_ct_l4proto_register_sysctl(&nf_conntrack_l4proto_generic); ++ err = nf_ct_l4proto_register_sysctl(ve_nf_conntrack_l4proto_generic); + if (err < 0) + return err; + + for (i = 0; i < AF_MAX; i++) +- rcu_assign_pointer(nf_ct_l3protos[i], ++ rcu_assign_pointer(ve_nf_ct_l3protos[i], + &nf_conntrack_l3proto_generic); + return 0; + } +@@ -353,9 +354,13 @@ + { + unsigned int i; + +- nf_ct_l4proto_unregister_sysctl(&nf_conntrack_l4proto_generic); ++ nf_ct_l4proto_unregister_sysctl(ve_nf_conntrack_l4proto_generic); + + /* free l3proto protocol tables */ + for (i = 0; i < PF_MAX; i++) +- kfree(nf_ct_protos[i]); ++ kfree(ve_nf_ct_protos[i]); ++#ifdef CONFIG_VE_IPTABLES ++ if (!ve_is_super(get_exec_env())) ++ kfree(ve_nf_conntrack_l4proto_generic); ++#endif + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_proto_generic.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_proto_generic.c +--- ./net/netfilter/nf_conntrack_proto_generic.c 2012-06-12 16:25:24.482312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_proto_generic.c 2012-11-13 15:20:15.764569052 +0000 +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -55,7 +56,7 @@ + int pf, + unsigned int hooknum) + { +- nf_ct_refresh_acct(conntrack, ctinfo, skb, nf_ct_generic_timeout); ++ nf_ct_refresh_acct(conntrack, ctinfo, skb, ve_nf_ct_generic_timeout); + return NF_ACCEPT; + } + +@@ -115,3 +116,61 @@ + #endif + #endif + }; ++ ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++int nf_ct_proto_generic_sysctl_init(void) ++{ ++ struct nf_conntrack_l4proto *generic; ++ ++ if (ve_is_super(get_exec_env())) { ++ generic = &nf_conntrack_l4proto_generic; ++ goto out; ++ } ++ ++ generic = kmemdup(&nf_conntrack_l4proto_generic, ++ sizeof(struct nf_conntrack_l4proto), GFP_KERNEL); ++ if (generic == NULL) ++ goto no_mem_ct; ++ ++ generic->ctl_table_header = &ve_generic_sysctl_header; ++ generic->ctl_table = clone_sysctl_template(generic_sysctl_table); ++ if (generic->ctl_table == NULL) ++ goto no_mem_sys; ++ ++ generic->ctl_table[0].data = &ve_nf_ct_generic_timeout; ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ generic->ctl_compat_table_header = ve_generic_compat_sysctl_header; ++ generic->ctl_compat_table = clone_sysctl_template(generic_compat_sysctl_table); ++ if (generic->ctl_compat_table == NULL) ++ goto no_mem_compat; ++ generic->ctl_compat_table[0].data = &ve_nf_ct_generic_timeout; ++#endif ++out: ++ ve_nf_ct_generic_timeout = nf_ct_generic_timeout; ++ ++ ve_nf_conntrack_l4proto_generic = generic; ++ return 0; ++ ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++no_mem_compat: ++ free_sysctl_clone(generic->ctl_table); ++#endif ++no_mem_sys: ++ kfree(generic); ++no_mem_ct: ++ return -ENOMEM; ++} ++EXPORT_SYMBOL(nf_ct_proto_generic_sysctl_init); ++ ++void nf_ct_proto_generic_sysctl_cleanup(void) ++{ ++ if (!ve_is_super(get_exec_env())) { ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ free_sysctl_clone( ++ ve_nf_conntrack_l4proto_generic->ctl_compat_table); ++#endif ++ free_sysctl_clone(ve_nf_conntrack_l4proto_generic->ctl_table); ++ } ++} ++EXPORT_SYMBOL(nf_ct_proto_generic_sysctl_cleanup); ++#endif /* CONFIG_VE_IPTABLES && CONFIG_SYSCTL */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_proto_tcp.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_proto_tcp.c +--- ./net/netfilter/nf_conntrack_proto_tcp.c 2012-06-12 16:25:24.482312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_proto_tcp.c 2012-11-13 15:20:15.768569054 +0000 +@@ -7,6 +7,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -31,16 +32,16 @@ + /* "Be conservative in what you do, + be liberal in what you accept from others." + If it's non-zero, we mark only out of window RST segments as INVALID. */ +-static int nf_ct_tcp_be_liberal __read_mostly = 0; ++int nf_ct_tcp_be_liberal __read_mostly = 0; + + /* If it is set to zero, we disable picking up already established + connections. */ +-static int nf_ct_tcp_loose __read_mostly = 1; ++int nf_ct_tcp_loose __read_mostly = 1; + + /* Max number of the retransmitted packets without receiving an (acceptable) + ACK from the destination. If this number is reached, a shorter timer + will be started. */ +-static int nf_ct_tcp_max_retrans __read_mostly = 3; ++int nf_ct_tcp_max_retrans __read_mostly = 3; + + /* FIXME: Examine ipfilter's timeouts and conntrack transitions more + closely. They're more complex. --RR */ +@@ -63,21 +64,21 @@ + #define HOURS * 60 MINS + #define DAYS * 24 HOURS + +-static unsigned int nf_ct_tcp_timeout_syn_sent __read_mostly = 2 MINS; +-static unsigned int nf_ct_tcp_timeout_syn_recv __read_mostly = 60 SECS; +-static unsigned int nf_ct_tcp_timeout_established __read_mostly = 5 DAYS; +-static unsigned int nf_ct_tcp_timeout_fin_wait __read_mostly = 2 MINS; +-static unsigned int nf_ct_tcp_timeout_close_wait __read_mostly = 60 SECS; +-static unsigned int nf_ct_tcp_timeout_last_ack __read_mostly = 30 SECS; +-static unsigned int nf_ct_tcp_timeout_time_wait __read_mostly = 2 MINS; +-static unsigned int nf_ct_tcp_timeout_close __read_mostly = 10 SECS; ++unsigned int nf_ct_tcp_timeout_syn_sent __read_mostly = 2 MINS; ++unsigned int nf_ct_tcp_timeout_syn_recv __read_mostly = 60 SECS; ++unsigned int nf_ct_tcp_timeout_established __read_mostly = 5 DAYS; ++unsigned int nf_ct_tcp_timeout_fin_wait __read_mostly = 2 MINS; ++unsigned int nf_ct_tcp_timeout_close_wait __read_mostly = 60 SECS; ++unsigned int nf_ct_tcp_timeout_last_ack __read_mostly = 30 SECS; ++unsigned int nf_ct_tcp_timeout_time_wait __read_mostly = 2 MINS; ++unsigned int nf_ct_tcp_timeout_close __read_mostly = 10 SECS; + + /* RFC1122 says the R2 limit should be at least 100 seconds. + Linux uses 15 packets as limit, which corresponds + to ~13-30min depending on RTO. */ +-static unsigned int nf_ct_tcp_timeout_max_retrans __read_mostly = 5 MINS; ++unsigned int nf_ct_tcp_timeout_max_retrans __read_mostly = 5 MINS; + +-static unsigned int * tcp_timeouts[] = { ++unsigned int * tcp_timeouts[] = { + NULL, /* TCP_CONNTRACK_NONE */ + &nf_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */ + &nf_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */ +@@ -671,7 +672,7 @@ + } else { + res = 0; + if (sender->flags & IP_CT_TCP_FLAG_BE_LIBERAL || +- nf_ct_tcp_be_liberal) ++ ve_nf_ct_tcp_be_liberal) + res = 1; + if (!res && LOG_INVALID(IPPROTO_TCP)) + nf_log_packet(pf, 0, skb, NULL, NULL, NULL, +@@ -960,9 +961,9 @@ + if (old_state != new_state + && new_state == TCP_CONNTRACK_FIN_WAIT) + conntrack->proto.tcp.seen[dir].flags |= IP_CT_TCP_FLAG_CLOSE_INIT; +- timeout = conntrack->proto.tcp.retrans >= nf_ct_tcp_max_retrans +- && *tcp_timeouts[new_state] > nf_ct_tcp_timeout_max_retrans +- ? nf_ct_tcp_timeout_max_retrans : *tcp_timeouts[new_state]; ++ timeout = conntrack->proto.tcp.retrans >= ve_nf_ct_tcp_max_retrans ++ && ve_nf_ct_tcp_timeouts[new_state] > ve_nf_ct_tcp_timeout_max_retrans ++ ? ve_nf_ct_tcp_timeout_max_retrans : ve_nf_ct_tcp_timeouts[new_state]; + write_unlock_bh(&tcp_lock); + + nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, skb); +@@ -1032,7 +1033,7 @@ + + tcp_options(skb, dataoff, th, &conntrack->proto.tcp.seen[0]); + conntrack->proto.tcp.seen[1].flags = 0; +- } else if (nf_ct_tcp_loose == 0) { ++ } else if (ve_nf_ct_tcp_loose == 0) { + /* Don't try to pick up connections. */ + return 0; + } else { +@@ -1427,3 +1428,114 @@ + #endif + }; + EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_tcp6); ++ ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++int nf_ct_proto_tcp_sysctl_init(void) ++{ ++ struct nf_conntrack_l4proto *tcp4, *tcp6; ++ ++ if (ve_is_super(get_exec_env())) { ++ tcp4 = &nf_conntrack_l4proto_tcp4; ++ tcp6 = &nf_conntrack_l4proto_tcp6; ++ goto out; ++ } ++ ++ tcp4 = kmemdup(&nf_conntrack_l4proto_tcp4, ++ sizeof(struct nf_conntrack_l4proto), GFP_KERNEL); ++ if (tcp4 == NULL) ++ goto no_mem_ct4; ++ ++ tcp4->ctl_table_users = &ve_tcp_sysctl_table_users; ++ tcp4->ctl_table_header = &ve_tcp_sysctl_header; ++ tcp4->ctl_table = clone_sysctl_template(tcp_sysctl_table); ++ if (tcp4->ctl_table == NULL) ++ goto no_mem_sys; ++ ++ tcp4->ctl_table[0].data = &ve_nf_ct_tcp_timeouts[1]; ++ tcp4->ctl_table[1].data = &ve_nf_ct_tcp_timeouts[2]; ++ tcp4->ctl_table[2].data = &ve_nf_ct_tcp_timeouts[3]; ++ tcp4->ctl_table[3].data = &ve_nf_ct_tcp_timeouts[4]; ++ tcp4->ctl_table[4].data = &ve_nf_ct_tcp_timeouts[5]; ++ tcp4->ctl_table[5].data = &ve_nf_ct_tcp_timeouts[6]; ++ tcp4->ctl_table[6].data = &ve_nf_ct_tcp_timeouts[7]; ++ tcp4->ctl_table[7].data = &ve_nf_ct_tcp_timeouts[8]; ++ tcp4->ctl_table[8].data = &ve_nf_ct_tcp_timeout_max_retrans; ++ tcp4->ctl_table[9].data = &ve_nf_ct_tcp_loose; ++ tcp4->ctl_table[10].data = &ve_nf_ct_tcp_be_liberal; ++ tcp4->ctl_table[11].data = &ve_nf_ct_tcp_max_retrans; ++ ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ tcp4->ctl_compat_table_header = ve_tcp_compat_sysctl_header; ++ tcp4->ctl_compat_table = clone_sysctl_template(tcp_compat_sysctl_table); ++ if (tcp4->ctl_compat_table == NULL) ++ goto no_mem_compat; ++ ++ tcp4->ctl_compat_table[0].data = &ve_nf_ct_tcp_timeouts[1]; ++ tcp4->ctl_compat_table[1].data = &ve_nf_ct_tcp_timeouts[2]; ++ tcp4->ctl_compat_table[2].data = &ve_nf_ct_tcp_timeouts[3]; ++ tcp4->ctl_compat_table[3].data = &ve_nf_ct_tcp_timeouts[4]; ++ tcp4->ctl_compat_table[4].data = &ve_nf_ct_tcp_timeouts[5]; ++ tcp4->ctl_compat_table[5].data = &ve_nf_ct_tcp_timeouts[6]; ++ tcp4->ctl_compat_table[6].data = &ve_nf_ct_tcp_timeouts[7]; ++ tcp4->ctl_compat_table[7].data = &ve_nf_ct_tcp_timeouts[8]; ++ tcp4->ctl_compat_table[8].data = &ve_nf_ct_tcp_timeout_max_retrans; ++ tcp4->ctl_compat_table[9].data = &ve_nf_ct_tcp_loose; ++ tcp4->ctl_compat_table[10].data = &ve_nf_ct_tcp_be_liberal; ++ tcp4->ctl_compat_table[11].data = &ve_nf_ct_tcp_max_retrans; ++#endif ++ ++ tcp6 = kmemdup(&nf_conntrack_l4proto_tcp6, ++ sizeof(struct nf_conntrack_l4proto), GFP_KERNEL); ++ if (!tcp6) ++ goto no_mem_ct6; ++ ++ tcp6->ctl_table_users = &ve_tcp_sysctl_table_users; ++ tcp6->ctl_table_header = &ve_tcp_sysctl_header; ++ tcp6->ctl_table = tcp4->ctl_table; ++out: ++ ve_nf_ct_tcp_timeouts[1] = nf_ct_tcp_timeout_syn_sent; ++ ve_nf_ct_tcp_timeouts[2] = nf_ct_tcp_timeout_syn_recv; ++ ve_nf_ct_tcp_timeouts[3] = nf_ct_tcp_timeout_established; ++ ve_nf_ct_tcp_timeouts[4] = nf_ct_tcp_timeout_fin_wait; ++ ve_nf_ct_tcp_timeouts[5] = nf_ct_tcp_timeout_close_wait; ++ ve_nf_ct_tcp_timeouts[6] = nf_ct_tcp_timeout_last_ack; ++ ve_nf_ct_tcp_timeouts[7] = nf_ct_tcp_timeout_time_wait; ++ ve_nf_ct_tcp_timeouts[8] = nf_ct_tcp_timeout_close; ++ ve_nf_ct_tcp_timeout_max_retrans = nf_ct_tcp_timeout_max_retrans; ++ ve_nf_ct_tcp_loose = nf_ct_tcp_loose; ++ ve_nf_ct_tcp_be_liberal = nf_ct_tcp_be_liberal; ++ ve_nf_ct_tcp_max_retrans = nf_ct_tcp_max_retrans; ++ ++ ve_nf_conntrack_l4proto_tcp4 = tcp4; ++ ve_nf_conntrack_l4proto_tcp6 = tcp6; ++ return 0; ++ ++no_mem_ct6: ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ free_sysctl_clone(tcp4->ctl_compat_table); ++no_mem_compat: ++#endif ++ free_sysctl_clone(tcp4->ctl_table); ++no_mem_sys: ++ kfree(tcp4); ++no_mem_ct4: ++ return -ENOMEM; ++} ++EXPORT_SYMBOL(nf_ct_proto_tcp_sysctl_init); ++ ++void nf_ct_proto_tcp_sysctl_cleanup(void) ++{ ++ if (!ve_is_super(get_exec_env())) { ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ free_sysctl_clone( ++ ve_nf_conntrack_l4proto_tcp4->ctl_compat_table); ++#endif ++ free_sysctl_clone(ve_nf_conntrack_l4proto_tcp4->ctl_table); ++ kfree(ve_nf_conntrack_l4proto_tcp4); ++ ++ kfree(ve_nf_conntrack_l4proto_tcp6); ++ } ++} ++EXPORT_SYMBOL(nf_ct_proto_tcp_sysctl_cleanup); ++#endif /* CONFIG_VE_IPTABLES && CONFIG_SYSCTL */ ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_proto_udp.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_proto_udp.c +--- ./net/netfilter/nf_conntrack_proto_udp.c 2012-06-12 16:25:24.482312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_proto_udp.c 2012-11-13 15:20:15.768569054 +0000 +@@ -7,6 +7,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -78,12 +79,12 @@ + stream. Extend timeout. */ + if (test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)) { + nf_ct_refresh_acct(conntrack, ctinfo, skb, +- nf_ct_udp_timeout_stream); ++ ve_nf_ct_udp_timeout_stream); + /* Also, more likely to be important, and not a probe */ + if (!test_and_set_bit(IPS_ASSURED_BIT, &conntrack->status)) + nf_conntrack_event_cache(IPCT_STATUS, skb); + } else +- nf_ct_refresh_acct(conntrack, ctinfo, skb, nf_ct_udp_timeout); ++ nf_ct_refresh_acct(conntrack, ctinfo, skb, ve_nf_ct_udp_timeout); + + return NF_ACCEPT; + } +@@ -238,3 +239,84 @@ + #endif + }; + EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_udp6); ++ ++#if defined(CONFIG_VE_IPTABLES) && defined(CONFIG_SYSCTL) ++int nf_ct_proto_udp_sysctl_init(void) ++{ ++ struct nf_conntrack_l4proto *udp4, *udp6; ++ ++ if (ve_is_super(get_exec_env())) { ++ udp4 = &nf_conntrack_l4proto_udp4; ++ udp6 = &nf_conntrack_l4proto_udp6; ++ goto out; ++ } ++ ++ udp4 = kmemdup(&nf_conntrack_l4proto_udp4, ++ sizeof(struct nf_conntrack_l4proto), GFP_KERNEL); ++ if (udp4 == NULL) ++ goto no_mem_ct4; ++ ++ udp4->ctl_table_users = &ve_udp_sysctl_table_users; ++ udp4->ctl_table_header = &ve_udp_sysctl_header; ++ udp4->ctl_table = clone_sysctl_template(udp_sysctl_table); ++ if (udp4->ctl_table == NULL) ++ goto no_mem_sys; ++ udp4->ctl_table[0].data = &ve_nf_ct_udp_timeout; ++ udp4->ctl_table[1].data = &ve_nf_ct_udp_timeout_stream; ++ ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ udp4->ctl_compat_table_header = ve_udp_compat_sysctl_header; ++ udp4->ctl_compat_table = clone_sysctl_template(udp_compat_sysctl_table); ++ if (udp4->ctl_compat_table == NULL) ++ goto no_mem_compat; ++ udp4->ctl_compat_table[0].data = &ve_nf_ct_udp_timeout; ++ udp4->ctl_compat_table[1].data = &ve_nf_ct_udp_timeout_stream; ++#endif ++ ++ udp6 = kmemdup(&nf_conntrack_l4proto_udp6, ++ sizeof(struct nf_conntrack_l4proto), GFP_KERNEL); ++ if (!udp6) ++ goto no_mem_ct6; ++ ++ udp6->ctl_table_users = &ve_udp_sysctl_table_users; ++ udp6->ctl_table_header = &ve_udp_sysctl_header; ++ udp6->ctl_table = udp4->ctl_table; ++ ++ udp6->ctl_table[0].data = &ve_nf_ct_udp_timeout; ++ udp6->ctl_table[1].data = &ve_nf_ct_udp_timeout_stream; ++out: ++ ve_nf_ct_udp_timeout = nf_ct_udp_timeout; ++ ve_nf_ct_udp_timeout_stream = nf_ct_udp_timeout_stream; ++ ++ ve_nf_conntrack_l4proto_udp4 = udp4; ++ ve_nf_conntrack_l4proto_udp6 = udp6; ++ return 0; ++ ++no_mem_ct6: ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ free_sysctl_clone(udp4->ctl_compat_table); ++no_mem_compat: ++#endif ++ free_sysctl_clone(udp4->ctl_table); ++no_mem_sys: ++ kfree(udp4); ++no_mem_ct4: ++ return -ENOMEM; ++} ++EXPORT_SYMBOL(nf_ct_proto_udp_sysctl_init); ++ ++void nf_ct_proto_udp_sysctl_cleanup(void) ++{ ++ if (!ve_is_super(get_exec_env())) { ++#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT ++ free_sysctl_clone( ++ ve_nf_conntrack_l4proto_udp4->ctl_compat_table); ++#endif ++ free_sysctl_clone(ve_nf_conntrack_l4proto_udp4->ctl_table); ++ kfree(ve_nf_conntrack_l4proto_udp4); ++ ++ kfree(ve_nf_conntrack_l4proto_udp6); ++ } ++} ++EXPORT_SYMBOL(nf_ct_proto_udp_sysctl_cleanup); ++#endif /* CONFIG_VE_IPTABLES && CONFIG_SYSCTL */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_conntrack_standalone.c debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_standalone.c +--- ./net/netfilter/nf_conntrack_standalone.c 2012-06-12 16:25:24.482312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_conntrack_standalone.c 2012-11-13 15:20:15.768569054 +0000 +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -18,6 +19,7 @@ + #ifdef CONFIG_SYSCTL + #include + #endif ++#include + + #include + #include +@@ -28,6 +30,10 @@ + + MODULE_LICENSE("GPL"); + ++int ip_conntrack_disable_ve0 = 0; ++module_param(ip_conntrack_disable_ve0, int, 0440); ++EXPORT_SYMBOL(ip_conntrack_disable_ve0); ++ + #ifdef CONFIG_PROC_FS + int + print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, +@@ -62,8 +68,8 @@ + for (st->bucket = 0; + st->bucket < nf_conntrack_htable_size; + st->bucket++) { +- if (!hlist_empty(&nf_conntrack_hash[st->bucket])) +- return nf_conntrack_hash[st->bucket].first; ++ if (!hlist_empty(&ve_nf_conntrack_hash[st->bucket])) ++ return ve_nf_conntrack_hash[st->bucket].first; + } + return NULL; + } +@@ -77,7 +83,7 @@ + while (head == NULL) { + if (++st->bucket >= nf_conntrack_htable_size) + return NULL; +- head = nf_conntrack_hash[st->bucket].first; ++ head = ve_nf_conntrack_hash[st->bucket].first; + } + return head; + } +@@ -244,7 +250,7 @@ + + static int ct_cpu_seq_show(struct seq_file *seq, void *v) + { +- unsigned int nr_conntracks = atomic_read(&nf_conntrack_count); ++ unsigned int nr_conntracks = atomic_read(&ve_nf_conntrack_count); + struct ip_conntrack_stat *st = v; + + if (v == SEQ_START_TOKEN) { +@@ -294,6 +300,55 @@ + .llseek = seq_lseek, + .release = seq_release_private, + }; ++ ++static int nf_conntrack_init_ve_proc(struct ve_struct *ve) ++{ ++ struct net *net = ve->ve_netns; ++ struct proc_dir_entry *proc, *proc_stat; ++ int create_proc_net_stat_nf_conntrack = 1; ++ ++ proc = proc_net_fops_create(net, "nf_conntrack", 0440, &ct_file_ops); ++ if (!proc) ++ goto out; ++#ifdef CONFIG_VE_IPTABLES ++ create_proc_net_stat_nf_conntrack = ve_is_super(get_exec_env()); ++#endif ++ if (create_proc_net_stat_nf_conntrack) { ++ proc_stat = create_proc_entry("nf_conntrack", S_IRUGO, ++ net->proc_net_stat); ++ if (!proc_stat) ++ goto out_rm_nf_conntrack_expect; ++ proc_stat->proc_fops = &ct_cpu_seq_fops; ++ proc_stat->owner = THIS_MODULE; ++ } ++ return 0; ++out_rm_nf_conntrack_expect: ++ proc_net_remove(net, "nf_conntrack"); ++out: ++ return -ENOMEM; ++} ++ ++static void nf_conntrack_fini_ve_proc(struct ve_struct *ve) ++{ ++ struct net *net = ve->ve_netns; ++ int remove_proc_net_stat_nf_conntrack = 1; ++ ++#ifdef CONFIG_VE_IPTABLES ++ remove_proc_net_stat_nf_conntrack = ve_is_super(get_exec_env()); ++#endif ++ if (remove_proc_net_stat_nf_conntrack) ++ remove_proc_entry("nf_conntrack", net->proc_net_stat); ++ proc_net_remove(net, "nf_conntrack"); ++} ++#else ++static inline int nf_conntrack_init_ve_proc(struct ve_struct *ve) ++{ ++ return 0; ++} ++ ++static inline void nf_conntrack_fini_ve_proc(struct ve_struct *ve) ++{ ++} + #endif /* CONFIG_PROC_FS */ + + /* Sysctl support */ +@@ -395,61 +450,121 @@ + EXPORT_SYMBOL_GPL(nf_ct_log_invalid); + #endif /* CONFIG_SYSCTL */ + +-static int __init nf_conntrack_standalone_init(void) ++#if defined(CONFIG_SYSCTL) && defined(CONFIG_VE_IPTABLES) ++static int nf_conntrack_init_ve_sysctl(struct ve_struct *ve) + { +-#ifdef CONFIG_PROC_FS +- struct proc_dir_entry *proc, *proc_stat; +-#endif +- int ret = 0; ++ ve_nf_ct_net_table = nf_ct_net_table; ++ ve_nf_ct_netfilter_table = nf_ct_netfilter_table; ++ ve_nf_ct_sysctl_table = nf_ct_sysctl_table; ++ ++ if (!ve_is_super(ve)) { ++ ve_nf_ct_net_table = clone_sysctl_template(nf_ct_net_table); ++ if (ve_nf_ct_net_table == NULL) ++ goto out; ++ } + +- ret = nf_conntrack_init(); +- if (ret < 0) +- return ret; ++ ve_nf_ct_netfilter_table = ve_nf_ct_net_table[0].child; ++ ve_nf_ct_netfilter_table[1].data = &ve_nf_conntrack_max; ++ ve_nf_ct_sysctl_table = ve_nf_ct_netfilter_table[0].child; ++ ve_nf_ct_sysctl_table[0].data = &ve_nf_conntrack_max; ++ ve_nf_ct_sysctl_table[1].data = &ve_nf_conntrack_count; ++ ve_nf_ct_sysctl_table[3].data = &ve_nf_conntrack_checksum; ++ ve_nf_ct_sysctl_table[4].data = &ve_nf_ct_log_invalid; ++ ve_nf_ct_sysctl_table[5].data = &ve_nf_ct_expect_max; ++ ++ ve_nf_ct_sysctl_header = register_sysctl_table(ve_nf_ct_net_table); ++ if (!ve_nf_ct_sysctl_header) ++ goto out_unclone; + +-#ifdef CONFIG_PROC_FS +- proc = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops); +- if (!proc) goto cleanup_init; ++ return 0; + +- proc_stat = create_proc_entry("nf_conntrack", S_IRUGO, init_net.proc_net_stat); +- if (!proc_stat) +- goto cleanup_proc; ++out_unclone: ++ if (!ve_is_super(ve)) ++ free_sysctl_clone(ve_nf_ct_net_table); ++out: ++ return -ENOMEM; ++} + +- proc_stat->proc_fops = &ct_cpu_seq_fops; +- proc_stat->owner = THIS_MODULE; +-#endif +-#ifdef CONFIG_SYSCTL +- nf_ct_sysctl_header = register_sysctl_table(nf_ct_net_table); +- if (nf_ct_sysctl_header == NULL) { +- printk("nf_conntrack: can't register to sysctl.\n"); +- ret = -ENOMEM; +- goto cleanup_proc_stat; +- } +-#endif +- return ret; ++static void nf_conntrack_fini_ve_sysctl(struct ve_struct *ve) ++{ ++ unregister_sysctl_table(ve_nf_ct_sysctl_header); ++ if (!ve_is_super(ve)) ++ free_sysctl_clone(ve_nf_ct_net_table); ++} ++#else ++static inline int nf_conntrack_init_ve_sysctl(struct ve_struct *ve) ++{ ++ return 0; ++} + +-#ifdef CONFIG_SYSCTL +- cleanup_proc_stat: ++static inline void nf_conntrack_fini_ve_sysctl(struct ve_struct *ve) ++{ ++} + #endif +-#ifdef CONFIG_PROC_FS +- remove_proc_entry("nf_conntrack", init_net. proc_net_stat); +- cleanup_proc: +- proc_net_remove(&init_net, "nf_conntrack"); +- cleanup_init: +-#endif /* CNFIG_PROC_FS */ ++ ++int nf_conntrack_init_ve(void) ++{ ++ struct ve_struct *ve = get_exec_env(); ++ int err; ++ ++ err = nf_conntrack_init(); ++ if (err) ++ goto out; ++ ++ if (ve_is_super(ve) && ip_conntrack_disable_ve0) ++ return 0; ++ ++ ve_nf_conntrack_checksum = nf_conntrack_checksum; ++ ++ err = nf_conntrack_init_ve_sysctl(ve); ++ if (err < 0) ++ goto out_generic; ++ ++ err = nf_conntrack_init_ve_proc(ve); ++ if (err < 0) ++ goto out_sysctl; ++ ++ return 0; ++ ++out_sysctl: ++ nf_conntrack_fini_ve_proc(ve); ++out_generic: ++ nf_conntrack_cleanup(); ++out: ++ return err; ++} ++ ++void nf_conntrack_cleanup_ve(void) ++{ ++ struct ve_struct *ve = get_exec_env(); ++ ++ if (ve_is_super(ve) && ip_conntrack_disable_ve0) ++ goto cleanup; ++ nf_conntrack_fini_ve_proc(ve); ++ nf_conntrack_fini_ve_sysctl(ve); ++cleanup: + nf_conntrack_cleanup(); +- return ret; ++} ++EXPORT_SYMBOL(nf_conntrack_cleanup_ve); ++ ++static int __init nf_conntrack_standalone_init(void) ++{ ++#ifdef CONFIG_VE_IPTABLES ++ KSYMRESOLVE(nf_conntrack_init_ve); ++ KSYMRESOLVE(nf_conntrack_cleanup_ve); ++ KSYMMODRESOLVE(nf_conntrack); ++#endif ++ return nf_conntrack_init_ve(); + } + + static void __exit nf_conntrack_standalone_fini(void) + { +-#ifdef CONFIG_SYSCTL +- unregister_sysctl_table(nf_ct_sysctl_header); ++#ifdef CONFIG_VE_IPTABLES ++ KSYMMODUNRESOLVE(nf_conntrack); ++ KSYMUNRESOLVE(nf_conntrack_init_ve); ++ KSYMUNRESOLVE(nf_conntrack_cleanup_ve); + #endif +-#ifdef CONFIG_PROC_FS +- remove_proc_entry("nf_conntrack", init_net.proc_net_stat); +- proc_net_remove(&init_net, "nf_conntrack"); +-#endif /* CNFIG_PROC_FS */ +- nf_conntrack_cleanup(); ++ nf_conntrack_cleanup_ve(); + } + + module_init(nf_conntrack_standalone_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_queue.c debian/binary-custom.d/openvz/src/net/netfilter/nf_queue.c +--- ./net/netfilter/nf_queue.c 2012-06-12 16:25:24.482312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_queue.c 2012-11-13 15:20:15.768569054 +0000 +@@ -236,12 +236,12 @@ + /* Drop reference to owner of hook which queued us. */ + module_put(info->elem->owner); + +- list_for_each_rcu(i, &nf_hooks[info->pf][info->hook]) { ++ list_for_each_rcu(i, &ve_nf_hooks[info->pf][info->hook]) { + if (i == elem) + break; + } + +- if (i == &nf_hooks[info->pf][info->hook]) { ++ if (i == &ve_nf_hooks[info->pf][info->hook]) { + /* The module which sent it to userspace is gone. */ + NFDEBUG("%s: module disappeared, dropping packet.\n", + __FUNCTION__); +@@ -262,7 +262,7 @@ + + if (verdict == NF_ACCEPT) { + next_hook: +- verdict = nf_iterate(&nf_hooks[info->pf][info->hook], ++ verdict = nf_iterate(&ve_nf_hooks[info->pf][info->hook], + skb, info->hook, + info->indev, info->outdev, &elem, + info->okfn, INT_MIN); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nf_sockopt.c debian/binary-custom.d/openvz/src/net/netfilter/nf_sockopt.c +--- ./net/netfilter/nf_sockopt.c 2012-06-12 16:25:24.482312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nf_sockopt.c 2012-11-13 15:20:15.768569054 +0000 +@@ -65,8 +65,10 @@ + { + struct nf_sockopt_ops *ops; + +- if (sk->sk_net != &init_net) ++#ifdef CONFIG_VE_IPTABLES ++ if (!get_exec_env()->_nf_hooks) + return ERR_PTR(-ENOPROTOOPT); ++#endif + + if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0) + return ERR_PTR(-EINTR); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nfnetlink.c debian/binary-custom.d/openvz/src/net/netfilter/nfnetlink.c +--- ./net/netfilter/nfnetlink.c 2012-06-12 16:25:24.482312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nfnetlink.c 2012-11-13 15:20:15.768569054 +0000 +@@ -124,7 +124,7 @@ + const struct nfnetlink_subsystem *ss; + int type, err; + +- if (security_netlink_recv(skb, CAP_NET_ADMIN)) ++ if (security_netlink_recv(skb, CAP_VE_NET_ADMIN)) + return -EPERM; + + /* All the messages must at least contain nfgenmsg */ +@@ -179,7 +179,7 @@ + static void __exit nfnetlink_exit(void) + { + printk("Removing netfilter NETLINK layer.\n"); +- sock_release(nfnl->sk_socket); ++ netlink_kernel_release(nfnl); + return; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/nfnetlink_queue.c debian/binary-custom.d/openvz/src/net/netfilter/nfnetlink_queue.c +--- ./net/netfilter/nfnetlink_queue.c 2012-06-12 16:25:24.486312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/nfnetlink_queue.c 2012-11-13 15:20:15.768569054 +0000 +@@ -728,9 +728,6 @@ + { + struct net_device *dev = ptr; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + /* Drop any packets associated with the downed device */ + if (event == NETDEV_DOWN) + nfqnl_dev_drop(dev->ifindex); +@@ -759,8 +756,7 @@ + struct hlist_head *head = &instance_table[i]; + + hlist_for_each_entry_safe(inst, tmp, t2, head, hlist) { +- if ((n->net == &init_net) && +- (n->pid == inst->peer_pid)) ++ if (n->pid == inst->peer_pid) + __instance_destroy(inst); + } + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/x_tables.c debian/binary-custom.d/openvz/src/net/netfilter/x_tables.c +--- ./net/netfilter/x_tables.c 2012-06-12 16:25:24.486312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/x_tables.c 2012-11-13 15:20:15.768569054 +0000 +@@ -26,6 +26,10 @@ + + #include + #include ++#include ++ ++#include ++#include + + + MODULE_LICENSE("GPL"); +@@ -44,6 +48,14 @@ + + static struct xt_af *xt; + ++#ifdef CONFIG_VE_IPTABLES ++/* include ve.h and define get_exec_env */ ++#include ++#define xt_tables(af) (get_exec_env()->_xt_tables[af]) ++#else ++#define xt_tables(af) xt[af].tables ++#endif ++ + #ifdef DEBUG_IP_FIREWALL_USER + #define duprintf(format, args...) printk(format , ## args) + #else +@@ -62,6 +74,46 @@ + [NF_ARP] = "arp", + }; + ++#ifdef CONFIG_BEANCOUNTERS ++static inline struct user_beancounter *xt_table_ub(struct xt_table_info *info) ++{ ++ struct user_beancounter *ub; ++ ++ for (ub = mem_ub(info); ub->parent != NULL; ub = ub->parent); ++ return ub; ++} ++ ++static void uncharge_xtables(struct xt_table_info *info, unsigned long size) ++{ ++ struct user_beancounter *ub; ++ ++ ub = xt_table_ub(info); ++ uncharge_beancounter(ub, UB_NUMXTENT, size); ++} ++ ++static int recharge_xtables(int check_ub, ++ struct xt_table_info *new, struct xt_table_info *old) ++{ ++ struct user_beancounter *ub; ++ long change; ++ ++ ub = xt_table_ub(new); ++ BUG_ON(check_ub && ub != xt_table_ub(old)); ++ ++ change = (long)new->number - (long)old->number; ++ if (change > 0) { ++ if (charge_beancounter(ub, UB_NUMXTENT, change, UB_SOFT)) ++ return -ENOMEM; ++ } else if (change < 0) ++ uncharge_beancounter(ub, UB_NUMXTENT, -change); ++ ++ return 0; ++} ++#else ++#define recharge_xtables(c, new, old) (0) ++#define uncharge_xtables(info, s) do { } while (0) ++#endif /* CONFIG_BEANCOUNTERS */ ++ + /* Registration hooks for targets. */ + int + xt_register_target(struct xt_target *target) +@@ -73,7 +125,7 @@ + return ret; + list_add(&target->list, &xt[af].target); + mutex_unlock(&xt[af].mutex); +- return ret; ++ return 0; + } + EXPORT_SYMBOL(xt_register_target); + +@@ -130,7 +182,7 @@ + list_add(&match->list, &xt[af].match); + mutex_unlock(&xt[af].mutex); + +- return ret; ++ return 0; + } + EXPORT_SYMBOL(xt_register_match); + +@@ -310,23 +362,23 @@ + unsigned short proto, int inv_proto) + { + if (XT_ALIGN(match->matchsize) != size) { +- printk("%s_tables: %s match: invalid size %Zu != %u\n", ++ ve_printk(VE_LOG, "%s_tables: %s match: invalid size %Zu != %u\n", + xt_prefix[family], match->name, + XT_ALIGN(match->matchsize), size); + return -EINVAL; + } + if (match->table && strcmp(match->table, table)) { +- printk("%s_tables: %s match: only valid in %s table, not %s\n", ++ ve_printk(VE_LOG, "%s_tables: %s match: only valid in %s table, not %s\n", + xt_prefix[family], match->name, match->table, table); + return -EINVAL; + } + if (match->hooks && (hook_mask & ~match->hooks) != 0) { +- printk("%s_tables: %s match: bad hook_mask %u/%u\n", ++ ve_printk(VE_LOG, "%s_tables: %s match: bad hook_mask %u/%u\n", + xt_prefix[family], match->name, hook_mask, match->hooks); + return -EINVAL; + } + if (match->proto && (match->proto != proto || inv_proto)) { +- printk("%s_tables: %s match: only valid for protocol %u\n", ++ ve_printk(VE_LOG, "%s_tables: %s match: only valid for protocol %u\n", + xt_prefix[family], match->name, match->proto); + return -EINVAL; + } +@@ -402,24 +454,24 @@ + unsigned short proto, int inv_proto) + { + if (XT_ALIGN(target->targetsize) != size) { +- printk("%s_tables: %s target: invalid size %Zu != %u\n", ++ ve_printk(VE_LOG, "%s_tables: %s target: invalid size %Zu != %u\n", + xt_prefix[family], target->name, + XT_ALIGN(target->targetsize), size); + return -EINVAL; + } + if (target->table && strcmp(target->table, table)) { +- printk("%s_tables: %s target: only valid in %s table, not %s\n", ++ ve_printk(VE_LOG, "%s_tables: %s target: only valid in %s table, not %s\n", + xt_prefix[family], target->name, target->table, table); + return -EINVAL; + } + if (target->hooks && (hook_mask & ~target->hooks) != 0) { +- printk("%s_tables: %s target: bad hook_mask %u/%u\n", ++ ve_printk(VE_LOG, "%s_tables: %s target: bad hook_mask %u/%u\n", + xt_prefix[family], target->name, hook_mask, + target->hooks); + return -EINVAL; + } + if (target->proto && (target->proto != proto || inv_proto)) { +- printk("%s_tables: %s target: only valid for protocol %u\n", ++ ve_printk(VE_LOG, "%s_tables: %s target: only valid for protocol %u\n", + xt_prefix[family], target->name, target->proto); + return -EINVAL; + } +@@ -499,19 +551,19 @@ + if ((SMP_ALIGN(size) >> PAGE_SHIFT) + 2 > num_physpages) + return NULL; + +- newinfo = kzalloc(sizeof(struct xt_table_info), GFP_KERNEL); ++ newinfo = kzalloc(sizeof(struct xt_table_info), GFP_KERNEL_UBC); + if (!newinfo) + return NULL; + +- newinfo->size = size; ++ newinfo->alloc_size = newinfo->size = size; + + for_each_possible_cpu(cpu) { + if (size <= PAGE_SIZE) + newinfo->entries[cpu] = kmalloc_node(size, +- GFP_KERNEL, ++ GFP_KERNEL_UBC, + cpu_to_node(cpu)); + else +- newinfo->entries[cpu] = vmalloc_node(size, ++ newinfo->entries[cpu] = ub_vmalloc_node(size, + cpu_to_node(cpu)); + + if (newinfo->entries[cpu] == NULL) { +@@ -529,7 +581,7 @@ + int cpu; + + for_each_possible_cpu(cpu) { +- if (info->size <= PAGE_SIZE) ++ if (info->alloc_size <= PAGE_SIZE) + kfree(info->entries[cpu]); + else + vfree(info->entries[cpu]); +@@ -546,7 +598,7 @@ + if (mutex_lock_interruptible(&xt[af].mutex) != 0) + return ERR_PTR(-EINTR); + +- list_for_each_entry(t, &xt[af].tables, list) ++ list_for_each_entry(t, &xt_tables(af), list) + if (strcmp(t->name, name) == 0 && try_module_get(t->me)) + return t; + mutex_unlock(&xt[af].mutex); +@@ -594,6 +646,13 @@ + return NULL; + } + oldinfo = private; ++ ++ if (recharge_xtables(num_counters != 0, newinfo, oldinfo)) { ++ write_unlock_bh(&table->lock); ++ *error = -ENOMEM; ++ return NULL; ++ } ++ + table->private = newinfo; + newinfo->initial_entries = oldinfo->initial_entries; + write_unlock_bh(&table->lock); +@@ -615,7 +674,7 @@ + return ret; + + /* Don't autoload: we'd eat our tail... */ +- list_for_each_entry(t, &xt[table->af].tables, list) { ++ list_for_each_entry(t, &xt_tables(table->af), list) { + if (strcmp(t->name, table->name) == 0) { + ret = -EEXIST; + goto unlock; +@@ -634,7 +693,7 @@ + /* save number of initial entries */ + private->initial_entries = private->number; + +- list_add(&table->list, &xt[table->af].tables); ++ list_add(&table->list, &xt_tables(table->af)); + + ret = 0; + unlock: +@@ -643,6 +702,39 @@ + } + EXPORT_SYMBOL_GPL(xt_register_table); + ++struct xt_table * virt_xt_register_table(struct xt_table *table, ++ struct xt_table_info *bootstrap, ++ struct xt_table_info *newinfo) ++{ ++ int ret; ++ struct module *mod = table->me; ++ ++ if (!ve_is_super(get_exec_env())) { ++ struct xt_table *tmp; ++ __module_get(mod); ++ ret = -ENOMEM; ++ tmp = kmalloc(sizeof(struct xt_table), GFP_KERNEL_UBC); ++ if (!tmp) ++ goto nomem; ++ memcpy(tmp, table, sizeof(struct xt_table)); ++ table = tmp; ++ } ++ ++ ret = xt_register_table(table, bootstrap, newinfo); ++ if (ret) ++ goto out; ++ ++ return table; ++out: ++ if (!ve_is_super(get_exec_env())) { ++ kfree(table); ++nomem: ++ module_put(mod); ++ } ++ return ERR_PTR(ret); ++} ++EXPORT_SYMBOL_GPL(virt_xt_register_table); ++ + void *xt_unregister_table(struct xt_table *table) + { + struct xt_table_info *private; +@@ -652,10 +744,25 @@ + list_del(&table->list); + mutex_unlock(&xt[table->af].mutex); + ++ uncharge_xtables(private, private->number); ++ + return private; + } + EXPORT_SYMBOL_GPL(xt_unregister_table); + ++void *virt_xt_unregister_table(struct xt_table *table) ++{ ++ void *ret; ++ ++ ret = xt_unregister_table(table); ++ if (!ve_is_super(get_exec_env())) { ++ module_put(table->me); ++ kfree(table); ++ } ++ return ret; ++} ++EXPORT_SYMBOL_GPL(virt_xt_unregister_table); ++ + #ifdef CONFIG_PROC_FS + static struct list_head *xt_get_idx(struct list_head *list, struct seq_file *seq, loff_t pos) + { +@@ -684,7 +791,7 @@ + list = &xt[af].match; + break; + case TABLE: +- list = &xt[af].tables; ++ list = &xt_tables(af); + break; + default: + list = NULL; +@@ -797,6 +904,7 @@ + return -EINVAL; + + ++ INIT_LIST_HEAD(&xt_tables(af)); + #ifdef CONFIG_PROC_FS + strlcpy(buf, xt_prefix[af], sizeof(buf)); + strlcat(buf, FORMAT_TABLES, sizeof(buf)); +@@ -885,6 +993,6 @@ + kfree(xt); + } + +-module_init(xt_init); ++subsys_initcall(xt_init); + module_exit(xt_fini); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/xt_MARK.c debian/binary-custom.d/openvz/src/net/netfilter/xt_MARK.c +--- ./net/netfilter/xt_MARK.c 2012-06-12 16:25:24.486312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/xt_MARK.c 2012-11-13 15:20:15.772569055 +0000 +@@ -75,7 +75,7 @@ + const struct xt_mark_target_info *markinfo = targinfo; + + if (markinfo->mark > 0xffffffff) { +- printk(KERN_WARNING "MARK: Only supports 32bit wide mark\n"); ++ ve_printk(VE_LOG, KERN_WARNING "MARK: Only supports 32bit wide mark\n"); + return false; + } + return true; +@@ -93,12 +93,12 @@ + if (markinfo->mode != XT_MARK_SET + && markinfo->mode != XT_MARK_AND + && markinfo->mode != XT_MARK_OR) { +- printk(KERN_WARNING "MARK: unknown mode %u\n", ++ ve_printk(VE_LOG, KERN_WARNING "MARK: unknown mode %u\n", + markinfo->mode); + return false; + } + if (markinfo->mark > 0xffffffff) { +- printk(KERN_WARNING "MARK: Only supports 32bit wide mark\n"); ++ ve_printk(VE_LOG, KERN_WARNING "MARK: Only supports 32bit wide mark\n"); + return false; + } + return true; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/xt_TCPMSS.c debian/binary-custom.d/openvz/src/net/netfilter/xt_TCPMSS.c +--- ./net/netfilter/xt_TCPMSS.c 2012-06-12 16:25:24.486312480 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/xt_TCPMSS.c 2012-11-13 15:20:15.772569055 +0000 +@@ -63,7 +63,7 @@ + badly. --RR */ + if (tcplen != tcph->doff*4) { + if (net_ratelimit()) +- printk(KERN_ERR "xt_TCPMSS: bad length (%u bytes)\n", ++ ve_printk(VE_LOG, KERN_ERR "xt_TCPMSS: bad length (%u bytes)\n", + skb->len); + return -1; + } +@@ -71,7 +71,7 @@ + if (info->mss == XT_TCPMSS_CLAMP_PMTU) { + if (dst_mtu(skb->dst) <= minlen) { + if (net_ratelimit()) +- printk(KERN_ERR "xt_TCPMSS: " ++ ve_printk(VE_LOG, KERN_ERR "xt_TCPMSS: " + "unknown or invalid path-MTU (%u)\n", + dst_mtu(skb->dst)); + return -1; +@@ -217,13 +217,13 @@ + (hook_mask & ~((1 << NF_IP_FORWARD) | + (1 << NF_IP_LOCAL_OUT) | + (1 << NF_IP_POST_ROUTING))) != 0) { +- printk("xt_TCPMSS: path-MTU clamping only supported in " ++ ve_printk(VE_LOG, "xt_TCPMSS: path-MTU clamping only supported in " + "FORWARD, OUTPUT and POSTROUTING hooks\n"); + return false; + } + if (IPT_MATCH_ITERATE(e, find_syn_match)) + return true; +- printk("xt_TCPMSS: Only works on TCP SYN packets\n"); ++ ve_printk(VE_LOG, "xt_TCPMSS: Only works on TCP SYN packets\n"); + return false; + } + +@@ -242,13 +242,13 @@ + (hook_mask & ~((1 << NF_IP6_FORWARD) | + (1 << NF_IP6_LOCAL_OUT) | + (1 << NF_IP6_POST_ROUTING))) != 0) { +- printk("xt_TCPMSS: path-MTU clamping only supported in " ++ ve_printk(VE_LOG, "xt_TCPMSS: path-MTU clamping only supported in " + "FORWARD, OUTPUT and POSTROUTING hooks\n"); + return false; + } + if (IP6T_MATCH_ITERATE(e, find_syn_match)) + return true; +- printk("xt_TCPMSS: Only works on TCP SYN packets\n"); ++ ve_printk(VE_LOG, "xt_TCPMSS: Only works on TCP SYN packets\n"); + return false; + } + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/xt_hashlimit.c debian/binary-custom.d/openvz/src/net/netfilter/xt_hashlimit.c +--- ./net/netfilter/xt_hashlimit.c 2012-06-12 16:25:24.490312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/xt_hashlimit.c 2012-11-13 15:20:15.772569055 +0000 +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -36,8 +37,13 @@ + MODULE_ALIAS("ip6t_hashlimit"); + + /* need to declare this at the top */ ++#ifdef CONFIG_VE_IPTABLES ++#define hashlimit_procdir4 (get_exec_env()->_xt_hashlimit->hashlimit_procdir4) ++#define hashlimit_procdir6 (get_exec_env()->_xt_hashlimit->hashlimit_procdir6) ++#else + static struct proc_dir_entry *hashlimit_procdir4; + static struct proc_dir_entry *hashlimit_procdir6; ++#endif + static const struct file_operations dl_file_ops; + + /* hash table crap */ +@@ -92,7 +98,11 @@ + + static DEFINE_SPINLOCK(hashlimit_lock); /* protects htables list */ + static DEFINE_MUTEX(hlimit_mutex); /* additional checkentry protection */ ++#ifdef CONFIG_VE_IPTABLES ++#define hashlimit_htables (get_exec_env()->_xt_hashlimit->hashlimit_htables) ++#else + static HLIST_HEAD(hashlimit_htables); ++#endif + static struct kmem_cache *hashlimit_cachep __read_mostly; + + static inline bool dst_cmp(const struct dsthash_ent *ent, +@@ -440,6 +450,9 @@ + return 0; + } + ++static int init_xt_hashlimit(struct ve_struct *ve); ++static void fini_xt_hashlimit(struct ve_struct *ve); ++ + static bool + hashlimit_match(const struct sk_buff *skb, + const struct net_device *in, +@@ -528,6 +541,9 @@ + if (r->name[sizeof(r->name) - 1] != '\0') + return false; + ++ if (init_xt_hashlimit(get_exec_env())) ++ return 0; ++ + /* This is the best we've got: We cannot release and re-grab lock, + * since checkentry() is called before x_tables.c grabs xt_mutex. + * We also cannot grab the hashtable spinlock, since htable_create will +@@ -553,6 +569,8 @@ + const struct xt_hashlimit_info *r = matchinfo; + + htable_put(r->hinfo); ++ if (!ve_is_super(get_exec_env()) && hlist_empty(&hashlimit_htables)) ++ fini_xt_hashlimit(get_exec_env()); + } + + #ifdef CONFIG_COMPAT +@@ -728,6 +746,59 @@ + .release = seq_release + }; + ++static int init_xt_hashlimit(struct ve_struct *ve) ++{ ++ struct proc_dir_entry *proc_net = ve->ve_netns->proc_net; ++ ++#if defined(CONFIG_VE_IPTABLES) ++ if (ve->_xt_hashlimit) ++ return 0; ++ ++ ve->_xt_hashlimit = kzalloc(sizeof(struct ve_xt_hashlimit), GFP_KERNEL); ++ if (!ve->_xt_hashlimit) ++ goto err1; ++#endif ++ INIT_HLIST_HEAD(&hashlimit_htables); ++ ++ hashlimit_procdir4 = proc_mkdir("ipt_hashlimit", proc_net); ++ if (!hashlimit_procdir4) { ++ printk(KERN_ERR "xt_hashlimit: unable to create proc dir " ++ "entry\n"); ++ goto err2; ++ } ++ hashlimit_procdir6 = proc_mkdir("ip6t_hashlimit", proc_net); ++ if (!hashlimit_procdir6) { ++ printk(KERN_ERR "xt_hashlimit: unable to create proc dir " ++ "entry\n"); ++ goto err3; ++ } ++ ++ return 0; ++ ++err3: ++ remove_proc_entry("ipt_hashlimit", proc_net); ++err2: ++#if defined(CONFIG_VE_IPTABLES) ++ kfree(ve->_xt_hashlimit); ++ ve->_xt_hashlimit = NULL; ++#endif ++err1: ++ return -ENOMEM; ++} ++ ++static void fini_xt_hashlimit(struct ve_struct *ve) ++{ ++ struct proc_dir_entry *proc_net = ve->ve_netns->proc_net; ++ ++ remove_proc_entry("ip6t_hashlimit", proc_net); ++ remove_proc_entry("ipt_hashlimit", proc_net); ++ ++#if defined(CONFIG_VE_IPTABLES) ++ kfree(ve->_xt_hashlimit); ++ ve->_xt_hashlimit = NULL; ++#endif ++} ++ + static int __init xt_hashlimit_init(void) + { + int err; +@@ -744,21 +815,10 @@ + printk(KERN_ERR "xt_hashlimit: unable to create slab cache\n"); + goto err2; + } +- hashlimit_procdir4 = proc_mkdir("ipt_hashlimit", init_net.proc_net); +- if (!hashlimit_procdir4) { +- printk(KERN_ERR "xt_hashlimit: unable to create proc dir " +- "entry\n"); ++ err = init_xt_hashlimit(get_exec_env()); ++ if (err) + goto err3; +- } +- hashlimit_procdir6 = proc_mkdir("ip6t_hashlimit", init_net.proc_net); +- if (!hashlimit_procdir6) { +- printk(KERN_ERR "xt_hashlimit: unable to create proc dir " +- "entry\n"); +- goto err4; +- } + return 0; +-err4: +- remove_proc_entry("ipt_hashlimit", init_net.proc_net); + err3: + kmem_cache_destroy(hashlimit_cachep); + err2: +@@ -770,8 +830,7 @@ + + static void __exit xt_hashlimit_fini(void) + { +- remove_proc_entry("ipt_hashlimit", init_net.proc_net); +- remove_proc_entry("ip6t_hashlimit", init_net.proc_net); ++ fini_xt_hashlimit(get_exec_env()); + kmem_cache_destroy(hashlimit_cachep); + xt_unregister_matches(xt_hashlimit, ARRAY_SIZE(xt_hashlimit)); + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netfilter/xt_limit.c debian/binary-custom.d/openvz/src/net/netfilter/xt_limit.c +--- ./net/netfilter/xt_limit.c 2012-06-12 16:25:24.490312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/netfilter/xt_limit.c 2012-11-13 15:20:15.776569055 +0000 +@@ -111,7 +111,7 @@ + /* Check for overflow. */ + if (r->burst == 0 + || user2credits(r->avg * r->burst) < user2credits(r->avg)) { +- printk("Overflow in xt_limit, try lower: %u/%u\n", ++ ve_printk(VE_LOG, "Overflow in xt_limit, try lower: %u/%u\n", + r->avg, r->burst); + return false; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netlink/af_netlink.c debian/binary-custom.d/openvz/src/net/netlink/af_netlink.c +--- ./net/netlink/af_netlink.c 2012-06-12 16:25:24.494312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/netlink/af_netlink.c 2012-11-13 15:20:15.784569051 +0000 +@@ -61,29 +61,14 @@ + #include + #include + #include ++#include ++ ++#include ++#include + + #define NLGRPSZ(x) (ALIGN(x, sizeof(unsigned long) * 8) / 8) + #define NLGRPLONGS(x) (NLGRPSZ(x)/sizeof(unsigned long)) + +-struct netlink_sock { +- /* struct sock has to be the first member of netlink_sock */ +- struct sock sk; +- u32 pid; +- u32 dst_pid; +- u32 dst_group; +- u32 flags; +- u32 subscriptions; +- u32 ngroups; +- unsigned long *groups; +- unsigned long state; +- wait_queue_head_t wait; +- struct netlink_callback *cb; +- struct mutex *cb_mutex; +- struct mutex cb_def_mutex; +- void (*netlink_rcv)(struct sk_buff *skb); +- struct module *module; +-}; +- + #define NETLINK_KERNEL_SOCKET 0x1 + #define NETLINK_RECV_PKTINFO 0x2 + +@@ -225,7 +210,7 @@ + read_lock(&nl_table_lock); + head = nl_pid_hashfn(hash, pid); + sk_for_each(sk, node, head) { +- if ((sk->sk_net == net) && (nlk_sk(sk)->pid == pid)) { ++ if (nlk_sk(sk)->pid == pid && sk->sk_net == net) { + sock_hold(sk); + goto found; + } +@@ -345,7 +330,8 @@ + head = nl_pid_hashfn(hash, pid); + len = 0; + sk_for_each(osk, node, head) { +- if ((osk->sk_net == net) && (nlk_sk(osk)->pid == pid)) ++ if ((osk->sk_net == net) && (nlk_sk(osk)->pid == pid) && ++ ve_accessible_strict(osk->owner_env, get_exec_env())) + break; + len++; + } +@@ -399,6 +385,8 @@ + sk = sk_alloc(net, PF_NETLINK, GFP_KERNEL, &netlink_proto); + if (!sk) + return -ENOMEM; ++ if (ub_other_sock_charge(sk)) ++ goto out_free; + + sock_init_data(sock, sk); + +@@ -414,6 +402,10 @@ + sk->sk_destruct = netlink_sock_destruct; + sk->sk_protocol = protocol; + return 0; ++ ++out_free: ++ sk_free(sk); ++ return -ENOMEM; + } + + static int netlink_create(struct net *net, struct socket *sock, int protocol) +@@ -494,9 +486,12 @@ + + netlink_table_grab(); + if (netlink_is_kernel(sk)) { +- kfree(nl_table[sk->sk_protocol].listeners); +- nl_table[sk->sk_protocol].module = NULL; +- nl_table[sk->sk_protocol].registered = 0; ++ BUG_ON(nl_table[sk->sk_protocol].registered == 0); ++ if (--nl_table[sk->sk_protocol].registered == 0) { ++ kfree(nl_table[sk->sk_protocol].listeners); ++ nl_table[sk->sk_protocol].module = NULL; ++ nl_table[sk->sk_protocol].registered = 0; ++ } + } else if (nlk->subscriptions) + netlink_update_listeners(sk); + netlink_table_ungrab(); +@@ -516,7 +511,7 @@ + struct hlist_head *head; + struct sock *osk; + struct hlist_node *node; +- s32 pid = current->tgid; ++ s32 pid = task_tgid_vnr(current); + int err; + static s32 rover = -4097; + +@@ -527,6 +522,8 @@ + sk_for_each(osk, node, head) { + if ((osk->sk_net != net)) + continue; ++ if (!ve_accessible_strict(osk->owner_env, get_exec_env())) ++ continue; + if (nlk_sk(osk)->pid == pid) { + /* Bind collision, search negative pid values. */ + pid = rover--; +@@ -552,7 +549,7 @@ + static inline int netlink_capable(struct socket *sock, unsigned int flag) + { + return (nl_table[sock->sk->sk_protocol].nl_nonroot & flag) || +- capable(CAP_NET_ADMIN); ++ capable(CAP_VE_NET_ADMIN); + } + + static void +@@ -755,12 +752,20 @@ + long *timeo, struct sock *ssk) + { + struct netlink_sock *nlk; ++ unsigned long chargesize; ++ int no_ubc; + + nlk = nlk_sk(sk); + +- if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || ++ chargesize = skb_charge_fullsize(skb); ++ no_ubc = ub_sock_getwres_other(sk, chargesize); ++ if (no_ubc || atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || + test_bit(0, &nlk->state)) { + DECLARE_WAITQUEUE(wait, current); ++ ++ if (!no_ubc) ++ ub_sock_retwres_other(sk, chargesize, ++ SOCK_MIN_UBCSPACE_CH); + if (!*timeo) { + if (!ssk || netlink_is_kernel(ssk)) + netlink_overrun(sk); +@@ -772,13 +777,20 @@ + __set_current_state(TASK_INTERRUPTIBLE); + add_wait_queue(&nlk->wait, &wait); + ++ /* this if can't be moved upper because ub_sock_snd_queue_add() ++ * may change task state to TASK_RUNNING */ ++ if (no_ubc) ++ ub_sock_sndqueueadd_other(sk, chargesize); ++ + if ((atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || +- test_bit(0, &nlk->state)) && ++ test_bit(0, &nlk->state) || no_ubc) && + !sock_flag(sk, SOCK_DEAD)) + *timeo = schedule_timeout(*timeo); + + __set_current_state(TASK_RUNNING); + remove_wait_queue(&nlk->wait, &wait); ++ if (no_ubc) ++ ub_sock_sndqueuedel(sk); + sock_put(sk); + + if (signal_pending(current)) { +@@ -788,6 +800,7 @@ + return 1; + } + skb_set_owner_r(skb, sk); ++ ub_skb_set_charge(skb, sk, chargesize, UB_OTHERSOCKBUF); + return 0; + } + +@@ -944,7 +957,7 @@ + !test_bit(p->group - 1, nlk->groups)) + goto out; + +- if ((sk->sk_net != p->net)) ++ if (!ve_accessible_strict(get_exec_env(), sk->owner_env)) + goto out; + + if (p->failure) { +@@ -1049,6 +1062,9 @@ + !test_bit(p->group - 1, nlk->groups)) + goto out; + ++ if (!ve_accessible_strict(get_exec_env(), sk->owner_env)) ++ goto out; ++ + sk->sk_err = p->code; + sk->sk_error_report(sk); + out: +@@ -1350,8 +1366,17 @@ + if (sock_create_lite(PF_NETLINK, SOCK_DGRAM, unit, &sock)) + return NULL; + +- if (__netlink_create(net, sock, cb_mutex, unit) < 0) +- goto out_sock_release; ++ /* ++ * We have to just have a reference on the net from sk, but don't ++ * get_net it. Besides, we cannot get and then put the net here. ++ * So we create one inside init_net and the move it to net. ++ */ ++ ++ if (__netlink_create(&init_net, sock, cb_mutex, unit) < 0) ++ goto out_sock_release_nosk; ++ ++ sk = sock->sk; ++ sk_change_net(sk, net); + + if (groups < 32) + groups = 32; +@@ -1360,7 +1385,6 @@ + if (!listeners) + goto out_sock_release; + +- sk = sock->sk; + sk->sk_data_ready = netlink_data_ready; + if (input) + nlk_sk(sk)->netlink_rcv = input; +@@ -1380,17 +1404,30 @@ + nl_table[unit].registered = 1; + } else { + kfree(listeners); ++ nl_table[unit].registered++; + } + netlink_table_ungrab(); +- + return sk; + + out_sock_release: + kfree(listeners); ++ netlink_kernel_release(sk); ++ return NULL; ++ ++out_sock_release_nosk: + sock_release(sock); + return NULL; + } + ++ ++void ++netlink_kernel_release(struct sock *sk) ++{ ++ sk_release_kernel(sk); ++} ++EXPORT_SYMBOL(netlink_kernel_release); ++ ++ + /** + * netlink_change_ngroups - change number of multicast groups + * +@@ -1485,6 +1522,10 @@ + skb = sock_rmalloc(sk, NLMSG_GOODSIZE, 0, GFP_KERNEL); + if (!skb) + goto errout; ++ if (ub_nlrcvbuf_charge(skb, sk) < 0) { ++ kfree_skb(skb); ++ return -EACCES; ++ } + + mutex_lock(nlk->cb_mutex); + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netlink/attr.c debian/binary-custom.d/openvz/src/net/netlink/attr.c +--- ./net/netlink/attr.c 2012-06-12 16:25:24.494312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/netlink/attr.c 2012-11-13 15:20:15.784569051 +0000 +@@ -163,7 +163,7 @@ + } + + if (unlikely(rem > 0)) +- printk(KERN_WARNING "netlink: %d bytes leftover after parsing " ++ ve_printk(VE_LOG, KERN_WARNING "netlink: %d bytes leftover after parsing " + "attributes.\n", rem); + + err = 0; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/netlink/genetlink.c debian/binary-custom.d/openvz/src/net/netlink/genetlink.c +--- ./net/netlink/genetlink.c 2012-06-12 16:25:24.494312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/netlink/genetlink.c 2012-11-13 15:20:15.784569051 +0000 +@@ -439,7 +439,7 @@ + return -EOPNOTSUPP; + + if ((ops->flags & GENL_ADMIN_PERM) && +- security_netlink_recv(skb, CAP_NET_ADMIN)) ++ security_netlink_recv(skb, CAP_VE_NET_ADMIN)) + return -EPERM; + + if (nlh->nlmsg_flags & NLM_F_DUMP) { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/packet/af_packet.c debian/binary-custom.d/openvz/src/net/packet/af_packet.c +--- ./net/packet/af_packet.c 2012-06-12 16:25:24.498312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/packet/af_packet.c 2012-11-13 15:20:15.784569051 +0000 +@@ -51,6 +51,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -80,6 +81,8 @@ + #include + #include + ++#include ++ + #ifdef CONFIG_INET + #include + #endif +@@ -246,9 +249,6 @@ + struct sock *sk; + struct sockaddr_pkt *spkt; + +- if (dev->nd_net != &init_net) +- goto out; +- + /* + * When we registered the protocol we saved the socket in the data + * field for just this event. +@@ -267,7 +267,8 @@ + * so that this procedure is noop. + */ + +- if (skb->pkt_type == PACKET_LOOPBACK) ++ if (skb->pkt_type == PACKET_LOOPBACK || ++ !ve_accessible(skb->owner_env, sk->owner_env)) + goto out; + + if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) +@@ -341,7 +342,7 @@ + */ + + saddr->spkt_device[13] = 0; +- dev = dev_get_by_name(&init_net, saddr->spkt_device); ++ dev = dev_get_by_name(current->nsproxy->net_ns, saddr->spkt_device); + err = -ENODEV; + if (dev == NULL) + goto out_unlock; +@@ -449,15 +450,17 @@ + int skb_len = skb->len; + unsigned int snaplen, res; + +- if (dev->nd_net != &init_net) +- goto drop; +- + if (skb->pkt_type == PACKET_LOOPBACK) + goto drop; + + sk = pt->af_packet_priv; + po = pkt_sk(sk); + ++ if (!ve_accessible(skb->owner_env, sk->owner_env)) ++ goto drop; ++ ++ skb_orphan(skb); ++ + skb->dev = dev; + + if (dev->header_ops) { +@@ -521,6 +524,9 @@ + if (pskb_trim(skb, snaplen)) + goto drop_n_acct; + ++ if (ub_sockrcvbuf_charge(sk, skb)) ++ goto drop_n_acct; ++ + skb_set_owner_r(skb, sk); + skb->dev = NULL; + dst_release(skb->dst); +@@ -566,15 +572,17 @@ + struct sk_buff *copy_skb = NULL; + struct timeval tv; + +- if (dev->nd_net != &init_net) +- goto drop; +- + if (skb->pkt_type == PACKET_LOOPBACK) + goto drop; + + sk = pt->af_packet_priv; + po = pkt_sk(sk); + ++ if (!ve_accessible(skb->owner_env, sk->owner_env)) ++ goto drop; ++ ++ skb_orphan(skb); ++ + if (dev->header_ops) { + if (sk->sk_type != SOCK_DGRAM) + skb_push(skb, skb->data - skb_mac_header(skb)); +@@ -621,6 +629,12 @@ + snaplen = 0; + } + ++ if (copy_skb && ++ ub_sockrcvbuf_charge(sk, copy_skb)) { ++ spin_lock(&sk->sk_receive_queue.lock); ++ goto ring_is_full; ++ } ++ + spin_lock(&sk->sk_receive_queue.lock); + h = packet_lookup_frame(po, po->head); + +@@ -732,7 +746,7 @@ + } + + +- dev = dev_get_by_index(&init_net, ifindex); ++ dev = dev_get_by_index(current->nsproxy->net_ns, ifindex); + err = -ENXIO; + if (dev == NULL) + goto out_unlock; +@@ -916,7 +930,7 @@ + return -EINVAL; + strlcpy(name,uaddr->sa_data,sizeof(name)); + +- dev = dev_get_by_name(&init_net, name); ++ dev = dev_get_by_name(current->nsproxy->net_ns, name); + if (dev) { + err = packet_do_bind(sk, dev, pkt_sk(sk)->num); + dev_put(dev); +@@ -943,7 +957,7 @@ + + if (sll->sll_ifindex) { + err = -ENODEV; +- dev = dev_get_by_index(&init_net, sll->sll_ifindex); ++ dev = dev_get_by_index(current->nsproxy->net_ns, sll->sll_ifindex); + if (dev == NULL) + goto out; + } +@@ -972,9 +986,6 @@ + __be16 proto = (__force __be16)protocol; /* weird, but documented */ + int err; + +- if (net != &init_net) +- return -EAFNOSUPPORT; +- + if (!capable(CAP_NET_RAW)) + return -EPERM; + if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW && +@@ -987,6 +998,8 @@ + sk = sk_alloc(net, PF_PACKET, GFP_KERNEL, &packet_proto); + if (sk == NULL) + goto out; ++ if (ub_other_sock_charge(sk)) ++ goto out_free; + + sock->ops = &packet_ops; + if (sock->type == SOCK_PACKET) +@@ -1024,6 +1037,9 @@ + sk_add_node(sk, &packet_sklist); + write_unlock_bh(&packet_sklist_lock); + return(0); ++ ++out_free: ++ sk_free(sk); + out: + return err; + } +@@ -1140,7 +1156,7 @@ + return -EOPNOTSUPP; + + uaddr->sa_family = AF_PACKET; +- dev = dev_get_by_index(&init_net, pkt_sk(sk)->ifindex); ++ dev = dev_get_by_index(current->nsproxy->net_ns, pkt_sk(sk)->ifindex); + if (dev) { + strncpy(uaddr->sa_data, dev->name, 14); + dev_put(dev); +@@ -1166,7 +1182,7 @@ + sll->sll_ifindex = po->ifindex; + sll->sll_protocol = po->num; + sll->sll_pkttype = 0; +- dev = dev_get_by_index(&init_net, po->ifindex); ++ dev = dev_get_by_index(current->nsproxy->net_ns, po->ifindex); + if (dev) { + sll->sll_hatype = dev->type; + sll->sll_halen = dev->addr_len; +@@ -1218,7 +1234,7 @@ + rtnl_lock(); + + err = -ENODEV; +- dev = __dev_get_by_index(&init_net, mreq->mr_ifindex); ++ dev = __dev_get_by_index(current->nsproxy->net_ns, mreq->mr_ifindex); + if (!dev) + goto done; + +@@ -1272,7 +1288,7 @@ + if (--ml->count == 0) { + struct net_device *dev; + *mlp = ml->next; +- dev = dev_get_by_index(&init_net, ml->ifindex); ++ dev = dev_get_by_index(current->nsproxy->net_ns, ml->ifindex); + if (dev) { + packet_dev_mc(dev, ml, -1); + dev_put(dev); +@@ -1300,7 +1316,7 @@ + struct net_device *dev; + + po->mclist = ml->next; +- if ((dev = dev_get_by_index(&init_net, ml->ifindex)) != NULL) { ++ if ((dev = dev_get_by_index(current->nsproxy->net_ns, ml->ifindex)) != NULL) { + packet_dev_mc(dev, ml, -1); + dev_put(dev); + } +@@ -1456,14 +1472,16 @@ + struct sock *sk; + struct hlist_node *node; + struct net_device *dev = data; ++ struct ve_struct *ve; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- ++ ve = get_exec_env(); + read_lock(&packet_sklist_lock); + sk_for_each(sk, node, &packet_sklist) { + struct packet_sock *po = pkt_sk(sk); + ++ if (!ve_accessible_strict(sk->owner_env, ve)) ++ continue; ++ + switch (msg) { + case NETDEV_UNREGISTER: + if (po->mclist) +@@ -1869,6 +1887,8 @@ + struct hlist_node *node; + + sk_for_each(s, node, &packet_sklist) { ++ if (!ve_accessible(s->owner_env, get_exec_env())) ++ continue; + if (!off--) + return s; + } +@@ -1884,9 +1904,14 @@ + static void *packet_seq_next(struct seq_file *seq, void *v, loff_t *pos) + { + ++*pos; +- return (v == SEQ_START_TOKEN) +- ? sk_head(&packet_sklist) +- : sk_next((struct sock*)v) ; ++ do { ++ v = (v == SEQ_START_TOKEN) ++ ? sk_head(&packet_sklist) ++ : sk_next((struct sock*)v); ++ } while (v != NULL && ++ !ve_accessible(((struct sock*)v)->owner_env, ++ get_exec_env())); ++ return v; + } + + static void packet_seq_stop(struct seq_file *seq, void *v) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sched/act_api.c debian/binary-custom.d/openvz/src/net/sched/act_api.c +--- ./net/sched/act_api.c 2012-06-12 16:25:24.506312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/sched/act_api.c 2012-11-13 15:20:15.796569053 +0000 +@@ -658,7 +658,7 @@ + return -EINVAL; + } + +- return rtnl_unicast(skb, pid); ++ return rtnl_unicast(skb, &init_net, pid); + } + + static struct tc_action * +@@ -779,7 +779,7 @@ + nlh->nlmsg_flags |= NLM_F_ROOT; + module_put(a->ops->owner); + kfree(a); +- err = rtnetlink_send(skb, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO); ++ err = rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO); + if (err > 0) + return 0; + +@@ -842,7 +842,7 @@ + + /* now do the delete */ + tcf_action_destroy(head, 0); +- ret = rtnetlink_send(skb, pid, RTNLGRP_TC, ++ ret = rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, + n->nlmsg_flags&NLM_F_ECHO); + if (ret > 0) + return 0; +@@ -886,7 +886,7 @@ + nlh->nlmsg_len = skb_tail_pointer(skb) - b; + NETLINK_CB(skb).dst_group = RTNLGRP_TC; + +- err = rtnetlink_send(skb, pid, RTNLGRP_TC, flags&NLM_F_ECHO); ++ err = rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, flags&NLM_F_ECHO); + if (err > 0) + err = 0; + return err; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sched/cls_api.c debian/binary-custom.d/openvz/src/net/sched/cls_api.c +--- ./net/sched/cls_api.c 2012-06-12 16:25:24.506312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/sched/cls_api.c 2012-11-13 15:20:15.800569054 +0000 +@@ -355,7 +355,7 @@ + return -EINVAL; + } + +- return rtnetlink_send(skb, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO); ++ return rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO); + } + + struct tcf_dump_args +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sched/sch_api.c debian/binary-custom.d/openvz/src/net/sched/sch_api.c +--- ./net/sched/sch_api.c 2012-06-12 16:25:24.510312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/sched/sch_api.c 2012-11-13 15:20:15.800569054 +0000 +@@ -868,7 +868,7 @@ + } + + if (skb->len) +- return rtnetlink_send(skb, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO); ++ return rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO); + + err_out: + kfree_skb(skb); +@@ -1093,7 +1093,7 @@ + return -EINVAL; + } + +- return rtnetlink_send(skb, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO); ++ return rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO); + } + + struct qdisc_dump_args +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sched/sch_cbq.c debian/binary-custom.d/openvz/src/net/sched/sch_cbq.c +--- ./net/sched/sch_cbq.c 2012-06-12 16:25:24.510312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/sched/sch_cbq.c 2012-11-13 15:20:15.804569054 +0000 +@@ -905,8 +905,8 @@ + + if (cl->deficit <= 0) { + q->active[prio] = cl; +- cl = cl->next_alive; + cl->deficit += cl->quantum; ++ cl = cl->next_alive; + } + return skb; + +@@ -1078,17 +1078,19 @@ + + for (h=0; h<16; h++) { + for (cl = q->classes[h]; cl; cl = cl->next) { ++ long mtu; + /* BUGGGG... Beware! This expression suffer of + arithmetic overflows! + */ + if (cl->priority == prio) { +- cl->quantum = (cl->weight*cl->allot*q->nclasses[prio])/ +- q->quanta[prio]; +- } +- if (cl->quantum <= 0 || cl->quantum>32*cl->qdisc->dev->mtu) { +- printk(KERN_WARNING "CBQ: class %08x has bad quantum==%ld, repaired.\n", cl->classid, cl->quantum); +- cl->quantum = cl->qdisc->dev->mtu/2 + 1; ++ cl->quantum = (cl->weight * cl->allot) / ++ (q->quanta[prio] / q->nclasses[prio]); + } ++ mtu = cl->qdisc->dev->mtu; ++ if (cl->quantum <= mtu/2) ++ cl->quantum = mtu/2 + 1; ++ else if (cl->quantum > 32*mtu) ++ cl->quantum = 32*mtu; + } + } + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sched/sch_generic.c debian/binary-custom.d/openvz/src/net/sched/sch_generic.c +--- ./net/sched/sch_generic.c 2012-06-12 16:25:24.510312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/sched/sch_generic.c 2012-11-13 15:20:15.804569054 +0000 +@@ -135,11 +135,13 @@ + struct Qdisc *q = dev->qdisc; + struct sk_buff *skb; + int ret = NETDEV_TX_BUSY; ++ struct ve_struct *old_ve; + + /* Dequeue packet */ + if (unlikely((skb = dev_dequeue_skb(dev, q)) == NULL)) + return 0; + ++ old_ve = set_exec_env(skb->owner_env); + + /* And release queue */ + spin_unlock(&dev->queue_lock); +@@ -173,6 +175,8 @@ + break; + } + ++ (void)set_exec_env(old_ve); ++ + return ret; + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sched/sch_teql.c debian/binary-custom.d/openvz/src/net/sched/sch_teql.c +--- ./net/sched/sch_teql.c 2012-06-12 16:25:24.514312479 +0100 ++++ debian/binary-custom.d/openvz/src/net/sched/sch_teql.c 2012-11-13 15:20:15.808569052 +0000 +@@ -174,6 +174,9 @@ + struct teql_master *m = (struct teql_master*)sch->ops; + struct teql_sched_data *q = qdisc_priv(sch); + ++ if (!capable(CAP_NET_ADMIN)) ++ return -EPERM; ++ + if (dev->hard_header_len > m->dev->hard_header_len) + return -EINVAL; + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/socket.c debian/binary-custom.d/openvz/src/net/socket.c +--- ./net/socket.c 2012-06-12 16:25:24.526312478 +0100 ++++ debian/binary-custom.d/openvz/src/net/socket.c 2012-11-13 15:20:15.824569052 +0000 +@@ -84,6 +84,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -155,15 +156,6 @@ + * divide and look after the messy bits. + */ + +-#define MAX_SOCK_ADDR 128 /* 108 for Unix domain - +- 16 for IP, 16 for IPX, +- 24 for IPv6, +- about 80 for AX.25 +- must be at least one bigger than +- the AF_UNIX size (see net/unix/af_unix.c +- :unix_mkname()). +- */ +- + /** + * move_addr_to_kernel - copy a socket address into kernel space + * @uaddr: Address in user space +@@ -492,6 +484,8 @@ + return sock; + } + ++EXPORT_SYMBOL(sock_alloc); ++ + /* + * In theory you can't get an open on this inode, but /proc provides + * a back door. Remember to keep it shut otherwise you'll let the +@@ -519,6 +513,9 @@ + + void sock_release(struct socket *sock) + { ++ if (sock->sk) ++ ub_sock_sndqueuedel(sock->sk); ++ + if (sock->ops) { + struct module *owner = sock->ops->owner; + +@@ -739,7 +736,6 @@ + if (iocb->ki_left == 0) /* Match SYS5 behaviour */ + return 0; + +- + x = alloc_sock_iocb(iocb, &siocb); + if (!x) + return -ENOMEM; +@@ -1076,6 +1072,48 @@ + return 0; + } + ++int vz_security_family_check(int family) ++{ ++#ifdef CONFIG_VE ++ if (ve_is_super(get_exec_env())) ++ return 0; ++ ++ switch (family) { ++ case PF_UNSPEC: ++ case PF_PACKET: ++ case PF_NETLINK: ++ case PF_UNIX: ++ case PF_INET: ++ case PF_INET6: ++ break; ++ default: ++ return -EAFNOSUPPORT; ++ } ++#endif ++ return 0; ++} ++EXPORT_SYMBOL_GPL(vz_security_family_check); ++ ++int vz_security_protocol_check(int protocol) ++{ ++#ifdef CONFIG_VE ++ if (ve_is_super(get_exec_env())) ++ return 0; ++ ++ switch (protocol) { ++ case IPPROTO_IP: ++ case IPPROTO_TCP: ++ case IPPROTO_UDP: ++ case IPPROTO_RAW: ++ break; ++ default: ++ return -EAFNOSUPPORT; ++ } ++#endif ++ return 0; ++} ++EXPORT_SYMBOL_GPL(vz_security_protocol_check); ++ + static int __sock_create(struct net *net, int family, int type, int protocol, + struct socket **res, int kern) + { +@@ -1106,6 +1144,11 @@ + family = PF_PACKET; + } + ++ /* VZ compatibility layer */ ++ err = vz_security_family_check(family); ++ if (err < 0) ++ return err; ++ + err = security_socket_create(family, type, protocol, kern); + if (err) + return err; +@@ -2317,9 +2360,12 @@ + { + mm_segment_t oldfs = get_fs(); + int err; ++ struct ve_struct *old_env; + + set_fs(KERNEL_DS); ++ old_env = set_exec_env(sock->sk->owner_env); + err = sock->ops->ioctl(sock, cmd, arg); ++ (void)set_exec_env(old_env); + set_fs(oldfs); + + return err; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sunrpc/clnt.c debian/binary-custom.d/openvz/src/net/sunrpc/clnt.c +--- ./net/sunrpc/clnt.c 2012-06-12 16:25:24.538312478 +0100 ++++ debian/binary-custom.d/openvz/src/net/sunrpc/clnt.c 2012-11-13 15:20:15.832569053 +0000 +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -88,6 +89,35 @@ + spin_unlock(&rpc_client_lock); + } + ++/* ++ * Grand abort timeout (stop the client if occures) ++ */ ++int xprt_abort_timeout = RPC_MAX_ABORT_TIMEOUT; ++ ++static int rpc_abort_hard(struct rpc_task *task) ++{ ++ struct rpc_clnt *clnt; ++ clnt = task->tk_client; ++ ++ if (clnt->cl_pr_time == 0) { ++ clnt->cl_pr_time = jiffies; ++ return 0; ++ } ++ if (xprt_abort_timeout == RPC_MAX_ABORT_TIMEOUT) ++ return 0; ++ if (time_before(jiffies, clnt->cl_pr_time + xprt_abort_timeout * HZ)) ++ return 0; ++ ++ clnt->cl_broken = 1; ++ rpc_killall_tasks(clnt); ++ return -ETIMEDOUT; ++} ++ ++static void rpc_abort_clear(struct rpc_task *task) ++{ ++ task->tk_client->cl_pr_time = 0; ++} ++ + static int + rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name) + { +@@ -253,6 +283,7 @@ + if (IS_ERR(xprt)) + return (struct rpc_clnt *)xprt; + ++ xprt->owner_env = get_ve(get_exec_env()); + /* + * If the caller chooses not to specify a hostname, whip + * up a string representation of the passed-in address. +@@ -277,13 +308,16 @@ + + clnt = rpc_new_client(xprt, args->servername, args->program, + args->version, args->authflavor); +- if (IS_ERR(clnt)) ++ if (IS_ERR(clnt)) { ++ put_ve(xprt->owner_env); + return clnt; ++ } + + if (!(args->flags & RPC_CLNT_CREATE_NOPING)) { + int err = rpc_ping(clnt, RPC_TASK_SOFT|RPC_TASK_NOINTR); + if (err != 0) { + rpc_shutdown_client(clnt); ++ put_ve(xprt->owner_env); + return ERR_PTR(err); + } + } +@@ -322,6 +356,7 @@ + new->cl_autobind = 0; + INIT_LIST_HEAD(&new->cl_tasks); + spin_lock_init(&new->cl_lock); ++ new->cl_broken = 0; + rpc_init_rtt(&new->cl_rtt_default, clnt->cl_xprt->timeout.to_initval); + new->cl_metrics = rpc_alloc_iostats(clnt); + if (new->cl_metrics == NULL) +@@ -528,6 +563,9 @@ + struct rpc_task *task, *ret; + sigset_t oldset; + ++ if (clnt->cl_broken) ++ return ERR_PTR(-EIO); ++ + task = rpc_new_task(clnt, flags, ops, data); + if (task == NULL) { + rpc_release_calldata(ops, data); +@@ -944,6 +982,7 @@ + + if (task->tk_status >= 0) { + dprint_status(task); ++ rpc_abort_clear(task); + task->tk_status = 0; + task->tk_action = call_connect; + return; +@@ -972,6 +1011,10 @@ + case -ETIMEDOUT: + dprintk("RPC: %5u rpcbind request timed out\n", + task->tk_pid); ++ if (rpc_abort_hard(task)) { ++ status = -EIO; ++ break; ++ } + goto retry_timeout; + case -EPFNOSUPPORT: + /* server doesn't support any rpcbind version we know of */ +@@ -1037,6 +1080,8 @@ + + /* Something failed: remote service port may have changed */ + rpc_force_rebind(clnt); ++ if (rpc_abort_hard(task)) ++ goto exit; + + switch (status) { + case -ENOTCONN: +@@ -1049,6 +1094,7 @@ + task->tk_action = call_timeout; + return; + } ++exit: + rpc_exit(task, -EIO); + } + +@@ -1179,7 +1225,7 @@ + dprintk("RPC: %5u call_timeout (major)\n", task->tk_pid); + task->tk_timeouts++; + +- if (RPC_IS_SOFT(task)) { ++ if (RPC_IS_SOFT(task) || rpc_abort_hard(task)) { + printk(KERN_NOTICE "%s: server %s not responding, timed out\n", + clnt->cl_protname, clnt->cl_server); + rpc_exit(task, -EIO); +@@ -1220,7 +1266,7 @@ + } + + if (task->tk_status < 12) { +- if (!RPC_IS_SOFT(task)) { ++ if (!RPC_IS_SOFT(task) && !rpc_abort_hard(task)) { + task->tk_action = call_bind; + clnt->cl_stats->rpcretrans++; + goto out_retry; +@@ -1231,6 +1277,7 @@ + goto out_retry; + } + ++ rpc_abort_clear(task); + /* + * Ensure that we see all writes made by xprt_complete_rqst() + * before it changed req->rq_received. +@@ -1566,3 +1613,67 @@ + spin_unlock(&rpc_client_lock); + } + #endif ++ ++#ifdef CONFIG_VE ++static int ve_sunrpc_start(void *data) ++{ ++ return 0; ++} ++ ++void ve_sunrpc_stop(void *data) ++{ ++ struct ve_struct *ve = (struct ve_struct *)data; ++ struct rpc_clnt *clnt; ++ struct rpc_task *rovr; ++ ++ dprintk("RPC: killing all tasks for VE %d\n", ve->veid); ++ ++ spin_lock(&rpc_client_lock); ++ list_for_each_entry(clnt, &all_clients, cl_clients) { ++ if (clnt->cl_xprt->owner_env != ve) ++ continue; ++ ++ spin_lock(&clnt->cl_lock); ++ list_for_each_entry(rovr, &clnt->cl_tasks, tk_task) { ++ if (!RPC_IS_ACTIVATED(rovr)) ++ continue; ++ printk(KERN_WARNING "RPC: Killing task %d client %p\n", ++ rovr->tk_pid, clnt); ++ ++ rovr->tk_flags |= RPC_TASK_KILLED; ++ rpc_exit(rovr, -EIO); ++ rpc_wake_up_task(rovr); ++ } ++ schedule_work(&clnt->cl_xprt->task_cleanup); ++ spin_unlock(&clnt->cl_lock); ++ } ++ spin_unlock(&rpc_client_lock); ++ ++ flush_scheduled_work(); ++} ++ ++static struct ve_hook sunrpc_hook = { ++ .init = ve_sunrpc_start, ++ .fini = ve_sunrpc_stop, ++ .owner = THIS_MODULE, ++ .priority = HOOK_PRIO_NET_PRE, ++}; ++ ++void ve_sunrpc_hook_register(void) ++{ ++ ve_hook_register(VE_SS_CHAIN, &sunrpc_hook); ++} ++ ++void ve_sunrpc_hook_unregister(void) ++{ ++ ve_hook_unregister(&sunrpc_hook); ++} ++#else ++void ve_sunrpc_hook_register(void) ++{ ++} ++ ++void ve_sunrpc_hook_unregister(void) ++{ ++} ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sunrpc/rpc_pipe.c debian/binary-custom.d/openvz/src/net/sunrpc/rpc_pipe.c +--- ./net/sunrpc/rpc_pipe.c 2012-06-12 16:25:24.538312478 +0100 ++++ debian/binary-custom.d/openvz/src/net/sunrpc/rpc_pipe.c 2012-11-13 15:20:15.836569051 +0000 +@@ -839,6 +839,7 @@ + .name = "rpc_pipefs", + .get_sb = rpc_get_sb, + .kill_sb = kill_litter_super, ++ .fs_flags = FS_VIRTUALIZED, + }; + + static void +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sunrpc/sched.c debian/binary-custom.d/openvz/src/net/sunrpc/sched.c +--- ./net/sunrpc/sched.c 2012-06-12 16:25:24.538312478 +0100 ++++ debian/binary-custom.d/openvz/src/net/sunrpc/sched.c 2012-11-13 15:20:15.836569051 +0000 +@@ -631,7 +631,9 @@ + static void __rpc_execute(struct rpc_task *task) + { + int status = 0; ++ struct ve_struct *env; + ++ env = set_exec_env(task->tk_client->cl_xprt->owner_env); + dprintk("RPC: %5u __rpc_execute flags=0x%x\n", + task->tk_pid, task->tk_flags); + +@@ -681,10 +683,14 @@ + rpc_clear_running(task); + if (RPC_IS_ASYNC(task)) { + /* Careful! we may have raced... */ +- if (RPC_IS_QUEUED(task)) ++ if (RPC_IS_QUEUED(task)) { ++ (void)set_exec_env(env); + return; +- if (rpc_test_and_set_running(task)) ++ } ++ if (rpc_test_and_set_running(task)) { ++ (void)set_exec_env(env); + return; ++ } + continue; + } + +@@ -714,6 +720,7 @@ + task->tk_status); + /* Release all resources associated with the task */ + rpc_release_task(task); ++ (void)set_exec_env(env); + } + + /* +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sunrpc/sunrpc_syms.c debian/binary-custom.d/openvz/src/net/sunrpc/sunrpc_syms.c +--- ./net/sunrpc/sunrpc_syms.c 2012-06-12 16:25:24.538312478 +0100 ++++ debian/binary-custom.d/openvz/src/net/sunrpc/sunrpc_syms.c 2012-11-13 15:20:15.836569051 +0000 +@@ -132,6 +132,9 @@ + + extern struct cache_detail ip_map_cache, unix_gid_cache; + ++extern void ve_sunrpc_hook_register(void); ++extern void ve_sunrpc_hook_unregister(void); ++ + static int __init + init_sunrpc(void) + { +@@ -153,6 +156,7 @@ + cache_register(&unix_gid_cache); + init_socket_xprt(); + rpcauth_init_module(); ++ ve_sunrpc_hook_register(); + out: + return err; + } +@@ -160,6 +164,7 @@ + static void __exit + cleanup_sunrpc(void) + { ++ ve_sunrpc_hook_unregister(); + rpcauth_remove_module(); + cleanup_socket_xprt(); + unregister_rpc_pipefs(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sunrpc/svcsock.c debian/binary-custom.d/openvz/src/net/sunrpc/svcsock.c +--- ./net/sunrpc/svcsock.c 2012-06-12 16:25:24.542312478 +0100 ++++ debian/binary-custom.d/openvz/src/net/sunrpc/svcsock.c 2012-11-13 15:20:15.836569051 +0000 +@@ -508,6 +508,9 @@ + unsigned int pglen = xdr->page_len; + unsigned int flags = MSG_MORE; + char buf[RPC_MAX_ADDRBUFLEN]; ++ struct ve_struct *old_env; ++ ++ old_env = set_exec_env(sock->sk->owner_env); + + slen = xdr->len; + +@@ -568,6 +571,8 @@ + rqstp->rq_sock, xdr->head[0].iov_base, xdr->head[0].iov_len, + xdr->len, len, svc_print_addr(rqstp, buf, sizeof(buf))); + ++ (void)set_exec_env(old_env); ++ + return len; + } + +@@ -642,14 +647,18 @@ + svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen) + { + struct svc_sock *svsk = rqstp->rq_sock; ++ struct socket *sock = svsk->sk_sock; + struct msghdr msg = { + .msg_flags = MSG_DONTWAIT, + }; + struct sockaddr *sin; + int len; ++ struct ve_struct *old_env; + ++ old_env = set_exec_env(sock->sk->owner_env); + len = kernel_recvmsg(svsk->sk_sock, &msg, iov, nr, buflen, + msg.msg_flags); ++ (void)set_exec_env(old_env); + + /* sock_recvmsg doesn't fill in the name/namelen, so we must.. + */ +@@ -1795,6 +1804,8 @@ + serv = svsk->sk_server; + sk = svsk->sk_sk; + ++ /* XXX: serialization? */ ++ sk->sk_user_data = NULL; + sk->sk_state_change = svsk->sk_ostate; + sk->sk_data_ready = svsk->sk_odata; + sk->sk_write_space = svsk->sk_owspace; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sunrpc/xprt.c debian/binary-custom.d/openvz/src/net/sunrpc/xprt.c +--- ./net/sunrpc/xprt.c 2012-06-12 16:25:24.542312478 +0100 ++++ debian/binary-custom.d/openvz/src/net/sunrpc/xprt.c 2012-11-13 15:20:15.840569049 +0000 +@@ -567,10 +567,13 @@ + { + struct rpc_xprt *xprt = + container_of(work, struct rpc_xprt, task_cleanup); ++ struct ve_struct *ve; + ++ ve = set_exec_env(xprt->owner_env); + xprt_disconnect(xprt); + xprt->ops->close(xprt); + xprt_release_write(xprt, NULL); ++ (void)set_exec_env(ve); + } + + /** +@@ -1017,6 +1020,7 @@ + xprt->last_used = jiffies; + xprt->cwnd = RPC_INITCWND; + xprt->bind_index = 0; ++ xprt->owner_env = get_exec_env(); + + rpc_init_wait_queue(&xprt->binding, "xprt_binding"); + rpc_init_wait_queue(&xprt->pending, "xprt_pending"); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/sunrpc/xprtsock.c debian/binary-custom.d/openvz/src/net/sunrpc/xprtsock.c +--- ./net/sunrpc/xprtsock.c 2012-06-12 16:25:24.546312477 +0100 ++++ debian/binary-custom.d/openvz/src/net/sunrpc/xprtsock.c 2012-11-13 15:20:15.844569048 +0000 +@@ -64,6 +64,8 @@ + static unsigned int max_slot_table_size = RPC_MAX_SLOT_TABLE; + static unsigned int xprt_min_resvport_limit = RPC_MIN_RESVPORT; + static unsigned int xprt_max_resvport_limit = RPC_MAX_RESVPORT; ++static int xprt_min_abort_timeout = RPC_MIN_ABORT_TIMEOUT; ++static int xprt_max_abort_timeout = RPC_MAX_ABORT_TIMEOUT; + + static struct ctl_table_header *sunrpc_table_header; + +@@ -117,6 +119,16 @@ + .extra2 = &xprt_max_resvport_limit + }, + { ++ .procname = "abort_timeout", ++ .data = &xprt_abort_timeout, ++ .maxlen = sizeof(unsigned int), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec_minmax, ++ .strategy = &sysctl_intvec, ++ .extra1 = &xprt_min_abort_timeout, ++ .extra2 = &xprt_max_abort_timeout ++ }, ++ { + .ctl_name = 0, + }, + }; +@@ -735,18 +747,23 @@ + static void xs_close(struct rpc_xprt *xprt) + { + struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); +- struct socket *sock = transport->sock; +- struct sock *sk = transport->inet; +- +- if (!sk) +- goto clear_close_wait; ++ struct socket *sock; ++ struct sock *sk; + + dprintk("RPC: xs_close xprt %p\n", xprt); + +- write_lock_bh(&sk->sk_callback_lock); ++ spin_lock_bh(&xprt->transport_lock); ++ if (transport->sock == NULL) { ++ spin_unlock_bh(&xprt->transport_lock); ++ goto clear_close_wait; ++ } ++ sock = transport->sock; ++ sk = transport->inet; + transport->inet = NULL; + transport->sock = NULL; ++ spin_unlock_bh(&xprt->transport_lock); + ++ write_lock_bh(&sk->sk_callback_lock); + sk->sk_user_data = NULL; + sk->sk_data_ready = transport->old_data_ready; + sk->sk_state_change = transport->old_state_change; +@@ -1415,7 +1432,12 @@ + struct rpc_xprt *xprt = &transport->xprt; + struct socket *sock = transport->sock; + int err, status = -EIO; ++ struct ve_struct *ve; + ++ ve = set_exec_env(xprt->owner_env); ++ down_read(&xprt->owner_env->op_sem); ++ if (!xprt->owner_env->is_running) ++ goto out; + if (xprt->shutdown || !xprt_bound(xprt)) + goto out; + +@@ -1441,6 +1463,8 @@ + out: + xprt_wake_pending_tasks(xprt, status); + xprt_clear_connecting(xprt); ++ up_read(&xprt->owner_env->op_sem); ++ (void)set_exec_env(ve); + } + + /** +@@ -1456,7 +1480,12 @@ + struct rpc_xprt *xprt = &transport->xprt; + struct socket *sock = transport->sock; + int err, status = -EIO; ++ struct ve_struct *ve; + ++ ve = set_exec_env(xprt->owner_env); ++ down_read(&xprt->owner_env->op_sem); ++ if (!xprt->owner_env->is_running) ++ goto out; + if (xprt->shutdown || !xprt_bound(xprt)) + goto out; + +@@ -1482,6 +1511,8 @@ + out: + xprt_wake_pending_tasks(xprt, status); + xprt_clear_connecting(xprt); ++ up_read(&xprt->owner_env->op_sem); ++ (void)set_exec_env(ve); + } + + /* +@@ -1560,7 +1591,12 @@ + struct rpc_xprt *xprt = &transport->xprt; + struct socket *sock = transport->sock; + int err, status = -EIO; ++ struct ve_struct *ve; + ++ ve = set_exec_env(xprt->owner_env); ++ down_read(&xprt->owner_env->op_sem); ++ if (!xprt->owner_env->is_running) ++ goto out; + if (xprt->shutdown || !xprt_bound(xprt)) + goto out; + +@@ -1606,6 +1642,8 @@ + xprt_wake_pending_tasks(xprt, status); + out_clear: + xprt_clear_connecting(xprt); ++ up_read(&xprt->owner_env->op_sem); ++ (void)set_exec_env(ve); + } + + /** +@@ -1621,7 +1659,12 @@ + struct rpc_xprt *xprt = &transport->xprt; + struct socket *sock = transport->sock; + int err, status = -EIO; ++ struct ve_struct *ve; + ++ ve = set_exec_env(xprt->owner_env); ++ down_read(&xprt->owner_env->op_sem); ++ if (!xprt->owner_env->is_running) ++ goto out; + if (xprt->shutdown || !xprt_bound(xprt)) + goto out; + +@@ -1666,6 +1709,8 @@ + xprt_wake_pending_tasks(xprt, status); + out_clear: + xprt_clear_connecting(xprt); ++ up_read(&xprt->owner_env->op_sem); ++ (void)set_exec_env(ve); + } + + /** +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/unix/af_unix.c debian/binary-custom.d/openvz/src/net/unix/af_unix.c +--- ./net/unix/af_unix.c 2012-06-12 16:25:24.554312477 +0100 ++++ debian/binary-custom.d/openvz/src/net/unix/af_unix.c 2012-11-13 15:20:15.856569052 +0000 +@@ -117,6 +117,9 @@ + #include + #include + ++#include ++#include ++ + int sysctl_unix_max_dgram_qlen __read_mostly = 10; + + static struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; +@@ -270,7 +273,8 @@ + spin_unlock(&unix_table_lock); + } + +-static struct sock *__unix_find_socket_byname(struct sockaddr_un *sunname, ++static struct sock *__unix_find_socket_byname(struct net *net, ++ struct sockaddr_un *sunname, + int len, int type, unsigned hash) + { + struct sock *s; +@@ -279,6 +283,9 @@ + sk_for_each(s, node, &unix_socket_table[hash ^ type]) { + struct unix_sock *u = unix_sk(s); + ++ if (s->sk_net != net) ++ continue; ++ + if (u->addr->len == len && + !memcmp(u->addr->name, sunname, len)) + goto found; +@@ -288,21 +295,22 @@ + return s; + } + +-static inline struct sock *unix_find_socket_byname(struct sockaddr_un *sunname, ++static inline struct sock *unix_find_socket_byname(struct net *net, ++ struct sockaddr_un *sunname, + int len, int type, + unsigned hash) + { + struct sock *s; + + spin_lock(&unix_table_lock); +- s = __unix_find_socket_byname(sunname, len, type, hash); ++ s = __unix_find_socket_byname(net, sunname, len, type, hash); + if (s) + sock_hold(s); + spin_unlock(&unix_table_lock); + return s; + } + +-static struct sock *unix_find_socket_byinode(struct inode *i) ++static struct sock *unix_find_socket_byinode(struct net *net, struct inode *i) + { + struct sock *s; + struct hlist_node *node; +@@ -312,6 +320,9 @@ + &unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) { + struct dentry *dentry = unix_sk(s)->dentry; + ++ if (s->sk_net != net) ++ continue; ++ + if(dentry && dentry->d_inode == i) + { + sock_hold(s); +@@ -606,6 +617,8 @@ + sk = sk_alloc(net, PF_UNIX, GFP_KERNEL, &unix_proto); + if (!sk) + goto out; ++ if (ub_other_sock_charge(sk)) ++ goto out_sk_free; + + sock_init_data(sock,sk); + lockdep_set_class(&sk->sk_receive_queue.lock, +@@ -627,13 +640,13 @@ + if (sk == NULL) + atomic_dec(&unix_nr_socks); + return sk; ++out_sk_free: ++ sk_free(sk); ++ return NULL; + } + + static int unix_create(struct net *net, struct socket *sock, int protocol) + { +- if (net != &init_net) +- return -EAFNOSUPPORT; +- + if (protocol && protocol != PF_UNIX) + return -EPROTONOSUPPORT; + +@@ -677,6 +690,7 @@ + static int unix_autobind(struct socket *sock) + { + struct sock *sk = sock->sk; ++ struct net *net = sk->sk_net; + struct unix_sock *u = unix_sk(sk); + static u32 ordernum = 1; + struct unix_address * addr; +@@ -703,7 +717,7 @@ + spin_lock(&unix_table_lock); + ordernum = (ordernum+1)&0xFFFFF; + +- if (__unix_find_socket_byname(addr->name, addr->len, sock->type, ++ if (__unix_find_socket_byname(net, addr->name, addr->len, sock->type, + addr->hash)) { + spin_unlock(&unix_table_lock); + /* Sanity yield. It is unusual case, but yet... */ +@@ -723,7 +737,8 @@ + return err; + } + +-static struct sock *unix_find_other(struct sockaddr_un *sunname, int len, ++static struct sock *unix_find_other(struct net *net, ++ struct sockaddr_un *sunname, int len, + int type, unsigned hash, int *error) + { + struct sock *u; +@@ -741,7 +756,7 @@ + err = -ECONNREFUSED; + if (!S_ISSOCK(nd.dentry->d_inode->i_mode)) + goto put_fail; +- u=unix_find_socket_byinode(nd.dentry->d_inode); ++ u=unix_find_socket_byinode(net, nd.dentry->d_inode); + if (!u) + goto put_fail; + +@@ -757,7 +772,7 @@ + } + } else { + err = -ECONNREFUSED; +- u=unix_find_socket_byname(sunname, len, type, hash); ++ u=unix_find_socket_byname(net, sunname, len, type, hash); + if (u) { + struct dentry *dentry; + dentry = unix_sk(u)->dentry; +@@ -779,6 +794,7 @@ + static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) + { + struct sock *sk = sock->sk; ++ struct net *net = sk->sk_net; + struct unix_sock *u = unix_sk(sk); + struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr; + struct dentry * dentry = NULL; +@@ -853,7 +869,7 @@ + + if (!sunaddr->sun_path[0]) { + err = -EADDRINUSE; +- if (__unix_find_socket_byname(sunaddr, addr_len, ++ if (__unix_find_socket_byname(net, sunaddr, addr_len, + sk->sk_type, hash)) { + unix_release_addr(addr); + goto out_unlock; +@@ -919,6 +935,7 @@ + int alen, int flags) + { + struct sock *sk = sock->sk; ++ struct net *net = sk->sk_net; + struct sockaddr_un *sunaddr=(struct sockaddr_un*)addr; + struct sock *other; + unsigned hash; +@@ -935,7 +952,7 @@ + goto out; + + restart: +- other=unix_find_other(sunaddr, alen, sock->type, hash, &err); ++ other=unix_find_other(net, sunaddr, alen, sock->type, hash, &err); + if (!other) + goto out; + +@@ -1015,6 +1032,7 @@ + { + struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr; + struct sock *sk = sock->sk; ++ struct net *net = sk->sk_net; + struct unix_sock *u = unix_sk(sk), *newu, *otheru; + struct sock *newsk = NULL; + struct sock *other = NULL; +@@ -1023,6 +1041,7 @@ + int st; + int err; + long timeo; ++ unsigned long chargesize; + + err = unix_mkname(sunaddr, addr_len, &hash); + if (err < 0) +@@ -1051,10 +1070,14 @@ + skb = sock_wmalloc(newsk, 1, 0, GFP_KERNEL); + if (skb == NULL) + goto out; ++ chargesize = skb_charge_fullsize(skb); ++ if (ub_sock_getwres_other(newsk, chargesize) < 0) ++ goto out; ++ ub_skb_set_charge(skb, newsk, chargesize, UB_OTHERSOCKBUF); + + restart: + /* Find listening sock. */ +- other = unix_find_other(sunaddr, addr_len, sk->sk_type, hash, &err); ++ other = unix_find_other(net, sunaddr, addr_len, sk->sk_type, hash, &err); + if (!other) + goto out; + +@@ -1301,7 +1324,7 @@ + unix_notinflight(scm->fp->fp[i]); + } + +-static void unix_destruct_fds(struct sk_buff *skb) ++void unix_destruct_fds(struct sk_buff *skb) + { + struct scm_cookie scm; + memset(&scm, 0, sizeof(scm)); +@@ -1312,6 +1335,7 @@ + scm_destroy(&scm); + sock_wfree(skb); + } ++EXPORT_SYMBOL_GPL(unix_destruct_fds); + + static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb) + { +@@ -1341,6 +1365,7 @@ + { + struct sock_iocb *siocb = kiocb_to_siocb(kiocb); + struct sock *sk = sock->sk; ++ struct net *net = sk->sk_net; + struct unix_sock *u = unix_sk(sk); + struct sockaddr_un *sunaddr=msg->msg_name; + struct sock *other = NULL; +@@ -1408,7 +1433,7 @@ + if (sunaddr == NULL) + goto out_free; + +- other = unix_find_other(sunaddr, namelen, sk->sk_type, ++ other = unix_find_other(net, sunaddr, namelen, sk->sk_type, + hash, &err); + if (other==NULL) + goto out_free; +@@ -1538,6 +1563,16 @@ + + size = len-sent; + ++ if (msg->msg_flags & MSG_DONTWAIT) ++ ub_sock_makewres_other(sk, skb_charge_size(size)); ++ if (sock_bc(sk) != NULL && ++ sock_bc(sk)->poll_reserv >= ++ SOCK_MIN_UBCSPACE && ++ skb_charge_size(size) > ++ sock_bc(sk)->poll_reserv) ++ size = skb_charge_datalen(sock_bc(sk)->poll_reserv); ++ ++ + /* Keep two messages in the pipe so it schedules better */ + if (size > ((sk->sk_sndbuf >> 1) - 64)) + size = (sk->sk_sndbuf >> 1) - 64; +@@ -1549,7 +1584,9 @@ + * Grab a buffer + */ + +- skb=sock_alloc_send_skb(sk,size,msg->msg_flags&MSG_DONTWAIT, &err); ++ ++ skb = sock_alloc_send_skb2(sk, size, SOCK_MIN_UBCSPACE, ++ msg->msg_flags&MSG_DONTWAIT, &err); + + if (skb==NULL) + goto out_err; +@@ -1994,6 +2031,7 @@ + { + struct sock *sk = sock->sk; + unsigned int mask; ++ int no_ub_res; + + poll_wait(file, sk->sk_sleep, wait); + mask = 0; +@@ -2006,6 +2044,10 @@ + if (sk->sk_shutdown & RCV_SHUTDOWN) + mask |= POLLRDHUP; + ++ no_ub_res = ub_sock_makewres_other(sk, SOCK_MIN_UBCSPACE_CH); ++ if (no_ub_res) ++ ub_sock_sndqueueadd_other(sk, SOCK_MIN_UBCSPACE_CH); ++ + /* readable? */ + if (!skb_queue_empty(&sk->sk_receive_queue) || + (sk->sk_shutdown & RCV_SHUTDOWN)) +@@ -2019,7 +2061,7 @@ + * we set writable also when the other side has shut down the + * connection. This prevents stuck sockets. + */ +- if (unix_writable(sk)) ++ if (!no_ub_res && unix_writable(sk)) + mask |= POLLOUT | POLLWRNORM | POLLWRBAND; + + return mask; +@@ -2027,12 +2069,18 @@ + + + #ifdef CONFIG_PROC_FS +-static struct sock *unix_seq_idx(int *iter, loff_t pos) ++struct unix_iter_state { ++ struct net *net; ++ int i; ++}; ++static struct sock *unix_seq_idx(struct unix_iter_state *iter, loff_t pos) + { + loff_t off = 0; + struct sock *s; + +- for (s = first_unix_socket(iter); s; s = next_unix_socket(iter, s)) { ++ for (s = first_unix_socket(&iter->i); s; s = next_unix_socket(&iter->i, s)) { ++ if (s->sk_net != iter->net) ++ continue; + if (off == pos) + return s; + ++off; +@@ -2043,17 +2091,24 @@ + + static void *unix_seq_start(struct seq_file *seq, loff_t *pos) + { ++ struct unix_iter_state *iter = seq->private; + spin_lock(&unix_table_lock); +- return *pos ? unix_seq_idx(seq->private, *pos - 1) : ((void *) 1); ++ return *pos ? unix_seq_idx(iter, *pos - 1) : ((void *) 1); + } + + static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos) + { ++ struct unix_iter_state *iter = seq->private; ++ struct sock *sk = v; + ++*pos; + + if (v == (void *)1) +- return first_unix_socket(seq->private); +- return next_unix_socket(seq->private, v); ++ sk = first_unix_socket(&iter->i); ++ else ++ sk = next_unix_socket(&iter->i, sk); ++ while (sk && (sk->sk_net != iter->net)) ++ sk = next_unix_socket(&iter->i, sk); ++ return sk; + } + + static void unix_seq_stop(struct seq_file *seq, void *v) +@@ -2115,7 +2170,27 @@ + + static int unix_seq_open(struct inode *inode, struct file *file) + { +- return seq_open_private(file, &unix_seq_ops, sizeof(int)); ++ struct unix_iter_state *it; ++ ++ it = __seq_open_private(file, &unix_seq_ops, ++ sizeof(struct unix_iter_state)); ++ if (it == NULL) ++ return -ENOMEM; ++ ++ it->net = get_proc_net(inode); ++ if (it->net == NULL) { ++ seq_release_private(inode, file); ++ return -ENXIO; ++ } ++ return 0; ++} ++ ++static int unix_seq_release(struct inode *inode, struct file *file) ++{ ++ struct seq_file *seq = file->private_data; ++ struct unix_iter_state *iter = seq->private; ++ put_net(iter->net); ++ return seq_release_private(inode, file); + } + + static const struct file_operations unix_seq_fops = { +@@ -2123,7 +2198,7 @@ + .open = unix_seq_open, + .read = seq_read, + .llseek = seq_lseek, +- .release = seq_release_private, ++ .release = unix_seq_release, + }; + + #endif +@@ -2134,6 +2209,30 @@ + .owner = THIS_MODULE, + }; + ++ ++static int unix_net_init(struct net *net) ++{ ++ int error = -ENOMEM; ++ ++#ifdef CONFIG_PROC_FS ++ if (!proc_net_fops_create(net, "unix", 0, &unix_seq_fops)) ++ goto out; ++#endif ++ error = 0; ++out: ++ return 0; ++} ++ ++static void unix_net_exit(struct net *net) ++{ ++ proc_net_remove(net, "unix"); ++} ++ ++static struct pernet_operations unix_net_ops = { ++ .init = unix_net_init, ++ .exit = unix_net_exit, ++}; ++ + static int __init af_unix_init(void) + { + int rc = -1; +@@ -2149,9 +2248,7 @@ + } + + sock_register(&unix_family_ops); +-#ifdef CONFIG_PROC_FS +- proc_net_fops_create(&init_net, "unix", 0, &unix_seq_fops); +-#endif ++ register_pernet_subsys(&unix_net_ops); + unix_sysctl_register(); + out: + return rc; +@@ -2161,8 +2258,8 @@ + { + sock_unregister(PF_UNIX); + unix_sysctl_unregister(); +- proc_net_remove(&init_net, "unix"); + proto_unregister(&unix_proto); ++ unregister_pernet_subsys(&unix_net_ops); + } + + module_init(af_unix_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/unix/garbage.c debian/binary-custom.d/openvz/src/net/unix/garbage.c +--- ./net/unix/garbage.c 2012-06-12 16:25:24.554312477 +0100 ++++ debian/binary-custom.d/openvz/src/net/unix/garbage.c 2012-11-13 15:20:15.856569052 +0000 +@@ -81,6 +81,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -153,6 +154,7 @@ + spin_unlock(&unix_gc_lock); + } + } ++EXPORT_SYMBOL_GPL(unix_notinflight); + + static inline struct sk_buff *sock_queue_head(struct sock *sk) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/wireless/wext.c debian/binary-custom.d/openvz/src/net/wireless/wext.c +--- ./net/wireless/wext.c 2012-06-12 16:25:24.562312477 +0100 ++++ debian/binary-custom.d/openvz/src/net/wireless/wext.c 2012-11-13 15:20:15.864569050 +0000 +@@ -1137,7 +1137,7 @@ + struct sk_buff *skb; + + while ((skb = skb_dequeue(&wireless_nlevent_queue))) +- rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); ++ rtnl_notify(skb, &init_net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); + } + + static DECLARE_TASKLET(wireless_nlevent_tasklet, wireless_nlevent_process, 0); +@@ -1189,6 +1189,9 @@ + struct sk_buff *skb; + int err; + ++ if (dev->nd_net != &init_net) ++ return; ++ + skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); + if (!skb) + return; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/xfrm/xfrm_policy.c debian/binary-custom.d/openvz/src/net/xfrm/xfrm_policy.c +--- ./net/xfrm/xfrm_policy.c 2012-06-12 16:25:24.566312477 +0100 ++++ debian/binary-custom.d/openvz/src/net/xfrm/xfrm_policy.c 2012-11-13 15:20:15.868569048 +0000 +@@ -1793,7 +1793,7 @@ + void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev) + { + while ((dst = dst->child) && dst->xfrm && dst->dev == dev) { +- dst->dev = init_net.loopback_dev; ++ dst->dev = dev->nd_net->loopback_dev; + dev_hold(dst->dev); + dev_put(dev); + } +@@ -2066,9 +2066,6 @@ + { + struct net_device *dev = ptr; + +- if (dev->nd_net != &init_net) +- return NOTIFY_DONE; +- + switch (event) { + case NETDEV_DOWN: + xfrm_flush_bundles(); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./net/xfrm/xfrm_user.c debian/binary-custom.d/openvz/src/net/xfrm/xfrm_user.c +--- ./net/xfrm/xfrm_user.c 2012-06-12 16:25:24.570312477 +0100 ++++ debian/binary-custom.d/openvz/src/net/xfrm/xfrm_user.c 2012-11-13 15:20:15.868569048 +0000 +@@ -1865,7 +1865,7 @@ + link = &xfrm_dispatch[type]; + + /* All operations require privileges, even GET */ +- if (security_netlink_recv(skb, CAP_NET_ADMIN)) ++ if (security_netlink_recv(skb, CAP_VE_NET_ADMIN)) + return -EPERM; + + if ((type == (XFRM_MSG_GETSA - XFRM_MSG_BASE) || +@@ -2420,7 +2420,7 @@ + xfrm_unregister_km(&netlink_mgr); + rcu_assign_pointer(xfrm_nl, NULL); + synchronize_rcu(); +- sock_release(nlsk->sk_socket); ++ netlink_kernel_release(nlsk); + } + + module_init(xfrm_user_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./security/Kconfig debian/binary-custom.d/openvz/src/security/Kconfig +--- ./security/Kconfig 2012-06-12 16:25:24.590312476 +0100 ++++ debian/binary-custom.d/openvz/src/security/Kconfig 2012-11-13 15:20:15.900569046 +0000 +@@ -4,6 +4,8 @@ + + menu "Security options" + ++source grsecurity/Kconfig ++ + config KEYS + bool "Enable access key retention support" + help +@@ -41,7 +43,7 @@ + + config SECURITY + bool "Enable different security models" +- depends on SYSFS ++ depends on SYSFS && !VE + help + This allows you to choose different security modules to be + configured into your kernel. +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./security/commoncap.c debian/binary-custom.d/openvz/src/security/commoncap.c +--- ./security/commoncap.c 2012-06-12 16:25:24.590312476 +0100 ++++ debian/binary-custom.d/openvz/src/security/commoncap.c 2012-11-13 15:20:15.900569046 +0000 +@@ -36,8 +36,10 @@ + # define CAP_INIT_BSET CAP_INIT_EFF_SET + #endif /* def CONFIG_SECURITY_FILE_CAPABILITIES */ + ++#ifndef CONFIG_VE + kernel_cap_t cap_bset = CAP_INIT_BSET; /* systemwide capability bound */ + EXPORT_SYMBOL(cap_bset); ++#endif + + /* Global security state */ + +@@ -52,6 +54,10 @@ + + int cap_netlink_recv(struct sk_buff *skb, int cap) + { ++ if (likely(cap == CAP_VE_NET_ADMIN) && ++ cap_raised(NETLINK_CB(skb).eff_cap, CAP_NET_ADMIN)) ++ return 0; ++ + if (!cap_raised(NETLINK_CB(skb).eff_cap, cap)) + return -EPERM; + return 0; +@@ -384,7 +390,7 @@ + return 0; + } else if (!strncmp(name, XATTR_SECURITY_PREFIX, + sizeof(XATTR_SECURITY_PREFIX) - 1) && +- !capable(CAP_SYS_ADMIN)) ++ !capable(CAP_SYS_ADMIN) && !capable(CAP_VE_ADMIN)) + return -EPERM; + return 0; + } +@@ -398,7 +404,7 @@ + return 0; + } else if (!strncmp(name, XATTR_SECURITY_PREFIX, + sizeof(XATTR_SECURITY_PREFIX) - 1) && +- !capable(CAP_SYS_ADMIN)) ++ !capable(CAP_SYS_ADMIN) && !capable(CAP_VE_ADMIN)) + return -EPERM; + return 0; + } +@@ -555,7 +561,7 @@ + + int cap_syslog (int type) + { +- if ((type != 3 && type != 10) && !capable(CAP_SYS_ADMIN)) ++ if ((type != 3 && type != 10) && !capable(CAP_VE_SYS_ADMIN)) + return -EPERM; + return 0; + } +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./security/selinux/Kconfig debian/binary-custom.d/openvz/src/security/selinux/Kconfig +--- ./security/selinux/Kconfig 2012-06-12 16:25:24.598312476 +0100 ++++ debian/binary-custom.d/openvz/src/security/selinux/Kconfig 2012-11-13 15:20:15.908569049 +0000 +@@ -1,6 +1,6 @@ + config SECURITY_SELINUX + bool "NSA SELinux Support" +- depends on SECURITY_NETWORK && AUDIT && NET && INET ++ depends on SECURITY_NETWORK && AUDIT && NET && INET && !VE + select NETWORK_SECMARK + default n + help +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./security/selinux/hooks.c debian/binary-custom.d/openvz/src/security/selinux/hooks.c +--- ./security/selinux/hooks.c 2012-06-12 16:25:24.598312476 +0100 ++++ debian/binary-custom.d/openvz/src/security/selinux/hooks.c 2012-11-13 15:20:15.912569050 +0000 +@@ -4676,12 +4676,12 @@ + struct task_struct *g, *t; + struct mm_struct *mm = p->mm; + read_lock(&tasklist_lock); +- do_each_thread(g, t) ++ do_each_thread_ve(g, t) + if (t->mm == mm && t != p) { + read_unlock(&tasklist_lock); + return -EPERM; + } +- while_each_thread(g, t); ++ while_each_thread_ve(g, t); + read_unlock(&tasklist_lock); + } + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./sound/core/info.c debian/binary-custom.d/openvz/src/sound/core/info.c +--- ./sound/core/info.c 2012-06-12 16:25:24.610312475 +0100 ++++ debian/binary-custom.d/openvz/src/sound/core/info.c 2012-11-13 15:20:15.928569045 +0000 +@@ -545,7 +545,7 @@ + { + struct proc_dir_entry *p; + +- p = snd_create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, &proc_root); ++ p = snd_create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL); + if (p == NULL) + return -ENOMEM; + snd_proc_root = p; +@@ -595,7 +595,7 @@ + #ifdef CONFIG_SND_OSSEMUL + snd_info_free_entry(snd_oss_root); + #endif +- snd_remove_proc_entry(&proc_root, snd_proc_root); ++ snd_remove_proc_entry(NULL, snd_proc_root); + } + return 0; + } --- linux-2.6.24.orig/debian/binary-custom.d/xen/vars +++ linux-2.6.24/debian/binary-custom.d/xen/vars @@ -0,0 +1,7 @@ +arch="i386 amd64" +supported="Generic" +target="Xen domO/domU" +desc="This kernel can be used for Xen dom0 and domU" +bootloader="grub" +provides="kvm-api-4, redhat-cluster-modules" +section_image="universe/base" --- linux-2.6.24.orig/debian/binary-custom.d/xen/rules +++ linux-2.6.24/debian/binary-custom.d/xen/rules @@ -0,0 +1,4 @@ +# Some overrides + +build_image_xen = vmlinuz +kernel_file_xen = $(build_image_xen) --- linux-2.6.24.orig/debian/binary-custom.d/xen/config.amd64 +++ linux-2.6.24/debian/binary-custom.d/xen/config.amd64 @@ -0,0 +1,3814 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.24-16-xen +# Wed Apr 9 14:26:53 2008 +# +CONFIG_64BIT=y +# CONFIG_X86_32 is not set +CONFIG_X86_64=y +CONFIG_X86=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_SEMAPHORE_SLEEPERS=y +CONFIG_MMU=y +CONFIG_ZONE_DMA=y +# CONFIG_QUICKLIST is not set +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_DMI=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_ARCH_SUPPORTS_OPROFILE=y +CONFIG_ZONE_DMA32=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_AUDIT_ARCH=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_X86_NO_TSS=y +CONFIG_X86_NO_IDT=y +# CONFIG_KTIME_SCALAR is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-generic" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +# CONFIG_USER_NS is not set +# CONFIG_PID_NS is not set +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_TREE=y +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_CGROUPS is not set +CONFIG_FAIR_GROUP_SCHED=y +CONFIG_FAIR_USER_SCHED=y +# CONFIG_FAIR_CGROUP_SCHED is not set +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_RELAY=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_BLK_DEV_IO_TRACE=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_BLOCK_COMPAT=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +CONFIG_LSM_MMAP_MIN_ADDR=0 + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" + +# +# Processor type and features +# +# CONFIG_TICK_ONESHOT is not set +CONFIG_SMP=y +# CONFIG_X86_PC is not set +# CONFIG_X86_XEN is not set +# CONFIG_X86_ELAN is not set +# CONFIG_X86_VOYAGER is not set +# CONFIG_X86_NUMAQ is not set +# CONFIG_X86_SUMMIT is not set +# CONFIG_X86_BIGSMP is not set +# CONFIG_X86_VISWS is not set +# CONFIG_X86_GENERICARCH is not set +# CONFIG_X86_ES7000 is not set +CONFIG_X86_64_XEN=y +# CONFIG_X86_VSMP is not set +# CONFIG_M386 is not set +# CONFIG_M486 is not set +# CONFIG_M586 is not set +# CONFIG_M586TSC is not set +# CONFIG_M586MMX is not set +# CONFIG_M686 is not set +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MPENTIUM4 is not set +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MEFFICEON is not set +# CONFIG_MWINCHIPC6 is not set +# CONFIG_MWINCHIP2 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +# CONFIG_MCYRIXIII is not set +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set +# CONFIG_MPSC is not set +# CONFIG_MCORE2 is not set +CONFIG_GENERIC_CPU=y +CONFIG_X86_L1_CACHE_BYTES=128 +CONFIG_X86_INTERNODE_CACHE_BYTES=128 +CONFIG_X86_CMPXCHG=y +CONFIG_X86_L1_CACHE_SHIFT=7 +CONFIG_X86_GOOD_APIC=y +CONFIG_X86_MINIMUM_CPU_FAMILY=64 +CONFIG_SWIOTLB=y +CONFIG_NR_CPUS=8 +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_BKL=y +CONFIG_X86_LOCAL_APIC=y +CONFIG_X86_IO_APIC=y +CONFIG_X86_XEN_GENAPIC=y +CONFIG_MICROCODE=m +CONFIG_MICROCODE_OLD_INTERFACE=y +CONFIG_X86_MSR=m +CONFIG_X86_CPUID=m +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_RESOURCES_64BIT=y +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_BOUNCE=y +CONFIG_VIRT_TO_BUS=y +CONFIG_MTRR=y +CONFIG_SECCOMP=y +CONFIG_CC_STACKPROTECTOR=y +# CONFIG_CC_STACKPROTECTOR_ALL is not set +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_300 is not set +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_KEXEC=y +CONFIG_CRASH_DUMP=y +CONFIG_PHYSICAL_START=0x200000 +CONFIG_PHYSICAL_ALIGN=0x200000 +CONFIG_HOTPLUG_CPU=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y + +# +# Power management options +# +CONFIG_PM=y +CONFIG_PM_LEGACY=y +CONFIG_PM_DEBUG=y +# CONFIG_PM_VERBOSE is not set +CONFIG_PM_TRACE=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PM_SLEEP=y +CONFIG_SUSPEND_SMP_POSSIBLE=y +CONFIG_SUSPEND=y +CONFIG_PM_DISABLE_CONSOLE=y +CONFIG_ACPI=y +CONFIG_ACPI_SLEEP=y +CONFIG_ACPI_PROCFS=y +CONFIG_ACPI_PROCFS_POWER=y +CONFIG_ACPI_SYSFS_POWER=y +CONFIG_ACPI_PROC_EVENT=y +CONFIG_ACPI_AC=m +CONFIG_ACPI_BATTERY=m +CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_VIDEO=m +CONFIG_ACPI_FAN=m +CONFIG_ACPI_DOCK=m +CONFIG_ACPI_BAY=m +CONFIG_ACPI_PROCESSOR=m +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_ASUS=m +CONFIG_ACPI_TOSHIBA=m +CONFIG_ACPI_CUSTOM_DSDT_INITRD=y +CONFIG_ACPI_BLACKLIST_YEAR=0 +# CONFIG_ACPI_DEBUG is not set +CONFIG_ACPI_EC=y +CONFIG_ACPI_POWER=y +CONFIG_ACPI_SYSTEM=y +CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_SBS=m +CONFIG_ACPI_PV_SLEEP=y + +# +# CPU Frequency scaling +# +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_TABLE=m +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m + +# +# CPUFreq processor drivers +# +CONFIG_X86_ACPI_CPUFREQ=m +CONFIG_X86_POWERNOW_K8=m +CONFIG_X86_POWERNOW_K8_ACPI=y +# CONFIG_X86_SPEEDSTEP_CENTRINO is not set +# CONFIG_X86_P4_CLOCKMOD is not set + +# +# shared options +# +# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set +# CONFIG_X86_SPEEDSTEP_LIB is not set +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y + +# +# Bus options (PCI etc.) +# +CONFIG_PCI=y +CONFIG_PCI_DIRECT=y +CONFIG_PCI_MMCONFIG=y +CONFIG_PCI_DOMAINS=y +CONFIG_XEN_PCIDEV_FRONTEND=y +# CONFIG_XEN_PCIDEV_FE_DEBUG is not set +CONFIG_PCIEPORTBUS=y +CONFIG_HOTPLUG_PCI_PCIE=m +CONFIG_PCIEAER=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_PCI_LEGACY=y +# CONFIG_PCI_DEBUG is not set +CONFIG_ISA_DMA_API=y +CONFIG_K8_NB=y +CONFIG_PCCARD=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_IOCTL=y +CONFIG_CARDBUS=y + +# +# PC-card bridges +# +CONFIG_YENTA=m +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_PD6729=m +CONFIG_I82092=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_HOTPLUG_PCI=m +CONFIG_HOTPLUG_PCI_FAKE=m +CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m +CONFIG_HOTPLUG_PCI_CPCI=y +CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m +CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m +CONFIG_HOTPLUG_PCI_SHPC=m + +# +# Executable file formats / Emulations +# +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m +CONFIG_IA32_EMULATION=y +# CONFIG_IA32_AOUT is not set +CONFIG_COMPAT=y +CONFIG_COMPAT_FOR_U64_ALIGNMENT=y +CONFIG_SYSVIPC_COMPAT=y + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=m +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_ASK_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +# CONFIG_IP_PNP is not set +CONFIG_NET_IPIP=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_IP_MROUTE=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_LRO=m +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_CONG_ILLINOIS=m +# CONFIG_DEFAULT_BIC is not set +# CONFIG_DEFAULT_CUBIC is not set +# CONFIG_DEFAULT_HTCP is not set +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFAULT_RENO=y +CONFIG_DEFAULT_TCP_CONG="reno" +CONFIG_TCP_MD5SIG=y +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_TAB_BITS=12 + +# +# IPVS transport protocol load balancing support +# +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_AH=y + +# +# IPVS scheduler +# +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_WRR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_NQ=m + +# +# IPVS application helper +# +CONFIG_IP_VS_FTP=m +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_NETLABEL is not set +CONFIG_NETWORK_SECMARK=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_BRIDGE_NETFILTER=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_NETLINK=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m + +# +# IP: Netfilter Configuration +# +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration (EXPERIMENTAL) +# +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_RAW=m + +# +# DECnet: Netfilter Configuration +# +CONFIG_DECNET_NF_GRABULATOR=m + +# +# Bridge: Netfilter Configuration +# +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_IP_DCCP=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_IP_DCCP_ACKVEC=y + +# +# DCCP CCIDs Configuration (EXPERIMENTAL) +# +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +CONFIG_IP_DCCP_TFRC_LIB=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 + +# +# DCCP Kernel Hacking +# +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_NET_DCCPPROBE=m +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +CONFIG_ATM=y +CONFIG_ATM_CLIP=y +# CONFIG_ATM_CLIP_NO_ICMP is not set +CONFIG_ATM_LANE=m +CONFIG_ATM_MPOA=m +CONFIG_ATM_BR2684=m +# CONFIG_ATM_BR2684_IPFILTER is not set +CONFIG_BRIDGE=m +CONFIG_VLAN_8021Q=m +CONFIG_DECNET=m +# CONFIG_DECNET_ROUTER is not set +CONFIG_LLC=y +CONFIG_LLC2=m +CONFIG_IPX=m +# CONFIG_IPX_INTERN is not set +CONFIG_ATALK=m +CONFIG_DEV_APPLETALK=m +CONFIG_IPDDP=m +CONFIG_IPDDP_ENCAP=y +CONFIG_IPDDP_DECAP=y +CONFIG_X25=m +CONFIG_LAPB=m +CONFIG_ECONET=m +CONFIG_ECONET_AUNUDP=y +CONFIG_ECONET_NATIVE=y +CONFIG_WAN_ROUTER=m +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_ATM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_INGRESS=m + +# +# Classification +# +CONFIG_NET_CLS=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_U32=m +# CONFIG_CLS_U32_PERF is not set +CONFIG_CLS_U32_MARK=y +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_CLS_ACT=y +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_GACT=m +CONFIG_GACT_PROB=y +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_SIMP=m +# CONFIG_NET_CLS_POLICE is not set +# CONFIG_NET_CLS_IND is not set +CONFIG_NET_SCH_FIFO=y + +# +# Network testing +# +CONFIG_NET_PKTGEN=m +CONFIG_NET_TCPPROBE=m +CONFIG_HAMRADIO=y + +# +# Packet Radio protocols +# +CONFIG_AX25=m +# CONFIG_AX25_DAMA_SLAVE is not set +CONFIG_NETROM=m +CONFIG_ROSE=m + +# +# AX.25 network device drivers +# +CONFIG_MKISS=m +CONFIG_6PACK=m +CONFIG_BPQETHER=m +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BAYCOM_PAR=m +CONFIG_YAM=m +CONFIG_IRDA=m + +# +# IrDA protocols +# +CONFIG_IRLAN=m +CONFIG_IRNET=m +CONFIG_IRCOMM=m +CONFIG_IRDA_ULTRA=y + +# +# IrDA options +# +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_FAST_RR=y +CONFIG_IRDA_DEBUG=y + +# +# Infrared-port device drivers +# + +# +# SIR device drivers +# +CONFIG_IRTTY_SIR=m + +# +# Dongle support +# +CONFIG_DONGLE=y +CONFIG_ESI_DONGLE=m +CONFIG_ACTISYS_DONGLE=m +CONFIG_TEKRAM_DONGLE=m +# CONFIG_TOIM3232_DONGLE is not set +CONFIG_LITELINK_DONGLE=m +CONFIG_MA600_DONGLE=m +CONFIG_GIRBIL_DONGLE=m +CONFIG_MCP2120_DONGLE=m +CONFIG_OLD_BELKIN_DONGLE=m +CONFIG_ACT200L_DONGLE=m +CONFIG_KINGSUN_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +CONFIG_KS959_DONGLE=m + +# +# Old SIR device drivers +# + +# +# Old Serial dongle support +# + +# +# FIR device drivers +# +CONFIG_USB_IRDA=m +CONFIG_SIGMATEL_FIR=m +CONFIG_NSC_FIR=m +CONFIG_WINBOND_FIR=m +CONFIG_SMC_IRCC_FIR=m +CONFIG_ALI_FIR=m +CONFIG_VLSI_FIR=m +CONFIG_VIA_FIR=m +CONFIG_MCS_FIR=m +CONFIG_BT=m +CONFIG_BT_L2CAP=m +CONFIG_BT_SCO=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_CMTP=m +CONFIG_BT_HIDP=m + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIVHCI=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_RXKAD=m +CONFIG_FIB_RULES=y + +# +# Wireless +# +CONFIG_CFG80211=m +CONFIG_NL80211=y +CONFIG_WIRELESS_EXT=y +CONFIG_MAC80211=m +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_DEBUGFS=y +# CONFIG_MAC80211_DEBUG is not set +CONFIG_IEEE80211=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_CRYPT_WEP=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +CONFIG_NET_9P=m +CONFIG_NET_9P_FD=m +# CONFIG_NET_9P_DEBUG is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +CONFIG_SYS_HYPERVISOR=y +CONFIG_CONNECTOR=m +CONFIG_MTD=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_CONCAT=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_REDBOOT_PARTS=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_FTL=m +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_INFTL=m +CONFIG_RFD_FTL=m +CONFIG_SSFDC=m +CONFIG_MTD_OOPS=m + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_GEN_PROBE=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_RAM=m +CONFIG_MTD_ROM=m +CONFIG_MTD_ABSENT=m + +# +# Mapping drivers for chip access +# +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PNC2000=m +CONFIG_MTD_SC520CDP=m +CONFIG_MTD_NETSC520=m +CONFIG_MTD_TS5500=m +CONFIG_MTD_SBC_GXX=m +CONFIG_MTD_AMD76XROM=m +CONFIG_MTD_ICHXROM=m +CONFIG_MTD_ESB2ROM=m +CONFIG_MTD_CK804XROM=m +CONFIG_MTD_SCB2_FLASH=m +CONFIG_MTD_NETtel=m +CONFIG_MTD_DILNETPC=m +CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000 +CONFIG_MTD_L440GX=m +CONFIG_MTD_PCI=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_PLATRAM=m + +# +# Self-contained MTD device drivers +# +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_DATAFLASH=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_MTDRAM=m +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTD_BLOCK2MTD=m + +# +# Disk-On-Chip Device Drivers +# +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCECC=m +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_DOCPROBE_ADDRESS=0 +CONFIG_MTD_NAND=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_IDS=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_2X_PROGRAM=y +CONFIG_MTD_ONENAND_SIM=m + +# +# UBI - Unsorted block images +# +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +CONFIG_MTD_UBI_GLUEBI=y + +# +# UBI debugging options +# +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_PARPORT=m +CONFIG_PARPORT_PC=m +CONFIG_PARPORT_SERIAL=m +CONFIG_PARPORT_PC_FIFO=y +# CONFIG_PARPORT_PC_SUPERIO is not set +CONFIG_PARPORT_PC_PCMCIA=m +# CONFIG_PARPORT_GSC is not set +CONFIG_PARPORT_AX88796=m +CONFIG_PARPORT_1284=y +CONFIG_PARPORT_NOT_PC=y +CONFIG_PNP=y +# CONFIG_PNP_DEBUG is not set + +# +# Protocols +# +CONFIG_PNPACPI=y +CONFIG_BLK_DEV=y +CONFIG_BLK_DEV_FD=m +CONFIG_PARIDE=m + +# +# Parallel IDE high-level drivers +# +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PT=m +CONFIG_PARIDE_PG=m + +# +# Parallel IDE protocol modules +# +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_CISS_SCSI_TAPE=y +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_UMEM=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_SX8=m +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_ATA_OVER_ETH=m +CONFIG_MISC_DEVICES=y +CONFIG_IBM_ASM=m +CONFIG_PHANTOM=m +CONFIG_EEPROM_93CX6=m +CONFIG_SGI_IOC4=m +CONFIG_TIFM_CORE=m +CONFIG_TIFM_7XX1=m +CONFIG_ASUS_LAPTOP=m +CONFIG_FUJITSU_LAPTOP=m +CONFIG_MSI_LAPTOP=m +CONFIG_SONY_LAPTOP=m +CONFIG_SONYPI_COMPAT=y +CONFIG_THINKPAD_ACPI=m +# CONFIG_THINKPAD_ACPI_DEBUG is not set +CONFIG_THINKPAD_ACPI_BAY=y +CONFIG_IDE=y +CONFIG_IDE_MAX_HWIFS=4 +CONFIG_BLK_DEV_IDE=m + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +# CONFIG_BLK_DEV_HD_IDE is not set +CONFIG_BLK_DEV_IDEDISK=m +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_IDECD=m +CONFIG_BLK_DEV_IDETAPE=m +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDEACPI=y +# CONFIG_IDE_TASK_IOCTL is not set +CONFIG_IDE_PROC_FS=y + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=m +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_CMD640=y +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +CONFIG_BLK_DEV_IDEPNP=y + +# +# PCI IDE chipsets support +# +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_IDEPCI_SHARE_IRQ=y +# CONFIG_IDEPCI_PCIBUS_ORDER is not set +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_GENERIC is not set +CONFIG_BLK_DEV_OPTI621=m +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI15X3=m +# CONFIG_WDC_ALI15X3 is not set +CONFIG_BLK_DEV_AMD74XX=m +CONFIG_BLK_DEV_ATIIXP=m +CONFIG_BLK_DEV_CMD64X=m +# CONFIG_BLK_DEV_TRIFLEX is not set +CONFIG_BLK_DEV_CY82C693=m +# CONFIG_BLK_DEV_CS5520 is not set +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_HPT34X=m +# CONFIG_HPT34X_AUTODMA is not set +CONFIG_BLK_DEV_HPT366=m +# CONFIG_BLK_DEV_JMICRON is not set +CONFIG_BLK_DEV_SC1200=m +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +CONFIG_BLK_DEV_NS87415=m +CONFIG_BLK_DEV_PDC202XX_OLD=m +CONFIG_PDC202XX_BURST=y +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +CONFIG_BLK_DEV_TRM290=m +CONFIG_BLK_DEV_VIA82CXXX=m +CONFIG_BLK_DEV_TC86C001=m +# CONFIG_IDE_ARM is not set +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI device support +# +CONFIG_RAID_ATTRS=m +CONFIG_SCSI=m +CONFIG_SCSI_DMA=y +CONFIG_SCSI_TGT=m +CONFIG_SCSI_NETLINK=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=m +CONFIG_CHR_DEV_ST=m +CONFIG_CHR_DEV_OSST=m +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_SCH=m + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_FC_TGT_ATTRS=y +CONFIG_SCSI_ISCSI_ATTRS=m +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +CONFIG_SCSI_SAS_ATA=y +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_LOWLEVEL=y +CONFIG_ISCSI_TCP=m +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_AIC7XXX=m +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_DEBUG_ENABLE=y +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_AIC79XX=m +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC79XX_DEBUG_ENABLE=y +CONFIG_AIC79XX_DEBUG_MASK=0 +CONFIG_AIC79XX_REG_PRETTY_PRINT=y +CONFIG_SCSI_AIC94XX=m +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_SAS=m +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_BUSLOGIC=m +# CONFIG_SCSI_OMIT_FLASHPOINT is not set +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_EATA=m +CONFIG_SCSI_EATA_TAGGED_QUEUE=y +CONFIG_SCSI_EATA_LINKED_COMMANDS=y +CONFIG_SCSI_EATA_MAX_TAGS=16 +CONFIG_SCSI_FUTURE_DOMAIN=m +CONFIG_SCSI_GDTH=m +CONFIG_SCSI_IPS=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_PPA=m +CONFIG_SCSI_IMM=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_TRACE is not set +# CONFIG_SCSI_IPR_DUMP is not set +CONFIG_SCSI_QLOGIC_1280=m +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_DC395x=m +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_DEBUG=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_ATA=m +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_ACPI=y +CONFIG_SATA_AHCI=m +CONFIG_SATA_SVW=m +CONFIG_ATA_PIIX=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_PDC_ADMA=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_SX4=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SATA_INIC162X=m +CONFIG_PATA_ACPI=m +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +CONFIG_PATA_ARTOP=m +CONFIG_PATA_ATIIXP=m +# CONFIG_PATA_CMD640_PCI is not set +CONFIG_PATA_CMD64X=m +CONFIG_PATA_CS5520=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_EFAR=m +CONFIG_ATA_GENERIC=m +CONFIG_PATA_HPT366=m +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +CONFIG_PATA_HPT3X3=m +# CONFIG_PATA_HPT3X3_DMA is not set +CONFIG_PATA_IT821X=m +CONFIG_PATA_IT8213=m +CONFIG_PATA_JMICRON=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_OLDPIIX=m +CONFIG_PATA_NETCELL=m +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +CONFIG_PATA_PCMCIA=m +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +CONFIG_PATA_RZ1000=m +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_PDC2027X=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_VIA=m +CONFIG_PATA_WINBOND=m +CONFIG_PATA_PLATFORM=m +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_MULTIPATH_RDAC=m +CONFIG_DM_MULTIPATH_HP=m +# CONFIG_DM_DELAY is not set +CONFIG_DM_UEVENT=y +CONFIG_FUSION=y +CONFIG_FUSION_SPI=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_SAS=m +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_CTL=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +CONFIG_IEEE1394=m + +# +# Subsystem Options +# +# CONFIG_IEEE1394_VERBOSEDEBUG is not set + +# +# Controllers +# +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_OHCI1394=m + +# +# Protocols +# +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_I2O=m +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_BUS=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_SCSI=m +CONFIG_I2O_PROC=m +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_NETDEVICES=y +# CONFIG_NETDEVICES_MULTIQUEUE is not set +CONFIG_IFB=m +CONFIG_DUMMY=m +CONFIG_BONDING=m +CONFIG_MACVLAN=m +CONFIG_EQUALIZER=m +CONFIG_TUN=m +CONFIG_VETH=m +CONFIG_NET_SB1000=m +CONFIG_ARCNET=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_RAW=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM90xx=m +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RIM_I=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_PCI=m +CONFIG_PHYLIB=m + +# +# MII PHY device drivers +# +CONFIG_MARVELL_PHY=m +CONFIG_DAVICOM_PHY=m +CONFIG_QSEMI_PHY=m +CONFIG_LXT_PHY=m +CONFIG_CICADA_PHY=m +CONFIG_VITESSE_PHY=m +CONFIG_SMSC_PHY=m +CONFIG_BROADCOM_PHY=m +CONFIG_ICPLUS_PHY=m +CONFIG_FIXED_PHY=m +# CONFIG_FIXED_MII_10_FDX is not set +# CONFIG_FIXED_MII_100_FDX is not set +CONFIG_FIXED_MII_1000_FDX=y +CONFIG_FIXED_MII_AMNT=1 +CONFIG_MDIO_BITBANG=m +CONFIG_NET_ETHERNET=y +CONFIG_MII=m +CONFIG_HAPPYMEAL=m +CONFIG_SUNGEM=m +CONFIG_CASSINI=m +CONFIG_NET_VENDOR_3COM=y +CONFIG_VORTEX=m +CONFIG_TYPHOON=m +CONFIG_NET_TULIP=y +CONFIG_DE2104X=m +CONFIG_TULIP=m +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_NAPI is not set +CONFIG_DE4X5=m +CONFIG_WINBOND_840=m +CONFIG_DM9102=m +CONFIG_ULI526X=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_HP100=m +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +CONFIG_NET_PCI=y +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_AMD8111_ETH=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_B44=m +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI=y +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +CONFIG_EEPRO100=m +CONFIG_E100=m +CONFIG_FEALNX=m +CONFIG_NATSEMI=m +CONFIG_NE2K_PCI=m +CONFIG_8139CP=m +CONFIG_8139TOO=m +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +CONFIG_8139TOO_8129=y +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_SIS900=m +CONFIG_EPIC100=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_SC92031=m +CONFIG_NET_POCKET=y +CONFIG_ATP=m +CONFIG_DE600=m +CONFIG_DE620=m +CONFIG_NETDEV_1000=y +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_DL2K=m +CONFIG_E1000=m +CONFIG_E1000_NAPI=y +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000E=m +CONFIG_IP1000=m +CONFIG_NS83820=m +CONFIG_HAMACHI=m +CONFIG_YELLOWFIN=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_SIS190=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SK98LIN is not set +CONFIG_VIA_VELOCITY=m +CONFIG_TIGON3=m +CONFIG_BNX2=m +CONFIG_QLA3XXX=m +CONFIG_ATL1=m +CONFIG_NETDEV_10000=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_IXGBE=m +CONFIG_IXGB=m +# CONFIG_IXGB_NAPI is not set +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +CONFIG_MYRI10GE=m +CONFIG_NETXEN_NIC=m +CONFIG_NIU=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_TEHUTI=m +CONFIG_TR=y +CONFIG_IBMOL=m +CONFIG_3C359=m +CONFIG_TMS380TR=m +CONFIG_TMSPCI=m +CONFIG_ABYSS=m + +# +# Wireless LAN +# +CONFIG_WLAN_PRE80211=y +CONFIG_STRIP=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_NETWAVE=m +CONFIG_WLAN_80211=y +CONFIG_PCMCIA_RAYCS=m +CONFIG_IPW2100=m +CONFIG_IPW2100_MONITOR=y +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2200=m +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +# CONFIG_IPW2200_DEBUG is not set +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_USB=m +CONFIG_LIBERTAS_CS=m +CONFIG_LIBERTAS_SDIO=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_AIRO=m +CONFIG_HERMES=m +# CONFIG_PLX_HERMES is not set +# CONFIG_TMD_HERMES is not set +# CONFIG_NORTEL_HERMES is not set +# CONFIG_PCI_HERMES is not set +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_ATMEL=m +CONFIG_PCI_ATMEL=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_AIRO_CS=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PRISM54=m +CONFIG_USB_ZD1201=m +CONFIG_RTL8187=m +CONFIG_ADM8211=m +CONFIG_P54_COMMON=m +CONFIG_P54_USB=m +CONFIG_P54_PCI=m +# CONFIG_IWLWIFI is not set +CONFIG_HOSTAP=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PLX=m +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_CS=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_PIO=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +# CONFIG_BCM43XX_PIO_MODE is not set +CONFIG_B43=m +CONFIG_B43_PCI_AUTOSELECT=y +CONFIG_B43_PCICORE_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_LEDS=y +CONFIG_B43_RFKILL=y +# CONFIG_B43_DEBUG is not set +CONFIG_B43_DMA=y +CONFIG_B43_PIO=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_PIO=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_RT2X00=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +# CONFIG_RT2X00_DEBUG is not set + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_BELKIN=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +# CONFIG_USB_NET_ZAURUS is not set +CONFIG_NET_PCMCIA=y +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_AXNET=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_WAN=y +CONFIG_LANMEDIA=m +CONFIG_HDLC=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_X25=m +CONFIG_PCI200SYN=m +CONFIG_WANXL=m +CONFIG_PC300=m +CONFIG_PC300_MLPPP=y + +# +# Cyclades-PC300 MLPPP support is disabled. +# + +# +# Refer to the file README.mlppp, provided by PC300 package. +# +# CONFIG_PC300TOO is not set +CONFIG_FARSYNC=m +CONFIG_DSCC4=m +CONFIG_DSCC4_PCISYNC=y +CONFIG_DSCC4_PCI_RST=y +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_WAN_ROUTER_DRIVERS=m +CONFIG_CYCLADES_SYNC=m +CONFIG_CYCLOMX_X25=y +CONFIG_LAPBETHER=m +CONFIG_X25_ASY=m +CONFIG_SBNI=m +# CONFIG_SBNI_MULTILINE is not set +CONFIG_ATM_DRIVERS=y +# CONFIG_ATM_DUMMY is not set +CONFIG_ATM_TCP=m +CONFIG_ATM_LANAI=m +CONFIG_ATM_ENI=m +# CONFIG_ATM_ENI_DEBUG is not set +# CONFIG_ATM_ENI_TUNE_BURST is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_ATM_IDT77252=m +# CONFIG_ATM_IDT77252_DEBUG is not set +# CONFIG_ATM_IDT77252_RCV_ALL is not set +CONFIG_ATM_IDT77252_USE_SUNI=y +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_FORE200E_MAYBE=m +CONFIG_ATM_FORE200E_PCA=y +CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y +# CONFIG_ATM_FORE200E_USE_TASKLET is not set +CONFIG_ATM_FORE200E_TX_RETRY=16 +CONFIG_ATM_FORE200E_DEBUG=0 +CONFIG_ATM_FORE200E=m +CONFIG_ATM_HE=m +CONFIG_ATM_HE_USE_SUNI=y +CONFIG_FDDI=y +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_SKFP=m +CONFIG_HIPPI=y +CONFIG_ROADRUNNER=m +# CONFIG_ROADRUNNER_LARGE_RINGS is not set +CONFIG_PLIP=m +CONFIG_PPP=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_FILTER=y +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_MPPE=m +CONFIG_PPPOE=m +CONFIG_PPPOATM=m +CONFIG_PPPOL2TP=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +CONFIG_SLHC=m +CONFIG_SLIP_SMART=y +CONFIG_SLIP_MODE_SLIP6=y +CONFIG_NET_FC=y +CONFIG_SHAPER=m +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_ISDN=m +CONFIG_ISDN_I4L=m +CONFIG_ISDN_PPP=y +CONFIG_ISDN_PPP_VJ=y +CONFIG_ISDN_MPP=y +CONFIG_IPPP_FILTER=y +CONFIG_ISDN_PPP_BSDCOMP=m +CONFIG_ISDN_AUDIO=y +CONFIG_ISDN_TTY_FAX=y +CONFIG_ISDN_X25=y + +# +# ISDN feature submodules +# +CONFIG_ISDN_DIVERSION=m + +# +# ISDN4Linux hardware drivers +# + +# +# Passive cards +# +CONFIG_ISDN_DRV_HISAX=m + +# +# D-channel protocol features +# +CONFIG_HISAX_EURO=y +CONFIG_DE_AOC=y +# CONFIG_HISAX_NO_SENDCOMPLETE is not set +# CONFIG_HISAX_NO_LLC is not set +# CONFIG_HISAX_NO_KEYPAD is not set +CONFIG_HISAX_1TR6=y +CONFIG_HISAX_NI1=y +CONFIG_HISAX_MAX_CARDS=8 + +# +# HiSax supported cards +# +CONFIG_HISAX_16_3=y +CONFIG_HISAX_TELESPCI=y +CONFIG_HISAX_S0BOX=y +CONFIG_HISAX_FRITZPCI=y +CONFIG_HISAX_AVM_A1_PCMCIA=y +CONFIG_HISAX_ELSA=y +CONFIG_HISAX_DIEHLDIVA=y +CONFIG_HISAX_SEDLBAUER=y +CONFIG_HISAX_NETJET=y +CONFIG_HISAX_NETJET_U=y +CONFIG_HISAX_NICCY=y +CONFIG_HISAX_BKM_A4T=y +CONFIG_HISAX_SCT_QUADRO=y +CONFIG_HISAX_GAZEL=y +CONFIG_HISAX_HFC_PCI=y +CONFIG_HISAX_W6692=y +CONFIG_HISAX_HFC_SX=y +CONFIG_HISAX_ENTERNOW_PCI=y +# CONFIG_HISAX_DEBUG is not set + +# +# HiSax PCMCIA card service modules +# +CONFIG_HISAX_SEDLBAUER_CS=m +CONFIG_HISAX_ELSA_CS=m +CONFIG_HISAX_AVM_A1_CS=m +CONFIG_HISAX_TELES_CS=m + +# +# HiSax sub driver modules +# +CONFIG_HISAX_ST5481=m +CONFIG_HISAX_HFCUSB=m +CONFIG_HISAX_HFC4S8S=m +CONFIG_HISAX_FRITZ_PCIPNP=m +CONFIG_HISAX_HDLC=y + +# +# Active cards +# +CONFIG_ISDN_DRV_GIGASET=m +CONFIG_GIGASET_BASE=m +CONFIG_GIGASET_M105=m +CONFIG_GIGASET_M101=m +# CONFIG_GIGASET_DEBUG is not set +# CONFIG_GIGASET_UNDOCREQ is not set +CONFIG_ISDN_CAPI=m +CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y +CONFIG_CAPI_TRACE=y +CONFIG_ISDN_CAPI_MIDDLEWARE=y +CONFIG_ISDN_CAPI_CAPI20=m +CONFIG_ISDN_CAPI_CAPIFS_BOOL=y +CONFIG_ISDN_CAPI_CAPIFS=m +CONFIG_ISDN_CAPI_CAPIDRV=m + +# +# CAPI hardware drivers +# +CONFIG_CAPI_AVM=y +CONFIG_ISDN_DRV_AVMB1_B1PCI=m +CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m +CONFIG_ISDN_DRV_AVMB1_AVM_CS=m +CONFIG_ISDN_DRV_AVMB1_T1PCI=m +CONFIG_ISDN_DRV_AVMB1_C4=m +CONFIG_CAPI_EICON=y +CONFIG_ISDN_DIVAS=m +CONFIG_ISDN_DIVAS_BRIPCI=y +CONFIG_ISDN_DIVAS_PRIPCI=y +CONFIG_ISDN_DIVAS_DIVACAPI=m +CONFIG_ISDN_DIVAS_USERIDI=m +CONFIG_ISDN_DIVAS_MAINT=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_POLLDEV=m + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_EVBUG=m + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_APPLETOUCH=m +CONFIG_MOUSE_VSXXXAA=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_IFORCE=m +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_IFORCE_232=y +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_INPUT_TABLET=y +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_FUJITSU=m +CONFIG_TOUCHSCREEN_GUNZE=m +CONFIG_TOUCHSCREEN_ELO=m +CONFIG_TOUCHSCREEN_MTOUCH=m +CONFIG_TOUCHSCREEN_MK712=m +CONFIG_TOUCHSCREEN_PENMOUNT=m +CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +CONFIG_TOUCHSCREEN_TOUCHWIN=m +CONFIG_TOUCHSCREEN_UCB1400=m +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_INPUT_MISC=y +CONFIG_INPUT_PCSPKR=m +CONFIG_INPUT_ATLAS_BTNS=m +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_YEALINK=m +CONFIG_INPUT_UINPUT=m + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_SERPORT=m +CONFIG_SERIO_CT82C710=m +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=m +CONFIG_GAMEPORT=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_DEV_KMEM is not set +CONFIG_SERIAL_NONSTANDARD=y +CONFIG_COMPUTONE=m +CONFIG_ROCKETPORT=m +CONFIG_CYCLADES=m +# CONFIG_CYZ_INTR is not set +CONFIG_DIGIEPCA=m +CONFIG_MOXA_INTELLIO=m +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +# CONFIG_ISI is not set +CONFIG_SYNCLINK=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_GT=m +CONFIG_N_HDLC=m +CONFIG_SPECIALIX=m +# CONFIG_SPECIALIX_RTSCTS is not set +CONFIG_SX=m +CONFIG_RIO=m +# CONFIG_RIO_OLDPCI is not set +CONFIG_STALDRV=y + +# +# Serial drivers +# +CONFIG_SERIAL_8250=m +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_SERIAL_8250_PCI=m +CONFIG_SERIAL_8250_PNP=m +CONFIG_SERIAL_8250_CS=m +CONFIG_SERIAL_8250_NR_UARTS=48 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_RSA=y + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=m +CONFIG_SERIAL_JSM=m +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_PRINTER=m +# CONFIG_LP_CONSOLE is not set +CONFIG_PPDEV=m +CONFIG_IPMI_HANDLER=m +# CONFIG_IPMI_PANIC_EVENT is not set +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m +CONFIG_IPMI_POWEROFF=m +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_INTEL=m +CONFIG_HW_RANDOM_AMD=m +CONFIG_NVRAM=m +CONFIG_RTC=y +CONFIG_R3964=m +CONFIG_APPLICOM=m + +# +# PCMCIA character devices +# +CONFIG_SYNCLINK_CS=m +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_MWAVE=m +CONFIG_PC8736x_GPIO=m +CONFIG_NSC_GPIO=m +CONFIG_RAW_DRIVER=m +CONFIG_MAX_RAW_DEVS=256 +CONFIG_HPET=y +# CONFIG_HPET_RTC_IRQ is not set +CONFIG_HPET_MMAP=y +CONFIG_HANGCHECK_TIMER=m +CONFIG_TCG_TPM=m +CONFIG_TCG_TIS=m +CONFIG_TCG_NSC=m +CONFIG_TCG_ATMEL=m +CONFIG_TCG_INFINEON=m +CONFIG_TCG_XEN=m +CONFIG_TELCLOCK=m +CONFIG_DEVPORT=y +CONFIG_I2C=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=m +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_ALGOPCA=m + +# +# I2C Hardware Bus support +# +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_PIIX4=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_TAOS_EVM=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m + +# +# Miscellaneous I2C Chip support +# +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_DS1682=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_TSL2550=m +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# SPI support +# +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +CONFIG_SPI_LM70_LLP=m + +# +# SPI Protocol Masters +# +CONFIG_SPI_AT25=m +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_W1=m +CONFIG_W1_CON=y + +# +# 1-wire Bus Masters +# +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_DS2482=m + +# +# 1-wire Slaves +# +CONFIG_W1_SLAVE_THERM=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2760=m +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_PDA_POWER=m +CONFIG_BATTERY_DS2760=m +CONFIG_HWMON=y +CONFIG_HWMON_VID=m +CONFIG_SENSORS_ABITUGURU=m +CONFIG_SENSORS_ABITUGURU3=m +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_K8TEMP=m +CONFIG_SENSORS_ASB100=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_FSCHER=m +CONFIG_SENSORS_FSCPOS=m +CONFIG_SENSORS_FSCHMD=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_CORETEMP=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_HDAPS=m +CONFIG_SENSORS_APPLESMC=m +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +CONFIG_SOFT_WATCHDOG=m +CONFIG_ACQUIRE_WDT=m +CONFIG_ADVANTECH_WDT=m +CONFIG_ALIM1535_WDT=m +CONFIG_ALIM7101_WDT=m +CONFIG_SC520_WDT=m +CONFIG_EUROTECH_WDT=m +CONFIG_IB700_WDT=m +CONFIG_IBMASR=m +CONFIG_WAFER_WDT=m +CONFIG_I6300ESB_WDT=m +CONFIG_ITCO_WDT=m +CONFIG_ITCO_VENDOR_SUPPORT=y +CONFIG_IT8712F_WDT=m +CONFIG_SC1200_WDT=m +CONFIG_PC87413_WDT=m +CONFIG_60XX_WDT=m +CONFIG_SBC8360_WDT=m +CONFIG_CPU5_WDT=m +CONFIG_SMSC37B787_WDT=m +CONFIG_W83627HF_WDT=m +CONFIG_W83697HF_WDT=m +CONFIG_W83877F_WDT=m +CONFIG_W83977F_WDT=m +CONFIG_MACHZ_WDT=m +CONFIG_SBC_EPX_C3_WATCHDOG=m + +# +# PCI-based Watchdog Cards +# +CONFIG_PCIPCWATCHDOG=m +CONFIG_WDTPCI=m +CONFIG_WDT_501_PCI=y + +# +# USB-based Watchdog Cards +# +CONFIG_USBPCWATCHDOG=m + +# +# Sonics Silicon Backplane +# +CONFIG_SSB_POSSIBLE=y +CONFIG_SSB=m +CONFIG_SSB_PCIHOST_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +# CONFIG_SSB_PCMCIAHOST is not set +# CONFIG_SSB_SILENT is not set +# CONFIG_SSB_DEBUG is not set +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_DRIVER_PCICORE=y + +# +# Multifunction device drivers +# +CONFIG_MFD_SM501=m + +# +# Multimedia devices +# +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set + +# +# Encoders/decoders and other helper chips +# + +# +# Audio decoders +# +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_MSP3400=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_WM8775=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_VP27SMPX=m + +# +# Video decoders +# +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_VPX3220=m + +# +# Video and audio decoders +# +CONFIG_VIDEO_CX25840=m + +# +# MPEG video encoders +# +CONFIG_VIDEO_CX2341X=m + +# +# Video encoders +# +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m + +# +# Video improvement chips +# +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_TUNER_3036=m +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_MEYE=m +CONFIG_VIDEO_SAA7134=m +CONFIG_VIDEO_SAA7134_ALSA=m +CONFIG_VIDEO_SAA7134_OSS=m +CONFIG_VIDEO_SAA7134_DVB=m +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_CX88=m +CONFIG_VIDEO_CX88_ALSA=m +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_FB_IVTV=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_29XXX=y +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_SYSFS=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_USBVIDEO=m +CONFIG_USB_VICAM=m +CONFIG_USB_IBMCAM=m +CONFIG_USB_KONICAWC=m +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_ET61X251=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_USB_W9968CF=m +# CONFIG_USB_OV511 is not set +CONFIG_USB_SE401=m +CONFIG_USB_SN9C102=m +CONFIG_USB_STV680=m +CONFIG_USB_ZC0301=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_ZR364XX=m +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RADIO_MAESTRO=m +CONFIG_USB_DSBR=m +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_PATCH=m + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 + +# +# Supported FlexCopII (B2C2) Adapters +# +CONFIG_DVB_B2C2_FLEXCOP=m +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set + +# +# Supported BT878 Adapters +# +CONFIG_DVB_BT8XX=m + +# +# Supported Pluto2 Adapters +# +CONFIG_DVB_PLUTO2=m + +# +# Supported DVB Frontends +# + +# +# Customise DVB Frontends +# +# CONFIG_DVB_FE_CUSTOMISE is not set + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_STV0299=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_MT312=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_TDA10086=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_S5H1409=m + +# +# Tuners/PLL support +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_DIB0070=m + +# +# Miscellaneous devices +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_TUA6100=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TUNER_SIMPLE=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_DAB=y +CONFIG_USB_DABUSB=m + +# +# Graphics support +# +CONFIG_AGP=y +CONFIG_AGP_AMD64=y +CONFIG_AGP_INTEL=m +CONFIG_AGP_SIS=m +CONFIG_AGP_VIA=m +CONFIG_DRM=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_I810=m +CONFIG_DRM_I830=m +CONFIG_DRM_I915=m +CONFIG_DRM_MGA=m +CONFIG_DRM_SIS=m +CONFIG_DRM_VIA=m +CONFIG_DRM_SAVAGE=m +CONFIG_VGASTATE=m +CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_FB=y +CONFIG_FIRMWARE_EDID=y +CONFIG_FB_DDC=m +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +CONFIG_FB_SYS_FILLRECT=m +CONFIG_FB_SYS_COPYAREA=m +CONFIG_FB_SYS_IMAGEBLIT=m +CONFIG_FB_SYS_FOPS=m +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_SVGALIB=m +# CONFIG_FB_MACMODES is not set +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y + +# +# Frame buffer hardware drivers +# +CONFIG_FB_CIRRUS=m +CONFIG_FB_PM2=m +CONFIG_FB_PM2_FIFO_DISCONNECT=y +CONFIG_FB_CYBER2000=m +CONFIG_FB_ARC=m +CONFIG_FB_ASILIANT=y +CONFIG_FB_IMSTT=y +CONFIG_FB_VGA16=m +CONFIG_FB_UVESA=m +CONFIG_FB_VESA=m +CONFIG_FB_EFI=y +CONFIG_FB_HECUBA=m +CONFIG_FB_HGA=m +# CONFIG_FB_HGA_ACCEL is not set +CONFIG_FB_S1D13XXX=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_I2C=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_BACKLIGHT=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_I2C=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_BACKLIGHT=y +CONFIG_FB_LE80578=m +CONFIG_FB_CARILLO_RANCH=m +CONFIG_FB_INTEL=m +# CONFIG_FB_INTEL_DEBUG is not set +CONFIG_FB_INTEL_I2C=y +CONFIG_FB_MATROX=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_RADEON=m +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_ATY128=m +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY=m +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_KYRO=m +CONFIG_FB_3DFX=m +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_VOODOO1=m +CONFIG_FB_VT8623=m +CONFIG_FB_TRIDENT=m +# CONFIG_FB_TRIDENT_ACCEL is not set +CONFIG_FB_ARK=m +CONFIG_FB_PM3=m +CONFIG_FB_GEODE=y +CONFIG_FB_GEODE_LX=m +CONFIG_FB_GEODE_GX=m +# CONFIG_FB_GEODE_GX_SET_FBSIZE is not set +CONFIG_FB_GEODE_GX1=m +CONFIG_FB_SM501=m +# CONFIG_FB_VIRTUAL is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_PROGEAR=m +CONFIG_BACKLIGHT_CARILLO_RANCH=m + +# +# Display device support +# +CONFIG_DISPLAY_SUPPORT=m + +# +# Display hardware drivers +# + +# +# Console display driver support +# +CONFIG_VGA_CONSOLE=y +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +CONFIG_VIDEO_SELECT=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +# CONFIG_LOGO is not set + +# +# Sound +# +CONFIG_SOUND=m + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=m +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m +CONFIG_SND_SEQUENCER=m +CONFIG_SND_SEQ_DUMMY=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +CONFIG_SND_SEQUENCER_OSS=y +CONFIG_SND_RTCTIMER=m +CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y +CONFIG_SND_DYNAMIC_MINORS=y +CONFIG_SND_SUPPORT_OLD_API=y +# CONFIG_SND_VERBOSE_PROCFS is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set + +# +# Generic devices +# +CONFIG_SND_MPU401_UART=m +CONFIG_SND_OPL3_LIB=m +CONFIG_SND_VX_LIB=m +CONFIG_SND_AC97_CODEC=m +CONFIG_SND_DUMMY=m +CONFIG_SND_VIRMIDI=m +CONFIG_SND_MTPAV=m +CONFIG_SND_MTS64=m +CONFIG_SND_SERIAL_U16550=m +CONFIG_SND_MPU401=m +CONFIG_SND_PORTMAN2X4=m +CONFIG_SND_SB_COMMON=m +CONFIG_SND_SB16_DSP=m + +# +# PCI devices +# +CONFIG_SND_AD1889=m +CONFIG_SND_ALS300=m +CONFIG_SND_ALS4000=m +CONFIG_SND_ALI5451=m +CONFIG_SND_ATIIXP=m +CONFIG_SND_ATIIXP_MODEM=m +CONFIG_SND_AU8810=m +CONFIG_SND_AU8820=m +CONFIG_SND_AU8830=m +CONFIG_SND_AZT3328=m +CONFIG_SND_BT87X=m +CONFIG_SND_BT87X_OVERCLOCK=y +CONFIG_SND_CA0106=m +CONFIG_SND_CMIPCI=m +CONFIG_SND_CS4281=m +CONFIG_SND_CS46XX=m +CONFIG_SND_CS46XX_NEW_DSP=y +CONFIG_SND_CS5530=m +CONFIG_SND_DARLA20=m +CONFIG_SND_GINA20=m +CONFIG_SND_LAYLA20=m +CONFIG_SND_DARLA24=m +CONFIG_SND_GINA24=m +CONFIG_SND_LAYLA24=m +CONFIG_SND_MONA=m +CONFIG_SND_MIA=m +CONFIG_SND_ECHO3G=m +CONFIG_SND_INDIGO=m +CONFIG_SND_INDIGOIO=m +CONFIG_SND_INDIGODJ=m +CONFIG_SND_EMU10K1=m +CONFIG_SND_EMU10K1X=m +CONFIG_SND_ENS1370=m +CONFIG_SND_ENS1371=m +CONFIG_SND_ES1938=m +CONFIG_SND_ES1968=m +CONFIG_SND_FM801=m +CONFIG_SND_FM801_TEA575X_BOOL=y +CONFIG_SND_FM801_TEA575X=m +CONFIG_SND_HDA_INTEL=m +CONFIG_SND_HDA_HWDEP=y +CONFIG_SND_HDA_CODEC_REALTEK=y +CONFIG_SND_HDA_CODEC_ANALOG=y +CONFIG_SND_HDA_CODEC_SIGMATEL=y +CONFIG_SND_HDA_CODEC_VIA=y +CONFIG_SND_HDA_CODEC_ATIHDMI=y +CONFIG_SND_HDA_CODEC_CONEXANT=y +CONFIG_SND_HDA_CODEC_CMEDIA=y +CONFIG_SND_HDA_CODEC_SI3054=y +CONFIG_SND_HDA_GENERIC=y +CONFIG_SND_HDA_POWER_SAVE=y +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDSP=m +CONFIG_SND_HDSPM=m +CONFIG_SND_ICE1712=m +CONFIG_SND_ICE1724=m +CONFIG_SND_INTEL8X0=m +CONFIG_SND_INTEL8X0M=m +CONFIG_SND_KORG1212=m +CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MAESTRO3=m +CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MIXART=m +CONFIG_SND_NM256=m +CONFIG_SND_PCXHR=m +CONFIG_SND_RIPTIDE=m +CONFIG_SND_RME32=m +CONFIG_SND_RME96=m +CONFIG_SND_RME9652=m +CONFIG_SND_SONICVIBES=m +CONFIG_SND_TRIDENT=m +CONFIG_SND_VIA82XX=m +CONFIG_SND_VIA82XX_MODEM=m +CONFIG_SND_VX222=m +CONFIG_SND_YMFPCI=m +CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y +CONFIG_SND_AC97_POWER_SAVE=y +CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0 + +# +# SPI devices +# + +# +# USB devices +# +CONFIG_SND_USB_AUDIO=m +CONFIG_SND_USB_USX2Y=m +CONFIG_SND_USB_CAIAQ=m +CONFIG_SND_USB_CAIAQ_INPUT=y + +# +# PCMCIA devices +# +CONFIG_SND_VXPOCKET=m +CONFIG_SND_PDAUDIOCF=m + +# +# System on Chip audio support +# +CONFIG_SND_SOC=m + +# +# SoC Audio support for SuperH +# + +# +# Open Sound System +# +CONFIG_SOUND_PRIME=m +CONFIG_SOUND_TRIDENT=m +CONFIG_SOUND_MSNDCLAS=m +CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin" +CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin" +CONFIG_SOUND_MSNDPIN=m +CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin" +CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin" +CONFIG_SOUND_OSS=m +# CONFIG_SOUND_TRACEINIT is not set +CONFIG_SOUND_DMAP=y +CONFIG_SOUND_SSCAPE=m +CONFIG_SOUND_VMIDI=m +CONFIG_SOUND_TRIX=m +CONFIG_SOUND_MSS=m +CONFIG_SOUND_MPU401=m +CONFIG_SOUND_PAS=m +CONFIG_SOUND_PSS=m +CONFIG_PSS_MIXER=y +CONFIG_SOUND_SB=m +CONFIG_SOUND_YM3812=m +CONFIG_SOUND_UART6850=m +CONFIG_SOUND_AEDSP16=m +CONFIG_SC6600=y +CONFIG_SC6600_JOY=y +CONFIG_SC6600_CDROM=4 +CONFIG_SC6600_CDROMBASE=0x0 +CONFIG_AEDSP16_MSS=y +# CONFIG_AEDSP16_SBPRO is not set +CONFIG_SOUND_KAHLUA=m +CONFIG_AC97_BUS=m +CONFIG_HID_SUPPORT=y +CONFIG_HID=m +# CONFIG_HID_DEBUG is not set +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=m +CONFIG_USB_HIDINPUT_POWERBOOK=y +# CONFIG_HID_FF is not set +CONFIG_USB_HIDDEV=y + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m +CONFIG_USB_SUPPORT=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB=m +# CONFIG_USB_DEBUG is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_SUSPEND=y +# CONFIG_USB_PERSIST is not set +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_ISP116X_HCD=m +CONFIG_USB_OHCI_HCD=m +CONFIG_USB_OHCI_HCD_SSB=y +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +CONFIG_USB_UHCI_HCD=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SL811_CS=m +CONFIG_USB_R8A66597_HCD=m + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# +# may also be needed; see USB_STORAGE Help for more information +# +CONFIG_USB_STORAGE=m +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_LIBUSUAL=y + +# +# USB Imaging devices +# +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +CONFIG_USB_MON=y + +# +# USB port drivers +# +CONFIG_USB_USS720=m + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_EZUSB=y + +# +# USB Miscellaneous drivers +# +CONFIG_USB_EMI62=m +CONFIG_USB_EMI26=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_AUERSWALD=m +CONFIG_USB_RIO500=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LCD=m +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_LED=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_FTDI_ELAN=m +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_LD=m +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_IOWARRIOR=m +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# +CONFIG_USB_ATM=m +CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_CXACRU=m +CONFIG_USB_UEAGLEATM=m +CONFIG_USB_XUSBATM=m + +# +# USB Gadget Support +# +CONFIG_USB_GADGET=m +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_SELECTED=y +CONFIG_USB_GADGET_AMD5536UDC=y +CONFIG_USB_AMD5536UDC=m +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +# CONFIG_USB_GADGET_NET2280 is not set +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_M66592 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_S3C2410 is not set +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_DUMMY_HCD is not set +CONFIG_USB_GADGET_DUALSPEED=y +CONFIG_USB_ZERO=m +CONFIG_USB_ETH=m +CONFIG_USB_ETH_RNDIS=y +CONFIG_USB_GADGETFS=m +CONFIG_USB_FILE_STORAGE=m +# CONFIG_USB_FILE_STORAGE_TEST is not set +CONFIG_USB_G_SERIAL=m +CONFIG_USB_MIDI_GADGET=m + +# +# MMC/SD/SDIO support, can only select one arch from MMC and MSS +# +CONFIG_MMC=m +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_UNSAFE_RESUME is not set + +# +# MMC/SD Card Drivers +# +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +CONFIG_SDIO_UART=m + +# +# MMC/SD Host Controller Drivers +# +CONFIG_MMC_SDHCI=m +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_WBSD=m +CONFIG_MMC_TIFM_SD=m +CONFIG_MMC_SPI=m +# CONFIG_MSS is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=m + +# +# LED drivers +# + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_MLX4_INFINIBAND=m +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_ISER=m +CONFIG_EDAC=y + +# +# Reporting subsystems +# +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_MM_EDAC=m +CONFIG_EDAC_E752X=m +CONFIG_EDAC_I82975X=m +CONFIG_EDAC_I5000=m +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +# CONFIG_RTC_DEBUG is not set + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_DRV_TEST=m + +# +# I2C RTC drivers +# +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y + +# +# SPI RTC drivers +# +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_MAX6902=m + +# +# Platform RTC drivers +# +CONFIG_RTC_DRV_CMOS=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_V3020=m + +# +# on-CPU RTC drivers +# +CONFIG_DMADEVICES=y + +# +# DMA Devices +# +CONFIG_INTEL_IOATDMA=m +CONFIG_DMA_ENGINE=y + +# +# DMA Clients +# +CONFIG_NET_DMA=y +CONFIG_DCA=m +CONFIG_AUXDISPLAY=y +CONFIG_KS0108=m +CONFIG_KS0108_PORT=0x378 +CONFIG_KS0108_DELAY=2 +CONFIG_CFAG12864B=m +CONFIG_CFAG12864B_RATE=20 + +# +# Userspace I/O +# +CONFIG_UIO=m +CONFIG_UIO_CIF=m + +# +# Firmware Drivers +# +# CONFIG_EDD is not set +CONFIG_DELL_RBU=m +CONFIG_DCDBAS=m +CONFIG_DMIID=y + +# +# File systems +# +CONFIG_EXT2_FS=m +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +CONFIG_EXT3_FS_XATTR=y +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=m +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +# CONFIG_JFS_DEBUG is not set +CONFIG_JFS_STATISTICS=y +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_RT=y +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_OCFS2_FS=m +CONFIG_OCFS2_DEBUG_MASKLOG=y +# CONFIG_OCFS2_DEBUG_FS is not set +CONFIG_MINIX_FS=m +CONFIG_ROMFS_FS=m +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_QUOTA=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_QFMT_V1=m +CONFIG_QFMT_V2=m +CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m +CONFIG_GENERIC_ACL=y + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_VMCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +# CONFIG_HUGETLB_PAGE is not set +CONFIG_CONFIGFS_FS=m + +# +# Miscellaneous filesystems +# +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_AFFS_FS=m +CONFIG_ECRYPT_FS=m +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +CONFIG_BEFS_FS=m +# CONFIG_BEFS_DEBUG is not set +CONFIG_BFS_FS=m +CONFIG_EFS_FS=m +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +CONFIG_CRAMFS=y +CONFIG_VXFS_FS=m +CONFIG_HPFS_FS=m +CONFIG_QNX4FS_FS=m +CONFIG_SYSV_FS=m +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_UFS_DEBUG is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFSD=m +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=m +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=m +CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_XPRT_RDMA=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_EXPERIMENTAL is not set +CONFIG_NCP_FS=m +CONFIG_NCPFS_PACKET_SIGNING=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_STRONG=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_OS2_NS=y +# CONFIG_NCPFS_SMALLDOS is not set +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_EXTRAS=y +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set +CONFIG_AFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_9P_FS=m +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +CONFIG_ACORN_PARTITION=y +# CONFIG_ACORN_PARTITION_CUMANA is not set +# CONFIG_ACORN_PARTITION_EESOX is not set +CONFIG_ACORN_PARTITION_ICS=y +# CONFIG_ACORN_PARTITION_ADFS is not set +# CONFIG_ACORN_PARTITION_POWERTEC is not set +CONFIG_ACORN_PARTITION_RISCIX=y +CONFIG_OSF_PARTITION=y +CONFIG_AMIGA_PARTITION=y +CONFIG_ATARI_PARTITION=y +CONFIG_MAC_PARTITION=y +CONFIG_MSDOS_PARTITION=y +CONFIG_BSD_DISKLABEL=y +CONFIG_MINIX_SUBPARTITION=y +CONFIG_SOLARIS_X86_PARTITION=y +CONFIG_UNIXWARE_DISKLABEL=y +CONFIG_LDM_PARTITION=y +# CONFIG_LDM_DEBUG is not set +CONFIG_SGI_PARTITION=y +CONFIG_ULTRIX_PARTITION=y +CONFIG_SUN_PARTITION=y +CONFIG_KARMA_PARTITION=y +CONFIG_EFI_PARTITION=y +CONFIG_SYSV68_PARTITION=y +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +CONFIG_INSTRUMENTATION=y +CONFIG_PROFILING=y +CONFIG_OPROFILE=m +CONFIG_KPROBES=y +# CONFIG_MARKERS is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_UNUSED_SYMBOLS=y +CONFIG_DEBUG_FS=y +# CONFIG_HEADERS_CHECK is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_SCHED_DEBUG=y +# CONFIG_SCHEDSTATS is not set +CONFIG_TIMER_STATS=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_FORCED_INLINING is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_LKDTM is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SAMPLES is not set +CONFIG_NONPROMISC_DEVMEM=y +CONFIG_EARLY_PRINTK=y +# CONFIG_WRAPPER_PRINT is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_RODATA is not set +CONFIG_IO_DELAY_TYPE_0X80=0 +CONFIG_IO_DELAY_TYPE_0XED=1 +CONFIG_IO_DELAY_TYPE_UDELAY=2 +CONFIG_IO_DELAY_TYPE_NONE=3 +CONFIG_IO_DELAY_0X80=y +# CONFIG_IO_DELAY_0XED is not set +# CONFIG_IO_DELAY_UDELAY is not set +# CONFIG_IO_DELAY_NONE is not set +CONFIG_DEFAULT_IO_DELAY_TYPE=0 + +# +# Security options +# +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +CONFIG_SECURITY=y +CONFIG_SECURITY_NETWORK=y +# CONFIG_SECURITY_NETWORK_XFRM is not set +CONFIG_SECURITY_CAPABILITIES=y +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_SECURITY_SELINUX=y +CONFIG_SECURITY_SELINUX_BOOTPARAM=y +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 +CONFIG_SECURITY_SELINUX_DISABLE=y +CONFIG_SECURITY_SELINUX_DEVELOP=y +CONFIG_SECURITY_SELINUX_AVC_STATS=y +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 +# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set +# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set +CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 +# CONFIG_SECURITY_APPARMOR_DISABLE is not set +CONFIG_XOR_BLOCKS=m +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_XTS=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_TWOFISH_X86_64=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_AES_X86_64=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_HW=y +CONFIG_HAVE_KVM=y +CONFIG_XEN=y +CONFIG_XEN_INTERFACE_VERSION=0x00030207 + +# +# XEN +# +CONFIG_XEN_PRIVILEGED_GUEST=y +# CONFIG_XEN_UNPRIVILEGED_GUEST is not set +CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_XENBUS_DEV=y +CONFIG_XEN_BACKEND=y +CONFIG_XEN_BLKDEV_BACKEND=y +CONFIG_XEN_BLKDEV_TAP=y +CONFIG_XEN_NETDEV_BACKEND=y +# CONFIG_XEN_NETDEV_PIPELINED_TRANSMITTER is not set +CONFIG_XEN_NETDEV_LOOPBACK=y +CONFIG_XEN_PCIDEV_BACKEND=y +CONFIG_XEN_PCIDEV_BACKEND_VPCI=y +# CONFIG_XEN_PCIDEV_BACKEND_PASS is not set +# CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set +# CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER is not set +# CONFIG_XEN_PCIDEV_BE_DEBUG is not set +CONFIG_XEN_TPMDEV_BACKEND=y +CONFIG_XEN_BLKDEV_FRONTEND=y +CONFIG_XEN_NETDEV_FRONTEND=y +CONFIG_XEN_GRANT_DEV=y +CONFIG_XEN_FRAMEBUFFER=y +CONFIG_XEN_KEYBOARD=y +CONFIG_XEN_CONSOLE=y +CONFIG_XEN_SCRUB_PAGES=y +CONFIG_XEN_DISABLE_SERIAL=y +CONFIG_XEN_SYSFS=y +CONFIG_XEN_COMPAT_030002_AND_LATER=y +# CONFIG_XEN_COMPAT_030004_AND_LATER is not set +# CONFIG_XEN_COMPAT_030100_AND_LATER is not set +# CONFIG_XEN_COMPAT_LATEST_ONLY is not set +CONFIG_XEN_COMPAT=0x030002 +CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_NO_IDLE_HZ=y +CONFIG_XEN_SMPBOOT=y +CONFIG_XEN_BALLOON=y +CONFIG_XEN_DEVMEM=y + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +CONFIG_CRC16=m +CONFIG_CRC_ITU_T=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_PLIST=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CHECK_SIGNATURE=y +CONFIG_DRM_VIA_CHROME9=m --- linux-2.6.24.orig/debian/binary-custom.d/xen/config.i386 +++ linux-2.6.24/debian/binary-custom.d/xen/config.i386 @@ -0,0 +1,3908 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.24-16-xen +# Wed Apr 9 14:22:31 2008 +# +# CONFIG_64BIT is not set +CONFIG_X86_32=y +# CONFIG_X86_64 is not set +CONFIG_X86=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_SEMAPHORE_SLEEPERS=y +CONFIG_MMU=y +CONFIG_ZONE_DMA=y +CONFIG_QUICKLIST=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_DMI=y +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y +# CONFIG_GENERIC_TIME_VSYSCALL is not set +CONFIG_ARCH_SUPPORTS_OPROFILE=y +# CONFIG_ZONE_DMA32 is not set +CONFIG_ARCH_POPULATES_NODE_MAP=y +# CONFIG_AUDIT_ARCH is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_X86_SMP=y +CONFIG_X86_BIOS_REBOOT=y +CONFIG_X86_TRAMPOLINE=y +CONFIG_X86_NO_TSS=y +CONFIG_X86_NO_IDT=y +CONFIG_KTIME_SCALAR=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.24-4.6-generic" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_TASKSTATS=y +# CONFIG_TASK_DELAY_ACCT is not set +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +# CONFIG_USER_NS is not set +# CONFIG_PID_NS is not set +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_TREE=y +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_CGROUPS is not set +CONFIG_FAIR_GROUP_SCHED=y +CONFIG_FAIR_USER_SCHED=y +# CONFIG_FAIR_CGROUP_SCHED is not set +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_RELAY=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_LBD=y +CONFIG_BLK_DEV_IO_TRACE=y +# CONFIG_LSF is not set +# CONFIG_BLK_DEV_BSG is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +CONFIG_LSM_MMAP_MIN_ADDR=0 + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" + +# +# Processor type and features +# +# CONFIG_TICK_ONESHOT is not set +CONFIG_SMP=y +# CONFIG_X86_PC is not set +CONFIG_X86_XEN=y +# CONFIG_X86_ELAN is not set +# CONFIG_X86_VOYAGER is not set +# CONFIG_X86_NUMAQ is not set +# CONFIG_X86_SUMMIT is not set +# CONFIG_X86_BIGSMP is not set +# CONFIG_X86_VISWS is not set +# CONFIG_X86_GENERICARCH is not set +# CONFIG_X86_ES7000 is not set +# CONFIG_X86_64_XEN is not set +# CONFIG_X86_VSMP is not set +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +# CONFIG_M386 is not set +# CONFIG_M486 is not set +CONFIG_M586=y +# CONFIG_M586TSC is not set +# CONFIG_M586MMX is not set +# CONFIG_M686 is not set +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MPENTIUM4 is not set +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MEFFICEON is not set +# CONFIG_MWINCHIPC6 is not set +# CONFIG_MWINCHIP2 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +# CONFIG_MCYRIXIII is not set +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set +# CONFIG_MPSC is not set +# CONFIG_MCORE2 is not set +# CONFIG_GENERIC_CPU is not set +CONFIG_X86_GENERIC=y +CONFIG_X86_CMPXCHG=y +CONFIG_X86_L1_CACHE_SHIFT=7 +CONFIG_X86_XADD=y +CONFIG_X86_PPRO_FENCE=y +CONFIG_X86_WP_WORKS_OK=y +CONFIG_X86_INVLPG=y +CONFIG_X86_BSWAP=y +CONFIG_X86_POPAD_OK=y +CONFIG_X86_ALIGNMENT_16=y +CONFIG_X86_INTEL_USERCOPY=y +CONFIG_X86_MINIMUM_CPU_FAMILY=4 +CONFIG_SWIOTLB=y +CONFIG_NR_CPUS=8 +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_BKL=y +CONFIG_X86_LOCAL_APIC=y +CONFIG_X86_IO_APIC=y +CONFIG_VM86=y +CONFIG_TOSHIBA=m +CONFIG_I8K=m +CONFIG_X86_REBOOTFIXUPS=y +CONFIG_MICROCODE=m +CONFIG_MICROCODE_OLD_INTERFACE=y +CONFIG_X86_MSR=m +CONFIG_X86_CPUID=m +# CONFIG_NOHIGHMEM is not set +# CONFIG_HIGHMEM4G is not set +CONFIG_HIGHMEM64G=y +CONFIG_VMSPLIT_3G=y +# CONFIG_VMSPLIT_3G_OPT is not set +# CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_2G_OPT is not set +# CONFIG_VMSPLIT_1G is not set +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_HIGHMEM=y +CONFIG_X86_PAE=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_RESOURCES_64BIT=y +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_BOUNCE=y +CONFIG_NR_QUICK=1 +CONFIG_VIRT_TO_BUS=y +CONFIG_HIGHPTE=y +CONFIG_MTRR=y +CONFIG_SECCOMP=y +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_300 is not set +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_KEXEC=y +CONFIG_CRASH_DUMP=y +CONFIG_PHYSICAL_START=0x100000 +CONFIG_PHYSICAL_ALIGN=0x100000 +CONFIG_HOTPLUG_CPU=y +# CONFIG_COMPAT_VDSO is not set +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y + +# +# Power management options +# +CONFIG_PM=y +CONFIG_PM_LEGACY=y +CONFIG_PM_DEBUG=y +# CONFIG_PM_VERBOSE is not set +CONFIG_PM_TRACE=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PM_SLEEP=y +CONFIG_SUSPEND_SMP_POSSIBLE=y +CONFIG_SUSPEND=y +CONFIG_PM_DISABLE_CONSOLE=y +CONFIG_ACPI=y +CONFIG_ACPI_SLEEP=y +CONFIG_ACPI_PROCFS=y +CONFIG_ACPI_PROCFS_POWER=y +CONFIG_ACPI_SYSFS_POWER=y +CONFIG_ACPI_PROC_EVENT=y +CONFIG_ACPI_AC=m +CONFIG_ACPI_BATTERY=m +CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_VIDEO=m +CONFIG_ACPI_FAN=m +CONFIG_ACPI_DOCK=m +CONFIG_ACPI_BAY=m +CONFIG_ACPI_PROCESSOR=m +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_ASUS=m +CONFIG_ACPI_TOSHIBA=m +CONFIG_ACPI_CUSTOM_DSDT_INITRD=y +CONFIG_ACPI_BLACKLIST_YEAR=2000 +# CONFIG_ACPI_DEBUG is not set +CONFIG_ACPI_EC=y +CONFIG_ACPI_POWER=y +CONFIG_ACPI_SYSTEM=y +CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_SBS=m +CONFIG_ACPI_PV_SLEEP=y + +# +# CPU Frequency scaling +# +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_TABLE=m +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m + +# +# CPUFreq processor drivers +# +CONFIG_X86_ACPI_CPUFREQ=m +CONFIG_X86_POWERNOW_K6=m +CONFIG_X86_POWERNOW_K7=m +CONFIG_X86_POWERNOW_K7_ACPI=y +CONFIG_X86_POWERNOW_K8=m +CONFIG_X86_POWERNOW_K8_ACPI=y +CONFIG_X86_GX_SUSPMOD=m +CONFIG_X86_SPEEDSTEP_CENTRINO=m +CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y +CONFIG_X86_SPEEDSTEP_ICH=m +CONFIG_X86_SPEEDSTEP_SMI=m +CONFIG_X86_P4_CLOCKMOD=m +CONFIG_X86_CPUFREQ_NFORCE2=m +CONFIG_X86_LONGRUN=m +CONFIG_X86_LONGHAUL=m +# CONFIG_X86_E_POWERSAVER is not set + +# +# shared options +# +# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set +CONFIG_X86_SPEEDSTEP_LIB=m +CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y + +# +# Bus options (PCI etc.) +# +CONFIG_PCI=y +# CONFIG_PCI_GOBIOS is not set +# CONFIG_PCI_GOMMCONFIG is not set +# CONFIG_PCI_GODIRECT is not set +# CONFIG_PCI_GOXEN_FE is not set +CONFIG_PCI_GOANY=y +CONFIG_PCI_DIRECT=y +CONFIG_PCI_MMCONFIG=y +CONFIG_PCI_DOMAINS=y +CONFIG_XEN_PCIDEV_FRONTEND=y +# CONFIG_XEN_PCIDEV_FE_DEBUG is not set +CONFIG_PCIEPORTBUS=y +CONFIG_HOTPLUG_PCI_PCIE=m +CONFIG_PCIEAER=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_PCI_LEGACY=y +# CONFIG_PCI_DEBUG is not set +CONFIG_ISA_DMA_API=y +CONFIG_SCx200=m +CONFIG_SCx200HR_TIMER=m +CONFIG_K8_NB=y +CONFIG_PCCARD=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_IOCTL=y +CONFIG_CARDBUS=y + +# +# PC-card bridges +# +CONFIG_YENTA=m +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_TOSHIBA=y +CONFIG_PD6729=m +CONFIG_I82092=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_HOTPLUG_PCI=m +CONFIG_HOTPLUG_PCI_FAKE=m +CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m +CONFIG_HOTPLUG_PCI_CPCI=y +CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m +CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m +CONFIG_HOTPLUG_PCI_SHPC=m + +# +# Executable file formats / Emulations +# +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_AOUT=m +CONFIG_BINFMT_MISC=m + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=m +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_ASK_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +# CONFIG_IP_PNP is not set +CONFIG_NET_IPIP=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_IP_MROUTE=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_LRO=m +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_VEGAS=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TCP_CONG_ILLINOIS=m +# CONFIG_DEFAULT_BIC is not set +# CONFIG_DEFAULT_CUBIC is not set +# CONFIG_DEFAULT_HTCP is not set +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +CONFIG_DEFAULT_RENO=y +CONFIG_DEFAULT_TCP_CONG="reno" +CONFIG_TCP_MD5SIG=y +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_TAB_BITS=12 + +# +# IPVS transport protocol load balancing support +# +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_AH=y + +# +# IPVS scheduler +# +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_WRR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_NQ=m + +# +# IPVS application helper +# +CONFIG_IP_VS_FTP=m +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_NETLABEL is not set +CONFIG_NETWORK_SECMARK=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_BRIDGE_NETFILTER=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_SECMARK=y +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_NETLINK=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m + +# +# IP: Netfilter Configuration +# +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration (EXPERIMENTAL) +# +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_RAW=m + +# +# DECnet: Netfilter Configuration +# +CONFIG_DECNET_NF_GRABULATOR=m + +# +# Bridge: Netfilter Configuration +# +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_IP_DCCP=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_IP_DCCP_ACKVEC=y + +# +# DCCP CCIDs Configuration (EXPERIMENTAL) +# +CONFIG_IP_DCCP_CCID2=m +# CONFIG_IP_DCCP_CCID2_DEBUG is not set +CONFIG_IP_DCCP_CCID3=m +CONFIG_IP_DCCP_TFRC_LIB=m +# CONFIG_IP_DCCP_CCID3_DEBUG is not set +CONFIG_IP_DCCP_CCID3_RTO=100 + +# +# DCCP Kernel Hacking +# +# CONFIG_IP_DCCP_DEBUG is not set +CONFIG_NET_DCCPPROBE=m +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y +CONFIG_TIPC=m +# CONFIG_TIPC_ADVANCED is not set +# CONFIG_TIPC_DEBUG is not set +CONFIG_ATM=y +CONFIG_ATM_CLIP=y +# CONFIG_ATM_CLIP_NO_ICMP is not set +CONFIG_ATM_LANE=m +CONFIG_ATM_MPOA=m +CONFIG_ATM_BR2684=m +# CONFIG_ATM_BR2684_IPFILTER is not set +CONFIG_BRIDGE=m +CONFIG_VLAN_8021Q=m +CONFIG_DECNET=m +# CONFIG_DECNET_ROUTER is not set +CONFIG_LLC=y +CONFIG_LLC2=m +CONFIG_IPX=m +# CONFIG_IPX_INTERN is not set +CONFIG_ATALK=m +CONFIG_DEV_APPLETALK=m +CONFIG_IPDDP=m +CONFIG_IPDDP_ENCAP=y +CONFIG_IPDDP_DECAP=y +CONFIG_X25=m +CONFIG_LAPB=m +CONFIG_ECONET=m +CONFIG_ECONET_AUNUDP=y +CONFIG_ECONET_NATIVE=y +CONFIG_WAN_ROUTER=m +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_ATM=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RR=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_INGRESS=m + +# +# Classification +# +CONFIG_NET_CLS=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_U32=m +# CONFIG_CLS_U32_PERF is not set +CONFIG_CLS_U32_MARK=y +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_STACK=32 +CONFIG_NET_EMATCH_CMP=m +CONFIG_NET_EMATCH_NBYTE=m +CONFIG_NET_EMATCH_U32=m +CONFIG_NET_EMATCH_META=m +CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_CLS_ACT=y +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_GACT=m +CONFIG_GACT_PROB=y +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_NAT=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_SIMP=m +# CONFIG_NET_CLS_POLICE is not set +# CONFIG_NET_CLS_IND is not set +CONFIG_NET_SCH_FIFO=y + +# +# Network testing +# +CONFIG_NET_PKTGEN=m +CONFIG_NET_TCPPROBE=m +CONFIG_HAMRADIO=y + +# +# Packet Radio protocols +# +CONFIG_AX25=m +# CONFIG_AX25_DAMA_SLAVE is not set +CONFIG_NETROM=m +CONFIG_ROSE=m + +# +# AX.25 network device drivers +# +CONFIG_MKISS=m +CONFIG_6PACK=m +CONFIG_BPQETHER=m +CONFIG_BAYCOM_SER_FDX=m +CONFIG_BAYCOM_SER_HDX=m +CONFIG_BAYCOM_PAR=m +CONFIG_BAYCOM_EPP=m +CONFIG_YAM=m +CONFIG_IRDA=m + +# +# IrDA protocols +# +CONFIG_IRLAN=m +CONFIG_IRNET=m +CONFIG_IRCOMM=m +CONFIG_IRDA_ULTRA=y + +# +# IrDA options +# +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_FAST_RR=y +CONFIG_IRDA_DEBUG=y + +# +# Infrared-port device drivers +# + +# +# SIR device drivers +# +CONFIG_IRTTY_SIR=m + +# +# Dongle support +# +CONFIG_DONGLE=y +CONFIG_ESI_DONGLE=m +CONFIG_ACTISYS_DONGLE=m +CONFIG_TEKRAM_DONGLE=m +# CONFIG_TOIM3232_DONGLE is not set +CONFIG_LITELINK_DONGLE=m +CONFIG_MA600_DONGLE=m +CONFIG_GIRBIL_DONGLE=m +CONFIG_MCP2120_DONGLE=m +CONFIG_OLD_BELKIN_DONGLE=m +CONFIG_ACT200L_DONGLE=m +CONFIG_KINGSUN_DONGLE=m +CONFIG_KSDAZZLE_DONGLE=m +CONFIG_KS959_DONGLE=m + +# +# Old SIR device drivers +# + +# +# Old Serial dongle support +# + +# +# FIR device drivers +# +CONFIG_USB_IRDA=m +CONFIG_SIGMATEL_FIR=m +CONFIG_NSC_FIR=m +CONFIG_WINBOND_FIR=m +CONFIG_TOSHIBA_FIR=m +CONFIG_SMC_IRCC_FIR=m +CONFIG_ALI_FIR=m +CONFIG_VLSI_FIR=m +CONFIG_VIA_FIR=m +CONFIG_MCS_FIR=m +CONFIG_BT=m +CONFIG_BT_L2CAP=m +CONFIG_BT_SCO=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_CMTP=m +CONFIG_BT_HIDP=m + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIDTL1=m +CONFIG_BT_HCIBT3C=m +CONFIG_BT_HCIBLUECARD=m +CONFIG_BT_HCIBTUART=m +CONFIG_BT_HCIVHCI=m +CONFIG_AF_RXRPC=m +# CONFIG_AF_RXRPC_DEBUG is not set +CONFIG_RXKAD=m +CONFIG_FIB_RULES=y + +# +# Wireless +# +CONFIG_CFG80211=m +CONFIG_NL80211=y +CONFIG_WIRELESS_EXT=y +CONFIG_MAC80211=m +CONFIG_MAC80211_RCSIMPLE=y +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_DEBUGFS=y +# CONFIG_MAC80211_DEBUG is not set +CONFIG_IEEE80211=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_CRYPT_WEP=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_RFKILL=m +CONFIG_RFKILL_INPUT=m +CONFIG_RFKILL_LEDS=y +CONFIG_NET_9P=m +CONFIG_NET_9P_FD=m +# CONFIG_NET_9P_DEBUG is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +CONFIG_SYS_HYPERVISOR=y +CONFIG_CONNECTOR=m +CONFIG_MTD=m +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_CONCAT=m +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_REDBOOT_PARTS=m +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_BLOCK_RO=m +CONFIG_FTL=m +CONFIG_NFTL=m +CONFIG_NFTL_RW=y +CONFIG_INFTL=m +CONFIG_RFD_FTL=m +CONFIG_SSFDC=m +CONFIG_MTD_OOPS=m + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=m +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_GEN_PROBE=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_CFI_UTIL=m +CONFIG_MTD_RAM=m +CONFIG_MTD_ROM=m +CONFIG_MTD_ABSENT=m + +# +# Mapping drivers for chip access +# +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PHYSMAP_LEN=0x4000000 +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PNC2000=m +CONFIG_MTD_SC520CDP=m +CONFIG_MTD_NETSC520=m +CONFIG_MTD_TS5500=m +CONFIG_MTD_SBC_GXX=m +CONFIG_MTD_SCx200_DOCFLASH=m +CONFIG_MTD_AMD76XROM=m +CONFIG_MTD_ICHXROM=m +CONFIG_MTD_ESB2ROM=m +CONFIG_MTD_CK804XROM=m +CONFIG_MTD_SCB2_FLASH=m +CONFIG_MTD_NETtel=m +CONFIG_MTD_DILNETPC=m +CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000 +CONFIG_MTD_L440GX=m +CONFIG_MTD_PCI=m +CONFIG_MTD_INTEL_VR_NOR=m +CONFIG_MTD_PLATRAM=m + +# +# Self-contained MTD device drivers +# +CONFIG_MTD_PMC551=m +# CONFIG_MTD_PMC551_BUGFIX is not set +# CONFIG_MTD_PMC551_DEBUG is not set +CONFIG_MTD_DATAFLASH=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_SLRAM=m +CONFIG_MTD_PHRAM=m +CONFIG_MTD_MTDRAM=m +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTDRAM_ERASE_SIZE=128 +CONFIG_MTD_BLOCK2MTD=m + +# +# Disk-On-Chip Device Drivers +# +CONFIG_MTD_DOC2000=m +CONFIG_MTD_DOC2001=m +CONFIG_MTD_DOC2001PLUS=m +CONFIG_MTD_DOCPROBE=m +CONFIG_MTD_DOCECC=m +# CONFIG_MTD_DOCPROBE_ADVANCED is not set +CONFIG_MTD_DOCPROBE_ADDRESS=0 +CONFIG_MTD_NAND=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_IDS=m +CONFIG_MTD_NAND_DISKONCHIP=m +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set +CONFIG_MTD_NAND_CAFE=m +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_PLATFORM=m +CONFIG_MTD_ALAUDA=m +CONFIG_MTD_ONENAND=m +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_2X_PROGRAM=y +CONFIG_MTD_ONENAND_SIM=m + +# +# UBI - Unsorted block images +# +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +CONFIG_MTD_UBI_GLUEBI=y + +# +# UBI debugging options +# +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_PARPORT=m +CONFIG_PARPORT_PC=m +CONFIG_PARPORT_SERIAL=m +CONFIG_PARPORT_PC_FIFO=y +# CONFIG_PARPORT_PC_SUPERIO is not set +CONFIG_PARPORT_PC_PCMCIA=m +# CONFIG_PARPORT_GSC is not set +CONFIG_PARPORT_AX88796=m +CONFIG_PARPORT_1284=y +CONFIG_PARPORT_NOT_PC=y +CONFIG_PNP=y +# CONFIG_PNP_DEBUG is not set + +# +# Protocols +# +CONFIG_PNPACPI=y +CONFIG_BLK_DEV=y +CONFIG_BLK_DEV_FD=m +CONFIG_PARIDE=m + +# +# Parallel IDE high-level drivers +# +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PT=m +CONFIG_PARIDE_PG=m + +# +# Parallel IDE protocol modules +# +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_BPCK6=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +CONFIG_BLK_CPQ_DA=m +CONFIG_BLK_CPQ_CISS_DA=m +CONFIG_CISS_SCSI_TAPE=y +CONFIG_BLK_DEV_DAC960=m +CONFIG_BLK_DEV_UMEM=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_SX8=m +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_ATA_OVER_ETH=m +CONFIG_MISC_DEVICES=y +CONFIG_IBM_ASM=m +CONFIG_PHANTOM=m +CONFIG_EEPROM_93CX6=m +CONFIG_SGI_IOC4=m +CONFIG_TIFM_CORE=m +CONFIG_TIFM_7XX1=m +CONFIG_ASUS_LAPTOP=m +CONFIG_FUJITSU_LAPTOP=m +CONFIG_MSI_LAPTOP=m +CONFIG_SONY_LAPTOP=m +CONFIG_SONYPI_COMPAT=y +CONFIG_THINKPAD_ACPI=m +# CONFIG_THINKPAD_ACPI_DEBUG is not set +CONFIG_THINKPAD_ACPI_BAY=y +CONFIG_IDE=y +CONFIG_IDE_MAX_HWIFS=4 +CONFIG_BLK_DEV_IDE=m + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +# CONFIG_BLK_DEV_HD_IDE is not set +CONFIG_BLK_DEV_IDEDISK=m +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_DELKIN=m +CONFIG_BLK_DEV_IDECD=m +CONFIG_BLK_DEV_IDETAPE=m +CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDESCSI=m +CONFIG_BLK_DEV_IDEACPI=y +# CONFIG_IDE_TASK_IOCTL is not set +CONFIG_IDE_PROC_FS=y + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=m +CONFIG_BLK_DEV_PLATFORM=m +CONFIG_BLK_DEV_CMD640=y +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +CONFIG_BLK_DEV_IDEPNP=y + +# +# PCI IDE chipsets support +# +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_IDEPCI_SHARE_IRQ=y +# CONFIG_IDEPCI_PCIBUS_ORDER is not set +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_GENERIC is not set +CONFIG_BLK_DEV_OPTI621=m +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_AEC62XX=m +CONFIG_BLK_DEV_ALI15X3=m +# CONFIG_WDC_ALI15X3 is not set +CONFIG_BLK_DEV_AMD74XX=m +CONFIG_BLK_DEV_ATIIXP=m +CONFIG_BLK_DEV_CMD64X=m +# CONFIG_BLK_DEV_TRIFLEX is not set +CONFIG_BLK_DEV_CY82C693=m +# CONFIG_BLK_DEV_CS5520 is not set +CONFIG_BLK_DEV_CS5530=m +CONFIG_BLK_DEV_CS5535=m +CONFIG_BLK_DEV_HPT34X=m +# CONFIG_HPT34X_AUTODMA is not set +CONFIG_BLK_DEV_HPT366=m +# CONFIG_BLK_DEV_JMICRON is not set +CONFIG_BLK_DEV_SC1200=m +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +CONFIG_BLK_DEV_NS87415=m +CONFIG_BLK_DEV_PDC202XX_OLD=m +CONFIG_PDC202XX_BURST=y +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +CONFIG_BLK_DEV_TRM290=m +CONFIG_BLK_DEV_VIA82CXXX=m +CONFIG_BLK_DEV_TC86C001=m +# CONFIG_IDE_ARM is not set +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_IDE_ARCH_OBSOLETE_INIT=y +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI device support +# +CONFIG_RAID_ATTRS=m +CONFIG_SCSI=m +CONFIG_SCSI_DMA=y +CONFIG_SCSI_TGT=m +CONFIG_SCSI_NETLINK=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=m +CONFIG_CHR_DEV_ST=m +CONFIG_CHR_DEV_OSST=m +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_SCH=m + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_FC_TGT_ATTRS=y +CONFIG_SCSI_ISCSI_ATTRS=m +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +CONFIG_SCSI_SAS_ATA=y +# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set +CONFIG_SCSI_SRP_ATTRS=m +CONFIG_SCSI_SRP_TGT_ATTRS=y +CONFIG_SCSI_LOWLEVEL=y +CONFIG_ISCSI_TCP=m +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_AIC7XXX=m +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +CONFIG_AIC7XXX_DEBUG_ENABLE=y +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +# CONFIG_SCSI_AIC7XXX_OLD is not set +CONFIG_SCSI_AIC79XX=m +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 +CONFIG_AIC79XX_RESET_DELAY_MS=15000 +CONFIG_AIC79XX_DEBUG_ENABLE=y +CONFIG_AIC79XX_DEBUG_MASK=0 +CONFIG_AIC79XX_REG_PRETTY_PRINT=y +CONFIG_SCSI_AIC94XX=m +# CONFIG_AIC94XX_DEBUG is not set +CONFIG_SCSI_DPT_I2O=m +CONFIG_SCSI_ADVANSYS=m +CONFIG_SCSI_ARCMSR=m +CONFIG_SCSI_ARCMSR_AER=y +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_MAILBOX=m +CONFIG_MEGARAID_LEGACY=m +CONFIG_MEGARAID_SAS=m +CONFIG_SCSI_HPTIOP=m +CONFIG_SCSI_BUSLOGIC=m +# CONFIG_SCSI_OMIT_FLASHPOINT is not set +CONFIG_SCSI_DMX3191D=m +CONFIG_SCSI_EATA=m +CONFIG_SCSI_EATA_TAGGED_QUEUE=y +CONFIG_SCSI_EATA_LINKED_COMMANDS=y +CONFIG_SCSI_EATA_MAX_TAGS=16 +CONFIG_SCSI_FUTURE_DOMAIN=m +CONFIG_SCSI_GDTH=m +CONFIG_SCSI_IPS=m +CONFIG_SCSI_INITIO=m +CONFIG_SCSI_INIA100=m +CONFIG_SCSI_PPA=m +CONFIG_SCSI_IMM=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +CONFIG_SCSI_STEX=m +CONFIG_SCSI_SYM53C8XX_2=m +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +CONFIG_SCSI_SYM53C8XX_MMIO=y +CONFIG_SCSI_IPR=m +# CONFIG_SCSI_IPR_TRACE is not set +# CONFIG_SCSI_IPR_DUMP is not set +CONFIG_SCSI_QLOGIC_1280=m +CONFIG_SCSI_QLA_FC=m +CONFIG_SCSI_QLA_ISCSI=m +CONFIG_SCSI_LPFC=m +CONFIG_SCSI_DC395x=m +CONFIG_SCSI_DC390T=m +CONFIG_SCSI_NSP32=m +CONFIG_SCSI_DEBUG=m +CONFIG_SCSI_SRP=m +CONFIG_SCSI_LOWLEVEL_PCMCIA=y +CONFIG_PCMCIA_AHA152X=m +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_NINJA_SCSI=m +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_SYM53C500=m +CONFIG_ATA=m +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_ACPI=y +CONFIG_SATA_AHCI=m +CONFIG_SATA_SVW=m +CONFIG_ATA_PIIX=m +CONFIG_SATA_MV=m +CONFIG_SATA_NV=m +CONFIG_PDC_ADMA=m +CONFIG_SATA_QSTOR=m +CONFIG_SATA_PROMISE=m +CONFIG_SATA_SX4=m +CONFIG_SATA_SIL=m +CONFIG_SATA_SIL24=m +CONFIG_SATA_SIS=m +CONFIG_SATA_ULI=m +CONFIG_SATA_VIA=m +CONFIG_SATA_VITESSE=m +CONFIG_SATA_INIC162X=m +CONFIG_PATA_ACPI=m +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=m +CONFIG_PATA_ARTOP=m +CONFIG_PATA_ATIIXP=m +# CONFIG_PATA_CMD640_PCI is not set +CONFIG_PATA_CMD64X=m +CONFIG_PATA_CS5520=m +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5535 is not set +CONFIG_PATA_CS5536=m +# CONFIG_PATA_CYPRESS is not set +CONFIG_PATA_EFAR=m +CONFIG_ATA_GENERIC=m +CONFIG_PATA_HPT366=m +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +CONFIG_PATA_HPT3X3=m +# CONFIG_PATA_HPT3X3_DMA is not set +CONFIG_PATA_IT821X=m +CONFIG_PATA_IT8213=m +CONFIG_PATA_JMICRON=m +CONFIG_PATA_TRIFLEX=m +CONFIG_PATA_MARVELL=m +CONFIG_PATA_MPIIX=m +CONFIG_PATA_OLDPIIX=m +CONFIG_PATA_NETCELL=m +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +CONFIG_PATA_PCMCIA=m +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +CONFIG_PATA_RZ1000=m +# CONFIG_PATA_SC1200 is not set +CONFIG_PATA_SERVERWORKS=m +CONFIG_PATA_PDC2027X=m +CONFIG_PATA_SIL680=m +CONFIG_PATA_SIS=m +CONFIG_PATA_VIA=m +CONFIG_PATA_WINBOND=m +CONFIG_PATA_PLATFORM=m +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_MULTIPATH_RDAC=m +CONFIG_DM_MULTIPATH_HP=m +# CONFIG_DM_DELAY is not set +CONFIG_DM_UEVENT=y +CONFIG_FUSION=y +CONFIG_FUSION_SPI=m +CONFIG_FUSION_FC=m +CONFIG_FUSION_SAS=m +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_CTL=m +CONFIG_FUSION_LAN=m +CONFIG_FUSION_LOGGING=y + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +CONFIG_IEEE1394=m + +# +# Subsystem Options +# +# CONFIG_IEEE1394_VERBOSEDEBUG is not set + +# +# Controllers +# +CONFIG_IEEE1394_PCILYNX=m +CONFIG_IEEE1394_OHCI1394=m + +# +# Protocols +# +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_RAWIO=m +CONFIG_I2O=m +CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y +CONFIG_I2O_EXT_ADAPTEC=y +CONFIG_I2O_EXT_ADAPTEC_DMA64=y +CONFIG_I2O_CONFIG=m +CONFIG_I2O_CONFIG_OLD_IOCTL=y +CONFIG_I2O_BUS=m +CONFIG_I2O_BLOCK=m +CONFIG_I2O_SCSI=m +CONFIG_I2O_PROC=m +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_NETDEVICES=y +# CONFIG_NETDEVICES_MULTIQUEUE is not set +CONFIG_IFB=m +CONFIG_DUMMY=m +CONFIG_BONDING=m +CONFIG_MACVLAN=m +CONFIG_EQUALIZER=m +CONFIG_TUN=m +CONFIG_VETH=m +CONFIG_NET_SB1000=m +CONFIG_ARCNET=m +CONFIG_ARCNET_1201=m +CONFIG_ARCNET_1051=m +CONFIG_ARCNET_RAW=m +CONFIG_ARCNET_CAP=m +CONFIG_ARCNET_COM90xx=m +CONFIG_ARCNET_COM90xxIO=m +CONFIG_ARCNET_RIM_I=m +CONFIG_ARCNET_COM20020=m +CONFIG_ARCNET_COM20020_PCI=m +CONFIG_PHYLIB=m + +# +# MII PHY device drivers +# +CONFIG_MARVELL_PHY=m +CONFIG_DAVICOM_PHY=m +CONFIG_QSEMI_PHY=m +CONFIG_LXT_PHY=m +CONFIG_CICADA_PHY=m +CONFIG_VITESSE_PHY=m +CONFIG_SMSC_PHY=m +CONFIG_BROADCOM_PHY=m +CONFIG_ICPLUS_PHY=m +CONFIG_FIXED_PHY=m +# CONFIG_FIXED_MII_10_FDX is not set +# CONFIG_FIXED_MII_100_FDX is not set +CONFIG_FIXED_MII_1000_FDX=y +CONFIG_FIXED_MII_AMNT=1 +CONFIG_MDIO_BITBANG=m +CONFIG_NET_ETHERNET=y +CONFIG_MII=m +CONFIG_HAPPYMEAL=m +CONFIG_SUNGEM=m +CONFIG_CASSINI=m +CONFIG_NET_VENDOR_3COM=y +CONFIG_VORTEX=m +CONFIG_TYPHOON=m +CONFIG_NET_TULIP=y +CONFIG_DE2104X=m +CONFIG_TULIP=m +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_NAPI is not set +CONFIG_DE4X5=m +CONFIG_WINBOND_840=m +CONFIG_DM9102=m +CONFIG_ULI526X=m +CONFIG_PCMCIA_XIRCOM=m +CONFIG_HP100=m +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +CONFIG_NET_PCI=y +CONFIG_PCNET32=m +# CONFIG_PCNET32_NAPI is not set +CONFIG_AMD8111_ETH=m +# CONFIG_AMD8111E_NAPI is not set +CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_ADAPTEC_STARFIRE_NAPI is not set +CONFIG_B44=m +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI=y +CONFIG_FORCEDETH=m +# CONFIG_FORCEDETH_NAPI is not set +CONFIG_EEPRO100=m +CONFIG_E100=m +CONFIG_FEALNX=m +CONFIG_NATSEMI=m +CONFIG_NE2K_PCI=m +CONFIG_8139CP=m +CONFIG_8139TOO=m +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +CONFIG_8139TOO_8129=y +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_SIS900=m +CONFIG_EPIC100=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set +CONFIG_TLAN=m +CONFIG_VIA_RHINE=m +CONFIG_VIA_RHINE_MMIO=y +CONFIG_VIA_RHINE_NAPI=y +CONFIG_SC92031=m +CONFIG_NET_POCKET=y +CONFIG_ATP=m +CONFIG_DE600=m +CONFIG_DE620=m +CONFIG_NETDEV_1000=y +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +CONFIG_DL2K=m +CONFIG_E1000=m +CONFIG_E1000_NAPI=y +# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set +CONFIG_E1000E=m +CONFIG_IP1000=m +CONFIG_NS83820=m +CONFIG_HAMACHI=m +CONFIG_YELLOWFIN=m +CONFIG_R8169=m +# CONFIG_R8169_NAPI is not set +CONFIG_R8169_VLAN=y +CONFIG_SIS190=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SK98LIN is not set +CONFIG_VIA_VELOCITY=m +CONFIG_TIGON3=m +CONFIG_BNX2=m +CONFIG_QLA3XXX=m +CONFIG_ATL1=m +CONFIG_NETDEV_10000=y +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T1_NAPI=y +CONFIG_CHELSIO_T3=m +CONFIG_IXGBE=m +CONFIG_IXGB=m +# CONFIG_IXGB_NAPI is not set +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +CONFIG_MYRI10GE=m +CONFIG_NETXEN_NIC=m +CONFIG_NIU=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_TEHUTI=m +CONFIG_TR=y +CONFIG_IBMOL=m +CONFIG_IBMLS=m +CONFIG_3C359=m +CONFIG_TMS380TR=m +CONFIG_TMSPCI=m +CONFIG_ABYSS=m + +# +# Wireless LAN +# +CONFIG_WLAN_PRE80211=y +CONFIG_STRIP=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_PCMCIA_NETWAVE=m +CONFIG_WLAN_80211=y +CONFIG_PCMCIA_RAYCS=m +CONFIG_IPW2100=m +CONFIG_IPW2100_MONITOR=y +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2200=m +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +# CONFIG_IPW2200_DEBUG is not set +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_USB=m +CONFIG_LIBERTAS_CS=m +CONFIG_LIBERTAS_SDIO=m +# CONFIG_LIBERTAS_DEBUG is not set +CONFIG_AIRO=m +CONFIG_HERMES=m +# CONFIG_PLX_HERMES is not set +# CONFIG_TMD_HERMES is not set +# CONFIG_NORTEL_HERMES is not set +# CONFIG_PCI_HERMES is not set +CONFIG_PCMCIA_HERMES=m +CONFIG_PCMCIA_SPECTRUM=m +CONFIG_ATMEL=m +CONFIG_PCI_ATMEL=m +CONFIG_PCMCIA_ATMEL=m +CONFIG_AIRO_CS=m +CONFIG_PCMCIA_WL3501=m +CONFIG_PRISM54=m +CONFIG_USB_ZD1201=m +CONFIG_RTL8187=m +CONFIG_ADM8211=m +CONFIG_P54_COMMON=m +CONFIG_P54_USB=m +CONFIG_P54_PCI=m +# CONFIG_IWLWIFI is not set +CONFIG_HOSTAP=m +CONFIG_HOSTAP_FIRMWARE=y +CONFIG_HOSTAP_FIRMWARE_NVRAM=y +CONFIG_HOSTAP_PLX=m +CONFIG_HOSTAP_PCI=m +CONFIG_HOSTAP_CS=m +CONFIG_BCM43XX=m +# CONFIG_BCM43XX_DEBUG is not set +CONFIG_BCM43XX_DMA=y +CONFIG_BCM43XX_PIO=y +CONFIG_BCM43XX_DMA_AND_PIO_MODE=y +# CONFIG_BCM43XX_DMA_MODE is not set +# CONFIG_BCM43XX_PIO_MODE is not set +CONFIG_B43=m +CONFIG_B43_PCI_AUTOSELECT=y +CONFIG_B43_PCICORE_AUTOSELECT=y +# CONFIG_B43_PCMCIA is not set +CONFIG_B43_LEDS=y +CONFIG_B43_RFKILL=y +# CONFIG_B43_DEBUG is not set +CONFIG_B43_DMA=y +CONFIG_B43_PIO=y +CONFIG_B43_DMA_AND_PIO_MODE=y +# CONFIG_B43_DMA_MODE is not set +# CONFIG_B43_PIO_MODE is not set +CONFIG_B43LEGACY=m +CONFIG_B43LEGACY_PCI_AUTOSELECT=y +CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +CONFIG_B43LEGACY_DEBUG=y +CONFIG_B43LEGACY_DMA=y +CONFIG_B43LEGACY_PIO=y +CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +# CONFIG_B43LEGACY_DMA_MODE is not set +# CONFIG_B43LEGACY_PIO_MODE is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_RT2X00=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_PCI=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_RFKILL=y +CONFIG_RT2400PCI=m +CONFIG_RT2400PCI_RFKILL=y +CONFIG_RT2500PCI=m +CONFIG_RT2500PCI_RFKILL=y +CONFIG_RT61PCI=m +CONFIG_RT61PCI_RFKILL=y +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +# CONFIG_RT2X00_LIB_DEBUGFS is not set +# CONFIG_RT2X00_DEBUG is not set + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_BELKIN=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +# CONFIG_USB_NET_ZAURUS is not set +CONFIG_NET_PCMCIA=y +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_AXNET=m +CONFIG_ARCNET_COM20020_CS=m +CONFIG_PCMCIA_IBMTR=m +CONFIG_WAN=y +CONFIG_LANMEDIA=m +CONFIG_HDLC=m +CONFIG_HDLC_RAW=m +CONFIG_HDLC_RAW_ETH=m +CONFIG_HDLC_CISCO=m +CONFIG_HDLC_FR=m +CONFIG_HDLC_PPP=m +CONFIG_HDLC_X25=m +CONFIG_PCI200SYN=m +CONFIG_WANXL=m +CONFIG_PC300=m +CONFIG_PC300_MLPPP=y + +# +# Cyclades-PC300 MLPPP support is disabled. +# + +# +# Refer to the file README.mlppp, provided by PC300 package. +# +# CONFIG_PC300TOO is not set +CONFIG_FARSYNC=m +CONFIG_DSCC4=m +CONFIG_DSCC4_PCISYNC=y +CONFIG_DSCC4_PCI_RST=y +CONFIG_DLCI=m +CONFIG_DLCI_MAX=8 +CONFIG_WAN_ROUTER_DRIVERS=m +CONFIG_CYCLADES_SYNC=m +CONFIG_CYCLOMX_X25=y +CONFIG_LAPBETHER=m +CONFIG_X25_ASY=m +CONFIG_SBNI=m +# CONFIG_SBNI_MULTILINE is not set +CONFIG_ATM_DRIVERS=y +# CONFIG_ATM_DUMMY is not set +CONFIG_ATM_TCP=m +CONFIG_ATM_LANAI=m +CONFIG_ATM_ENI=m +# CONFIG_ATM_ENI_DEBUG is not set +# CONFIG_ATM_ENI_TUNE_BURST is not set +CONFIG_ATM_FIRESTREAM=m +CONFIG_ATM_ZATM=m +# CONFIG_ATM_ZATM_DEBUG is not set +CONFIG_ATM_NICSTAR=m +# CONFIG_ATM_NICSTAR_USE_SUNI is not set +# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set +CONFIG_ATM_IDT77252=m +# CONFIG_ATM_IDT77252_DEBUG is not set +# CONFIG_ATM_IDT77252_RCV_ALL is not set +CONFIG_ATM_IDT77252_USE_SUNI=y +CONFIG_ATM_AMBASSADOR=m +# CONFIG_ATM_AMBASSADOR_DEBUG is not set +CONFIG_ATM_HORIZON=m +# CONFIG_ATM_HORIZON_DEBUG is not set +CONFIG_ATM_IA=m +# CONFIG_ATM_IA_DEBUG is not set +CONFIG_ATM_FORE200E_MAYBE=m +CONFIG_ATM_FORE200E_PCA=y +CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y +# CONFIG_ATM_FORE200E_USE_TASKLET is not set +CONFIG_ATM_FORE200E_TX_RETRY=16 +CONFIG_ATM_FORE200E_DEBUG=0 +CONFIG_ATM_FORE200E=m +CONFIG_ATM_HE=m +CONFIG_ATM_HE_USE_SUNI=y +CONFIG_FDDI=y +CONFIG_DEFXX=m +# CONFIG_DEFXX_MMIO is not set +CONFIG_SKFP=m +CONFIG_HIPPI=y +CONFIG_ROADRUNNER=m +# CONFIG_ROADRUNNER_LARGE_RINGS is not set +CONFIG_PLIP=m +CONFIG_PPP=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_FILTER=y +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_MPPE=m +CONFIG_PPPOE=m +CONFIG_PPPOATM=m +CONFIG_PPPOL2TP=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +CONFIG_SLHC=m +CONFIG_SLIP_SMART=y +CONFIG_SLIP_MODE_SLIP6=y +CONFIG_NET_FC=y +CONFIG_SHAPER=m +CONFIG_NETCONSOLE=m +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NET_POLL_CONTROLLER=y +CONFIG_ISDN=m +CONFIG_ISDN_I4L=m +CONFIG_ISDN_PPP=y +CONFIG_ISDN_PPP_VJ=y +CONFIG_ISDN_MPP=y +CONFIG_IPPP_FILTER=y +CONFIG_ISDN_PPP_BSDCOMP=m +CONFIG_ISDN_AUDIO=y +CONFIG_ISDN_TTY_FAX=y +CONFIG_ISDN_X25=y + +# +# ISDN feature submodules +# +CONFIG_ISDN_DIVERSION=m + +# +# ISDN4Linux hardware drivers +# + +# +# Passive cards +# +CONFIG_ISDN_DRV_HISAX=m + +# +# D-channel protocol features +# +CONFIG_HISAX_EURO=y +CONFIG_DE_AOC=y +# CONFIG_HISAX_NO_SENDCOMPLETE is not set +# CONFIG_HISAX_NO_LLC is not set +# CONFIG_HISAX_NO_KEYPAD is not set +CONFIG_HISAX_1TR6=y +CONFIG_HISAX_NI1=y +CONFIG_HISAX_MAX_CARDS=8 + +# +# HiSax supported cards +# +CONFIG_HISAX_16_3=y +CONFIG_HISAX_TELESPCI=y +CONFIG_HISAX_S0BOX=y +CONFIG_HISAX_FRITZPCI=y +CONFIG_HISAX_AVM_A1_PCMCIA=y +CONFIG_HISAX_ELSA=y +CONFIG_HISAX_DIEHLDIVA=y +CONFIG_HISAX_SEDLBAUER=y +CONFIG_HISAX_NETJET=y +CONFIG_HISAX_NETJET_U=y +CONFIG_HISAX_NICCY=y +CONFIG_HISAX_BKM_A4T=y +CONFIG_HISAX_SCT_QUADRO=y +CONFIG_HISAX_GAZEL=y +CONFIG_HISAX_HFC_PCI=y +CONFIG_HISAX_W6692=y +CONFIG_HISAX_HFC_SX=y +CONFIG_HISAX_ENTERNOW_PCI=y +# CONFIG_HISAX_DEBUG is not set + +# +# HiSax PCMCIA card service modules +# +CONFIG_HISAX_SEDLBAUER_CS=m +CONFIG_HISAX_ELSA_CS=m +CONFIG_HISAX_AVM_A1_CS=m +CONFIG_HISAX_TELES_CS=m + +# +# HiSax sub driver modules +# +CONFIG_HISAX_ST5481=m +CONFIG_HISAX_HFCUSB=m +CONFIG_HISAX_HFC4S8S=m +CONFIG_HISAX_FRITZ_PCIPNP=m +CONFIG_HISAX_HDLC=y + +# +# Active cards +# +CONFIG_ISDN_DRV_GIGASET=m +CONFIG_GIGASET_BASE=m +CONFIG_GIGASET_M105=m +CONFIG_GIGASET_M101=m +# CONFIG_GIGASET_DEBUG is not set +# CONFIG_GIGASET_UNDOCREQ is not set +CONFIG_ISDN_CAPI=m +CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y +CONFIG_CAPI_TRACE=y +CONFIG_ISDN_CAPI_MIDDLEWARE=y +CONFIG_ISDN_CAPI_CAPI20=m +CONFIG_ISDN_CAPI_CAPIFS_BOOL=y +CONFIG_ISDN_CAPI_CAPIFS=m +CONFIG_ISDN_CAPI_CAPIDRV=m + +# +# CAPI hardware drivers +# +CONFIG_CAPI_AVM=y +CONFIG_ISDN_DRV_AVMB1_B1PCI=m +CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m +CONFIG_ISDN_DRV_AVMB1_AVM_CS=m +CONFIG_ISDN_DRV_AVMB1_T1PCI=m +CONFIG_ISDN_DRV_AVMB1_C4=m +CONFIG_CAPI_EICON=y +CONFIG_ISDN_DIVAS=m +CONFIG_ISDN_DIVAS_BRIPCI=y +CONFIG_ISDN_DIVAS_PRIPCI=y +CONFIG_ISDN_DIVAS_DIVACAPI=m +CONFIG_ISDN_DIVAS_USERIDI=m +CONFIG_ISDN_DIVAS_MAINT=m +CONFIG_PHONE=m +CONFIG_PHONE_IXJ=m +CONFIG_PHONE_IXJ_PCMCIA=m + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_POLLDEV=m + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_EVDEV=m +CONFIG_INPUT_EVBUG=m + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_SUNKBD=m +CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_XTKBD=m +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_SERIAL=m +CONFIG_MOUSE_APPLETOUCH=m +CONFIG_MOUSE_VSXXXAA=m +CONFIG_INPUT_JOYSTICK=y +CONFIG_JOYSTICK_ANALOG=m +CONFIG_JOYSTICK_A3D=m +CONFIG_JOYSTICK_ADI=m +CONFIG_JOYSTICK_COBRA=m +CONFIG_JOYSTICK_GF2K=m +CONFIG_JOYSTICK_GRIP=m +CONFIG_JOYSTICK_GRIP_MP=m +CONFIG_JOYSTICK_GUILLEMOT=m +CONFIG_JOYSTICK_INTERACT=m +CONFIG_JOYSTICK_SIDEWINDER=m +CONFIG_JOYSTICK_TMDC=m +CONFIG_JOYSTICK_IFORCE=m +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_IFORCE_232=y +CONFIG_JOYSTICK_WARRIOR=m +CONFIG_JOYSTICK_MAGELLAN=m +CONFIG_JOYSTICK_SPACEORB=m +CONFIG_JOYSTICK_SPACEBALL=m +CONFIG_JOYSTICK_STINGER=m +CONFIG_JOYSTICK_TWIDJOY=m +CONFIG_JOYSTICK_DB9=m +CONFIG_JOYSTICK_GAMECON=m +CONFIG_JOYSTICK_TURBOGRAFX=m +CONFIG_JOYSTICK_JOYDUMP=m +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y +CONFIG_INPUT_TABLET=y +CONFIG_TABLET_USB_ACECAD=m +CONFIG_TABLET_USB_AIPTEK=m +CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_KBTAB=m +CONFIG_TABLET_USB_WACOM=m +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_FUJITSU=m +CONFIG_TOUCHSCREEN_GUNZE=m +CONFIG_TOUCHSCREEN_ELO=m +CONFIG_TOUCHSCREEN_MTOUCH=m +CONFIG_TOUCHSCREEN_MK712=m +CONFIG_TOUCHSCREEN_PENMOUNT=m +CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +CONFIG_TOUCHSCREEN_TOUCHWIN=m +CONFIG_TOUCHSCREEN_UCB1400=m +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_INPUT_MISC=y +CONFIG_INPUT_PCSPKR=m +CONFIG_INPUT_WISTRON_BTNS=m +CONFIG_INPUT_ATLAS_BTNS=m +CONFIG_INPUT_ATI_REMOTE=m +CONFIG_INPUT_ATI_REMOTE2=m +CONFIG_INPUT_KEYSPAN_REMOTE=m +CONFIG_INPUT_POWERMATE=m +CONFIG_INPUT_YEALINK=m +CONFIG_INPUT_UINPUT=m + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_SERPORT=m +CONFIG_SERIO_CT82C710=m +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_PCIPS2=m +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=m +CONFIG_GAMEPORT=m +CONFIG_GAMEPORT_NS558=m +CONFIG_GAMEPORT_L4=m +CONFIG_GAMEPORT_EMU10K1=m +CONFIG_GAMEPORT_FM801=m + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_DEV_KMEM is not set +CONFIG_SERIAL_NONSTANDARD=y +# CONFIG_COMPUTONE is not set +CONFIG_ROCKETPORT=m +CONFIG_CYCLADES=m +# CONFIG_CYZ_INTR is not set +CONFIG_DIGIEPCA=m +# CONFIG_MOXA_INTELLIO is not set +# CONFIG_MOXA_SMARTIO is not set +CONFIG_MOXA_SMARTIO_NEW=m +# CONFIG_ISI is not set +CONFIG_SYNCLINK=m +CONFIG_SYNCLINKMP=m +CONFIG_SYNCLINK_GT=m +CONFIG_N_HDLC=m +CONFIG_SPECIALIX=m +# CONFIG_SPECIALIX_RTSCTS is not set +CONFIG_SX=m +# CONFIG_RIO is not set +CONFIG_STALDRV=y + +# +# Serial drivers +# +CONFIG_SERIAL_8250=m +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_SERIAL_8250_PCI=m +CONFIG_SERIAL_8250_PNP=m +CONFIG_SERIAL_8250_CS=m +CONFIG_SERIAL_8250_NR_UARTS=48 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_RSA=y + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=m +CONFIG_SERIAL_JSM=m +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_PRINTER=m +# CONFIG_LP_CONSOLE is not set +CONFIG_PPDEV=m +CONFIG_IPMI_HANDLER=m +# CONFIG_IPMI_PANIC_EVENT is not set +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m +CONFIG_IPMI_POWEROFF=m +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_INTEL=m +CONFIG_HW_RANDOM_AMD=m +CONFIG_HW_RANDOM_GEODE=m +CONFIG_HW_RANDOM_VIA=m +CONFIG_NVRAM=m +CONFIG_RTC=y +CONFIG_R3964=m +CONFIG_APPLICOM=m +CONFIG_SONYPI=m + +# +# PCMCIA character devices +# +CONFIG_SYNCLINK_CS=m +CONFIG_CARDMAN_4000=m +CONFIG_CARDMAN_4040=m +CONFIG_MWAVE=m +CONFIG_SCx200_GPIO=m +CONFIG_PC8736x_GPIO=m +CONFIG_NSC_GPIO=m +CONFIG_CS5535_GPIO=m +CONFIG_RAW_DRIVER=m +CONFIG_MAX_RAW_DEVS=256 +CONFIG_HPET=y +# CONFIG_HPET_RTC_IRQ is not set +CONFIG_HPET_MMAP=y +CONFIG_HANGCHECK_TIMER=m +CONFIG_TCG_TPM=m +CONFIG_TCG_TIS=m +CONFIG_TCG_NSC=m +CONFIG_TCG_ATMEL=m +CONFIG_TCG_INFINEON=m +# CONFIG_TCG_XEN is not set +CONFIG_TELCLOCK=m +CONFIG_DEVPORT=y +CONFIG_I2C=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=m +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_ALGOPCA=m + +# +# I2C Hardware Bus support +# +CONFIG_I2C_ALI1535=m +CONFIG_I2C_ALI1563=m +CONFIG_I2C_ALI15X3=m +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_I801=m +CONFIG_I2C_I810=m +CONFIG_I2C_PIIX4=m +CONFIG_I2C_NFORCE2=m +CONFIG_I2C_OCORES=m +CONFIG_I2C_PARPORT=m +CONFIG_I2C_PARPORT_LIGHT=m +CONFIG_I2C_PROSAVAGE=m +CONFIG_I2C_SAVAGE4=m +CONFIG_I2C_SIMTEC=m +CONFIG_SCx200_I2C=m +CONFIG_SCx200_I2C_SCL=12 +CONFIG_SCx200_I2C_SDA=13 +CONFIG_SCx200_ACB=m +CONFIG_I2C_SIS5595=m +CONFIG_I2C_SIS630=m +CONFIG_I2C_SIS96X=m +CONFIG_I2C_TAOS_EVM=m +CONFIG_I2C_STUB=m +CONFIG_I2C_TINY_USB=m +CONFIG_I2C_VIA=m +CONFIG_I2C_VIAPRO=m +CONFIG_I2C_VOODOO3=m + +# +# Miscellaneous I2C Chip support +# +CONFIG_SENSORS_DS1337=m +CONFIG_SENSORS_DS1374=m +CONFIG_DS1682=m +CONFIG_SENSORS_EEPROM=m +CONFIG_SENSORS_PCF8574=m +CONFIG_SENSORS_PCA9539=m +CONFIG_SENSORS_PCF8591=m +CONFIG_SENSORS_MAX6875=m +CONFIG_SENSORS_TSL2550=m +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# SPI support +# +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +CONFIG_SPI_BITBANG=m +CONFIG_SPI_BUTTERFLY=m +CONFIG_SPI_LM70_LLP=m + +# +# SPI Protocol Masters +# +CONFIG_SPI_AT25=m +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_TLE62X0=m +CONFIG_W1=m +CONFIG_W1_CON=y + +# +# 1-wire Bus Masters +# +CONFIG_W1_MASTER_MATROX=m +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_DS2482=m + +# +# 1-wire Slaves +# +CONFIG_W1_SLAVE_THERM=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2760=m +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_PDA_POWER=m +CONFIG_BATTERY_DS2760=m +CONFIG_HWMON=y +CONFIG_HWMON_VID=m +CONFIG_SENSORS_ABITUGURU=m +CONFIG_SENSORS_ABITUGURU3=m +CONFIG_SENSORS_AD7418=m +CONFIG_SENSORS_ADM1021=m +CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m +CONFIG_SENSORS_ADM1029=m +CONFIG_SENSORS_ADM1031=m +CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7470=m +CONFIG_SENSORS_K8TEMP=m +CONFIG_SENSORS_ASB100=m +CONFIG_SENSORS_ATXP1=m +CONFIG_SENSORS_DS1621=m +CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_F71805F=m +CONFIG_SENSORS_F71882FG=m +CONFIG_SENSORS_F75375S=m +CONFIG_SENSORS_FSCHER=m +CONFIG_SENSORS_FSCPOS=m +CONFIG_SENSORS_FSCHMD=m +CONFIG_SENSORS_GL518SM=m +CONFIG_SENSORS_GL520SM=m +CONFIG_SENSORS_CORETEMP=m +CONFIG_SENSORS_IBMPEX=m +CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_LM63=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_LM77=m +CONFIG_SENSORS_LM78=m +CONFIG_SENSORS_LM80=m +CONFIG_SENSORS_LM83=m +CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m +CONFIG_SENSORS_LM90=m +CONFIG_SENSORS_LM92=m +CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_PC87427=m +CONFIG_SENSORS_SIS5595=m +CONFIG_SENSORS_DME1737=m +CONFIG_SENSORS_SMSC47M1=m +CONFIG_SENSORS_SMSC47M192=m +CONFIG_SENSORS_SMSC47B397=m +CONFIG_SENSORS_THMC50=m +CONFIG_SENSORS_VIA686A=m +CONFIG_SENSORS_VT1211=m +CONFIG_SENSORS_VT8231=m +CONFIG_SENSORS_W83781D=m +CONFIG_SENSORS_W83791D=m +CONFIG_SENSORS_W83792D=m +CONFIG_SENSORS_W83793=m +CONFIG_SENSORS_W83L785TS=m +CONFIG_SENSORS_W83627HF=m +CONFIG_SENSORS_W83627EHF=m +CONFIG_SENSORS_HDAPS=m +CONFIG_SENSORS_APPLESMC=m +# CONFIG_HWMON_DEBUG_CHIP is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +CONFIG_SOFT_WATCHDOG=m +CONFIG_ACQUIRE_WDT=m +CONFIG_ADVANTECH_WDT=m +CONFIG_ALIM1535_WDT=m +CONFIG_ALIM7101_WDT=m +CONFIG_SC520_WDT=m +CONFIG_EUROTECH_WDT=m +CONFIG_IB700_WDT=m +CONFIG_IBMASR=m +CONFIG_WAFER_WDT=m +CONFIG_I6300ESB_WDT=m +CONFIG_ITCO_WDT=m +CONFIG_ITCO_VENDOR_SUPPORT=y +CONFIG_IT8712F_WDT=m +CONFIG_SC1200_WDT=m +CONFIG_SCx200_WDT=m +CONFIG_PC87413_WDT=m +CONFIG_60XX_WDT=m +CONFIG_SBC8360_WDT=m +CONFIG_SBC7240_WDT=m +CONFIG_CPU5_WDT=m +CONFIG_SMSC37B787_WDT=m +CONFIG_W83627HF_WDT=m +CONFIG_W83697HF_WDT=m +CONFIG_W83877F_WDT=m +CONFIG_W83977F_WDT=m +CONFIG_MACHZ_WDT=m +CONFIG_SBC_EPX_C3_WATCHDOG=m + +# +# PCI-based Watchdog Cards +# +CONFIG_PCIPCWATCHDOG=m +CONFIG_WDTPCI=m +CONFIG_WDT_501_PCI=y + +# +# USB-based Watchdog Cards +# +CONFIG_USBPCWATCHDOG=m + +# +# Sonics Silicon Backplane +# +CONFIG_SSB_POSSIBLE=y +CONFIG_SSB=m +CONFIG_SSB_PCIHOST_POSSIBLE=y +CONFIG_SSB_PCIHOST=y +CONFIG_SSB_PCMCIAHOST_POSSIBLE=y +# CONFIG_SSB_PCMCIAHOST is not set +# CONFIG_SSB_SILENT is not set +# CONFIG_SSB_DEBUG is not set +CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +CONFIG_SSB_DRIVER_PCICORE=y + +# +# Multifunction device drivers +# +CONFIG_MFD_SM501=m + +# +# Multimedia devices +# +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set + +# +# Encoders/decoders and other helper chips +# + +# +# Audio decoders +# +CONFIG_VIDEO_TVAUDIO=m +CONFIG_VIDEO_TDA7432=m +CONFIG_VIDEO_TDA9840=m +CONFIG_VIDEO_TDA9875=m +CONFIG_VIDEO_TEA6415C=m +CONFIG_VIDEO_TEA6420=m +CONFIG_VIDEO_MSP3400=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_TLV320AIC23B=m +CONFIG_VIDEO_WM8775=m +CONFIG_VIDEO_WM8739=m +CONFIG_VIDEO_VP27SMPX=m + +# +# Video decoders +# +CONFIG_VIDEO_BT819=m +CONFIG_VIDEO_BT856=m +CONFIG_VIDEO_BT866=m +CONFIG_VIDEO_KS0127=m +CONFIG_VIDEO_OV7670=m +CONFIG_VIDEO_TCM825X=m +CONFIG_VIDEO_SAA7110=m +CONFIG_VIDEO_SAA7111=m +CONFIG_VIDEO_SAA7114=m +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_SAA7191=m +CONFIG_VIDEO_TVP5150=m +CONFIG_VIDEO_VPX3220=m + +# +# Video and audio decoders +# +CONFIG_VIDEO_CX25840=m + +# +# MPEG video encoders +# +CONFIG_VIDEO_CX2341X=m + +# +# Video encoders +# +CONFIG_VIDEO_SAA7127=m +CONFIG_VIDEO_SAA7185=m +CONFIG_VIDEO_ADV7170=m +CONFIG_VIDEO_ADV7175=m + +# +# Video improvement chips +# +CONFIG_VIDEO_UPD64031A=m +CONFIG_VIDEO_UPD64083=m +CONFIG_VIDEO_VIVI=m +CONFIG_VIDEO_BT848=m +CONFIG_VIDEO_BT848_DVB=y +CONFIG_VIDEO_SAA6588=m +CONFIG_VIDEO_BWQCAM=m +CONFIG_VIDEO_CQCAM=m +CONFIG_VIDEO_W9966=m +CONFIG_VIDEO_CPIA=m +CONFIG_VIDEO_CPIA_PP=m +CONFIG_VIDEO_CPIA_USB=m +CONFIG_VIDEO_CPIA2=m +CONFIG_VIDEO_SAA5246A=m +CONFIG_VIDEO_SAA5249=m +CONFIG_TUNER_3036=m +CONFIG_VIDEO_STRADIS=m +CONFIG_VIDEO_ZORAN_ZR36060=m +CONFIG_VIDEO_ZORAN=m +CONFIG_VIDEO_ZORAN_BUZ=m +CONFIG_VIDEO_ZORAN_DC10=m +CONFIG_VIDEO_ZORAN_DC30=m +CONFIG_VIDEO_ZORAN_LML33=m +CONFIG_VIDEO_ZORAN_LML33R10=m +CONFIG_VIDEO_ZORAN_AVS6EYES=m +CONFIG_VIDEO_MEYE=m +CONFIG_VIDEO_SAA7134=m +# CONFIG_VIDEO_SAA7134_ALSA is not set +# CONFIG_VIDEO_SAA7134_OSS is not set +CONFIG_VIDEO_SAA7134_DVB=m +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_DPC is not set +CONFIG_VIDEO_HEXIUM_ORION=m +CONFIG_VIDEO_HEXIUM_GEMINI=m +CONFIG_VIDEO_CX88=m +# CONFIG_VIDEO_CX88_ALSA is not set +CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_DVB=m +CONFIG_VIDEO_CX88_VP3054=m +CONFIG_VIDEO_CX23885=m +CONFIG_VIDEO_IVTV=m +CONFIG_VIDEO_FB_IVTV=m +CONFIG_VIDEO_CAFE_CCIC=m +CONFIG_V4L_USB_DRIVERS=y +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_29XXX=y +CONFIG_VIDEO_PVRUSB2_24XXX=y +CONFIG_VIDEO_PVRUSB2_SYSFS=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_USBVIDEO=m +CONFIG_USB_VICAM=m +CONFIG_USB_IBMCAM=m +CONFIG_USB_KONICAWC=m +CONFIG_USB_QUICKCAM_MESSENGER=m +CONFIG_USB_ET61X251=m +CONFIG_VIDEO_OVCAMCHIP=m +CONFIG_USB_W9968CF=m +# CONFIG_USB_OV511 is not set +CONFIG_USB_SE401=m +CONFIG_USB_SN9C102=m +CONFIG_USB_STV680=m +CONFIG_USB_ZC0301=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_ZR364XX=m +CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_GEMTEK_PCI=m +CONFIG_RADIO_MAXIRADIO=m +CONFIG_RADIO_MAESTRO=m +CONFIG_USB_DSBR=m +CONFIG_DVB_CORE=m +CONFIG_DVB_CORE_ATTACH=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_DVB_AV7110=m +CONFIG_DVB_AV7110_OSD=y +CONFIG_DVB_BUDGET=m +CONFIG_DVB_BUDGET_CI=m +CONFIG_DVB_BUDGET_AV=m +CONFIG_DVB_BUDGET_PATCH=m + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_CINERGYT2=m +CONFIG_DVB_CINERGYT2_TUNING=y +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512 +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250 +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100 + +# +# Supported FlexCopII (B2C2) Adapters +# +CONFIG_DVB_B2C2_FLEXCOP=m +CONFIG_DVB_B2C2_FLEXCOP_PCI=m +CONFIG_DVB_B2C2_FLEXCOP_USB=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set + +# +# Supported BT878 Adapters +# +CONFIG_DVB_BT8XX=m + +# +# Supported Pluto2 Adapters +# +CONFIG_DVB_PLUTO2=m + +# +# Supported DVB Frontends +# + +# +# Customise DVB Frontends +# +# CONFIG_DVB_FE_CUSTOMISE is not set + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_STV0299=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_MT312=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_TDA10086=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_S5H1409=m + +# +# Tuners/PLL support +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TDA827X=m +CONFIG_DVB_TUNER_QT1010=m +CONFIG_DVB_TUNER_MT2060=m +CONFIG_DVB_TUNER_MT2266=m +CONFIG_DVB_TUNER_MT2131=m +CONFIG_DVB_TUNER_DIB0070=m + +# +# Miscellaneous devices +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_TUA6100=m +CONFIG_VIDEO_SAA7146=m +CONFIG_VIDEO_SAA7146_VV=m +CONFIG_VIDEO_TUNER=m +# CONFIG_VIDEO_TUNER_CUSTOMIZE is not set +CONFIG_TUNER_MT20XX=m +CONFIG_TUNER_TDA8290=m +CONFIG_TUNER_TEA5761=m +CONFIG_TUNER_TEA5767=m +CONFIG_TUNER_SIMPLE=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_DMA_SG=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_BTCX=m +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_IR=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_DAB=y +CONFIG_USB_DABUSB=m + +# +# Graphics support +# +CONFIG_AGP=m +CONFIG_AGP_ALI=m +CONFIG_AGP_ATI=m +CONFIG_AGP_AMD=m +CONFIG_AGP_AMD64=m +CONFIG_AGP_INTEL=m +CONFIG_AGP_NVIDIA=m +CONFIG_AGP_SIS=m +CONFIG_AGP_SWORKS=m +CONFIG_AGP_VIA=m +CONFIG_AGP_EFFICEON=m +CONFIG_DRM=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_I810=m +CONFIG_DRM_I830=m +CONFIG_DRM_I915=m +CONFIG_DRM_MGA=m +CONFIG_DRM_SIS=m +CONFIG_DRM_VIA=m +CONFIG_DRM_SAVAGE=m +CONFIG_VGASTATE=m +CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_FB=y +CONFIG_FIRMWARE_EDID=y +CONFIG_FB_DDC=m +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +CONFIG_FB_SYS_FILLRECT=m +CONFIG_FB_SYS_COPYAREA=m +CONFIG_FB_SYS_IMAGEBLIT=m +CONFIG_FB_SYS_FOPS=m +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_SVGALIB=m +# CONFIG_FB_MACMODES is not set +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y + +# +# Frame buffer hardware drivers +# +CONFIG_FB_CIRRUS=m +CONFIG_FB_PM2=m +CONFIG_FB_PM2_FIFO_DISCONNECT=y +CONFIG_FB_CYBER2000=m +CONFIG_FB_ARC=m +CONFIG_FB_ASILIANT=y +CONFIG_FB_IMSTT=y +CONFIG_FB_VGA16=m +CONFIG_FB_UVESA=m +CONFIG_FB_VESA=m +CONFIG_FB_EFI=y +CONFIG_FB_HECUBA=m +CONFIG_FB_HGA=m +# CONFIG_FB_HGA_ACCEL is not set +CONFIG_FB_S1D13XXX=m +CONFIG_FB_NVIDIA=m +CONFIG_FB_NVIDIA_I2C=y +# CONFIG_FB_NVIDIA_DEBUG is not set +CONFIG_FB_NVIDIA_BACKLIGHT=y +CONFIG_FB_RIVA=m +CONFIG_FB_RIVA_I2C=y +# CONFIG_FB_RIVA_DEBUG is not set +CONFIG_FB_RIVA_BACKLIGHT=y +CONFIG_FB_I810=m +# CONFIG_FB_I810_GTF is not set +CONFIG_FB_LE80578=m +CONFIG_FB_CARILLO_RANCH=m +CONFIG_FB_INTEL=m +# CONFIG_FB_INTEL_DEBUG is not set +CONFIG_FB_INTEL_I2C=y +CONFIG_FB_MATROX=m +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_MATROX_G=y +CONFIG_FB_MATROX_I2C=m +CONFIG_FB_MATROX_MAVEN=m +CONFIG_FB_MATROX_MULTIHEAD=y +CONFIG_FB_RADEON=m +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RADEON_BACKLIGHT=y +# CONFIG_FB_RADEON_DEBUG is not set +CONFIG_FB_ATY128=m +CONFIG_FB_ATY128_BACKLIGHT=y +CONFIG_FB_ATY=m +CONFIG_FB_ATY_CT=y +CONFIG_FB_ATY_GENERIC_LCD=y +CONFIG_FB_ATY_GX=y +CONFIG_FB_ATY_BACKLIGHT=y +CONFIG_FB_S3=m +CONFIG_FB_SAVAGE=m +CONFIG_FB_SAVAGE_I2C=y +CONFIG_FB_SAVAGE_ACCEL=y +CONFIG_FB_SIS=m +CONFIG_FB_SIS_300=y +CONFIG_FB_SIS_315=y +CONFIG_FB_NEOMAGIC=m +CONFIG_FB_KYRO=m +CONFIG_FB_3DFX=m +# CONFIG_FB_3DFX_ACCEL is not set +CONFIG_FB_VOODOO1=m +CONFIG_FB_VT8623=m +CONFIG_FB_CYBLA=m +CONFIG_FB_TRIDENT=m +# CONFIG_FB_TRIDENT_ACCEL is not set +CONFIG_FB_ARK=m +CONFIG_FB_PM3=m +CONFIG_FB_GEODE=y +CONFIG_FB_GEODE_LX=m +CONFIG_FB_GEODE_GX=m +# CONFIG_FB_GEODE_GX_SET_FBSIZE is not set +CONFIG_FB_GEODE_GX1=m +CONFIG_FB_SM501=m +# CONFIG_FB_VIRTUAL is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_LTV350QV=m +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=m +CONFIG_BACKLIGHT_PROGEAR=m +CONFIG_BACKLIGHT_CARILLO_RANCH=m + +# +# Display device support +# +CONFIG_DISPLAY_SUPPORT=m + +# +# Display hardware drivers +# + +# +# Console display driver support +# +CONFIG_VGA_CONSOLE=y +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +CONFIG_VIDEO_SELECT=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +# CONFIG_LOGO is not set + +# +# Sound +# +CONFIG_SOUND=m + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=m +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m +CONFIG_SND_SEQUENCER=m +CONFIG_SND_SEQ_DUMMY=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +CONFIG_SND_SEQUENCER_OSS=y +CONFIG_SND_RTCTIMER=m +CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y +CONFIG_SND_DYNAMIC_MINORS=y +CONFIG_SND_SUPPORT_OLD_API=y +# CONFIG_SND_VERBOSE_PROCFS is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set + +# +# Generic devices +# +CONFIG_SND_MPU401_UART=m +CONFIG_SND_OPL3_LIB=m +CONFIG_SND_VX_LIB=m +CONFIG_SND_AC97_CODEC=m +CONFIG_SND_DUMMY=m +CONFIG_SND_VIRMIDI=m +CONFIG_SND_MTPAV=m +CONFIG_SND_MTS64=m +CONFIG_SND_SERIAL_U16550=m +CONFIG_SND_MPU401=m +CONFIG_SND_PORTMAN2X4=m +CONFIG_SND_SB_COMMON=m +CONFIG_SND_SB16_DSP=m + +# +# PCI devices +# +CONFIG_SND_AD1889=m +CONFIG_SND_ALS300=m +CONFIG_SND_ALS4000=m +CONFIG_SND_ALI5451=m +CONFIG_SND_ATIIXP=m +CONFIG_SND_ATIIXP_MODEM=m +CONFIG_SND_AU8810=m +CONFIG_SND_AU8820=m +CONFIG_SND_AU8830=m +CONFIG_SND_AZT3328=m +CONFIG_SND_BT87X=m +CONFIG_SND_BT87X_OVERCLOCK=y +CONFIG_SND_CA0106=m +CONFIG_SND_CMIPCI=m +CONFIG_SND_CS4281=m +CONFIG_SND_CS46XX=m +CONFIG_SND_CS46XX_NEW_DSP=y +CONFIG_SND_CS5530=m +CONFIG_SND_CS5535AUDIO=m +CONFIG_SND_DARLA20=m +CONFIG_SND_GINA20=m +CONFIG_SND_LAYLA20=m +CONFIG_SND_DARLA24=m +CONFIG_SND_GINA24=m +CONFIG_SND_LAYLA24=m +CONFIG_SND_MONA=m +CONFIG_SND_MIA=m +CONFIG_SND_ECHO3G=m +CONFIG_SND_INDIGO=m +CONFIG_SND_INDIGOIO=m +CONFIG_SND_INDIGODJ=m +CONFIG_SND_EMU10K1=m +CONFIG_SND_EMU10K1X=m +CONFIG_SND_ENS1370=m +CONFIG_SND_ENS1371=m +CONFIG_SND_ES1938=m +CONFIG_SND_ES1968=m +CONFIG_SND_FM801=m +CONFIG_SND_FM801_TEA575X_BOOL=y +CONFIG_SND_FM801_TEA575X=m +CONFIG_SND_HDA_INTEL=m +CONFIG_SND_HDA_HWDEP=y +CONFIG_SND_HDA_CODEC_REALTEK=y +CONFIG_SND_HDA_CODEC_ANALOG=y +CONFIG_SND_HDA_CODEC_SIGMATEL=y +CONFIG_SND_HDA_CODEC_VIA=y +CONFIG_SND_HDA_CODEC_ATIHDMI=y +CONFIG_SND_HDA_CODEC_CONEXANT=y +CONFIG_SND_HDA_CODEC_CMEDIA=y +CONFIG_SND_HDA_CODEC_SI3054=y +CONFIG_SND_HDA_GENERIC=y +CONFIG_SND_HDA_POWER_SAVE=y +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDSP=m +CONFIG_SND_HDSPM=m +CONFIG_SND_ICE1712=m +CONFIG_SND_ICE1724=m +CONFIG_SND_INTEL8X0=m +CONFIG_SND_INTEL8X0M=m +CONFIG_SND_KORG1212=m +CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MAESTRO3=m +CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL=y +CONFIG_SND_MIXART=m +CONFIG_SND_NM256=m +CONFIG_SND_PCXHR=m +CONFIG_SND_RIPTIDE=m +CONFIG_SND_RME32=m +CONFIG_SND_RME96=m +CONFIG_SND_RME9652=m +CONFIG_SND_SONICVIBES=m +CONFIG_SND_TRIDENT=m +CONFIG_SND_VIA82XX=m +CONFIG_SND_VIA82XX_MODEM=m +CONFIG_SND_VX222=m +CONFIG_SND_YMFPCI=m +CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y +CONFIG_SND_AC97_POWER_SAVE=y +CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0 + +# +# SPI devices +# + +# +# USB devices +# +CONFIG_SND_USB_AUDIO=m +CONFIG_SND_USB_USX2Y=m +CONFIG_SND_USB_CAIAQ=m +CONFIG_SND_USB_CAIAQ_INPUT=y + +# +# PCMCIA devices +# +CONFIG_SND_VXPOCKET=m +CONFIG_SND_PDAUDIOCF=m + +# +# System on Chip audio support +# +CONFIG_SND_SOC=m + +# +# SoC Audio support for SuperH +# + +# +# Open Sound System +# +CONFIG_SOUND_PRIME=m +CONFIG_SOUND_TRIDENT=m +CONFIG_SOUND_MSNDCLAS=m +CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin" +CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin" +CONFIG_SOUND_MSNDPIN=m +CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin" +CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin" +CONFIG_SOUND_OSS=m +# CONFIG_SOUND_TRACEINIT is not set +CONFIG_SOUND_DMAP=y +CONFIG_SOUND_SSCAPE=m +CONFIG_SOUND_VMIDI=m +CONFIG_SOUND_TRIX=m +CONFIG_SOUND_MSS=m +CONFIG_SOUND_MPU401=m +CONFIG_SOUND_PAS=m +CONFIG_SOUND_PSS=m +CONFIG_PSS_MIXER=y +CONFIG_SOUND_SB=m +CONFIG_SOUND_YM3812=m +CONFIG_SOUND_UART6850=m +CONFIG_SOUND_AEDSP16=m +CONFIG_SC6600=y +CONFIG_SC6600_JOY=y +CONFIG_SC6600_CDROM=4 +CONFIG_SC6600_CDROMBASE=0 +CONFIG_AEDSP16_MSS=y +# CONFIG_AEDSP16_SBPRO is not set +CONFIG_SOUND_KAHLUA=m +CONFIG_AC97_BUS=m +CONFIG_HID_SUPPORT=y +CONFIG_HID=m +# CONFIG_HID_DEBUG is not set +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=m +CONFIG_USB_HIDINPUT_POWERBOOK=y +# CONFIG_HID_FF is not set +CONFIG_USB_HIDDEV=y + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m +CONFIG_USB_SUPPORT=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB=m +# CONFIG_USB_DEBUG is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_SUSPEND=y +# CONFIG_USB_PERSIST is not set +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_ISP116X_HCD=m +CONFIG_USB_OHCI_HCD=m +CONFIG_USB_OHCI_HCD_SSB=y +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +CONFIG_USB_UHCI_HCD=m +CONFIG_USB_U132_HCD=m +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SL811_CS=m +CONFIG_USB_R8A66597_HCD=m + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# +# may also be needed; see USB_STORAGE Help for more information +# +CONFIG_USB_STORAGE=m +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_LIBUSUAL=y + +# +# USB Imaging devices +# +CONFIG_USB_MDC800=m +CONFIG_USB_MICROTEK=m +CONFIG_USB_MON=y + +# +# USB port drivers +# +CONFIG_USB_USS720=m + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m +# CONFIG_USB_SERIAL_IR is not set +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_DEBUG=m +CONFIG_USB_EZUSB=y + +# +# USB Miscellaneous drivers +# +CONFIG_USB_EMI62=m +CONFIG_USB_EMI26=m +CONFIG_USB_ADUTUX=m +CONFIG_USB_AUERSWALD=m +CONFIG_USB_RIO500=m +CONFIG_USB_LEGOTOWER=m +CONFIG_USB_LCD=m +CONFIG_USB_BERRY_CHARGE=m +CONFIG_USB_LED=m +CONFIG_USB_CYPRESS_CY7C63=m +CONFIG_USB_CYTHERM=m +CONFIG_USB_PHIDGET=m +CONFIG_USB_PHIDGETKIT=m +CONFIG_USB_PHIDGETMOTORCONTROL=m +CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_IDMOUSE=m +CONFIG_USB_FTDI_ELAN=m +CONFIG_USB_APPLEDISPLAY=m +CONFIG_USB_SISUSBVGA=m +# CONFIG_USB_SISUSBVGA_CON is not set +CONFIG_USB_LD=m +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_IOWARRIOR=m +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# +CONFIG_USB_ATM=m +CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_CXACRU=m +CONFIG_USB_UEAGLEATM=m +CONFIG_USB_XUSBATM=m + +# +# USB Gadget Support +# +CONFIG_USB_GADGET=m +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_SELECTED=y +# CONFIG_USB_GADGET_AMD5536UDC is not set +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +CONFIG_USB_GADGET_NET2280=y +CONFIG_USB_NET2280=m +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_M66592 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_S3C2410 is not set +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_DUMMY_HCD is not set +CONFIG_USB_GADGET_DUALSPEED=y +CONFIG_USB_ZERO=m +CONFIG_USB_ETH=m +CONFIG_USB_ETH_RNDIS=y +CONFIG_USB_GADGETFS=m +CONFIG_USB_FILE_STORAGE=m +# CONFIG_USB_FILE_STORAGE_TEST is not set +CONFIG_USB_G_SERIAL=m +# CONFIG_USB_MIDI_GADGET is not set + +# +# MMC/SD/SDIO support, can only select one arch from MMC and MSS +# +CONFIG_MMC=m +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_UNSAFE_RESUME is not set + +# +# MMC/SD Card Drivers +# +CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_BOUNCE=y +CONFIG_SDIO_UART=m + +# +# MMC/SD Host Controller Drivers +# +CONFIG_MMC_SDHCI=m +CONFIG_MMC_RICOH_MMC=m +CONFIG_MMC_WBSD=m +CONFIG_MMC_TIFM_SD=m +# CONFIG_MSS is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=m + +# +# LED drivers +# +CONFIG_LEDS_NET48XX=m +CONFIG_LEDS_WRAP=m + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_TRIGGER_IDE_DISK=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_MEM=y +CONFIG_INFINIBAND_ADDR_TRANS=y +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_AMSO1100=m +CONFIG_INFINIBAND_AMSO1100_DEBUG=y +CONFIG_INFINIBAND_CXGB3=m +# CONFIG_INFINIBAND_CXGB3_DEBUG is not set +CONFIG_MLX4_INFINIBAND=m +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_CM=y +CONFIG_INFINIBAND_IPOIB_DEBUG=y +# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set +CONFIG_INFINIBAND_SRP=m +CONFIG_INFINIBAND_ISER=m +CONFIG_EDAC=y + +# +# Reporting subsystems +# +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_MM_EDAC=m +# CONFIG_EDAC_AMD76X is not set +CONFIG_EDAC_E7XXX=m +CONFIG_EDAC_E752X=m +CONFIG_EDAC_I82875P=m +CONFIG_EDAC_I82975X=m +CONFIG_EDAC_I3000=m +CONFIG_EDAC_I82860=m +CONFIG_EDAC_R82600=m +CONFIG_EDAC_I5000=m +CONFIG_RTC_LIB=m +CONFIG_RTC_CLASS=m + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_DRV_TEST=m + +# +# I2C RTC drivers +# +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y + +# +# SPI RTC drivers +# +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_MAX6902=m + +# +# Platform RTC drivers +# +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_V3020=m + +# +# on-CPU RTC drivers +# +CONFIG_DMADEVICES=y + +# +# DMA Devices +# +CONFIG_INTEL_IOATDMA=m +CONFIG_DMA_ENGINE=y + +# +# DMA Clients +# +CONFIG_NET_DMA=y +CONFIG_DCA=m +CONFIG_AUXDISPLAY=y +CONFIG_KS0108=m +CONFIG_KS0108_PORT=0x378 +CONFIG_KS0108_DELAY=2 +CONFIG_CFAG12864B=m +CONFIG_CFAG12864B_RATE=20 + +# +# Userspace I/O +# +CONFIG_UIO=m +CONFIG_UIO_CIF=m + +# +# Firmware Drivers +# +# CONFIG_EDD is not set +CONFIG_DELL_RBU=m +CONFIG_DCDBAS=m +CONFIG_DMIID=y + +# +# File systems +# +CONFIG_EXT2_FS=m +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +CONFIG_EXT3_FS_XATTR=y +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +# CONFIG_EXT4DEV_FS is not set +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=m +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +# CONFIG_JFS_DEBUG is not set +CONFIG_JFS_STATISTICS=y +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_RT=y +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_GFS2_FS_LOCKING_DLM=m +CONFIG_OCFS2_FS=m +CONFIG_OCFS2_DEBUG_MASKLOG=y +# CONFIG_OCFS2_DEBUG_FS is not set +CONFIG_MINIX_FS=m +CONFIG_ROMFS_FS=m +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_QUOTA=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_QFMT_V1=m +CONFIG_QFMT_V2=m +CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m +CONFIG_GENERIC_ACL=y + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_VMCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +# CONFIG_HUGETLB_PAGE is not set +CONFIG_CONFIGFS_FS=m + +# +# Miscellaneous filesystems +# +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_AFFS_FS=m +CONFIG_ECRYPT_FS=m +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +CONFIG_BEFS_FS=m +# CONFIG_BEFS_DEBUG is not set +CONFIG_BFS_FS=m +CONFIG_EFS_FS=m +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +CONFIG_CRAMFS=y +CONFIG_VXFS_FS=m +CONFIG_HPFS_FS=m +CONFIG_QNX4FS_FS=m +CONFIG_SYSV_FS=m +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_UFS_DEBUG is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFSD=m +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=m +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=m +CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_XPRT_RDMA=m +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_EXPERIMENTAL is not set +CONFIG_NCP_FS=m +CONFIG_NCPFS_PACKET_SIGNING=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_STRONG=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_OS2_NS=y +# CONFIG_NCPFS_SMALLDOS is not set +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_EXTRAS=y +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set +CONFIG_AFS_FS=m +# CONFIG_AFS_DEBUG is not set +CONFIG_9P_FS=m +CONFIG_DEFAULT_RELATIME=y +CONFIG_DEFAULT_RELATIME_VAL=1 + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +CONFIG_ACORN_PARTITION=y +# CONFIG_ACORN_PARTITION_CUMANA is not set +# CONFIG_ACORN_PARTITION_EESOX is not set +CONFIG_ACORN_PARTITION_ICS=y +# CONFIG_ACORN_PARTITION_ADFS is not set +# CONFIG_ACORN_PARTITION_POWERTEC is not set +CONFIG_ACORN_PARTITION_RISCIX=y +CONFIG_OSF_PARTITION=y +CONFIG_AMIGA_PARTITION=y +CONFIG_ATARI_PARTITION=y +CONFIG_MAC_PARTITION=y +CONFIG_MSDOS_PARTITION=y +CONFIG_BSD_DISKLABEL=y +CONFIG_MINIX_SUBPARTITION=y +CONFIG_SOLARIS_X86_PARTITION=y +CONFIG_UNIXWARE_DISKLABEL=y +CONFIG_LDM_PARTITION=y +# CONFIG_LDM_DEBUG is not set +CONFIG_SGI_PARTITION=y +CONFIG_ULTRIX_PARTITION=y +CONFIG_SUN_PARTITION=y +CONFIG_KARMA_PARTITION=y +CONFIG_EFI_PARTITION=y +CONFIG_SYSV68_PARTITION=y +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set +CONFIG_INSTRUMENTATION=y +CONFIG_PROFILING=y +CONFIG_OPROFILE=m +CONFIG_KPROBES=y +# CONFIG_MARKERS is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_UNUSED_SYMBOLS=y +CONFIG_DEBUG_FS=y +# CONFIG_HEADERS_CHECK is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_SCHED_DEBUG=y +# CONFIG_SCHEDSTATS is not set +CONFIG_TIMER_STATS=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_HIGHMEM is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_FORCED_INLINING is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_LKDTM is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SAMPLES is not set +CONFIG_NONPROMISC_DEVMEM=y +CONFIG_EARLY_PRINTK=y +# CONFIG_WRAPPER_PRINT is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_DEBUG_RODATA is not set +# CONFIG_4KSTACKS is not set +CONFIG_X86_FIND_SMP_CONFIG=y +CONFIG_X86_MPPARSE=y +CONFIG_IO_DELAY_TYPE_0X80=0 +CONFIG_IO_DELAY_TYPE_0XED=1 +CONFIG_IO_DELAY_TYPE_UDELAY=2 +CONFIG_IO_DELAY_TYPE_NONE=3 +CONFIG_IO_DELAY_0X80=y +# CONFIG_IO_DELAY_0XED is not set +# CONFIG_IO_DELAY_UDELAY is not set +# CONFIG_IO_DELAY_NONE is not set +CONFIG_DEFAULT_IO_DELAY_TYPE=0 + +# +# Security options +# +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +CONFIG_SECURITY=y +CONFIG_SECURITY_NETWORK=y +# CONFIG_SECURITY_NETWORK_XFRM is not set +CONFIG_SECURITY_CAPABILITIES=y +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_SECURITY_SELINUX=y +CONFIG_SECURITY_SELINUX_BOOTPARAM=y +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 +CONFIG_SECURITY_SELINUX_DISABLE=y +CONFIG_SECURITY_SELINUX_DEVELOP=y +CONFIG_SECURITY_SELINUX_AVC_STATS=y +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 +# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set +# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set +CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 +# CONFIG_SECURITY_APPARMOR_DISABLE is not set +CONFIG_XOR_BLOCKS=m +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_XOR=m +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ABLKCIPHER=m +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_XTS=m +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_TWOFISH_586=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_AES_586=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_DEV_PADLOCK=y +CONFIG_CRYPTO_DEV_PADLOCK_AES=m +CONFIG_CRYPTO_DEV_PADLOCK_SHA=m +CONFIG_CRYPTO_DEV_GEODE=m +CONFIG_HAVE_KVM=y +CONFIG_XEN=y +CONFIG_XEN_INTERFACE_VERSION=0x00030207 + +# +# XEN +# +CONFIG_XEN_PRIVILEGED_GUEST=y +# CONFIG_XEN_UNPRIVILEGED_GUEST is not set +CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_XENBUS_DEV=y +CONFIG_XEN_BACKEND=y +CONFIG_XEN_BLKDEV_BACKEND=y +CONFIG_XEN_BLKDEV_TAP=y +CONFIG_XEN_NETDEV_BACKEND=y +# CONFIG_XEN_NETDEV_PIPELINED_TRANSMITTER is not set +CONFIG_XEN_NETDEV_LOOPBACK=y +CONFIG_XEN_PCIDEV_BACKEND=y +CONFIG_XEN_PCIDEV_BACKEND_VPCI=y +# CONFIG_XEN_PCIDEV_BACKEND_PASS is not set +# CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set +# CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER is not set +# CONFIG_XEN_PCIDEV_BE_DEBUG is not set +CONFIG_XEN_TPMDEV_BACKEND=y +CONFIG_XEN_BLKDEV_FRONTEND=y +CONFIG_XEN_NETDEV_FRONTEND=y +CONFIG_XEN_GRANT_DEV=y +CONFIG_XEN_FRAMEBUFFER=y +CONFIG_XEN_KEYBOARD=y +CONFIG_XEN_CONSOLE=y +CONFIG_XEN_SCRUB_PAGES=y +# CONFIG_XEN_DISABLE_SERIAL is not set +CONFIG_XEN_SYSFS=y +CONFIG_XEN_COMPAT_030002_AND_LATER=y +# CONFIG_XEN_COMPAT_030004_AND_LATER is not set +# CONFIG_XEN_COMPAT_030100_AND_LATER is not set +# CONFIG_XEN_COMPAT_LATEST_ONLY is not set +CONFIG_XEN_COMPAT=0x030002 +CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_NO_IDLE_HZ=y +CONFIG_XEN_SMPBOOT=y +CONFIG_XEN_BALLOON=y +CONFIG_XEN_DEVMEM=y + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +CONFIG_CRC16=m +CONFIG_CRC_ITU_T=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_LIBCRC32C=m +CONFIG_AUDIT_GENERIC=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_LZO_COMPRESS=m +CONFIG_LZO_DECOMPRESS=m +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_DEC16=y +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_PLIST=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CHECK_SIGNATURE=y +CONFIG_DRM_VIA_CHROME9=m --- linux-2.6.24.orig/debian/binary-custom.d/xen/patchset/000.patch +++ linux-2.6.24/debian/binary-custom.d/xen/patchset/000.patch @@ -0,0 +1,96948 @@ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./.mailmap debian/binary-custom.d/xen/src/.mailmap +--- ./.mailmap 2012-06-12 16:25:10.402312974 +0100 ++++ debian/binary-custom.d/xen/src/.mailmap 1970-01-01 01:00:00.000000000 +0100 +@@ -1,98 +0,0 @@ +-# +-# This list is used by git-shortlog to fix a few botched name translations +-# in the git archive, either because the author's full name was messed up +-# and/or not always written the same way, making contributions from the +-# same person appearing not to be so or badly displayed. +-# +-# repo-abbrev: /pub/scm/linux/kernel/git/ +-# +- +-Aaron Durbin +-Adam Oldham +-Adam Radford +-Adrian Bunk +-Alan Cox +-Alan Cox +-Aleksey Gorelov +-Al Viro +-Al Viro +-Andreas Herrmann +-Andrew Morton +-Andrew Vasquez +-Andy Adamson +-Arnaud Patard +-Arnd Bergmann +-Axel Dyks +-Ben Gardner +-Ben M Cahill +-Björn Steinbrink +-Brian Avery +-Brian King +-Christoph Hellwig +-Corey Minyard +-David Brownell +-David Woodhouse +-Domen Puncer +-Douglas Gilbert +-Ed L. Cashin +-Evgeniy Polyakov +-Felipe W Damasio +-Felix Kuhling +-Felix Moeller +-Filipe Lautert +-Franck Bui-Huu +-Frank Zago +-Greg Kroah-Hartman +-Greg Kroah-Hartman +-Greg Kroah-Hartman +-Henk Vergonet +-Henrik Kretzschmar +-Herbert Xu +-Jacob Shin +-James Bottomley +-James Bottomley +-James E Wilson +-James Ketrenos +-Jean Tourrilhes +-Jeff Garzik +-Jens Axboe +-Jens Osterkamp +-John Stultz +-Juha Yrjola +-Juha Yrjola +-Juha Yrjola +-Kay Sievers +-Kenneth W Chen +-Koushik +-Leonid I Ananiev +-Linas Vepstas +-Matthieu CASTET +-Michael Buesch +-Michael Buesch +-Michel Dänzer +-Mitesh shah +-Morten Welinder +-Morten Welinder +-Morten Welinder +-Morten Welinder +-Nguyen Anh Quynh +-Paolo 'Blaisorblade' Giarrusso +-Patrick Mochel +-Peter A Jonsson +-Praveen BP +-Rajesh Shah +-Ralf Baechle +-Ralf Wildenhues +-Rémi Denis-Courmont +-Rudolf Marek +-Rui Saraiva +-Sachin P Sant +-Sam Ravnborg +-Simon Kelley +-Stéphane Witzmann +-Stephen Hemminger +-Tejun Heo +-Thomas Graf +-Tony Luck +-Tsuneo Yoshioka +-Valdis Kletnieks +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/arm/boot/compressed/vmlinux.lds.in debian/binary-custom.d/xen/src/arch/arm/boot/compressed/vmlinux.lds.in +--- ./arch/arm/boot/compressed/vmlinux.lds.in 2012-06-12 16:25:10.650312966 +0100 ++++ debian/binary-custom.d/xen/src/arch/arm/boot/compressed/vmlinux.lds.in 1970-01-01 01:00:00.000000000 +0100 +@@ -1,56 +0,0 @@ +-/* +- * linux/arch/arm/boot/compressed/vmlinux.lds.in +- * +- * Copyright (C) 2000 Russell King +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +- */ +-OUTPUT_ARCH(arm) +-ENTRY(_start) +-SECTIONS +-{ +- . = TEXT_START; +- _text = .; +- +- .text : { +- _start = .; +- *(.start) +- *(.text) +- *(.text.*) +- *(.fixup) +- *(.gnu.warning) +- *(.rodata) +- *(.rodata.*) +- *(.glue_7) +- *(.glue_7t) +- *(.piggydata) +- . = ALIGN(4); +- } +- +- _etext = .; +- +- _got_start = .; +- .got : { *(.got) } +- _got_end = .; +- .got.plt : { *(.got.plt) } +- .data : { *(.data) } +- _edata = .; +- +- . = BSS_START; +- __bss_start = .; +- .bss : { *(.bss) } +- _end = .; +- +- .stack (NOLOAD) : { *(.stack) } +- +- .stab 0 : { *(.stab) } +- .stabstr 0 : { *(.stabstr) } +- .stab.excl 0 : { *(.stab.excl) } +- .stab.exclstr 0 : { *(.stab.exclstr) } +- .stab.index 0 : { *(.stab.index) } +- .stab.indexstr 0 : { *(.stab.indexstr) } +- .comment 0 : { *(.comment) } +-} +- +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/h8300/boot/compressed/vmlinux.lds debian/binary-custom.d/xen/src/arch/h8300/boot/compressed/vmlinux.lds +--- ./arch/h8300/boot/compressed/vmlinux.lds 2012-06-12 16:25:10.870312958 +0100 ++++ debian/binary-custom.d/xen/src/arch/h8300/boot/compressed/vmlinux.lds 1970-01-01 01:00:00.000000000 +0100 +@@ -1,32 +0,0 @@ +-SECTIONS +-{ +- .text : +- { +- __stext = . ; +- __text = .; +- *(.text.startup) +- *(.text) +- __etext = . ; +- } +- +- .rodata : +- { +- *(.rodata) +- } +- .data : +- +- { +- __sdata = . ; +- ___data_start = . ; +- *(.data.*) +- } +- .bss : +- { +- . = ALIGN(0x4) ; +- __sbss = . ; +- *(.bss*) +- . = ALIGN(0x4) ; +- __ebss = . ; +- __end = . ; +- } +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/h8300/boot/compressed/vmlinux.scr debian/binary-custom.d/xen/src/arch/h8300/boot/compressed/vmlinux.scr +--- ./arch/h8300/boot/compressed/vmlinux.scr 2012-06-12 16:25:10.870312958 +0100 ++++ debian/binary-custom.d/xen/src/arch/h8300/boot/compressed/vmlinux.scr 1970-01-01 01:00:00.000000000 +0100 +@@ -1,9 +0,0 @@ +-SECTIONS +-{ +- .data : { +- _input_len = .; +- LONG(_input_data_end - _input_data) _input_data = .; +- *(.data) +- _input_data_end = .; +- } +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/m32r/boot/compressed/vmlinux.scr debian/binary-custom.d/xen/src/arch/m32r/boot/compressed/vmlinux.scr +--- ./arch/m32r/boot/compressed/vmlinux.scr 2012-06-12 16:25:10.930312956 +0100 ++++ debian/binary-custom.d/xen/src/arch/m32r/boot/compressed/vmlinux.scr 1970-01-01 01:00:00.000000000 +0100 +@@ -1,9 +0,0 @@ +-SECTIONS +-{ +- .data : { +- zimage_data = .; +- *(.data) +- zimage_data_end = .; +- } +- zimage_len = zimage_data_end - zimage_data; +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/m68k/kernel/vmlinux-std.lds debian/binary-custom.d/xen/src/arch/m68k/kernel/vmlinux-std.lds +--- ./arch/m68k/kernel/vmlinux-std.lds 2012-06-12 16:25:10.990312954 +0100 ++++ debian/binary-custom.d/xen/src/arch/m68k/kernel/vmlinux-std.lds 1970-01-01 01:00:00.000000000 +0100 +@@ -1,98 +0,0 @@ +-/* ld script to make m68k Linux kernel */ +- +-#include +- +-OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") +-OUTPUT_ARCH(m68k) +-ENTRY(_start) +-jiffies = jiffies_64 + 4; +-SECTIONS +-{ +- . = 0x1000; +- _text = .; /* Text and read-only data */ +- .text : { +- *(.text.head) +- TEXT_TEXT +- SCHED_TEXT +- LOCK_TEXT +- *(.fixup) +- *(.gnu.warning) +- } :text = 0x4e75 +- +- _etext = .; /* End of text section */ +- +- . = ALIGN(16); /* Exception table */ +- __start___ex_table = .; +- __ex_table : { *(__ex_table) } +- __stop___ex_table = .; +- +- RODATA +- +- .data : { /* Data */ +- DATA_DATA +- CONSTRUCTORS +- } +- +- .bss : { *(.bss) } /* BSS */ +- +- . = ALIGN(16); +- .data.cacheline_aligned : { *(.data.cacheline_aligned) } :data +- +- _edata = .; /* End of data section */ +- +- /* will be freed after init */ +- . = ALIGN(4096); /* Init code and data */ +- __init_begin = .; +- .init.text : { +- _sinittext = .; +- *(.init.text) +- _einittext = .; +- } +- .init.data : { *(.init.data) } +- . = ALIGN(16); +- __setup_start = .; +- .init.setup : { *(.init.setup) } +- __setup_end = .; +- __initcall_start = .; +- .initcall.init : { +- INITCALLS +- } +- __initcall_end = .; +- __con_initcall_start = .; +- .con_initcall.init : { *(.con_initcall.init) } +- __con_initcall_end = .; +- .m68k_fixup : { +- __start_fixup = .; +- *(.m68k_fixup) +- __stop_fixup = .; +- } +- SECURITY_INIT +-#ifdef CONFIG_BLK_DEV_INITRD +- . = ALIGN(8192); +- __initramfs_start = .; +- .init.ramfs : { *(.init.ramfs) } +- __initramfs_end = .; +-#endif +- . = ALIGN(8192); +- __init_end = .; +- +- .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */ +- +- _end = . ; +- +- /* Sections to be discarded */ +- /DISCARD/ : { +- *(.exit.text) +- *(.exit.data) +- *(.exitcall.exit) +- } +- +- /* Stabs debugging sections. */ +- .stab 0 : { *(.stab) } +- .stabstr 0 : { *(.stabstr) } +- .stab.excl 0 : { *(.stab.excl) } +- .stab.exclstr 0 : { *(.stab.exclstr) } +- .stab.index 0 : { *(.stab.index) } +- .stab.indexstr 0 : { *(.stab.indexstr) } +- .comment 0 : { *(.comment) } +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/m68k/kernel/vmlinux-sun3.lds debian/binary-custom.d/xen/src/arch/m68k/kernel/vmlinux-sun3.lds +--- ./arch/m68k/kernel/vmlinux-sun3.lds 2012-06-12 16:25:10.990312954 +0100 ++++ debian/binary-custom.d/xen/src/arch/m68k/kernel/vmlinux-sun3.lds 1970-01-01 01:00:00.000000000 +0100 +@@ -1,97 +0,0 @@ +-/* ld script to make m68k Linux kernel */ +- +-#include +- +-OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") +-OUTPUT_ARCH(m68k) +-ENTRY(_start) +-jiffies = jiffies_64 + 4; +-SECTIONS +-{ +- . = 0xE002000; +- _text = .; /* Text and read-only data */ +- .text : { +- *(.text.head) +- TEXT_TEXT +- SCHED_TEXT +- LOCK_TEXT +- *(.fixup) +- *(.gnu.warning) +- } :text = 0x4e75 +- RODATA +- +- _etext = .; /* End of text section */ +- +- .data : { /* Data */ +- DATA_DATA +- CONSTRUCTORS +- . = ALIGN(16); /* Exception table */ +- __start___ex_table = .; +- *(__ex_table) +- __stop___ex_table = .; +- } :data +- /* End of data goes *here* so that freeing init code works properly. */ +- _edata = .; +- +- /* will be freed after init */ +- . = ALIGN(8192); /* Init code and data */ +-__init_begin = .; +- .init.text : { +- _sinittext = .; +- *(.init.text) +- _einittext = .; +- } +- .init.data : { *(.init.data) } +- . = ALIGN(16); +- __setup_start = .; +- .init.setup : { *(.init.setup) } +- __setup_end = .; +- __initcall_start = .; +- .initcall.init : { +- INITCALLS +- } +- __initcall_end = .; +- __con_initcall_start = .; +- .con_initcall.init : { *(.con_initcall.init) } +- __con_initcall_end = .; +- .m68k_fixup : { +- __start_fixup = .; +- *(.m68k_fixup) +- __stop_fixup = .; +- } +- SECURITY_INIT +-#ifdef CONFIG_BLK_DEV_INITRD +- . = ALIGN(8192); +- __initramfs_start = .; +- .init.ramfs : { *(.init.ramfs) } +- __initramfs_end = .; +-#endif +- . = ALIGN(8192); +- __init_end = .; +- .data.init.task : { *(.data.init_task) } +- +- +- .bss : { *(.bss) } /* BSS */ +- +- _end = . ; +- +- /* Sections to be discarded */ +- /DISCARD/ : { +- *(.exit.text) +- *(.exit.data) +- *(.exitcall.exit) +- } +- +- .crap : { +- /* Stabs debugging sections. */ +- *(.stab) +- *(.stabstr) +- *(.stab.excl) +- *(.stab.exclstr) +- *(.stab.index) +- *(.stab.indexstr) +- *(.comment) +- *(.note) +- } +- +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/sh/boot/compressed/vmlinux.scr debian/binary-custom.d/xen/src/arch/sh/boot/compressed/vmlinux.scr +--- ./arch/sh/boot/compressed/vmlinux.scr 2012-06-12 16:25:11.398312939 +0100 ++++ debian/binary-custom.d/xen/src/arch/sh/boot/compressed/vmlinux.scr 1970-01-01 01:00:00.000000000 +0100 +@@ -1,9 +0,0 @@ +-SECTIONS +-{ +- .data : { +- input_len = .; +- LONG(input_data_end - input_data) input_data = .; +- *(.data) +- input_data_end = .; +- } +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/Kconfig debian/binary-custom.d/xen/src/arch/x86/Kconfig +--- ./arch/x86/Kconfig 2012-06-12 16:25:11.562312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/Kconfig 2012-11-13 15:20:17.256568999 +0000 +@@ -31,15 +31,17 @@ + config CLOCKSOURCE_WATCHDOG + bool + default y ++ depends on !X86_XEN && !X86_64_XEN + + config GENERIC_CLOCKEVENTS + bool + default y ++ depends on !X86_XEN && !X86_64_XEN + + config GENERIC_CLOCKEVENTS_BROADCAST + bool + default y +- depends on X86_64 || (X86_32 && X86_LOCAL_APIC) ++ depends on (X86_64 && !X86_64_XEN) || (X86_32 && X86_LOCAL_APIC && !X86_XEN) + + config LOCKDEP_SUPPORT + bool +@@ -151,7 +153,7 @@ + config X86_HT + bool + depends on SMP +- depends on (X86_32 && !(X86_VISWS || X86_VOYAGER)) || (X86_64 && !MK8) ++ depends on (X86_32 && !(X86_VISWS || X86_VOYAGER || X86_XEN)) || (X86_64 && !MK8 && !X86_64_XEN) + default y + + config X86_BIOS_REBOOT +@@ -164,6 +166,16 @@ + depends on X86_SMP || (X86_VOYAGER && SMP) + default y + ++config X86_NO_TSS ++ bool ++ depends on X86_XEN || X86_64_XEN ++ default y ++ ++config X86_NO_IDT ++ bool ++ depends on X86_XEN || X86_64_XEN ++ default y ++ + config KTIME_SCALAR + def_bool X86_32 + source "init/Kconfig" +@@ -210,6 +222,16 @@ + help + Choose this option if your computer is a standard PC or compatible. + ++config X86_XEN ++ bool "Xen-compatible" ++ depends on X86_32 ++ select X86_UP_APIC if !SMP && XEN_PRIVILEGED_GUEST ++ select X86_UP_IOAPIC if !SMP && XEN_PRIVILEGED_GUEST ++ select SWIOTLB ++ help ++ Choose this option if you plan to run this kernel on top of the ++ Xen Hypervisor. ++ + config X86_ELAN + bool "AMD Elan" + depends on X86_32 +@@ -293,6 +315,13 @@ + Only choose this option if you have such a system, otherwise you + should say N here. + ++config X86_64_XEN ++ bool "Enable Xen compatible kernel" ++ depends on X86_64 ++ select SWIOTLB ++ help ++ This option will compile a kernel compatible with Xen hypervisor ++ + config X86_VSMP + bool "Support for ScaleMP vSMP" + depends on X86_64 && PCI +@@ -317,7 +346,7 @@ + + config PARAVIRT + bool +- depends on X86_32 && !(X86_VISWS || X86_VOYAGER) ++ depends on X86_32 && !(X86_VISWS || X86_VOYAGER || X86_XEN) + help + This changes the kernel so it can modify itself when it is run + under a hypervisor, potentially improving performance significantly +@@ -326,7 +355,7 @@ + + menuconfig PARAVIRT_GUEST + bool "Paravirtualized guest support" +- depends on X86_32 ++ depends on X86_32 && !X86_XEN + help + Say Y here to get to see options related to running Linux under + various hypervisors. This option alone does not add any kernel code. +@@ -382,6 +411,7 @@ + config HPET_TIMER + bool + prompt "HPET Timer Support" if X86_32 ++ depends on !X86_XEN && !X86_64_XEN + default X86_64 + help + Use the IA-PC HPET (High Precision Event Timer) to manage +@@ -411,7 +441,7 @@ + default y + select SWIOTLB + select AGP +- depends on X86_64 && PCI ++ depends on X86_64 && PCI && !X86_64_XEN + help + Support for full DMA access of devices with 32bit memory access only + on systems with more than 3GB. This is usually needed for USB, +@@ -426,7 +456,7 @@ + config CALGARY_IOMMU + bool "IBM Calgary IOMMU support" + select SWIOTLB +- depends on X86_64 && PCI && EXPERIMENTAL ++ depends on X86_64 && PCI && !X86_64_XEN && EXPERIMENTAL + help + Support for hardware IOMMUs in IBM's xSeries x366 and x460 + systems. Needed to run systems with more than 3GB of memory +@@ -468,6 +498,7 @@ + range 2 255 + depends on SMP + default "32" if X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000 ++ default "16" if X86_64_XEN + default "8" + help + This allows you to specify the maximum number of CPUs which this +@@ -479,7 +510,7 @@ + + config SCHED_SMT + bool "SMT (Hyperthreading) scheduler support" +- depends on (X86_64 && SMP) || (X86_32 && X86_HT) ++ depends on (X86_64 && SMP && !X86_64_XEN) || (X86_32 && X86_HT) + help + SMT scheduler support improves the CPU scheduler's decision making + when dealing with Intel Pentium 4 chips with HyperThreading at a +@@ -488,7 +519,7 @@ + + config SCHED_MC + bool "Multi-core scheduler support" +- depends on (X86_64 && SMP) || (X86_32 && X86_HT) ++ depends on (X86_64 && SMP && !X86_64_XEN) || (X86_32 && X86_HT) + default y + help + Multi-core scheduler support improves the CPU scheduler's decision +@@ -499,7 +530,7 @@ + + config X86_UP_APIC + bool "Local APIC support on uniprocessors" +- depends on X86_32 && !SMP && !(X86_VISWS || X86_VOYAGER || X86_GENERICARCH) ++ depends on X86_32 && !SMP && !(X86_VISWS || X86_VOYAGER || X86_GENERICARCH || XEN_UNPRIVILEGED_GUEST) + help + A local APIC (Advanced Programmable Interrupt Controller) is an + integrated interrupt controller in the CPU. If you have a single-CPU +@@ -525,11 +556,13 @@ + config X86_LOCAL_APIC + bool + depends on X86_64 || (X86_32 && (X86_UP_APIC || ((X86_VISWS || SMP) && !X86_VOYAGER) || X86_GENERICARCH)) ++ depends on !XEN_UNPRIVILEGED_GUEST + default y + + config X86_IO_APIC + bool + depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER)) || X86_GENERICARCH)) ++ depends on !XEN_UNPRIVILEGED_GUEST + default y + + config X86_VISWS_APIC +@@ -537,9 +570,14 @@ + depends on X86_32 && X86_VISWS + default y + ++config X86_XEN_GENAPIC ++ bool ++ depends on X86_64_XEN ++ default y ++ + config X86_MCE + bool "Machine Check Exception" +- depends on !X86_VOYAGER ++ depends on !(X86_VOYAGER || X86_XEN || X86_64_XEN) + ---help--- + Machine Check Exception support allows the processor to notify the + kernel if it detects a problem (e.g. overheating, component failure). +@@ -657,6 +695,7 @@ + + config MICROCODE + tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support" ++ depends on !XEN_UNPRIVILEGED_GUEST + select FW_LOADER + ---help--- + If you say Y here, you will be able to update the microcode on +@@ -817,7 +856,7 @@ + # Common NUMA Features + config NUMA + bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" +- depends on SMP ++ depends on SMP && !X86_64_XEN + depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT || X86_GENERICARCH) && ACPI) && EXPERIMENTAL) + default n if X86_PC + default y if (X86_NUMAQ || X86_SUMMIT) +@@ -904,7 +943,7 @@ + + config ARCH_SPARSEMEM_ENABLE + def_bool y +- depends on NUMA || (EXPERIMENTAL && (X86_PC || X86_64)) ++ depends on NUMA || (EXPERIMENTAL && (X86_PC || X86_64) && !X86_64_XEN) + select SPARSEMEM_STATIC if X86_32 + select SPARSEMEM_VMEMMAP_ENABLE if X86_64 + +@@ -930,6 +969,7 @@ + config MATH_EMULATION + bool + prompt "Math emulation" if X86_32 ++ depends on !X86_XEN + ---help--- + Linux can emulate a math coprocessor (used for floating point + operations) if you don't have one. 486DX and Pentium processors have +@@ -955,6 +995,8 @@ + + config MTRR + bool "MTRR (Memory Type Range Register) support" ++ depends on !XEN_UNPRIVILEGED_GUEST ++ default y if X86_XEN + ---help--- + On Intel P6 family processors (Pentium Pro, Pentium II and later) + the Memory Type Range Registers (MTRRs) may be used to control +@@ -989,7 +1031,7 @@ + + config EFI + bool "Boot from EFI support" +- depends on X86_32 && ACPI ++ depends on X86_32 && ACPI && !X86_XEN + default n + ---help--- + This enables the kernel to boot on EFI platforms using +@@ -1007,7 +1049,7 @@ + + config IRQBALANCE + bool "Enable kernel irq balancing" +- depends on X86_32 && SMP && X86_IO_APIC ++ depends on X86_32 && SMP && X86_IO_APIC && !X86_XEN + default y + help + The default yes will allow the kernel to do irq load balancing. +@@ -1065,6 +1107,7 @@ + + config KEXEC + bool "kexec system call" ++ depends on !XEN_UNPRIVILEGED_GUEST + help + kexec is a system call that implements the ability to shutdown your + current kernel, and to start another kernel. It is like a reboot +@@ -1139,7 +1182,7 @@ + + config RELOCATABLE + bool "Build a relocatable kernel (EXPERIMENTAL)" +- depends on EXPERIMENTAL ++ depends on EXPERIMENTAL && !X86_XEN && !X86_64_XEN + help + This builds a kernel image that retains relocation information + so it can be loaded someplace besides the default 1MB. +@@ -1221,7 +1264,7 @@ + depends on DISCONTIGMEM + + menu "Power management options" +- depends on !X86_VOYAGER ++ depends on !(X86_VOYAGER || XEN_UNPRIVILEGED_GUEST) + + config ARCH_HIBERNATION_HEADER + bool +@@ -1234,7 +1277,7 @@ + + menuconfig APM + tristate "APM (Advanced Power Management) BIOS support" +- depends on X86_32 && PM_SLEEP && !X86_VISWS ++ depends on X86_32 && PM_SLEEP && !(X86_VISWS || X86_XEN) + ---help--- + APM is a BIOS specification for saving power using several different + techniques. This is mostly useful for battery powered laptops with +@@ -1373,7 +1416,7 @@ + bool "PCI support" if !X86_VISWS + depends on !X86_VOYAGER + default y if X86_VISWS +- select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC) ++ select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC && !X86_XEN && !X86_64_XEN) + help + Find out whether you have a PCI motherboard. PCI is the name of a + bus system, i.e. the way the CPU talks to the other stuff inside +@@ -1406,6 +1449,7 @@ + + config PCI_GOBIOS + bool "BIOS" ++ depends on !X86_XEN + + config PCI_GOMMCONFIG + bool "MMConfig" +@@ -1413,6 +1457,13 @@ + config PCI_GODIRECT + bool "Direct" + ++config PCI_GOXEN_FE ++ bool "Xen PCI Frontend" ++ depends on X86_XEN ++ help ++ The PCI device frontend driver allows the kernel to import arbitrary ++ PCI devices from a PCI backend to support PCI driver domains. ++ + config PCI_GOANY + bool "Any" + +@@ -1420,7 +1471,7 @@ + + config PCI_BIOS + bool +- depends on X86_32 && !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY) ++ depends on X86_32 && !(X86_VISWS || X86_XEN) && PCI && (PCI_GOBIOS || PCI_GOANY) + default y + + # x86-64 doesn't support PCI BIOS access from long mode so always go direct. +@@ -1443,6 +1494,21 @@ + bool "Support mmconfig PCI config space access" + depends on X86_64 && PCI && ACPI + ++config XEN_PCIDEV_FRONTEND ++ bool "Xen PCI Frontend" if X86_64 ++ depends on PCI && ((X86_XEN && (PCI_GOXEN_FE || PCI_GOANY)) || X86_64_XEN) ++ default y ++ help ++ The PCI device frontend driver allows the kernel to import arbitrary ++ PCI devices from a PCI backend to support PCI driver domains. ++ ++config XEN_PCIDEV_FE_DEBUG ++ bool "Xen PCI Frontend Debugging" ++ depends on XEN_PCIDEV_FRONTEND ++ default n ++ help ++ Enables some debug statements within the PCI Frontend. ++ + config DMAR + bool "Support for DMA Remapping Devices (EXPERIMENTAL)" + depends on X86_64 && PCI_MSI && ACPI && EXPERIMENTAL +@@ -1487,7 +1553,7 @@ + + config ISA + bool "ISA support" +- depends on !(X86_VOYAGER || X86_VISWS) ++ depends on !(X86_VOYAGER || X86_VISWS || X86_XEN) + help + Find out whether you have ISA slots on your motherboard. ISA is the + name of a bus system, i.e. the way the CPU talks to the other stuff +@@ -1514,7 +1580,7 @@ + source "drivers/eisa/Kconfig" + + config MCA +- bool "MCA support" if !(X86_VISWS || X86_VOYAGER) ++ bool "MCA support" if !(X86_VISWS || X86_VOYAGER || X86_XEN) + default y if X86_VOYAGER + help + MicroChannel Architecture is found in some IBM PS/2 machines and +@@ -1622,4 +1688,6 @@ + + source "arch/x86/kvm/Kconfig" + ++source "drivers/xen/Kconfig" ++ + source "lib/Kconfig" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/Kconfig.cpu debian/binary-custom.d/xen/src/arch/x86/Kconfig.cpu +--- ./arch/x86/Kconfig.cpu 2012-06-12 16:25:11.566312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/Kconfig.cpu 2012-11-13 15:20:17.256568999 +0000 +@@ -328,7 +328,7 @@ + + config X86_F00F_BUG + bool +- depends on M586MMX || M586TSC || M586 || M486 || M386 ++ depends on (M586MMX || M586TSC || M586 || M486 || M386) && !X86_NO_IDT + default y + + config X86_WP_WORKS_OK +@@ -384,6 +384,7 @@ + config X86_TSC + bool + depends on ((MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2) && !X86_NUMAQ) || X86_64 ++ depends on !X86_XEN && !X86_64_XEN + default y + + # this should be set for all -march=.. options where the compiler +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/Kconfig.debug debian/binary-custom.d/xen/src/arch/x86/Kconfig.debug +--- ./arch/x86/Kconfig.debug 2012-06-12 16:25:11.566312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/Kconfig.debug 2012-11-13 15:20:17.256568999 +0000 +@@ -99,7 +99,7 @@ + config DOUBLEFAULT + default y + bool "Enable doublefault exception handler" if EMBEDDED +- depends on X86_32 ++ depends on X86_32 && !X86_NO_TSS + help + This option allows trapping of rare doublefault exceptions that + would otherwise cause a system to silently reboot. Disabling this +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/Makefile_32 debian/binary-custom.d/xen/src/arch/x86/Makefile_32 +--- ./arch/x86/Makefile_32 2012-06-12 16:25:11.566312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/Makefile_32 2012-11-13 15:20:17.256568999 +0000 +@@ -89,6 +89,10 @@ + mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-x86/mach-summit + mcore-$(CONFIG_X86_SUMMIT) := arch/x86/mach-default + ++# Xen subarch support ++mflags-$(CONFIG_X86_XEN) := -Iinclude/asm-x86/mach-xen ++mcore-$(CONFIG_X86_XEN) := arch/x86/mach-xen ++ + # generic subarchitecture + mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-x86/mach-generic + mcore-$(CONFIG_X86_GENERICARCH) := arch/x86/mach-default +@@ -100,7 +104,7 @@ + core-$(CONFIG_X86_ES7000) := arch/x86/mach-es7000/ + + # Xen paravirtualization support +-core-$(CONFIG_XEN) += arch/x86/xen/ ++core-$(CONFIG_PARAVIRT_XEN) += arch/x86/xen/ + + # lguest paravirtualization support + core-$(CONFIG_LGUEST_GUEST) += arch/x86/lguest/ +@@ -127,9 +131,22 @@ + + boot := arch/x86/boot + +-PHONY += zImage bzImage compressed zlilo bzlilo \ ++PHONY += zImage bzImage vmlinuz compressed zlilo bzlilo \ + zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install + ++ifdef CONFIG_XEN ++KBUILD_CPPFLAGS := -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION) \ ++ -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(KBUILD_CPPFLAGS) ++all: vmlinuz ++ ++# KBUILD_IMAGE specifies the target image being built ++KBUILD_IMAGE := $(boot)/vmlinuz ++ ++vmlinuz: vmlinux ++ $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) ++ $(Q)mkdir -p $(objtree)/arch/i386/boot ++ $(Q)ln -fsn ../../x86/boot/$@ $(objtree)/arch/i386/boot/$@ ++else + all: bzImage + + # KBUILD_IMAGE specify target image being built +@@ -151,6 +168,7 @@ + + fdimage fdimage144 fdimage288 isoimage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ ++endif + + install: + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/Makefile_64 debian/binary-custom.d/xen/src/arch/x86/Makefile_64 +--- ./arch/x86/Makefile_64 2012-06-12 16:25:11.566312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/Makefile_64 2012-11-13 15:20:17.260568998 +0000 +@@ -90,9 +90,24 @@ + + boot := arch/x86/boot + +-PHONY += bzImage bzlilo install archmrproper \ ++PHONY += bzImage bzlilo vmlinuz install archmrproper \ + fdimage fdimage144 fdimage288 isoimage archclean + ++ifdef CONFIG_XEN ++KBUILD_CPPFLAGS := -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION) \ ++ -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(KBUILD_CPPFLAGS) ++LDFLAGS_vmlinux := -e startup_64 ++#Default target when executing "make" ++all: vmlinuz ++ ++BOOTIMAGE := $(boot)/vmlinuz ++KBUILD_IMAGE := $(BOOTIMAGE) ++ ++vmlinuz: vmlinux ++ $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) ++ $(Q)mkdir -p $(objtree)/arch/x86_64/boot ++ $(Q)ln -fsn ../../x86/boot/$@ $(objtree)/arch/x86_64/boot/$@ ++else + #Default target when executing "make" + all: bzImage + +@@ -112,6 +127,7 @@ + + fdimage fdimage144 fdimage288 isoimage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ ++endif + + install: vdso_install + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/boot/Makefile debian/binary-custom.d/xen/src/arch/x86/boot/Makefile +--- ./arch/x86/boot/Makefile 2012-06-12 16:25:11.566312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/boot/Makefile 2012-11-13 15:20:17.260568998 +0000 +@@ -25,7 +25,7 @@ + + #RAMDISK := -DRAMDISK=512 + +-targets := vmlinux.bin setup.bin setup.elf zImage bzImage ++targets := vmlinux.bin setup.bin setup.elf zImage bzImage vmlinuz vmlinux-stripped + subdir- := compressed + + setup-y += a20.o apm.o cmdline.o copy.o cpu.o cpucheck.o edd.o +@@ -168,5 +168,13 @@ + cp System.map $(INSTALL_PATH)/ + if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi + ++$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE ++ $(call if_changed,gzip) ++ @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' ++ ++$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded ++$(obj)/vmlinux-stripped: vmlinux FORCE ++ $(call if_changed,objcopy) ++ + install: + sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/boot/compressed/vmlinux_32.lds debian/binary-custom.d/xen/src/arch/x86/boot/compressed/vmlinux_32.lds +--- ./arch/x86/boot/compressed/vmlinux_32.lds 2012-06-12 16:25:11.566312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/boot/compressed/vmlinux_32.lds 1970-01-01 01:00:00.000000000 +0100 +@@ -1,43 +0,0 @@ +-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") +-OUTPUT_ARCH(i386) +-ENTRY(startup_32) +-SECTIONS +-{ +- /* Be careful parts of head.S assume startup_32 is at +- * address 0. +- */ +- . = 0 ; +- .text.head : { +- _head = . ; +- *(.text.head) +- _ehead = . ; +- } +- .data.compressed : { +- *(.data.compressed) +- } +- .text : { +- _text = .; /* Text */ +- *(.text) +- *(.text.*) +- _etext = . ; +- } +- .rodata : { +- _rodata = . ; +- *(.rodata) /* read-only data */ +- *(.rodata.*) +- _erodata = . ; +- } +- .data : { +- _data = . ; +- *(.data) +- *(.data.*) +- _edata = . ; +- } +- .bss : { +- _bss = . ; +- *(.bss) +- *(.bss.*) +- *(COMMON) +- _end = . ; +- } +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/boot/compressed/vmlinux_32.scr debian/binary-custom.d/xen/src/arch/x86/boot/compressed/vmlinux_32.scr +--- ./arch/x86/boot/compressed/vmlinux_32.scr 2012-06-12 16:25:11.566312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/boot/compressed/vmlinux_32.scr 1970-01-01 01:00:00.000000000 +0100 +@@ -1,10 +0,0 @@ +-SECTIONS +-{ +- .data.compressed : { +- input_len = .; +- LONG(input_data_end - input_data) input_data = .; +- *(.data) +- output_len = . - 4; +- input_data_end = .; +- } +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/boot/compressed/vmlinux_64.lds debian/binary-custom.d/xen/src/arch/x86/boot/compressed/vmlinux_64.lds +--- ./arch/x86/boot/compressed/vmlinux_64.lds 2012-06-12 16:25:11.566312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/boot/compressed/vmlinux_64.lds 1970-01-01 01:00:00.000000000 +0100 +@@ -1,44 +0,0 @@ +-OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") +-OUTPUT_ARCH(i386:x86-64) +-ENTRY(startup_64) +-SECTIONS +-{ +- /* Be careful parts of head.S assume startup_32 is at +- * address 0. +- */ +- . = 0; +- .text : { +- _head = . ; +- *(.text.head) +- _ehead = . ; +- *(.text.compressed) +- _text = .; /* Text */ +- *(.text) +- *(.text.*) +- _etext = . ; +- } +- .rodata : { +- _rodata = . ; +- *(.rodata) /* read-only data */ +- *(.rodata.*) +- _erodata = . ; +- } +- .data : { +- _data = . ; +- *(.data) +- *(.data.*) +- _edata = . ; +- } +- .bss : { +- _bss = . ; +- *(.bss) +- *(.bss.*) +- *(COMMON) +- . = ALIGN(8); +- _end = . ; +- . = ALIGN(4096); +- pgtable = . ; +- . = . + 4096 * 6; +- _heap = .; +- } +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/boot/compressed/vmlinux_64.scr debian/binary-custom.d/xen/src/arch/x86/boot/compressed/vmlinux_64.scr +--- ./arch/x86/boot/compressed/vmlinux_64.scr 2012-06-12 16:25:11.566312934 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/boot/compressed/vmlinux_64.scr 1970-01-01 01:00:00.000000000 +0100 +@@ -1,10 +0,0 @@ +-SECTIONS +-{ +- .text.compressed : { +- input_len = .; +- LONG(input_data_end - input_data) input_data = .; +- *(.data) +- output_len = . - 4; +- input_data_end = .; +- } +-} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/Makefile debian/binary-custom.d/xen/src/arch/x86/ia32/Makefile +--- ./arch/x86/ia32/Makefile 2012-06-12 16:25:11.574312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/ia32/Makefile 2012-11-13 15:20:17.264568999 +0000 +@@ -14,11 +14,14 @@ + audit-class-$(CONFIG_AUDIT) := audit.o + obj-$(CONFIG_IA32_EMULATION) += $(audit-class-y) + ++syscall32-types-y := sysenter syscall ++syscall32-types-$(subst 1,$(CONFIG_XEN),$(shell expr $(CONFIG_XEN_COMPAT)0 '<' 0x0302000)) += int80 ++ + $(obj)/syscall32_syscall.o: \ +- $(foreach F,sysenter syscall,$(obj)/vsyscall-$F.so) ++ $(foreach F,$(syscall32-types-y),$(obj)/vsyscall-$F.so) + + # Teach kbuild about targets +-targets := $(foreach F,$(addprefix vsyscall-,sysenter syscall),\ ++targets := $(foreach F,$(addprefix vsyscall-,$(syscall32-types-y)),\ + $F.o $F.so $F.so.dbg) + + # The DSO images are built using a special linker script +@@ -32,12 +35,13 @@ + $(obj)/%.so: $(obj)/%.so.dbg FORCE + $(call if_changed,objcopy) + +-$(obj)/vsyscall-sysenter.so.dbg $(obj)/vsyscall-syscall.so.dbg: \ ++$(foreach F,$(syscall32-types-y),$(obj)/vsyscall-$F.so.dbg): \ + $(obj)/vsyscall-%.so.dbg: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE + $(call if_changed,syscall) + + AFLAGS_vsyscall-sysenter.o = -m32 -Wa,-32 + AFLAGS_vsyscall-syscall.o = -m32 -Wa,-32 ++AFLAGS_vsyscall-int80.o = -m32 -Wa,-32 + + vdsos := vdso32-sysenter.so vdso32-syscall.so + +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/ia32entry-xen.S debian/binary-custom.d/xen/src/arch/x86/ia32/ia32entry-xen.S +--- ./arch/x86/ia32/ia32entry-xen.S 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/ia32/ia32entry-xen.S 2012-11-13 15:20:17.268569001 +0000 +@@ -0,0 +1,669 @@ ++/* ++ * Compatibility mode system call entry point for x86-64. ++ * ++ * Copyright 2000-2002 Andi Kleen, SuSE Labs. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8) ++ ++ .macro IA32_ARG_FIXUP noebp=0 ++ movl %edi,%r8d ++ .if \noebp ++ .else ++ movl %ebp,%r9d ++ .endif ++ xchg %ecx,%esi ++ movl %ebx,%edi ++ movl %edx,%edx /* zero extension */ ++ .endm ++ ++ /* clobbers %eax */ ++ .macro CLEAR_RREGS ++ xorl %eax,%eax ++ movq %rax,R11(%rsp) ++ movq %rax,R10(%rsp) ++ movq %rax,R9(%rsp) ++ movq %rax,R8(%rsp) ++ .endm ++ ++ .macro LOAD_ARGS32 offset ++ movl \offset(%rsp),%r11d ++ movl \offset+8(%rsp),%r10d ++ movl \offset+16(%rsp),%r9d ++ movl \offset+24(%rsp),%r8d ++ movl \offset+40(%rsp),%ecx ++ movl \offset+48(%rsp),%edx ++ movl \offset+56(%rsp),%esi ++ movl \offset+64(%rsp),%edi ++ movl \offset+72(%rsp),%eax ++ .endm ++ ++#include "../kernel/xen_entry_64.S" ++ ++ .macro CFI_STARTPROC32 simple ++ CFI_STARTPROC \simple ++ CFI_UNDEFINED r8 ++ CFI_UNDEFINED r9 ++ CFI_UNDEFINED r10 ++ CFI_UNDEFINED r11 ++ CFI_UNDEFINED r12 ++ CFI_UNDEFINED r13 ++ CFI_UNDEFINED r14 ++ CFI_UNDEFINED r15 ++ .endm ++ ++/* ++ * 32bit SYSENTER instruction entry. ++ * ++ * Arguments: ++ * %eax System call number. ++ * %ebx Arg1 ++ * %ecx Arg2 ++ * %edx Arg3 ++ * %esi Arg4 ++ * %edi Arg5 ++ * %ebp user stack ++ * 0(%ebp) Arg6 ++ * ++ * Interrupts on. ++ * ++ * This is purely a fast path. For anything complicated we use the int 0x80 ++ * path below. Set up a complete hardware stack frame to share code ++ * with the int 0x80 path. ++ */ ++ENTRY(ia32_sysenter_target) ++ CFI_STARTPROC32 simple ++ CFI_SIGNAL_FRAME ++ CFI_DEF_CFA rsp,SS+8-RIP+16 ++ /*CFI_REL_OFFSET ss,SS-RIP+16*/ ++ CFI_REL_OFFSET rsp,RSP-RIP+16 ++ /*CFI_REL_OFFSET rflags,EFLAGS-RIP+16*/ ++ /*CFI_REL_OFFSET cs,CS-RIP+16*/ ++ CFI_REL_OFFSET rip,RIP-RIP+16 ++ CFI_REL_OFFSET r11,8 ++ CFI_REL_OFFSET rcx,0 ++ movq 8(%rsp),%r11 ++ CFI_RESTORE r11 ++ popq %rcx ++ CFI_ADJUST_CFA_OFFSET -8 ++ CFI_RESTORE rcx ++ movl %ebp,%ebp /* zero extension */ ++ movl %eax,%eax ++ movl $__USER32_DS,40(%rsp) ++ movq %rbp,32(%rsp) ++ movl $__USER32_CS,16(%rsp) ++ movl $VSYSCALL32_SYSEXIT,8(%rsp) ++ movq %rax,(%rsp) ++ cld ++ SAVE_ARGS 0,0,1 ++ /* no need to do an access_ok check here because rbp has been ++ 32bit zero extended */ ++1: movl (%rbp),%r9d ++ .section __ex_table,"a" ++ .quad 1b,ia32_badarg ++ .previous ++ GET_THREAD_INFO(%r10) ++ orl $TS_COMPAT,threadinfo_status(%r10) ++ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10) ++ jnz sysenter_tracesys ++sysenter_do_call: ++ cmpl $(IA32_NR_syscalls-1),%eax ++ ja ia32_badsys ++ IA32_ARG_FIXUP 1 ++ call *ia32_sys_call_table(,%rax,8) ++ movq %rax,RAX-ARGOFFSET(%rsp) ++ jmp int_ret_from_sys_call ++ ++sysenter_tracesys: ++ xchgl %r9d,%ebp ++ SAVE_REST ++ CLEAR_RREGS ++ movq %r9,R9(%rsp) ++ movq $-ENOSYS,RAX(%rsp) /* really needed? */ ++ movq %rsp,%rdi /* &pt_regs -> arg1 */ ++ call syscall_trace_enter ++ LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ ++ RESTORE_REST ++ xchgl %ebp,%r9d ++ jmp sysenter_do_call ++ CFI_ENDPROC ++ENDPROC(ia32_sysenter_target) ++ ++/* ++ * 32bit SYSCALL instruction entry. ++ * ++ * Arguments: ++ * %eax System call number. ++ * %ebx Arg1 ++ * %ecx return EIP ++ * %edx Arg3 ++ * %esi Arg4 ++ * %edi Arg5 ++ * %ebp Arg2 [note: not saved in the stack frame, should not be touched] ++ * %esp user stack ++ * 0(%esp) Arg6 ++ * ++ * Interrupts on. ++ * ++ * This is purely a fast path. For anything complicated we use the int 0x80 ++ * path below. Set up a complete hardware stack frame to share code ++ * with the int 0x80 path. ++ */ ++ENTRY(ia32_cstar_target) ++ CFI_STARTPROC32 simple ++ CFI_SIGNAL_FRAME ++ CFI_DEF_CFA rsp,SS+8-RIP+16 ++ /*CFI_REL_OFFSET ss,SS-RIP+16*/ ++ CFI_REL_OFFSET rsp,RSP-RIP+16 ++ /*CFI_REL_OFFSET rflags,EFLAGS-RIP+16*/ ++ /*CFI_REL_OFFSET cs,CS-RIP+16*/ ++ CFI_REL_OFFSET rip,RIP-RIP+16 ++ movl %eax,%eax /* zero extension */ ++ movl RSP-RIP+16(%rsp),%r8d ++ SAVE_ARGS -8,1,1 ++ movq %rax,ORIG_RAX-ARGOFFSET(%rsp) ++ movq %rbp,RCX-ARGOFFSET(%rsp) /* this lies slightly to ptrace */ ++ movl %ebp,%ecx ++ movl $__USER32_CS,CS-ARGOFFSET(%rsp) ++ movl $__USER32_DS,SS-ARGOFFSET(%rsp) ++ /* no need to do an access_ok check here because r8 has been ++ 32bit zero extended */ ++ /* hardware stack frame is complete now */ ++1: movl (%r8),%r9d ++ .section __ex_table,"a" ++ .quad 1b,ia32_badarg ++ .previous ++ GET_THREAD_INFO(%r10) ++ orl $TS_COMPAT,threadinfo_status(%r10) ++ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10) ++ jnz cstar_tracesys ++cstar_do_call: ++ cmpl $IA32_NR_syscalls-1,%eax ++ ja ia32_badsys ++ IA32_ARG_FIXUP 1 ++ call *ia32_sys_call_table(,%rax,8) ++ movq %rax,RAX-ARGOFFSET(%rsp) ++ jmp int_ret_from_sys_call ++ ++cstar_tracesys: ++ xchgl %r9d,%ebp ++ SAVE_REST ++ CLEAR_RREGS ++ movq %r9,R9(%rsp) ++ movq $-ENOSYS,RAX(%rsp) /* really needed? */ ++ movq %rsp,%rdi /* &pt_regs -> arg1 */ ++ call syscall_trace_enter ++ LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ ++ RESTORE_REST ++ xchgl %ebp,%r9d ++ movl RSP-ARGOFFSET(%rsp), %r8d ++ jmp cstar_do_call ++END(ia32_cstar_target) ++ ++ia32_badarg: ++ movq $-EFAULT,%rax ++ jmp ia32_sysret ++ CFI_ENDPROC ++ ++/* ++ * Emulated IA32 system calls via int 0x80. ++ * ++ * Arguments: ++ * %eax System call number. ++ * %ebx Arg1 ++ * %ecx Arg2 ++ * %edx Arg3 ++ * %esi Arg4 ++ * %edi Arg5 ++ * %ebp Arg6 [note: not saved in the stack frame, should not be touched] ++ * ++ * Notes: ++ * Uses the same stack frame as the x86-64 version. ++ * All registers except %eax must be saved (but ptrace may violate that) ++ * Arguments are zero extended. For system calls that want sign extension and ++ * take long arguments a wrapper is needed. Most calls can just be called ++ * directly. ++ * Assumes it is only called from user space and entered with interrupts on. ++ */ ++ ++ENTRY(ia32_syscall) ++ CFI_STARTPROC32 simple ++ CFI_SIGNAL_FRAME ++ CFI_DEF_CFA rsp,SS+8-RIP+16 ++ /*CFI_REL_OFFSET ss,SS-RIP+16*/ ++ CFI_REL_OFFSET rsp,RSP-RIP+16 ++ /*CFI_REL_OFFSET rflags,EFLAGS-RIP+16*/ ++ /*CFI_REL_OFFSET cs,CS-RIP+16*/ ++ CFI_REL_OFFSET rip,RIP-RIP+16 ++ CFI_REL_OFFSET r11,8 ++ CFI_REL_OFFSET rcx,0 ++ movq 8(%rsp),%r11 ++ CFI_RESTORE r11 ++ popq %rcx ++ CFI_ADJUST_CFA_OFFSET -8 ++ CFI_RESTORE rcx ++ movl %eax,%eax ++ movq %rax,(%rsp) ++ cld ++ /* note the registers are not zero extended to the sf. ++ this could be a problem. */ ++ SAVE_ARGS 0,0,1 ++ GET_THREAD_INFO(%r10) ++ orl $TS_COMPAT,threadinfo_status(%r10) ++ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10) ++ jnz ia32_tracesys ++ia32_do_syscall: ++ cmpl $(IA32_NR_syscalls-1),%eax ++ ja ia32_badsys ++ IA32_ARG_FIXUP ++ call *ia32_sys_call_table(,%rax,8) # xxx: rip relative ++ia32_sysret: ++ movq %rax,RAX-ARGOFFSET(%rsp) ++ jmp int_ret_from_sys_call ++ ++ia32_tracesys: ++ SAVE_REST ++ CLEAR_RREGS ++ movq $-ENOSYS,RAX(%rsp) /* really needed? */ ++ movq %rsp,%rdi /* &pt_regs -> arg1 */ ++ call syscall_trace_enter ++ LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ ++ RESTORE_REST ++ jmp ia32_do_syscall ++END(ia32_syscall) ++ ++ia32_badsys: ++ movq $0,ORIG_RAX-ARGOFFSET(%rsp) ++ movq $-ENOSYS,RAX-ARGOFFSET(%rsp) ++ jmp int_ret_from_sys_call ++ ++quiet_ni_syscall: ++ movq $-ENOSYS,%rax ++ ret ++ CFI_ENDPROC ++ ++ .macro PTREGSCALL label, func, arg ++ .globl \label ++\label: ++ leaq \func(%rip),%rax ++ leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */ ++ jmp ia32_ptregs_common ++ .endm ++ ++ CFI_STARTPROC32 ++ ++ PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi ++ PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi ++ PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx ++ PTREGSCALL stub32_sigsuspend, sys32_sigsuspend, %rcx ++ PTREGSCALL stub32_execve, sys32_execve, %rcx ++ PTREGSCALL stub32_fork, sys_fork, %rdi ++ PTREGSCALL stub32_clone, sys32_clone, %rdx ++ PTREGSCALL stub32_vfork, sys_vfork, %rdi ++ PTREGSCALL stub32_iopl, sys_iopl, %rsi ++ PTREGSCALL stub32_rt_sigsuspend, sys_rt_sigsuspend, %rdx ++ ++ENTRY(ia32_ptregs_common) ++ popq %r11 ++ CFI_ENDPROC ++ CFI_STARTPROC32 simple ++ CFI_SIGNAL_FRAME ++ CFI_DEF_CFA rsp,SS+8-ARGOFFSET ++ CFI_REL_OFFSET rax,RAX-ARGOFFSET ++ CFI_REL_OFFSET rcx,RCX-ARGOFFSET ++ CFI_REL_OFFSET rdx,RDX-ARGOFFSET ++ CFI_REL_OFFSET rsi,RSI-ARGOFFSET ++ CFI_REL_OFFSET rdi,RDI-ARGOFFSET ++ CFI_REL_OFFSET rip,RIP-ARGOFFSET ++/* CFI_REL_OFFSET cs,CS-ARGOFFSET*/ ++/* CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/ ++ CFI_REL_OFFSET rsp,RSP-ARGOFFSET ++/* CFI_REL_OFFSET ss,SS-ARGOFFSET*/ ++ SAVE_REST ++ call *%rax ++ RESTORE_REST ++ jmp ia32_sysret /* misbalances the return cache */ ++ CFI_ENDPROC ++END(ia32_ptregs_common) ++ ++ .section .rodata,"a" ++ .align 8 ++ia32_sys_call_table: ++ .quad sys_restart_syscall ++ .quad sys_exit ++ .quad stub32_fork ++ .quad sys_read ++ .quad sys_write ++ .quad compat_sys_open /* 5 */ ++ .quad sys_close ++ .quad sys32_waitpid ++ .quad sys_creat ++ .quad sys_link ++ .quad sys_unlink /* 10 */ ++ .quad stub32_execve ++ .quad sys_chdir ++ .quad compat_sys_time ++ .quad sys_mknod ++ .quad sys_chmod /* 15 */ ++ .quad sys_lchown16 ++ .quad quiet_ni_syscall /* old break syscall holder */ ++ .quad sys_stat ++ .quad sys32_lseek ++ .quad sys_getpid /* 20 */ ++ .quad compat_sys_mount /* mount */ ++ .quad sys_oldumount /* old_umount */ ++ .quad sys_setuid16 ++ .quad sys_getuid16 ++ .quad compat_sys_stime /* stime */ /* 25 */ ++ .quad sys32_ptrace /* ptrace */ ++ .quad sys_alarm ++ .quad sys_fstat /* (old)fstat */ ++ .quad sys_pause ++ .quad compat_sys_utime /* 30 */ ++ .quad quiet_ni_syscall /* old stty syscall holder */ ++ .quad quiet_ni_syscall /* old gtty syscall holder */ ++ .quad sys_access ++ .quad sys_nice ++ .quad quiet_ni_syscall /* 35 */ /* old ftime syscall holder */ ++ .quad sys_sync ++ .quad sys32_kill ++ .quad sys_rename ++ .quad sys_mkdir ++ .quad sys_rmdir /* 40 */ ++ .quad sys_dup ++ .quad sys32_pipe ++ .quad compat_sys_times ++ .quad quiet_ni_syscall /* old prof syscall holder */ ++ .quad sys_brk /* 45 */ ++ .quad sys_setgid16 ++ .quad sys_getgid16 ++ .quad sys_signal ++ .quad sys_geteuid16 ++ .quad sys_getegid16 /* 50 */ ++ .quad sys_acct ++ .quad sys_umount /* new_umount */ ++ .quad quiet_ni_syscall /* old lock syscall holder */ ++ .quad compat_sys_ioctl ++ .quad compat_sys_fcntl64 /* 55 */ ++ .quad quiet_ni_syscall /* old mpx syscall holder */ ++ .quad sys_setpgid ++ .quad quiet_ni_syscall /* old ulimit syscall holder */ ++ .quad sys32_olduname ++ .quad sys_umask /* 60 */ ++ .quad sys_chroot ++ .quad sys32_ustat ++ .quad sys_dup2 ++ .quad sys_getppid ++ .quad sys_getpgrp /* 65 */ ++ .quad sys_setsid ++ .quad sys32_sigaction ++ .quad sys_sgetmask ++ .quad sys_ssetmask ++ .quad sys_setreuid16 /* 70 */ ++ .quad sys_setregid16 ++ .quad stub32_sigsuspend ++ .quad compat_sys_sigpending ++ .quad sys_sethostname ++ .quad compat_sys_setrlimit /* 75 */ ++ .quad compat_sys_old_getrlimit /* old_getrlimit */ ++ .quad compat_sys_getrusage ++ .quad sys32_gettimeofday ++ .quad sys32_settimeofday ++ .quad sys_getgroups16 /* 80 */ ++ .quad sys_setgroups16 ++ .quad sys32_old_select ++ .quad sys_symlink ++ .quad sys_lstat ++ .quad sys_readlink /* 85 */ ++ .quad sys_uselib ++ .quad sys_swapon ++ .quad sys_reboot ++ .quad compat_sys_old_readdir ++ .quad sys32_mmap /* 90 */ ++ .quad sys_munmap ++ .quad sys_truncate ++ .quad sys_ftruncate ++ .quad sys_fchmod ++ .quad sys_fchown16 /* 95 */ ++ .quad sys_getpriority ++ .quad sys_setpriority ++ .quad quiet_ni_syscall /* old profil syscall holder */ ++ .quad compat_sys_statfs ++ .quad compat_sys_fstatfs /* 100 */ ++ .quad sys_ioperm ++ .quad compat_sys_socketcall ++ .quad sys_syslog ++ .quad compat_sys_setitimer ++ .quad compat_sys_getitimer /* 105 */ ++ .quad compat_sys_newstat ++ .quad compat_sys_newlstat ++ .quad compat_sys_newfstat ++ .quad sys32_uname ++ .quad stub32_iopl /* 110 */ ++ .quad sys_vhangup ++ .quad quiet_ni_syscall /* old "idle" system call */ ++ .quad sys32_vm86_warning /* vm86old */ ++ .quad compat_sys_wait4 ++ .quad sys_swapoff /* 115 */ ++ .quad compat_sys_sysinfo ++ .quad sys32_ipc ++ .quad sys_fsync ++ .quad stub32_sigreturn ++ .quad stub32_clone /* 120 */ ++ .quad sys_setdomainname ++ .quad sys_uname ++ .quad sys_modify_ldt ++ .quad compat_sys_adjtimex ++ .quad sys32_mprotect /* 125 */ ++ .quad compat_sys_sigprocmask ++ .quad quiet_ni_syscall /* create_module */ ++ .quad sys_init_module ++ .quad sys_delete_module ++ .quad quiet_ni_syscall /* 130 get_kernel_syms */ ++ .quad sys32_quotactl ++ .quad sys_getpgid ++ .quad sys_fchdir ++ .quad quiet_ni_syscall /* bdflush */ ++ .quad sys_sysfs /* 135 */ ++ .quad sys_personality ++ .quad quiet_ni_syscall /* for afs_syscall */ ++ .quad sys_setfsuid16 ++ .quad sys_setfsgid16 ++ .quad sys_llseek /* 140 */ ++ .quad compat_sys_getdents ++ .quad compat_sys_select ++ .quad sys_flock ++ .quad sys_msync ++ .quad compat_sys_readv /* 145 */ ++ .quad compat_sys_writev ++ .quad sys_getsid ++ .quad sys_fdatasync ++ .quad sys32_sysctl /* sysctl */ ++ .quad sys_mlock /* 150 */ ++ .quad sys_munlock ++ .quad sys_mlockall ++ .quad sys_munlockall ++ .quad sys_sched_setparam ++ .quad sys_sched_getparam /* 155 */ ++ .quad sys_sched_setscheduler ++ .quad sys_sched_getscheduler ++ .quad sys_sched_yield ++ .quad sys_sched_get_priority_max ++ .quad sys_sched_get_priority_min /* 160 */ ++ .quad sys32_sched_rr_get_interval ++ .quad compat_sys_nanosleep ++ .quad sys_mremap ++ .quad sys_setresuid16 ++ .quad sys_getresuid16 /* 165 */ ++ .quad sys32_vm86_warning /* vm86 */ ++ .quad quiet_ni_syscall /* query_module */ ++ .quad sys_poll ++ .quad compat_sys_nfsservctl ++ .quad sys_setresgid16 /* 170 */ ++ .quad sys_getresgid16 ++ .quad sys_prctl ++ .quad stub32_rt_sigreturn ++ .quad sys32_rt_sigaction ++ .quad sys32_rt_sigprocmask /* 175 */ ++ .quad sys32_rt_sigpending ++ .quad compat_sys_rt_sigtimedwait ++ .quad sys32_rt_sigqueueinfo ++ .quad stub32_rt_sigsuspend ++ .quad sys32_pread /* 180 */ ++ .quad sys32_pwrite ++ .quad sys_chown16 ++ .quad sys_getcwd ++ .quad sys_capget ++ .quad sys_capset ++ .quad stub32_sigaltstack ++ .quad sys32_sendfile ++ .quad quiet_ni_syscall /* streams1 */ ++ .quad quiet_ni_syscall /* streams2 */ ++ .quad stub32_vfork /* 190 */ ++ .quad compat_sys_getrlimit ++ .quad sys_mmap_pgoff ++ .quad sys32_truncate64 ++ .quad sys32_ftruncate64 ++ .quad sys32_stat64 /* 195 */ ++ .quad sys32_lstat64 ++ .quad sys32_fstat64 ++ .quad sys_lchown ++ .quad sys_getuid ++ .quad sys_getgid /* 200 */ ++ .quad sys_geteuid ++ .quad sys_getegid ++ .quad sys_setreuid ++ .quad sys_setregid ++ .quad sys_getgroups /* 205 */ ++ .quad sys_setgroups ++ .quad sys_fchown ++ .quad sys_setresuid ++ .quad sys_getresuid ++ .quad sys_setresgid /* 210 */ ++ .quad sys_getresgid ++ .quad sys_chown ++ .quad sys_setuid ++ .quad sys_setgid ++ .quad sys_setfsuid /* 215 */ ++ .quad sys_setfsgid ++ .quad sys_pivot_root ++ .quad sys_mincore ++ .quad sys_madvise ++ .quad compat_sys_getdents64 /* 220 getdents64 */ ++ .quad compat_sys_fcntl64 ++ .quad quiet_ni_syscall /* tux */ ++ .quad quiet_ni_syscall /* security */ ++ .quad sys_gettid ++ .quad sys32_readahead /* 225 */ ++ .quad sys_setxattr ++ .quad sys_lsetxattr ++ .quad sys_fsetxattr ++ .quad sys_getxattr ++ .quad sys_lgetxattr /* 230 */ ++ .quad sys_fgetxattr ++ .quad sys_listxattr ++ .quad sys_llistxattr ++ .quad sys_flistxattr ++ .quad sys_removexattr /* 235 */ ++ .quad sys_lremovexattr ++ .quad sys_fremovexattr ++ .quad sys_tkill ++ .quad sys_sendfile64 ++ .quad compat_sys_futex /* 240 */ ++ .quad compat_sys_sched_setaffinity ++ .quad compat_sys_sched_getaffinity ++ .quad sys32_set_thread_area ++ .quad sys32_get_thread_area ++ .quad compat_sys_io_setup /* 245 */ ++ .quad sys_io_destroy ++ .quad compat_sys_io_getevents ++ .quad compat_sys_io_submit ++ .quad sys_io_cancel ++ .quad sys32_fadvise64 /* 250 */ ++ .quad quiet_ni_syscall /* free_huge_pages */ ++ .quad sys_exit_group ++ .quad sys32_lookup_dcookie ++ .quad sys_epoll_create ++ .quad sys_epoll_ctl /* 255 */ ++ .quad sys_epoll_wait ++ .quad sys_remap_file_pages ++ .quad sys_set_tid_address ++ .quad compat_sys_timer_create ++ .quad compat_sys_timer_settime /* 260 */ ++ .quad compat_sys_timer_gettime ++ .quad sys_timer_getoverrun ++ .quad sys_timer_delete ++ .quad compat_sys_clock_settime ++ .quad compat_sys_clock_gettime /* 265 */ ++ .quad compat_sys_clock_getres ++ .quad compat_sys_clock_nanosleep ++ .quad compat_sys_statfs64 ++ .quad compat_sys_fstatfs64 ++ .quad sys_tgkill /* 270 */ ++ .quad compat_sys_utimes ++ .quad sys32_fadvise64_64 ++ .quad quiet_ni_syscall /* sys_vserver */ ++ .quad sys_mbind ++ .quad compat_sys_get_mempolicy /* 275 */ ++ .quad sys_set_mempolicy ++ .quad compat_sys_mq_open ++ .quad sys_mq_unlink ++ .quad compat_sys_mq_timedsend ++ .quad compat_sys_mq_timedreceive /* 280 */ ++ .quad compat_sys_mq_notify ++ .quad compat_sys_mq_getsetattr ++ .quad compat_sys_kexec_load /* reserved for kexec */ ++ .quad compat_sys_waitid ++ .quad quiet_ni_syscall /* 285: sys_altroot */ ++ .quad sys_add_key ++ .quad sys_request_key ++ .quad sys_keyctl ++ .quad sys_ioprio_set ++ .quad sys_ioprio_get /* 290 */ ++ .quad sys_inotify_init ++ .quad sys_inotify_add_watch ++ .quad sys_inotify_rm_watch ++ .quad sys_migrate_pages ++ .quad compat_sys_openat /* 295 */ ++ .quad sys_mkdirat ++ .quad sys_mknodat ++ .quad sys_fchownat ++ .quad compat_sys_futimesat ++ .quad sys32_fstatat /* 300 */ ++ .quad sys_unlinkat ++ .quad sys_renameat ++ .quad sys_linkat ++ .quad sys_symlinkat ++ .quad sys_readlinkat /* 305 */ ++ .quad sys_fchmodat ++ .quad sys_faccessat ++ .quad compat_sys_pselect6 ++ .quad compat_sys_ppoll ++ .quad sys_unshare /* 310 */ ++ .quad compat_sys_set_robust_list ++ .quad compat_sys_get_robust_list ++ .quad sys_splice ++ .quad sys32_sync_file_range ++ .quad sys_tee /* 315 */ ++ .quad compat_sys_vmsplice ++ .quad compat_sys_move_pages ++ .quad sys_getcpu ++ .quad sys_epoll_pwait ++ .quad compat_sys_utimensat /* 320 */ ++ .quad compat_sys_signalfd ++ .quad compat_sys_timerfd ++ .quad sys_eventfd ++ .quad sys32_fallocate ++ia32_syscall_end: +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/syscall32-xen.c debian/binary-custom.d/xen/src/arch/x86/ia32/syscall32-xen.c +--- ./arch/x86/ia32/syscall32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/ia32/syscall32-xen.c 2012-11-13 15:20:17.268569001 +0000 +@@ -0,0 +1,112 @@ ++/* Copyright 2002,2003 Andi Kleen, SuSE Labs */ ++ ++/* vsyscall handling for 32bit processes. Map a stub page into it ++ on demand because 32bit cannot reach the kernel's fixmaps */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++extern unsigned char syscall32_syscall[], syscall32_syscall_end[]; ++extern unsigned char syscall32_sysenter[], syscall32_sysenter_end[]; ++extern int sysctl_vsyscall32; ++ ++static struct page *syscall32_pages[1]; ++static int use_sysenter = -1; ++ ++#if CONFIG_XEN_COMPAT < 0x030200 ++extern unsigned char syscall32_int80[], syscall32_int80_end[]; ++static int use_int80 = 1; ++#endif ++ ++struct linux_binprm; ++ ++/* Setup a VMA at program startup for the vsyscall page */ ++int syscall32_setup_pages(struct linux_binprm *bprm, int exstack) ++{ ++ struct mm_struct *mm = current->mm; ++ int ret; ++ ++ down_write(&mm->mmap_sem); ++ /* ++ * MAYWRITE to allow gdb to COW and set breakpoints ++ * ++ * Make sure the vDSO gets into every core dump. ++ * Dumping its contents makes post-mortem fully interpretable later ++ * without matching up the same kernel and hardware config to see ++ * what PC values meant. ++ */ ++ /* Could randomize here */ ++ ret = install_special_mapping(mm, VSYSCALL32_BASE, PAGE_SIZE, ++ VM_READ|VM_EXEC| ++ VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| ++ VM_ALWAYSDUMP, ++ syscall32_pages); ++ up_write(&mm->mmap_sem); ++ return ret; ++} ++ ++static int __init init_syscall32(void) ++{ ++ char *syscall32_page = (void *)get_zeroed_page(GFP_KERNEL); ++ if (!syscall32_page) ++ panic("Cannot allocate syscall32 page"); ++ ++ syscall32_pages[0] = virt_to_page(syscall32_page); ++#if CONFIG_XEN_COMPAT < 0x030200 ++ if (use_int80) { ++ memcpy(syscall32_page, syscall32_int80, ++ syscall32_int80_end - syscall32_int80); ++ } else ++#endif ++ if (use_sysenter > 0) { ++ memcpy(syscall32_page, syscall32_sysenter, ++ syscall32_sysenter_end - syscall32_sysenter); ++ } else { ++ memcpy(syscall32_page, syscall32_syscall, ++ syscall32_syscall_end - syscall32_syscall); ++ } ++ return 0; ++} ++ ++/* ++ * This must be done early in case we have an initrd containing 32-bit ++ * binaries (e.g., hotplug). This could be pushed upstream to arch/x86_64. ++ */ ++core_initcall(init_syscall32); ++ ++/* May not be __init: called during resume */ ++void syscall32_cpu_init(void) ++{ ++ static struct callback_register cstar = { ++ .type = CALLBACKTYPE_syscall32, ++ .address = (unsigned long)ia32_cstar_target ++ }; ++ static struct callback_register sysenter = { ++ .type = CALLBACKTYPE_sysenter, ++ .address = (unsigned long)ia32_sysenter_target ++ }; ++ ++ /* Load these always in case some future AMD CPU supports ++ SYSENTER from compat mode too. */ ++ if ((HYPERVISOR_callback_op(CALLBACKOP_register, &sysenter) < 0) || ++ (HYPERVISOR_callback_op(CALLBACKOP_register, &cstar) < 0)) ++#if CONFIG_XEN_COMPAT < 0x030200 ++ return; ++ use_int80 = 0; ++#else ++ BUG(); ++#endif ++ ++ if (use_sysenter < 0) ++ use_sysenter = (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/syscall32_syscall-xen.S debian/binary-custom.d/xen/src/arch/x86/ia32/syscall32_syscall-xen.S +--- ./arch/x86/ia32/syscall32_syscall-xen.S 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/ia32/syscall32_syscall-xen.S 2012-11-13 15:20:17.268569001 +0000 +@@ -0,0 +1,28 @@ ++/* 32bit VDSOs mapped into user space. */ ++ ++ .section ".init.data","aw" ++ ++#if CONFIG_XEN_COMPAT < 0x030200 ++ ++ .globl syscall32_int80 ++ .globl syscall32_int80_end ++ ++syscall32_int80: ++ .incbin "arch/x86/ia32/vsyscall-int80.so" ++syscall32_int80_end: ++ ++#endif ++ ++ .globl syscall32_syscall ++ .globl syscall32_syscall_end ++ ++syscall32_syscall: ++ .incbin "arch/x86/ia32/vsyscall-syscall.so" ++syscall32_syscall_end: ++ ++ .globl syscall32_sysenter ++ .globl syscall32_sysenter_end ++ ++syscall32_sysenter: ++ .incbin "arch/x86/ia32/vsyscall-sysenter.so" ++syscall32_sysenter_end: +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/ia32/vsyscall-int80.S debian/binary-custom.d/xen/src/arch/x86/ia32/vsyscall-int80.S +--- ./arch/x86/ia32/vsyscall-int80.S 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/ia32/vsyscall-int80.S 2012-11-13 15:20:17.268569001 +0000 +@@ -0,0 +1,58 @@ ++/* ++ * Code for the vsyscall page. This version uses the old int $0x80 method. ++ * ++ * NOTE: ++ * 1) __kernel_vsyscall _must_ be first in this page. ++ * 2) there are alignment constraints on this stub, see vsyscall-sigreturn.S ++ * for details. ++ */ ++#include ++#include ++ ++ .code32 ++ .text ++ .section .text.vsyscall,"ax" ++ .globl __kernel_vsyscall ++ .type __kernel_vsyscall,@function ++__kernel_vsyscall: ++.LSTART_vsyscall: ++ int $0x80 ++ ret ++.LEND_vsyscall: ++ .size __kernel_vsyscall,.-.LSTART_vsyscall ++ .previous ++ ++ .section .eh_frame,"a",@progbits ++.LSTARTFRAME: ++ .long .LENDCIE-.LSTARTCIE ++.LSTARTCIE: ++ .long 0 /* CIE ID */ ++ .byte 1 /* Version number */ ++ .string "zR" /* NUL-terminated augmentation string */ ++ .uleb128 1 /* Code alignment factor */ ++ .sleb128 -4 /* Data alignment factor */ ++ .byte 8 /* Return address register column */ ++ .uleb128 1 /* Augmentation value length */ ++ .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ ++ .byte 0x0c /* DW_CFA_def_cfa */ ++ .uleb128 4 ++ .uleb128 4 ++ .byte 0x88 /* DW_CFA_offset, column 0x8 */ ++ .uleb128 1 ++ .align 4 ++.LENDCIE: ++ ++ .long .LENDFDE1-.LSTARTFDE1 /* Length FDE */ ++.LSTARTFDE1: ++ .long .LSTARTFDE1-.LSTARTFRAME /* CIE pointer */ ++ .long .LSTART_vsyscall-. /* PC-relative start address */ ++ .long .LEND_vsyscall-.LSTART_vsyscall ++ .uleb128 0 /* Augmentation length */ ++ .align 4 ++.LENDFDE1: ++ ++/* ++ * Get the common code for the sigreturn entry points. ++ */ ++#define SYSCALL_ENTER_KERNEL int $0x80 ++#include "vsyscall-sigreturn.S" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/Makefile debian/binary-custom.d/xen/src/arch/x86/kernel/Makefile +--- ./arch/x86/kernel/Makefile 2012-06-12 16:25:11.578312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/Makefile 2012-11-13 15:20:17.268569001 +0000 +@@ -7,3 +7,6 @@ + # Workaround to delete .lds files with make clean + # The problem is that we do not enter Makefile_32 with make clean. + clean-files := vsyscall*.lds vsyscall*.so ++ ++disabled-obj-$(CONFIG_XEN) := early-quirks.o genapic_flat_$(BITS).o hpet.o i8253.o i8259_$(BITS).o \ ++ reboot_$(BITS).o smpboot_$(BITS).o suspend_$(BITS).o trampoline_$(BITS).o tsc_$(BITS).o tsc_sync.o +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/Makefile_32 debian/binary-custom.d/xen/src/arch/x86/kernel/Makefile_32 +--- ./arch/x86/kernel/Makefile_32 2012-06-12 16:25:11.578312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/Makefile_32 2012-11-13 15:20:17.268569001 +0000 +@@ -49,6 +49,7 @@ + obj-y += pcspeaker.o + + obj-$(CONFIG_SCx200) += scx200_32.o ++obj-$(CONFIG_XEN) += fixup.o + + # vsyscall_32.o contains the vsyscall DSO images as __initdata. + # We must build both images before we can assemble it. +@@ -85,5 +86,3 @@ + $(obj)/vsyscall-syms.o: $(src)/vsyscall_32.lds \ + $(obj)/vsyscall-sysenter_32.o $(obj)/vsyscall-note_32.o FORCE + $(call if_changed,syscall) +- +- +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/Makefile_64 debian/binary-custom.d/xen/src/arch/x86/kernel/Makefile_64 +--- ./arch/x86/kernel/Makefile_64 2012-06-12 16:25:11.578312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/Makefile_64 2012-11-13 15:20:17.268569001 +0000 +@@ -6,7 +6,7 @@ + CPPFLAGS_vmlinux.lds += -Ux86_64 + EXTRA_AFLAGS := -traditional + +-obj-y := process_64.o signal_64.o entry_64.o traps_64.o irq_64.o \ ++obj-y := process_64.o signal_64.o entry_64.o traps_64.o irq_64.o nmi_64.o \ + ptrace_64.o time_64.o ioport_64.o ldt_64.o setup_64.o i8259_64.o sys_x86_64.o \ + x8664_ksyms_64.o i387_64.o syscall_64.o vsyscall_64.o \ + setup64.o bootflag.o e820_64.o reboot_64.o quirks.o i8237.o \ +@@ -20,8 +20,9 @@ + obj-$(CONFIG_MICROCODE) += microcode.o + obj-$(CONFIG_X86_CPUID) += cpuid.o + obj-$(CONFIG_SMP) += smp_64.o smpboot_64.o trampoline_64.o tsc_sync.o +-obj-y += apic_64.o nmi_64.o +-obj-y += io_apic_64.o mpparse_64.o genapic_64.o genapic_flat_64.o ++obj-$(CONFIG_X86_LOCAL_APIC) += apic_64.o ++obj-$(CONFIG_X86_XEN_GENAPIC) += genapic_64.o genapic_xen_64.o ++obj-$(CONFIG_X86_IO_APIC) += io_apic_64.o mpparse_64.o genapic_64.o genapic_flat_64.o + obj-$(CONFIG_KEXEC) += machine_kexec_64.o relocate_kernel_64.o crash.o + obj-$(CONFIG_CRASH_DUMP) += crash_dump_64.o + obj-$(CONFIG_PM) += suspend_64.o +@@ -43,3 +44,9 @@ + obj-y += pcspeaker.o + + CFLAGS_vsyscall_64.o := $(PROFILING) -g0 ++ ++apic_64-$(CONFIG_XEN) += apic_32.o ++time_64-$(CONFIG_XEN) += time_32.o ++pci-dma_64-$(CONFIG_XEN) += pci-dma_32.o ++ ++%/head_64.o %/head_64.s: asflags-$(CONFIG_XEN) := +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/acpi/Makefile debian/binary-custom.d/xen/src/arch/x86/kernel/acpi/Makefile +--- ./arch/x86/kernel/acpi/Makefile 2012-06-12 16:25:11.578312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/acpi/Makefile 2012-11-13 15:20:17.268569001 +0000 +@@ -5,3 +5,4 @@ + obj-y += cstate.o processor.o + endif + ++disabled-obj-$(CONFIG_XEN) := cstate.o wakeup_$(BITS).o +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/acpi/boot-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/acpi/boot-xen.c +--- ./arch/x86/kernel/acpi/boot-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/acpi/boot-xen.c 2012-11-13 15:20:17.272569002 +0000 +@@ -0,0 +1,1367 @@ ++/* ++ * boot.c - Architecture-Specific Low-Level ACPI Boot Support ++ * ++ * Copyright (C) 2001, 2002 Paul Diefenbaugh ++ * Copyright (C) 2001 Jun Nakajima ++ * ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++static int __initdata acpi_force = 0; ++ ++#ifdef CONFIG_ACPI ++int acpi_disabled = 0; ++#else ++int acpi_disabled = 1; ++#endif ++EXPORT_SYMBOL(acpi_disabled); ++ ++#ifdef CONFIG_X86_64 ++ ++#include ++ ++static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return 0; } ++ ++ ++#else /* X86 */ ++ ++#ifdef CONFIG_X86_LOCAL_APIC ++#include ++#include ++#endif /* CONFIG_X86_LOCAL_APIC */ ++ ++#endif /* X86 */ ++ ++#define BAD_MADT_ENTRY(entry, end) ( \ ++ (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ ++ ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) ++ ++#define PREFIX "ACPI: " ++ ++int acpi_noirq; /* skip ACPI IRQ initialization */ ++int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */ ++int acpi_ht __initdata = 1; /* enable HT */ ++ ++int acpi_lapic; ++int acpi_ioapic; ++int acpi_strict; ++EXPORT_SYMBOL(acpi_strict); ++ ++u8 acpi_sci_flags __initdata; ++int acpi_sci_override_gsi __initdata; ++int acpi_skip_timer_override __initdata; ++int acpi_use_timer_override __initdata; ++ ++#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN) ++static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; ++#endif ++ ++#ifndef __HAVE_ARCH_CMPXCHG ++#warning ACPI uses CMPXCHG, i486 and later hardware ++#endif ++ ++/* -------------------------------------------------------------------------- ++ Boot-time Configuration ++ -------------------------------------------------------------------------- */ ++ ++/* ++ * The default interrupt routing model is PIC (8259). This gets ++ * overridden if IOAPICs are enumerated (below). ++ */ ++enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; ++ ++#if defined(CONFIG_X86_64) && !defined(CONFIG_XEN) ++ ++/* rely on all ACPI tables being in the direct mapping */ ++char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size) ++{ ++ if (!phys_addr || !size) ++ return NULL; ++ ++ if (phys_addr+size <= (end_pfn_map << PAGE_SHIFT) + PAGE_SIZE) ++ return __va(phys_addr); ++ ++ return NULL; ++} ++ ++#else ++ ++/* ++ * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, ++ * to map the target physical address. The problem is that set_fixmap() ++ * provides a single page, and it is possible that the page is not ++ * sufficient. ++ * By using this area, we can map up to MAX_IO_APICS pages temporarily, ++ * i.e. until the next __va_range() call. ++ * ++ * Important Safety Note: The fixed I/O APIC page numbers are *subtracted* ++ * from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and ++ * count idx down while incrementing the phys address. ++ */ ++char *__init __acpi_map_table(unsigned long phys, unsigned long size) ++{ ++ unsigned long base, offset, mapped_size; ++ int idx; ++ ++#ifndef CONFIG_XEN ++ if (phys + size < 8 * 1024 * 1024) ++ return __va(phys); ++#endif ++ ++ offset = phys & (PAGE_SIZE - 1); ++ mapped_size = PAGE_SIZE - offset; ++ set_fixmap(FIX_ACPI_END, phys); ++ base = fix_to_virt(FIX_ACPI_END); ++ ++ /* ++ * Most cases can be covered by the below. ++ */ ++ idx = FIX_ACPI_END; ++ while (mapped_size < size) { ++ if (--idx < FIX_ACPI_BEGIN) ++ return NULL; /* cannot handle this */ ++ phys += PAGE_SIZE; ++ set_fixmap(idx, phys); ++ mapped_size += PAGE_SIZE; ++ } ++ ++ return ((unsigned char *)base + offset); ++} ++#endif ++ ++#ifdef CONFIG_PCI_MMCONFIG ++/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ ++struct acpi_mcfg_allocation *pci_mmcfg_config; ++int pci_mmcfg_config_num; ++ ++int __init acpi_parse_mcfg(struct acpi_table_header *header) ++{ ++ struct acpi_table_mcfg *mcfg; ++ unsigned long i; ++ int config_size; ++ ++ if (!header) ++ return -EINVAL; ++ ++ mcfg = (struct acpi_table_mcfg *)header; ++ ++ /* how many config structures do we have */ ++ pci_mmcfg_config_num = 0; ++ i = header->length - sizeof(struct acpi_table_mcfg); ++ while (i >= sizeof(struct acpi_mcfg_allocation)) { ++ ++pci_mmcfg_config_num; ++ i -= sizeof(struct acpi_mcfg_allocation); ++ }; ++ if (pci_mmcfg_config_num == 0) { ++ printk(KERN_ERR PREFIX "MMCONFIG has no entries\n"); ++ return -ENODEV; ++ } ++ ++ config_size = pci_mmcfg_config_num * sizeof(*pci_mmcfg_config); ++ pci_mmcfg_config = kmalloc(config_size, GFP_KERNEL); ++ if (!pci_mmcfg_config) { ++ printk(KERN_WARNING PREFIX ++ "No memory for MCFG config tables\n"); ++ return -ENOMEM; ++ } ++ ++ memcpy(pci_mmcfg_config, &mcfg[1], config_size); ++ for (i = 0; i < pci_mmcfg_config_num; ++i) { ++ if (pci_mmcfg_config[i].address > 0xFFFFFFFF) { ++ printk(KERN_ERR PREFIX ++ "MMCONFIG not in low 4GB of memory\n"); ++ kfree(pci_mmcfg_config); ++ pci_mmcfg_config_num = 0; ++ return -ENODEV; ++ } ++ } ++ ++ return 0; ++} ++#endif /* CONFIG_PCI_MMCONFIG */ ++ ++#ifdef CONFIG_X86_LOCAL_APIC ++static int __init acpi_parse_madt(struct acpi_table_header *table) ++{ ++ struct acpi_table_madt *madt = NULL; ++ ++ if (!cpu_has_apic) ++ return -EINVAL; ++ ++ madt = (struct acpi_table_madt *)table; ++ if (!madt) { ++ printk(KERN_WARNING PREFIX "Unable to map MADT\n"); ++ return -ENODEV; ++ } ++ ++#ifndef CONFIG_XEN ++ if (madt->address) { ++ acpi_lapic_addr = (u64) madt->address; ++ ++ printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n", ++ madt->address); ++ } ++#endif ++ ++ acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); ++ ++ return 0; ++} ++ ++static int __init ++acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end) ++{ ++ struct acpi_madt_local_apic *processor = NULL; ++ ++ processor = (struct acpi_madt_local_apic *)header; ++ ++ if (BAD_MADT_ENTRY(processor, end)) ++ return -EINVAL; ++ ++ acpi_table_print_madt_entry(header); ++ ++ /* ++ * We need to register disabled CPU as well to permit ++ * counting disabled CPUs. This allows us to size ++ * cpus_possible_map more accurately, to permit ++ * to not preallocating memory for all NR_CPUS ++ * when we use CPU hotplug. ++ */ ++ mp_register_lapic(processor->id, /* APIC ID */ ++ processor->lapic_flags & ACPI_MADT_ENABLED); /* Enabled? */ ++ ++ return 0; ++} ++ ++static int __init ++acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header, ++ const unsigned long end) ++{ ++#ifndef CONFIG_XEN ++ struct acpi_madt_local_apic_override *lapic_addr_ovr = NULL; ++ ++ lapic_addr_ovr = (struct acpi_madt_local_apic_override *)header; ++ ++ if (BAD_MADT_ENTRY(lapic_addr_ovr, end)) ++ return -EINVAL; ++ ++ acpi_lapic_addr = lapic_addr_ovr->address; ++#endif ++ ++ return 0; ++} ++ ++static int __init ++acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long end) ++{ ++ struct acpi_madt_local_apic_nmi *lapic_nmi = NULL; ++ ++ lapic_nmi = (struct acpi_madt_local_apic_nmi *)header; ++ ++ if (BAD_MADT_ENTRY(lapic_nmi, end)) ++ return -EINVAL; ++ ++ acpi_table_print_madt_entry(header); ++ ++ if (lapic_nmi->lint != 1) ++ printk(KERN_WARNING PREFIX "NMI not connected to LINT 1!\n"); ++ ++ return 0; ++} ++ ++#endif /*CONFIG_X86_LOCAL_APIC */ ++ ++#ifdef CONFIG_X86_IO_APIC ++ ++static int __init ++acpi_parse_ioapic(struct acpi_subtable_header * header, const unsigned long end) ++{ ++ struct acpi_madt_io_apic *ioapic = NULL; ++ ++ ioapic = (struct acpi_madt_io_apic *)header; ++ ++ if (BAD_MADT_ENTRY(ioapic, end)) ++ return -EINVAL; ++ ++ acpi_table_print_madt_entry(header); ++ ++ mp_register_ioapic(ioapic->id, ++ ioapic->address, ioapic->global_irq_base); ++ ++ return 0; ++} ++ ++/* ++ * Parse Interrupt Source Override for the ACPI SCI ++ */ ++static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) ++{ ++ if (trigger == 0) /* compatible SCI trigger is level */ ++ trigger = 3; ++ ++ if (polarity == 0) /* compatible SCI polarity is low */ ++ polarity = 3; ++ ++ /* Command-line over-ride via acpi_sci= */ ++ if (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) ++ trigger = (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) >> 2; ++ ++ if (acpi_sci_flags & ACPI_MADT_POLARITY_MASK) ++ polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK; ++ ++ /* ++ * mp_config_acpi_legacy_irqs() already setup IRQs < 16 ++ * If GSI is < 16, this will update its flags, ++ * else it will create a new mp_irqs[] entry. ++ */ ++ mp_override_legacy_irq(gsi, polarity, trigger, gsi); ++ ++ /* ++ * stash over-ride to indicate we've been here ++ * and for later update of acpi_gbl_FADT ++ */ ++ acpi_sci_override_gsi = gsi; ++ return; ++} ++ ++static int __init ++acpi_parse_int_src_ovr(struct acpi_subtable_header * header, ++ const unsigned long end) ++{ ++ struct acpi_madt_interrupt_override *intsrc = NULL; ++ ++ intsrc = (struct acpi_madt_interrupt_override *)header; ++ ++ if (BAD_MADT_ENTRY(intsrc, end)) ++ return -EINVAL; ++ ++ acpi_table_print_madt_entry(header); ++ ++ if (intsrc->source_irq == acpi_gbl_FADT.sci_interrupt) { ++ acpi_sci_ioapic_setup(intsrc->global_irq, ++ intsrc->inti_flags & ACPI_MADT_POLARITY_MASK, ++ (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2); ++ return 0; ++ } ++ ++ if (acpi_skip_timer_override && ++ intsrc->source_irq == 0 && intsrc->global_irq == 2) { ++ printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); ++ return 0; ++ } ++ ++ mp_override_legacy_irq(intsrc->source_irq, ++ intsrc->inti_flags & ACPI_MADT_POLARITY_MASK, ++ (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2, ++ intsrc->global_irq); ++ ++ return 0; ++} ++ ++static int __init ++acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end) ++{ ++ struct acpi_madt_nmi_source *nmi_src = NULL; ++ ++ nmi_src = (struct acpi_madt_nmi_source *)header; ++ ++ if (BAD_MADT_ENTRY(nmi_src, end)) ++ return -EINVAL; ++ ++ acpi_table_print_madt_entry(header); ++ ++ /* TBD: Support nimsrc entries? */ ++ ++ return 0; ++} ++ ++#endif /* CONFIG_X86_IO_APIC */ ++ ++/* ++ * acpi_pic_sci_set_trigger() ++ * ++ * use ELCR to set PIC-mode trigger type for SCI ++ * ++ * If a PIC-mode SCI is not recognized or gives spurious IRQ7's ++ * it may require Edge Trigger -- use "acpi_sci=edge" ++ * ++ * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers ++ * for the 8259 PIC. bit[n] = 1 means irq[n] is Level, otherwise Edge. ++ * ECLR1 is IRQs 0-7 (IRQ 0, 1, 2 must be 0) ++ * ECLR2 is IRQs 8-15 (IRQ 8, 13 must be 0) ++ */ ++ ++void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) ++{ ++ unsigned int mask = 1 << irq; ++ unsigned int old, new; ++ ++ /* Real old ELCR mask */ ++ old = inb(0x4d0) | (inb(0x4d1) << 8); ++ ++ /* ++ * If we use ACPI to set PCI IRQs, then we should clear ELCR ++ * since we will set it correctly as we enable the PCI irq ++ * routing. ++ */ ++ new = acpi_noirq ? old : 0; ++ ++ /* ++ * Update SCI information in the ELCR, it isn't in the PCI ++ * routing tables.. ++ */ ++ switch (trigger) { ++ case 1: /* Edge - clear */ ++ new &= ~mask; ++ break; ++ case 3: /* Level - set */ ++ new |= mask; ++ break; ++ } ++ ++ if (old == new) ++ return; ++ ++ printk(PREFIX "setting ELCR to %04x (from %04x)\n", new, old); ++ outb(new, 0x4d0); ++ outb(new >> 8, 0x4d1); ++} ++ ++int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) ++{ ++ *irq = gsi; ++ return 0; ++} ++ ++/* ++ * success: return IRQ number (>=0) ++ * failure: return < 0 ++ */ ++int acpi_register_gsi(u32 gsi, int triggering, int polarity) ++{ ++ unsigned int irq; ++ unsigned int plat_gsi = gsi; ++ ++#ifdef CONFIG_PCI ++ /* ++ * Make sure all (legacy) PCI IRQs are set as level-triggered. ++ */ ++ if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) { ++ extern void eisa_set_level_irq(unsigned int irq); ++ ++ if (triggering == ACPI_LEVEL_SENSITIVE) ++ eisa_set_level_irq(gsi); ++ } ++#endif ++ ++#ifdef CONFIG_X86_IO_APIC ++ if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) { ++ plat_gsi = mp_register_gsi(gsi, triggering, polarity); ++ } ++#endif ++ acpi_gsi_to_irq(plat_gsi, &irq); ++ return irq; ++} ++ ++EXPORT_SYMBOL(acpi_register_gsi); ++ ++/* ++ * ACPI based hotplug support for CPU ++ */ ++#ifdef CONFIG_ACPI_HOTPLUG_CPU ++int acpi_map_lsapic(acpi_handle handle, int *pcpu) ++{ ++ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; ++ union acpi_object *obj; ++ struct acpi_madt_local_apic *lapic; ++ cpumask_t tmp_map, new_map; ++ u8 physid; ++ int cpu; ++ ++ if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) ++ return -EINVAL; ++ ++ if (!buffer.length || !buffer.pointer) ++ return -EINVAL; ++ ++ obj = buffer.pointer; ++ if (obj->type != ACPI_TYPE_BUFFER || ++ obj->buffer.length < sizeof(*lapic)) { ++ kfree(buffer.pointer); ++ return -EINVAL; ++ } ++ ++ lapic = (struct acpi_madt_local_apic *)obj->buffer.pointer; ++ ++ if (lapic->header.type != ACPI_MADT_TYPE_LOCAL_APIC || ++ !(lapic->lapic_flags & ACPI_MADT_ENABLED)) { ++ kfree(buffer.pointer); ++ return -EINVAL; ++ } ++ ++ physid = lapic->id; ++ ++ kfree(buffer.pointer); ++ buffer.length = ACPI_ALLOCATE_BUFFER; ++ buffer.pointer = NULL; ++ ++ tmp_map = cpu_present_map; ++ mp_register_lapic(physid, lapic->lapic_flags & ACPI_MADT_ENABLED); ++ ++ /* ++ * If mp_register_lapic successfully generates a new logical cpu ++ * number, then the following will get us exactly what was mapped ++ */ ++ cpus_andnot(new_map, cpu_present_map, tmp_map); ++ if (cpus_empty(new_map)) { ++ printk ("Unable to map lapic to logical cpu number\n"); ++ return -EINVAL; ++ } ++ ++ cpu = first_cpu(new_map); ++ ++ *pcpu = cpu; ++ return 0; ++} ++ ++EXPORT_SYMBOL(acpi_map_lsapic); ++ ++int acpi_unmap_lsapic(int cpu) ++{ ++ per_cpu(x86_cpu_to_apicid, cpu) = -1; ++ cpu_clear(cpu, cpu_present_map); ++ num_processors--; ++ ++ return (0); ++} ++ ++EXPORT_SYMBOL(acpi_unmap_lsapic); ++#endif /* CONFIG_ACPI_HOTPLUG_CPU */ ++ ++int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) ++{ ++ /* TBD */ ++ return -EINVAL; ++} ++ ++EXPORT_SYMBOL(acpi_register_ioapic); ++ ++int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base) ++{ ++ /* TBD */ ++ return -EINVAL; ++} ++ ++EXPORT_SYMBOL(acpi_unregister_ioapic); ++ ++static unsigned long __init ++acpi_scan_rsdp(unsigned long start, unsigned long length) ++{ ++ unsigned long offset = 0; ++ unsigned long sig_len = sizeof("RSD PTR ") - 1; ++ unsigned long vstart = (unsigned long)isa_bus_to_virt(start); ++ ++ /* ++ * Scan all 16-byte boundaries of the physical memory region for the ++ * RSDP signature. ++ */ ++ for (offset = 0; offset < length; offset += 16) { ++ if (strncmp((char *)(vstart + offset), "RSD PTR ", sig_len)) ++ continue; ++ return (start + offset); ++ } ++ ++ return 0; ++} ++ ++static int __init acpi_parse_sbf(struct acpi_table_header *table) ++{ ++ struct acpi_table_boot *sb; ++ ++ sb = (struct acpi_table_boot *)table; ++ if (!sb) { ++ printk(KERN_WARNING PREFIX "Unable to map SBF\n"); ++ return -ENODEV; ++ } ++ ++ sbf_port = sb->cmos_index; /* Save CMOS port */ ++ ++ return 0; ++} ++ ++#ifdef CONFIG_HPET_TIMER ++#include ++ ++static struct __initdata resource *hpet_res; ++ ++static int __init acpi_parse_hpet(struct acpi_table_header *table) ++{ ++ struct acpi_table_hpet *hpet_tbl; ++ ++ hpet_tbl = (struct acpi_table_hpet *)table; ++ if (!hpet_tbl) { ++ printk(KERN_WARNING PREFIX "Unable to map HPET\n"); ++ return -ENODEV; ++ } ++ ++ if (hpet_tbl->address.space_id != ACPI_SPACE_MEM) { ++ printk(KERN_WARNING PREFIX "HPET timers must be located in " ++ "memory.\n"); ++ return -1; ++ } ++ ++ hpet_address = hpet_tbl->address.address; ++ ++ /* ++ * Some broken BIOSes advertise HPET at 0x0. We really do not ++ * want to allocate a resource there. ++ */ ++ if (!hpet_address) { ++ printk(KERN_WARNING PREFIX ++ "HPET id: %#x base: %#lx is invalid\n", ++ hpet_tbl->id, hpet_address); ++ return 0; ++ } ++#ifdef CONFIG_X86_64 ++ /* ++ * Some even more broken BIOSes advertise HPET at ++ * 0xfed0000000000000 instead of 0xfed00000. Fix it up and add ++ * some noise: ++ */ ++ if (hpet_address == 0xfed0000000000000UL) { ++ if (!hpet_force_user) { ++ printk(KERN_WARNING PREFIX "HPET id: %#x " ++ "base: 0xfed0000000000000 is bogus\n " ++ "try hpet=force on the kernel command line to " ++ "fix it up to 0xfed00000.\n", hpet_tbl->id); ++ hpet_address = 0; ++ return 0; ++ } ++ printk(KERN_WARNING PREFIX ++ "HPET id: %#x base: 0xfed0000000000000 fixed up " ++ "to 0xfed00000.\n", hpet_tbl->id); ++ hpet_address >>= 32; ++ } ++#endif ++ printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", ++ hpet_tbl->id, hpet_address); ++ ++ /* ++ * Allocate and initialize the HPET firmware resource for adding into ++ * the resource tree during the lateinit timeframe. ++ */ ++#define HPET_RESOURCE_NAME_SIZE 9 ++ hpet_res = alloc_bootmem(sizeof(*hpet_res) + HPET_RESOURCE_NAME_SIZE); ++ ++ if (!hpet_res) ++ return 0; ++ ++ memset(hpet_res, 0, sizeof(*hpet_res)); ++ hpet_res->name = (void *)&hpet_res[1]; ++ hpet_res->flags = IORESOURCE_MEM; ++ snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE, "HPET %u", ++ hpet_tbl->sequence); ++ ++ hpet_res->start = hpet_address; ++ hpet_res->end = hpet_address + (1 * 1024) - 1; ++ ++ return 0; ++} ++ ++/* ++ * hpet_insert_resource inserts the HPET resources used into the resource ++ * tree. ++ */ ++static __init int hpet_insert_resource(void) ++{ ++ if (!hpet_res) ++ return 1; ++ ++ return insert_resource(&iomem_resource, hpet_res); ++} ++ ++late_initcall(hpet_insert_resource); ++ ++#else ++#define acpi_parse_hpet NULL ++#endif ++ ++static int __init acpi_parse_fadt(struct acpi_table_header *table) ++{ ++ ++#ifdef CONFIG_X86_PM_TIMER ++ /* detect the location of the ACPI PM Timer */ ++ if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) { ++ /* FADT rev. 2 */ ++ if (acpi_gbl_FADT.xpm_timer_block.space_id != ++ ACPI_ADR_SPACE_SYSTEM_IO) ++ return 0; ++ ++ pmtmr_ioport = acpi_gbl_FADT.xpm_timer_block.address; ++ /* ++ * "X" fields are optional extensions to the original V1.0 ++ * fields, so we must selectively expand V1.0 fields if the ++ * corresponding X field is zero. ++ */ ++ if (!pmtmr_ioport) ++ pmtmr_ioport = acpi_gbl_FADT.pm_timer_block; ++ } else { ++ /* FADT rev. 1 */ ++ pmtmr_ioport = acpi_gbl_FADT.pm_timer_block; ++ } ++ if (pmtmr_ioport) ++ printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", ++ pmtmr_ioport); ++#endif ++ return 0; ++} ++ ++unsigned long __init acpi_find_rsdp(void) ++{ ++ unsigned long rsdp_phys = 0; ++ ++ if (efi_enabled) { ++ if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) ++ return efi.acpi20; ++ else if (efi.acpi != EFI_INVALID_TABLE_ADDR) ++ return efi.acpi; ++ } ++ /* ++ * Scan memory looking for the RSDP signature. First search EBDA (low ++ * memory) paragraphs and then search upper memory (E0000-FFFFF). ++ */ ++ rsdp_phys = acpi_scan_rsdp(0, 0x400); ++ if (!rsdp_phys) ++ rsdp_phys = acpi_scan_rsdp(0xE0000, 0x20000); ++ ++ return rsdp_phys; ++} ++ ++#ifdef CONFIG_X86_LOCAL_APIC ++/* ++ * Parse LAPIC entries in MADT ++ * returns 0 on success, < 0 on error ++ */ ++static int __init acpi_parse_madt_lapic_entries(void) ++{ ++ int count; ++ ++ if (!cpu_has_apic) ++ return -ENODEV; ++ ++ /* ++ * Note that the LAPIC address is obtained from the MADT (32-bit value) ++ * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). ++ */ ++ ++ count = ++ acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, ++ acpi_parse_lapic_addr_ovr, 0); ++ if (count < 0) { ++ printk(KERN_ERR PREFIX ++ "Error parsing LAPIC address override entry\n"); ++ return count; ++ } ++ ++#ifndef CONFIG_XEN ++ mp_register_lapic_address(acpi_lapic_addr); ++#endif ++ ++ count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC, acpi_parse_lapic, ++ MAX_APICS); ++ if (!count) { ++ printk(KERN_ERR PREFIX "No LAPIC entries present\n"); ++ /* TBD: Cleanup to allow fallback to MPS */ ++ return -ENODEV; ++ } else if (count < 0) { ++ printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n"); ++ /* TBD: Cleanup to allow fallback to MPS */ ++ return count; ++ } ++ ++ count = ++ acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0); ++ if (count < 0) { ++ printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); ++ /* TBD: Cleanup to allow fallback to MPS */ ++ return count; ++ } ++ return 0; ++} ++#endif /* CONFIG_X86_LOCAL_APIC */ ++ ++#ifdef CONFIG_X86_IO_APIC ++/* ++ * Parse IOAPIC related entries in MADT ++ * returns 0 on success, < 0 on error ++ */ ++static int __init acpi_parse_madt_ioapic_entries(void) ++{ ++ int count; ++ ++ /* ++ * ACPI interpreter is required to complete interrupt setup, ++ * so if it is off, don't enumerate the io-apics with ACPI. ++ * If MPS is present, it will handle them, ++ * otherwise the system will stay in PIC mode ++ */ ++ if (acpi_disabled || acpi_noirq) { ++ return -ENODEV; ++ } ++ ++ if (!cpu_has_apic) ++ return -ENODEV; ++ ++ /* ++ * if "noapic" boot option, don't look for IO-APICs ++ */ ++ if (skip_ioapic_setup) { ++ printk(KERN_INFO PREFIX "Skipping IOAPIC probe " ++ "due to 'noapic' option.\n"); ++ return -ENODEV; ++ } ++ ++ count = ++ acpi_table_parse_madt(ACPI_MADT_TYPE_IO_APIC, acpi_parse_ioapic, ++ MAX_IO_APICS); ++ if (!count) { ++ printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); ++ return -ENODEV; ++ } else if (count < 0) { ++ printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n"); ++ return count; ++ } ++ ++ count = ++ acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr, ++ NR_IRQ_VECTORS); ++ if (count < 0) { ++ printk(KERN_ERR PREFIX ++ "Error parsing interrupt source overrides entry\n"); ++ /* TBD: Cleanup to allow fallback to MPS */ ++ return count; ++ } ++ ++ /* ++ * If BIOS did not supply an INT_SRC_OVR for the SCI ++ * pretend we got one so we can set the SCI flags. ++ */ ++ if (!acpi_sci_override_gsi) ++ acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0); ++ ++ /* Fill in identity legacy mapings where no override */ ++ mp_config_acpi_legacy_irqs(); ++ ++ count = ++ acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_parse_nmi_src, ++ NR_IRQ_VECTORS); ++ if (count < 0) { ++ printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); ++ /* TBD: Cleanup to allow fallback to MPS */ ++ return count; ++ } ++ ++ return 0; ++} ++#else ++static inline int acpi_parse_madt_ioapic_entries(void) ++{ ++ return -1; ++} ++#endif /* !CONFIG_X86_IO_APIC */ ++ ++static void __init acpi_process_madt(void) ++{ ++#ifdef CONFIG_X86_LOCAL_APIC ++ int error; ++ ++ if (!acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) { ++ ++ /* ++ * Parse MADT LAPIC entries ++ */ ++ error = acpi_parse_madt_lapic_entries(); ++ if (!error) { ++ acpi_lapic = 1; ++ ++#ifdef CONFIG_X86_GENERICARCH ++ generic_bigsmp_probe(); ++#endif ++ /* ++ * Parse MADT IO-APIC entries ++ */ ++ error = acpi_parse_madt_ioapic_entries(); ++ if (!error) { ++ acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; ++ acpi_irq_balance_set(NULL); ++ acpi_ioapic = 1; ++ ++ smp_found_config = 1; ++ setup_apic_routing(); ++ } ++ } ++ if (error == -EINVAL) { ++ /* ++ * Dell Precision Workstation 410, 610 come here. ++ */ ++ printk(KERN_ERR PREFIX ++ "Invalid BIOS MADT, disabling ACPI\n"); ++ disable_acpi(); ++ } ++ } ++#endif ++ return; ++} ++ ++#ifdef __i386__ ++ ++static int __init disable_acpi_irq(const struct dmi_system_id *d) ++{ ++ if (!acpi_force) { ++ printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n", ++ d->ident); ++ acpi_noirq_set(); ++ } ++ return 0; ++} ++ ++static int __init disable_acpi_pci(const struct dmi_system_id *d) ++{ ++ if (!acpi_force) { ++ printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", ++ d->ident); ++ acpi_disable_pci(); ++ } ++ return 0; ++} ++ ++static int __init dmi_disable_acpi(const struct dmi_system_id *d) ++{ ++ if (!acpi_force) { ++ printk(KERN_NOTICE "%s detected: acpi off\n", d->ident); ++ disable_acpi(); ++ } else { ++ printk(KERN_NOTICE ++ "Warning: DMI blacklist says broken, but acpi forced\n"); ++ } ++ return 0; ++} ++ ++/* ++ * Limit ACPI to CPU enumeration for HT ++ */ ++static int __init force_acpi_ht(const struct dmi_system_id *d) ++{ ++ if (!acpi_force) { ++ printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", ++ d->ident); ++ disable_acpi(); ++ acpi_ht = 1; ++ } else { ++ printk(KERN_NOTICE ++ "Warning: acpi=force overrules DMI blacklist: acpi=ht\n"); ++ } ++ return 0; ++} ++ ++/* ++ * If your system is blacklisted here, but you find that acpi=force ++ * works for you, please contact acpi-devel@sourceforge.net ++ */ ++static struct dmi_system_id __initdata acpi_dmi_table[] = { ++ /* ++ * Boxes that need ACPI disabled ++ */ ++ { ++ .callback = dmi_disable_acpi, ++ .ident = "IBM Thinkpad", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), ++ DMI_MATCH(DMI_BOARD_NAME, "2629H1G"), ++ }, ++ }, ++ ++ /* ++ * Boxes that need acpi=ht ++ */ ++ { ++ .callback = force_acpi_ht, ++ .ident = "FSC Primergy T850", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "HP VISUALIZE NT Workstation", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "Compaq Workstation W8000", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Compaq"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "ASUS P4B266", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), ++ DMI_MATCH(DMI_BOARD_NAME, "P4B266"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "ASUS P2B-DS", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), ++ DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "ASUS CUR-DLS", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), ++ DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "ABIT i440BX-W83977", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "ABIT "), ++ DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "IBM Bladecenter", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), ++ DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "IBM eServer xSeries 360", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), ++ DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "IBM eserver xSeries 330", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), ++ DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"), ++ }, ++ }, ++ { ++ .callback = force_acpi_ht, ++ .ident = "IBM eserver xSeries 440", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"), ++ }, ++ }, ++ ++ /* ++ * Boxes that need ACPI PCI IRQ routing disabled ++ */ ++ { ++ .callback = disable_acpi_irq, ++ .ident = "ASUS A7V", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"), ++ DMI_MATCH(DMI_BOARD_NAME, ""), ++ /* newer BIOS, Revision 1011, does work */ ++ DMI_MATCH(DMI_BIOS_VERSION, ++ "ASUS A7V ACPI BIOS Revision 1007"), ++ }, ++ }, ++ { ++ /* ++ * Latest BIOS for IBM 600E (1.16) has bad pcinum ++ * for LPC bridge, which is needed for the PCI ++ * interrupt links to work. DSDT fix is in bug 5966. ++ * 2645, 2646 model numbers are shared with 600/600E/600X ++ */ ++ .callback = disable_acpi_irq, ++ .ident = "IBM Thinkpad 600 Series 2645", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), ++ DMI_MATCH(DMI_BOARD_NAME, "2645"), ++ }, ++ }, ++ { ++ .callback = disable_acpi_irq, ++ .ident = "IBM Thinkpad 600 Series 2646", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), ++ DMI_MATCH(DMI_BOARD_NAME, "2646"), ++ }, ++ }, ++ /* ++ * Boxes that need ACPI PCI IRQ routing and PCI scan disabled ++ */ ++ { /* _BBN 0 bug */ ++ .callback = disable_acpi_pci, ++ .ident = "ASUS PR-DLS", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), ++ DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"), ++ DMI_MATCH(DMI_BIOS_VERSION, ++ "ASUS PR-DLS ACPI BIOS Revision 1010"), ++ DMI_MATCH(DMI_BIOS_DATE, "03/21/2003") ++ }, ++ }, ++ { ++ .callback = disable_acpi_pci, ++ .ident = "Acer TravelMate 36x Laptop", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Acer"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), ++ }, ++ }, ++ {} ++}; ++ ++#endif /* __i386__ */ ++ ++/* ++ * acpi_boot_table_init() and acpi_boot_init() ++ * called from setup_arch(), always. ++ * 1. checksums all tables ++ * 2. enumerates lapics ++ * 3. enumerates io-apics ++ * ++ * acpi_table_init() is separate to allow reading SRAT without ++ * other side effects. ++ * ++ * side effects of acpi_boot_init: ++ * acpi_lapic = 1 if LAPIC found ++ * acpi_ioapic = 1 if IOAPIC found ++ * if (acpi_lapic && acpi_ioapic) smp_found_config = 1; ++ * if acpi_blacklisted() acpi_disabled = 1; ++ * acpi_irq_model=... ++ * ... ++ * ++ * return value: (currently ignored) ++ * 0: success ++ * !0: failure ++ */ ++ ++int __init acpi_boot_table_init(void) ++{ ++ int error; ++ ++#ifdef __i386__ ++ dmi_check_system(acpi_dmi_table); ++#endif ++ ++ /* ++ * If acpi_disabled, bail out ++ * One exception: acpi=ht continues far enough to enumerate LAPICs ++ */ ++ if (acpi_disabled && !acpi_ht) ++ return 1; ++ ++ /* ++ * Initialize the ACPI boot-time table parser. ++ */ ++ error = acpi_table_init(); ++ if (error) { ++ disable_acpi(); ++ return error; ++ } ++ ++ acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); ++ ++ /* ++ * blacklist may disable ACPI entirely ++ */ ++ error = acpi_blacklisted(); ++ if (error) { ++ if (acpi_force) { ++ printk(KERN_WARNING PREFIX "acpi=force override\n"); ++ } else { ++ printk(KERN_WARNING PREFIX "Disabling ACPI support\n"); ++ disable_acpi(); ++ return error; ++ } ++ } ++ ++ return 0; ++} ++ ++int __init acpi_boot_init(void) ++{ ++ /* ++ * If acpi_disabled, bail out ++ * One exception: acpi=ht continues far enough to enumerate LAPICs ++ */ ++ if (acpi_disabled && !acpi_ht) ++ return 1; ++ ++ acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); ++ ++ /* ++ * set sci_int and PM timer address ++ */ ++ acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt); ++ ++ /* ++ * Process the Multiple APIC Description Table (MADT), if present ++ */ ++ acpi_process_madt(); ++ ++ acpi_table_parse(ACPI_SIG_HPET, acpi_parse_hpet); ++ ++ return 0; ++} ++ ++static int __init parse_acpi(char *arg) ++{ ++ if (!arg) ++ return -EINVAL; ++ ++ /* "acpi=off" disables both ACPI table parsing and interpreter */ ++ if (strcmp(arg, "off") == 0) { ++ disable_acpi(); ++ } ++ /* acpi=force to over-ride black-list */ ++ else if (strcmp(arg, "force") == 0) { ++ acpi_force = 1; ++ acpi_ht = 1; ++ acpi_disabled = 0; ++ } ++ /* acpi=strict disables out-of-spec workarounds */ ++ else if (strcmp(arg, "strict") == 0) { ++ acpi_strict = 1; ++ } ++ /* Limit ACPI just to boot-time to enable HT */ ++ else if (strcmp(arg, "ht") == 0) { ++ if (!acpi_force) ++ disable_acpi(); ++ acpi_ht = 1; ++ } ++ /* "acpi=noirq" disables ACPI interrupt routing */ ++ else if (strcmp(arg, "noirq") == 0) { ++ acpi_noirq_set(); ++ } else { ++ /* Core will printk when we return error. */ ++ return -EINVAL; ++ } ++ return 0; ++} ++early_param("acpi", parse_acpi); ++ ++/* FIXME: Using pci= for an ACPI parameter is a travesty. */ ++static int __init parse_pci(char *arg) ++{ ++ if (arg && strcmp(arg, "noacpi") == 0) ++ acpi_disable_pci(); ++ return 0; ++} ++early_param("pci", parse_pci); ++ ++#ifdef CONFIG_X86_IO_APIC ++static int __init parse_acpi_skip_timer_override(char *arg) ++{ ++ acpi_skip_timer_override = 1; ++ return 0; ++} ++early_param("acpi_skip_timer_override", parse_acpi_skip_timer_override); ++ ++static int __init parse_acpi_use_timer_override(char *arg) ++{ ++ acpi_use_timer_override = 1; ++ return 0; ++} ++early_param("acpi_use_timer_override", parse_acpi_use_timer_override); ++#endif /* CONFIG_X86_IO_APIC */ ++ ++static int __init setup_acpi_sci(char *s) ++{ ++ if (!s) ++ return -EINVAL; ++ if (!strcmp(s, "edge")) ++ acpi_sci_flags = ACPI_MADT_TRIGGER_EDGE | ++ (acpi_sci_flags & ~ACPI_MADT_TRIGGER_MASK); ++ else if (!strcmp(s, "level")) ++ acpi_sci_flags = ACPI_MADT_TRIGGER_LEVEL | ++ (acpi_sci_flags & ~ACPI_MADT_TRIGGER_MASK); ++ else if (!strcmp(s, "high")) ++ acpi_sci_flags = ACPI_MADT_POLARITY_ACTIVE_HIGH | ++ (acpi_sci_flags & ~ACPI_MADT_POLARITY_MASK); ++ else if (!strcmp(s, "low")) ++ acpi_sci_flags = ACPI_MADT_POLARITY_ACTIVE_LOW | ++ (acpi_sci_flags & ~ACPI_MADT_POLARITY_MASK); ++ else ++ return -EINVAL; ++ return 0; ++} ++early_param("acpi_sci", setup_acpi_sci); ++ ++int __acpi_acquire_global_lock(unsigned int *lock) ++{ ++ unsigned int old, new, val; ++ do { ++ old = *lock; ++ new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); ++ val = cmpxchg(lock, old, new); ++ } while (unlikely (val != old)); ++ return (new < 3) ? -1 : 0; ++} ++ ++int __acpi_release_global_lock(unsigned int *lock) ++{ ++ unsigned int old, new, val; ++ do { ++ old = *lock; ++ new = old & ~0x3; ++ val = cmpxchg(lock, old, new); ++ } while (unlikely (val != old)); ++ return old & 0x1; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/acpi/sleep_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/acpi/sleep_32-xen.c +--- ./arch/x86/kernel/acpi/sleep_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/acpi/sleep_32-xen.c 2012-11-13 15:20:17.272569002 +0000 +@@ -0,0 +1,138 @@ ++/* ++ * sleep.c - x86-specific ACPI sleep support. ++ * ++ * Copyright (C) 2001-2003 Patrick Mochel ++ * Copyright (C) 2001-2003 Pavel Machek ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++ ++#ifndef CONFIG_ACPI_PV_SLEEP ++/* address in low memory of the wakeup routine. */ ++unsigned long acpi_wakeup_address = 0; ++unsigned long acpi_realmode_flags; ++extern char wakeup_start, wakeup_end; ++ ++extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); ++#endif ++ ++/** ++ * acpi_save_state_mem - save kernel state ++ * ++ * Create an identity mapped page table and copy the wakeup routine to ++ * low memory. ++ */ ++int acpi_save_state_mem(void) ++{ ++#ifndef CONFIG_ACPI_PV_SLEEP ++ if (!acpi_wakeup_address) ++ return 1; ++ memcpy((void *)acpi_wakeup_address, &wakeup_start, ++ &wakeup_end - &wakeup_start); ++ acpi_copy_wakeup_routine(acpi_wakeup_address); ++#endif ++ return 0; ++} ++ ++/* ++ * acpi_restore_state - undo effects of acpi_save_state_mem ++ */ ++void acpi_restore_state_mem(void) ++{ ++} ++ ++/** ++ * acpi_reserve_bootmem - do _very_ early ACPI initialisation ++ * ++ * We allocate a page from the first 1MB of memory for the wakeup ++ * routine for when we come back from a sleep state. The ++ * runtime allocator allows specification of <16MB pages, but not ++ * <1MB pages. ++ */ ++void __init acpi_reserve_bootmem(void) ++{ ++#ifndef CONFIG_ACPI_PV_SLEEP ++ if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) { ++ printk(KERN_ERR ++ "ACPI: Wakeup code way too big, S3 disabled.\n"); ++ return; ++ } ++ ++ acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE); ++ if (!acpi_wakeup_address) ++ printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n"); ++#endif ++} ++ ++#ifndef CONFIG_ACPI_PV_SLEEP ++static int __init acpi_sleep_setup(char *str) ++{ ++ while ((str != NULL) && (*str != '\0')) { ++ if (strncmp(str, "s3_bios", 7) == 0) ++ acpi_realmode_flags |= 1; ++ if (strncmp(str, "s3_mode", 7) == 0) ++ acpi_realmode_flags |= 2; ++ if (strncmp(str, "s3_beep", 7) == 0) ++ acpi_realmode_flags |= 4; ++ str = strchr(str, ','); ++ if (str != NULL) ++ str += strspn(str, ", \t"); ++ } ++ return 1; ++} ++ ++__setup("acpi_sleep=", acpi_sleep_setup); ++ ++/* Ouch, we want to delete this. We already have better version in userspace, in ++ s2ram from suspend.sf.net project */ ++static __init int reset_videomode_after_s3(const struct dmi_system_id *d) ++{ ++ acpi_realmode_flags |= 2; ++ return 0; ++} ++ ++static __initdata struct dmi_system_id acpisleep_dmi_table[] = { ++ { /* Reset video mode after returning from ACPI S3 sleep */ ++ .callback = reset_videomode_after_s3, ++ .ident = "Toshiba Satellite 4030cdt", ++ .matches = { ++ DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), ++ }, ++ }, ++ {} ++}; ++ ++static int __init acpisleep_dmi_init(void) ++{ ++ dmi_check_system(acpisleep_dmi_table); ++ return 0; ++} ++ ++core_initcall(acpisleep_dmi_init); ++ ++#else /* CONFIG_ACPI_PV_SLEEP */ ++#include ++#include ++int acpi_notify_hypervisor_state(u8 sleep_state, ++ u32 pm1a_cnt, u32 pm1b_cnt) ++{ ++ struct xen_platform_op op = { ++ .cmd = XENPF_enter_acpi_sleep, ++ .interface_version = XENPF_INTERFACE_VERSION, ++ .u = { ++ .enter_acpi_sleep = { ++ .pm1a_cnt_val = (u16)pm1a_cnt, ++ .pm1b_cnt_val = (u16)pm1b_cnt, ++ .sleep_state = sleep_state, ++ }, ++ }, ++ }; ++ ++ return HYPERVISOR_platform_op(&op); ++} ++#endif /* CONFIG_ACPI_PV_SLEEP */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/acpi/sleep_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/acpi/sleep_64-xen.c +--- ./arch/x86/kernel/acpi/sleep_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/acpi/sleep_64-xen.c 2012-11-13 15:20:17.272569002 +0000 +@@ -0,0 +1,146 @@ ++/* ++ * acpi.c - Architecture-Specific Low-Level ACPI Support ++ * ++ * Copyright (C) 2001, 2002 Paul Diefenbaugh ++ * Copyright (C) 2001 Jun Nakajima ++ * Copyright (C) 2001 Patrick Mochel ++ * Copyright (C) 2002 Andi Kleen, SuSE Labs (x86-64 port) ++ * Copyright (C) 2003 Pavel Machek, SuSE Labs ++ * ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* -------------------------------------------------------------------------- ++ Low-Level Sleep Support ++ -------------------------------------------------------------------------- */ ++ ++#ifndef CONFIG_ACPI_PV_SLEEP ++/* address in low memory of the wakeup routine. */ ++unsigned long acpi_wakeup_address = 0; ++unsigned long acpi_realmode_flags; ++extern char wakeup_start, wakeup_end; ++ ++extern unsigned long acpi_copy_wakeup_routine(unsigned long); ++#endif ++ ++/** ++ * acpi_save_state_mem - save kernel state ++ * ++ * Create an identity mapped page table and copy the wakeup routine to ++ * low memory. ++ */ ++int acpi_save_state_mem(void) ++{ ++#ifndef CONFIG_ACPI_PV_SLEEP ++ memcpy((void *)acpi_wakeup_address, &wakeup_start, ++ &wakeup_end - &wakeup_start); ++ acpi_copy_wakeup_routine(acpi_wakeup_address); ++#endif ++ return 0; ++} ++ ++/* ++ * acpi_restore_state ++ */ ++void acpi_restore_state_mem(void) ++{ ++} ++ ++/** ++ * acpi_reserve_bootmem - do _very_ early ACPI initialisation ++ * ++ * We allocate a page in low memory for the wakeup ++ * routine for when we come back from a sleep state. The ++ * runtime allocator allows specification of <16M pages, but not ++ * <1M pages. ++ */ ++void __init acpi_reserve_bootmem(void) ++{ ++#ifndef CONFIG_ACPI_PV_SLEEP ++ acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE*2); ++ if ((&wakeup_end - &wakeup_start) > (PAGE_SIZE*2)) ++ printk(KERN_CRIT ++ "ACPI: Wakeup code way too big, will crash on attempt" ++ " to suspend\n"); ++#endif ++} ++ ++#ifndef CONFIG_ACPI_PV_SLEEP ++static int __init acpi_sleep_setup(char *str) ++{ ++ while ((str != NULL) && (*str != '\0')) { ++ if (strncmp(str, "s3_bios", 7) == 0) ++ acpi_realmode_flags |= 1; ++ if (strncmp(str, "s3_mode", 7) == 0) ++ acpi_realmode_flags |= 2; ++ if (strncmp(str, "s3_beep", 7) == 0) ++ acpi_realmode_flags |= 4; ++ str = strchr(str, ','); ++ if (str != NULL) ++ str += strspn(str, ", \t"); ++ } ++ ++ return 1; ++} ++ ++__setup("acpi_sleep=", acpi_sleep_setup); ++ ++#else /* CONFIG_ACPI_PV_SLEEP */ ++#include ++#include ++int acpi_notify_hypervisor_state(u8 sleep_state, ++ u32 pm1a_cnt, u32 pm1b_cnt) ++{ ++ struct xen_platform_op op = { ++ .cmd = XENPF_enter_acpi_sleep, ++ .interface_version = XENPF_INTERFACE_VERSION, ++ .u = { ++ .enter_acpi_sleep = { ++ .pm1a_cnt_val = (u16)pm1a_cnt, ++ .pm1b_cnt_val = (u16)pm1b_cnt, ++ .sleep_state = sleep_state, ++ }, ++ }, ++ }; ++ ++ return HYPERVISOR_platform_op(&op); ++} ++#endif /* CONFIG_ACPI_PV_SLEEP */ ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/apic_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/apic_32-xen.c +--- ./arch/x86/kernel/apic_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/apic_32-xen.c 2012-11-13 15:20:17.272569002 +0000 +@@ -0,0 +1,44 @@ ++/* ++ * Local APIC handling stubs ++ */ ++ ++#include ++#include ++ ++#include ++ ++/* ++ * Debug level, exported for io_apic.c ++ */ ++int apic_verbosity; ++ ++static int __init apic_set_verbosity(char *str) ++{ ++ if (strcmp("debug", str) == 0) ++ apic_verbosity = APIC_DEBUG; ++ else if (strcmp("verbose", str) == 0) ++ apic_verbosity = APIC_VERBOSE; ++ return 1; ++} ++ ++__setup("apic=", apic_set_verbosity); ++ ++int setup_profiling_timer(unsigned int multiplier) ++{ ++ return -EINVAL; ++} ++ ++/* ++ * This initializes the IO-APIC and APIC hardware if this is ++ * a UP kernel. ++ */ ++int __init APIC_init_uniprocessor (void) ++{ ++#ifdef CONFIG_X86_IO_APIC ++ if (smp_found_config) ++ if (!skip_ioapic_setup && nr_ioapics) ++ setup_IO_APIC(); ++#endif ++ ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/asm-offsets_32.c debian/binary-custom.d/xen/src/arch/x86/kernel/asm-offsets_32.c +--- ./arch/x86/kernel/asm-offsets_32.c 2012-06-12 16:25:11.582312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/asm-offsets_32.c 2012-11-13 15:20:17.276569002 +0000 +@@ -18,7 +18,9 @@ + #include + #include + ++#if defined(CONFIG_XEN) || defined(CONFIG_PARAVIRT_XEN) + #include ++#endif + + #ifdef CONFIG_LGUEST_GUEST + #include +@@ -63,6 +65,7 @@ + OFFSET(TI_exec_domain, thread_info, exec_domain); + OFFSET(TI_flags, thread_info, flags); + OFFSET(TI_status, thread_info, status); ++ OFFSET(TI_cpu, thread_info, cpu); + OFFSET(TI_preempt_count, thread_info, preempt_count); + OFFSET(TI_addr_limit, thread_info, addr_limit); + OFFSET(TI_restart_block, thread_info, restart_block); +@@ -101,9 +104,14 @@ + OFFSET(pbe_orig_address, pbe, orig_address); + OFFSET(pbe_next, pbe, next); + ++#ifndef CONFIG_X86_NO_TSS + /* Offset from the sysenter stack to tss.esp0 */ +- DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, x86_tss.esp0) - ++ DEFINE(SYSENTER_stack_esp0, offsetof(struct tss_struct, x86_tss.esp0) - + sizeof(struct tss_struct)); ++#else ++ /* sysenter stack points directly to esp0 */ ++ DEFINE(SYSENTER_stack_esp0, 0); ++#endif + + DEFINE(PAGE_SIZE_asm, PAGE_SIZE); + DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT); +@@ -115,6 +123,11 @@ + + OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); + ++#ifdef CONFIG_XEN ++ BLANK(); ++ OFFSET(XEN_START_mfn_list, start_info, mfn_list); ++#endif ++ + #ifdef CONFIG_PARAVIRT + BLANK(); + OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled); +@@ -127,7 +140,7 @@ + OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0); + #endif + +-#ifdef CONFIG_XEN ++#ifdef CONFIG_PARAVIRT_XEN + BLANK(); + OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask); + OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/asm-offsets_64.c debian/binary-custom.d/xen/src/arch/x86/kernel/asm-offsets_64.c +--- ./arch/x86/kernel/asm-offsets_64.c 2012-06-12 16:25:11.582312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/asm-offsets_64.c 2012-11-13 15:20:17.276569002 +0000 +@@ -108,8 +108,10 @@ + ENTRY(cr8); + BLANK(); + #undef ENTRY ++#ifndef CONFIG_X86_NO_TSS + DEFINE(TSS_ist, offsetof(struct tss_struct, ist)); + BLANK(); ++#endif + DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx)); + BLANK(); + DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/cpu/Makefile debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/Makefile +--- ./arch/x86/kernel/cpu/Makefile 2012-06-12 16:25:11.582312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/Makefile 2012-11-13 15:20:17.276569002 +0000 +@@ -18,4 +18,6 @@ + obj-$(CONFIG_MTRR) += mtrr/ + obj-$(CONFIG_CPU_FREQ) += cpufreq/ + ++ifneq ($(CONFIG_XEN),y) + obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o ++endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/cpu/amd.c debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/amd.c +--- ./arch/x86/kernel/cpu/amd.c 2012-06-12 16:25:11.582312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/amd.c 2012-11-13 15:20:17.276569002 +0000 +@@ -24,7 +24,7 @@ + extern void vide(void); + __asm__(".align 4\nvide: ret"); + +-#ifdef CONFIG_X86_LOCAL_APIC ++#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN) + #define ENABLE_C1E_MASK 0x18000000 + #define CPUID_PROCESSOR_SIGNATURE 1 + #define CPUID_XFAM 0x0ff00000 +@@ -290,7 +290,7 @@ + num_cache_leaves = 3; + } + +-#ifdef CONFIG_X86_LOCAL_APIC ++#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN) + if (amd_apic_timer_broken()) + local_apic_timer_disabled = 1; + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/cpu/common-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/common-xen.c +--- ./arch/x86/kernel/cpu/common-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/common-xen.c 2012-11-13 15:20:17.276569002 +0000 +@@ -0,0 +1,751 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_X86_LOCAL_APIC ++#include ++#include ++#include ++#else ++#ifdef CONFIG_XEN ++#define phys_pkg_id(a,b) a ++#endif ++#endif ++#include ++ ++#include "cpu.h" ++ ++DEFINE_PER_CPU(struct gdt_page, gdt_page) = { .gdt = { ++ [GDT_ENTRY_KERNEL_CS] = { 0x0000ffff, 0x00cf9a00 }, ++ [GDT_ENTRY_KERNEL_DS] = { 0x0000ffff, 0x00cf9200 }, ++ [GDT_ENTRY_DEFAULT_USER_CS] = { 0x0000ffff, 0x00cffa00 }, ++ [GDT_ENTRY_DEFAULT_USER_DS] = { 0x0000ffff, 0x00cff200 }, ++#ifndef CONFIG_XEN ++ /* ++ * Segments used for calling PnP BIOS have byte granularity. ++ * They code segments and data segments have fixed 64k limits, ++ * the transfer segment sizes are set at run time. ++ */ ++ [GDT_ENTRY_PNPBIOS_CS32] = { 0x0000ffff, 0x00409a00 },/* 32-bit code */ ++ [GDT_ENTRY_PNPBIOS_CS16] = { 0x0000ffff, 0x00009a00 },/* 16-bit code */ ++ [GDT_ENTRY_PNPBIOS_DS] = { 0x0000ffff, 0x00009200 }, /* 16-bit data */ ++ [GDT_ENTRY_PNPBIOS_TS1] = { 0x00000000, 0x00009200 },/* 16-bit data */ ++ [GDT_ENTRY_PNPBIOS_TS2] = { 0x00000000, 0x00009200 },/* 16-bit data */ ++ /* ++ * The APM segments have byte granularity and their bases ++ * are set at run time. All have 64k limits. ++ */ ++ [GDT_ENTRY_APMBIOS_BASE] = { 0x0000ffff, 0x00409a00 },/* 32-bit code */ ++ /* 16-bit code */ ++ [GDT_ENTRY_APMBIOS_BASE+1] = { 0x0000ffff, 0x00009a00 }, ++ [GDT_ENTRY_APMBIOS_BASE+2] = { 0x0000ffff, 0x00409200 }, /* data */ ++ ++ [GDT_ENTRY_ESPFIX_SS] = { 0x00000000, 0x00c09200 }, ++#endif ++ [GDT_ENTRY_PERCPU] = { 0x00000000, 0x00000000 }, ++} }; ++EXPORT_PER_CPU_SYMBOL_GPL(gdt_page); ++ ++static int cachesize_override __cpuinitdata = -1; ++static int disable_x86_fxsr __cpuinitdata; ++static int disable_x86_serial_nr __cpuinitdata = 1; ++static int disable_x86_sep __cpuinitdata; ++ ++struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {}; ++ ++extern int disable_pse; ++ ++static void __cpuinit default_init(struct cpuinfo_x86 * c) ++{ ++ /* Not much we can do here... */ ++ /* Check if at least it has cpuid */ ++ if (c->cpuid_level == -1) { ++ /* No cpuid. It must be an ancient CPU */ ++ if (c->x86 == 4) ++ strcpy(c->x86_model_id, "486"); ++ else if (c->x86 == 3) ++ strcpy(c->x86_model_id, "386"); ++ } ++} ++ ++static struct cpu_dev __cpuinitdata default_cpu = { ++ .c_init = default_init, ++ .c_vendor = "Unknown", ++}; ++static struct cpu_dev * this_cpu __cpuinitdata = &default_cpu; ++ ++static int __init cachesize_setup(char *str) ++{ ++ get_option (&str, &cachesize_override); ++ return 1; ++} ++__setup("cachesize=", cachesize_setup); ++ ++int __cpuinit get_model_name(struct cpuinfo_x86 *c) ++{ ++ unsigned int *v; ++ char *p, *q; ++ ++ if (cpuid_eax(0x80000000) < 0x80000004) ++ return 0; ++ ++ v = (unsigned int *) c->x86_model_id; ++ cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]); ++ cpuid(0x80000003, &v[4], &v[5], &v[6], &v[7]); ++ cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]); ++ c->x86_model_id[48] = 0; ++ ++ /* Intel chips right-justify this string for some dumb reason; ++ undo that brain damage */ ++ p = q = &c->x86_model_id[0]; ++ while ( *p == ' ' ) ++ p++; ++ if ( p != q ) { ++ while ( *p ) ++ *q++ = *p++; ++ while ( q <= &c->x86_model_id[48] ) ++ *q++ = '\0'; /* Zero-pad the rest */ ++ } ++ ++ return 1; ++} ++ ++ ++void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c) ++{ ++ unsigned int n, dummy, ecx, edx, l2size; ++ ++ n = cpuid_eax(0x80000000); ++ ++ if (n >= 0x80000005) { ++ cpuid(0x80000005, &dummy, &dummy, &ecx, &edx); ++ printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n", ++ edx>>24, edx&0xFF, ecx>>24, ecx&0xFF); ++ c->x86_cache_size=(ecx>>24)+(edx>>24); ++ } ++ ++ if (n < 0x80000006) /* Some chips just has a large L1. */ ++ return; ++ ++ ecx = cpuid_ecx(0x80000006); ++ l2size = ecx >> 16; ++ ++ /* do processor-specific cache resizing */ ++ if (this_cpu->c_size_cache) ++ l2size = this_cpu->c_size_cache(c,l2size); ++ ++ /* Allow user to override all this if necessary. */ ++ if (cachesize_override != -1) ++ l2size = cachesize_override; ++ ++ if ( l2size == 0 ) ++ return; /* Again, no L2 cache is possible */ ++ ++ c->x86_cache_size = l2size; ++ ++ printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n", ++ l2size, ecx & 0xFF); ++} ++ ++/* Naming convention should be: [()] */ ++/* This table only is used unless init_() below doesn't set it; */ ++/* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */ ++ ++/* Look up CPU names by table lookup. */ ++static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c) ++{ ++ struct cpu_model_info *info; ++ ++ if ( c->x86_model >= 16 ) ++ return NULL; /* Range check */ ++ ++ if (!this_cpu) ++ return NULL; ++ ++ info = this_cpu->c_models; ++ ++ while (info && info->family) { ++ if (info->family == c->x86) ++ return info->model_names[c->x86_model]; ++ info++; ++ } ++ return NULL; /* Not found */ ++} ++ ++ ++static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c, int early) ++{ ++ char *v = c->x86_vendor_id; ++ int i; ++ static int printed; ++ ++ for (i = 0; i < X86_VENDOR_NUM; i++) { ++ if (cpu_devs[i]) { ++ if (!strcmp(v,cpu_devs[i]->c_ident[0]) || ++ (cpu_devs[i]->c_ident[1] && ++ !strcmp(v,cpu_devs[i]->c_ident[1]))) { ++ c->x86_vendor = i; ++ if (!early) ++ this_cpu = cpu_devs[i]; ++ return; ++ } ++ } ++ } ++ if (!printed) { ++ printed++; ++ printk(KERN_ERR "CPU: Vendor unknown, using generic init.\n"); ++ printk(KERN_ERR "CPU: Your system may be unstable.\n"); ++ } ++ c->x86_vendor = X86_VENDOR_UNKNOWN; ++ this_cpu = &default_cpu; ++} ++ ++ ++static int __init x86_fxsr_setup(char * s) ++{ ++ /* Tell all the other CPUs to not use it... */ ++ disable_x86_fxsr = 1; ++ ++ /* ++ * ... and clear the bits early in the boot_cpu_data ++ * so that the bootup process doesn't try to do this ++ * either. ++ */ ++ clear_bit(X86_FEATURE_FXSR, boot_cpu_data.x86_capability); ++ clear_bit(X86_FEATURE_XMM, boot_cpu_data.x86_capability); ++ return 1; ++} ++__setup("nofxsr", x86_fxsr_setup); ++ ++ ++static int __init x86_sep_setup(char * s) ++{ ++ disable_x86_sep = 1; ++ return 1; ++} ++__setup("nosep", x86_sep_setup); ++ ++ ++/* Standard macro to see if a specific flag is changeable */ ++static inline int flag_is_changeable_p(u32 flag) ++{ ++ u32 f1, f2; ++ ++ asm("pushfl\n\t" ++ "pushfl\n\t" ++ "popl %0\n\t" ++ "movl %0,%1\n\t" ++ "xorl %2,%0\n\t" ++ "pushl %0\n\t" ++ "popfl\n\t" ++ "pushfl\n\t" ++ "popl %0\n\t" ++ "popfl\n\t" ++ : "=&r" (f1), "=&r" (f2) ++ : "ir" (flag)); ++ ++ return ((f1^f2) & flag) != 0; ++} ++ ++ ++/* Probe for the CPUID instruction */ ++static int __cpuinit have_cpuid_p(void) ++{ ++ return flag_is_changeable_p(X86_EFLAGS_ID); ++} ++ ++void __init cpu_detect(struct cpuinfo_x86 *c) ++{ ++ /* Get vendor name */ ++ cpuid(0x00000000, &c->cpuid_level, ++ (int *)&c->x86_vendor_id[0], ++ (int *)&c->x86_vendor_id[8], ++ (int *)&c->x86_vendor_id[4]); ++ ++ c->x86 = 4; ++ if (c->cpuid_level >= 0x00000001) { ++ u32 junk, tfms, cap0, misc; ++ cpuid(0x00000001, &tfms, &misc, &junk, &cap0); ++ c->x86 = (tfms >> 8) & 15; ++ c->x86_model = (tfms >> 4) & 15; ++ if (c->x86 == 0xf) ++ c->x86 += (tfms >> 20) & 0xff; ++ if (c->x86 >= 0x6) ++ c->x86_model += ((tfms >> 16) & 0xF) << 4; ++ c->x86_mask = tfms & 15; ++ if (cap0 & (1<<19)) ++ c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8; ++ } ++} ++ ++/* Do minimum CPU detection early. ++ Fields really needed: vendor, cpuid_level, family, model, mask, cache alignment. ++ The others are not touched to avoid unwanted side effects. ++ ++ WARNING: this function is only called on the BP. Don't add code here ++ that is supposed to run on all CPUs. */ ++static void __init early_cpu_detect(void) ++{ ++ struct cpuinfo_x86 *c = &boot_cpu_data; ++ ++ c->x86_cache_alignment = 32; ++ ++ if (!have_cpuid_p()) ++ return; ++ ++ cpu_detect(c); ++ ++ get_cpu_vendor(c, 1); ++} ++ ++static void __cpuinit generic_identify(struct cpuinfo_x86 * c) ++{ ++ u32 tfms, xlvl; ++ int ebx; ++ ++ if (have_cpuid_p()) { ++ /* Get vendor name */ ++ cpuid(0x00000000, &c->cpuid_level, ++ (int *)&c->x86_vendor_id[0], ++ (int *)&c->x86_vendor_id[8], ++ (int *)&c->x86_vendor_id[4]); ++ ++ get_cpu_vendor(c, 0); ++ /* Initialize the standard set of capabilities */ ++ /* Note that the vendor-specific code below might override */ ++ ++ /* Intel-defined flags: level 0x00000001 */ ++ if ( c->cpuid_level >= 0x00000001 ) { ++ u32 capability, excap; ++ cpuid(0x00000001, &tfms, &ebx, &excap, &capability); ++ c->x86_capability[0] = capability; ++ c->x86_capability[4] = excap; ++ c->x86 = (tfms >> 8) & 15; ++ c->x86_model = (tfms >> 4) & 15; ++ if (c->x86 == 0xf) ++ c->x86 += (tfms >> 20) & 0xff; ++ if (c->x86 >= 0x6) ++ c->x86_model += ((tfms >> 16) & 0xF) << 4; ++ c->x86_mask = tfms & 15; ++#ifdef CONFIG_X86_HT ++ c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0); ++#else ++ c->apicid = (ebx >> 24) & 0xFF; ++#endif ++ if (c->x86_capability[0] & (1<<19)) ++ c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8; ++ } else { ++ /* Have CPUID level 0 only - unheard of */ ++ c->x86 = 4; ++ } ++ ++ /* AMD-defined flags: level 0x80000001 */ ++ xlvl = cpuid_eax(0x80000000); ++ if ( (xlvl & 0xffff0000) == 0x80000000 ) { ++ if ( xlvl >= 0x80000001 ) { ++ c->x86_capability[1] = cpuid_edx(0x80000001); ++ c->x86_capability[6] = cpuid_ecx(0x80000001); ++ } ++ if ( xlvl >= 0x80000004 ) ++ get_model_name(c); /* Default name */ ++ } ++ ++ init_scattered_cpuid_features(c); ++ } ++ ++ early_intel_workaround(c); ++ ++#ifdef CONFIG_X86_HT ++ c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff; ++#endif ++} ++ ++static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c) ++{ ++ if (cpu_has(c, X86_FEATURE_PN) && disable_x86_serial_nr ) { ++ /* Disable processor serial number */ ++ unsigned long lo,hi; ++ rdmsr(MSR_IA32_BBL_CR_CTL,lo,hi); ++ lo |= 0x200000; ++ wrmsr(MSR_IA32_BBL_CR_CTL,lo,hi); ++ printk(KERN_NOTICE "CPU serial number disabled.\n"); ++ clear_bit(X86_FEATURE_PN, c->x86_capability); ++ ++ /* Disabling the serial number may affect the cpuid level */ ++ c->cpuid_level = cpuid_eax(0); ++ } ++} ++ ++static int __init x86_serial_nr_setup(char *s) ++{ ++ disable_x86_serial_nr = 0; ++ return 1; ++} ++__setup("serialnumber", x86_serial_nr_setup); ++ ++ ++ ++/* ++ * This does the hard work of actually picking apart the CPU stuff... ++ */ ++static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) ++{ ++ int i; ++ ++ c->loops_per_jiffy = loops_per_jiffy; ++ c->x86_cache_size = -1; ++ c->x86_vendor = X86_VENDOR_UNKNOWN; ++ c->cpuid_level = -1; /* CPUID not detected */ ++ c->x86_model = c->x86_mask = 0; /* So far unknown... */ ++ c->x86_vendor_id[0] = '\0'; /* Unset */ ++ c->x86_model_id[0] = '\0'; /* Unset */ ++ c->x86_max_cores = 1; ++ c->x86_clflush_size = 32; ++ memset(&c->x86_capability, 0, sizeof c->x86_capability); ++ ++ if (!have_cpuid_p()) { ++ /* First of all, decide if this is a 486 or higher */ ++ /* It's a 486 if we can modify the AC flag */ ++ if ( flag_is_changeable_p(X86_EFLAGS_AC) ) ++ c->x86 = 4; ++ else ++ c->x86 = 3; ++ } ++ ++ generic_identify(c); ++ ++ printk(KERN_DEBUG "CPU: After generic identify, caps:"); ++ for (i = 0; i < NCAPINTS; i++) ++ printk(" %08lx", c->x86_capability[i]); ++ printk("\n"); ++ ++ if (this_cpu->c_identify) { ++ this_cpu->c_identify(c); ++ ++ printk(KERN_DEBUG "CPU: After vendor identify, caps:"); ++ for (i = 0; i < NCAPINTS; i++) ++ printk(" %08lx", c->x86_capability[i]); ++ printk("\n"); ++ } ++ ++ /* ++ * Vendor-specific initialization. In this section we ++ * canonicalize the feature flags, meaning if there are ++ * features a certain CPU supports which CPUID doesn't ++ * tell us, CPUID claiming incorrect flags, or other bugs, ++ * we handle them here. ++ * ++ * At the end of this section, c->x86_capability better ++ * indicate the features this CPU genuinely supports! ++ */ ++ if (this_cpu->c_init) ++ this_cpu->c_init(c); ++ ++ /* Disable the PN if appropriate */ ++ squash_the_stupid_serial_number(c); ++ ++ /* ++ * The vendor-specific functions might have changed features. Now ++ * we do "generic changes." ++ */ ++ ++ /* TSC disabled? */ ++ if ( tsc_disable ) ++ clear_bit(X86_FEATURE_TSC, c->x86_capability); ++ ++ /* FXSR disabled? */ ++ if (disable_x86_fxsr) { ++ clear_bit(X86_FEATURE_FXSR, c->x86_capability); ++ clear_bit(X86_FEATURE_XMM, c->x86_capability); ++ } ++ ++ /* SEP disabled? */ ++ if (disable_x86_sep) ++ clear_bit(X86_FEATURE_SEP, c->x86_capability); ++ ++ if (disable_pse) ++ clear_bit(X86_FEATURE_PSE, c->x86_capability); ++ ++ /* If the model name is still unset, do table lookup. */ ++ if ( !c->x86_model_id[0] ) { ++ char *p; ++ p = table_lookup_model(c); ++ if ( p ) ++ strcpy(c->x86_model_id, p); ++ else ++ /* Last resort... */ ++ sprintf(c->x86_model_id, "%02x/%02x", ++ c->x86, c->x86_model); ++ } ++ ++ /* Now the feature flags better reflect actual CPU features! */ ++ ++ printk(KERN_DEBUG "CPU: After all inits, caps:"); ++ for (i = 0; i < NCAPINTS; i++) ++ printk(" %08lx", c->x86_capability[i]); ++ printk("\n"); ++ ++ /* ++ * On SMP, boot_cpu_data holds the common feature set between ++ * all CPUs; so make sure that we indicate which features are ++ * common between the CPUs. The first time this routine gets ++ * executed, c == &boot_cpu_data. ++ */ ++ if ( c != &boot_cpu_data ) { ++ /* AND the already accumulated flags with these */ ++ for ( i = 0 ; i < NCAPINTS ; i++ ) ++ boot_cpu_data.x86_capability[i] &= c->x86_capability[i]; ++ } ++ ++ /* Init Machine Check Exception if available. */ ++ mcheck_init(c); ++} ++ ++void __init identify_boot_cpu(void) ++{ ++ identify_cpu(&boot_cpu_data); ++ sysenter_setup(); ++ enable_sep_cpu(); ++ mtrr_bp_init(); ++} ++ ++void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c) ++{ ++ BUG_ON(c == &boot_cpu_data); ++ identify_cpu(c); ++ enable_sep_cpu(); ++ mtrr_ap_init(); ++} ++ ++#ifdef CONFIG_X86_HT ++void __cpuinit detect_ht(struct cpuinfo_x86 *c) ++{ ++ u32 eax, ebx, ecx, edx; ++ int index_msb, core_bits; ++ ++ cpuid(1, &eax, &ebx, &ecx, &edx); ++ ++ if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY)) ++ return; ++ ++ smp_num_siblings = (ebx & 0xff0000) >> 16; ++ ++ if (smp_num_siblings == 1) { ++ printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); ++ } else if (smp_num_siblings > 1 ) { ++ ++ if (smp_num_siblings > NR_CPUS) { ++ printk(KERN_WARNING "CPU: Unsupported number of the " ++ "siblings %d", smp_num_siblings); ++ smp_num_siblings = 1; ++ return; ++ } ++ ++ index_msb = get_count_order(smp_num_siblings); ++ c->phys_proc_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb); ++ ++ printk(KERN_INFO "CPU: Physical Processor ID: %d\n", ++ c->phys_proc_id); ++ ++ smp_num_siblings = smp_num_siblings / c->x86_max_cores; ++ ++ index_msb = get_count_order(smp_num_siblings) ; ++ ++ core_bits = get_count_order(c->x86_max_cores); ++ ++ c->cpu_core_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb) & ++ ((1 << core_bits) - 1); ++ ++ if (c->x86_max_cores > 1) ++ printk(KERN_INFO "CPU: Processor Core ID: %d\n", ++ c->cpu_core_id); ++ } ++} ++#endif ++ ++void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) ++{ ++ char *vendor = NULL; ++ ++ if (c->x86_vendor < X86_VENDOR_NUM) ++ vendor = this_cpu->c_vendor; ++ else if (c->cpuid_level >= 0) ++ vendor = c->x86_vendor_id; ++ ++ if (vendor && strncmp(c->x86_model_id, vendor, strlen(vendor))) ++ printk("%s ", vendor); ++ ++ if (!c->x86_model_id[0]) ++ printk("%d86", c->x86); ++ else ++ printk("%s", c->x86_model_id); ++ ++ if (c->x86_mask || c->cpuid_level >= 0) ++ printk(" stepping %02x\n", c->x86_mask); ++ else ++ printk("\n"); ++} ++ ++cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE; ++ ++/* This is hacky. :) ++ * We're emulating future behavior. ++ * In the future, the cpu-specific init functions will be called implicitly ++ * via the magic of initcalls. ++ * They will insert themselves into the cpu_devs structure. ++ * Then, when cpu_init() is called, we can just iterate over that array. ++ */ ++ ++extern int intel_cpu_init(void); ++extern int cyrix_init_cpu(void); ++extern int nsc_init_cpu(void); ++extern int amd_init_cpu(void); ++extern int centaur_init_cpu(void); ++extern int transmeta_init_cpu(void); ++extern int nexgen_init_cpu(void); ++extern int umc_init_cpu(void); ++ ++void __init early_cpu_init(void) ++{ ++ intel_cpu_init(); ++ cyrix_init_cpu(); ++ nsc_init_cpu(); ++ amd_init_cpu(); ++ centaur_init_cpu(); ++ transmeta_init_cpu(); ++ nexgen_init_cpu(); ++ umc_init_cpu(); ++ early_cpu_detect(); ++ ++#ifdef CONFIG_DEBUG_PAGEALLOC ++ /* pse is not compatible with on-the-fly unmapping, ++ * disable it even if the cpus claim to support it. ++ */ ++ clear_bit(X86_FEATURE_PSE, boot_cpu_data.x86_capability); ++ disable_pse = 1; ++#endif ++} ++ ++/* Make sure %fs is initialized properly in idle threads */ ++struct pt_regs * __devinit idle_regs(struct pt_regs *regs) ++{ ++ memset(regs, 0, sizeof(struct pt_regs)); ++ regs->xfs = __KERNEL_PERCPU; ++ return regs; ++} ++ ++/* Current gdt points %fs at the "master" per-cpu area: after this, ++ * it's on the real one. */ ++void switch_to_new_gdt(void) ++{ ++ struct Xgt_desc_struct gdt_descr; ++ unsigned long va, frames[16]; ++ int f; ++ ++ gdt_descr.address = (long)get_cpu_gdt_table(smp_processor_id()); ++ gdt_descr.size = GDT_SIZE - 1; ++ ++ for (va = gdt_descr.address, f = 0; ++ va < gdt_descr.address + gdt_descr.size; ++ va += PAGE_SIZE, f++) { ++ frames[f] = virt_to_mfn(va); ++ make_lowmem_page_readonly( ++ (void *)va, XENFEAT_writable_descriptor_tables); ++ } ++ if (HYPERVISOR_set_gdt(frames, (gdt_descr.size + 1) / 8)) ++ BUG(); ++ asm("mov %0, %%fs" : : "r" (__KERNEL_PERCPU) : "memory"); ++} ++ ++/* ++ * cpu_init() initializes state that is per-CPU. Some data is already ++ * initialized (naturally) in the bootstrap process, such as the GDT ++ * and IDT. We reload them nevertheless, this function acts as a ++ * 'CPU state barrier', nothing should get across. ++ */ ++void __cpuinit cpu_init(void) ++{ ++ int cpu = smp_processor_id(); ++ struct task_struct *curr = current; ++#ifndef CONFIG_X86_NO_TSS ++ struct tss_struct * t = &per_cpu(init_tss, cpu); ++#endif ++ struct thread_struct *thread = &curr->thread; ++ ++ if (cpu_test_and_set(cpu, cpu_initialized)) { ++ printk(KERN_WARNING "CPU#%d already initialized!\n", cpu); ++ for (;;) local_irq_enable(); ++ } ++ ++ printk(KERN_INFO "Initializing CPU#%d\n", cpu); ++ ++ if (cpu_has_vme || cpu_has_de) ++ clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); ++ if (tsc_disable && cpu_has_tsc) { ++ printk(KERN_NOTICE "Disabling TSC...\n"); ++ /**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/ ++ clear_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability); ++ set_in_cr4(X86_CR4_TSD); ++ } ++ ++ switch_to_new_gdt(); ++ ++ /* ++ * Set up and load the per-CPU TSS and LDT ++ */ ++ atomic_inc(&init_mm.mm_count); ++ curr->active_mm = &init_mm; ++ if (curr->mm) ++ BUG(); ++ enter_lazy_tlb(&init_mm, curr); ++ ++ load_esp0(t, thread); ++ ++ load_LDT(&init_mm.context); ++ ++#ifdef CONFIG_DOUBLEFAULT ++ /* Set up doublefault TSS pointer in the GDT */ ++ __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); ++#endif ++ ++ /* Clear %gs. */ ++ asm volatile ("mov %0, %%gs" : : "r" (0)); ++ ++ /* Clear all 6 debug registers: */ ++ set_debugreg(0, 0); ++ set_debugreg(0, 1); ++ set_debugreg(0, 2); ++ set_debugreg(0, 3); ++ set_debugreg(0, 6); ++ set_debugreg(0, 7); ++ ++ /* ++ * Force FPU initialization: ++ */ ++ current_thread_info()->status = 0; ++ clear_used_math(); ++ mxcsr_feature_mask_init(); ++} ++ ++#ifdef CONFIG_HOTPLUG_CPU ++void __cpuinit cpu_uninit(void) ++{ ++ int cpu = raw_smp_processor_id(); ++ cpu_clear(cpu, cpu_initialized); ++ ++ /* lazy TLB state */ ++ per_cpu(cpu_tlbstate, cpu).state = 0; ++ per_cpu(cpu_tlbstate, cpu).active_mm = &init_mm; ++} ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/cpu/cpufreq/powernow-k7.c debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/cpufreq/powernow-k7.c +--- ./arch/x86/kernel/cpu/cpufreq/powernow-k7.c 2012-06-12 16:25:11.586312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/cpufreq/powernow-k7.c 2012-11-13 15:20:17.280569000 +0000 +@@ -699,3 +699,24 @@ + late_initcall(powernow_init); + module_exit(powernow_exit); + ++int recalibrate_cpu_khz(void) ++{ ++#ifndef CONFIG_SMP ++ unsigned long cpu_khz_old = cpu_khz; ++ ++ if (cpu_has_tsc) { ++ cpu_khz = calculate_cpu_khz(); ++ tsc_khz = cpu_khz; ++ cpu_data(0).loops_per_jiffy = ++ cpufreq_scale(cpu_data(0).loops_per_jiffy, ++ cpu_khz_old, cpu_khz); ++ return 0; ++ } else ++ return -ENODEV; ++#else ++ return -ENODEV; ++#endif ++} ++ ++EXPORT_SYMBOL(recalibrate_cpu_khz); ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/cpu/mtrr/Makefile debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/mtrr/Makefile +--- ./arch/x86/kernel/cpu/mtrr/Makefile 2012-06-12 16:25:11.590312933 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/mtrr/Makefile 2012-11-13 15:20:17.284568998 +0000 +@@ -1,3 +1,4 @@ + obj-y := main.o if.o generic.o state.o + obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o + ++obj-$(CONFIG_XEN) := main.o if.o +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/cpu/mtrr/main-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/mtrr/main-xen.c +--- ./arch/x86/kernel/cpu/mtrr/main-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/cpu/mtrr/main-xen.c 2012-11-13 15:20:17.288568997 +0000 +@@ -0,0 +1,196 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include "mtrr.h" ++ ++static DEFINE_MUTEX(mtrr_mutex); ++ ++void generic_get_mtrr(unsigned int reg, unsigned long *base, ++ unsigned long *size, mtrr_type * type) ++{ ++ struct xen_platform_op op; ++ ++ op.cmd = XENPF_read_memtype; ++ op.u.read_memtype.reg = reg; ++ (void)HYPERVISOR_platform_op(&op); ++ ++ *size = op.u.read_memtype.nr_mfns; ++ *base = op.u.read_memtype.mfn; ++ *type = op.u.read_memtype.type; ++} ++ ++struct mtrr_ops generic_mtrr_ops = { ++ .use_intel_if = 1, ++ .get = generic_get_mtrr, ++}; ++ ++struct mtrr_ops *mtrr_if = &generic_mtrr_ops; ++unsigned int num_var_ranges; ++unsigned int *usage_table; ++ ++static void __init set_num_var_ranges(void) ++{ ++ struct xen_platform_op op; ++ ++ for (num_var_ranges = 0; ; num_var_ranges++) { ++ op.cmd = XENPF_read_memtype; ++ op.u.read_memtype.reg = num_var_ranges; ++ if (HYPERVISOR_platform_op(&op) != 0) ++ break; ++ } ++} ++ ++static void __init init_table(void) ++{ ++ int i, max; ++ ++ max = num_var_ranges; ++ if ((usage_table = kmalloc(max * sizeof *usage_table, GFP_KERNEL)) ++ == NULL) { ++ printk(KERN_ERR "mtrr: could not allocate\n"); ++ return; ++ } ++ for (i = 0; i < max; i++) ++ usage_table[i] = 0; ++} ++ ++int mtrr_add_page(unsigned long base, unsigned long size, ++ unsigned int type, char increment) ++{ ++ int error; ++ struct xen_platform_op op; ++ ++ mutex_lock(&mtrr_mutex); ++ ++ op.cmd = XENPF_add_memtype; ++ op.u.add_memtype.mfn = base; ++ op.u.add_memtype.nr_mfns = size; ++ op.u.add_memtype.type = type; ++ error = HYPERVISOR_platform_op(&op); ++ if (error) { ++ mutex_unlock(&mtrr_mutex); ++ BUG_ON(error > 0); ++ return error; ++ } ++ ++ if (increment) ++ ++usage_table[op.u.add_memtype.reg]; ++ ++ mutex_unlock(&mtrr_mutex); ++ ++ return op.u.add_memtype.reg; ++} ++ ++static int mtrr_check(unsigned long base, unsigned long size) ++{ ++ if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) { ++ printk(KERN_WARNING ++ "mtrr: size and base must be multiples of 4 kiB\n"); ++ printk(KERN_DEBUG ++ "mtrr: size: 0x%lx base: 0x%lx\n", size, base); ++ dump_stack(); ++ return -1; ++ } ++ return 0; ++} ++ ++int ++mtrr_add(unsigned long base, unsigned long size, unsigned int type, ++ char increment) ++{ ++ if (mtrr_check(base, size)) ++ return -EINVAL; ++ return mtrr_add_page(base >> PAGE_SHIFT, size >> PAGE_SHIFT, type, ++ increment); ++} ++ ++int mtrr_del_page(int reg, unsigned long base, unsigned long size) ++{ ++ unsigned i; ++ mtrr_type ltype; ++ unsigned long lbase, lsize; ++ int error = -EINVAL; ++ struct xen_platform_op op; ++ ++ mutex_lock(&mtrr_mutex); ++ ++ if (reg < 0) { ++ /* Search for existing MTRR */ ++ for (i = 0; i < num_var_ranges; ++i) { ++ mtrr_if->get(i, &lbase, &lsize, <ype); ++ if (lbase == base && lsize == size) { ++ reg = i; ++ break; ++ } ++ } ++ if (reg < 0) { ++ printk(KERN_DEBUG "mtrr: no MTRR for %lx000,%lx000 found\n", base, ++ size); ++ goto out; ++ } ++ } ++ if (usage_table[reg] < 1) { ++ printk(KERN_WARNING "mtrr: reg: %d has count=0\n", reg); ++ goto out; ++ } ++ if (--usage_table[reg] < 1) { ++ op.cmd = XENPF_del_memtype; ++ op.u.del_memtype.handle = 0; ++ op.u.del_memtype.reg = reg; ++ error = HYPERVISOR_platform_op(&op); ++ if (error) { ++ BUG_ON(error > 0); ++ goto out; ++ } ++ } ++ error = reg; ++ out: ++ mutex_unlock(&mtrr_mutex); ++ return error; ++} ++ ++int ++mtrr_del(int reg, unsigned long base, unsigned long size) ++{ ++ if (mtrr_check(base, size)) ++ return -EINVAL; ++ return mtrr_del_page(reg, base >> PAGE_SHIFT, size >> PAGE_SHIFT); ++} ++ ++EXPORT_SYMBOL(mtrr_add); ++EXPORT_SYMBOL(mtrr_del); ++ ++void __init mtrr_bp_init(void) ++{ ++} ++ ++void mtrr_ap_init(void) ++{ ++} ++ ++static int __init mtrr_init(void) ++{ ++ struct cpuinfo_x86 *c = &boot_cpu_data; ++ ++ if (!is_initial_xendomain()) ++ return -ENODEV; ++ ++ if ((!cpu_has(c, X86_FEATURE_MTRR)) && ++ (!cpu_has(c, X86_FEATURE_K6_MTRR)) && ++ (!cpu_has(c, X86_FEATURE_CYRIX_ARR)) && ++ (!cpu_has(c, X86_FEATURE_CENTAUR_MCR))) ++ return -ENODEV; ++ ++ set_num_var_ranges(); ++ init_table(); ++ ++ return 0; ++} ++ ++subsys_initcall(mtrr_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/crash.c debian/binary-custom.d/xen/src/arch/x86/kernel/crash.c +--- ./arch/x86/kernel/crash.c 2012-06-12 16:25:11.598312932 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/crash.c 2012-11-13 15:20:17.288568997 +0000 +@@ -32,6 +32,7 @@ + #include + #endif + ++#ifndef CONFIG_XEN + /* This keeps a track of which one is crashing cpu. */ + static int crashing_cpu; + +@@ -120,6 +121,7 @@ + /* There are no cpus to shootdown */ + } + #endif ++#endif /* CONFIG_XEN */ + + void machine_crash_shutdown(struct pt_regs *regs) + { +@@ -134,6 +136,7 @@ + /* The kernel is broken so disable interrupts */ + local_irq_disable(); + ++#ifndef CONFIG_XEN + /* Make a note of crashing cpu. Will be used in NMI callback.*/ + crashing_cpu = safe_smp_processor_id(); + nmi_shootdown_cpus(); +@@ -141,6 +144,7 @@ + #if defined(CONFIG_X86_IO_APIC) + disable_IO_APIC(); + #endif ++#endif /* CONFIG_XEN */ + #ifdef CONFIG_HPET_TIMER + hpet_disable(); + #endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/e820_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/e820_32-xen.c +--- ./arch/x86/kernel/e820_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/e820_32-xen.c 2012-11-13 15:20:17.288568997 +0000 +@@ -0,0 +1,1044 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef CONFIG_EFI ++int efi_enabled = 0; ++EXPORT_SYMBOL(efi_enabled); ++#endif ++ ++struct e820map e820; ++struct change_member { ++ struct e820entry *pbios; /* pointer to original bios entry */ ++ unsigned long long addr; /* address for this change point */ ++}; ++static struct change_member change_point_list[2*E820MAX] __initdata; ++static struct change_member *change_point[2*E820MAX] __initdata; ++static struct e820entry *overlap_list[E820MAX] __initdata; ++static struct e820entry new_bios[E820MAX] __initdata; ++/* For PCI or other memory-mapped resources */ ++unsigned long pci_mem_start = 0x10000000; ++#ifdef CONFIG_PCI ++EXPORT_SYMBOL(pci_mem_start); ++#endif ++extern int user_defined_memmap; ++struct resource data_resource = { ++ .name = "Kernel data", ++ .start = 0, ++ .end = 0, ++ .flags = IORESOURCE_BUSY | IORESOURCE_MEM ++}; ++ ++struct resource code_resource = { ++ .name = "Kernel code", ++ .start = 0, ++ .end = 0, ++ .flags = IORESOURCE_BUSY | IORESOURCE_MEM ++}; ++ ++struct resource bss_resource = { ++ .name = "Kernel bss", ++ .start = 0, ++ .end = 0, ++ .flags = IORESOURCE_BUSY | IORESOURCE_MEM ++}; ++ ++static struct resource system_rom_resource = { ++ .name = "System ROM", ++ .start = 0xf0000, ++ .end = 0xfffff, ++ .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM ++}; ++ ++static struct resource extension_rom_resource = { ++ .name = "Extension ROM", ++ .start = 0xe0000, ++ .end = 0xeffff, ++ .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM ++}; ++ ++static struct resource adapter_rom_resources[] = { { ++ .name = "Adapter ROM", ++ .start = 0xc8000, ++ .end = 0, ++ .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM ++}, { ++ .name = "Adapter ROM", ++ .start = 0, ++ .end = 0, ++ .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM ++}, { ++ .name = "Adapter ROM", ++ .start = 0, ++ .end = 0, ++ .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM ++}, { ++ .name = "Adapter ROM", ++ .start = 0, ++ .end = 0, ++ .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM ++}, { ++ .name = "Adapter ROM", ++ .start = 0, ++ .end = 0, ++ .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM ++}, { ++ .name = "Adapter ROM", ++ .start = 0, ++ .end = 0, ++ .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM ++} }; ++ ++static struct resource video_rom_resource = { ++ .name = "Video ROM", ++ .start = 0xc0000, ++ .end = 0xc7fff, ++ .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM ++}; ++ ++static struct resource video_ram_resource = { ++ .name = "Video RAM area", ++ .start = 0xa0000, ++ .end = 0xbffff, ++ .flags = IORESOURCE_BUSY | IORESOURCE_MEM ++}; ++ ++static struct resource standard_io_resources[] = { { ++ .name = "dma1", ++ .start = 0x0000, ++ .end = 0x001f, ++ .flags = IORESOURCE_BUSY | IORESOURCE_IO ++}, { ++ .name = "pic1", ++ .start = 0x0020, ++ .end = 0x0021, ++ .flags = IORESOURCE_BUSY | IORESOURCE_IO ++}, { ++ .name = "timer0", ++ .start = 0x0040, ++ .end = 0x0043, ++ .flags = IORESOURCE_BUSY | IORESOURCE_IO ++}, { ++ .name = "timer1", ++ .start = 0x0050, ++ .end = 0x0053, ++ .flags = IORESOURCE_BUSY | IORESOURCE_IO ++}, { ++ .name = "keyboard", ++ .start = 0x0060, ++ .end = 0x006f, ++ .flags = IORESOURCE_BUSY | IORESOURCE_IO ++}, { ++ .name = "dma page reg", ++ .start = 0x0080, ++ .end = 0x008f, ++ .flags = IORESOURCE_BUSY | IORESOURCE_IO ++}, { ++ .name = "pic2", ++ .start = 0x00a0, ++ .end = 0x00a1, ++ .flags = IORESOURCE_BUSY | IORESOURCE_IO ++}, { ++ .name = "dma2", ++ .start = 0x00c0, ++ .end = 0x00df, ++ .flags = IORESOURCE_BUSY | IORESOURCE_IO ++}, { ++ .name = "fpu", ++ .start = 0x00f0, ++ .end = 0x00ff, ++ .flags = IORESOURCE_BUSY | IORESOURCE_IO ++} }; ++ ++#define ROMSIGNATURE 0xaa55 ++ ++static int __init romsignature(const unsigned char *rom) ++{ ++ const unsigned short * const ptr = (const unsigned short *)rom; ++ unsigned short sig; ++ ++ return probe_kernel_address(ptr, sig) == 0 && sig == ROMSIGNATURE; ++} ++ ++static int __init romchecksum(const unsigned char *rom, unsigned long length) ++{ ++ unsigned char sum, c; ++ ++ for (sum = 0; length && probe_kernel_address(rom++, c) == 0; length--) ++ sum += c; ++ return !length && !sum; ++} ++ ++static void __init probe_roms(void) ++{ ++ const unsigned char *rom; ++ unsigned long start, length, upper; ++ unsigned char c; ++ int i; ++ ++#ifdef CONFIG_XEN ++ /* Nothing to do if not running in dom0. */ ++ if (!is_initial_xendomain()) ++ return; ++#endif ++ ++ /* video rom */ ++ upper = adapter_rom_resources[0].start; ++ for (start = video_rom_resource.start; start < upper; start += 2048) { ++ rom = isa_bus_to_virt(start); ++ if (!romsignature(rom)) ++ continue; ++ ++ video_rom_resource.start = start; ++ ++ if (probe_kernel_address(rom + 2, c) != 0) ++ continue; ++ ++ /* 0 < length <= 0x7f * 512, historically */ ++ length = c * 512; ++ ++ /* if checksum okay, trust length byte */ ++ if (length && romchecksum(rom, length)) ++ video_rom_resource.end = start + length - 1; ++ ++ request_resource(&iomem_resource, &video_rom_resource); ++ break; ++ } ++ ++ start = (video_rom_resource.end + 1 + 2047) & ~2047UL; ++ if (start < upper) ++ start = upper; ++ ++ /* system rom */ ++ request_resource(&iomem_resource, &system_rom_resource); ++ upper = system_rom_resource.start; ++ ++ /* check for extension rom (ignore length byte!) */ ++ rom = isa_bus_to_virt((unsigned long)extension_rom_resource.start); ++ if (romsignature(rom)) { ++ length = extension_rom_resource.end - extension_rom_resource.start + 1; ++ if (romchecksum(rom, length)) { ++ request_resource(&iomem_resource, &extension_rom_resource); ++ upper = extension_rom_resource.start; ++ } ++ } ++ ++ /* check for adapter roms on 2k boundaries */ ++ for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; start += 2048) { ++ rom = isa_bus_to_virt(start); ++ if (!romsignature(rom)) ++ continue; ++ ++ if (probe_kernel_address(rom + 2, c) != 0) ++ continue; ++ ++ /* 0 < length <= 0x7f * 512, historically */ ++ length = c * 512; ++ ++ /* but accept any length that fits if checksum okay */ ++ if (!length || start + length > upper || !romchecksum(rom, length)) ++ continue; ++ ++ adapter_rom_resources[i].start = start; ++ adapter_rom_resources[i].end = start + length - 1; ++ request_resource(&iomem_resource, &adapter_rom_resources[i]); ++ ++ start = adapter_rom_resources[i++].end & ~2047UL; ++ } ++} ++ ++#ifdef CONFIG_XEN ++static struct e820map machine_e820; ++#define e820 machine_e820 ++#endif ++ ++/* ++ * Request address space for all standard RAM and ROM resources ++ * and also for regions reported as reserved by the e820. ++ */ ++static void __init ++legacy_init_iomem_resources(struct resource *code_resource, ++ struct resource *data_resource, ++ struct resource *bss_resource) ++{ ++ int i; ++ ++ probe_roms(); ++ for (i = 0; i < e820.nr_map; i++) { ++ struct resource *res; ++#ifndef CONFIG_RESOURCES_64BIT ++ if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL) ++ continue; ++#endif ++ res = kzalloc(sizeof(struct resource), GFP_ATOMIC); ++ switch (e820.map[i].type) { ++ case E820_RAM: res->name = "System RAM"; break; ++ case E820_ACPI: res->name = "ACPI Tables"; break; ++ case E820_NVS: res->name = "ACPI Non-volatile Storage"; break; ++ default: res->name = "reserved"; ++ } ++ res->start = e820.map[i].addr; ++ res->end = res->start + e820.map[i].size - 1; ++ res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; ++ if (request_resource(&iomem_resource, res)) { ++ kfree(res); ++ continue; ++ } ++ if (e820.map[i].type == E820_RAM) { ++ /* ++ * We don't know which RAM region contains kernel data, ++ * so we try it repeatedly and let the resource manager ++ * test it. ++ */ ++#ifndef CONFIG_XEN ++ request_resource(res, code_resource); ++ request_resource(res, data_resource); ++ request_resource(res, bss_resource); ++#endif ++#ifdef CONFIG_KEXEC ++ if (crashk_res.start != crashk_res.end) ++ request_resource(res, &crashk_res); ++#ifdef CONFIG_XEN ++ xen_machine_kexec_register_resources(res); ++#endif ++#endif ++ } ++ } ++} ++ ++#undef e820 ++ ++/* ++ * Request address space for all standard resources ++ * ++ * This is called just before pcibios_init(), which is also a ++ * subsys_initcall, but is linked in later (in arch/i386/pci/common.c). ++ */ ++static int __init request_standard_resources(void) ++{ ++ int i; ++ ++ /* Nothing to do if not running in dom0. */ ++ if (!is_initial_xendomain()) ++ return 0; ++ ++ printk("Setting up standard PCI resources\n"); ++ if (efi_enabled) ++ efi_initialize_iomem_resources(&code_resource, ++ &data_resource, &bss_resource); ++ else ++ legacy_init_iomem_resources(&code_resource, ++ &data_resource, &bss_resource); ++ ++ /* EFI systems may still have VGA */ ++ request_resource(&iomem_resource, &video_ram_resource); ++ ++ /* request I/O space for devices used on all i[345]86 PCs */ ++ for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++) ++ request_resource(&ioport_resource, &standard_io_resources[i]); ++ return 0; ++} ++ ++subsys_initcall(request_standard_resources); ++ ++#if defined(CONFIG_PM) && defined(CONFIG_HIBERNATION) ++/** ++ * e820_mark_nosave_regions - Find the ranges of physical addresses that do not ++ * correspond to e820 RAM areas and mark the corresponding pages as nosave for ++ * hibernation. ++ * ++ * This function requires the e820 map to be sorted and without any ++ * overlapping entries and assumes the first e820 area to be RAM. ++ */ ++void __init e820_mark_nosave_regions(void) ++{ ++ int i; ++ unsigned long pfn; ++ ++ pfn = PFN_DOWN(e820.map[0].addr + e820.map[0].size); ++ for (i = 1; i < e820.nr_map; i++) { ++ struct e820entry *ei = &e820.map[i]; ++ ++ if (pfn < PFN_UP(ei->addr)) ++ register_nosave_region(pfn, PFN_UP(ei->addr)); ++ ++ pfn = PFN_DOWN(ei->addr + ei->size); ++ if (ei->type != E820_RAM) ++ register_nosave_region(PFN_UP(ei->addr), pfn); ++ ++ if (pfn >= max_low_pfn) ++ break; ++ } ++} ++#endif ++ ++void __init add_memory_region(unsigned long long start, ++ unsigned long long size, int type) ++{ ++ int x; ++ ++ if (!efi_enabled) { ++ x = e820.nr_map; ++ ++ if (x == E820MAX) { ++ printk(KERN_ERR "Ooops! Too many entries in the memory map!\n"); ++ return; ++ } ++ ++ e820.map[x].addr = start; ++ e820.map[x].size = size; ++ e820.map[x].type = type; ++ e820.nr_map++; ++ } ++} /* add_memory_region */ ++ ++/* ++ * Sanitize the BIOS e820 map. ++ * ++ * Some e820 responses include overlapping entries. The following ++ * replaces the original e820 map with a new one, removing overlaps. ++ * ++ */ ++int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map) ++{ ++ struct change_member *change_tmp; ++ unsigned long current_type, last_type; ++ unsigned long long last_addr; ++ int chgidx, still_changing; ++ int overlap_entries; ++ int new_bios_entry; ++ int old_nr, new_nr, chg_nr; ++ int i; ++ ++ /* ++ Visually we're performing the following (1,2,3,4 = memory types)... ++ ++ Sample memory map (w/overlaps): ++ ____22__________________ ++ ______________________4_ ++ ____1111________________ ++ _44_____________________ ++ 11111111________________ ++ ____________________33__ ++ ___________44___________ ++ __________33333_________ ++ ______________22________ ++ ___________________2222_ ++ _________111111111______ ++ _____________________11_ ++ _________________4______ ++ ++ Sanitized equivalent (no overlap): ++ 1_______________________ ++ _44_____________________ ++ ___1____________________ ++ ____22__________________ ++ ______11________________ ++ _________1______________ ++ __________3_____________ ++ ___________44___________ ++ _____________33_________ ++ _______________2________ ++ ________________1_______ ++ _________________4______ ++ ___________________2____ ++ ____________________33__ ++ ______________________4_ ++ */ ++ /* if there's only one memory region, don't bother */ ++ if (*pnr_map < 2) { ++ return -1; ++ } ++ ++ old_nr = *pnr_map; ++ ++ /* bail out if we find any unreasonable addresses in bios map */ ++ for (i=0; iaddr = biosmap[i].addr; ++ change_point[chgidx++]->pbios = &biosmap[i]; ++ change_point[chgidx]->addr = biosmap[i].addr + biosmap[i].size; ++ change_point[chgidx++]->pbios = &biosmap[i]; ++ } ++ } ++ chg_nr = chgidx; /* true number of change-points */ ++ ++ /* sort change-point list by memory addresses (low -> high) */ ++ still_changing = 1; ++ while (still_changing) { ++ still_changing = 0; ++ for (i=1; i < chg_nr; i++) { ++ /* if > , swap */ ++ /* or, if current= & last=, swap */ ++ if ((change_point[i]->addr < change_point[i-1]->addr) || ++ ((change_point[i]->addr == change_point[i-1]->addr) && ++ (change_point[i]->addr == change_point[i]->pbios->addr) && ++ (change_point[i-1]->addr != change_point[i-1]->pbios->addr)) ++ ) ++ { ++ change_tmp = change_point[i]; ++ change_point[i] = change_point[i-1]; ++ change_point[i-1] = change_tmp; ++ still_changing=1; ++ } ++ } ++ } ++ ++ /* create a new bios memory map, removing overlaps */ ++ overlap_entries=0; /* number of entries in the overlap table */ ++ new_bios_entry=0; /* index for creating new bios map entries */ ++ last_type = 0; /* start with undefined memory type */ ++ last_addr = 0; /* start with 0 as last starting address */ ++ /* loop through change-points, determining affect on the new bios map */ ++ for (chgidx=0; chgidx < chg_nr; chgidx++) ++ { ++ /* keep track of all overlapping bios entries */ ++ if (change_point[chgidx]->addr == change_point[chgidx]->pbios->addr) ++ { ++ /* add map entry to overlap list (> 1 entry implies an overlap) */ ++ overlap_list[overlap_entries++]=change_point[chgidx]->pbios; ++ } ++ else ++ { ++ /* remove entry from list (order independent, so swap with last) */ ++ for (i=0; ipbios) ++ overlap_list[i] = overlap_list[overlap_entries-1]; ++ } ++ overlap_entries--; ++ } ++ /* if there are overlapping entries, decide which "type" to use */ ++ /* (larger value takes precedence -- 1=usable, 2,3,4,4+=unusable) */ ++ current_type = 0; ++ for (i=0; itype > current_type) ++ current_type = overlap_list[i]->type; ++ /* continue building up new bios map based on this information */ ++ if (current_type != last_type) { ++ if (last_type != 0) { ++ new_bios[new_bios_entry].size = ++ change_point[chgidx]->addr - last_addr; ++ /* move forward only if the new size was non-zero */ ++ if (new_bios[new_bios_entry].size != 0) ++ if (++new_bios_entry >= E820MAX) ++ break; /* no more space left for new bios entries */ ++ } ++ if (current_type != 0) { ++ new_bios[new_bios_entry].addr = change_point[chgidx]->addr; ++ new_bios[new_bios_entry].type = current_type; ++ last_addr=change_point[chgidx]->addr; ++ } ++ last_type = current_type; ++ } ++ } ++ new_nr = new_bios_entry; /* retain count for new bios entries */ ++ ++ /* copy new bios mapping into original location */ ++ memcpy(biosmap, new_bios, new_nr*sizeof(struct e820entry)); ++ *pnr_map = new_nr; ++ ++ return 0; ++} ++ ++/* ++ * Copy the BIOS e820 map into a safe place. ++ * ++ * Sanity-check it while we're at it.. ++ * ++ * If we're lucky and live on a modern system, the setup code ++ * will have given us a memory map that we can use to properly ++ * set up memory. If we aren't, we'll fake a memory map. ++ * ++ * We check to see that the memory map contains at least 2 elements ++ * before we'll use it, because the detection code in setup.S may ++ * not be perfect and most every PC known to man has two memory ++ * regions: one from 0 to 640k, and one from 1mb up. (The IBM ++ * thinkpad 560x, for example, does not cooperate with the memory ++ * detection code.) ++ */ ++int __init copy_e820_map(struct e820entry * biosmap, int nr_map) ++{ ++#ifndef CONFIG_XEN ++ /* Only one memory region (or negative)? Ignore it */ ++ if (nr_map < 2) ++ return -1; ++#else ++ BUG_ON(nr_map < 1); ++#endif ++ ++ do { ++ unsigned long long start = biosmap->addr; ++ unsigned long long size = biosmap->size; ++ unsigned long long end = start + size; ++ unsigned long type = biosmap->type; ++ ++ /* Overflow in 64 bits? Ignore the memory map. */ ++ if (start > end) ++ return -1; ++ ++#ifndef CONFIG_XEN ++ /* ++ * Some BIOSes claim RAM in the 640k - 1M region. ++ * Not right. Fix it up. ++ */ ++ if (type == E820_RAM) { ++ if (start < 0x100000ULL && end > 0xA0000ULL) { ++ if (start < 0xA0000ULL) ++ add_memory_region(start, 0xA0000ULL-start, type); ++ if (end <= 0x100000ULL) ++ continue; ++ start = 0x100000ULL; ++ size = end - start; ++ } ++ } ++#endif ++ add_memory_region(start, size, type); ++ } while (biosmap++,--nr_map); ++ return 0; ++} ++ ++/* ++ * Callback for efi_memory_walk. ++ */ ++static int __init ++efi_find_max_pfn(unsigned long start, unsigned long end, void *arg) ++{ ++ unsigned long *max_pfn = arg, pfn; ++ ++ if (start < end) { ++ pfn = PFN_UP(end -1); ++ if (pfn > *max_pfn) ++ *max_pfn = pfn; ++ } ++ return 0; ++} ++ ++static int __init ++efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg) ++{ ++ memory_present(0, PFN_UP(start), PFN_DOWN(end)); ++ return 0; ++} ++ ++/* ++ * Find the highest page frame number we have available ++ */ ++void __init find_max_pfn(void) ++{ ++ int i; ++ ++ max_pfn = 0; ++ if (efi_enabled) { ++ efi_memmap_walk(efi_find_max_pfn, &max_pfn); ++ efi_memmap_walk(efi_memory_present_wrapper, NULL); ++ return; ++ } ++ ++ for (i = 0; i < e820.nr_map; i++) { ++ unsigned long start, end; ++ /* RAM? */ ++ if (e820.map[i].type != E820_RAM) ++ continue; ++ start = PFN_UP(e820.map[i].addr); ++ end = PFN_DOWN(e820.map[i].addr + e820.map[i].size); ++ if (start >= end) ++ continue; ++ if (end > max_pfn) ++ max_pfn = end; ++ memory_present(0, start, end); ++ } ++} ++ ++/* ++ * Free all available memory for boot time allocation. Used ++ * as a callback function by efi_memory_walk() ++ */ ++ ++static int __init ++free_available_memory(unsigned long start, unsigned long end, void *arg) ++{ ++ /* check max_low_pfn */ ++ if (start >= (max_low_pfn << PAGE_SHIFT)) ++ return 0; ++ if (end >= (max_low_pfn << PAGE_SHIFT)) ++ end = max_low_pfn << PAGE_SHIFT; ++ if (start < end) ++ free_bootmem(start, end - start); ++ ++ return 0; ++} ++/* ++ * Register fully available low RAM pages with the bootmem allocator. ++ */ ++void __init register_bootmem_low_pages(unsigned long max_low_pfn) ++{ ++ int i; ++ ++ if (efi_enabled) { ++ efi_memmap_walk(free_available_memory, NULL); ++ return; ++ } ++ for (i = 0; i < e820.nr_map; i++) { ++ unsigned long curr_pfn, last_pfn, size; ++ /* ++ * Reserve usable low memory ++ */ ++ if (e820.map[i].type != E820_RAM) ++ continue; ++ /* ++ * We are rounding up the start address of usable memory: ++ */ ++ curr_pfn = PFN_UP(e820.map[i].addr); ++ if (curr_pfn >= max_low_pfn) ++ continue; ++ /* ++ * ... and at the end of the usable range downwards: ++ */ ++ last_pfn = PFN_DOWN(e820.map[i].addr + e820.map[i].size); ++ ++#ifdef CONFIG_XEN ++ /* ++ * Truncate to the number of actual pages currently ++ * present. ++ */ ++ if (last_pfn > xen_start_info->nr_pages) ++ last_pfn = xen_start_info->nr_pages; ++#endif ++ ++ if (last_pfn > max_low_pfn) ++ last_pfn = max_low_pfn; ++ ++ /* ++ * .. finally, did all the rounding and playing ++ * around just make the area go away? ++ */ ++ if (last_pfn <= curr_pfn) ++ continue; ++ ++ size = last_pfn - curr_pfn; ++ free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size)); ++ } ++} ++ ++void __init e820_register_memory(void) ++{ ++ unsigned long gapstart, gapsize, round; ++ unsigned long long last; ++ int i; ++ ++#ifdef CONFIG_XEN ++ if (is_initial_xendomain()) { ++ struct xen_memory_map memmap; ++ ++ memmap.nr_entries = E820MAX; ++ set_xen_guest_handle(memmap.buffer, machine_e820.map); ++ ++ if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap)) ++ BUG(); ++ machine_e820.nr_map = memmap.nr_entries; ++ } ++ else ++ machine_e820 = e820; ++#define e820 machine_e820 ++#endif ++ ++ /* ++ * Search for the biggest gap in the low 32 bits of the e820 ++ * memory space. ++ */ ++ last = 0x100000000ull; ++ gapstart = 0x10000000; ++ gapsize = 0x400000; ++ i = e820.nr_map; ++ while (--i >= 0) { ++ unsigned long long start = e820.map[i].addr; ++ unsigned long long end = start + e820.map[i].size; ++ ++ /* ++ * Since "last" is at most 4GB, we know we'll ++ * fit in 32 bits if this condition is true ++ */ ++ if (last > end) { ++ unsigned long gap = last - end; ++ ++ if (gap > gapsize) { ++ gapsize = gap; ++ gapstart = end; ++ } ++ } ++ if (start < last) ++ last = start; ++ } ++ ++ /* ++ * See how much we want to round up: start off with ++ * rounding to the next 1MB area. ++ */ ++ round = 0x100000; ++ while ((gapsize >> 4) > round) ++ round += round; ++ /* Fun with two's complement */ ++ pci_mem_start = (gapstart + round) & -round; ++ ++ printk("Allocating PCI resources starting at %08lx (gap: %08lx:%08lx)\n", ++ pci_mem_start, gapstart, gapsize); ++} ++ ++#undef e820 ++ ++void __init print_memory_map(char *who) ++{ ++ int i; ++ ++ for (i = 0; i < e820.nr_map; i++) { ++ printk(" %s: %016Lx - %016Lx ", who, ++ e820.map[i].addr, ++ e820.map[i].addr + e820.map[i].size); ++ switch (e820.map[i].type) { ++ case E820_RAM: printk("(usable)\n"); ++ break; ++ case E820_RESERVED: ++ printk("(reserved)\n"); ++ break; ++ case E820_ACPI: ++ printk("(ACPI data)\n"); ++ break; ++ case E820_NVS: ++ printk("(ACPI NVS)\n"); ++ break; ++ default: printk("type %u\n", e820.map[i].type); ++ break; ++ } ++ } ++} ++ ++static __init __always_inline void efi_limit_regions(unsigned long long size) ++{ ++ unsigned long long current_addr = 0; ++ efi_memory_desc_t *md, *next_md; ++ void *p, *p1; ++ int i, j; ++ ++ j = 0; ++ p1 = memmap.map; ++ for (p = p1, i = 0; p < memmap.map_end; p += memmap.desc_size, i++) { ++ md = p; ++ next_md = p1; ++ current_addr = md->phys_addr + ++ PFN_PHYS(md->num_pages); ++ if (is_available_memory(md)) { ++ if (md->phys_addr >= size) continue; ++ memcpy(next_md, md, memmap.desc_size); ++ if (current_addr >= size) { ++ next_md->num_pages -= ++ PFN_UP(current_addr-size); ++ } ++ p1 += memmap.desc_size; ++ next_md = p1; ++ j++; ++ } else if ((md->attribute & EFI_MEMORY_RUNTIME) == ++ EFI_MEMORY_RUNTIME) { ++ /* In order to make runtime services ++ * available we have to include runtime ++ * memory regions in memory map */ ++ memcpy(next_md, md, memmap.desc_size); ++ p1 += memmap.desc_size; ++ next_md = p1; ++ j++; ++ } ++ } ++ memmap.nr_map = j; ++ memmap.map_end = memmap.map + ++ (memmap.nr_map * memmap.desc_size); ++} ++ ++void __init limit_regions(unsigned long long size) ++{ ++ unsigned long long current_addr = 0; ++ int i; ++ ++ print_memory_map("limit_regions start"); ++ if (efi_enabled) { ++ efi_limit_regions(size); ++ return; ++ } ++ for (i = 0; i < e820.nr_map; i++) { ++ current_addr = e820.map[i].addr + e820.map[i].size; ++ if (current_addr < size) ++ continue; ++ ++ if (e820.map[i].type != E820_RAM) ++ continue; ++ ++ if (e820.map[i].addr >= size) { ++ /* ++ * This region starts past the end of the ++ * requested size, skip it completely. ++ */ ++ e820.nr_map = i; ++ } else { ++ e820.nr_map = i + 1; ++ e820.map[i].size -= current_addr - size; ++ } ++ print_memory_map("limit_regions endfor"); ++ return; ++ } ++#ifdef CONFIG_XEN ++ if (current_addr < size) { ++ /* ++ * The e820 map finished before our requested size so ++ * extend the final entry to the requested address. ++ */ ++ --i; ++ if (e820.map[i].type == E820_RAM) ++ e820.map[i].size -= current_addr - size; ++ else ++ add_memory_region(current_addr, size - current_addr, E820_RAM); ++ } ++#endif ++ print_memory_map("limit_regions endfunc"); ++} ++ ++/* ++ * This function checks if any part of the range is mapped ++ * with type. ++ */ ++int ++e820_any_mapped(u64 start, u64 end, unsigned type) ++{ ++ int i; ++ ++#ifndef CONFIG_XEN ++ for (i = 0; i < e820.nr_map; i++) { ++ const struct e820entry *ei = &e820.map[i]; ++#else ++ if (!is_initial_xendomain()) ++ return 0; ++ for (i = 0; i < machine_e820.nr_map; ++i) { ++ const struct e820entry *ei = &machine_e820.map[i]; ++#endif ++ ++ if (type && ei->type != type) ++ continue; ++ if (ei->addr >= end || ei->addr + ei->size <= start) ++ continue; ++ return 1; ++ } ++ return 0; ++} ++EXPORT_SYMBOL_GPL(e820_any_mapped); ++ ++ /* ++ * This function checks if the entire range is mapped with type. ++ * ++ * Note: this function only works correct if the e820 table is sorted and ++ * not-overlapping, which is the case ++ */ ++int __init ++e820_all_mapped(unsigned long s, unsigned long e, unsigned type) ++{ ++ u64 start = s; ++ u64 end = e; ++ int i; ++ ++#ifndef CONFIG_XEN ++ for (i = 0; i < e820.nr_map; i++) { ++ struct e820entry *ei = &e820.map[i]; ++#else ++ if (!is_initial_xendomain()) ++ return 0; ++ for (i = 0; i < machine_e820.nr_map; ++i) { ++ const struct e820entry *ei = &machine_e820.map[i]; ++#endif ++ ++ if (type && ei->type != type) ++ continue; ++ /* is the region (part) in overlap with the current region ?*/ ++ if (ei->addr >= end || ei->addr + ei->size <= start) ++ continue; ++ /* if the region is at the beginning of we move ++ * start to the end of the region since it's ok until there ++ */ ++ if (ei->addr <= start) ++ start = ei->addr + ei->size; ++ /* if start is now at or beyond end, we're done, full ++ * coverage */ ++ if (start >= end) ++ return 1; /* we're done */ ++ } ++ return 0; ++} ++ ++static int __init parse_memmap(char *arg) ++{ ++ if (!arg) ++ return -EINVAL; ++ ++ if (strcmp(arg, "exactmap") == 0) { ++#ifdef CONFIG_CRASH_DUMP ++ /* If we are doing a crash dump, we ++ * still need to know the real mem ++ * size before original memory map is ++ * reset. ++ */ ++ find_max_pfn(); ++ saved_max_pfn = max_pfn; ++#endif ++ e820.nr_map = 0; ++ user_defined_memmap = 1; ++ } else { ++ /* If the user specifies memory size, we ++ * limit the BIOS-provided memory map to ++ * that size. exactmap can be used to specify ++ * the exact map. mem=number can be used to ++ * trim the existing memory map. ++ */ ++ unsigned long long start_at, mem_size; ++ ++ mem_size = memparse(arg, &arg); ++ if (*arg == '@') { ++ start_at = memparse(arg+1, &arg); ++ add_memory_region(start_at, mem_size, E820_RAM); ++ } else if (*arg == '#') { ++ start_at = memparse(arg+1, &arg); ++ add_memory_region(start_at, mem_size, E820_ACPI); ++ } else if (*arg == '$') { ++ start_at = memparse(arg+1, &arg); ++ add_memory_region(start_at, mem_size, E820_RESERVED); ++ } else { ++ limit_regions(mem_size); ++ user_defined_memmap = 1; ++ } ++ } ++ return 0; ++} ++early_param("memmap", parse_memmap); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/e820_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/e820_64-xen.c +--- ./arch/x86/kernel/e820_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/e820_64-xen.c 2012-11-13 15:20:17.292568998 +0000 +@@ -0,0 +1,850 @@ ++/* ++ * Handle the memory map. ++ * The functions here do the job until bootmem takes over. ++ * ++ * Getting sanitize_e820_map() in sync with i386 version by applying change: ++ * - Provisions for empty E820 memory regions (reported by certain BIOSes). ++ * Alex Achenbach , December 2002. ++ * Venkatesh Pallipadi ++ * ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++struct e820map e820 __initdata; ++#ifdef CONFIG_XEN ++struct e820map machine_e820; ++#endif ++ ++/* ++ * PFN of last memory page. ++ */ ++unsigned long end_pfn; ++EXPORT_SYMBOL(end_pfn); ++ ++/* ++ * end_pfn only includes RAM, while end_pfn_map includes all e820 entries. ++ * The direct mapping extends to end_pfn_map, so that we can directly access ++ * apertures, ACPI and other tables without having to play with fixmaps. ++ */ ++unsigned long end_pfn_map; ++ ++/* ++ * Last pfn which the user wants to use. ++ */ ++static unsigned long __initdata end_user_pfn = MAXMEM>>PAGE_SHIFT; ++ ++extern struct resource code_resource, data_resource, bss_resource; ++ ++/* Check for some hardcoded bad areas that early boot is not allowed to touch */ ++static inline int bad_addr(unsigned long *addrp, unsigned long size) ++{ ++ unsigned long addr = *addrp, last = addr + size; ++ ++#ifndef CONFIG_XEN ++ /* various gunk below that needed for SMP startup */ ++ if (addr < 0x8000) { ++ *addrp = PAGE_ALIGN(0x8000); ++ return 1; ++ } ++ ++ /* direct mapping tables of the kernel */ ++ if (last >= table_start<= ramdisk_image && addr < ramdisk_end) { ++ *addrp = PAGE_ALIGN(ramdisk_end); ++ return 1; ++ } ++ } ++#endif ++ /* kernel code */ ++ if (last >= __pa_symbol(&_text) && addr < __pa_symbol(&_end)) { ++ *addrp = PAGE_ALIGN(__pa_symbol(&_end)); ++ return 1; ++ } ++ ++ if (last >= ebda_addr && addr < ebda_addr + ebda_size) { ++ *addrp = PAGE_ALIGN(ebda_addr + ebda_size); ++ return 1; ++ } ++ ++#ifdef CONFIG_NUMA ++ /* NUMA memory to node map */ ++ if (last >= nodemap_addr && addr < nodemap_addr + nodemap_size) { ++ *addrp = nodemap_addr + nodemap_size; ++ return 1; ++ } ++#endif ++ /* XXX ramdisk image here? */ ++#else ++ if (last < (table_end< is mapped ++ * with type. ++ */ ++int e820_any_mapped(unsigned long start, unsigned long end, unsigned type) ++{ ++ int i; ++ ++#ifndef CONFIG_XEN ++ for (i = 0; i < e820.nr_map; i++) { ++ struct e820entry *ei = &e820.map[i]; ++#else ++ extern struct e820map machine_e820; ++ ++ if (!is_initial_xendomain()) ++ return 0; ++ for (i = 0; i < machine_e820.nr_map; i++) { ++ const struct e820entry *ei = &machine_e820.map[i]; ++#endif ++ ++ if (type && ei->type != type) ++ continue; ++ if (ei->addr >= end || ei->addr + ei->size <= start) ++ continue; ++ return 1; ++ } ++ return 0; ++} ++EXPORT_SYMBOL_GPL(e820_any_mapped); ++ ++/* ++ * This function checks if the entire range is mapped with type. ++ * ++ * Note: this function only works correct if the e820 table is sorted and ++ * not-overlapping, which is the case ++ */ ++int __init e820_all_mapped(unsigned long start, unsigned long end, unsigned type) ++{ ++ int i; ++ ++#ifndef CONFIG_XEN ++ for (i = 0; i < e820.nr_map; i++) { ++ struct e820entry *ei = &e820.map[i]; ++#else ++ if (!is_initial_xendomain()) ++ return 0; ++ for (i = 0; i < machine_e820.nr_map; i++) { ++ const struct e820entry *ei = &machine_e820.map[i]; ++#endif ++ ++ if (type && ei->type != type) ++ continue; ++ /* is the region (part) in overlap with the current region ?*/ ++ if (ei->addr >= end || ei->addr + ei->size <= start) ++ continue; ++ ++ /* if the region is at the beginning of we move ++ * start to the end of the region since it's ok until there ++ */ ++ if (ei->addr <= start) ++ start = ei->addr + ei->size; ++ /* if start is now at or beyond end, we're done, full coverage */ ++ if (start >= end) ++ return 1; /* we're done */ ++ } ++ return 0; ++} ++ ++/* ++ * Find a free area in a specific range. ++ */ ++unsigned long __init find_e820_area(unsigned long start, unsigned long end, unsigned size) ++{ ++ int i; ++ for (i = 0; i < e820.nr_map; i++) { ++ struct e820entry *ei = &e820.map[i]; ++ unsigned long addr = ei->addr, last; ++ if (ei->type != E820_RAM) ++ continue; ++ if (addr < start) ++ addr = start; ++ if (addr > ei->addr + ei->size) ++ continue; ++ while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size) ++ ; ++ last = PAGE_ALIGN(addr) + size; ++ if (last > ei->addr + ei->size) ++ continue; ++ if (last > end) ++ continue; ++ return addr; ++ } ++ return -1UL; ++} ++ ++/* ++ * Find the highest page frame number we have available ++ */ ++unsigned long __init e820_end_of_ram(void) ++{ ++ unsigned long end_pfn = 0; ++ end_pfn = find_max_pfn_with_active_regions(); ++ ++ if (end_pfn > end_pfn_map) ++ end_pfn_map = end_pfn; ++ if (end_pfn_map > MAXMEM>>PAGE_SHIFT) ++ end_pfn_map = MAXMEM>>PAGE_SHIFT; ++ if (end_pfn > end_user_pfn) ++ end_pfn = end_user_pfn; ++ if (end_pfn > end_pfn_map) ++ end_pfn = end_pfn_map; ++ ++ printk("end_pfn_map = %lu\n", end_pfn_map); ++ return end_pfn; ++} ++ ++/* ++ * Mark e820 reserved areas as busy for the resource manager. ++ */ ++void __init e820_reserve_resources(struct e820entry *e820, int nr_map) ++{ ++ int i; ++ for (i = 0; i < nr_map; i++) { ++ struct resource *res; ++ res = alloc_bootmem_low(sizeof(struct resource)); ++ switch (e820[i].type) { ++ case E820_RAM: res->name = "System RAM"; break; ++ case E820_ACPI: res->name = "ACPI Tables"; break; ++ case E820_NVS: res->name = "ACPI Non-volatile Storage"; break; ++ default: res->name = "reserved"; ++ } ++ res->start = e820[i].addr; ++ res->end = res->start + e820[i].size - 1; ++ res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; ++ request_resource(&iomem_resource, res); ++ if (e820[i].type == E820_RAM) { ++ /* ++ * We don't know which RAM region contains kernel data, ++ * so we try it repeatedly and let the resource manager ++ * test it. ++ */ ++#ifndef CONFIG_XEN ++ request_resource(res, &code_resource); ++ request_resource(res, &data_resource); ++ request_resource(res, &bss_resource); ++#endif ++#ifdef CONFIG_KEXEC ++ if (crashk_res.start != crashk_res.end) ++ request_resource(res, &crashk_res); ++#ifdef CONFIG_XEN ++ xen_machine_kexec_register_resources(res); ++#endif ++#endif ++ } ++ } ++} ++ ++#ifndef CONFIG_XEN ++/* ++ * Find the ranges of physical addresses that do not correspond to ++ * e820 RAM areas and mark the corresponding pages as nosave for software ++ * suspend and suspend to RAM. ++ * ++ * This function requires the e820 map to be sorted and without any ++ * overlapping entries and assumes the first e820 area to be RAM. ++ */ ++void __init e820_mark_nosave_regions(void) ++{ ++ int i; ++ unsigned long paddr; ++ ++ paddr = round_down(e820.map[0].addr + e820.map[0].size, PAGE_SIZE); ++ for (i = 1; i < e820.nr_map; i++) { ++ struct e820entry *ei = &e820.map[i]; ++ ++ if (paddr < ei->addr) ++ register_nosave_region(PFN_DOWN(paddr), ++ PFN_UP(ei->addr)); ++ ++ paddr = round_down(ei->addr + ei->size, PAGE_SIZE); ++ if (ei->type != E820_RAM) ++ register_nosave_region(PFN_UP(ei->addr), ++ PFN_DOWN(paddr)); ++ ++ if (paddr >= (end_pfn << PAGE_SHIFT)) ++ break; ++ } ++} ++#endif ++ ++/* ++ * Finds an active region in the address range from start_pfn to end_pfn and ++ * returns its range in ei_startpfn and ei_endpfn for the e820 entry. ++ */ ++static int __init e820_find_active_region(const struct e820entry *ei, ++ unsigned long start_pfn, ++ unsigned long end_pfn, ++ unsigned long *ei_startpfn, ++ unsigned long *ei_endpfn) ++{ ++ *ei_startpfn = round_up(ei->addr, PAGE_SIZE) >> PAGE_SHIFT; ++ *ei_endpfn = round_down(ei->addr + ei->size, PAGE_SIZE) >> PAGE_SHIFT; ++ ++ /* Skip map entries smaller than a page */ ++ if (*ei_startpfn >= *ei_endpfn) ++ return 0; ++ ++ /* Check if end_pfn_map should be updated */ ++ if (ei->type != E820_RAM && *ei_endpfn > end_pfn_map) ++ end_pfn_map = *ei_endpfn; ++ ++ /* Skip if map is outside the node */ ++ if (ei->type != E820_RAM || *ei_endpfn <= start_pfn || ++ *ei_startpfn >= end_pfn) ++ return 0; ++ ++ /* Check for overlaps */ ++ if (*ei_startpfn < start_pfn) ++ *ei_startpfn = start_pfn; ++ if (*ei_endpfn > end_pfn) ++ *ei_endpfn = end_pfn; ++ ++ /* Obey end_user_pfn to save on memmap */ ++ if (*ei_startpfn >= end_user_pfn) ++ return 0; ++ if (*ei_endpfn > end_user_pfn) ++ *ei_endpfn = end_user_pfn; ++ ++ return 1; ++} ++ ++/* Walk the e820 map and register active regions within a node */ ++void __init ++e820_register_active_regions(int nid, unsigned long start_pfn, ++ unsigned long end_pfn) ++{ ++ unsigned long ei_startpfn; ++ unsigned long ei_endpfn; ++ int i; ++ ++ for (i = 0; i < e820.nr_map; i++) ++ if (e820_find_active_region(&e820.map[i], ++ start_pfn, end_pfn, ++ &ei_startpfn, &ei_endpfn)) ++ add_active_range(nid, ei_startpfn, ei_endpfn); ++} ++ ++/* ++ * Add a memory region to the kernel e820 map. ++ */ ++void __init add_memory_region(unsigned long start, unsigned long size, int type) ++{ ++ int x = e820.nr_map; ++ ++ if (x == E820MAX) { ++ printk(KERN_ERR "Ooops! Too many entries in the memory map!\n"); ++ return; ++ } ++ ++ e820.map[x].addr = start; ++ e820.map[x].size = size; ++ e820.map[x].type = type; ++ e820.nr_map++; ++} ++ ++/* ++ * Find the hole size (in bytes) in the memory range. ++ * @start: starting address of the memory range to scan ++ * @end: ending address of the memory range to scan ++ */ ++unsigned long __init e820_hole_size(unsigned long start, unsigned long end) ++{ ++ unsigned long start_pfn = start >> PAGE_SHIFT; ++ unsigned long end_pfn = end >> PAGE_SHIFT; ++ unsigned long ei_startpfn; ++ unsigned long ei_endpfn; ++ unsigned long ram = 0; ++ int i; ++ ++ for (i = 0; i < e820.nr_map; i++) { ++ if (e820_find_active_region(&e820.map[i], ++ start_pfn, end_pfn, ++ &ei_startpfn, &ei_endpfn)) ++ ram += ei_endpfn - ei_startpfn; ++ } ++ return end - start - (ram << PAGE_SHIFT); ++} ++ ++void __init e820_print_map(char *who) ++{ ++ int i; ++ ++ for (i = 0; i < e820.nr_map; i++) { ++ printk(KERN_INFO " %s: %016Lx - %016Lx ", who, ++ (unsigned long long) e820.map[i].addr, ++ (unsigned long long) (e820.map[i].addr + e820.map[i].size)); ++ switch (e820.map[i].type) { ++ case E820_RAM: printk("(usable)\n"); ++ break; ++ case E820_RESERVED: ++ printk("(reserved)\n"); ++ break; ++ case E820_ACPI: ++ printk("(ACPI data)\n"); ++ break; ++ case E820_NVS: ++ printk("(ACPI NVS)\n"); ++ break; ++ default: printk("type %u\n", e820.map[i].type); ++ break; ++ } ++ } ++} ++ ++/* ++ * Sanitize the BIOS e820 map. ++ * ++ * Some e820 responses include overlapping entries. The following ++ * replaces the original e820 map with a new one, removing overlaps. ++ * ++ */ ++static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map) ++{ ++ struct change_member { ++ struct e820entry *pbios; /* pointer to original bios entry */ ++ unsigned long long addr; /* address for this change point */ ++ }; ++ static struct change_member change_point_list[2*E820MAX] __initdata; ++ static struct change_member *change_point[2*E820MAX] __initdata; ++ static struct e820entry *overlap_list[E820MAX] __initdata; ++ static struct e820entry new_bios[E820MAX] __initdata; ++ struct change_member *change_tmp; ++ unsigned long current_type, last_type; ++ unsigned long long last_addr; ++ int chgidx, still_changing; ++ int overlap_entries; ++ int new_bios_entry; ++ int old_nr, new_nr, chg_nr; ++ int i; ++ ++ /* ++ Visually we're performing the following (1,2,3,4 = memory types)... ++ ++ Sample memory map (w/overlaps): ++ ____22__________________ ++ ______________________4_ ++ ____1111________________ ++ _44_____________________ ++ 11111111________________ ++ ____________________33__ ++ ___________44___________ ++ __________33333_________ ++ ______________22________ ++ ___________________2222_ ++ _________111111111______ ++ _____________________11_ ++ _________________4______ ++ ++ Sanitized equivalent (no overlap): ++ 1_______________________ ++ _44_____________________ ++ ___1____________________ ++ ____22__________________ ++ ______11________________ ++ _________1______________ ++ __________3_____________ ++ ___________44___________ ++ _____________33_________ ++ _______________2________ ++ ________________1_______ ++ _________________4______ ++ ___________________2____ ++ ____________________33__ ++ ______________________4_ ++ */ ++ ++ /* if there's only one memory region, don't bother */ ++ if (*pnr_map < 2) ++ return -1; ++ ++ old_nr = *pnr_map; ++ ++ /* bail out if we find any unreasonable addresses in bios map */ ++ for (i=0; iaddr = biosmap[i].addr; ++ change_point[chgidx++]->pbios = &biosmap[i]; ++ change_point[chgidx]->addr = biosmap[i].addr + biosmap[i].size; ++ change_point[chgidx++]->pbios = &biosmap[i]; ++ } ++ } ++ chg_nr = chgidx; ++ ++ /* sort change-point list by memory addresses (low -> high) */ ++ still_changing = 1; ++ while (still_changing) { ++ still_changing = 0; ++ for (i=1; i < chg_nr; i++) { ++ /* if > , swap */ ++ /* or, if current= & last=, swap */ ++ if ((change_point[i]->addr < change_point[i-1]->addr) || ++ ((change_point[i]->addr == change_point[i-1]->addr) && ++ (change_point[i]->addr == change_point[i]->pbios->addr) && ++ (change_point[i-1]->addr != change_point[i-1]->pbios->addr)) ++ ) ++ { ++ change_tmp = change_point[i]; ++ change_point[i] = change_point[i-1]; ++ change_point[i-1] = change_tmp; ++ still_changing=1; ++ } ++ } ++ } ++ ++ /* create a new bios memory map, removing overlaps */ ++ overlap_entries=0; /* number of entries in the overlap table */ ++ new_bios_entry=0; /* index for creating new bios map entries */ ++ last_type = 0; /* start with undefined memory type */ ++ last_addr = 0; /* start with 0 as last starting address */ ++ /* loop through change-points, determining affect on the new bios map */ ++ for (chgidx=0; chgidx < chg_nr; chgidx++) ++ { ++ /* keep track of all overlapping bios entries */ ++ if (change_point[chgidx]->addr == change_point[chgidx]->pbios->addr) ++ { ++ /* add map entry to overlap list (> 1 entry implies an overlap) */ ++ overlap_list[overlap_entries++]=change_point[chgidx]->pbios; ++ } ++ else ++ { ++ /* remove entry from list (order independent, so swap with last) */ ++ for (i=0; ipbios) ++ overlap_list[i] = overlap_list[overlap_entries-1]; ++ } ++ overlap_entries--; ++ } ++ /* if there are overlapping entries, decide which "type" to use */ ++ /* (larger value takes precedence -- 1=usable, 2,3,4,4+=unusable) */ ++ current_type = 0; ++ for (i=0; itype > current_type) ++ current_type = overlap_list[i]->type; ++ /* continue building up new bios map based on this information */ ++ if (current_type != last_type) { ++ if (last_type != 0) { ++ new_bios[new_bios_entry].size = ++ change_point[chgidx]->addr - last_addr; ++ /* move forward only if the new size was non-zero */ ++ if (new_bios[new_bios_entry].size != 0) ++ if (++new_bios_entry >= E820MAX) ++ break; /* no more space left for new bios entries */ ++ } ++ if (current_type != 0) { ++ new_bios[new_bios_entry].addr = change_point[chgidx]->addr; ++ new_bios[new_bios_entry].type = current_type; ++ last_addr=change_point[chgidx]->addr; ++ } ++ last_type = current_type; ++ } ++ } ++ new_nr = new_bios_entry; /* retain count for new bios entries */ ++ ++ /* copy new bios mapping into original location */ ++ memcpy(biosmap, new_bios, new_nr*sizeof(struct e820entry)); ++ *pnr_map = new_nr; ++ ++ return 0; ++} ++ ++/* ++ * Copy the BIOS e820 map into a safe place. ++ * ++ * Sanity-check it while we're at it.. ++ * ++ * If we're lucky and live on a modern system, the setup code ++ * will have given us a memory map that we can use to properly ++ * set up memory. If we aren't, we'll fake a memory map. ++ */ ++static int __init copy_e820_map(struct e820entry * biosmap, int nr_map) ++{ ++#ifndef CONFIG_XEN ++ /* Only one memory region (or negative)? Ignore it */ ++ if (nr_map < 2) ++ return -1; ++#else ++ BUG_ON(nr_map < 1); ++#endif ++ ++ do { ++ unsigned long start = biosmap->addr; ++ unsigned long size = biosmap->size; ++ unsigned long end = start + size; ++ unsigned long type = biosmap->type; ++ ++ /* Overflow in 64 bits? Ignore the memory map. */ ++ if (start > end) ++ return -1; ++ ++ add_memory_region(start, size, type); ++ } while (biosmap++,--nr_map); ++ return 0; ++} ++ ++void early_panic(char *msg) ++{ ++ early_printk(msg); ++ panic(msg); ++} ++ ++#ifndef CONFIG_XEN ++void __init setup_memory_region(void) ++{ ++ /* ++ * Try to copy the BIOS-supplied E820-map. ++ * ++ * Otherwise fake a memory map; one section from 0k->640k, ++ * the next section from 1mb->appropriate_mem_k ++ */ ++ sanitize_e820_map(boot_params.e820_map, &boot_params.e820_entries); ++ if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries) < 0) ++ early_panic("Cannot find a valid memory map"); ++ printk(KERN_INFO "BIOS-provided physical RAM map:\n"); ++ e820_print_map("BIOS-e820"); ++} ++ ++#else /* CONFIG_XEN */ ++ ++void __init setup_memory_region(void) ++{ ++ int rc; ++ struct xen_memory_map memmap; ++ /* ++ * This is rather large for a stack variable but this early in ++ * the boot process we know we have plenty slack space. ++ */ ++ struct e820entry map[E820MAX]; ++ ++ memmap.nr_entries = E820MAX; ++ set_xen_guest_handle(memmap.buffer, map); ++ ++ rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap); ++ if ( rc == -ENOSYS ) { ++ memmap.nr_entries = 1; ++ map[0].addr = 0ULL; ++ map[0].size = xen_start_info->nr_pages << PAGE_SHIFT; ++ /* 8MB slack (to balance backend allocations). */ ++ map[0].size += 8 << 20; ++ map[0].type = E820_RAM; ++ rc = 0; ++ } ++ BUG_ON(rc); ++ ++ sanitize_e820_map(map, (char *)&memmap.nr_entries); ++ ++ if (copy_e820_map(map, (char)memmap.nr_entries) < 0) ++ early_panic("Cannot find a valid memory map"); ++ ++ printk(KERN_INFO "BIOS-provided physical RAM map:\n"); ++ e820_print_map("Xen"); ++} ++#endif ++ ++static int __init parse_memopt(char *p) ++{ ++ int i; ++ unsigned long current_end; ++ unsigned long end; ++ ++ if (!p) ++ return -EINVAL; ++ end_user_pfn = memparse(p, &p); ++ end_user_pfn >>= PAGE_SHIFT; ++ ++ end = end_user_pfn<> PAGE_SHIFT); ++ } ++ return *p == '\0' ? 0 : -EINVAL; ++} ++early_param("memmap", parse_memmap_opt); ++ ++void __init finish_e820_parsing(void) ++{ ++ if (userdef) { ++ printk(KERN_INFO "user-defined physical RAM map:\n"); ++ e820_print_map("user"); ++ } ++} ++ ++unsigned long pci_mem_start = 0xaeedbabe; ++EXPORT_SYMBOL(pci_mem_start); ++ ++/* ++ * Search for the biggest gap in the low 32 bits of the e820 ++ * memory space. We pass this space to PCI to assign MMIO resources ++ * for hotplug or unconfigured devices in. ++ * Hopefully the BIOS let enough space left. ++ */ ++__init void e820_setup_gap(struct e820entry *e820, int nr_map) ++{ ++ unsigned long gapstart, gapsize, round; ++ unsigned long last; ++ int i; ++ int found = 0; ++ ++ last = 0x100000000ull; ++ gapstart = 0x10000000; ++ gapsize = 0x400000; ++ i = nr_map; ++ while (--i >= 0) { ++ unsigned long long start = e820[i].addr; ++ unsigned long long end = start + e820[i].size; ++ ++ /* ++ * Since "last" is at most 4GB, we know we'll ++ * fit in 32 bits if this condition is true ++ */ ++ if (last > end) { ++ unsigned long gap = last - end; ++ ++ if (gap > gapsize) { ++ gapsize = gap; ++ gapstart = end; ++ found = 1; ++ } ++ } ++ if (start < last) ++ last = start; ++ } ++ ++ if (!found) { ++ gapstart = (end_pfn << PAGE_SHIFT) + 1024*1024; ++ printk(KERN_ERR "PCI: Warning: Cannot find a gap in the 32bit address range\n" ++ KERN_ERR "PCI: Unassigned devices with 32bit resource registers may break!\n"); ++ } ++ ++ /* ++ * See how much we want to round up: start off with ++ * rounding to the next 1MB area. ++ */ ++ round = 0x100000; ++ while ((gapsize >> 4) > round) ++ round += round; ++ /* Fun with two's complement */ ++ pci_mem_start = (gapstart + round) & -round; ++ ++ printk(KERN_INFO "Allocating PCI resources starting at %lx (gap: %lx:%lx)\n", ++ pci_mem_start, gapstart, gapsize); ++} ++ ++int __init arch_get_ram_range(int slot, u64 *addr, u64 *size) ++{ ++ int i; ++ ++ if (slot < 0 || slot >= e820.nr_map) ++ return -1; ++ for (i = slot; i < e820.nr_map; i++) { ++ if (e820.map[i].type != E820_RAM) ++ continue; ++ break; ++ } ++ if (i == e820.nr_map || e820.map[i].addr > (max_pfn << PAGE_SHIFT)) ++ return -1; ++ *addr = e820.map[i].addr; ++ *size = min_t(u64, e820.map[i].size + e820.map[i].addr, ++ max_pfn << PAGE_SHIFT) - *addr; ++ return i + 1; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/early-quirks.c debian/binary-custom.d/xen/src/arch/x86/kernel/early-quirks.c +--- ./arch/x86/kernel/early-quirks.c 2012-06-12 16:25:11.602312932 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/early-quirks.c 2012-11-13 15:20:17.292568998 +0000 +@@ -74,6 +74,7 @@ + + static void __init ati_bugs(void) + { ++#ifndef CONFIG_XEN + #ifdef CONFIG_X86_IO_APIC + if (timer_over_8254 == 1) { + timer_over_8254 = 0; +@@ -81,6 +82,7 @@ + "ATI board detected. Disabling timer routing over 8254.\n"); + } + #endif ++#endif + } + + struct chipset { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/early_printk-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/early_printk-xen.c +--- ./arch/x86/kernel/early_printk-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/early_printk-xen.c 2012-11-13 15:20:17.292568998 +0000 +@@ -0,0 +1,287 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Simple VGA output */ ++#define VGABASE (__ISA_IO_base + 0xb8000) ++ ++#ifndef CONFIG_XEN ++static int max_ypos = 25, max_xpos = 80; ++static int current_ypos = 25, current_xpos = 0; ++ ++static void early_vga_write(struct console *con, const char *str, unsigned n) ++{ ++ char c; ++ int i, k, j; ++ ++ while ((c = *str++) != '\0' && n-- > 0) { ++ if (current_ypos >= max_ypos) { ++ /* scroll 1 line up */ ++ for (k = 1, j = 0; k < max_ypos; k++, j++) { ++ for (i = 0; i < max_xpos; i++) { ++ writew(readw(VGABASE+2*(max_xpos*k+i)), ++ VGABASE + 2*(max_xpos*j + i)); ++ } ++ } ++ for (i = 0; i < max_xpos; i++) ++ writew(0x720, VGABASE + 2*(max_xpos*j + i)); ++ current_ypos = max_ypos-1; ++ } ++ if (c == '\n') { ++ current_xpos = 0; ++ current_ypos++; ++ } else if (c != '\r') { ++ writew(((0x7 << 8) | (unsigned short) c), ++ VGABASE + 2*(max_xpos*current_ypos + ++ current_xpos++)); ++ if (current_xpos >= max_xpos) { ++ current_xpos = 0; ++ current_ypos++; ++ } ++ } ++ } ++} ++ ++static struct console early_vga_console = { ++ .name = "earlyvga", ++ .write = early_vga_write, ++ .flags = CON_PRINTBUFFER, ++ .index = -1, ++}; ++ ++/* Serial functions loosely based on a similar package from Klaus P. Gerlicher */ ++ ++static int early_serial_base = 0x3f8; /* ttyS0 */ ++ ++#define XMTRDY 0x20 ++ ++#define DLAB 0x80 ++ ++#define TXR 0 /* Transmit register (WRITE) */ ++#define RXR 0 /* Receive register (READ) */ ++#define IER 1 /* Interrupt Enable */ ++#define IIR 2 /* Interrupt ID */ ++#define FCR 2 /* FIFO control */ ++#define LCR 3 /* Line control */ ++#define MCR 4 /* Modem control */ ++#define LSR 5 /* Line Status */ ++#define MSR 6 /* Modem Status */ ++#define DLL 0 /* Divisor Latch Low */ ++#define DLH 1 /* Divisor latch High */ ++ ++static int early_serial_putc(unsigned char ch) ++{ ++ unsigned timeout = 0xffff; ++ while ((inb(early_serial_base + LSR) & XMTRDY) == 0 && --timeout) ++ cpu_relax(); ++ outb(ch, early_serial_base + TXR); ++ return timeout ? 0 : -1; ++} ++ ++static void early_serial_write(struct console *con, const char *s, unsigned n) ++{ ++ while (*s && n-- > 0) { ++ if (*s == '\n') ++ early_serial_putc('\r'); ++ early_serial_putc(*s); ++ s++; ++ } ++} ++ ++#define DEFAULT_BAUD 9600 ++ ++static __init void early_serial_init(char *s) ++{ ++ unsigned char c; ++ unsigned divisor; ++ unsigned baud = DEFAULT_BAUD; ++ char *e; ++ ++ if (*s == ',') ++ ++s; ++ ++ if (*s) { ++ unsigned port; ++ if (!strncmp(s,"0x",2)) { ++ early_serial_base = simple_strtoul(s, &e, 16); ++ } else { ++ static int bases[] = { 0x3f8, 0x2f8 }; ++ ++ if (!strncmp(s,"ttyS",4)) ++ s += 4; ++ port = simple_strtoul(s, &e, 10); ++ if (port > 1 || s == e) ++ port = 0; ++ early_serial_base = bases[port]; ++ } ++ s += strcspn(s, ","); ++ if (*s == ',') ++ s++; ++ } ++ ++ outb(0x3, early_serial_base + LCR); /* 8n1 */ ++ outb(0, early_serial_base + IER); /* no interrupt */ ++ outb(0, early_serial_base + FCR); /* no fifo */ ++ outb(0x3, early_serial_base + MCR); /* DTR + RTS */ ++ ++ if (*s) { ++ baud = simple_strtoul(s, &e, 0); ++ if (baud == 0 || s == e) ++ baud = DEFAULT_BAUD; ++ } ++ ++ divisor = 115200 / baud; ++ c = inb(early_serial_base + LCR); ++ outb(c | DLAB, early_serial_base + LCR); ++ outb(divisor & 0xff, early_serial_base + DLL); ++ outb((divisor >> 8) & 0xff, early_serial_base + DLH); ++ outb(c & ~DLAB, early_serial_base + LCR); ++} ++ ++#else /* CONFIG_XEN */ ++ ++static void ++early_serial_write(struct console *con, const char *s, unsigned count) ++{ ++ int n; ++ ++ while (count > 0) { ++ n = HYPERVISOR_console_io(CONSOLEIO_write, count, (char *)s); ++ if (n <= 0) ++ break; ++ count -= n; ++ s += n; ++ } ++} ++ ++static __init void early_serial_init(char *s) ++{ ++} ++ ++/* ++ * No early VGA console on Xen, as we do not have convenient ISA-space ++ * mappings. Someone should fix this for domain 0. For now, use fake serial. ++ */ ++#define early_vga_console early_serial_console ++ ++#endif ++ ++static struct console early_serial_console = { ++ .name = "earlyser", ++ .write = early_serial_write, ++ .flags = CON_PRINTBUFFER, ++ .index = -1, ++}; ++ ++/* Console interface to a host file on AMD's SimNow! */ ++ ++static int simnow_fd; ++ ++enum { ++ MAGIC1 = 0xBACCD00A, ++ MAGIC2 = 0xCA110000, ++ XOPEN = 5, ++ XWRITE = 4, ++}; ++ ++static noinline long simnow(long cmd, long a, long b, long c) ++{ ++ long ret; ++ asm volatile("cpuid" : ++ "=a" (ret) : ++ "b" (a), "c" (b), "d" (c), "0" (MAGIC1), "D" (cmd + MAGIC2)); ++ return ret; ++} ++ ++static void __init simnow_init(char *str) ++{ ++ char *fn = "klog"; ++ if (*str == '=') ++ fn = ++str; ++ /* error ignored */ ++ simnow_fd = simnow(XOPEN, (unsigned long)fn, O_WRONLY|O_APPEND|O_CREAT, 0644); ++} ++ ++static void simnow_write(struct console *con, const char *s, unsigned n) ++{ ++ simnow(XWRITE, simnow_fd, (unsigned long)s, n); ++} ++ ++static struct console simnow_console = { ++ .name = "simnow", ++ .write = simnow_write, ++ .flags = CON_PRINTBUFFER, ++ .index = -1, ++}; ++ ++/* Direct interface for emergencies */ ++struct console *early_console = &early_vga_console; ++static int early_console_initialized = 0; ++ ++void early_printk(const char *fmt, ...) ++{ ++ char buf[512]; ++ int n; ++ va_list ap; ++ ++ va_start(ap,fmt); ++ n = vscnprintf(buf,512,fmt,ap); ++ early_console->write(early_console,buf,n); ++ va_end(ap); ++} ++ ++static int __initdata keep_early; ++ ++static int __init setup_early_printk(char *buf) ++{ ++ if (!buf) ++ return 0; ++ ++ if (early_console_initialized) ++ return 0; ++ early_console_initialized = 1; ++ ++ if (strstr(buf, "keep")) ++ keep_early = 1; ++ ++ if (!strncmp(buf, "serial", 6)) { ++ early_serial_init(buf + 6); ++ early_console = &early_serial_console; ++ } else if (!strncmp(buf, "ttyS", 4)) { ++ early_serial_init(buf); ++ early_console = &early_serial_console; ++ } else if (!strncmp(buf, "vga", 3) ++#ifndef CONFIG_XEN ++ && boot_params.screen_info.orig_video_isVGA == 1) { ++ max_xpos = boot_params.screen_info.orig_video_cols; ++ max_ypos = boot_params.screen_info.orig_video_lines; ++ current_ypos = boot_params.screen_info.orig_y; ++#else ++ || !strncmp(buf, "xen", 3)) { ++#endif ++ early_console = &early_vga_console; ++ } else if (!strncmp(buf, "simnow", 6)) { ++ simnow_init(buf + 6); ++ early_console = &simnow_console; ++ keep_early = 1; ++#ifdef CONFIG_HVC_XEN ++ } else if (!strncmp(buf, "xen", 3)) { ++ early_console = &xenboot_console; ++#endif ++ } ++ ++ if (keep_early) ++ early_console->flags &= ~CON_BOOT; ++ else ++ early_console->flags |= CON_BOOT; ++ register_console(early_console); ++ return 0; ++} ++early_param("earlyprintk", setup_early_printk); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/entry_32-xen.S debian/binary-custom.d/xen/src/arch/x86/kernel/entry_32-xen.S +--- ./arch/x86/kernel/entry_32-xen.S 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/entry_32-xen.S 2012-11-13 15:20:17.292568998 +0000 +@@ -0,0 +1,1273 @@ ++/* ++ * linux/arch/i386/entry.S ++ * ++ * Copyright (C) 1991, 1992 Linus Torvalds ++ */ ++ ++/* ++ * entry.S contains the system-call and fault low-level handling routines. ++ * This also contains the timer-interrupt handler, as well as all interrupts ++ * and faults that can result in a task-switch. ++ * ++ * NOTE: This code handles signal-recognition, which happens every time ++ * after a timer-interrupt and after each system call. ++ * ++ * I changed all the .align's to 4 (16 byte alignment), as that's faster ++ * on a 486. ++ * ++ * Stack layout in 'syscall_exit': ++ * ptrace needs to have all regs on the stack. ++ * if the order here is changed, it needs to be ++ * updated in fork.c:copy_process, signal.c:do_signal, ++ * ptrace.c and ptrace.h ++ * ++ * 0(%esp) - %ebx ++ * 4(%esp) - %ecx ++ * 8(%esp) - %edx ++ * C(%esp) - %esi ++ * 10(%esp) - %edi ++ * 14(%esp) - %ebp ++ * 18(%esp) - %eax ++ * 1C(%esp) - %ds ++ * 20(%esp) - %es ++ * 24(%esp) - %fs ++ * 28(%esp) - orig_eax ++ * 2C(%esp) - %eip ++ * 30(%esp) - %cs ++ * 34(%esp) - %eflags ++ * 38(%esp) - %oldesp ++ * 3C(%esp) - %oldss ++ * ++ * "current" is in register %ebx during any slow entries. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "irq_vectors.h" ++#include ++ ++/* ++ * We use macros for low-level operations which need to be overridden ++ * for paravirtualization. The following will never clobber any registers: ++ * INTERRUPT_RETURN (aka. "iret") ++ * GET_CR0_INTO_EAX (aka. "movl %cr0, %eax") ++ * ENABLE_INTERRUPTS_SYSEXIT (aka "sti; sysexit"). ++ * ++ * For DISABLE_INTERRUPTS/ENABLE_INTERRUPTS (aka "cli"/"sti"), you must ++ * specify what registers can be overwritten (CLBR_NONE, CLBR_EAX/EDX/ECX/ANY). ++ * Allowing a register to be clobbered can shrink the paravirt replacement ++ * enough to patch inline, increasing performance. ++ */ ++ ++#define nr_syscalls ((syscall_table_size)/4) ++ ++CF_MASK = 0x00000001 ++TF_MASK = 0x00000100 ++IF_MASK = 0x00000200 ++DF_MASK = 0x00000400 ++NT_MASK = 0x00004000 ++VM_MASK = 0x00020000 ++/* Pseudo-eflags. */ ++NMI_MASK = 0x80000000 ++ ++#ifdef CONFIG_PREEMPT ++#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF ++#else ++#define preempt_stop(clobbers) ++#define resume_kernel restore_nocheck ++#endif ++ ++.macro TRACE_IRQS_IRET ++#ifdef CONFIG_TRACE_IRQFLAGS ++ testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off? ++ jz 1f ++ TRACE_IRQS_ON ++1: ++#endif ++.endm ++ ++#ifdef CONFIG_VM86 ++#define resume_userspace_sig check_userspace ++#else ++#define resume_userspace_sig resume_userspace ++#endif ++ ++#define SAVE_ALL \ ++ cld; \ ++ pushl %fs; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ /*CFI_REL_OFFSET fs, 0;*/\ ++ pushl %es; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ /*CFI_REL_OFFSET es, 0;*/\ ++ pushl %ds; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ /*CFI_REL_OFFSET ds, 0;*/\ ++ pushl %eax; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ CFI_REL_OFFSET eax, 0;\ ++ pushl %ebp; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ CFI_REL_OFFSET ebp, 0;\ ++ pushl %edi; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ CFI_REL_OFFSET edi, 0;\ ++ pushl %esi; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ CFI_REL_OFFSET esi, 0;\ ++ pushl %edx; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ CFI_REL_OFFSET edx, 0;\ ++ pushl %ecx; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ CFI_REL_OFFSET ecx, 0;\ ++ pushl %ebx; \ ++ CFI_ADJUST_CFA_OFFSET 4;\ ++ CFI_REL_OFFSET ebx, 0;\ ++ movl $(__USER_DS), %edx; \ ++ movl %edx, %ds; \ ++ movl %edx, %es; \ ++ movl $(__KERNEL_PERCPU), %edx; \ ++ movl %edx, %fs ++ ++#define RESTORE_INT_REGS \ ++ popl %ebx; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ CFI_RESTORE ebx;\ ++ popl %ecx; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ CFI_RESTORE ecx;\ ++ popl %edx; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ CFI_RESTORE edx;\ ++ popl %esi; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ CFI_RESTORE esi;\ ++ popl %edi; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ CFI_RESTORE edi;\ ++ popl %ebp; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ CFI_RESTORE ebp;\ ++ popl %eax; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ CFI_RESTORE eax ++ ++#define RESTORE_REGS \ ++ RESTORE_INT_REGS; \ ++1: popl %ds; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ /*CFI_RESTORE ds;*/\ ++2: popl %es; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ /*CFI_RESTORE es;*/\ ++3: popl %fs; \ ++ CFI_ADJUST_CFA_OFFSET -4;\ ++ /*CFI_RESTORE fs;*/\ ++.pushsection .fixup,"ax"; \ ++4: movl $0,(%esp); \ ++ jmp 1b; \ ++5: movl $0,(%esp); \ ++ jmp 2b; \ ++6: movl $0,(%esp); \ ++ jmp 3b; \ ++.section __ex_table,"a";\ ++ .align 4; \ ++ .long 1b,4b; \ ++ .long 2b,5b; \ ++ .long 3b,6b; \ ++.popsection ++ ++#define RING0_INT_FRAME \ ++ CFI_STARTPROC simple;\ ++ CFI_SIGNAL_FRAME;\ ++ CFI_DEF_CFA esp, 3*4;\ ++ /*CFI_OFFSET cs, -2*4;*/\ ++ CFI_OFFSET eip, -3*4 ++ ++#define RING0_EC_FRAME \ ++ CFI_STARTPROC simple;\ ++ CFI_SIGNAL_FRAME;\ ++ CFI_DEF_CFA esp, 4*4;\ ++ /*CFI_OFFSET cs, -2*4;*/\ ++ CFI_OFFSET eip, -3*4 ++ ++#define RING0_PTREGS_FRAME \ ++ CFI_STARTPROC simple;\ ++ CFI_SIGNAL_FRAME;\ ++ CFI_DEF_CFA esp, PT_OLDESP-PT_EBX;\ ++ /*CFI_OFFSET cs, PT_CS-PT_OLDESP;*/\ ++ CFI_OFFSET eip, PT_EIP-PT_OLDESP;\ ++ /*CFI_OFFSET es, PT_ES-PT_OLDESP;*/\ ++ /*CFI_OFFSET ds, PT_DS-PT_OLDESP;*/\ ++ CFI_OFFSET eax, PT_EAX-PT_OLDESP;\ ++ CFI_OFFSET ebp, PT_EBP-PT_OLDESP;\ ++ CFI_OFFSET edi, PT_EDI-PT_OLDESP;\ ++ CFI_OFFSET esi, PT_ESI-PT_OLDESP;\ ++ CFI_OFFSET edx, PT_EDX-PT_OLDESP;\ ++ CFI_OFFSET ecx, PT_ECX-PT_OLDESP;\ ++ CFI_OFFSET ebx, PT_EBX-PT_OLDESP ++ ++ENTRY(ret_from_fork) ++ CFI_STARTPROC ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ call schedule_tail ++ GET_THREAD_INFO(%ebp) ++ popl %eax ++ CFI_ADJUST_CFA_OFFSET -4 ++ pushl $0x0202 # Reset kernel eflags ++ CFI_ADJUST_CFA_OFFSET 4 ++ popfl ++ CFI_ADJUST_CFA_OFFSET -4 ++ jmp syscall_exit ++ CFI_ENDPROC ++END(ret_from_fork) ++ ++/* ++ * Return to user mode is not as complex as all this looks, ++ * but we want the default path for a system call return to ++ * go as quickly as possible which is why some of this is ++ * less clear than it otherwise should be. ++ */ ++ ++ # userspace resumption stub bypassing syscall exit tracing ++ ALIGN ++ RING0_PTREGS_FRAME ++ret_from_exception: ++ preempt_stop(CLBR_ANY) ++ret_from_intr: ++ GET_THREAD_INFO(%ebp) ++check_userspace: ++ movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS ++ movb PT_CS(%esp), %al ++ andl $(VM_MASK | SEGMENT_RPL_MASK), %eax ++ cmpl $USER_RPL, %eax ++ jb resume_kernel # not returning to v8086 or userspace ++ ++ENTRY(resume_userspace) ++ LOCKDEP_SYS_EXIT ++ DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt ++ # setting need_resched or sigpending ++ # between sampling and the iret ++ movl TI_flags(%ebp), %ecx ++ andl $_TIF_WORK_MASK, %ecx # is there any work to be done on ++ # int/exception return? ++ jne work_pending ++ jmp restore_all ++END(ret_from_exception) ++ ++#ifdef CONFIG_PREEMPT ++ENTRY(resume_kernel) ++ DISABLE_INTERRUPTS(CLBR_ANY) ++ cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ? ++ jnz restore_nocheck ++need_resched: ++ movl TI_flags(%ebp), %ecx # need_resched set ? ++ testb $_TIF_NEED_RESCHED, %cl ++ jz restore_all ++ testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off (exception path) ? ++ jz restore_all ++ call preempt_schedule_irq ++ jmp need_resched ++END(resume_kernel) ++#endif ++ CFI_ENDPROC ++ ++/* SYSENTER_RETURN points to after the "sysenter" instruction in ++ the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */ ++ ++ # sysenter call handler stub ++ENTRY(sysenter_entry) ++ CFI_STARTPROC simple ++ CFI_SIGNAL_FRAME ++ CFI_DEF_CFA esp, 0 ++ CFI_REGISTER esp, ebp ++ movl SYSENTER_stack_esp0(%esp),%esp ++sysenter_past_esp: ++ /* ++ * No need to follow this irqs on/off section: the syscall ++ * disabled irqs and here we enable it straight after entry: ++ */ ++ ENABLE_INTERRUPTS(CLBR_NONE) ++ pushl $(__USER_DS) ++ CFI_ADJUST_CFA_OFFSET 4 ++ /*CFI_REL_OFFSET ss, 0*/ ++ pushl %ebp ++ CFI_ADJUST_CFA_OFFSET 4 ++ CFI_REL_OFFSET esp, 0 ++ pushfl ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl $(__USER_CS) ++ CFI_ADJUST_CFA_OFFSET 4 ++ /*CFI_REL_OFFSET cs, 0*/ ++ /* ++ * Push current_thread_info()->sysenter_return to the stack. ++ * A tiny bit of offset fixup is necessary - 4*4 means the 4 words ++ * pushed above; +8 corresponds to copy_thread's esp0 setting. ++ */ ++ pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) ++ CFI_ADJUST_CFA_OFFSET 4 ++ CFI_REL_OFFSET eip, 0 ++ ++/* ++ * Load the potential sixth argument from user stack. ++ * Careful about security. ++ */ ++ cmpl $__PAGE_OFFSET-3,%ebp ++ jae syscall_fault ++1: movl (%ebp),%ebp ++.section __ex_table,"a" ++ .align 4 ++ .long 1b,syscall_fault ++.previous ++ ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++ GET_THREAD_INFO(%ebp) ++ ++ /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ ++ testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp) ++ jnz syscall_trace_entry ++ cmpl $(nr_syscalls), %eax ++ jae syscall_badsys ++ call *sys_call_table(,%eax,4) ++ movl %eax,PT_EAX(%esp) ++ LOCKDEP_SYS_EXIT ++ DISABLE_INTERRUPTS(CLBR_ANY) ++ TRACE_IRQS_OFF ++ movl TI_flags(%ebp), %ecx ++ testw $_TIF_ALLWORK_MASK, %cx ++ jne syscall_exit_work ++/* if something modifies registers it must also disable sysexit */ ++ movl PT_EIP(%esp), %edx ++ movl PT_OLDESP(%esp), %ecx ++ xorl %ebp,%ebp ++ TRACE_IRQS_ON ++1: mov PT_FS(%esp), %fs ++ ENABLE_INTERRUPTS_SYSEXIT ++ CFI_ENDPROC ++.pushsection .fixup,"ax" ++2: movl $0,PT_FS(%esp) ++ jmp 1b ++.section __ex_table,"a" ++ .align 4 ++ .long 1b,2b ++.popsection ++ENDPROC(sysenter_entry) ++ ++ # pv sysenter call handler stub ++ENTRY(sysenter_entry_pv) ++ RING0_INT_FRAME ++ movl $__USER_DS,16(%esp) ++ movl %ebp,12(%esp) ++ movl $__USER_CS,4(%esp) ++ addl $4,%esp ++ CFI_ADJUST_CFA_OFFSET -4 ++ /* +5*4 is SS:ESP,EFLAGS,CS:EIP. +8 is esp0 setting. */ ++ pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) ++ CFI_ADJUST_CFA_OFFSET 4 ++/* ++ * Load the potential sixth argument from user stack. ++ * Careful about security. ++ */ ++ cmpl $__PAGE_OFFSET-3,%ebp ++ jae syscall_fault ++1: movl (%ebp),%ebp ++.section __ex_table,"a" ++ .align 4 ++ .long 1b,syscall_fault ++.previous ++ /* fall through */ ++ CFI_ENDPROC ++ENDPROC(sysenter_entry_pv) ++ ++ # system call handler stub ++ENTRY(system_call) ++ RING0_INT_FRAME # can't unwind into user space anyway ++ pushl %eax # save orig_eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++ GET_THREAD_INFO(%ebp) ++ # system call tracing in operation / emulation ++ /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ ++ testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp) ++ jnz syscall_trace_entry ++ cmpl $(nr_syscalls), %eax ++ jae syscall_badsys ++syscall_call: ++ call *sys_call_table(,%eax,4) ++ movl %eax,PT_EAX(%esp) # store the return value ++syscall_exit: ++ LOCKDEP_SYS_EXIT ++ DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt ++ # setting need_resched or sigpending ++ # between sampling and the iret ++ TRACE_IRQS_OFF ++ testl $TF_MASK,PT_EFLAGS(%esp) # If tracing set singlestep flag on exit ++ jz no_singlestep ++ orl $_TIF_SINGLESTEP,TI_flags(%ebp) ++no_singlestep: ++ movl TI_flags(%ebp), %ecx ++ testw $_TIF_ALLWORK_MASK, %cx # current->work ++ jne syscall_exit_work ++ ++restore_all: ++#ifndef CONFIG_XEN ++ movl PT_EFLAGS(%esp), %eax # mix EFLAGS, SS and CS ++ # Warning: PT_OLDSS(%esp) contains the wrong/random values if we ++ # are returning to the kernel. ++ # See comments in process.c:copy_thread() for details. ++ movb PT_OLDSS(%esp), %ah ++ movb PT_CS(%esp), %al ++ andl $(VM_MASK | (SEGMENT_TI_MASK << 8) | SEGMENT_RPL_MASK), %eax ++ cmpl $((SEGMENT_LDT << 8) | USER_RPL), %eax ++ CFI_REMEMBER_STATE ++ je ldt_ss # returning to user-space with LDT SS ++restore_nocheck: ++#else ++restore_nocheck: ++ movl PT_EFLAGS(%esp), %eax ++ testl $(VM_MASK|NMI_MASK), %eax ++ CFI_REMEMBER_STATE ++ jnz hypervisor_iret ++ shr $9, %eax # EAX[0] == IRET_EFLAGS.IF ++ GET_VCPU_INFO ++ andb evtchn_upcall_mask(%esi),%al ++ andb $1,%al # EAX[0] == IRET_EFLAGS.IF & event_mask ++ CFI_REMEMBER_STATE ++ jnz restore_all_enable_events # != 0 => enable event delivery ++#endif ++ TRACE_IRQS_IRET ++restore_nocheck_notrace: ++ RESTORE_REGS ++ addl $4, %esp # skip orig_eax/error_code ++ CFI_ADJUST_CFA_OFFSET -4 ++1: INTERRUPT_RETURN ++.section .fixup,"ax" ++iret_exc: ++ pushl $0 # no error code ++ pushl $do_iret_error ++ jmp error_code ++.previous ++.section __ex_table,"a" ++ .align 4 ++ .long 1b,iret_exc ++.previous ++ ++ CFI_RESTORE_STATE ++#ifndef CONFIG_XEN ++ldt_ss: ++ larl PT_OLDSS(%esp), %eax ++ jnz restore_nocheck ++ testl $0x00400000, %eax # returning to 32bit stack? ++ jnz restore_nocheck # allright, normal return ++ ++#ifdef CONFIG_PARAVIRT ++ /* ++ * The kernel can't run on a non-flat stack if paravirt mode ++ * is active. Rather than try to fixup the high bits of ++ * ESP, bypass this code entirely. This may break DOSemu ++ * and/or Wine support in a paravirt VM, although the option ++ * is still available to implement the setting of the high ++ * 16-bits in the INTERRUPT_RETURN paravirt-op. ++ */ ++ cmpl $0, pv_info+PARAVIRT_enabled ++ jne restore_nocheck ++#endif ++ ++ /* If returning to userspace with 16bit stack, ++ * try to fix the higher word of ESP, as the CPU ++ * won't restore it. ++ * This is an "official" bug of all the x86-compatible ++ * CPUs, which we can try to work around to make ++ * dosemu and wine happy. */ ++ movl PT_OLDESP(%esp), %eax ++ movl %esp, %edx ++ call patch_espfix_desc ++ pushl $__ESPFIX_SS ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ DISABLE_INTERRUPTS(CLBR_EAX) ++ TRACE_IRQS_OFF ++ lss (%esp), %esp ++ CFI_ADJUST_CFA_OFFSET -8 ++ jmp restore_nocheck ++#else ++ ALIGN ++restore_all_enable_events: ++ TRACE_IRQS_ON ++ __ENABLE_INTERRUPTS ++scrit: /**** START OF CRITICAL REGION ****/ ++ __TEST_PENDING ++ jnz 14f # process more events if necessary... ++ RESTORE_REGS ++ addl $4, %esp ++ CFI_ADJUST_CFA_OFFSET -4 ++1: INTERRUPT_RETURN ++.section __ex_table,"a" ++ .align 4 ++ .long 1b,iret_exc ++.previous ++14: __DISABLE_INTERRUPTS ++ TRACE_IRQS_OFF ++ jmp 11f ++ecrit: /**** END OF CRITICAL REGION ****/ ++ ++ CFI_RESTORE_STATE ++hypervisor_iret: ++ andl $~NMI_MASK, PT_EFLAGS(%esp) ++ RESTORE_REGS ++ addl $4, %esp ++ CFI_ADJUST_CFA_OFFSET -4 ++ jmp hypercall_page + (__HYPERVISOR_iret * 32) ++#endif ++ CFI_ENDPROC ++ENDPROC(system_call) ++ ++ # perform work that needs to be done immediately before resumption ++ ALIGN ++ RING0_PTREGS_FRAME # can't unwind into user space anyway ++work_pending: ++ testb $_TIF_NEED_RESCHED, %cl ++ jz work_notifysig ++work_resched: ++ call schedule ++ LOCKDEP_SYS_EXIT ++ DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt ++ # setting need_resched or sigpending ++ # between sampling and the iret ++ TRACE_IRQS_OFF ++ movl TI_flags(%ebp), %ecx ++ andl $_TIF_WORK_MASK, %ecx # is there any work to be done other ++ # than syscall tracing? ++ jz restore_all ++ testb $_TIF_NEED_RESCHED, %cl ++ jnz work_resched ++ ++work_notifysig: # deal with pending signals and ++ # notify-resume requests ++#ifdef CONFIG_VM86 ++ testl $VM_MASK, PT_EFLAGS(%esp) ++ movl %esp, %eax ++ jne work_notifysig_v86 # returning to kernel-space or ++ # vm86-space ++ xorl %edx, %edx ++ call do_notify_resume ++ jmp resume_userspace_sig ++ ++ ALIGN ++work_notifysig_v86: ++ pushl %ecx # save ti_flags for do_notify_resume ++ CFI_ADJUST_CFA_OFFSET 4 ++ call save_v86_state # %eax contains pt_regs pointer ++ popl %ecx ++ CFI_ADJUST_CFA_OFFSET -4 ++ movl %eax, %esp ++#else ++ movl %esp, %eax ++#endif ++ xorl %edx, %edx ++ call do_notify_resume ++ jmp resume_userspace_sig ++END(work_pending) ++ ++ # perform syscall exit tracing ++ ALIGN ++syscall_trace_entry: ++ movl $-ENOSYS,PT_EAX(%esp) ++ movl %esp, %eax ++ xorl %edx,%edx ++ call do_syscall_trace ++ cmpl $0, %eax ++ jne resume_userspace # ret != 0 -> running under PTRACE_SYSEMU, ++ # so must skip actual syscall ++ movl PT_ORIG_EAX(%esp), %eax ++ cmpl $(nr_syscalls), %eax ++ jnae syscall_call ++ jmp syscall_exit ++END(syscall_trace_entry) ++ ++ # perform syscall exit tracing ++ ALIGN ++syscall_exit_work: ++ testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl ++ jz work_pending ++ TRACE_IRQS_ON ++ ENABLE_INTERRUPTS(CLBR_ANY) # could let do_syscall_trace() call ++ # schedule() instead ++ movl %esp, %eax ++ movl $1, %edx ++ call do_syscall_trace ++ jmp resume_userspace ++END(syscall_exit_work) ++ CFI_ENDPROC ++ ++ RING0_INT_FRAME # can't unwind into user space anyway ++syscall_fault: ++ pushl %eax # save orig_eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++ GET_THREAD_INFO(%ebp) ++ movl $-EFAULT,PT_EAX(%esp) ++ jmp resume_userspace ++END(syscall_fault) ++ ++syscall_badsys: ++ movl $-ENOSYS,PT_EAX(%esp) ++ jmp resume_userspace ++END(syscall_badsys) ++ CFI_ENDPROC ++ ++#ifndef CONFIG_XEN ++#define FIXUP_ESPFIX_STACK \ ++ /* since we are on a wrong stack, we cant make it a C code :( */ \ ++ PER_CPU(gdt_page, %ebx); \ ++ GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \ ++ addl %esp, %eax; \ ++ pushl $__KERNEL_DS; \ ++ CFI_ADJUST_CFA_OFFSET 4; \ ++ pushl %eax; \ ++ CFI_ADJUST_CFA_OFFSET 4; \ ++ lss (%esp), %esp; \ ++ CFI_ADJUST_CFA_OFFSET -8; ++#define UNWIND_ESPFIX_STACK \ ++ movl %ss, %eax; \ ++ /* see if on espfix stack */ \ ++ cmpw $__ESPFIX_SS, %ax; \ ++ jne 27f; \ ++ movl $__KERNEL_DS, %eax; \ ++ movl %eax, %ds; \ ++ movl %eax, %es; \ ++ /* switch to normal stack */ \ ++ FIXUP_ESPFIX_STACK; \ ++27:; ++ ++/* ++ * Build the entry stubs and pointer table with ++ * some assembler magic. ++ */ ++.data ++ENTRY(interrupt) ++.text ++ ++ENTRY(irq_entries_start) ++ RING0_INT_FRAME ++vector=0 ++.rept NR_IRQS ++ ALIGN ++ .if vector ++ CFI_ADJUST_CFA_OFFSET -4 ++ .endif ++1: pushl $~(vector) ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp common_interrupt ++ .previous ++ .long 1b ++ .text ++vector=vector+1 ++.endr ++END(irq_entries_start) ++ ++.previous ++END(interrupt) ++.previous ++ ++/* ++ * the CPU automatically disables interrupts when executing an IRQ vector, ++ * so IRQ-flags tracing has to follow that: ++ */ ++ ALIGN ++common_interrupt: ++ SAVE_ALL ++ TRACE_IRQS_OFF ++ movl %esp,%eax ++ call do_IRQ ++ jmp ret_from_intr ++ENDPROC(common_interrupt) ++ CFI_ENDPROC ++ ++#define BUILD_INTERRUPT(name, nr) \ ++ENTRY(name) \ ++ RING0_INT_FRAME; \ ++ pushl $~(nr); \ ++ CFI_ADJUST_CFA_OFFSET 4; \ ++ SAVE_ALL; \ ++ TRACE_IRQS_OFF \ ++ movl %esp,%eax; \ ++ call smp_##name; \ ++ jmp ret_from_intr; \ ++ CFI_ENDPROC; \ ++ENDPROC(name) ++ ++/* The include is where all of the SMP etc. interrupts come from */ ++#include "entry_arch.h" ++ ++#else ++#define UNWIND_ESPFIX_STACK ++#endif ++ ++KPROBE_ENTRY(page_fault) ++ RING0_EC_FRAME ++ pushl $do_page_fault ++ CFI_ADJUST_CFA_OFFSET 4 ++ ALIGN ++error_code: ++ /* the function address is in %fs's slot on the stack */ ++ pushl %es ++ CFI_ADJUST_CFA_OFFSET 4 ++ /*CFI_REL_OFFSET es, 0*/ ++ pushl %ds ++ CFI_ADJUST_CFA_OFFSET 4 ++ /*CFI_REL_OFFSET ds, 0*/ ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ CFI_REL_OFFSET eax, 0 ++ pushl %ebp ++ CFI_ADJUST_CFA_OFFSET 4 ++ CFI_REL_OFFSET ebp, 0 ++ pushl %edi ++ CFI_ADJUST_CFA_OFFSET 4 ++ CFI_REL_OFFSET edi, 0 ++ pushl %esi ++ CFI_ADJUST_CFA_OFFSET 4 ++ CFI_REL_OFFSET esi, 0 ++ pushl %edx ++ CFI_ADJUST_CFA_OFFSET 4 ++ CFI_REL_OFFSET edx, 0 ++ pushl %ecx ++ CFI_ADJUST_CFA_OFFSET 4 ++ CFI_REL_OFFSET ecx, 0 ++ pushl %ebx ++ CFI_ADJUST_CFA_OFFSET 4 ++ CFI_REL_OFFSET ebx, 0 ++ cld ++ pushl %fs ++ CFI_ADJUST_CFA_OFFSET 4 ++ /*CFI_REL_OFFSET fs, 0*/ ++ movl $(__KERNEL_PERCPU), %ecx ++ movl %ecx, %fs ++ UNWIND_ESPFIX_STACK ++ popl %ecx ++ CFI_ADJUST_CFA_OFFSET -4 ++ /*CFI_REGISTER es, ecx*/ ++ movl PT_FS(%esp), %edi # get the function address ++ movl PT_ORIG_EAX(%esp), %edx # get the error code ++ movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart ++ mov %ecx, PT_FS(%esp) ++ /*CFI_REL_OFFSET fs, ES*/ ++ movl $(__USER_DS), %ecx ++ movl %ecx, %ds ++ movl %ecx, %es ++ movl %esp,%eax # pt_regs pointer ++ call *%edi ++ jmp ret_from_exception ++ CFI_ENDPROC ++KPROBE_END(page_fault) ++ ++#ifdef CONFIG_XEN ++# A note on the "critical region" in our callback handler. ++# We want to avoid stacking callback handlers due to events occurring ++# during handling of the last event. To do this, we keep events disabled ++# until we've done all processing. HOWEVER, we must enable events before ++# popping the stack frame (can't be done atomically) and so it would still ++# be possible to get enough handler activations to overflow the stack. ++# Although unlikely, bugs of that kind are hard to track down, so we'd ++# like to avoid the possibility. ++# So, on entry to the handler we detect whether we interrupted an ++# existing activation in its critical region -- if so, we pop the current ++# activation and restart the handler using the previous one. ++# ++# The sysexit critical region is slightly different. sysexit ++# atomically removes the entire stack frame. If we interrupt in the ++# critical region we know that the entire frame is present and correct ++# so we can simply throw away the new one. ++ENTRY(hypervisor_callback) ++ RING0_INT_FRAME ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++ movl PT_EIP(%esp),%eax ++ cmpl $scrit,%eax ++ jb 11f ++ cmpl $ecrit,%eax ++ jb critical_region_fixup ++ cmpl $sysexit_scrit,%eax ++ jb 11f ++ cmpl $sysexit_ecrit,%eax ++ ja 11f ++ addl $PT_OLDESP,%esp # Remove eflags...ebx from stack frame. ++11: push %esp ++ CFI_ADJUST_CFA_OFFSET 4 ++ call evtchn_do_upcall ++ add $4,%esp ++ CFI_ADJUST_CFA_OFFSET -4 ++ jmp ret_from_intr ++ CFI_ENDPROC ++ ++# [How we do the fixup]. We want to merge the current stack frame with the ++# just-interrupted frame. How we do this depends on where in the critical ++# region the interrupted handler was executing, and so how many saved ++# registers are in each frame. We do this quickly using the lookup table ++# 'critical_fixup_table'. For each byte offset in the critical region, it ++# provides the number of bytes which have already been popped from the ++# interrupted stack frame. ++critical_region_fixup: ++ movzbl critical_fixup_table-scrit(%eax),%ecx # %eax contains num bytes popped ++ cmpb $0xff,%cl # 0xff => vcpu_info critical region ++ jne 15f ++ xorl %ecx,%ecx ++15: leal (%esp,%ecx),%esi # %esi points at end of src region ++ leal PT_OLDESP(%esp),%edi # %edi points at end of dst region ++ shrl $2,%ecx # convert words to bytes ++ je 17f # skip loop if nothing to copy ++16: subl $4,%esi # pre-decrementing copy loop ++ subl $4,%edi ++ movl (%esi),%eax ++ movl %eax,(%edi) ++ loop 16b ++17: movl %edi,%esp # final %edi is top of merged stack ++ jmp 11b ++ ++.section .rodata,"a" ++critical_fixup_table: ++ .byte 0xff,0xff,0xff # testb $0xff,(%esi) = __TEST_PENDING ++ .byte 0xff,0xff # jnz 14f ++ .byte 0x00 # pop %ebx ++ .byte 0x04 # pop %ecx ++ .byte 0x08 # pop %edx ++ .byte 0x0c # pop %esi ++ .byte 0x10 # pop %edi ++ .byte 0x14 # pop %ebp ++ .byte 0x18 # pop %eax ++ .byte 0x1c # pop %ds ++ .byte 0x20 # pop %es ++ .byte 0x24,0x24 # pop %fs ++ .byte 0x28,0x28,0x28 # add $4,%esp ++ .byte 0x2c # iret ++ .byte 0xff,0xff,0xff,0xff # movb $1,1(%esi) ++ .byte 0x00,0x00 # jmp 11b ++.previous ++ ++# Hypervisor uses this for application faults while it executes. ++# We get here for two reasons: ++# 1. Fault while reloading DS, ES, FS or GS ++# 2. Fault while executing IRET ++# Category 1 we fix up by reattempting the load, and zeroing the segment ++# register if the load fails. ++# Category 2 we fix up by jumping to do_iret_error. We cannot use the ++# normal Linux return path in this case because if we use the IRET hypercall ++# to pop the stack frame we end up in an infinite loop of failsafe callbacks. ++# We distinguish between categories by maintaining a status value in EAX. ++ENTRY(failsafe_callback) ++ pushl %eax ++ movl $1,%eax ++1: mov 4(%esp),%ds ++2: mov 8(%esp),%es ++3: mov 12(%esp),%fs ++4: mov 16(%esp),%gs ++ testl %eax,%eax ++ popl %eax ++ jz 5f ++ addl $16,%esp # EAX != 0 => Category 2 (Bad IRET) ++ jmp iret_exc ++5: addl $16,%esp # EAX == 0 => Category 1 (Bad segment) ++ RING0_INT_FRAME ++ pushl $0 ++ SAVE_ALL ++ jmp ret_from_exception ++.section .fixup,"ax"; \ ++6: xorl %eax,%eax; \ ++ movl %eax,4(%esp); \ ++ jmp 1b; \ ++7: xorl %eax,%eax; \ ++ movl %eax,8(%esp); \ ++ jmp 2b; \ ++8: xorl %eax,%eax; \ ++ movl %eax,12(%esp); \ ++ jmp 3b; \ ++9: xorl %eax,%eax; \ ++ movl %eax,16(%esp); \ ++ jmp 4b; \ ++.previous; \ ++.section __ex_table,"a"; \ ++ .align 4; \ ++ .long 1b,6b; \ ++ .long 2b,7b; \ ++ .long 3b,8b; \ ++ .long 4b,9b; \ ++.previous ++#endif ++ CFI_ENDPROC ++ ++ENTRY(coprocessor_error) ++ RING0_INT_FRAME ++ pushl $0 ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl $do_coprocessor_error ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(coprocessor_error) ++ ++ENTRY(simd_coprocessor_error) ++ RING0_INT_FRAME ++ pushl $0 ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl $do_simd_coprocessor_error ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(simd_coprocessor_error) ++ ++ENTRY(device_not_available) ++ RING0_INT_FRAME ++ pushl $-1 # mark this as an int ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++#ifndef CONFIG_XEN ++ GET_CR0_INTO_EAX ++ testl $0x4, %eax # EM (math emulation bit) ++ je device_available_emulate ++ pushl $0 # temporary storage for ORIG_EIP ++ CFI_ADJUST_CFA_OFFSET 4 ++ call math_emulate ++ addl $4, %esp ++ CFI_ADJUST_CFA_OFFSET -4 ++ jmp ret_from_exception ++device_available_emulate: ++#endif ++ preempt_stop(CLBR_ANY) ++ call math_state_restore ++ jmp ret_from_exception ++ CFI_ENDPROC ++END(device_not_available) ++ ++#ifndef CONFIG_XEN ++/* ++ * Debug traps and NMI can happen at the one SYSENTER instruction ++ * that sets up the real kernel stack. Check here, since we can't ++ * allow the wrong stack to be used. ++ * ++ * "SYSENTER_stack_esp0+12" is because the NMI/debug handler will have ++ * already pushed 3 words if it hits on the sysenter instruction: ++ * eflags, cs and eip. ++ * ++ * We just load the right stack, and push the three (known) values ++ * by hand onto the new stack - while updating the return eip past ++ * the instruction that would have done it for sysenter. ++ */ ++#define FIX_STACK(offset, ok, label) \ ++ cmpw $__KERNEL_CS,4(%esp); \ ++ jne ok; \ ++label: \ ++ movl SYSENTER_stack_esp0+offset(%esp),%esp; \ ++ CFI_DEF_CFA esp, 0; \ ++ CFI_UNDEFINED eip; \ ++ pushfl; \ ++ CFI_ADJUST_CFA_OFFSET 4; \ ++ pushl $__KERNEL_CS; \ ++ CFI_ADJUST_CFA_OFFSET 4; \ ++ pushl $sysenter_past_esp; \ ++ CFI_ADJUST_CFA_OFFSET 4; \ ++ CFI_REL_OFFSET eip, 0 ++#endif /* CONFIG_XEN */ ++ ++KPROBE_ENTRY(debug) ++ RING0_INT_FRAME ++#ifndef CONFIG_XEN ++ cmpl $sysenter_entry,(%esp) ++ jne debug_stack_correct ++ FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn) ++debug_stack_correct: ++#endif /* !CONFIG_XEN */ ++ pushl $-1 # mark this as an int ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++ xorl %edx,%edx # error code 0 ++ movl %esp,%eax # pt_regs pointer ++ call do_debug ++ jmp ret_from_exception ++ CFI_ENDPROC ++KPROBE_END(debug) ++ ++#ifndef CONFIG_XEN ++/* ++ * NMI is doubly nasty. It can happen _while_ we're handling ++ * a debug fault, and the debug fault hasn't yet been able to ++ * clear up the stack. So we first check whether we got an ++ * NMI on the sysenter entry path, but after that we need to ++ * check whether we got an NMI on the debug path where the debug ++ * fault happened on the sysenter path. ++ */ ++KPROBE_ENTRY(nmi) ++ RING0_INT_FRAME ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ movl %ss, %eax ++ cmpw $__ESPFIX_SS, %ax ++ popl %eax ++ CFI_ADJUST_CFA_OFFSET -4 ++ je nmi_espfix_stack ++ cmpl $sysenter_entry,(%esp) ++ je nmi_stack_fixup ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ movl %esp,%eax ++ /* Do not access memory above the end of our stack page, ++ * it might not exist. ++ */ ++ andl $(THREAD_SIZE-1),%eax ++ cmpl $(THREAD_SIZE-20),%eax ++ popl %eax ++ CFI_ADJUST_CFA_OFFSET -4 ++ jae nmi_stack_correct ++ cmpl $sysenter_entry,12(%esp) ++ je nmi_debug_stack_check ++nmi_stack_correct: ++ /* We have a RING0_INT_FRAME here */ ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++ xorl %edx,%edx # zero error code ++ movl %esp,%eax # pt_regs pointer ++ call do_nmi ++ jmp restore_nocheck_notrace ++ CFI_ENDPROC ++ ++nmi_stack_fixup: ++ RING0_INT_FRAME ++ FIX_STACK(12,nmi_stack_correct, 1) ++ jmp nmi_stack_correct ++ ++nmi_debug_stack_check: ++ /* We have a RING0_INT_FRAME here */ ++ cmpw $__KERNEL_CS,16(%esp) ++ jne nmi_stack_correct ++ cmpl $debug,(%esp) ++ jb nmi_stack_correct ++ cmpl $debug_esp_fix_insn,(%esp) ++ ja nmi_stack_correct ++ FIX_STACK(24,nmi_stack_correct, 1) ++ jmp nmi_stack_correct ++ ++nmi_espfix_stack: ++ /* We have a RING0_INT_FRAME here. ++ * ++ * create the pointer to lss back ++ */ ++ pushl %ss ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl %esp ++ CFI_ADJUST_CFA_OFFSET 4 ++ addw $4, (%esp) ++ /* copy the iret frame of 12 bytes */ ++ .rept 3 ++ pushl 16(%esp) ++ CFI_ADJUST_CFA_OFFSET 4 ++ .endr ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++ FIXUP_ESPFIX_STACK # %eax == %esp ++ xorl %edx,%edx # zero error code ++ call do_nmi ++ RESTORE_REGS ++ lss 12+4(%esp), %esp # back to espfix stack ++ CFI_ADJUST_CFA_OFFSET -24 ++1: INTERRUPT_RETURN ++ CFI_ENDPROC ++.section __ex_table,"a" ++ .align 4 ++ .long 1b,iret_exc ++.previous ++#else ++KPROBE_ENTRY(nmi) ++ RING0_INT_FRAME ++ pushl %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++ xorl %edx,%edx # zero error code ++ movl %esp,%eax # pt_regs pointer ++ call do_nmi ++ orl $NMI_MASK, PT_EFLAGS(%esp) ++ jmp restore_all ++ CFI_ENDPROC ++#endif ++KPROBE_END(nmi) ++ ++#ifdef CONFIG_PARAVIRT ++ENTRY(native_iret) ++1: iret ++.section __ex_table,"a" ++ .align 4 ++ .long 1b,iret_exc ++.previous ++END(native_iret) ++ ++ENTRY(native_irq_enable_sysexit) ++ sti ++ sysexit ++END(native_irq_enable_sysexit) ++#endif ++ ++KPROBE_ENTRY(int3) ++ RING0_INT_FRAME ++ pushl $-1 # mark this as an int ++ CFI_ADJUST_CFA_OFFSET 4 ++ SAVE_ALL ++ xorl %edx,%edx # zero error code ++ movl %esp,%eax # pt_regs pointer ++ call do_int3 ++ jmp ret_from_exception ++ CFI_ENDPROC ++KPROBE_END(int3) ++ ++ENTRY(overflow) ++ RING0_INT_FRAME ++ pushl $0 ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl $do_overflow ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(overflow) ++ ++ENTRY(bounds) ++ RING0_INT_FRAME ++ pushl $0 ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl $do_bounds ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(bounds) ++ ++ENTRY(invalid_op) ++ RING0_INT_FRAME ++ pushl $0 ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl $do_invalid_op ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(invalid_op) ++ ++ENTRY(coprocessor_segment_overrun) ++ RING0_INT_FRAME ++ pushl $0 ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl $do_coprocessor_segment_overrun ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(coprocessor_segment_overrun) ++ ++ENTRY(invalid_TSS) ++ RING0_EC_FRAME ++ pushl $do_invalid_TSS ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(invalid_TSS) ++ ++ENTRY(segment_not_present) ++ RING0_EC_FRAME ++ pushl $do_segment_not_present ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(segment_not_present) ++ ++ENTRY(stack_segment) ++ RING0_EC_FRAME ++ pushl $do_stack_segment ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(stack_segment) ++ ++KPROBE_ENTRY(general_protection) ++ RING0_EC_FRAME ++ pushl $do_general_protection ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++KPROBE_END(general_protection) ++ ++ENTRY(alignment_check) ++ RING0_EC_FRAME ++ pushl $do_alignment_check ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(alignment_check) ++ ++ENTRY(divide_error) ++ RING0_INT_FRAME ++ pushl $0 # no error code ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl $do_divide_error ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(divide_error) ++ ++#ifdef CONFIG_X86_MCE ++ENTRY(machine_check) ++ RING0_INT_FRAME ++ pushl $0 ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl machine_check_vector ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(machine_check) ++#endif ++ ++#ifndef CONFIG_XEN ++ENTRY(spurious_interrupt_bug) ++ RING0_INT_FRAME ++ pushl $0 ++ CFI_ADJUST_CFA_OFFSET 4 ++ pushl $do_spurious_interrupt_bug ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++#endif /* !CONFIG_XEN */ ++ ++ENTRY(fixup_4gb_segment) ++ RING0_EC_FRAME ++ pushl $do_fixup_4gb_segment ++ CFI_ADJUST_CFA_OFFSET 4 ++ jmp error_code ++ CFI_ENDPROC ++END(spurious_interrupt_bug) ++ ++ENTRY(kernel_thread_helper) ++ pushl $0 # fake return address for unwinder ++ CFI_STARTPROC ++ movl %edx,%eax ++ push %edx ++ CFI_ADJUST_CFA_OFFSET 4 ++ call *%ebx ++ push %eax ++ CFI_ADJUST_CFA_OFFSET 4 ++ call do_exit ++ CFI_ENDPROC ++ENDPROC(kernel_thread_helper) ++ ++.section .rodata,"a" ++#include "syscall_table_32.S" ++ ++syscall_table_size=(.-sys_call_table) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/entry_32.S debian/binary-custom.d/xen/src/arch/x86/kernel/entry_32.S +--- ./arch/x86/kernel/entry_32.S 2012-06-12 16:25:11.602312932 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/entry_32.S 2012-11-13 15:20:17.292568998 +0000 +@@ -288,7 +288,7 @@ + CFI_SIGNAL_FRAME + CFI_DEF_CFA esp, 0 + CFI_REGISTER esp, ebp +- movl TSS_sysenter_esp0(%esp),%esp ++ movl SYSENTER_stack_esp0(%esp),%esp + sysenter_past_esp: + /* + * No need to follow this irqs on/off section: the syscall +@@ -743,7 +743,7 @@ + * that sets up the real kernel stack. Check here, since we can't + * allow the wrong stack to be used. + * +- * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have ++ * "SYSENTER_stack_esp0+12" is because the NMI/debug handler will have + * already pushed 3 words if it hits on the sysenter instruction: + * eflags, cs and eip. + * +@@ -755,7 +755,7 @@ + cmpw $__KERNEL_CS,4(%esp); \ + jne ok; \ + label: \ +- movl TSS_sysenter_esp0+offset(%esp),%esp; \ ++ movl SYSENTER_stack_esp0+offset(%esp),%esp; \ + CFI_DEF_CFA esp, 0; \ + CFI_UNDEFINED eip; \ + pushfl; \ +@@ -1025,7 +1025,7 @@ + CFI_ENDPROC + ENDPROC(kernel_thread_helper) + +-#ifdef CONFIG_XEN ++#ifdef CONFIG_PARAVIRT_XEN + ENTRY(xen_hypervisor_callback) + CFI_STARTPROC + pushl $0 +@@ -1108,7 +1108,7 @@ + .previous + ENDPROC(xen_failsafe_callback) + +-#endif /* CONFIG_XEN */ ++#endif /* CONFIG_PARAVIRT_XEN */ + + .section .rodata,"a" + #include "syscall_table_32.S" +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/entry_64-xen.S debian/binary-custom.d/xen/src/arch/x86/kernel/entry_64-xen.S +--- ./arch/x86/kernel/entry_64-xen.S 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/entry_64-xen.S 2012-11-13 15:20:17.292568998 +0000 +@@ -0,0 +1,1263 @@ ++/* ++ * linux/arch/x86_64/entry.S ++ * ++ * Copyright (C) 1991, 1992 Linus Torvalds ++ * Copyright (C) 2000, 2001, 2002 Andi Kleen SuSE Labs ++ * Copyright (C) 2000 Pavel Machek ++ * Jun Nakajima ++ * Asit Mallick ++ * Modified for Xen ++ */ ++ ++/* ++ * entry.S contains the system-call and fault low-level handling routines. ++ * ++ * NOTE: This code handles signal-recognition, which happens every time ++ * after an interrupt and after each system call. ++ * ++ * Normal syscalls and interrupts don't save a full stack frame, this is ++ * only done for syscall tracing, signals or fork/exec et.al. ++ * ++ * A note on terminology: ++ * - top of stack: Architecture defined interrupt frame from SS to RIP ++ * at the top of the kernel process stack. ++ * - partial stack frame: partially saved registers upto R11. ++ * - full stack frame: Like partial stack frame, but all register saved. ++ * ++ * Some macro usage: ++ * - CFI macros are used to generate dwarf2 unwind information for better ++ * backtraces. They don't change any code. ++ * - SAVE_ALL/RESTORE_ALL - Save/restore all registers ++ * - SAVE_ARGS/RESTORE_ARGS - Save/restore registers that C functions modify. ++ * There are unfortunately lots of special cases where some registers ++ * not touched. The macro is a big mess that should be cleaned up. ++ * - SAVE_REST/RESTORE_REST - Handle the registers not saved by SAVE_ARGS. ++ * Gives a full stack frame. ++ * - ENTRY/END Define functions in the symbol table. ++ * - FIXUP_TOP_OF_STACK/RESTORE_TOP_OF_STACK - Fix up the hardware stack ++ * frame that is otherwise undefined after a SYSCALL ++ * - TRACE_IRQ_* - Trace hard interrupt state for lock debugging. ++ * - errorentry/paranoidentry/zeroentry - Define exception entry points. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "xen_entry_64.S" ++ ++ .code64 ++ ++#ifndef CONFIG_PREEMPT ++#define retint_kernel retint_restore_args ++#endif ++ ++ ++.macro TRACE_IRQS_IRETQ offset=ARGOFFSET ++#ifdef CONFIG_TRACE_IRQFLAGS ++ bt $9,EFLAGS-\offset(%rsp) /* interrupts off? */ ++ jnc 1f ++ TRACE_IRQS_ON ++1: ++#endif ++.endm ++ ++NMI_MASK = 0x80000000 ++ ++/* ++ * C code is not supposed to know about undefined top of stack. Every time ++ * a C function with an pt_regs argument is called from the SYSCALL based ++ * fast path FIXUP_TOP_OF_STACK is needed. ++ * RESTORE_TOP_OF_STACK syncs the syscall state after any possible ptregs ++ * manipulation. ++ */ ++ ++ /* %rsp:at FRAMEEND */ ++ .macro FIXUP_TOP_OF_STACK tmp ++ movq $__USER_CS,CS(%rsp) ++ movq $-1,RCX(%rsp) ++ .endm ++ ++ .macro RESTORE_TOP_OF_STACK tmp,offset=0 ++ .endm ++ ++ .macro FAKE_STACK_FRAME child_rip ++ /* push in order ss, rsp, eflags, cs, rip */ ++ xorl %eax, %eax ++ pushq %rax /* ss */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ /*CFI_REL_OFFSET ss,0*/ ++ pushq %rax /* rsp */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ CFI_REL_OFFSET rsp,0 ++ pushq $(1<<9) /* eflags - interrupts on */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ /*CFI_REL_OFFSET rflags,0*/ ++ pushq $__KERNEL_CS /* cs */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ /*CFI_REL_OFFSET cs,0*/ ++ pushq \child_rip /* rip */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ CFI_REL_OFFSET rip,0 ++ pushq %rax /* orig rax */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ .endm ++ ++ .macro UNFAKE_STACK_FRAME ++ addq $8*6, %rsp ++ CFI_ADJUST_CFA_OFFSET -(6*8) ++ .endm ++ ++ .macro CFI_DEFAULT_STACK start=1,adj=0 ++ .if \start ++ CFI_STARTPROC simple ++ CFI_SIGNAL_FRAME ++ CFI_DEF_CFA rsp,SS+8-(\adj*ARGOFFSET) ++ .else ++ CFI_DEF_CFA_OFFSET SS+8-(\adj*ARGOFFSET) ++ .endif ++ .if \adj == 0 ++ CFI_REL_OFFSET r15,R15 ++ CFI_REL_OFFSET r14,R14 ++ CFI_REL_OFFSET r13,R13 ++ CFI_REL_OFFSET r12,R12 ++ CFI_REL_OFFSET rbp,RBP ++ CFI_REL_OFFSET rbx,RBX ++ .endif ++ CFI_REL_OFFSET r11,R11 ++ CFI_REL_OFFSET r10,R10 ++ CFI_REL_OFFSET r9,R9 ++ CFI_REL_OFFSET r8,R8 ++ CFI_REL_OFFSET rax,RAX ++ CFI_REL_OFFSET rcx,RCX ++ CFI_REL_OFFSET rdx,RDX ++ CFI_REL_OFFSET rsi,RSI ++ CFI_REL_OFFSET rdi,RDI ++ CFI_REL_OFFSET rip,RIP ++ /*CFI_REL_OFFSET cs,CS*/ ++ /*CFI_REL_OFFSET rflags,EFLAGS*/ ++ CFI_REL_OFFSET rsp,RSP ++ /*CFI_REL_OFFSET ss,SS*/ ++ .endm ++ ++ /* ++ * Must be consistent with the definition in arch-x86/xen-x86_64.h: ++ * struct iret_context { ++ * u64 rax, r11, rcx, flags, rip, cs, rflags, rsp, ss; ++ * }; ++ * with rax, r11, and rcx being taken care of in the hypercall stub. ++ */ ++ .macro HYPERVISOR_IRET flag ++ testb $3,1*8(%rsp) ++ jnz 2f ++ testl $NMI_MASK,2*8(%rsp) ++ jnz 2f ++ ++ cmpb $0,(xen_features+XENFEAT_supervisor_mode_kernel)(%rip) ++ jne 1f ++ ++ /* Direct iret to kernel space. Correct CS and SS. */ ++ orl $3,1*8(%rsp) ++ orl $3,4*8(%rsp) ++1: iretq ++ ++2: /* Slow iret via hypervisor. */ ++ andl $~NMI_MASK, 2*8(%rsp) ++ pushq $\flag ++ jmp hypercall_page + (__HYPERVISOR_iret * 32) ++ .endm ++ ++/* ++ * A newly forked process directly context switches into this. ++ */ ++/* rdi: prev */ ++ENTRY(ret_from_fork) ++ CFI_DEFAULT_STACK ++ push kernel_eflags(%rip) ++ CFI_ADJUST_CFA_OFFSET 4 ++ popf # reset kernel eflags ++ CFI_ADJUST_CFA_OFFSET -4 ++ call schedule_tail ++ GET_THREAD_INFO(%rcx) ++ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx) ++ jnz rff_trace ++rff_action: ++ RESTORE_REST ++ testl $3,CS-ARGOFFSET(%rsp) # from kernel_thread? ++ je int_ret_from_sys_call ++ testl $_TIF_IA32,threadinfo_flags(%rcx) ++ jnz int_ret_from_sys_call ++ RESTORE_TOP_OF_STACK %rdi,ARGOFFSET ++ jmp ret_from_sys_call ++rff_trace: ++ movq %rsp,%rdi ++ call syscall_trace_leave ++ GET_THREAD_INFO(%rcx) ++ jmp rff_action ++ CFI_ENDPROC ++END(ret_from_fork) ++ ++/* ++ * initial frame state for interrupts and exceptions ++ */ ++ .macro _frame ref ++ CFI_STARTPROC simple ++ CFI_SIGNAL_FRAME ++ CFI_DEF_CFA rsp,SS+8-\ref ++ /*CFI_REL_OFFSET ss,SS-\ref*/ ++ CFI_REL_OFFSET rsp,RSP-\ref ++ /*CFI_REL_OFFSET rflags,EFLAGS-\ref*/ ++ /*CFI_REL_OFFSET cs,CS-\ref*/ ++ CFI_REL_OFFSET rip,RIP-\ref ++ .endm ++ ++/* ++ * System call entry. Upto 6 arguments in registers are supported. ++ * ++ * SYSCALL does not save anything on the stack and does not change the ++ * stack pointer. ++ */ ++ ++/* ++ * Register setup: ++ * rax system call number ++ * rdi arg0 ++ * rcx return address for syscall/sysret, C arg3 ++ * rsi arg1 ++ * rdx arg2 ++ * r10 arg3 (--> moved to rcx for C) ++ * r8 arg4 ++ * r9 arg5 ++ * r11 eflags for syscall/sysret, temporary for C ++ * r12-r15,rbp,rbx saved by C code, not touched. ++ * ++ * Interrupts are enabled on entry. ++ * Only called from user space. ++ * ++ * XXX if we had a free scratch register we could save the RSP into the stack frame ++ * and report it properly in ps. Unfortunately we haven't. ++ * ++ * When user can change the frames always force IRET. That is because ++ * it deals with uncanonical addresses better. SYSRET has trouble ++ * with them due to bugs in both AMD and Intel CPUs. ++ */ ++ ++ENTRY(system_call) ++ _frame (RIP-0x10) ++ SAVE_ARGS -8,0 ++ movq %rax,ORIG_RAX-ARGOFFSET(%rsp) ++ GET_THREAD_INFO(%rcx) ++ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx) ++ jnz tracesys ++ cmpq $__NR_syscall_max,%rax ++ ja badsys ++ movq %r10,%rcx ++ call *sys_call_table(,%rax,8) # XXX: rip relative ++ movq %rax,RAX-ARGOFFSET(%rsp) ++/* ++ * Syscall return path ending with SYSRET (fast path) ++ * Has incomplete stack frame and undefined top of stack. ++ */ ++ret_from_sys_call: ++ movl $_TIF_ALLWORK_MASK,%edi ++ /* edi: flagmask */ ++sysret_check: ++ LOCKDEP_SYS_EXIT ++ GET_THREAD_INFO(%rcx) ++ XEN_BLOCK_EVENTS(%rsi) ++ TRACE_IRQS_OFF ++ movl threadinfo_flags(%rcx),%edx ++ andl %edi,%edx ++ jnz sysret_careful ++ CFI_REMEMBER_STATE ++ /* ++ * sysretq will re-enable interrupts: ++ */ ++ TRACE_IRQS_ON ++ XEN_UNBLOCK_EVENTS(%rsi) ++ RESTORE_ARGS 0,8,0 ++ HYPERVISOR_IRET VGCF_IN_SYSCALL ++ ++ CFI_RESTORE_STATE ++ /* Handle reschedules */ ++ /* edx: work, edi: workmask */ ++sysret_careful: ++ bt $TIF_NEED_RESCHED,%edx ++ jnc sysret_signal ++ TRACE_IRQS_ON ++ XEN_UNBLOCK_EVENTS(%rsi) ++ pushq %rdi ++ CFI_ADJUST_CFA_OFFSET 8 ++ call schedule ++ popq %rdi ++ CFI_ADJUST_CFA_OFFSET -8 ++ jmp sysret_check ++ ++ /* Handle a signal */ ++sysret_signal: ++ TRACE_IRQS_ON ++/* sti */ ++ XEN_UNBLOCK_EVENTS(%rsi) ++ testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx ++ jz 1f ++ ++ /* Really a signal */ ++ /* edx: work flags (arg3) */ ++ leaq do_notify_resume(%rip),%rax ++ leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1 ++ xorl %esi,%esi # oldset -> arg2 ++ call ptregscall_common ++1: movl $_TIF_NEED_RESCHED,%edi ++ /* Use IRET because user could have changed frame. This ++ works because ptregscall_common has called FIXUP_TOP_OF_STACK. */ ++ XEN_BLOCK_EVENTS(%rsi) ++ TRACE_IRQS_OFF ++ jmp int_with_check ++ ++badsys: ++ movq $-ENOSYS,RAX-ARGOFFSET(%rsp) ++ jmp ret_from_sys_call ++ ++ /* Do syscall tracing */ ++tracesys: ++ SAVE_REST ++ movq $-ENOSYS,RAX(%rsp) ++ FIXUP_TOP_OF_STACK %rdi ++ movq %rsp,%rdi ++ call syscall_trace_enter ++ LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */ ++ RESTORE_REST ++ cmpq $__NR_syscall_max,%rax ++ movq $-ENOSYS,%rcx ++ cmova %rcx,%rax ++ ja 1f ++ movq %r10,%rcx /* fixup for C */ ++ call *sys_call_table(,%rax,8) ++1: movq %rax,RAX-ARGOFFSET(%rsp) ++ /* Use IRET because user could have changed frame */ ++ ++/* ++ * Syscall return path ending with IRET. ++ * Has correct top of stack, but partial stack frame. ++ */ ++ .globl int_ret_from_sys_call ++int_ret_from_sys_call: ++ XEN_BLOCK_EVENTS(%rsi) ++ TRACE_IRQS_OFF ++ testb $3,CS-ARGOFFSET(%rsp) ++ jnz 1f ++ /* Need to set the proper %ss (not NULL) for ring 3 iretq */ ++ movl $__KERNEL_DS,SS-ARGOFFSET(%rsp) ++ jmp retint_restore_args # retrun from ring3 kernel ++1: ++ movl $_TIF_ALLWORK_MASK,%edi ++ /* edi: mask to check */ ++int_with_check: ++ LOCKDEP_SYS_EXIT_IRQ ++ GET_THREAD_INFO(%rcx) ++ movl threadinfo_flags(%rcx),%edx ++ andl %edi,%edx ++ jnz int_careful ++ andl $~TS_COMPAT,threadinfo_status(%rcx) ++ jmp retint_restore_args ++ ++ /* Either reschedule or signal or syscall exit tracking needed. */ ++ /* First do a reschedule test. */ ++ /* edx: work, edi: workmask */ ++int_careful: ++ bt $TIF_NEED_RESCHED,%edx ++ jnc int_very_careful ++ TRACE_IRQS_ON ++/* sti */ ++ XEN_UNBLOCK_EVENTS(%rsi) ++ pushq %rdi ++ CFI_ADJUST_CFA_OFFSET 8 ++ call schedule ++ popq %rdi ++ CFI_ADJUST_CFA_OFFSET -8 ++ XEN_BLOCK_EVENTS(%rsi) ++ TRACE_IRQS_OFF ++ jmp int_with_check ++ ++ /* handle signals and tracing -- both require a full stack frame */ ++int_very_careful: ++ TRACE_IRQS_ON ++/* sti */ ++ XEN_UNBLOCK_EVENTS(%rsi) ++ SAVE_REST ++ /* Check for syscall exit trace */ ++ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edx ++ jz int_signal ++ pushq %rdi ++ CFI_ADJUST_CFA_OFFSET 8 ++ leaq 8(%rsp),%rdi # &ptregs -> arg1 ++ call syscall_trace_leave ++ popq %rdi ++ CFI_ADJUST_CFA_OFFSET -8 ++ andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi ++ jmp int_restore_rest ++ ++int_signal: ++ testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx ++ jz 1f ++ movq %rsp,%rdi # &ptregs -> arg1 ++ xorl %esi,%esi # oldset -> arg2 ++ call do_notify_resume ++1: movl $_TIF_NEED_RESCHED,%edi ++int_restore_rest: ++ RESTORE_REST ++ XEN_BLOCK_EVENTS(%rsi) ++ TRACE_IRQS_OFF ++ jmp int_with_check ++ CFI_ENDPROC ++END(system_call) ++ ++/* ++ * Certain special system calls that need to save a complete full stack frame. ++ */ ++ ++ .macro PTREGSCALL label,func,arg ++ .globl \label ++\label: ++ leaq \func(%rip),%rax ++ leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */ ++ jmp ptregscall_common ++END(\label) ++ .endm ++ ++ CFI_STARTPROC ++ ++ PTREGSCALL stub_clone, sys_clone, %r8 ++ PTREGSCALL stub_fork, sys_fork, %rdi ++ PTREGSCALL stub_vfork, sys_vfork, %rdi ++ PTREGSCALL stub_rt_sigsuspend, sys_rt_sigsuspend, %rdx ++ PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx ++ PTREGSCALL stub_iopl, sys_iopl, %rsi ++ ++ENTRY(ptregscall_common) ++ popq %r11 ++ CFI_ADJUST_CFA_OFFSET -8 ++ CFI_REGISTER rip, r11 ++ SAVE_REST ++ movq %r11, %r15 ++ CFI_REGISTER rip, r15 ++ FIXUP_TOP_OF_STACK %r11 ++ call *%rax ++ RESTORE_TOP_OF_STACK %r11 ++ movq %r15, %r11 ++ CFI_REGISTER rip, r11 ++ RESTORE_REST ++ pushq %r11 ++ CFI_ADJUST_CFA_OFFSET 8 ++ CFI_REL_OFFSET rip, 0 ++ ret ++ CFI_ENDPROC ++END(ptregscall_common) ++ ++ENTRY(stub_execve) ++ CFI_STARTPROC ++ popq %r11 ++ CFI_ADJUST_CFA_OFFSET -8 ++ CFI_REGISTER rip, r11 ++ SAVE_REST ++ FIXUP_TOP_OF_STACK %r11 ++ call sys_execve ++ RESTORE_TOP_OF_STACK %r11 ++ movq %rax,RAX(%rsp) ++ RESTORE_REST ++ jmp int_ret_from_sys_call ++ CFI_ENDPROC ++END(stub_execve) ++ ++/* ++ * sigreturn is special because it needs to restore all registers on return. ++ * This cannot be done with SYSRET, so use the IRET return path instead. ++ */ ++ENTRY(stub_rt_sigreturn) ++ CFI_STARTPROC ++ addq $8, %rsp ++ CFI_ADJUST_CFA_OFFSET -8 ++ SAVE_REST ++ movq %rsp,%rdi ++ FIXUP_TOP_OF_STACK %r11 ++ call sys_rt_sigreturn ++ movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer ++ RESTORE_REST ++ jmp int_ret_from_sys_call ++ CFI_ENDPROC ++END(stub_rt_sigreturn) ++ ++/* initial frame state for interrupts (and exceptions without error code) */ ++#define INTR_FRAME _frame (RIP-0x10); \ ++ CFI_REL_OFFSET rcx,0; \ ++ CFI_REL_OFFSET r11,8 ++ ++/* initial frame state for exceptions with error code (and interrupts with ++ vector already pushed) */ ++#define XCPT_FRAME _frame (RIP-0x18); \ ++ CFI_REL_OFFSET rcx,0; \ ++ CFI_REL_OFFSET r11,8 ++ ++/* ++ * Interrupt exit. ++ * ++ */ ++ ++retint_check: ++ CFI_DEFAULT_STACK adj=1 ++ LOCKDEP_SYS_EXIT_IRQ ++ movl threadinfo_flags(%rcx),%edx ++ andl %edi,%edx ++ CFI_REMEMBER_STATE ++ jnz retint_careful ++retint_restore_args: /* return to kernel space */ ++ movl EFLAGS-REST_SKIP(%rsp), %eax ++ shr $9, %eax # EAX[0] == IRET_EFLAGS.IF ++ XEN_GET_VCPU_INFO(%rsi) ++ andb evtchn_upcall_mask(%rsi),%al ++ andb $1,%al # EAX[0] == IRET_EFLAGS.IF & event_mask ++ jnz restore_all_enable_events # != 0 => enable event delivery ++ XEN_PUT_VCPU_INFO(%rsi) ++ ++ RESTORE_ARGS 0,8,0 ++ HYPERVISOR_IRET 0 ++ ++ /* edi: workmask, edx: work */ ++retint_careful: ++ CFI_RESTORE_STATE ++ bt $TIF_NEED_RESCHED,%edx ++ jnc retint_signal ++ TRACE_IRQS_ON ++ XEN_UNBLOCK_EVENTS(%rsi) ++/* sti */ ++ pushq %rdi ++ CFI_ADJUST_CFA_OFFSET 8 ++ call schedule ++ popq %rdi ++ CFI_ADJUST_CFA_OFFSET -8 ++ GET_THREAD_INFO(%rcx) ++ XEN_BLOCK_EVENTS(%rsi) ++/* cli */ ++ TRACE_IRQS_OFF ++ jmp retint_check ++ ++retint_signal: ++ testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx ++ jz retint_restore_args ++ TRACE_IRQS_ON ++ XEN_UNBLOCK_EVENTS(%rsi) ++ SAVE_REST ++ movq $-1,ORIG_RAX(%rsp) ++ xorl %esi,%esi # oldset ++ movq %rsp,%rdi # &pt_regs ++ call do_notify_resume ++ RESTORE_REST ++ XEN_BLOCK_EVENTS(%rsi) ++ TRACE_IRQS_OFF ++ movl $_TIF_NEED_RESCHED,%edi ++ GET_THREAD_INFO(%rcx) ++ jmp retint_check ++ ++#ifdef CONFIG_PREEMPT ++ /* Returning to kernel space. Check if we need preemption */ ++ /* rcx: threadinfo. interrupts off. */ ++ENTRY(retint_kernel) ++ cmpl $0,threadinfo_preempt_count(%rcx) ++ jnz retint_restore_args ++ bt $TIF_NEED_RESCHED,threadinfo_flags(%rcx) ++ jnc retint_restore_args ++ bt $9,EFLAGS-ARGOFFSET(%rsp) /* interrupts off? */ ++ jnc retint_restore_args ++ call preempt_schedule_irq ++ jmp retint_kernel /* check again */ ++#endif ++ ++ CFI_ENDPROC ++END(retint_check) ++ ++#ifndef CONFIG_XEN ++/* ++ * APIC interrupts. ++ */ ++ .macro apicinterrupt num,func ++ INTR_FRAME ++ pushq $~(\num) ++ CFI_ADJUST_CFA_OFFSET 8 ++ interrupt \func ++ jmp error_entry ++ CFI_ENDPROC ++ .endm ++ ++ENTRY(thermal_interrupt) ++ apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt ++END(thermal_interrupt) ++ ++ENTRY(threshold_interrupt) ++ apicinterrupt THRESHOLD_APIC_VECTOR,mce_threshold_interrupt ++END(threshold_interrupt) ++ ++#ifdef CONFIG_SMP ++ENTRY(reschedule_interrupt) ++ apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt ++END(reschedule_interrupt) ++ ++ .macro INVALIDATE_ENTRY num ++ENTRY(invalidate_interrupt\num) ++ apicinterrupt INVALIDATE_TLB_VECTOR_START+\num,smp_invalidate_interrupt ++END(invalidate_interrupt\num) ++ .endm ++ ++ INVALIDATE_ENTRY 0 ++ INVALIDATE_ENTRY 1 ++ INVALIDATE_ENTRY 2 ++ INVALIDATE_ENTRY 3 ++ INVALIDATE_ENTRY 4 ++ INVALIDATE_ENTRY 5 ++ INVALIDATE_ENTRY 6 ++ INVALIDATE_ENTRY 7 ++ ++ENTRY(call_function_interrupt) ++ apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt ++END(call_function_interrupt) ++ENTRY(irq_move_cleanup_interrupt) ++ apicinterrupt IRQ_MOVE_CLEANUP_VECTOR,smp_irq_move_cleanup_interrupt ++END(irq_move_cleanup_interrupt) ++#endif ++ ++ENTRY(apic_timer_interrupt) ++ apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt ++END(apic_timer_interrupt) ++ ++ENTRY(error_interrupt) ++ apicinterrupt ERROR_APIC_VECTOR,smp_error_interrupt ++END(error_interrupt) ++ ++ENTRY(spurious_interrupt) ++ apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt ++END(spurious_interrupt) ++#endif /* !CONFIG_XEN */ ++ ++/* ++ * Exception entry points. ++ */ ++ .macro zeroentry sym ++ INTR_FRAME ++ movq (%rsp),%rcx ++ CFI_RESTORE rcx ++ movq 8(%rsp),%r11 ++ CFI_RESTORE r11 ++ addq $0x10,%rsp /* skip rcx and r11 */ ++ CFI_ADJUST_CFA_OFFSET -0x10 ++ pushq $0 /* push error code/oldrax */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ pushq %rax /* push real oldrax to the rdi slot */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ CFI_REL_OFFSET rax,0 ++ leaq \sym(%rip),%rax ++ jmp error_entry ++ CFI_ENDPROC ++ .endm ++ ++ .macro errorentry sym ++ XCPT_FRAME ++ movq (%rsp),%rcx ++ CFI_RESTORE rcx ++ movq 8(%rsp),%r11 ++ CFI_RESTORE r11 ++ addq $0x10,%rsp /* rsp points to the error code */ ++ CFI_ADJUST_CFA_OFFSET -0x10 ++ pushq %rax ++ CFI_ADJUST_CFA_OFFSET 8 ++ CFI_REL_OFFSET rax,0 ++ leaq \sym(%rip),%rax ++ jmp error_entry ++ CFI_ENDPROC ++ .endm ++ ++#if 0 /* not XEN */ ++ /* error code is on the stack already */ ++ /* handle NMI like exceptions that can happen everywhere */ ++ .macro paranoidentry sym, ist=0, irqtrace=1 ++ movq (%rsp),%rcx ++ movq 8(%rsp),%r11 ++ addq $0x10,%rsp /* skip rcx and r11 */ ++ SAVE_ALL ++ cld ++#if 0 /* not XEN */ ++ movl $1,%ebx ++ movl $MSR_GS_BASE,%ecx ++ rdmsr ++ testl %edx,%edx ++ js 1f ++ swapgs ++ xorl %ebx,%ebx ++1: ++#endif ++ .if \ist ++ movq %gs:pda_data_offset, %rbp ++ .endif ++ movq %rsp,%rdi ++ movq ORIG_RAX(%rsp),%rsi ++ movq $-1,ORIG_RAX(%rsp) ++ .if \ist ++ subq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) ++ .endif ++ call \sym ++ .if \ist ++ addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) ++ .endif ++/* cli */ ++ XEN_BLOCK_EVENTS(%rsi) ++ .if \irqtrace ++ TRACE_IRQS_OFF ++ .endif ++ .endm ++ ++ /* ++ * "Paranoid" exit path from exception stack. ++ * Paranoid because this is used by NMIs and cannot take ++ * any kernel state for granted. ++ * We don't do kernel preemption checks here, because only ++ * NMI should be common and it does not enable IRQs and ++ * cannot get reschedule ticks. ++ * ++ * "trace" is 0 for the NMI handler only, because irq-tracing ++ * is fundamentally NMI-unsafe. (we cannot change the soft and ++ * hard flags at once, atomically) ++ */ ++ .macro paranoidexit trace=1 ++ /* ebx: no swapgs flag */ ++paranoid_exit\trace: ++ testl %ebx,%ebx /* swapgs needed? */ ++ jnz paranoid_restore\trace ++ testl $3,CS(%rsp) ++ jnz paranoid_userspace\trace ++paranoid_swapgs\trace: ++ .if \trace ++ TRACE_IRQS_IRETQ 0 ++ .endif ++ swapgs ++paranoid_restore\trace: ++ RESTORE_ALL 8 ++ iretq ++paranoid_userspace\trace: ++ GET_THREAD_INFO(%rcx) ++ movl threadinfo_flags(%rcx),%ebx ++ andl $_TIF_WORK_MASK,%ebx ++ jz paranoid_swapgs\trace ++ movq %rsp,%rdi /* &pt_regs */ ++ call sync_regs ++ movq %rax,%rsp /* switch stack for scheduling */ ++ testl $_TIF_NEED_RESCHED,%ebx ++ jnz paranoid_schedule\trace ++ movl %ebx,%edx /* arg3: thread flags */ ++ .if \trace ++ TRACE_IRQS_ON ++ .endif ++ sti ++ xorl %esi,%esi /* arg2: oldset */ ++ movq %rsp,%rdi /* arg1: &pt_regs */ ++ call do_notify_resume ++ cli ++ .if \trace ++ TRACE_IRQS_OFF ++ .endif ++ jmp paranoid_userspace\trace ++paranoid_schedule\trace: ++ .if \trace ++ TRACE_IRQS_ON ++ .endif ++ sti ++ call schedule ++ cli ++ .if \trace ++ TRACE_IRQS_OFF ++ .endif ++ jmp paranoid_userspace\trace ++ CFI_ENDPROC ++ .endm ++#endif ++ ++/* ++ * Exception entry point. This expects an error code/orig_rax on the stack ++ * and the exception handler in %rax. ++ */ ++KPROBE_ENTRY(error_entry) ++ _frame RDI ++ CFI_REL_OFFSET rax,0 ++ /* rdi slot contains rax, oldrax contains error code */ ++ cld ++ subq $14*8,%rsp ++ CFI_ADJUST_CFA_OFFSET (14*8) ++ movq %rsi,13*8(%rsp) ++ CFI_REL_OFFSET rsi,RSI ++ movq 14*8(%rsp),%rsi /* load rax from rdi slot */ ++ CFI_REGISTER rax,rsi ++ movq %rdx,12*8(%rsp) ++ CFI_REL_OFFSET rdx,RDX ++ movq %rcx,11*8(%rsp) ++ CFI_REL_OFFSET rcx,RCX ++ movq %rsi,10*8(%rsp) /* store rax */ ++ CFI_REL_OFFSET rax,RAX ++ movq %r8, 9*8(%rsp) ++ CFI_REL_OFFSET r8,R8 ++ movq %r9, 8*8(%rsp) ++ CFI_REL_OFFSET r9,R9 ++ movq %r10,7*8(%rsp) ++ CFI_REL_OFFSET r10,R10 ++ movq %r11,6*8(%rsp) ++ CFI_REL_OFFSET r11,R11 ++ movq %rbx,5*8(%rsp) ++ CFI_REL_OFFSET rbx,RBX ++ movq %rbp,4*8(%rsp) ++ CFI_REL_OFFSET rbp,RBP ++ movq %r12,3*8(%rsp) ++ CFI_REL_OFFSET r12,R12 ++ movq %r13,2*8(%rsp) ++ CFI_REL_OFFSET r13,R13 ++ movq %r14,1*8(%rsp) ++ CFI_REL_OFFSET r14,R14 ++ movq %r15,(%rsp) ++ CFI_REL_OFFSET r15,R15 ++#if 0 ++ cmpl $__KERNEL_CS,CS(%rsp) ++ CFI_REMEMBER_STATE ++ je error_kernelspace ++#endif ++error_call_handler: ++ movq %rdi, RDI(%rsp) ++ CFI_REL_OFFSET rdi,RDI ++ movq %rsp,%rdi ++ movq ORIG_RAX(%rsp),%rsi # get error code ++ movq $-1,ORIG_RAX(%rsp) ++ call *%rax ++error_exit: ++ RESTORE_REST ++/* cli */ ++ XEN_BLOCK_EVENTS(%rsi) ++ TRACE_IRQS_OFF ++ GET_THREAD_INFO(%rcx) ++ testb $3,CS-ARGOFFSET(%rsp) ++ jz retint_kernel ++ LOCKDEP_SYS_EXIT_IRQ ++ movl threadinfo_flags(%rcx),%edx ++ movl $_TIF_WORK_MASK,%edi ++ andl %edi,%edx ++ jnz retint_careful ++ jmp retint_restore_args ++ ++#if 0 ++ /* ++ * We need to re-write the logic here because we don't do iretq to ++ * to return to user mode. It's still possible that we get trap/fault ++ * in the kernel (when accessing buffers pointed to by system calls, ++ * for example). ++ * ++ */ ++ CFI_RESTORE_STATE ++error_kernelspace: ++ incl %ebx ++ /* There are two places in the kernel that can potentially fault with ++ usergs. Handle them here. The exception handlers after ++ iret run with kernel gs again, so don't set the user space flag. ++ B stepping K8s sometimes report an truncated RIP for IRET ++ exceptions returning to compat mode. Check for these here too. */ ++ leaq iret_label(%rip),%rbp ++ cmpq %rbp,RIP(%rsp) ++ je error_swapgs ++ movl %ebp,%ebp /* zero extend */ ++ cmpq %rbp,RIP(%rsp) ++ je error_swapgs ++ cmpq $gs_change,RIP(%rsp) ++ je error_swapgs ++ jmp error_sti ++#endif ++ CFI_ENDPROC ++KPROBE_END(error_entry) ++ ++ENTRY(hypervisor_callback) ++ zeroentry do_hypervisor_callback ++END(hypervisor_callback) ++ ++/* ++ * Copied from arch/xen/i386/kernel/entry.S ++ */ ++# A note on the "critical region" in our callback handler. ++# We want to avoid stacking callback handlers due to events occurring ++# during handling of the last event. To do this, we keep events disabled ++# until we've done all processing. HOWEVER, we must enable events before ++# popping the stack frame (can't be done atomically) and so it would still ++# be possible to get enough handler activations to overflow the stack. ++# Although unlikely, bugs of that kind are hard to track down, so we'd ++# like to avoid the possibility. ++# So, on entry to the handler we detect whether we interrupted an ++# existing activation in its critical region -- if so, we pop the current ++# activation and restart the handler using the previous one. ++ENTRY(do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs) ++ CFI_STARTPROC ++# Since we don't modify %rdi, evtchn_do_upall(struct *pt_regs) will ++# see the correct pointer to the pt_regs ++ movq %rdi, %rsp # we don't return, adjust the stack frame ++ CFI_ENDPROC ++ CFI_DEFAULT_STACK ++11: incl %gs:pda_irqcount ++ movq %rsp,%rbp ++ CFI_DEF_CFA_REGISTER rbp ++ cmovzq %gs:pda_irqstackptr,%rsp ++ pushq %rbp # backlink for old unwinder ++ call evtchn_do_upcall ++ popq %rsp ++ CFI_DEF_CFA_REGISTER rsp ++ decl %gs:pda_irqcount ++ jmp error_exit ++ CFI_ENDPROC ++END(do_hypervisor_callback) ++ ++ ALIGN ++restore_all_enable_events: ++ CFI_DEFAULT_STACK adj=1 ++ TRACE_IRQS_ON ++ XEN_UNBLOCK_EVENTS(%rsi) # %rsi is already set up... ++ ++scrit: /**** START OF CRITICAL REGION ****/ ++ XEN_TEST_PENDING(%rsi) ++ CFI_REMEMBER_STATE ++ jnz 14f # process more events if necessary... ++ XEN_PUT_VCPU_INFO(%rsi) ++ RESTORE_ARGS 0,8,0 ++ HYPERVISOR_IRET 0 ++ ++ CFI_RESTORE_STATE ++14: XEN_LOCKED_BLOCK_EVENTS(%rsi) ++ XEN_PUT_VCPU_INFO(%rsi) ++ SAVE_REST ++ movq %rsp,%rdi # set the argument again ++ jmp 11b ++ CFI_ENDPROC ++ecrit: /**** END OF CRITICAL REGION ****/ ++# At this point, unlike on x86-32, we don't do the fixup to simplify the ++# code and the stack frame is more complex on x86-64. ++# When the kernel is interrupted in the critical section, the kernel ++# will do IRET in that case, and everything will be restored at that point, ++# i.e. it just resumes from the next instruction interrupted with the same context. ++ ++# Hypervisor uses this for application faults while it executes. ++# We get here for two reasons: ++# 1. Fault while reloading DS, ES, FS or GS ++# 2. Fault while executing IRET ++# Category 1 we do not need to fix up as Xen has already reloaded all segment ++# registers that could be reloaded and zeroed the others. ++# Category 2 we fix up by killing the current process. We cannot use the ++# normal Linux return path in this case because if we use the IRET hypercall ++# to pop the stack frame we end up in an infinite loop of failsafe callbacks. ++# We distinguish between categories by comparing each saved segment register ++# with its current contents: any discrepancy means we in category 1. ++ENTRY(failsafe_callback) ++ _frame (RIP-0x30) ++ CFI_REL_OFFSET rcx, 0 ++ CFI_REL_OFFSET r11, 8 ++ movw %ds,%cx ++ cmpw %cx,0x10(%rsp) ++ CFI_REMEMBER_STATE ++ jne 1f ++ movw %es,%cx ++ cmpw %cx,0x18(%rsp) ++ jne 1f ++ movw %fs,%cx ++ cmpw %cx,0x20(%rsp) ++ jne 1f ++ movw %gs,%cx ++ cmpw %cx,0x28(%rsp) ++ jne 1f ++ /* All segments match their saved values => Category 2 (Bad IRET). */ ++ movq (%rsp),%rcx ++ CFI_RESTORE rcx ++ movq 8(%rsp),%r11 ++ CFI_RESTORE r11 ++ addq $0x30,%rsp ++ CFI_ADJUST_CFA_OFFSET -0x30 ++ movq $11,%rdi /* SIGSEGV */ ++ jmp do_exit ++ CFI_RESTORE_STATE ++1: /* Segment mismatch => Category 1 (Bad segment). Retry the IRET. */ ++ movq (%rsp),%rcx ++ CFI_RESTORE rcx ++ movq 8(%rsp),%r11 ++ CFI_RESTORE r11 ++ addq $0x30,%rsp ++ CFI_ADJUST_CFA_OFFSET -0x30 ++ pushq $0 ++ CFI_ADJUST_CFA_OFFSET 8 ++ SAVE_ALL ++ jmp error_exit ++ CFI_ENDPROC ++#if 0 ++ .section __ex_table,"a" ++ .align 8 ++ .quad gs_change,bad_gs ++ .previous ++ .section .fixup,"ax" ++ /* running with kernelgs */ ++bad_gs: ++/* swapgs */ /* switch back to user gs */ ++ xorl %eax,%eax ++ movl %eax,%gs ++ jmp 2b ++ .previous ++#endif ++ ++/* ++ * Create a kernel thread. ++ * ++ * C extern interface: ++ * extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++ * ++ * asm input arguments: ++ * rdi: fn, rsi: arg, rdx: flags ++ */ ++ENTRY(kernel_thread) ++ CFI_STARTPROC ++ FAKE_STACK_FRAME $child_rip ++ SAVE_ALL ++ ++ # rdi: flags, rsi: usp, rdx: will be &pt_regs ++ movq %rdx,%rdi ++ orq kernel_thread_flags(%rip),%rdi ++ movq $-1, %rsi ++ movq %rsp, %rdx ++ ++ xorl %r8d,%r8d ++ xorl %r9d,%r9d ++ ++ # clone now ++ call do_fork ++ movq %rax,RAX(%rsp) ++ xorl %edi,%edi ++ ++ /* ++ * It isn't worth to check for reschedule here, ++ * so internally to the x86_64 port you can rely on kernel_thread() ++ * not to reschedule the child before returning, this avoids the need ++ * of hacks for example to fork off the per-CPU idle tasks. ++ * [Hopefully no generic code relies on the reschedule -AK] ++ */ ++ RESTORE_ALL ++ UNFAKE_STACK_FRAME ++ ret ++ CFI_ENDPROC ++ENDPROC(kernel_thread) ++ ++child_rip: ++ pushq $0 # fake return address ++ CFI_STARTPROC ++ /* ++ * Here we are in the child and the registers are set as they were ++ * at kernel_thread() invocation in the parent. ++ */ ++ movq %rdi, %rax ++ movq %rsi, %rdi ++ call *%rax ++ # exit ++ mov %eax, %edi ++ call do_exit ++ CFI_ENDPROC ++ENDPROC(child_rip) ++ ++/* ++ * execve(). This function needs to use IRET, not SYSRET, to set up all state properly. ++ * ++ * C extern interface: ++ * extern long execve(char *name, char **argv, char **envp) ++ * ++ * asm input arguments: ++ * rdi: name, rsi: argv, rdx: envp ++ * ++ * We want to fallback into: ++ * extern long sys_execve(char *name, char **argv,char **envp, struct pt_regs regs) ++ * ++ * do_sys_execve asm fallback arguments: ++ * rdi: name, rsi: argv, rdx: envp, fake frame on the stack ++ */ ++ENTRY(kernel_execve) ++ CFI_STARTPROC ++ FAKE_STACK_FRAME $0 ++ SAVE_ALL ++ call sys_execve ++ movq %rax, RAX(%rsp) ++ RESTORE_REST ++ testq %rax,%rax ++ jne 1f ++ jmp int_ret_from_sys_call ++1: RESTORE_ARGS ++ UNFAKE_STACK_FRAME ++ ret ++ CFI_ENDPROC ++ENDPROC(kernel_execve) ++ ++KPROBE_ENTRY(page_fault) ++ errorentry do_page_fault ++KPROBE_END(page_fault) ++ ++ENTRY(coprocessor_error) ++ zeroentry do_coprocessor_error ++END(coprocessor_error) ++ ++ENTRY(simd_coprocessor_error) ++ zeroentry do_simd_coprocessor_error ++END(simd_coprocessor_error) ++ ++ENTRY(device_not_available) ++ zeroentry math_state_restore ++END(device_not_available) ++ ++ /* runs on exception stack */ ++KPROBE_ENTRY(debug) ++/* INTR_FRAME ++ pushq $0 ++ CFI_ADJUST_CFA_OFFSET 8 */ ++ zeroentry do_debug ++/* paranoidexit ++ CFI_ENDPROC */ ++KPROBE_END(debug) ++ ++KPROBE_ENTRY(nmi) ++ zeroentry do_nmi_callback ++KPROBE_END(nmi) ++do_nmi_callback: ++ CFI_STARTPROC ++ addq $8, %rsp ++ CFI_ENDPROC ++ CFI_DEFAULT_STACK ++ call do_nmi ++ orl $NMI_MASK,EFLAGS(%rsp) ++ RESTORE_REST ++ XEN_BLOCK_EVENTS(%rsi) ++ TRACE_IRQS_OFF ++ GET_THREAD_INFO(%rcx) ++ jmp retint_restore_args ++ CFI_ENDPROC ++END(do_nmi_callback) ++ ++KPROBE_ENTRY(int3) ++/* INTR_FRAME ++ pushq $0 ++ CFI_ADJUST_CFA_OFFSET 8 */ ++ zeroentry do_int3 ++/* jmp paranoid_exit1 ++ CFI_ENDPROC */ ++KPROBE_END(int3) ++ ++ENTRY(overflow) ++ zeroentry do_overflow ++END(overflow) ++ ++ENTRY(bounds) ++ zeroentry do_bounds ++END(bounds) ++ ++ENTRY(invalid_op) ++ zeroentry do_invalid_op ++END(invalid_op) ++ ++ENTRY(coprocessor_segment_overrun) ++ zeroentry do_coprocessor_segment_overrun ++END(coprocessor_segment_overrun) ++ ++ENTRY(reserved) ++ zeroentry do_reserved ++END(reserved) ++ ++#if 0 ++ /* runs on exception stack */ ++ENTRY(double_fault) ++ XCPT_FRAME ++ paranoidentry do_double_fault ++ jmp paranoid_exit1 ++ CFI_ENDPROC ++END(double_fault) ++#endif ++ ++ENTRY(invalid_TSS) ++ errorentry do_invalid_TSS ++END(invalid_TSS) ++ ++ENTRY(segment_not_present) ++ errorentry do_segment_not_present ++END(segment_not_present) ++ ++ /* runs on exception stack */ ++ENTRY(stack_segment) ++/* XCPT_FRAME ++ paranoidentry do_stack_segment */ ++ errorentry do_stack_segment ++/* jmp paranoid_exit1 ++ CFI_ENDPROC */ ++END(stack_segment) ++ ++KPROBE_ENTRY(general_protection) ++ errorentry do_general_protection ++KPROBE_END(general_protection) ++ ++ENTRY(alignment_check) ++ errorentry do_alignment_check ++END(alignment_check) ++ ++ENTRY(divide_error) ++ zeroentry do_divide_error ++END(divide_error) ++ ++ENTRY(spurious_interrupt_bug) ++ zeroentry do_spurious_interrupt_bug ++END(spurious_interrupt_bug) ++ ++#ifdef CONFIG_X86_MCE ++ /* runs on exception stack */ ++ENTRY(machine_check) ++ INTR_FRAME ++ pushq $0 ++ CFI_ADJUST_CFA_OFFSET 8 ++ paranoidentry do_machine_check ++ jmp paranoid_exit1 ++ CFI_ENDPROC ++END(machine_check) ++#endif ++ ++/* Call softirq on interrupt stack. Interrupts are off. */ ++ENTRY(call_softirq) ++ CFI_STARTPROC ++ push %rbp ++ CFI_ADJUST_CFA_OFFSET 8 ++ CFI_REL_OFFSET rbp,0 ++ mov %rsp,%rbp ++ CFI_DEF_CFA_REGISTER rbp ++ incl %gs:pda_irqcount ++ cmove %gs:pda_irqstackptr,%rsp ++ push %rbp # backlink for old unwinder ++ call __do_softirq ++ leaveq ++ CFI_DEF_CFA_REGISTER rsp ++ CFI_ADJUST_CFA_OFFSET -8 ++ decl %gs:pda_irqcount ++ ret ++ CFI_ENDPROC ++ENDPROC(call_softirq) ++ ++KPROBE_ENTRY(ignore_sysret) ++ CFI_STARTPROC ++ mov $-ENOSYS,%eax ++ HYPERVISOR_IRET 0 ++ CFI_ENDPROC ++ENDPROC(ignore_sysret) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/fixup.c debian/binary-custom.d/xen/src/arch/x86/kernel/fixup.c +--- ./arch/x86/kernel/fixup.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/fixup.c 2012-11-13 15:20:17.292568998 +0000 +@@ -0,0 +1,88 @@ ++/****************************************************************************** ++ * fixup.c ++ * ++ * Binary-rewriting of certain IA32 instructions, on notification by Xen. ++ * Used to avoid repeated slow emulation of common instructions used by the ++ * user-space TLS (Thread-Local Storage) libraries. ++ * ++ * **** NOTE **** ++ * Issues with the binary rewriting have caused it to be removed. Instead ++ * we rely on Xen's emulator to boot the kernel, and then print a banner ++ * message recommending that the user disables /lib/tls. ++ * ++ * Copyright (c) 2004, K A Fraser ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define DP(_f, _args...) printk(KERN_ALERT " " _f "\n" , ## _args ) ++ ++fastcall void do_fixup_4gb_segment(struct pt_regs *regs, long error_code) ++{ ++ static unsigned long printed = 0; ++ char info[100]; ++ int i; ++ ++ /* Ignore statically-linked init. */ ++ if (current->tgid == 1) ++ return; ++ ++ HYPERVISOR_vm_assist( ++ VMASST_CMD_disable, VMASST_TYPE_4gb_segments_notify); ++ ++ if (test_and_set_bit(0, &printed)) ++ return; ++ ++ sprintf(info, "%s (pid=%d)", current->comm, current->tgid); ++ ++ DP(""); ++ DP("***************************************************************"); ++ DP("***************************************************************"); ++ DP("** WARNING: Currently emulating unsupported memory accesses **"); ++ DP("** in /lib/tls glibc libraries. The emulation is **"); ++ DP("** slow. To ensure full performance you should **"); ++ DP("** install a 'xen-friendly' (nosegneg) version of **"); ++ DP("** the library, or disable tls support by executing **"); ++ DP("** the following as root: **"); ++ DP("** mv /lib/tls /lib/tls.disabled **"); ++ DP("** Offending process: %-38.38s **", info); ++ DP("***************************************************************"); ++ DP("***************************************************************"); ++ DP(""); ++ ++ for (i = 5; i > 0; i--) { ++ touch_softlockup_watchdog(); ++ printk("Pausing... %d", i); ++ mdelay(1000); ++ printk("\b\b\b\b\b\b\b\b\b\b\b\b"); ++ } ++ ++ printk("Continuing...\n\n"); ++} ++ ++static int __init fixup_init(void) ++{ ++ HYPERVISOR_vm_assist( ++ VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify); ++ return 0; ++} ++__initcall(fixup_init); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/genapic_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/genapic_64-xen.c +--- ./arch/x86/kernel/genapic_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/genapic_64-xen.c 2012-11-13 15:20:17.292568998 +0000 +@@ -0,0 +1,93 @@ ++/* ++ * Copyright 2004 James Cleverdon, IBM. ++ * Subject to the GNU Public License, v.2 ++ * ++ * Generic APIC sub-arch probe layer. ++ * ++ * Hacked for x86-64 by James Cleverdon from i386 architecture code by ++ * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and ++ * James Cleverdon. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#ifdef CONFIG_ACPI ++#include ++#endif ++ ++/* ++ * which logical CPU number maps to which CPU (physical APIC ID) ++ * ++ * The following static array is used during kernel startup ++ * and the x86_cpu_to_apicid_ptr contains the address of the ++ * array during this time. Is it zeroed when the per_cpu ++ * data area is removed. ++ */ ++#ifndef CONFIG_XEN ++u8 x86_cpu_to_apicid_init[NR_CPUS] __initdata ++ = { [0 ... NR_CPUS-1] = BAD_APICID }; ++void *x86_cpu_to_apicid_ptr; ++#endif ++DEFINE_PER_CPU(u8, x86_cpu_to_apicid) = BAD_APICID; ++EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); ++ ++#ifndef CONFIG_XEN ++struct genapic __read_mostly *genapic = &apic_flat; ++#else ++extern struct genapic apic_xen; ++struct genapic __read_mostly *genapic = &apic_xen; ++#endif ++ ++ ++/* ++ * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode. ++ */ ++void __init setup_apic_routing(void) ++{ ++#ifndef CONFIG_XEN ++#ifdef CONFIG_ACPI ++ /* ++ * Quirk: some x86_64 machines can only use physical APIC mode ++ * regardless of how many processors are present (x86_64 ES7000 ++ * is an example). ++ */ ++ if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID && ++ (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) ++ genapic = &apic_physflat; ++ else ++#endif ++ ++ if (cpus_weight(cpu_possible_map) <= 8) ++ genapic = &apic_flat; ++ else ++ genapic = &apic_physflat; ++ ++#else ++ /* hardcode to xen apic functions */ ++ genapic = &apic_xen; ++#endif ++ printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name); ++} ++ ++/* Same for both flat and physical. */ ++ ++#ifdef CONFIG_XEN ++extern void xen_send_IPI_shortcut(unsigned int shortcut, int vector); ++#endif ++ ++void send_IPI_self(int vector) ++{ ++#ifndef CONFIG_XEN ++ __send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL); ++#else ++ xen_send_IPI_shortcut(APIC_DEST_SELF, vector); ++#endif ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/genapic_xen_64.c debian/binary-custom.d/xen/src/arch/x86/kernel/genapic_xen_64.c +--- ./arch/x86/kernel/genapic_xen_64.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/genapic_xen_64.c 2012-11-13 15:20:17.296569000 +0000 +@@ -0,0 +1,166 @@ ++/* ++ * Copyright 2004 James Cleverdon, IBM. ++ * Subject to the GNU Public License, v.2 ++ * ++ * Xen APIC subarch code. Maximum 8 CPUs, logical delivery. ++ * ++ * Hacked for x86-64 by James Cleverdon from i386 architecture code by ++ * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and ++ * James Cleverdon. ++ * ++ * Hacked to pieces for Xen by Chris Wright. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_XEN_PRIVILEGED_GUEST ++#include ++#else ++#include ++#endif ++#include ++#include ++ ++DECLARE_PER_CPU(int, ipi_to_irq[NR_IPIS]); ++ ++static inline void __send_IPI_one(unsigned int cpu, int vector) ++{ ++ int irq = per_cpu(ipi_to_irq, cpu)[vector]; ++ BUG_ON(irq < 0); ++ notify_remote_via_irq(irq); ++} ++ ++void xen_send_IPI_shortcut(unsigned int shortcut, int vector) ++{ ++ int cpu; ++ ++ switch (shortcut) { ++ case APIC_DEST_SELF: ++ __send_IPI_one(smp_processor_id(), vector); ++ break; ++ case APIC_DEST_ALLBUT: ++ for (cpu = 0; cpu < NR_CPUS; ++cpu) { ++ if (cpu == smp_processor_id()) ++ continue; ++ if (cpu_isset(cpu, cpu_online_map)) { ++ __send_IPI_one(cpu, vector); ++ } ++ } ++ break; ++ case APIC_DEST_ALLINC: ++ for (cpu = 0; cpu < NR_CPUS; ++cpu) { ++ if (cpu_isset(cpu, cpu_online_map)) { ++ __send_IPI_one(cpu, vector); ++ } ++ } ++ break; ++ default: ++ printk("XXXXXX __send_IPI_shortcut %08x vector %d\n", shortcut, ++ vector); ++ break; ++ } ++} ++ ++static cpumask_t xen_target_cpus(void) ++{ ++ return cpu_online_map; ++} ++ ++static cpumask_t xen_vector_allocation_domain(int cpu) ++{ ++ cpumask_t domain = CPU_MASK_NONE; ++ cpu_set(cpu, domain); ++ return domain; ++} ++ ++/* ++ * Set up the logical destination ID. ++ * Do nothing, not called now. ++ */ ++static void xen_init_apic_ldr(void) ++{ ++ Dprintk("%s\n", __FUNCTION__); ++ return; ++} ++ ++static void xen_send_IPI_allbutself(int vector) ++{ ++ /* ++ * if there are no other CPUs in the system then ++ * we get an APIC send error if we try to broadcast. ++ * thus we have to avoid sending IPIs in this case. ++ */ ++ Dprintk("%s\n", __FUNCTION__); ++ if (num_online_cpus() > 1) ++ xen_send_IPI_shortcut(APIC_DEST_ALLBUT, vector); ++} ++ ++static void xen_send_IPI_all(int vector) ++{ ++ Dprintk("%s\n", __FUNCTION__); ++ xen_send_IPI_shortcut(APIC_DEST_ALLINC, vector); ++} ++ ++static void xen_send_IPI_mask(cpumask_t cpumask, int vector) ++{ ++ unsigned long mask = cpus_addr(cpumask)[0]; ++ unsigned int cpu; ++ unsigned long flags; ++ ++ Dprintk("%s\n", __FUNCTION__); ++ local_irq_save(flags); ++ WARN_ON(mask & ~cpus_addr(cpu_online_map)[0]); ++ ++ for (cpu = 0; cpu < NR_CPUS; ++cpu) { ++ if (cpu_isset(cpu, cpumask)) { ++ __send_IPI_one(cpu, vector); ++ } ++ } ++ local_irq_restore(flags); ++} ++ ++#ifdef CONFIG_XEN_PRIVILEGED_GUEST ++static int xen_apic_id_registered(void) ++{ ++ /* better be set */ ++ Dprintk("%s\n", __FUNCTION__); ++ return physid_isset(smp_processor_id(), phys_cpu_present_map); ++} ++#endif ++ ++static unsigned int xen_cpu_mask_to_apicid(cpumask_t cpumask) ++{ ++ Dprintk("%s\n", __FUNCTION__); ++ return cpus_addr(cpumask)[0] & APIC_ALL_CPUS; ++} ++ ++static unsigned int phys_pkg_id(int index_msb) ++{ ++ u32 ebx; ++ ++ Dprintk("%s\n", __FUNCTION__); ++ ebx = cpuid_ebx(1); ++ return ((ebx >> 24) & 0xFF) >> index_msb; ++} ++ ++struct genapic apic_xen = { ++ .name = "xen", ++#ifdef CONFIG_XEN_PRIVILEGED_GUEST ++ .int_delivery_mode = dest_LowestPrio, ++#endif ++ .int_dest_mode = 1, ++ .target_cpus = xen_target_cpus, ++ .vector_allocation_domain = xen_vector_allocation_domain, ++#ifdef CONFIG_XEN_PRIVILEGED_GUEST ++ .apic_id_registered = xen_apic_id_registered, ++#endif ++ .init_apic_ldr = xen_init_apic_ldr, ++ .send_IPI_all = xen_send_IPI_all, ++ .send_IPI_allbutself = xen_send_IPI_allbutself, ++ .send_IPI_mask = xen_send_IPI_mask, ++ .cpu_mask_to_apicid = xen_cpu_mask_to_apicid, ++ .phys_pkg_id = phys_pkg_id, ++}; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/head64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/head64-xen.c +--- ./arch/x86/kernel/head64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/head64-xen.c 2012-11-13 15:20:17.296569000 +0000 +@@ -0,0 +1,119 @@ ++/* ++ * prepare to run common code ++ * ++ * Copyright (C) 2000 Andrea Arcangeli SuSE ++ * ++ * Jun Nakajima ++ * Modified for Xen. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++unsigned long start_pfn; ++ ++#ifndef CONFIG_XEN ++static void __init zap_identity_mappings(void) ++{ ++ pgd_t *pgd = pgd_offset_k(0UL); ++ pgd_clear(pgd); ++ __flush_tlb(); ++} ++ ++/* Don't add a printk in there. printk relies on the PDA which is not initialized ++ yet. */ ++static void __init clear_bss(void) ++{ ++ memset(__bss_start, 0, ++ (unsigned long) __bss_stop - (unsigned long) __bss_start); ++} ++#endif ++ ++static void __init copy_bootdata(char *real_mode_data) ++{ ++#ifndef CONFIG_XEN ++ char * command_line; ++ ++ memcpy(&boot_params, real_mode_data, sizeof boot_params); ++ if (boot_params.hdr.cmd_line_ptr) { ++ command_line = __va(boot_params.hdr.cmd_line_ptr); ++ memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); ++ } ++#else ++ int max_cmdline; ++ ++ if ((max_cmdline = MAX_GUEST_CMDLINE) > COMMAND_LINE_SIZE) ++ max_cmdline = COMMAND_LINE_SIZE; ++ memcpy(boot_command_line, xen_start_info->cmd_line, max_cmdline); ++ boot_command_line[max_cmdline-1] = '\0'; ++#endif ++} ++ ++#include ++unsigned long *machine_to_phys_mapping; ++EXPORT_SYMBOL(machine_to_phys_mapping); ++unsigned int machine_to_phys_order; ++EXPORT_SYMBOL(machine_to_phys_order); ++ ++void __init x86_64_start_kernel(char * real_mode_data) ++{ ++ struct xen_machphys_mapping mapping; ++ unsigned long machine_to_phys_nr_ents; ++ int i; ++ ++ xen_setup_features(); ++ ++ xen_start_info = (struct start_info *)real_mode_data; ++ if (!xen_feature(XENFEAT_auto_translated_physmap)) ++ phys_to_machine_mapping = ++ (unsigned long *)xen_start_info->mfn_list; ++ start_pfn = (__pa(xen_start_info->pt_base) >> PAGE_SHIFT) + ++ xen_start_info->nr_pt_frames; ++ ++ machine_to_phys_mapping = (unsigned long *)MACH2PHYS_VIRT_START; ++ machine_to_phys_nr_ents = MACH2PHYS_NR_ENTRIES; ++ if (HYPERVISOR_memory_op(XENMEM_machphys_mapping, &mapping) == 0) { ++ machine_to_phys_mapping = (unsigned long *)mapping.v_start; ++ machine_to_phys_nr_ents = mapping.max_mfn + 1; ++ } ++ while ((1UL << machine_to_phys_order) < machine_to_phys_nr_ents ) ++ machine_to_phys_order++; ++ ++#ifndef CONFIG_XEN ++ /* clear bss before set_intr_gate with early_idt_handler */ ++ clear_bss(); ++ ++ /* Make NULL pointers segfault */ ++ zap_identity_mappings(); ++ ++ for (i = 0; i < IDT_ENTRIES; i++) ++ set_intr_gate(i, early_idt_handler); ++ load_idt((const struct desc_ptr *)&idt_descr); ++#endif ++ ++ early_printk("Kernel alive\n"); ++ ++ for (i = 0; i < NR_CPUS; i++) ++ cpu_pda(i) = &boot_cpu_pda[i]; ++ ++ pda_init(0); ++ copy_bootdata(__va(real_mode_data)); ++#ifdef CONFIG_SMP ++ cpu_set(0, cpu_online_map); ++#endif ++ start_kernel(); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/head_32-xen.S debian/binary-custom.d/xen/src/arch/x86/kernel/head_32-xen.S +--- ./arch/x86/kernel/head_32-xen.S 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/head_32-xen.S 2012-11-13 15:20:17.296569000 +0000 +@@ -0,0 +1,163 @@ ++ ++ ++.text ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * References to members of the new_cpu_data structure. ++ */ ++ ++#define X86 new_cpu_data+CPUINFO_x86 ++#define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor ++#define X86_MODEL new_cpu_data+CPUINFO_x86_model ++#define X86_MASK new_cpu_data+CPUINFO_x86_mask ++#define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math ++#define X86_CPUID new_cpu_data+CPUINFO_cpuid_level ++#define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability ++#define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id ++ ++.section .text.head,"ax",@progbits ++#define VIRT_ENTRY_OFFSET 0x0 ++.org VIRT_ENTRY_OFFSET ++ENTRY(startup_32) ++ movl %esi,xen_start_info ++ cld ++ ++ /* Set up the stack pointer */ ++ movl $(init_thread_union+THREAD_SIZE),%esp ++ ++ movl %ss,%eax ++ movl %eax,%fs # gets reset once there's real percpu ++ ++ /* get vendor info */ ++ xorl %eax,%eax # call CPUID with 0 -> return vendor ID ++ XEN_CPUID ++ movl %eax,X86_CPUID # save CPUID level ++ movl %ebx,X86_VENDOR_ID # lo 4 chars ++ movl %edx,X86_VENDOR_ID+4 # next 4 chars ++ movl %ecx,X86_VENDOR_ID+8 # last 4 chars ++ ++ movl $1,%eax # Use the CPUID instruction to get CPU type ++ XEN_CPUID ++ movb %al,%cl # save reg for future use ++ andb $0x0f,%ah # mask processor family ++ movb %ah,X86 ++ andb $0xf0,%al # mask model ++ shrb $4,%al ++ movb %al,X86_MODEL ++ andb $0x0f,%cl # mask mask revision ++ movb %cl,X86_MASK ++ movl %edx,X86_CAPABILITY ++ ++ movb $1,X86_HARD_MATH ++ ++ xorl %eax,%eax # Clear GS ++ movl %eax,%gs ++ ++ cld # gcc2 wants the direction flag cleared at all times ++ ++ pushl $0 # fake return address for unwinder ++ jmp start_kernel ++ ++#define HYPERCALL_PAGE_OFFSET 0x1000 ++.org HYPERCALL_PAGE_OFFSET ++ENTRY(hypercall_page) ++ CFI_STARTPROC ++.skip 0x1000 ++ CFI_ENDPROC ++ ++/* ++ * Real beginning of normal "text" segment ++ */ ++ENTRY(stext) ++ENTRY(_stext) ++ ++/* ++ * BSS section ++ */ ++.section ".bss.page_aligned","wa" ++ .align PAGE_SIZE_asm ++ENTRY(swapper_pg_pmd) ++ .fill 1024,4,0 ++ENTRY(empty_zero_page) ++ .fill 4096,1,0 ++ ++/* ++ * This starts the data section. ++ */ ++.data ++ ++#if CONFIG_XEN_COMPAT <= 0x030002 ++/* ++ * __xen_guest information ++ */ ++.macro utoa value ++ .if (\value) < 0 || (\value) >= 0x10 ++ utoa (((\value)>>4)&0x0fffffff) ++ .endif ++ .if ((\value) & 0xf) < 10 ++ .byte '0' + ((\value) & 0xf) ++ .else ++ .byte 'A' + ((\value) & 0xf) - 10 ++ .endif ++.endm ++ ++.section __xen_guest ++ .ascii "GUEST_OS=linux,GUEST_VER=2.6" ++ .ascii ",XEN_VER=xen-3.0" ++ .ascii ",VIRT_BASE=0x" ++ utoa __PAGE_OFFSET ++ .ascii ",ELF_PADDR_OFFSET=0x" ++ utoa __PAGE_OFFSET ++ .ascii ",VIRT_ENTRY=0x" ++ utoa (__PAGE_OFFSET + LOAD_PHYSICAL_ADDR + VIRT_ENTRY_OFFSET) ++ .ascii ",HYPERCALL_PAGE=0x" ++ utoa ((LOAD_PHYSICAL_ADDR+HYPERCALL_PAGE_OFFSET)>>PAGE_SHIFT) ++ .ascii ",FEATURES=writable_page_tables" ++ .ascii "|writable_descriptor_tables" ++ .ascii "|auto_translated_physmap" ++ .ascii "|pae_pgdir_above_4gb" ++ .ascii "|supervisor_mode_kernel" ++#ifdef CONFIG_X86_PAE ++ .ascii ",PAE=yes[extended-cr3]" ++#else ++ .ascii ",PAE=no" ++#endif ++ .ascii ",LOADER=generic" ++ .byte 0 ++#endif /* CONFIG_XEN_COMPAT <= 0x030002 */ ++ ++ ++ ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux") ++ ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz "2.6") ++ ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0") ++ ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, .long __PAGE_OFFSET) ++#if CONFIG_XEN_COMPAT <= 0x030002 ++ ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .long __PAGE_OFFSET) ++#else ++ ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .long 0) ++#endif ++ ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, .long startup_32) ++ ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .long hypercall_page) ++ ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, .long HYPERVISOR_VIRT_START) ++ ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel") ++#ifdef CONFIG_X86_PAE ++ ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes") ++ ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID, .quad _PAGE_PRESENT, _PAGE_PRESENT) ++#else ++ ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "no") ++ ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID, .long _PAGE_PRESENT, _PAGE_PRESENT) ++#endif ++ ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic") ++ ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/head_64-xen.S debian/binary-custom.d/xen/src/arch/x86/kernel/head_64-xen.S +--- ./arch/x86/kernel/head_64-xen.S 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/head_64-xen.S 2012-11-13 15:20:17.296569000 +0000 +@@ -0,0 +1,211 @@ ++/* ++ * linux/arch/x86_64/kernel/head.S -- start in 32bit and switch to 64bit ++ * ++ * Copyright (C) 2000 Andrea Arcangeli SuSE ++ * Copyright (C) 2000 Pavel Machek ++ * Copyright (C) 2000 Karsten Keil ++ * Copyright (C) 2001,2002 Andi Kleen ++ * Copyright (C) 2005 Eric Biederman ++ * Jun Nakajima ++ * Modified for Xen ++ */ ++ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ .section .text.head, "ax", @progbits ++ .code64 ++ .globl startup_64 ++startup_64: ++ movq $(init_thread_union+THREAD_SIZE-8),%rsp ++ ++ /* rsi is pointer to startup info structure. ++ pass it to C */ ++ movq %rsi,%rdi ++ pushq $0 # fake return address ++ jmp x86_64_start_kernel ++ ++#ifdef CONFIG_ACPI_SLEEP ++.org 0xf00 ++ .globl pGDT32 ++pGDT32: ++ .word gdt_end-cpu_gdt_table-1 ++ .long cpu_gdt_table-__START_KERNEL_map ++#endif ++ ++.balign PAGE_SIZE ++ ++#define NEXT_PAGE(name) \ ++ .balign PAGE_SIZE; \ ++ phys_##name = . - .text.head; \ ++ENTRY(name) ++ ++NEXT_PAGE(init_level4_pgt) ++ .fill 512,8,0 ++ /* ++ * We update two pgd entries to make kernel and user pgd consistent ++ * at pgd_populate(). It can be used for kernel modules. So we place ++ * this page here for those cases to avoid memory corruption. ++ * We also use this page to establish the initial mapping for the ++ * vsyscall area. ++ */ ++ .fill 512,8,0 ++ ++NEXT_PAGE(level3_kernel_pgt) ++ .fill 512,8,0 ++ ++ /* ++ * This is used for vsyscall area mapping as we have a different ++ * level4 page table for user. ++ */ ++NEXT_PAGE(level3_user_pgt) ++ .fill 512,8,0 ++ ++NEXT_PAGE(level2_kernel_pgt) ++ .fill 512,8,0 ++ ++NEXT_PAGE(level2_fixmap_pgt) ++ .fill 512,8,0 ++ ++NEXT_PAGE(level1_fixmap_pgt) ++ .fill 512,8,0 ++ ++NEXT_PAGE(hypercall_page) ++ CFI_STARTPROC ++ .rept 0x1000 / 0x20 ++ .skip 1 /* push %rcx */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ CFI_REL_OFFSET rcx,0 ++ .skip 2 /* push %r11 */ ++ CFI_ADJUST_CFA_OFFSET 8 ++ CFI_REL_OFFSET rcx,0 ++ .skip 5 /* mov $#,%eax */ ++ .skip 2 /* syscall */ ++ .skip 2 /* pop %r11 */ ++ CFI_ADJUST_CFA_OFFSET -8 ++ CFI_RESTORE r11 ++ .skip 1 /* pop %rcx */ ++ CFI_ADJUST_CFA_OFFSET -8 ++ CFI_RESTORE rcx ++ .align 0x20,0 /* ret */ ++ .endr ++ CFI_ENDPROC ++ ++#undef NEXT_PAGE ++ ++ .data ++/* Just dummy symbol to allow compilation. Not used in sleep path */ ++#ifdef CONFIG_ACPI_SLEEP ++ .align PAGE_SIZE ++ENTRY(wakeup_level4_pgt) ++ .fill 512,8,0 ++#endif ++ ++ .data ++ ++ .align 16 ++ .globl cpu_gdt_descr ++cpu_gdt_descr: ++ .word gdt_end-cpu_gdt_table-1 ++gdt: ++ .quad cpu_gdt_table ++#ifdef CONFIG_SMP ++ .rept NR_CPUS-1 ++ .word 0 ++ .quad 0 ++ .endr ++#endif ++ ++/* We need valid kernel segments for data and code in long mode too ++ * IRET will check the segment types kkeil 2000/10/28 ++ * Also sysret mandates a special GDT layout ++ */ ++ ++ .section .data.page_aligned, "aw" ++ .align PAGE_SIZE ++ ++/* The TLS descriptors are currently at a different place compared to i386. ++ Hopefully nobody expects them at a fixed place (Wine?) */ ++ ++ENTRY(cpu_gdt_table) ++ .quad 0x0000000000000000 /* NULL descriptor */ ++ .quad 0x00cf9b000000ffff /* __KERNEL32_CS */ ++ .quad 0x00af9b000000ffff /* __KERNEL_CS */ ++ .quad 0x00cf93000000ffff /* __KERNEL_DS */ ++ .quad 0x00cffb000000ffff /* __USER32_CS */ ++ .quad 0x00cff3000000ffff /* __USER_DS, __USER32_DS */ ++ .quad 0x00affb000000ffff /* __USER_CS */ ++ .quad 0x0 /* unused */ ++ .quad 0,0 /* TSS */ ++ .quad 0,0 /* LDT */ ++ .quad 0,0,0 /* three TLS descriptors */ ++ .quad 0x0000f40000000000 /* node/CPU stored in limit */ ++gdt_end: ++ /* asm/segment.h:GDT_ENTRIES must match this */ ++ /* This should be a multiple of the cache line size */ ++ /* GDTs of other CPUs are now dynamically allocated */ ++ ++ /* zero the remaining page */ ++ .fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0 ++ ++ .section .bss.page_aligned, "aw", @nobits ++ .align PAGE_SIZE ++ENTRY(empty_zero_page) ++ .skip PAGE_SIZE ++ ++#if CONFIG_XEN_COMPAT <= 0x030002 ++/* ++ * __xen_guest information ++ */ ++.macro utoh value ++ i = 64 ++ .rept 16 ++ i = i - 4 ++ .byte '0' + ((((\value) >> i) & 0xf) > 9) * ('0' - 'A' + 10) + (((\value) >> i) & 0xf) ++ .endr ++.endm ++ ++.section __xen_guest ++ .ascii "GUEST_OS=linux,GUEST_VER=2.6" ++ .ascii ",XEN_VER=xen-3.0" ++ .ascii ",VIRT_BASE=0x" ++ utoh __START_KERNEL_map ++ .ascii ",ELF_PADDR_OFFSET=0x" ++ utoh __START_KERNEL_map ++ .ascii ",VIRT_ENTRY=0x" ++ utoh (__START_KERNEL_map + __PHYSICAL_START) ++ .ascii ",HYPERCALL_PAGE=0x" ++ utoh (phys_hypercall_page >> PAGE_SHIFT) ++ .ascii ",FEATURES=writable_page_tables" ++ .ascii "|writable_descriptor_tables" ++ .ascii "|auto_translated_physmap" ++ .ascii "|supervisor_mode_kernel" ++ .ascii ",LOADER=generic" ++ .byte 0 ++#endif /* CONFIG_XEN_COMPAT <= 0x030002 */ ++ ++ ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux") ++ ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz "2.6") ++ ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0") ++ ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, .quad __START_KERNEL_map) ++#if CONFIG_XEN_COMPAT <= 0x030002 ++ ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .quad __START_KERNEL_map) ++#else ++ ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .quad 0) ++#endif ++ ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, .quad startup_64) ++ ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad hypercall_page) ++ ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID, .quad _PAGE_PRESENT, _PAGE_PRESENT) ++ ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel") ++ ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic") ++ ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/init_task-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/init_task-xen.c +--- ./arch/x86/kernel/init_task-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/init_task-xen.c 2012-11-13 15:20:17.296569000 +0000 +@@ -0,0 +1,52 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++static struct fs_struct init_fs = INIT_FS; ++static struct files_struct init_files = INIT_FILES; ++static struct signal_struct init_signals = INIT_SIGNALS(init_signals); ++static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); ++#ifdef CONFIG_X86_XEN ++#define swapper_pg_dir ((pgd_t *)NULL) ++#endif ++struct mm_struct init_mm = INIT_MM(init_mm); ++#undef swapper_pg_dir ++EXPORT_SYMBOL(init_mm); ++ ++/* ++ * Initial thread structure. ++ * ++ * We need to make sure that this is THREAD_SIZE aligned due to the ++ * way process stacks are handled. This is done by having a special ++ * "init_task" linker map entry.. ++ */ ++union thread_union init_thread_union ++ __attribute__((__section__(".data.init_task"))) = ++ { INIT_THREAD_INFO(init_task) }; ++ ++/* ++ * Initial task structure. ++ * ++ * All other task structs will be allocated on slabs in fork.c ++ */ ++struct task_struct init_task = INIT_TASK(init_task); ++EXPORT_SYMBOL(init_task); ++ ++#ifndef CONFIG_X86_NO_TSS ++/* ++ * no more per-task TSS's. The TSS size is kept cacheline-aligned ++ * so they are allowed to end up in the .data.cacheline_aligned ++ * section. Since TSS's are completely CPU-local, we want them ++ * on exact cacheline boundaries, to eliminate cacheline ping-pong. ++ */ ++DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss) = INIT_TSS; ++#endif ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/init_task.c debian/binary-custom.d/xen/src/arch/x86/kernel/init_task.c +--- ./arch/x86/kernel/init_task.c 2012-06-12 16:25:11.606312932 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/init_task.c 2012-11-13 15:20:17.296569000 +0000 +@@ -36,6 +36,7 @@ + struct task_struct init_task = INIT_TASK(init_task); + EXPORT_SYMBOL(init_task); + ++ + /* + * per-CPU TSS segments. Threads are completely 'soft' on Linux, + * no more per-task TSS's. The TSS size is kept cacheline-aligned +@@ -44,4 +45,3 @@ + * on exact cacheline boundaries, to eliminate cacheline ping-pong. + */ + DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss) = INIT_TSS; +- +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/io_apic_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/io_apic_32-xen.c +--- ./arch/x86/kernel/io_apic_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/io_apic_32-xen.c 2012-11-13 15:20:17.300569001 +0000 +@@ -0,0 +1,2964 @@ ++/* ++ * Intel IO-APIC support for multi-Pentium hosts. ++ * ++ * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar, Hajnalka Szabo ++ * ++ * Many thanks to Stig Venaas for trying out countless experimental ++ * patches and reporting/debugging problems patiently! ++ * ++ * (c) 1999, Multiple IO-APIC support, developed by ++ * Ken-ichi Yaku and ++ * Hidemi Kishimoto , ++ * further tested and cleaned up by Zach Brown ++ * and Ingo Molnar ++ * ++ * Fixes ++ * Maciej W. Rozycki : Bits for genuine 82489DX APICs; ++ * thanks to Eric Gilmore ++ * and Rolf G. Tews ++ * for testing these extensively ++ * Paul Diefenbaugh : Added full ACPI support ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "io_ports.h" ++ ++#ifdef CONFIG_XEN ++#include ++#include ++ ++/* Fake i8259 */ ++#define make_8259A_irq(_irq) (io_apic_irqs &= ~(1UL<<(_irq))) ++#define disable_8259A_irq(_irq) ((void)0) ++#define i8259A_irq_pending(_irq) (0) ++ ++unsigned long io_apic_irqs; ++ ++#define clear_IO_APIC() ((void)0) ++#else ++int (*ioapic_renumber_irq)(int ioapic, int irq); ++atomic_t irq_mis_count; ++#endif /* CONFIG_XEN */ ++ ++/* Where if anywhere is the i8259 connect in external int mode */ ++static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; ++ ++static DEFINE_SPINLOCK(ioapic_lock); ++static DEFINE_SPINLOCK(vector_lock); ++ ++#ifndef CONFIG_XEN ++int timer_over_8254 __initdata = 1; ++#endif ++ ++/* ++ * Is the SiS APIC rmw bug present ? ++ * -1 = don't know, 0 = no, 1 = yes ++ */ ++int sis_apic_bug = -1; ++ ++/* ++ * # of IRQ routing registers ++ */ ++int nr_ioapic_registers[MAX_IO_APICS]; ++ ++#ifndef CONFIG_XEN ++static int disable_timer_pin_1 __initdata; ++#endif ++ ++/* ++ * Rough estimation of how many shared IRQs there are, can ++ * be changed anytime. ++ */ ++#define MAX_PLUS_SHARED_IRQS NR_IRQS ++#define PIN_MAP_SIZE (MAX_PLUS_SHARED_IRQS + NR_IRQS) ++ ++/* ++ * This is performance-critical, we want to do it O(1) ++ * ++ * the indexing order of this array favors 1:1 mappings ++ * between pins and IRQs. ++ */ ++ ++static struct irq_pin_list { ++ int apic, pin, next; ++} irq_2_pin[PIN_MAP_SIZE]; ++ ++#ifndef CONFIG_XEN ++struct io_apic { ++ unsigned int index; ++ unsigned int unused[3]; ++ unsigned int data; ++}; ++ ++static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx) ++{ ++ return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx) ++ + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK); ++} ++#endif ++ ++static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) ++{ ++#ifndef CONFIG_XEN ++ struct io_apic __iomem *io_apic = io_apic_base(apic); ++ writel(reg, &io_apic->index); ++ return readl(&io_apic->data); ++#else ++ struct physdev_apic apic_op; ++ int ret; ++ ++ apic_op.apic_physbase = mp_ioapics[apic].mpc_apicaddr; ++ apic_op.reg = reg; ++ ret = HYPERVISOR_physdev_op(PHYSDEVOP_apic_read, &apic_op); ++ if (ret) ++ return ret; ++ return apic_op.value; ++#endif ++} ++ ++static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) ++{ ++#ifndef CONFIG_XEN ++ struct io_apic __iomem *io_apic = io_apic_base(apic); ++ writel(reg, &io_apic->index); ++ writel(value, &io_apic->data); ++#else ++ struct physdev_apic apic_op; ++ ++ apic_op.apic_physbase = mp_ioapics[apic].mpc_apicaddr; ++ apic_op.reg = reg; ++ apic_op.value = value; ++ HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op); ++#endif ++} ++ ++#ifndef CONFIG_XEN ++/* ++ * Re-write a value: to be used for read-modify-write ++ * cycles where the read already set up the index register. ++ * ++ * Older SiS APIC requires we rewrite the index register ++ */ ++static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) ++{ ++ volatile struct io_apic __iomem *io_apic = io_apic_base(apic); ++ if (sis_apic_bug) ++ writel(reg, &io_apic->index); ++ writel(value, &io_apic->data); ++} ++#else ++#define io_apic_modify io_apic_write ++#endif ++ ++union entry_union { ++ struct { u32 w1, w2; }; ++ struct IO_APIC_route_entry entry; ++}; ++ ++static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) ++{ ++ union entry_union eu; ++ unsigned long flags; ++ spin_lock_irqsave(&ioapic_lock, flags); ++ eu.w1 = io_apic_read(apic, 0x10 + 2 * pin); ++ eu.w2 = io_apic_read(apic, 0x11 + 2 * pin); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ return eu.entry; ++} ++ ++/* ++ * When we write a new IO APIC routing entry, we need to write the high ++ * word first! If the mask bit in the low word is clear, we will enable ++ * the interrupt, and we need to make sure the entry is fully populated ++ * before that happens. ++ */ ++static void ++__ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) ++{ ++ union entry_union eu; ++ eu.entry = e; ++ io_apic_write(apic, 0x11 + 2*pin, eu.w2); ++ io_apic_write(apic, 0x10 + 2*pin, eu.w1); ++} ++ ++static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) ++{ ++ unsigned long flags; ++ spin_lock_irqsave(&ioapic_lock, flags); ++ __ioapic_write_entry(apic, pin, e); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++ ++#ifndef CONFIG_XEN ++/* ++ * When we mask an IO APIC routing entry, we need to write the low ++ * word first, in order to set the mask bit before we change the ++ * high bits! ++ */ ++static void ioapic_mask_entry(int apic, int pin) ++{ ++ unsigned long flags; ++ union entry_union eu = { .entry.mask = 1 }; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ io_apic_write(apic, 0x10 + 2*pin, eu.w1); ++ io_apic_write(apic, 0x11 + 2*pin, eu.w2); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++#endif ++ ++/* ++ * The common case is 1:1 IRQ<->pin mappings. Sometimes there are ++ * shared ISA-space IRQs, so we have to support them. We are super ++ * fast in the common case, and fast for shared ISA-space IRQs. ++ */ ++static void add_pin_to_irq(unsigned int irq, int apic, int pin) ++{ ++ static int first_free_entry = NR_IRQS; ++ struct irq_pin_list *entry = irq_2_pin + irq; ++ ++ while (entry->next) ++ entry = irq_2_pin + entry->next; ++ ++ if (entry->pin != -1) { ++ entry->next = first_free_entry; ++ entry = irq_2_pin + entry->next; ++ if (++first_free_entry >= PIN_MAP_SIZE) ++ panic("io_apic.c: whoops"); ++ } ++ entry->apic = apic; ++ entry->pin = pin; ++} ++ ++#ifndef CONFIG_XEN ++/* ++ * Reroute an IRQ to a different pin. ++ */ ++static void __init replace_pin_at_irq(unsigned int irq, ++ int oldapic, int oldpin, ++ int newapic, int newpin) ++{ ++ struct irq_pin_list *entry = irq_2_pin + irq; ++ ++ while (1) { ++ if (entry->apic == oldapic && entry->pin == oldpin) { ++ entry->apic = newapic; ++ entry->pin = newpin; ++ } ++ if (!entry->next) ++ break; ++ entry = irq_2_pin + entry->next; ++ } ++} ++ ++static void __modify_IO_APIC_irq (unsigned int irq, unsigned long enable, unsigned long disable) ++{ ++ struct irq_pin_list *entry = irq_2_pin + irq; ++ unsigned int pin, reg; ++ ++ for (;;) { ++ pin = entry->pin; ++ if (pin == -1) ++ break; ++ reg = io_apic_read(entry->apic, 0x10 + pin*2); ++ reg &= ~disable; ++ reg |= enable; ++ io_apic_modify(entry->apic, 0x10 + pin*2, reg); ++ if (!entry->next) ++ break; ++ entry = irq_2_pin + entry->next; ++ } ++} ++ ++/* mask = 1 */ ++static void __mask_IO_APIC_irq (unsigned int irq) ++{ ++ __modify_IO_APIC_irq(irq, 0x00010000, 0); ++} ++ ++/* mask = 0 */ ++static void __unmask_IO_APIC_irq (unsigned int irq) ++{ ++ __modify_IO_APIC_irq(irq, 0, 0x00010000); ++} ++ ++/* mask = 1, trigger = 0 */ ++static void __mask_and_edge_IO_APIC_irq (unsigned int irq) ++{ ++ __modify_IO_APIC_irq(irq, 0x00010000, 0x00008000); ++} ++ ++/* mask = 0, trigger = 1 */ ++static void __unmask_and_level_IO_APIC_irq (unsigned int irq) ++{ ++ __modify_IO_APIC_irq(irq, 0x00008000, 0x00010000); ++} ++ ++static void mask_IO_APIC_irq (unsigned int irq) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ __mask_IO_APIC_irq(irq); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++ ++static void unmask_IO_APIC_irq (unsigned int irq) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ __unmask_IO_APIC_irq(irq); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++ ++static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin) ++{ ++ struct IO_APIC_route_entry entry; ++ ++ /* Check delivery_mode to be sure we're not clearing an SMI pin */ ++ entry = ioapic_read_entry(apic, pin); ++ if (entry.delivery_mode == dest_SMI) ++ return; ++ ++ /* ++ * Disable it in the IO-APIC irq-routing table: ++ */ ++ ioapic_mask_entry(apic, pin); ++} ++ ++static void clear_IO_APIC (void) ++{ ++ int apic, pin; ++ ++ for (apic = 0; apic < nr_ioapics; apic++) ++ for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) ++ clear_IO_APIC_pin(apic, pin); ++} ++ ++#ifdef CONFIG_SMP ++static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t cpumask) ++{ ++ unsigned long flags; ++ int pin; ++ struct irq_pin_list *entry = irq_2_pin + irq; ++ unsigned int apicid_value; ++ cpumask_t tmp; ++ ++ cpus_and(tmp, cpumask, cpu_online_map); ++ if (cpus_empty(tmp)) ++ tmp = TARGET_CPUS; ++ ++ cpus_and(cpumask, tmp, CPU_MASK_ALL); ++ ++ apicid_value = cpu_mask_to_apicid(cpumask); ++ /* Prepare to do the io_apic_write */ ++ apicid_value = apicid_value << 24; ++ spin_lock_irqsave(&ioapic_lock, flags); ++ for (;;) { ++ pin = entry->pin; ++ if (pin == -1) ++ break; ++ io_apic_write(entry->apic, 0x10 + 1 + pin*2, apicid_value); ++ if (!entry->next) ++ break; ++ entry = irq_2_pin + entry->next; ++ } ++ irq_desc[irq].affinity = cpumask; ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++ ++#if defined(CONFIG_IRQBALANCE) ++# include /* kernel_thread() */ ++# include /* kstat */ ++# include /* kmalloc() */ ++# include /* time_after() */ ++ ++#define IRQBALANCE_CHECK_ARCH -999 ++#define MAX_BALANCED_IRQ_INTERVAL (5*HZ) ++#define MIN_BALANCED_IRQ_INTERVAL (HZ/2) ++#define BALANCED_IRQ_MORE_DELTA (HZ/10) ++#define BALANCED_IRQ_LESS_DELTA (HZ) ++ ++static int irqbalance_disabled __read_mostly = IRQBALANCE_CHECK_ARCH; ++static int physical_balance __read_mostly; ++static long balanced_irq_interval __read_mostly = MAX_BALANCED_IRQ_INTERVAL; ++ ++static struct irq_cpu_info { ++ unsigned long * last_irq; ++ unsigned long * irq_delta; ++ unsigned long irq; ++} irq_cpu_data[NR_CPUS]; ++ ++#define CPU_IRQ(cpu) (irq_cpu_data[cpu].irq) ++#define LAST_CPU_IRQ(cpu,irq) (irq_cpu_data[cpu].last_irq[irq]) ++#define IRQ_DELTA(cpu,irq) (irq_cpu_data[cpu].irq_delta[irq]) ++ ++#define IDLE_ENOUGH(cpu,now) \ ++ (idle_cpu(cpu) && ((now) - per_cpu(irq_stat, (cpu)).idle_timestamp > 1)) ++ ++#define IRQ_ALLOWED(cpu, allowed_mask) cpu_isset(cpu, allowed_mask) ++ ++#define CPU_TO_PACKAGEINDEX(i) (first_cpu(per_cpu(cpu_sibling_map, i))) ++ ++static cpumask_t balance_irq_affinity[NR_IRQS] = { ++ [0 ... NR_IRQS-1] = CPU_MASK_ALL ++}; ++ ++void set_balance_irq_affinity(unsigned int irq, cpumask_t mask) ++{ ++ balance_irq_affinity[irq] = mask; ++} ++ ++static unsigned long move(int curr_cpu, cpumask_t allowed_mask, ++ unsigned long now, int direction) ++{ ++ int search_idle = 1; ++ int cpu = curr_cpu; ++ ++ goto inside; ++ ++ do { ++ if (unlikely(cpu == curr_cpu)) ++ search_idle = 0; ++inside: ++ if (direction == 1) { ++ cpu++; ++ if (cpu >= NR_CPUS) ++ cpu = 0; ++ } else { ++ cpu--; ++ if (cpu == -1) ++ cpu = NR_CPUS-1; ++ } ++ } while (!cpu_online(cpu) || !IRQ_ALLOWED(cpu,allowed_mask) || ++ (search_idle && !IDLE_ENOUGH(cpu,now))); ++ ++ return cpu; ++} ++ ++static inline void balance_irq(int cpu, int irq) ++{ ++ unsigned long now = jiffies; ++ cpumask_t allowed_mask; ++ unsigned int new_cpu; ++ ++ if (irqbalance_disabled) ++ return; ++ ++ cpus_and(allowed_mask, cpu_online_map, balance_irq_affinity[irq]); ++ new_cpu = move(cpu, allowed_mask, now, 1); ++ if (cpu != new_cpu) { ++ set_pending_irq(irq, cpumask_of_cpu(new_cpu)); ++ } ++} ++ ++static inline void rotate_irqs_among_cpus(unsigned long useful_load_threshold) ++{ ++ int i, j; ++ ++ for_each_online_cpu(i) { ++ for (j = 0; j < NR_IRQS; j++) { ++ if (!irq_desc[j].action) ++ continue; ++ /* Is it a significant load ? */ ++ if (IRQ_DELTA(CPU_TO_PACKAGEINDEX(i),j) < ++ useful_load_threshold) ++ continue; ++ balance_irq(i, j); ++ } ++ } ++ balanced_irq_interval = max((long)MIN_BALANCED_IRQ_INTERVAL, ++ balanced_irq_interval - BALANCED_IRQ_LESS_DELTA); ++ return; ++} ++ ++static void do_irq_balance(void) ++{ ++ int i, j; ++ unsigned long max_cpu_irq = 0, min_cpu_irq = (~0); ++ unsigned long move_this_load = 0; ++ int max_loaded = 0, min_loaded = 0; ++ int load; ++ unsigned long useful_load_threshold = balanced_irq_interval + 10; ++ int selected_irq; ++ int tmp_loaded, first_attempt = 1; ++ unsigned long tmp_cpu_irq; ++ unsigned long imbalance = 0; ++ cpumask_t allowed_mask, target_cpu_mask, tmp; ++ ++ for_each_possible_cpu(i) { ++ int package_index; ++ CPU_IRQ(i) = 0; ++ if (!cpu_online(i)) ++ continue; ++ package_index = CPU_TO_PACKAGEINDEX(i); ++ for (j = 0; j < NR_IRQS; j++) { ++ unsigned long value_now, delta; ++ /* Is this an active IRQ or balancing disabled ? */ ++ if (!irq_desc[j].action || irq_balancing_disabled(j)) ++ continue; ++ if ( package_index == i ) ++ IRQ_DELTA(package_index,j) = 0; ++ /* Determine the total count per processor per IRQ */ ++ value_now = (unsigned long) kstat_cpu(i).irqs[j]; ++ ++ /* Determine the activity per processor per IRQ */ ++ delta = value_now - LAST_CPU_IRQ(i,j); ++ ++ /* Update last_cpu_irq[][] for the next time */ ++ LAST_CPU_IRQ(i,j) = value_now; ++ ++ /* Ignore IRQs whose rate is less than the clock */ ++ if (delta < useful_load_threshold) ++ continue; ++ /* update the load for the processor or package total */ ++ IRQ_DELTA(package_index,j) += delta; ++ ++ /* Keep track of the higher numbered sibling as well */ ++ if (i != package_index) ++ CPU_IRQ(i) += delta; ++ /* ++ * We have sibling A and sibling B in the package ++ * ++ * cpu_irq[A] = load for cpu A + load for cpu B ++ * cpu_irq[B] = load for cpu B ++ */ ++ CPU_IRQ(package_index) += delta; ++ } ++ } ++ /* Find the least loaded processor package */ ++ for_each_online_cpu(i) { ++ if (i != CPU_TO_PACKAGEINDEX(i)) ++ continue; ++ if (min_cpu_irq > CPU_IRQ(i)) { ++ min_cpu_irq = CPU_IRQ(i); ++ min_loaded = i; ++ } ++ } ++ max_cpu_irq = ULONG_MAX; ++ ++tryanothercpu: ++ /* Look for heaviest loaded processor. ++ * We may come back to get the next heaviest loaded processor. ++ * Skip processors with trivial loads. ++ */ ++ tmp_cpu_irq = 0; ++ tmp_loaded = -1; ++ for_each_online_cpu(i) { ++ if (i != CPU_TO_PACKAGEINDEX(i)) ++ continue; ++ if (max_cpu_irq <= CPU_IRQ(i)) ++ continue; ++ if (tmp_cpu_irq < CPU_IRQ(i)) { ++ tmp_cpu_irq = CPU_IRQ(i); ++ tmp_loaded = i; ++ } ++ } ++ ++ if (tmp_loaded == -1) { ++ /* In the case of small number of heavy interrupt sources, ++ * loading some of the cpus too much. We use Ingo's original ++ * approach to rotate them around. ++ */ ++ if (!first_attempt && imbalance >= useful_load_threshold) { ++ rotate_irqs_among_cpus(useful_load_threshold); ++ return; ++ } ++ goto not_worth_the_effort; ++ } ++ ++ first_attempt = 0; /* heaviest search */ ++ max_cpu_irq = tmp_cpu_irq; /* load */ ++ max_loaded = tmp_loaded; /* processor */ ++ imbalance = (max_cpu_irq - min_cpu_irq) / 2; ++ ++ /* if imbalance is less than approx 10% of max load, then ++ * observe diminishing returns action. - quit ++ */ ++ if (imbalance < (max_cpu_irq >> 3)) ++ goto not_worth_the_effort; ++ ++tryanotherirq: ++ /* if we select an IRQ to move that can't go where we want, then ++ * see if there is another one to try. ++ */ ++ move_this_load = 0; ++ selected_irq = -1; ++ for (j = 0; j < NR_IRQS; j++) { ++ /* Is this an active IRQ? */ ++ if (!irq_desc[j].action) ++ continue; ++ if (imbalance <= IRQ_DELTA(max_loaded,j)) ++ continue; ++ /* Try to find the IRQ that is closest to the imbalance ++ * without going over. ++ */ ++ if (move_this_load < IRQ_DELTA(max_loaded,j)) { ++ move_this_load = IRQ_DELTA(max_loaded,j); ++ selected_irq = j; ++ } ++ } ++ if (selected_irq == -1) { ++ goto tryanothercpu; ++ } ++ ++ imbalance = move_this_load; ++ ++ /* For physical_balance case, we accumulated both load ++ * values in the one of the siblings cpu_irq[], ++ * to use the same code for physical and logical processors ++ * as much as possible. ++ * ++ * NOTE: the cpu_irq[] array holds the sum of the load for ++ * sibling A and sibling B in the slot for the lowest numbered ++ * sibling (A), _AND_ the load for sibling B in the slot for ++ * the higher numbered sibling. ++ * ++ * We seek the least loaded sibling by making the comparison ++ * (A+B)/2 vs B ++ */ ++ load = CPU_IRQ(min_loaded) >> 1; ++ for_each_cpu_mask(j, per_cpu(cpu_sibling_map, min_loaded)) { ++ if (load > CPU_IRQ(j)) { ++ /* This won't change cpu_sibling_map[min_loaded] */ ++ load = CPU_IRQ(j); ++ min_loaded = j; ++ } ++ } ++ ++ cpus_and(allowed_mask, ++ cpu_online_map, ++ balance_irq_affinity[selected_irq]); ++ target_cpu_mask = cpumask_of_cpu(min_loaded); ++ cpus_and(tmp, target_cpu_mask, allowed_mask); ++ ++ if (!cpus_empty(tmp)) { ++ /* mark for change destination */ ++ set_pending_irq(selected_irq, cpumask_of_cpu(min_loaded)); ++ ++ /* Since we made a change, come back sooner to ++ * check for more variation. ++ */ ++ balanced_irq_interval = max((long)MIN_BALANCED_IRQ_INTERVAL, ++ balanced_irq_interval - BALANCED_IRQ_LESS_DELTA); ++ return; ++ } ++ goto tryanotherirq; ++ ++not_worth_the_effort: ++ /* ++ * if we did not find an IRQ to move, then adjust the time interval ++ * upward ++ */ ++ balanced_irq_interval = min((long)MAX_BALANCED_IRQ_INTERVAL, ++ balanced_irq_interval + BALANCED_IRQ_MORE_DELTA); ++ return; ++} ++ ++static int balanced_irq(void *unused) ++{ ++ int i; ++ unsigned long prev_balance_time = jiffies; ++ long time_remaining = balanced_irq_interval; ++ ++ /* push everything to CPU 0 to give us a starting point. */ ++ for (i = 0 ; i < NR_IRQS ; i++) { ++ irq_desc[i].pending_mask = cpumask_of_cpu(0); ++ set_pending_irq(i, cpumask_of_cpu(0)); ++ } ++ ++ set_freezable(); ++ for ( ; ; ) { ++ time_remaining = schedule_timeout_interruptible(time_remaining); ++ try_to_freeze(); ++ if (time_after(jiffies, ++ prev_balance_time+balanced_irq_interval)) { ++ preempt_disable(); ++ do_irq_balance(); ++ prev_balance_time = jiffies; ++ time_remaining = balanced_irq_interval; ++ preempt_enable(); ++ } ++ } ++ return 0; ++} ++ ++static int __init balanced_irq_init(void) ++{ ++ int i; ++ struct cpuinfo_x86 *c; ++ cpumask_t tmp; ++ ++ cpus_shift_right(tmp, cpu_online_map, 2); ++ c = &boot_cpu_data; ++ /* When not overwritten by the command line ask subarchitecture. */ ++ if (irqbalance_disabled == IRQBALANCE_CHECK_ARCH) ++ irqbalance_disabled = NO_BALANCE_IRQ; ++ if (irqbalance_disabled) ++ return 0; ++ ++ /* disable irqbalance completely if there is only one processor online */ ++ if (num_online_cpus() < 2) { ++ irqbalance_disabled = 1; ++ return 0; ++ } ++ /* ++ * Enable physical balance only if more than 1 physical processor ++ * is present ++ */ ++ if (smp_num_siblings > 1 && !cpus_empty(tmp)) ++ physical_balance = 1; ++ ++ for_each_online_cpu(i) { ++ irq_cpu_data[i].irq_delta = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL); ++ irq_cpu_data[i].last_irq = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL); ++ if (irq_cpu_data[i].irq_delta == NULL || irq_cpu_data[i].last_irq == NULL) { ++ printk(KERN_ERR "balanced_irq_init: out of memory"); ++ goto failed; ++ } ++ memset(irq_cpu_data[i].irq_delta,0,sizeof(unsigned long) * NR_IRQS); ++ memset(irq_cpu_data[i].last_irq,0,sizeof(unsigned long) * NR_IRQS); ++ } ++ ++ printk(KERN_INFO "Starting balanced_irq\n"); ++ if (!IS_ERR(kthread_run(balanced_irq, NULL, "kirqd"))) ++ return 0; ++ printk(KERN_ERR "balanced_irq_init: failed to spawn balanced_irq"); ++failed: ++ for_each_possible_cpu(i) { ++ kfree(irq_cpu_data[i].irq_delta); ++ irq_cpu_data[i].irq_delta = NULL; ++ kfree(irq_cpu_data[i].last_irq); ++ irq_cpu_data[i].last_irq = NULL; ++ } ++ return 0; ++} ++ ++int __devinit irqbalance_disable(char *str) ++{ ++ irqbalance_disabled = 1; ++ return 1; ++} ++ ++__setup("noirqbalance", irqbalance_disable); ++ ++late_initcall(balanced_irq_init); ++#endif /* CONFIG_IRQBALANCE */ ++#endif /* CONFIG_SMP */ ++#endif ++ ++#ifndef CONFIG_SMP ++void fastcall send_IPI_self(int vector) ++{ ++#ifndef CONFIG_XEN ++ unsigned int cfg; ++ ++ /* ++ * Wait for idle. ++ */ ++ apic_wait_icr_idle(); ++ cfg = APIC_DM_FIXED | APIC_DEST_SELF | vector | APIC_DEST_LOGICAL; ++ /* ++ * Send the IPI. The write to APIC_ICR fires this off. ++ */ ++ apic_write_around(APIC_ICR, cfg); ++#endif ++} ++#endif /* !CONFIG_SMP */ ++ ++ ++/* ++ * support for broken MP BIOSs, enables hand-redirection of PIRQ0-7 to ++ * specific CPU-side IRQs. ++ */ ++ ++#define MAX_PIRQS 8 ++static int pirq_entries [MAX_PIRQS]; ++static int pirqs_enabled; ++int skip_ioapic_setup; ++ ++static int __init ioapic_pirq_setup(char *str) ++{ ++ int i, max; ++ int ints[MAX_PIRQS+1]; ++ ++ get_options(str, ARRAY_SIZE(ints), ints); ++ ++ for (i = 0; i < MAX_PIRQS; i++) ++ pirq_entries[i] = -1; ++ ++ pirqs_enabled = 1; ++ apic_printk(APIC_VERBOSE, KERN_INFO ++ "PIRQ redirection, working around broken MP-BIOS.\n"); ++ max = MAX_PIRQS; ++ if (ints[0] < MAX_PIRQS) ++ max = ints[0]; ++ ++ for (i = 0; i < max; i++) { ++ apic_printk(APIC_VERBOSE, KERN_DEBUG ++ "... PIRQ%d -> IRQ %d\n", i, ints[i+1]); ++ /* ++ * PIRQs are mapped upside down, usually. ++ */ ++ pirq_entries[MAX_PIRQS-i-1] = ints[i+1]; ++ } ++ return 1; ++} ++ ++__setup("pirq=", ioapic_pirq_setup); ++ ++/* ++ * Find the IRQ entry number of a certain pin. ++ */ ++static int find_irq_entry(int apic, int pin, int type) ++{ ++ int i; ++ ++ for (i = 0; i < mp_irq_entries; i++) ++ if (mp_irqs[i].mpc_irqtype == type && ++ (mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mpc_apicid || ++ mp_irqs[i].mpc_dstapic == MP_APIC_ALL) && ++ mp_irqs[i].mpc_dstirq == pin) ++ return i; ++ ++ return -1; ++} ++ ++/* ++ * Find the pin to which IRQ[irq] (ISA) is connected ++ */ ++static int __init find_isa_irq_pin(int irq, int type) ++{ ++ int i; ++ ++ for (i = 0; i < mp_irq_entries; i++) { ++ int lbus = mp_irqs[i].mpc_srcbus; ++ ++ if ((mp_bus_id_to_type[lbus] == MP_BUS_ISA || ++ mp_bus_id_to_type[lbus] == MP_BUS_EISA || ++ mp_bus_id_to_type[lbus] == MP_BUS_MCA ++ ) && ++ (mp_irqs[i].mpc_irqtype == type) && ++ (mp_irqs[i].mpc_srcbusirq == irq)) ++ ++ return mp_irqs[i].mpc_dstirq; ++ } ++ return -1; ++} ++ ++static int __init find_isa_irq_apic(int irq, int type) ++{ ++ int i; ++ ++ for (i = 0; i < mp_irq_entries; i++) { ++ int lbus = mp_irqs[i].mpc_srcbus; ++ ++ if ((mp_bus_id_to_type[lbus] == MP_BUS_ISA || ++ mp_bus_id_to_type[lbus] == MP_BUS_EISA || ++ mp_bus_id_to_type[lbus] == MP_BUS_MCA ++ ) && ++ (mp_irqs[i].mpc_irqtype == type) && ++ (mp_irqs[i].mpc_srcbusirq == irq)) ++ break; ++ } ++ if (i < mp_irq_entries) { ++ int apic; ++ for(apic = 0; apic < nr_ioapics; apic++) { ++ if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic) ++ return apic; ++ } ++ } ++ ++ return -1; ++} ++ ++/* ++ * Find a specific PCI IRQ entry. ++ * Not an __init, possibly needed by modules ++ */ ++static int pin_2_irq(int idx, int apic, int pin); ++ ++int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin) ++{ ++ int apic, i, best_guess = -1; ++ ++ apic_printk(APIC_DEBUG, "querying PCI -> IRQ mapping bus:%d, " ++ "slot:%d, pin:%d.\n", bus, slot, pin); ++ if (mp_bus_id_to_pci_bus[bus] == -1) { ++ printk(KERN_WARNING "PCI BIOS passed nonexistent PCI bus %d!\n", bus); ++ return -1; ++ } ++ for (i = 0; i < mp_irq_entries; i++) { ++ int lbus = mp_irqs[i].mpc_srcbus; ++ ++ for (apic = 0; apic < nr_ioapics; apic++) ++ if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic || ++ mp_irqs[i].mpc_dstapic == MP_APIC_ALL) ++ break; ++ ++ if ((mp_bus_id_to_type[lbus] == MP_BUS_PCI) && ++ !mp_irqs[i].mpc_irqtype && ++ (bus == lbus) && ++ (slot == ((mp_irqs[i].mpc_srcbusirq >> 2) & 0x1f))) { ++ int irq = pin_2_irq(i,apic,mp_irqs[i].mpc_dstirq); ++ ++ if (!(apic || IO_APIC_IRQ(irq))) ++ continue; ++ ++ if (pin == (mp_irqs[i].mpc_srcbusirq & 3)) ++ return irq; ++ /* ++ * Use the first all-but-pin matching entry as a ++ * best-guess fuzzy result for broken mptables. ++ */ ++ if (best_guess < 0) ++ best_guess = irq; ++ } ++ } ++ return best_guess; ++} ++EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector); ++ ++/* ++ * This function currently is only a helper for the i386 smp boot process where ++ * we need to reprogram the ioredtbls to cater for the cpus which have come online ++ * so mask in all cases should simply be TARGET_CPUS ++ */ ++#ifdef CONFIG_SMP ++#ifndef CONFIG_XEN ++void __init setup_ioapic_dest(void) ++{ ++ int pin, ioapic, irq, irq_entry; ++ ++ if (skip_ioapic_setup == 1) ++ return; ++ ++ for (ioapic = 0; ioapic < nr_ioapics; ioapic++) { ++ for (pin = 0; pin < nr_ioapic_registers[ioapic]; pin++) { ++ irq_entry = find_irq_entry(ioapic, pin, mp_INT); ++ if (irq_entry == -1) ++ continue; ++ irq = pin_2_irq(irq_entry, ioapic, pin); ++ set_ioapic_affinity_irq(irq, TARGET_CPUS); ++ } ++ ++ } ++} ++#endif /* !CONFIG_XEN */ ++#endif ++ ++/* ++ * EISA Edge/Level control register, ELCR ++ */ ++static int EISA_ELCR(unsigned int irq) ++{ ++ if (irq < 16) { ++ unsigned int port = 0x4d0 + (irq >> 3); ++ return (inb(port) >> (irq & 7)) & 1; ++ } ++ apic_printk(APIC_VERBOSE, KERN_INFO ++ "Broken MPtable reports ISA irq %d\n", irq); ++ return 0; ++} ++ ++/* EISA interrupts are always polarity zero and can be edge or level ++ * trigger depending on the ELCR value. If an interrupt is listed as ++ * EISA conforming in the MP table, that means its trigger type must ++ * be read in from the ELCR */ ++ ++#define default_EISA_trigger(idx) (EISA_ELCR(mp_irqs[idx].mpc_srcbusirq)) ++#define default_EISA_polarity(idx) (0) ++ ++/* ISA interrupts are always polarity zero edge triggered, ++ * when listed as conforming in the MP table. */ ++ ++#define default_ISA_trigger(idx) (0) ++#define default_ISA_polarity(idx) (0) ++ ++/* PCI interrupts are always polarity one level triggered, ++ * when listed as conforming in the MP table. */ ++ ++#define default_PCI_trigger(idx) (1) ++#define default_PCI_polarity(idx) (1) ++ ++/* MCA interrupts are always polarity zero level triggered, ++ * when listed as conforming in the MP table. */ ++ ++#define default_MCA_trigger(idx) (1) ++#define default_MCA_polarity(idx) (0) ++ ++static int MPBIOS_polarity(int idx) ++{ ++ int bus = mp_irqs[idx].mpc_srcbus; ++ int polarity; ++ ++ /* ++ * Determine IRQ line polarity (high active or low active): ++ */ ++ switch (mp_irqs[idx].mpc_irqflag & 3) ++ { ++ case 0: /* conforms, ie. bus-type dependent polarity */ ++ { ++ switch (mp_bus_id_to_type[bus]) ++ { ++ case MP_BUS_ISA: /* ISA pin */ ++ { ++ polarity = default_ISA_polarity(idx); ++ break; ++ } ++ case MP_BUS_EISA: /* EISA pin */ ++ { ++ polarity = default_EISA_polarity(idx); ++ break; ++ } ++ case MP_BUS_PCI: /* PCI pin */ ++ { ++ polarity = default_PCI_polarity(idx); ++ break; ++ } ++ case MP_BUS_MCA: /* MCA pin */ ++ { ++ polarity = default_MCA_polarity(idx); ++ break; ++ } ++ default: ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ polarity = 1; ++ break; ++ } ++ } ++ break; ++ } ++ case 1: /* high active */ ++ { ++ polarity = 0; ++ break; ++ } ++ case 2: /* reserved */ ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ polarity = 1; ++ break; ++ } ++ case 3: /* low active */ ++ { ++ polarity = 1; ++ break; ++ } ++ default: /* invalid */ ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ polarity = 1; ++ break; ++ } ++ } ++ return polarity; ++} ++ ++static int MPBIOS_trigger(int idx) ++{ ++ int bus = mp_irqs[idx].mpc_srcbus; ++ int trigger; ++ ++ /* ++ * Determine IRQ trigger mode (edge or level sensitive): ++ */ ++ switch ((mp_irqs[idx].mpc_irqflag>>2) & 3) ++ { ++ case 0: /* conforms, ie. bus-type dependent */ ++ { ++ switch (mp_bus_id_to_type[bus]) ++ { ++ case MP_BUS_ISA: /* ISA pin */ ++ { ++ trigger = default_ISA_trigger(idx); ++ break; ++ } ++ case MP_BUS_EISA: /* EISA pin */ ++ { ++ trigger = default_EISA_trigger(idx); ++ break; ++ } ++ case MP_BUS_PCI: /* PCI pin */ ++ { ++ trigger = default_PCI_trigger(idx); ++ break; ++ } ++ case MP_BUS_MCA: /* MCA pin */ ++ { ++ trigger = default_MCA_trigger(idx); ++ break; ++ } ++ default: ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ trigger = 1; ++ break; ++ } ++ } ++ break; ++ } ++ case 1: /* edge */ ++ { ++ trigger = 0; ++ break; ++ } ++ case 2: /* reserved */ ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ trigger = 1; ++ break; ++ } ++ case 3: /* level */ ++ { ++ trigger = 1; ++ break; ++ } ++ default: /* invalid */ ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ trigger = 0; ++ break; ++ } ++ } ++ return trigger; ++} ++ ++static inline int irq_polarity(int idx) ++{ ++ return MPBIOS_polarity(idx); ++} ++ ++static inline int irq_trigger(int idx) ++{ ++ return MPBIOS_trigger(idx); ++} ++ ++static int pin_2_irq(int idx, int apic, int pin) ++{ ++ int irq, i; ++ int bus = mp_irqs[idx].mpc_srcbus; ++ ++ /* ++ * Debugging check, we are in big trouble if this message pops up! ++ */ ++ if (mp_irqs[idx].mpc_dstirq != pin) ++ printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n"); ++ ++ switch (mp_bus_id_to_type[bus]) ++ { ++ case MP_BUS_ISA: /* ISA pin */ ++ case MP_BUS_EISA: ++ case MP_BUS_MCA: ++ { ++ irq = mp_irqs[idx].mpc_srcbusirq; ++ break; ++ } ++ case MP_BUS_PCI: /* PCI pin */ ++ { ++ /* ++ * PCI IRQs are mapped in order ++ */ ++ i = irq = 0; ++ while (i < apic) ++ irq += nr_ioapic_registers[i++]; ++ irq += pin; ++ ++#ifndef CONFIG_XEN ++ /* ++ * For MPS mode, so far only needed by ES7000 platform ++ */ ++ if (ioapic_renumber_irq) ++ irq = ioapic_renumber_irq(apic, irq); ++#endif ++ break; ++ } ++ default: ++ { ++ printk(KERN_ERR "unknown bus type %d.\n",bus); ++ irq = 0; ++ break; ++ } ++ } ++ ++ /* ++ * PCI IRQ command line redirection. Yes, limits are hardcoded. ++ */ ++ if ((pin >= 16) && (pin <= 23)) { ++ if (pirq_entries[pin-16] != -1) { ++ if (!pirq_entries[pin-16]) { ++ apic_printk(APIC_VERBOSE, KERN_DEBUG ++ "disabling PIRQ%d\n", pin-16); ++ } else { ++ irq = pirq_entries[pin-16]; ++ apic_printk(APIC_VERBOSE, KERN_DEBUG ++ "using PIRQ%d -> IRQ %d\n", ++ pin-16, irq); ++ } ++ } ++ } ++ return irq; ++} ++ ++static inline int IO_APIC_irq_trigger(int irq) ++{ ++ int apic, idx, pin; ++ ++ for (apic = 0; apic < nr_ioapics; apic++) { ++ for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { ++ idx = find_irq_entry(apic,pin,mp_INT); ++ if ((idx != -1) && (irq == pin_2_irq(idx,apic,pin))) ++ return irq_trigger(idx); ++ } ++ } ++ /* ++ * nonexistent IRQs are edge default ++ */ ++ return 0; ++} ++ ++/* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */ ++static u8 irq_vector[NR_IRQ_VECTORS] __read_mostly; /* = { FIRST_DEVICE_VECTOR , 0 }; */ ++ ++static int __assign_irq_vector(int irq) ++{ ++ int vector; ++ struct physdev_irq irq_op; ++ ++ BUG_ON((unsigned)irq >= NR_IRQ_VECTORS); ++ ++ if (irq_vector[irq] > 0) ++ return irq_vector[irq]; ++ ++ irq_op.irq = irq; ++ if (HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &irq_op)) ++ return -ENOSPC; ++ ++ vector = irq_op.vector; ++ irq_vector[irq] = vector; ++ ++ return vector; ++} ++ ++static int assign_irq_vector(int irq) ++{ ++ unsigned long flags; ++ int vector; ++ ++ spin_lock_irqsave(&vector_lock, flags); ++ vector = __assign_irq_vector(irq); ++ spin_unlock_irqrestore(&vector_lock, flags); ++ ++ return vector; ++} ++ ++#ifndef CONFIG_XEN ++static struct irq_chip ioapic_chip; ++ ++#define IOAPIC_AUTO -1 ++#define IOAPIC_EDGE 0 ++#define IOAPIC_LEVEL 1 ++ ++static void ioapic_register_intr(int irq, int vector, unsigned long trigger) ++{ ++ if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) || ++ trigger == IOAPIC_LEVEL) { ++ irq_desc[irq].status |= IRQ_LEVEL; ++ set_irq_chip_and_handler_name(irq, &ioapic_chip, ++ handle_fasteoi_irq, "fasteoi"); ++ } else { ++ irq_desc[irq].status &= ~IRQ_LEVEL; ++ set_irq_chip_and_handler_name(irq, &ioapic_chip, ++ handle_edge_irq, "edge"); ++ } ++ set_intr_gate(vector, interrupt[irq]); ++} ++#else ++#define ioapic_register_intr(_irq,_vector,_trigger) ((void)0) ++#endif ++ ++static void __init setup_IO_APIC_irqs(void) ++{ ++ struct IO_APIC_route_entry entry; ++ int apic, pin, idx, irq, first_notcon = 1, vector; ++ unsigned long flags; ++ ++ apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n"); ++ ++ for (apic = 0; apic < nr_ioapics; apic++) { ++ for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { ++ ++ /* ++ * add it to the IO-APIC irq-routing table: ++ */ ++ memset(&entry,0,sizeof(entry)); ++ ++ entry.delivery_mode = INT_DELIVERY_MODE; ++ entry.dest_mode = INT_DEST_MODE; ++ entry.mask = 0; /* enable IRQ */ ++ entry.dest.logical.logical_dest = ++ cpu_mask_to_apicid(TARGET_CPUS); ++ ++ idx = find_irq_entry(apic,pin,mp_INT); ++ if (idx == -1) { ++ if (first_notcon) { ++ apic_printk(APIC_VERBOSE, KERN_DEBUG ++ " IO-APIC (apicid-pin) %d-%d", ++ mp_ioapics[apic].mpc_apicid, ++ pin); ++ first_notcon = 0; ++ } else ++ apic_printk(APIC_VERBOSE, ", %d-%d", ++ mp_ioapics[apic].mpc_apicid, pin); ++ continue; ++ } ++ ++ if (!first_notcon) { ++ apic_printk(APIC_VERBOSE, " not connected.\n"); ++ first_notcon = 1; ++ } ++ ++ entry.trigger = irq_trigger(idx); ++ entry.polarity = irq_polarity(idx); ++ ++ if (irq_trigger(idx)) { ++ entry.trigger = 1; ++ entry.mask = 1; ++ } ++ ++ irq = pin_2_irq(idx, apic, pin); ++ /* ++ * skip adding the timer int on secondary nodes, which causes ++ * a small but painful rift in the time-space continuum ++ */ ++ if (multi_timer_check(apic, irq)) ++ continue; ++ else ++ add_pin_to_irq(irq, apic, pin); ++ ++ if (/*!apic &&*/ !IO_APIC_IRQ(irq)) ++ continue; ++ ++ if (IO_APIC_IRQ(irq)) { ++ vector = assign_irq_vector(irq); ++ entry.vector = vector; ++ ioapic_register_intr(irq, vector, IOAPIC_AUTO); ++ ++ if (!apic && (irq < 16)) ++ disable_8259A_irq(irq); ++ } ++ spin_lock_irqsave(&ioapic_lock, flags); ++ __ioapic_write_entry(apic, pin, entry); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ } ++ } ++ ++ if (!first_notcon) ++ apic_printk(APIC_VERBOSE, " not connected.\n"); ++} ++ ++/* ++ * Set up the 8259A-master output pin: ++ */ ++#ifndef CONFIG_XEN ++static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, int vector) ++{ ++ struct IO_APIC_route_entry entry; ++ ++ memset(&entry,0,sizeof(entry)); ++ ++ disable_8259A_irq(0); ++ ++ /* mask LVT0 */ ++ apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); ++ ++ /* ++ * We use logical delivery to get the timer IRQ ++ * to the first CPU. ++ */ ++ entry.dest_mode = INT_DEST_MODE; ++ entry.mask = 0; /* unmask IRQ now */ ++ entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); ++ entry.delivery_mode = INT_DELIVERY_MODE; ++ entry.polarity = 0; ++ entry.trigger = 0; ++ entry.vector = vector; ++ ++ /* ++ * The timer IRQ doesn't have to know that behind the ++ * scene we have a 8259A-master in AEOI mode ... ++ */ ++ irq_desc[0].chip = &ioapic_chip; ++ set_irq_handler(0, handle_edge_irq); ++ ++ /* ++ * Add it to the IO-APIC irq-routing table: ++ */ ++ ioapic_write_entry(apic, pin, entry); ++ ++ enable_8259A_irq(0); ++} ++ ++void __init print_IO_APIC(void) ++{ ++ int apic, i; ++ union IO_APIC_reg_00 reg_00; ++ union IO_APIC_reg_01 reg_01; ++ union IO_APIC_reg_02 reg_02; ++ union IO_APIC_reg_03 reg_03; ++ unsigned long flags; ++ ++ if (apic_verbosity == APIC_QUIET) ++ return; ++ ++ printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); ++ for (i = 0; i < nr_ioapics; i++) ++ printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", ++ mp_ioapics[i].mpc_apicid, nr_ioapic_registers[i]); ++ ++ /* ++ * We are a bit conservative about what we expect. We have to ++ * know about every hardware change ASAP. ++ */ ++ printk(KERN_INFO "testing the IO APIC.......................\n"); ++ ++ for (apic = 0; apic < nr_ioapics; apic++) { ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_00.raw = io_apic_read(apic, 0); ++ reg_01.raw = io_apic_read(apic, 1); ++ if (reg_01.bits.version >= 0x10) ++ reg_02.raw = io_apic_read(apic, 2); ++ if (reg_01.bits.version >= 0x20) ++ reg_03.raw = io_apic_read(apic, 3); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mpc_apicid); ++ printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw); ++ printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID); ++ printk(KERN_DEBUG "....... : Delivery Type: %X\n", reg_00.bits.delivery_type); ++ printk(KERN_DEBUG "....... : LTS : %X\n", reg_00.bits.LTS); ++ ++ printk(KERN_DEBUG ".... register #01: %08X\n", reg_01.raw); ++ printk(KERN_DEBUG "....... : max redirection entries: %04X\n", reg_01.bits.entries); ++ ++ printk(KERN_DEBUG "....... : PRQ implemented: %X\n", reg_01.bits.PRQ); ++ printk(KERN_DEBUG "....... : IO APIC version: %04X\n", reg_01.bits.version); ++ ++ /* ++ * Some Intel chipsets with IO APIC VERSION of 0x1? don't have reg_02, ++ * but the value of reg_02 is read as the previous read register ++ * value, so ignore it if reg_02 == reg_01. ++ */ ++ if (reg_01.bits.version >= 0x10 && reg_02.raw != reg_01.raw) { ++ printk(KERN_DEBUG ".... register #02: %08X\n", reg_02.raw); ++ printk(KERN_DEBUG "....... : arbitration: %02X\n", reg_02.bits.arbitration); ++ } ++ ++ /* ++ * Some Intel chipsets with IO APIC VERSION of 0x2? don't have reg_02 ++ * or reg_03, but the value of reg_0[23] is read as the previous read ++ * register value, so ignore it if reg_03 == reg_0[12]. ++ */ ++ if (reg_01.bits.version >= 0x20 && reg_03.raw != reg_02.raw && ++ reg_03.raw != reg_01.raw) { ++ printk(KERN_DEBUG ".... register #03: %08X\n", reg_03.raw); ++ printk(KERN_DEBUG "....... : Boot DT : %X\n", reg_03.bits.boot_DT); ++ } ++ ++ printk(KERN_DEBUG ".... IRQ redirection table:\n"); ++ ++ printk(KERN_DEBUG " NR Log Phy Mask Trig IRR Pol" ++ " Stat Dest Deli Vect: \n"); ++ ++ for (i = 0; i <= reg_01.bits.entries; i++) { ++ struct IO_APIC_route_entry entry; ++ ++ entry = ioapic_read_entry(apic, i); ++ ++ printk(KERN_DEBUG " %02x %03X %02X ", ++ i, ++ entry.dest.logical.logical_dest, ++ entry.dest.physical.physical_dest ++ ); ++ ++ printk("%1d %1d %1d %1d %1d %1d %1d %02X\n", ++ entry.mask, ++ entry.trigger, ++ entry.irr, ++ entry.polarity, ++ entry.delivery_status, ++ entry.dest_mode, ++ entry.delivery_mode, ++ entry.vector ++ ); ++ } ++ } ++ printk(KERN_DEBUG "IRQ to pin mappings:\n"); ++ for (i = 0; i < NR_IRQS; i++) { ++ struct irq_pin_list *entry = irq_2_pin + i; ++ if (entry->pin < 0) ++ continue; ++ printk(KERN_DEBUG "IRQ%d ", i); ++ for (;;) { ++ printk("-> %d:%d", entry->apic, entry->pin); ++ if (!entry->next) ++ break; ++ entry = irq_2_pin + entry->next; ++ } ++ printk("\n"); ++ } ++ ++ printk(KERN_INFO ".................................... done.\n"); ++ ++ return; ++} ++ ++static void print_APIC_bitfield (int base) ++{ ++ unsigned int v; ++ int i, j; ++ ++ if (apic_verbosity == APIC_QUIET) ++ return; ++ ++ printk(KERN_DEBUG "0123456789abcdef0123456789abcdef\n" KERN_DEBUG); ++ for (i = 0; i < 8; i++) { ++ v = apic_read(base + i*0x10); ++ for (j = 0; j < 32; j++) { ++ if (v & (1< 3) /* Due to the Pentium erratum 3AP. */ ++ apic_write(APIC_ESR, 0); ++ v = apic_read(APIC_ESR); ++ printk(KERN_DEBUG "... APIC ESR: %08x\n", v); ++ } ++ ++ v = apic_read(APIC_ICR); ++ printk(KERN_DEBUG "... APIC ICR: %08x\n", v); ++ v = apic_read(APIC_ICR2); ++ printk(KERN_DEBUG "... APIC ICR2: %08x\n", v); ++ ++ v = apic_read(APIC_LVTT); ++ printk(KERN_DEBUG "... APIC LVTT: %08x\n", v); ++ ++ if (maxlvt > 3) { /* PC is LVT#4. */ ++ v = apic_read(APIC_LVTPC); ++ printk(KERN_DEBUG "... APIC LVTPC: %08x\n", v); ++ } ++ v = apic_read(APIC_LVT0); ++ printk(KERN_DEBUG "... APIC LVT0: %08x\n", v); ++ v = apic_read(APIC_LVT1); ++ printk(KERN_DEBUG "... APIC LVT1: %08x\n", v); ++ ++ if (maxlvt > 2) { /* ERR is LVT#3. */ ++ v = apic_read(APIC_LVTERR); ++ printk(KERN_DEBUG "... APIC LVTERR: %08x\n", v); ++ } ++ ++ v = apic_read(APIC_TMICT); ++ printk(KERN_DEBUG "... APIC TMICT: %08x\n", v); ++ v = apic_read(APIC_TMCCT); ++ printk(KERN_DEBUG "... APIC TMCCT: %08x\n", v); ++ v = apic_read(APIC_TDCR); ++ printk(KERN_DEBUG "... APIC TDCR: %08x\n", v); ++ printk("\n"); ++} ++ ++void print_all_local_APICs (void) ++{ ++ on_each_cpu(print_local_APIC, NULL, 1, 1); ++} ++ ++void /*__init*/ print_PIC(void) ++{ ++ unsigned int v; ++ unsigned long flags; ++ ++ if (apic_verbosity == APIC_QUIET) ++ return; ++ ++ printk(KERN_DEBUG "\nprinting PIC contents\n"); ++ ++ spin_lock_irqsave(&i8259A_lock, flags); ++ ++ v = inb(0xa1) << 8 | inb(0x21); ++ printk(KERN_DEBUG "... PIC IMR: %04x\n", v); ++ ++ v = inb(0xa0) << 8 | inb(0x20); ++ printk(KERN_DEBUG "... PIC IRR: %04x\n", v); ++ ++ outb(0x0b,0xa0); ++ outb(0x0b,0x20); ++ v = inb(0xa0) << 8 | inb(0x20); ++ outb(0x0a,0xa0); ++ outb(0x0a,0x20); ++ ++ spin_unlock_irqrestore(&i8259A_lock, flags); ++ ++ printk(KERN_DEBUG "... PIC ISR: %04x\n", v); ++ ++ v = inb(0x4d1) << 8 | inb(0x4d0); ++ printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); ++} ++#endif /* !CONFIG_XEN */ ++ ++static void __init enable_IO_APIC(void) ++{ ++ union IO_APIC_reg_01 reg_01; ++ int i8259_apic, i8259_pin; ++ int i, apic; ++ unsigned long flags; ++ ++ for (i = 0; i < PIN_MAP_SIZE; i++) { ++ irq_2_pin[i].pin = -1; ++ irq_2_pin[i].next = 0; ++ } ++ if (!pirqs_enabled) ++ for (i = 0; i < MAX_PIRQS; i++) ++ pirq_entries[i] = -1; ++ ++ /* ++ * The number of IO-APIC IRQ registers (== #pins): ++ */ ++ for (apic = 0; apic < nr_ioapics; apic++) { ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_01.raw = io_apic_read(apic, 1); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ nr_ioapic_registers[apic] = reg_01.bits.entries+1; ++ } ++ for(apic = 0; apic < nr_ioapics; apic++) { ++ int pin; ++ /* See if any of the pins is in ExtINT mode */ ++ for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { ++ struct IO_APIC_route_entry entry; ++ entry = ioapic_read_entry(apic, pin); ++ ++ ++ /* If the interrupt line is enabled and in ExtInt mode ++ * I have found the pin where the i8259 is connected. ++ */ ++ if ((entry.mask == 0) && (entry.delivery_mode == dest_ExtINT)) { ++ ioapic_i8259.apic = apic; ++ ioapic_i8259.pin = pin; ++ goto found_i8259; ++ } ++ } ++ } ++ found_i8259: ++ /* Look to see what if the MP table has reported the ExtINT */ ++ /* If we could not find the appropriate pin by looking at the ioapic ++ * the i8259 probably is not connected the ioapic but give the ++ * mptable a chance anyway. ++ */ ++ i8259_pin = find_isa_irq_pin(0, mp_ExtINT); ++ i8259_apic = find_isa_irq_apic(0, mp_ExtINT); ++ /* Trust the MP table if nothing is setup in the hardware */ ++ if ((ioapic_i8259.pin == -1) && (i8259_pin >= 0)) { ++ printk(KERN_WARNING "ExtINT not setup in hardware but reported by MP table\n"); ++ ioapic_i8259.pin = i8259_pin; ++ ioapic_i8259.apic = i8259_apic; ++ } ++ /* Complain if the MP table and the hardware disagree */ ++ if (((ioapic_i8259.apic != i8259_apic) || (ioapic_i8259.pin != i8259_pin)) && ++ (i8259_pin >= 0) && (ioapic_i8259.pin >= 0)) ++ { ++ printk(KERN_WARNING "ExtINT in hardware and MP table differ\n"); ++ } ++ ++ /* ++ * Do not trust the IO-APIC being empty at bootup ++ */ ++ clear_IO_APIC(); ++} ++ ++/* ++ * Not an __init, needed by the reboot code ++ */ ++void disable_IO_APIC(void) ++{ ++ /* ++ * Clear the IO-APIC before rebooting: ++ */ ++ clear_IO_APIC(); ++ ++#ifndef CONFIG_XEN ++ /* ++ * If the i8259 is routed through an IOAPIC ++ * Put that IOAPIC in virtual wire mode ++ * so legacy interrupts can be delivered. ++ */ ++ if (ioapic_i8259.pin != -1) { ++ struct IO_APIC_route_entry entry; ++ ++ memset(&entry, 0, sizeof(entry)); ++ entry.mask = 0; /* Enabled */ ++ entry.trigger = 0; /* Edge */ ++ entry.irr = 0; ++ entry.polarity = 0; /* High */ ++ entry.delivery_status = 0; ++ entry.dest_mode = 0; /* Physical */ ++ entry.delivery_mode = dest_ExtINT; /* ExtInt */ ++ entry.vector = 0; ++ entry.dest.physical.physical_dest = ++ GET_APIC_ID(apic_read(APIC_ID)); ++ ++ /* ++ * Add it to the IO-APIC irq-routing table: ++ */ ++ ioapic_write_entry(ioapic_i8259.apic, ioapic_i8259.pin, entry); ++ } ++ disconnect_bsp_APIC(ioapic_i8259.pin != -1); ++#endif ++} ++ ++/* ++ * function to set the IO-APIC physical IDs based on the ++ * values stored in the MPC table. ++ * ++ * by Matt Domsch Tue Dec 21 12:25:05 CST 1999 ++ */ ++ ++#if !defined(CONFIG_XEN) && !defined(CONFIG_X86_NUMAQ) ++static void __init setup_ioapic_ids_from_mpc(void) ++{ ++ union IO_APIC_reg_00 reg_00; ++ physid_mask_t phys_id_present_map; ++ int apic; ++ int i; ++ unsigned char old_id; ++ unsigned long flags; ++ ++ /* ++ * Don't check I/O APIC IDs for xAPIC systems. They have ++ * no meaning without the serial APIC bus. ++ */ ++ if (!(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) ++ || APIC_XAPIC(apic_version[boot_cpu_physical_apicid])) ++ return; ++ /* ++ * This is broken; anything with a real cpu count has to ++ * circumvent this idiocy regardless. ++ */ ++ phys_id_present_map = ioapic_phys_id_map(phys_cpu_present_map); ++ ++ /* ++ * Set the IOAPIC ID to the value stored in the MPC table. ++ */ ++ for (apic = 0; apic < nr_ioapics; apic++) { ++ ++ /* Read the register 0 value */ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_00.raw = io_apic_read(apic, 0); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ old_id = mp_ioapics[apic].mpc_apicid; ++ ++ if (mp_ioapics[apic].mpc_apicid >= get_physical_broadcast()) { ++ printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n", ++ apic, mp_ioapics[apic].mpc_apicid); ++ printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", ++ reg_00.bits.ID); ++ mp_ioapics[apic].mpc_apicid = reg_00.bits.ID; ++ } ++ ++ /* ++ * Sanity check, is the ID really free? Every APIC in a ++ * system must have a unique ID or we get lots of nice ++ * 'stuck on smp_invalidate_needed IPI wait' messages. ++ */ ++ if (check_apicid_used(phys_id_present_map, ++ mp_ioapics[apic].mpc_apicid)) { ++ printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", ++ apic, mp_ioapics[apic].mpc_apicid); ++ for (i = 0; i < get_physical_broadcast(); i++) ++ if (!physid_isset(i, phys_id_present_map)) ++ break; ++ if (i >= get_physical_broadcast()) ++ panic("Max APIC ID exceeded!\n"); ++ printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", ++ i); ++ physid_set(i, phys_id_present_map); ++ mp_ioapics[apic].mpc_apicid = i; ++ } else { ++ physid_mask_t tmp; ++ tmp = apicid_to_cpu_present(mp_ioapics[apic].mpc_apicid); ++ apic_printk(APIC_VERBOSE, "Setting %d in the " ++ "phys_id_present_map\n", ++ mp_ioapics[apic].mpc_apicid); ++ physids_or(phys_id_present_map, phys_id_present_map, tmp); ++ } ++ ++ ++ /* ++ * We need to adjust the IRQ routing table ++ * if the ID changed. ++ */ ++ if (old_id != mp_ioapics[apic].mpc_apicid) ++ for (i = 0; i < mp_irq_entries; i++) ++ if (mp_irqs[i].mpc_dstapic == old_id) ++ mp_irqs[i].mpc_dstapic ++ = mp_ioapics[apic].mpc_apicid; ++ ++ /* ++ * Read the right value from the MPC table and ++ * write it into the ID register. ++ */ ++ apic_printk(APIC_VERBOSE, KERN_INFO ++ "...changing IO-APIC physical APIC ID to %d ...", ++ mp_ioapics[apic].mpc_apicid); ++ ++ reg_00.bits.ID = mp_ioapics[apic].mpc_apicid; ++ spin_lock_irqsave(&ioapic_lock, flags); ++ io_apic_write(apic, 0, reg_00.raw); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ /* ++ * Sanity check ++ */ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_00.raw = io_apic_read(apic, 0); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ if (reg_00.bits.ID != mp_ioapics[apic].mpc_apicid) ++ printk("could not set ID!\n"); ++ else ++ apic_printk(APIC_VERBOSE, " ok.\n"); ++ } ++} ++#else ++static void __init setup_ioapic_ids_from_mpc(void) { } ++#endif ++ ++#ifndef CONFIG_XEN ++int no_timer_check __initdata; ++ ++static int __init notimercheck(char *s) ++{ ++ no_timer_check = 1; ++ return 1; ++} ++__setup("no_timer_check", notimercheck); ++ ++/* ++ * There is a nasty bug in some older SMP boards, their mptable lies ++ * about the timer IRQ. We do the following to work around the situation: ++ * ++ * - timer IRQ defaults to IO-APIC IRQ ++ * - if this function detects that timer IRQs are defunct, then we fall ++ * back to ISA timer IRQs ++ */ ++static int __init timer_irq_works(void) ++{ ++ unsigned long t1 = jiffies; ++ unsigned long flags; ++ ++ if (no_timer_check) ++ return 1; ++ ++ local_save_flags(flags); ++ local_irq_enable(); ++ /* Let ten ticks pass... */ ++ mdelay((10 * 1000) / HZ); ++ local_irq_restore(flags); ++ ++ /* ++ * Expect a few ticks at least, to be sure some possible ++ * glue logic does not lock up after one or two first ++ * ticks in a non-ExtINT mode. Also the local APIC ++ * might have cached one ExtINT interrupt. Finally, at ++ * least one tick may be lost due to delays. ++ */ ++ if (jiffies - t1 > 4) ++ return 1; ++ ++ return 0; ++} ++ ++/* ++ * In the SMP+IOAPIC case it might happen that there are an unspecified ++ * number of pending IRQ events unhandled. These cases are very rare, ++ * so we 'resend' these IRQs via IPIs, to the same CPU. It's much ++ * better to do it this way as thus we do not have to be aware of ++ * 'pending' interrupts in the IRQ path, except at this point. ++ */ ++/* ++ * Edge triggered needs to resend any interrupt ++ * that was delayed but this is now handled in the device ++ * independent code. ++ */ ++ ++/* ++ * Startup quirk: ++ * ++ * Starting up a edge-triggered IO-APIC interrupt is ++ * nasty - we need to make sure that we get the edge. ++ * If it is already asserted for some reason, we need ++ * return 1 to indicate that is was pending. ++ * ++ * This is not complete - we should be able to fake ++ * an edge even if it isn't on the 8259A... ++ * ++ * (We do this for level-triggered IRQs too - it cannot hurt.) ++ */ ++static unsigned int startup_ioapic_irq(unsigned int irq) ++{ ++ int was_pending = 0; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ if (irq < 16) { ++ disable_8259A_irq(irq); ++ if (i8259A_irq_pending(irq)) ++ was_pending = 1; ++ } ++ __unmask_IO_APIC_irq(irq); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ return was_pending; ++} ++ ++static void ack_ioapic_irq(unsigned int irq) ++{ ++ move_native_irq(irq); ++ ack_APIC_irq(); ++} ++ ++static void ack_ioapic_quirk_irq(unsigned int irq) ++{ ++ unsigned long v; ++ int i; ++ ++ move_native_irq(irq); ++/* ++ * It appears there is an erratum which affects at least version 0x11 ++ * of I/O APIC (that's the 82093AA and cores integrated into various ++ * chipsets). Under certain conditions a level-triggered interrupt is ++ * erroneously delivered as edge-triggered one but the respective IRR ++ * bit gets set nevertheless. As a result the I/O unit expects an EOI ++ * message but it will never arrive and further interrupts are blocked ++ * from the source. The exact reason is so far unknown, but the ++ * phenomenon was observed when two consecutive interrupt requests ++ * from a given source get delivered to the same CPU and the source is ++ * temporarily disabled in between. ++ * ++ * A workaround is to simulate an EOI message manually. We achieve it ++ * by setting the trigger mode to edge and then to level when the edge ++ * trigger mode gets detected in the TMR of a local APIC for a ++ * level-triggered interrupt. We mask the source for the time of the ++ * operation to prevent an edge-triggered interrupt escaping meanwhile. ++ * The idea is from Manfred Spraul. --macro ++ */ ++ i = irq_vector[irq]; ++ ++ v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1)); ++ ++ ack_APIC_irq(); ++ ++ if (!(v & (1 << (i & 0x1f)))) { ++ atomic_inc(&irq_mis_count); ++ spin_lock(&ioapic_lock); ++ __mask_and_edge_IO_APIC_irq(irq); ++ __unmask_and_level_IO_APIC_irq(irq); ++ spin_unlock(&ioapic_lock); ++ } ++} ++ ++static int ioapic_retrigger_irq(unsigned int irq) ++{ ++ send_IPI_self(irq_vector[irq]); ++ ++ return 1; ++} ++ ++static struct irq_chip ioapic_chip __read_mostly = { ++ .name = "IO-APIC", ++ .startup = startup_ioapic_irq, ++ .mask = mask_IO_APIC_irq, ++ .unmask = unmask_IO_APIC_irq, ++ .ack = ack_ioapic_irq, ++ .eoi = ack_ioapic_quirk_irq, ++#ifdef CONFIG_SMP ++ .set_affinity = set_ioapic_affinity_irq, ++#endif ++ .retrigger = ioapic_retrigger_irq, ++}; ++#endif /* !CONFIG_XEN */ ++ ++static inline void init_IO_APIC_traps(void) ++{ ++ int irq; ++ ++ /* ++ * NOTE! The local APIC isn't very good at handling ++ * multiple interrupts at the same interrupt level. ++ * As the interrupt level is determined by taking the ++ * vector number and shifting that right by 4, we ++ * want to spread these out a bit so that they don't ++ * all fall in the same interrupt level. ++ * ++ * Also, we've got to be careful not to trash gate ++ * 0x80, because int 0x80 is hm, kind of importantish. ;) ++ */ ++ for (irq = 0; irq < NR_IRQS ; irq++) { ++ int tmp = irq; ++ if (IO_APIC_IRQ(tmp) && !irq_vector[tmp]) { ++ /* ++ * Hmm.. We don't have an entry for this, ++ * so default to an old-fashioned 8259 ++ * interrupt if we can.. ++ */ ++ if (irq < 16) ++ make_8259A_irq(irq); ++#ifndef CONFIG_XEN ++ else ++ /* Strange. Oh, well.. */ ++ irq_desc[irq].chip = &no_irq_chip; ++#endif ++ } ++ } ++} ++ ++#ifndef CONFIG_XEN ++/* ++ * The local APIC irq-chip implementation: ++ */ ++ ++static void ack_apic(unsigned int irq) ++{ ++ ack_APIC_irq(); ++} ++ ++static void mask_lapic_irq (unsigned int irq) ++{ ++ unsigned long v; ++ ++ v = apic_read(APIC_LVT0); ++ apic_write_around(APIC_LVT0, v | APIC_LVT_MASKED); ++} ++ ++static void unmask_lapic_irq (unsigned int irq) ++{ ++ unsigned long v; ++ ++ v = apic_read(APIC_LVT0); ++ apic_write_around(APIC_LVT0, v & ~APIC_LVT_MASKED); ++} ++ ++static struct irq_chip lapic_chip __read_mostly = { ++ .name = "local-APIC-edge", ++ .mask = mask_lapic_irq, ++ .unmask = unmask_lapic_irq, ++ .eoi = ack_apic, ++}; ++ ++static void setup_nmi (void) ++{ ++ /* ++ * Dirty trick to enable the NMI watchdog ... ++ * We put the 8259A master into AEOI mode and ++ * unmask on all local APICs LVT0 as NMI. ++ * ++ * The idea to use the 8259A in AEOI mode ('8259A Virtual Wire') ++ * is from Maciej W. Rozycki - so we do not have to EOI from ++ * the NMI handler or the timer interrupt. ++ */ ++ apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ..."); ++ ++ on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1); ++ ++ apic_printk(APIC_VERBOSE, " done.\n"); ++} ++ ++/* ++ * This looks a bit hackish but it's about the only one way of sending ++ * a few INTA cycles to 8259As and any associated glue logic. ICR does ++ * not support the ExtINT mode, unfortunately. We need to send these ++ * cycles as some i82489DX-based boards have glue logic that keeps the ++ * 8259A interrupt line asserted until INTA. --macro ++ */ ++static inline void unlock_ExtINT_logic(void) ++{ ++ int apic, pin, i; ++ struct IO_APIC_route_entry entry0, entry1; ++ unsigned char save_control, save_freq_select; ++ ++ pin = find_isa_irq_pin(8, mp_INT); ++ if (pin == -1) { ++ WARN_ON_ONCE(1); ++ return; ++ } ++ apic = find_isa_irq_apic(8, mp_INT); ++ if (apic == -1) { ++ WARN_ON_ONCE(1); ++ return; ++ } ++ ++ entry0 = ioapic_read_entry(apic, pin); ++ clear_IO_APIC_pin(apic, pin); ++ ++ memset(&entry1, 0, sizeof(entry1)); ++ ++ entry1.dest_mode = 0; /* physical delivery */ ++ entry1.mask = 0; /* unmask IRQ now */ ++ entry1.dest.physical.physical_dest = hard_smp_processor_id(); ++ entry1.delivery_mode = dest_ExtINT; ++ entry1.polarity = entry0.polarity; ++ entry1.trigger = 0; ++ entry1.vector = 0; ++ ++ ioapic_write_entry(apic, pin, entry1); ++ ++ save_control = CMOS_READ(RTC_CONTROL); ++ save_freq_select = CMOS_READ(RTC_FREQ_SELECT); ++ CMOS_WRITE((save_freq_select & ~RTC_RATE_SELECT) | 0x6, ++ RTC_FREQ_SELECT); ++ CMOS_WRITE(save_control | RTC_PIE, RTC_CONTROL); ++ ++ i = 100; ++ while (i-- > 0) { ++ mdelay(10); ++ if ((CMOS_READ(RTC_INTR_FLAGS) & RTC_PF) == RTC_PF) ++ i -= 10; ++ } ++ ++ CMOS_WRITE(save_control, RTC_CONTROL); ++ CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); ++ clear_IO_APIC_pin(apic, pin); ++ ++ ioapic_write_entry(apic, pin, entry0); ++} ++ ++int timer_uses_ioapic_pin_0; ++ ++/* ++ * This code may look a bit paranoid, but it's supposed to cooperate with ++ * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ ++ * is so screwy. Thanks to Brian Perkins for testing/hacking this beast ++ * fanatically on his truly buggy board. ++ */ ++static inline void __init check_timer(void) ++{ ++ int apic1, pin1, apic2, pin2; ++ int vector; ++ unsigned int ver; ++ unsigned long flags; ++ ++ local_irq_save(flags); ++ ++ ver = apic_read(APIC_LVR); ++ ver = GET_APIC_VERSION(ver); ++ ++ /* ++ * get/set the timer IRQ vector: ++ */ ++ disable_8259A_irq(0); ++ vector = assign_irq_vector(0); ++ set_intr_gate(vector, interrupt[0]); ++ ++ /* ++ * Subtle, code in do_timer_interrupt() expects an AEOI ++ * mode for the 8259A whenever interrupts are routed ++ * through I/O APICs. Also IRQ0 has to be enabled in ++ * the 8259A which implies the virtual wire has to be ++ * disabled in the local APIC. Finally timer interrupts ++ * need to be acknowledged manually in the 8259A for ++ * timer_interrupt() and for the i82489DX when using ++ * the NMI watchdog. ++ */ ++ apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); ++ init_8259A(1); ++ timer_ack = !cpu_has_tsc; ++ timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver)); ++ if (timer_over_8254 > 0) ++ enable_8259A_irq(0); ++ ++ pin1 = find_isa_irq_pin(0, mp_INT); ++ apic1 = find_isa_irq_apic(0, mp_INT); ++ pin2 = ioapic_i8259.pin; ++ apic2 = ioapic_i8259.apic; ++ ++ if (pin1 == 0) ++ timer_uses_ioapic_pin_0 = 1; ++ ++ printk(KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", ++ vector, apic1, pin1, apic2, pin2); ++ ++ if (pin1 != -1) { ++ /* ++ * Ok, does IRQ0 through the IOAPIC work? ++ */ ++ unmask_IO_APIC_irq(0); ++ if (timer_irq_works()) { ++ if (nmi_watchdog == NMI_IO_APIC) { ++ disable_8259A_irq(0); ++ setup_nmi(); ++ enable_8259A_irq(0); ++ } ++ if (disable_timer_pin_1 > 0) ++ clear_IO_APIC_pin(0, pin1); ++ goto out; ++ } ++ clear_IO_APIC_pin(apic1, pin1); ++ printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to " ++ "IO-APIC\n"); ++ } ++ ++ printk(KERN_INFO "...trying to set up timer (IRQ0) through the 8259A ... "); ++ if (pin2 != -1) { ++ printk("\n..... (found pin %d) ...", pin2); ++ /* ++ * legacy devices should be connected to IO APIC #0 ++ */ ++ setup_ExtINT_IRQ0_pin(apic2, pin2, vector); ++ if (timer_irq_works()) { ++ printk("works.\n"); ++ if (pin1 != -1) ++ replace_pin_at_irq(0, apic1, pin1, apic2, pin2); ++ else ++ add_pin_to_irq(0, apic2, pin2); ++ if (nmi_watchdog == NMI_IO_APIC) { ++ setup_nmi(); ++ } ++ goto out; ++ } ++ /* ++ * Cleanup, just in case ... ++ */ ++ clear_IO_APIC_pin(apic2, pin2); ++ } ++ printk(" failed.\n"); ++ ++ if (nmi_watchdog == NMI_IO_APIC) { ++ printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n"); ++ nmi_watchdog = 0; ++ } ++ ++ printk(KERN_INFO "...trying to set up timer as Virtual Wire IRQ..."); ++ ++ disable_8259A_irq(0); ++ set_irq_chip_and_handler_name(0, &lapic_chip, handle_fasteoi_irq, ++ "fasteoi"); ++ apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */ ++ enable_8259A_irq(0); ++ ++ if (timer_irq_works()) { ++ printk(" works.\n"); ++ goto out; ++ } ++ apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector); ++ printk(" failed.\n"); ++ ++ printk(KERN_INFO "...trying to set up timer as ExtINT IRQ..."); ++ ++ timer_ack = 0; ++ init_8259A(0); ++ make_8259A_irq(0); ++ apic_write_around(APIC_LVT0, APIC_DM_EXTINT); ++ ++ unlock_ExtINT_logic(); ++ ++ if (timer_irq_works()) { ++ printk(" works.\n"); ++ goto out; ++ } ++ printk(" failed :(.\n"); ++ panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a " ++ "report. Then try booting with the 'noapic' option"); ++out: ++ local_irq_restore(flags); ++} ++#else ++int timer_uses_ioapic_pin_0 = 0; ++#define check_timer() ((void)0) ++#endif ++ ++/* ++ * ++ * IRQ's that are handled by the PIC in the MPS IOAPIC case. ++ * - IRQ2 is the cascade IRQ, and cannot be a io-apic IRQ. ++ * Linux doesn't really care, as it's not actually used ++ * for any interrupt handling anyway. ++ */ ++#define PIC_IRQS (1 << PIC_CASCADE_IR) ++ ++void __init setup_IO_APIC(void) ++{ ++#ifndef CONFIG_XEN ++ int i; ++ ++ /* Reserve all the system vectors. */ ++ for (i = FIRST_SYSTEM_VECTOR; i < NR_VECTORS; i++) ++ set_bit(i, used_vectors); ++#endif ++ ++ enable_IO_APIC(); ++ ++ if (acpi_ioapic) ++ io_apic_irqs = ~0; /* all IRQs go through IOAPIC */ ++ else ++ io_apic_irqs = ~PIC_IRQS; ++ ++ printk("ENABLING IO-APIC IRQs\n"); ++ ++ /* ++ * Set up IO-APIC IRQ routing. ++ */ ++ if (!acpi_ioapic) ++ setup_ioapic_ids_from_mpc(); ++#ifndef CONFIG_XEN ++ sync_Arb_IDs(); ++#endif ++ setup_IO_APIC_irqs(); ++ init_IO_APIC_traps(); ++ check_timer(); ++ if (!acpi_ioapic) ++ print_IO_APIC(); ++} ++ ++#ifndef CONFIG_XEN ++static int __init setup_disable_8254_timer(char *s) ++{ ++ timer_over_8254 = -1; ++ return 1; ++} ++static int __init setup_enable_8254_timer(char *s) ++{ ++ timer_over_8254 = 2; ++ return 1; ++} ++ ++__setup("disable_8254_timer", setup_disable_8254_timer); ++__setup("enable_8254_timer", setup_enable_8254_timer); ++#endif ++ ++/* ++ * Called after all the initialization is done. If we didnt find any ++ * APIC bugs then we can allow the modify fast path ++ */ ++ ++static int __init io_apic_bug_finalize(void) ++{ ++ if(sis_apic_bug == -1) ++ sis_apic_bug = 0; ++ if (is_initial_xendomain()) { ++ struct xen_platform_op op = { .cmd = XENPF_platform_quirk }; ++ op.u.platform_quirk.quirk_id = sis_apic_bug ? ++ QUIRK_IOAPIC_BAD_REGSEL : QUIRK_IOAPIC_GOOD_REGSEL; ++ HYPERVISOR_platform_op(&op); ++ } ++ return 0; ++} ++ ++late_initcall(io_apic_bug_finalize); ++ ++struct sysfs_ioapic_data { ++ struct sys_device dev; ++ struct IO_APIC_route_entry entry[0]; ++}; ++static struct sysfs_ioapic_data * mp_ioapic_data[MAX_IO_APICS]; ++ ++static int ioapic_suspend(struct sys_device *dev, pm_message_t state) ++{ ++ struct IO_APIC_route_entry *entry; ++ struct sysfs_ioapic_data *data; ++ int i; ++ ++ data = container_of(dev, struct sysfs_ioapic_data, dev); ++ entry = data->entry; ++ for (i = 0; i < nr_ioapic_registers[dev->id]; i ++) ++ entry[i] = ioapic_read_entry(dev->id, i); ++ ++ return 0; ++} ++ ++static int ioapic_resume(struct sys_device *dev) ++{ ++ struct IO_APIC_route_entry *entry; ++ struct sysfs_ioapic_data *data; ++ unsigned long flags; ++ union IO_APIC_reg_00 reg_00; ++ int i; ++ ++ data = container_of(dev, struct sysfs_ioapic_data, dev); ++ entry = data->entry; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_00.raw = io_apic_read(dev->id, 0); ++ if (reg_00.bits.ID != mp_ioapics[dev->id].mpc_apicid) { ++ reg_00.bits.ID = mp_ioapics[dev->id].mpc_apicid; ++ io_apic_write(dev->id, 0, reg_00.raw); ++ } ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ for (i = 0; i < nr_ioapic_registers[dev->id]; i ++) ++ ioapic_write_entry(dev->id, i, entry[i]); ++ ++ return 0; ++} ++ ++static struct sysdev_class ioapic_sysdev_class = { ++ set_kset_name("ioapic"), ++ .suspend = ioapic_suspend, ++ .resume = ioapic_resume, ++}; ++ ++static int __init ioapic_init_sysfs(void) ++{ ++ struct sys_device * dev; ++ int i, size, error = 0; ++ ++ error = sysdev_class_register(&ioapic_sysdev_class); ++ if (error) ++ return error; ++ ++ for (i = 0; i < nr_ioapics; i++ ) { ++ size = sizeof(struct sys_device) + nr_ioapic_registers[i] ++ * sizeof(struct IO_APIC_route_entry); ++ mp_ioapic_data[i] = kmalloc(size, GFP_KERNEL); ++ if (!mp_ioapic_data[i]) { ++ printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i); ++ continue; ++ } ++ memset(mp_ioapic_data[i], 0, size); ++ dev = &mp_ioapic_data[i]->dev; ++ dev->id = i; ++ dev->cls = &ioapic_sysdev_class; ++ error = sysdev_register(dev); ++ if (error) { ++ kfree(mp_ioapic_data[i]); ++ mp_ioapic_data[i] = NULL; ++ printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i); ++ continue; ++ } ++ } ++ ++ return 0; ++} ++ ++device_initcall(ioapic_init_sysfs); ++ ++#ifndef CONFIG_XEN ++/* ++ * Dynamic irq allocate and deallocation ++ */ ++int create_irq(void) ++{ ++ /* Allocate an unused irq */ ++ int irq, new, vector = 0; ++ unsigned long flags; ++ ++ irq = -ENOSPC; ++ spin_lock_irqsave(&vector_lock, flags); ++ for (new = (NR_IRQS - 1); new >= 0; new--) { ++ if (platform_legacy_irq(new)) ++ continue; ++ if (irq_vector[new] != 0) ++ continue; ++ vector = __assign_irq_vector(new); ++ if (likely(vector > 0)) ++ irq = new; ++ break; ++ } ++ spin_unlock_irqrestore(&vector_lock, flags); ++ ++ if (irq >= 0) { ++ set_intr_gate(vector, interrupt[irq]); ++ dynamic_irq_init(irq); ++ } ++ return irq; ++} ++ ++void destroy_irq(unsigned int irq) ++{ ++ unsigned long flags; ++ ++ dynamic_irq_cleanup(irq); ++ ++ spin_lock_irqsave(&vector_lock, flags); ++ irq_vector[irq] = 0; ++ spin_unlock_irqrestore(&vector_lock, flags); ++} ++#endif ++ ++/* ++ * MSI message composition ++ */ ++#ifdef CONFIG_PCI_MSI ++static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msg *msg) ++{ ++ int vector; ++ unsigned dest; ++ ++ vector = assign_irq_vector(irq); ++ if (vector >= 0) { ++ dest = cpu_mask_to_apicid(TARGET_CPUS); ++ ++ msg->address_hi = MSI_ADDR_BASE_HI; ++ msg->address_lo = ++ MSI_ADDR_BASE_LO | ++ ((INT_DEST_MODE == 0) ? ++ MSI_ADDR_DEST_MODE_PHYSICAL: ++ MSI_ADDR_DEST_MODE_LOGICAL) | ++ ((INT_DELIVERY_MODE != dest_LowestPrio) ? ++ MSI_ADDR_REDIRECTION_CPU: ++ MSI_ADDR_REDIRECTION_LOWPRI) | ++ MSI_ADDR_DEST_ID(dest); ++ ++ msg->data = ++ MSI_DATA_TRIGGER_EDGE | ++ MSI_DATA_LEVEL_ASSERT | ++ ((INT_DELIVERY_MODE != dest_LowestPrio) ? ++ MSI_DATA_DELIVERY_FIXED: ++ MSI_DATA_DELIVERY_LOWPRI) | ++ MSI_DATA_VECTOR(vector); ++ } ++ return vector; ++} ++ ++#ifdef CONFIG_SMP ++static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask) ++{ ++ struct msi_msg msg; ++ unsigned int dest; ++ cpumask_t tmp; ++ int vector; ++ ++ cpus_and(tmp, mask, cpu_online_map); ++ if (cpus_empty(tmp)) ++ tmp = TARGET_CPUS; ++ ++ vector = assign_irq_vector(irq); ++ if (vector < 0) ++ return; ++ ++ dest = cpu_mask_to_apicid(mask); ++ ++ read_msi_msg(irq, &msg); ++ ++ msg.data &= ~MSI_DATA_VECTOR_MASK; ++ msg.data |= MSI_DATA_VECTOR(vector); ++ msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK; ++ msg.address_lo |= MSI_ADDR_DEST_ID(dest); ++ ++ write_msi_msg(irq, &msg); ++ irq_desc[irq].affinity = mask; ++} ++#endif /* CONFIG_SMP */ ++ ++/* ++ * IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices, ++ * which implement the MSI or MSI-X Capability Structure. ++ */ ++static struct irq_chip msi_chip = { ++ .name = "PCI-MSI", ++ .unmask = unmask_msi_irq, ++ .mask = mask_msi_irq, ++ .ack = ack_ioapic_irq, ++#ifdef CONFIG_SMP ++ .set_affinity = set_msi_irq_affinity, ++#endif ++ .retrigger = ioapic_retrigger_irq, ++}; ++ ++int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) ++{ ++ struct msi_msg msg; ++ int irq, ret; ++ irq = create_irq(); ++ if (irq < 0) ++ return irq; ++ ++ ret = msi_compose_msg(dev, irq, &msg); ++ if (ret < 0) { ++ destroy_irq(irq); ++ return ret; ++ } ++ ++ set_irq_msi(irq, desc); ++ write_msi_msg(irq, &msg); ++ ++ set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, ++ "edge"); ++ ++ return 0; ++} ++ ++void arch_teardown_msi_irq(unsigned int irq) ++{ ++ destroy_irq(irq); ++} ++ ++#endif /* CONFIG_PCI_MSI */ ++ ++/* ++ * Hypertransport interrupt support ++ */ ++#ifdef CONFIG_HT_IRQ ++ ++#ifdef CONFIG_SMP ++ ++static void target_ht_irq(unsigned int irq, unsigned int dest) ++{ ++ struct ht_irq_msg msg; ++ fetch_ht_irq_msg(irq, &msg); ++ ++ msg.address_lo &= ~(HT_IRQ_LOW_DEST_ID_MASK); ++ msg.address_hi &= ~(HT_IRQ_HIGH_DEST_ID_MASK); ++ ++ msg.address_lo |= HT_IRQ_LOW_DEST_ID(dest); ++ msg.address_hi |= HT_IRQ_HIGH_DEST_ID(dest); ++ ++ write_ht_irq_msg(irq, &msg); ++} ++ ++static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask) ++{ ++ unsigned int dest; ++ cpumask_t tmp; ++ ++ cpus_and(tmp, mask, cpu_online_map); ++ if (cpus_empty(tmp)) ++ tmp = TARGET_CPUS; ++ ++ cpus_and(mask, tmp, CPU_MASK_ALL); ++ ++ dest = cpu_mask_to_apicid(mask); ++ ++ target_ht_irq(irq, dest); ++ irq_desc[irq].affinity = mask; ++} ++#endif ++ ++static struct irq_chip ht_irq_chip = { ++ .name = "PCI-HT", ++ .mask = mask_ht_irq, ++ .unmask = unmask_ht_irq, ++ .ack = ack_ioapic_irq, ++#ifdef CONFIG_SMP ++ .set_affinity = set_ht_irq_affinity, ++#endif ++ .retrigger = ioapic_retrigger_irq, ++}; ++ ++int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) ++{ ++ int vector; ++ ++ vector = assign_irq_vector(irq); ++ if (vector >= 0) { ++ struct ht_irq_msg msg; ++ unsigned dest; ++ cpumask_t tmp; ++ ++ cpus_clear(tmp); ++ cpu_set(vector >> 8, tmp); ++ dest = cpu_mask_to_apicid(tmp); ++ ++ msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest); ++ ++ msg.address_lo = ++ HT_IRQ_LOW_BASE | ++ HT_IRQ_LOW_DEST_ID(dest) | ++ HT_IRQ_LOW_VECTOR(vector) | ++ ((INT_DEST_MODE == 0) ? ++ HT_IRQ_LOW_DM_PHYSICAL : ++ HT_IRQ_LOW_DM_LOGICAL) | ++ HT_IRQ_LOW_RQEOI_EDGE | ++ ((INT_DELIVERY_MODE != dest_LowestPrio) ? ++ HT_IRQ_LOW_MT_FIXED : ++ HT_IRQ_LOW_MT_ARBITRATED) | ++ HT_IRQ_LOW_IRQ_MASKED; ++ ++ write_ht_irq_msg(irq, &msg); ++ ++ set_irq_chip_and_handler_name(irq, &ht_irq_chip, ++ handle_edge_irq, "edge"); ++ } ++ return vector; ++} ++#endif /* CONFIG_HT_IRQ */ ++ ++/* -------------------------------------------------------------------------- ++ ACPI-based IOAPIC Configuration ++ -------------------------------------------------------------------------- */ ++ ++#ifdef CONFIG_ACPI ++ ++int __init io_apic_get_unique_id (int ioapic, int apic_id) ++{ ++#ifndef CONFIG_XEN ++ union IO_APIC_reg_00 reg_00; ++ static physid_mask_t apic_id_map = PHYSID_MASK_NONE; ++ physid_mask_t tmp; ++ unsigned long flags; ++ int i = 0; ++ ++ /* ++ * The P4 platform supports up to 256 APIC IDs on two separate APIC ++ * buses (one for LAPICs, one for IOAPICs), where predecessors only ++ * supports up to 16 on one shared APIC bus. ++ * ++ * TBD: Expand LAPIC/IOAPIC support on P4-class systems to take full ++ * advantage of new APIC bus architecture. ++ */ ++ ++ if (physids_empty(apic_id_map)) ++ apic_id_map = ioapic_phys_id_map(phys_cpu_present_map); ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_00.raw = io_apic_read(ioapic, 0); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ if (apic_id >= get_physical_broadcast()) { ++ printk(KERN_WARNING "IOAPIC[%d]: Invalid apic_id %d, trying " ++ "%d\n", ioapic, apic_id, reg_00.bits.ID); ++ apic_id = reg_00.bits.ID; ++ } ++ ++ /* ++ * Every APIC in a system must have a unique ID or we get lots of nice ++ * 'stuck on smp_invalidate_needed IPI wait' messages. ++ */ ++ if (check_apicid_used(apic_id_map, apic_id)) { ++ ++ for (i = 0; i < get_physical_broadcast(); i++) { ++ if (!check_apicid_used(apic_id_map, i)) ++ break; ++ } ++ ++ if (i == get_physical_broadcast()) ++ panic("Max apic_id exceeded!\n"); ++ ++ printk(KERN_WARNING "IOAPIC[%d]: apic_id %d already used, " ++ "trying %d\n", ioapic, apic_id, i); ++ ++ apic_id = i; ++ } ++ ++ tmp = apicid_to_cpu_present(apic_id); ++ physids_or(apic_id_map, apic_id_map, tmp); ++ ++ if (reg_00.bits.ID != apic_id) { ++ reg_00.bits.ID = apic_id; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ io_apic_write(ioapic, 0, reg_00.raw); ++ reg_00.raw = io_apic_read(ioapic, 0); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ /* Sanity check */ ++ if (reg_00.bits.ID != apic_id) { ++ printk("IOAPIC[%d]: Unable to change apic_id!\n", ioapic); ++ return -1; ++ } ++ } ++ ++ apic_printk(APIC_VERBOSE, KERN_INFO ++ "IOAPIC[%d]: Assigned apic_id %d\n", ioapic, apic_id); ++#endif /* !CONFIG_XEN */ ++ ++ return apic_id; ++} ++ ++ ++int __init io_apic_get_version (int ioapic) ++{ ++ union IO_APIC_reg_01 reg_01; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_01.raw = io_apic_read(ioapic, 1); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ return reg_01.bits.version; ++} ++ ++ ++int __init io_apic_get_redir_entries (int ioapic) ++{ ++ union IO_APIC_reg_01 reg_01; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_01.raw = io_apic_read(ioapic, 1); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ return reg_01.bits.entries; ++} ++ ++ ++int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low) ++{ ++ struct IO_APIC_route_entry entry; ++ unsigned long flags; ++ ++ if (!IO_APIC_IRQ(irq)) { ++ printk(KERN_ERR "IOAPIC[%d]: Invalid reference to IRQ 0\n", ++ ioapic); ++ return -EINVAL; ++ } ++ ++ /* ++ * Generate a PCI IRQ routing entry and program the IOAPIC accordingly. ++ * Note that we mask (disable) IRQs now -- these get enabled when the ++ * corresponding device driver registers for this IRQ. ++ */ ++ ++ memset(&entry,0,sizeof(entry)); ++ ++ entry.delivery_mode = INT_DELIVERY_MODE; ++ entry.dest_mode = INT_DEST_MODE; ++ entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); ++ entry.trigger = edge_level; ++ entry.polarity = active_high_low; ++ entry.mask = 1; ++ ++ /* ++ * IRQs < 16 are already in the irq_2_pin[] map ++ */ ++ if (irq >= 16) ++ add_pin_to_irq(irq, ioapic, pin); ++ ++ entry.vector = assign_irq_vector(irq); ++ ++ apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry " ++ "(%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i)\n", ioapic, ++ mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq, ++ edge_level, active_high_low); ++ ++ ioapic_register_intr(irq, entry.vector, edge_level); ++ ++ if (!ioapic && (irq < 16)) ++ disable_8259A_irq(irq); ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ __ioapic_write_entry(ioapic, pin, entry); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ return 0; ++} ++ ++int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity) ++{ ++ int i; ++ ++ if (skip_ioapic_setup) ++ return -1; ++ ++ for (i = 0; i < mp_irq_entries; i++) ++ if (mp_irqs[i].mpc_irqtype == mp_INT && ++ mp_irqs[i].mpc_srcbusirq == bus_irq) ++ break; ++ if (i >= mp_irq_entries) ++ return -1; ++ ++ *trigger = irq_trigger(i); ++ *polarity = irq_polarity(i); ++ return 0; ++} ++ ++#endif /* CONFIG_ACPI */ ++ ++#ifndef CONFIG_XEN ++static int __init parse_disable_timer_pin_1(char *arg) ++{ ++ disable_timer_pin_1 = 1; ++ return 0; ++} ++early_param("disable_timer_pin_1", parse_disable_timer_pin_1); ++ ++static int __init parse_enable_timer_pin_1(char *arg) ++{ ++ disable_timer_pin_1 = -1; ++ return 0; ++} ++early_param("enable_timer_pin_1", parse_enable_timer_pin_1); ++#endif ++ ++static int __init parse_noapic(char *arg) ++{ ++ /* disable IO-APIC */ ++ disable_ioapic_setup(); ++ return 0; ++} ++early_param("noapic", parse_noapic); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/io_apic_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/io_apic_64-xen.c +--- ./arch/x86/kernel/io_apic_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/io_apic_64-xen.c 2012-11-13 15:20:17.300569001 +0000 +@@ -0,0 +1,2298 @@ ++/* ++ * Intel IO-APIC support for multi-Pentium hosts. ++ * ++ * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar, Hajnalka Szabo ++ * ++ * Many thanks to Stig Venaas for trying out countless experimental ++ * patches and reporting/debugging problems patiently! ++ * ++ * (c) 1999, Multiple IO-APIC support, developed by ++ * Ken-ichi Yaku and ++ * Hidemi Kishimoto , ++ * further tested and cleaned up by Zach Brown ++ * and Ingo Molnar ++ * ++ * Fixes ++ * Maciej W. Rozycki : Bits for genuine 82489DX APICs; ++ * thanks to Eric Gilmore ++ * and Rolf G. Tews ++ * for testing these extensively ++ * Paul Diefenbaugh : Added full ACPI support ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_ACPI ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++struct irq_cfg { ++#ifndef CONFIG_XEN ++ cpumask_t domain; ++ cpumask_t old_domain; ++#endif ++ unsigned move_cleanup_count; ++ u8 vector; ++ u8 move_in_progress : 1; ++}; ++ ++/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */ ++struct irq_cfg irq_cfg[NR_IRQS] __read_mostly; ++ ++static int assign_irq_vector(int irq, cpumask_t mask); ++ ++#define __apicdebuginit __init ++ ++int sis_apic_bug; /* not actually supported, dummy for compile */ ++ ++#ifdef CONFIG_XEN ++#include ++#include ++ ++/* Fake i8259 */ ++#define make_8259A_irq(_irq) (io_apic_irqs &= ~(1UL<<(_irq))) ++#define disable_8259A_irq(_irq) ((void)0) ++#define i8259A_irq_pending(_irq) (0) ++ ++unsigned long io_apic_irqs; ++ ++#define clear_IO_APIC() ((void)0) ++#else ++static int no_timer_check; ++ ++static int disable_timer_pin_1 __initdata; ++ ++int timer_over_8254 __initdata = 1; ++ ++/* Where if anywhere is the i8259 connect in external int mode */ ++static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; ++#endif ++ ++static DEFINE_SPINLOCK(ioapic_lock); ++DEFINE_SPINLOCK(vector_lock); ++ ++/* ++ * # of IRQ routing registers ++ */ ++int nr_ioapic_registers[MAX_IO_APICS]; ++ ++/* ++ * Rough estimation of how many shared IRQs there are, can ++ * be changed anytime. ++ */ ++#define MAX_PLUS_SHARED_IRQS NR_IRQS ++#define PIN_MAP_SIZE (MAX_PLUS_SHARED_IRQS + NR_IRQS) ++ ++/* ++ * This is performance-critical, we want to do it O(1) ++ * ++ * the indexing order of this array favors 1:1 mappings ++ * between pins and IRQs. ++ */ ++ ++static struct irq_pin_list { ++ short apic, pin, next; ++} irq_2_pin[PIN_MAP_SIZE]; ++ ++#ifndef CONFIG_XEN ++struct io_apic { ++ unsigned int index; ++ unsigned int unused[3]; ++ unsigned int data; ++}; ++ ++static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx) ++{ ++ return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx) ++ + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK); ++} ++#endif ++ ++static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) ++{ ++#ifndef CONFIG_XEN ++ struct io_apic __iomem *io_apic = io_apic_base(apic); ++ writel(reg, &io_apic->index); ++ return readl(&io_apic->data); ++#else ++ struct physdev_apic apic_op; ++ int ret; ++ ++ apic_op.apic_physbase = mp_ioapics[apic].mpc_apicaddr; ++ apic_op.reg = reg; ++ ret = HYPERVISOR_physdev_op(PHYSDEVOP_apic_read, &apic_op); ++ if (ret) ++ return ret; ++ return apic_op.value; ++#endif ++} ++ ++static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) ++{ ++#ifndef CONFIG_XEN ++ struct io_apic __iomem *io_apic = io_apic_base(apic); ++ writel(reg, &io_apic->index); ++ writel(value, &io_apic->data); ++#else ++ struct physdev_apic apic_op; ++ ++ apic_op.apic_physbase = mp_ioapics[apic].mpc_apicaddr; ++ apic_op.reg = reg; ++ apic_op.value = value; ++ HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op); ++#endif ++} ++ ++#ifdef CONFIG_XEN ++#define io_apic_modify io_apic_write ++#else ++/* ++ * Re-write a value: to be used for read-modify-write ++ * cycles where the read already set up the index register. ++ */ ++static inline void io_apic_modify(unsigned int apic, unsigned int value) ++{ ++ struct io_apic __iomem *io_apic = io_apic_base(apic); ++ writel(value, &io_apic->data); ++} ++ ++static int io_apic_level_ack_pending(unsigned int irq) ++{ ++ struct irq_pin_list *entry; ++ unsigned long flags; ++ int pending = 0; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ entry = irq_2_pin + irq; ++ for (;;) { ++ unsigned int reg; ++ int pin; ++ ++ pin = entry->pin; ++ if (pin == -1) ++ break; ++ reg = io_apic_read(entry->apic, 0x10 + pin*2); ++ /* Is the remote IRR bit set? */ ++ pending |= (reg >> 14) & 1; ++ if (!entry->next) ++ break; ++ entry = irq_2_pin + entry->next; ++ } ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ return pending; ++} ++#endif ++ ++/* ++ * Synchronize the IO-APIC and the CPU by doing ++ * a dummy read from the IO-APIC ++ */ ++static inline void io_apic_sync(unsigned int apic) ++{ ++#ifndef CONFIG_XEN ++ struct io_apic __iomem *io_apic = io_apic_base(apic); ++ readl(&io_apic->data); ++#endif ++} ++ ++union entry_union { ++ struct { u32 w1, w2; }; ++ struct IO_APIC_route_entry entry; ++}; ++ ++static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) ++{ ++ union entry_union eu; ++ unsigned long flags; ++ spin_lock_irqsave(&ioapic_lock, flags); ++ eu.w1 = io_apic_read(apic, 0x10 + 2 * pin); ++ eu.w2 = io_apic_read(apic, 0x11 + 2 * pin); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ return eu.entry; ++} ++ ++/* ++ * When we write a new IO APIC routing entry, we need to write the high ++ * word first! If the mask bit in the low word is clear, we will enable ++ * the interrupt, and we need to make sure the entry is fully populated ++ * before that happens. ++ */ ++static void ++__ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) ++{ ++ union entry_union eu; ++ eu.entry = e; ++ io_apic_write(apic, 0x11 + 2*pin, eu.w2); ++ io_apic_write(apic, 0x10 + 2*pin, eu.w1); ++} ++ ++static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) ++{ ++ unsigned long flags; ++ spin_lock_irqsave(&ioapic_lock, flags); ++ __ioapic_write_entry(apic, pin, e); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++ ++#ifndef CONFIG_XEN ++/* ++ * When we mask an IO APIC routing entry, we need to write the low ++ * word first, in order to set the mask bit before we change the ++ * high bits! ++ */ ++static void ioapic_mask_entry(int apic, int pin) ++{ ++ unsigned long flags; ++ union entry_union eu = { .entry.mask = 1 }; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ io_apic_write(apic, 0x10 + 2*pin, eu.w1); ++ io_apic_write(apic, 0x11 + 2*pin, eu.w2); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++ ++#ifdef CONFIG_SMP ++static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, u8 vector) ++{ ++ int apic, pin; ++ struct irq_pin_list *entry = irq_2_pin + irq; ++ ++ BUG_ON(irq >= NR_IRQS); ++ for (;;) { ++ unsigned int reg; ++ apic = entry->apic; ++ pin = entry->pin; ++ if (pin == -1) ++ break; ++ io_apic_write(apic, 0x11 + pin*2, dest); ++ reg = io_apic_read(apic, 0x10 + pin*2); ++ reg &= ~0x000000ff; ++ reg |= vector; ++ io_apic_modify(apic, reg); ++ if (!entry->next) ++ break; ++ entry = irq_2_pin + entry->next; ++ } ++} ++ ++static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) ++{ ++ struct irq_cfg *cfg = irq_cfg + irq; ++ unsigned long flags; ++ unsigned int dest; ++ cpumask_t tmp; ++ ++ cpus_and(tmp, mask, cpu_online_map); ++ if (cpus_empty(tmp)) ++ return; ++ ++ if (assign_irq_vector(irq, mask)) ++ return; ++ ++ cpus_and(tmp, cfg->domain, mask); ++ dest = cpu_mask_to_apicid(tmp); ++ ++ /* ++ * Only the high 8 bits are valid. ++ */ ++ dest = SET_APIC_LOGICAL_ID(dest); ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ __target_IO_APIC_irq(irq, dest, cfg->vector); ++ irq_desc[irq].affinity = mask; ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++#endif ++#endif ++ ++/* ++ * The common case is 1:1 IRQ<->pin mappings. Sometimes there are ++ * shared ISA-space IRQs, so we have to support them. We are super ++ * fast in the common case, and fast for shared ISA-space IRQs. ++ */ ++static void add_pin_to_irq(unsigned int irq, int apic, int pin) ++{ ++ static int first_free_entry = NR_IRQS; ++ struct irq_pin_list *entry = irq_2_pin + irq; ++ ++ BUG_ON(irq >= NR_IRQS); ++ while (entry->next) ++ entry = irq_2_pin + entry->next; ++ ++ if (entry->pin != -1) { ++ entry->next = first_free_entry; ++ entry = irq_2_pin + entry->next; ++ if (++first_free_entry >= PIN_MAP_SIZE) ++ panic("io_apic.c: ran out of irq_2_pin entries!"); ++ } ++ entry->apic = apic; ++ entry->pin = pin; ++} ++ ++#ifndef CONFIG_XEN ++#define __DO_ACTION(R, ACTION, FINAL) \ ++ \ ++{ \ ++ int pin; \ ++ struct irq_pin_list *entry = irq_2_pin + irq; \ ++ \ ++ BUG_ON(irq >= NR_IRQS); \ ++ for (;;) { \ ++ unsigned int reg; \ ++ pin = entry->pin; \ ++ if (pin == -1) \ ++ break; \ ++ reg = io_apic_read(entry->apic, 0x10 + R + pin*2); \ ++ reg ACTION; \ ++ io_apic_modify(entry->apic, reg); \ ++ FINAL; \ ++ if (!entry->next) \ ++ break; \ ++ entry = irq_2_pin + entry->next; \ ++ } \ ++} ++ ++#define DO_ACTION(name,R,ACTION, FINAL) \ ++ \ ++ static void name##_IO_APIC_irq (unsigned int irq) \ ++ __DO_ACTION(R, ACTION, FINAL) ++ ++DO_ACTION( __mask, 0, |= 0x00010000, io_apic_sync(entry->apic) ) ++ /* mask = 1 */ ++DO_ACTION( __unmask, 0, &= 0xfffeffff, ) ++ /* mask = 0 */ ++ ++static void mask_IO_APIC_irq (unsigned int irq) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ __mask_IO_APIC_irq(irq); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++ ++static void unmask_IO_APIC_irq (unsigned int irq) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ __unmask_IO_APIC_irq(irq); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++ ++static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin) ++{ ++ struct IO_APIC_route_entry entry; ++ ++ /* Check delivery_mode to be sure we're not clearing an SMI pin */ ++ entry = ioapic_read_entry(apic, pin); ++ if (entry.delivery_mode == dest_SMI) ++ return; ++ /* ++ * Disable it in the IO-APIC irq-routing table: ++ */ ++ ioapic_mask_entry(apic, pin); ++} ++ ++static void clear_IO_APIC (void) ++{ ++ int apic, pin; ++ ++ for (apic = 0; apic < nr_ioapics; apic++) ++ for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) ++ clear_IO_APIC_pin(apic, pin); ++} ++ ++#endif /* !CONFIG_XEN */ ++ ++int skip_ioapic_setup; ++int ioapic_force; ++ ++static int __init parse_noapic(char *str) ++{ ++ disable_ioapic_setup(); ++ return 0; ++} ++early_param("noapic", parse_noapic); ++ ++#ifndef CONFIG_XEN ++/* Actually the next is obsolete, but keep it for paranoid reasons -AK */ ++static int __init disable_timer_pin_setup(char *arg) ++{ ++ disable_timer_pin_1 = 1; ++ return 1; ++} ++__setup("disable_timer_pin_1", disable_timer_pin_setup); ++ ++static int __init setup_disable_8254_timer(char *s) ++{ ++ timer_over_8254 = -1; ++ return 1; ++} ++static int __init setup_enable_8254_timer(char *s) ++{ ++ timer_over_8254 = 2; ++ return 1; ++} ++ ++__setup("disable_8254_timer", setup_disable_8254_timer); ++__setup("enable_8254_timer", setup_enable_8254_timer); ++#endif /* !CONFIG_XEN */ ++ ++ ++/* ++ * Find the IRQ entry number of a certain pin. ++ */ ++static int find_irq_entry(int apic, int pin, int type) ++{ ++ int i; ++ ++ for (i = 0; i < mp_irq_entries; i++) ++ if (mp_irqs[i].mpc_irqtype == type && ++ (mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mpc_apicid || ++ mp_irqs[i].mpc_dstapic == MP_APIC_ALL) && ++ mp_irqs[i].mpc_dstirq == pin) ++ return i; ++ ++ return -1; ++} ++ ++#ifndef CONFIG_XEN ++/* ++ * Find the pin to which IRQ[irq] (ISA) is connected ++ */ ++static int __init find_isa_irq_pin(int irq, int type) ++{ ++ int i; ++ ++ for (i = 0; i < mp_irq_entries; i++) { ++ int lbus = mp_irqs[i].mpc_srcbus; ++ ++ if (test_bit(lbus, mp_bus_not_pci) && ++ (mp_irqs[i].mpc_irqtype == type) && ++ (mp_irqs[i].mpc_srcbusirq == irq)) ++ ++ return mp_irqs[i].mpc_dstirq; ++ } ++ return -1; ++} ++ ++static int __init find_isa_irq_apic(int irq, int type) ++{ ++ int i; ++ ++ for (i = 0; i < mp_irq_entries; i++) { ++ int lbus = mp_irqs[i].mpc_srcbus; ++ ++ if (test_bit(lbus, mp_bus_not_pci) && ++ (mp_irqs[i].mpc_irqtype == type) && ++ (mp_irqs[i].mpc_srcbusirq == irq)) ++ break; ++ } ++ if (i < mp_irq_entries) { ++ int apic; ++ for(apic = 0; apic < nr_ioapics; apic++) { ++ if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic) ++ return apic; ++ } ++ } ++ ++ return -1; ++} ++#endif ++ ++/* ++ * Find a specific PCI IRQ entry. ++ * Not an __init, possibly needed by modules ++ */ ++static int pin_2_irq(int idx, int apic, int pin); ++ ++int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin) ++{ ++ int apic, i, best_guess = -1; ++ ++ apic_printk(APIC_DEBUG, "querying PCI -> IRQ mapping bus:%d, slot:%d, pin:%d.\n", ++ bus, slot, pin); ++ if (mp_bus_id_to_pci_bus[bus] == -1) { ++ apic_printk(APIC_VERBOSE, "PCI BIOS passed nonexistent PCI bus %d!\n", bus); ++ return -1; ++ } ++ for (i = 0; i < mp_irq_entries; i++) { ++ int lbus = mp_irqs[i].mpc_srcbus; ++ ++ for (apic = 0; apic < nr_ioapics; apic++) ++ if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic || ++ mp_irqs[i].mpc_dstapic == MP_APIC_ALL) ++ break; ++ ++ if (!test_bit(lbus, mp_bus_not_pci) && ++ !mp_irqs[i].mpc_irqtype && ++ (bus == lbus) && ++ (slot == ((mp_irqs[i].mpc_srcbusirq >> 2) & 0x1f))) { ++ int irq = pin_2_irq(i,apic,mp_irqs[i].mpc_dstirq); ++ ++ if (!(apic || IO_APIC_IRQ(irq))) ++ continue; ++ ++ if (pin == (mp_irqs[i].mpc_srcbusirq & 3)) ++ return irq; ++ /* ++ * Use the first all-but-pin matching entry as a ++ * best-guess fuzzy result for broken mptables. ++ */ ++ if (best_guess < 0) ++ best_guess = irq; ++ } ++ } ++ BUG_ON(best_guess >= NR_IRQS); ++ return best_guess; ++} ++ ++/* ISA interrupts are always polarity zero edge triggered, ++ * when listed as conforming in the MP table. */ ++ ++#define default_ISA_trigger(idx) (0) ++#define default_ISA_polarity(idx) (0) ++ ++/* PCI interrupts are always polarity one level triggered, ++ * when listed as conforming in the MP table. */ ++ ++#define default_PCI_trigger(idx) (1) ++#define default_PCI_polarity(idx) (1) ++ ++static int MPBIOS_polarity(int idx) ++{ ++ int bus = mp_irqs[idx].mpc_srcbus; ++ int polarity; ++ ++ /* ++ * Determine IRQ line polarity (high active or low active): ++ */ ++ switch (mp_irqs[idx].mpc_irqflag & 3) ++ { ++ case 0: /* conforms, ie. bus-type dependent polarity */ ++ if (test_bit(bus, mp_bus_not_pci)) ++ polarity = default_ISA_polarity(idx); ++ else ++ polarity = default_PCI_polarity(idx); ++ break; ++ case 1: /* high active */ ++ { ++ polarity = 0; ++ break; ++ } ++ case 2: /* reserved */ ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ polarity = 1; ++ break; ++ } ++ case 3: /* low active */ ++ { ++ polarity = 1; ++ break; ++ } ++ default: /* invalid */ ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ polarity = 1; ++ break; ++ } ++ } ++ return polarity; ++} ++ ++static int MPBIOS_trigger(int idx) ++{ ++ int bus = mp_irqs[idx].mpc_srcbus; ++ int trigger; ++ ++ /* ++ * Determine IRQ trigger mode (edge or level sensitive): ++ */ ++ switch ((mp_irqs[idx].mpc_irqflag>>2) & 3) ++ { ++ case 0: /* conforms, ie. bus-type dependent */ ++ if (test_bit(bus, mp_bus_not_pci)) ++ trigger = default_ISA_trigger(idx); ++ else ++ trigger = default_PCI_trigger(idx); ++ break; ++ case 1: /* edge */ ++ { ++ trigger = 0; ++ break; ++ } ++ case 2: /* reserved */ ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ trigger = 1; ++ break; ++ } ++ case 3: /* level */ ++ { ++ trigger = 1; ++ break; ++ } ++ default: /* invalid */ ++ { ++ printk(KERN_WARNING "broken BIOS!!\n"); ++ trigger = 0; ++ break; ++ } ++ } ++ return trigger; ++} ++ ++static inline int irq_polarity(int idx) ++{ ++ return MPBIOS_polarity(idx); ++} ++ ++static inline int irq_trigger(int idx) ++{ ++ return MPBIOS_trigger(idx); ++} ++ ++static int pin_2_irq(int idx, int apic, int pin) ++{ ++ int irq, i; ++ int bus = mp_irqs[idx].mpc_srcbus; ++ ++ /* ++ * Debugging check, we are in big trouble if this message pops up! ++ */ ++ if (mp_irqs[idx].mpc_dstirq != pin) ++ printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n"); ++ ++ if (test_bit(bus, mp_bus_not_pci)) { ++ irq = mp_irqs[idx].mpc_srcbusirq; ++ } else { ++ /* ++ * PCI IRQs are mapped in order ++ */ ++ i = irq = 0; ++ while (i < apic) ++ irq += nr_ioapic_registers[i++]; ++ irq += pin; ++ } ++ BUG_ON(irq >= NR_IRQS); ++ return irq; ++} ++ ++static int __assign_irq_vector(int irq, cpumask_t mask) ++{ ++ struct physdev_irq irq_op; ++ struct irq_cfg *cfg; ++ ++ BUG_ON((unsigned)irq >= NR_IRQS); ++ cfg = &irq_cfg[irq]; ++ ++ if ((cfg->move_in_progress) || cfg->move_cleanup_count) ++ return -EBUSY; ++ ++ if (cfg->vector) ++ return 0; ++ ++ irq_op.irq = irq; ++ if (HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &irq_op)) ++ return -ENOSPC; ++ ++ cfg->vector = irq_op.vector; ++ ++ return 0; ++} ++ ++static int assign_irq_vector(int irq, cpumask_t mask) ++{ ++ int err; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&vector_lock, flags); ++ err = __assign_irq_vector(irq, mask); ++ spin_unlock_irqrestore(&vector_lock, flags); ++ return err; ++} ++ ++#ifndef CONFIG_XEN ++static void __clear_irq_vector(int irq) ++{ ++ struct irq_cfg *cfg; ++ cpumask_t mask; ++ int cpu, vector; ++ ++ BUG_ON((unsigned)irq >= NR_IRQS); ++ cfg = &irq_cfg[irq]; ++ BUG_ON(!cfg->vector); ++ ++ vector = cfg->vector; ++ cpus_and(mask, cfg->domain, cpu_online_map); ++ for_each_cpu_mask(cpu, mask) ++ per_cpu(vector_irq, cpu)[vector] = -1; ++ ++ cfg->vector = 0; ++ cfg->domain = CPU_MASK_NONE; ++} ++ ++void __setup_vector_irq(int cpu) ++{ ++ /* Initialize vector_irq on a new cpu */ ++ /* This function must be called with vector_lock held */ ++ int irq, vector; ++ ++ /* Mark the inuse vectors */ ++ for (irq = 0; irq < NR_IRQS; ++irq) { ++ if (!cpu_isset(cpu, irq_cfg[irq].domain)) ++ continue; ++ vector = irq_cfg[irq].vector; ++ per_cpu(vector_irq, cpu)[vector] = irq; ++ } ++ /* Mark the free vectors */ ++ for (vector = 0; vector < NR_VECTORS; ++vector) { ++ irq = per_cpu(vector_irq, cpu)[vector]; ++ if (irq < 0) ++ continue; ++ if (!cpu_isset(cpu, irq_cfg[irq].domain)) ++ per_cpu(vector_irq, cpu)[vector] = -1; ++ } ++} ++ ++static struct irq_chip ioapic_chip; ++ ++static void ioapic_register_intr(int irq, unsigned long trigger) ++{ ++ if (trigger) { ++ irq_desc[irq].status |= IRQ_LEVEL; ++ set_irq_chip_and_handler_name(irq, &ioapic_chip, ++ handle_fasteoi_irq, "fasteoi"); ++ } else { ++ irq_desc[irq].status &= ~IRQ_LEVEL; ++ set_irq_chip_and_handler_name(irq, &ioapic_chip, ++ handle_edge_irq, "edge"); ++ } ++} ++#else ++#define ioapic_register_intr(irq,trigger) ((void)0) ++#endif /* !CONFIG_XEN */ ++ ++static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, ++ int trigger, int polarity) ++{ ++ struct irq_cfg *cfg = irq_cfg + irq; ++ struct IO_APIC_route_entry entry; ++ cpumask_t mask; ++ ++ if (!IO_APIC_IRQ(irq)) ++ return; ++ ++ mask = TARGET_CPUS; ++ if (assign_irq_vector(irq, mask)) ++ return; ++ ++#ifndef CONFIG_XEN ++ cpus_and(mask, cfg->domain, mask); ++#endif ++ ++ apic_printk(APIC_VERBOSE,KERN_DEBUG ++ "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> " ++ "IRQ %d Mode:%i Active:%i)\n", ++ apic, mp_ioapics[apic].mpc_apicid, pin, cfg->vector, ++ irq, trigger, polarity); ++ ++ /* ++ * add it to the IO-APIC irq-routing table: ++ */ ++ memset(&entry,0,sizeof(entry)); ++ ++ entry.delivery_mode = INT_DELIVERY_MODE; ++ entry.dest_mode = INT_DEST_MODE; ++ entry.dest = cpu_mask_to_apicid(mask); ++ entry.mask = 0; /* enable IRQ */ ++ entry.trigger = trigger; ++ entry.polarity = polarity; ++ entry.vector = cfg->vector; ++ ++ /* Mask level triggered irqs. ++ * Use IRQ_DELAYED_DISABLE for edge triggered irqs. ++ */ ++ if (trigger) ++ entry.mask = 1; ++ ++ ioapic_register_intr(irq, trigger); ++ if (irq < 16) ++ disable_8259A_irq(irq); ++ ++ ioapic_write_entry(apic, pin, entry); ++} ++ ++static void __init setup_IO_APIC_irqs(void) ++{ ++ int apic, pin, idx, irq, first_notcon = 1; ++ ++ apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n"); ++ ++ for (apic = 0; apic < nr_ioapics; apic++) { ++ for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { ++ ++ idx = find_irq_entry(apic,pin,mp_INT); ++ if (idx == -1) { ++ if (first_notcon) { ++ apic_printk(APIC_VERBOSE, KERN_DEBUG " IO-APIC (apicid-pin) %d-%d", mp_ioapics[apic].mpc_apicid, pin); ++ first_notcon = 0; ++ } else ++ apic_printk(APIC_VERBOSE, ", %d-%d", mp_ioapics[apic].mpc_apicid, pin); ++ continue; ++ } ++ if (!first_notcon) { ++ apic_printk(APIC_VERBOSE, " not connected.\n"); ++ first_notcon = 1; ++ } ++ ++ irq = pin_2_irq(idx, apic, pin); ++ add_pin_to_irq(irq, apic, pin); ++ ++ setup_IO_APIC_irq(apic, pin, irq, ++ irq_trigger(idx), irq_polarity(idx)); ++ } ++ } ++ ++ if (!first_notcon) ++ apic_printk(APIC_VERBOSE, " not connected.\n"); ++} ++ ++#ifndef CONFIG_XEN ++/* ++ * Set up the 8259A-master output pin as broadcast to all ++ * CPUs. ++ */ ++static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, int vector) ++{ ++ struct IO_APIC_route_entry entry; ++ unsigned long flags; ++ ++ memset(&entry,0,sizeof(entry)); ++ ++ disable_8259A_irq(0); ++ ++ /* mask LVT0 */ ++ apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); ++ ++ /* ++ * We use logical delivery to get the timer IRQ ++ * to the first CPU. ++ */ ++ entry.dest_mode = INT_DEST_MODE; ++ entry.mask = 0; /* unmask IRQ now */ ++ entry.dest = cpu_mask_to_apicid(TARGET_CPUS); ++ entry.delivery_mode = INT_DELIVERY_MODE; ++ entry.polarity = 0; ++ entry.trigger = 0; ++ entry.vector = vector; ++ ++ /* ++ * The timer IRQ doesn't have to know that behind the ++ * scene we have a 8259A-master in AEOI mode ... ++ */ ++ set_irq_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq, "edge"); ++ ++ /* ++ * Add it to the IO-APIC irq-routing table: ++ */ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ io_apic_write(apic, 0x11+2*pin, *(((int *)&entry)+1)); ++ io_apic_write(apic, 0x10+2*pin, *(((int *)&entry)+0)); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ enable_8259A_irq(0); ++} ++ ++void __apicdebuginit print_IO_APIC(void) ++{ ++ int apic, i; ++ union IO_APIC_reg_00 reg_00; ++ union IO_APIC_reg_01 reg_01; ++ union IO_APIC_reg_02 reg_02; ++ unsigned long flags; ++ ++ if (apic_verbosity == APIC_QUIET) ++ return; ++ ++ printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); ++ for (i = 0; i < nr_ioapics; i++) ++ printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", ++ mp_ioapics[i].mpc_apicid, nr_ioapic_registers[i]); ++ ++ /* ++ * We are a bit conservative about what we expect. We have to ++ * know about every hardware change ASAP. ++ */ ++ printk(KERN_INFO "testing the IO APIC.......................\n"); ++ ++ for (apic = 0; apic < nr_ioapics; apic++) { ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_00.raw = io_apic_read(apic, 0); ++ reg_01.raw = io_apic_read(apic, 1); ++ if (reg_01.bits.version >= 0x10) ++ reg_02.raw = io_apic_read(apic, 2); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ printk("\n"); ++ printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mpc_apicid); ++ printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw); ++ printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID); ++ ++ printk(KERN_DEBUG ".... register #01: %08X\n", *(int *)®_01); ++ printk(KERN_DEBUG "....... : max redirection entries: %04X\n", reg_01.bits.entries); ++ ++ printk(KERN_DEBUG "....... : PRQ implemented: %X\n", reg_01.bits.PRQ); ++ printk(KERN_DEBUG "....... : IO APIC version: %04X\n", reg_01.bits.version); ++ ++ if (reg_01.bits.version >= 0x10) { ++ printk(KERN_DEBUG ".... register #02: %08X\n", reg_02.raw); ++ printk(KERN_DEBUG "....... : arbitration: %02X\n", reg_02.bits.arbitration); ++ } ++ ++ printk(KERN_DEBUG ".... IRQ redirection table:\n"); ++ ++ printk(KERN_DEBUG " NR Dst Mask Trig IRR Pol" ++ " Stat Dmod Deli Vect: \n"); ++ ++ for (i = 0; i <= reg_01.bits.entries; i++) { ++ struct IO_APIC_route_entry entry; ++ ++ entry = ioapic_read_entry(apic, i); ++ ++ printk(KERN_DEBUG " %02x %03X ", ++ i, ++ entry.dest ++ ); ++ ++ printk("%1d %1d %1d %1d %1d %1d %1d %02X\n", ++ entry.mask, ++ entry.trigger, ++ entry.irr, ++ entry.polarity, ++ entry.delivery_status, ++ entry.dest_mode, ++ entry.delivery_mode, ++ entry.vector ++ ); ++ } ++ } ++ printk(KERN_DEBUG "IRQ to pin mappings:\n"); ++ for (i = 0; i < NR_IRQS; i++) { ++ struct irq_pin_list *entry = irq_2_pin + i; ++ if (entry->pin < 0) ++ continue; ++ printk(KERN_DEBUG "IRQ%d ", i); ++ for (;;) { ++ printk("-> %d:%d", entry->apic, entry->pin); ++ if (!entry->next) ++ break; ++ entry = irq_2_pin + entry->next; ++ } ++ printk("\n"); ++ } ++ ++ printk(KERN_INFO ".................................... done.\n"); ++ ++ return; ++} ++ ++static __apicdebuginit void print_APIC_bitfield (int base) ++{ ++ unsigned int v; ++ int i, j; ++ ++ if (apic_verbosity == APIC_QUIET) ++ return; ++ ++ printk(KERN_DEBUG "0123456789abcdef0123456789abcdef\n" KERN_DEBUG); ++ for (i = 0; i < 8; i++) { ++ v = apic_read(base + i*0x10); ++ for (j = 0; j < 32; j++) { ++ if (v & (1< 3) { /* PC is LVT#4. */ ++ v = apic_read(APIC_LVTPC); ++ printk(KERN_DEBUG "... APIC LVTPC: %08x\n", v); ++ } ++ v = apic_read(APIC_LVT0); ++ printk(KERN_DEBUG "... APIC LVT0: %08x\n", v); ++ v = apic_read(APIC_LVT1); ++ printk(KERN_DEBUG "... APIC LVT1: %08x\n", v); ++ ++ if (maxlvt > 2) { /* ERR is LVT#3. */ ++ v = apic_read(APIC_LVTERR); ++ printk(KERN_DEBUG "... APIC LVTERR: %08x\n", v); ++ } ++ ++ v = apic_read(APIC_TMICT); ++ printk(KERN_DEBUG "... APIC TMICT: %08x\n", v); ++ v = apic_read(APIC_TMCCT); ++ printk(KERN_DEBUG "... APIC TMCCT: %08x\n", v); ++ v = apic_read(APIC_TDCR); ++ printk(KERN_DEBUG "... APIC TDCR: %08x\n", v); ++ printk("\n"); ++} ++ ++void print_all_local_APICs (void) ++{ ++ on_each_cpu(print_local_APIC, NULL, 1, 1); ++} ++ ++void __apicdebuginit print_PIC(void) ++{ ++ unsigned int v; ++ unsigned long flags; ++ ++ if (apic_verbosity == APIC_QUIET) ++ return; ++ ++ printk(KERN_DEBUG "\nprinting PIC contents\n"); ++ ++ spin_lock_irqsave(&i8259A_lock, flags); ++ ++ v = inb(0xa1) << 8 | inb(0x21); ++ printk(KERN_DEBUG "... PIC IMR: %04x\n", v); ++ ++ v = inb(0xa0) << 8 | inb(0x20); ++ printk(KERN_DEBUG "... PIC IRR: %04x\n", v); ++ ++ outb(0x0b,0xa0); ++ outb(0x0b,0x20); ++ v = inb(0xa0) << 8 | inb(0x20); ++ outb(0x0a,0xa0); ++ outb(0x0a,0x20); ++ ++ spin_unlock_irqrestore(&i8259A_lock, flags); ++ ++ printk(KERN_DEBUG "... PIC ISR: %04x\n", v); ++ ++ v = inb(0x4d1) << 8 | inb(0x4d0); ++ printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); ++} ++#endif /* !CONFIG_XEN */ ++ ++static void __init enable_IO_APIC(void) ++{ ++ union IO_APIC_reg_01 reg_01; ++#ifndef CONFIG_XEN ++ int i8259_apic, i8259_pin; ++#endif ++ int i, apic; ++ unsigned long flags; ++ ++ for (i = 0; i < PIN_MAP_SIZE; i++) { ++ irq_2_pin[i].pin = -1; ++ irq_2_pin[i].next = 0; ++ } ++ ++ /* ++ * The number of IO-APIC IRQ registers (== #pins): ++ */ ++ for (apic = 0; apic < nr_ioapics; apic++) { ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_01.raw = io_apic_read(apic, 1); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ nr_ioapic_registers[apic] = reg_01.bits.entries+1; ++ } ++#ifndef CONFIG_XEN ++ for(apic = 0; apic < nr_ioapics; apic++) { ++ int pin; ++ /* See if any of the pins is in ExtINT mode */ ++ for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { ++ struct IO_APIC_route_entry entry; ++ entry = ioapic_read_entry(apic, pin); ++ ++ /* If the interrupt line is enabled and in ExtInt mode ++ * I have found the pin where the i8259 is connected. ++ */ ++ if ((entry.mask == 0) && (entry.delivery_mode == dest_ExtINT)) { ++ ioapic_i8259.apic = apic; ++ ioapic_i8259.pin = pin; ++ goto found_i8259; ++ } ++ } ++ } ++ found_i8259: ++ /* Look to see what if the MP table has reported the ExtINT */ ++ i8259_pin = find_isa_irq_pin(0, mp_ExtINT); ++ i8259_apic = find_isa_irq_apic(0, mp_ExtINT); ++ /* Trust the MP table if nothing is setup in the hardware */ ++ if ((ioapic_i8259.pin == -1) && (i8259_pin >= 0)) { ++ printk(KERN_WARNING "ExtINT not setup in hardware but reported by MP table\n"); ++ ioapic_i8259.pin = i8259_pin; ++ ioapic_i8259.apic = i8259_apic; ++ } ++ /* Complain if the MP table and the hardware disagree */ ++ if (((ioapic_i8259.apic != i8259_apic) || (ioapic_i8259.pin != i8259_pin)) && ++ (i8259_pin >= 0) && (ioapic_i8259.pin >= 0)) ++ { ++ printk(KERN_WARNING "ExtINT in hardware and MP table differ\n"); ++ } ++#endif ++ ++ /* ++ * Do not trust the IO-APIC being empty at bootup ++ */ ++ clear_IO_APIC(); ++} ++ ++/* ++ * Not an __init, needed by the reboot code ++ */ ++void disable_IO_APIC(void) ++{ ++ /* ++ * Clear the IO-APIC before rebooting: ++ */ ++ clear_IO_APIC(); ++ ++#ifndef CONFIG_XEN ++ /* ++ * If the i8259 is routed through an IOAPIC ++ * Put that IOAPIC in virtual wire mode ++ * so legacy interrupts can be delivered. ++ */ ++ if (ioapic_i8259.pin != -1) { ++ struct IO_APIC_route_entry entry; ++ ++ memset(&entry, 0, sizeof(entry)); ++ entry.mask = 0; /* Enabled */ ++ entry.trigger = 0; /* Edge */ ++ entry.irr = 0; ++ entry.polarity = 0; /* High */ ++ entry.delivery_status = 0; ++ entry.dest_mode = 0; /* Physical */ ++ entry.delivery_mode = dest_ExtINT; /* ExtInt */ ++ entry.vector = 0; ++ entry.dest = GET_APIC_ID(apic_read(APIC_ID)); ++ ++ /* ++ * Add it to the IO-APIC irq-routing table: ++ */ ++ ioapic_write_entry(ioapic_i8259.apic, ioapic_i8259.pin, entry); ++ } ++ ++ disconnect_bsp_APIC(ioapic_i8259.pin != -1); ++#endif ++} ++ ++/* ++ * There is a nasty bug in some older SMP boards, their mptable lies ++ * about the timer IRQ. We do the following to work around the situation: ++ * ++ * - timer IRQ defaults to IO-APIC IRQ ++ * - if this function detects that timer IRQs are defunct, then we fall ++ * back to ISA timer IRQs ++ */ ++#ifndef CONFIG_XEN ++static int __init timer_irq_works(void) ++{ ++ unsigned long t1 = jiffies; ++ unsigned long flags; ++ ++ local_save_flags(flags); ++ local_irq_enable(); ++ /* Let ten ticks pass... */ ++ mdelay((10 * 1000) / HZ); ++ local_irq_restore(flags); ++ ++ /* ++ * Expect a few ticks at least, to be sure some possible ++ * glue logic does not lock up after one or two first ++ * ticks in a non-ExtINT mode. Also the local APIC ++ * might have cached one ExtINT interrupt. Finally, at ++ * least one tick may be lost due to delays. ++ */ ++ ++ /* jiffies wrap? */ ++ if (jiffies - t1 > 4) ++ return 1; ++ return 0; ++} ++ ++/* ++ * In the SMP+IOAPIC case it might happen that there are an unspecified ++ * number of pending IRQ events unhandled. These cases are very rare, ++ * so we 'resend' these IRQs via IPIs, to the same CPU. It's much ++ * better to do it this way as thus we do not have to be aware of ++ * 'pending' interrupts in the IRQ path, except at this point. ++ */ ++/* ++ * Edge triggered needs to resend any interrupt ++ * that was delayed but this is now handled in the device ++ * independent code. ++ */ ++ ++/* ++ * Starting up a edge-triggered IO-APIC interrupt is ++ * nasty - we need to make sure that we get the edge. ++ * If it is already asserted for some reason, we need ++ * return 1 to indicate that is was pending. ++ * ++ * This is not complete - we should be able to fake ++ * an edge even if it isn't on the 8259A... ++ */ ++ ++static unsigned int startup_ioapic_irq(unsigned int irq) ++{ ++ int was_pending = 0; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ if (irq < 16) { ++ disable_8259A_irq(irq); ++ if (i8259A_irq_pending(irq)) ++ was_pending = 1; ++ } ++ __unmask_IO_APIC_irq(irq); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ return was_pending; ++} ++ ++static int ioapic_retrigger_irq(unsigned int irq) ++{ ++ struct irq_cfg *cfg = &irq_cfg[irq]; ++ cpumask_t mask; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&vector_lock, flags); ++ cpus_clear(mask); ++ cpu_set(first_cpu(cfg->domain), mask); ++ ++ send_IPI_mask(mask, cfg->vector); ++ spin_unlock_irqrestore(&vector_lock, flags); ++ ++ return 1; ++} ++ ++/* ++ * Level and edge triggered IO-APIC interrupts need different handling, ++ * so we use two separate IRQ descriptors. Edge triggered IRQs can be ++ * handled with the level-triggered descriptor, but that one has slightly ++ * more overhead. Level-triggered interrupts cannot be handled with the ++ * edge-triggered handler, without risking IRQ storms and other ugly ++ * races. ++ */ ++ ++#ifdef CONFIG_SMP ++asmlinkage void smp_irq_move_cleanup_interrupt(void) ++{ ++ unsigned vector, me; ++ ack_APIC_irq(); ++ exit_idle(); ++ irq_enter(); ++ ++ me = smp_processor_id(); ++ for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) { ++ unsigned int irq; ++ struct irq_desc *desc; ++ struct irq_cfg *cfg; ++ irq = __get_cpu_var(vector_irq)[vector]; ++ if (irq >= NR_IRQS) ++ continue; ++ ++ desc = irq_desc + irq; ++ cfg = irq_cfg + irq; ++ spin_lock(&desc->lock); ++ if (!cfg->move_cleanup_count) ++ goto unlock; ++ ++ if ((vector == cfg->vector) && cpu_isset(me, cfg->domain)) ++ goto unlock; ++ ++ __get_cpu_var(vector_irq)[vector] = -1; ++ cfg->move_cleanup_count--; ++unlock: ++ spin_unlock(&desc->lock); ++ } ++ ++ irq_exit(); ++} ++ ++static void irq_complete_move(unsigned int irq) ++{ ++ struct irq_cfg *cfg = irq_cfg + irq; ++ unsigned vector, me; ++ ++ if (likely(!cfg->move_in_progress)) ++ return; ++ ++ vector = ~get_irq_regs()->orig_rax; ++ me = smp_processor_id(); ++ if ((vector == cfg->vector) && cpu_isset(me, cfg->domain)) { ++ cpumask_t cleanup_mask; ++ ++ cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map); ++ cfg->move_cleanup_count = cpus_weight(cleanup_mask); ++ send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR); ++ cfg->move_in_progress = 0; ++ } ++} ++#else ++static inline void irq_complete_move(unsigned int irq) {} ++#endif ++ ++static void ack_apic_edge(unsigned int irq) ++{ ++ irq_complete_move(irq); ++ move_native_irq(irq); ++ ack_APIC_irq(); ++} ++ ++static void ack_apic_level(unsigned int irq) ++{ ++ int do_unmask_irq = 0; ++ ++ irq_complete_move(irq); ++#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) ++ /* If we are moving the irq we need to mask it */ ++ if (unlikely(irq_desc[irq].status & IRQ_MOVE_PENDING)) { ++ do_unmask_irq = 1; ++ mask_IO_APIC_irq(irq); ++ } ++#endif ++ ++ /* ++ * We must acknowledge the irq before we move it or the acknowledge will ++ * not propagate properly. ++ */ ++ ack_APIC_irq(); ++ ++ /* Now we can move and renable the irq */ ++ if (unlikely(do_unmask_irq)) { ++ /* Only migrate the irq if the ack has been received. ++ * ++ * On rare occasions the broadcast level triggered ack gets ++ * delayed going to ioapics, and if we reprogram the ++ * vector while Remote IRR is still set the irq will never ++ * fire again. ++ * ++ * To prevent this scenario we read the Remote IRR bit ++ * of the ioapic. This has two effects. ++ * - On any sane system the read of the ioapic will ++ * flush writes (and acks) going to the ioapic from ++ * this cpu. ++ * - We get to see if the ACK has actually been delivered. ++ * ++ * Based on failed experiments of reprogramming the ++ * ioapic entry from outside of irq context starting ++ * with masking the ioapic entry and then polling until ++ * Remote IRR was clear before reprogramming the ++ * ioapic I don't trust the Remote IRR bit to be ++ * completey accurate. ++ * ++ * However there appears to be no other way to plug ++ * this race, so if the Remote IRR bit is not ++ * accurate and is causing problems then it is a hardware bug ++ * and you can go talk to the chipset vendor about it. ++ */ ++ if (!io_apic_level_ack_pending(irq)) ++ move_masked_irq(irq); ++ unmask_IO_APIC_irq(irq); ++ } ++} ++ ++static struct irq_chip ioapic_chip __read_mostly = { ++ .name = "IO-APIC", ++ .startup = startup_ioapic_irq, ++ .mask = mask_IO_APIC_irq, ++ .unmask = unmask_IO_APIC_irq, ++ .ack = ack_apic_edge, ++ .eoi = ack_apic_level, ++#ifdef CONFIG_SMP ++ .set_affinity = set_ioapic_affinity_irq, ++#endif ++ .retrigger = ioapic_retrigger_irq, ++}; ++#endif /* !CONFIG_XEN */ ++ ++static inline void init_IO_APIC_traps(void) ++{ ++ int irq; ++ ++ /* ++ * NOTE! The local APIC isn't very good at handling ++ * multiple interrupts at the same interrupt level. ++ * As the interrupt level is determined by taking the ++ * vector number and shifting that right by 4, we ++ * want to spread these out a bit so that they don't ++ * all fall in the same interrupt level. ++ * ++ * Also, we've got to be careful not to trash gate ++ * 0x80, because int 0x80 is hm, kind of importantish. ;) ++ */ ++ for (irq = 0; irq < NR_IRQS ; irq++) { ++ int tmp = irq; ++ if (IO_APIC_IRQ(tmp) && !irq_cfg[tmp].vector) { ++ /* ++ * Hmm.. We don't have an entry for this, ++ * so default to an old-fashioned 8259 ++ * interrupt if we can.. ++ */ ++ if (irq < 16) ++ make_8259A_irq(irq); ++#ifndef CONFIG_XEN ++ else ++ /* Strange. Oh, well.. */ ++ irq_desc[irq].chip = &no_irq_chip; ++#endif ++ } ++ } ++} ++ ++#ifndef CONFIG_XEN ++static void enable_lapic_irq (unsigned int irq) ++{ ++ unsigned long v; ++ ++ v = apic_read(APIC_LVT0); ++ apic_write(APIC_LVT0, v & ~APIC_LVT_MASKED); ++} ++ ++static void disable_lapic_irq (unsigned int irq) ++{ ++ unsigned long v; ++ ++ v = apic_read(APIC_LVT0); ++ apic_write(APIC_LVT0, v | APIC_LVT_MASKED); ++} ++ ++static void ack_lapic_irq (unsigned int irq) ++{ ++ ack_APIC_irq(); ++} ++ ++static void end_lapic_irq (unsigned int i) { /* nothing */ } ++ ++static struct hw_interrupt_type lapic_irq_type __read_mostly = { ++ .name = "local-APIC", ++ .typename = "local-APIC-edge", ++ .startup = NULL, /* startup_irq() not used for IRQ0 */ ++ .shutdown = NULL, /* shutdown_irq() not used for IRQ0 */ ++ .enable = enable_lapic_irq, ++ .disable = disable_lapic_irq, ++ .ack = ack_lapic_irq, ++ .end = end_lapic_irq, ++}; ++ ++static void setup_nmi (void) ++{ ++ /* ++ * Dirty trick to enable the NMI watchdog ... ++ * We put the 8259A master into AEOI mode and ++ * unmask on all local APICs LVT0 as NMI. ++ * ++ * The idea to use the 8259A in AEOI mode ('8259A Virtual Wire') ++ * is from Maciej W. Rozycki - so we do not have to EOI from ++ * the NMI handler or the timer interrupt. ++ */ ++ printk(KERN_INFO "activating NMI Watchdog ..."); ++ ++ enable_NMI_through_LVT0(NULL); ++ ++ printk(" done.\n"); ++} ++ ++/* ++ * This looks a bit hackish but it's about the only one way of sending ++ * a few INTA cycles to 8259As and any associated glue logic. ICR does ++ * not support the ExtINT mode, unfortunately. We need to send these ++ * cycles as some i82489DX-based boards have glue logic that keeps the ++ * 8259A interrupt line asserted until INTA. --macro ++ */ ++static inline void unlock_ExtINT_logic(void) ++{ ++ int apic, pin, i; ++ struct IO_APIC_route_entry entry0, entry1; ++ unsigned char save_control, save_freq_select; ++ unsigned long flags; ++ ++ pin = find_isa_irq_pin(8, mp_INT); ++ apic = find_isa_irq_apic(8, mp_INT); ++ if (pin == -1) ++ return; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ *(((int *)&entry0) + 1) = io_apic_read(apic, 0x11 + 2 * pin); ++ *(((int *)&entry0) + 0) = io_apic_read(apic, 0x10 + 2 * pin); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ clear_IO_APIC_pin(apic, pin); ++ ++ memset(&entry1, 0, sizeof(entry1)); ++ ++ entry1.dest_mode = 0; /* physical delivery */ ++ entry1.mask = 0; /* unmask IRQ now */ ++ entry1.dest = hard_smp_processor_id(); ++ entry1.delivery_mode = dest_ExtINT; ++ entry1.polarity = entry0.polarity; ++ entry1.trigger = 0; ++ entry1.vector = 0; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&entry1) + 1)); ++ io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&entry1) + 0)); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ save_control = CMOS_READ(RTC_CONTROL); ++ save_freq_select = CMOS_READ(RTC_FREQ_SELECT); ++ CMOS_WRITE((save_freq_select & ~RTC_RATE_SELECT) | 0x6, ++ RTC_FREQ_SELECT); ++ CMOS_WRITE(save_control | RTC_PIE, RTC_CONTROL); ++ ++ i = 100; ++ while (i-- > 0) { ++ mdelay(10); ++ if ((CMOS_READ(RTC_INTR_FLAGS) & RTC_PF) == RTC_PF) ++ i -= 10; ++ } ++ ++ CMOS_WRITE(save_control, RTC_CONTROL); ++ CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); ++ clear_IO_APIC_pin(apic, pin); ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&entry0) + 1)); ++ io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&entry0) + 0)); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++} ++ ++/* ++ * This code may look a bit paranoid, but it's supposed to cooperate with ++ * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ ++ * is so screwy. Thanks to Brian Perkins for testing/hacking this beast ++ * fanatically on his truly buggy board. ++ * ++ * FIXME: really need to revamp this for modern platforms only. ++ */ ++static inline void check_timer(void) ++{ ++ struct irq_cfg *cfg = irq_cfg + 0; ++ int apic1, pin1, apic2, pin2; ++ unsigned long flags; ++ ++ local_irq_save(flags); ++ ++ /* ++ * get/set the timer IRQ vector: ++ */ ++ disable_8259A_irq(0); ++ assign_irq_vector(0, TARGET_CPUS); ++ ++ /* ++ * Subtle, code in do_timer_interrupt() expects an AEOI ++ * mode for the 8259A whenever interrupts are routed ++ * through I/O APICs. Also IRQ0 has to be enabled in ++ * the 8259A which implies the virtual wire has to be ++ * disabled in the local APIC. ++ */ ++ apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); ++ init_8259A(1); ++ if (timer_over_8254 > 0) ++ enable_8259A_irq(0); ++ ++ pin1 = find_isa_irq_pin(0, mp_INT); ++ apic1 = find_isa_irq_apic(0, mp_INT); ++ pin2 = ioapic_i8259.pin; ++ apic2 = ioapic_i8259.apic; ++ ++ apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", ++ cfg->vector, apic1, pin1, apic2, pin2); ++ ++ if (pin1 != -1) { ++ /* ++ * Ok, does IRQ0 through the IOAPIC work? ++ */ ++ unmask_IO_APIC_irq(0); ++ if (!no_timer_check && timer_irq_works()) { ++ nmi_watchdog_default(); ++ if (nmi_watchdog == NMI_IO_APIC) { ++ disable_8259A_irq(0); ++ setup_nmi(); ++ enable_8259A_irq(0); ++ } ++ if (disable_timer_pin_1 > 0) ++ clear_IO_APIC_pin(0, pin1); ++ goto out; ++ } ++ clear_IO_APIC_pin(apic1, pin1); ++ apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not " ++ "connected to IO-APIC\n"); ++ } ++ ++ apic_printk(APIC_VERBOSE,KERN_INFO "...trying to set up timer (IRQ0) " ++ "through the 8259A ... "); ++ if (pin2 != -1) { ++ apic_printk(APIC_VERBOSE,"\n..... (found apic %d pin %d) ...", ++ apic2, pin2); ++ /* ++ * legacy devices should be connected to IO APIC #0 ++ */ ++ setup_ExtINT_IRQ0_pin(apic2, pin2, cfg->vector); ++ if (timer_irq_works()) { ++ apic_printk(APIC_VERBOSE," works.\n"); ++ nmi_watchdog_default(); ++ if (nmi_watchdog == NMI_IO_APIC) { ++ setup_nmi(); ++ } ++ goto out; ++ } ++ /* ++ * Cleanup, just in case ... ++ */ ++ clear_IO_APIC_pin(apic2, pin2); ++ } ++ apic_printk(APIC_VERBOSE," failed.\n"); ++ ++ if (nmi_watchdog == NMI_IO_APIC) { ++ printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n"); ++ nmi_watchdog = 0; ++ } ++ ++ apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as Virtual Wire IRQ..."); ++ ++ disable_8259A_irq(0); ++ irq_desc[0].chip = &lapic_irq_type; ++ apic_write(APIC_LVT0, APIC_DM_FIXED | cfg->vector); /* Fixed mode */ ++ enable_8259A_irq(0); ++ ++ if (timer_irq_works()) { ++ apic_printk(APIC_VERBOSE," works.\n"); ++ goto out; ++ } ++ apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector); ++ apic_printk(APIC_VERBOSE," failed.\n"); ++ ++ apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as ExtINT IRQ..."); ++ ++ init_8259A(0); ++ make_8259A_irq(0); ++ apic_write(APIC_LVT0, APIC_DM_EXTINT); ++ ++ unlock_ExtINT_logic(); ++ ++ if (timer_irq_works()) { ++ apic_printk(APIC_VERBOSE," works.\n"); ++ goto out; ++ } ++ apic_printk(APIC_VERBOSE," failed :(.\n"); ++ panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n"); ++out: ++ local_irq_restore(flags); ++} ++ ++static int __init notimercheck(char *s) ++{ ++ no_timer_check = 1; ++ return 1; ++} ++__setup("no_timer_check", notimercheck); ++#else ++#define check_timer() ((void)0) ++int timer_uses_ioapic_pin_0 = 0; ++#endif /* !CONFIG_XEN */ ++ ++/* ++ * ++ * IRQs that are handled by the PIC in the MPS IOAPIC case. ++ * - IRQ2 is the cascade IRQ, and cannot be a io-apic IRQ. ++ * Linux doesn't really care, as it's not actually used ++ * for any interrupt handling anyway. ++ */ ++#define PIC_IRQS (1<<2) ++ ++void __init setup_IO_APIC(void) ++{ ++ enable_IO_APIC(); ++ ++ if (acpi_ioapic) ++ io_apic_irqs = ~0; /* all IRQs go through IOAPIC */ ++ else ++ io_apic_irqs = ~PIC_IRQS; ++ ++ apic_printk(APIC_VERBOSE, "ENABLING IO-APIC IRQs\n"); ++ ++#ifndef CONFIG_XEN ++ sync_Arb_IDs(); ++#endif /* !CONFIG_XEN */ ++ setup_IO_APIC_irqs(); ++ init_IO_APIC_traps(); ++ check_timer(); ++ if (!acpi_ioapic) ++ print_IO_APIC(); ++} ++ ++struct sysfs_ioapic_data { ++ struct sys_device dev; ++ struct IO_APIC_route_entry entry[0]; ++}; ++static struct sysfs_ioapic_data * mp_ioapic_data[MAX_IO_APICS]; ++ ++static int ioapic_suspend(struct sys_device *dev, pm_message_t state) ++{ ++ struct IO_APIC_route_entry *entry; ++ struct sysfs_ioapic_data *data; ++ int i; ++ ++ data = container_of(dev, struct sysfs_ioapic_data, dev); ++ entry = data->entry; ++ for (i = 0; i < nr_ioapic_registers[dev->id]; i ++, entry ++ ) ++ *entry = ioapic_read_entry(dev->id, i); ++ ++ return 0; ++} ++ ++static int ioapic_resume(struct sys_device *dev) ++{ ++ struct IO_APIC_route_entry *entry; ++ struct sysfs_ioapic_data *data; ++ unsigned long flags; ++ union IO_APIC_reg_00 reg_00; ++ int i; ++ ++ data = container_of(dev, struct sysfs_ioapic_data, dev); ++ entry = data->entry; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_00.raw = io_apic_read(dev->id, 0); ++ if (reg_00.bits.ID != mp_ioapics[dev->id].mpc_apicid) { ++ reg_00.bits.ID = mp_ioapics[dev->id].mpc_apicid; ++ io_apic_write(dev->id, 0, reg_00.raw); ++ } ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ for (i = 0; i < nr_ioapic_registers[dev->id]; i++) ++ ioapic_write_entry(dev->id, i, entry[i]); ++ ++ return 0; ++} ++ ++static struct sysdev_class ioapic_sysdev_class = { ++ set_kset_name("ioapic"), ++ .suspend = ioapic_suspend, ++ .resume = ioapic_resume, ++}; ++ ++static int __init ioapic_init_sysfs(void) ++{ ++ struct sys_device * dev; ++ int i, size, error; ++ ++ error = sysdev_class_register(&ioapic_sysdev_class); ++ if (error) ++ return error; ++ ++ for (i = 0; i < nr_ioapics; i++ ) { ++ size = sizeof(struct sys_device) + nr_ioapic_registers[i] ++ * sizeof(struct IO_APIC_route_entry); ++ mp_ioapic_data[i] = kzalloc(size, GFP_KERNEL); ++ if (!mp_ioapic_data[i]) { ++ printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i); ++ continue; ++ } ++ dev = &mp_ioapic_data[i]->dev; ++ dev->id = i; ++ dev->cls = &ioapic_sysdev_class; ++ error = sysdev_register(dev); ++ if (error) { ++ kfree(mp_ioapic_data[i]); ++ mp_ioapic_data[i] = NULL; ++ printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i); ++ continue; ++ } ++ } ++ ++ return 0; ++} ++ ++device_initcall(ioapic_init_sysfs); ++ ++#ifndef CONFIG_XEN ++/* ++ * Dynamic irq allocate and deallocation ++ */ ++int create_irq(void) ++{ ++ /* Allocate an unused irq */ ++ int irq; ++ int new; ++ unsigned long flags; ++ ++ irq = -ENOSPC; ++ spin_lock_irqsave(&vector_lock, flags); ++ for (new = (NR_IRQS - 1); new >= 0; new--) { ++ if (platform_legacy_irq(new)) ++ continue; ++ if (irq_cfg[new].vector != 0) ++ continue; ++ if (__assign_irq_vector(new, TARGET_CPUS) == 0) ++ irq = new; ++ break; ++ } ++ spin_unlock_irqrestore(&vector_lock, flags); ++ ++ if (irq >= 0) { ++ dynamic_irq_init(irq); ++ } ++ return irq; ++} ++ ++void destroy_irq(unsigned int irq) ++{ ++ unsigned long flags; ++ ++ dynamic_irq_cleanup(irq); ++ ++ spin_lock_irqsave(&vector_lock, flags); ++ __clear_irq_vector(irq); ++ spin_unlock_irqrestore(&vector_lock, flags); ++} ++#endif ++ ++/* ++ * MSI message composition ++ */ ++#ifdef CONFIG_PCI_MSI ++static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msg *msg) ++{ ++ struct irq_cfg *cfg = irq_cfg + irq; ++ int err; ++ unsigned dest; ++ cpumask_t tmp; ++ ++ tmp = TARGET_CPUS; ++ err = assign_irq_vector(irq, tmp); ++ if (!err) { ++ cpus_and(tmp, cfg->domain, tmp); ++ dest = cpu_mask_to_apicid(tmp); ++ ++ msg->address_hi = MSI_ADDR_BASE_HI; ++ msg->address_lo = ++ MSI_ADDR_BASE_LO | ++ ((INT_DEST_MODE == 0) ? ++ MSI_ADDR_DEST_MODE_PHYSICAL: ++ MSI_ADDR_DEST_MODE_LOGICAL) | ++ ((INT_DELIVERY_MODE != dest_LowestPrio) ? ++ MSI_ADDR_REDIRECTION_CPU: ++ MSI_ADDR_REDIRECTION_LOWPRI) | ++ MSI_ADDR_DEST_ID(dest); ++ ++ msg->data = ++ MSI_DATA_TRIGGER_EDGE | ++ MSI_DATA_LEVEL_ASSERT | ++ ((INT_DELIVERY_MODE != dest_LowestPrio) ? ++ MSI_DATA_DELIVERY_FIXED: ++ MSI_DATA_DELIVERY_LOWPRI) | ++ MSI_DATA_VECTOR(cfg->vector); ++ } ++ return err; ++} ++ ++#ifdef CONFIG_SMP ++static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask) ++{ ++ struct irq_cfg *cfg = irq_cfg + irq; ++ struct msi_msg msg; ++ unsigned int dest; ++ cpumask_t tmp; ++ ++ cpus_and(tmp, mask, cpu_online_map); ++ if (cpus_empty(tmp)) ++ return; ++ ++ if (assign_irq_vector(irq, mask)) ++ return; ++ ++ cpus_and(tmp, cfg->domain, mask); ++ dest = cpu_mask_to_apicid(tmp); ++ ++ read_msi_msg(irq, &msg); ++ ++ msg.data &= ~MSI_DATA_VECTOR_MASK; ++ msg.data |= MSI_DATA_VECTOR(cfg->vector); ++ msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK; ++ msg.address_lo |= MSI_ADDR_DEST_ID(dest); ++ ++ write_msi_msg(irq, &msg); ++ irq_desc[irq].affinity = mask; ++} ++#endif /* CONFIG_SMP */ ++ ++/* ++ * IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices, ++ * which implement the MSI or MSI-X Capability Structure. ++ */ ++static struct irq_chip msi_chip = { ++ .name = "PCI-MSI", ++ .unmask = unmask_msi_irq, ++ .mask = mask_msi_irq, ++ .ack = ack_apic_edge, ++#ifdef CONFIG_SMP ++ .set_affinity = set_msi_irq_affinity, ++#endif ++ .retrigger = ioapic_retrigger_irq, ++}; ++ ++int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) ++{ ++ struct msi_msg msg; ++ int irq, ret; ++ irq = create_irq(); ++ if (irq < 0) ++ return irq; ++ ++ ret = msi_compose_msg(dev, irq, &msg); ++ if (ret < 0) { ++ destroy_irq(irq); ++ return ret; ++ } ++ ++ set_irq_msi(irq, desc); ++ write_msi_msg(irq, &msg); ++ ++ set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, "edge"); ++ ++ return 0; ++} ++ ++void arch_teardown_msi_irq(unsigned int irq) ++{ ++ destroy_irq(irq); ++} ++ ++#ifdef CONFIG_DMAR ++#ifdef CONFIG_SMP ++static void dmar_msi_set_affinity(unsigned int irq, cpumask_t mask) ++{ ++ struct irq_cfg *cfg = irq_cfg + irq; ++ struct msi_msg msg; ++ unsigned int dest; ++ cpumask_t tmp; ++ ++ cpus_and(tmp, mask, cpu_online_map); ++ if (cpus_empty(tmp)) ++ return; ++ ++ if (assign_irq_vector(irq, mask)) ++ return; ++ ++ cpus_and(tmp, cfg->domain, mask); ++ dest = cpu_mask_to_apicid(tmp); ++ ++ dmar_msi_read(irq, &msg); ++ ++ msg.data &= ~MSI_DATA_VECTOR_MASK; ++ msg.data |= MSI_DATA_VECTOR(cfg->vector); ++ msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK; ++ msg.address_lo |= MSI_ADDR_DEST_ID(dest); ++ ++ dmar_msi_write(irq, &msg); ++ irq_desc[irq].affinity = mask; ++} ++#endif /* CONFIG_SMP */ ++ ++struct irq_chip dmar_msi_type = { ++ .name = "DMAR_MSI", ++ .unmask = dmar_msi_unmask, ++ .mask = dmar_msi_mask, ++ .ack = ack_apic_edge, ++#ifdef CONFIG_SMP ++ .set_affinity = dmar_msi_set_affinity, ++#endif ++ .retrigger = ioapic_retrigger_irq, ++}; ++ ++int arch_setup_dmar_msi(unsigned int irq) ++{ ++ int ret; ++ struct msi_msg msg; ++ ++ ret = msi_compose_msg(NULL, irq, &msg); ++ if (ret < 0) ++ return ret; ++ dmar_msi_write(irq, &msg); ++ set_irq_chip_and_handler_name(irq, &dmar_msi_type, handle_edge_irq, ++ "edge"); ++ return 0; ++} ++#endif ++ ++#endif /* CONFIG_PCI_MSI */ ++/* ++ * Hypertransport interrupt support ++ */ ++#ifdef CONFIG_HT_IRQ ++ ++#ifdef CONFIG_SMP ++ ++static void target_ht_irq(unsigned int irq, unsigned int dest, u8 vector) ++{ ++ struct ht_irq_msg msg; ++ fetch_ht_irq_msg(irq, &msg); ++ ++ msg.address_lo &= ~(HT_IRQ_LOW_VECTOR_MASK | HT_IRQ_LOW_DEST_ID_MASK); ++ msg.address_hi &= ~(HT_IRQ_HIGH_DEST_ID_MASK); ++ ++ msg.address_lo |= HT_IRQ_LOW_VECTOR(vector) | HT_IRQ_LOW_DEST_ID(dest); ++ msg.address_hi |= HT_IRQ_HIGH_DEST_ID(dest); ++ ++ write_ht_irq_msg(irq, &msg); ++} ++ ++static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask) ++{ ++ struct irq_cfg *cfg = irq_cfg + irq; ++ unsigned int dest; ++ cpumask_t tmp; ++ ++ cpus_and(tmp, mask, cpu_online_map); ++ if (cpus_empty(tmp)) ++ return; ++ ++ if (assign_irq_vector(irq, mask)) ++ return; ++ ++ cpus_and(tmp, cfg->domain, mask); ++ dest = cpu_mask_to_apicid(tmp); ++ ++ target_ht_irq(irq, dest, cfg->vector); ++ irq_desc[irq].affinity = mask; ++} ++#endif ++ ++static struct irq_chip ht_irq_chip = { ++ .name = "PCI-HT", ++ .mask = mask_ht_irq, ++ .unmask = unmask_ht_irq, ++ .ack = ack_apic_edge, ++#ifdef CONFIG_SMP ++ .set_affinity = set_ht_irq_affinity, ++#endif ++ .retrigger = ioapic_retrigger_irq, ++}; ++ ++int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) ++{ ++ struct irq_cfg *cfg = irq_cfg + irq; ++ int err; ++ cpumask_t tmp; ++ ++ tmp = TARGET_CPUS; ++ err = assign_irq_vector(irq, tmp); ++ if (!err) { ++ struct ht_irq_msg msg; ++ unsigned dest; ++ ++ cpus_and(tmp, cfg->domain, tmp); ++ dest = cpu_mask_to_apicid(tmp); ++ ++ msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest); ++ ++ msg.address_lo = ++ HT_IRQ_LOW_BASE | ++ HT_IRQ_LOW_DEST_ID(dest) | ++ HT_IRQ_LOW_VECTOR(cfg->vector) | ++ ((INT_DEST_MODE == 0) ? ++ HT_IRQ_LOW_DM_PHYSICAL : ++ HT_IRQ_LOW_DM_LOGICAL) | ++ HT_IRQ_LOW_RQEOI_EDGE | ++ ((INT_DELIVERY_MODE != dest_LowestPrio) ? ++ HT_IRQ_LOW_MT_FIXED : ++ HT_IRQ_LOW_MT_ARBITRATED) | ++ HT_IRQ_LOW_IRQ_MASKED; ++ ++ write_ht_irq_msg(irq, &msg); ++ ++ set_irq_chip_and_handler_name(irq, &ht_irq_chip, ++ handle_edge_irq, "edge"); ++ } ++ return err; ++} ++#endif /* CONFIG_HT_IRQ */ ++ ++/* -------------------------------------------------------------------------- ++ ACPI-based IOAPIC Configuration ++ -------------------------------------------------------------------------- */ ++ ++#ifdef CONFIG_ACPI ++ ++#define IO_APIC_MAX_ID 0xFE ++ ++int __init io_apic_get_redir_entries (int ioapic) ++{ ++ union IO_APIC_reg_01 reg_01; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ioapic_lock, flags); ++ reg_01.raw = io_apic_read(ioapic, 1); ++ spin_unlock_irqrestore(&ioapic_lock, flags); ++ ++ return reg_01.bits.entries; ++} ++ ++ ++int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity) ++{ ++ if (!IO_APIC_IRQ(irq)) { ++ apic_printk(APIC_QUIET,KERN_ERR "IOAPIC[%d]: Invalid reference to IRQ 0\n", ++ ioapic); ++ return -EINVAL; ++ } ++ ++ /* ++ * IRQs < 16 are already in the irq_2_pin[] map ++ */ ++ if (irq >= 16) ++ add_pin_to_irq(irq, ioapic, pin); ++ ++ setup_IO_APIC_irq(ioapic, pin, irq, triggering, polarity); ++ ++ return 0; ++} ++ ++ ++int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity) ++{ ++ int i; ++ ++ if (skip_ioapic_setup) ++ return -1; ++ ++ for (i = 0; i < mp_irq_entries; i++) ++ if (mp_irqs[i].mpc_irqtype == mp_INT && ++ mp_irqs[i].mpc_srcbusirq == bus_irq) ++ break; ++ if (i >= mp_irq_entries) ++ return -1; ++ ++ *trigger = irq_trigger(i); ++ *polarity = irq_polarity(i); ++ return 0; ++} ++ ++#endif /* CONFIG_ACPI */ ++ ++#ifndef CONFIG_XEN ++/* ++ * This function currently is only a helper for the i386 smp boot process where ++ * we need to reprogram the ioredtbls to cater for the cpus which have come online ++ * so mask in all cases should simply be TARGET_CPUS ++ */ ++#ifdef CONFIG_SMP ++void __init setup_ioapic_dest(void) ++{ ++ int pin, ioapic, irq, irq_entry; ++ ++ if (skip_ioapic_setup == 1) ++ return; ++ ++ for (ioapic = 0; ioapic < nr_ioapics; ioapic++) { ++ for (pin = 0; pin < nr_ioapic_registers[ioapic]; pin++) { ++ irq_entry = find_irq_entry(ioapic, pin, mp_INT); ++ if (irq_entry == -1) ++ continue; ++ irq = pin_2_irq(irq_entry, ioapic, pin); ++ ++ /* setup_IO_APIC_irqs could fail to get vector for some device ++ * when you have too many devices, because at that time only boot ++ * cpu is online. ++ */ ++ if (!irq_cfg[irq].vector) ++ setup_IO_APIC_irq(ioapic, pin, irq, ++ irq_trigger(irq_entry), ++ irq_polarity(irq_entry)); ++ else ++ set_ioapic_affinity_irq(irq, TARGET_CPUS); ++ } ++ ++ } ++} ++#endif ++#endif /* !CONFIG_XEN */ ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/ioport_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/ioport_32-xen.c +--- ./arch/x86/kernel/ioport_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/ioport_32-xen.c 2012-11-13 15:20:17.300569001 +0000 +@@ -0,0 +1,120 @@ ++/* ++ * This contains the io-permission bitmap code - written by obz, with changes ++ * by Linus. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ ++static void set_bitmap(unsigned long *bitmap, unsigned int base, unsigned int extent, int new_value) ++{ ++ unsigned long mask; ++ unsigned long *bitmap_base = bitmap + (base / BITS_PER_LONG); ++ unsigned int low_index = base & (BITS_PER_LONG-1); ++ int length = low_index + extent; ++ ++ if (low_index != 0) { ++ mask = (~0UL << low_index); ++ if (length < BITS_PER_LONG) ++ mask &= ~(~0UL << length); ++ if (new_value) ++ *bitmap_base++ |= mask; ++ else ++ *bitmap_base++ &= ~mask; ++ length -= BITS_PER_LONG; ++ } ++ ++ mask = (new_value ? ~0UL : 0UL); ++ while (length >= BITS_PER_LONG) { ++ *bitmap_base++ = mask; ++ length -= BITS_PER_LONG; ++ } ++ ++ if (length > 0) { ++ mask = ~(~0UL << length); ++ if (new_value) ++ *bitmap_base++ |= mask; ++ else ++ *bitmap_base++ &= ~mask; ++ } ++} ++ ++ ++/* ++ * this changes the io permissions bitmap in the current task. ++ */ ++asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) ++{ ++ struct thread_struct * t = ¤t->thread; ++ unsigned long *bitmap; ++ struct physdev_set_iobitmap set_iobitmap; ++ ++ if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) ++ return -EINVAL; ++ if (turn_on && !capable(CAP_SYS_RAWIO)) ++ return -EPERM; ++ ++ /* ++ * If it's the first ioperm() call in this thread's lifetime, set the ++ * IO bitmap up. ioperm() is much less timing critical than clone(), ++ * this is why we delay this operation until now: ++ */ ++ if (!t->io_bitmap_ptr) { ++ bitmap = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); ++ if (!bitmap) ++ return -ENOMEM; ++ ++ memset(bitmap, 0xff, IO_BITMAP_BYTES); ++ t->io_bitmap_ptr = bitmap; ++ set_thread_flag(TIF_IO_BITMAP); ++ ++ set_xen_guest_handle(set_iobitmap.bitmap, (char *)bitmap); ++ set_iobitmap.nr_ports = IO_BITMAP_BITS; ++ HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &set_iobitmap); ++ } ++ ++ set_bitmap(t->io_bitmap_ptr, from, num, !turn_on); ++ ++ return 0; ++} ++ ++/* ++ * sys_iopl has to be used when you want to access the IO ports ++ * beyond the 0x3ff range: to get the full 65536 ports bitmapped ++ * you'd need 8kB of bitmaps/process, which is a bit excessive. ++ * ++ * Here we just change the eflags value on the stack: we allow ++ * only the super-user to do it. This depends on the stack-layout ++ * on system-call entry - see also fork() and the signal handling ++ * code. ++ */ ++ ++asmlinkage long sys_iopl(unsigned long unused) ++{ ++ volatile struct pt_regs * regs = (struct pt_regs *) &unused; ++ unsigned int level = regs->ebx; ++ struct thread_struct *t = ¤t->thread; ++ unsigned int old = (t->iopl >> 12) & 3; ++ ++ if (level > 3) ++ return -EINVAL; ++ /* Trying to gain more privileges? */ ++ if (level > old) { ++ if (!capable(CAP_SYS_RAWIO)) ++ return -EPERM; ++ } ++ t->iopl = level << 12; ++ set_iopl_mask(t->iopl); ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/ioport_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/ioport_64-xen.c +--- ./arch/x86/kernel/ioport_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/ioport_64-xen.c 2012-11-13 15:20:17.300569001 +0000 +@@ -0,0 +1,98 @@ ++/* ++ * This contains the io-permission bitmap code - written by obz, with changes ++ * by Linus. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ ++static void set_bitmap(unsigned long *bitmap, unsigned int base, unsigned int extent, int new_value) ++{ ++ int i; ++ ++ if (new_value) ++ for (i = base; i < base + extent; i++) ++ __set_bit(i, bitmap); ++ else ++ for (i = base; i < base + extent; i++) ++ clear_bit(i, bitmap); ++} ++ ++/* ++ * this changes the io permissions bitmap in the current task. ++ */ ++asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) ++{ ++ struct thread_struct * t = ¤t->thread; ++ unsigned long *bitmap; ++ struct physdev_set_iobitmap set_iobitmap; ++ ++ if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) ++ return -EINVAL; ++ if (turn_on && !capable(CAP_SYS_RAWIO)) ++ return -EPERM; ++ ++ /* ++ * If it's the first ioperm() call in this thread's lifetime, set the ++ * IO bitmap up. ioperm() is much less timing critical than clone(), ++ * this is why we delay this operation until now: ++ */ ++ if (!t->io_bitmap_ptr) { ++ bitmap = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); ++ if (!bitmap) ++ return -ENOMEM; ++ ++ memset(bitmap, 0xff, IO_BITMAP_BYTES); ++ t->io_bitmap_ptr = bitmap; ++ set_thread_flag(TIF_IO_BITMAP); ++ ++ set_xen_guest_handle(set_iobitmap.bitmap, (char *)bitmap); ++ set_iobitmap.nr_ports = IO_BITMAP_BITS; ++ HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &set_iobitmap); ++ } ++ ++ set_bitmap(t->io_bitmap_ptr, from, num, !turn_on); ++ ++ return 0; ++} ++ ++/* ++ * sys_iopl has to be used when you want to access the IO ports ++ * beyond the 0x3ff range: to get the full 65536 ports bitmapped ++ * you'd need 8kB of bitmaps/process, which is a bit excessive. ++ * ++ */ ++ ++asmlinkage long sys_iopl(unsigned int new_iopl, struct pt_regs *regs) ++{ ++ unsigned int old_iopl = current->thread.iopl; ++ struct physdev_set_iopl set_iopl; ++ ++ if (new_iopl > 3) ++ return -EINVAL; ++ ++ /* Need "raw I/O" privileges for direct port access. */ ++ if ((new_iopl > old_iopl) && !capable(CAP_SYS_RAWIO)) ++ return -EPERM; ++ ++ /* Change our version of the privilege levels. */ ++ current->thread.iopl = new_iopl; ++ ++ /* Force the change at ring 0. */ ++ set_iopl.iopl = (new_iopl == 0) ? 1 : new_iopl; ++ HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl); ++ ++ return 0; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/irq_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/irq_32-xen.c +--- ./arch/x86/kernel/irq_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/irq_32-xen.c 2012-11-13 15:20:17.300569001 +0000 +@@ -0,0 +1,385 @@ ++/* ++ * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar ++ * ++ * This file contains the lowest level x86-specific interrupt ++ * entry, irq-stacks and irq statistics code. All the remaining ++ * irq logic is done by the generic kernel/irq/ code and ++ * by the x86-specific irq controller code. (e.g. i8259.c and ++ * io_apic.c.) ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); ++EXPORT_PER_CPU_SYMBOL(irq_stat); ++ ++DEFINE_PER_CPU(struct pt_regs *, irq_regs); ++EXPORT_PER_CPU_SYMBOL(irq_regs); ++ ++/* ++ * 'what should we do if we get a hw irq event on an illegal vector'. ++ * each architecture has to answer this themselves. ++ */ ++void ack_bad_irq(unsigned int irq) ++{ ++ printk(KERN_ERR "unexpected IRQ trap at vector %02x\n", irq); ++ ++#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN) ++ /* ++ * Currently unexpected vectors happen only on SMP and APIC. ++ * We _must_ ack these because every local APIC has only N ++ * irq slots per priority level, and a 'hanging, unacked' IRQ ++ * holds up an irq slot - in excessive cases (when multiple ++ * unexpected vectors occur) that might lock up the APIC ++ * completely. ++ * But only ack when the APIC is enabled -AK ++ */ ++ if (cpu_has_apic) ++ ack_APIC_irq(); ++#endif ++} ++ ++#ifdef CONFIG_4KSTACKS ++/* ++ * per-CPU IRQ handling contexts (thread information and stack) ++ */ ++union irq_ctx { ++ struct thread_info tinfo; ++ u32 stack[THREAD_SIZE/sizeof(u32)]; ++}; ++ ++static union irq_ctx *hardirq_ctx[NR_CPUS] __read_mostly; ++static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly; ++#endif ++ ++/* ++ * do_IRQ handles all normal device IRQ's (the special ++ * SMP cross-CPU interrupts have their own specific ++ * handlers). ++ */ ++fastcall unsigned int do_IRQ(struct pt_regs *regs) ++{ ++ struct pt_regs *old_regs; ++ /* high bit used in ret_from_ code */ ++ int irq = ~regs->orig_eax; ++ struct irq_desc *desc = irq_desc + irq; ++#ifdef CONFIG_4KSTACKS ++ union irq_ctx *curctx, *irqctx; ++ u32 *isp; ++#endif ++ ++ if (unlikely((unsigned)irq >= NR_IRQS)) { ++ printk(KERN_EMERG "%s: cannot handle IRQ %d\n", ++ __FUNCTION__, irq); ++ BUG(); ++ } ++ ++ old_regs = set_irq_regs(regs); ++ irq_enter(); ++#ifdef CONFIG_DEBUG_STACKOVERFLOW ++ /* Debugging check for stack overflow: is there less than 1KB free? */ ++ { ++ long esp; ++ ++ __asm__ __volatile__("andl %%esp,%0" : ++ "=r" (esp) : "0" (THREAD_SIZE - 1)); ++ if (unlikely(esp < (sizeof(struct thread_info) + STACK_WARN))) { ++ printk("do_IRQ: stack overflow: %ld\n", ++ esp - sizeof(struct thread_info)); ++ dump_stack(); ++ } ++ } ++#endif ++ ++#ifdef CONFIG_4KSTACKS ++ ++ curctx = (union irq_ctx *) current_thread_info(); ++ irqctx = hardirq_ctx[smp_processor_id()]; ++ ++ /* ++ * this is where we switch to the IRQ stack. However, if we are ++ * already using the IRQ stack (because we interrupted a hardirq ++ * handler) we can't do that and just have to keep using the ++ * current stack (which is the irq stack already after all) ++ */ ++ if (curctx != irqctx) { ++ int arg1, arg2, ebx; ++ ++ /* build the stack frame on the IRQ stack */ ++ isp = (u32*) ((char*)irqctx + sizeof(*irqctx)); ++ irqctx->tinfo.task = curctx->tinfo.task; ++ irqctx->tinfo.previous_esp = current_stack_pointer; ++ ++ /* ++ * Copy the softirq bits in preempt_count so that the ++ * softirq checks work in the hardirq context. ++ */ ++ irqctx->tinfo.preempt_count = ++ (irqctx->tinfo.preempt_count & ~SOFTIRQ_MASK) | ++ (curctx->tinfo.preempt_count & SOFTIRQ_MASK); ++ ++ asm volatile( ++ " xchgl %%ebx,%%esp \n" ++ " call *%%edi \n" ++ " movl %%ebx,%%esp \n" ++ : "=a" (arg1), "=d" (arg2), "=b" (ebx) ++ : "0" (irq), "1" (desc), "2" (isp), ++ "D" (desc->handle_irq) ++ : "memory", "cc" ++ ); ++ } else ++#endif ++ desc->handle_irq(irq, desc); ++ ++ irq_exit(); ++ set_irq_regs(old_regs); ++ return 1; ++} ++ ++#ifdef CONFIG_4KSTACKS ++ ++static char softirq_stack[NR_CPUS * THREAD_SIZE] ++ __attribute__((__section__(".bss.page_aligned"))); ++ ++static char hardirq_stack[NR_CPUS * THREAD_SIZE] ++ __attribute__((__section__(".bss.page_aligned"))); ++ ++/* ++ * allocate per-cpu stacks for hardirq and for softirq processing ++ */ ++void irq_ctx_init(int cpu) ++{ ++ union irq_ctx *irqctx; ++ ++ if (hardirq_ctx[cpu]) ++ return; ++ ++ irqctx = (union irq_ctx*) &hardirq_stack[cpu*THREAD_SIZE]; ++ irqctx->tinfo.task = NULL; ++ irqctx->tinfo.exec_domain = NULL; ++ irqctx->tinfo.cpu = cpu; ++ irqctx->tinfo.preempt_count = HARDIRQ_OFFSET; ++ irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); ++ ++ hardirq_ctx[cpu] = irqctx; ++ ++ irqctx = (union irq_ctx*) &softirq_stack[cpu*THREAD_SIZE]; ++ irqctx->tinfo.task = NULL; ++ irqctx->tinfo.exec_domain = NULL; ++ irqctx->tinfo.cpu = cpu; ++ irqctx->tinfo.preempt_count = 0; ++ irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); ++ ++ softirq_ctx[cpu] = irqctx; ++ ++ printk("CPU %u irqstacks, hard=%p soft=%p\n", ++ cpu,hardirq_ctx[cpu],softirq_ctx[cpu]); ++} ++ ++void irq_ctx_exit(int cpu) ++{ ++ hardirq_ctx[cpu] = NULL; ++} ++ ++extern asmlinkage void __do_softirq(void); ++ ++asmlinkage void do_softirq(void) ++{ ++ unsigned long flags; ++ struct thread_info *curctx; ++ union irq_ctx *irqctx; ++ u32 *isp; ++ ++ if (in_interrupt()) ++ return; ++ ++ local_irq_save(flags); ++ ++ if (local_softirq_pending()) { ++ curctx = current_thread_info(); ++ irqctx = softirq_ctx[smp_processor_id()]; ++ irqctx->tinfo.task = curctx->task; ++ irqctx->tinfo.previous_esp = current_stack_pointer; ++ ++ /* build the stack frame on the softirq stack */ ++ isp = (u32*) ((char*)irqctx + sizeof(*irqctx)); ++ ++ asm volatile( ++ " xchgl %%ebx,%%esp \n" ++ " call __do_softirq \n" ++ " movl %%ebx,%%esp \n" ++ : "=b"(isp) ++ : "0"(isp) ++ : "memory", "cc", "edx", "ecx", "eax" ++ ); ++ /* ++ * Shouldnt happen, we returned above if in_interrupt(): ++ */ ++ WARN_ON_ONCE(softirq_count()); ++ } ++ ++ local_irq_restore(flags); ++} ++#endif ++ ++/* ++ * Interrupt statistics: ++ */ ++ ++#ifndef CONFIG_XEN ++atomic_t irq_err_count; ++#endif ++ ++/* ++ * /proc/interrupts printing: ++ */ ++ ++int show_interrupts(struct seq_file *p, void *v) ++{ ++ int i = *(loff_t *) v, j; ++ struct irqaction * action; ++ unsigned long flags; ++ ++ if (i == 0) { ++ seq_printf(p, " "); ++ for_each_online_cpu(j) ++ seq_printf(p, "CPU%-8d",j); ++ seq_putc(p, '\n'); ++ } ++ ++ if (i < NR_IRQS) { ++ unsigned any_count = 0; ++ ++ spin_lock_irqsave(&irq_desc[i].lock, flags); ++#ifndef CONFIG_SMP ++ any_count = kstat_irqs(i); ++#else ++ for_each_online_cpu(j) ++ any_count |= kstat_cpu(j).irqs[i]; ++#endif ++ action = irq_desc[i].action; ++ if (!action && !any_count) ++ goto skip; ++ seq_printf(p, "%3d: ",i); ++#ifndef CONFIG_SMP ++ seq_printf(p, "%10u ", kstat_irqs(i)); ++#else ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); ++#endif ++ seq_printf(p, " %8s", irq_desc[i].chip->name); ++ seq_printf(p, "-%-8s", irq_desc[i].name); ++ ++ if (action) { ++ seq_printf(p, " %s", action->name); ++ while ((action = action->next) != NULL) ++ seq_printf(p, ", %s", action->name); ++ } ++ ++ seq_putc(p, '\n'); ++skip: ++ spin_unlock_irqrestore(&irq_desc[i].lock, flags); ++ } else if (i == NR_IRQS) { ++ seq_printf(p, "NMI: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", nmi_count(j)); ++ seq_printf(p, " Non-maskable interrupts\n"); ++#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN) ++ seq_printf(p, "LOC: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", ++ per_cpu(irq_stat,j).apic_timer_irqs); ++ seq_printf(p, " Local timer interrupts\n"); ++#endif ++#ifdef CONFIG_SMP ++ seq_printf(p, "RES: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", ++ per_cpu(irq_stat,j).irq_resched_count); ++ seq_printf(p, " Rescheduling interrupts\n"); ++ seq_printf(p, "CAL: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", ++ per_cpu(irq_stat,j).irq_call_count); ++ seq_printf(p, " function call interrupts\n"); ++#ifndef CONFIG_XEN ++ seq_printf(p, "TLB: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", ++ per_cpu(irq_stat,j).irq_tlb_count); ++ seq_printf(p, " TLB shootdowns\n"); ++#endif ++#endif ++#ifdef CONFIG_X86_MCE ++ seq_printf(p, "TRM: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", ++ per_cpu(irq_stat,j).irq_thermal_count); ++ seq_printf(p, " Thermal event interrupts\n"); ++#endif ++#ifndef CONFIG_XEN ++#ifdef CONFIG_X86_LOCAL_APIC ++ seq_printf(p, "SPU: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", ++ per_cpu(irq_stat,j).irq_spurious_count); ++ seq_printf(p, " Spurious interrupts\n"); ++#endif ++ seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); ++#if defined(CONFIG_X86_IO_APIC) ++ seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); ++#endif ++#endif ++ } ++ return 0; ++} ++ ++#ifdef CONFIG_HOTPLUG_CPU ++ ++void fixup_irqs(cpumask_t map) ++{ ++ unsigned int irq; ++ static int warned; ++ ++ for (irq = 0; irq < NR_IRQS; irq++) { ++ cpumask_t mask; ++ if (irq == 2) ++ continue; ++ ++ cpus_and(mask, irq_desc[irq].affinity, map); ++ if (any_online_cpu(mask) == NR_CPUS) { ++ /*printk("Breaking affinity for irq %i\n", irq);*/ ++ mask = map; ++ } ++ if (irq_desc[irq].chip->set_affinity) ++ irq_desc[irq].chip->set_affinity(irq, mask); ++ else if (irq_desc[irq].action && !(warned++)) ++ printk("Cannot set affinity for irq %i\n", irq); ++ } ++ ++#if 0 ++ barrier(); ++ /* Ingo Molnar says: "after the IO-APIC masks have been redirected ++ [note the nop - the interrupt-enable boundary on x86 is two ++ instructions from sti] - to flush out pending hardirqs and ++ IPIs. After this point nothing is supposed to reach this CPU." */ ++ __asm__ __volatile__("sti; nop; cli"); ++ barrier(); ++#else ++ /* That doesn't seem sufficient. Give it 1ms. */ ++ local_irq_enable(); ++ mdelay(1); ++ local_irq_disable(); ++#endif ++} ++#endif ++ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/irq_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/irq_64-xen.c +--- ./arch/x86/kernel/irq_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/irq_64-xen.c 2012-11-13 15:20:17.300569001 +0000 +@@ -0,0 +1,266 @@ ++/* ++ * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar ++ * ++ * This file contains the lowest level x86_64-specific interrupt ++ * entry and irq statistics code. All the remaining irq logic is ++ * done by the generic kernel/irq/ code and in the ++ * x86_64-specific irq controller code. (e.g. i8259.c and ++ * io_apic.c.) ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifndef CONFIG_XEN ++atomic_t irq_err_count; ++#endif ++ ++#ifdef CONFIG_DEBUG_STACKOVERFLOW ++/* ++ * Probabilistic stack overflow check: ++ * ++ * Only check the stack in process context, because everything else ++ * runs on the big interrupt stacks. Checking reliably is too expensive, ++ * so we just check from interrupts. ++ */ ++static inline void stack_overflow_check(struct pt_regs *regs) ++{ ++ u64 curbase = (u64)task_stack_page(current); ++ static unsigned long warned = -60*HZ; ++ ++ if (regs->rsp >= curbase && regs->rsp <= curbase + THREAD_SIZE && ++ regs->rsp < curbase + sizeof(struct thread_info) + 128 && ++ time_after(jiffies, warned + 60*HZ)) { ++ printk("do_IRQ: %s near stack overflow (cur:%Lx,rsp:%lx)\n", ++ current->comm, curbase, regs->rsp); ++ show_stack(NULL,NULL); ++ warned = jiffies; ++ } ++} ++#endif ++ ++/* ++ * Generic, controller-independent functions: ++ */ ++ ++int show_interrupts(struct seq_file *p, void *v) ++{ ++ int i = *(loff_t *) v, j; ++ struct irqaction * action; ++ unsigned long flags; ++ ++ if (i == 0) { ++ seq_printf(p, " "); ++ for_each_online_cpu(j) ++ seq_printf(p, "CPU%-8d",j); ++ seq_putc(p, '\n'); ++ } ++ ++ if (i < NR_IRQS) { ++ unsigned any_count = 0; ++ ++ spin_lock_irqsave(&irq_desc[i].lock, flags); ++#ifndef CONFIG_SMP ++ any_count = kstat_irqs(i); ++#else ++ for_each_online_cpu(j) ++ any_count |= kstat_cpu(j).irqs[i]; ++#endif ++ action = irq_desc[i].action; ++ if (!action && !any_count) ++ goto skip; ++ seq_printf(p, "%3d: ",i); ++#ifndef CONFIG_SMP ++ seq_printf(p, "%10u ", kstat_irqs(i)); ++#else ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); ++#endif ++ seq_printf(p, " %8s", irq_desc[i].chip->name); ++ seq_printf(p, "-%-8s", irq_desc[i].name); ++ ++ if (action) { ++ seq_printf(p, " %s", action->name); ++ while ((action = action->next) != NULL) ++ seq_printf(p, ", %s", action->name); ++ } ++ seq_putc(p, '\n'); ++skip: ++ spin_unlock_irqrestore(&irq_desc[i].lock, flags); ++ } else if (i == NR_IRQS) { ++ seq_printf(p, "NMI: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); ++ seq_printf(p, " Non-maskable interrupts\n"); ++#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN) ++ seq_printf(p, "LOC: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", cpu_pda(j)->apic_timer_irqs); ++ seq_printf(p, " Local timer interrupts\n"); ++#endif ++#ifdef CONFIG_SMP ++ seq_printf(p, "RES: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", cpu_pda(j)->irq_resched_count); ++ seq_printf(p, " Rescheduling interrupts\n"); ++ seq_printf(p, "CAL: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", cpu_pda(j)->irq_call_count); ++ seq_printf(p, " function call interrupts\n"); ++#ifndef CONFIG_XEN ++ seq_printf(p, "TLB: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", cpu_pda(j)->irq_tlb_count); ++ seq_printf(p, " TLB shootdowns\n"); ++#endif ++#endif ++#ifdef CONFIG_X86_MCE ++ seq_printf(p, "TRM: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", cpu_pda(j)->irq_thermal_count); ++ seq_printf(p, " Thermal event interrupts\n"); ++ seq_printf(p, "THR: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", cpu_pda(j)->irq_threshold_count); ++ seq_printf(p, " Threshold APIC interrupts\n"); ++#endif ++#ifndef CONFIG_XEN ++#ifdef CONFIG_X86_LOCAL_APIC ++ seq_printf(p, "SPU: "); ++ for_each_online_cpu(j) ++ seq_printf(p, "%10u ", cpu_pda(j)->irq_spurious_count); ++ seq_printf(p, " Spurious interrupts\n"); ++#endif ++ seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); ++#endif ++ } ++ return 0; ++} ++ ++/* ++ * do_IRQ handles all normal device IRQ's (the special ++ * SMP cross-CPU interrupts have their own specific ++ * handlers). ++ */ ++asmlinkage unsigned int do_IRQ(struct pt_regs *regs) ++{ ++ struct pt_regs *old_regs = set_irq_regs(regs); ++ ++ /* high bit used in ret_from_ code */ ++ unsigned irq = ~regs->orig_rax; ++ ++ exit_idle(); ++ irq_enter(); ++ ++#ifdef CONFIG_DEBUG_STACKOVERFLOW ++ stack_overflow_check(regs); ++#endif ++ ++ if (likely(irq < NR_IRQS)) ++ generic_handle_irq(irq); ++ else { ++#ifndef CONFIG_XEN ++ if (!disable_apic) ++ ack_APIC_irq(); ++#endif ++ if (printk_ratelimit()) ++ printk(KERN_EMERG "%s: %d.%d No irq handler for irq\n", ++ __func__, smp_processor_id(), irq); ++ } ++ ++ irq_exit(); ++ ++ set_irq_regs(old_regs); ++ return 1; ++} ++ ++#ifdef CONFIG_HOTPLUG_CPU ++void fixup_irqs(cpumask_t map) ++{ ++ unsigned int irq; ++ static int warned; ++ ++ for (irq = 0; irq < NR_IRQS; irq++) { ++ cpumask_t mask; ++ int break_affinity = 0; ++ int set_affinity = 1; ++ ++ if (irq == 2) ++ continue; ++ ++ /* interrupt's are disabled at this point */ ++ spin_lock(&irq_desc[irq].lock); ++ ++ if (!irq_has_action(irq) || ++ cpus_equal(irq_desc[irq].affinity, map)) { ++ spin_unlock(&irq_desc[irq].lock); ++ continue; ++ } ++ ++ cpus_and(mask, irq_desc[irq].affinity, map); ++ if (cpus_empty(mask)) { ++ break_affinity = 1; ++ mask = map; ++ } ++ ++ if (irq_desc[irq].chip->mask) ++ irq_desc[irq].chip->mask(irq); ++ ++ if (irq_desc[irq].chip->set_affinity) ++ irq_desc[irq].chip->set_affinity(irq, mask); ++ else if (!(warned++)) ++ set_affinity = 0; ++ ++ if (irq_desc[irq].chip->unmask) ++ irq_desc[irq].chip->unmask(irq); ++ ++ spin_unlock(&irq_desc[irq].lock); ++ ++ if (break_affinity && set_affinity) ++ printk("Broke affinity for irq %i\n", irq); ++ else if (!set_affinity) ++ printk("Cannot set affinity for irq %i\n", irq); ++ } ++ ++ /* That doesn't seem sufficient. Give it 1ms. */ ++ local_irq_enable(); ++ mdelay(1); ++ local_irq_disable(); ++} ++#endif ++ ++extern void call_softirq(void); ++ ++asmlinkage void do_softirq(void) ++{ ++ __u32 pending; ++ unsigned long flags; ++ ++ if (in_interrupt()) ++ return; ++ ++ local_irq_save(flags); ++ pending = local_softirq_pending(); ++ /* Switch to interrupt stack */ ++ if (pending) { ++ call_softirq(); ++ WARN_ON_ONCE(softirq_count()); ++ } ++ local_irq_restore(flags); ++} ++ ++/* ++ * 'what should we do if we get a hw irq event on an illegal vector'. ++ * each architecture has to answer this themselves. ++ */ ++void ack_bad_irq(unsigned int irq) ++{ ++ printk("unexpected IRQ trap at irq %02x\n", irq); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/ldt_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/ldt_32-xen.c +--- ./arch/x86/kernel/ldt_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/ldt_32-xen.c 2012-11-13 15:20:17.304569001 +0000 +@@ -0,0 +1,265 @@ ++/* ++ * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds ++ * Copyright (C) 1999 Ingo Molnar ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef CONFIG_SMP /* avoids "defined but not used" warnig */ ++static void flush_ldt(void *null) ++{ ++ if (current->active_mm) ++ load_LDT(¤t->active_mm->context); ++} ++#endif ++ ++static int alloc_ldt(mm_context_t *pc, int mincount, int reload) ++{ ++ void *oldldt; ++ void *newldt; ++ int oldsize; ++ ++ if (mincount <= pc->size) ++ return 0; ++ oldsize = pc->size; ++ mincount = (mincount+511)&(~511); ++ if (mincount*LDT_ENTRY_SIZE > PAGE_SIZE) ++ newldt = vmalloc(mincount*LDT_ENTRY_SIZE); ++ else ++ newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL); ++ ++ if (!newldt) ++ return -ENOMEM; ++ ++ if (oldsize) ++ memcpy(newldt, pc->ldt, oldsize*LDT_ENTRY_SIZE); ++ oldldt = pc->ldt; ++ memset(newldt+oldsize*LDT_ENTRY_SIZE, 0, (mincount-oldsize)*LDT_ENTRY_SIZE); ++ pc->ldt = newldt; ++ wmb(); ++ pc->size = mincount; ++ wmb(); ++ ++ if (reload) { ++#ifdef CONFIG_SMP ++ cpumask_t mask; ++ preempt_disable(); ++#endif ++ make_pages_readonly( ++ pc->ldt, ++ (pc->size * LDT_ENTRY_SIZE) / PAGE_SIZE, ++ XENFEAT_writable_descriptor_tables); ++ load_LDT(pc); ++#ifdef CONFIG_SMP ++ mask = cpumask_of_cpu(smp_processor_id()); ++ if (!cpus_equal(current->mm->cpu_vm_mask, mask)) ++ smp_call_function(flush_ldt, NULL, 1, 1); ++ preempt_enable(); ++#endif ++ } ++ if (oldsize) { ++ make_pages_writable( ++ oldldt, ++ (oldsize * LDT_ENTRY_SIZE) / PAGE_SIZE, ++ XENFEAT_writable_descriptor_tables); ++ if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE) ++ vfree(oldldt); ++ else ++ kfree(oldldt); ++ } ++ return 0; ++} ++ ++static inline int copy_ldt(mm_context_t *new, mm_context_t *old) ++{ ++ int err = alloc_ldt(new, old->size, 0); ++ if (err < 0) ++ return err; ++ memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE); ++ make_pages_readonly( ++ new->ldt, ++ (new->size * LDT_ENTRY_SIZE) / PAGE_SIZE, ++ XENFEAT_writable_descriptor_tables); ++ return 0; ++} ++ ++/* ++ * we do not have to muck with descriptors here, that is ++ * done in switch_mm() as needed. ++ */ ++int init_new_context(struct task_struct *tsk, struct mm_struct *mm) ++{ ++ struct mm_struct * old_mm; ++ int retval = 0; ++ ++ mutex_init(&mm->context.lock); ++ mm->context.size = 0; ++ mm->context.has_foreign_mappings = 0; ++ old_mm = current->mm; ++ if (old_mm && old_mm->context.size > 0) { ++ mutex_lock(&old_mm->context.lock); ++ retval = copy_ldt(&mm->context, &old_mm->context); ++ mutex_unlock(&old_mm->context.lock); ++ } ++ return retval; ++} ++ ++/* ++ * No need to lock the MM as we are the last user ++ */ ++void destroy_context(struct mm_struct *mm) ++{ ++ if (mm->context.size) { ++ if (mm == current->active_mm) ++ clear_LDT(); ++ make_pages_writable( ++ mm->context.ldt, ++ (mm->context.size * LDT_ENTRY_SIZE) / PAGE_SIZE, ++ XENFEAT_writable_descriptor_tables); ++ if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE) ++ vfree(mm->context.ldt); ++ else ++ kfree(mm->context.ldt); ++ mm->context.size = 0; ++ } ++} ++ ++static int read_ldt(void __user * ptr, unsigned long bytecount) ++{ ++ int err; ++ unsigned long size; ++ struct mm_struct * mm = current->mm; ++ ++ if (!mm->context.size) ++ return 0; ++ if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) ++ bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; ++ ++ mutex_lock(&mm->context.lock); ++ size = mm->context.size*LDT_ENTRY_SIZE; ++ if (size > bytecount) ++ size = bytecount; ++ ++ err = 0; ++ if (copy_to_user(ptr, mm->context.ldt, size)) ++ err = -EFAULT; ++ mutex_unlock(&mm->context.lock); ++ if (err < 0) ++ goto error_return; ++ if (size != bytecount) { ++ /* zero-fill the rest */ ++ if (clear_user(ptr+size, bytecount-size) != 0) { ++ err = -EFAULT; ++ goto error_return; ++ } ++ } ++ return bytecount; ++error_return: ++ return err; ++} ++ ++static int read_default_ldt(void __user * ptr, unsigned long bytecount) ++{ ++ int err; ++ unsigned long size; ++ ++ err = 0; ++ size = 5*sizeof(struct desc_struct); ++ if (size > bytecount) ++ size = bytecount; ++ ++ err = size; ++ if (clear_user(ptr, size)) ++ err = -EFAULT; ++ ++ return err; ++} ++ ++static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode) ++{ ++ struct mm_struct * mm = current->mm; ++ __u32 entry_1, entry_2; ++ int error; ++ struct user_desc ldt_info; ++ ++ error = -EINVAL; ++ if (bytecount != sizeof(ldt_info)) ++ goto out; ++ error = -EFAULT; ++ if (copy_from_user(&ldt_info, ptr, sizeof(ldt_info))) ++ goto out; ++ ++ error = -EINVAL; ++ if (ldt_info.entry_number >= LDT_ENTRIES) ++ goto out; ++ if (ldt_info.contents == 3) { ++ if (oldmode) ++ goto out; ++ if (ldt_info.seg_not_present == 0) ++ goto out; ++ } ++ ++ mutex_lock(&mm->context.lock); ++ if (ldt_info.entry_number >= mm->context.size) { ++ error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); ++ if (error < 0) ++ goto out_unlock; ++ } ++ ++ /* Allow LDTs to be cleared by the user. */ ++ if (ldt_info.base_addr == 0 && ldt_info.limit == 0) { ++ if (oldmode || LDT_empty(&ldt_info)) { ++ entry_1 = 0; ++ entry_2 = 0; ++ goto install; ++ } ++ } ++ ++ entry_1 = LDT_entry_a(&ldt_info); ++ entry_2 = LDT_entry_b(&ldt_info); ++ if (oldmode) ++ entry_2 &= ~(1 << 20); ++ ++ /* Install the new entry ... */ ++install: ++ error = write_ldt_entry(mm->context.ldt, ldt_info.entry_number, ++ entry_1, entry_2); ++ ++out_unlock: ++ mutex_unlock(&mm->context.lock); ++out: ++ return error; ++} ++ ++asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount) ++{ ++ int ret = -ENOSYS; ++ ++ switch (func) { ++ case 0: ++ ret = read_ldt(ptr, bytecount); ++ break; ++ case 1: ++ ret = write_ldt(ptr, bytecount, 1); ++ break; ++ case 2: ++ ret = read_default_ldt(ptr, bytecount); ++ break; ++ case 0x11: ++ ret = write_ldt(ptr, bytecount, 0); ++ break; ++ } ++ return ret; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/ldt_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/ldt_64-xen.c +--- ./arch/x86/kernel/ldt_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/ldt_64-xen.c 2012-11-13 15:20:17.304569001 +0000 +@@ -0,0 +1,279 @@ ++/* ++ * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds ++ * Copyright (C) 1999 Ingo Molnar ++ * Copyright (C) 2002 Andi Kleen ++ * ++ * This handles calls from both 32bit and 64bit mode. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef CONFIG_SMP /* avoids "defined but not used" warnig */ ++static void flush_ldt(void *null) ++{ ++ if (current->active_mm) ++ load_LDT(¤t->active_mm->context); ++} ++#endif ++ ++static int alloc_ldt(mm_context_t *pc, unsigned mincount, int reload) ++{ ++ void *oldldt; ++ void *newldt; ++ unsigned oldsize; ++ ++ if (mincount <= (unsigned)pc->size) ++ return 0; ++ oldsize = pc->size; ++ mincount = (mincount+511)&(~511); ++ if (mincount*LDT_ENTRY_SIZE > PAGE_SIZE) ++ newldt = vmalloc(mincount*LDT_ENTRY_SIZE); ++ else ++ newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL); ++ ++ if (!newldt) ++ return -ENOMEM; ++ ++ if (oldsize) ++ memcpy(newldt, pc->ldt, oldsize*LDT_ENTRY_SIZE); ++ oldldt = pc->ldt; ++ memset(newldt+oldsize*LDT_ENTRY_SIZE, 0, (mincount-oldsize)*LDT_ENTRY_SIZE); ++ wmb(); ++ pc->ldt = newldt; ++ wmb(); ++ pc->size = mincount; ++ wmb(); ++ if (reload) { ++#ifdef CONFIG_SMP ++ cpumask_t mask; ++ ++ preempt_disable(); ++#endif ++ make_pages_readonly( ++ pc->ldt, ++ (pc->size * LDT_ENTRY_SIZE) / PAGE_SIZE, ++ XENFEAT_writable_descriptor_tables); ++ load_LDT(pc); ++#ifdef CONFIG_SMP ++ mask = cpumask_of_cpu(smp_processor_id()); ++ if (!cpus_equal(current->mm->cpu_vm_mask, mask)) ++ smp_call_function(flush_ldt, NULL, 1, 1); ++ preempt_enable(); ++#endif ++ } ++ if (oldsize) { ++ make_pages_writable( ++ oldldt, ++ (oldsize * LDT_ENTRY_SIZE) / PAGE_SIZE, ++ XENFEAT_writable_descriptor_tables); ++ if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE) ++ vfree(oldldt); ++ else ++ kfree(oldldt); ++ } ++ return 0; ++} ++ ++static inline int copy_ldt(mm_context_t *new, mm_context_t *old) ++{ ++ int err = alloc_ldt(new, old->size, 0); ++ if (err < 0) ++ return err; ++ memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE); ++ make_pages_readonly( ++ new->ldt, ++ (new->size * LDT_ENTRY_SIZE) / PAGE_SIZE, ++ XENFEAT_writable_descriptor_tables); ++ return 0; ++} ++ ++/* ++ * we do not have to muck with descriptors here, that is ++ * done in switch_mm() as needed. ++ */ ++int init_new_context(struct task_struct *tsk, struct mm_struct *mm) ++{ ++ struct mm_struct * old_mm; ++ int retval = 0; ++ ++ memset(&mm->context, 0, sizeof(mm->context)); ++ mutex_init(&mm->context.lock); ++ old_mm = current->mm; ++ if (old_mm && old_mm->context.size > 0) { ++ mutex_lock(&old_mm->context.lock); ++ retval = copy_ldt(&mm->context, &old_mm->context); ++ mutex_unlock(&old_mm->context.lock); ++ } ++ if (retval == 0) { ++ spin_lock(&mm_unpinned_lock); ++ list_add(&mm->context.unpinned, &mm_unpinned); ++ spin_unlock(&mm_unpinned_lock); ++ } ++ return retval; ++} ++ ++/* ++ * ++ * Don't touch the LDT register - we're already in the next thread. ++ */ ++void destroy_context(struct mm_struct *mm) ++{ ++ if (mm->context.size) { ++ if (mm == current->active_mm) ++ clear_LDT(); ++ make_pages_writable( ++ mm->context.ldt, ++ (mm->context.size * LDT_ENTRY_SIZE) / PAGE_SIZE, ++ XENFEAT_writable_descriptor_tables); ++ if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE) ++ vfree(mm->context.ldt); ++ else ++ kfree(mm->context.ldt); ++ mm->context.size = 0; ++ } ++ if (!mm->context.pinned) { ++ spin_lock(&mm_unpinned_lock); ++ list_del(&mm->context.unpinned); ++ spin_unlock(&mm_unpinned_lock); ++ } ++} ++ ++static int read_ldt(void __user * ptr, unsigned long bytecount) ++{ ++ int err; ++ unsigned long size; ++ struct mm_struct * mm = current->mm; ++ ++ if (!mm->context.size) ++ return 0; ++ if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) ++ bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; ++ ++ mutex_lock(&mm->context.lock); ++ size = mm->context.size*LDT_ENTRY_SIZE; ++ if (size > bytecount) ++ size = bytecount; ++ ++ err = 0; ++ if (copy_to_user(ptr, mm->context.ldt, size)) ++ err = -EFAULT; ++ mutex_unlock(&mm->context.lock); ++ if (err < 0) ++ goto error_return; ++ if (size != bytecount) { ++ /* zero-fill the rest */ ++ if (clear_user(ptr+size, bytecount-size) != 0) { ++ err = -EFAULT; ++ goto error_return; ++ } ++ } ++ return bytecount; ++error_return: ++ return err; ++} ++ ++static int read_default_ldt(void __user * ptr, unsigned long bytecount) ++{ ++ /* Arbitrary number */ ++ /* x86-64 default LDT is all zeros */ ++ if (bytecount > 128) ++ bytecount = 128; ++ if (clear_user(ptr, bytecount)) ++ return -EFAULT; ++ return bytecount; ++} ++ ++static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode) ++{ ++ struct task_struct *me = current; ++ struct mm_struct * mm = me->mm; ++ __u32 entry_1, entry_2, *lp; ++ unsigned long mach_lp; ++ int error; ++ struct user_desc ldt_info; ++ ++ error = -EINVAL; ++ ++ if (bytecount != sizeof(ldt_info)) ++ goto out; ++ error = -EFAULT; ++ if (copy_from_user(&ldt_info, ptr, bytecount)) ++ goto out; ++ ++ error = -EINVAL; ++ if (ldt_info.entry_number >= LDT_ENTRIES) ++ goto out; ++ if (ldt_info.contents == 3) { ++ if (oldmode) ++ goto out; ++ if (ldt_info.seg_not_present == 0) ++ goto out; ++ } ++ ++ mutex_lock(&mm->context.lock); ++ if (ldt_info.entry_number >= (unsigned)mm->context.size) { ++ error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); ++ if (error < 0) ++ goto out_unlock; ++ } ++ ++ lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->context.ldt); ++ mach_lp = arbitrary_virt_to_machine(lp); ++ ++ /* Allow LDTs to be cleared by the user. */ ++ if (ldt_info.base_addr == 0 && ldt_info.limit == 0) { ++ if (oldmode || LDT_empty(&ldt_info)) { ++ entry_1 = 0; ++ entry_2 = 0; ++ goto install; ++ } ++ } ++ ++ entry_1 = LDT_entry_a(&ldt_info); ++ entry_2 = LDT_entry_b(&ldt_info); ++ if (oldmode) ++ entry_2 &= ~(1 << 20); ++ ++ /* Install the new entry ... */ ++install: ++ error = HYPERVISOR_update_descriptor(mach_lp, (unsigned long)((entry_1 | (unsigned long) entry_2 << 32))); ++ ++out_unlock: ++ mutex_unlock(&mm->context.lock); ++out: ++ return error; ++} ++ ++asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount) ++{ ++ int ret = -ENOSYS; ++ ++ switch (func) { ++ case 0: ++ ret = read_ldt(ptr, bytecount); ++ break; ++ case 1: ++ ret = write_ldt(ptr, bytecount, 1); ++ break; ++ case 2: ++ ret = read_default_ldt(ptr, bytecount); ++ break; ++ case 0x11: ++ ret = write_ldt(ptr, bytecount, 0); ++ break; ++ } ++ return ret; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/machine_kexec_32.c debian/binary-custom.d/xen/src/arch/x86/kernel/machine_kexec_32.c +--- ./arch/x86/kernel/machine_kexec_32.c 2012-06-12 16:25:11.606312932 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/machine_kexec_32.c 2012-11-13 15:20:17.304569001 +0000 +@@ -21,6 +21,10 @@ + #include + #include + ++#ifdef CONFIG_XEN ++#include ++#endif ++ + #define PAGE_ALIGNED __attribute__ ((__aligned__(PAGE_SIZE))) + static u32 kexec_pgd[1024] PAGE_ALIGNED; + #ifdef CONFIG_X86_PAE +@@ -30,48 +34,40 @@ + static u32 kexec_pte0[1024] PAGE_ALIGNED; + static u32 kexec_pte1[1024] PAGE_ALIGNED; + +-static void set_idt(void *newidt, __u16 limit) +-{ +- struct Xgt_desc_struct curidt; ++#ifdef CONFIG_XEN + +- /* ia32 supports unaliged loads & stores */ +- curidt.size = limit; +- curidt.address = (unsigned long)newidt; ++#define __ma(x) (pfn_to_mfn(__pa((x)) >> PAGE_SHIFT) << PAGE_SHIFT) + +- load_idt(&curidt); +-}; ++#if PAGES_NR > KEXEC_XEN_NO_PAGES ++#error PAGES_NR is greater than KEXEC_XEN_NO_PAGES - Xen support will break ++#endif + ++#if PA_CONTROL_PAGE != 0 ++#error PA_CONTROL_PAGE is non zero - Xen support will break ++#endif + +-static void set_gdt(void *newgdt, __u16 limit) ++void machine_kexec_setup_load_arg(xen_kexec_image_t *xki, struct kimage *image) + { +- struct Xgt_desc_struct curgdt; ++ void *control_page; + +- /* ia32 supports unaligned loads & stores */ +- curgdt.size = limit; +- curgdt.address = (unsigned long)newgdt; ++ memset(xki->page_list, 0, sizeof(xki->page_list)); + +- load_gdt(&curgdt); +-}; ++ control_page = page_address(image->control_code_page); ++ memcpy(control_page, relocate_kernel, PAGE_SIZE); + +-static void load_segments(void) +-{ +-#define __STR(X) #X +-#define STR(X) __STR(X) ++ xki->page_list[PA_CONTROL_PAGE] = __ma(control_page); ++ xki->page_list[PA_PGD] = __ma(kexec_pgd); ++#ifdef CONFIG_X86_PAE ++ xki->page_list[PA_PMD_0] = __ma(kexec_pmd0); ++ xki->page_list[PA_PMD_1] = __ma(kexec_pmd1); ++#endif ++ xki->page_list[PA_PTE_0] = __ma(kexec_pte0); ++ xki->page_list[PA_PTE_1] = __ma(kexec_pte1); + +- __asm__ __volatile__ ( +- "\tljmp $"STR(__KERNEL_CS)",$1f\n" +- "\t1:\n" +- "\tmovl $"STR(__KERNEL_DS)",%%eax\n" +- "\tmovl %%eax,%%ds\n" +- "\tmovl %%eax,%%es\n" +- "\tmovl %%eax,%%fs\n" +- "\tmovl %%eax,%%gs\n" +- "\tmovl %%eax,%%ss\n" +- ::: "eax", "memory"); +-#undef STR +-#undef __STR + } + ++#endif /* CONFIG_XEN */ ++ + /* + * A architecture hook called to validate the + * proposed image and prepare the control pages +@@ -98,6 +94,7 @@ + { + } + ++#ifndef CONFIG_XEN + /* + * Do not allocate memory (or fail in any way) in machine_kexec(). + * We are past the point of no return, committed to rebooting now. +@@ -128,26 +125,10 @@ + page_list[PA_PTE_1] = __pa(kexec_pte1); + page_list[VA_PTE_1] = (unsigned long)kexec_pte1; + +- /* The segment registers are funny things, they have both a +- * visible and an invisible part. Whenever the visible part is +- * set to a specific selector, the invisible part is loaded +- * with from a table in memory. At no other time is the +- * descriptor table in memory accessed. +- * +- * I take advantage of this here by force loading the +- * segments, before I zap the gdt with an invalid value. +- */ +- load_segments(); +- /* The gdt & idt are now invalid. +- * If you want to load them you must set up your own idt & gdt. +- */ +- set_gdt(phys_to_virt(0),0); +- set_idt(phys_to_virt(0),0); +- +- /* now call it */ + relocate_kernel((unsigned long)image->head, (unsigned long)page_list, + image->start, cpu_has_pae); + } ++#endif + + void arch_crash_save_vmcoreinfo(void) + { +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/machine_kexec_64.c debian/binary-custom.d/xen/src/arch/x86/kernel/machine_kexec_64.c +--- ./arch/x86/kernel/machine_kexec_64.c 2012-06-12 16:25:11.606312932 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/machine_kexec_64.c 2012-11-13 15:20:17.304569001 +0000 +@@ -25,6 +25,104 @@ + static u64 kexec_pmd1[512] PAGE_ALIGNED; + static u64 kexec_pte1[512] PAGE_ALIGNED; + ++#ifdef CONFIG_XEN ++ ++/* In the case of Xen, override hypervisor functions to be able to create ++ * a regular identity mapping page table... ++ */ ++ ++#include ++#include ++ ++#define x__pmd(x) ((pmd_t) { (x) } ) ++#define x__pud(x) ((pud_t) { (x) } ) ++#define x__pgd(x) ((pgd_t) { (x) } ) ++ ++#define x_pmd_val(x) ((x).pmd) ++#define x_pud_val(x) ((x).pud) ++#define x_pgd_val(x) ((x).pgd) ++ ++static inline void x_set_pmd(pmd_t *dst, pmd_t val) ++{ ++ x_pmd_val(*dst) = x_pmd_val(val); ++} ++ ++static inline void x_set_pud(pud_t *dst, pud_t val) ++{ ++ x_pud_val(*dst) = phys_to_machine(x_pud_val(val)); ++} ++ ++static inline void x_pud_clear (pud_t *pud) ++{ ++ x_pud_val(*pud) = 0; ++} ++ ++static inline void x_set_pgd(pgd_t *dst, pgd_t val) ++{ ++ x_pgd_val(*dst) = phys_to_machine(x_pgd_val(val)); ++} ++ ++static inline void x_pgd_clear (pgd_t * pgd) ++{ ++ x_pgd_val(*pgd) = 0; ++} ++ ++#define X__PAGE_KERNEL_LARGE_EXEC \ ++ _PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_PSE ++#define X_KERNPG_TABLE _PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY ++ ++#define __ma(x) (pfn_to_mfn(__pa((x)) >> PAGE_SHIFT) << PAGE_SHIFT) ++ ++#if PAGES_NR > KEXEC_XEN_NO_PAGES ++#error PAGES_NR is greater than KEXEC_XEN_NO_PAGES - Xen support will break ++#endif ++ ++#if PA_CONTROL_PAGE != 0 ++#error PA_CONTROL_PAGE is non zero - Xen support will break ++#endif ++ ++void machine_kexec_setup_load_arg(xen_kexec_image_t *xki, struct kimage *image) ++{ ++ void *control_page; ++ void *table_page; ++ ++ memset(xki->page_list, 0, sizeof(xki->page_list)); ++ ++ control_page = page_address(image->control_code_page) + PAGE_SIZE; ++ memcpy(control_page, relocate_kernel, PAGE_SIZE); ++ ++ table_page = page_address(image->control_code_page); ++ ++ xki->page_list[PA_CONTROL_PAGE] = __ma(control_page); ++ xki->page_list[PA_TABLE_PAGE] = __ma(table_page); ++ ++ xki->page_list[PA_PGD] = __ma(kexec_pgd); ++ xki->page_list[PA_PUD_0] = __ma(kexec_pud0); ++ xki->page_list[PA_PUD_1] = __ma(kexec_pud1); ++ xki->page_list[PA_PMD_0] = __ma(kexec_pmd0); ++ xki->page_list[PA_PMD_1] = __ma(kexec_pmd1); ++ xki->page_list[PA_PTE_0] = __ma(kexec_pte0); ++ xki->page_list[PA_PTE_1] = __ma(kexec_pte1); ++} ++ ++#else /* CONFIG_XEN */ ++ ++#define x__pmd(x) __pmd(x) ++#define x__pud(x) __pud(x) ++#define x__pgd(x) __pgd(x) ++ ++#define x_set_pmd(x, y) set_pmd(x, y) ++#define x_set_pud(x, y) set_pud(x, y) ++#define x_set_pgd(x, y) set_pgd(x, y) ++ ++#define x_pud_clear(x) pud_clear(x) ++#define x_pgd_clear(x) pgd_clear(x) ++ ++#define X__PAGE_KERNEL_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC ++#define X_KERNPG_TABLE _KERNPG_TABLE ++ ++#endif /* CONFIG_XEN */ ++ + static void init_level2_page(pmd_t *level2p, unsigned long addr) + { + unsigned long end_addr; +@@ -32,7 +130,7 @@ + addr &= PAGE_MASK; + end_addr = addr + PUD_SIZE; + while (addr < end_addr) { +- set_pmd(level2p++, __pmd(addr | __PAGE_KERNEL_LARGE_EXEC)); ++ x_set_pmd(level2p++, x__pmd(addr | X__PAGE_KERNEL_LARGE_EXEC)); + addr += PMD_SIZE; + } + } +@@ -57,12 +155,12 @@ + } + level2p = (pmd_t *)page_address(page); + init_level2_page(level2p, addr); +- set_pud(level3p++, __pud(__pa(level2p) | _KERNPG_TABLE)); ++ x_set_pud(level3p++, x__pud(__pa(level2p) | X_KERNPG_TABLE)); + addr += PUD_SIZE; + } + /* clear the unused entries */ + while (addr < end_addr) { +- pud_clear(level3p++); ++ x_pud_clear(level3p++); + addr += PUD_SIZE; + } + out: +@@ -93,12 +191,12 @@ + if (result) { + goto out; + } +- set_pgd(level4p++, __pgd(__pa(level3p) | _KERNPG_TABLE)); ++ x_set_pgd(level4p++, x__pgd(__pa(level3p) | X_KERNPG_TABLE)); + addr += PGDIR_SIZE; + } + /* clear the unused entries */ + while (addr < end_addr) { +- pgd_clear(level4p++); ++ x_pgd_clear(level4p++); + addr += PGDIR_SIZE; + } + out: +@@ -109,49 +207,14 @@ + static int init_pgtable(struct kimage *image, unsigned long start_pgtable) + { + pgd_t *level4p; +- level4p = (pgd_t *)__va(start_pgtable); +- return init_level4_page(image, level4p, 0, end_pfn << PAGE_SHIFT); +-} +- +-static void set_idt(void *newidt, u16 limit) +-{ +- struct desc_ptr curidt; ++ unsigned long x_end_pfn = end_pfn; + +- /* x86-64 supports unaliged loads & stores */ +- curidt.size = limit; +- curidt.address = (unsigned long)newidt; ++#ifdef CONFIG_XEN ++ x_end_pfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL); ++#endif + +- __asm__ __volatile__ ( +- "lidtq %0\n" +- : : "m" (curidt) +- ); +-}; +- +- +-static void set_gdt(void *newgdt, u16 limit) +-{ +- struct desc_ptr curgdt; +- +- /* x86-64 supports unaligned loads & stores */ +- curgdt.size = limit; +- curgdt.address = (unsigned long)newgdt; +- +- __asm__ __volatile__ ( +- "lgdtq %0\n" +- : : "m" (curgdt) +- ); +-}; +- +-static void load_segments(void) +-{ +- __asm__ __volatile__ ( +- "\tmovl %0,%%ds\n" +- "\tmovl %0,%%es\n" +- "\tmovl %0,%%ss\n" +- "\tmovl %0,%%fs\n" +- "\tmovl %0,%%gs\n" +- : : "a" (__KERNEL_DS) : "memory" +- ); ++ level4p = (pgd_t *)__va(start_pgtable); ++ return init_level4_page(image, level4p, 0, x_end_pfn << PAGE_SHIFT); + } + + int machine_kexec_prepare(struct kimage *image) +@@ -175,6 +238,7 @@ + return; + } + ++#ifndef CONFIG_XEN + /* + * Do not allocate memory (or fail in any way) in machine_kexec(). + * We are past the point of no return, committed to rebooting now. +@@ -210,30 +274,16 @@ + page_list[PA_TABLE_PAGE] = + (unsigned long)__pa(page_address(image->control_code_page)); + +- /* The segment registers are funny things, they have both a +- * visible and an invisible part. Whenever the visible part is +- * set to a specific selector, the invisible part is loaded +- * with from a table in memory. At no other time is the +- * descriptor table in memory accessed. +- * +- * I take advantage of this here by force loading the +- * segments, before I zap the gdt with an invalid value. +- */ +- load_segments(); +- /* The gdt & idt are now invalid. +- * If you want to load them you must set up your own idt & gdt. +- */ +- set_gdt(phys_to_virt(0),0); +- set_idt(phys_to_virt(0),0); +- +- /* now call it */ + relocate_kernel((unsigned long)image->head, (unsigned long)page_list, + image->start); + } ++#endif + + void arch_crash_save_vmcoreinfo(void) + { ++#ifndef CONFIG_XEN + VMCOREINFO_SYMBOL(phys_base); ++#endif + VMCOREINFO_SYMBOL(init_level4_pgt); + + #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/microcode-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/microcode-xen.c +--- ./arch/x86/kernel/microcode-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/microcode-xen.c 2012-11-13 15:20:17.304569001 +0000 +@@ -0,0 +1,210 @@ ++/* ++ * Intel CPU Microcode Update Driver for Linux ++ * ++ * Copyright (C) 2000-2006 Tigran Aivazian ++ * 2006 Shaohua Li ++ * ++ * This driver allows to upgrade microcode on Intel processors ++ * belonging to IA-32 family - PentiumPro, Pentium II, ++ * Pentium III, Xeon, Pentium 4, etc. ++ * ++ * Reference: Section 8.10 of Volume III, Intel Pentium 4 Manual, ++ * Order Number 245472 or free download from: ++ * ++ * http://developer.intel.com/design/pentium4/manuals/245472.htm ++ * ++ * For more information, go to http://www.urbanmyth.org/microcode ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version ++ * 2 of the License, or (at your option) any later version. ++ */ ++ ++//#define DEBUG /* pr_debug */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++MODULE_DESCRIPTION("Intel CPU (IA-32) Microcode Update Driver"); ++MODULE_AUTHOR("Tigran Aivazian "); ++MODULE_LICENSE("GPL"); ++ ++static int verbose; ++module_param(verbose, int, 0644); ++ ++#define MICROCODE_VERSION "1.14a-xen" ++ ++#define DEFAULT_UCODE_DATASIZE (2000) /* 2000 bytes */ ++#define MC_HEADER_SIZE (sizeof (microcode_header_t)) /* 48 bytes */ ++#define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE) /* 2048 bytes */ ++ ++/* no concurrent ->write()s are allowed on /dev/cpu/microcode */ ++static DEFINE_MUTEX(microcode_mutex); ++ ++#ifdef CONFIG_MICROCODE_OLD_INTERFACE ++static int do_microcode_update (const void __user *ubuf, size_t len) ++{ ++ int err; ++ void *kbuf; ++ ++ kbuf = vmalloc(len); ++ if (!kbuf) ++ return -ENOMEM; ++ ++ if (copy_from_user(kbuf, ubuf, len) == 0) { ++ struct xen_platform_op op; ++ ++ op.cmd = XENPF_microcode_update; ++ set_xen_guest_handle(op.u.microcode.data, kbuf); ++ op.u.microcode.length = len; ++ err = HYPERVISOR_platform_op(&op); ++ } else ++ err = -EFAULT; ++ ++ vfree(kbuf); ++ ++ return err; ++} ++ ++static int microcode_open (struct inode *unused1, struct file *unused2) ++{ ++ return capable(CAP_SYS_RAWIO) ? 0 : -EPERM; ++} ++ ++static ssize_t microcode_write (struct file *file, const char __user *buf, size_t len, loff_t *ppos) ++{ ++ ssize_t ret; ++ ++ if (len < MC_HEADER_SIZE) { ++ printk(KERN_ERR "microcode: not enough data\n"); ++ return -EINVAL; ++ } ++ ++ mutex_lock(µcode_mutex); ++ ++ ret = do_microcode_update(buf, len); ++ if (!ret) ++ ret = (ssize_t)len; ++ ++ mutex_unlock(µcode_mutex); ++ ++ return ret; ++} ++ ++static const struct file_operations microcode_fops = { ++ .owner = THIS_MODULE, ++ .write = microcode_write, ++ .open = microcode_open, ++}; ++ ++static struct miscdevice microcode_dev = { ++ .minor = MICROCODE_MINOR, ++ .name = "microcode", ++ .fops = µcode_fops, ++}; ++ ++static int __init microcode_dev_init (void) ++{ ++ int error; ++ ++ error = misc_register(µcode_dev); ++ if (error) { ++ printk(KERN_ERR ++ "microcode: can't misc_register on minor=%d\n", ++ MICROCODE_MINOR); ++ return error; ++ } ++ ++ return 0; ++} ++ ++static void microcode_dev_exit (void) ++{ ++ misc_deregister(µcode_dev); ++} ++ ++MODULE_ALIAS_MISCDEV(MICROCODE_MINOR); ++#else ++#define microcode_dev_init() 0 ++#define microcode_dev_exit() do { } while(0) ++#endif ++ ++/* fake device for request_firmware */ ++static struct platform_device *microcode_pdev; ++ ++static int request_microcode(void) ++{ ++ char name[30]; ++ const struct cpuinfo_x86 *c = &boot_cpu_data; ++ const struct firmware *firmware; ++ int error; ++ struct xen_platform_op op; ++ ++ sprintf(name,"intel-ucode/%02x-%02x-%02x", ++ c->x86, c->x86_model, c->x86_mask); ++ error = request_firmware(&firmware, name, µcode_pdev->dev); ++ if (error) { ++ pr_debug("ucode data file %s load failed\n", name); ++ return error; ++ } ++ ++ op.cmd = XENPF_microcode_update; ++ set_xen_guest_handle(op.u.microcode.data, (void *)firmware->data); ++ op.u.microcode.length = firmware->size; ++ error = HYPERVISOR_platform_op(&op); ++ ++ release_firmware(firmware); ++ ++ if (error) ++ pr_debug("ucode load failed\n"); ++ ++ return error; ++} ++ ++static int __init microcode_init (void) ++{ ++ int error; ++ ++ error = microcode_dev_init(); ++ if (error) ++ return error; ++ microcode_pdev = platform_device_register_simple("microcode", -1, ++ NULL, 0); ++ if (IS_ERR(microcode_pdev)) { ++ microcode_dev_exit(); ++ return PTR_ERR(microcode_pdev); ++ } ++ ++ request_microcode(); ++ ++ printk(KERN_INFO ++ "IA-32 Microcode Update Driver: v" MICROCODE_VERSION " \n"); ++ return 0; ++} ++ ++static void __exit microcode_exit (void) ++{ ++ microcode_dev_exit(); ++ platform_device_unregister(microcode_pdev); ++} ++ ++module_init(microcode_init) ++module_exit(microcode_exit) +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/mpparse_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/mpparse_32-xen.c +--- ./arch/x86/kernel/mpparse_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/mpparse_32-xen.c 2012-11-13 15:20:17.304569001 +0000 +@@ -0,0 +1,1161 @@ ++/* ++ * Intel Multiprocessor Specification 1.1 and 1.4 ++ * compliant MP-table parsing routines. ++ * ++ * (c) 1995 Alan Cox, Building #3 ++ * (c) 1998, 1999, 2000 Ingo Molnar ++ * ++ * Fixes ++ * Erich Boleyn : MP v1.4 and additional changes. ++ * Alan Cox : Added EBDA scanning ++ * Ingo Molnar : various cleanups and rewrites ++ * Maciej W. Rozycki: Bits for default MP configurations ++ * Paul Diefenbaugh: Added full ACPI support ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++/* Have we found an MP table */ ++int smp_found_config; ++unsigned int __cpuinitdata maxcpus = NR_CPUS; ++ ++/* ++ * Various Linux-internal data structures created from the ++ * MP-table. ++ */ ++int apic_version [MAX_APICS]; ++int mp_bus_id_to_type [MAX_MP_BUSSES]; ++int mp_bus_id_to_node [MAX_MP_BUSSES]; ++int mp_bus_id_to_local [MAX_MP_BUSSES]; ++int quad_local_to_mp_bus_id [NR_CPUS/4][4]; ++int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 }; ++static int mp_current_pci_id; ++ ++/* I/O APIC entries */ ++struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS]; ++ ++/* # of MP IRQ source entries */ ++struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; ++ ++/* MP IRQ source entries */ ++int mp_irq_entries; ++ ++int nr_ioapics; ++ ++int pic_mode; ++#ifndef CONFIG_XEN ++unsigned long mp_lapic_addr; ++#endif ++ ++unsigned int def_to_bigsmp = 0; ++ ++/* Processor that is doing the boot up */ ++unsigned int boot_cpu_physical_apicid = -1U; ++/* Internal processor count */ ++unsigned int __cpuinitdata num_processors; ++ ++/* Bitmask of physically existing CPUs */ ++physid_mask_t phys_cpu_present_map; ++ ++u8 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; ++ ++/* ++ * Intel MP BIOS table parsing routines: ++ */ ++ ++ ++/* ++ * Checksum an MP configuration block. ++ */ ++ ++static int __init mpf_checksum(unsigned char *mp, int len) ++{ ++ int sum = 0; ++ ++ while (len--) ++ sum += *mp++; ++ ++ return sum & 0xFF; ++} ++ ++/* ++ * Have to match translation table entries to main table entries by counter ++ * hence the mpc_record variable .... can't see a less disgusting way of ++ * doing this .... ++ */ ++ ++static int mpc_record; ++static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __cpuinitdata; ++ ++#ifndef CONFIG_XEN ++static void __cpuinit MP_processor_info (struct mpc_config_processor *m) ++{ ++ int ver, apicid; ++ physid_mask_t phys_cpu; ++ ++ if (!(m->mpc_cpuflag & CPU_ENABLED)) ++ return; ++ ++ apicid = mpc_apic_id(m, translation_table[mpc_record]); ++ ++ if (m->mpc_featureflag&(1<<0)) ++ Dprintk(" Floating point unit present.\n"); ++ if (m->mpc_featureflag&(1<<7)) ++ Dprintk(" Machine Exception supported.\n"); ++ if (m->mpc_featureflag&(1<<8)) ++ Dprintk(" 64 bit compare & exchange supported.\n"); ++ if (m->mpc_featureflag&(1<<9)) ++ Dprintk(" Internal APIC present.\n"); ++ if (m->mpc_featureflag&(1<<11)) ++ Dprintk(" SEP present.\n"); ++ if (m->mpc_featureflag&(1<<12)) ++ Dprintk(" MTRR present.\n"); ++ if (m->mpc_featureflag&(1<<13)) ++ Dprintk(" PGE present.\n"); ++ if (m->mpc_featureflag&(1<<14)) ++ Dprintk(" MCA present.\n"); ++ if (m->mpc_featureflag&(1<<15)) ++ Dprintk(" CMOV present.\n"); ++ if (m->mpc_featureflag&(1<<16)) ++ Dprintk(" PAT present.\n"); ++ if (m->mpc_featureflag&(1<<17)) ++ Dprintk(" PSE present.\n"); ++ if (m->mpc_featureflag&(1<<18)) ++ Dprintk(" PSN present.\n"); ++ if (m->mpc_featureflag&(1<<19)) ++ Dprintk(" Cache Line Flush Instruction present.\n"); ++ /* 20 Reserved */ ++ if (m->mpc_featureflag&(1<<21)) ++ Dprintk(" Debug Trace and EMON Store present.\n"); ++ if (m->mpc_featureflag&(1<<22)) ++ Dprintk(" ACPI Thermal Throttle Registers present.\n"); ++ if (m->mpc_featureflag&(1<<23)) ++ Dprintk(" MMX present.\n"); ++ if (m->mpc_featureflag&(1<<24)) ++ Dprintk(" FXSR present.\n"); ++ if (m->mpc_featureflag&(1<<25)) ++ Dprintk(" XMM present.\n"); ++ if (m->mpc_featureflag&(1<<26)) ++ Dprintk(" Willamette New Instructions present.\n"); ++ if (m->mpc_featureflag&(1<<27)) ++ Dprintk(" Self Snoop present.\n"); ++ if (m->mpc_featureflag&(1<<28)) ++ Dprintk(" HT present.\n"); ++ if (m->mpc_featureflag&(1<<29)) ++ Dprintk(" Thermal Monitor present.\n"); ++ /* 30, 31 Reserved */ ++ ++ ++ if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { ++ Dprintk(" Bootup CPU\n"); ++ boot_cpu_physical_apicid = m->mpc_apicid; ++ } ++ ++ ver = m->mpc_apicver; ++ ++ /* ++ * Validate version ++ */ ++ if (ver == 0x0) { ++ printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! " ++ "fixing up to 0x10. (tell your hw vendor)\n", ++ m->mpc_apicid); ++ ver = 0x10; ++ } ++ apic_version[m->mpc_apicid] = ver; ++ ++ phys_cpu = apicid_to_cpu_present(apicid); ++ physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu); ++ ++ if (num_processors >= NR_CPUS) { ++ printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached." ++ " Processor ignored.\n", NR_CPUS); ++ return; ++ } ++ ++ if (num_processors >= maxcpus) { ++ printk(KERN_WARNING "WARNING: maxcpus limit of %i reached." ++ " Processor ignored.\n", maxcpus); ++ return; ++ } ++ ++ cpu_set(num_processors, cpu_possible_map); ++ num_processors++; ++ ++ /* ++ * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y ++ * but we need to work other dependencies like SMP_SUSPEND etc ++ * before this can be done without some confusion. ++ * if (CPU_HOTPLUG_ENABLED || num_processors > 8) ++ * - Ashok Raj ++ */ ++ if (num_processors > 8) { ++ switch (boot_cpu_data.x86_vendor) { ++ case X86_VENDOR_INTEL: ++ if (!APIC_XAPIC(ver)) { ++ def_to_bigsmp = 0; ++ break; ++ } ++ /* If P4 and above fall through */ ++ case X86_VENDOR_AMD: ++ def_to_bigsmp = 1; ++ } ++ } ++ bios_cpu_apicid[num_processors - 1] = m->mpc_apicid; ++} ++#else ++static void __cpuinit MP_processor_info (struct mpc_config_processor *m) ++{ ++ num_processors++; ++} ++#endif /* CONFIG_XEN */ ++ ++static void __init MP_bus_info (struct mpc_config_bus *m) ++{ ++ char str[7]; ++ ++ memcpy(str, m->mpc_bustype, 6); ++ str[6] = 0; ++ ++ mpc_oem_bus_info(m, str, translation_table[mpc_record]); ++ ++#if MAX_MP_BUSSES < 256 ++ if (m->mpc_busid >= MAX_MP_BUSSES) { ++ printk(KERN_WARNING "MP table busid value (%d) for bustype %s " ++ " is too large, max. supported is %d\n", ++ m->mpc_busid, str, MAX_MP_BUSSES - 1); ++ return; ++ } ++#endif ++ ++ if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA)-1) == 0) { ++ mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA; ++ } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA)-1) == 0) { ++ mp_bus_id_to_type[m->mpc_busid] = MP_BUS_EISA; ++ } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI)-1) == 0) { ++ mpc_oem_pci_bus(m, translation_table[mpc_record]); ++ mp_bus_id_to_type[m->mpc_busid] = MP_BUS_PCI; ++ mp_bus_id_to_pci_bus[m->mpc_busid] = mp_current_pci_id; ++ mp_current_pci_id++; ++ } else if (strncmp(str, BUSTYPE_MCA, sizeof(BUSTYPE_MCA)-1) == 0) { ++ mp_bus_id_to_type[m->mpc_busid] = MP_BUS_MCA; ++ } else { ++ printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str); ++ } ++} ++ ++static void __init MP_ioapic_info (struct mpc_config_ioapic *m) ++{ ++ if (!(m->mpc_flags & MPC_APIC_USABLE)) ++ return; ++ ++ printk(KERN_INFO "I/O APIC #%d Version %d at 0x%lX.\n", ++ m->mpc_apicid, m->mpc_apicver, m->mpc_apicaddr); ++ if (nr_ioapics >= MAX_IO_APICS) { ++ printk(KERN_CRIT "Max # of I/O APICs (%d) exceeded (found %d).\n", ++ MAX_IO_APICS, nr_ioapics); ++ panic("Recompile kernel with bigger MAX_IO_APICS!.\n"); ++ } ++ if (!m->mpc_apicaddr) { ++ printk(KERN_ERR "WARNING: bogus zero I/O APIC address" ++ " found in MP table, skipping!\n"); ++ return; ++ } ++ mp_ioapics[nr_ioapics] = *m; ++ nr_ioapics++; ++} ++ ++static void __init MP_intsrc_info (struct mpc_config_intsrc *m) ++{ ++ mp_irqs [mp_irq_entries] = *m; ++ Dprintk("Int: type %d, pol %d, trig %d, bus %d," ++ " IRQ %02x, APIC ID %x, APIC INT %02x\n", ++ m->mpc_irqtype, m->mpc_irqflag & 3, ++ (m->mpc_irqflag >> 2) & 3, m->mpc_srcbus, ++ m->mpc_srcbusirq, m->mpc_dstapic, m->mpc_dstirq); ++ if (++mp_irq_entries == MAX_IRQ_SOURCES) ++ panic("Max # of irq sources exceeded!!\n"); ++} ++ ++static void __init MP_lintsrc_info (struct mpc_config_lintsrc *m) ++{ ++ Dprintk("Lint: type %d, pol %d, trig %d, bus %d," ++ " IRQ %02x, APIC ID %x, APIC LINT %02x\n", ++ m->mpc_irqtype, m->mpc_irqflag & 3, ++ (m->mpc_irqflag >> 2) &3, m->mpc_srcbusid, ++ m->mpc_srcbusirq, m->mpc_destapic, m->mpc_destapiclint); ++} ++ ++#ifdef CONFIG_X86_NUMAQ ++static void __init MP_translation_info (struct mpc_config_translation *m) ++{ ++ printk(KERN_INFO "Translation: record %d, type %d, quad %d, global %d, local %d\n", mpc_record, m->trans_type, m->trans_quad, m->trans_global, m->trans_local); ++ ++ if (mpc_record >= MAX_MPC_ENTRY) ++ printk(KERN_ERR "MAX_MPC_ENTRY exceeded!\n"); ++ else ++ translation_table[mpc_record] = m; /* stash this for later */ ++ if (m->trans_quad < MAX_NUMNODES && !node_online(m->trans_quad)) ++ node_set_online(m->trans_quad); ++} ++ ++/* ++ * Read/parse the MPC oem tables ++ */ ++ ++static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable, \ ++ unsigned short oemsize) ++{ ++ int count = sizeof (*oemtable); /* the header size */ ++ unsigned char *oemptr = ((unsigned char *)oemtable)+count; ++ ++ mpc_record = 0; ++ printk(KERN_INFO "Found an OEM MPC table at %8p - parsing it ... \n", oemtable); ++ if (memcmp(oemtable->oem_signature,MPC_OEM_SIGNATURE,4)) ++ { ++ printk(KERN_WARNING "SMP mpc oemtable: bad signature [%c%c%c%c]!\n", ++ oemtable->oem_signature[0], ++ oemtable->oem_signature[1], ++ oemtable->oem_signature[2], ++ oemtable->oem_signature[3]); ++ return; ++ } ++ if (mpf_checksum((unsigned char *)oemtable,oemtable->oem_length)) ++ { ++ printk(KERN_WARNING "SMP oem mptable: checksum error!\n"); ++ return; ++ } ++ while (count < oemtable->oem_length) { ++ switch (*oemptr) { ++ case MP_TRANSLATION: ++ { ++ struct mpc_config_translation *m= ++ (struct mpc_config_translation *)oemptr; ++ MP_translation_info(m); ++ oemptr += sizeof(*m); ++ count += sizeof(*m); ++ ++mpc_record; ++ break; ++ } ++ default: ++ { ++ printk(KERN_WARNING "Unrecognised OEM table entry type! - %d\n", (int) *oemptr); ++ return; ++ } ++ } ++ } ++} ++ ++static inline void mps_oem_check(struct mp_config_table *mpc, char *oem, ++ char *productid) ++{ ++ if (strncmp(oem, "IBM NUMA", 8)) ++ printk("Warning! May not be a NUMA-Q system!\n"); ++ if (mpc->mpc_oemptr) ++ smp_read_mpc_oem((struct mp_config_oemtable *) mpc->mpc_oemptr, ++ mpc->mpc_oemsize); ++} ++#endif /* CONFIG_X86_NUMAQ */ ++ ++/* ++ * Read/parse the MPC ++ */ ++ ++static int __init smp_read_mpc(struct mp_config_table *mpc) ++{ ++ char str[16]; ++ char oem[10]; ++ int count=sizeof(*mpc); ++ unsigned char *mpt=((unsigned char *)mpc)+count; ++ ++ if (memcmp(mpc->mpc_signature,MPC_SIGNATURE,4)) { ++ printk(KERN_ERR "SMP mptable: bad signature [0x%x]!\n", ++ *(u32 *)mpc->mpc_signature); ++ return 0; ++ } ++ if (mpf_checksum((unsigned char *)mpc,mpc->mpc_length)) { ++ printk(KERN_ERR "SMP mptable: checksum error!\n"); ++ return 0; ++ } ++ if (mpc->mpc_spec!=0x01 && mpc->mpc_spec!=0x04) { ++ printk(KERN_ERR "SMP mptable: bad table version (%d)!!\n", ++ mpc->mpc_spec); ++ return 0; ++ } ++ if (!mpc->mpc_lapic) { ++ printk(KERN_ERR "SMP mptable: null local APIC address!\n"); ++ return 0; ++ } ++ memcpy(oem,mpc->mpc_oem,8); ++ oem[8]=0; ++ printk(KERN_INFO "OEM ID: %s ",oem); ++ ++ memcpy(str,mpc->mpc_productid,12); ++ str[12]=0; ++ printk("Product ID: %s ",str); ++ ++ mps_oem_check(mpc, oem, str); ++ ++#ifndef CONFIG_XEN ++ printk("APIC at: 0x%lX\n",mpc->mpc_lapic); ++ ++ /* ++ * Save the local APIC address (it might be non-default) -- but only ++ * if we're not using ACPI. ++ */ ++ if (!acpi_lapic) ++ mp_lapic_addr = mpc->mpc_lapic; ++#endif ++ ++ /* ++ * Now process the configuration blocks. ++ */ ++ mpc_record = 0; ++ while (count < mpc->mpc_length) { ++ switch(*mpt) { ++ case MP_PROCESSOR: ++ { ++ struct mpc_config_processor *m= ++ (struct mpc_config_processor *)mpt; ++ /* ACPI may have already provided this data */ ++ if (!acpi_lapic) ++ MP_processor_info(m); ++ mpt += sizeof(*m); ++ count += sizeof(*m); ++ break; ++ } ++ case MP_BUS: ++ { ++ struct mpc_config_bus *m= ++ (struct mpc_config_bus *)mpt; ++ MP_bus_info(m); ++ mpt += sizeof(*m); ++ count += sizeof(*m); ++ break; ++ } ++ case MP_IOAPIC: ++ { ++ struct mpc_config_ioapic *m= ++ (struct mpc_config_ioapic *)mpt; ++ MP_ioapic_info(m); ++ mpt+=sizeof(*m); ++ count+=sizeof(*m); ++ break; ++ } ++ case MP_INTSRC: ++ { ++ struct mpc_config_intsrc *m= ++ (struct mpc_config_intsrc *)mpt; ++ ++ MP_intsrc_info(m); ++ mpt+=sizeof(*m); ++ count+=sizeof(*m); ++ break; ++ } ++ case MP_LINTSRC: ++ { ++ struct mpc_config_lintsrc *m= ++ (struct mpc_config_lintsrc *)mpt; ++ MP_lintsrc_info(m); ++ mpt+=sizeof(*m); ++ count+=sizeof(*m); ++ break; ++ } ++ default: ++ { ++ count = mpc->mpc_length; ++ break; ++ } ++ } ++ ++mpc_record; ++ } ++ setup_apic_routing(); ++ if (!num_processors) ++ printk(KERN_ERR "SMP mptable: no processors registered!\n"); ++ return num_processors; ++} ++ ++static int __init ELCR_trigger(unsigned int irq) ++{ ++ unsigned int port; ++ ++ port = 0x4d0 + (irq >> 3); ++ return (inb(port) >> (irq & 7)) & 1; ++} ++ ++static void __init construct_default_ioirq_mptable(int mpc_default_type) ++{ ++ struct mpc_config_intsrc intsrc; ++ int i; ++ int ELCR_fallback = 0; ++ ++ intsrc.mpc_type = MP_INTSRC; ++ intsrc.mpc_irqflag = 0; /* conforming */ ++ intsrc.mpc_srcbus = 0; ++ intsrc.mpc_dstapic = mp_ioapics[0].mpc_apicid; ++ ++ intsrc.mpc_irqtype = mp_INT; ++ ++ /* ++ * If true, we have an ISA/PCI system with no IRQ entries ++ * in the MP table. To prevent the PCI interrupts from being set up ++ * incorrectly, we try to use the ELCR. The sanity check to see if ++ * there is good ELCR data is very simple - IRQ0, 1, 2 and 13 can ++ * never be level sensitive, so we simply see if the ELCR agrees. ++ * If it does, we assume it's valid. ++ */ ++ if (mpc_default_type == 5) { ++ printk(KERN_INFO "ISA/PCI bus type with no IRQ information... falling back to ELCR\n"); ++ ++ if (ELCR_trigger(0) || ELCR_trigger(1) || ELCR_trigger(2) || ELCR_trigger(13)) ++ printk(KERN_WARNING "ELCR contains invalid data... not using ELCR\n"); ++ else { ++ printk(KERN_INFO "Using ELCR to identify PCI interrupts\n"); ++ ELCR_fallback = 1; ++ } ++ } ++ ++ for (i = 0; i < 16; i++) { ++ switch (mpc_default_type) { ++ case 2: ++ if (i == 0 || i == 13) ++ continue; /* IRQ0 & IRQ13 not connected */ ++ /* fall through */ ++ default: ++ if (i == 2) ++ continue; /* IRQ2 is never connected */ ++ } ++ ++ if (ELCR_fallback) { ++ /* ++ * If the ELCR indicates a level-sensitive interrupt, we ++ * copy that information over to the MP table in the ++ * irqflag field (level sensitive, active high polarity). ++ */ ++ if (ELCR_trigger(i)) ++ intsrc.mpc_irqflag = 13; ++ else ++ intsrc.mpc_irqflag = 0; ++ } ++ ++ intsrc.mpc_srcbusirq = i; ++ intsrc.mpc_dstirq = i ? i : 2; /* IRQ0 to INTIN2 */ ++ MP_intsrc_info(&intsrc); ++ } ++ ++ intsrc.mpc_irqtype = mp_ExtINT; ++ intsrc.mpc_srcbusirq = 0; ++ intsrc.mpc_dstirq = 0; /* 8259A to INTIN0 */ ++ MP_intsrc_info(&intsrc); ++} ++ ++static inline void __init construct_default_ISA_mptable(int mpc_default_type) ++{ ++ struct mpc_config_processor processor; ++ struct mpc_config_bus bus; ++ struct mpc_config_ioapic ioapic; ++ struct mpc_config_lintsrc lintsrc; ++ int linttypes[2] = { mp_ExtINT, mp_NMI }; ++ int i; ++ ++#ifndef CONFIG_XEN ++ /* ++ * local APIC has default address ++ */ ++ mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; ++#endif ++ ++ /* ++ * 2 CPUs, numbered 0 & 1. ++ */ ++ processor.mpc_type = MP_PROCESSOR; ++ /* Either an integrated APIC or a discrete 82489DX. */ ++ processor.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01; ++ processor.mpc_cpuflag = CPU_ENABLED; ++ processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | ++ (boot_cpu_data.x86_model << 4) | ++ boot_cpu_data.x86_mask; ++ processor.mpc_featureflag = boot_cpu_data.x86_capability[0]; ++ processor.mpc_reserved[0] = 0; ++ processor.mpc_reserved[1] = 0; ++ for (i = 0; i < 2; i++) { ++ processor.mpc_apicid = i; ++ MP_processor_info(&processor); ++ } ++ ++ bus.mpc_type = MP_BUS; ++ bus.mpc_busid = 0; ++ switch (mpc_default_type) { ++ default: ++ printk("???\n"); ++ printk(KERN_ERR "Unknown standard configuration %d\n", ++ mpc_default_type); ++ /* fall through */ ++ case 1: ++ case 5: ++ memcpy(bus.mpc_bustype, "ISA ", 6); ++ break; ++ case 2: ++ case 6: ++ case 3: ++ memcpy(bus.mpc_bustype, "EISA ", 6); ++ break; ++ case 4: ++ case 7: ++ memcpy(bus.mpc_bustype, "MCA ", 6); ++ } ++ MP_bus_info(&bus); ++ if (mpc_default_type > 4) { ++ bus.mpc_busid = 1; ++ memcpy(bus.mpc_bustype, "PCI ", 6); ++ MP_bus_info(&bus); ++ } ++ ++ ioapic.mpc_type = MP_IOAPIC; ++ ioapic.mpc_apicid = 2; ++ ioapic.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01; ++ ioapic.mpc_flags = MPC_APIC_USABLE; ++ ioapic.mpc_apicaddr = 0xFEC00000; ++ MP_ioapic_info(&ioapic); ++ ++ /* ++ * We set up most of the low 16 IO-APIC pins according to MPS rules. ++ */ ++ construct_default_ioirq_mptable(mpc_default_type); ++ ++ lintsrc.mpc_type = MP_LINTSRC; ++ lintsrc.mpc_irqflag = 0; /* conforming */ ++ lintsrc.mpc_srcbusid = 0; ++ lintsrc.mpc_srcbusirq = 0; ++ lintsrc.mpc_destapic = MP_APIC_ALL; ++ for (i = 0; i < 2; i++) { ++ lintsrc.mpc_irqtype = linttypes[i]; ++ lintsrc.mpc_destapiclint = i; ++ MP_lintsrc_info(&lintsrc); ++ } ++} ++ ++static struct intel_mp_floating *mpf_found; ++ ++/* ++ * Scan the memory blocks for an SMP configuration block. ++ */ ++void __init get_smp_config (void) ++{ ++ struct intel_mp_floating *mpf = mpf_found; ++ ++ /* ++ * ACPI supports both logical (e.g. Hyper-Threading) and physical ++ * processors, where MPS only supports physical. ++ */ ++ if (acpi_lapic && acpi_ioapic) { ++ printk(KERN_INFO "Using ACPI (MADT) for SMP configuration information\n"); ++ return; ++ } ++ else if (acpi_lapic) ++ printk(KERN_INFO "Using ACPI for processor (LAPIC) configuration information\n"); ++ ++ printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification); ++ if (mpf->mpf_feature2 & (1<<7)) { ++ printk(KERN_INFO " IMCR and PIC compatibility mode.\n"); ++ pic_mode = 1; ++ } else { ++ printk(KERN_INFO " Virtual Wire compatibility mode.\n"); ++ pic_mode = 0; ++ } ++ ++ /* ++ * Now see if we need to read further. ++ */ ++ if (mpf->mpf_feature1 != 0) { ++ ++ printk(KERN_INFO "Default MP configuration #%d\n", mpf->mpf_feature1); ++ construct_default_ISA_mptable(mpf->mpf_feature1); ++ ++ } else if (mpf->mpf_physptr) { ++ ++ /* ++ * Read the physical hardware table. Anything here will ++ * override the defaults. ++ */ ++ if (!smp_read_mpc(isa_bus_to_virt(mpf->mpf_physptr))) { ++ smp_found_config = 0; ++ printk(KERN_ERR "BIOS bug, MP table errors detected!...\n"); ++ printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n"); ++ return; ++ } ++ /* ++ * If there are no explicit MP IRQ entries, then we are ++ * broken. We set up most of the low 16 IO-APIC pins to ++ * ISA defaults and hope it will work. ++ */ ++ if (!mp_irq_entries) { ++ struct mpc_config_bus bus; ++ ++ printk(KERN_ERR "BIOS bug, no explicit IRQ entries, using default mptable. (tell your hw vendor)\n"); ++ ++ bus.mpc_type = MP_BUS; ++ bus.mpc_busid = 0; ++ memcpy(bus.mpc_bustype, "ISA ", 6); ++ MP_bus_info(&bus); ++ ++ construct_default_ioirq_mptable(0); ++ } ++ ++ } else ++ BUG(); ++ ++ printk(KERN_INFO "Processors: %d\n", num_processors); ++ /* ++ * Only use the first configuration found. ++ */ ++} ++ ++static int __init smp_scan_config (unsigned long base, unsigned long length) ++{ ++ unsigned long *bp = isa_bus_to_virt(base); ++ struct intel_mp_floating *mpf; ++ ++ Dprintk("Scan SMP from %p for %ld bytes.\n", bp,length); ++ if (sizeof(*mpf) != 16) ++ printk("Error: MPF size\n"); ++ ++ while (length > 0) { ++ mpf = (struct intel_mp_floating *)bp; ++ if ((*bp == SMP_MAGIC_IDENT) && ++ (mpf->mpf_length == 1) && ++ !mpf_checksum((unsigned char *)bp, 16) && ++ ((mpf->mpf_specification == 1) ++ || (mpf->mpf_specification == 4)) ) { ++ ++ smp_found_config = 1; ++#ifndef CONFIG_XEN ++ printk(KERN_INFO "found SMP MP-table at %08lx\n", ++ virt_to_phys(mpf)); ++ reserve_bootmem(virt_to_phys(mpf), PAGE_SIZE); ++ if (mpf->mpf_physptr) { ++ /* ++ * We cannot access to MPC table to compute ++ * table size yet, as only few megabytes from ++ * the bottom is mapped now. ++ * PC-9800's MPC table places on the very last ++ * of physical memory; so that simply reserving ++ * PAGE_SIZE from mpg->mpf_physptr yields BUG() ++ * in reserve_bootmem. ++ */ ++ unsigned long size = PAGE_SIZE; ++ unsigned long end = max_low_pfn * PAGE_SIZE; ++ if (mpf->mpf_physptr + size > end) ++ size = end - mpf->mpf_physptr; ++ reserve_bootmem(mpf->mpf_physptr, size); ++ } ++#else ++ printk(KERN_INFO "found SMP MP-table at %08lx\n", ++ ((unsigned long)bp - (unsigned long)isa_bus_to_virt(base)) + base); ++#endif ++ ++ mpf_found = mpf; ++ return 1; ++ } ++ bp += 4; ++ length -= 16; ++ } ++ return 0; ++} ++ ++void __init find_smp_config (void) ++{ ++#ifndef CONFIG_XEN ++ unsigned int address; ++#endif ++ ++ /* ++ * FIXME: Linux assumes you have 640K of base ram.. ++ * this continues the error... ++ * ++ * 1) Scan the bottom 1K for a signature ++ * 2) Scan the top 1K of base RAM ++ * 3) Scan the 64K of bios ++ */ ++ if (smp_scan_config(0x0,0x400) || ++ smp_scan_config(639*0x400,0x400) || ++ smp_scan_config(0xF0000,0x10000)) ++ return; ++ /* ++ * If it is an SMP machine we should know now, unless the ++ * configuration is in an EISA/MCA bus machine with an ++ * extended bios data area. ++ * ++ * there is a real-mode segmented pointer pointing to the ++ * 4K EBDA area at 0x40E, calculate and scan it here. ++ * ++ * NOTE! There are Linux loaders that will corrupt the EBDA ++ * area, and as such this kind of SMP config may be less ++ * trustworthy, simply because the SMP table may have been ++ * stomped on during early boot. These loaders are buggy and ++ * should be fixed. ++ * ++ * MP1.4 SPEC states to only scan first 1K of 4K EBDA. ++ */ ++ ++#ifndef CONFIG_XEN ++ address = get_bios_ebda(); ++ if (address) ++ smp_scan_config(address, 0x400); ++#endif ++} ++ ++int es7000_plat; ++ ++/* -------------------------------------------------------------------------- ++ ACPI-based MP Configuration ++ -------------------------------------------------------------------------- */ ++ ++#ifdef CONFIG_ACPI ++ ++#ifndef CONFIG_XEN ++void __init mp_register_lapic_address(u64 address) ++{ ++ mp_lapic_addr = (unsigned long) address; ++ ++ set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr); ++ ++ if (boot_cpu_physical_apicid == -1U) ++ boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); ++ ++ Dprintk("Boot CPU = %d\n", boot_cpu_physical_apicid); ++} ++#endif ++ ++void __cpuinit mp_register_lapic (u8 id, u8 enabled) ++{ ++ struct mpc_config_processor processor; ++ int boot_cpu = 0; ++ ++ if (MAX_APICS - id <= 0) { ++ printk(KERN_WARNING "Processor #%d invalid (max %d)\n", ++ id, MAX_APICS); ++ return; ++ } ++ ++ if (id == boot_cpu_physical_apicid) ++ boot_cpu = 1; ++ ++#ifndef CONFIG_XEN ++ processor.mpc_type = MP_PROCESSOR; ++ processor.mpc_apicid = id; ++ processor.mpc_apicver = GET_APIC_VERSION(apic_read(APIC_LVR)); ++ processor.mpc_cpuflag = (enabled ? CPU_ENABLED : 0); ++ processor.mpc_cpuflag |= (boot_cpu ? CPU_BOOTPROCESSOR : 0); ++ processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | ++ (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask; ++ processor.mpc_featureflag = boot_cpu_data.x86_capability[0]; ++ processor.mpc_reserved[0] = 0; ++ processor.mpc_reserved[1] = 0; ++#endif ++ ++ MP_processor_info(&processor); ++} ++ ++#ifdef CONFIG_X86_IO_APIC ++ ++#define MP_ISA_BUS 0 ++#define MP_MAX_IOAPIC_PIN 127 ++ ++static struct mp_ioapic_routing { ++ int apic_id; ++ int gsi_base; ++ int gsi_end; ++ u32 pin_programmed[4]; ++} mp_ioapic_routing[MAX_IO_APICS]; ++ ++static int mp_find_ioapic (int gsi) ++{ ++ int i = 0; ++ ++ /* Find the IOAPIC that manages this GSI. */ ++ for (i = 0; i < nr_ioapics; i++) { ++ if ((gsi >= mp_ioapic_routing[i].gsi_base) ++ && (gsi <= mp_ioapic_routing[i].gsi_end)) ++ return i; ++ } ++ ++ printk(KERN_ERR "ERROR: Unable to locate IOAPIC for GSI %d\n", gsi); ++ ++ return -1; ++} ++ ++void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base) ++{ ++ int idx = 0; ++ int tmpid; ++ ++ if (nr_ioapics >= MAX_IO_APICS) { ++ printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded " ++ "(found %d)\n", MAX_IO_APICS, nr_ioapics); ++ panic("Recompile kernel with bigger MAX_IO_APICS!\n"); ++ } ++ if (!address) { ++ printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address" ++ " found in MADT table, skipping!\n"); ++ return; ++ } ++ ++ idx = nr_ioapics++; ++ ++ mp_ioapics[idx].mpc_type = MP_IOAPIC; ++ mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE; ++ mp_ioapics[idx].mpc_apicaddr = address; ++ ++#ifndef CONFIG_XEN ++ set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); ++ if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) ++ && !APIC_XAPIC(apic_version[boot_cpu_physical_apicid])) ++ tmpid = io_apic_get_unique_id(idx, id); ++ else ++#endif ++ tmpid = id; ++ if (tmpid == -1) { ++ nr_ioapics--; ++ return; ++ } ++ mp_ioapics[idx].mpc_apicid = tmpid; ++ mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx); ++ ++ /* ++ * Build basic GSI lookup table to facilitate gsi->io_apic lookups ++ * and to prevent reprogramming of IOAPIC pins (PCI GSIs). ++ */ ++ mp_ioapic_routing[idx].apic_id = mp_ioapics[idx].mpc_apicid; ++ mp_ioapic_routing[idx].gsi_base = gsi_base; ++ mp_ioapic_routing[idx].gsi_end = gsi_base + ++ io_apic_get_redir_entries(idx); ++ ++ printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%lx, " ++ "GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, ++ mp_ioapics[idx].mpc_apicver, mp_ioapics[idx].mpc_apicaddr, ++ mp_ioapic_routing[idx].gsi_base, ++ mp_ioapic_routing[idx].gsi_end); ++} ++ ++void __init ++mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) ++{ ++ struct mpc_config_intsrc intsrc; ++ int ioapic = -1; ++ int pin = -1; ++ ++ /* ++ * Convert 'gsi' to 'ioapic.pin'. ++ */ ++ ioapic = mp_find_ioapic(gsi); ++ if (ioapic < 0) ++ return; ++ pin = gsi - mp_ioapic_routing[ioapic].gsi_base; ++ ++ /* ++ * TBD: This check is for faulty timer entries, where the override ++ * erroneously sets the trigger to level, resulting in a HUGE ++ * increase of timer interrupts! ++ */ ++ if ((bus_irq == 0) && (trigger == 3)) ++ trigger = 1; ++ ++ intsrc.mpc_type = MP_INTSRC; ++ intsrc.mpc_irqtype = mp_INT; ++ intsrc.mpc_irqflag = (trigger << 2) | polarity; ++ intsrc.mpc_srcbus = MP_ISA_BUS; ++ intsrc.mpc_srcbusirq = bus_irq; /* IRQ */ ++ intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; /* APIC ID */ ++ intsrc.mpc_dstirq = pin; /* INTIN# */ ++ ++ Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, %d-%d\n", ++ intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3, ++ (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, ++ intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq); ++ ++ mp_irqs[mp_irq_entries] = intsrc; ++ if (++mp_irq_entries == MAX_IRQ_SOURCES) ++ panic("Max # of irq sources exceeded!\n"); ++} ++ ++void __init mp_config_acpi_legacy_irqs (void) ++{ ++ struct mpc_config_intsrc intsrc; ++ int i = 0; ++ int ioapic = -1; ++ ++ /* ++ * Fabricate the legacy ISA bus (bus #31). ++ */ ++ mp_bus_id_to_type[MP_ISA_BUS] = MP_BUS_ISA; ++ Dprintk("Bus #%d is ISA\n", MP_ISA_BUS); ++ ++ /* ++ * Older generations of ES7000 have no legacy identity mappings ++ */ ++ if (es7000_plat == 1) ++ return; ++ ++ /* ++ * Locate the IOAPIC that manages the ISA IRQs (0-15). ++ */ ++ ioapic = mp_find_ioapic(0); ++ if (ioapic < 0) ++ return; ++ ++ intsrc.mpc_type = MP_INTSRC; ++ intsrc.mpc_irqflag = 0; /* Conforming */ ++ intsrc.mpc_srcbus = MP_ISA_BUS; ++ intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; ++ ++ /* ++ * Use the default configuration for the IRQs 0-15. Unless ++ * overridden by (MADT) interrupt source override entries. ++ */ ++ for (i = 0; i < 16; i++) { ++ int idx; ++ ++ for (idx = 0; idx < mp_irq_entries; idx++) { ++ struct mpc_config_intsrc *irq = mp_irqs + idx; ++ ++ /* Do we already have a mapping for this ISA IRQ? */ ++ if (irq->mpc_srcbus == MP_ISA_BUS && irq->mpc_srcbusirq == i) ++ break; ++ ++ /* Do we already have a mapping for this IOAPIC pin */ ++ if ((irq->mpc_dstapic == intsrc.mpc_dstapic) && ++ (irq->mpc_dstirq == i)) ++ break; ++ } ++ ++ if (idx != mp_irq_entries) { ++ printk(KERN_DEBUG "ACPI: IRQ%d used by override.\n", i); ++ continue; /* IRQ already used */ ++ } ++ ++ intsrc.mpc_irqtype = mp_INT; ++ intsrc.mpc_srcbusirq = i; /* Identity mapped */ ++ intsrc.mpc_dstirq = i; ++ ++ Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, " ++ "%d-%d\n", intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3, ++ (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, ++ intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, ++ intsrc.mpc_dstirq); ++ ++ mp_irqs[mp_irq_entries] = intsrc; ++ if (++mp_irq_entries == MAX_IRQ_SOURCES) ++ panic("Max # of irq sources exceeded!\n"); ++ } ++} ++ ++#define MAX_GSI_NUM 4096 ++ ++int mp_register_gsi(u32 gsi, int triggering, int polarity) ++{ ++ int ioapic = -1; ++ int ioapic_pin = 0; ++ int idx, bit = 0; ++ static int pci_irq = 16; ++ /* ++ * Mapping between Global System Interrups, which ++ * represent all possible interrupts, and IRQs ++ * assigned to actual devices. ++ */ ++ static int gsi_to_irq[MAX_GSI_NUM]; ++ ++ /* Don't set up the ACPI SCI because it's already set up */ ++ if (acpi_gbl_FADT.sci_interrupt == gsi) ++ return gsi; ++ ++ ioapic = mp_find_ioapic(gsi); ++ if (ioapic < 0) { ++ printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi); ++ return gsi; ++ } ++ ++ ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_base; ++ ++#ifndef CONFIG_XEN ++ if (ioapic_renumber_irq) ++ gsi = ioapic_renumber_irq(ioapic, gsi); ++#endif ++ ++ /* ++ * Avoid pin reprogramming. PRTs typically include entries ++ * with redundant pin->gsi mappings (but unique PCI devices); ++ * we only program the IOAPIC on the first. ++ */ ++ bit = ioapic_pin % 32; ++ idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32); ++ if (idx > 3) { ++ printk(KERN_ERR "Invalid reference to IOAPIC pin " ++ "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, ++ ioapic_pin); ++ return gsi; ++ } ++ if ((1< 15), but ++ * avoid a problem where the 8254 timer (IRQ0) is setup ++ * via an override (so it's not on pin 0 of the ioapic), ++ * and at the same time, the pin 0 interrupt is a PCI ++ * type. The gsi > 15 test could cause these two pins ++ * to be shared as IRQ0, and they are not shareable. ++ * So test for this condition, and if necessary, avoid ++ * the pin collision. ++ */ ++ if (gsi > 15 || (gsi == 0 && !timer_uses_ioapic_pin_0)) ++ gsi = pci_irq++; ++ /* ++ * Don't assign IRQ used by ACPI SCI ++ */ ++ if (gsi == acpi_gbl_FADT.sci_interrupt) ++ gsi = pci_irq++; ++ gsi_to_irq[irq] = gsi; ++ } else { ++ printk(KERN_ERR "GSI %u is too high\n", gsi); ++ return gsi; ++ } ++ } ++ ++ io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, ++ triggering == ACPI_EDGE_SENSITIVE ? 0 : 1, ++ polarity == ACPI_ACTIVE_HIGH ? 0 : 1); ++ return gsi; ++} ++ ++#endif /* CONFIG_X86_IO_APIC */ ++#endif /* CONFIG_ACPI */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/mpparse_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/mpparse_64-xen.c +--- ./arch/x86/kernel/mpparse_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/mpparse_64-xen.c 2012-11-13 15:20:17.308568999 +0000 +@@ -0,0 +1,880 @@ ++/* ++ * Intel Multiprocessor Specification 1.1 and 1.4 ++ * compliant MP-table parsing routines. ++ * ++ * (c) 1995 Alan Cox, Building #3 ++ * (c) 1998, 1999, 2000 Ingo Molnar ++ * ++ * Fixes ++ * Erich Boleyn : MP v1.4 and additional changes. ++ * Alan Cox : Added EBDA scanning ++ * Ingo Molnar : various cleanups and rewrites ++ * Maciej W. Rozycki: Bits for default MP configurations ++ * Paul Diefenbaugh: Added full ACPI support ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Have we found an MP table */ ++int smp_found_config; ++ ++/* ++ * Various Linux-internal data structures created from the ++ * MP-table. ++ */ ++DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES); ++int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 }; ++ ++static int mp_current_pci_id = 0; ++/* I/O APIC entries */ ++struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS]; ++ ++/* # of MP IRQ source entries */ ++struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; ++ ++/* MP IRQ source entries */ ++int mp_irq_entries; ++ ++int nr_ioapics; ++#ifndef CONFIG_XEN ++unsigned long mp_lapic_addr = 0; ++#endif ++ ++ ++/* Processor that is doing the boot up */ ++unsigned int boot_cpu_id = -1U; ++EXPORT_SYMBOL(boot_cpu_id); ++ ++/* Internal processor count */ ++unsigned int num_processors __cpuinitdata = 0; ++ ++unsigned disabled_cpus __cpuinitdata; ++ ++/* Bitmask of physically existing CPUs */ ++physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE; ++ ++u8 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; ++ ++ ++/* ++ * Intel MP BIOS table parsing routines: ++ */ ++ ++/* ++ * Checksum an MP configuration block. ++ */ ++ ++static int __init mpf_checksum(unsigned char *mp, int len) ++{ ++ int sum = 0; ++ ++ while (len--) ++ sum += *mp++; ++ ++ return sum & 0xFF; ++} ++ ++#ifndef CONFIG_XEN ++static void __cpuinit MP_processor_info(struct mpc_config_processor *m) ++{ ++ int cpu; ++ cpumask_t tmp_map; ++ char *bootup_cpu = ""; ++ ++ if (!(m->mpc_cpuflag & CPU_ENABLED)) { ++ disabled_cpus++; ++ return; ++ } ++ if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { ++ bootup_cpu = " (Bootup-CPU)"; ++ boot_cpu_id = m->mpc_apicid; ++ } ++ ++ printk(KERN_INFO "Processor #%d%s\n", m->mpc_apicid, bootup_cpu); ++ ++ if (num_processors >= NR_CPUS) { ++ printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached." ++ " Processor ignored.\n", NR_CPUS); ++ return; ++ } ++ ++ num_processors++; ++ cpus_complement(tmp_map, cpu_present_map); ++ cpu = first_cpu(tmp_map); ++ ++ physid_set(m->mpc_apicid, phys_cpu_present_map); ++ if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { ++ /* ++ * bios_cpu_apicid is required to have processors listed ++ * in same order as logical cpu numbers. Hence the first ++ * entry is BSP, and so on. ++ */ ++ cpu = 0; ++ } ++ bios_cpu_apicid[cpu] = m->mpc_apicid; ++ /* ++ * We get called early in the the start_kernel initialization ++ * process when the per_cpu data area is not yet setup, so we ++ * use a static array that is removed after the per_cpu data ++ * area is created. ++ */ ++ if (x86_cpu_to_apicid_ptr) { ++ u8 *x86_cpu_to_apicid = (u8 *)x86_cpu_to_apicid_ptr; ++ x86_cpu_to_apicid[cpu] = m->mpc_apicid; ++ } else { ++ per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid; ++ } ++ ++ cpu_set(cpu, cpu_possible_map); ++ cpu_set(cpu, cpu_present_map); ++} ++#else ++static void __cpuinit MP_processor_info(struct mpc_config_processor *m) ++{ ++ num_processors++; ++} ++#endif /* CONFIG_XEN */ ++ ++static void __init MP_bus_info (struct mpc_config_bus *m) ++{ ++ char str[7]; ++ ++ memcpy(str, m->mpc_bustype, 6); ++ str[6] = 0; ++ Dprintk("Bus #%d is %s\n", m->mpc_busid, str); ++ ++ if (strncmp(str, "ISA", 3) == 0) { ++ set_bit(m->mpc_busid, mp_bus_not_pci); ++ } else if (strncmp(str, "PCI", 3) == 0) { ++ clear_bit(m->mpc_busid, mp_bus_not_pci); ++ mp_bus_id_to_pci_bus[m->mpc_busid] = mp_current_pci_id; ++ mp_current_pci_id++; ++ } else { ++ printk(KERN_ERR "Unknown bustype %s\n", str); ++ } ++} ++ ++static int bad_ioapic(unsigned long address) ++{ ++ if (nr_ioapics >= MAX_IO_APICS) { ++ printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded " ++ "(found %d)\n", MAX_IO_APICS, nr_ioapics); ++ panic("Recompile kernel with bigger MAX_IO_APICS!\n"); ++ } ++ if (!address) { ++ printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address" ++ " found in table, skipping!\n"); ++ return 1; ++ } ++ return 0; ++} ++ ++static void __init MP_ioapic_info (struct mpc_config_ioapic *m) ++{ ++ if (!(m->mpc_flags & MPC_APIC_USABLE)) ++ return; ++ ++ printk("I/O APIC #%d at 0x%X.\n", ++ m->mpc_apicid, m->mpc_apicaddr); ++ ++ if (bad_ioapic(m->mpc_apicaddr)) ++ return; ++ ++ mp_ioapics[nr_ioapics] = *m; ++ nr_ioapics++; ++} ++ ++static void __init MP_intsrc_info (struct mpc_config_intsrc *m) ++{ ++ mp_irqs [mp_irq_entries] = *m; ++ Dprintk("Int: type %d, pol %d, trig %d, bus %d," ++ " IRQ %02x, APIC ID %x, APIC INT %02x\n", ++ m->mpc_irqtype, m->mpc_irqflag & 3, ++ (m->mpc_irqflag >> 2) & 3, m->mpc_srcbus, ++ m->mpc_srcbusirq, m->mpc_dstapic, m->mpc_dstirq); ++ if (++mp_irq_entries >= MAX_IRQ_SOURCES) ++ panic("Max # of irq sources exceeded!!\n"); ++} ++ ++static void __init MP_lintsrc_info (struct mpc_config_lintsrc *m) ++{ ++ Dprintk("Lint: type %d, pol %d, trig %d, bus %d," ++ " IRQ %02x, APIC ID %x, APIC LINT %02x\n", ++ m->mpc_irqtype, m->mpc_irqflag & 3, ++ (m->mpc_irqflag >> 2) &3, m->mpc_srcbusid, ++ m->mpc_srcbusirq, m->mpc_destapic, m->mpc_destapiclint); ++} ++ ++/* ++ * Read/parse the MPC ++ */ ++ ++static int __init smp_read_mpc(struct mp_config_table *mpc) ++{ ++ char str[16]; ++ int count=sizeof(*mpc); ++ unsigned char *mpt=((unsigned char *)mpc)+count; ++ ++ if (memcmp(mpc->mpc_signature,MPC_SIGNATURE,4)) { ++ printk("MPTABLE: bad signature [%c%c%c%c]!\n", ++ mpc->mpc_signature[0], ++ mpc->mpc_signature[1], ++ mpc->mpc_signature[2], ++ mpc->mpc_signature[3]); ++ return 0; ++ } ++ if (mpf_checksum((unsigned char *)mpc,mpc->mpc_length)) { ++ printk("MPTABLE: checksum error!\n"); ++ return 0; ++ } ++ if (mpc->mpc_spec!=0x01 && mpc->mpc_spec!=0x04) { ++ printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n", ++ mpc->mpc_spec); ++ return 0; ++ } ++ if (!mpc->mpc_lapic) { ++ printk(KERN_ERR "MPTABLE: null local APIC address!\n"); ++ return 0; ++ } ++ memcpy(str,mpc->mpc_oem,8); ++ str[8] = 0; ++ printk(KERN_INFO "MPTABLE: OEM ID: %s ",str); ++ ++ memcpy(str,mpc->mpc_productid,12); ++ str[12] = 0; ++ printk("MPTABLE: Product ID: %s ",str); ++ ++#ifndef CONFIG_XEN ++ printk("MPTABLE: APIC at: 0x%X\n",mpc->mpc_lapic); ++ ++ /* save the local APIC address, it might be non-default */ ++ if (!acpi_lapic) ++ mp_lapic_addr = mpc->mpc_lapic; ++#endif ++ ++ /* ++ * Now process the configuration blocks. ++ */ ++ while (count < mpc->mpc_length) { ++ switch(*mpt) { ++ case MP_PROCESSOR: ++ { ++ struct mpc_config_processor *m= ++ (struct mpc_config_processor *)mpt; ++ if (!acpi_lapic) ++ MP_processor_info(m); ++ mpt += sizeof(*m); ++ count += sizeof(*m); ++ break; ++ } ++ case MP_BUS: ++ { ++ struct mpc_config_bus *m= ++ (struct mpc_config_bus *)mpt; ++ MP_bus_info(m); ++ mpt += sizeof(*m); ++ count += sizeof(*m); ++ break; ++ } ++ case MP_IOAPIC: ++ { ++ struct mpc_config_ioapic *m= ++ (struct mpc_config_ioapic *)mpt; ++ MP_ioapic_info(m); ++ mpt += sizeof(*m); ++ count += sizeof(*m); ++ break; ++ } ++ case MP_INTSRC: ++ { ++ struct mpc_config_intsrc *m= ++ (struct mpc_config_intsrc *)mpt; ++ ++ MP_intsrc_info(m); ++ mpt += sizeof(*m); ++ count += sizeof(*m); ++ break; ++ } ++ case MP_LINTSRC: ++ { ++ struct mpc_config_lintsrc *m= ++ (struct mpc_config_lintsrc *)mpt; ++ MP_lintsrc_info(m); ++ mpt += sizeof(*m); ++ count += sizeof(*m); ++ break; ++ } ++ } ++ } ++ setup_apic_routing(); ++ if (!num_processors) ++ printk(KERN_ERR "MPTABLE: no processors registered!\n"); ++ return num_processors; ++} ++ ++static int __init ELCR_trigger(unsigned int irq) ++{ ++ unsigned int port; ++ ++ port = 0x4d0 + (irq >> 3); ++ return (inb(port) >> (irq & 7)) & 1; ++} ++ ++static void __init construct_default_ioirq_mptable(int mpc_default_type) ++{ ++ struct mpc_config_intsrc intsrc; ++ int i; ++ int ELCR_fallback = 0; ++ ++ intsrc.mpc_type = MP_INTSRC; ++ intsrc.mpc_irqflag = 0; /* conforming */ ++ intsrc.mpc_srcbus = 0; ++ intsrc.mpc_dstapic = mp_ioapics[0].mpc_apicid; ++ ++ intsrc.mpc_irqtype = mp_INT; ++ ++ /* ++ * If true, we have an ISA/PCI system with no IRQ entries ++ * in the MP table. To prevent the PCI interrupts from being set up ++ * incorrectly, we try to use the ELCR. The sanity check to see if ++ * there is good ELCR data is very simple - IRQ0, 1, 2 and 13 can ++ * never be level sensitive, so we simply see if the ELCR agrees. ++ * If it does, we assume it's valid. ++ */ ++ if (mpc_default_type == 5) { ++ printk(KERN_INFO "ISA/PCI bus type with no IRQ information... falling back to ELCR\n"); ++ ++ if (ELCR_trigger(0) || ELCR_trigger(1) || ELCR_trigger(2) || ELCR_trigger(13)) ++ printk(KERN_ERR "ELCR contains invalid data... not using ELCR\n"); ++ else { ++ printk(KERN_INFO "Using ELCR to identify PCI interrupts\n"); ++ ELCR_fallback = 1; ++ } ++ } ++ ++ for (i = 0; i < 16; i++) { ++ switch (mpc_default_type) { ++ case 2: ++ if (i == 0 || i == 13) ++ continue; /* IRQ0 & IRQ13 not connected */ ++ /* fall through */ ++ default: ++ if (i == 2) ++ continue; /* IRQ2 is never connected */ ++ } ++ ++ if (ELCR_fallback) { ++ /* ++ * If the ELCR indicates a level-sensitive interrupt, we ++ * copy that information over to the MP table in the ++ * irqflag field (level sensitive, active high polarity). ++ */ ++ if (ELCR_trigger(i)) ++ intsrc.mpc_irqflag = 13; ++ else ++ intsrc.mpc_irqflag = 0; ++ } ++ ++ intsrc.mpc_srcbusirq = i; ++ intsrc.mpc_dstirq = i ? i : 2; /* IRQ0 to INTIN2 */ ++ MP_intsrc_info(&intsrc); ++ } ++ ++ intsrc.mpc_irqtype = mp_ExtINT; ++ intsrc.mpc_srcbusirq = 0; ++ intsrc.mpc_dstirq = 0; /* 8259A to INTIN0 */ ++ MP_intsrc_info(&intsrc); ++} ++ ++static inline void __init construct_default_ISA_mptable(int mpc_default_type) ++{ ++ struct mpc_config_processor processor; ++ struct mpc_config_bus bus; ++ struct mpc_config_ioapic ioapic; ++ struct mpc_config_lintsrc lintsrc; ++ int linttypes[2] = { mp_ExtINT, mp_NMI }; ++ int i; ++ ++#ifndef CONFIG_XEN ++ /* ++ * local APIC has default address ++ */ ++ mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; ++#endif ++ ++ /* ++ * 2 CPUs, numbered 0 & 1. ++ */ ++ processor.mpc_type = MP_PROCESSOR; ++ processor.mpc_apicver = 0; ++ processor.mpc_cpuflag = CPU_ENABLED; ++ processor.mpc_cpufeature = 0; ++ processor.mpc_featureflag = 0; ++ processor.mpc_reserved[0] = 0; ++ processor.mpc_reserved[1] = 0; ++ for (i = 0; i < 2; i++) { ++ processor.mpc_apicid = i; ++ MP_processor_info(&processor); ++ } ++ ++ bus.mpc_type = MP_BUS; ++ bus.mpc_busid = 0; ++ switch (mpc_default_type) { ++ default: ++ printk(KERN_ERR "???\nUnknown standard configuration %d\n", ++ mpc_default_type); ++ /* fall through */ ++ case 1: ++ case 5: ++ memcpy(bus.mpc_bustype, "ISA ", 6); ++ break; ++ } ++ MP_bus_info(&bus); ++ if (mpc_default_type > 4) { ++ bus.mpc_busid = 1; ++ memcpy(bus.mpc_bustype, "PCI ", 6); ++ MP_bus_info(&bus); ++ } ++ ++ ioapic.mpc_type = MP_IOAPIC; ++ ioapic.mpc_apicid = 2; ++ ioapic.mpc_apicver = 0; ++ ioapic.mpc_flags = MPC_APIC_USABLE; ++ ioapic.mpc_apicaddr = 0xFEC00000; ++ MP_ioapic_info(&ioapic); ++ ++ /* ++ * We set up most of the low 16 IO-APIC pins according to MPS rules. ++ */ ++ construct_default_ioirq_mptable(mpc_default_type); ++ ++ lintsrc.mpc_type = MP_LINTSRC; ++ lintsrc.mpc_irqflag = 0; /* conforming */ ++ lintsrc.mpc_srcbusid = 0; ++ lintsrc.mpc_srcbusirq = 0; ++ lintsrc.mpc_destapic = MP_APIC_ALL; ++ for (i = 0; i < 2; i++) { ++ lintsrc.mpc_irqtype = linttypes[i]; ++ lintsrc.mpc_destapiclint = i; ++ MP_lintsrc_info(&lintsrc); ++ } ++} ++ ++static struct intel_mp_floating *mpf_found; ++ ++/* ++ * Scan the memory blocks for an SMP configuration block. ++ */ ++void __init get_smp_config (void) ++{ ++ struct intel_mp_floating *mpf = mpf_found; ++ ++ /* ++ * ACPI supports both logical (e.g. Hyper-Threading) and physical ++ * processors, where MPS only supports physical. ++ */ ++ if (acpi_lapic && acpi_ioapic) { ++ printk(KERN_INFO "Using ACPI (MADT) for SMP configuration information\n"); ++ return; ++ } ++ else if (acpi_lapic) ++ printk(KERN_INFO "Using ACPI for processor (LAPIC) configuration information\n"); ++ ++ printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification); ++ ++ /* ++ * Now see if we need to read further. ++ */ ++ if (mpf->mpf_feature1 != 0) { ++ ++ printk(KERN_INFO "Default MP configuration #%d\n", mpf->mpf_feature1); ++ construct_default_ISA_mptable(mpf->mpf_feature1); ++ ++ } else if (mpf->mpf_physptr) { ++ ++ /* ++ * Read the physical hardware table. Anything here will ++ * override the defaults. ++ */ ++ if (!smp_read_mpc(isa_bus_to_virt(mpf->mpf_physptr))) { ++ smp_found_config = 0; ++ printk(KERN_ERR "BIOS bug, MP table errors detected!...\n"); ++ printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n"); ++ return; ++ } ++ /* ++ * If there are no explicit MP IRQ entries, then we are ++ * broken. We set up most of the low 16 IO-APIC pins to ++ * ISA defaults and hope it will work. ++ */ ++ if (!mp_irq_entries) { ++ struct mpc_config_bus bus; ++ ++ printk(KERN_ERR "BIOS bug, no explicit IRQ entries, using default mptable. (tell your hw vendor)\n"); ++ ++ bus.mpc_type = MP_BUS; ++ bus.mpc_busid = 0; ++ memcpy(bus.mpc_bustype, "ISA ", 6); ++ MP_bus_info(&bus); ++ ++ construct_default_ioirq_mptable(0); ++ } ++ ++ } else ++ BUG(); ++ ++ printk(KERN_INFO "Processors: %d\n", num_processors); ++ /* ++ * Only use the first configuration found. ++ */ ++} ++ ++static int __init smp_scan_config (unsigned long base, unsigned long length) ++{ ++ extern void __bad_mpf_size(void); ++ unsigned int *bp = isa_bus_to_virt(base); ++ struct intel_mp_floating *mpf; ++ ++ Dprintk("Scan SMP from %p for %ld bytes.\n", bp,length); ++ if (sizeof(*mpf) != 16) ++ __bad_mpf_size(); ++ ++ while (length > 0) { ++ mpf = (struct intel_mp_floating *)bp; ++ if ((*bp == SMP_MAGIC_IDENT) && ++ (mpf->mpf_length == 1) && ++ !mpf_checksum((unsigned char *)bp, 16) && ++ ((mpf->mpf_specification == 1) ++ || (mpf->mpf_specification == 4)) ) { ++ ++ smp_found_config = 1; ++ mpf_found = mpf; ++ return 1; ++ } ++ bp += 4; ++ length -= 16; ++ } ++ return 0; ++} ++ ++void __init find_smp_config(void) ++{ ++ unsigned int address; ++ ++ /* ++ * FIXME: Linux assumes you have 640K of base ram.. ++ * this continues the error... ++ * ++ * 1) Scan the bottom 1K for a signature ++ * 2) Scan the top 1K of base RAM ++ * 3) Scan the 64K of bios ++ */ ++ if (smp_scan_config(0x0,0x400) || ++ smp_scan_config(639*0x400,0x400) || ++ smp_scan_config(0xF0000,0x10000)) ++ return; ++ /* ++ * If it is an SMP machine we should know now. ++ * ++ * there is a real-mode segmented pointer pointing to the ++ * 4K EBDA area at 0x40E, calculate and scan it here. ++ * ++ * NOTE! There are Linux loaders that will corrupt the EBDA ++ * area, and as such this kind of SMP config may be less ++ * trustworthy, simply because the SMP table may have been ++ * stomped on during early boot. These loaders are buggy and ++ * should be fixed. ++ */ ++ ++ address = *(unsigned short *)phys_to_virt(0x40E); ++ address <<= 4; ++ if (smp_scan_config(address, 0x1000)) ++ return; ++ ++ /* If we have come this far, we did not find an MP table */ ++ printk(KERN_INFO "No mptable found.\n"); ++} ++ ++/* -------------------------------------------------------------------------- ++ ACPI-based MP Configuration ++ -------------------------------------------------------------------------- */ ++ ++#ifdef CONFIG_ACPI ++ ++#ifndef CONFIG_XEN ++void __init mp_register_lapic_address(u64 address) ++{ ++ mp_lapic_addr = (unsigned long) address; ++ set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr); ++ if (boot_cpu_id == -1U) ++ boot_cpu_id = GET_APIC_ID(apic_read(APIC_ID)); ++} ++#endif ++ ++void __cpuinit mp_register_lapic (u8 id, u8 enabled) ++{ ++ struct mpc_config_processor processor; ++ int boot_cpu = 0; ++ ++ if (id == boot_cpu_id) ++ boot_cpu = 1; ++ ++#ifndef CONFIG_XEN ++ processor.mpc_type = MP_PROCESSOR; ++ processor.mpc_apicid = id; ++ processor.mpc_apicver = 0; ++ processor.mpc_cpuflag = (enabled ? CPU_ENABLED : 0); ++ processor.mpc_cpuflag |= (boot_cpu ? CPU_BOOTPROCESSOR : 0); ++ processor.mpc_cpufeature = 0; ++ processor.mpc_featureflag = 0; ++ processor.mpc_reserved[0] = 0; ++ processor.mpc_reserved[1] = 0; ++#endif ++ ++ MP_processor_info(&processor); ++} ++ ++#define MP_ISA_BUS 0 ++#define MP_MAX_IOAPIC_PIN 127 ++ ++static struct mp_ioapic_routing { ++ int apic_id; ++ int gsi_start; ++ int gsi_end; ++ u32 pin_programmed[4]; ++} mp_ioapic_routing[MAX_IO_APICS]; ++ ++static int mp_find_ioapic(int gsi) ++{ ++ int i = 0; ++ ++ /* Find the IOAPIC that manages this GSI. */ ++ for (i = 0; i < nr_ioapics; i++) { ++ if ((gsi >= mp_ioapic_routing[i].gsi_start) ++ && (gsi <= mp_ioapic_routing[i].gsi_end)) ++ return i; ++ } ++ ++ printk(KERN_ERR "ERROR: Unable to locate IOAPIC for GSI %d\n", gsi); ++ return -1; ++} ++ ++static u8 uniq_ioapic_id(u8 id) ++{ ++ int i; ++ DECLARE_BITMAP(used, 256); ++ bitmap_zero(used, 256); ++ for (i = 0; i < nr_ioapics; i++) { ++ struct mpc_config_ioapic *ia = &mp_ioapics[i]; ++ __set_bit(ia->mpc_apicid, used); ++ } ++ if (!test_bit(id, used)) ++ return id; ++ return find_first_zero_bit(used, 256); ++} ++ ++void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base) ++{ ++ int idx = 0; ++ ++ if (bad_ioapic(address)) ++ return; ++ ++ idx = nr_ioapics; ++ ++ mp_ioapics[idx].mpc_type = MP_IOAPIC; ++ mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE; ++ mp_ioapics[idx].mpc_apicaddr = address; ++ ++#ifndef CONFIG_XEN ++ set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); ++#endif ++ mp_ioapics[idx].mpc_apicid = uniq_ioapic_id(id); ++ mp_ioapics[idx].mpc_apicver = 0; ++ ++ /* ++ * Build basic IRQ lookup table to facilitate gsi->io_apic lookups ++ * and to prevent reprogramming of IOAPIC pins (PCI IRQs). ++ */ ++ mp_ioapic_routing[idx].apic_id = mp_ioapics[idx].mpc_apicid; ++ mp_ioapic_routing[idx].gsi_start = gsi_base; ++ mp_ioapic_routing[idx].gsi_end = gsi_base + ++ io_apic_get_redir_entries(idx); ++ ++ printk(KERN_INFO "IOAPIC[%d]: apic_id %d, address 0x%x, " ++ "GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, ++ mp_ioapics[idx].mpc_apicaddr, ++ mp_ioapic_routing[idx].gsi_start, ++ mp_ioapic_routing[idx].gsi_end); ++ ++ nr_ioapics++; ++} ++ ++void __init ++mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) ++{ ++ struct mpc_config_intsrc intsrc; ++ int ioapic = -1; ++ int pin = -1; ++ ++ /* ++ * Convert 'gsi' to 'ioapic.pin'. ++ */ ++ ioapic = mp_find_ioapic(gsi); ++ if (ioapic < 0) ++ return; ++ pin = gsi - mp_ioapic_routing[ioapic].gsi_start; ++ ++ /* ++ * TBD: This check is for faulty timer entries, where the override ++ * erroneously sets the trigger to level, resulting in a HUGE ++ * increase of timer interrupts! ++ */ ++ if ((bus_irq == 0) && (trigger == 3)) ++ trigger = 1; ++ ++ intsrc.mpc_type = MP_INTSRC; ++ intsrc.mpc_irqtype = mp_INT; ++ intsrc.mpc_irqflag = (trigger << 2) | polarity; ++ intsrc.mpc_srcbus = MP_ISA_BUS; ++ intsrc.mpc_srcbusirq = bus_irq; /* IRQ */ ++ intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; /* APIC ID */ ++ intsrc.mpc_dstirq = pin; /* INTIN# */ ++ ++ Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, %d-%d\n", ++ intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3, ++ (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, ++ intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq); ++ ++ mp_irqs[mp_irq_entries] = intsrc; ++ if (++mp_irq_entries == MAX_IRQ_SOURCES) ++ panic("Max # of irq sources exceeded!\n"); ++} ++ ++void __init mp_config_acpi_legacy_irqs(void) ++{ ++ struct mpc_config_intsrc intsrc; ++ int i = 0; ++ int ioapic = -1; ++ ++ /* ++ * Fabricate the legacy ISA bus (bus #31). ++ */ ++ set_bit(MP_ISA_BUS, mp_bus_not_pci); ++ ++ /* ++ * Locate the IOAPIC that manages the ISA IRQs (0-15). ++ */ ++ ioapic = mp_find_ioapic(0); ++ if (ioapic < 0) ++ return; ++ ++ intsrc.mpc_type = MP_INTSRC; ++ intsrc.mpc_irqflag = 0; /* Conforming */ ++ intsrc.mpc_srcbus = MP_ISA_BUS; ++ intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; ++ ++ /* ++ * Use the default configuration for the IRQs 0-15. Unless ++ * overridden by (MADT) interrupt source override entries. ++ */ ++ for (i = 0; i < 16; i++) { ++ int idx; ++ ++ for (idx = 0; idx < mp_irq_entries; idx++) { ++ struct mpc_config_intsrc *irq = mp_irqs + idx; ++ ++ /* Do we already have a mapping for this ISA IRQ? */ ++ if (irq->mpc_srcbus == MP_ISA_BUS && irq->mpc_srcbusirq == i) ++ break; ++ ++ /* Do we already have a mapping for this IOAPIC pin */ ++ if ((irq->mpc_dstapic == intsrc.mpc_dstapic) && ++ (irq->mpc_dstirq == i)) ++ break; ++ } ++ ++ if (idx != mp_irq_entries) { ++ printk(KERN_DEBUG "ACPI: IRQ%d used by override.\n", i); ++ continue; /* IRQ already used */ ++ } ++ ++ intsrc.mpc_irqtype = mp_INT; ++ intsrc.mpc_srcbusirq = i; /* Identity mapped */ ++ intsrc.mpc_dstirq = i; ++ ++ Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, " ++ "%d-%d\n", intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3, ++ (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, ++ intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, ++ intsrc.mpc_dstirq); ++ ++ mp_irqs[mp_irq_entries] = intsrc; ++ if (++mp_irq_entries == MAX_IRQ_SOURCES) ++ panic("Max # of irq sources exceeded!\n"); ++ } ++} ++ ++int mp_register_gsi(u32 gsi, int triggering, int polarity) ++{ ++ int ioapic = -1; ++ int ioapic_pin = 0; ++ int idx, bit = 0; ++ ++ if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) ++ return gsi; ++ ++ /* Don't set up the ACPI SCI because it's already set up */ ++ if (acpi_gbl_FADT.sci_interrupt == gsi) ++ return gsi; ++ ++ ioapic = mp_find_ioapic(gsi); ++ if (ioapic < 0) { ++ printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi); ++ return gsi; ++ } ++ ++ ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_start; ++ ++ /* ++ * Avoid pin reprogramming. PRTs typically include entries ++ * with redundant pin->gsi mappings (but unique PCI devices); ++ * we only program the IOAPIC on the first. ++ */ ++ bit = ioapic_pin % 32; ++ idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32); ++ if (idx > 3) { ++ printk(KERN_ERR "Invalid reference to IOAPIC pin " ++ "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, ++ ioapic_pin); ++ return gsi; ++ } ++ if ((1< + #include + ++#ifdef CONFIG_SYSCTL + int unknown_nmi_panic; +-int nmi_watchdog_enabled; ++static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu); ++#endif ++ + int panic_on_unrecovered_nmi; + ++#ifndef CONFIG_XEN ++ ++int nmi_watchdog_enabled; ++ + static cpumask_t backtrace_mask = CPU_MASK_NONE; + + /* nmi_active: +@@ -46,9 +53,6 @@ + + static DEFINE_PER_CPU(short, wd_enabled); + +-/* local prototypes */ +-static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu); +- + /* Run after command line and cpu_init init, but before all other checks */ + void nmi_watchdog_default(void) + { +@@ -383,6 +387,8 @@ + return rc; + } + ++#endif /* CONFIG_XEN */ ++ + static unsigned ignore_nmis; + + asmlinkage __kprobes void do_nmi(struct pt_regs * regs, long error_code) +@@ -427,6 +433,7 @@ + return 0; + } + ++#ifndef CONFIG_XEN + /* + * proc handler for /proc/sys/kernel/nmi + */ +@@ -461,9 +468,11 @@ + } + return 0; + } ++#endif + + #endif + ++#ifndef CONFIG_XEN + void __trigger_all_cpu_backtrace(void) + { + int i; +@@ -480,3 +489,4 @@ + EXPORT_SYMBOL(nmi_active); + EXPORT_SYMBOL(nmi_watchdog); + EXPORT_SYMBOL(touch_nmi_watchdog); ++#endif /* CONFIG_XEN */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/pci-dma_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/pci-dma_32-xen.c +--- ./arch/x86/kernel/pci-dma_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/pci-dma_32-xen.c 2012-11-13 15:20:17.308568999 +0000 +@@ -0,0 +1,442 @@ ++/* ++ * Dynamic DMA mapping support. ++ * ++ * On i386 there is no hardware dynamic DMA address translation, ++ * so consistent alloc/free are merely page allocation/freeing. ++ * The rest of the dynamic DMA mapping interface is implemented ++ * in asm/pci.h. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef __x86_64__ ++#include ++ ++int iommu_merge __read_mostly = 0; ++EXPORT_SYMBOL(iommu_merge); ++ ++dma_addr_t bad_dma_address __read_mostly; ++EXPORT_SYMBOL(bad_dma_address); ++ ++/* This tells the BIO block layer to assume merging. Default to off ++ because we cannot guarantee merging later. */ ++int iommu_bio_merge __read_mostly = 0; ++EXPORT_SYMBOL(iommu_bio_merge); ++ ++int force_iommu __read_mostly= 0; ++ ++__init int iommu_setup(char *p) ++{ ++ return 1; ++} ++ ++void __init pci_iommu_alloc(void) ++{ ++#ifdef CONFIG_SWIOTLB ++ pci_swiotlb_init(); ++#endif ++} ++ ++static int __init pci_iommu_init(void) ++{ ++ no_iommu_init(); ++ return 0; ++} ++ ++/* Must execute after PCI subsystem */ ++fs_initcall(pci_iommu_init); ++#endif ++ ++struct dma_coherent_mem { ++ void *virt_base; ++ u32 device_base; ++ int size; ++ int flags; ++ unsigned long *bitmap; ++}; ++ ++#define IOMMU_BUG_ON(test) \ ++do { \ ++ if (unlikely(test)) { \ ++ printk(KERN_ALERT "Fatal DMA error! " \ ++ "Please use 'swiotlb=force'\n"); \ ++ BUG(); \ ++ } \ ++} while (0) ++ ++static int check_pages_physically_contiguous(unsigned long pfn, ++ unsigned int offset, ++ size_t length) ++{ ++ unsigned long next_mfn; ++ int i; ++ int nr_pages; ++ ++ next_mfn = pfn_to_mfn(pfn); ++ nr_pages = (offset + length + PAGE_SIZE-1) >> PAGE_SHIFT; ++ ++ for (i = 1; i < nr_pages; i++) { ++ if (pfn_to_mfn(++pfn) != ++next_mfn) ++ return 0; ++ } ++ return 1; ++} ++ ++int range_straddles_page_boundary(paddr_t p, size_t size) ++{ ++ extern unsigned long *contiguous_bitmap; ++ unsigned long pfn = p >> PAGE_SHIFT; ++ unsigned int offset = p & ~PAGE_MASK; ++ ++ if (offset + size <= PAGE_SIZE) ++ return 0; ++ if (test_bit(pfn, contiguous_bitmap)) ++ return 0; ++ if (check_pages_physically_contiguous(pfn, offset, size)) ++ return 0; ++ return 1; ++} ++ ++int ++dma_map_sg(struct device *hwdev, struct scatterlist *sgl, int nents, ++ enum dma_data_direction direction) ++{ ++ int i, rc; ++ ++ BUG_ON(!valid_dma_direction(direction)); ++ WARN_ON(nents == 0 || sgl->length == 0); ++ ++ if (swiotlb) { ++ rc = swiotlb_map_sg(hwdev, sgl, nents, direction); ++ } else { ++ struct scatterlist *sg; ++ ++ for_each_sg(sgl, sg, nents, i) { ++ BUG_ON(!sg_page(sg)); ++ sg->dma_address = ++ gnttab_dma_map_page(sg_page(sg)) + sg->offset; ++ sg->dma_length = sg->length; ++ IOMMU_BUG_ON(address_needs_mapping( ++ hwdev, sg->dma_address)); ++ IOMMU_BUG_ON(range_straddles_page_boundary( ++ page_to_pseudophys(sg_page(sg)) + sg->offset, ++ sg->length)); ++ } ++ rc = nents; ++ } ++ ++ flush_write_buffers(); ++ return rc; ++} ++EXPORT_SYMBOL(dma_map_sg); ++ ++void ++dma_unmap_sg(struct device *hwdev, struct scatterlist *sgl, int nents, ++ enum dma_data_direction direction) ++{ ++ int i; ++ ++ BUG_ON(!valid_dma_direction(direction)); ++ if (swiotlb) ++ swiotlb_unmap_sg(hwdev, sgl, nents, direction); ++ else { ++ struct scatterlist *sg; ++ ++ for_each_sg(sgl, sg, nents, i) ++ gnttab_dma_unmap_page(sg->dma_address); ++ } ++} ++EXPORT_SYMBOL(dma_unmap_sg); ++ ++#ifdef CONFIG_HIGHMEM ++dma_addr_t ++dma_map_page(struct device *dev, struct page *page, unsigned long offset, ++ size_t size, enum dma_data_direction direction) ++{ ++ dma_addr_t dma_addr; ++ ++ BUG_ON(!valid_dma_direction(direction)); ++ if (swiotlb) { ++ dma_addr = swiotlb_map_page( ++ dev, page, offset, size, direction); ++ } else { ++ dma_addr = gnttab_dma_map_page(page) + offset; ++ IOMMU_BUG_ON(address_needs_mapping(dev, dma_addr)); ++ } ++ ++ return dma_addr; ++} ++EXPORT_SYMBOL(dma_map_page); ++ ++void ++dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, ++ enum dma_data_direction direction) ++{ ++ BUG_ON(!valid_dma_direction(direction)); ++ if (swiotlb) ++ swiotlb_unmap_page(dev, dma_address, size, direction); ++ else ++ gnttab_dma_unmap_page(dma_address); ++} ++EXPORT_SYMBOL(dma_unmap_page); ++#endif /* CONFIG_HIGHMEM */ ++ ++int ++dma_mapping_error(dma_addr_t dma_addr) ++{ ++ if (swiotlb) ++ return swiotlb_dma_mapping_error(dma_addr); ++ return 0; ++} ++EXPORT_SYMBOL(dma_mapping_error); ++ ++int ++dma_supported(struct device *dev, u64 mask) ++{ ++ if (swiotlb) ++ return swiotlb_dma_supported(dev, mask); ++ /* ++ * By default we'll BUG when an infeasible DMA is requested, and ++ * request swiotlb=force (see IOMMU_BUG_ON). ++ */ ++ return 1; ++} ++EXPORT_SYMBOL(dma_supported); ++ ++void *dma_alloc_coherent(struct device *dev, size_t size, ++ dma_addr_t *dma_handle, gfp_t gfp) ++{ ++ void *ret; ++ struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; ++ unsigned int order = get_order(size); ++ unsigned long vstart; ++ u64 mask; ++ ++ /* ignore region specifiers */ ++ gfp &= ~(__GFP_DMA | __GFP_HIGHMEM); ++ ++ if (mem) { ++ int page = bitmap_find_free_region(mem->bitmap, mem->size, ++ order); ++ if (page >= 0) { ++ *dma_handle = mem->device_base + (page << PAGE_SHIFT); ++ ret = mem->virt_base + (page << PAGE_SHIFT); ++ memset(ret, 0, size); ++ return ret; ++ } ++ if (mem->flags & DMA_MEMORY_EXCLUSIVE) ++ return NULL; ++ } ++ ++ if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff)) ++ gfp |= GFP_DMA; ++ ++ vstart = __get_free_pages(gfp, order); ++ ret = (void *)vstart; ++ ++ if (dev != NULL && dev->coherent_dma_mask) ++ mask = dev->coherent_dma_mask; ++ else ++ mask = 0xffffffff; ++ ++ if (ret != NULL) { ++ if (xen_create_contiguous_region(vstart, order, ++ fls64(mask)) != 0) { ++ free_pages(vstart, order); ++ return NULL; ++ } ++ memset(ret, 0, size); ++ *dma_handle = virt_to_bus(ret); ++ } ++ return ret; ++} ++EXPORT_SYMBOL(dma_alloc_coherent); ++ ++void dma_free_coherent(struct device *dev, size_t size, ++ void *vaddr, dma_addr_t dma_handle) ++{ ++ struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; ++ int order = get_order(size); ++ ++ WARN_ON(irqs_disabled()); /* for portability */ ++ if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) { ++ int page = (vaddr - mem->virt_base) >> PAGE_SHIFT; ++ ++ bitmap_release_region(mem->bitmap, page, order); ++ } else { ++ xen_destroy_contiguous_region((unsigned long)vaddr, order); ++ free_pages((unsigned long)vaddr, order); ++ } ++} ++EXPORT_SYMBOL(dma_free_coherent); ++ ++#ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY ++int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, ++ dma_addr_t device_addr, size_t size, int flags) ++{ ++ void __iomem *mem_base = NULL; ++ int pages = size >> PAGE_SHIFT; ++ int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long); ++ ++ if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0) ++ goto out; ++ if (!size) ++ goto out; ++ if (dev->dma_mem) ++ goto out; ++ ++ /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */ ++ ++ mem_base = ioremap(bus_addr, size); ++ if (!mem_base) ++ goto out; ++ ++ dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL); ++ if (!dev->dma_mem) ++ goto out; ++ dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL); ++ if (!dev->dma_mem->bitmap) ++ goto free1_out; ++ ++ dev->dma_mem->virt_base = mem_base; ++ dev->dma_mem->device_base = device_addr; ++ dev->dma_mem->size = pages; ++ dev->dma_mem->flags = flags; ++ ++ if (flags & DMA_MEMORY_MAP) ++ return DMA_MEMORY_MAP; ++ ++ return DMA_MEMORY_IO; ++ ++ free1_out: ++ kfree(dev->dma_mem); ++ out: ++ if (mem_base) ++ iounmap(mem_base); ++ return 0; ++} ++EXPORT_SYMBOL(dma_declare_coherent_memory); ++ ++void dma_release_declared_memory(struct device *dev) ++{ ++ struct dma_coherent_mem *mem = dev->dma_mem; ++ ++ if(!mem) ++ return; ++ dev->dma_mem = NULL; ++ iounmap(mem->virt_base); ++ kfree(mem->bitmap); ++ kfree(mem); ++} ++EXPORT_SYMBOL(dma_release_declared_memory); ++ ++void *dma_mark_declared_memory_occupied(struct device *dev, ++ dma_addr_t device_addr, size_t size) ++{ ++ struct dma_coherent_mem *mem = dev->dma_mem; ++ int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT; ++ int pos, err; ++ ++ if (!mem) ++ return ERR_PTR(-EINVAL); ++ ++ pos = (device_addr - mem->device_base) >> PAGE_SHIFT; ++ err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages)); ++ if (err != 0) ++ return ERR_PTR(err); ++ return mem->virt_base + (pos << PAGE_SHIFT); ++} ++EXPORT_SYMBOL(dma_mark_declared_memory_occupied); ++#endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ ++ ++#if defined(CONFIG_PCI) && !defined(CONFIG_XEN) ++/* Many VIA bridges seem to corrupt data for DAC. Disable it here */ ++ ++int forbid_dac; ++EXPORT_SYMBOL(forbid_dac); ++ ++static __devinit void via_no_dac(struct pci_dev *dev) ++{ ++ if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) { ++ printk(KERN_INFO "PCI: VIA PCI bridge detected. Disabling DAC.\n"); ++ forbid_dac = 1; ++ } ++} ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac); ++ ++static int check_iommu(char *s) ++{ ++ if (!strcmp(s, "usedac")) { ++ forbid_dac = -1; ++ return 1; ++ } ++ return 0; ++} ++__setup("iommu=", check_iommu); ++#endif ++ ++dma_addr_t ++dma_map_single(struct device *dev, void *ptr, size_t size, ++ enum dma_data_direction direction) ++{ ++ dma_addr_t dma; ++ ++ BUG_ON(!valid_dma_direction(direction)); ++ WARN_ON(size == 0); ++ ++ if (swiotlb) { ++ dma = swiotlb_map_single(dev, ptr, size, direction); ++ } else { ++ dma = gnttab_dma_map_page(virt_to_page(ptr)) + ++ offset_in_page(ptr); ++ IOMMU_BUG_ON(range_straddles_page_boundary(__pa(ptr), size)); ++ IOMMU_BUG_ON(address_needs_mapping(dev, dma)); ++ } ++ ++ flush_write_buffers(); ++ return dma; ++} ++EXPORT_SYMBOL(dma_map_single); ++ ++void ++dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, ++ enum dma_data_direction direction) ++{ ++ BUG_ON(!valid_dma_direction(direction)); ++ if (swiotlb) ++ swiotlb_unmap_single(dev, dma_addr, size, direction); ++ else ++ gnttab_dma_unmap_page(dma_addr); ++} ++EXPORT_SYMBOL(dma_unmap_single); ++ ++void ++dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, ++ enum dma_data_direction direction) ++{ ++ if (swiotlb) ++ swiotlb_sync_single_for_cpu(dev, dma_handle, size, direction); ++} ++EXPORT_SYMBOL(dma_sync_single_for_cpu); ++ ++void ++dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, ++ enum dma_data_direction direction) ++{ ++ if (swiotlb) ++ swiotlb_sync_single_for_device(dev, dma_handle, size, direction); ++} ++EXPORT_SYMBOL(dma_sync_single_for_device); +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/pci-swiotlb_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/pci-swiotlb_64-xen.c +--- ./arch/x86/kernel/pci-swiotlb_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/pci-swiotlb_64-xen.c 2012-11-13 15:20:17.308568999 +0000 +@@ -0,0 +1,58 @@ ++/* Glue code to lib/swiotlb.c */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#if 0 ++int swiotlb __read_mostly; ++EXPORT_SYMBOL(swiotlb); ++#endif ++ ++void swiotlb_init(void); ++ ++const struct dma_mapping_ops swiotlb_dma_ops = { ++#if 0 ++ .mapping_error = swiotlb_dma_mapping_error, ++ .alloc_coherent = swiotlb_alloc_coherent, ++ .free_coherent = swiotlb_free_coherent, ++ .map_single = swiotlb_map_single, ++ .unmap_single = swiotlb_unmap_single, ++ .sync_single_for_cpu = swiotlb_sync_single_for_cpu, ++ .sync_single_for_device = swiotlb_sync_single_for_device, ++ .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, ++ .sync_single_range_for_device = swiotlb_sync_single_range_for_device, ++ .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, ++ .sync_sg_for_device = swiotlb_sync_sg_for_device, ++ .map_sg = swiotlb_map_sg, ++ .unmap_sg = swiotlb_unmap_sg, ++ .dma_supported = NULL, ++#endif ++}; ++ ++void __init pci_swiotlb_init(void) ++{ ++#if 0 ++ /* don't initialize swiotlb if iommu=off (no_iommu=1) */ ++ if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN) ++ swiotlb = 1; ++ if (swiotlb_force) ++ swiotlb = 1; ++ if (swiotlb) { ++ printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n"); ++ swiotlb_init(); ++ dma_ops = &swiotlb_dma_ops; ++ } ++#else ++ swiotlb_init(); ++ if (swiotlb) { ++ printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n"); ++ dma_ops = &swiotlb_dma_ops; ++ } ++#endif ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/pcspeaker.c debian/binary-custom.d/xen/src/arch/x86/kernel/pcspeaker.c +--- ./arch/x86/kernel/pcspeaker.c 2012-06-12 16:25:11.614312932 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/pcspeaker.c 2012-11-13 15:20:17.312568997 +0000 +@@ -7,6 +7,11 @@ + struct platform_device *pd; + int ret; + ++#ifdef CONFIG_XEN ++ if (!is_initial_xendomain()) ++ return 0; ++#endif ++ + pd = platform_device_alloc("pcspkr", -1); + if (!pd) + return -ENOMEM; +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/process_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/process_32-xen.c +--- ./arch/x86/kernel/process_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/process_32-xen.c 2012-11-13 15:20:17.312568997 +0000 +@@ -0,0 +1,909 @@ ++/* ++ * Copyright (C) 1995 Linus Torvalds ++ * ++ * Pentium III FXSR, SSE support ++ * Gareth Hughes , May 2000 ++ */ ++ ++/* ++ * This file handles the architecture-dependent parts of process handling.. ++ */ ++ ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_MATH_EMULATION ++#include ++#endif ++ ++#include ++#include ++#include ++ ++#include ++ ++#include ++#include ++ ++asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); ++ ++static int hlt_counter; ++ ++unsigned long boot_option_idle_override = 0; ++EXPORT_SYMBOL(boot_option_idle_override); ++ ++DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task; ++EXPORT_PER_CPU_SYMBOL(current_task); ++ ++DEFINE_PER_CPU(int, cpu_number); ++EXPORT_PER_CPU_SYMBOL(cpu_number); ++ ++/* ++ * Return saved PC of a blocked thread. ++ */ ++unsigned long thread_saved_pc(struct task_struct *tsk) ++{ ++ return ((unsigned long *)tsk->thread.esp)[3]; ++} ++ ++/* ++ * Powermanagement idle function, if any.. ++ */ ++void (*pm_idle)(void); ++EXPORT_SYMBOL(pm_idle); ++static DEFINE_PER_CPU(unsigned int, cpu_idle_state); ++ ++void disable_hlt(void) ++{ ++ hlt_counter++; ++} ++ ++EXPORT_SYMBOL(disable_hlt); ++ ++void enable_hlt(void) ++{ ++ hlt_counter--; ++} ++ ++EXPORT_SYMBOL(enable_hlt); ++ ++/* ++ * On SMP it's slightly faster (but much more power-consuming!) ++ * to poll the ->work.need_resched flag instead of waiting for the ++ * cross-CPU IPI to arrive. Use this option with caution. ++ */ ++static void poll_idle (void) ++{ ++ cpu_relax(); ++} ++ ++static void xen_idle(void) ++{ ++ current_thread_info()->status &= ~TS_POLLING; ++ /* ++ * TS_POLLING-cleared state must be visible before we ++ * test NEED_RESCHED: ++ */ ++ smp_mb(); ++ ++ local_irq_disable(); ++ if (!need_resched()) ++ safe_halt(); /* enables interrupts racelessly */ ++ else ++ local_irq_enable(); ++ current_thread_info()->status |= TS_POLLING; ++} ++#ifdef CONFIG_APM_MODULE ++EXPORT_SYMBOL(default_idle); ++#endif ++ ++#ifdef CONFIG_HOTPLUG_CPU ++extern cpumask_t cpu_initialized; ++static inline void play_dead(void) ++{ ++ idle_task_exit(); ++ local_irq_disable(); ++ cpu_clear(smp_processor_id(), cpu_initialized); ++ preempt_enable_no_resched(); ++ HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL); ++ cpu_bringup(); ++} ++#else ++static inline void play_dead(void) ++{ ++ BUG(); ++} ++#endif /* CONFIG_HOTPLUG_CPU */ ++ ++/* ++ * The idle thread. There's no useful work to be ++ * done, so just try to conserve power and have a ++ * low exit latency (ie sit in a loop waiting for ++ * somebody to say that they'd like to reschedule) ++ */ ++void cpu_idle(void) ++{ ++ int cpu = smp_processor_id(); ++ ++ current_thread_info()->status |= TS_POLLING; ++ ++ /* endless idle loop with no priority at all */ ++ while (1) { ++ tick_nohz_stop_sched_tick(); ++ while (!need_resched()) { ++ void (*idle)(void); ++ ++ if (__get_cpu_var(cpu_idle_state)) ++ __get_cpu_var(cpu_idle_state) = 0; ++ ++ check_pgt_cache(); ++ rmb(); ++ idle = xen_idle; /* no alternatives */ ++ ++ if (cpu_is_offline(cpu)) ++ play_dead(); ++ ++ __get_cpu_var(irq_stat).idle_timestamp = jiffies; ++ idle(); ++ } ++ tick_nohz_restart_sched_tick(); ++ preempt_enable_no_resched(); ++ schedule(); ++ preempt_disable(); ++ } ++} ++ ++void cpu_idle_wait(void) ++{ ++ unsigned int cpu, this_cpu = get_cpu(); ++ cpumask_t map, tmp = current->cpus_allowed; ++ ++ set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); ++ put_cpu(); ++ ++ cpus_clear(map); ++ for_each_online_cpu(cpu) { ++ per_cpu(cpu_idle_state, cpu) = 1; ++ cpu_set(cpu, map); ++ } ++ ++ __get_cpu_var(cpu_idle_state) = 0; ++ ++ wmb(); ++ do { ++ ssleep(1); ++ for_each_online_cpu(cpu) { ++ if (cpu_isset(cpu, map) && !per_cpu(cpu_idle_state, cpu)) ++ cpu_clear(cpu, map); ++ } ++ cpus_and(map, map, cpu_online_map); ++ } while (!cpus_empty(map)); ++ ++ set_cpus_allowed(current, tmp); ++} ++EXPORT_SYMBOL_GPL(cpu_idle_wait); ++ ++void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) ++{ ++} ++ ++static int __init idle_setup(char *str) ++{ ++ if (!strcmp(str, "poll")) { ++ printk("using polling idle threads.\n"); ++ pm_idle = poll_idle; ++ } ++ else ++ return -1; ++ ++ boot_option_idle_override = 1; ++ return 0; ++} ++early_param("idle", idle_setup); ++ ++void __show_registers(struct pt_regs *regs, int all) ++{ ++ unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; ++ unsigned long d0, d1, d2, d3, d6, d7; ++ unsigned long esp; ++ unsigned short ss, gs; ++ ++ if (user_mode_vm(regs)) { ++ esp = regs->esp; ++ ss = regs->xss & 0xffff; ++ savesegment(gs, gs); ++ } else { ++ esp = (unsigned long) (®s->esp); ++ savesegment(ss, ss); ++ savesegment(gs, gs); ++ } ++ ++ printk("\n"); ++ printk("Pid: %d, comm: %s %s (%s %.*s)\n", ++ task_pid_nr(current), current->comm, ++ print_tainted(), init_utsname()->release, ++ (int)strcspn(init_utsname()->version, " "), ++ init_utsname()->version); ++ ++ printk("EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n", ++ 0xffff & regs->xcs, regs->eip, regs->eflags, ++ smp_processor_id()); ++ print_symbol("EIP is at %s\n", regs->eip); ++ ++ printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", ++ regs->eax, regs->ebx, regs->ecx, regs->edx); ++ printk("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n", ++ regs->esi, regs->edi, regs->ebp, esp); ++ printk(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n", ++ regs->xds & 0xffff, regs->xes & 0xffff, ++ regs->xfs & 0xffff, gs, ss); ++ ++ if (!all) ++ return; ++ ++ cr0 = read_cr0(); ++ cr2 = read_cr2(); ++ cr3 = read_cr3(); ++ cr4 = read_cr4_safe(); ++ printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", ++ cr0, cr2, cr3, cr4); ++ ++ get_debugreg(d0, 0); ++ get_debugreg(d1, 1); ++ get_debugreg(d2, 2); ++ get_debugreg(d3, 3); ++ printk("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n", ++ d0, d1, d2, d3); ++ ++ get_debugreg(d6, 6); ++ get_debugreg(d7, 7); ++ printk("DR6: %08lx DR7: %08lx\n", ++ d6, d7); ++} ++ ++void show_regs(struct pt_regs *regs) ++{ ++ __show_registers(regs, 1); ++ show_trace(NULL, regs, ®s->esp); ++} ++ ++/* ++ * This gets run with %ebx containing the ++ * function to call, and %edx containing ++ * the "args". ++ */ ++extern void kernel_thread_helper(void); ++ ++/* ++ * Create a kernel thread ++ */ ++int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++{ ++ struct pt_regs regs; ++ ++ memset(®s, 0, sizeof(regs)); ++ ++ regs.ebx = (unsigned long) fn; ++ regs.edx = (unsigned long) arg; ++ ++ regs.xds = __USER_DS; ++ regs.xes = __USER_DS; ++ regs.xfs = __KERNEL_PERCPU; ++ regs.orig_eax = -1; ++ regs.eip = (unsigned long) kernel_thread_helper; ++ regs.xcs = __KERNEL_CS | get_kernel_rpl(); ++ regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2; ++ ++ /* Ok, create the new process.. */ ++ return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); ++} ++EXPORT_SYMBOL(kernel_thread); ++ ++/* ++ * Free current thread data structures etc.. ++ */ ++void exit_thread(void) ++{ ++ /* The process may have allocated an io port bitmap... nuke it. */ ++ if (unlikely(test_thread_flag(TIF_IO_BITMAP))) { ++ struct task_struct *tsk = current; ++ struct thread_struct *t = &tsk->thread; ++ struct physdev_set_iobitmap set_iobitmap; ++ memset(&set_iobitmap, 0, sizeof(set_iobitmap)); ++ HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &set_iobitmap); ++ kfree(t->io_bitmap_ptr); ++ t->io_bitmap_ptr = NULL; ++ clear_thread_flag(TIF_IO_BITMAP); ++ } ++} ++ ++void flush_thread(void) ++{ ++ struct task_struct *tsk = current; ++ ++ memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8); ++ memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); ++ clear_tsk_thread_flag(tsk, TIF_DEBUG); ++ /* ++ * Forget coprocessor state.. ++ */ ++ clear_fpu(tsk); ++ clear_used_math(); ++} ++ ++void release_thread(struct task_struct *dead_task) ++{ ++ BUG_ON(dead_task->mm); ++ release_vm86_irqs(dead_task); ++} ++ ++/* ++ * This gets called before we allocate a new thread and copy ++ * the current task into it. ++ */ ++void prepare_to_copy(struct task_struct *tsk) ++{ ++ unlazy_fpu(tsk); ++} ++ ++int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, ++ unsigned long unused, ++ struct task_struct * p, struct pt_regs * regs) ++{ ++ struct pt_regs * childregs; ++ struct task_struct *tsk; ++ int err; ++ ++ childregs = task_pt_regs(p); ++ *childregs = *regs; ++ childregs->eax = 0; ++ childregs->esp = esp; ++ ++ p->thread.esp = (unsigned long) childregs; ++ p->thread.esp0 = (unsigned long) (childregs+1); ++ ++ p->thread.eip = (unsigned long) ret_from_fork; ++ ++ savesegment(gs,p->thread.gs); ++ ++ tsk = current; ++ if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) { ++ p->thread.io_bitmap_ptr = kmemdup(tsk->thread.io_bitmap_ptr, ++ IO_BITMAP_BYTES, GFP_KERNEL); ++ if (!p->thread.io_bitmap_ptr) { ++ p->thread.io_bitmap_max = 0; ++ return -ENOMEM; ++ } ++ set_tsk_thread_flag(p, TIF_IO_BITMAP); ++ } ++ ++ /* ++ * Set a new TLS for the child thread? ++ */ ++ if (clone_flags & CLONE_SETTLS) { ++ struct desc_struct *desc; ++ struct user_desc info; ++ int idx; ++ ++ err = -EFAULT; ++ if (copy_from_user(&info, (void __user *)childregs->esi, sizeof(info))) ++ goto out; ++ err = -EINVAL; ++ if (LDT_empty(&info)) ++ goto out; ++ ++ idx = info.entry_number; ++ if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX) ++ goto out; ++ ++ desc = p->thread.tls_array + idx - GDT_ENTRY_TLS_MIN; ++ desc->a = LDT_entry_a(&info); ++ desc->b = LDT_entry_b(&info); ++ } ++ ++ p->thread.iopl = current->thread.iopl; ++ ++ err = 0; ++ out: ++ if (err && p->thread.io_bitmap_ptr) { ++ kfree(p->thread.io_bitmap_ptr); ++ p->thread.io_bitmap_max = 0; ++ } ++ return err; ++} ++ ++/* ++ * fill in the user structure for a core dump.. ++ */ ++void dump_thread(struct pt_regs * regs, struct user * dump) ++{ ++ int i; ++ ++/* changed the size calculations - should hopefully work better. lbt */ ++ dump->magic = CMAGIC; ++ dump->start_code = 0; ++ dump->start_stack = regs->esp & ~(PAGE_SIZE - 1); ++ dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT; ++ dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT; ++ dump->u_dsize -= dump->u_tsize; ++ dump->u_ssize = 0; ++ for (i = 0; i < 8; i++) ++ dump->u_debugreg[i] = current->thread.debugreg[i]; ++ ++ if (dump->start_stack < TASK_SIZE) ++ dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT; ++ ++ dump->regs.ebx = regs->ebx; ++ dump->regs.ecx = regs->ecx; ++ dump->regs.edx = regs->edx; ++ dump->regs.esi = regs->esi; ++ dump->regs.edi = regs->edi; ++ dump->regs.ebp = regs->ebp; ++ dump->regs.eax = regs->eax; ++ dump->regs.ds = regs->xds; ++ dump->regs.es = regs->xes; ++ dump->regs.fs = regs->xfs; ++ savesegment(gs,dump->regs.gs); ++ dump->regs.orig_eax = regs->orig_eax; ++ dump->regs.eip = regs->eip; ++ dump->regs.cs = regs->xcs; ++ dump->regs.eflags = regs->eflags; ++ dump->regs.esp = regs->esp; ++ dump->regs.ss = regs->xss; ++ ++ dump->u_fpvalid = dump_fpu (regs, &dump->i387); ++} ++EXPORT_SYMBOL(dump_thread); ++ ++/* ++ * Capture the user space registers if the task is not running (in user space) ++ */ ++int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) ++{ ++ struct pt_regs ptregs = *task_pt_regs(tsk); ++ ptregs.xcs &= 0xffff; ++ ptregs.xds &= 0xffff; ++ ptregs.xes &= 0xffff; ++ ptregs.xss &= 0xffff; ++ ++ elf_core_copy_regs(regs, &ptregs); ++ ++ return 1; ++} ++ ++#ifdef CONFIG_SECCOMP ++void hard_disable_TSC(void) ++{ ++ write_cr4(read_cr4() | X86_CR4_TSD); ++} ++void disable_TSC(void) ++{ ++ preempt_disable(); ++ if (!test_and_set_thread_flag(TIF_NOTSC)) ++ /* ++ * Must flip the CPU state synchronously with ++ * TIF_NOTSC in the current running context. ++ */ ++ hard_disable_TSC(); ++ preempt_enable(); ++} ++void hard_enable_TSC(void) ++{ ++ write_cr4(read_cr4() & ~X86_CR4_TSD); ++} ++#endif /* CONFIG_SECCOMP */ ++ ++static noinline void ++__switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p) ++{ ++ struct thread_struct *next; ++ ++ next = &next_p->thread; ++ ++ if (test_tsk_thread_flag(next_p, TIF_DEBUG)) { ++ set_debugreg(next->debugreg[0], 0); ++ set_debugreg(next->debugreg[1], 1); ++ set_debugreg(next->debugreg[2], 2); ++ set_debugreg(next->debugreg[3], 3); ++ /* no 4 and 5 */ ++ set_debugreg(next->debugreg[6], 6); ++ set_debugreg(next->debugreg[7], 7); ++ } ++ ++#ifdef CONFIG_SECCOMP ++ if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^ ++ test_tsk_thread_flag(next_p, TIF_NOTSC)) { ++ /* prev and next are different */ ++ if (test_tsk_thread_flag(next_p, TIF_NOTSC)) ++ hard_disable_TSC(); ++ else ++ hard_enable_TSC(); ++ } ++#endif ++} ++ ++/* ++ * switch_to(x,yn) should switch tasks from x to y. ++ * ++ * We fsave/fwait so that an exception goes off at the right time ++ * (as a call from the fsave or fwait in effect) rather than to ++ * the wrong process. Lazy FP saving no longer makes any sense ++ * with modern CPU's, and this simplifies a lot of things (SMP ++ * and UP become the same). ++ * ++ * NOTE! We used to use the x86 hardware context switching. The ++ * reason for not using it any more becomes apparent when you ++ * try to recover gracefully from saved state that is no longer ++ * valid (stale segment register values in particular). With the ++ * hardware task-switch, there is no way to fix up bad state in ++ * a reasonable manner. ++ * ++ * The fact that Intel documents the hardware task-switching to ++ * be slow is a fairly red herring - this code is not noticeably ++ * faster. However, there _is_ some room for improvement here, ++ * so the performance issues may eventually be a valid point. ++ * More important, however, is the fact that this allows us much ++ * more flexibility. ++ * ++ * The return value (in %eax) will be the "prev" task after ++ * the task-switch, and shows up in ret_from_fork in entry.S, ++ * for example. ++ */ ++struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct task_struct *next_p) ++{ ++ struct thread_struct *prev = &prev_p->thread, ++ *next = &next_p->thread; ++ int cpu = smp_processor_id(); ++#ifndef CONFIG_X86_NO_TSS ++ struct tss_struct *tss = &per_cpu(init_tss, cpu); ++#endif ++ struct physdev_set_iopl iopl_op; ++ struct physdev_set_iobitmap iobmp_op; ++ multicall_entry_t _mcl[8], *mcl = _mcl; ++ ++ /* XEN NOTE: FS/GS saved in switch_mm(), not here. */ ++ ++ /* ++ * This is basically '__unlazy_fpu', except that we queue a ++ * multicall to indicate FPU task switch, rather than ++ * synchronously trapping to Xen. ++ */ ++ if (task_thread_info(prev_p)->status & TS_USEDFPU) { ++ __save_init_fpu(prev_p); /* _not_ save_init_fpu() */ ++ mcl->op = __HYPERVISOR_fpu_taskswitch; ++ mcl->args[0] = 1; ++ mcl++; ++ } ++#if 0 /* lazy fpu sanity check */ ++ else BUG_ON(!(read_cr0() & 8)); ++#endif ++ ++ /* ++ * Reload esp0. ++ * This is load_esp0(tss, next) with a multicall. ++ */ ++ mcl->op = __HYPERVISOR_stack_switch; ++ mcl->args[0] = __KERNEL_DS; ++ mcl->args[1] = next->esp0; ++ mcl++; ++ ++ /* ++ * Load the per-thread Thread-Local Storage descriptor. ++ * This is load_TLS(next, cpu) with multicalls. ++ */ ++#define C(i) do { \ ++ if (unlikely(next->tls_array[i].a != prev->tls_array[i].a || \ ++ next->tls_array[i].b != prev->tls_array[i].b)) { \ ++ mcl->op = __HYPERVISOR_update_descriptor; \ ++ *(u64 *)&mcl->args[0] = virt_to_machine( \ ++ &get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]);\ ++ *(u64 *)&mcl->args[2] = *(u64 *)&next->tls_array[i]; \ ++ mcl++; \ ++ } \ ++} while (0) ++ C(0); C(1); C(2); ++#undef C ++ ++ if (unlikely(prev->iopl != next->iopl)) { ++ iopl_op.iopl = (next->iopl == 0) ? 1 : (next->iopl >> 12) & 3; ++ mcl->op = __HYPERVISOR_physdev_op; ++ mcl->args[0] = PHYSDEVOP_set_iopl; ++ mcl->args[1] = (unsigned long)&iopl_op; ++ mcl++; ++ } ++ ++ if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) { ++ set_xen_guest_handle(iobmp_op.bitmap, ++ (char *)next->io_bitmap_ptr); ++ iobmp_op.nr_ports = next->io_bitmap_ptr ? IO_BITMAP_BITS : 0; ++ mcl->op = __HYPERVISOR_physdev_op; ++ mcl->args[0] = PHYSDEVOP_set_iobitmap; ++ mcl->args[1] = (unsigned long)&iobmp_op; ++ mcl++; ++ } ++ ++ (void)HYPERVISOR_multicall(_mcl, mcl - _mcl); ++ ++ /* we're going to use this soon, after a few expensive things */ ++ if (next_p->fpu_counter > 5) ++ prefetch(&next->i387.fxsave); ++ ++ /* ++ * Now maybe handle debug registers ++ */ ++ if (unlikely(task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV || ++ task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT)) ++ __switch_to_xtra(prev_p, next_p); ++ ++ /* ++ * Leave lazy mode, flushing any hypercalls made here. ++ * This must be done before restoring TLS segments so ++ * the GDT and LDT are properly updated, and must be ++ * done before math_state_restore, so the TS bit is up ++ * to date. ++ */ ++ arch_leave_lazy_cpu_mode(); ++ ++ /* If the task has used fpu the last 5 timeslices, just do a full ++ * restore of the math state immediately to avoid the trap; the ++ * chances of needing FPU soon are obviously high now ++ */ ++ if (next_p->fpu_counter > 5) ++ math_state_restore(); ++ ++ /* ++ * Restore %gs if needed (which is common) ++ */ ++ if (prev->gs | next->gs) ++ loadsegment(gs, next->gs); ++ ++ x86_write_percpu(current_task, next_p); ++ ++ return prev_p; ++} ++ ++asmlinkage int sys_fork(struct pt_regs regs) ++{ ++ return do_fork(SIGCHLD, regs.esp, ®s, 0, NULL, NULL); ++} ++ ++asmlinkage int sys_clone(struct pt_regs regs) ++{ ++ unsigned long clone_flags; ++ unsigned long newsp; ++ int __user *parent_tidptr, *child_tidptr; ++ ++ clone_flags = regs.ebx; ++ newsp = regs.ecx; ++ parent_tidptr = (int __user *)regs.edx; ++ child_tidptr = (int __user *)regs.edi; ++ if (!newsp) ++ newsp = regs.esp; ++ return do_fork(clone_flags, newsp, ®s, 0, parent_tidptr, child_tidptr); ++} ++ ++/* ++ * This is trivial, and on the face of it looks like it ++ * could equally well be done in user mode. ++ * ++ * Not so, for quite unobvious reasons - register pressure. ++ * In user mode vfork() cannot have a stack frame, and if ++ * done by calling the "clone()" system call directly, you ++ * do not have enough call-clobbered registers to hold all ++ * the information you need. ++ */ ++asmlinkage int sys_vfork(struct pt_regs regs) ++{ ++ return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, ®s, 0, NULL, NULL); ++} ++ ++/* ++ * sys_execve() executes a new program. ++ */ ++asmlinkage int sys_execve(struct pt_regs regs) ++{ ++ int error; ++ char * filename; ++ ++ filename = getname((char __user *) regs.ebx); ++ error = PTR_ERR(filename); ++ if (IS_ERR(filename)) ++ goto out; ++ error = do_execve(filename, ++ (char __user * __user *) regs.ecx, ++ (char __user * __user *) regs.edx, ++ ®s); ++ if (error == 0) { ++ task_lock(current); ++ current->ptrace &= ~PT_DTRACE; ++ task_unlock(current); ++ /* Make sure we don't return using sysenter.. */ ++ set_thread_flag(TIF_IRET); ++ } ++ putname(filename); ++out: ++ return error; ++} ++ ++#define top_esp (THREAD_SIZE - sizeof(unsigned long)) ++#define top_ebp (THREAD_SIZE - 2*sizeof(unsigned long)) ++ ++unsigned long get_wchan(struct task_struct *p) ++{ ++ unsigned long ebp, esp, eip; ++ unsigned long stack_page; ++ int count = 0; ++ if (!p || p == current || p->state == TASK_RUNNING) ++ return 0; ++ stack_page = (unsigned long)task_stack_page(p); ++ esp = p->thread.esp; ++ if (!stack_page || esp < stack_page || esp > top_esp+stack_page) ++ return 0; ++ /* include/asm-i386/system.h:switch_to() pushes ebp last. */ ++ ebp = *(unsigned long *) esp; ++ do { ++ if (ebp < stack_page || ebp > top_ebp+stack_page) ++ return 0; ++ eip = *(unsigned long *) (ebp+4); ++ if (!in_sched_functions(eip)) ++ return eip; ++ ebp = *(unsigned long *) ebp; ++ } while (count++ < 16); ++ return 0; ++} ++ ++/* ++ * sys_alloc_thread_area: get a yet unused TLS descriptor index. ++ */ ++static int get_free_idx(void) ++{ ++ struct thread_struct *t = ¤t->thread; ++ int idx; ++ ++ for (idx = 0; idx < GDT_ENTRY_TLS_ENTRIES; idx++) ++ if (desc_empty(t->tls_array + idx)) ++ return idx + GDT_ENTRY_TLS_MIN; ++ return -ESRCH; ++} ++ ++/* ++ * Set a given TLS descriptor: ++ */ ++asmlinkage int sys_set_thread_area(struct user_desc __user *u_info) ++{ ++ struct thread_struct *t = ¤t->thread; ++ struct user_desc info; ++ struct desc_struct *desc; ++ int cpu, idx; ++ ++ if (copy_from_user(&info, u_info, sizeof(info))) ++ return -EFAULT; ++ idx = info.entry_number; ++ ++ /* ++ * index -1 means the kernel should try to find and ++ * allocate an empty descriptor: ++ */ ++ if (idx == -1) { ++ idx = get_free_idx(); ++ if (idx < 0) ++ return idx; ++ if (put_user(idx, &u_info->entry_number)) ++ return -EFAULT; ++ } ++ ++ if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX) ++ return -EINVAL; ++ ++ desc = t->tls_array + idx - GDT_ENTRY_TLS_MIN; ++ ++ /* ++ * We must not get preempted while modifying the TLS. ++ */ ++ cpu = get_cpu(); ++ ++ if (LDT_empty(&info)) { ++ desc->a = 0; ++ desc->b = 0; ++ } else { ++ desc->a = LDT_entry_a(&info); ++ desc->b = LDT_entry_b(&info); ++ } ++ load_TLS(t, cpu); ++ ++ put_cpu(); ++ ++ return 0; ++} ++ ++/* ++ * Get the current Thread-Local Storage area: ++ */ ++ ++#define GET_BASE(desc) ( \ ++ (((desc)->a >> 16) & 0x0000ffff) | \ ++ (((desc)->b << 16) & 0x00ff0000) | \ ++ ( (desc)->b & 0xff000000) ) ++ ++#define GET_LIMIT(desc) ( \ ++ ((desc)->a & 0x0ffff) | \ ++ ((desc)->b & 0xf0000) ) ++ ++#define GET_32BIT(desc) (((desc)->b >> 22) & 1) ++#define GET_CONTENTS(desc) (((desc)->b >> 10) & 3) ++#define GET_WRITABLE(desc) (((desc)->b >> 9) & 1) ++#define GET_LIMIT_PAGES(desc) (((desc)->b >> 23) & 1) ++#define GET_PRESENT(desc) (((desc)->b >> 15) & 1) ++#define GET_USEABLE(desc) (((desc)->b >> 20) & 1) ++ ++asmlinkage int sys_get_thread_area(struct user_desc __user *u_info) ++{ ++ struct user_desc info; ++ struct desc_struct *desc; ++ int idx; ++ ++ if (get_user(idx, &u_info->entry_number)) ++ return -EFAULT; ++ if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX) ++ return -EINVAL; ++ ++ memset(&info, 0, sizeof(info)); ++ ++ desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN; ++ ++ info.entry_number = idx; ++ info.base_addr = GET_BASE(desc); ++ info.limit = GET_LIMIT(desc); ++ info.seg_32bit = GET_32BIT(desc); ++ info.contents = GET_CONTENTS(desc); ++ info.read_exec_only = !GET_WRITABLE(desc); ++ info.limit_in_pages = GET_LIMIT_PAGES(desc); ++ info.seg_not_present = !GET_PRESENT(desc); ++ info.useable = GET_USEABLE(desc); ++ ++ if (copy_to_user(u_info, &info, sizeof(info))) ++ return -EFAULT; ++ return 0; ++} ++ ++unsigned long arch_align_stack(unsigned long sp) ++{ ++ if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) ++ sp -= get_random_int() % 8192; ++ return sp & ~0xf; ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/process_64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/process_64-xen.c +--- ./arch/x86/kernel/process_64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/process_64-xen.c 2012-11-13 15:20:17.312568997 +0000 +@@ -0,0 +1,889 @@ ++/* ++ * Copyright (C) 1995 Linus Torvalds ++ * ++ * Pentium III FXSR, SSE support ++ * Gareth Hughes , May 2000 ++ * ++ * X86-64 port ++ * Andi Kleen. ++ * ++ * CPU hotplug support - ashok.raj@intel.com ++ * ++ * Jun Nakajima ++ * Modified for Xen ++ */ ++ ++/* ++ * This file handles the architecture-dependent parts of process handling.. ++ */ ++ ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++asmlinkage extern void ret_from_fork(void); ++ ++unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; ++ ++unsigned long boot_option_idle_override = 0; ++EXPORT_SYMBOL(boot_option_idle_override); ++ ++/* ++ * Powermanagement idle function, if any.. ++ */ ++void (*pm_idle)(void); ++EXPORT_SYMBOL(pm_idle); ++static DEFINE_PER_CPU(unsigned int, cpu_idle_state); ++ ++static ATOMIC_NOTIFIER_HEAD(idle_notifier); ++ ++void idle_notifier_register(struct notifier_block *n) ++{ ++ atomic_notifier_chain_register(&idle_notifier, n); ++} ++EXPORT_SYMBOL_GPL(idle_notifier_register); ++ ++void idle_notifier_unregister(struct notifier_block *n) ++{ ++ atomic_notifier_chain_unregister(&idle_notifier, n); ++} ++EXPORT_SYMBOL(idle_notifier_unregister); ++ ++void enter_idle(void) ++{ ++ write_pda(isidle, 1); ++ atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL); ++} ++ ++static void __exit_idle(void) ++{ ++ if (test_and_clear_bit_pda(0, isidle) == 0) ++ return; ++ atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL); ++} ++ ++/* Called from interrupts to signify idle end */ ++void exit_idle(void) ++{ ++ /* idle loop has pid 0 */ ++ if (current->pid) ++ return; ++ __exit_idle(); ++} ++ ++/* ++ * On SMP it's slightly faster (but much more power-consuming!) ++ * to poll the ->need_resched flag instead of waiting for the ++ * cross-CPU IPI to arrive. Use this option with caution. ++ */ ++static void poll_idle (void) ++{ ++ local_irq_enable(); ++ cpu_relax(); ++} ++ ++static void xen_idle(void) ++{ ++ current_thread_info()->status &= ~TS_POLLING; ++ /* ++ * TS_POLLING-cleared state must be visible before we ++ * test NEED_RESCHED: ++ */ ++ smp_mb(); ++ local_irq_disable(); ++ if (!need_resched()) ++ safe_halt(); ++ else ++ local_irq_enable(); ++ current_thread_info()->status |= TS_POLLING; ++} ++ ++#ifdef CONFIG_HOTPLUG_CPU ++static inline void play_dead(void) ++{ ++ idle_task_exit(); ++ local_irq_disable(); ++ cpu_clear(smp_processor_id(), cpu_initialized); ++ preempt_enable_no_resched(); ++ HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL); ++ cpu_bringup(); ++} ++#else ++static inline void play_dead(void) ++{ ++ BUG(); ++} ++#endif /* CONFIG_HOTPLUG_CPU */ ++ ++/* ++ * The idle thread. There's no useful work to be ++ * done, so just try to conserve power and have a ++ * low exit latency (ie sit in a loop waiting for ++ * somebody to say that they'd like to reschedule) ++ */ ++void cpu_idle (void) ++{ ++ current_thread_info()->status |= TS_POLLING; ++ /* endless idle loop with no priority at all */ ++ while (1) { ++ while (!need_resched()) { ++ void (*idle)(void); ++ ++ if (__get_cpu_var(cpu_idle_state)) ++ __get_cpu_var(cpu_idle_state) = 0; ++ ++ tick_nohz_stop_sched_tick(); ++ ++ rmb(); ++ idle = xen_idle; /* no alternatives */ ++ if (cpu_is_offline(smp_processor_id())) ++ play_dead(); ++ /* ++ * Idle routines should keep interrupts disabled ++ * from here on, until they go to idle. ++ * Otherwise, idle callbacks can misfire. ++ */ ++ local_irq_disable(); ++ enter_idle(); ++ idle(); ++ /* In many cases the interrupt that ended idle ++ has already called exit_idle. But some idle ++ loops can be woken up without interrupt. */ ++ __exit_idle(); ++ } ++ ++ tick_nohz_restart_sched_tick(); ++ preempt_enable_no_resched(); ++ schedule(); ++ preempt_disable(); ++ } ++} ++ ++void cpu_idle_wait(void) ++{ ++ unsigned int cpu, this_cpu = get_cpu(); ++ cpumask_t map, tmp = current->cpus_allowed; ++ ++ set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); ++ put_cpu(); ++ ++ cpus_clear(map); ++ for_each_online_cpu(cpu) { ++ per_cpu(cpu_idle_state, cpu) = 1; ++ cpu_set(cpu, map); ++ } ++ ++ __get_cpu_var(cpu_idle_state) = 0; ++ ++ wmb(); ++ do { ++ ssleep(1); ++ for_each_online_cpu(cpu) { ++ if (cpu_isset(cpu, map) && ++ !per_cpu(cpu_idle_state, cpu)) ++ cpu_clear(cpu, map); ++ } ++ cpus_and(map, map, cpu_online_map); ++ } while (!cpus_empty(map)); ++ ++ set_cpus_allowed(current, tmp); ++} ++EXPORT_SYMBOL_GPL(cpu_idle_wait); ++ ++void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) ++{ ++} ++ ++static int __init idle_setup (char *str) ++{ ++ if (!strcmp(str, "poll")) { ++ printk("using polling idle threads.\n"); ++ pm_idle = poll_idle; ++ } else if (!strcmp(str, "mwait")) ++ force_mwait = 1; ++ else ++ return -1; ++ ++ boot_option_idle_override = 1; ++ return 0; ++} ++early_param("idle", idle_setup); ++ ++/* Prints also some state that isn't saved in the pt_regs */ ++void __show_regs(struct pt_regs * regs) ++{ ++ unsigned long fs, gs, shadowgs; ++ unsigned long d0, d1, d2, d3, d6, d7; ++ unsigned int fsindex,gsindex; ++ unsigned int ds,cs,es; ++ ++ printk("\n"); ++ print_modules(); ++ printk("Pid: %d, comm: %.20s %s %s %.*s\n", ++ current->pid, current->comm, print_tainted(), ++ init_utsname()->release, ++ (int)strcspn(init_utsname()->version, " "), ++ init_utsname()->version); ++ printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip); ++ printk_address(regs->rip); ++ printk("RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->rsp, ++ regs->eflags); ++ printk("RAX: %016lx RBX: %016lx RCX: %016lx\n", ++ regs->rax, regs->rbx, regs->rcx); ++ printk("RDX: %016lx RSI: %016lx RDI: %016lx\n", ++ regs->rdx, regs->rsi, regs->rdi); ++ printk("RBP: %016lx R08: %016lx R09: %016lx\n", ++ regs->rbp, regs->r8, regs->r9); ++ printk("R10: %016lx R11: %016lx R12: %016lx\n", ++ regs->r10, regs->r11, regs->r12); ++ printk("R13: %016lx R14: %016lx R15: %016lx\n", ++ regs->r13, regs->r14, regs->r15); ++ ++ asm("mov %%ds,%0" : "=r" (ds)); ++ asm("mov %%cs,%0" : "=r" (cs)); ++ asm("mov %%es,%0" : "=r" (es)); ++ asm("mov %%fs,%0" : "=r" (fsindex)); ++ asm("mov %%gs,%0" : "=r" (gsindex)); ++ ++ rdmsrl(MSR_FS_BASE, fs); ++ rdmsrl(MSR_GS_BASE, gs); ++ rdmsrl(MSR_KERNEL_GS_BASE, shadowgs); ++ ++ printk("FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n", ++ fs,fsindex,gs,gsindex,shadowgs); ++ printk("CS: %04x DS: %04x ES: %04x\n", cs, ds, es); ++ ++ get_debugreg(d0, 0); ++ get_debugreg(d1, 1); ++ get_debugreg(d2, 2); ++ printk("DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2); ++ get_debugreg(d3, 3); ++ get_debugreg(d6, 6); ++ get_debugreg(d7, 7); ++ printk("DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7); ++} ++ ++void show_regs(struct pt_regs *regs) ++{ ++ printk("CPU %d:", smp_processor_id()); ++ __show_regs(regs); ++ show_trace(NULL, regs, (void *)(regs + 1)); ++} ++ ++/* ++ * Free current thread data structures etc.. ++ */ ++void exit_thread(void) ++{ ++ struct task_struct *me = current; ++ struct thread_struct *t = &me->thread; ++ ++ if (me->thread.io_bitmap_ptr) { ++#ifndef CONFIG_X86_NO_TSS ++ struct tss_struct *tss = &per_cpu(init_tss, get_cpu()); ++#endif ++#ifdef CONFIG_XEN ++ struct physdev_set_iobitmap iobmp_op; ++ memset(&iobmp_op, 0, sizeof(iobmp_op)); ++#endif ++ ++ kfree(t->io_bitmap_ptr); ++ t->io_bitmap_ptr = NULL; ++ clear_thread_flag(TIF_IO_BITMAP); ++ /* ++ * Careful, clear this in the TSS too: ++ */ ++#ifndef CONFIG_X86_NO_TSS ++ memset(tss->io_bitmap, 0xff, t->io_bitmap_max); ++ put_cpu(); ++#endif ++#ifdef CONFIG_XEN ++ HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &iobmp_op); ++#endif ++ t->io_bitmap_max = 0; ++ } ++} ++ ++void load_gs_index(unsigned gs) ++{ ++ HYPERVISOR_set_segment_base(SEGBASE_GS_USER_SEL, gs); ++} ++ ++void flush_thread(void) ++{ ++ struct task_struct *tsk = current; ++ ++ clear_tsk_thread_flag(tsk, TIF_DEBUG); ++ ++ tsk->thread.debugreg0 = 0; ++ tsk->thread.debugreg1 = 0; ++ tsk->thread.debugreg2 = 0; ++ tsk->thread.debugreg3 = 0; ++ tsk->thread.debugreg6 = 0; ++ tsk->thread.debugreg7 = 0; ++ memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); ++ /* ++ * Forget coprocessor state.. ++ */ ++ clear_fpu(tsk); ++ clear_used_math(); ++} ++ ++void release_thread(struct task_struct *dead_task) ++{ ++ if (dead_task->mm) { ++ if (dead_task->mm->context.size) { ++ printk("WARNING: dead process %8s still has LDT? <%p/%d>\n", ++ dead_task->comm, ++ dead_task->mm->context.ldt, ++ dead_task->mm->context.size); ++ BUG(); ++ } ++ } ++} ++ ++static inline void set_32bit_tls(struct task_struct *t, int tls, u32 addr) ++{ ++ struct user_desc ud = { ++ .base_addr = addr, ++ .limit = 0xfffff, ++ .seg_32bit = 1, ++ .limit_in_pages = 1, ++ .useable = 1, ++ }; ++ struct n_desc_struct *desc = (void *)t->thread.tls_array; ++ desc += tls; ++ desc->a = LDT_entry_a(&ud); ++ desc->b = LDT_entry_b(&ud); ++} ++ ++static inline u32 read_32bit_tls(struct task_struct *t, int tls) ++{ ++ struct desc_struct *desc = (void *)t->thread.tls_array; ++ desc += tls; ++ return desc->base0 | ++ (((u32)desc->base1) << 16) | ++ (((u32)desc->base2) << 24); ++} ++ ++/* ++ * This gets called before we allocate a new thread and copy ++ * the current task into it. ++ */ ++void prepare_to_copy(struct task_struct *tsk) ++{ ++ unlazy_fpu(tsk); ++} ++ ++int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, ++ unsigned long unused, ++ struct task_struct * p, struct pt_regs * regs) ++{ ++ int err; ++ struct pt_regs * childregs; ++ struct task_struct *me = current; ++ ++ childregs = ((struct pt_regs *) ++ (THREAD_SIZE + task_stack_page(p))) - 1; ++ *childregs = *regs; ++ ++ childregs->rax = 0; ++ childregs->rsp = rsp; ++ if (rsp == ~0UL) ++ childregs->rsp = (unsigned long)childregs; ++ ++ p->thread.rsp = (unsigned long) childregs; ++ p->thread.rsp0 = (unsigned long) (childregs+1); ++ p->thread.userrsp = me->thread.userrsp; ++ ++ set_tsk_thread_flag(p, TIF_FORK); ++ ++ p->thread.fs = me->thread.fs; ++ p->thread.gs = me->thread.gs; ++ ++ asm("mov %%gs,%0" : "=m" (p->thread.gsindex)); ++ asm("mov %%fs,%0" : "=m" (p->thread.fsindex)); ++ asm("mov %%es,%0" : "=m" (p->thread.es)); ++ asm("mov %%ds,%0" : "=m" (p->thread.ds)); ++ ++ if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) { ++ p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); ++ if (!p->thread.io_bitmap_ptr) { ++ p->thread.io_bitmap_max = 0; ++ return -ENOMEM; ++ } ++ memcpy(p->thread.io_bitmap_ptr, me->thread.io_bitmap_ptr, ++ IO_BITMAP_BYTES); ++ set_tsk_thread_flag(p, TIF_IO_BITMAP); ++ } ++ ++ /* ++ * Set a new TLS for the child thread? ++ */ ++ if (clone_flags & CLONE_SETTLS) { ++#ifdef CONFIG_IA32_EMULATION ++ if (test_thread_flag(TIF_IA32)) ++ err = ia32_child_tls(p, childregs); ++ else ++#endif ++ err = do_arch_prctl(p, ARCH_SET_FS, childregs->r8); ++ if (err) ++ goto out; ++ } ++ p->thread.iopl = current->thread.iopl; ++ ++ err = 0; ++out: ++ if (err && p->thread.io_bitmap_ptr) { ++ kfree(p->thread.io_bitmap_ptr); ++ p->thread.io_bitmap_max = 0; ++ } ++ return err; ++} ++ ++/* ++ * This special macro can be used to load a debugging register ++ */ ++#define loaddebug(thread,r) set_debugreg(thread->debugreg ## r, r) ++ ++static inline void __switch_to_xtra(struct task_struct *prev_p, ++ struct task_struct *next_p) ++{ ++ struct thread_struct *prev, *next; ++ ++ prev = &prev_p->thread, ++ next = &next_p->thread; ++ ++ if (test_tsk_thread_flag(next_p, TIF_DEBUG)) { ++ loaddebug(next, 0); ++ loaddebug(next, 1); ++ loaddebug(next, 2); ++ loaddebug(next, 3); ++ /* no 4 and 5 */ ++ loaddebug(next, 6); ++ loaddebug(next, 7); ++ } ++} ++ ++/* ++ * switch_to(x,y) should switch tasks from x to y. ++ * ++ * This could still be optimized: ++ * - fold all the options into a flag word and test it with a single test. ++ * - could test fs/gs bitsliced ++ * ++ * Kprobes not supported here. Set the probe on schedule instead. ++ */ ++struct task_struct * ++__switch_to(struct task_struct *prev_p, struct task_struct *next_p) ++{ ++ struct thread_struct *prev = &prev_p->thread, ++ *next = &next_p->thread; ++ int cpu = smp_processor_id(); ++#ifndef CONFIG_X86_NO_TSS ++ struct tss_struct *tss = &per_cpu(init_tss, cpu); ++#endif ++ struct physdev_set_iopl iopl_op; ++ struct physdev_set_iobitmap iobmp_op; ++ multicall_entry_t _mcl[8], *mcl = _mcl; ++ ++ /* we're going to use this soon, after a few expensive things */ ++ if (next_p->fpu_counter>5) ++ prefetch(&next->i387.fxsave); ++ ++ /* ++ * This is basically '__unlazy_fpu', except that we queue a ++ * multicall to indicate FPU task switch, rather than ++ * synchronously trapping to Xen. ++ * The AMD workaround requires it to be after DS reload, or ++ * after DS has been cleared, which we do in __prepare_arch_switch. ++ */ ++ if (task_thread_info(prev_p)->status & TS_USEDFPU) { ++ __save_init_fpu(prev_p); /* _not_ save_init_fpu() */ ++ mcl->op = __HYPERVISOR_fpu_taskswitch; ++ mcl->args[0] = 1; ++ mcl++; ++ } else ++ prev_p->fpu_counter = 0; ++ ++ /* ++ * Reload esp0, LDT and the page table pointer: ++ */ ++ mcl->op = __HYPERVISOR_stack_switch; ++ mcl->args[0] = __KERNEL_DS; ++ mcl->args[1] = next->rsp0; ++ mcl++; ++ ++ /* ++ * Load the per-thread Thread-Local Storage descriptor. ++ * This is load_TLS(next, cpu) with multicalls. ++ */ ++#define C(i) do { \ ++ if (unlikely(next->tls_array[i] != prev->tls_array[i])) { \ ++ mcl->op = __HYPERVISOR_update_descriptor; \ ++ mcl->args[0] = virt_to_machine( \ ++ &cpu_gdt(cpu)[GDT_ENTRY_TLS_MIN + i]); \ ++ mcl->args[1] = next->tls_array[i]; \ ++ mcl++; \ ++ } \ ++} while (0) ++ C(0); C(1); C(2); ++#undef C ++ ++ if (unlikely(prev->iopl != next->iopl)) { ++ iopl_op.iopl = (next->iopl == 0) ? 1 : next->iopl; ++ mcl->op = __HYPERVISOR_physdev_op; ++ mcl->args[0] = PHYSDEVOP_set_iopl; ++ mcl->args[1] = (unsigned long)&iopl_op; ++ mcl++; ++ } ++ ++ if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) { ++ set_xen_guest_handle(iobmp_op.bitmap, ++ (char *)next->io_bitmap_ptr); ++ iobmp_op.nr_ports = next->io_bitmap_ptr ? IO_BITMAP_BITS : 0; ++ mcl->op = __HYPERVISOR_physdev_op; ++ mcl->args[0] = PHYSDEVOP_set_iobitmap; ++ mcl->args[1] = (unsigned long)&iobmp_op; ++ mcl++; ++ } ++ ++ (void)HYPERVISOR_multicall(_mcl, mcl - _mcl); ++ /* ++ * Switch DS and ES. ++ * This won't pick up thread selector changes, but I guess that is ok. ++ */ ++ if (unlikely(next->es)) ++ loadsegment(es, next->es); ++ ++ if (unlikely(next->ds)) ++ loadsegment(ds, next->ds); ++ ++ /* ++ * Switch FS and GS. ++ */ ++ if (unlikely(next->fsindex)) ++ loadsegment(fs, next->fsindex); ++ ++ if (next->fs) ++ HYPERVISOR_set_segment_base(SEGBASE_FS, next->fs); ++ ++ if (unlikely(next->gsindex)) ++ load_gs_index(next->gsindex); ++ ++ if (next->gs) ++ HYPERVISOR_set_segment_base(SEGBASE_GS_USER, next->gs); ++ ++ /* ++ * Switch the PDA context. ++ */ ++ prev->userrsp = read_pda(oldrsp); ++ write_pda(oldrsp, next->userrsp); ++ write_pda(pcurrent, next_p); ++ write_pda(kernelstack, ++ (unsigned long)task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET); ++#ifdef CONFIG_CC_STACKPROTECTOR ++ write_pda(stack_canary, next_p->stack_canary); ++ ++ /* ++ * Build time only check to make sure the stack_canary is at ++ * offset 40 in the pda; this is a gcc ABI requirement ++ */ ++ BUILD_BUG_ON(offsetof(struct x8664_pda, stack_canary) != 40); ++#endif ++ ++ /* ++ * Now maybe reload the debug registers ++ */ ++ if (unlikely(task_thread_info(next_p)->flags & _TIF_WORK_CTXSW)) ++ __switch_to_xtra(prev_p, next_p); ++ ++ /* If the task has used fpu the last 5 timeslices, just do a full ++ * restore of the math state immediately to avoid the trap; the ++ * chances of needing FPU soon are obviously high now ++ */ ++ if (next_p->fpu_counter>5) ++ math_state_restore(); ++ return prev_p; ++} ++ ++/* ++ * sys_execve() executes a new program. ++ */ ++asmlinkage ++long sys_execve(char __user *name, char __user * __user *argv, ++ char __user * __user *envp, struct pt_regs regs) ++{ ++ long error; ++ char * filename; ++ ++ filename = getname(name); ++ error = PTR_ERR(filename); ++ if (IS_ERR(filename)) ++ return error; ++ error = do_execve(filename, argv, envp, ®s); ++ if (error == 0) { ++ task_lock(current); ++ current->ptrace &= ~PT_DTRACE; ++ task_unlock(current); ++ } ++ putname(filename); ++ return error; ++} ++ ++void set_personality_64bit(void) ++{ ++ /* inherit personality from parent */ ++ ++ /* Make sure to be in 64bit mode */ ++ clear_thread_flag(TIF_IA32); ++ ++ /* TBD: overwrites user setup. Should have two bits. ++ But 64bit processes have always behaved this way, ++ so it's not too bad. The main problem is just that ++ 32bit childs are affected again. */ ++ current->personality &= ~READ_IMPLIES_EXEC; ++} ++ ++extern int force_personality32; ++ ++void set_personality_ia32(void) ++{ ++ /* inherit personality from parent */ ++ ++ /* Make sure to be in 32bit mode */ ++ set_thread_flag(TIF_IA32); ++ current->personality |= force_personality32; ++ ++ /* Prepare the first "return" to user space */ ++ current_thread_info()->status |= TS_COMPAT; ++} ++ ++asmlinkage long sys_fork(struct pt_regs *regs) ++{ ++ return do_fork(SIGCHLD, regs->rsp, regs, 0, NULL, NULL); ++} ++ ++asmlinkage long ++sys_clone(unsigned long clone_flags, unsigned long newsp, ++ void __user *parent_tid, void __user *child_tid, struct pt_regs *regs) ++{ ++ if (!newsp) ++ newsp = regs->rsp; ++ return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid); ++} ++ ++/* ++ * This is trivial, and on the face of it looks like it ++ * could equally well be done in user mode. ++ * ++ * Not so, for quite unobvious reasons - register pressure. ++ * In user mode vfork() cannot have a stack frame, and if ++ * done by calling the "clone()" system call directly, you ++ * do not have enough call-clobbered registers to hold all ++ * the information you need. ++ */ ++asmlinkage long sys_vfork(struct pt_regs *regs) ++{ ++ return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->rsp, regs, 0, ++ NULL, NULL); ++} ++ ++unsigned long get_wchan(struct task_struct *p) ++{ ++ unsigned long stack; ++ u64 fp,rip; ++ int count = 0; ++ ++ if (!p || p == current || p->state==TASK_RUNNING) ++ return 0; ++ stack = (unsigned long)task_stack_page(p); ++ if (p->thread.rsp < stack || p->thread.rsp > stack+THREAD_SIZE) ++ return 0; ++ fp = *(u64 *)(p->thread.rsp); ++ do { ++ if (fp < (unsigned long)stack || ++ fp > (unsigned long)stack+THREAD_SIZE) ++ return 0; ++ rip = *(u64 *)(fp+8); ++ if (!in_sched_functions(rip)) ++ return rip; ++ fp = *(u64 *)fp; ++ } while (count++ < 16); ++ return 0; ++} ++ ++long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) ++{ ++ int ret = 0; ++ int doit = task == current; ++ int cpu; ++ ++ switch (code) { ++ case ARCH_SET_GS: ++ if (addr >= TASK_SIZE_OF(task)) ++ return -EPERM; ++ cpu = get_cpu(); ++ /* handle small bases via the GDT because that's faster to ++ switch. */ ++ if (addr <= 0xffffffff) { ++ set_32bit_tls(task, GS_TLS, addr); ++ if (doit) { ++ load_TLS(&task->thread, cpu); ++ load_gs_index(GS_TLS_SEL); ++ } ++ task->thread.gsindex = GS_TLS_SEL; ++ task->thread.gs = 0; ++ } else { ++ task->thread.gsindex = 0; ++ task->thread.gs = addr; ++ if (doit) { ++ load_gs_index(0); ++ ret = HYPERVISOR_set_segment_base( ++ SEGBASE_GS_USER, addr); ++ } ++ } ++ put_cpu(); ++ break; ++ case ARCH_SET_FS: ++ /* Not strictly needed for fs, but do it for symmetry ++ with gs */ ++ if (addr >= TASK_SIZE_OF(task)) ++ return -EPERM; ++ cpu = get_cpu(); ++ /* handle small bases via the GDT because that's faster to ++ switch. */ ++ if (addr <= 0xffffffff) { ++ set_32bit_tls(task, FS_TLS, addr); ++ if (doit) { ++ load_TLS(&task->thread, cpu); ++ asm volatile("movl %0,%%fs" :: "r"(FS_TLS_SEL)); ++ } ++ task->thread.fsindex = FS_TLS_SEL; ++ task->thread.fs = 0; ++ } else { ++ task->thread.fsindex = 0; ++ task->thread.fs = addr; ++ if (doit) { ++ /* set the selector to 0 to not confuse ++ __switch_to */ ++ asm volatile("movl %0,%%fs" :: "r" (0)); ++ ret = HYPERVISOR_set_segment_base(SEGBASE_FS, ++ addr); ++ } ++ } ++ put_cpu(); ++ break; ++ case ARCH_GET_FS: { ++ unsigned long base; ++ if (task->thread.fsindex == FS_TLS_SEL) ++ base = read_32bit_tls(task, FS_TLS); ++ else if (doit) ++ rdmsrl(MSR_FS_BASE, base); ++ else ++ base = task->thread.fs; ++ ret = put_user(base, (unsigned long __user *)addr); ++ break; ++ } ++ case ARCH_GET_GS: { ++ unsigned long base; ++ unsigned gsindex; ++ if (task->thread.gsindex == GS_TLS_SEL) ++ base = read_32bit_tls(task, GS_TLS); ++ else if (doit) { ++ asm("movl %%gs,%0" : "=r" (gsindex)); ++ if (gsindex) ++ rdmsrl(MSR_KERNEL_GS_BASE, base); ++ else ++ base = task->thread.gs; ++ } ++ else ++ base = task->thread.gs; ++ ret = put_user(base, (unsigned long __user *)addr); ++ break; ++ } ++ ++ default: ++ ret = -EINVAL; ++ break; ++ } ++ ++ return ret; ++} ++ ++long sys_arch_prctl(int code, unsigned long addr) ++{ ++ return do_arch_prctl(current, code, addr); ++} ++ ++/* ++ * Capture the user space registers if the task is not running (in user space) ++ */ ++int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) ++{ ++ struct pt_regs *pp, ptregs; ++ ++ pp = task_pt_regs(tsk); ++ ++ ptregs = *pp; ++ ptregs.cs &= 0xffff; ++ ptregs.ss &= 0xffff; ++ ++ elf_core_copy_regs(regs, &ptregs); ++ ++ boot_option_idle_override = 1; ++ return 1; ++} ++ ++unsigned long arch_align_stack(unsigned long sp) ++{ ++ if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) ++ sp -= get_random_int() % 8192; ++ return sp & ~0xf; ++} ++ ++#ifndef CONFIG_SMP ++void _restore_vcpu(void) ++{ ++} ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/quirks-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/quirks-xen.c +--- ./arch/x86/kernel/quirks-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/quirks-xen.c 2012-11-13 15:20:17.312568997 +0000 +@@ -0,0 +1,392 @@ ++/* ++ * This file contains work-arounds for x86 and x86_64 platform bugs. ++ */ ++#include ++#include ++ ++#if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_SMP) || defined(CONFIG_XEN)) && defined(CONFIG_PCI) ++ ++static void __devinit quirk_intel_irqbalance(struct pci_dev *dev) ++{ ++ u8 config, rev; ++ u32 word; ++ ++ /* BIOS may enable hardware IRQ balancing for ++ * E7520/E7320/E7525(revision ID 0x9 and below) ++ * based platforms. ++ * Disable SW irqbalance/affinity on those platforms. ++ */ ++ pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev); ++ if (rev > 0x9) ++ return; ++ ++ /* enable access to config space*/ ++ pci_read_config_byte(dev, 0xf4, &config); ++ pci_write_config_byte(dev, 0xf4, config|0x2); ++ ++ /* read xTPR register */ ++ raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, &word); ++ ++ if (!(word & (1 << 13))) { ++ struct xen_platform_op op; ++ printk(KERN_INFO "Intel E7520/7320/7525 detected. " ++ "Disabling irq balancing and affinity\n"); ++ op.cmd = XENPF_platform_quirk; ++ op.u.platform_quirk.quirk_id = QUIRK_NOIRQBALANCING; ++ (void)HYPERVISOR_platform_op(&op); ++ } ++ ++ /* put back the original value for config space*/ ++ if (!(config & 0x2)) ++ pci_write_config_byte(dev, 0xf4, config); ++} ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, ++ quirk_intel_irqbalance); ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, ++ quirk_intel_irqbalance); ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, ++ quirk_intel_irqbalance); ++#endif ++ ++#if defined(CONFIG_HPET_TIMER) ++#include ++ ++unsigned long force_hpet_address; ++ ++static enum { ++ NONE_FORCE_HPET_RESUME, ++ OLD_ICH_FORCE_HPET_RESUME, ++ ICH_FORCE_HPET_RESUME, ++ VT8237_FORCE_HPET_RESUME, ++ NVIDIA_FORCE_HPET_RESUME, ++} force_hpet_resume_type; ++ ++static void __iomem *rcba_base; ++ ++static void ich_force_hpet_resume(void) ++{ ++ u32 val; ++ ++ if (!force_hpet_address) ++ return; ++ ++ if (rcba_base == NULL) ++ BUG(); ++ ++ /* read the Function Disable register, dword mode only */ ++ val = readl(rcba_base + 0x3404); ++ if (!(val & 0x80)) { ++ /* HPET disabled in HPTC. Trying to enable */ ++ writel(val | 0x80, rcba_base + 0x3404); ++ } ++ ++ val = readl(rcba_base + 0x3404); ++ if (!(val & 0x80)) ++ BUG(); ++ else ++ printk(KERN_DEBUG "Force enabled HPET at resume\n"); ++ ++ return; ++} ++ ++static void ich_force_enable_hpet(struct pci_dev *dev) ++{ ++ u32 val; ++ u32 uninitialized_var(rcba); ++ int err = 0; ++ ++ if (hpet_address || force_hpet_address) ++ return; ++ ++ pci_read_config_dword(dev, 0xF0, &rcba); ++ rcba &= 0xFFFFC000; ++ if (rcba == 0) { ++ printk(KERN_DEBUG "RCBA disabled. Cannot force enable HPET\n"); ++ return; ++ } ++ ++ /* use bits 31:14, 16 kB aligned */ ++ rcba_base = ioremap_nocache(rcba, 0x4000); ++ if (rcba_base == NULL) { ++ printk(KERN_DEBUG "ioremap failed. Cannot force enable HPET\n"); ++ return; ++ } ++ ++ /* read the Function Disable register, dword mode only */ ++ val = readl(rcba_base + 0x3404); ++ ++ if (val & 0x80) { ++ /* HPET is enabled in HPTC. Just not reported by BIOS */ ++ val = val & 0x3; ++ force_hpet_address = 0xFED00000 | (val << 12); ++ printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n", ++ force_hpet_address); ++ iounmap(rcba_base); ++ return; ++ } ++ ++ /* HPET disabled in HPTC. Trying to enable */ ++ writel(val | 0x80, rcba_base + 0x3404); ++ ++ val = readl(rcba_base + 0x3404); ++ if (!(val & 0x80)) { ++ err = 1; ++ } else { ++ val = val & 0x3; ++ force_hpet_address = 0xFED00000 | (val << 12); ++ } ++ ++ if (err) { ++ force_hpet_address = 0; ++ iounmap(rcba_base); ++ printk(KERN_DEBUG "Failed to force enable HPET\n"); ++ } else { ++ force_hpet_resume_type = ICH_FORCE_HPET_RESUME; ++ printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n", ++ force_hpet_address); ++ } ++} ++ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0, ++ ich_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, ++ ich_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, ++ ich_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, ++ ich_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, ++ ich_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1, ++ ich_force_enable_hpet); ++ ++ ++static struct pci_dev *cached_dev; ++ ++static void old_ich_force_hpet_resume(void) ++{ ++ u32 val; ++ u32 uninitialized_var(gen_cntl); ++ ++ if (!force_hpet_address || !cached_dev) ++ return; ++ ++ pci_read_config_dword(cached_dev, 0xD0, &gen_cntl); ++ gen_cntl &= (~(0x7 << 15)); ++ gen_cntl |= (0x4 << 15); ++ ++ pci_write_config_dword(cached_dev, 0xD0, gen_cntl); ++ pci_read_config_dword(cached_dev, 0xD0, &gen_cntl); ++ val = gen_cntl >> 15; ++ val &= 0x7; ++ if (val == 0x4) ++ printk(KERN_DEBUG "Force enabled HPET at resume\n"); ++ else ++ BUG(); ++} ++ ++static void old_ich_force_enable_hpet(struct pci_dev *dev) ++{ ++ u32 val; ++ u32 uninitialized_var(gen_cntl); ++ ++ if (hpet_address || force_hpet_address) ++ return; ++ ++ pci_read_config_dword(dev, 0xD0, &gen_cntl); ++ /* ++ * Bit 17 is HPET enable bit. ++ * Bit 16:15 control the HPET base address. ++ */ ++ val = gen_cntl >> 15; ++ val &= 0x7; ++ if (val & 0x4) { ++ val &= 0x3; ++ force_hpet_address = 0xFED00000 | (val << 12); ++ printk(KERN_DEBUG "HPET at base address 0x%lx\n", ++ force_hpet_address); ++ return; ++ } ++ ++ /* ++ * HPET is disabled. Trying enabling at FED00000 and check ++ * whether it sticks ++ */ ++ gen_cntl &= (~(0x7 << 15)); ++ gen_cntl |= (0x4 << 15); ++ pci_write_config_dword(dev, 0xD0, gen_cntl); ++ ++ pci_read_config_dword(dev, 0xD0, &gen_cntl); ++ ++ val = gen_cntl >> 15; ++ val &= 0x7; ++ if (val & 0x4) { ++ /* HPET is enabled in HPTC. Just not reported by BIOS */ ++ val &= 0x3; ++ force_hpet_address = 0xFED00000 | (val << 12); ++ printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n", ++ force_hpet_address); ++ cached_dev = dev; ++ force_hpet_resume_type = OLD_ICH_FORCE_HPET_RESUME; ++ return; ++ } ++ ++ printk(KERN_DEBUG "Failed to force enable HPET\n"); ++} ++ ++/* ++ * Undocumented chipset features. Make sure that the user enforced ++ * this. ++ */ ++static void old_ich_force_enable_hpet_user(struct pci_dev *dev) ++{ ++ if (hpet_force_user) ++ old_ich_force_enable_hpet(dev); ++} ++ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, ++ old_ich_force_enable_hpet_user); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, ++ old_ich_force_enable_hpet_user); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, ++ old_ich_force_enable_hpet_user); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, ++ old_ich_force_enable_hpet_user); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, ++ old_ich_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_12, ++ old_ich_force_enable_hpet); ++ ++ ++static void vt8237_force_hpet_resume(void) ++{ ++ u32 val; ++ ++ if (!force_hpet_address || !cached_dev) ++ return; ++ ++ val = 0xfed00000 | 0x80; ++ pci_write_config_dword(cached_dev, 0x68, val); ++ ++ pci_read_config_dword(cached_dev, 0x68, &val); ++ if (val & 0x80) ++ printk(KERN_DEBUG "Force enabled HPET at resume\n"); ++ else ++ BUG(); ++} ++ ++static void vt8237_force_enable_hpet(struct pci_dev *dev) ++{ ++ u32 uninitialized_var(val); ++ ++ if (!hpet_force_user || hpet_address || force_hpet_address) ++ return; ++ ++ pci_read_config_dword(dev, 0x68, &val); ++ /* ++ * Bit 7 is HPET enable bit. ++ * Bit 31:10 is HPET base address (contrary to what datasheet claims) ++ */ ++ if (val & 0x80) { ++ force_hpet_address = (val & ~0x3ff); ++ printk(KERN_DEBUG "HPET at base address 0x%lx\n", ++ force_hpet_address); ++ return; ++ } ++ ++ /* ++ * HPET is disabled. Trying enabling at FED00000 and check ++ * whether it sticks ++ */ ++ val = 0xfed00000 | 0x80; ++ pci_write_config_dword(dev, 0x68, val); ++ ++ pci_read_config_dword(dev, 0x68, &val); ++ if (val & 0x80) { ++ force_hpet_address = (val & ~0x3ff); ++ printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n", ++ force_hpet_address); ++ cached_dev = dev; ++ force_hpet_resume_type = VT8237_FORCE_HPET_RESUME; ++ return; ++ } ++ ++ printk(KERN_DEBUG "Failed to force enable HPET\n"); ++} ++ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, ++ vt8237_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, ++ vt8237_force_enable_hpet); ++ ++/* ++ * Undocumented chipset feature taken from LinuxBIOS. ++ */ ++static void nvidia_force_hpet_resume(void) ++{ ++ pci_write_config_dword(cached_dev, 0x44, 0xfed00001); ++ printk(KERN_DEBUG "Force enabled HPET at resume\n"); ++} ++ ++static void nvidia_force_enable_hpet(struct pci_dev *dev) ++{ ++ u32 uninitialized_var(val); ++ ++ if (!hpet_force_user || hpet_address || force_hpet_address) ++ return; ++ ++ pci_write_config_dword(dev, 0x44, 0xfed00001); ++ pci_read_config_dword(dev, 0x44, &val); ++ force_hpet_address = val & 0xfffffffe; ++ force_hpet_resume_type = NVIDIA_FORCE_HPET_RESUME; ++ printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n", ++ force_hpet_address); ++ cached_dev = dev; ++ return; ++} ++ ++/* ISA Bridges */ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0050, ++ nvidia_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0051, ++ nvidia_force_enable_hpet); ++ ++/* LPC bridges */ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0360, ++ nvidia_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0361, ++ nvidia_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0362, ++ nvidia_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0363, ++ nvidia_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0364, ++ nvidia_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0365, ++ nvidia_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0366, ++ nvidia_force_enable_hpet); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0367, ++ nvidia_force_enable_hpet); ++ ++void force_hpet_resume(void) ++{ ++ switch (force_hpet_resume_type) { ++ case ICH_FORCE_HPET_RESUME: ++ return ich_force_hpet_resume(); ++ ++ case OLD_ICH_FORCE_HPET_RESUME: ++ return old_ich_force_hpet_resume(); ++ ++ case VT8237_FORCE_HPET_RESUME: ++ return vt8237_force_hpet_resume(); ++ ++ case NVIDIA_FORCE_HPET_RESUME: ++ return nvidia_force_hpet_resume(); ++ ++ default: ++ break; ++ } ++} ++ ++#endif +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/relocate_kernel_32.S debian/binary-custom.d/xen/src/arch/x86/kernel/relocate_kernel_32.S +--- ./arch/x86/kernel/relocate_kernel_32.S 2012-06-12 16:25:11.614312932 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/relocate_kernel_32.S 2012-11-13 15:20:17.312568997 +0000 +@@ -154,14 +154,45 @@ + movl PTR(PA_PGD)(%ebp), %eax + movl %eax, %cr3 + ++ /* setup idt */ ++ movl %edi, %eax ++ addl $(idt_48 - relocate_kernel), %eax ++ lidtl (%eax) ++ ++ /* setup gdt */ ++ movl %edi, %eax ++ addl $(gdt - relocate_kernel), %eax ++ movl %edi, %esi ++ addl $((gdt_48 - relocate_kernel) + 2), %esi ++ movl %eax, (%esi) ++ ++ movl %edi, %eax ++ addl $(gdt_48 - relocate_kernel), %eax ++ lgdtl (%eax) ++ ++ /* setup data segment registers */ ++ mov $(gdt_ds - gdt), %eax ++ mov %eax, %ds ++ mov %eax, %es ++ mov %eax, %fs ++ mov %eax, %gs ++ mov %eax, %ss ++ + /* setup a new stack at the end of the physical control page */ + lea 4096(%edi), %esp + +- /* jump to identity mapped page */ +- movl %edi, %eax +- addl $(identity_mapped - relocate_kernel), %eax +- pushl %eax +- ret ++ /* load new code segment and jump to identity mapped page */ ++ movl %edi, %esi ++ xorl %eax, %eax ++ pushl %eax ++ pushl %esi ++ pushl %eax ++ movl $(gdt_cs - gdt), %eax ++ pushl %eax ++ movl %edi, %eax ++ addl $(identity_mapped - relocate_kernel),%eax ++ pushl %eax ++ iretl + + identity_mapped: + /* store the start address on the stack */ +@@ -250,3 +281,20 @@ + xorl %edi, %edi + xorl %ebp, %ebp + ret ++ ++ .align 16 ++gdt: ++ .quad 0x0000000000000000 /* NULL descriptor */ ++gdt_cs: ++ .quad 0x00cf9a000000ffff /* kernel 4GB code at 0x00000000 */ ++gdt_ds: ++ .quad 0x00cf92000000ffff /* kernel 4GB data at 0x00000000 */ ++gdt_end: ++ ++gdt_48: ++ .word gdt_end - gdt - 1 /* limit */ ++ .long 0 /* base - filled in by code above */ ++ ++idt_48: ++ .word 0 /* limit */ ++ .long 0 /* base */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/relocate_kernel_64.S debian/binary-custom.d/xen/src/arch/x86/kernel/relocate_kernel_64.S +--- ./arch/x86/kernel/relocate_kernel_64.S 2012-06-12 16:25:11.614312932 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/relocate_kernel_64.S 2012-11-13 15:20:17.312568997 +0000 +@@ -159,13 +159,39 @@ + movq PTR(PA_PGD)(%rsi), %r9 + movq %r9, %cr3 + ++ /* setup idt */ ++ movq %r8, %rax ++ addq $(idt_80 - relocate_kernel), %rax ++ lidtq (%rax) ++ ++ /* setup gdt */ ++ movq %r8, %rax ++ addq $(gdt - relocate_kernel), %rax ++ movq %r8, %r9 ++ addq $((gdt_80 - relocate_kernel) + 2), %r9 ++ movq %rax, (%r9) ++ ++ movq %r8, %rax ++ addq $(gdt_80 - relocate_kernel), %rax ++ lgdtq (%rax) ++ ++ /* setup data segment registers */ ++ xorl %eax, %eax ++ movl %eax, %ds ++ movl %eax, %es ++ movl %eax, %fs ++ movl %eax, %gs ++ movl %eax, %ss ++ + /* setup a new stack at the end of the physical control page */ + lea 4096(%r8), %rsp + +- /* jump to identity mapped page */ +- addq $(identity_mapped - relocate_kernel), %r8 +- pushq %r8 +- ret ++ /* load new code segment and jump to identity mapped page */ ++ movq %r8, %rax ++ addq $(identity_mapped - relocate_kernel), %rax ++ pushq $(gdt_cs - gdt) ++ pushq %rax ++ lretq + + identity_mapped: + /* store the start address on the stack */ +@@ -272,5 +298,19 @@ + xorq %r13, %r13 + xorq %r14, %r14 + xorq %r15, %r15 +- + ret ++ ++ .align 16 ++gdt: ++ .quad 0x0000000000000000 /* NULL descriptor */ ++gdt_cs: ++ .quad 0x00af9a000000ffff ++gdt_end: ++ ++gdt_80: ++ .word gdt_end - gdt - 1 /* limit */ ++ .quad 0 /* base - filled in by code above */ ++ ++idt_80: ++ .word 0 /* limit */ ++ .quad 0 /* base */ +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/setup64-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/setup64-xen.c +--- ./arch/x86/kernel/setup64-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/setup64-xen.c 2012-11-13 15:20:17.316568996 +0000 +@@ -0,0 +1,375 @@ ++/* ++ * X86-64 specific CPU setup. ++ * Copyright (C) 1995 Linus Torvalds ++ * Copyright 2001, 2002, 2003 SuSE Labs / Andi Kleen. ++ * See setup.c for older changelog. ++ * ++ * Jun Nakajima ++ * Modified for Xen ++ * ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef CONFIG_XEN ++#include ++#endif ++ ++struct boot_params __initdata boot_params; ++ ++cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE; ++ ++struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly; ++EXPORT_SYMBOL(_cpu_pda); ++struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned; ++ ++#ifndef CONFIG_X86_NO_IDT ++struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table }; ++#endif ++ ++char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned"))); ++ ++unsigned long __supported_pte_mask __read_mostly = ~0UL; ++EXPORT_SYMBOL(__supported_pte_mask); ++static int do_not_nx __cpuinitdata = 0; ++ ++/* noexec=on|off ++Control non executable mappings for 64bit processes. ++ ++on Enable(default) ++off Disable ++*/ ++static int __init nonx_setup(char *str) ++{ ++ if (!str) ++ return -EINVAL; ++ if (!strncmp(str, "on", 2)) { ++ __supported_pte_mask |= _PAGE_NX; ++ do_not_nx = 0; ++ } else if (!strncmp(str, "off", 3)) { ++ do_not_nx = 1; ++ __supported_pte_mask &= ~_PAGE_NX; ++ } ++ return 0; ++} ++early_param("noexec", nonx_setup); ++ ++int force_personality32 = 0; ++ ++/* noexec32=on|off ++Control non executable heap for 32bit processes. ++To control the stack too use noexec=off ++ ++on PROT_READ does not imply PROT_EXEC for 32bit processes ++off PROT_READ implies PROT_EXEC (default) ++*/ ++static int __init nonx32_setup(char *str) ++{ ++ if (!strcmp(str, "on")) ++ force_personality32 &= ~READ_IMPLIES_EXEC; ++ else if (!strcmp(str, "off")) ++ force_personality32 |= READ_IMPLIES_EXEC; ++ return 1; ++} ++__setup("noexec32=", nonx32_setup); ++ ++/* ++ * Great future plan: ++ * Declare PDA itself and support (irqstack,tss,pgd) as per cpu data. ++ * Always point %gs to its beginning ++ */ ++void __init setup_per_cpu_areas(void) ++{ ++ int i; ++ unsigned long size; ++ ++#ifdef CONFIG_HOTPLUG_CPU ++ prefill_possible_map(); ++#endif ++ ++ /* Copy section for each CPU (we discard the original) */ ++ size = PERCPU_ENOUGH_ROOM; ++ ++ printk(KERN_INFO "PERCPU: Allocating %lu bytes of per cpu data\n", size); ++ for_each_cpu_mask (i, cpu_possible_map) { ++ char *ptr; ++ ++ if (!NODE_DATA(cpu_to_node(i))) { ++ printk("cpu with no node %d, num_online_nodes %d\n", ++ i, num_online_nodes()); ++ ptr = alloc_bootmem_pages(size); ++ } else { ++ ptr = alloc_bootmem_pages_node(NODE_DATA(cpu_to_node(i)), size); ++ } ++ if (!ptr) ++ panic("Cannot allocate cpu data for CPU %d\n", i); ++ cpu_pda(i)->data_offset = ptr - __per_cpu_start; ++ memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); ++ } ++} ++ ++#ifdef CONFIG_XEN ++static void __init_refok switch_pt(int cpu) ++{ ++ if (cpu == 0) ++ xen_init_pt(); ++ xen_pt_switch(__pa_symbol(init_level4_pgt)); ++ xen_new_user_pt(__pa_symbol(__user_pgd(init_level4_pgt))); ++} ++#define switch_pt() switch_pt(cpu) ++ ++static void __cpuinit cpu_gdt_init(const struct desc_ptr *gdt_descr) ++{ ++ unsigned long frames[16]; ++ unsigned long va; ++ int f; ++ ++ for (va = gdt_descr->address, f = 0; ++ va < gdt_descr->address + gdt_descr->size; ++ va += PAGE_SIZE, f++) { ++ frames[f] = virt_to_mfn(va); ++ make_page_readonly( ++ (void *)va, XENFEAT_writable_descriptor_tables); ++ } ++ if (HYPERVISOR_set_gdt(frames, (gdt_descr->size + 1) / ++ sizeof (struct desc_struct))) ++ BUG(); ++} ++#else ++static void switch_pt(void) ++{ ++ asm volatile("movq %0,%%cr3" :: "r" (__pa_symbol(&init_level4_pgt))); ++} ++ ++static void __cpuinit cpu_gdt_init(const struct desc_ptr *gdt_descr) ++{ ++ load_gdt(gdt_descr); ++ load_idt(idt_descr); ++} ++#endif ++ ++void pda_init(int cpu) ++{ ++ struct x8664_pda *pda = cpu_pda(cpu); ++ ++ /* Setup up data that may be needed in __get_free_pages early */ ++ asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0)); ++#ifndef CONFIG_XEN ++ /* Memory clobbers used to order PDA accessed */ ++ mb(); ++ wrmsrl(MSR_GS_BASE, pda); ++ mb(); ++#else ++ HYPERVISOR_set_segment_base(SEGBASE_GS_KERNEL, (unsigned long)pda); ++#endif ++ pda->cpunumber = cpu; ++ pda->irqcount = -1; ++ pda->kernelstack = ++ (unsigned long)stack_thread_info() - PDA_STACKOFFSET + THREAD_SIZE; ++ pda->active_mm = &init_mm; ++ pda->mmu_state = 0; ++ ++ if (cpu == 0) { ++ /* others are initialized in smpboot.c */ ++ pda->pcurrent = &init_task; ++ pda->irqstackptr = boot_cpu_stack; ++ } else { ++ pda->irqstackptr = (char *) ++ __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER); ++ if (!pda->irqstackptr) ++ panic("cannot allocate irqstack for cpu %d", cpu); ++ } ++ ++ switch_pt(); ++ ++ pda->irqstackptr += IRQSTACKSIZE-64; ++} ++ ++#ifndef CONFIG_X86_NO_TSS ++char boot_exception_stacks[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + DEBUG_STKSZ] ++__attribute__((section(".bss.page_aligned"))); ++#endif ++ ++extern asmlinkage void ignore_sysret(void); ++ ++/* May not be marked __init: used by software suspend */ ++void syscall_init(void) ++{ ++#ifndef CONFIG_XEN ++ /* ++ * LSTAR and STAR live in a bit strange symbiosis. ++ * They both write to the same internal register. STAR allows to set CS/DS ++ * but only a 32bit target. LSTAR sets the 64bit rip. ++ */ ++ wrmsrl(MSR_STAR, ((u64)__USER32_CS)<<48 | ((u64)__KERNEL_CS)<<32); ++ wrmsrl(MSR_LSTAR, system_call); ++ wrmsrl(MSR_CSTAR, ignore_sysret); ++ ++ /* Flags to clear on syscall */ ++ wrmsrl(MSR_SYSCALL_MASK, EF_TF|EF_DF|EF_IE|0x3000); ++#endif ++#ifdef CONFIG_IA32_EMULATION ++ syscall32_cpu_init (); ++#else ++ { ++ static struct callback_register cstar = { ++ .type = CALLBACKTYPE_syscall32, ++ .address = (unsigned long)ignore_sysret ++ }; ++ if (HYPERVISOR_callback_op(CALLBACKOP_register, &cstar)) ++ printk(KERN_WARN "Unable to register CSTAR callback\n"); ++ } ++#endif ++} ++ ++void __cpuinit check_efer(void) ++{ ++ unsigned long efer; ++ ++ rdmsrl(MSR_EFER, efer); ++ if (!(efer & EFER_NX) || do_not_nx) { ++ __supported_pte_mask &= ~_PAGE_NX; ++ } ++} ++ ++unsigned long kernel_eflags; ++ ++#ifndef CONFIG_X86_NO_TSS ++/* ++ * Copies of the original ist values from the tss are only accessed during ++ * debugging, no special alignment required. ++ */ ++DEFINE_PER_CPU(struct orig_ist, orig_ist); ++#endif ++ ++/* ++ * cpu_init() initializes state that is per-CPU. Some data is already ++ * initialized (naturally) in the bootstrap process, such as the GDT ++ * and IDT. We reload them nevertheless, this function acts as a ++ * 'CPU state barrier', nothing should get across. ++ * A lot of state is already set up in PDA init. ++ */ ++void __cpuinit cpu_init (void) ++{ ++ int cpu = stack_smp_processor_id(); ++#ifndef CONFIG_X86_NO_TSS ++ struct tss_struct *t = &per_cpu(init_tss, cpu); ++ struct orig_ist *orig_ist = &per_cpu(orig_ist, cpu); ++ unsigned long v; ++ char *estacks = NULL; ++ unsigned i; ++#endif ++ struct task_struct *me; ++ ++ /* CPU 0 is initialised in head64.c */ ++ if (cpu != 0) { ++ pda_init(cpu); ++ } ++#ifndef CONFIG_X86_NO_TSS ++ else ++ estacks = boot_exception_stacks; ++#endif ++ ++ me = current; ++ ++ if (cpu_test_and_set(cpu, cpu_initialized)) ++ panic("CPU#%d already initialized!\n", cpu); ++ ++ printk("Initializing CPU#%d\n", cpu); ++ ++ clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); ++ ++ /* ++ * Initialize the per-CPU GDT with the boot GDT, ++ * and set up the GDT descriptor: ++ */ ++#ifndef CONFIG_XEN ++ if (cpu) ++ memcpy(cpu_gdt(cpu), cpu_gdt_table, GDT_SIZE); ++#endif ++ ++ cpu_gdt_descr[cpu].size = GDT_SIZE; ++ cpu_gdt_init(&cpu_gdt_descr[cpu]); ++ ++ memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8); ++ syscall_init(); ++ ++ wrmsrl(MSR_FS_BASE, 0); ++ wrmsrl(MSR_KERNEL_GS_BASE, 0); ++ barrier(); ++ ++ check_efer(); ++ ++#ifndef CONFIG_X86_NO_TSS ++ /* ++ * set up and load the per-CPU TSS ++ */ ++ for (v = 0; v < N_EXCEPTION_STACKS; v++) { ++ static const unsigned int order[N_EXCEPTION_STACKS] = { ++ [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER, ++ [DEBUG_STACK - 1] = DEBUG_STACK_ORDER ++ }; ++ if (cpu) { ++ estacks = (char *)__get_free_pages(GFP_ATOMIC, order[v]); ++ if (!estacks) ++ panic("Cannot allocate exception stack %ld %d\n", ++ v, cpu); ++ } ++ estacks += PAGE_SIZE << order[v]; ++ orig_ist->ist[v] = t->ist[v] = (unsigned long)estacks; ++ } ++ ++ t->io_bitmap_base = offsetof(struct tss_struct, io_bitmap); ++ /* ++ * <= is required because the CPU will access up to ++ * 8 bits beyond the end of the IO permission bitmap. ++ */ ++ for (i = 0; i <= IO_BITMAP_LONGS; i++) ++ t->io_bitmap[i] = ~0UL; ++#endif ++ ++ atomic_inc(&init_mm.mm_count); ++ me->active_mm = &init_mm; ++ if (me->mm) ++ BUG(); ++ enter_lazy_tlb(&init_mm, me); ++ ++#ifndef CONFIG_X86_NO_TSS ++ set_tss_desc(cpu, t); ++#endif ++#ifndef CONFIG_XEN ++ load_TR_desc(); ++#endif ++ load_LDT(&init_mm.context); ++ ++ /* ++ * Clear all 6 debug registers: ++ */ ++ ++ set_debugreg(0UL, 0); ++ set_debugreg(0UL, 1); ++ set_debugreg(0UL, 2); ++ set_debugreg(0UL, 3); ++ set_debugreg(0UL, 6); ++ set_debugreg(0UL, 7); ++ ++ fpu_init(); ++ ++ raw_local_save_flags(kernel_eflags); ++} +diff -r -u --new-file '--exclude=.git' '--exclude=debian' '--exclude=.gitignore' '--from-file=.' ./arch/x86/kernel/setup_32-xen.c debian/binary-custom.d/xen/src/arch/x86/kernel/setup_32-xen.c +--- ./arch/x86/kernel/setup_32-xen.c 1970-01-01 01:00:00.000000000 +0100 ++++ debian/binary-custom.d/xen/src/arch/x86/kernel/setup_32-xen.c 2012-11-13 15:20:17.316568996 +0000 +@@ -0,0 +1,882 @@ ++/* ++ * Copyright (C) 1995 Linus Torvalds ++ * ++ * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 ++ * ++ * Memory region support ++ * David Parsons , July-August 1999 ++ * ++ * Added E820 sanitization routine (removes overlapping memory regions); ++ * Brian Moyle , February 2001 ++ * ++ * Moved CPU detection code to cpu/${cpu}.c ++ * Patrick Mochel , March 2002 ++ * ++ * Provisions for empty E820 memory regions (reported by certain BIOSes). ++ * Alex Achenbach , December 2002. ++ * ++ */ ++ ++/* ++ * This file handles the architecture-dependent parts of initialization ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include