]> Git Repo - linux.git/log
linux.git
10 years agoceph: fix setting empty extended attribute
Yan, Zheng [Wed, 17 Dec 2014 13:26:47 +0000 (21:26 +0800)]
ceph: fix setting empty extended attribute

make sure 'value' is not null. otherwise __ceph_setxattr will remove
the extended attribute.

Signed-off-by: Yan, Zheng <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
10 years agoceph: fix mksnap crash
Yan, Zheng [Wed, 10 Dec 2014 08:17:31 +0000 (16:17 +0800)]
ceph: fix mksnap crash

mksnap reply only contain 'target', does not contain 'dentry'. So
it's wrong to use req->r_reply_info.head->is_dentry to detect traceless
reply.

Signed-off-by: Yan, Zheng <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
10 years agoceph: do_sync is never initialized
Dan Carpenter [Fri, 28 Nov 2014 08:33:34 +0000 (11:33 +0300)]
ceph: do_sync is never initialized

Probably this code was syncing a lot more often then intended because
the do_sync variable wasn't set to zero.

Cc: [email protected] # v3.11+
Fixes: c62988ec0910 ('ceph: avoid meaningless calling ceph_caps_revoking if sync_mode == WB_SYNC_ALL.')
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
10 years agolibceph: fixup includes in pagelist.h
Ilya Dryomov [Mon, 17 Nov 2014 18:45:24 +0000 (21:45 +0300)]
libceph: fixup includes in pagelist.h

pagelist.h needs to include linux/types.h and asm/byteorder.h and not
rely on other headers pulling yet another set of headers.

Signed-off-by: Ilya Dryomov <[email protected]>
10 years agoceph: support inline data feature
Yan, Zheng [Mon, 17 Nov 2014 02:01:03 +0000 (10:01 +0800)]
ceph: support inline data feature

Signed-off-by: Yan, Zheng <[email protected]>
10 years agoceph: flush inline version
Yan, Zheng [Fri, 14 Nov 2014 14:39:13 +0000 (22:39 +0800)]
ceph: flush inline version

After converting inline data to normal data, client need to flush
the new i_inline_version (CEPH_INLINE_NONE) to MDS. This commit makes
cap messages (sent to MDS) contain inline_version and inline_data.
Client always converts inline data to normal data before data write,
so the inline data length part is always zero.

Signed-off-by: Yan, Zheng <[email protected]>
10 years agoceph: convert inline data to normal data before data write
Yan, Zheng [Fri, 14 Nov 2014 14:38:29 +0000 (22:38 +0800)]
ceph: convert inline data to normal data before data write

Before any data write, convert inline data to normal data and set
i_inline_version to CEPH_INLINE_NONE. The OSD request that saves
inline data to object contains 3 operations (CMPXATTR, WRITE and
SETXATTR). It compares a xattr named 'inline_version' to prevent
old data overwrites newer data.

Signed-off-by: Yan, Zheng <[email protected]>
10 years agoceph: sync read inline data
Yan, Zheng [Fri, 14 Nov 2014 14:36:18 +0000 (22:36 +0800)]
ceph: sync read inline data

we can't use getattr to fetch inline data while holding Fr cap,
because it can cause deadlock. If we need to sync read inline data,
drop cap refs first, then use getattr to fetch inline data.

Signed-off-by: Yan, Zheng <[email protected]>
10 years agoceph: fetch inline data when getting Fcr cap refs
Yan, Zheng [Fri, 14 Nov 2014 14:10:07 +0000 (22:10 +0800)]
ceph: fetch inline data when getting Fcr cap refs

we can't use getattr to fetch inline data after getting Fcr caps,
because it can cause deadlock. The solution is try bringing inline
data to page cache when not holding any cap, and hope the inline
data page is still there after getting the Fcr caps. If the page
is still there, pin it in page cache for later IO.

Signed-off-by: Yan, Zheng <[email protected]>
10 years agoceph: use getattr request to fetch inline data
Yan, Zheng [Fri, 14 Nov 2014 13:56:29 +0000 (21:56 +0800)]
ceph: use getattr request to fetch inline data

Add a new parameter 'locked_page' to ceph_do_getattr(). If inline data
in getattr reply will be copied to the page.

Signed-off-by: Yan, Zheng <[email protected]>
10 years agoceph: add inline data to pagecache
Yan, Zheng [Fri, 14 Nov 2014 13:41:55 +0000 (21:41 +0800)]
ceph: add inline data to pagecache

Request reply and cap message can contain inline data. add inline data
to the page cache if there is Fc cap.

Signed-off-by: Yan, Zheng <[email protected]>
10 years agoceph: parse inline data in MClientReply and MClientCaps
Yan, Zheng [Fri, 14 Nov 2014 13:29:55 +0000 (21:29 +0800)]
ceph: parse inline data in MClientReply and MClientCaps

Signed-off-by: Yan, Zheng <[email protected]>
10 years agolibceph: specify position of extent operation
Yan, Zheng [Thu, 13 Nov 2014 06:40:37 +0000 (14:40 +0800)]
libceph: specify position of extent operation

allow specifying position of extent operation in multi-operations
osd request. This is required for cephfs to convert inline data to
normal data (compare xattr, then write object).

Signed-off-by: Yan, Zheng <[email protected]>
Reviewed-by: Ilya Dryomov <[email protected]>
10 years agolibceph: add CREATE osd operation support
Yan, Zheng [Thu, 13 Nov 2014 02:47:25 +0000 (10:47 +0800)]
libceph: add CREATE osd operation support

Add CEPH_OSD_OP_CREATE support.  Also change libceph to not treat
CEPH_OSD_OP_DELETE as an extent op and add an assert to that end.

Signed-off-by: Yan, Zheng <[email protected]>
Reviewed-by: Ilya Dryomov <[email protected]>
10 years agolibceph: add SETXATTR/CMPXATTR osd operations support
Yan, Zheng [Wed, 12 Nov 2014 06:00:43 +0000 (14:00 +0800)]
libceph: add SETXATTR/CMPXATTR osd operations support

Signed-off-by: Yan, Zheng <[email protected]>
Reviewed-by: Ilya Dryomov <[email protected]>
10 years agorbd: don't treat CEPH_OSD_OP_DELETE as extent op
Ilya Dryomov [Fri, 21 Nov 2014 19:16:43 +0000 (22:16 +0300)]
rbd: don't treat CEPH_OSD_OP_DELETE as extent op

CEPH_OSD_OP_DELETE is not an extent op, stop treating it as such.  This
sneaked in with discard patches - it's one of the three osd ops (the
other two are CEPH_OSD_OP_TRUNCATE and CEPH_OSD_OP_ZERO) that discard
is implemented with.

Signed-off-by: Ilya Dryomov <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
10 years agoceph: remove unused stringification macros
Ilya Dryomov [Thu, 13 Nov 2014 17:42:35 +0000 (20:42 +0300)]
ceph: remove unused stringification macros

These were used to report git versions a long time ago.

Signed-off-by: Ilya Dryomov <[email protected]>
10 years agolibceph: require cephx message signature by default
Yan, Zheng [Tue, 11 Nov 2014 08:30:55 +0000 (16:30 +0800)]
libceph: require cephx message signature by default

Signed-off-by: Yan, Zheng <[email protected]>
Reviewed-by: Ilya Dryomov <[email protected]>
10 years agoceph: introduce global empty snap context
Yan, Zheng [Thu, 6 Nov 2014 07:09:41 +0000 (15:09 +0800)]
ceph: introduce global empty snap context

