31 Jan, 2019

2 commits

  • commit ba50bf1ce9a51fc97db58b96d01306aa70bc3979 upstream.

    fc96df16a1ce is good and can already fix the "return stack garbage" issue,
    but let's also improve hv_ringbuffer_get_debuginfo(), which would silently
    return stack garbage, if people forget to check channel->state or
    ring_info->ring_buffer, when using the function in the future.

    Having an error check in the function would eliminate the potential risk.

    Add a Fixes tag to indicate the patch depdendency.

    Fixes: fc96df16a1ce ("Drivers: hv: vmbus: Return -EINVAL for the sys files for unopened channels")
    Cc: stable@vger.kernel.org
    Cc: K. Y. Srinivasan
    Cc: Haiyang Zhang
    Signed-off-by: Stephen Hemminger
    Signed-off-by: Dexuan Cui
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     
  • commit da8ced360ca8ad72d8f41f5c8fcd5b0e63e1555f upstream.

    Hyper-V memory hotplug protocol has 2M granularity and in Linux x86 we use
    128M. To deal with it we implement partial section onlining by registering
    custom page onlining callback (hv_online_page()). Later, when more memory
    arrives we try to online the 'tail' (see hv_bring_pgs_online()).

    It was found that in some cases this 'tail' onlining causes issues:

    BUG: Bad page state in process kworker/0:2 pfn:109e3a
    page:ffffe08344278e80 count:0 mapcount:1 mapping:0000000000000000 index:0x0
    flags: 0xfffff80000000()
    raw: 000fffff80000000 dead000000000100 dead000000000200 0000000000000000
    raw: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    page dumped because: nonzero mapcount
    ...
    Workqueue: events hot_add_req [hv_balloon]
    Call Trace:
    dump_stack+0x5c/0x80
    bad_page.cold.112+0x7f/0xb2
    free_pcppages_bulk+0x4b8/0x690
    free_unref_page+0x54/0x70
    hv_page_online_one+0x5c/0x80 [hv_balloon]
    hot_add_req.cold.24+0x182/0x835 [hv_balloon]
    ...

    Turns out that we now have deferred struct page initialization for memory
    hotplug so e.g. memory_block_action() in drivers/base/memory.c does
    pages_correctly_probed() check and in that check it avoids inspecting
    struct pages and checks sections instead. But in Hyper-V balloon driver we
    do PageReserved(pfn_to_page()) check and this is now wrong.

    Switch to checking online_section_nr() instead.

    Signed-off-by: Vitaly Kuznetsov
    Cc: stable@kernel.org
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     

13 Jan, 2019

1 commit


29 Dec, 2018

1 commit

  • commit fc96df16a1ce80cbb3c316ab7d4dc8cd5c2852ce upstream.

    Before 98f4c651762c, we returned zeros for unopened channels.
    With 98f4c651762c, we started to return random on-stack values.

    We'd better return -EINVAL instead.

    Fixes: 98f4c651762c ("hv: move ringbuffer bus attributes to dev_groups")
    Cc: stable@vger.kernel.org
    Cc: K. Y. Srinivasan
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Signed-off-by: Dexuan Cui
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     

13 Dec, 2018

1 commit

  • commit 37c2578c0c40e286bc0d30bdc05290b2058cf66e upstream.

    vmbus_process_offer() mustn't call channel->sc_creation_callback()
    directly for sub-channels, because sc_creation_callback() ->
    vmbus_open() may never get the host's response to the
    OPEN_CHANNEL message (the host may rescind a channel at any time,
    e.g. in the case of hot removing a NIC), and vmbus_onoffer_rescind()
    may not wake up the vmbus_open() as it's blocked due to a non-zero
    vmbus_connection.offer_in_progress, and finally we have a deadlock.

    The above is also true for primary channels, if the related device
    drivers use sync probing mode by default.

    And, usually the handling of primary channels and sub-channels can
    depend on each other, so we should offload them to different
    workqueues to avoid possible deadlock, e.g. in sync-probing mode,
    NIC1's netvsc_subchan_work() can race with NIC2's netvsc_probe() ->
    rtnl_lock(), and causes deadlock: the former gets the rtnl_lock
    and waits for all the sub-channels to appear, but the latter
    can't get the rtnl_lock and this blocks the handling of sub-channels.

    The patch can fix the multiple-NIC deadlock described above for
    v3.x kernels (e.g. RHEL 7.x) which don't support async-probing
    of devices, and v4.4, v4.9, v4.14 and v4.18 which support async-probing
    but don't enable async-probing for Hyper-V drivers (yet).

    The patch can also fix the hang issue in sub-channel's handling described
    above for all versions of kernels, including v4.19 and v4.20-rc4.

    So actually the patch should be applied to all the existing kernels,
    not only the kernels that have 8195b1396ec8.

    Fixes: 8195b1396ec8 ("hv_netvsc: fix deadlock on hotplug")
    Cc: stable@vger.kernel.org
    Cc: Stephen Hemminger
    Cc: K. Y. Srinivasan
    Cc: Haiyang Zhang
    Signed-off-by: Dexuan Cui
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     

