1. 31 Oct, 2012 1 commit
  2. 30 Oct, 2012 12 commits
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Fix thinko in try_lock_hpte() · 8b5869ad
      Paul Mackerras authored
      This fixes an error in the inline asm in try_lock_hpte() where we
      were erroneously using a register number as an immediate operand.
      The bug only affects an error path, and in fact the code will still
      work as long as the compiler chooses some register other than r0
      for the "bits" variable.  Nevertheless it should still be fixed.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      8b5869ad
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Allow DTL to be set to address 0, length 0 · 9f8c8c78
      Paul Mackerras authored
      Commit 55b665b0 ("KVM: PPC: Book3S HV: Provide a way for userspace
      to get/set per-vCPU areas") includes a check on the length of the
      dispatch trace log (DTL) to make sure the buffer is at least one entry
      long.  This is appropriate when registering a buffer, but the
      interface also allows for any existing buffer to be unregistered by
      specifying a zero address.  In this case the length check is not
      appropriate.  This makes the check conditional on the address being
      non-zero.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      9f8c8c78
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Fix accounting of stolen time · c7b67670
      Paul Mackerras authored
      Currently the code that accounts stolen time tends to overestimate the
      stolen time, and will sometimes report more stolen time in a DTL
      (dispatch trace log) entry than has elapsed since the last DTL entry.
      This can cause guests to underflow the user or system time measured
      for some tasks, leading to ridiculous CPU percentages and total runtimes
      being reported by top and other utilities.
      
      In addition, the current code was designed for the previous policy where
      a vcore would only run when all the vcpus in it were runnable, and so
      only counted stolen time on a per-vcore basis.  Now that a vcore can
      run while some of the vcpus in it are doing other things in the kernel
      (e.g. handling a page fault), we need to count the time when a vcpu task
      is preempted while it is not running as part of a vcore as stolen also.
      
      To do this, we bring back the BUSY_IN_HOST vcpu state and extend the
      vcpu_load/put functions to count preemption time while the vcpu is
      in that state.  Handling the transitions between the RUNNING and
      BUSY_IN_HOST states requires checking and updating two variables
      (accumulated time stolen and time last preempted), so we add a new
      spinlock, vcpu->arch.tbacct_lock.  This protects both the per-vcpu
      stolen/preempt-time variables, and the per-vcore variables while this
      vcpu is running the vcore.
      
      Finally, we now don't count time spent in userspace as stolen time.
      The task could be executing in userspace on behalf of the vcpu, or
      it could be preempted, or the vcpu could be genuinely stopped.  Since
      we have no way of dividing up the time between these cases, we don't
      count any of it as stolen.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      c7b67670
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Run virtual core whenever any vcpus in it can run · 8455d79e
      Paul Mackerras authored
      Currently the Book3S HV code implements a policy on multi-threaded
      processors (i.e. POWER7) that requires all of the active vcpus in a
      virtual core to be ready to run before we run the virtual core.
      However, that causes problems on reset, because reset stops all vcpus
      except vcpu 0, and can also reduce throughput since all four threads
      in a virtual core have to wait whenever any one of them hits a
      hypervisor page fault.
      
      This relaxes the policy, allowing the virtual core to run as soon as
      any vcpu in it is runnable.  With this, the KVMPPC_VCPU_STOPPED state
      and the KVMPPC_VCPU_BUSY_IN_HOST state have been combined into a single
      KVMPPC_VCPU_NOTREADY state, since we no longer need to distinguish
      between them.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      8455d79e
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Fixes for late-joining threads · 2f12f034
      Paul Mackerras authored
      If a thread in a virtual core becomes runnable while other threads
      in the same virtual core are already running in the guest, it is
      possible for the latecomer to join the others on the core without
      first pulling them all out of the guest.  Currently this only happens
      rarely, when a vcpu is first started.  This fixes some bugs and
      omissions in the code in this case.
      
      First, we need to check for VPA updates for the latecomer and make
      a DTL entry for it.  Secondly, if it comes along while the master
      vcpu is doing a VPA update, we don't need to do anything since the
      master will pick it up in kvmppc_run_core.  To handle this correctly
      we introduce a new vcore state, VCORE_STARTING.  Thirdly, there is
      a race because we currently clear the hardware thread's hwthread_req
      before waiting to see it get to nap.  A latecomer thread could have
      its hwthread_req cleared before it gets to test it, and therefore
      never increment the nap_count, leading to messages about wait_for_nap
      timeouts.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      2f12f034
    • Paul Mackerras's avatar
      KVM: PPC: Book3s HV: Don't access runnable threads list without vcore lock · 913d3ff9
      Paul Mackerras authored
      There were a few places where we were traversing the list of runnable
      threads in a virtual core, i.e. vc->runnable_threads, without holding
      the vcore spinlock.  This extends the places where we hold the vcore
      spinlock to cover everywhere that we traverse that list.
      
      Since we possibly need to sleep inside kvmppc_book3s_hv_page_fault,
      this moves the call of it from kvmppc_handle_exit out to
      kvmppc_vcpu_run, where we don't hold the vcore lock.
      
      In kvmppc_vcore_blocked, we don't actually need to check whether
      all vcpus are ceded and don't have any pending exceptions, since the
      caller has already done that.  The caller (kvmppc_run_vcpu) wasn't
      actually checking for pending exceptions, so we add that.
      
      The change of if to while in kvmppc_run_vcpu is to make sure that we
      never call kvmppc_remove_runnable() when the vcore state is RUNNING or
      EXITING.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      913d3ff9
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Fix some races in starting secondary threads · 7b444c67
      Paul Mackerras authored
      Subsequent patches implementing in-kernel XICS emulation will make it
      possible for IPIs to arrive at secondary threads at arbitrary times.
      This fixes some races in how we start the secondary threads, which
      if not fixed could lead to occasional crashes of the host kernel.
      
      This makes sure that (a) we have grabbed all the secondary threads,
      and verified that they are no longer in the kernel, before we start
      any thread, (b) that the secondary thread loads its vcpu pointer
      after clearing the IPI that woke it up (so we don't miss a wakeup),
      and (c) that the secondary thread clears its vcpu pointer before
      incrementing the nap count.  It also removes unnecessary setting
      of the vcpu and vcore pointers in the paca in kvmppc_core_vcpu_load.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      7b444c67
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Allow KVM guests to stop secondary threads coming online · 512691d4
      Paul Mackerras authored
      When a Book3S HV KVM guest is running, we need the host to be in
      single-thread mode, that is, all of the cores (or at least all of
      the cores where the KVM guest could run) to be running only one
      active hardware thread.  This is because of the hardware restriction
      in POWER processors that all of the hardware threads in the core
      must be in the same logical partition.  Complying with this restriction
      is much easier if, from the host kernel's point of view, only one
      hardware thread is active.
      
      This adds two hooks in the SMP hotplug code to allow the KVM code to
      make sure that secondary threads (i.e. hardware threads other than
      thread 0) cannot come online while any KVM guest exists.  The KVM
      code still has to check that any core where it runs a guest has the
      secondary threads offline, but having done that check it can now be
      sure that they will not come online while the guest is running.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      512691d4
    • Alexander Graf's avatar
      PPC: ePAPR: Convert header to uapi · c99ec973
      Alexander Graf authored
      The new uapi framework splits kernel internal and user space exported
      bits of header files more cleanly. Adjust the ePAPR header accordingly.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      c99ec973
    • Alexander Graf's avatar
      KVM: PPC: Move mtspr/mfspr emulation into own functions · 388cf9ee
      Alexander Graf authored
      The mtspr/mfspr emulation code became quite big over time. Move it
      into its own function so things stay more readable.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      388cf9ee
    • Alexander Graf's avatar
      KVM: Documentation: Fix reentry-to-be-consistent paragraph · 686de182
      Alexander Graf authored
      All user space offloaded instruction emulation needs to reenter kvm
      to produce consistent state again. Fix the section in the documentation
      to mention all of them.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      686de182
    • Alexander Graf's avatar
      KVM: PPC: 44x: fix DCR read/write · e43a0287
      Alexander Graf authored
      When remembering the direction of a DCR transaction, we should write
      to the same variable that we interpret on later when doing vcpu_run
      again.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Cc: stable@vger.kernel.org
      e43a0287
  3. 29 Oct, 2012 4 commits
  4. 28 Oct, 2012 11 commits
  5. 27 Oct, 2012 4 commits
  6. 26 Oct, 2012 8 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · e657e078
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "This is what we usually expect at this stage of the game, lots of
        little things, mostly in drivers.  With the occasional 'oops didn't
        mean to do that' kind of regressions in the core code."
      
       1) Uninitialized data in __ip_vs_get_timeouts(), from Arnd Bergmann
      
       2) Reject invalid ACK sequences in Fast Open sockets, from Jerry Chu.
      
       3) Lost error code on return from _rtl_usb_receive(), from Christian
          Lamparter.
      
       4) Fix reset resume on USB rt2x00, from Stanislaw Gruszka.
      
       5) Release resources on error in pch_gbe driver, from Veaceslav Falico.
      
       6) Default hop limit not set correctly in ip6_template_metrics[], fix
          from Li RongQing.
      
       7) Gianfar PTP code requests wrong kind of resource during probe, fix
          from Wei Yang.
      
       8) Fix VHOST net driver on big-endian, from Michael S Tsirkin.
      
       9) Mallenox driver bug fixes from Jack Morgenstein, Or Gerlitz, Moni
          Shoua, Dotan Barak, and Uri Habusha.
      
      10) usbnet leaks memory on TX path, fix from Hemant Kumar.
      
      11) Use socket state test, rather than presence of FIN bit packet, to
          determine FIONREAD/SIOCINQ value.  Fix from Eric Dumazet.
      
      12) Fix cxgb4 build failure, from Vipul Pandya.
      
      13) Provide a SYN_DATA_ACKED state to complement SYN_FASTOPEN in socket
          info dumps.  From Yuchung Cheng.
      
      14) Fix leak of security path in kfree_skb_partial().  Fix from Eric
          Dumazet.
      
      15) Handle RX FIFO overflows more resiliently in pch_gbe driver, from
          Veaceslav Falico.
      
      16) Fix MAINTAINERS file pattern for networking drivers, from Jean
          Delvare.
      
      17) Add iPhone5 IDs to IPHETH driver, from Jay Purohit.
      
      18) VLAN device type change restriction is too strict, and should not
          trigger for the automatically generated vlan0 device.  Fix from Jiri
          Pirko.
      
      19) Make PMTU/redirect flushing work properly again in ipv4, from
          Steffen Klassert.
      
      20) Fix memory corruptions by using kfree_rcu() in netlink_release().
          From Eric Dumazet.
      
      21) More qmi_wwan device IDs, from Bjørn Mork.
      
      22) Fix unintentional change of SNAT/DNAT hooks in generic NAT
          infrastructure, from Elison Niven.
      
      23) Fix 3.6.x regression in xt_TEE netfilter module, from Eric Dumazet.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (57 commits)
        tilegx: fix some issues in the SW TSO support
        qmi_wwan/cdc_ether: move Novatel 551 and E362 to qmi_wwan
        net: usb: Fix memory leak on Tx data path
        net/mlx4_core: Unmap UAR also in the case of error flow
        net/mlx4_en: Don't use vlan tag value as an indication for vlan presence
        net/mlx4_en: Fix double-release-range in tx-rings
        bas_gigaset: fix pre_reset handling
        vhost: fix mergeable bufs on BE hosts
        gianfar_ptp: use iomem, not ioports resource tree in probe
        ipv6: Set default hoplimit as zero.
        NET_VENDOR_TI: make available for am33xx as well
        pch_gbe: fix error handling in pch_gbe_up()
        b43: Fix oops on unload when firmware not found
        mwifiex: clean up scan state on error
        mwifiex: return -EBUSY if specific scan request cannot be honored
        brcmfmac: fix potential NULL dereference
        Revert "ath9k_hw: Updated AR9003 tx gain table for 5GHz"
        ath9k_htc: Add PID/VID for a Ubiquiti WiFiStation
        rt2x00: usb: fix reset resume
        rtlwifi: pass rx setup error code to caller
        ...
      e657e078
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma · f761237e
      Linus Torvalds authored
      Pull slave-dmaengine fixes from Vinod Koul:
       "Three fixes for slave dmanegine.
      
        Two are for typo omissions in sifr dmaengine driver and the last one
        is for the imx driver fixing a missing unlock"
      
      * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: sirf: fix a typo in moving running dma_desc to active queue
        dmaengine: sirf: fix a typo in dma_prep_interleaved
        dmaengine: imx-dma: fix missing unlock on error in imxdma_xfer_desc()
      f761237e
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-for-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 64b1cbaa
      Linus Torvalds authored
      Pull power management and ACPI fixes from Rafael J Wysocki:
      
       - Fix for a memory leak in acpi_bind_one() from Jesper Juhl.
      
       - Fix for an error code path memory leak in pm_genpd_attach_cpuidle()
         from Jonghwan Choi.
      
       - Fix for smp_processor_id() usage in preemptible code in powernow-k8
         from Andreas Herrmann.
      
       - Fix for a suspend-related memory leak in cpufreq stats from Xiaobing
         Tu.
      
       - Freezer fix for failure to clear PF_NOFREEZE along with PF_KTHREAD in
         flush_old_exec() from Oleg Nesterov.
      
       - acpi_processor_notify() fix from Alan Cox.
      
      * tag 'pm+acpi-for-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: missing break
        freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD
        Fix memory leak in cpufreq stats.
        cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible code
        PM / Domains: Fix memory leak on error path in pm_genpd_attach_cpuidle
        ACPI: Fix memory leak in acpi_bind_one()
      64b1cbaa
    • Wei Yongjun's avatar
      KVM: ia64: remove unused variable in kvm_release_vm_pages() · 787c57c0
      Wei Yongjun authored
      The variable base_gfn is initialized but never used
      otherwise, so remove the unused variable.
      
      dpatch engine is used to auto generate this patch.
      (https://github.com/weiyj/dpatch)
      Acked-by: default avatarXiantao Zhang <xiantao.zhang@intel.com>
      Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      787c57c0
    • Linus Torvalds's avatar
      Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband · f54c77dd
      Linus Torvalds authored
      Pull infiniband fixes from Roland Dreier:
       "Small batch of fixes for 3.7:
         - Fix crash in error path in cxgb4
         - Fix build error on 32 bits in mlx4
         - Fix SR-IOV bugs in mlx4"
      
      * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
        mlx4_core: Perform correct resource cleanup if mlx4_QUERY_ADAPTER() fails
        mlx4_core: Remove annoying debug messages from SR-IOV flow
        RDMA/cxgb4: Don't free chunk that we have failed to allocate
        IB/mlx4: Synchronize cleanup of MCGs in MCG paravirtualization
        IB/mlx4: Fix QP1 P_Key processing in the Primary Physical Function (PPF)
        IB/mlx4: Fix build error on platforms where UL is not 64 bits
      f54c77dd
    • Linus Torvalds's avatar
      Merge tag 'usb-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 1d47091a
      Linus Torvalds authored
      Pull USB fixes from Greg Kroah-Hartman:
       "Here are a bunch of USB fixes for the 3.7-rc tree.
      
        There's a lot of small USB serial driver fixes, and one larger one
        (the mos7840 driver changes are mostly just moving code around to fix
        problems.) Thanks to Johan Hovold for finding the problems and fixing
        them all up.
      
        Other than those, there is the usual new device ids, xhci bugfixes,
        and gadget driver fixes, nothing out of the ordinary.
      
        Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
      
      * tag 'usb-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (49 commits)
        xhci: trivial: Remove assigned but unused ep_ctx.
        xhci: trivial: Remove assigned but unused slot_ctx.
        xhci: Fix missing break in xhci_evaluate_context_result.
        xhci: Fix potential NULL ptr deref in command cancellation.
        ehci: Add yet-another Lucid nohandoff pci quirk
        ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versions
        USB: mos7840: fix port_probe flow
        USB: mos7840: fix port-data memory leak
        USB: mos7840: remove invalid disconnect handling
        USB: mos7840: remove NULL-urb submission
        USB: qcserial: fix interface-data memory leak in error path
        USB: option: fix interface-data memory leak in error path
        USB: ipw: fix interface-data memory leak in error path
        USB: mos7840: fix port-device leak in error path
        USB: mos7840: fix urb leak at release
        USB: sierra: fix port-data memory leak
        USB: sierra: fix memory leak in probe error path
        USB: sierra: fix memory leak in attach error path
        USB: usb-wwan: fix multiple memory leaks in error paths
        USB: keyspan: fix NULL-pointer dereferences and memory leaks
        ...
      1d47091a
    • Linus Torvalds's avatar
      Merge tag 'tty-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 6ad2c73d
      Linus Torvalds authored
      Pull serial fix from Greg Kroah-Hartman:
       "Here is one patch, a revert of a omap serial driver patch that was
        causing problems, for your 3.7-rc tree.
      
        Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
      
      * tag 'tty-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        Revert "serial: omap: fix software flow control"
      6ad2c73d
    • Linus Torvalds's avatar
      Merge tag 'staging-3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 490916d6
      Linus Torvalds authored
      Pull staging driver fixes from Greg Kroah-Hartman:
       "Here are some staging driver fixes for your 3.7-rc tree.
      
        Nothing major here, a number of iio driver fixups that were causing
        problems, some comedi driver bugfixes, and a bunch of tidspbridge
        warning squashing and other regressions fixed from the 3.6 release.
      
        All have been in the linux-next releases for a bit.
      
        Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
      
      * tag 'staging-3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (32 commits)
        staging: tidspbridge: delete unused mmu functions
        staging: tidspbridge: ioremap physical address of the stack segment in shm
        staging: tidspbridge: ioremap dsp sync addr
        staging: tidspbridge: change type to __iomem for per and core addresses
        staging: tidspbridge: drop const from custom mmu implementation
        staging: tidspbridge: request the right irq for mmu
        staging: ipack: add missing include (implicit declaration of function 'kfree')
        staging: ramster: depends on NET
        staging: omapdrm: fix allocation size for page addresses array
        staging: zram: Fix handling of incompressible pages
        Staging: android: binder: Allow using highmem for binder buffers
        Staging: android: binder: Fix memory leak on thread/process exit
        staging: comedi: ni_labpc: fix possible NULL deref during detach
        staging: comedi: das08: fix possible NULL deref during detach
        staging: comedi: amplc_pc263: fix possible NULL deref during detach
        staging: comedi: amplc_pc236: fix possible NULL deref during detach
        staging: comedi: amplc_pc236: fix invalid register access during detach
        staging: comedi: amplc_dio200: fix possible NULL deref during detach
        staging: comedi: 8255_pci: fix possible NULL deref during detach
        staging: comedi: ni_daq_700: fix dio subdevice regression
        ...
      490916d6