Current snaphost code does not properly handle moving inode from one
empty snap realm to another empty snap realm. After changing inode's
snap realm, some dirty pages' snap context can be not equal to inode's
i_head_snap. This can trigger BUG() in ceph_put_wrbuffer_cap_refs()

The fix is introduce a global empty snap context for all empty snap
realm. This avoids triggering the BUG() for filesystem with no snapshot.

Fixes: http://tracker.ceph.com/issues/9928
Signed-off-by: Yan, Zheng <[email protected]>
Reviewed-by: Ilya Dryomov <[email protected]>
10 years agoceph: message versioning fixes
John Spray [Thu, 30 Oct 2014 17:15:26 +0000 (17:15 +0000)]
ceph: message versioning fixes

There were two places we were assigning version in host byte order
instead of network byte order.

Also in MSG_CLIENT_SESSION we weren't setting compat_version in the
header to reflect continued compatability with older MDSs.

Fixes: http://tracker.ceph.com/issues/9945
Signed-off-by: John Spray <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
10 years agolibceph: update ceph_msg_header structure
John Spray [Thu, 16 Oct 2014 11:05:34 +0000 (12:05 +0100)]
libceph: update ceph_msg_header structure

2 bytes of what was reserved space is now used by userspace for the
compat_version field.

Signed-off-by: John Spray <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
10 years agolibceph: message signature support
Yan, Zheng [Tue, 4 Nov 2014 08:33:37 +0000 (16:33 +0800)]
libceph: message signature support

Signed-off-by: Yan, Zheng <[email protected]>
10 years agolibceph: store session key in cephx authorizer
Yan, Zheng [Tue, 4 Nov 2014 08:32:35 +0000 (16:32 +0800)]
libceph: store session key in cephx authorizer

Session key is required when calculating message signature. Save the session
key in authorizer, this avoid lookup ticket handler for each message

Signed-off-by: Yan, Zheng <[email protected]>
10 years agoceph, rbd: delete unnecessary checks before two function calls
SF Markus Elfring [Sun, 2 Nov 2014 14:20:59 +0000 (15:20 +0100)]
ceph, rbd: delete unnecessary checks before two function calls

The functions ceph_put_snap_context() and iput() test whether their
argument is NULL and then return immediately. Thus the test around the
call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
[[email protected]: squashed rbd.c hunk, changelog]
Signed-off-by: Ilya Dryomov <[email protected]>
10 years agoceph: introduce a new inode flag indicating if cached dentries are ordered
Yan, Zheng [Wed, 22 Oct 2014 01:09:56 +0000 (18:09 -0700)]
ceph: introduce a new inode flag indicating if cached dentries are ordered

After creating/deleting/renaming file, offsets of sibling dentries may
change. So we can not use cached dentries to satisfy readdir. But we can
still use the cached dentries to conclude -ENOENT for lookup.

This patch introduces a new inode flag indicating if child dentries are
ordered. The flag is set at the same time marking a directory complete.
After creating/deleting/renaming file, we clear the flag on directory
inode. This prevents ceph_readdir() from using cached dentries to satisfy
readdir syscall.

Signed-off-by: Yan, Zheng <[email protected]>
10 years agolibceph: nuke ceph_kvfree()
Ilya Dryomov [Thu, 23 Oct 2014 12:32:57 +0000 (16:32 +0400)]
libceph: nuke ceph_kvfree()

Use kvfree() from linux/mm.h instead, which is identical.  Also fix the
ceph_buffer comment: we will allocate with kmalloc() up to 32k - the
value of PAGE_ALLOC_COSTLY_ORDER, but that really is just an
implementation detail so don't mention it at all.

Signed-off-by: Ilya Dryomov <[email protected]>
10 years agoceph: fix file lock interruption
Yan, Zheng [Tue, 14 Oct 2014 02:33:35 +0000 (10:33 +0800)]
ceph: fix file lock interruption

When a lock operation is interrupted, current code sends a unlock request to
MDS to undo the lock operation. This method does not work as expected because
the unlock request can drop locks that have already been acquired.

The fix is use the newly introduced CEPH_LOCK_FCNTL_INTR/CEPH_LOCK_FLOCK_INTR
requests to interrupt blocked file lock request. These requests do not drop
locks that have alread been acquired, they only interrupt blocked file lock
request.

Signed-off-by: Yan, Zheng <[email protected]>
10 years agodm thin: fix crash by initializing thin device's refcount and completion earlier
Marc Dionne [Wed, 17 Dec 2014 12:59:59 +0000 (07:59 -0500)]
dm thin: fix crash by initializing thin device's refcount and completion earlier

