Merge tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyper...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 6 Aug 2020 16:26:10 +0000 (09:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 6 Aug 2020 16:26:10 +0000 (09:26 -0700)
Pull hyperv updates from Wei Liu:

 - A patch series from Andrea to improve vmbus code

 - Two clean-up patches from Alexander and Randy

* tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
  hyperv: hyperv.h: drop a duplicated word
  tools: hv: change http to https in hv_kvp_daemon.c
  Drivers: hv: vmbus: Remove the lock field from the vmbus_channel struct
  scsi: storvsc: Introduce the per-storvsc_device spinlock
  Drivers: hv: vmbus: Remove unnecessary channel->lock critical sections (sc_list updaters)
  Drivers: hv: vmbus: Use channel_mutex in channel_vp_mapping_show()
  Drivers: hv: vmbus: Remove unnecessary channel->lock critical sections (sc_list readers)
  Drivers: hv: vmbus: Replace cpumask_test_cpu(, cpu_online_mask) with cpu_online()
  Drivers: hv: vmbus: Remove the numa_node field from the vmbus_channel struct
  Drivers: hv: vmbus: Remove the target_vp field from the vmbus_channel struct

1  2 
drivers/hv/vmbus_drv.c

diff --combined drivers/hv/vmbus_drv.c
@@@ -23,7 -23,6 +23,6 @@@
  #include <linux/cpu.h>
  #include <linux/sched/task_stack.h>
  
- #include <asm/mshyperv.h>
  #include <linux/delay.h>
  #include <linux/notifier.h>
  #include <linux/ptrace.h>
@@@ -227,7 -226,7 +226,7 @@@ static ssize_t numa_node_show(struct de
        if (!hv_dev->channel)
                return -ENODEV;
  
-       return sprintf(buf, "%d\n", hv_dev->channel->numa_node);
+       return sprintf(buf, "%d\n", cpu_to_node(hv_dev->channel->target_cpu));
  }
  static DEVICE_ATTR_RO(numa_node);
  #endif
@@@ -508,18 -507,17 +507,17 @@@ static ssize_t channel_vp_mapping_show(
  {
        struct hv_device *hv_dev = device_to_hv_device(dev);
        struct vmbus_channel *channel = hv_dev->channel, *cur_sc;
-       unsigned long flags;
        int buf_size = PAGE_SIZE, n_written, tot_written;
        struct list_head *cur;
  
        if (!channel)
                return -ENODEV;
  
+       mutex_lock(&vmbus_connection.channel_mutex);
        tot_written = snprintf(buf, buf_size, "%u:%u\n",
                channel->offermsg.child_relid, channel->target_cpu);
  
-       spin_lock_irqsave(&channel->lock, flags);
        list_for_each(cur, &channel->sc_list) {
                if (tot_written >= buf_size - 1)
                        break;
                tot_written += n_written;
        }
  
-       spin_unlock_irqrestore(&channel->lock, flags);
+       mutex_unlock(&vmbus_connection.channel_mutex);
  
        return tot_written;
  }
@@@ -1368,7 -1366,7 +1366,7 @@@ static void hv_kmsg_dump(struct kmsg_du
         * Write dump contents to the page. No need to synchronize; panic should
         * be single-threaded.
         */
 -      kmsg_dump_get_buffer(dumper, true, hv_panic_page, HV_HYP_PAGE_SIZE,
 +      kmsg_dump_get_buffer(dumper, false, hv_panic_page, HV_HYP_PAGE_SIZE,
                             &bytes_written);
        if (bytes_written)
                hyperv_report_panic_msg(panic_pa, bytes_written);
@@@ -1717,7 -1715,7 +1715,7 @@@ static ssize_t target_cpu_store(struct 
        /* No CPUs should come up or down during this. */
        cpus_read_lock();
  
-       if (!cpumask_test_cpu(target_cpu, cpu_online_mask)) {
+       if (!cpu_online(target_cpu)) {
                cpus_read_unlock();
                return -EINVAL;
        }
         */
  
        channel->target_cpu = target_cpu;
-       channel->target_vp = hv_cpu_number_to_vp_number(target_cpu);
-       channel->numa_node = cpu_to_node(target_cpu);
  
        /* See init_vp_index(). */
        if (hv_is_perf_channel(channel))
@@@ -2347,7 -2343,6 +2343,6 @@@ acpi_walk_err
  static int vmbus_bus_suspend(struct device *dev)
  {
        struct vmbus_channel *channel, *sc;
-       unsigned long flags;
  
        while (atomic_read(&vmbus_connection.offer_in_progress) != 0) {
                /*
                        continue;
                }
  
-               spin_lock_irqsave(&channel->lock, flags);
                list_for_each_entry(sc, &channel->sc_list, sc_list) {
                        pr_err("Sub-channel not deleted!\n");
                        WARN_ON_ONCE(1);
                }
-               spin_unlock_irqrestore(&channel->lock, flags);
  
                atomic_inc(&vmbus_connection.nr_chan_fixup_on_resume);
        }