06 Dec, 2018

1 commit

  • commit eceb05965489784f24bbf4d61ba60e475a983016 upstream.

    This is a longstanding issue: if the vmbus upper-layer drivers try to
    consume too many GPADLs, the host may return with an error
    0xC0000044 (STATUS_QUOTA_EXCEEDED), but currently we forget to check
    the creation_status, and hence we can pass an invalid GPADL handle
    into the OPEN_CHANNEL message, and get an error code 0xc0000225 in
    open_info->response.open_result.status, and finally we hang in
    vmbus_open() -> "goto error_free_info" -> vmbus_teardown_gpadl().

    With this patch, we can exit gracefully on STATUS_QUOTA_EXCEEDED.

    Cc: Stephen Hemminger
    Cc: K. Y. Srinivasan
    Cc: Haiyang Zhang
    Cc: stable@vger.kernel.org
    Signed-off-by: Dexuan Cui
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     

14 Nov, 2018

1 commit

  • [ Upstream commit 25355252607ca288f329ee033f387764883393f6 ]

    A cpumask structure on the stack can cause a warning with
    CONFIG_NR_CPUS=8192 (e.g. Ubuntu 16.04 and 18.04 use this):

    drivers/hv//channel_mgmt.c: In function ‘init_vp_index’:
    drivers/hv//channel_mgmt.c:702:1: warning: the frame size of 1032 bytes
    is larger than 1024 bytes [-Wframe-larger-than=]

    Nowadays it looks most distros enable CONFIG_CPUMASK_OFFSTACK=y, and
    hence we can work around the warning by using cpumask_var_t.

    Signed-off-by: Dexuan Cui
    Cc: K. Y. Srinivasan
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Cc:
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     

30 Sep, 2018

1 commit

  • With CONFIG_DEBUG_PREEMPT=y, I always see this warning:
    BUG: using smp_processor_id() in preemptible [00000000]

    Fix the false warning by using get/put_cpu().

    Here vmbus_connect() sends a message to the host and waits for the
    host's response. The host will deliver the response message and an
    interrupt on CPU msg->target_vcpu, and later the interrupt handler
    will wake up vmbus_connect(). vmbus_connect() doesn't really have
    to run on the same cpu as CPU msg->target_vcpu, so it's safe to
    call put_cpu() just here.

    Signed-off-by: Dexuan Cui
    Cc: stable@vger.kernel.org
    Cc: K. Y. Srinivasan
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     

12 Sep, 2018

1 commit

  • For unsupported device types, the vmbus channel ringbuffer is never
    initialized, and therefore reading the sysfs files will return garbage
    or cause a kernel OOPS.

    Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info")

    Signed-off-by: Stephen Hemminger
    Signed-off-by: K. Y. Srinivasan
    Cc: # 4.15
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     

02 Aug, 2018

