]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoMerge remote-tracking branch 'selinux/master'
Stephen Rothwell [Wed, 20 Mar 2013 01:53:48 +0000 (12:53 +1100)]
Merge remote-tracking branch 'selinux/master'

11 years agoMerge remote-tracking branch 'security/next'
Stephen Rothwell [Wed, 20 Mar 2013 01:52:20 +0000 (12:52 +1100)]
Merge remote-tracking branch 'security/next'

11 years agoMerge remote-tracking branch 'regulator/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:50:48 +0000 (12:50 +1100)]
Merge remote-tracking branch 'regulator/for-next'

11 years agoMerge remote-tracking branch 'battery/master'
Stephen Rothwell [Wed, 20 Mar 2013 01:49:10 +0000 (12:49 +1100)]
Merge remote-tracking branch 'battery/master'

11 years agoMerge remote-tracking branch 'md/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:47:35 +0000 (12:47 +1100)]
Merge remote-tracking branch 'md/for-next'

11 years agoMerge remote-tracking branch 'slab/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:40:23 +0000 (12:40 +1100)]
Merge remote-tracking branch 'slab/for-next'

11 years agoMerge remote-tracking branch 'kgdb/kgdb-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:40:20 +0000 (12:40 +1100)]
Merge remote-tracking branch 'kgdb/kgdb-next'

11 years agoMerge remote-tracking branch 'mmc/mmc-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:38:51 +0000 (12:38 +1100)]
Merge remote-tracking branch 'mmc/mmc-next'

11 years agoMerge branch 'device-mapper/master'
Stephen Rothwell [Wed, 20 Mar 2013 01:37:10 +0000 (12:37 +1100)]
Merge branch 'device-mapper/master'

11 years agoMerge remote-tracking branch 'block/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:37:06 +0000 (12:37 +1100)]
Merge remote-tracking branch 'block/for-next'

11 years agoMerge remote-tracking branch 'cgroup/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:32:49 +0000 (12:32 +1100)]
Merge remote-tracking branch 'cgroup/for-next'

Conflicts:
include/linux/res_counter.h

11 years agoMerge remote-tracking branch 'input/next'
Stephen Rothwell [Wed, 20 Mar 2013 01:25:50 +0000 (12:25 +1100)]
Merge remote-tracking branch 'input/next'

11 years agoMerge remote-tracking branch 'virtio/virtio-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:24:21 +0000 (12:24 +1100)]
Merge remote-tracking branch 'virtio/virtio-next'

11 years agoMerge remote-tracking branch 'pekey/devel-pekey'
Stephen Rothwell [Wed, 20 Mar 2013 01:17:25 +0000 (12:17 +1100)]
Merge remote-tracking branch 'pekey/devel-pekey'

11 years agoMerge remote-tracking branch 'modules/modules-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:09:58 +0000 (12:09 +1100)]
Merge remote-tracking branch 'modules/modules-next'

11 years agoMerge remote-tracking branch 'sound-asoc/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:08:25 +0000 (12:08 +1100)]
Merge remote-tracking branch 'sound-asoc/for-next'

11 years agoMerge remote-tracking branch 'sound/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 01:06:41 +0000 (12:06 +1100)]
Merge remote-tracking branch 'sound/for-next'

11 years agoMerge remote-tracking branch 'drm-intel/drm-intel-next-queued'
Stephen Rothwell [Wed, 20 Mar 2013 00:59:20 +0000 (11:59 +1100)]
Merge remote-tracking branch 'drm-intel/drm-intel-next-queued'

11 years agoMerge remote-tracking branch 'crypto/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:57:47 +0000 (11:57 +1100)]
Merge remote-tracking branch 'crypto/master'

11 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:56:16 +0000 (11:56 +1100)]
Merge remote-tracking branch 'l2-mtd/master'

11 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:54:42 +0000 (11:54 +1100)]
Merge remote-tracking branch 'bluetooth/master'

11 years agoMerge remote-tracking branch 'wireless-next/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:50:12 +0000 (11:50 +1100)]
Merge remote-tracking branch 'wireless-next/master'

11 years agoMerge remote-tracking branch 'ipsec-next/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:46:24 +0000 (11:46 +1100)]
Merge remote-tracking branch 'ipsec-next/master'

11 years agoMerge remote-tracking branch 'net-next/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:42:21 +0000 (11:42 +1100)]
Merge remote-tracking branch 'net-next/master'

11 years agoMerge remote-tracking branch 'dmaengine/next'
Stephen Rothwell [Wed, 20 Mar 2013 00:42:15 +0000 (11:42 +1100)]
Merge remote-tracking branch 'dmaengine/next'

Conflicts:
drivers/dma/ioat/dma_v3.c

11 years agoMerge remote-tracking branch 'slave-dma/next'
Stephen Rothwell [Wed, 20 Mar 2013 00:40:44 +0000 (11:40 +1100)]
Merge remote-tracking branch 'slave-dma/next'

11 years agoMerge remote-tracking branch 'target-updates/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:39:05 +0000 (11:39 +1100)]
Merge remote-tracking branch 'target-updates/for-next'

11 years agoMerge remote-tracking branch 'thermal/next'
Stephen Rothwell [Wed, 20 Mar 2013 00:37:22 +0000 (11:37 +1100)]
Merge remote-tracking branch 'thermal/next'

11 years agoMerge remote-tracking branch 'idle/next'
Stephen Rothwell [Wed, 20 Mar 2013 00:35:45 +0000 (11:35 +1100)]
Merge remote-tracking branch 'idle/next'

11 years agoMerge remote-tracking branch 'pm/linux-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:33:56 +0000 (11:33 +1100)]
Merge remote-tracking branch 'pm/linux-next'

11 years agoMerge remote-tracking branch 'pstore/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:32:28 +0000 (11:32 +1100)]
Merge remote-tracking branch 'pstore/master'

11 years agoMerge remote-tracking branch 'libata/NEXT'
Stephen Rothwell [Wed, 20 Mar 2013 00:30:48 +0000 (11:30 +1100)]
Merge remote-tracking branch 'libata/NEXT'

