15 May, 2021

2 commits

  • Use blk_mq_unique_tag() to generate requestIDs for StorVSC, avoiding
    all issues with allocating enough entries in the VMbus requestor.

    Suggested-by: Michael Kelley
    Signed-off-by: Andrea Parri (Microsoft)
    Reviewed-by: Michael Kelley
    Acked-by: Martin K. Petersen
    Link: https://lore.kernel.org/r/20210510210841.370472-1-parri.andrea@gmail.com
    Signed-off-by: Wei Liu

    Andrea Parri (Microsoft)
     
  • Pointers to ring-buffer packets sent by Hyper-V are used within the
    guest VM. Hyper-V can send packets with erroneous values or modify
    packet fields after they are processed by the guest. To defend
    against these scenarios, return a copy of the incoming VMBus packet
    after validating its length and offset fields in hv_pkt_iter_first().
    In this way, the packet can no longer be modified by the host.

    Signed-off-by: Andres Beltran
    Co-developed-by: Andrea Parri (Microsoft)
    Signed-off-by: Andrea Parri (Microsoft)
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20210408161439.341988-1-parri.andrea@gmail.com
    Signed-off-by: Wei Liu

    Andres Beltran
     

29 Apr, 2021

1 commit

  • Pull SCSI updates from James Bottomley:
    "This consists of the usual driver updates (ufs, target, tcmu,
    smartpqi, lpfc, zfcp, qla2xxx, mpt3sas, pm80xx).

    The major core change is using a sbitmap instead of an atomic for
    queue tracking"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (412 commits)
    scsi: target: tcm_fc: Fix a kernel-doc header
    scsi: target: Shorten ALUA error messages
    scsi: target: Fix two format specifiers
    scsi: target: Compare explicitly with SAM_STAT_GOOD
    scsi: sd: Introduce a new local variable in sd_check_events()
    scsi: dc395x: Open-code status_byte(u8) calls
    scsi: 53c700: Open-code status_byte(u8) calls
    scsi: smartpqi: Remove unused functions
    scsi: qla4xxx: Remove an unused function
    scsi: myrs: Remove unused functions
    scsi: myrb: Remove unused functions
    scsi: mpt3sas: Fix two kernel-doc headers
    scsi: fcoe: Suppress a compiler warning
    scsi: libfc: Fix a format specifier
    scsi: aacraid: Remove an unused function
    scsi: core: Introduce enum scsi_disposition
    scsi: core: Modify the scsi_send_eh_cmnd() return value for the SDEV_BLOCK case
    scsi: core: Rename scsi_softirq_done() into scsi_complete()
    scsi: core: Remove an incorrect comment
    scsi: core: Make the scsi_alloc_sgtables() documentation more accurate
    ...

    Linus Torvalds
     

18 Apr, 2021

2 commits


24 Mar, 2021

1 commit


17 Mar, 2021

1 commit

  • storvsc currently sets .dma_boundary to limit scatterlist entries to 4
    Kbytes, which is less efficient with huge pages that offer large chunks of
    contiguous physical memory. Improve the algorithm for creating the Hyper-V
    guest physical address PFN array so that scatterlist entries with lengths >
    4Kbytes are handled. As a result, remove the .dma_boundary setting.

    The improved algorithm also adds support for scatterlist entries with
    offsets >= 4Kbytes, which is supported by many other SCSI low-level
    drivers. And it retains support for architectures where possibly PAGE_SIZE
    != HV_HYP_PAGE_SIZE (such as ARM64).

    Link: https://lore.kernel.org/r/1614120294-1930-1-git-send-email-mikelley@microsoft.com
    Reviewed-by: Vitaly Kuznetsov
    Signed-off-by: Michael Kelley
    Signed-off-by: Martin K. Petersen

    Michael Kelley
     

15 Feb, 2021

1 commit


11 Feb, 2021