3 commits

  • clk_evt memory is not being freed when the synic is shutdown
    or when there is an allocation error. Add the appropriate
    kfree() call, along with a comment to clarify how the memory
    gets freed after an allocation error. Make the free path
    consistent by removing checks for NULL since kfree() and
    free_page() already do the check.

    Signed-off-by: Michael Kelley
    Reported-by: Dan Carpenter
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Michael Kelley
     
  • slow_virt_to_phys() is only implemented for arch/x86.
    Remove its use in arch independent Hyper-V drivers, and
    replace with test for vmalloc() address followed by
    appropriate v-to-p function. This follows the typical
    pattern of other drivers and avoids the need to implement
    slow_virt_to_phys() for Hyper-V on ARM64.

    Signed-off-by: Michael Kelley
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Michael Kelley
     
  • Before setting channel->rescind in vmbus_rescind_cleanup(), we should make
    sure the channel callback won't run any more, otherwise a high-level
    driver like pci_hyperv, which may be infinitely waiting for the host VSP's
    response and notices the channel has been rescinded, can't safely give
    up: e.g., in hv_pci_protocol_negotiation() -> wait_for_response(), it's
    unsafe to exit from wait_for_response() and proceed with the on-stack
    variable "comp_pkt" popped. The issue was originally spotted by
    Michael Kelley .

    In vmbus_close_internal(), the patch also minimizes the range protected by
    disabling/enabling channel->callback_event: we don't really need that for
    the whole function.

    Signed-off-by: Dexuan Cui
    Reviewed-by: Michael Kelley
    Cc: stable@vger.kernel.org
    Cc: K. Y. Srinivasan
    Cc: Stephen Hemminger
    Cc: Michael Kelley
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     

29 Jul, 2018

4 commits


08 Jul, 2018

1 commit

  • In the VM mode on Hyper-V, currently, when the kernel panics, an error
    code and few register values are populated in an MSR and the Hypervisor
    notified. This information is collected on the host. The amount of
    information currently collected is found to be limited and not very
    actionable. To gather more actionable data, such as stack trace, the
    proposal is to write one page worth of kmsg data on an allocated page
    and the Hypervisor notified of the page address through the MSR.

    - Sysctl option to control the behavior, with ON by default.

    Cc: K. Y. Srinivasan
    Cc: Stephen Hemminger
    Signed-off-by: Sunil Muthuswamy
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Sunil Muthuswamy
     

03 Jul, 2018

5 commits

  • The Hyper-V feature and hint flags in hyperv-tlfs.h are all defined
    with the string "X64" in the name. Some of these flags are indeed
    x86/x64 specific, but others are not. For the ones that are used
    in architecture independent Hyper-V driver code, or will be used in
    the upcoming support for Hyper-V for ARM64, this patch removes the
    "X64" from the name.

    This patch changes the flags that are currently known to be
    used on multiple architectures. Hyper-V for ARM64 is still a
    work-in-progress and the Top Level Functional Spec (TLFS) has not
    been separated into x86/x64 and ARM64 areas. So additional flags
    may need to be updated later.

    This patch only changes symbol names. There are no functional
    changes.

    Signed-off-by: Michael Kelley
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Michael Kelley
     
  • In architecture independent code for manipulating Hyper-V synthetic timers
    and synthetic interrupts, pass in an ordinal number identifying the timer
    or interrupt, rather than an actual MSR register address. Then in
    x86/x64 specific code, map the ordinal number to the appropriate MSR.
    This change facilitates the introduction of an ARM64 version of Hyper-V,
    which uses the same synthetic timers and interrupts, but a different
    mechanism for accessing them.

    Signed-off-by: Michael Kelley
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Michael Kelley
     
  • I didn't really hit a real bug, but just happened to spot the bug:
    we have decreased the counter at the beginning of vmbus_process_offer(),
    so we mustn't decrease it again.

    Fixes: 6f3d791f3006 ("Drivers: hv: vmbus: Fix rescind handling issues")
    Signed-off-by: Dexuan Cui
    Cc: stable@vger.kernel.org
    Cc: Stephen Hemminger
    Cc: K. Y. Srinivasan
    Cc: Stable # 4.14 and above
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     
  • Add comments describing intricacies of Hyper-V ring buffer
    signaling code. This information is not in Hyper-V public
    documents, so include here to capture the knowledge for
    future coders.

    There are no code changes in this commit.

    Signed-off-by: Michael Kelley
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Michael Kelley
     
  • Recent kernels support asynchronous probing; most hyperv drivers
    can be probed async easily so set the required flag for this.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Stephen Hemminger
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Arjan van de Ven
     

13 Jun, 2018

1 commit

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