11 years agoMerge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:30:38 +0000 (11:30 +1100)]
Merge remote-tracking branch 'kbuild/for-next'

11 years agoMerge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:28:54 +0000 (11:28 +1100)]
Merge remote-tracking branch 'v4l-dvb/master'

11 years agoMerge remote-tracking branch 'hwmon-staging/hwmon-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:27:29 +0000 (11:27 +1100)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'

11 years agoMerge branch 'jdelvare-hwmon/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:26:05 +0000 (11:26 +1100)]
Merge branch 'jdelvare-hwmon/master'

11 years agoMerge remote-tracking branch 'i2c/i2c/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:24:42 +0000 (11:24 +1100)]
Merge remote-tracking branch 'i2c/i2c/for-next'

11 years agoMerge remote-tracking branch 'hid/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:23:13 +0000 (11:23 +1100)]
Merge remote-tracking branch 'hid/for-next'

11 years agoMerge remote-tracking branch 'xfs/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:21:42 +0000 (11:21 +1100)]
Merge remote-tracking branch 'xfs/for-next'

11 years agoMerge remote-tracking branch 'ubifs/linux-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:20:18 +0000 (11:20 +1100)]
Merge remote-tracking branch 'ubifs/linux-next'

11 years agoMerge remote-tracking branch 'ocfs2/linux-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:18:27 +0000 (11:18 +1100)]
Merge remote-tracking branch 'ocfs2/linux-next'

11 years agoMerge remote-tracking branch 'nfs/linux-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:17:02 +0000 (11:17 +1100)]
Merge remote-tracking branch 'nfs/linux-next'

11 years agoMerge remote-tracking branch 'logfs/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:15:22 +0000 (11:15 +1100)]
Merge remote-tracking branch 'logfs/master'

11 years agoMerge remote-tracking branch 'jfs/jfs-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:13:57 +0000 (11:13 +1100)]
Merge remote-tracking branch 'jfs/jfs-next'

11 years agoMerge remote-tracking branch 'gfs2/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:12:33 +0000 (11:12 +1100)]
Merge remote-tracking branch 'gfs2/master'

11 years agoMerge remote-tracking branch 'f2fs/dev'
Stephen Rothwell [Wed, 20 Mar 2013 00:11:10 +0000 (11:11 +1100)]
Merge remote-tracking branch 'f2fs/dev'

11 years agoMerge remote-tracking branch 'ext4/dev'
Stephen Rothwell [Wed, 20 Mar 2013 00:09:43 +0000 (11:09 +1100)]
Merge remote-tracking branch 'ext4/dev'

11 years agoMerge remote-tracking branch 'cifs/for-next'
Stephen Rothwell [Wed, 20 Mar 2013 00:08:17 +0000 (11:08 +1100)]
Merge remote-tracking branch 'cifs/for-next'

11 years agoMerge remote-tracking branch 'btrfs/next'
Stephen Rothwell [Wed, 20 Mar 2013 00:08:15 +0000 (11:08 +1100)]
Merge remote-tracking branch 'btrfs/next'

11 years agoMerge remote-tracking branch 'tile/master'
Stephen Rothwell [Wed, 20 Mar 2013 00:06:49 +0000 (11:06 +1100)]
Merge remote-tracking branch 'tile/master'

11 years agoMerge remote-tracking branch 'sh/sh-latest'
Stephen Rothwell [Wed, 20 Mar 2013 00:05:26 +0000 (11:05 +1100)]
Merge remote-tracking branch 'sh/sh-latest'

11 years agoMerge remote-tracking branch 's390/features'
Stephen Rothwell [Wed, 20 Mar 2013 00:04:03 +0000 (11:04 +1100)]
Merge remote-tracking branch 's390/features'

11 years agoMerge remote-tracking branch 'galak/next'
Stephen Rothwell [Wed, 20 Mar 2013 00:01:33 +0000 (11:01 +1100)]
Merge remote-tracking branch 'galak/next'

11 years agoMerge remote-tracking branch 'mpc5xxx/next'
Stephen Rothwell [Wed, 20 Mar 2013 00:00:10 +0000 (11:00 +1100)]
Merge remote-tracking branch 'mpc5xxx/next'

11 years agoMerge remote-tracking branch 'mips/mips-for-linux-next'
Stephen Rothwell [Tue, 19 Mar 2013 23:53:17 +0000 (10:53 +1100)]
Merge remote-tracking branch 'mips/mips-for-linux-next'

11 years agoMerge remote-tracking branch 'microblaze/next'
Stephen Rothwell [Tue, 19 Mar 2013 23:51:55 +0000 (10:51 +1100)]
Merge remote-tracking branch 'microblaze/next'

11 years agoMerge remote-tracking branch 'metag/for-next'
Stephen Rothwell [Tue, 19 Mar 2013 23:50:33 +0000 (10:50 +1100)]
Merge remote-tracking branch 'metag/for-next'

11 years agoMerge remote-tracking branch 'ia64/next'
Stephen Rothwell [Tue, 19 Mar 2013 23:49:09 +0000 (10:49 +1100)]
Merge remote-tracking branch 'ia64/next'

11 years agoMerge remote-tracking branch 'xilinx/arm-next'
Stephen Rothwell [Tue, 19 Mar 2013 23:49:03 +0000 (10:49 +1100)]
Merge remote-tracking branch 'xilinx/arm-next'

Conflicts:
arch/arm/mach-zynq/common.c

11 years agoMerge remote-tracking branch 'arm/for-next'
Stephen Rothwell [Tue, 19 Mar 2013 23:47:37 +0000 (10:47 +1100)]
Merge remote-tracking branch 'arm/for-next'

11 years agoMerge remote-tracking branch 'arc/for-next'
Stephen Rothwell [Tue, 19 Mar 2013 23:46:15 +0000 (10:46 +1100)]
Merge remote-tracking branch 'arc/for-next'

11 years agoMerge remote-tracking branch 'vfio-fixes/for-linus'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:47 +0000 (10:44 +1100)]
Merge remote-tracking branch 'vfio-fixes/for-linus'

