17 Nov, 2020

1 commit


11 Nov, 2020

1 commit

  • When invoking kexec() on a Linux guest running on a Hyper-V host, the
    kernel panics.

    RIP: 0010:cpuhp_issue_call+0x137/0x140
    Call Trace:
    __cpuhp_remove_state_cpuslocked+0x99/0x100
    __cpuhp_remove_state+0x1c/0x30
    hv_kexec_handler+0x23/0x30 [hv_vmbus]
    hv_machine_shutdown+0x1e/0x30
    machine_shutdown+0x10/0x20
    kernel_kexec+0x6d/0x96
    __do_sys_reboot+0x1ef/0x230
    __x64_sys_reboot+0x1d/0x20
    do_syscall_64+0x6b/0x3d8
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    This was due to hv_synic_cleanup() callback returning -EBUSY to
    cpuhp_issue_call() when tearing down the VMBUS_CONNECT_CPU, even
    if the vmbus_connection.conn_state = DISCONNECTED. hv_synic_cleanup()
    should succeed in the case where vmbus_connection.conn_state
    is DISCONNECTED.

    Fix is to add an extra condition to test for
    vmbus_connection.conn_state == CONNECTED on the VMBUS_CONNECT_CPU and
    only return early if true. This way the kexec() path can still shut
    everything down while preserving the initial behavior of preventing
    CPU offlining on the VMBUS_CONNECT_CPU while the VM is running.

    Fixes: 8a857c55420f29 ("Drivers: hv: vmbus: Always handle the VMBus messages on CPU0")
    Signed-off-by: Chris Co
    Reviewed-by: Andrea Parri (Microsoft)
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20201110190118.15596-1-chrco@linux.microsoft.com
    Signed-off-by: Wei Liu

    Chris Co
     

06 Nov, 2020

1 commit


19 Oct, 2020

1 commit

  • It is not an error if the host requests to balloon down, but the VM
    refuses to do so. Without this change a warning is logged in dmesg
    every five minutes.

    Fixes: b3bb97b8a49f3 ("Drivers: hv: balloon: Add logging for dynamic memory operations")

    Signed-off-by: Olaf Hering
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20201008071216.16554-1-olaf@aepfle.de
    Signed-off-by: Wei Liu

    Olaf Hering
     

17 Oct, 2020