2 commits

  • There is a regular need in the kernel to provide a way to declare having
    a dynamically sized set of trailing elements in a structure. Kernel code
    should always use “flexible array members”[1] for these cases. The older
    style of one-element or zero-length arrays should no longer be used[2].

    Refactor the code according to the use of a flexible-array member in
    struct icmsg_negotiate, instead of a one-element array.

    Also, this helps the ongoing efforts to enable -Warray-bounds and fix the
    following warnings:

    drivers/hv/channel_mgmt.c:315:23: warning: array subscript 1 is above array bounds of ‘struct ic_version[1]’ [-Warray-bounds]
    drivers/hv/channel_mgmt.c:316:23: warning: array subscript 1 is above array bounds of ‘struct ic_version[1]’ [-Warray-bounds]

    [1] https://en.wikipedia.org/wiki/Flexible_array_member
    [2] https://www.kernel.org/doc/html/v5.9/process/deprecated.html#zero-length-and-one-element-arrays

    Link: https://github.com/KSPP/linux/issues/79
    Link: https://github.com/KSPP/linux/issues/109
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20210201174334.GA171933@embeddedor
    Signed-off-by: Wei Liu

    Gustavo A. R. Silva
     
  • Only the VSCs or ICs that have been hardened and that are critical for
    the successful adoption of Confidential VMs should be allowed if the
    guest is running isolated. This change reduces the footprint of the
    code that will be exercised by Confidential VMs and hence the exposure
    to bugs and vulnerabilities.

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

    Andrea Parri (Microsoft)
     

05 Feb, 2021

3 commits

  • An erroneous or malicious host could send multiple rescind messages for
    a same channel. In vmbus_onoffer_rescind(), the guest maps the channel
    ID to obtain a pointer to the channel object and it eventually releases
    such object and associated data. The host could time rescind messages
    and lead to an use-after-free. Add a new flag to the channel structure
    to make sure that only one instance of vmbus_onoffer_rescind() can get
    the reference to the channel object.

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

    Andrea Parri (Microsoft)
     
  • For additional robustness in the face of Hyper-V errors or malicious
    behavior, validate all values that originate from packets that Hyper-V
    has sent to the guest in the host-to-guest ring buffer. Ensure that
    invalid values cannot cause indexing off the end of the icversion_data
    array in vmbus_prep_negotiate_resp().

    Signed-off-by: Andres Beltran
    Co-developed-by: Andrea Parri (Microsoft)
    Signed-off-by: Andrea Parri (Microsoft)
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20201109100704.9152-1-parri.andrea@gmail.com
    Signed-off-by: Wei Liu

    Andres Beltran
     
  • Pointers to ring-buffer packets sent by Hyper-V are used within the
    guest VM. Hyper-V can send packets with erroneous values or modify
    packet fields after they are processed by the guest. To defend
    against these scenarios, return a copy of the incoming VMBus packet
    after validating its length and offset fields in hv_pkt_iter_first().
    In this way, the packet can no longer be modified by the host.

    Signed-off-by: Andres Beltran
    Co-developed-by: Andrea Parri (Microsoft)
    Signed-off-by: Andrea Parri (Microsoft)
    Cc: "David S. Miller"
    Cc: Jakub Kicinski
    Cc: "James E.J. Bottomley"
    Cc: "Martin K. Petersen"
    Cc: netdev@vger.kernel.org
    Cc: linux-scsi@vger.kernel.org
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20201208045311.10244-1-parri.andrea@gmail.com
    Signed-off-by: Wei Liu

    Andres Beltran
     

17 Nov, 2020

2 commits

  • Currently, pointers to guest memory are passed to Hyper-V as
    transaction IDs in netvsc. In the face of errors or malicious
    behavior in Hyper-V, netvsc should not expose or trust the transaction
    IDs returned by Hyper-V to be valid guest memory addresses. Instead,
    use small integers generated by vmbus_requestor as requests
    (transaction) IDs.

    Signed-off-by: Andres Beltran
    Co-developed-by: Andrea Parri (Microsoft)
    Signed-off-by: Andrea Parri (Microsoft)
    Reviewed-by: Michael Kelley
    Acked-by: Jakub Kicinski
    Reviewed-by: Wei Liu
    Cc: "David S. Miller"
    Cc: Jakub Kicinski
    Cc: netdev@vger.kernel.org
    Link: https://lore.kernel.org/r/20201109100402.8946-4-parri.andrea@gmail.com
    Signed-off-by: Wei Liu

    Andres Beltran
     
  • Currently, VMbus drivers use pointers into guest memory as request IDs
    for interactions with Hyper-V. To be more robust in the face of errors
    or malicious behavior from a compromised Hyper-V, avoid exposing
    guest memory addresses to Hyper-V. Also avoid Hyper-V giving back a
    bad request ID that is then treated as the address of a guest data
    structure with no validation. Instead, encapsulate these memory
    addresses and provide small integers as request IDs.

    Signed-off-by: Andres Beltran
    Co-developed-by: Andrea Parri (Microsoft)
    Signed-off-by: Andrea Parri (Microsoft)
    Reviewed-by: Michael Kelley
    Reviewed-by: Wei Liu
    Link: https://lore.kernel.org/r/20201109100402.8946-2-parri.andrea@gmail.com
    Signed-off-by: Wei Liu

    Andres Beltran
     