11 years agoMerge remote-tracking branch 'rr-fixes/fixes'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:46 +0000 (10:44 +1100)]
Merge remote-tracking branch 'rr-fixes/fixes'

11 years agoMerge remote-tracking branch 'dwmw2/master'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:38 +0000 (10:44 +1100)]
Merge remote-tracking branch 'dwmw2/master'

11 years agoMerge remote-tracking branch 'ide/master'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:38 +0000 (10:44 +1100)]
Merge remote-tracking branch 'ide/master'

11 years agoMerge remote-tracking branch 'char-misc.current/char-misc-linus'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:33 +0000 (10:44 +1100)]
Merge remote-tracking branch 'char-misc.current/char-misc-linus'

11 years agoMerge remote-tracking branch 'staging.current/staging-linus'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:32 +0000 (10:44 +1100)]
Merge remote-tracking branch 'staging.current/staging-linus'

11 years agoMerge remote-tracking branch 'usb.current/usb-linus'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:31 +0000 (10:44 +1100)]
Merge remote-tracking branch 'usb.current/usb-linus'

11 years agoMerge remote-tracking branch 'tty.current/tty-linus'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:31 +0000 (10:44 +1100)]
Merge remote-tracking branch 'tty.current/tty-linus'

11 years agoMerge remote-tracking branch 'wireless/master'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:30 +0000 (10:44 +1100)]
Merge remote-tracking branch 'wireless/master'

11 years agoMerge remote-tracking branch 'sound-current/for-linus'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:29 +0000 (10:44 +1100)]
Merge remote-tracking branch 'sound-current/for-linus'

11 years agoMerge remote-tracking branch 'ipsec/master'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:27 +0000 (10:44 +1100)]
Merge remote-tracking branch 'ipsec/master'

11 years agoMerge remote-tracking branch 'arc-current/for-curr'
Stephen Rothwell [Tue, 19 Mar 2013 23:44:25 +0000 (10:44 +1100)]
Merge remote-tracking branch 'arc-current/for-curr'

11 years agoCorrect the documented requirement on the return code from dm cache policy
Alasdair G Kergon [Tue, 19 Mar 2013 23:32:57 +0000 (10:32 +1100)]
Correct the documented requirement on the return code from dm cache policy
lookup functions stated in the policy module header file.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agoWhen reading the dm cache metadata from disk, ignore the policy hints
Mike Snitzer [Tue, 19 Mar 2013 23:32:57 +0000 (10:32 +1100)]
When reading the dm cache metadata from disk, ignore the policy hints
unless they were generated by the same major version number of the same
policy module.

The hints are considered to be private data belonging to the specific
module that generated them and there is no requirement for them to make
sense to different versions of the policy that generated them.
Policy modules are all required to work fine if no previous hints are
supplied (or if existing hints are lost).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agoSeparate dm cache policy version string into 3 unsigned numbers
Mike Snitzer [Tue, 19 Mar 2013 23:32:57 +0000 (10:32 +1100)]
Separate dm cache policy version string into 3 unsigned numbers
corresponding to major, minor and patchlevel and store them at the end
of the on-disk metadata so we know which version of the policy generated
the hints in case a future version wants to use them differently.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodrm/i915: Introduce GEN7_FEATURES for device info
Ben Widawsky [Fri, 15 Mar 2013 18:17:54 +0000 (11:17 -0700)]
drm/i915: Introduce GEN7_FEATURES for device info

Recommended by Chris.

v2: Make it GEN7_FEATURES, and use it for vlv and hsw also (Ben)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agoChange "select DMAR" to "select INTEL_IOMMU"
Paul Bolle [Tue, 5 Mar 2013 13:59:23 +0000 (14:59 +0100)]
Change "select DMAR" to "select INTEL_IOMMU"

Commit d3f138106b ("iommu: Rename the DMAR and INTR_REMAP config
options") changed all references to DMAR in Kconfig files to INTEL_IOMMU
(and, likewise, changed the references to CONFIG_DMAR everywhere else
to CONFIG_INTEL_IOMMU). That commit missed one "select DMAR" statement
in ia64's Kconfig file. Change that one too.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Tony Luck <tony.luck@intel.com>
11 years agoWrong asm register contraints in the kvm implementation
Stephan Schreiber [Tue, 19 Mar 2013 22:27:12 +0000 (15:27 -0700)]
Wrong asm register contraints in the kvm implementation

The Linux Kernel contains some inline assembly source code which has
wrong asm register constraints in arch/ia64/kvm/vtlb.c.

I observed this on Kernel 3.2.35 but it is also true on the most
recent Kernel 3.9-rc1.

File arch/ia64/kvm/vtlb.c:

u64 guest_vhpt_lookup(u64 iha, u64 *pte)
{
u64 ret;
struct thash_data *data;

data = __vtr_lookup(current_vcpu, iha, D_TLB);
if (data != NULL)
thash_vhpt_insert(current_vcpu, data->page_flags,
data->itir, iha, D_TLB);

asm volatile (
"rsm psr.ic|psr.i;;"
"srlz.d;;"
"ld8.s r9=[%1];;"
"tnat.nz p6,p7=r9;;"
"(p6) mov %0=1;"
"(p6) mov r9=r0;"
"(p7) extr.u r9=r9,0,53;;"
"(p7) mov %0=r0;"
"(p7) st8 [%2]=r9;;"
"ssm psr.ic;;"
"srlz.d;;"
"ssm psr.i;;"
"srlz.d;;"
: "=r"(ret) : "r"(iha), "r"(pte):"memory");

return ret;
}

The list of output registers is
: "=r"(ret) : "r"(iha), "r"(pte):"memory");
The constraint "=r" means that the GCC has to maintain that these vars
are in registers and contain valid info when the program flow leaves
the assembly block (output registers).
But "=r" also means that GCC can put them in registers that are used
as input registers. Input registers are iha, pte on the example.
If the predicate p7 is true, the 8th assembly instruction
"(p7) mov %0=r0;"
is the first one which writes to a register which is maintained by the
register constraints; it sets %0. %0 means the first register operand;
it is ret here.
This instruction might overwrite the %2 register (pte) which is needed
by the next instruction:
"(p7) st8 [%2]=r9;;"
Whether it really happens depends on how GCC decides what registers it
uses and how it optimizes the code.