3 commits

  • Merge more updates from Andrew Morton:
    "155 patches.

    Subsystems affected by this patch series: mm (dax, debug, thp,
    readahead, page-poison, util, memory-hotplug, zram, cleanups), misc,
    core-kernel, get_maintainer, MAINTAINERS, lib, bitops, checkpatch,
    binfmt, ramfs, autofs, nilfs, rapidio, panic, relay, kgdb, ubsan,
    romfs, and fault-injection"

    * emailed patches from Andrew Morton : (155 commits)
    lib, uaccess: add failure injection to usercopy functions
    lib, include/linux: add usercopy failure capability
    ROMFS: support inode blocks calculation
    ubsan: introduce CONFIG_UBSAN_LOCAL_BOUNDS for Clang
    sched.h: drop in_ubsan field when UBSAN is in trap mode
    scripts/gdb/tasks: add headers and improve spacing format
    scripts/gdb/proc: add struct mount & struct super_block addr in lx-mounts command
    kernel/relay.c: drop unneeded initialization
    panic: dump registers on panic_on_warn
    rapidio: fix the missed put_device() for rio_mport_add_riodev
    rapidio: fix error handling path
    nilfs2: fix some kernel-doc warnings for nilfs2
    autofs: harden ioctl table
    ramfs: fix nommu mmap with gaps in the page cache
    mm: remove the now-unnecessary mmget_still_valid() hack
    mm/gup: take mmap_lock in get_dump_page()
    binfmt_elf, binfmt_elf_fdpic: use a VMA list snapshot
    coredump: rework elf/elf_fdpic vma_dump_size() into common helper
    coredump: refactor page range dumping into common helper
    coredump: let dump_emit() bail out on short writes
    ...

    Linus Torvalds
     
  • Let's try to merge system ram resources we add, to minimize the number of
    resources in /proc/iomem. We don't care about the boundaries of
    individual chunks we added.

    Signed-off-by: David Hildenbrand
    Signed-off-by: Andrew Morton
    Reviewed-by: Wei Liu
    Cc: Michal Hocko
    Cc: "K. Y. Srinivasan"
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Cc: Wei Liu
    Cc: Pankaj Gupta
    Cc: Baoquan He
    Cc: Wei Yang
    Cc: Anton Blanchard
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Boris Ostrovsky
    Cc: Christian Borntraeger
    Cc: Dan Williams
    Cc: Dave Jiang
    Cc: Eric Biederman
    Cc: Greg Kroah-Hartman
    Cc: Heiko Carstens
    Cc: Jason Gunthorpe
    Cc: Jason Wang
    Cc: Juergen Gross
    Cc: Julien Grall
    Cc: Kees Cook
    Cc: Len Brown
    Cc: Leonardo Bras
    Cc: Libor Pechacek
    Cc: Michael Ellerman
    Cc: "Michael S. Tsirkin"
    Cc: Nathan Lynch
    Cc: "Oliver O'Halloran"
    Cc: Paul Mackerras
    Cc: Pingfan Liu
    Cc: "Rafael J. Wysocki"
    Cc: Roger Pau Monné
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Vasily Gorbik
    Cc: Vishal Verma
    Link: https://lkml.kernel.org/r/20200911103459.10306-9-david@redhat.com
    Signed-off-by: Linus Torvalds

    David Hildenbrand
     
  • We soon want to pass flags, e.g., to mark added System RAM resources.
    mergeable. Prepare for that.

    This patch is based on a similar patch by Oscar Salvador:

    https://lkml.kernel.org/r/20190625075227.15193-3-osalvador@suse.de

    Signed-off-by: David Hildenbrand
    Signed-off-by: Andrew Morton
    Reviewed-by: Juergen Gross # Xen related part
    Reviewed-by: Pankaj Gupta
    Acked-by: Wei Liu
    Cc: Michal Hocko
    Cc: Dan Williams
    Cc: Jason Gunthorpe
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: "Rafael J. Wysocki"
    Cc: Len Brown
    Cc: Greg Kroah-Hartman
    Cc: Vishal Verma
    Cc: Dave Jiang
    Cc: "K. Y. Srinivasan"
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Cc: Wei Liu
    Cc: Heiko Carstens
    Cc: Vasily Gorbik
    Cc: Christian Borntraeger
    Cc: David Hildenbrand
    Cc: "Michael S. Tsirkin"
    Cc: Jason Wang
    Cc: Boris Ostrovsky
    Cc: Stefano Stabellini
    Cc: "Oliver O'Halloran"
    Cc: Pingfan Liu
    Cc: Nathan Lynch
    Cc: Libor Pechacek
    Cc: Anton Blanchard
    Cc: Leonardo Bras
    Cc: Ard Biesheuvel
    Cc: Eric Biederman
    Cc: Julien Grall
    Cc: Kees Cook
    Cc: Roger Pau Monné
    Cc: Thomas Gleixner
    Cc: Wei Yang
    Link: https://lkml.kernel.org/r/20200911103459.10306-5-david@redhat.com
    Signed-off-by: Linus Torvalds

    David Hildenbrand
     

16 Oct, 2020

1 commit


15 Oct, 2020

2 commits

  • On ARM64, Hyper-V now specifies the interrupt to be used by VMbus
    in the ACPI DSDT. This information is not used on x86 because the
    interrupt vector must be hardcoded. But update the generic
    VMbus driver to do the parsing and pass the information to the
    architecture specific code that sets up the Linux IRQ. Update
    consumers of the interrupt to get it from an architecture specific
    function.

    Signed-off-by: Michael Kelley
    Link: https://lore.kernel.org/r/1597434304-40631-1-git-send-email-mikelley@microsoft.com
    Signed-off-by: Wei Liu

    Michael Kelley
     
  • Pull Hyper-V updates from Wei Liu:

    - a series from Boqun Feng to support page size larger than 4K

    - a few miscellaneous clean-ups

    * tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
    hv: clocksource: Add notrace attribute to read_hv_sched_clock_*() functions
    x86/hyperv: Remove aliases with X64 in their name
    PCI: hv: Document missing hv_pci_protocol_negotiation() parameter
    scsi: storvsc: Support PAGE_SIZE larger than 4K
    Driver: hv: util: Use VMBUS_RING_SIZE() for ringbuffer sizes
    HID: hyperv: Use VMBUS_RING_SIZE() for ringbuffer sizes
    Input: hyperv-keyboard: Use VMBUS_RING_SIZE() for ringbuffer sizes
    hv_netvsc: Use HV_HYP_PAGE_SIZE for Hyper-V communication
    hv: hyperv.h: Introduce some hvpfn helper functions
    Drivers: hv: vmbus: Move virt_to_hvpfn() to hyperv header
    Drivers: hv: Use HV_HYP_PAGE in hv_synic_enable_regs()
    Drivers: hv: vmbus: Introduce types of GPADL
    Drivers: hv: vmbus: Move __vmbus_open()
    Drivers: hv: vmbus: Always use HV_HYP_PAGE_SIZE for gpadl
    drivers: hv: remove cast from hyperv_die_event

    Linus Torvalds
     

