1. 11 10月, 2015 3 次提交
  2. 08 10月, 2015 10 次提交
  3. 06 10月, 2015 2 次提交
  4. 05 10月, 2015 17 次提交
  5. 04 10月, 2015 8 次提交
    • L
      Linux 4.3-rc4 · 049e6dde
      Linus Torvalds 提交于
      049e6dde
    • L
      Merge branch 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · 30c44659
      Linus Torvalds 提交于
      Pull strscpy string copy function implementation from Chris Metcalf.
      
      Chris sent this during the merge window, but I waffled back and forth on
      the pull request, which is why it's going in only now.
      
      The new "strscpy()" function is definitely easier to use and more secure
      than either strncpy() or strlcpy(), both of which are horrible nasty
      interfaces that have serious and irredeemable problems.
      
      strncpy() has a useless return value, and doesn't NUL-terminate an
      overlong result.  To make matters worse, it pads a short result with
      zeroes, which is a performance disaster if you have big buffers.
      
      strlcpy(), by contrast, is a mis-designed "fix" for strlcpy(), lacking
      the insane NUL padding, but having a differently broken return value
      which returns the original length of the source string.  Which means
      that it will read characters past the count from the source buffer, and
      you have to trust the source to be properly terminated.  It also makes
      error handling fragile, since the test for overflow is unnecessarily
      subtle.
      
      strscpy() avoids both these problems, guaranteeing the NUL termination
      (but not excessive padding) if the destination size wasn't zero, and
      making the overflow condition very obvious by returning -E2BIG.  It also
      doesn't read past the size of the source, and can thus be used for
      untrusted source data too.
      
      So why did I waffle about this for so long?
      
      Every time we introduce a new-and-improved interface, people start doing
      these interminable series of trivial conversion patches.
      
      And every time that happens, somebody does some silly mistake, and the
      conversion patch to the improved interface actually makes things worse.
      Because the patch is mindnumbing and trivial, nobody has the attention
      span to look at it carefully, and it's usually done over large swatches
      of source code which means that not every conversion gets tested.
      
      So I'm pulling the strscpy() support because it *is* a better interface.
      But I will refuse to pull mindless conversion patches.  Use this in
      places where it makes sense, but don't do trivial patches to fix things
      that aren't actually known to be broken.
      
      * 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        tile: use global strscpy() rather than private copy
        string: provide strscpy()
        Make asm/word-at-a-time.h available on all architectures
      30c44659
    • S
      spmi: pmic-arb: u8 <= 0xff is always true · 9b76968d
      Stephen Boyd 提交于
      Silences this static checker warning:
      
       drivers/spmi/spmi-pmic-arb.c:363
       pmic_arb_write_cmd() warn: always true condition
       '(opc <= 255) => (0-255 <= 255)'
      
      Cc: Andy Gross <agross@codeaurora.org>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Reviewed-by: NBjorn Andersson <bjorn.andersson@sonymobile.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b76968d
    • S
      spmi: pmic-arb: Don't byte swap when reading/writing FIFO · d5144796
      Stephen Boyd 提交于
      We don't want to swap bytes that we're reading and writing to the
      FIFOs when we're running on a big-endian CPU. Doing so causes
      problems like where the qcom-spmi-iadc driver can't detect the
      type of device because the bytes are all mixed up. Use the raw IO
      accessors for these API instead, and collapse pmic_arb_base_read()
      into the byte reading API so that we aren't tempted to read non-FIFO
      data like commands with that function.
      
      Cc: Andy Gross <agross@codeaurora.org>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Acked-by: NBjorn Andersson <bjorn.andersson@sonymobile.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d5144796
    • P
      VMware balloon: Enable notification via VMCI · 48e3d668
      Philip P. Moltmann 提交于
      Get notified immediately when a balloon target is set, instead of waiting for
      up to one second.
      
      The up-to 1 second gap could be long enough to cause swapping inside of the
      VM that receives the VM.
      Acked-by: NAndy King <acking@vmware.com>
      Signed-off-by: NXavier Deguillard <xdeguillard@vmware.com>
      Tested-by: NSiva Sankar Reddy B <sankars@vmware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      48e3d668
    • P
      VMware balloon: Treat init like reset · d7568c13
      Philip P. Moltmann 提交于
      Unify the behavior of the first start of the balloon and a reset. Also on
      unload, declare that the balloon driver does not have any capabilities
      anymore.
      Acked-by: NAndy King <acking@vmware.com>
      Signed-off-by: NXavier Deguillard <xdeguillard@vmware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d7568c13
    • P
      VMware balloon: Support 2m page ballooning. · 365bd7ef
      Philip P. Moltmann 提交于
      2m ballooning significantly reduces the hypervisor side (and guest side)
      overhead of ballooning and unballooning.
      
      hypervisor only:
            balloon  unballoon
      4 KB  2 GB/s   2.6 GB/s
      2 MB  54 GB/s  767 GB/s
      
      Use 2 MB pages as the hypervisor is alwys 64bit and 2 MB is the smallest
      supported super-page size.
      
      The code has to run on older versions of ESX and old balloon drivers run on
      newer version of ESX. Hence match the capabilities with the host before 2m
      page ballooning could be enabled.
      Signed-off-by: NXavier Deguillard <xdeguillard@vmware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      365bd7ef
    • P
      VMware balloon: Do not limit the amount of frees and allocations in non-sleep mode. · 33d268ed
      Philip P. Moltmann 提交于
      When VMware's hypervisor requests a VM to reclaim memory this is preferrably done
      via ballooning. If the balloon driver does not return memory fast enough, more
      drastic methods, such as hypervisor-level swapping are needed. These other methods
      cause performance issues, e.g. hypervisor-level swapping requires the hypervisor to
      swap in a page syncronously while the virtual CPU is blocked.
      
      Hence it is in the interest of the VM to balloon memory as fast as possible. The
      problem with doing this is that the VM might end up doing nothing else than
      ballooning and the user might notice that the VM is stalled, esp. when the VM has
      only a single virtual CPU.
      
      This is less of a problem if the VM and the hypervisor perform balloon operations
      faster. Also the balloon driver yields regularly, hence on a single virtual CPU
      the Linux scheduler should be able to properly time-slice between ballooning and
      other tasks.
      
      Testing Done: quickly ballooned a lot of pages while wathing if there are any
      perceived hickups (periods of non-responsiveness) in the execution of the
      linux VM. No such hickups were seen.
      Signed-off-by: NXavier Deguillard <xdeguillard@vmware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      33d268ed