Commit 80e96c5484be ("dm thin: do not allow thin device activation
while pool is suspended") delayed the initialization of a new thin
device's refcount and completion until after this new thin was added
to the pool's active_thins list and the pool lock is released.  This
opens a race with a worker thread that walks the list and calls
thin_get/put, noticing that the refcount goes to 0 and calling
complete, freezing up the system and giving the oops below:

 kernel: BUG: unable to handle kernel NULL pointer dereference at           (null)
 kernel: IP: [<ffffffff810d360b>] __wake_up_common+0x2b/0x90

 kernel: Call Trace:
 kernel: [<ffffffff810d3683>] __wake_up_locked+0x13/0x20
 kernel: [<ffffffff810d3dc7>] complete+0x37/0x50
 kernel: [<ffffffffa0595c50>] thin_put+0x20/0x30 [dm_thin_pool]
 kernel: [<ffffffffa059aab7>] do_worker+0x667/0x870 [dm_thin_pool]
 kernel: [<ffffffff816a8a4c>] ? __schedule+0x3ac/0x9a0
 kernel: [<ffffffff810b1aef>] process_one_work+0x14f/0x400
 kernel: [<ffffffff810b206b>] worker_thread+0x6b/0x490
 kernel: [<ffffffff810b2000>] ? rescuer_thread+0x260/0x260
 kernel: [<ffffffff810b6a7b>] kthread+0xdb/0x100
 kernel: [<ffffffff810b69a0>] ? kthread_create_on_node+0x170/0x170
 kernel: [<ffffffff816ad7ec>] ret_from_fork+0x7c/0xb0
 kernel: [<ffffffff810b69a0>] ? kthread_create_on_node+0x170/0x170

Set the thin device's initial refcount and initialize the completion
before adding it to the pool's active_thins list in thin_ctr().

Signed-off-by: Marc Dionne <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
10 years agoALSA: hda - Add quirk for Packard Bell EasyNote MX65
Takashi Iwai [Mon, 15 Dec 2014 12:47:25 +0000 (13:47 +0100)]
ALSA: hda - Add quirk for Packard Bell EasyNote MX65

Packard Bell EasyNote MX65 with AD1986A codec needs a few fixups,
namely, the pin config overrides to set only the known I/O pins and
the EAPD has to be turned on.  In addition, add stereo mix input
forcibly for avoiding the weird KDE behavior by this update.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88251
Signed-off-by: Takashi Iwai <[email protected]>
10 years agodm thin: fix missing out-of-data-space to write mode transition if blocks are released
Joe Thornber [Thu, 11 Dec 2014 11:12:19 +0000 (11:12 +0000)]
dm thin: fix missing out-of-data-space to write mode transition if blocks are released

Discard bios and thin device deletion have the potential to release data
blocks.  If the thin-pool is in out-of-data-space mode, and blocks were
released, transition the thin-pool back to full write mode.

The correct time to do this is just after the thin-pool metadata commit.
It cannot be done before the commit because the space maps will not
allow immediate reuse of the data blocks in case there's a rollback
following power failure.

Signed-off-by: Joe Thornber <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Cc: [email protected]
10 years agodm thin: fix inability to discard blocks when in out-of-data-space mode
Joe Thornber [Wed, 10 Dec 2014 17:06:57 +0000 (17:06 +0000)]
dm thin: fix inability to discard blocks when in out-of-data-space mode

When the pool was in PM_OUT_OF_SPACE mode its process_prepared_discard
function pointer was incorrectly being set to
process_prepared_discard_passdown rather than process_prepared_discard.

This incorrect function pointer meant the discard was being passed down,
but not effecting the mapping.  As such any discard that was issued, in
an attempt to reclaim blocks, would not successfully free data space.

Reported-by: Eric Sandeen <[email protected]>
Signed-off-by: Joe Thornber <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Cc: [email protected]
10 years agoALSA: usb-audio: add native DSD support for Matrix Audio DACs
Jurgen Kramer [Wed, 17 Dec 2014 16:45:20 +0000 (17:45 +0100)]
ALSA: usb-audio: add native DSD support for Matrix Audio DACs

This patch adds native DSD support for two XMOS based DACs from Matrix Audio:
- X-Sabre
- Mini-i Pro

Signed-off-by: Jurgen Kramer <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
10 years agodrm/msm: Deletion of unnecessary checks before the function call "release_firmware"
Markus Elfring [Tue, 25 Nov 2014 12:44:20 +0000 (13:44 +0100)]
drm/msm: Deletion of unnecessary checks before the function call "release_firmware"

The release_firmware() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Reviewed-by: Thierry Reding <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
10 years agodrm/msm: Deletion of unnecessary checks before two function calls
Markus Elfring [Tue, 25 Nov 2014 13:30:28 +0000 (14:30 +0100)]
drm/msm: Deletion of unnecessary checks before two function calls

The functions framebuffer_release() and vunmap() perform also input
parameter validation. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Reviewed-by: Thierry Reding <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
10 years agoclk: samsung: Fix Exynos 5420 pinctrl setup and clock disable failure due to domain...
Krzysztof Kozlowski [Fri, 5 Dec 2014 14:15:34 +0000 (15:15 +0100)]
clk: samsung: Fix Exynos 5420 pinctrl setup and clock disable failure due to domain being gated

Audio subsystem clocks are located in separate block. On Exynos 5420 if
clock for this block (from main clock domain) 'mau_epll' is gated then
any read or write to audss registers will block.

This kind of boot hang was observed on Arndale Octa and Peach Pi/Pit
after introducing runtime PM to pl330 DMA driver. After that commit the
'mau_epll' was gated, because the "amba" clock was disabled and there
were no more users of mau_epll.

The system hang on one of steps:
1. Disabling unused clocks from audss block.
2. During audss GPIO setup (just before probing i2s0 because
   samsung_pinmux_setup() tried to access memory from audss block which was
   gated.

Add a workaround for this by enabling the 'mau_epll' clock in probe.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Sylwester Nawrocki <[email protected]>
Tested-by: Javier Martinez Canillas <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Signed-off-by: Michael Turquette <[email protected]>
10 years agoperf symbols: Fix use after free in filename__read_build_id
Mitchell Krome [Tue, 16 Dec 2014 02:16:12 +0000 (12:16 +1000)]
perf symbols: Fix use after free in filename__read_build_id

In filename__read_build_id, phdr points to memory in buf, which gets realloced
before a call to fseek that uses phdr->p_offset. This change stores the value
of p_offset before buf is realloced, so the fseek can use the value safely.

Signed-off-by: Mitchell Krome <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/20141216021612.GA7199@mitchell
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agoperf evlist: Use roundup_pow_of_two
Arnaldo Carvalho de Melo [Tue, 16 Dec 2014 16:24:41 +0000 (13:24 -0300)]
perf evlist: Use roundup_pow_of_two

And remove the equivalent next_pow2{_l} functions.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools: Adopt roundup_pow_of_two
Arnaldo Carvalho de Melo [Tue, 16 Dec 2014 16:19:23 +0000 (13:19 -0300)]
tools: Adopt roundup_pow_of_two

To replace equivalent code used in the mmap_pages command line
parameter handling in tools/perf.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agoperf tools: Make the mmap length autotuning more robust
Arnaldo Carvalho de Melo [Tue, 16 Dec 2014 15:19:00 +0000 (12:19 -0300)]
perf tools: Make the mmap length autotuning more robust

If /proc/sys/kernel/perf_event_mlock_kb is not (power of 2 + PAGE_SIZE_in_kb)
and we let the perf tools do mmap length autosizing based on that, then, for
non-CAP_IPC_LOCK users when /proc/sys/kernel/perf_event_paranoid is > -1, then
we get an -EINVAL that ends up in:

  [acme@ssdandy linux]$ trace usleep 1
  Invalid argument
  [acme@ssdandy linux]$ perf record usleep 1
  failed to mmap with 22 (Invalid argument)

After this fix:

  [acme@ssdandy linux]$ trace usleep 1
  <SNIP>
   0.806 ( 0.006 ms): munmap(addr: 0x7f7e4740a000, len: 66467) = 0
   0.869 ( 0.002 ms): brk(                                   ) = 0x7bb000
   0.873 ( 0.003 ms): brk(brk: 0x7dc000                      ) = 0x7dc000
   0.877 ( 0.001 ms): brk(                                   ) = 0x7dc000
   0.953 ( 0.058 ms): nanosleep(rqtp: 0x7fff26ab9420         ) = 0
   0.959 ( 0.000 ms): exit_group(
  [acme@ssdandy linux]$ perf record usleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.017 MB perf.data (~759 samples) ]
  [acme@ssdandy linux]$

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools: Adopt rounddown_pow_of_two and deps
Arnaldo Carvalho de Melo [Tue, 16 Dec 2014 15:14:11 +0000 (12:14 -0300)]
tools: Adopt rounddown_pow_of_two and deps

Will be used to make sure we pass a power of two when automatically
setting up the perf_mmap addr range length, as the kernel code
validating input on /proc/sys/kernel/perf_event_mlock_kb accepts any
integer, if we plain use it to set up the mmap lenght, we may get an
EINVAL when passing a non power of two.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools: Adopt fls_long and deps
Arnaldo Carvalho de Melo [Tue, 16 Dec 2014 14:26:35 +0000 (11:26 -0300)]
tools: Adopt fls_long and deps

Will be used when adopting rounddown_pow_of_two.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools: Move bitops.h from tools/perf/util to tools/
Arnaldo Carvalho de Melo [Tue, 16 Dec 2014 13:55:42 +0000 (10:55 -0300)]
tools: Move bitops.h from tools/perf/util to tools/

So that we better mirror the kernel sources and make it available for
other tools.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools: Introduce asm-generic/bitops.h
Arnaldo Carvalho de Melo [Tue, 16 Dec 2014 13:53:27 +0000 (10:53 -0300)]
tools: Introduce asm-generic/bitops.h

In preparation for moving linux/bitops.h from tools/perf/util/ to
tools/include/.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib
Arnaldo Carvalho de Melo [Mon, 15 Dec 2014 22:50:12 +0000 (19:50 -0300)]
tools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib

To match the Linux kernel source code structure from where this code came from.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools: Whitespace prep patches for moving bitops.h
Arnaldo Carvalho de Melo [Mon, 15 Dec 2014 20:08:00 +0000 (17:08 -0300)]
tools: Whitespace prep patches for moving bitops.h

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/
Arnaldo Carvalho de Melo [Mon, 15 Dec 2014 19:44:26 +0000 (16:44 -0300)]
tools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/

To match the Linux kernel source code structure from where this code came from.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools: Move code originally from linux/log2.h to tools/include/linux/
Arnaldo Carvalho de Melo [Mon, 15 Dec 2014 19:04:11 +0000 (16:04 -0300)]
tools: Move code originally from linux/log2.h to tools/include/linux/

From tools/perf/util/include/linux, so that it becomes accessible to
other tools/.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agotools: Move __ffs implementation to tools/include/asm-generic/bitops/__ffs.h
Arnaldo Carvalho de Melo [Mon, 15 Dec 2014 18:07:24 +0000 (15:07 -0300)]
tools: Move __ffs implementation to tools/include/asm-generic/bitops/__ffs.h

To match the Linux kernel source code structure from where this code came from.

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
10 years agodrm/tegra: dc: Select root window for event dispatch
Sean Paul [Wed, 19 Nov 2014 18:04:49 +0000 (13:04 -0500)]
drm/tegra: dc: Select root window for event dispatch

In finish pageflip, the driver was not selecting the root window when
dispatching events. This exposed a race where a plane update would
change the window selection and cause tegra_dc_finish_page_flip to check
the wrong base address.

This patch also protects access to the window selection register as well
as the registers affected by it.

Signed-off-by: Sean Paul <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
10 years agodrm/tegra: gem: Use the proper size for GEM objects
Thierry Reding [Tue, 16 Dec 2014 15:41:47 +0000 (16:41 +0100)]
drm/tegra: gem: Use the proper size for GEM objects

If the requested buffer size wasn't a multiple of the page size, the
IOMMU code would round down the size to the next multiple of the page
size, thereby causing translation errors. To fix this we no longer pass
around the requested size but reuse the computed size of the GEM object.
This is already rounded to the next page boundary, so mapping that size
works out fine.

Signed-off-by: Thierry Reding <[email protected]>
10 years agodrm/tegra: gem: Flush buffer objects upon allocation
Thierry Reding [Tue, 16 Dec 2014 15:35:26 +0000 (16:35 +0100)]
drm/tegra: gem: Flush buffer objects upon allocation

Buffers obtained via shmem may still have associated cachelines. If they
aren't properly flushed they may cause framebuffer corruption if the
cache gets flushed after the application has drawn to it.

Signed-off-by: Thierry Reding <[email protected]>
10 years agodrm/tegra: dc: Fix a potential race on page-flip completion
Thierry Reding [Tue, 16 Dec 2014 15:33:27 +0000 (16:33 +0100)]
drm/tegra: dc: Fix a potential race on page-flip completion

Page-flip completion could race with page-flip submission, so extend the
critical section to include all accesses to page-flip related data.

Reported-by: Alexandre Courbot <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
10 years agodrm/tegra: dc: Consistently use the same pipe
Thierry Reding [Tue, 16 Dec 2014 15:03:13 +0000 (16:03 +0100)]
drm/tegra: dc: Consistently use the same pipe

The hardware pipe numbers don't always match the DRM CRTC indices. This
can happen for example if the first display controller defers probe,
causing it to be registered with DRM after the second display
controller. When that happens the hardware pipe numbers and DRM CRTC
indices become different. Make sure that the CRTC index is always used
when accessing per-CRTC VBLANK data. This can be ensured by using the
drm_crtc_vblank_*() API, which will do the right thing automatically
given a struct drm_crtc *.

Signed-off-by: Thierry Reding <[email protected]>
10 years agodrm/irq: Add drm_crtc_vblank_count()
Thierry Reding [Tue, 16 Dec 2014 12:08:47 +0000 (13:08 +0100)]
drm/irq: Add drm_crtc_vblank_count()

This function is the KMS native variant of drm_vblank_count(). It takes
a struct drm_crtc * instead of a struct drm_device * and an index of the
CRTC.

Eventually the goal is to access vblank data through the CRTC only so
that the per-CRTC data can be moved to struct drm_crtc.

Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
10 years agodrm/irq: Add drm_crtc_handle_vblank()
Thierry Reding [Mon, 15 Dec 2014 13:47:18 +0000 (14:47 +0100)]
drm/irq: Add drm_crtc_handle_vblank()

This function is the KMS native variant of drm_handle_vblank(). It takes
a struct drm_crtc * instead of a struct drm_device * and an index of the
CRTC.

Eventually the goal is to access vblank data through the CRTC only so
that the per-CRTC data can be moved to struct drm_crtc.

Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
10 years agodrm/irq: Add drm_crtc_send_vblank_event()
Thierry Reding [Mon, 15 Dec 2014 13:47:18 +0000 (14:47 +0100)]
drm/irq: Add drm_crtc_send_vblank_event()

This function is the KMS native variant of drm_send_vblank_event(). It
takes a struct drm_crtc * instead of a struct drm_device * and an index
of the CRTC.

Eventually the goal is to access vblank data through the CRTC only so
that the per-CRTC data can be moved to struct drm_crtc.

Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
10 years agovfs: make mounts and mountstats honor root dir like mountinfo does
Dmitry V. Levin [Tue, 16 Dec 2014 03:59:37 +0000 (06:59 +0300)]
vfs: make mounts and mountstats honor root dir like mountinfo does

As we already show mountpoints relative to the root directory, thanks
to the change made back in 2000, change show_vfsmnt() and show_vfsstat()
to skip out-of-root mountpoints the same way as show_mountinfo() does.

Signed-off-by: Dmitry V. Levin <[email protected]>
Signed-off-by: Al Viro <[email protected]>
10 years agovfs: cleanup show_mountinfo
Dmitry V. Levin [Wed, 17 Oct 2012 16:29:36 +0000 (20:29 +0400)]
vfs: cleanup show_mountinfo

Starting with commit v3.2-rc4-1-g02125a8, seq_path_root() no longer
changes the value of its "struct path *root" argument.
Starting with commit v3.2-rc7-104-g8c9379e, the "struct path *root"
argument of seq_path_root() is const.
As result, the temporary variable "root" in show_mountinfo() that
holds a copy of struct path root is no longer needed.

Signed-off-by: Dmitry V. Levin <[email protected]>
Signed-off-by: Al Viro <[email protected]>
10 years agoinit: fix read-write root mount
Miklos Szeredi [Thu, 20 Nov 2014 15:08:59 +0000 (16:08 +0100)]
init: fix read-write root mount

If mount flags don't have MS_RDONLY, iso9660 returns EACCES without actually
checking if it's an iso image.

This tricks mount_block_root() into retrying with MS_RDONLY.  This results
in a read-only root despite the "rw" boot parameter if the actual
filesystem was checked after iso9660.

I believe the behavior of iso9660 is okay, while that of mount_block_root()
is not.  It should rather try all types without MS_RDONLY and only then
retry with MS_RDONLY.

This change also makes the code more robust against the case when EACCES is
returned despite MS_RDONLY, which would've resulted in a lockup.

Signed-off-by: Miklos Szeredi <[email protected]>
Signed-off-by: Al Viro <[email protected]>
10 years agounfuck binfmt_misc.c (broken by commit e6084d4)
Al Viro [Wed, 17 Dec 2014 10:29:16 +0000 (05:29 -0500)]
unfuck binfmt_misc.c (broken by commit e6084d4)

scanarg(s, del) never returns s; the empty field results in s + 1.
Restore the correct checks, and move NUL-termination into scanarg(),
while we are at it.

Incidentally, mixing "coding style cleanups" (for small values of cleanup)
with functional changes is a Bad Idea(tm)...

Signed-off-by: Al Viro <[email protected]>
10 years agovm_area_operations: kill ->migrate()
Al Viro [Thu, 15 May 2014 09:06:42 +0000 (05:06 -0400)]
vm_area_operations: kill ->migrate()

the only instance this method has ever grown was one in kernfs -
one that call ->migrate() of another vm_ops if it exists.

Signed-off-by: Al Viro <[email protected]>
10 years agomac80211: free management frame keys when removing station
Johannes Berg [Wed, 17 Dec 2014 12:55:49 +0000 (13:55 +0100)]
mac80211: free management frame keys when removing station

When writing the code to allow per-station GTKs, I neglected to
take into account the management frame keys (index 4 and 5) when
freeing the station and only added code to free the first four
data frame keys.

Fix this by iterating the array of keys over the right length.

Cc: [email protected]
Fixes: e31b82136d1a ("cfg80211/mac80211: allow per-station GTKs")
Signed-off-by: Johannes Berg <[email protected]>
10 years agoKVM: PPC: Book3S HV: Improve H_CONFER implementation
Sam Bobroff [Wed, 3 Dec 2014 02:30:40 +0000 (13:30 +1100)]
KVM: PPC: Book3S HV: Improve H_CONFER implementation

Currently the H_CONFER hcall is implemented in kernel virtual mode,
meaning that whenever a guest thread does an H_CONFER, all the threads
in that virtual core have to exit the guest.  This is bad for
performance because it interrupts the other threads even if they
are doing useful work.

The H_CONFER hcall is called by a guest VCPU when it is spinning on a
spinlock and it detects that the spinlock is held by a guest VCPU that
is currently not running on a physical CPU.  The idea is to give this
VCPU's time slice to the holder VCPU so that it can make progress
towards releasing the lock.

To avoid having the other threads exit the guest unnecessarily,
we add a real-mode implementation of H_CONFER that checks whether
the other threads are doing anything.  If all the other threads
are idle (i.e. in H_CEDE) or trying to confer (i.e. in H_CONFER),
it returns H_TOO_HARD which causes a guest exit and allows the
H_CONFER to be handled in virtual mode.

Otherwise it spins for a short time (up to 10 microseconds) to give
other threads the chance to observe that this thread is trying to
confer.  The spin loop also terminates when any thread exits the guest
or when all other threads are idle or trying to confer.  If the
timeout is reached, the H_CONFER returns H_SUCCESS.  In this case the
guest VCPU will recheck the spinlock word and most likely call
H_CONFER again.

This also improves the implementation of the H_CONFER virtual mode
handler.  If the VCPU is part of a virtual core (vcore) which is
runnable, there will be a 'runner' VCPU which has taken responsibility
for running the vcore.  In this case we yield to the runner VCPU
rather than the target VCPU.

We also introduce a check on the target VCPU's yield count: if it
differs from the yield count passed to H_CONFER, the target VCPU
has run since H_CONFER was called and may have already released
the lock.  This check is required by PAPR.

Signed-off-by: Sam Bobroff <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
10 years agoKVM: PPC: Book3S HV: Fix endianness of instruction obtained from HEIR register
Paul Mackerras [Wed, 3 Dec 2014 02:30:39 +0000 (13:30 +1100)]
KVM: PPC: Book3S HV: Fix endianness of instruction obtained from HEIR register

There are two ways in which a guest instruction can be obtained from
the guest in the guest exit code in book3s_hv_rmhandlers.S.  If the
exit was caused by a Hypervisor Emulation interrupt (i.e. an illegal
instruction), the offending instruction is in the HEIR register
(Hypervisor Emulation Instruction Register).  If the exit was caused
by a load or store to an emulated MMIO device, we load the instruction
from the guest by turning data relocation on and loading the instruction
with an lwz instruction.

Unfortunately, in the case where the guest has opposite endianness to
the host, these two methods give results of different endianness, but
both get put into vcpu->arch.last_inst.  The HEIR value has been loaded
using guest endianness, whereas the lwz will load the instruction using
host endianness.  The rest of the code that uses vcpu->arch.last_inst
assumes it was loaded using host endianness.

To fix this, we define a new vcpu field to store the HEIR value.  Then,
in kvmppc_handle_exit_hv(), we transfer the value from this new field to
vcpu->arch.last_inst, doing a byte-swap if the guest and host endianness
differ.

Signed-off-by: Paul Mackerras <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
10 years agoKVM: PPC: Book3S HV: Remove code for PPC970 processors
Paul Mackerras [Wed, 3 Dec 2014 02:30:38 +0000 (13:30 +1100)]
KVM: PPC: Book3S HV: Remove code for PPC970 processors

This removes the code that was added to enable HV KVM to work
on PPC970 processors.  The PPC970 is an old CPU that doesn't
support virtualizing guest memory.  Removing PPC970 support also
lets us remove the code for allocating and managing contiguous
real-mode areas, the code for the !kvm->arch.using_mmu_notifiers
case, the code for pinning pages of guest memory when first
accessed and keeping track of which pages have been pinned, and
the code for handling H_ENTER hypercalls in virtual mode.

Book3S HV KVM is now supported only on POWER7 and POWER8 processors.
The KVM_CAP_PPC_RMA capability now always returns 0.

Signed-off-by: Paul Mackerras <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
10 years agoKVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions
Suresh E. Warrier [Thu, 4 Dec 2014 00:48:10 +0000 (18:48 -0600)]
KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions

This patch adds trace points in the guest entry and exit code and also
for exceptions handled by the host in kernel mode - hypercalls and page
faults. The new events are added to /sys/kernel/debug/tracing/events
under a new subsystem called kvm_hv.

Acked-by: Paul Mackerras <[email protected]>
Signed-off-by: Suresh Warrier <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
10 years agoKVM: PPC: Book3S HV: Simplify locking around stolen time calculations
Paul Mackerras [Thu, 4 Dec 2014 05:43:28 +0000 (16:43 +1100)]
KVM: PPC: Book3S HV: Simplify locking around stolen time calculations

Currently the calculations of stolen time for PPC Book3S HV guests
uses fields in both the vcpu struct and the kvmppc_vcore struct.  The
fields in the kvmppc_vcore struct are protected by the
vcpu->arch.tbacct_lock of the vcpu that has taken responsibility for
running the virtual core.  This works correctly but confuses lockdep,
because it sees that the code takes the tbacct_lock for a vcpu in
kvmppc_remove_runnable() and then takes another vcpu's tbacct_lock in
vcore_stolen_time(), and it thinks there is a possibility of deadlock,
causing it to print reports like this:

=============================================
[ INFO: possible recursive locking detected ]
3.18.0-rc7-kvm-00016-g8db4bc6 #89 Not tainted
---------------------------------------------
qemu-system-ppc/6188 is trying to acquire lock:
 (&(&vcpu->arch.tbacct_lock)->rlock){......}, at: [<d00000000ecb1fe8>] .vcore_stolen_time+0x48/0xd0 [kvm_hv]

but task is already holding lock:
 (&(&vcpu->arch.tbacct_lock)->rlock){......}, at: [<d00000000ecb25a0>] .kvmppc_remove_runnable.part.3+0x30/0xd0 [kvm_hv]

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(&vcpu->arch.tbacct_lock)->rlock);
  lock(&(&vcpu->arch.tbacct_lock)->rlock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by qemu-system-ppc/6188:
 #0:  (&vcpu->mutex){+.+.+.}, at: [<d00000000eb93f98>] .vcpu_load+0x28/0xe0 [kvm]
 #1:  (&(&vcore->lock)->rlock){+.+...}, at: [<d00000000ecb41b0>] .kvmppc_vcpu_run_hv+0x530/0x1530 [kvm_hv]
 #2:  (&(&vcpu->arch.tbacct_lock)->rlock){......}, at: [<d00000000ecb25a0>] .kvmppc_remove_runnable.part.3+0x30/0xd0 [kvm_hv]

stack backtrace:
CPU: 40 PID: 6188 Comm: qemu-system-ppc Not tainted 3.18.0-rc7-kvm-00016-g8db4bc6 #89
Call Trace:
[c000000b2754f3f0] [c000000000b31b6c] .dump_stack+0x88/0xb4 (unreliable)
[c000000b2754f470] [c0000000000faeb8] .__lock_acquire+0x1878/0x2190
[c000000b2754f600] [c0000000000fbf0c] .lock_acquire+0xcc/0x1a0
[c000000b2754f6d0] [c000000000b2954c] ._raw_spin_lock_irq+0x4c/0x70
[c000000b2754f760] [d00000000ecb1fe8] .vcore_stolen_time+0x48/0xd0 [kvm_hv]
[c000000b2754f7f0] [d00000000ecb25b4] .kvmppc_remove_runnable.part.3+0x44/0xd0 [kvm_hv]
[c000000b2754f880] [d00000000ecb43ec] .kvmppc_vcpu_run_hv+0x76c/0x1530 [kvm_hv]
[c000000b2754f9f0] [d00000000eb9f46c] .kvmppc_vcpu_run+0x2c/0x40 [kvm]
[c000000b2754fa60] [d00000000eb9c9a4] .kvm_arch_vcpu_ioctl_run+0x54/0x160 [kvm]
[c000000b2754faf0] [d00000000eb94538] .kvm_vcpu_ioctl+0x498/0x760 [kvm]
[c000000b2754fcb0] [c000000000267eb4] .do_vfs_ioctl+0x444/0x770
[c000000b2754fd90] [c0000000002682a4] .SyS_ioctl+0xc4/0xe0
[c000000b2754fe30] [c0000000000092e4] syscall_exit+0x0/0x98

In order to make the locking easier to analyse, we change the code to
use a spinlock in the kvmppc_vcore struct to protect the stolen_tb and
preempt_tb fields.  This lock needs to be an irq-safe lock since it is
used in the kvmppc_core_vcpu_load_hv() and kvmppc_core_vcpu_put_hv()
functions, which are called with the scheduler rq lock held, which is
an irq-safe lock.

Signed-off-by: Paul Mackerras <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
10 years agoarch: powerpc: kvm: book3s_paired_singles.c: Remove unused function
Rickard Strandqvist [Sun, 7 Dec 2014 22:29:14 +0000 (23:29 +0100)]
arch: powerpc: kvm: book3s_paired_singles.c: Remove unused function

Remove the function inst_set_field() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
10 years agoarch: powerpc: kvm: book3s_pr.c: Remove unused function
Rickard Strandqvist [Sun, 7 Dec 2014 18:11:48 +0000 (19:11 +0100)]
arch: powerpc: kvm: book3s_pr.c: Remove unused function

Remove the function get_fpr_index() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
10 years agoarch: powerpc: kvm: book3s.c: Remove some unused functions
Rickard Strandqvist [Sun, 7 Dec 2014 17:28:54 +0000 (18:28 +0100)]
arch: powerpc: kvm: book3s.c: Remove some unused functions

Removes some functions that are not used anywhere:
kvmppc_core_load_guest_debugstate() kvmppc_core_load_host_debugstate()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
10 years agoarch: powerpc: kvm: book3s_32_mmu.c: Remove unused function
Rickard Strandqvist [Sun, 7 Dec 2014 17:20:46 +0000 (18:20 +0100)]
arch: powerpc: kvm: book3s_32_mmu.c: Remove unused function

Remove the function sr_nx() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
10 years agomicroblaze: Fix mmap for cache coherent memory
Lars-Peter Clausen [Wed, 3 Dec 2014 15:07:28 +0000 (16:07 +0100)]
microblaze: Fix mmap for cache coherent memory

When running in non-cache coherent configuration the memory that was
allocated with dma_alloc_coherent() has a custom mapping and so there is no
1-to-1 relationship between the kernel virtual address and the PFN. This
means that virt_to_pfn() will not work correctly for those addresses and the
default mmap implementation in the form of dma_common_mmap() will map some
random, but not the requested, memory area.

Fix this by providing a custom mmap implementation that looks up the PFN
from the page table rather than using virt_to_pfn.

Signed-off-by: Lars-Peter Clausen <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
10 years agonew helper: iter_is_iovec()
Al Viro [Wed, 17 Dec 2014 09:46:46 +0000 (04:46 -0500)]
new helper: iter_is_iovec()

Signed-off-by: Al Viro <[email protected]>
10 years agomove_extent_per_page(): get rid of unused w_flags
Al Viro [Wed, 17 Dec 2014 09:37:27 +0000 (04:37 -0500)]
move_extent_per_page(): get rid of unused w_flags

... and comparing get_fs() with KERNEL_DS used only to initialize that

Signed-off-by: Al Viro <[email protected]>
10 years agolustre: get rid of playing with ->fs
Al Viro [Fri, 12 Dec 2014 03:40:27 +0000 (22:40 -0500)]
lustre: get rid of playing with ->fs

* removed several pieces of dead code in lustre_compat25.h
* don't open-code current_umask() (and BTW, 0755 & (S_IRWXUGO | S_ISVTX)
is better spelled as 0755)
* fix broken attempt to get the pathname by dentry - abusing d_path() for
that is simply wrong.

Signed-off-by: Al Viro <[email protected]>
10 years agobtrfs: filp_open() returns ERR_PTR() on failure, not NULL...
Al Viro [Sun, 14 Dec 2014 07:59:17 +0000 (02:59 -0500)]
btrfs: filp_open() returns ERR_PTR() on failure, not NULL...

Signed-off-by: Al Viro <[email protected]>
10 years agoARC: rename default defconfig
Vineet Gupta [Fri, 12 Dec 2014 04:57:50 +0000 (10:27 +0530)]
ARC: rename default defconfig

Signed-off-by: Vineet Gupta <[email protected]>
10 years agoALSA: hda/realtek - New codec support for ALC256
Kailang Yang [Wed, 17 Dec 2014 09:39:05 +0000 (17:39 +0800)]
ALSA: hda/realtek - New codec support for ALC256

Add new support for ALC256 codec.

Signed-off-by: Kailang Yang <[email protected]>
Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
10 years agoALSA: hda/realtek - Add new Dell desktop for ALC3234 headset mode
Kailang Yang [Wed, 17 Dec 2014 09:08:59 +0000 (17:08 +0800)]
ALSA: hda/realtek - Add new Dell desktop for ALC3234 headset mode

New Dell desktop needs to support headset mode for ALC3234.

Signed-off-by: Kailang Yang <[email protected]>
Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
10 years agonios2/uaccess: fix sparse errors
Ley Foon Tan [Wed, 17 Dec 2014 05:53:41 +0000 (13:53 +0800)]
nios2/uaccess: fix sparse errors

virtio wants to read bitwise types from userspace using get_user.  At the
moment this triggers sparse errors, since the value is passed through an
integer.

Fix that up using __force.

Suggested-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Ley Foon Tan <[email protected]>
10 years agonios2: enable "make defconfig"
Paul Bolle [Thu, 11 Dec 2014 02:49:36 +0000 (10:49 +0800)]
nios2: enable "make defconfig"

Running "make defconfig" currently fails for nios2:
    $ make ARCH=nios2 defconfig
    scripts/kconfig/conf --defconfig Kconfig
    ***
    *** Can't find default configuration "arch/nios2/defconfig"!
    ***
    make[1]: *** [defconfig] Error 1
    make: *** [defconfig] Error 2

Add a definition for KBUILD_DEFCONFIG to the nios2's main Makefile to enable
this make target.

Signed-off-by: Paul Bolle <[email protected]>
Acked-by: Ley Foon Tan <[email protected]>
10 years agonios2: add definition of ioremap_wc to io.h
Guenter Roeck [Thu, 11 Dec 2014 02:36:42 +0000 (10:36 +0800)]
nios2: add definition of ioremap_wc to io.h

Fix

drivers/gpu/drm/drm_bufs.c: In function 'drm_addmap_core':
drivers/gpu/drm/drm_bufs.c:213:5:
error: implicit declaration of function 'ioremap_wc'

seen when building nios2:allmodconfig.

Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Ley Foon Tan <[email protected]>
10 years ago[media] bq/c-qcam, w9966, pms: move to staging in preparation for removal
Hans Verkuil [Tue, 2 Dec 2014 15:40:33 +0000 (12:40 -0300)]
[media] bq/c-qcam, w9966, pms: move to staging in preparation for removal

These drivers haven't been tested in a long, long time. The hardware is
ancient and hopelessly obsolete. These drivers also need to be converted
to newer media frameworks but due to the lack of hardware that's going
to be impossible. In addition, cheaper and vastly better hardware is
available today.

So these drivers are a prime candidate for removal. If someone is
interested in working on these drivers to prevent their removal, then
please contact the linux-media mailinglist.

Let's be honest, the age of parallel port webcams and ISA video capture
boards is really gone.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] tlg2300: move to staging in preparation for removal
Hans Verkuil [Tue, 2 Dec 2014 15:40:32 +0000 (12:40 -0300)]
[media] tlg2300: move to staging in preparation for removal