28 Sep, 2020

6 commits

  • For a Hyper-V vmbus, the size of the ringbuffer has two requirements:

    1) it has to take one PAGE_SIZE for the header

    2) it has to be PAGE_SIZE aligned so that double-mapping can work

    VMBUS_RING_SIZE() could calculate a correct ringbuffer size which
    fulfills both requirements, therefore use it to make sure vmbus work
    when PAGE_SIZE != HV_HYP_PAGE_SIZE (4K).

    Note that since the argument for VMBUS_RING_SIZE() is the size of
    payload (data part), so it will be minus 4k (the size of header when
    PAGE_SIZE = 4k) than the original value to keep the ringbuffer total
    size unchanged when PAGE_SIZE = 4k.

    Signed-off-by: Boqun Feng
    Cc: Michael Kelley
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200916034817.30282-11-boqun.feng@gmail.com
    Signed-off-by: Wei Liu

    Boqun Feng
     
  • There will be more places other than vmbus where we need to calculate
    the Hyper-V page PFN from a virtual address, so move virt_to_hvpfn() to
    hyperv generic header.

    Signed-off-by: Boqun Feng
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200916034817.30282-6-boqun.feng@gmail.com
    Signed-off-by: Wei Liu

    Boqun Feng
     
  • Both the base_*_gpa should use the guest page number in Hyper-V page, so
    use HV_HYP_PAGE instead of PAGE.

    Signed-off-by: Boqun Feng
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200916034817.30282-5-boqun.feng@gmail.com
    Signed-off-by: Wei Liu

    Boqun Feng
     
  • This patch introduces two types of GPADL: HV_GPADL_{BUFFER, RING}. The
    types of GPADL are purely the concept in the guest, IOW the hypervisor
    treat them as the same.

    The reason of introducing the types for GPADL is to support guests whose
    page size is not 4k (the page size of Hyper-V hypervisor). In these
    guests, both the headers and the data parts of the ringbuffers need to
    be aligned to the PAGE_SIZE, because 1) some of the ringbuffers will be
    mapped into userspace and 2) we use "double mapping" mechanism to
    support fast wrap-around, and "double mapping" relies on ringbuffers
    being page-aligned. However, the Hyper-V hypervisor only uses 4k
    (HV_HYP_PAGE_SIZE) headers. Our solution to this is that we always make
    the headers of ringbuffers take one guest page and when GPADL is
    established between the guest and hypervisor, the only first 4k of
    header is used. To handle this special case, we need the types of GPADL
    to differ different guest memory usage for GPADL.

    Type enum is introduced along with several general interfaces to
    describe the differences between normal buffer GPADL and ringbuffer
    GPADL.

    Signed-off-by: Boqun Feng
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200916034817.30282-4-boqun.feng@gmail.com
    Signed-off-by: Wei Liu

    Boqun Feng
     
  • Pure function movement, no functional changes. The move is made, because
    in a later change, __vmbus_open() will rely on some static functions
    afterwards, so we separate the move and the modification of
    __vmbus_open() in two patches to make it easy to review.

    Signed-off-by: Boqun Feng
    Reviewed-by: Wei Liu
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200916034817.30282-3-boqun.feng@gmail.com
    Signed-off-by: Wei Liu

    Boqun Feng
     
  • Since the hypervisor always uses 4K as its page size, the size of PFNs
    used for gpadl should be HV_HYP_PAGE_SIZE rather than PAGE_SIZE, so
    adjust this accordingly as the preparation for supporting 16K/64K page
    size guests. No functional changes on x86, since PAGE_SIZE is always 4k
    (equals to HV_HYP_PAGE_SIZE).

    Signed-off-by: Boqun Feng
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200916034817.30282-2-boqun.feng@gmail.com
    Signed-off-by: Wei Liu

    Boqun Feng
     