The attached patch  fixes the register operand constraints in
arch/ia64/kvm/vtlb.c.
The register constraints should be
: "=&r"(ret) : "r"(iha), "r"(pte):"memory");
The & means that GCC must not use any of the input registers to place
this output register in.

This is Debian bug#702639
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702639).

The patch is applicable on Kernel 3.9-rc1, 3.2.35 and many other versions.

Signed-off-by: Stephan Schreiber <info@fs-driver.org>
Cc: stable@vger.kernel.org
Signed-off-by: Tony Luck <tony.luck@intel.com>
11 years agoWrong asm register contraints in the futex implementation
Stephan Schreiber [Tue, 19 Mar 2013 22:22:27 +0000 (15:22 -0700)]
Wrong asm register contraints in the futex implementation

The Linux Kernel contains some inline assembly source code which has
wrong asm register constraints in arch/ia64/include/asm/futex.h.

I observed this on Kernel 3.2.23 but it is also true on the most
recent Kernel 3.9-rc1.

File arch/ia64/include/asm/futex.h:

static inline int
futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
      u32 oldval, u32 newval)
{
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;

{
register unsigned long r8 __asm ("r8");
unsigned long prev;
__asm__ __volatile__(
" mf;; \n"
" mov %0=r0 \n"
" mov ar.ccv=%4;; \n"
"[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n"
" .xdata4 \"__ex_table\", 1b-., 2f-. \n"
"[2:]"
: "=r" (r8), "=r" (prev)
: "r" (uaddr), "r" (newval),
  "rO" ((long) (unsigned) oldval)
: "memory");
*uval = prev;
return r8;
}
}

The list of output registers is
: "=r" (r8), "=r" (prev)
The constraint "=r" means that the GCC has to maintain that these vars
are in registers and contain valid info when the program flow leaves
the assembly block (output registers).
But "=r" also means that GCC can put them in registers that are used
as input registers. Input registers are uaddr, newval, oldval on the
example.
The second assembly instruction
" mov %0=r0 \n"
is the first one which writes to a register; it sets %0 to 0. %0 means
the first register operand; it is r8 here. (The r0 is read-only and
always 0 on the Itanium; it can be used if an immediate zero value is
needed.)
This instruction might overwrite one of the other registers which are
still needed.
Whether it really happens depends on how GCC decides what registers it
uses and how it optimizes the code.

The objdump utility can give us disassembly.
The futex_atomic_cmpxchg_inatomic() function is inline, so we have to
look for a module that uses the funtion. This is the
cmpxchg_futex_value_locked() function in
kernel/futex.c:

static int cmpxchg_futex_value_locked(u32 *curval, u32 __user *uaddr,
      u32 uval, u32 newval)
{
int ret;

pagefault_disable();
ret = futex_atomic_cmpxchg_inatomic(curval, uaddr, uval, newval);
pagefault_enable();

return ret;
}

Now the disassembly. At first from the Kernel package 3.2.23 which has
been compiled with GCC 4.4, remeber this Kernel seemed to work:
objdump -d linux-3.2.23/debian/build/build_ia64_none_mckinley/kernel/futex.o

0000000000000230 <cmpxchg_futex_value_locked>:
      230: 0b 18 80 1b 18 21  [MMI]       adds r3=3168,r13;;
      236: 80 40 0d 00 42 00              adds r8=40,r3
      23c: 00 00 04 00                    nop.i 0x0;;
      240: 0b 50 00 10 10 10  [MMI]       ld4 r10=[r8];;
      246: 90 08 28 00 42 00              adds r9=1,r10
      24c: 00 00 04 00                    nop.i 0x0;;
      250: 09 00 00 00 01 00  [MMI]       nop.m 0x0
      256: 00 48 20 20 23 00              st4 [r8]=r9
      25c: 00 00 04 00                    nop.i 0x0;;
      260: 08 10 80 06 00 21  [MMI]       adds r2=32,r3
      266: 00 00 00 02 00 00              nop.m 0x0
      26c: 02 08 f1 52                    extr.u r16=r33,0,61
      270: 05 40 88 00 08 e0  [MLX]       addp4 r8=r34,r0
      276: ff ff 0f 00 00 e0              movl r15=0xfffffffbfff;;
      27c: f1 f7 ff 65
      280: 09 70 00 04 18 10  [MMI]       ld8 r14=[r2]
      286: 00 00 00 02 00 c0              nop.m 0x0
      28c: f0 80 1c d0                    cmp.ltu p6,p7=r15,r16;;
      290: 08 40 fc 1d 09 3b  [MMI]       cmp.eq p8,p9=-1,r14
      296: 00 00 00 02 00 40              nop.m 0x0
      29c: e1 08 2d d0                    cmp.ltu p10,p11=r14,r33
      2a0: 56 01 10 00 40 10  [BBB] (p10) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
      2a6: 02 08 00 80 21 03        (p08) br.cond.dpnt.few 2b0
<cmpxchg_futex_value_locked+0x80>
      2ac: 40 00 00 41              (p06) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
      2b0: 0a 00 00 00 22 00  [MMI]       mf;;
      2b6: 80 00 00 00 42 00              mov r8=r0
      2bc: 00 00 04 00                    nop.i 0x0
      2c0: 0b 00 20 40 2a 04  [MMI]       mov.m ar.ccv=r8;;
      2c6: 10 1a 85 22 20 00              cmpxchg4.acq r33=[r33],r35,ar.ccv
      2cc: 00 00 04 00                    nop.i 0x0;;
      2d0: 10 00 84 40 90 11  [MIB]       st4 [r32]=r33
      2d6: 00 00 00 02 00 00              nop.i 0x0
      2dc: 20 00 00 40                    br.few 2f0