This driver hasn't been tested in a long, long time. The company that made
this chip has gone bust many years ago and hardware using this chip is next
to impossible to find.

This driver needs to be converted to newer media frameworks but due to the
lack of hardware that's going to be impossible. Since cheap alternatives are
easily available, there is little point in keeping this driver alive.

In other words, this driver is a prime candidate for removal. If someone is
interested in working on this driver to prevent its removal, then please
contact the linux-media mailinglist.

Signed-off-by: Hans Verkuil <[email protected]>
Acked-by: Huang Shijie <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] vino/saa7191: move to staging in preparation for removal
Hans Verkuil [Tue, 2 Dec 2014 15:40:31 +0000 (12:40 -0300)]
[media] vino/saa7191: move to staging in preparation for removal

These drivers haven't been tested in a long, long time. The hardware is
ancient and hopelessly obsolete. These drivers also need to be converted
to newer media frameworks but due to the lack of hardware that's going
to be impossible.

So these drivers are a prime candidate for removal. If someone is
interested in working on these drivers to prevent their removal, then
please contact the linux-media mailinglist.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] MAINTAINERS: vivi -> vivid
Hans Verkuil [Wed, 10 Dec 2014 07:22:37 +0000 (04:22 -0300)]
[media] MAINTAINERS: vivi -> vivid