16 Sep, 2020

1 commit


14 Sep, 2020

1 commit

  • vmbus_wait_for_unload() looks for a CHANNELMSG_UNLOAD_RESPONSE message
    coming from Hyper-V. But if the message isn't found for some reason,
    the panic path gets hung forever. Add a timeout of 10 seconds to prevent
    this.

    Fixes: 415719160de3 ("Drivers: hv: vmbus: avoid scheduling in interrupt context in vmbus_initiate_unload()")
    Signed-off-by: Michael Kelley
    Reviewed-by: Dexuan Cui
    Reviewed-by: Vitaly Kuznetsov
    Link: https://lore.kernel.org/r/1600026449-23651-1-git-send-email-mikelley@microsoft.com
    Signed-off-by: Wei Liu

    Michael Kelley
     

09 Sep, 2020

1 commit

  • After we Stop and later Start a VM that uses Accelerated Networking (NIC
    SR-IOV), currently the VF vmbus device's Instance GUID can change, so after
    vmbus_bus_resume() -> vmbus_request_offers(), vmbus_onoffer() can not find
    the original vmbus channel of the VF, and hence we can't complete()
    vmbus_connection.ready_for_resume_event in check_ready_for_resume_event(),
    and the VM hangs in vmbus_bus_resume() forever.

    Fix the issue by adding a timeout, so the resuming can still succeed, and
    the saved state is not lost, and according to my test, the user can disable
    Accelerated Networking and then will be able to SSH into the VM for
    further recovery. Also prevent the VM in question from suspending again.

    The host will be fixed so in future the Instance GUID will stay the same
    across hibernation.

    Fixes: d8bd2d442bb2 ("Drivers: hv: vmbus: Resume after fixing up old primary channels")
    Signed-off-by: Dexuan Cui
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200905025555.45614-1-decui@microsoft.com
    Signed-off-by: Wei Liu

    Dexuan Cui
     

27 Aug, 2020

1 commit


24 Aug, 2020

3 commits

  • There could be instances where a system stall prevents the timesync
    packets to be consumed. And this might lead to more than one packet
    pending in the ring buffer. Current code empties one packet per callback
    and it might be a stale one. So drain all the packets from ring buffer
    on each callback.

    Signed-off-by: Vineeth Pillai
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200821152849.99517-1-viremana@linux.microsoft.com
    Signed-off-by: Wei Liu

    Vineeth Pillai
     
  • If for any reason, host timesync messages were not processed by
    the guest, hv_ptp_gettime() returns a stale value and the
    caller (clock_gettime, PTP ioctl etc) has no means to know this
    now. Return an error so that the caller knows about this.

    Signed-off-by: Vineeth Pillai
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200821152523.99364-1-viremana@linux.microsoft.com
    Signed-off-by: Wei Liu

    Vineeth Pillai
     
  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

19 Aug, 2020

1 commit


15 Aug, 2020

1 commit


07 Aug, 2020

2 commits

  • Hyper-V currently may be notified of a panic for any die event. But
    this results in false panic notifications for various user space traps
    that are die events. Fix this by ignoring die events that aren't oops.

    Fixes: 510f7aef65bb ("Drivers: hv: vmbus: prefer 'die' notification chain to 'panic'")
    Signed-off-by: Michael Kelley
    Reviewed-by: Vitaly Kuznetsov
    Link: https://lore.kernel.org/r/1596730935-11564-1-git-send-email-mikelley@microsoft.com
    Signed-off-by: Wei Liu

    Michael Kelley
     
  • 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

    Linus Torvalds
     

29 Jun, 2020

1 commit

  • When the kernel panics, one page of kmsg data may be collected and sent to
    Hyper-V to aid in diagnosing the failure. The collected kmsg data typically
    contains 50 to 100 lines, each of which has a log level prefix that isn't
    very useful from a diagnostic standpoint. So tell kmsg_dump_get_buffer()
    to not include the log level, enabling more information that *is* useful to
    fit in the page.

    Requesting in stable kernels, since many kernels running in production are
    stable releases.

    Cc: stable@vger.kernel.org
    Signed-off-by: Joseph Salisbury
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/1593210497-114310-1-git-send-email-joseph.salisbury@microsoft.com
    Signed-off-by: Wei Liu

    Joseph Salisbury
     

