1. 09 9月, 2020 1 次提交
  2. 07 8月, 2020 1 次提交
  3. 29 6月, 2020 1 次提交
  4. 23 5月, 2020 1 次提交
    • A
      Drivers: hv: vmbus: Resolve more races involving init_vp_index() · afaa33da
      Andrea Parri (Microsoft) 提交于
      init_vp_index() uses the (per-node) hv_numa_map[] masks to record the
      CPUs allocated for channel interrupts at a given time, and distribute
      the performance-critical channels across the available CPUs: in part.,
      the mask of "candidate" target CPUs in a given NUMA node, for a newly
      offered channel, is determined by XOR-ing the node's CPU mask and the
      node's hv_numa_map.  This operation/mechanism assumes that no offline
      CPUs is set in the hv_numa_map mask, an assumption that does not hold
      since such mask is currently not updated when a channel is removed or
      assigned to a different CPU.
      
      To address the issues described above, this adds hooks in the channel
      removal path (hv_process_channel_removal()) and in target_cpu_store()
      in order to clear, resp. to update, the hv_numa_map[] masks as needed.
      This also adds a (missed) update of the masks in init_vp_index() (cf.,
      e.g., the memory-allocation failure path in this function).
      
      Like in the case of init_vp_index(), such hooks require to determine
      if the given channel is performance critical.  init_vp_index() does
      this by parsing the channel's offer, it can not rely on the device
      data structure (device_obj) to retrieve such information because the
      device data structure has not been allocated/linked with the channel
      by the time that init_vp_index() executes.  A similar situation may
      hold in hv_is_alloced_cpu() (defined below); the adopted approach is
      to "cache" the device type of the channel, as computed by parsing the
      channel's offer, in the channel structure itself.
      
      Fixes: 75278105 ("Drivers: hv: vmbus: Introduce the CHANNELMSG_MODIFYCHANNEL message type")
      Signed-off-by: NAndrea Parri (Microsoft) <parri.andrea@gmail.com>
      Reviewed-by: NMichael Kelley <mikelley@microsoft.com>
      Link: https://lore.kernel.org/r/20200522171901.204127-3-parri.andrea@gmail.comSigned-off-by: NWei Liu <wei.liu@kernel.org>
      afaa33da
  5. 20 5月, 2020 4 次提交
  6. 23 4月, 2020 10 次提交
  7. 15 4月, 2020 1 次提交
  8. 12 4月, 2020 3 次提交
  9. 10 4月, 2020 2 次提交
  10. 26 1月, 2020 1 次提交
    • D
      Drivers: hv: vmbus: Ignore CHANNELMSG_TL_CONNECT_RESULT(23) · ddc9d357
      Dexuan Cui 提交于
      When a Linux hv_sock app tries to connect to a Service GUID on which no
      host app is listening, a recent host (RS3+) sends a
      CHANNELMSG_TL_CONNECT_RESULT (23) message to Linux and this triggers such
      a warning:
      
      unknown msgtype=23
      WARNING: CPU: 2 PID: 0 at drivers/hv/vmbus_drv.c:1031 vmbus_on_msg_dpc
      
      Actually Linux can safely ignore the message because the Linux app's
      connect() will time out in 2 seconds: see VSOCK_DEFAULT_CONNECT_TIMEOUT
      and vsock_stream_connect(). We don't bother to make use of the message
      because: 1) it's only supported on recent hosts; 2) a non-trivial effort
      is required to use the message in Linux, but the benefit is small.
      
      So, let's not see the warning by silently ignoring the message.
      Signed-off-by: NDexuan Cui <decui@microsoft.com>
      Reviewed-by: NMichael Kelley <mikelley@microsoft.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ddc9d357
  11. 22 11月, 2019 5 次提交
  12. 15 11月, 2019 1 次提交
    • M
      x86/hyperv: Initialize clockevents earlier in CPU onlining · 4df4cb9e
      Michael Kelley 提交于
      Hyper-V has historically initialized stimer-based clockevents late in the
      process of onlining a CPU because clockevents depend on stimer
      interrupts. In the original Hyper-V design, stimer interrupts generate a
      VMbus message, so the VMbus machinery must be running first, and VMbus
      can't be initialized until relatively late. On x86/64, LAPIC timer based
      clockevents are used during early initialization before VMbus and
      stimer-based clockevents are ready, and again during CPU offlining after
      the stimer clockevents have been shut down.
      
      Unfortunately, this design creates problems when offlining CPUs for
      hibernation or other purposes. stimer-based clockevents are shut down
      relatively early in the offlining process, so clockevents_unbind_device()
      must be used to fallback to the LAPIC-based clockevents for the remainder
      of the offlining process.  Furthermore, the late initialization and early
      shutdown of stimer-based clockevents doesn't work well on ARM64 since there
      is no other timer like the LAPIC to fallback to. So CPU onlining and
      offlining doesn't work properly.
      
      Fix this by recognizing that stimer Direct Mode is the normal path for
      newer versions of Hyper-V on x86/64, and the only path on other
      architectures. With stimer Direct Mode, stimer interrupts don't require any
      VMbus machinery. stimer clockevents can be initialized and shut down
      consistent with how it is done for other clockevent devices. While the old
      VMbus-based stimer interrupts must still be supported for backward
      compatibility on x86, that mode of operation can be treated as legacy.
      
      So add a new Hyper-V stimer entry in the CPU hotplug state list, and use
      that new state when in Direct Mode. Update the Hyper-V clocksource driver
      to allocate and initialize stimer clockevents earlier during boot. Update
      Hyper-V initialization and the VMbus driver to use this new design. As a
      result, the LAPIC timer is no longer used during boot or CPU
      onlining/offlining and clockevents_unbind_device() is not called.  But
      retain the old design as a legacy implementation for older versions of
      Hyper-V that don't support Direct Mode.
      Signed-off-by: NMichael Kelley <mikelley@microsoft.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NDexuan Cui <decui@microsoft.com>
      Reviewed-by: NDexuan Cui <decui@microsoft.com>
      Link: https://lkml.kernel.org/r/1573607467-9456-1-git-send-email-mikelley@microsoft.com
      4df4cb9e
  13. 02 10月, 2019 1 次提交
  14. 07 9月, 2019 6 次提交
  15. 19 7月, 2019 1 次提交
  16. 03 7月, 2019 1 次提交
    • M
      clocksource/drivers: Make Hyper-V clocksource ISA agnostic · fd1fea68
      Michael Kelley 提交于
      Hyper-V clock/timer code and data structures are currently mixed
      in with other code in the ISA independent drivers/hv directory as
      well as the ISA dependent Hyper-V code under arch/x86.
      
      Consolidate this code and data structures into a Hyper-V clocksource driver
      to better follow the Linux model. In doing so, separate out the ISA
      dependent portions so the new clocksource driver works for x86 and for the
      in-process Hyper-V on ARM64 code.
      
      To start, move the existing clockevents code to create the new clocksource
      driver. Update the VMbus driver to call initialization and cleanup routines
      since the Hyper-V synthetic timers are not independently enumerated in
      ACPI.
      
      No behavior is changed and no new functionality is added.
      Suggested-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NMichael Kelley <mikelley@microsoft.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Cc: "bp@alien8.de" <bp@alien8.de>
      Cc: "will.deacon@arm.com" <will.deacon@arm.com>
      Cc: "catalin.marinas@arm.com" <catalin.marinas@arm.com>
      Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>
      Cc: "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>
      Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
      Cc: "linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
      Cc: "olaf@aepfle.de" <olaf@aepfle.de>
      Cc: "apw@canonical.com" <apw@canonical.com>
      Cc: "jasowang@redhat.com" <jasowang@redhat.com>
      Cc: "marcelo.cerri@canonical.com" <marcelo.cerri@canonical.com>
      Cc: Sunil Muthuswamy <sunilmut@microsoft.com>
      Cc: KY Srinivasan <kys@microsoft.com>
      Cc: "sashal@kernel.org" <sashal@kernel.org>
      Cc: "vincenzo.frascino@arm.com" <vincenzo.frascino@arm.com>
      Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
      Cc: "linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>
      Cc: "linux-kselftest@vger.kernel.org" <linux-kselftest@vger.kernel.org>
      Cc: "arnd@arndb.de" <arnd@arndb.de>
      Cc: "linux@armlinux.org.uk" <linux@armlinux.org.uk>
      Cc: "ralf@linux-mips.org" <ralf@linux-mips.org>
      Cc: "paul.burton@mips.com" <paul.burton@mips.com>
      Cc: "daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>
      Cc: "salyzyn@android.com" <salyzyn@android.com>
      Cc: "pcc@google.com" <pcc@google.com>
      Cc: "shuah@kernel.org" <shuah@kernel.org>
      Cc: "0x7f454c46@gmail.com" <0x7f454c46@gmail.com>
      Cc: "linux@rasmusvillemoes.dk" <linux@rasmusvillemoes.dk>
      Cc: "huw@codeweavers.com" <huw@codeweavers.com>
      Cc: "sfr@canb.auug.org.au" <sfr@canb.auug.org.au>
      Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>
      Cc: "rkrcmar@redhat.com" <rkrcmar@redhat.com>
      Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
      Link: https://lkml.kernel.org/r/1561955054-1838-2-git-send-email-mikelley@microsoft.com
      fd1fea68