Skip to content
  1. Nov 28, 2012
  2. Nov 14, 2012
  3. Nov 01, 2012
    • Marcelo Tosatti's avatar
      Merge branch 'for-queue' of https://github.com/agraf/linux-2.6 into queue · f026399f
      Marcelo Tosatti authored
      * 'for-queue' of https://github.com/agraf/linux-2.6:
        PPC: ePAPR: Convert hcall header to uapi (round 2)
        KVM: PPC: Book3S HV: Fix thinko in try_lock_hpte()
        KVM: PPC: Book3S HV: Allow DTL to be set to address 0, length 0
        KVM: PPC: Book3S HV: Fix accounting of stolen time
        KVM: PPC: Book3S HV: Run virtual core whenever any vcpus in it can run
        KVM: PPC: Book3S HV: Fixes for late-joining threads
        KVM: PPC: Book3s HV: Don't access runnable threads list without vcore lock
        KVM: PPC: Book3S HV: Fix some races in starting secondary threads
        KVM: PPC: Book3S HV: Allow KVM guests to stop secondary threads coming online
        PPC: ePAPR: Convert header to uapi
        KVM: PPC: Move mtspr/mfspr emulation into own functions
        KVM: Documentation: Fix reentry-to-be-consistent paragraph
        KVM: PPC: 44x: fix DCR read/write
      f026399f
    • Joerg Roedel's avatar
      KVM: SVM: update MAINTAINERS entry · 7de609c8
      Joerg Roedel authored
      
      
      I have no access to my AMD email address anymore. Update
      entry in MAINTAINERS to the new address.
      
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: default avatarJoerg Roedel <joro@8bytes.org>
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      7de609c8
  4. Oct 31, 2012
  5. Oct 30, 2012
    • 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
    • Xiao Guangrong's avatar
      KVM: do not treat noslot pfn as a error pfn · 81c52c56
      Xiao Guangrong authored
      
      
      This patch filters noslot pfn out from error pfns based on Marcelo comment:
      noslot pfn is not a error pfn
      
      After this patch,
      - is_noslot_pfn indicates that the gfn is not in slot
      - is_error_pfn indicates that the gfn is in slot but the error is occurred
        when translate the gfn to pfn
      - is_error_noslot_pfn indicates that the pfn either it is error pfns or it
        is noslot pfn
      And is_invalid_pfn can be removed, it makes the code more clean
      
      Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      81c52c56
    • Marcelo Tosatti's avatar
      Merge remote-tracking branch 'master' into queue · 19bf7f8a
      Marcelo Tosatti authored
      
      
      Merge reason: development work has dependency on kvm patches merged
      upstream.
      
      Conflicts:
      	arch/powerpc/include/asm/Kbuild
      	arch/powerpc/include/asm/kvm_para.h
      
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      19bf7f8a
  6. Oct 29, 2012
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 35fd3dc5
      Linus Torvalds authored
      Pull Ceph fixes form Sage Weil:
       "There are two fixes in the messenger code, one that can trigger a NULL
        dereference, and one that error in refcounting (extra put).  There is
        also a trivial fix that in the fs client code that is triggered by NFS
        reexport."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        ceph: fix dentry reference leak in encode_fh()
        libceph: avoid NULL kref_put when osd reset races with alloc_msg
        rbd: reset BACKOFF if unable to re-queue
      35fd3dc5
    • David Zafman's avatar
      ceph: fix dentry reference leak in encode_fh() · 52eb5a90
      David Zafman authored
      
      
      Call to d_find_alias() needs a corresponding dput()
      
      This fixes http://tracker.newdream.net/issues/3271
      
      Signed-off-by: default avatarDavid Zafman <david.zafman@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      52eb5a90
    • Linus Torvalds's avatar
      Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging · 6b0cb4ee
      Linus Torvalds authored
      Pull i2c subsystem fixes from Jean Delvare.
      
      * 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
        i2c-i801: Fix comment
        i2c-i801: Simplify dependency towards GPIOLIB
        i2c-stub: Move to drivers/i2c
      6b0cb4ee
    • Jean Delvare's avatar
      i2c-i801: Fix comment · 28901f57
      Jean Delvare authored
      
      
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      28901f57
    • Jean Delvare's avatar
      i2c-i801: Simplify dependency towards GPIOLIB · 79e3e5b8
      Jean Delvare authored
      
      
      Arbitrarily selecting GPIOLIB causes trouble on some architectures,
      so don't do that. Instead, just make the optional multiplexing code
      depend on CONFIG_I2C_MUX_GPIO instead of CONFIG_I2C_MUX for now. We
      can revisit if the i2c-i801 driver ever supports other multiplexing
      flavors.
      
      Also make that optional code depend on DMI, as it won't do anything
      without that.
      
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      79e3e5b8
    • Jean Delvare's avatar
      i2c-stub: Move to drivers/i2c · 31d178bf
      Jean Delvare authored
      
      
      Move the i2c-stub driver to drivers/i2c, to match the Kconfig entry.
      This is less confusing that way.
      
      I also fixed all checkpatch warnings and errors.
      
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Peter Huewe <peterhuewe@gmx.de>
      31d178bf
    • Linus Torvalds's avatar
      Linux 3.7-rc3 · 8f0d8163
      Linus Torvalds authored
      8f0d8163
    • Linus Torvalds's avatar
      Merge tag 'ktest-v3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest · 5a5210c6
      Linus Torvalds authored
      Pull ktest confusion fix from Steven Rostedt:
       "With the v3.7-rc2 kernel, the network cards on my target boxes were
        not being brought up.
      
        I found that the modules for the network was not being installed.
        This was due to the config CONFIG_MODULES_USE_ELF_RELA that came
        before CONFIG_MODULES, and confused ktest in thinking that
        CONFIG_MODULES=y was not found.
      
        Ktest needs to test all configs and not just stop if something starts
        with CONFIG_MODULES."
      
      * tag 'ktest-v3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
        ktest: Fix ktest confusion with CONFIG_MODULES_USE_ELF_RELA
      5a5210c6
    • Linus Torvalds's avatar
      Merge tag 'spi-mxs' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc · 8e99165a
      Linus Torvalds authored
      Pull minor spi MXS fixes from Mark Brown:
       "These fixes are both pretty minor ones and are driver local."
      
      * tag 'spi-mxs' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc:
        spi: mxs: Terminate DMA in case of DMA timeout
        spi: mxs: Assign message status after transfer finished
      8e99165a
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 065c8012
      Linus Torvalds authored
      Pull arm-soc fixes from Arnd Bergmann:
       "Bug fixes for a number of ARM platforms, mostly OMAP, imx and at91.
      
        These come a little later than I had hoped but unfortunately we had a
        few of these patches cause regressions themselves and had to work out
        how to deal with those in the meantime."
      
      * tag 'fixes-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (38 commits)
        Revert "ARM i.MX25: Fix PWM per clock lookups"
        ARM: versatile: fix versatile_defconfig
        ARM: mvebu: update defconfig with 3.7 changes
        ARM: at91: fix at91x40 build
        ARM: socfpga: Fix socfpga compilation with early_printk() enabled
        ARM: SPEAr: Remove unused empty files
        MAINTAINERS: Add arm-soc tree entry
        ARM: dts: mxs: add the "clock-names" for gpmi-nand
        ARM: ux500: Correct SDI5 address and add some format changes
        ARM: ux500: Specify AMBA Primecell IDs for Nomadik I2C in DT
        ARM: ux500: Fix build error relating to IRQCHIP_SKIP_SET_WAKE
        ARM: at91: drop duplicated config SOC_AT91SAM9 entry
        ARM: at91/i2c: change id to let i2c-at91 work
        ARM: at91/i2c: change id to let i2c-gpio work
        ARM: at91/dts: at91sam9g20ek_common: Fix typos in buttons labels.
        ARM: at91: fix external interrupt specification in board code
        ARM: at91: fix external interrupts in non-DT case
        ARM: at91: at91sam9g10: fix SOC type detection
        ARM: at91/tc: fix typo in the DT document
        ARM: AM33XX: Fix configuration of dmtimer parent clock by dmtimer driverDate:Wed, 17 Oct 2012 13:55:55 -0500
        ...
      065c8012
    • Mikulas Patocka's avatar
      Lock splice_read and splice_write functions · 1a25b1c4
      Mikulas Patocka authored
      Functions generic_file_splice_read and generic_file_splice_write access
      the pagecache directly. For block devices these functions must be locked
      so that block size is not changed while they are in progress.
      
      This patch is an additional fix for commit b87570f5
      
       ("Fix a crash
      when block device is read and block size is changed at the same time")
      that locked aio_read, aio_write and mmap against block size change.
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1a25b1c4
    • Mikulas Patocka's avatar
      percpu-rw-semaphores: use rcu_read_lock_sched · 1bf11c53
      Mikulas Patocka authored
      
      
      Use rcu_read_lock_sched / rcu_read_unlock_sched / synchronize_sched
      instead of rcu_read_lock / rcu_read_unlock / synchronize_rcu.
      
      This is an optimization. The RCU-protected region is very small, so
      there will be no latency problems if we disable preempt in this region.
      
      So we use rcu_read_lock_sched / rcu_read_unlock_sched that translates
      to preempt_disable / preempt_disable. It is smaller (and supposedly
      faster) than preemptible rcu_read_lock / rcu_read_unlock.
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1bf11c53
    • Mikulas Patocka's avatar
      percpu-rw-semaphores: use light/heavy barriers · 5c1eabe6
      Mikulas Patocka authored
      
      
      This patch introduces new barrier pair light_mb() and heavy_mb() for
      percpu rw semaphores.
      
      This patch fixes a bug in percpu-rw-semaphores where a barrier was
      missing in percpu_up_write.
      
      This patch improves performance on the read path of
      percpu-rw-semaphores: on non-x86 cpus, there was a smp_mb() in
      percpu_up_read. This patch changes it to a compiler barrier and removes
      the "#if defined(X86) ..." condition.
      
      From: Lai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5c1eabe6
  7. Oct 27, 2012