20 Jun, 2020

1 commit

  • The spinlock is (now) *not used to protect test-and-set accesses
    to attributes of the structure or sc_list operations.

    There is, AFAICT, a distinct lack of {WRITE,READ}_ONCE()s in the
    handling of channel->state, but the changes below do not seem to
    make things "worse". ;-)

    Signed-off-by: Andrea Parri (Microsoft)
    Link: https://lore.kernel.org/r/20200617164642.37393-9-parri.andrea@gmail.com
    Reviewed-by: Michael Kelley
    Signed-off-by: Wei Liu

    Andrea Parri (Microsoft)
     

19 Jun, 2020

6 commits


04 Jun, 2020

1 commit

  • Pull hyper-v updates from Wei Liu:

    - a series from Andrea to support channel reassignment

    - a series from Vitaly to clean up Vmbus message handling

    - a series from Michael to clean up and augment hyperv-tlfs.h

    - patches from Andy to clean up GUID usage in Hyper-V code

    - a few other misc patches

    * tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: (29 commits)
    Drivers: hv: vmbus: Resolve more races involving init_vp_index()
    Drivers: hv: vmbus: Resolve race between init_vp_index() and CPU hotplug
    vmbus: Replace zero-length array with flexible-array
    Driver: hv: vmbus: drop a no long applicable comment
    hyper-v: Switch to use UUID types directly
    hyper-v: Replace open-coded variant of %*phN specifier
    hyper-v: Supply GUID pointer to printf() like functions
    hyper-v: Use UUID API for exporting the GUID (part 2)
    asm-generic/hyperv: Add definitions for Get/SetVpRegister hypercalls
    x86/hyperv: Split hyperv-tlfs.h into arch dependent and independent files
    x86/hyperv: Remove HV_PROCESSOR_POWER_STATE #defines
    KVM: x86: hyperv: Remove duplicate definitions of Reference TSC Page
    drivers: hv: remove redundant assignment to pointer primary_channel
    scsi: storvsc: Re-init stor_chns when a channel interrupt is re-assigned
    Drivers: hv: vmbus: Introduce the CHANNELMSG_MODIFYCHANNEL message type
    Drivers: hv: vmbus: Synchronize init_vp_index() vs. CPU hotplug
    Drivers: hv: vmbus: Remove the unused HV_LOCALIZED channel affinity logic
    PCI: hv: Prepare hv_compose_msi_msg() for the VMBus-channel-interrupt-to-vCPU reassignment functionality
    Drivers: hv: vmbus: Use a spin lock for synchronizing channel scheduling vs. channel removal
    hv_utils: Always execute the fcopy and vss callbacks in a tasklet
    ...

    Linus Torvalds
     

23 May, 2020

2 commits

  • 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: 7527810573436f ("Drivers: hv: vmbus: Introduce the CHANNELMSG_MODIFYCHANNEL message type")
    Signed-off-by: Andrea Parri (Microsoft)
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200522171901.204127-3-parri.andrea@gmail.com
    Signed-off-by: Wei Liu

    Andrea Parri (Microsoft)
     
  • vmbus_process_offer() does two things (among others):

    1) first, it sets the channel's target CPU with cpu_hotplug_lock;
    2) it then adds the channel to the channel list(s) with channel_mutex.

    Since cpu_hotplug_lock is released before (2), the channel's target CPU
    (as designated in (1)) can be deemed "free" by hv_synic_cleanup() and go
    offline before the channel is added to the list.

    Fix the race condition by "extending" the cpu_hotplug_lock critical
    section to include (2) (and (1)), nesting the channel_mutex critical
    section within the cpu_hotplug_lock critical section as done elsewhere
    (hv_synic_cleanup(), target_cpu_store()) in the hyperv drivers code.

    Move even further by extending the channel_mutex critical section to
    include (1) (and (2)): this change allows to remove (the now redundant)
    bind_channel_to_cpu_lock, and generally simplifies the handling of the
    target CPUs (that are now always modified with channel_mutex held).

    Fixes: d570aec0f2154e ("Drivers: hv: vmbus: Synchronize init_vp_index() vs. CPU hotplug")
    Signed-off-by: Andrea Parri (Microsoft)
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200522171901.204127-2-parri.andrea@gmail.com
    Signed-off-by: Wei Liu

    Andrea Parri (Microsoft)
     

20 May, 2020

2 commits