11 Jun, 2018

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is mostly updates to the usual drivers: ufs, qedf, mpt3sas, lpfc,
    xfcp, hisi_sas, cxlflash, qla2xxx.

    In the absence of Nic, we're also taking target updates which are
    mostly minor except for the tcmu refactor.

    The only real core change to worry about is the removal of high page
    bouncing (in sas, storvsc and iscsi). This has been well tested and no
    problems have shown up so far"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (268 commits)
    scsi: lpfc: update driver version to 12.0.0.4
    scsi: lpfc: Fix port initialization failure.
    scsi: lpfc: Fix 16gb hbas failing cq create.
    scsi: lpfc: Fix crash in blk_mq layer when executing modprobe -r lpfc
    scsi: lpfc: correct oversubscription of nvme io requests for an adapter
    scsi: lpfc: Fix MDS diagnostics failure (Rx < Tx)
    scsi: hisi_sas: Mark PHY as in reset for nexus reset
    scsi: hisi_sas: Fix return value when get_free_slot() failed
    scsi: hisi_sas: Terminate STP reject quickly for v2 hw
    scsi: hisi_sas: Add v2 hw force PHY function for internal ATA command
    scsi: hisi_sas: Include TMF elements in struct hisi_sas_slot
    scsi: hisi_sas: Try wait commands before before controller reset
    scsi: hisi_sas: Init disks after controller reset
    scsi: hisi_sas: Create a scsi_host_template per HW module
    scsi: hisi_sas: Reset disks when discovered
    scsi: hisi_sas: Add LED feature for v3 hw
    scsi: hisi_sas: Change common allocation mode of device id
    scsi: hisi_sas: change slot index allocation mode
    scsi: hisi_sas: Introduce hisi_sas_phy_set_linkrate()
    scsi: hisi_sas: fix a typo in hisi_sas_task_prep()
    ...

    Linus Torvalds
     

15 May, 2018

1 commit


14 May, 2018

1 commit

  • With VMBus protocol 5.0, we're able to better support new features, e.g.
    running two or more VMBus drivers simultaneously in a single VM -- note:
    we can't simply load the current VMBus driver twice, instead, a secondary
    VMBus driver must be implemented.

    This patch adds the support for the new VMBus protocol, which is available
    on new Windows hosts, by:

    1) We still use SINT2 for compatibility;
    2) We must use Connection ID 4 for the Initiate Contact Message, and for
    subsequent messages, we must use the Message Connection ID field in
    the host-returned VersionResponse Message.

    Notes for developers of the secondary VMBus driver:
    1) Must use VMBus protocol 5.0 as well;
    2) Must use a different SINT number that is not in use.
    3) Must use Connection ID 4 for the Initiate Contact Message, and for
    subsequent messages, must use the Message Connection ID field in
    the host-returned VersionResponse Message.
    4) It's possible that the primary VMBus driver using protocol version 4.0
    can work with a secondary VMBus driver using protocol version 5.0, but it's
    recommended that both should use 5.0 for new Hyper-V features in the future.

    Signed-off-by: Dexuan Cui
    Cc: Stephen Hemminger
    Cc: K. Y. Srinivasan
    Cc: Michael Kelley
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     

19 Apr, 2018

1 commit


10 Apr, 2018

1 commit

  • Pull kvm updates from Paolo Bonzini:
    "ARM:
    - VHE optimizations

    - EL2 address space randomization

    - speculative execution mitigations ("variant 3a", aka execution past
    invalid privilege register access)

    - bugfixes and cleanups

    PPC:
    - improvements for the radix page fault handler for HV KVM on POWER9

    s390:
    - more kvm stat counters

    - virtio gpu plumbing

    - documentation

    - facilities improvements

    x86:
    - support for VMware magic I/O port and pseudo-PMCs

    - AMD pause loop exiting

    - support for AMD core performance extensions

    - support for synchronous register access

    - expose nVMX capabilities to userspace

    - support for Hyper-V signaling via eventfd

    - use Enlightened VMCS when running on Hyper-V

    - allow userspace to disable MWAIT/HLT/PAUSE vmexits

    - usual roundup of optimizations and nested virtualization bugfixes

    Generic:
    - API selftest infrastructure (though the only tests are for x86 as
    of now)"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (174 commits)
    kvm: x86: fix a prototype warning
    kvm: selftests: add sync_regs_test
    kvm: selftests: add API testing infrastructure
    kvm: x86: fix a compile warning
    KVM: X86: Add Force Emulation Prefix for "emulate the next instruction"
    KVM: X86: Introduce handle_ud()
    KVM: vmx: unify adjacent #ifdefs
    x86: kvm: hide the unused 'cpu' variable
    KVM: VMX: remove bogus WARN_ON in handle_ept_misconfig
    Revert "KVM: X86: Fix SMRAM accessing even if VM is shutdown"
    kvm: Add emulation for movups/movupd
    KVM: VMX: raise internal error for exception during invalid protected mode state
    KVM: nVMX: Optimization: Dont set KVM_REQ_EVENT when VMExit with nested_run_pending
    KVM: nVMX: Require immediate-exit when event reinjected to L2 and L1 event pending
    KVM: x86: Fix misleading comments on handling pending exceptions
    KVM: x86: Rename interrupt.pending to interrupt.injected
    KVM: VMX: No need to clear pending NMI/interrupt on inject realmode interrupt
    x86/kvm: use Enlightened VMCS when running on Hyper-V
    x86/hyper-v: detect nested features
    x86/hyper-v: define struct hv_enlightened_vmcs and clean field bits
    ...

    Linus Torvalds
     

