Skip to content
  1. Dec 20, 2016
    • Vitaly Kuznetsov's avatar
      x86/hyperv: Handle unknown NMIs on one CPU when unknown_nmi_panic · 59107e2f
      Vitaly Kuznetsov authored
      
      
      There is a feature in Hyper-V ('Debug-VM --InjectNonMaskableInterrupt')
      which injects NMI to the guest. We may want to crash the guest and do kdump
      on this NMI by enabling unknown_nmi_panic. To make kdump succeed we need to
      allow the kdump kernel to re-establish VMBus connection so it will see
      VMBus devices (storage, network,..).
      
      To properly unload VMBus making it possible to start over during kdump we
      need to do the following:
      
       - Send an 'unload' message to the hypervisor. This can be done on any CPU
         so we do this the crashing CPU.
      
       - Receive the 'unload finished' reply message. WS2012R2 delivers this
         message to the CPU which was used to establish VMBus connection during
         module load and this CPU may differ from the CPU sending 'unload'.
      
      Receiving a VMBus message means the following:
      
       - There is a per-CPU slot in memory for one message. This slot can in
         theory be accessed by any CPU.
      
       - We get an interrupt on the CPU when a message was placed into the slot.
      
       - When we read the message we need to clear the slot and signal the fact
         to the hypervisor. In case there are more messages to this CPU pending
         the hypervisor will deliver the next message. The signaling is done by
         writing to an MSR so this can only be done on the appropriate CPU.
      
      To avoid doing cross-CPU work on crash we have vmbus_wait_for_unload()
      function which checks message slots for all CPUs in a loop waiting for the
      'unload finished' messages. However, there is an issue which arises when
      these conditions are met:
      
       - We're crashing on a CPU which is different from the one which was used
         to initially contact the hypervisor.
      
       - The CPU which was used for the initial contact is blocked with interrupts
         disabled and there is a message pending in the message slot.
      
      In this case we won't be able to read the 'unload finished' message on the
      crashing CPU. This is reproducible when we receive unknown NMIs on all CPUs
      simultaneously: the first CPU entering panic() will proceed to crash and
      all other CPUs will stop themselves with interrupts disabled.
      
      The suggested solution is to handle unknown NMIs for Hyper-V guests on the
      first CPU which gets them only. This will allow us to rely on VMBus
      interrupt handler being able to receive the 'unload finish' message in
      case it is delivered to a different CPU.
      
      The issue is not reproducible on WS2016 as Debug-VM delivers NMI to the
      boot CPU only, WS2012R2 and earlier Hyper-V versions are affected.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Acked-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Cc: devel@linuxdriverproject.org
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Link: http://lkml.kernel.org/r/20161202100720.28121-1-vkuznets@redhat.com
      
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      59107e2f
  2. Dec 19, 2016
  3. Dec 18, 2016
    • Thomas Gleixner's avatar
      x86/tsc: Limit the adjust value further · 8c9b9d87
      Thomas Gleixner authored
      
      
      Adjust value 0x80000000 and other values larger than that render the TSC
      deadline timer disfunctional.
      
      We have not yet any information about this from Intel, but experimentation
      clearly proves that this is a 32/64 bit and sign extension issue.
      
      If adjust values larger than that are actually required, which might be the
      case for physical CPU hotplug, then we need to disable the deadline timer
      on the affected package/CPUs and use the local APIC timer instead.
      
      That requires some surgery in the APIC setup code, so we just limit the
      ADJUST register value into the known to work range for now and revisit this
      when Intel comes forth with proper information.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Roland Scheidegger <rscheidegger_lists@hispeed.ch>
      Cc: Bruce Schlobohm <bruce.schlobohm@intel.com>
      Cc: Kevin Stanton <kevin.b.stanton@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      8c9b9d87
    • Thomas Gleixner's avatar
      x86/tsc: Annotate printouts as firmware bug · 16588f65
      Thomas Gleixner authored
      
      
      Make it more obvious that the BIOS is screwed up.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Roland Scheidegger <rscheidegger_lists@hispeed.ch>
      Cc: Bruce Schlobohm <bruce.schlobohm@intel.com>
      Cc: Kevin Stanton <kevin.b.stanton@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      16588f65
    • Kees Cook's avatar
      x86/floppy: Use designated initializers · ffc7dc8d
      Kees Cook authored
      
      
      Prepare to mark sensitive kernel structures for randomization by making
      sure they're using designated initializers. These were identified during
      allyesconfig builds of x86, arm, and arm64, with most initializer fixes
      extracted from grsecurity.
      
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20161217213705.GA1248@beast
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      ffc7dc8d
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 52f40e9d
      Linus Torvalds authored
      Pull networking fixes and cleanups from David Miller:
      
       1) Revert bogus nla_ok() change, from Alexey Dobriyan.
      
       2) Various bpf validator fixes from Daniel Borkmann.
      
       3) Add some necessary SET_NETDEV_DEV() calls to hsis_femac and hip04
          drivers, from Dongpo Li.
      
       4) Several ethtool ksettings conversions from Philippe Reynes.
      
       5) Fix bugs in inet port management wrt. soreuseport, from Tom Herbert.
      
       6) XDP support for virtio_net, from John Fastabend.
      
       7) Fix NAT handling within a vrf, from David Ahern.
      
       8) Endianness fixes in dpaa_eth driver, from Claudiu Manoil
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (63 commits)
        net: mv643xx_eth: fix build failure
        isdn: Constify some function parameters
        mlxsw: spectrum: Mark split ports as such
        cgroup: Fix CGROUP_BPF config
        qed: fix old-style function definition
        net: ipv6: check route protocol when deleting routes
        r6040: move spinlock in r6040_close as SOFTIRQ-unsafe lock order detected
        irda: w83977af_ir: cleanup an indent issue
        net: sfc: use new api ethtool_{get|set}_link_ksettings
        net: davicom: dm9000: use new api ethtool_{get|set}_link_ksettings
        net: cirrus: ep93xx: use new api ethtool_{get|set}_link_ksettings
        net: chelsio: cxgb3: use new api ethtool_{get|set}_link_ksettings
        net: chelsio: cxgb2: use new api ethtool_{get|set}_link_ksettings
        bpf: fix mark_reg_unknown_value for spilled regs on map value marking
        bpf: fix overflow in prog accounting
        bpf: dynamically allocate digest scratch buffer
        gtp: Fix initialization of Flags octet in GTPv1 header
        gtp: gtp_check_src_ms_ipv4() always return success
        net/x25: use designated initializers
        isdn: use designated initializers
        ...
      52f40e9d
    • Linus Torvalds's avatar
      Merge uncontroversial parts of branch 'readlink' of... · 231753ef
      Linus Torvalds authored
      Merge uncontroversial parts of branch 'readlink' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs
      
      Pull partial readlink cleanups from Miklos Szeredi.
      
      This is the uncontroversial part of the readlink cleanup patch-set that
      simplifies the default readlink handling.
      
      Miklos and Al are still discussing the rest of the series.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
        vfs: make generic_readlink() static
        vfs: remove ".readlink = generic_readlink" assignments
        vfs: default to generic_readlink()
        vfs: replace calling i_op->readlink with vfs_readlink()
        proc/self: use generic_readlink
        ecryptfs: use vfs_get_link()
        bad_inode: add missing i_op initializers
      231753ef