15 Oct, 2020

1 commit

  • 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
     

11 Aug, 2020

1 commit

  • Make hv_setup_sched_clock inline so the reference to pv_ops works
    correctly with objtool updates to detect noinstr violations.
    See https://lore.kernel.org/patchwork/patch/1283635/

    Signed-off-by: Michael Kelley
    Acked-by: Peter Zijlstra (Intel)
    Acked-by: Thomas Gleixner
    Link: https://lore.kernel.org/r/1597022991-24088-1-git-send-email-mikelley@microsoft.com
    Signed-off-by: Wei Liu

    Michael Kelley
     

12 Apr, 2020

1 commit

  • When oops happens with panic_on_oops unset, the oops
    thread is killed by die() and system continues to run.
    In such case, guest should not report crash register
    data to host since system still runs. Check panic_on_oops
    and return directly in hyperv_report_panic() when the function
    is called in the die() and panic_on_oops is unset. Fix it.

    Fixes: 7ed4325a44ea ("Drivers: hv: vmbus: Make panic reporting to be more useful")
    Signed-off-by: Tianyu Lan
    Reviewed-by: Michael Kelley
    Link: https://lore.kernel.org/r/20200406155331.2105-7-Tianyu.Lan@microsoft.com
    Signed-off-by: Wei Liu

    Tianyu Lan
     

22 Nov, 2019

1 commit

  • The API will be used by the hv_balloon and hv_vmbus drivers.

    Balloon up/down and hot-add of memory must not be active if the user
    wants the Linux VM to support hibernation, because they are incompatible
    with hibernation according to Hyper-V team, e.g. upon suspend the
    balloon VSP doesn't save any info about the ballooned-out pages (if any);
    so, after Linux resumes, Linux balloon VSC expects that the VSP will
    return the pages if Linux is under memory pressure, but the VSP will
    never do that, since the VSP thinks it never stole the pages from the VM.

    So, if the user wants Linux VM to support hibernation, Linux must forbid
    balloon up/down and hot-add, and the only functionality of the balloon VSC
    driver is reporting the VM's memory pressure to the host.

    Ideally, when Linux detects that the user wants it to support hibernation,
    the balloon VSC should tell the VSP that it does not support ballooning
    and hot-add. However, the current version of the VSP requires the VSC
    should support these capabilities, otherwise the capability negotiation
    fails and the VSC can not load at all, so with the later changes to the
    VSC driver, Linux VM still reports to the VSP that the VSC supports these
    capabilities, but the VSC ignores the VSP's requests of balloon up/down
    and hot add, and reports an error to the VSP, when applicable. BTW, in
    the future the balloon VSP driver will allow the VSC to not support the
    capabilities of balloon up/down and hot add.

    The ACPI S4 state is not a must for hibernation to work, because Linux is
    able to hibernate as long as the system can shut down. However in practice
    we decide to artificially use the presence of the virtual ACPI S4 state as
    an indicator of the user's intent of using hibernation, because Linux VM
    must find a way to know if the user wants to use the hibernation feature
    or not.

    By default, Hyper-V does not enable the virtual ACPI S4 state; on recent
    Hyper-V hosts (e.g. RS5, 19H1), the administrator is able to enable the
    state for a VM by WMI commands.

    Once all the vmbus and VSC patches for the hibernation feature are
    accepted, an extra patch will be submitted to forbid hibernation if the
    virtual ACPI S4 state is absent, i.e. hv_is_hibernation_supported() is
    false.

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

    Dexuan Cui
     

23 Aug, 2019

1 commit

  • Hyper-V guests use the default native_sched_clock() in
    pv_ops.time.sched_clock on x86. But native_sched_clock() directly uses the
    raw TSC value, which can be discontinuous in a Hyper-V VM.

    Add the generic hv_setup_sched_clock() to set the sched clock function
    appropriately. On x86, this sets pv_ops.time.sched_clock to read the
    Hyper-V reference TSC value that is scaled and adjusted to be continuous.

    Also move the Hyper-V reference TSC initialization much earlier in the boot
    process so no discontinuity is observed when pv_ops.time.sched_clock
    calculates its offset.

    [ tglx: Folded build fix ]

    Signed-off-by: Tianyu Lan
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Michael Kelley
    Link: https://lkml.kernel.org/r/20190814123216.32245-3-Tianyu.Lan@microsoft.com

    Tianyu Lan
     

09 Jul, 2019

1 commit