The vivi driver no longer exists and is replaced by the vivid driver.
Update MAINTAINERS accordingly.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] cx88: remove leftover start_video_dma() call
Hans Verkuil [Mon, 8 Dec 2014 16:23:50 +0000 (13:23 -0300)]
[media] cx88: remove leftover start_video_dma() call

The start_streaming op is responsible for starting the video dma,
so it shouldn't be called anymore from the buf_queue op.

Unfortunately, this call to start_video_dma() was added to the
start_streaming op, but was forgotten to be removed from the
buf_queue op, which is where it used to be before the vb2 conversion.

Calling this function twice causes very hard to find errors: sometimes
it works, sometimes it doesn't. It took me a whole friggin' day
to track this down, and in the end it was just luck that my eye suddenly
triggered on that line.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] cx88: add missing alloc_ctx support
Hans Verkuil [Mon, 8 Dec 2014 16:23:49 +0000 (13:23 -0300)]
[media] cx88: add missing alloc_ctx support

The cx88 vb2 conversion and the vb2 dma_sg improvements were developed separately and
were merged separately. Unfortunately, the patch updating drivers to the dma_sg
improvements didn't take the updated cx88 driver into account. Basically two ships
passing in the night, unaware of one another even though both ships have the same
owner, i.e. me :-)