28 Sep, 2020

3 commits

  • When a guest communicate with the hypervisor, it must use HV_HYP_PAGE to
    calculate PFN, so introduce a few hvpfn helper functions as the
    counterpart of the page helper functions. This is the preparation for
    supporting guest whose PAGE_SIZE is not 4k.

    Signed-off-by: Boqun Feng
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200916034817.30282-7-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
     
  • 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
     

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

2 commits


23 May, 2020

1 commit

  • 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)
     

20 May, 2020

2 commits

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    sizeof(flexible-array-member) triggers a warning because flexible array
    members have incomplete type[1]. There are some instances of code in
    which the sizeof operator is being incorrectly/erroneously applied to
    zero-length arrays and the result is zero. Such instances may be hiding
    some bugs. So, this work (flexible-array member conversions) will also
    help to get completely rid of those sorts of issues.

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200507185323.GA14416@embeddedor
    Signed-off-by: Wei Liu

    Gustavo A. R. Silva
     
  • For each storvsc_device, storvsc keeps track of the channel target CPUs
    associated to the device (alloced_cpus) and it uses this information to
    fill a "cache" (stor_chns) mapping CPU->channel according to a certain
    heuristic. Update the alloced_cpus mask and the stor_chns array when a
    channel of the storvsc device is re-assigned to a different CPU.

    Signed-off-by: Andrea Parri (Microsoft)
    Cc: "James E.J. Bottomley"
    Cc: "Martin K. Petersen"
    Cc:
    Link: https://lore.kernel.org/r/20200406001514.19876-12-parri.andrea@gmail.com
    Reviewed-by; Long Li
    Reviewed-by: Michael Kelley
    [ wei: fix a small issue reported by kbuild test robot ]
    Signed-off-by: Wei Liu

    Andrea Parri (Microsoft)
     

23 Apr, 2020

