1
0
Fork 0
Commit Graph

546681 Commits (13e96db61c1c32cd4c8102a95129bb7677cc746d)

Author SHA1 Message Date
Arnaldo Carvalho de Melo 13e96db61c tools build: Allow setting the feature detection user
We will use the tools/build/ autodetection in the eBPF patchkit
and it is currently sharing the output directory with perf, that
also uses the feature detection logic.

As we keep state in the output directory, so that we can avoid running
all the tests again, we need to have different filenames for the files
used in this state, allow doing that via the FEATURE_USER variable, to
be set alongside the existing FEATURE_{TEST,DISPLAY} variables.

v2: Fix comment describing the FEATURE_DUMP filename to make sure where
    it is created, precisely at $(OUTPUT)FEATURE-DUMP$(FEATURE_USER).
    Pointed out by Jiri.

Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/n/tip-fdbev0vrn3x6idqc3ajbnvcb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-22 10:47:04 -03:00
Arnaldo Carvalho de Melo 20517cd9c5 tools lib bpf: Fix up FEATURE_{TESTS,DISPLAY} usage
When libbpf was introduced it wrongly asked for the "libelf" and "bpf"
feature tests to be performed (via FEATURE_TESTS), while asking that
"libbpf", "libelf-mmap", "libelf-getphdrnum" and "bpf" to have the
result of its respective tests to be displayed (via FEATURE_DISPLAY).

Due to another recently bug fixed in the tools/build/ infrastructure
("tools build: Fixup feature detection display function name") the
results for the entries in the FEATURE_DISPLAY, for this case, were
appearing as all succeeding, when two of them (the ones only on the
DISPLAY) were not even being performed.

Before:

  $ make -C tools/lib/bpf/
  make: Entering directory '/home/git/linux/tools/lib/bpf'
  Auto-detecting system features:
  ...                        libelf: [ on  ]
  ...             libelf-getphdrnum: [ OFF ]
  ...                   libelf-mmap: [ OFF ]
  ...                           bpf: [ on  ]
  <SNIP>

After, with FEATURE_TESTS == FEATURE_DISPLAY:

  Auto-detecting system features:
  ...                        libelf: [ on  ]
  ...             libelf-getphdrnum: [ on  ]
  ...                   libelf-mmap: [ on  ]
  ...                           bpf: [ on  ]
  <SNIP>

I just inverted, so that it tests the four features but displays just
the libelf and mmap ones, to make it more compact. So it becomes:

  $ make -C tools/lib/bpf/
  make: Entering directory '/home/git/linux/tools/lib/bpf'

  Auto-detecting system features:
  ...                        libelf: [ on  ]
  ...                           bpf: [ on  ]

Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: pi3orama@163.com
Fixes: 1b76c13e4b ("bpf tools: Introduce 'bpf' library and add bpf feature check")
Link: http://lkml.kernel.org/n/tip-y4bd59e6j9rzzojiyeqrg2jq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-22 10:47:01 -03:00
Arnaldo Carvalho de Melo 6076e2a47c tools build: Fixup feature detection display function name
Cut'n'paste mistake, it should eval the name of the function
defined right next to it, in the next line, fix it.

Before:

  $ make -C tools/lib/bpf/
  make: Entering directory '/home/git/linux/tools/lib/bpf'

  Auto-detecting system features:
  ...                        libelf: [ on  ]
  ...             libelf-getphdrnum: [ on  ]
  ...                   libelf-mmap: [ on  ]
  ...                           bpf: [ on  ]
  <SNIP>

After:

  $ make -C tools/lib/bpf/
  make: Entering directory '/home/git/linux/tools/lib/bpf'

  Auto-detecting system features:
  ...                        libelf: [ on  ]
  ...             libelf-getphdrnum: [ OFF ]
  ...                   libelf-mmap: [ OFF ]
  ...                           bpf: [ on  ]
  <SNIP>

Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: pi3orama@163.com
Fixes: 58d4f00ff1 ("perf build: Fix feature_check name clash")
Link: http://lkml.kernel.org/n/tip-dzu1c4sruukgfq5d5b1c4r30@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-22 10:44:19 -03:00
Wang Nan 854f736364 perf tools: Don't assume that the parser returns non empty evsel list
Don't blindly retrieve and use a last element in the lists returned by
parse_events__scanner(), as it may have collected no entries, i.e.
return an empty list.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kaixu Xia <xiakaixu@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1441523623-152703-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-21 18:01:17 -03:00
Masami Hiramatsu 0fb1855347 perf probe: Fix a segfault when removing uprobe events
Fix a segfault bug and a small mistake in perf probe -d.

Since the "ulist" in perf_del_probe_events is never initialized,
strlist__add(ulist, *) always causes a segfault when removing
uprobe events by perf probe -d.

Also, the "str" local variable is never released if fail to
allocate the "klist". This fixes it too.