<cmpxchg_futex_value_locked+0xc0>
      2e0: 09 40 c8 f9 ff 27  [MMI]       mov r8=-14
      2e6: 00 00 00 02 00 00              nop.m 0x0
      2ec: 00 00 04 00                    nop.i 0x0;;
      2f0: 0b 58 20 1a 19 21  [MMI]       adds r11=3208,r13;;
      2f6: 20 01 2c 20 20 00              ld4 r18=[r11]
      2fc: 00 00 04 00                    nop.i 0x0;;
      300: 0b 88 fc 25 3f 23  [MMI]       adds r17=-1,r18;;
      306: 00 88 2c 20 23 00              st4 [r11]=r17
      30c: 00 00 04 00                    nop.i 0x0;;
      310: 11 00 00 00 01 00  [MIB]       nop.m 0x0
      316: 00 00 00 02 00 80              nop.i 0x0
      31c: 08 00 84 00                    br.ret.sptk.many b0;;

The lines
      2b0: 0a 00 00 00 22 00  [MMI]       mf;;
      2b6: 80 00 00 00 42 00              mov r8=r0
      2bc: 00 00 04 00                    nop.i 0x0
      2c0: 0b 00 20 40 2a 04  [MMI]       mov.m ar.ccv=r8;;
      2c6: 10 1a 85 22 20 00              cmpxchg4.acq r33=[r33],r35,ar.ccv
      2cc: 00 00 04 00                    nop.i 0x0;;
are the instructions of the assembly block.
The line
      2b6: 80 00 00 00 42 00              mov r8=r0
sets the r8 register to 0 and after that
      2c0: 0b 00 20 40 2a 04  [MMI]       mov.m ar.ccv=r8;;
prepares the 'oldvalue' for the cmpxchg but it takes it from r8. This
is wrong.
What happened here is what I explained above: An input register is
overwritten which is still needed.
The register operand constraints in futex.h are wrong.

(The problem doesn't occur when the Kernel is compiled with GCC 4.6.)

The attached patch fixes the register operand constraints in futex.h.
The code after patching of it:

static inline int
futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
      u32 oldval, u32 newval)
{
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;

{
register unsigned long r8 __asm ("r8") = 0;
unsigned long prev;
__asm__ __volatile__(
" mf;; \n"
" mov ar.ccv=%4;; \n"
"[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n"
" .xdata4 \"__ex_table\", 1b-., 2f-. \n"
"[2:]"
: "+r" (r8), "=&r" (prev)
: "r" (uaddr), "r" (newval),
  "rO" ((long) (unsigned) oldval)
: "memory");
*uval = prev;
return r8;
}
}

I also initialized the 'r8' var with the C programming language.
The _asm qualifier on the definition of the 'r8' var forces GCC to use
the r8 processor register for it.
I don't believe that we should use inline assembly for zeroing out a
local variable.
The constraint is
"+r" (r8)
what means that it is both an input register and an output register.
Note that the page fault handler will modify the r8 register which
will be the return value of the function.
The real fix is
"=&r" (prev)
The & means that GCC must not use any of the input registers to place
this output register in.

Patched the Kernel 3.2.23 and compiled it with GCC4.4:

0000000000000230 <cmpxchg_futex_value_locked>:
      230: 0b 18 80 1b 18 21  [MMI]       adds r3=3168,r13;;
      236: 80 40 0d 00 42 00              adds r8=40,r3
      23c: 00 00 04 00                    nop.i 0x0;;
      240: 0b 50 00 10 10 10  [MMI]       ld4 r10=[r8];;
      246: 90 08 28 00 42 00              adds r9=1,r10
      24c: 00 00 04 00                    nop.i 0x0;;
      250: 09 00 00 00 01 00  [MMI]       nop.m 0x0
      256: 00 48 20 20 23 00              st4 [r8]=r9
      25c: 00 00 04 00                    nop.i 0x0;;
      260: 08 10 80 06 00 21  [MMI]       adds r2=32,r3
      266: 20 12 01 10 40 00              addp4 r34=r34,r0
      26c: 02 08 f1 52                    extr.u r16=r33,0,61
      270: 05 40 00 00 00 e1  [MLX]       mov r8=r0
      276: ff ff 0f 00 00 e0              movl r15=0xfffffffbfff;;
      27c: f1 f7 ff 65
      280: 09 70 00 04 18 10  [MMI]       ld8 r14=[r2]
      286: 00 00 00 02 00 c0              nop.m 0x0
      28c: f0 80 1c d0                    cmp.ltu p6,p7=r15,r16;;
      290: 08 40 fc 1d 09 3b  [MMI]       cmp.eq p8,p9=-1,r14
      296: 00 00 00 02 00 40              nop.m 0x0
      29c: e1 08 2d d0                    cmp.ltu p10,p11=r14,r33
      2a0: 56 01 10 00 40 10  [BBB] (p10) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
      2a6: 02 08 00 80 21 03        (p08) br.cond.dpnt.few 2b0
<cmpxchg_futex_value_locked+0x80>
      2ac: 40 00 00 41              (p06) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
      2b0: 0b 00 00 00 22 00  [MMI]       mf;;
      2b6: 00 10 81 54 08 00              mov.m ar.ccv=r34
      2bc: 00 00 04 00                    nop.i 0x0;;
      2c0: 09 58 8c 42 11 10  [MMI]       cmpxchg4.acq r11=[r33],r35,ar.ccv
      2c6: 00 00 00 02 00 00              nop.m 0x0
      2cc: 00 00 04 00                    nop.i 0x0;;
      2d0: 10 00 2c 40 90 11  [MIB]       st4 [r32]=r11
      2d6: 00 00 00 02 00 00              nop.i 0x0
      2dc: 20 00 00 40                    br.few 2f0