5 commits

  • VMBus version 4.1 and later support the CHANNELMSG_MODIFYCHANNEL(22)
    message type which can be used to request Hyper-V to change the vCPU
    that a channel will interrupt.

    Introduce the CHANNELMSG_MODIFYCHANNEL message type, and define the
    vmbus_send_modifychannel() function to send CHANNELMSG_MODIFYCHANNEL
    requests to the host via a hypercall. The function is then used to
    define a sysfs "store" operation, which allows to change the (v)CPU
    the channel will interrupt by using the sysfs interface. The feature
    can be used for load balancing or other purposes.

    One interesting catch here is that Hyper-V can *not* currently ACK
    CHANNELMSG_MODIFYCHANNEL messages with the promise that (after the ACK
    is sent) the channel won't send any more interrupts to the "old" CPU.

    The peculiarity of the CHANNELMSG_MODIFYCHANNEL messages is problematic
    if the user want to take a CPU offline, since we don't want to take a
    CPU offline (and, potentially, "lose" channel interrupts on such CPU)
    if the host is still processing a CHANNELMSG_MODIFYCHANNEL message
    associated to that CPU.

    It is worth mentioning, however, that we have been unable to observe
    the above mentioned "race": in all our tests, CHANNELMSG_MODIFYCHANNEL
    requests appeared *as if* they were processed synchronously by the host.

    Suggested-by: Michael Kelley
    Signed-off-by: Andrea Parri (Microsoft)
    Link: https://lore.kernel.org/r/20200406001514.19876-11-parri.andrea@gmail.com
    Reviewed-by: Michael Kelley
    [ wei: fix conflict in channel_mgmt.c ]
    Signed-off-by: Wei Liu

    Andrea Parri (Microsoft)
     
  • The logic is unused since commit 509879bdb30b8 ("Drivers: hv: Introduce
    a policy for controlling channel affinity").

    This logic assumes that a channel target_cpu doesn't change during the
    lifetime of a channel, but this assumption is incompatible with the new
    functionality that allows changing the vCPU a channel will interrupt.

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

    Andrea Parri (Microsoft)
     
  • Since vmbus_chan_sched() dereferences the ring buffer pointer, we have
    to make sure that the ring buffer data structures don't get freed while
    such dereferencing is happening. Current code does this by sending an
    IPI to the CPU that is allowed to access that ring buffer from interrupt
    level, cf., vmbus_reset_channel_cb(). But with the new functionality
    to allow changing the CPU that a channel will interrupt, we can't be
    sure what CPU will be running the vmbus_chan_sched() function for a
    particular channel, so the current IPI mechanism is infeasible.

    Instead synchronize vmbus_chan_sched() and vmbus_reset_channel_cb() by
    using the (newly introduced) per-channel spin lock "sched_lock". Move
    the test for onchannel_callback being NULL before the "switch" control
    statement in vmbus_chan_sched(), in order to not access the ring buffer
    if the vmbus_reset_channel_cb() has been completed on the channel.

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

    Andrea Parri (Microsoft)
     
  • When Hyper-V sends an interrupt to the guest, the guest has to figure
    out which channel the interrupt is associated with. Hyper-V sets a bit
    in a memory page that is shared with the guest, indicating a particular
    "relid" that the interrupt is associated with. The current Linux code
    then uses a set of per-CPU linked lists to map a given "relid" to a
    pointer to a channel structure.

    This design introduces a synchronization problem if the CPU that Hyper-V
    will interrupt for a certain channel is changed. If the interrupt comes
    on the "old CPU" and the channel was already moved to the per-CPU list
    of the "new CPU", then the relid -> channel mapping will fail and the
    interrupt is dropped. Similarly, if the interrupt comes on the new CPU
    but the channel was not moved to the per-CPU list of the new CPU, then
    the mapping will fail and the interrupt is dropped.

    Relids are integers ranging from 0 to 2047. The mapping from relids to
    channel structures can be done by setting up an array with 2048 entries,
    each entry being a pointer to a channel structure (hence total size ~16K
    bytes, which is not a problem). The array is global, so there are no
    per-CPU linked lists to update. The array can be searched and updated
    by loading from/storing to the array at the specified index. With no
    per-CPU data structures, the above mentioned synchronization problem is
    avoided and the relid2channel() function gets simpler.

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

    Andrea Parri (Microsoft)
     
  • vmbus_onmessage() doesn't need the header of the message, it only
    uses it to get to the payload, we can pass the pointer to the
    payload directly.

    Signed-off-by: Vitaly Kuznetsov
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200406104154.45010-4-vkuznets@redhat.com
    Signed-off-by: Wei Liu

    Vitaly Kuznetsov
     

27 Jan, 2020

1 commit

  • Add util_pre_suspend() and util_pre_resume() for some hv_utils devices
    (e.g. kvp/vss/fcopy), because they need special handling before
    util_suspend() calls vmbus_close().

    For kvp, all the possible pending work items should be cancelled.

    For vss and fcopy, some extra clean-up needs to be done, i.e. fake a
    THAW message for hv_vss_daemon and fake a CANCEL_FCOPY message for
    hv_fcopy_daemon, otherwise when the VM resums back, the daemons
    can end up in an inconsistent state (i.e. the file systems are
    frozen but will never be thawed; the file transmitted via fcopy
    may not be complete). Note: there is an extra patch for the daemons:
    "Tools: hv: Reopen the devices if read() or write() returns errors",
    because the hv_utils driver can not guarantee the whole transaction
    finishes completely once util_suspend() starts to run (at this time,
    all the userspace processes are frozen).

    util_probe() disables channel->callback_event to avoid the race with
    the channel callback.

    Signed-off-by: Dexuan Cui
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Dexuan Cui
     

26 Jan, 2020

1 commit

  • 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: Dexuan Cui
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Dexuan Cui
     

22 Nov, 2019

3 commits

  • Introduce user specified latency in the packet reception path
    By exposing the test parameters as part of the debugfs channel
    attributes. We will control the testing state via these attributes.

    Signed-off-by: Branden Bonaby
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Branden Bonaby
     
  • Hyper-V has added VMBus protocol versions 5.1 and 5.2 in recent release
    versions. Allow Linux guests to negotiate these new protocol versions
    on versions of Hyper-V that support them. While on this, also allow
    guests to negotiate the VMBus protocol version 4.1 (which was missing).

    Signed-off-by: Andrea Parri
    Reviewed-by: Wei Liu
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Andrea Parri
     
  • The technique used to get the next VMBus version seems increasisly
    clumsy as the number of VMBus versions increases. Performance is
    not a concern since this is only done once during system boot; it's
    just that we'll end up with more lines of code than is really needed.

    As an alternative, introduce a table with the version numbers listed
    in order (from the most recent to the oldest). vmbus_connect() loops
    through the versions listed in the table until it gets an accepted
    connection or gets to the end of the table (invalid version).

    Suggested-by: Michael Kelley
    Signed-off-by: Andrea Parri
    Reviewed-by: Wei Liu
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Andrea Parri
     

25 Sep, 2019

1 commit

  • Pull Hyper-V updates from Sasha Levin:

    - first round of vmbus hibernation support (Dexuan Cui)

    - remove dependencies on PAGE_SIZE (Maya Nakamura)

    - move the hyper-v tools/ code into the tools build system (Andy
    Shevchenko)

    - hyper-v balloon cleanups (Dexuan Cui)

    * tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
    Drivers: hv: vmbus: Resume after fixing up old primary channels
    Drivers: hv: vmbus: Suspend after cleaning up hv_sock and sub channels
    Drivers: hv: vmbus: Clean up hv_sock channels by force upon suspend
    Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation
    Drivers: hv: vmbus: Ignore the offers when resuming from hibernation
    Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation
    Drivers: hv: vmbus: Add a helper function is_sub_channel()
    Drivers: hv: vmbus: Suspend/resume the synic for hibernation
    Drivers: hv: vmbus: Break out synic enable and disable operations
    HID: hv: Remove dependencies on PAGE_SIZE for ring buffer
    Tools: hv: move to tools buildsystem
    hv_balloon: Reorganize the probe function
    hv_balloon: Use a static page for the balloon_up send buffer

    Linus Torvalds
     

07 Sep, 2019

3 commits


22 Aug, 2019

2 commits

  • This interface driver is a helper driver allows other drivers to
    have a common interface with the Hyper-V PCI frontend driver.

    Signed-off-by: Haiyang Zhang
    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Haiyang Zhang
     
  • Windows SR-IOV provides a backchannel mechanism in software for communication
    between a VF driver and a PF driver. These "configuration blocks" are
    similar in concept to PCI configuration space, but instead of doing reads and
    writes in 32-bit chunks through a very slow path, packets of up to 128 bytes
    can be sent or received asynchronously.

    Nearly every SR-IOV device contains just such a communications channel in
    hardware, so using this one in software is usually optional. Using the
    software channel, however, allows driver implementers to leverage software
    tools that fuzz the communications channel looking for vulnerabilities.

    The usage model for these packets puts the responsibility for reading or
    writing on the VF driver. The VF driver sends a read or a write packet,
    indicating which "block" is being referred to by number.

    If the PF driver wishes to initiate communication, it can "invalidate" one or
    more of the first 64 blocks. This invalidation is delivered via a callback
    supplied by the VF driver by this driver.

    No protocol is implied, except that supplied by the PF and VF drivers.

    Signed-off-by: Jake Oshins
    Signed-off-by: Dexuan Cui
    Cc: Haiyang Zhang
    Cc: K. Y. Srinivasan
    Cc: Stephen Hemminger
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Haiyang Zhang
    Signed-off-by: David S. Miller

    Dexuan Cui