1. 29 Aug, 2013 36 commits
    • Chuck Anderson's avatar
      xen/smp: initialize IPI vectors before marking CPU online · 51f50872
      Chuck Anderson authored
      commit fc78d343 upstream.
      
      An older PVHVM guest (v3.0 based) crashed during vCPU hot-plug with:
      
      	kernel BUG at drivers/xen/events.c:1328!
      
      RCU has detected that a CPU has not entered a quiescent state within the
      grace period.  It needs to send the CPU a reschedule IPI if it is not
      offline.  rcu_implicit_offline_qs() does this check:
      
      	/*
      	 * If the CPU is offline, it is in a quiescent state.  We can
      	 * trust its state not to change because interrupts are disabled.
      	 */
      	if (cpu_is_offline(rdp->cpu)) {
      		rdp->offline_fqs++;
      		return 1;
      	}
      
      	Else the CPU is online.  Send it a reschedule IPI.
      
      The CPU is in the middle of being hot-plugged and has been marked online
      (!cpu_is_offline()).  See start_secondary():
      
      	set_cpu_online(smp_processor_id(), true);
      	...
      	per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
      
      start_secondary() then waits for the CPU bringing up the hot-plugged CPU to
      mark it as active:
      
      	/*
      	 * Wait until the cpu which brought this one up marked it
      	 * online before enabling interrupts. If we don't do that then
      	 * we can end up waking up the softirq thread before this cpu
      	 * reached the active state, which makes the scheduler unhappy
      	 * and schedule the softirq thread on the wrong cpu. This is
      	 * only observable with forced threaded interrupts, but in
      	 * theory it could also happen w/o them. It's just way harder
      	 * to achieve.
      	 */
      	while (!cpumask_test_cpu(smp_processor_id(), cpu_active_mask))
      		cpu_relax();
      
      	/* enable local interrupts */
      	local_irq_enable();
      
      The CPU being hot-plugged will be marked active after it has been fully
      initialized by the CPU managing the hot-plug.  In the Xen PVHVM case
      xen_smp_intr_init() is called to set up the hot-plugged vCPU's
      XEN_RESCHEDULE_VECTOR.
      
      The hot-plugging CPU is marked online, not marked active and does not have
      its IPI vectors set up.  rcu_implicit_offline_qs() sees the hot-plugging
      cpu is !cpu_is_offline() and tries to send it a reschedule IPI:
      This will lead to:
      
      	kernel BUG at drivers/xen/events.c:1328!
      
      	xen_send_IPI_one()
      	xen_smp_send_reschedule()
      	rcu_implicit_offline_qs()
      	rcu_implicit_dynticks_qs()
      	force_qs_rnp()
      	force_quiescent_state()
      	__rcu_process_callbacks()
      	rcu_process_callbacks()
      	__do_softirq()
      	call_softirq()
      	do_softirq()
      	irq_exit()
      	xen_evtchn_do_upcall()
      
      because xen_send_IPI_one() will attempt to use an uninitialized IRQ for
      the XEN_RESCHEDULE_VECTOR.
      
      There is at least one other place that has caused the same crash:
      
      	xen_smp_send_reschedule()
      	wake_up_idle_cpu()
      	add_timer_on()
      	clocksource_watchdog()
      	call_timer_fn()
      	run_timer_softirq()
      	__do_softirq()
      	call_softirq()
      	do_softirq()
      	irq_exit()
      	xen_evtchn_do_upcall()
      	xen_hvm_callback_vector()
      
      clocksource_watchdog() uses cpu_online_mask to pick the next CPU to handle
      a watchdog timer:
      
      	/*
      	 * Cycle through CPUs to check if the CPUs stay synchronized
      	 * to each other.
      	 */
      	next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
      	if (next_cpu >= nr_cpu_ids)
      		next_cpu = cpumask_first(cpu_online_mask);
      	watchdog_timer.expires += WATCHDOG_INTERVAL;
      	add_timer_on(&watchdog_timer, next_cpu);
      
      This resulted in an attempt to send an IPI to a hot-plugging CPU that
      had not initialized its reschedule vector. One option would be to make
      the RCU code check to not check for CPU offline but for CPU active.
      As becoming active is done after a CPU is online (in older kernels).
      
      But Srivatsa pointed out that "the cpu_active vs cpu_online ordering has been
      completely reworked - in the online path, cpu_active is set *before* cpu_online,
      and also, in the cpu offline path, the cpu_active bit is reset in the CPU_DYING
      notification instead of CPU_DOWN_PREPARE." Drilling in this the bring-up
      path: "[brought up CPU].. send out a CPU_STARTING notification, and in response
      to that, the scheduler sets the CPU in the cpu_active_mask. Again, this mask
      is better left to the scheduler alone, since it has the intelligence to use it
      judiciously."
      
      The conclusion was that:
      "
      1. At the IPI sender side:
      
         It is incorrect to send an IPI to an offline CPU (cpu not present in
         the cpu_online_mask). There are numerous places where we check this
         and warn/complain.
      
      2. At the IPI receiver side:
      
         It is incorrect to let the world know of our presence (by setting
         ourselves in global bitmasks) until our initialization steps are complete
         to such an extent that we can handle the consequences (such as
         receiving interrupts without crashing the sender etc.)
      " (from Srivatsa)
      
      As the native code enables the interrupts at some point we need to be
      able to service them. In other words a CPU must have valid IPI vectors
      if it has been marked online.
      
      It doesn't need to handle the IPI (interrupts may be disabled) but needs
      to have valid IPI vectors because another CPU may find it in cpu_online_mask
      and attempt to send it an IPI.
      
      This patch will change the order of the Xen vCPU bring-up functions so that
      Xen vectors have been set up before start_secondary() is called.
      It also will not continue to bring up a Xen vCPU if xen_smp_intr_init() fails
      to initialize it.
      
      Orabug 13823853
      Signed-off-by Chuck Anderson <chuck.anderson@oracle.com>
      Acked-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarJonghwan Choi <jhbird.choi@samsung.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      51f50872
    • Steven Rostedt (Red Hat)'s avatar
      ftrace: Check module functions being traced on reload · f05e999f
      Steven Rostedt (Red Hat) authored
      commit 8c4f3c3f upstream.
      
      There's been a nasty bug that would show up and not give much info.
      The bug displayed the following warning:
      
       WARNING: at kernel/trace/ftrace.c:1529 __ftrace_hash_rec_update+0x1e3/0x230()
       Pid: 20903, comm: bash Tainted: G           O 3.6.11+ #38405.trunk
       Call Trace:
        [<ffffffff8103e5ff>] warn_slowpath_common+0x7f/0xc0
        [<ffffffff8103e65a>] warn_slowpath_null+0x1a/0x20
        [<ffffffff810c2ee3>] __ftrace_hash_rec_update+0x1e3/0x230
        [<ffffffff810c4f28>] ftrace_hash_move+0x28/0x1d0
        [<ffffffff811401cc>] ? kfree+0x2c/0x110
        [<ffffffff810c68ee>] ftrace_regex_release+0x8e/0x150
        [<ffffffff81149f1e>] __fput+0xae/0x220
        [<ffffffff8114a09e>] ____fput+0xe/0x10
        [<ffffffff8105fa22>] task_work_run+0x72/0x90
        [<ffffffff810028ec>] do_notify_resume+0x6c/0xc0
        [<ffffffff8126596e>] ? trace_hardirqs_on_thunk+0x3a/0x3c
        [<ffffffff815c0f88>] int_signal+0x12/0x17
       ---[ end trace 793179526ee09b2c ]---
      
      It was finally narrowed down to unloading a module that was being traced.
      
      It was actually more than that. When functions are being traced, there's
      a table of all functions that have a ref count of the number of active
      tracers attached to that function. When a function trace callback is
      registered to a function, the function's record ref count is incremented.
      When it is unregistered, the function's record ref count is decremented.
      If an inconsistency is detected (ref count goes below zero) the above
      warning is shown and the function tracing is permanently disabled until
      reboot.
      
      The ftrace callback ops holds a hash of functions that it filters on
      (and/or filters off). If the hash is empty, the default means to filter
      all functions (for the filter_hash) or to disable no functions (for the
      notrace_hash).
      
      When a module is unloaded, it frees the function records that represent
      the module functions. These records exist on their own pages, that is
      function records for one module will not exist on the same page as
      function records for other modules or even the core kernel.
      
      Now when a module unloads, the records that represents its functions are
      freed. When the module is loaded again, the records are recreated with
      a default ref count of zero (unless there's a callback that traces all
      functions, then they will also be traced, and the ref count will be
      incremented).
      
      The problem is that if an ftrace callback hash includes functions of the
      module being unloaded, those hash entries will not be removed. If the
      module is reloaded in the same location, the hash entries still point
      to the functions of the module but the module's ref counts do not reflect
      that.
      
      With the help of Steve and Joern, we found a reproducer:
      
       Using uinput module and uinput_release function.
      
       cd /sys/kernel/debug/tracing
       modprobe uinput
       echo uinput_release > set_ftrace_filter
       echo function > current_tracer
       rmmod uinput
       modprobe uinput
       # check /proc/modules to see if loaded in same addr, otherwise try again
       echo nop > current_tracer
      
       [BOOM]
      
      The above loads the uinput module, which creates a table of functions that
      can be traced within the module.
      
      We add uinput_release to the filter_hash to trace just that function.
      
      Enable function tracincg, which increments the ref count of the record
      associated to uinput_release.
      
      Remove uinput, which frees the records including the one that represents
      uinput_release.
      
      Load the uinput module again (and make sure it's at the same address).
      This recreates the function records all with a ref count of zero,
      including uinput_release.
      
      Disable function tracing, which will decrement the ref count for uinput_release
      which is now zero because of the module removal and reload, and we have
      a mismatch (below zero ref count).
      
      The solution is to check all currently tracing ftrace callbacks to see if any
      are tracing any of the module's functions when a module is loaded (it already does
      that with callbacks that trace all functions). If a callback happens to have
      a module function being traced, it increments that records ref count and starts
      tracing that function.
      
      There may be a strange side effect with this, where tracing module functions
      on unload and then reloading a new module may have that new module's functions
      being traced. This may be something that confuses the user, but it's not
      a big deal. Another approach is to disable all callback hashes on module unload,
      but this leaves some ftrace callbacks that may not be registered, but can
      still have hashes tracing the module's function where ftrace doesn't know about
      it. That situation can cause the same bug. This solution solves that case too.
      Another benefit of this solution, is it is possible to trace a module's
      function on unload and load.
      
      Link: http://lkml.kernel.org/r/20130705142629.GA325@redhat.comReported-by: default avatarJörn Engel <joern@logfs.org>
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Reported-by: default avatarSteve Hodgson <steve@purestorage.com>
      Tested-by: default avatarSteve Hodgson <steve@purestorage.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f05e999f
    • Steven Rostedt (Red Hat)'s avatar
      tracing/uprobes: Fail to unregister if probe event files are in use · 396dd500
      Steven Rostedt (Red Hat) authored
      commit c6c2401d upstream.
      
      Uprobes suffer the same problem that kprobes have. There's a race between
      writing to the "enable" file and removing the probe. The probe checks for
      it being in use and if it is not, goes about deleting the probe and the
      event that represents it. But the problem with that is, after it checks
      if it is in use it can be enabled, and the deletion of the event (access
      to the probe) will fail, as it is in use. But the uprobe will still be
      deleted. This is a problem as the event can reference the uprobe that
      was deleted.
      
      The fix is to remove the event first, and check to make sure the event
      removal succeeds. Then it is safe to remove the probe.
      
      When the event exists, either ftrace or perf can enable the probe and
      prevent the event from being removed.
      
      Link: http://lkml.kernel.org/r/20130704034038.991525256@goodmis.orgAcked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      396dd500
    • Steven Rostedt (Red Hat)'s avatar
      tracing/kprobes: Fail to unregister if probe event files are in use · 428fbcf9
      Steven Rostedt (Red Hat) authored
      commit 40c32592 upstream.
      
      When a probe is being removed, it cleans up the event files that correspond
      to the probe. But there is a race between writing to one of these files
      and deleting the probe. This is especially true for the "enable" file.
      
      	CPU 0				CPU 1
      	-----				-----
      
      				  fd = open("enable",O_WRONLY);
      
        probes_open()
        release_all_trace_probes()
        unregister_trace_probe()
        if (trace_probe_is_enabled(tp))
      	return -EBUSY
      
      				   write(fd, "1", 1)
      				   __ftrace_set_clr_event()
      				   call->class->reg()
      				    (kprobe_register)
      				     enable_trace_probe(tp)
      
        __unregister_trace_probe(tp);
        list_del(&tp->list)
        unregister_probe_event(tp) <-- fails!
        free_trace_probe(tp)
      
      				   write(fd, "0", 1)
      				   __ftrace_set_clr_event()
      				   call->class->unreg
      				    (kprobe_register)
      				    disable_trace_probe(tp) <-- BOOM!
      
      A test program was written that used two threads to simulate the
      above scenario adding a nanosleep() interval to change the timings
      and after several thousand runs, it was able to trigger this bug
      and crash:
      
      BUG: unable to handle kernel paging request at 00000005000000f9
      IP: [<ffffffff810dee70>] probes_open+0x3b/0xa7
      PGD 7808a067 PUD 0
      Oops: 0000 [#1] PREEMPT SMP
      Dumping ftrace buffer:
      ---------------------------------
      Modules linked in: ipt_MASQUERADE sunrpc ip6t_REJECT nf_conntrack_ipv6
      CPU: 1 PID: 2070 Comm: test-kprobe-rem Not tainted 3.11.0-rc3-test+ #47
      Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./To be filled by O.E.M., BIOS SDBLI944.86P 05/08/2007
      task: ffff880077756440 ti: ffff880076e52000 task.ti: ffff880076e52000
      RIP: 0010:[<ffffffff810dee70>]  [<ffffffff810dee70>] probes_open+0x3b/0xa7
      RSP: 0018:ffff880076e53c38  EFLAGS: 00010203
      RAX: 0000000500000001 RBX: ffff88007844f440 RCX: 0000000000000003
      RDX: 0000000000000003 RSI: 0000000000000003 RDI: ffff880076e52000
      RBP: ffff880076e53c58 R08: ffff880076e53bd8 R09: 0000000000000000
      R10: ffff880077756440 R11: 0000000000000006 R12: ffffffff810dee35
      R13: ffff880079250418 R14: 0000000000000000 R15: ffff88007844f450
      FS:  00007f87a276f700(0000) GS:ffff88007d480000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 00000005000000f9 CR3: 0000000077262000 CR4: 00000000000007e0
      Stack:
       ffff880076e53c58 ffffffff81219ea0 ffff88007844f440 ffffffff810dee35
       ffff880076e53ca8 ffffffff81130f78 ffff8800772986c0 ffff8800796f93a0
       ffffffff81d1b5d8 ffff880076e53e04 0000000000000000 ffff88007844f440
      Call Trace:
       [<ffffffff81219ea0>] ? security_file_open+0x2c/0x30
       [<ffffffff810dee35>] ? unregister_trace_probe+0x4b/0x4b
       [<ffffffff81130f78>] do_dentry_open+0x162/0x226
       [<ffffffff81131186>] finish_open+0x46/0x54
       [<ffffffff8113f30b>] do_last+0x7f6/0x996
       [<ffffffff8113cc6f>] ? inode_permission+0x42/0x44
       [<ffffffff8113f6dd>] path_openat+0x232/0x496
       [<ffffffff8113fc30>] do_filp_open+0x3a/0x8a
       [<ffffffff8114ab32>] ? __alloc_fd+0x168/0x17a
       [<ffffffff81131f4e>] do_sys_open+0x70/0x102
       [<ffffffff8108f06e>] ? trace_hardirqs_on_caller+0x160/0x197
       [<ffffffff81131ffe>] SyS_open+0x1e/0x20
       [<ffffffff81522742>] system_call_fastpath+0x16/0x1b
      Code: e5 41 54 53 48 89 f3 48 83 ec 10 48 23 56 78 48 39 c2 75 6c 31 f6 48 c7
      RIP  [<ffffffff810dee70>] probes_open+0x3b/0xa7
       RSP <ffff880076e53c38>
      CR2: 00000005000000f9
      ---[ end trace 35f17d68fc569897 ]---
      
      The unregister_trace_probe() must be done first, and if it fails it must
      fail the removal of the kprobe.
      
      Several changes have already been made by Oleg Nesterov and Masami Hiramatsu
      to allow moving the unregister_probe_event() before the removal of
      the probe and exit the function if it fails. This prevents the tp
      structure from being used after it is freed.
      
      Link: http://lkml.kernel.org/r/20130704034038.819592356@goodmis.orgAcked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      428fbcf9
    • Oleg Nesterov's avatar
      tracing: trace_remove_event_call() should fail if call/file is in use · 8169887b
      Oleg Nesterov authored
      commit 2816c551 upstream.
      
      Change trace_remove_event_call(call) to return the error if this
      call is active. This is what the callers assume but can't verify
      outside of the tracing locks. Both trace_kprobe.c/trace_uprobe.c
      need the additional changes, unregister_trace_probe() should abort
      if trace_remove_event_call() fails.
      
      The caller is going to free this call/file so we must ensure that
      nobody can use them after trace_remove_event_call() succeeds.
      debugfs should be fine after the previous changes and event_remove()
      does TRACE_REG_UNREGISTER, but still there are 2 reasons why we need
      the additional checks:
      
      - There could be a perf_event(s) attached to this tp_event, so the
        patch checks ->perf_refcount.
      
      - TRACE_REG_UNREGISTER can be suppressed by FTRACE_EVENT_FL_SOFT_MODE,
        so we simply check FTRACE_EVENT_FL_ENABLED protected by event_mutex.
      
      Link: http://lkml.kernel.org/r/20130729175033.GB26284@redhat.comReviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8169887b
    • Oleg Nesterov's avatar
      tracing: Change remove_event_file_dir() to clear "d_subdirs"->i_private · 012dc156
      Oleg Nesterov authored
      commit bf682c31 upstream.
      
      Change remove_event_file_dir() to clear ->i_private for every
      file we are going to remove.
      
      We need to check file->dir != NULL because event_create_dir()
      can fail. debugfs_remove_recursive(NULL) is fine but the patch
      moves it under the same check anyway for readability.
      
      spin_lock(d_lock) and "d_inode != NULL" check are not needed
      afaics, but I do not understand this code enough.
      
      tracing_open_generic_file() and tracing_release_generic_file()
      can go away, ftrace_enable_fops and ftrace_event_filter_fops()
      use tracing_open_generic() but only to check tracing_disabled.
      
      This fixes all races with event_remove() or instance_delete().
      f_op->read/write/whatever can never use the freed file/call,
      all event/* files were changed to check and use ->i_private
      under event_mutex.
      
      Note: this doesn't not fix other problems, event_remove() can
      destroy the active ftrace_event_call, we need more changes but
      those changes are completely orthogonal.
      
      Link: http://lkml.kernel.org/r/20130728183527.GB16723@redhat.comReviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      012dc156
    • Oleg Nesterov's avatar
      tracing: Introduce remove_event_file_dir() · c6febdf2
      Oleg Nesterov authored
      commit f6a84bdc upstream.
      
      Preparation for the next patch. Extract the common code from
      remove_event_from_tracers() and __trace_remove_event_dirs()
      into the new helper, remove_event_file_dir().
      
      The patch looks more complicated than it actually is, it also
      moves remove_subsystem() up to avoid the forward declaration.
      
      Link: http://lkml.kernel.org/r/20130726172547.GA3629@redhat.comReviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c6febdf2
    • Oleg Nesterov's avatar
      tracing: Change f_start() to take event_mutex and verify i_private != NULL · b86d0ba6
      Oleg Nesterov authored
      commit c5a44a12 upstream.
      
      trace_format_open() and trace_format_seq_ops are racy, nothing
      protects ftrace_event_call from trace_remove_event_call().
      
      Change f_start() to take event_mutex and verify i_private != NULL,
      change f_stop() to drop this lock.
      
      This fixes nothing, but now we can change debugfs_remove("format")
      callers to nullify ->i_private and fix the the problem.
      
      Note: the usage of event_mutex is sub-optimal but simple, we can
      change this later.
      
      Link: http://lkml.kernel.org/r/20130726172543.GA3622@redhat.comReviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      b86d0ba6
    • Oleg Nesterov's avatar
      tracing: Change event_filter_read/write to verify i_private != NULL · 70c91fb9
      Oleg Nesterov authored
      commit e2912b09 upstream.
      
      event_filter_read/write() are racy, ftrace_event_call can be already
      freed by trace_remove_event_call() callers.
      
      1. Shift mutex_lock(event_mutex) from print/apply_event_filter to
         the callers.
      
      2. Change the callers, event_filter_read() and event_filter_write()
         to read i_private under this mutex and abort if it is NULL.
      
      This fixes nothing, but now we can change debugfs_remove("filter")
      callers to nullify ->i_private and fix the the problem.
      
      Link: http://lkml.kernel.org/r/20130726172540.GA3619@redhat.comReviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      70c91fb9
    • Oleg Nesterov's avatar
      tracing: Change event_enable/disable_read() to verify i_private != NULL · df89bf77
      Oleg Nesterov authored
      commit bc6f6b08 upstream.
      
      tracing_open_generic_file() is racy, ftrace_event_file can be
      already freed by rmdir or trace_remove_event_call().
      
      Change event_enable_read() and event_disable_read() to read and
      verify "file = i_private" under event_mutex.
      
      This fixes nothing, but now we can change debugfs_remove("enable")
      callers to nullify ->i_private and fix the the problem.
      
      Link: http://lkml.kernel.org/r/20130726172536.GA3612@redhat.comReviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      df89bf77
    • Oleg Nesterov's avatar
      tracing: Turn event/id->i_private into call->event.type · fdb65fe2
      Oleg Nesterov authored
      commit 1a11126b upstream.
      
      event_id_read() is racy, ftrace_event_call can be already freed
      by trace_remove_event_call() callers.
      
      Change event_create_dir() to pass "data = call->event.type", this
      is all event_id_read() needs. ftrace_event_id_fops no longer needs
      tracing_open_generic().
      
      We add the new helper, event_file_data(), to read ->i_private, it
      will have more users.
      
      Note: currently ACCESS_ONCE() and "id != 0" check are not needed,
      but we are going to change event_remove/rmdir to clear ->i_private.
      
      Link: http://lkml.kernel.org/r/20130726172532.GA3605@redhat.comReviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fdb65fe2
    • Steven Rostedt (Red Hat)'s avatar
      ftrace: Add check for NULL regs if ops has SAVE_REGS set · 29632b10
      Steven Rostedt (Red Hat) authored
      commit 195a8afc upstream.
      
      If a ftrace ops is registered with the SAVE_REGS flag set, and there's
      already a ops registered to one of its functions but without the
      SAVE_REGS flag, there's a small race window where the SAVE_REGS ops gets
      added to the list of callbacks to call for that function before the
      callback trampoline gets set to save the regs.
      
      The problem is, the function is not currently saving regs, which opens
      a small race window where the ops that is expecting regs to be passed
      to it, wont. This can cause a crash if the callback were to reference
      the regs, as the SAVE_REGS guarantees that regs will be set.
      
      To fix this, we add a check in the loop case where it checks if the ops
      has the SAVE_REGS flag set, and if so, it will ignore it if regs is
      not set.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      29632b10
    • Oleg Nesterov's avatar
      tracing: Change tracing_fops/snapshot_fops to rely on tracing_get_cpu() · 7272711a
      Oleg Nesterov authored
      commit 6484c71c upstream.
      
      tracing_open() and tracing_snapshot_open() are racy, the memory
      inode->i_private points to can be already freed.
      
      Convert these last users of "inode->i_private == trace_cpu" to
      use "i_private = trace_array" and rely on tracing_get_cpu().
      
      v2: incorporate the fix from Steven, tracing_release() must not
          blindly dereference file->private_data unless we know that
          the file was opened for reading.
      
      Link: http://lkml.kernel.org/r/20130723152610.GA23737@redhat.comSigned-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7272711a
    • Oleg Nesterov's avatar
      tracing: Change tracing_entries_fops to rely on tracing_get_cpu() · e5dd03c4
      Oleg Nesterov authored
      commit 0bc392ee upstream.
      
      tracing_open_generic_tc() is racy, the memory inode->i_private
      points to can be already freed.
      
      1. Change its last user, tracing_entries_fops, to use
         tracing_*_generic_tr() instead.
      
      2. Change debugfs_create_file("buffer_size_kb", data) callers
         to pass "data = tr".
      
      3. Change tracing_entries_read() and tracing_entries_write() to
         use tracing_get_cpu().
      
      4. Kill the no longer used tracing_open_generic_tc() and
         tracing_release_generic_tc().
      
      Link: http://lkml.kernel.org/r/20130723152606.GA23730@redhat.comSigned-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e5dd03c4
    • Oleg Nesterov's avatar
      tracing: Change tracing_stats_fops to rely on tracing_get_cpu() · 6dafb0f1
      Oleg Nesterov authored
      commit 4d3435b8 upstream.
      
      tracing_open_generic_tc() is racy, the memory inode->i_private
      points to can be already freed.
      
      1. Change one of its users, tracing_stats_fops, to use
         tracing_*_generic_tr() instead.
      
      2. Change trace_create_cpu_file("stats", data) to pass "data = tr".
      
      3. Change tracing_stats_read() to use tracing_get_cpu().
      
      Link: http://lkml.kernel.org/r/20130723152603.GA23727@redhat.comSigned-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6dafb0f1
    • Oleg Nesterov's avatar
      tracing: Change tracing_buffers_fops to rely on tracing_get_cpu() · 92b6279e
      Oleg Nesterov authored
      commit 46ef2be0 upstream.
      
      tracing_buffers_open() is racy, the memory inode->i_private points
      to can be already freed.
      
      Change debugfs_create_file("trace_pipe_raw", data) caller to pass
      "data = tr", tracing_buffers_open() can use tracing_get_cpu().
      
      Change debugfs_create_file("snapshot_raw_fops", data) caller too,
      this file uses tracing_buffers_open/release.
      
      Link: http://lkml.kernel.org/r/20130723152600.GA23720@redhat.comSigned-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      92b6279e
    • Oleg Nesterov's avatar
      tracing: Change tracing_pipe_fops() to rely on tracing_get_cpu() · 23b625fa
      Oleg Nesterov authored
      commit 15544209 upstream.
      
      tracing_open_pipe() is racy, the memory inode->i_private points to
      can be already freed.
      
      Change debugfs_create_file("trace_pipe", data) callers to to pass
      "data = tr", tracing_open_pipe() can use tracing_get_cpu().
      
      Link: http://lkml.kernel.org/r/20130723152557.GA23717@redhat.comSigned-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      23b625fa
    • Oleg Nesterov's avatar
      tracing: Introduce trace_create_cpu_file() and tracing_get_cpu() · e2d4dbe0
      Oleg Nesterov authored
      commit 649e9c70 upstream.
      
      Every "file_operations" used by tracing_init_debugfs_percpu is buggy.
      f_op->open/etc does:
      
      	1. struct trace_cpu *tc = inode->i_private;
      	   struct trace_array *tr = tc->tr;
      
      	2. trace_array_get(tr) or fail;
      
      	3. do_something(tc);
      
      But tc (and tr) can be already freed before trace_array_get() is called.
      And it doesn't matter whether this file is per-cpu or it was created by
      init_tracer_debugfs(), free_percpu() or kfree() are equally bad.
      
      Note that even 1. is not safe, the freed memory can be unmapped. But even
      if it was safe trace_array_get() can wrongly succeed if we also race with
      the next new_instance_create() which can re-allocate the same tr, or tc
      was overwritten and ->tr points to the valid tr. In this case 3. uses the
      freed/reused memory.
      
      Add the new trivial helper, trace_create_cpu_file() which simply calls
      trace_create_file() and encodes "cpu" in "struct inode". Another helper,
      tracing_get_cpu() will be used to read cpu_nr-or-RING_BUFFER_ALL_CPUS.
      
      The patch abuses ->i_cdev to encode the number, it is never used unless
      the file is S_ISCHR(). But we could use something else, say, i_bytes or
      even ->d_fsdata. In any case this hack is hidden inside these 2 helpers,
      it would be trivial to change them if needed.
      
      This patch only changes tracing_init_debugfs_percpu() to use the new
      trace_create_cpu_file(), the next patches will change file_operations.
      
      Note: tracing_get_cpu(inode) is always safe but you can't trust the
      result unless trace_array_get() was called, without trace_types_lock
      which acts as a barrier it can wrongly return RING_BUFFER_ALL_CPUS.
      
      Link: http://lkml.kernel.org/r/20130723152554.GA23710@redhat.com
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e2d4dbe0
    • Masami Hiramatsu's avatar
      tracing/kprobe: Wait for disabling all running kprobe handlers · e899e7e4
      Masami Hiramatsu authored
      commit a232e270 upstream.
      
      Wait for disabling all running kprobe handlers when a kprobe
      event is disabled, since the caller, trace_remove_event_call()
      supposes that a removing event is disabled completely by
      disabling the event.
      With this change, ftrace can ensure that there is no running
      event handlers after disabling it.
      
      Link: http://lkml.kernel.org/r/20130709093526.20138.93100.stgit@mhiramat-M0-7522Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e899e7e4
    • Namhyung Kim's avatar
    • Johannes Berg's avatar
      iwlwifi: mvm: adjust firmware D3 configuration API · b460440f
      Johannes Berg authored
      commit dfcb4c3a upstream.
      
      The D3 firmware API changed to include a new field, adjust
      the driver to it to avoid getting an NMI when configuring.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b460440f
    • Johannes Berg's avatar
      iwlwifi: bump required firmware API version for 3160/7260 · a76139c0
      Johannes Berg authored
      commit a2d0909a upstream.
      
      As the firmware API has changed significantly and we don't
      have support code for the old APIs, bump the version to be
      able to release the version 7 API firmware. Unfortunately
      this means that the driver in 3.9 and 3.10 can't work, but
      that's still better than crashing the device/driver there.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a76139c0
    • Emmanuel Grumbach's avatar
      iwlwifi: mvm: unregister leds when registration failed · 8351caff
      Emmanuel Grumbach authored
      commit b7327d89 upstream.
      
      This was missing and prevented any further attempts
      to load the module.
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8351caff
    • Emmanuel Grumbach's avatar
      iwlwifi: mvm: take the seqno from packet if transmit failed · 07e915c9
      Emmanuel Grumbach authored
      commit ebea2f32 upstream.
      
      The fw is unreliable in all the cases in which the packet
      wasn't sent.
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      07e915c9
    • Emmanuel Grumbach's avatar
      iwlwifi: mvm: don't set the MCAST queue in STA's queue list · 0710345e
      Emmanuel Grumbach authored
      commit 837fb69f upstream.
      
      The MCAST queue should be enabled after DTIM only.
      According to fw API, the MCAST must not be attached to any
      station, but should appear in the mcast_qid of the AP's
      mac context only.
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0710345e
    • Emmanuel Grumbach's avatar
      iwlwifi: mvm: properly tell the fw that a STA is awake · 06a80c46
      Emmanuel Grumbach authored
      commit 5af01772 upstream.
      
      The firmware API wasn't being used correctly, fix that.
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      06a80c46
    • Emmanuel Grumbach's avatar
      iwlwifi: mvm: fix MCAST in AP mode · 21e0f1b2
      Emmanuel Grumbach authored
      commit 9116a368 upstream.
      
      In multicast, there is no retries nor RTS since there is no
      specific recipient that can ACK or send CTS. This means
      that we must not use the rate scale table for multicast
      frames.
      This true for any frame that doesn't have a valid
      ieee80211_sta pointer.
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      21e0f1b2
    • Emmanuel Grumbach's avatar
      iwlwifi: mvm: correctly configure MCAST in AP mode · 446b977e
      Emmanuel Grumbach authored
      commit 86a91ec7 upstream.
      
      The AP mode needs to use the MCAST fifo for the MCAST
      frames sent after the DTIM. This fifo needs to be
      configured with the same parameters as the VOICE FIFO.
      
      A separate SCD queue is mapped to this fifo - the cab_queue
      (cab stands for Content After Beacon). This queue isn't
      connected to any station, but rather to the MAC context.
      This queue should (and is already) be set as the MCAST
      queue - this is part of the of MAC context command.
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Reviewed-by: default avatarIlan Peer <ilan.peer@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      446b977e
    • Samuel Ortiz's avatar
      NFC: llcp: Fix non blocking sockets connections · da989ee1
      Samuel Ortiz authored
      commit b4011239 upstream.
      
      Without the new LLCP_CONNECTING state, non blocking sockets will be
      woken up with a POLLHUP right after calling connect() because their
      state is stuck at LLCP_CLOSED.
      That prevents userspace from implementing any proper non blocking
      socket based NFC p2p client.
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      da989ee1
    • Nicolas Ferre's avatar
      ARM: at91: at91sam9x5 RTC is not compatible with at91rm9200 one · dfc85592
      Nicolas Ferre authored
      commit 23fb05c6 upstream.
      
      Due to a bug with RTC IMR, we cannot consider at91sam9x5 RTC compatible
      with the previous one. Modify DT compatibility string, even if the driver
      is not yet modified to take it into account.
      Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dfc85592
    • Vineet Gupta's avatar
      ARC: gdbserver breakage in Big-Endian configuration #2 · 16a06df2
      Vineet Gupta authored
      [Based on mainline commit 352c1d95: "ARC: stop using
      pt_regs->orig_r8"]
      
      Stop using orig_r8 as it could get clobbered by ST in trap_with_param,
      and further it is semantically not needed either.
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16a06df2
    • Vineet Gupta's avatar
      ARC: gdbserver breakage in Big-Endian configuration #1 · 9b2c750d
      Vineet Gupta authored
      [Based on mainline commit 502a0c77: "ARC: pt_regs update #5"]
      
      gdbserver needs @stop_pc, served by ptrace, but fetched from pt_regs
      differently, based on in_brkpt_traps(), which in turn relies on
      additional machine state in pt_regs->event bitfield.
      
              unsigned long orig_r8:16, event:16;
      
      For big endian config, this macro was returning false, despite being in
      breakpoint Trap exception, causing wrong @stop_pc to be returned to gdb.
      
      Issue #1: In BE, @event above is at offset 2 in word, while a STW insn
                at offset 0 was used to update it. Resort to using ST insn
      	  which updates the half-word at right location.
      
      Issue #2: The union involving bitfields causes all the members to be
      	  laid out at offset 0. So with fix #1 above, ASM was now
      	  updating at offset 2, "C" code was still referencing at
      	  offset 0. Fixed by wrapping bitfield in a struct.
      Reported-by: default avatarNoam Camus <noamc@ezchip.com>
      Tested-by: default avatarAnton Kolesov <akolesov@synopsys.com>
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b2c750d
    • Rafael J. Wysocki's avatar
      ACPI: Try harder to resolve _ADR collisions for bridges · 6e4fdb80
      Rafael J. Wysocki authored
      commit 60f75b8e upstream.
      
      In theory, under a given ACPI namespace node there should be only
      one child device object with _ADR whose value matches a given bus
      address exactly.  In practice, however, there are systems in which
      multiple child device objects under a given parent have _ADR matching
      exactly the same address.  In those cases we use _STA to determine
      which of the multiple matching devices is enabled, since some systems
      are known to indicate which ACPI device object to associate with the
      given physical (usually PCI) device this way.
      
      Unfortunately, as it turns out, there are systems in which many
      device objects under the same parent have _ADR matching exactly the
      same bus address and none of them has _STA, in which case they all
      should be regarded as enabled according to the spec.  Still, if
      those device objects are supposed to represent bridges (e.g. this
      is the case for device objects corresponding to PCIe ports), we can
      try harder and skip the ones that have no child device objects in the
      ACPI namespace.  With luck, we can avoid using device objects that we
      are not expected to use this way.
      
      Although this only works for bridges whose children also have ACPI
      namespace representation, it is sufficient to address graphics
      adapter detection issues on some systems, so rework the code finding
      a matching device ACPI handle for a given bus address to implement
      this idea.
      
      Introduce a new function, acpi_find_child(), taking three arguments:
      the ACPI handle of the device's parent, a bus address suitable for
      the device's bus type and a bool indicating if the device is a
      bridge and make it work as outlined above.  Reimplement the function
      currently used for this purpose, acpi_get_child(), as a call to
      acpi_find_child() with the last argument set to 'false' and make
      the PCI subsystem use acpi_find_child() with the bridge information
      passed as the last argument to it.  [Lan Tianyu notices that it is
      not sufficient to use pci_is_bridge() for that, because the device's
      subordinate pointer hasn't been set yet at this point, so use
      hdr_type instead.]
      
      This change fixes a regression introduced inadvertently by commit
      33f767d7 (ACPI: Rework acpi_get_child() to be more efficient) which
      overlooked the fact that for acpi_walk_namespace() "post-order" means
      "after all children have been visited" rather than "on the way back",
      so for device objects without children and for namespace walks of
      depth 1, as in the acpi_get_child() case, the "post-order" callbacks
      ordering is actually the same as the ordering of "pre-order" ones.
      Since that commit changed the namespace walk in acpi_get_child() to
      terminate after finding the first matching object instead of going
      through all of them and returning the last one, it effectively
      changed the result returned by that function in some rare cases and
      that led to problems (the switch from a "pre-order" to a "post-order"
      callback was supposed to prevent that from happening, but it was
      ineffective).
      
      As it turns out, the systems where the change made by commit
      33f767d7 actually matters are those where there are multiple ACPI
      device objects representing the same PCIe port (which effectively
      is a bridge).  Moreover, only one of them, and the one we are
      expected to use, has child device objects in the ACPI namespace,
      so the regression can be addressed as described above.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=60561Reported-by: default avatarPeter Wu <lekensteyn@gmail.com>
      Tested-by: default avatarVladimir Lalov <mail@vlalov.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Cc: Peter Wu <lekensteyn@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e4fdb80
    • Jeff Wu's avatar
      ACPI: add _STA evaluation at do_acpi_find_child() · 2ac3b5e4
      Jeff Wu authored
      commit c7d9ca90 upstream.
      
      Once do_acpi_find_child() has found the first matching handle, it
      makes the acpi_get_child() loop stop and return that handle.  On some
      platforms, though, there are multiple devices with the same value of
      "_ADR" in the same namespace scope, and if one of them is enabled,
      the others will be disabled.  For example:
      
       Address : 0x1FFFF ; path : SB_PCI0.SATA.DEV0
       Address : 0x1FFFF ; path : SB_PCI0.SATA.DEV1
       Address : 0x1FFFF ; path : SB_PCI0.SATA.DEV2
      
      If DEV0 and DEV1 are disabled and DEV2 is enabled, the handle of DEV2
      should be returned, but actually the function always returns the
      handle of DEV0.
      
      To address that issue, make do_acpi_find_child() evaluate _STA to
      check the device status.  If a matching device object exists, but is
      disabled, acpi_get_child() will continue to walk the namespace in the
      hope of finding an enabled one.  If one is found, its handle will be
      returned, but otherwise the function will return the handle of the
      disabled object found before (in case it is enabled going forward).
      
      [rjw: Changelog]
      Signed-off-by: default avatarJeff Wu <zlinuxkernel@gmail.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Peter Wu <lekensteyn@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2ac3b5e4
    • Johannes Berg's avatar
      mac80211: don't wait for TX status forever · e0f23666
      Johannes Berg authored
      commit cb236d2d upstream.
      
      TX status notification can get lost, or the frames could
      get stuck on the queue, so don't wait for the callback
      from the driver forever and instead time out after half
      a second.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      e0f23666
    • Dominik Dingel's avatar
      KVM: s390: move kvm_guest_enter,exit closer to sie · 6904756d
      Dominik Dingel authored
      commit 2b29a9fd upstream.
      
      Any uaccess between guest_enter and guest_exit could trigger a page fault,
      the page fault handler would handle it as a guest fault and translate a
      user address as guest address.
      Signed-off-by: default avatarDominik Dingel <dingel@linux.vnet.ibm.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      6904756d
  2. 20 Aug, 2013 4 commits