29 Mar, 2018

1 commit

  • hyperv.h is not part of uapi, there are no (known) users outside of kernel.
    We are making changes to this file to match current Hyper-V Hypervisor
    Top-Level Functional Specification (TLFS, see:
    https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs)
    and we don't want to maintain backwards compatibility.

    Move the file renaming to hyperv-tlfs.h to avoid confusing it with
    mshyperv.h. In future, all definitions from TLFS should go to it and
    all kernel objects should go to mshyperv.h or include/linux/hyperv.h.

    Signed-off-by: Vitaly Kuznetsov
    Acked-by: Thomas Gleixner
    Signed-off-by: Radim Krčmář

    Vitaly Kuznetsov
     

28 Mar, 2018

5 commits


07 Mar, 2018

6 commits

  • Hyper-V balloon driver makes non-trivial calculations to convert Linux's
    representation of free/used memory to what Hyper-V host expects to see. Add
    a tracepoint to see what's being sent and where the data comes from.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • Our num_pages_onlined accounting is buggy:
    1) In case we're offlining a memory block which was present at boot (e.g.
    when there was no hotplug at all) we subtract 32k from 0 and as
    num_pages_onlined is unsigned get a very big positive number.

    2) Commit 6df8d9aaf3af ("Drivers: hv: balloon: Correctly update onlined
    page count") made num_pages_onlined counter accurate on onlining but
    totally incorrect on offlining for partly populated regions: no matter
    how many pages were onlined and what was actually added to
    num_pages_onlined counter we always subtract the full region (32k) so
    again, num_pages_onlined can wrap around zero. By onlining/offlining
    the same partly populated region multiple times we can make the
    situation worse.

    Solve these issues by doing accurate accounting on offlining: walk HAS
    list, check for covered range and gaps.

    Fixes: 6df8d9aaf3af ("Drivers: hv: balloon: Correctly update onlined page count")
    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • Instead of doing pfn_to_page() and continuosly casting page to unsigned
    long just cache the pfn of the page with page_to_pfn().

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • We have a mix of different ideas of which loglevel should be used. Unify
    on the following:
    - pr_info() for normal operation
    - pr_warn() for 'strange' host behavior
    - pr_err() for all errors.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • The 2016 version of Hyper-V offers the option to operate the guest VM
    per-vcpu stimer's in Direct Mode, which means the timer interupts on its
    own vector rather than queueing a VMbus message. Direct Mode reduces
    timer processing overhead in both the hypervisor and the guest, and
    avoids having timer interrupts pollute the VMbus interrupt stream for
    the synthetic NIC and storage. This patch enables Direct Mode by
    default on stimer0 when running on a version of Hyper-V that supports
    it.

    In prep for coming support of Hyper-V on ARM64, the arch independent
    portion of the code contains calls to routines that will be populated
    on ARM64 but are not needed and do nothing on x86.

    Signed-off-by: Michael Kelley
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Michael Kelley
     
  • The comments doesn't match what the current code does, also have a
    typo. This patch corrects them.

    Signed-off-by: Haiyang Zhang
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Haiyang Zhang