<cmpxchg_futex_value_locked+0xc0>
      2e0: 09 40 c8 f9 ff 27  [MMI]       mov r8=-14
      2e6: 00 00 00 02 00 00              nop.m 0x0
      2ec: 00 00 04 00                    nop.i 0x0;;
      2f0: 0b 88 20 1a 19 21  [MMI]       adds r17=3208,r13;;
      2f6: 30 01 44 20 20 00              ld4 r19=[r17]
      2fc: 00 00 04 00                    nop.i 0x0;;
      300: 0b 90 fc 27 3f 23  [MMI]       adds r18=-1,r19;;
      306: 00 90 44 20 23 00              st4 [r17]=r18
      30c: 00 00 04 00                    nop.i 0x0;;
      310: 11 00 00 00 01 00  [MIB]       nop.m 0x0
      316: 00 00 00 02 00 80              nop.i 0x0
      31c: 08 00 84 00                    br.ret.sptk.many b0;;

Much better.
There is a
      270: 05 40 00 00 00 e1  [MLX]       mov r8=r0
which was generated by C code r8 = 0. Below
      2b6: 00 10 81 54 08 00              mov.m ar.ccv=r34
what means that oldval is no longer overwritten.

This is Debian bug#702641
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702641).

The patch is applicable on Kernel 3.9-rc1, 3.2.23 and many other versions.

Signed-off-by: Stephan Schreiber <info@fs-driver.org>
Cc: stable@vger.kernel.org
Signed-off-by: Tony Luck <tony.luck@intel.com>
11 years agoRemove cast for kmalloc return value
Zhang Yanfei [Tue, 12 Mar 2013 04:47:08 +0000 (12:47 +0800)]
Remove cast for kmalloc return value

remove cast for kmalloc return value.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
11 years agoFix kexec oops when iosapic was removed
Hanjun Guo [Fri, 8 Mar 2013 04:33:35 +0000 (12:33 +0800)]
Fix kexec oops when iosapic was removed

Iosapic hotplug was supported in IA64 code, but will lead to kexec oops
when iosapic was removed. here is the code logic:

iosapic_remove
  iosapic_free
    memset(&iosapic_lists[index], 0, sizeof(iosapic_lists[0]))
      iosapic_lists[index].addr was set to 0;

and then kexec a new kernel
kexec_disable_iosapic
  iosapic_write(rte->iosapic,..)
    __iosapic_write(iosapic->addr, reg, val);
      addr was set to 0 when iosapic_remove, and oops happened

The call trace is:
Starting new kernel
kexec[11336]: Oops 8804682956800 [1]
Modules linked in: raw(N) ipv6(N) acpi_cpufreq(N) binfmt_misc(N) fuse(N) nls_iso
8859_1(N) loop(N) ipmi_si(N) ipmi_devintf(N) ipmi_msghandler(N) mca_ereport(N) s
csi_ereport(N) nic_ereport(N) pcie_ereport(N) err_transport(N) nvlist(PN) dm_mod
(N) tpm_tis(N) tpm(N) ppdev(N) tpm_bios(N) serio_raw(N) i2c_i801(N) iTCO_wdt(N)
i2c_core(N) iTCO_vendor_support(N) sg(N) ioatdma(N) igb(N) mptctl(N) dca(N) parp
ort_pc(N) parport(N) container(N) button(N) usbhid(N) hid(N) uhci_hcd(N) ehci_hc
d(N) usbcore(N) sd_mod(N) crc_t10dif(N) ext3(N) mbcache(N) jbd(N) fan(N) process
or(N) ide_pci_generic(N) ide_core(N) ata_piix(N) libata(N) mptsas(N) mptscsih(N)
 mptbase(N) scsi_transport_sas(N) scsi_mod(N) thermal(N) thermal_sys(N) hwmon(N)

Supported: Yes, External

Pid: 11336, CPU 0, comm:                kexec
psr : 0000101009522030 ifs : 8000000000000791 ip  : [<a00000010004c160>]    Tain
ted: P          N  (2.6.32.12_RAS_V1R3C00B011)
ip is at kexec_disable_iosapic+0x120/0x1e0
unat: 0000000000000000 pfs : 0000000000000791 rsc : 0000000000000003
rnat: 0000000000000000 bsps: 0000000000000000 pr  : 65519aa6a555a659
ldrs: 0000000000000000 ccv : 00000000ea3cf51e fpsr: 0009804c8a70033f
csd : 0000000000000000 ssd : 0000000000000000
b0  : a00000010004c150 b6  : a000000100012620 b7  : a00000010000cda0
f6  : 000000000000000000000 f7  : 1003e0000000002000000
f8  : 1003e0000000050000003 f9  : 1003e0000028fb97183cd
f10 : 1003ee9f380df3c548b67 f11 : 1003e00000000000000cc
r1  : a0000001016cf660 r2  : 0000000000000000 r3  : 0000000000000000
r8  : 0000001009526030 r9  : a000000100012620 r10 : e00000010053f600
r11 : c0000000fec34040 r12 : e00000078f76fd30 r13 : e00000078f760000
r14 : 0000000000000000 r15 : 0000000000000000 r16 : 0000000000000000
r17 : 0000000000000000 r18 : 0000000000007fff r19 : 0000000000000000
r20 : 0000000000000000 r21 : e00000010053f590 r22 : a000000100cf0000
r23 : 0000000000000036 r24 : e0000007002f8a84 r25 : 0000000000000022
r26 : e0000007002f8a88 r27 : 0000000000000020 r28 : 0000000000000002
r29 : a0000001012c8c60 r30 : 0000000000000000 r31 : 0000000000322e49

Call Trace:
 [<a000000100018ca0>] show_stack+0x80/0xa0
                                sp=e00000078f76f8f0 bsp=e00000078f761380
 [<a000000100019300>] show_regs+0x640/0x920
                                sp=e00000078f76fac0 bsp=e00000078f761328
 [<a00000010002a130>] die+0x190/0x2e0
                                sp=e00000078f76fad0 bsp=e00000078f7612e8
 [<a000000100922fa0>] ia64_do_page_fault+0x840/0xb20
                                sp=e00000078f76fad0 bsp=e00000078f761288
 [<a00000010000d5c0>] ia64_native_leave_kernel+0x0/0x270
                                sp=e00000078f76fb60 bsp=e00000078f761288
 [<a00000010004c160>] kexec_disable_iosapic+0x120/0x1e0
                                sp=e00000078f76fd30 bsp=e00000078f761200
 [<a000000100016970>] machine_shutdown+0x110/0x140
                                sp=e00000078f76fd30 bsp=e00000078f7611c8
 [<a000000100133530>] kernel_kexec+0xd0/0x120
                                sp=e00000078f76fd30 bsp=e00000078f7611a0
 [<a0000001000eca40>] sys_reboot+0x480/0x4e0
                                sp=e00000078f76fd30 bsp=e00000078f761128
 [<a00000010000d420>] ia64_ret_from_syscall+0x0/0x20
                                sp=e00000078f76fe30 bsp=e00000078f761120
