1. 18 Apr, 2014 23 commits
    • Erik Hugne's avatar
      tipc: fix memory leak during module removal · 140490bc
      Erik Hugne authored
      [ Upstream commit 1bb8dce5 ]
      
      When the TIPC module is removed, the tasklet handler is disabled
      before all other subsystems. This will cause lingering publications
      in the name table because the node_down tasklets responsible to
      clean up publications from an unreachable node will never run.
      When the name table is shut down, these publications are detected
      and an error message is logged:
      tipc: nametbl_stop(): orphaned hash chain detected
      This is actually a memory leak, introduced with commit
      993b858e ("tipc: correct the order
      of stopping services at rmmod")
      
      Instead of just logging an error and leaking memory, we free
      the orphaned entries during nametable shutdown.
      Signed-off-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      140490bc
    • Erik Hugne's avatar
      tipc: drop subscriber connection id invalidation · fa7a24ee
      Erik Hugne authored
      [ Upstream commit edcc0511 ]
      
      When a topology server subscriber is disconnected, the associated
      connection id is set to zero. A check vs zero is then done in the
      subscription timeout function to see if the subscriber have been
      shut down. This is unnecessary, because all subscription timers
      will be cancelled when a subscriber terminates. Setting the
      connection id to zero is actually harmful because id zero is the
      identity of the topology server listening socket, and can cause a
      race that leads to this socket being closed instead.
      Signed-off-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      fa7a24ee
    • Ying Xue's avatar
      tipc: fix connection refcount leak · a9d79658
      Ying Xue authored
      [ Upstream commit 4652edb7 ]
      
      When tipc_conn_sendmsg() calls tipc_conn_lookup() to query a
      connection instance, its reference count value is increased if
      it's found. But subsequently if it's found that the connection is
      closed, the work of sending message is not queued into its server
      send workqueue, and the connection reference count is not decreased.
      This will cause a reference count leak. To reproduce this problem,
      an application would need to open and closes topology server
      connections with high intensity.
      
      We fix this by immediately decrementing the connection reference
      count if a send fails due to the connection being closed.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Acked-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      a9d79658
    • Ying Xue's avatar
      tipc: allow connection shutdown callback to be invoked in advance · 1f92d32f
      Ying Xue authored
      [ Upstream commit 6d4ebeb4 ]
      
      Currently connection shutdown callback function is called when
      connection instance is released in tipc_conn_kref_release(), and
      receiving packets and sending packets are running in different
      threads. Even if connection is closed by the thread of receiving
      packets, its shutdown callback may not be called immediately as
      the connection reference count is non-zero at that moment. So,
      although the connection is shut down by the thread of receiving
      packets, the thread of sending packets doesn't know it. Before
      its shutdown callback is invoked to tell the sending thread its
      connection has been closed, the sending thread may deliver
      messages by tipc_conn_sendmsg(), this is why the following error
      information appears:
      
      "Sending subscription event failed, no memory"
      
      To eliminate it, allow connection shutdown callback function to
      be called before connection id is removed in tipc_close_conn(),
      which makes the sending thread know the truth in time that its
      socket is closed so that it doesn't send message to it. We also
      remove the "Sending XXX failed..." error reporting for topology
      and config services.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1f92d32f
    • Linus Lüssing's avatar
      bridge: multicast: add sanity check for query source addresses · f8adfb64
      Linus Lüssing authored
      [ Upstream commit 6565b9ee ]
      
      MLD queries are supposed to have an IPv6 link-local source address
      according to RFC2710, section 4 and RFC3810, section 5.1.14. This patch
      adds a sanity check to ignore such broken MLD queries.
      
      Without this check, such malformed MLD queries can result in a
      denial of service: The queries are ignored by any MLD listener
      therefore they will not respond with an MLD report. However,
      without this patch these malformed MLD queries would enable the
      snooping part in the bridge code, potentially shutting down the
      according ports towards these hosts for multicast traffic as the
      bridge did not learn about these listeners.
      Reported-by: default avatarJan Stancek <jstancek@redhat.com>
      Signed-off-by: default avatarLinus Lüssing <linus.luessing@web.de>
      Reviewed-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f8adfb64
    • Daniel Borkmann's avatar
      net: sctp: fix skb leakage in COOKIE ECHO path of chunk->auth_chunk · 607e4255
      Daniel Borkmann authored
      [ Upstream commit c485658b ]
      
      While working on ec0223ec ("net: sctp: fix sctp_sf_do_5_1D_ce to
      verify if we/peer is AUTH capable"), we noticed that there's a skb
      memory leakage in the error path.
      
      Running the same reproducer as in ec0223ec and by unconditionally
      jumping to the error label (to simulate an error condition) in
      sctp_sf_do_5_1D_ce() receive path lets kmemleak detector bark about
      the unfreed chunk->auth_chunk skb clone:
      
      Unreferenced object 0xffff8800b8f3a000 (size 256):
        comm "softirq", pid 0, jiffies 4294769856 (age 110.757s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          89 ab 75 5e d4 01 58 13 00 00 00 00 00 00 00 00  ..u^..X.........
        backtrace:
          [<ffffffff816660be>] kmemleak_alloc+0x4e/0xb0
          [<ffffffff8119f328>] kmem_cache_alloc+0xc8/0x210
          [<ffffffff81566929>] skb_clone+0x49/0xb0
          [<ffffffffa0467459>] sctp_endpoint_bh_rcv+0x1d9/0x230 [sctp]
          [<ffffffffa046fdbc>] sctp_inq_push+0x4c/0x70 [sctp]
          [<ffffffffa047e8de>] sctp_rcv+0x82e/0x9a0 [sctp]
          [<ffffffff815abd38>] ip_local_deliver_finish+0xa8/0x210
          [<ffffffff815a64af>] nf_reinject+0xbf/0x180
          [<ffffffffa04b4762>] nfqnl_recv_verdict+0x1d2/0x2b0 [nfnetlink_queue]
          [<ffffffffa04aa40b>] nfnetlink_rcv_msg+0x14b/0x250 [nfnetlink]
          [<ffffffff815a3269>] netlink_rcv_skb+0xa9/0xc0
          [<ffffffffa04aa7cf>] nfnetlink_rcv+0x23f/0x408 [nfnetlink]
          [<ffffffff815a2bd8>] netlink_unicast+0x168/0x250
          [<ffffffff815a2fa1>] netlink_sendmsg+0x2e1/0x3f0
          [<ffffffff8155cc6b>] sock_sendmsg+0x8b/0xc0
          [<ffffffff8155d449>] ___sys_sendmsg+0x369/0x380
      
      What happens is that commit bbd0d598 clones the skb containing
      the AUTH chunk in sctp_endpoint_bh_rcv() when having the edge case
      that an endpoint requires COOKIE-ECHO chunks to be authenticated:
      
        ---------- INIT[RANDOM; CHUNKS; HMAC-ALGO] ---------->
        <------- INIT-ACK[RANDOM; CHUNKS; HMAC-ALGO] ---------
        ------------------ AUTH; COOKIE-ECHO ---------------->
        <-------------------- COOKIE-ACK ---------------------
      
      When we enter sctp_sf_do_5_1D_ce() and before we actually get to
      the point where we process (and subsequently free) a non-NULL
      chunk->auth_chunk, we could hit the "goto nomem_init" path from
      an error condition and thus leave the cloned skb around w/o
      freeing it.
      
      The fix is to centrally free such clones in sctp_chunk_destroy()
      handler that is invoked from sctp_chunk_free() after all refs have
      dropped; and also move both kfree_skb(chunk->auth_chunk) there,
      so that chunk->auth_chunk is either NULL (since sctp_chunkify()
      allocs new chunks through kmem_cache_zalloc()) or non-NULL with
      a valid skb pointer. chunk->skb and chunk->auth_chunk are the
      only skbs in the sctp_chunk structure that need to be handeled.
      
      While at it, we should use consume_skb() for both. It is the same
      as dev_kfree_skb() but more appropriately named as we are not
      a device but a protocol. Also, this effectively replaces the
      kfree_skb() from both invocations into consume_skb(). Functions
      are the same only that kfree_skb() assumes that the frame was
      being dropped after a failure (e.g. for tools like drop monitor),
      usage of consume_skb() seems more appropriate in function
      sctp_chunk_destroy() though.
      
      Fixes: bbd0d598 ("[SCTP]: Implement the receive and verification of AUTH chunk")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Cc: Vlad Yasevich <yasevich@gmail.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      607e4255
    • Nikolay Aleksandrov's avatar
      net: fix for a race condition in the inet frag code · e8443124
      Nikolay Aleksandrov authored
      [ Upstream commit 24b9bf43 ]
      
      I stumbled upon this very serious bug while hunting for another one,
      it's a very subtle race condition between inet_frag_evictor,
      inet_frag_intern and the IPv4/6 frag_queue and expire functions
      (basically the users of inet_frag_kill/inet_frag_put).
      
      What happens is that after a fragment has been added to the hash chain
      but before it's been added to the lru_list (inet_frag_lru_add) in
      inet_frag_intern, it may get deleted (either by an expired timer if
      the system load is high or the timer sufficiently low, or by the
      fraq_queue function for different reasons) before it's added to the
      lru_list, then after it gets added it's a matter of time for the
      evictor to get to a piece of memory which has been freed leading to a
      number of different bugs depending on what's left there.
      
      I've been able to trigger this on both IPv4 and IPv6 (which is normal
      as the frag code is the same), but it's been much more difficult to
      trigger on IPv4 due to the protocol differences about how fragments
      are treated.
      
      The setup I used to reproduce this is: 2 machines with 4 x 10G bonded
      in a RR bond, so the same flow can be seen on multiple cards at the
      same time. Then I used multiple instances of ping/ping6 to generate
      fragmented packets and flood the machines with them while running
      other processes to load the attacked machine.
      
      *It is very important to have the _same flow_ coming in on multiple CPUs
      concurrently. Usually the attacked machine would die in less than 30
      minutes, if configured properly to have many evictor calls and timeouts
      it could happen in 10 minutes or so.
      
      An important point to make is that any caller (frag_queue or timer) of
      inet_frag_kill will remove both the timer refcount and the
      original/guarding refcount thus removing everything that's keeping the
      frag from being freed at the next inet_frag_put.  All of this could
      happen before the frag was ever added to the LRU list, then it gets
      added and the evictor uses a freed fragment.
      
      An example for IPv6 would be if a fragment is being added and is at
      the stage of being inserted in the hash after the hash lock is
      released, but before inet_frag_lru_add executes (or is able to obtain
      the lru lock) another overlapping fragment for the same flow arrives
      at a different CPU which finds it in the hash, but since it's
      overlapping it drops it invoking inet_frag_kill and thus removing all
      guarding refcounts, and afterwards freeing it by invoking
      inet_frag_put which removes the last refcount added previously by
      inet_frag_find, then inet_frag_lru_add gets executed by
      inet_frag_intern and we have a freed fragment in the lru_list.
      
      The fix is simple, just move the lru_add under the hash chain locked
      region so when a removing function is called it'll have to wait for
      the fragment to be added to the lru_list, and then it'll remove it (it
      works because the hash chain removal is done before the lru_list one
      and there's no window between the two list adds when the frag can get
      dropped). With this fix applied I couldn't kill the same machine in 24
      hours with the same setup.
      
      Fixes: 3ef0eb0d ("net: frag, move LRU list maintenance outside of
      rwlock")
      
      CC: Florian Westphal <fw@strlen.de>
      CC: Jesper Dangaard Brouer <brouer@redhat.com>
      CC: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
      Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e8443124
    • Gerd Hoffmann's avatar
      drm/cirrus: use drm_set_preferred_mode · 7837b5ae
      Gerd Hoffmann authored
      commit 121a6a17 upstream.
      
      Explicitly set 1024x768 as default mode, so the display doesn't come up
      with the largest supported mode.
      
      While being at it drop first three drm_add_modes_noedid calls.  As
      drm_add_modes_noedid fills the mode list with modes from the database
      *up to* the specified size it is pretty pointless to call it multiple
      times with different sizes.
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      7837b5ae
    • Gerd Hoffmann's avatar
      drm: add drm_set_preferred_mode · 1d2fa7e7
      Gerd Hoffmann authored
      commit 3cf70daf upstream.
      
      New helper function to set the preferred video mode.  Can be called
      after drm_add_modes_noedid if you don't want the largest supported
      video mode be used by default.
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1d2fa7e7
    • Adam Jackson's avatar
      fbdev: Make the switch from generic to native driver less alarming · aa66ee97
      Adam Jackson authored
      commit 13ba0ad4 upstream.
      
      Calling this "conflicting" just makes people think there's a problem
      when there's not.
      Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
      Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      aa66ee97
    • Chris Wilson's avatar
      video/fb: Propagate error code from failing to unregister conflicting fb · 9419c62c
      Chris Wilson authored
      commit 46eeb2c1 upstream.
      
      If we fail to remove a conflicting fb driver, we need to abort the
      loading of the second driver to avoid likely kernel panics.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9419c62c
    • Gu Zheng's avatar
      fb: reorder the lock sequence to fix potential dead lock · be528908
      Gu Zheng authored
      commit 3a41c5db upstream.
      
      Following commits:
      
      50e244cc fb: rework locking to fix lock ordering on takeover
      e93a9a86 fb: Yet another band-aid for fixing lockdep mess
      054430e7 fbcon: fix locking harder
      
      reworked locking to fix related lock ordering on takeover, and introduced console_lock
      into fbmem, but it seems that the new lock sequence(fb_info->lock ---> console_lock)
      is against with the one in console_callback(console_lock ---> fb_info->lock), and leads to
      a potential dead lock as following:
      
      [  601.079000] ======================================================
      [  601.079000] [ INFO: possible circular locking dependency detected ]
      [  601.079000] 3.11.0 #189 Not tainted
      [  601.079000] -------------------------------------------------------
      [  601.079000] kworker/0:3/619 is trying to acquire lock:
      [  601.079000]  (&fb_info->lock){+.+.+.}, at: [<ffffffff81397566>] lock_fb_info+0x26/0x60
      [  601.079000]
      but task is already holding lock:
      [  601.079000]  (console_lock){+.+.+.}, at: [<ffffffff8141aae3>] console_callback+0x13/0x160
      [  601.079000]
      which lock already depends on the new lock.
      
      [  601.079000]
      the existing dependency chain (in reverse order) is:
      [  601.079000]
      -> #1 (console_lock){+.+.+.}:
      [  601.079000]        [<ffffffff810dc971>] lock_acquire+0xa1/0x140
      [  601.079000]        [<ffffffff810c6267>] console_lock+0x77/0x80
      [  601.079000]        [<ffffffff81399448>] register_framebuffer+0x1d8/0x320
      [  601.079000]        [<ffffffff81cfb4c8>] efifb_probe+0x408/0x48f
      [  601.079000]        [<ffffffff8144a963>] platform_drv_probe+0x43/0x80
      [  601.079000]        [<ffffffff8144853b>] driver_probe_device+0x8b/0x390
      [  601.079000]        [<ffffffff814488eb>] __driver_attach+0xab/0xb0
      [  601.079000]        [<ffffffff814463bd>] bus_for_each_dev+0x5d/0xa0
      [  601.079000]        [<ffffffff81447e6e>] driver_attach+0x1e/0x20
      [  601.079000]        [<ffffffff81447a07>] bus_add_driver+0x117/0x290
      [  601.079000]        [<ffffffff81448fea>] driver_register+0x7a/0x170
      [  601.079000]        [<ffffffff8144a10a>] __platform_driver_register+0x4a/0x50
      [  601.079000]        [<ffffffff8144a12d>] platform_driver_probe+0x1d/0xb0
      [  601.079000]        [<ffffffff81cfb0a1>] efifb_init+0x273/0x292
      [  601.079000]        [<ffffffff81002132>] do_one_initcall+0x102/0x1c0
      [  601.079000]        [<ffffffff81cb80a6>] kernel_init_freeable+0x15d/0x1ef
      [  601.079000]        [<ffffffff8166d2de>] kernel_init+0xe/0xf0
      [  601.079000]        [<ffffffff816914ec>] ret_from_fork+0x7c/0xb0
      [  601.079000]
      -> #0 (&fb_info->lock){+.+.+.}:
      [  601.079000]        [<ffffffff810dc1d8>] __lock_acquire+0x1e18/0x1f10
      [  601.079000]        [<ffffffff810dc971>] lock_acquire+0xa1/0x140
      [  601.079000]        [<ffffffff816835ca>] mutex_lock_nested+0x7a/0x3b0
      [  601.079000]        [<ffffffff81397566>] lock_fb_info+0x26/0x60
      [  601.079000]        [<ffffffff813a4aeb>] fbcon_blank+0x29b/0x2e0
      [  601.079000]        [<ffffffff81418658>] do_blank_screen+0x1d8/0x280
      [  601.079000]        [<ffffffff8141ab34>] console_callback+0x64/0x160
      [  601.079000]        [<ffffffff8108d855>] process_one_work+0x1f5/0x540
      [  601.079000]        [<ffffffff8108e04c>] worker_thread+0x11c/0x370
      [  601.079000]        [<ffffffff81095fbd>] kthread+0xed/0x100
      [  601.079000]        [<ffffffff816914ec>] ret_from_fork+0x7c/0xb0
      [  601.079000]
      other info that might help us debug this:
      
      [  601.079000]  Possible unsafe locking scenario:
      
      [  601.079000]        CPU0                    CPU1
      [  601.079000]        ----                    ----
      [  601.079000]   lock(console_lock);
      [  601.079000]                                lock(&fb_info->lock);
      [  601.079000]                                lock(console_lock);
      [  601.079000]   lock(&fb_info->lock);
      [  601.079000]
       *** DEADLOCK ***
      
      so we reorder the lock sequence the same as it in console_callback() to
      avoid this issue. And following Tomi's suggestion, fix these similar
      issues all in fb subsystem.
      Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      be528908
    • Takashi Iwai's avatar
      drm: Prefer noninterlace cmdline mode unless explicitly specified · c9c5b01e
      Takashi Iwai authored
      commit c683f427 upstream.
      
      Currently drm_pick_cmdline_mode() doesn't care about the interlace
      when the given mode line has no "i" suffix.  That is, when there are
      multiple entries for the same resolution, an interlace mode might be
      picked up just depending on the assigned order, and there is no way to
      exclude it.
      
      This patch changes the logic for the mode selection, to prefer the
      noninterlace mode unless the interlace mode is explicitly given.
      When no matching mode is found, it still tries the interlace mode as
      fallback.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c9c5b01e
    • Alex Deucher's avatar
      drm/radeon: enable speaker allocation setup on dce3.2 · 21a4209d
      Alex Deucher authored
      commit 3803c8e5 upstream.
      
      Now that we disable audio while setting up the audio
      hw, we should be able to set this up without hangs.
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      21a4209d
    • Alex Deucher's avatar
      drm/radeon: change audio enable logic · d6bb21f4
      Alex Deucher authored
      commit 832eafaf upstream.
      
      Disable audio around audio hw setup.  This may avoid
      hangs on certain asics.
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d6bb21f4
    • Martin Koegler's avatar
      drm/cirrus: Fix cirrus drm driver for fbdev + qemu · 929476d0
      Martin Koegler authored
      commit 99d4a8ae upstream.
      
      Xorg fbdev driver requires smem_start/smem_len, otherwise
      it tries to map 0 bytes as video memory.
      
      Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=856760Signed-off-by: default avatarMartin Koegler <martin.koegler@chello.at>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      929476d0
    • Chris Wilson's avatar
      drm/i915: Undo the PIPEA quirk for i845 · 14fa4b54
      Chris Wilson authored
      commit a4945f95 upstream.
      
      The PIPEA quirk is specifically for the issue with the PIPEB PLL on
      830gm being slaved to the PIPEA PLL, and so to use PIPEB requires PIPEA
      running. i845 doesn't even have the second PLL or pipe, and enabling
      the quirk results in a blank DVO LVDS.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      14fa4b54
    • Jiri Kosina's avatar
      floppy: bail out in open() if drive is not responding to block0 read · e6732e00
      Jiri Kosina authored
      commit 7b7b68bb upstream.
      
      In case reading of block 0 during open() fails, it is not the right thing
      to let open() succeed.
      
      Fix this by introducing FD_OPEN_SHOULD_FAIL_BIT flag, and setting it in
      case the bio callback encounters an error while trying to read block 0.
      
      As a bonus, this works around certain broken userspace (blkid), which is
      not able to properly handle read()s returning IO errors. Hence be nice to
      those, and bail out during open() already; if block 0 is not readable,
      read()s are not going to provide any meaningful data anyway.
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e6732e00
    • Jan Kara's avatar
      ext4: Speedup WB_SYNC_ALL pass called from sync(2) · 3042adcc
      Jan Kara authored
      commit 10542c22 upstream.
      
      When doing filesystem wide sync, there's no need to force transaction
      commit (or synchronously write inode buffer) separately for each inode
      because ext4_sync_fs() takes care of forcing commit at the end (VFS
      takes care of flushing buffer cache, respectively). Most of the time
      this slowness doesn't manifest because previous WB_SYNC_NONE writeback
      doesn't leave much to write but when there are processes aggressively
      creating new files and several filesystems to sync, the sync slowness
      can be noticeable. In the following test script sync(1) takes around 6
      minutes when there are two ext4 filesystems mounted on a standard SATA
      drive. After this patch sync takes a couple of seconds so we have about
      two orders of magnitude improvement.
      
            function run_writers
            {
              for (( i = 0; i < 10; i++ )); do
                mkdir $1/dir$i
                for (( j = 0; j < 40000; j++ )); do
                  dd if=/dev/zero of=$1/dir$i/$j bs=4k count=4 &>/dev/null
                done &
              done
            }
      
            for dir in "$@"; do
              run_writers $dir
            done
      
            sleep 40
            time sync
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3042adcc
    • Trond Myklebust's avatar
      SUNRPC: Fix potential memory scribble in xprt_free_bc_request() · 8eab668e
      Trond Myklebust authored
      commit 62835679 upstream.
      
      The call to xprt_free_allocation() will call list_del() on
      req->rq_bc_pa_list, which is not attached to a list.
      This patch moves the list_del() out of xprt_free_allocation()
      and into those callers that need it.
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      8eab668e
    • Trond Myklebust's avatar
      NFSv3: Fix return value of nfs3_proc_setacls · 173d76aa
      Trond Myklebust authored
      commit 8f493b9c upstream.
      
      nfs3_proc_setacls is used internally by the NFSv3 create operations
      to set the acl after the file has been created. If the operation
      fails because the server doesn't support acls, then it must return '0',
      not -EOPNOTSUPP.
      Reported-by: default avatarRussell King <linux@arm.linux.org.uk>
      Link: http://lkml.kernel.org/r/20140201010328.GI15937@n2100.arm.linux.org.uk
      Cc: Christoph Hellwig <hch@lst.de>
      Tested-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Acked-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      173d76aa
    • Malahal Naineni's avatar
      nfs: initialize the ACL support bits to zero. · 0eec4308
      Malahal Naineni authored
      commit a1800aca upstream.
      
      Avoid returning incorrect acl mask attributes when the server doesn't
      support ACLs.
      Signed-off-by: default avatarMalahal Naineni <malahal@us.ibm.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0eec4308
    • Jiri Slaby's avatar
      Char: ipmi_bt_sm, fix infinite loop · 1070f326
      Jiri Slaby authored
      commit a94cdd1f upstream.
      
      In read_all_bytes, we do
      
        unsigned char i;
        ...
        bt->read_data[0] = BMC2HOST;
        bt->read_count = bt->read_data[0];
        ...
        for (i = 1; i <= bt->read_count; i++)
          bt->read_data[i] = BMC2HOST;
      
      If bt->read_data[0] == bt->read_count == 255, we loop infinitely in the
      'for' loop.  Make 'i' an 'int' instead of 'char' to get rid of the
      overflow and finish the loop after 255 iterations every time.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Reported-and-debugged-by: default avatarRui Hui Dian <rhdian@novell.com>
      Cc: Tomas Cech <tcech@suse.cz>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: <openipmi-developer@lists.sourceforge.net>
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1070f326
  2. 13 Apr, 2014 7 commits
    • Finn Thain's avatar
      m68k: Skip futex_atomic_cmpxchg_inatomic() test · 37f6d106
      Finn Thain authored
      commit e571c58f upstream.
      
      Skip the futex_atomic_cmpxchg_inatomic() test in futex_init(). It causes a
      fatal exception on 68030 (and presumably 68020 also).
      Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1403061006440.5525@nippy.intranetSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      37f6d106
    • Heiko Carstens's avatar
      futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test · cee41ea0
      Heiko Carstens authored
      commit 03b8c7b6 upstream.
      
      If an architecture has futex_atomic_cmpxchg_inatomic() implemented and there
      is no runtime check necessary, allow to skip the test within futex_init().
      
      This allows to get rid of some code which would always give the same result,
      and also allows the compiler to optimize a couple of if statements away.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Finn Thain <fthain@telegraphics.com.au>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Link: http://lkml.kernel.org/r/20140302120947.GA3641@osirisSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      [geert: Backported to v3.10..v3.13]
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      cee41ea0
    • Paul Moore's avatar
      selinux: correctly label /proc inodes in use before the policy is loaded · 4a1bdd99
      Paul Moore authored
      commit f64410ec upstream.
      
      This patch is based on an earlier patch by Eric Paris, he describes
      the problem below:
      
        "If an inode is accessed before policy load it will get placed on a
         list of inodes to be initialized after policy load.  After policy
         load we call inode_doinit() which calls inode_doinit_with_dentry()
         on all inodes accessed before policy load.  In the case of inodes
         in procfs that means we'll end up at the bottom where it does:
      
           /* Default to the fs superblock SID. */
           isec->sid = sbsec->sid;
      
           if ((sbsec->flags & SE_SBPROC) && !S_ISLNK(inode->i_mode)) {
                   if (opt_dentry) {
                           isec->sclass = inode_mode_to_security_class(...)
                           rc = selinux_proc_get_sid(opt_dentry,
                                                     isec->sclass,
                                                     &sid);
                           if (rc)
                                   goto out_unlock;
                           isec->sid = sid;
                   }
           }
      
         Since opt_dentry is null, we'll never call selinux_proc_get_sid()
         and will leave the inode labeled with the label on the superblock.
         I believe a fix would be to mimic the behavior of xattrs.  Look
         for an alias of the inode.  If it can't be found, just leave the
         inode uninitialized (and pick it up later) if it can be found, we
         should be able to call selinux_proc_get_sid() ..."
      
      On a system exhibiting this problem, you will notice a lot of files in
      /proc with the generic "proc_t" type (at least the ones that were
      accessed early in the boot), for example:
      
         # ls -Z /proc/sys/kernel/shmmax | awk '{ print $4 " " $5 }'
         system_u:object_r:proc_t:s0 /proc/sys/kernel/shmmax
      
      However, with this patch in place we see the expected result:
      
         # ls -Z /proc/sys/kernel/shmmax | awk '{ print $4 " " $5 }'
         system_u:object_r:sysctl_kernel_t:s0 /proc/sys/kernel/shmmax
      
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: default avatarPaul Moore <pmoore@redhat.com>
      Acked-by: default avatarEric Paris <eparis@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      4a1bdd99
    • Sebastian Hesselbarth's avatar
      PCI: mvebu: move clock enable before register access · 5829b0e0
      Sebastian Hesselbarth authored
      commit b42285f6 upstream.
      
      The clock passed to PCI controller found on MVEBU SoCs may come from a
      clock gate. This requires the clock to be enabled before any registers
      are accessed. Therefore, move the clock enable before register iomap to
      ensure it is enabled.
      Signed-off-by: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      5829b0e0
    • Mikulas Patocka's avatar
      powernow-k6: reorder frequencies · 204e4f25
      Mikulas Patocka authored
      commit 22c73795 upstream.
      
      This patch reorders reported frequencies from the highest to the lowest,
      just like in other frequency drivers.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      204e4f25
    • Mikulas Patocka's avatar
      powernow-k6: correctly initialize default parameters · b80bb221
      Mikulas Patocka authored
      commit d82b922a upstream.
      
      The powernow-k6 driver used to read the initial multiplier from the
      powernow register. However, there is a problem with this:
      
      * If there was a frequency transition before, the multiplier read from the
        register corresponds to the current multiplier.
      * If there was no frequency transition since reset, the field in the
        register always reads as zero, regardless of the current multiplier that
        is set using switches on the mainboard and that the CPU is running at.
      
      The zero value corresponds to multiplier 4.5, so as a consequence, the
      powernow-k6 driver always assumes multiplier 4.5.
      
      For example, if we have 550MHz CPU with bus frequency 100MHz and
      multiplier 5.5, the powernow-k6 driver thinks that the multiplier is 4.5
      and bus frequency is 122MHz. The powernow-k6 driver then sets the
      multiplier to 4.5, underclocking the CPU to 450MHz, but reports the
      current frequency as 550MHz.
      
      There is no reliable way how to read the initial multiplier. I modified
      the driver so that it contains a table of known frequencies (based on
      parameters of existing CPUs and some common overclocking schemes) and sets
      the multiplier according to the frequency. If the frequency is unknown
      (because of unusual overclocking or underclocking), the user must supply
      the bus speed and maximum multiplier as module parameters.
      
      This patch should be backported to all stable kernels. If it doesn't
      apply cleanly, change it, or ask me to change it.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      b80bb221
    • Mikulas Patocka's avatar
      powernow-k6: disable cache when changing frequency · 3389f243
      Mikulas Patocka authored
      commit e20e1d0a upstream.
      
      I found out that a system with k6-3+ processor is unstable during network
      server load. The system locks up or the network card stops receiving. The
      reason for the instability is the CPU frequency scaling.
      
      During frequency transition the processor is in "EPM Stop Grant" state.
      The documentation says that the processor doesn't respond to inquiry
      requests in this state. Consequently, coherency of processor caches and
      bus master devices is not maintained, causing the system instability.
      
      This patch flushes the cache during frequency transition. It fixes the
      instability.
      
      Other minor changes:
      * u64 invalue changed to unsigned long because the variable is 32-bit
      * move the logic to set the multiplier to a separate function
        powernow_k6_set_cpu_multiplier
      * preserve lower 5 bits of the powernow port instead of 4 (the voltage
        field has 5 bits)
      * mask interrupts when reading the multiplier, so that the port is not
        open during other activity (running other kernel code with the port open
        shouldn't cause any misbehavior, but we should better be safe and keep
        the port closed)
      
      This patch should be backported to all stable kernels. If it doesn't
      apply cleanly, change it, or ask me to change it.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3389f243
  3. 03 Apr, 2014 10 commits
    • Jiri Slaby's avatar
      Linux 3.12.17 · 2acf1c25
      Jiri Slaby authored
      2acf1c25
    • Daniel Borkmann's avatar
      netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages · f9c8e356
      Daniel Borkmann authored
      commit b22f5126 upstream.
      
      Some occurences in the netfilter tree use skb_header_pointer() in
      the following way ...
      
        struct dccp_hdr _dh, *dh;
        ...
        skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
      
      ... where dh itself is a pointer that is being passed as the copy
      buffer. Instead, we need to use &_dh as the forth argument so that
      we're copying the data into an actual buffer that sits on the stack.
      
      Currently, we probably could overwrite memory on the stack (e.g.
      with a possibly mal-formed DCCP packet), but unintentionally, as
      we only want the buffer to be placed into _dh variable.
      
      Fixes: 2bc78049 ("[NETFILTER]: nf_conntrack: add DCCP protocol support")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f9c8e356
    • David Rientjes's avatar
      mm: close PageTail race · 9a110858
      David Rientjes authored
      commit 668f9abb upstream.
      
      Commit bf6bddf1 ("mm: introduce compaction and migration for
      ballooned pages") introduces page_count(page) into memory compaction
      which dereferences page->first_page if PageTail(page).
      
      This results in a very rare NULL pointer dereference on the
      aforementioned page_count(page).  Indeed, anything that does
      compound_head(), including page_count() is susceptible to racing with
      prep_compound_page() and seeing a NULL or dangling page->first_page
      pointer.
      
      This patch uses Andrea's implementation of compound_trans_head() that
      deals with such a race and makes it the default compound_head()
      implementation.  This includes a read memory barrier that ensures that
      if PageTail(head) is true that we return a head page that is neither
      NULL nor dangling.  The patch then adds a store memory barrier to
      prep_compound_page() to ensure page->first_page is set.
      
      This is the safest way to ensure we see the head page that we are
      expecting, PageTail(page) is already in the unlikely() path and the
      memory barriers are unfortunately required.
      
      Hugetlbfs is the exception, we don't enforce a store memory barrier
      during init since no race is possible.
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Holger Kiehl <Holger.Kiehl@dwd.de>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Rafael Aquini <aquini@redhat.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9a110858
    • Thomas Petazzoni's avatar
      net: mvneta: fix usage as a module on RGMII configurations · 2c34f0e2
      Thomas Petazzoni authored
      commit e3a8786c upstream.
      
      Commit 5445eaf3 ('mvneta: Try to fix mvneta when compiled as
      module') fixed the mvneta driver to make it work properly when loaded
      as a module in SGMII configuration, which was tested successful by the
      author on the Armada XP OpenBlocks AX3, which uses SGMII.
      
      However, it turns out that the Armada XP GP, which uses RGMII, is
      affected by a similar problem: its SERDES configuration is lost when
      mvneta is loaded as a module, because this configuration is set by the
      bootloader, and then lost because the clock is gated by the clock
      framework until the mvneta driver is loaded again and the clock is
      re-enabled.
      
      However, it turns out that for the RGMII case, setting the SERDES
      configuration is not sufficient: the PCS enable bit in the
      MVNETA_GMAC_CTRL_2 register must also be set, like in the SGMII
      configuration.
      
      Therefore, this commit reworks the SGMII/RGMII initialization: the
      only difference between the two now is a different SERDES
      configuration, all the rest is identical.
      
      In detail, to achieve this, the commit:
      
       * Renames MVNETA_SGMII_SERDES_CFG to MVNETA_SERDES_CFG because it is
         not specific to SGMII, but also used on RGMII configurations.
      
       * Adds a MVNETA_RGMII_SERDES_PROTO definition, that must be used as
         the MVNETA_SERDES_CFG value in RGMII configurations.
      
       * Removes the mvneta_gmac_rgmii_set() and mvneta_port_sgmii_config()
         functions, and instead directly do the SGMII/RGMII configuration in
         mvneta_port_up(), from where those functions where called. It is
         worth mentioning that mvneta_gmac_rgmii_set() had an 'enable'
         parameter that was always passed as '1', so it was pretty useless.
      
       * Reworks the mvneta_port_up() function to set the MVNETA_SERDES_CFG
         register to the appropriate value depending on the RGMII vs. SGMII
         configuration. It also unconditionally set the PCS_ENABLE bit (was
         already done for SGMII, but is now also needed for RGMII), and sets
         the PORT_RGMII bit (which was already done for both SGMII and
         RGMII).
      
      This commit was successfully tested with mvneta compiled as a module,
      on both the OpenBlocks AX3 (SGMII configuration) and the Armada XP GP
      (RGMII configuration).
      Reported-by: default avatarSteve McIntyre <steve@einval.com>
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2c34f0e2
    • Thomas Petazzoni's avatar
      net: mvneta: rename MVNETA_GMAC2_PSC_ENABLE to MVNETA_GMAC2_PCS_ENABLE · 44144f93
      Thomas Petazzoni authored
      commit a79121d3 upstream.
      
      Bit 3 of the MVNETA_GMAC_CTRL_2 is actually used to enable the PCS,
      not the PSC: there was a typo in the name of the define, which this
      commit fixes.
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      44144f93
    • Al Viro's avatar
      make prepend_name() work correctly when called with negative *buflen · a41fd753
      Al Viro authored
      commit e825196d upstream.
      
      In all callchains leading to prepend_name(), the value left in *buflen
      is eventually discarded unused if prepend_name() has returned a negative.
      So we are free to do what prepend() does, and subtract from *buflen
      *before* checking for underflow (which turns into checking the sign
      of subtraction result, of course).
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      a41fd753
    • Artem Fetishev's avatar
      x86: fix boot on uniprocessor systems · 2c611dc0
      Artem Fetishev authored
      commit 825600c0 upstream.
      
      On x86 uniprocessor systems topology_physical_package_id() returns -1
      which causes rapl_cpu_prepare() to leave rapl_pmu variable uninitialized
      which leads to GPF in rapl_pmu_init().
      
      See arch/x86/kernel/cpu/perf_event_intel_rapl.c.
      
      It turns out that physical_package_id and core_id can actually be
      retreived for uniprocessor systems too.  Enabling them also fixes
      rapl_pmu code.
      Signed-off-by: default avatarArtem Fetishev <artem_fetishev@epam.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2c611dc0
    • Daniel Vetter's avatar
      drm/i915: Undo gtt scratch pte unmapping again · c890d3e4
      Daniel Vetter authored
      commit 8ee661b5 upstream.
      
      It apparently blows up on some machines. This functionally reverts
      
      commit 828c7908
      Author: Ben Widawsky <benjamin.widawsky@intel.com>
      Date:   Wed Oct 16 09:21:30 2013 -0700
      
          drm/i915: Disable GGTT PTEs on GEN6+ suspend
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64841Reported-and-Tested-by: default avatarBrad  Jackson <bjackson0971@gmail.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Todd Previte <tprevite@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c890d3e4
    • Scott Wood's avatar
      i2c: cpm: Fix build by adding of_address.h and of_irq.h · 9002dd5f
      Scott Wood authored
      commit 5f12c5ec upstream.
      
      Fixes a build break due to the undeclared use of irq_of_parse_and_map()
      and of_iomap().  This build break was apparently introduced while the
      driver was unbuildable due to the bug fixed by
      62c19c9d ("i2c: Remove usage of
      orphaned symbol OF_I2C").  When 62c19c was added in v3.14-rc7,
      the driver was enabled again, breaking the powerpc mpc85xx_defconfig
      and mpc85xx_smp_defconfig.
      
      62c19c is marked for stable, so this should go there as well.
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9002dd5f
    • David Vrabel's avatar
      Revert "xen: properly account for _PAGE_NUMA during xen pte translations" · 1f21fba4
      David Vrabel authored
      commit 5926f87f upstream.
      
      This reverts commit a9c8e4be.
      
      PTEs in Xen PV guests must contain machine addresses if _PAGE_PRESENT
      is set and pseudo-physical addresses is _PAGE_PRESENT is clear.
      
      This is because during a domain save/restore (migration) the page
      table entries are "canonicalised" and uncanonicalised". i.e., MFNs are
      converted to PFNs during domain save so that on a restore the page
      table entries may be rewritten with the new MFNs on the destination.
      This canonicalisation is only done for PTEs that are present.
      
      This change resulted in writing PTEs with MFNs if _PAGE_PROTNONE (or
      _PAGE_NUMA) was set but _PAGE_PRESENT was clear.  These PTEs would be
      migrated as-is which would result in unexpected behaviour in the
      destination domain.  Either a) the MFN would be translated to the
      wrong PFN/page; b) setting the _PAGE_PRESENT bit would clear the PTE
      because the MFN is no longer owned by the domain; or c) the present
      bit would not get set.
      
      Symptoms include "Bad page" reports when munmapping after migrating a
      domain.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Acked-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1f21fba4