This has been introduced by the commit e607f1426b ("perf probe:
Print deleted events in cmd_probe()").

Reported-by: Milian Wolff <milian.wolff@kdab.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150916125241.4446.44805.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-21 18:01:17 -03:00
Kan Liang 96f3eda67f perf/x86/intel: Fix static checker warning in lbr enable
Commit deb27519bf ("perf/x86/intel: Fix LBR callstack issue caused
by FREEZE_LBRS_ON_PMI") leads to the following Smatch complaint:

   warn: variable dereferenced before check 'cpuc->lbr_sel' (see line 154)

Fix the warning.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: deb27519bf ("perf/x86/intel: Fix LBR callstack issue caused by FREEZE_LBRS_ON_PMI")
Link: http://lkml.kernel.org/r/1442240047-48149-1-git-send-email-kan.liang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-18 09:24:57 +02:00
Ingo Molnar 02386c356a Merge branch 'perf/urgent' into perf/core, to pick up fixes before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-18 09:24:01 +02:00
Peter Zijlstra f73e22ab45 perf: Fix races in computing the header sizes
There are two races with the current code:

 - Another event can join the group and compute a larger header_size
   concurrently, if the smaller store wins we'll have an incorrect
   header_size set.

 - We compute the header_size after the event becomes active,
   therefore its possible to use the size before its computed.

Remedy the first by moving the computation inside the ctx::mutex lock,
and the second by placing it _before_ perf_install_in_context().

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-18 09:20:26 +02:00
Peter Zijlstra a723968c0e perf: Fix u16 overflows
Vince reported that its possible to overflow the various size fields
and get weird stuff if you stick too many events in a group.

Put a lid on this by requiring the fixed record size not exceed 16k.
This is still a fair amount of events (silly amount really) and leaves
plenty room for callchains and stack dwarves while also avoiding
overflowing the u16 variables.

Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-18 09:20:25 +02:00
Peter Zijlstra f55fc2a57c perf: Restructure perf syscall point of no return
The exclusive_event_installable() stuff only works because its
exclusive with the grouping bits.

Rework the code such that there is a sane place to error out before we
go do things we cannot undo.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-18 09:20:24 +02:00
Andi Kleen dfe1f3cb31 perf/x86/intel: Fix Skylake FRONTEND MSR extrareg mask
Stephane pointed out that the extrareg mask was one bit too short.
The bubble width field was truncated by one bit. Fix that here.
Also add some extra comments on the reserved bits inside the event
select code.

Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1441835640-21347-3-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-18 09:20:23 +02:00
Andi Kleen d0dc8494cd perf/x86/intel/pebs: Add PEBS frontend profiling for Skylake
Skylake has a new FRONTEND_LATENCY PEBS event to accurately profile
frontend problems (like ITLB or decoding issues).

The new event is configured through a separate MSR, which selects
a range of sub events.

Define the extra MSR as a extra reg and export support for it
through sysfs.  To avoid duplicating the existing
tables use a new function to add new entries to existing tables.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1435707205-6676-4-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-18 09:20:22 +02:00
Andi Kleen 5e176213a6 perf/x86/intel: Make the CYCLE_ACTIVITY.* constraint on Broadwell more specific
The counter constraint for CYCLE_ACTIVITY.* on Broadwell covered
all CYCLE_ACTIVITY.* sub events, and forced them on counter 2.
But actually only one sub event (umask 8) needs to be on counter 2,
all others do not have any constraint.

Only force that subevent. This fixes groups with multiple
CYCLE_ACTIVITY.* events, for example:

	% perf stat -x, -e '{cpu/event=0xa3,umask=0x6,cmask=6/,\
	cpu/event=0xa2,umask=0x8/,\
	cpu/event=0xa3,umask=0x4,cmask=4/,cpu/event=0xb1,umask=0x1,cmask=1/}' true
	122150,,cpu/event=0xa3,umask=0x6,cmask=6/,846486,100.00
	16483,,cpu/event=0xa2,umask=0x8/,846486,100.00
	252280,,cpu/event=0xa3,umask=0x4,cmask=4/,846486,100.00
	233604,,cpu/event=0xb1,umask=0x1,cmask=1/,846486,100.00
	%

Without this patch the third result would be <unsupported>

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1442267222-16464-1-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-18 09:20:21 +02:00
Ingo Molnar a6f83f00ad perf/urgent fixes:
User visible:
 
 - When handling perf_event_open() returning EBUSY and not being able to opendir
   the procfs mount point we would tell the user that the oprofile daemon was
   found by returning -1 on as the return for a bool function, oops, fix it,
   found with Coccinelle (Peter Senna Tschudin).
 
 - Fix per-pkg event reporting bug in 'perf stat' (Stephane Eranian)
 
 Developer visible:
 
 - Fix missing prototype for function provided when it isn't present in the
   libelf present, fixing the build on RHEL/CentOS 5.1 systems, for instance
   (Arnaldo Carvalho de Melo)
 
 - Detect if the gcc and libnuma have the features needed to avoid requiring
   the use of NO_LIBNUMA and/or NO_AUXTRACE to build on older systems
   (Arnaldo Carvalho de Melo)
 
 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV+wq3AAoJENZQFvNTUqpA6l0P/jyymIC3TfV7tEIQpA5Q9+y4
 Mex2UL++XFy4TCxFKPqs8H0v4JwCE5Hy7C7XOisrujWcabPxfL1Rd1n/oWkCaSRB
 FxmvxrnRDHAjF9/PpOhzGSSWbj9NA35l8Z4i15wYRC68T+j6Xxnwd6eQvdxpEY/7
 iaTI9vReyu4o8HTVO4mJFg+Ylo1QI/7r4UxBdaq5xnA+/pUhq4uDyus0e8R30Ix+
 uFlpOA7Izn7QMwQ40KIFfLZNnTFrhDrbXcCruHoVEYx+vb9ytn3CgaqkXwY42lvz
 F2RSLryCg7PMoVwWXgeEV+cPFGnkLX0Go3GTQ09OFksewh8lQkxq6OfdF62xKpa8
 J7owPMTFwXHjEDwHfvohEwzzianiqE1KQsZoVVztfCXcnblHY2PGQAQ27JrQGy+K
 W5emgXgqSKGin/8VBeqkhOpwBRcWdy5EBNoXKkWS1FGkZqWylIjpd9d7x8MKKB/Z
 8rc5H3mJ/strF75CmUeIu1TDwhSJsZ8DQQNo6Y82YO89SpLojUznJEERsrI4KN0e
 pDlI4prCBoMj7euSRCkCETymQUdWsJlFlmmJFJhI87/E+M4G6paH4vL/bET3Z2yt
 aYDDIapPGPB1xUryCaBd++qqSZsTxKPu1qTdQ1CkDM0SkrzQwP6dKLSlmKpBtbUS
 TGOR3QWI45xInbkw73fa
 =k6ND
 -----END PGP SIGNATURE-----

Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

User visible changes:

  - When handling perf_event_open() returning EBUSY and not being able to opendir
    the procfs mount point we would tell the user that the oprofile daemon was
    found by returning -1 on as the return for a bool function, oops, fix it,
    found with Coccinelle. (Peter Senna Tschudin).

  - Fix per-pkg event reporting bug in 'perf stat'. (Stephane Eranian)

Developer visible changes:

  - Fix missing prototype for function provided when it isn't present in the
    libelf present, fixing the build on RHEL/CentOS 5.1 systems, for instance.
    (Arnaldo Carvalho de Melo)

  - Detect if the gcc and libnuma have the features needed to avoid requiring
    the use of NO_LIBNUMA and/or NO_AUXTRACE to build on older systems.
    (Arnaldo Carvalho de Melo)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-18 07:41:56 +02:00
Linus Torvalds a7d5c18971 platform-drivers-x86 for 4.3-2
Fix an issue introduced by the previous major toshiba rework. Add a quirk.
 Workaround a few platform specific firmware items. One cleanup to wmi I
 inadvertently dropped from a previous pull request.
 
 hp-wmi
  - limit hotkey enable
 
 toshiba_acpi:
  - Fix hotkeys registration on some toshiba models
  - Fix USB Sleep and Music always disabled
 
 wmi:
  - Remove private %pUL implementation
 
 asus-nb-wmi:
  - Add wapf=4 quirk for X456UA/X456UF
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJV+2i5AAoJEKbMaAwKp364AmwIAKZd3N2lsI15wqx8fYKrvBTR
 tdov/1v4N0T79BAngZNF7dIrSCzRGtjCK7w1zoR6B8vkrpJg2vgXS89GA9p0gkdq
 jOQGuDswBDDD9KWDhlR0SjXE+P8T35gQMeeHNC8mpAfn9S9IGKEkLW4UsPF8tDxx
 TmIv2b2kH8LN2SdmgkK1aNrDvm/Z7Z+2VH1a87NlNKQtJJFjxx5CVKs09UrzGOVG
 ETOZ5+vq+7LR/ajzquEyPIZIFncz6adkxVKvFs9FuTFYza6VNBH+ED0QzijCY4mn
 nAD7cIEa5b9/CSDgwaueBbCzLAkl0csPwjJiA4JaBWgVSn5ctZUUi0b+dApIU88=
 =DQTr
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v4.3-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver fixes from Darren Hart:
 "Fix an issue introduced by the previous major toshiba rework.  Add a
  quirk.  Workaround a few platform specific firmware items.  One
  cleanup to wmi I inadvertently dropped from a previous pull request.

  Details:

  hp-wmi:
   - limit hotkey enable

  toshiba_acpi:
   - Fix hotkeys registration on some toshiba models
   - Fix USB Sleep and Music always disabled

  wmi:
   - Remove private %pUL implementation

  asus-nb-wmi:
   - Add wapf=4 quirk for X456UA/X456UF"

* tag 'platform-drivers-x86-v4.3-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  hp-wmi: limit hotkey enable
  toshiba_acpi: Fix hotkeys registration on some toshiba models
  toshiba_acpi: Fix USB Sleep and Music always disabled
  wmi: Remove private %pUL implementation
  asus-nb-wmi: Add wapf=4 quirk for X456UA/X456UF
2015-09-17 21:41:02 -07:00
Linus Torvalds a8f1558558 Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from ANdrew Morton:
 "8 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  revert "mm: make sure all file VMAs have ->vm_ops set"
  MAINTAINERS: update LTP mailing list
  userfaultfd: add missing mmput() in error path
  lib/string_helpers.c: fix infinite loop in string_get_size()
  alpha: lib: export __delay
  alpha: io: define ioremap_uc
  kasan: fix last shadow judgement in memory_is_poisoned_16()
  zram: fix possible use after free in zcomp_create()
2015-09-17 21:16:47 -07:00
Andrew Morton 28c553d0aa revert "mm: make sure all file VMAs have ->vm_ops set"
Revert commit 6dc296e7df "mm: make sure all file VMAs have ->vm_ops
set".

Will Deacon reports that it "causes some mmap regressions in LTP, which
appears to use a MAP_PRIVATE mmap of /dev/zero as a way to get anonymous
pages in some of its tests (specifically mmap10 [1])".

William Shuman reports Oracle crashes.

So revert the patch while we work out what to do.

Reported-by: William Shuman <wshuman3@gmail.com>
Reported-by: Will Deacon <will.deacon@arm.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-17 21:16:07 -07:00
Cyril Hrubis 0526109a24 MAINTAINERS: update LTP mailing list
[akpm@linux-foundation.org: Wanlong Gao has moved]
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Cc: Jan Stancek <jstancek@redhat.com>
Cc: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Cc: Alexey Kodanev <alexey.kodanev@oracle.com>
Cc: Wanlong Gao <wanlong.gao@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-17 21:16:07 -07:00
Eric Biggers c03e946fdd userfaultfd: add missing mmput() in error path
This fixes a memleak if anon_inode_getfile() fails in userfaultfd().

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-17 21:16:07 -07:00
Vitaly Kuznetsov 62bef58a55 lib/string_helpers.c: fix infinite loop in string_get_size()
Some string_get_size() calls (e.g.:
 string_get_size(1, 512, STRING_UNITS_10, ..., ...)
 string_get_size(15, 64, STRING_UNITS_10, ..., ...)
) result in an infinite loop. The problem is that if size is equal to
divisor[units]/blk_size and is smaller than divisor[units] we'll end
up with size == 0 when we start doing sf_cap calculations:

For string_get_size(1, 512, STRING_UNITS_10, ..., ...) case:
   ...
   remainder = do_div(size, divisor[units]); -> size is 0, remainder is 1
   remainder *= blk_size; -> remainder is 512
   ...
   size *= blk_size; -> size is still 0
   size += remainder / divisor[units]; -> size is still 0

The caller causing the issue is sd_read_capacity(), the problem was
noticed on Hyper-V, such weird size was reported by host when scanning
collides with device removal.  This is probably a separate issue worth
fixing, this patch is intended to prevent the library routine from
infinite looping.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: James Bottomley <JBottomley@Odin.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-17 21:16:07 -07:00
Sudip Mukherjee 14b97deddf alpha: lib: export __delay
__delay was not exported as a result while building with allmodconfig we
were getting build error of undefined symbol.  __delay is being used by:
drivers/net/phy/mdio-octeon.c

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-17 21:16:07 -07:00
Sudip Mukherjee 969560d2af alpha: io: define ioremap_uc
ioremap_uc was not defined and as a result while building with
allmodconfig were getting build error of: implicit declaration of
function 'ioremap_uc'.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-17 21:16:07 -07:00
Xishi Qiu 8d77a6d18a kasan: fix last shadow judgement in memory_is_poisoned_16()
The shadow which correspond 16 bytes memory may span 2 or 3 bytes.  If
the memory is aligned on 8, then the shadow takes only 2 bytes.  So we
check "shadow_first_bytes" is enough, and need not to call
"memory_is_poisoned_1(addr + 15);".  But the code "if
(likely(!last_byte))" is wrong judgement.

e.g.  addr=0, so last_byte = 15 & KASAN_SHADOW_MASK = 7, then the code
will continue to call "memory_is_poisoned_1(addr + 15);"

Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrey Konovalov <adech.fo@gmail.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michal Marek <mmarek@suse.cz>
Cc: <zhongjiang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-17 21:16:07 -07:00
Luis Henriques 3aaf14da80 zram: fix possible use after free in zcomp_create()
zcomp_create() verifies the success of zcomp_strm_{multi,single}_create()
through comp->stream, which can potentially be pointing to memory that
was freed if these functions returned an error.

While at it, replace a 'ERR_PTR(-ENOMEM)' by a more generic
'ERR_PTR(error)' as in the future zcomp_strm_{multi,siggle}_create()
could return other error codes.  Function documentation updated
accordingly.

Fixes: beca3ec71f ("zram: add multi stream functionality")
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-17 21:16:07 -07:00
Kyle Evans 8a1513b493 hp-wmi: limit hotkey enable
Do not write initialize magic on systems that do not have
feature query 0xb. Fixes Bug #82451.

Redefine FEATURE_QUERY to align with 0xb and FEATURE2 with 0xd
for code clearity.

Add a new test function, hp_wmi_bios_2008_later() & simplify
hp_wmi_bios_2009_later(), which fixes a bug in cases where
an improper value is returned. Probably also fixes Bug #69131.

Add missing __init tag.

Signed-off-by: Kyle Evans <kvans32@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-09-17 18:14:11 -07:00
Linus Torvalds 8e64a73317 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull Ceph fixes from Sage Weil:
 "These are both fixes to the new and improved keepalive2 behavior"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  libceph: advertise support for keepalive2
  libceph: don't access invalid memory in keepalive2 path
2015-09-17 12:32:40 -07:00
Linus Torvalds 2e5735f4c3 power supply and reset fixes for the v4.3 series
* twl4030-charger fixes
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCgAGBQJV+BZgAAoJENju1/PIO/qaWpMP/0s+579Lu1dJssDGiTYzbe0h
 IDeLvFbj6ikHehSCoKYeKiWJ765p/yYI0SySB6OLXuXxJsluDNqD/OSNh+ieZSZy
 thLmV5+pEW/a9zIl223JZGDWMBbFCtHJX3S61bRldtrv3CCeB1vQIw+3QDhG4YKb
 GAuWF/zs3FLMtMpycxx8cl08cm8KaDZ9tZEtASt2xAO2LfVOWc2I0JDfTraFrtn6
 xpnqT6Y7noFHDT2DdKgg6hvymWzUUPhQj2uTEhdl4l3yjTCXXOYReyYEmYBQKYgi
 cpT6ydetphZAeu73I4UikQjRUeXbE+d/iWdPwR6ZzgYPn9V9yBWkN5v7F1aVm8+1
 GWZUcT5tFXSeOIwocPlzTJP5h7f/wLhTfgPtN4REaQJTj1NGvptByZPbKckdCbQr
 V6eYryhQNdDYBRwKHFn48YD6X2CkuvitQ8CJokcnGqB0iw1L/tdACjcsFC0hIbrN
 N3tXenzvnA9mTeAQRMMXjAO7Y9GBY86ssZcMbtMQGbMv4hfVOgmK/RBauMMmLb2t
 HffceagdQr9Dxf2UVUGvH/hRwCqvmGjiK9vbO8iY8VgnWFmtIjDQiP9y8uns2RsD
 5AR/HMl00dcptLc0/MWojvJzn3Q43MlkFb9Hod3GFKgI1IsVjrlmepO9ImFCnKmQ
 UMzowtWTwm4lBk0Bk1gh
 =5keI
 -----END PGP SIGNATURE-----

Merge tag 'for-v4.3-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply fixes from Sebastian Reichel:
 "twl4030-charger fixes"

* tag 'for-v4.3-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
  twl4030_charger: fix another compile error
  Revert "twl4030_charger: correctly handle -EPROBE_DEFER from devm_usb_get_phy_by_node"
2015-09-17 12:25:42 -07:00
Peter Senna Tschudin bf6445631c perf tools: Bool functions shouldn't return -1
Returning a negative value for a boolean function seem to have the
undesired effect of returning true. Replace -1 by false in a
bool-returning function.

The diff of the .s file before and after the change (for x86_64):

  3907c3907
  < 	movl	$1, %ebx
  ---
  > 	xorl	%ebx, %ebx

while if -1 is replaced by true, the diff is empty.

This issue was found by the following Coccinelle semantic patch:

  <smpl>
  @@
  identifier f;
  constant C;
  typedef bool;
  @@
  bool f (...){
  <+...
  * return -C;
  ...+>
  }
  </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Milos Vyletel <milos@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1442484533-19742-1-git-send-email-peter.senna@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-17 15:31:52 -03:00
Linus Torvalds d109c4bb45 arm64 fixes for 4.3-rc2
A mixture of fixes for regressions introduced during the merge window,
 some longer standing problems that we spotted and a couple of hardware
 errata. The main changes are:
 
   - Fix fallout from the h/w DBM patches, causing filesystem writeback
     issues on both v8 and v8.1 CPUs
   - Workaround for Cortex-A53 erratum #843419 in the module loader
   - Fix for long-standing issue with compat big-endian signal handlers
     using the saved floating point state
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCgAGBQJV+pz5AAoJEC379FI+VC/ZhlIP/26twmE0COohnFmJbYLqipF4
 fX3kLZVpW9yYqSbP/pZyY8T+7B838Ke1JuUisJEWQzsHBrdvv0YmXAb1SaPm1B6V
 DMDXAPgsjOugmW8BHvVui/zau8VfShkXIfr4E6bHQbo6wQCzVbOTMqotXzsM+kkm
 vODvhSsaTUWH9DNTG+euP4FZBUYKQjHy/ODY3tyQ65Nm/zTA7J3ZYKWM5HSlzt2x
 4DXFTsxNpIHsflUo/H7LpG/S/DuEE3eIQyMDU3zUuE0wjAR7ukBfKGd8XVMccXUq
 ZR1rUH6NMSUkoiZp6zjck+6FFJ2f3As19wQlmY4+CSQBD7T0Ve6pCGueZV8F3OUG
 aX+bth3xCz6lP7XVXV6IChuIs9kSnEmGH28q1rPIjWiOI3yMGG218TWxP3qLZAAF
 aL0G95WmFpVii1PkgoELBHkfi5WQOaoQwKFNErP4SkuGNFlOKGF1sIq3AqgyypW5
 oY1oWZ3DHDidWl0rUjanSCbDdY+wl8/hB0XiWtBolEnw79ciNOU2rPbTrsER+ilL
 Lrxp0PHb4UaZvKUWa8SQwqOkuuAIVe53wNZovizISCOomYR7LouMrA/8z4mQPieL
 8jrb0R5l3H3sO3umpKvA3GrZIs5Po7QjLhJ8EnFvtba2Mk5JzNH4uHRdFvGBAG00
 dbHd9rJ3wHlBhaYahVjS
 =Bc04
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
 "This addresses some problems with filesystem writeback due to the
  recently merged hardware DBM patches, which caused us to treat some
  read-only pages as dirty.

  There are also some other, less significant fixes that are described
  in the summary below:

  A mixture of fixes for regressions introduced during the merge window,
  some longer standing problems that we spotted and a couple of hardware
  errata.  The main changes are:

   - Fix fallout from the h/w DBM patches, causing filesystem writeback
     issues on both v8 and v8.1 CPUs

   - Workaround for Cortex-A53 erratum #843419 in the module loader

   - Fix for long-standing issue with compat big-endian signal handlers
     using the saved floating point state"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: errata: add module build workaround for erratum #843419
  arm64: compat: fix vfp save/restore across signal handlers in big-endian
  arm64: cpu hotplug: ensure we mask out CPU_TASKS_FROZEN in notifiers
  arm64: head.S: initialise mdcr_el2 in el2_setup
  arm64: enable generic idle loop
  arm64: pgtable: use a single bit for PTE_WRITE regardless of DBM
  arm64: Fix pte_modify() to preserve the hardware dirty information
  arm64: Fix the pte_hw_dirty() check when AF/DBM is enabled
  arm64: dma-mapping: check whether cma area is initialized or not
2015-09-17 11:28:17 -07:00
Linus Torvalds 42dc2a3048 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar:
 - misc fixes all around the map
 - block non-root vm86(old) if mmap_min_addr != 0
 - two small debuggability improvements
 - removal of obsolete paravirt op

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/platform: Fix Geode LX timekeeping in the generic x86 build
  x86/apic: Serialize LVTT and TSC_DEADLINE writes
  x86/ioapic: Force affinity setting in setup_ioapic_dest()
  x86/paravirt: Remove the unused pv_time_ops::get_tsc_khz method
  x86/ldt: Fix small LDT allocation for Xen
  x86/vm86: Fix the misleading CONFIG_VM86 Kconfig help text
  x86/cpu: Print family/model/stepping in hex
  x86/vm86: Block non-root vm86(old) if mmap_min_addr != 0
  x86/alternatives: Make optimize_nops() interrupt safe and synced
  x86/mm/srat: Print non-volatile flag in SRAT
  x86/cpufeatures: Enable cpuid for Intel SHA extensions
2015-09-17 11:01:34 -07:00
Linus Torvalds 1345df21ac Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Ingo Molnar:
 "A fix for an abs()/abs64() bug that caused too slow NTP convergence on
  32-bit kernels, plus a removal of an obsolete clockevents driver
  facility after all users got converted during the merge window"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clockevents: Remove unused set_mode() callback
  time: Fix timekeeping_freqadjust()'s incorrect use of abs() instead of abs64()
2015-09-17 10:55:25 -07:00
Linus Torvalds c2ea72fd86 Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar:
 "A migrate_tasks() locking fix, and a late-coming nohz change plus a
  nohz debug check"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched: 'Annotate' migrate_tasks()
  nohz: Assert existing housekeepers when nohz full enabled
  nohz: Affine unpinned timers to housekeepers
2015-09-17 10:49:42 -07:00
Linus Torvalds a706797feb Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo MOlnar:
 "Mostly tooling fixes, but also two x86 PMU driver fixes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf tests: Fix software clock events test setting maps
  perf tests: Fix task exit test setting maps
  perf evlist: Fix create_syswide_maps() not propagating maps
  perf evlist: Fix add() not propagating maps
  perf evlist: Factor out a function to propagate maps for a single evsel
  perf evlist: Make create_maps() use set_maps()
  perf evlist: Make set_maps() more resilient
  perf evsel: Add own_cpus member
  perf evlist: Fix missing thread_map__put in propagate_maps()
  perf evlist: Fix splice_list_tail() not setting evlist
  perf evlist: Add has_user_cpus member
  perf evlist: Remove redundant validation from propagate_maps()
  perf evlist: Simplify set_maps() logic
  perf evlist: Simplify propagate_maps() logic
  perf top: Fix segfault pressing -> with no hist entries
  perf header: Fixup reading of HEADER_NRCPUS feature
  perf/x86/intel: Fix constraint access
  perf/x86/intel/bts: Set event->hw.itrace_started in pmu::start to match the new logic
  perf tools: Fix use of wrong event when processing exit events
  perf tools: Fix parse_events_add_pmu caller
2015-09-17 10:37:46 -07:00
Ilya Dryomov 335c258582 libceph: advertise support for keepalive2
We are the client, but advertise keepalive2 anyway - for consistency,
if nothing else.  In the future the server might want to know whether
its clients support keepalive2.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
2015-09-17 20:14:27 +03:00
Ilya Dryomov 7f61f54565 libceph: don't access invalid memory in keepalive2 path
This

    struct ceph_timespec ceph_ts;
    ...
    con_out_kvec_add(con, sizeof(ceph_ts), &ceph_ts);

wraps ceph_ts into a kvec and adds it to con->out_kvec array, yet
ceph_ts becomes invalid on return from prepare_write_keepalive().  As
a result, we send out bogus keepalive2 stamps.  Fix this by encoding
into a ceph_timespec member, similar to how acks are read and written.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
2015-09-17 20:14:15 +03:00
Arnaldo Carvalho de Melo b0063dbfb0 tools build: Add test for presence of __get_cpuid() gcc builtin
The auxtrace code needed by Intel PT uses the __get_cpuid() gcc builtin,
that is not present in old systems, breaking the build.

Add a test to check for that builtin and disable AUXTRACE in those
systems.

  [acme@rhel5 linux]$  make NO_LIBPERL=1 -C tools/perf O=/tmp/build/perf install-bin
  make: Entering directory `/home/acme/git/linux/tools/perf'
    BUILD:   Doing 'make -j2' parallel build

  Auto-detecting system features:
  <SNIP>
  ...                          lzma: [ on  ]
  ...                     get_cpuid: [ OFF ]
  <SNIP>
  config/Makefile:630: Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc
    MKDIR    /tmp/build/perf/util/
  <SNIP>

This fixes the build on old systems such as RHEL/CentOS 5.11.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Victor Kamensky <victor.kamensky@linaro.org>
Cc: Vinson Lee <vlee@twopensource.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-d4puslul0jltoodzpx9r4sje@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-17 13:14:35 -03:00
Arnaldo Carvalho de Melo f8ac8606fd tools build: Add test for presence of numa_num_possible_cpus() in libnuma
The existing numa test checks only if numa.h and numa_available() are
present, but that can be satisfied with an old libnuma that is not
enough for the 'perf bench numa' entry, so add a test to check for that:

  [acme@rhel5 linux]$  make NO_AUXTRACE=1 NO_LIBPERL=1 -C tools/perf O=/tmp/build/perf install-bin
  make: Entering directory `/home/acme/git/linux/tools/perf'
    BUILD:   Doing 'make -j2' parallel build

  Auto-detecting system features:
  ...                        libelf: [ on  ]
  ...                       libnuma: [ on  ]
  ...        numa_num_possible_cpus: [ OFF ]
  ...                       libperl: [ on  ]

  <SNIP>
  config/Makefile:577: Old numa library found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev >= 2.0.8
    INSTALL  binaries
  <SNIP>

This fixes the build on old systems such as RHEL/CentOS 5.11.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Victor Kamensky <victor.kamensky@linaro.org>
Cc: Vinson Lee <vlee@twopensource.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-zqriqkezppi2de2iyjin1tnc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-17 13:14:35 -03:00
Arnaldo Carvalho de Melo 179f36dde3 Revert "perf symbols: Fix mismatched declarations for elf_getphdrnum"
This reverts commit f785f23576.

We have a test to check if elf_getphdrnum() is present, so, if it fails,
we'll get:

  [acme@rhel5 linux]$ cat /tmp/build/perf/feature/test-libelf-getphdrnum.make.output
  cc1: warnings being treated as errors
  test-libelf-getphdrnum.c: In function ‘main’:
  test-libelf-getphdrnum.c:7: warning: implicit declaration of function ‘elf_getphdrnum’
  [acme@rhel5 linux]$

And this block will not be compiled:

  #ifndef HAVE_ELF_GETPHDRNUM_SUPPORT
  static int elf_getphdrnum(Elf *elf, size_t *dst)
  ...
  #endif

So, if elf_getphdrnum() is being defined somewhere, there is a problem
with the test that is not detecting that function, go fix it.

Reported-by: Vinson Lee <vlee@twopensource.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Victor Kamensky <victor.kamensky@linaro.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-qn459fal6acvcvm50i8zxx9k@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-17 13:10:05 -03:00
Linus Torvalds 9786cff38a Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fixes from Ingo Molnar:
 "Spinlock performance regression fix, plus documentation fixes"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/static_keys: Fix up the static keys documentation
  locking/qspinlock/x86: Only emit the test-and-set fallback when building guest support
  locking/qspinlock/x86: Fix performance regression under unaccelerated VMs
  locking/static_keys: Fix a silly typo
2015-09-17 08:45:23 -07:00
Linus Torvalds 1b3dfde386 Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RCU fix from Ingo Molnar:
 "Fix a false positive warning"

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  security/device_cgroup: Fix RCU_LOCKDEP_WARN() condition
2015-09-17 08:44:27 -07:00
Will Deacon df057cc7b4 arm64: errata: add module build workaround for erratum #843419
Cortex-A53 processors <= r0p4 are affected by erratum #843419 which can
lead to a memory access using an incorrect address in certain sequences
headed by an ADRP instruction.

There is a linker fix to generate veneers for ADRP instructions, but
this doesn't work for kernel modules which are built as unlinked ELF
objects.

This patch adds a new config option for the erratum which, when enabled,
builds kernel modules with the mcmodel=large flag. This uses absolute
addressing for all kernel symbols, thereby removing the use of ADRP as
a PC-relative form of addressing. The ADRP relocs are removed from the
module loader so that we fail to load any potentially affected modules.

Cc: <stable@vger.kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-09-17 11:57:03 +01:00
Will Deacon bdec97a855 arm64: compat: fix vfp save/restore across signal handlers in big-endian
When saving/restoring the VFP registers from a compat (AArch32)
signal frame, we rely on the compat registers forming a prefix of the
native register file and therefore make use of copy_{to,from}_user to
transfer between the native fpsimd_state and the compat_vfp_sigframe.

Unfortunately, this doesn't work so well in a big-endian environment.
Our fpsimd save/restore code operates directly on 128-bit quantities
(Q registers) whereas the compat_vfp_sigframe represents the registers
as an array of 64-bit (D) registers. The architecture packs the compat D
registers into the Q registers, with the least significant bytes holding
the lower register. Consequently, we need to swap the 64-bit halves when
converting between these two representations on a big-endian machine.

This patch replaces the __copy_{to,from}_user invocations in our
compat VFP signal handling code with explicit __put_user loops that
operate on 64-bit values and swap them accordingly.

Cc: <stable@vger.kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-09-17 11:57:03 +01:00
Will Deacon e56d82a116 arm64: cpu hotplug: ensure we mask out CPU_TASKS_FROZEN in notifiers
We have a couple of CPU hotplug notifiers for resetting the CPU debug
state to a sane value when a CPU comes online.

This patch ensures that we mask out CPU_TASKS_FROZEN so that we don't
miss any online events occuring due to suspend/resume.

Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-09-17 11:57:02 +01:00
Stephane Eranian 02d8dabc50 perf stat: Fix per-pkg event reporting bug
Per-pkg events need to be captured once per processor socket. The code
in check_per_pkg() ensures only one value per processor package is used.
However there is a problem with this function in case the first CPU of
the package does not measure anything for the per-pkg event, but other
CPUs do.

Consider the following:

  $ create cgroup FOO; echo $$ >FOO/tasks; taskset -c 1 noploop &
  $ perf stat -a -I 1000 -e intel_cqm/llc_occupancy/ -G FOO sleep 100
    1.00000 <not counted> Bytes intel_cqm/llc_occupancy/  FOO

The reason for this is that CPU0 in the cgroup has nothing running on it.
Yet check_per_plg() will mark socket0 as processed and no other event
value will be considered for the socket.

This patch fixes the problem by having check_per_pkg() only consider
events which actually ran.

Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1441286620-10117-1-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-16 18:01:03 -03:00
Linus Torvalds 72714841b7 Changes for 4.3-rc1
- Move ehca driver to staging/rdma and schedule for deletion
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV9xxNAAoJELgmozMOVy/dI+QP/R0afI1zc7pJe1D2RmrZWnAH
 HDWSNYJ8eVk25ptnaOes9kV6yuOV1nGiyCIGqUXk8Q7rVYbIIz0nK81S+gPLMpTU
 /la28bmUz7szvEtY+gFHZCuQvCiwjM+N7t39aehIMCc/vYnIdrOXuYMhB8kd6flL
 2mpnUFmfqMZLGh4RY1PQB9cNwVW9yYOVnG+1Z/M26wWl3NIDe4jiNoqV/jFvEf2v
 FyzjcYfjexVA47XOsfGy512Vlb+8DTtFeCz/TRl9e8tYCSHOmTcXv7jLywRoA1zn
 NNwJnXhliM9/EDqtbJMymYDAm9vzcfvXPCx1OOisVWxJxg9IF3p2/uPLeIKUSXZl
 15mfOzoTuNXlunHDQYbzC4+P2zs+uU2k6ivpd7HZgyiBkUXzftYh/6gIJcJOreU6
 1ndt2fK5hcG/Was+v6kkYaw0x6ZpawyLqHMs32V1xVcbmM5P1OFFOQFx1KDYhHH8
 WmOlcd/XmIjNY5o3ySQHSKjO6Ar0IfNyzpU3jUzg2AFbZv8m2BgYEhQOnrggxBtM
 deFbDlxMnIrsIJtsHBmr5Y/nsgIYpkxLK4xUod76yZSRuyjLCH/2C0otubS1w1vH
 4unU9zJXboBi7naPE5/fdIPMhwZu1X47xUyrwGksz3pHyiRpnhq55t+AWpsHCrg+
 +XYexztBX/cPReacpWJR
 =4XzR
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma driver move from Doug Ledford:
 "This is a move only, no functional changes.

  I tried to get it in prior to the rc1 release, but we were waiting on
  IBM to get back to us that they were OK with the deprecation and
  eventual removal of this driver.  That OK didn't materialize until
  last week, so integration and testing time pushed us beyond the rc1
  release.

  Summary:

   - Move ehca driver to staging/rdma and schedule for deletion"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma:
  IB/ehca: Deprecate driver, move to staging, schedule deletion
2015-09-16 09:16:20 -07:00
Linus Torvalds 30255100d7 Two patches for nct6775 driver:
Add support for NCT6793D, and fix swapped registers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV+X7kAAoJEMsfJm/On5mBhPAP/2aWMuRrLl2bx7EUgqB84PAV
 i3ynORuSBX1yfVPYxaU1W7OsoXlD4+62gMLgvmVO2w+yjLnveowI9cCQYL3wmcg3
 ASG5NdpbwKGZwYc0q7ofi67zdYYYEdR9OtR1Raw8DROV7cZiuhhnA6vGYEI9m5Dz
 TbSAolTcaBino0cNGVRiD/ohktqvJSxnnxI73KRx0bgAOS3oiCRCdn760DaiXpEn
 FX99JtB9arBFX5wTx2KHQpGvFiqtIGUk+2ghyiKODjmfI2Hy+Jgh/c4VMcb9+p8K
 VP/JYXh1k7fBBOZlmn4qXJh8Ls36k0PwKefa9KbyyflICNYLjv7bqv3gt9hCQcW/
 BoXR58mH6wfrjhMdnZv3gNEDj1rN8FkMtAEYHNyykVnHOLbPDM0D1mDesKdQeO8K
 mvMGNk0FU4j6JNS7GmhnoZUE39qBjG9uiWqElt3aiVMP+t9eV4If0BSxQV0xe+un
 b1CwbcpEtvdXQn4DW3Qn0pu+aI/WpBTU1QoUH+3Z2XmPaaQGvZx+4Qm4XhlOgFkW
 WFi3Cc+Uets3IbhsfCdGwNttGjufHb28dAX3IfkCdpEOd62HH03jsMobKT2PEKx1
 01CzyBwLUhx3EkqZCWJvlM8OVbqG1991JS5e0qJ2tMJgND242ZiL71TtXyahMF/H
 mmYb9Wrg9hgvzBwolKrg
 =/U4E
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus-v4.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:
 "Two patches for the nct6775 driver: add support for NCT6793D, and fix
  swapped registers"

* tag 'hwmon-for-linus-v4.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (nct6775) Add support for NCT6793D
  hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for most chips
2015-09-16 08:49:41 -07:00
Linus Torvalds 9efeaaf9a0 This is a first set of pin control fixes for the v4.3 series:
- Some IS_ERR() fixes from Julia Lawall. I always wanted the compiler
   to catch these but error pointers by nailing them as an err pointer
   intrinsic type or something seem to be a "no can do". In any
   case, cocinelle is obviously up to the task, better than bugs
   staying around.
 
 - Better error handling for NULL GPIO chips.
 
 - Fix a compile error from the big irq desc refactoring. I'm
   surprised the fallout wasn't bigger than this.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV+VRDAAoJEEEQszewGV1z7UQP+wZi0VTV3VY04sbGxFe9NTCl
 BSXcFYoxq/6SMRkgewa47MIqEejO0q8Qq+2wE1HhUy4xiCSg5XLxCJGePqUGsglf
 0GjUbTinXuc+HqEdR56xqz+H8RAjC5bqlUFOhXNPhpmAJlLvg6WL4t/08Dcd2N/9
 RuoAlbPqzO8ingAvoj4r8cwF7/4pRojOvh/aFQ5jZ4aVriL04Uqnzdnf4OmplNIj
 gzEMICTIg6hQo0iWrKnn97DSHGR4UFKn7FQxF6g48tOIzE4hiWgfyXdpY6emG0Zi
 eeEH6y/kAk3V3kmNqLe83N8TLBiHvKoj33s/ZtFuLHoakeMcQR3B3FUodQWAEs8A
 6bzB8bninXEU8h8eyOhly/0DIOM6rGTEyNgPcJI0F5CSfcB5uFdl5s+X4xEEiwKo
 Bsx1sfLKKI7p7lWXbML+7B+3JcgLr4E0yT6QsC9yA2AyHIgtZIBfp1hc82U9Qfgf
 lheT09XGGS+8uuECQuG3woI/qokZdHlnIGsY28sqEJVrSKyXoYSFZ03YZi2DEKsj
 2qPJfpfEE6x6gMUsfh+u1oJlfYrJfSU+X4uBFJ9estLOX7J9y/nygULZutQFImZ1
 hUBhFDnUiKe33oe4VuLplDt/KkQ1JGC32mgYsSVGTLzUS2/vyeTlYsLXxsohLgv6
 0fec5ExVS9/JWJHwFwOf
 =xpIg
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v4.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
 "This is a first set of pin control fixes for the v4.3 series.  Nothing
  special to say, business as usual.

   - Some IS_ERR() fixes from Julia Lawall.  I always wanted the
     compiler to catch these but error pointers by nailing them as an
     err pointer intrinsic type or something seem to be a "no can do".
     In any case, cocinelle is obviously up to the task, better than
     bugs staying around.

   - Better error handling for NULL GPIO chips.

   - Fix a compile error from the big irq desc refactoring.  I'm
     surprised the fallout wasn't bigger than this"

* tag 'pinctrl-v4.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: samsung: s3c24xx: fix syntax error
  pinctrl: core: Warn about NULL gpio_chip in pinctrl_ready_for_gpio_range()
  pinctrl: join lines that can be a single line within 80 columns
  pinctrl: digicolor: convert null test to IS_ERR test
  pinctrl: qcom: ssbi: convert null test to IS_ERR test
2015-09-16 08:07:04 -07:00
Linus Torvalds d1291ebd85 This is the first round of GPIO fixes for v4.3:
- Return value checks and thus nicer errorpath for two drivers.
 
 - Make GPIO_RCAR arch neutral.
 
 - Propagate errors from GPIO chip ->get() vtable call. It turned
   out these can actually fail sometimes, especially on slowpath
   controllers doing I2C traffic and similar.
 
 - Update documentation to be in sync with the massive changes in
   the v4.3 merge window, phew.
 
 - Handle deferred probe properly in the OMAP driver.
 
 - Get rid of surplus MODULE_ALIAS() from sx150x.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV+RcuAAoJEEEQszewGV1zMqwQALnqXAvtJGw7CaKOiShm3ywH
 JPm4jMh7iiUFI8H+k6TscwxRz7bPKrezsCZleUxz/BOu/sAA9bVarYU3Fcl5HwZD
 0qVszWCQ3E44qMh708F/B2kuQWdMl3u0aY9AGcNm0e4uDZ+hxXQ/jw+B1N/W0KFL
 vkCCCG/uE5eoRsOkOlEtm0UI+DjHRSpzEkgZ/1HmFfBtZaQuvHOMc5ouzT72hMQn
 YOk9lKPqjivGzDZYiISfmb62uuDQ8YnwsWZvP5SEbNdEgSlVes5Njd59pnxJgjYg
 tSQO37Sm0kNafbIao71DHrTBWHRxvsNeLuaDRnfNj95W8QtcYjvWrqCd3kBIeAt5
 ZgUlm6mKEeZuz2PW+biT4DC7hPpV0LXCwTjjHtJ6S5w7JuM3+2HpHDItbYfs5SiL
 40VlXKuLPOlxt6f179+4YTRwtaotQ6Bw0Rcflh5Sa4qq7LmZFghwSwtCDsNsWhWq
 qnFRoqbDmcxXBbnOuTvhM4DVCv7bvyQpos3EoFVANGg/T2zJ+8TEfi1ClHd5CbFO
 WHbgVaYVwLsfGgYX5Hq5aF/dhl4NSSDpikUhcDCvX62HoeImGFcWrybzIjk+9QND
 dCFS2ldd2znVZsCszCVAvtKmv0+TACb2iUK8Anhte8aYc1PLnhYT95BqUSB9QiyI
 Df6Pj5FQiLEyAnxVIrEh
 =72G1
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "This is the first round of GPIO fixes for v4.3.  Quite a lot of
  patches, but the influx of new stuff in the merge window was equally
  big, so I'm not surprised.

   - Return value checks and thus nicer errorpath for two drivers.

   - Make GPIO_RCAR arch neutral.

   - Propagate errors from GPIO chip ->get() vtable call.  It turned out
     these can actually fail sometimes, especially on slowpath
     controllers doing I2C traffic and similar.

   - Update documentation to be in sync with the massive changes in the
     v4.3 merge window, phew.

   - Handle deferred probe properly in the OMAP driver.

   - Get rid of surplus MODULE_ALIAS() from sx150x"

* tag 'gpio-v4.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: omap: Fix GPIO numbering for deferred probe
  Documentation: gpio: Explain that <function>-gpio is also supported
  gpio: omap: Fix gpiochip_add() handling for deferred probe
  gpio: sx150x: Remove unnecessary MODULE_ALIAS()
  Documentation: gpio: board: describe the con_id parameter
  Documentation: gpio: board: add flags parameter to gpiod_get*() functions
  gpio: Propagate errors from chip->get()
  gpio: rcar: GPIO_RCAR doesn't relate to ARM
  gpio: mxs: need to check return value of irq_alloc_generic_chip
  gpio: mxc: need to check return value of irq_alloc_generic_chip
2015-09-16 07:58:58 -07:00
Linus Torvalds aa57e0b281 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
 "This fixes the following issues:

   - The selftest overreads the IV test vector.

  - Fix potential infinite loop in sunxi-ss driver.

   - Fix powerpc build failure when VMX is set without VSX"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: testmgr - don't copy from source IV too much
  crypto: sunxi-ss - Fix a possible driver hang with ciphers
  crypto: vmx - VMX crypto should depend on CONFIG_VSX
2015-09-16 07:53:33 -07:00
David Woodhouse 03da3ff1cf x86/platform: Fix Geode LX timekeeping in the generic x86 build
In 2007, commit 07190a08ee ("Mark TSC on GeodeLX reliable")
bypassed verification of the TSC on Geode LX. However, this code
(now in the check_system_tsc_reliable() function in
arch/x86/kernel/tsc.c) was only present if CONFIG_MGEODE_LX was
set.

OpenWRT has recently started building its generic Geode target
for Geode GX, not LX, to include support for additional
platforms. This broke the timekeeping on LX-based devices,
because the TSC wasn't marked as reliable:
https://dev.openwrt.org/ticket/20531

By adding a runtime check on is_geode_lx(), we can also include
the fix if CONFIG_MGEODEGX1 or CONFIG_X86_GENERIC are set, thus
fixing the problem.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marcelo Tosatti <marcelo@kvack.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1442409003.131189.87.camel@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-16 16:00:12 +02:00