Kernel panic - not syncing: Fatal exception

With Tony and Toshi's advice, the patch removes the "rte" from rte_list
when the iosapic was removed.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
11 years agoiosapic: fix a minor typo in comments
Hanjun Guo [Fri, 8 Mar 2013 04:32:52 +0000 (12:32 +0800)]
iosapic: fix a minor typo in comments

describeinterrupts -> describe interrupts

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
11 years agoAdd WB/UC check for early_ioremap
Li, Zhen-Hua [Mon, 18 Mar 2013 02:45:43 +0000 (10:45 +0800)]
Add WB/UC check for early_ioremap

On ia64 system, the function early_ioremap returned an uncached memory
reference without checking whether this was consistent with existing
mappings. This causes efi error and the kernel failed during boot.  Add a
check to test whether memory has EFI_MEMORY_WB set.  Use the function
kern_mem_attribute() in early_iomap() function to provide appropriate
cacheable or uncacheable mapped address.

See the document Documentation/ia64/aliasing.txt for more details.

Signed-off-by: Li, Zhen-Hua <zhen-hual@hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
11 years agoFix broken fsys_getppid()
Eric W. Biederman [Tue, 19 Mar 2013 00:03:03 +0000 (17:03 -0700)]
Fix broken fsys_getppid()

In particular fsys_getppid always returns the ppid in the initial pid
namespace so it does not work for a process in a pid namespace.

Fix from Eric Biederman just removes the fast system call path.
While it is a little bit sad to see another one of these bite
the dust ... I can't imagine that getppid() is really on any
real applications critical path.

Signed-off-by: Tony Luck <tony.luck@intel.com>
11 years agotiocx: check retval from bus_register()
Jiri Kosina [Tue, 19 Mar 2013 09:36:13 +0000 (10:36 +0100)]
tiocx: check retval from bus_register()

Properly check return value from bus_register() and propagate it out of
tiocx_init() in case of failure.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Tony Luck <tony.luck@intel.com>
11 years agodrm/i915: Move num_pipes to intel info
Ben Widawsky [Wed, 13 Mar 2013 21:05:41 +0000 (14:05 -0700)]
drm/i915: Move num_pipes to intel info

Requested by Daniel.

v2: Fix incorrect num_pipe settings. (Chris)

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agodrm/i915: fixup pd vs pt confusion in gen6 ppgtt code
Daniel Vetter [Tue, 19 Mar 2013 22:48:39 +0000 (23:48 +0100)]
drm/i915: fixup pd vs pt confusion in gen6 ppgtt code

The index variable points at a page table, not a page directory or a
pde. Ben Widawsky fix this up correctly in his ppgtt cleanup, but I've
botched the job and copy&pasted the old confusion from the original
gen6 ppgtt code in

commit def886c3768d24c4e0aa56ff98b5a468c2b5c9bf
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Jan 24 14:44:56 2013 -0800

    drm/i915: vfuncs for ppgtt

Cc: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agostyle nit: Align function parameter continuation properly.
Daniel Vetter [Tue, 19 Mar 2013 22:37:08 +0000 (23:37 +0100)]
style nit: Align function parameter continuation properly.

11 years agoMerge tag 'for-linus-v3.9-rc4' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Tue, 19 Mar 2013 22:17:40 +0000 (15:17 -0700)]
Merge tag 'for-linus-v3.9-rc4' of git://oss.sgi.com/xfs/xfs