Signed-off-by: Hans Verkuil <[email protected]>
Reported-by: Chris Lee <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] v4l2-ioctl: WARN_ON if querycap didn't fill device_caps
Hans Verkuil [Sun, 7 Dec 2014 14:59:42 +0000 (11:59 -0300)]
[media] v4l2-ioctl: WARN_ON if querycap didn't fill device_caps

This is easy to forget to do in drivers. While v4l2-compliance will check for it,
not everyone remembers to run it. So warn about it.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] vivid: fix CROP_BOUNDS typo for video output
Hans Verkuil [Sat, 6 Dec 2014 10:30:03 +0000 (07:30 -0300)]
[media] vivid: fix CROP_BOUNDS typo for video output

An error was returned if composing was not supported, instead of if
cropping was not supported.

A classic copy-and-paste bug. Found with v4l2-compliance.

Signed-off-by: Hans Verkuil <[email protected]>
Cc: <[email protected]> # for v3.18
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] DocBook media: update version number and document changes
Hans Verkuil [Fri, 5 Dec 2014 14:23:55 +0000 (11:23 -0300)]
[media] DocBook media: update version number and document changes

Update the version to 3.19.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] vivid.txt: document new controls
Hans Verkuil [Fri, 5 Dec 2014 13:18:38 +0000 (10:18 -0300)]
[media] vivid.txt: document new controls