Pull XFS fixes from Ben Myers:

 - Fix for a potential infinite loop which was introduced in commit
   4d559a3bcb73 ("xfs: limit speculative prealloc near ENOSPC
   thresholds")

 - Fix for the return type of xfs_iomap_eof_prealloc_initial_size from
   commit a1e16c26660b ("xfs: limit speculative prealloc size on sparse
   files")

 - Fix for a failed buffer readahead causing subsequent callers to fail
   incorrectly

* tag 'for-linus-v3.9-rc4' of git://oss.sgi.com/xfs/xfs:
  xfs: ensure we capture IO errors correctly
  xfs: fix xfs_iomap_eof_prealloc_initial_size type
  xfs: fix potential infinite loop in xfs_iomap_prealloc_size()

11 years agonet: Get rid of compat defines in psock_fanout.c selftest.
David S. Miller [Tue, 19 Mar 2013 22:08:45 +0000 (18:08 -0400)]
net: Get rid of compat defines in psock_fanout.c selftest.

Reported-by: Daniel Baluta <dbaluta@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoPCI: Use ROM images from firmware only if no other ROM source available
Matthew Garrett [Tue, 19 Mar 2013 21:26:57 +0000 (17:26 -0400)]
PCI: Use ROM images from firmware only if no other ROM source available

Mantas Mikulėnas reported that his graphics hardware failed to
initialise after commit f9a37be0f02a ("x86: Use PCI setup data").

The aim of this commit was to ensure that ROM images were available on
some Apple systems that don't expose the GPU ROM via any other source.
In this case, UEFI appears to have provided a broken ROM image that we
were using even though there was a perfectly valid ROM available via
other sources.  The simplest way to handle this seems to be to just
re-order pci_map_rom() and leave any firmare-supplied ROM to last.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Tested-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Linus Torvalds [Tue, 19 Mar 2013 21:47:11 +0000 (14:47 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

Pull sparc fixes from David Miller:
 "Just some minor fixups, a sunsu console setup panic cure, and
  recognition of a Fujitsu sun4v cpu."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc: remove unused "config BITS"
  sparc: delete "if !ULTRA_HAS_POPULATION_COUNT"
  sparc64: correctly recognize SPARC64-X chips
  sparc,leon: fix GRPCI2 device0 PCI config space access
  sunsu: Fix panic in case of nonexistent port at "console=ttySY" cmdline option

11 years agocgroup: consolidate cgroup_attach_task() and cgroup_attach_proc()
Li Zefan [Wed, 13 Mar 2013 01:17:09 +0000 (09:17 +0800)]
cgroup: consolidate cgroup_attach_task() and cgroup_attach_proc()

These two functions share most of the code.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
11 years agodevcg: propagate local changes down the hierarchy
Aristeu Rozanski [Fri, 15 Feb 2013 16:55:47 +0000 (11:55 -0500)]
devcg: propagate local changes down the hierarchy

This patch makes exception changes to propagate down in hierarchy respecting
when possible local exceptions.

New exceptions allowing additional access to devices won't be propagated, but
it'll be possible to add an exception to access all of part of the newly
allowed device(s).

New exceptions disallowing access to devices will be propagated down and the
local group's exceptions will be revalidated for the new situation.
Example:
      A
     / \
        B

    group        behavior          exceptions
    A            allow             "b 8:* rwm", "c 116:1 rw"
    B            deny              "c 1:3 rwm", "c 116:2 rwm", "b 3:* rwm"

If a new exception is added to group A:
# echo "c 116:* r" > A/devices.deny
it'll propagate down and after revalidating B's local exceptions, the exception
"c 116:2 rwm" will be removed.

In case parent's exceptions change and local exceptions are not allowed anymore,
they'll be deleted.

v7:
- do not allow behavior change when the cgroup has children
- update documentation

v6: fixed issues pointed by Serge Hallyn
- only copy parent's exceptions while propagating behavior if the local
  behavior is different
- while propagating exceptions, do not clear and copy parent's: it'd be against
  the premise we don't propagate access to more devices

v5: fixed issues pointed by Serge Hallyn
- updated documentation
- not propagating when an exception is written to devices.allow
- when propagating a new behavior, clean the local exceptions list if they're
  for a different behavior

v4: fixed issues pointed by Tejun Heo
- separated function to walk the tree and collect valid propagation targets

v3: fixed issues pointed by Tejun Heo
- update documentation
- move css_online/css_offline changes to a new patch
- use cgroup_for_each_descendant_pre() instead of own descendant walk
- move exception_copy rework to a separared patch
- move exception_clean rework to a separated patch

v2: fixed issues pointed by Tejun Heo
- instead of keeping the local settings that won't apply anymore, remove them

Cc: Tejun Heo <tj@kernel.org>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
11 years agodevcg: use css_online and css_offline
Aristeu Rozanski [Fri, 15 Feb 2013 16:55:46 +0000 (11:55 -0500)]
devcg: use css_online and css_offline

Allocate resources and change behavior only when online. This is needed in
order to determine if a node is suitable for hierarchy propagation or if it's
being removed.

Locking:
Both functions take devcgroup_mutex to make changes to device_cgroup structure.
Hierarchy propagation will also take devcgroup_mutex before walking the
tree while walking the tree itself is protected by rcu lock.

Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
11 years agodevcg: prepare may_access() for hierarchy support
Aristeu Rozanski [Fri, 15 Feb 2013 16:55:45 +0000 (11:55 -0500)]
devcg: prepare may_access() for hierarchy support

Currently may_access() is only able to verify if an exception is valid for the
current cgroup, which has the same behavior. With hierarchy, it'll be also used
to verify if a cgroup local exception is valid towards its cgroup parent, which
might have different behavior.

v2:
- updated patch description
- rebased on top of a new patch to expand the may_access() logic to make it
  more clear
- fixed argument description order in may_access()

Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
11 years agodevcg: expand may_access() logic
Aristeu Rozanski [Fri, 15 Feb 2013 16:55:44 +0000 (11:55 -0500)]
devcg: expand may_access() logic

In order to make the next patch more clear, expand may_access() logic.

v2: may_access() returns bool now

Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
11 years agonet: Fix failure string in net-socket selftests Makefile.
David S. Miller [Tue, 19 Mar 2013 21:05:50 +0000 (17:05 -0400)]
net: Fix failure string in net-socket selftests Makefile.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agopacket: packet fanout rollover during socket overload
Willem de Bruijn [Tue, 19 Mar 2013 10:18:11 +0000 (10:18 +0000)]
packet: packet fanout rollover during socket overload

Changes:
  v3->v2: rebase (no other changes)
          passes selftest
  v2->v1: read f->num_members only once
          fix bug: test rollover mode + flag

Minimize packet drop in a fanout group. If one socket is full,
roll over packets to another from the group. Maintain flow
affinity during normal load using an rxhash fanout policy, while
dispersing unexpected traffic storms that hit a single cpu, such
as spoofed-source DoS flows. Rollover breaks affinity for flows
arriving at saturated sockets during those conditions.

The patch adds a fanout policy ROLLOVER that rotates between sockets,
filling each socket before moving to the next. It also adds a fanout
flag ROLLOVER. If passed along with any other fanout policy, the
primary policy is applied until the chosen socket is full. Then,
rollover selects another socket, to delay packet drop until the
entire system is saturated.

Probing sockets is not free. Selecting the last used socket, as
rollover does, is a greedy approach that maximizes chance of
success, at the cost of extreme load imbalance. In practice, with
sufficiently long queues to absorb bursts, sockets are drained in
parallel and load balance looks uniform in `top`.

To avoid contention, scales counters with number of sockets and
accesses them lockfree. Values are bounds checked to ensure
correctness.

Tested using an application with 9 threads pinned to CPUs, one socket
per thread and sufficient busywork per packet operation to limits each
thread to handling 32 Kpps. When sent 500 Kpps single UDP stream
packets, a FANOUT_CPU setup processes 32 Kpps in total without this
patch, 270 Kpps with the patch. Tested with read() and with a packet
ring (V1).

Also, passes psock_fanout.c unit test added to selftests.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>