Document the new 'Y'CbCr Encoding' and 'Quantization' controls.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] DocBook media: add missing ycbcr_enc and quantization fields
Hans Verkuil [Fri, 5 Dec 2014 13:04:47 +0000 (10:04 -0300)]
[media] DocBook media: add missing ycbcr_enc and quantization fields

I forgot to add these fields to the relevant structs.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years ago[media] v4l2-mediabus.h: use two __u16 instead of two __u32
Hans Verkuil [Fri, 5 Dec 2014 13:02:47 +0000 (10:02 -0300)]
[media] v4l2-mediabus.h: use two __u16 instead of two __u32

The ycbcr_enc and quantization fields do not need a __u32. Switch to
two __u16 types, thus preserving alignment and avoiding holes in the
struct. This makes one more __u32 available for future expansion.

Suggested by Sakari Ailus.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Tue, 16 Dec 2014 23:53:03 +0000 (15:53 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull vfs pile #2 from Al Viro:
 "Next pile (and there'll be one or two more).

  The large piece in this one is getting rid of /proc/*/ns/* weirdness;
  among other things, it allows to (finally) make nameidata completely
  opaque outside of fs/namei.c, making for easier further cleanups in
  there"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  coda_venus_readdir(): use file_inode()
  fs/namei.c: fold link_path_walk() call into path_init()
  path_init(): don't bother with LOOKUP_PARENT in argument
  fs/namei.c: new helper (path_cleanup())
  path_init(): store the "base" pointer to file in nameidata itself
  make default ->i_fop have ->open() fail with ENXIO
  make nameidata completely opaque outside of fs/namei.c
  kill proc_ns completely
  take the targets of /proc/*/ns/* symlinks to separate fs
  bury struct proc_ns in fs/proc
  copy address of proc_ns_ops into ns_common
  new helpers: ns_alloc_inum/ns_free_inum
  make proc_ns_operations work with struct ns_common * instead of void *
  switch the rest of proc_ns_operations to working with &...->ns
  netns: switch ->get()/->put()/->install()/->inum() to working with &net->ns
  make mntns ->get()/->put()/->install()/->inum() work with &mnt_ns->ns
  common object embedded into various struct ....ns

10 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Linus Torvalds [Tue, 16 Dec 2014 23:46:01 +0000 (15:46 -0800)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull isofs and reiserfs fixes from Jan Kara:
 "A reiserfs and an isofs fix.  They arrived after I sent you my first
  pull request and I don't want to delay them unnecessarily till rc2"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  isofs: Fix infinite looping over CE entries
  reiserfs: destroy allocated commit workqueue

10 years agoMerge branch 'for-3.19' of git://linux-nfs.org/~bfields/linux
Linus Torvalds [Tue, 16 Dec 2014 23:25:31 +0000 (15:25 -0800)]
Merge branch 'for-3.19' of git://linux-nfs.org/~bfields/linux

Pull nfsd updates from Bruce Fields:
 "A comparatively quieter cycle for nfsd this time, but still with two
  larger changes:

   - RPC server scalability improvements from Jeff Layton (using RCU
     instead of a spinlock to find idle threads).

   - server-side NFSv4.2 ALLOCATE/DEALLOCATE support from Anna
     Schumaker, enabling fallocate on new clients"

* 'for-3.19' of git://linux-nfs.org/~bfields/linux: (32 commits)
  nfsd4: fix xdr4 count of server in fs_location4
  nfsd4: fix xdr4 inclusion of escaped char
  sunrpc/cache: convert to use string_escape_str()
  sunrpc: only call test_bit once in svc_xprt_received
  fs: nfsd: Fix signedness bug in compare_blob
  sunrpc: add some tracepoints around enqueue and dequeue of svc_xprt
  sunrpc: convert to lockless lookup of queued server threads
  sunrpc: fix potential races in pool_stats collection
  sunrpc: add a rcu_head to svc_rqst and use kfree_rcu to free it
  sunrpc: require svc_create callers to pass in meaningful shutdown routine
  sunrpc: have svc_wake_up only deal with pool 0
  sunrpc: convert sp_task_pending flag to use atomic bitops
  sunrpc: move rq_cachetype field to better optimize space
  sunrpc: move rq_splice_ok flag into rq_flags
  sunrpc: move rq_dropme flag into rq_flags
  sunrpc: move rq_usedeferral flag to rq_flags
  sunrpc: move rq_local field to rq_flags
  sunrpc: add a generic rq_flags field to svc_rqst and move rq_secure to it
  nfsd: minor off by one checks in __write_versions()
  sunrpc: release svc_pool_map reference when serv allocation fails
  ...

10 years agovirtio_pci: restore module attributes
Herbert Xu [Tue, 16 Dec 2014 22:54:03 +0000 (00:54 +0200)]
virtio_pci: restore module attributes

When the virtio_pci driver was moved into virtio_pci_legacy.c the module
licence and other attributes went AWOL.  This patch restores them.

Signed-off-by: Herbert Xu <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
10 years agoMerge tag 'iommu-config-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 16 Dec 2014 22:53:01 +0000 (14:53 -0800)]
Merge tag 'iommu-config-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC/iommu configuration update from Arnd Bergmann:
 "The iomm-config branch contains work from Will Deacon, quoting his
  description:

    This series adds automatic IOMMU and DMA-mapping configuration for
    OF-based DMA masters described using the generic IOMMU devicetree
    bindings. Although there is plenty of future work around splitting up
    iommu_ops, adding default IOMMU domains and sorting out automatic IOMMU
    group creation for the platform_bus, this is already useful enough for
    people to port over their IOMMU drivers and start using the new probing
    infrastructure (indeed, Marek has patches queued for the Exynos IOMMU).

  The branch touches core ARM and IOMMU driver files, and the respective
  maintainers (Russell King and Joerg Roedel) agreed to have the
  contents merged through the arm-soc tree.

  The final version was ready just before the merge window, so we ended
  up delaying it a bit longer than the rest, but we don't expect to see
  regressions because this is just additional infrastructure that will
  get used in drivers starting in 3.20 but is unused so far"

* tag 'iommu-config-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  iommu: store DT-probed IOMMU data privately
  arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops
  arm: call iommu_init before of_platform_populate
  dma-mapping: detect and configure IOMMU in of_dma_configure
  iommu: fix initialization without 'add_device' callback
  iommu: provide helper function to configure an IOMMU for an of master
  iommu: add new iommu_ops callback for adding an OF device
  dma-mapping: replace set_arch_dma_coherent_ops with arch_setup_dma_ops
  iommu: provide early initialisation hook for IOMMU drivers

10 years agoMerge tag 'dt2-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Linus Torvalds [Tue, 16 Dec 2014 22:26:26 +0000 (14:26 -0800)]
Merge tag 'dt2-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC DT updates part 2 from Arnd Bergmann:
 "This is a follow-up to the early ARM SoC DT changes, with additional
  content that has external dependencies:

   - The Tegra IOMMU DT support depends on changes from the iommu tree,
     plus the contents of the arm-soc drivers branch
   - The MVEBU PHY support depends on changes from the phy tree
   - The AT91 DT support depends on changes from the RTC and DMA-slave
     trees

  All of these changes just enable additional devices for existing
  platforms"

* tag 'dt2-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: tegra: Enable IOMMU for display controllers on Tegra124
  ARM: tegra: Enable IOMMU for display controllers on Tegra114
  ARM: tegra: Enable IOMMU for display controllers on Tegra30
  ARM: tegra: Add memory controller support for Tegra124
  ARM: tegra: Add memory controller support for Tegra114
  ARM: tegra: Add memory controller support for Tegra30
  ARM: tegra: Add APB_MISC_GP as a MIPI pad control bank
  ARM: mvebu: add PHY support to the dts for the USB controllers on Armada 375
  ARM: mvebu: add Device Tree description of USB cluster controller on Armada 375
  ARM: at91/dt: at91sam9g45: add ISI node
  ARM: at91/dt: enable the RTT block on the at91sam9m10g45ek board
  ARM: at91/dt: enable the RTT block on the sam9g20ek board
  ARM: at91/dt: add GPBR nodes
  ARM: at91/dt: add RTT nodes to at91 dtsis
  ARM: at91/dt: at91sam9rl: add rtc
  ARM: at91: fix GPLv2 wording
  ARM: at91/dt: sama5d4: add DMA support
  ARM: at91/dt: sama5d4: use macro instead of numeric value

This page took 0.123833 seconds and 4 git commands to generate.