11 Feb, 2020

1 commit

  • commit d33c240d47dab4fd15123d9e73fc8810cbc6ed6a upstream.

    Current code has assumption that balloon request memory size aligns
    with 2MB. But actually Hyper-V doesn't guarantee such alignment. When
    balloon driver receives non-aligned balloon request, it produces warning
    and balloon up more memory than requested in order to keep 2MB alignment.
    Remove the warning and balloon up memory according to actual requested
    memory size.

    Fixes: f6712238471a ("hv: hv_balloon: avoid memory leak on alloc_error of 2MB memory block")
    Cc: stable@vger.kernel.org
    Reviewed-by: Vitaly Kuznetsov
    Signed-off-by: Tianyu Lan
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Tianyu Lan
     

05 Jan, 2020

1 commit

  • [ Upstream commit 7a1323b5dfe44a9013a2cc56ef2973034a00bf88 ]

    The crash handler calls hv_synic_cleanup() to shutdown the
    Hyper-V synthetic interrupt controller. But if the CPU
    that calls hv_synic_cleanup() has a VMbus channel interrupt
    assigned to it (which is likely the case in smaller VM sizes),
    hv_synic_cleanup() returns an error and the synthetic
    interrupt controller isn't shutdown. While the lack of
    being shutdown hasn't caused a known problem, it still
    should be fixed for highest reliability.

    So directly call hv_synic_disable_regs() instead of
    hv_synic_cleanup(), which ensures that the synic is always
    shutdown.

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

    Michael Kelley
     

02 Oct, 2019

1 commit

  • If CONFIG_PM_SLEEP is not set, we can comment out these functions to avoid
    the below warnings:

    drivers/hv/vmbus_drv.c:2208:12: warning: ‘vmbus_bus_resume’ defined but not used [-Wunused-function]
    drivers/hv/vmbus_drv.c:2128:12: warning: ‘vmbus_bus_suspend’ defined but not used [-Wunused-function]
    drivers/hv/vmbus_drv.c:937:12: warning: ‘vmbus_resume’ defined but not used [-Wunused-function]
    drivers/hv/vmbus_drv.c:918:12: warning: ‘vmbus_suspend’ defined but not used [-Wunused-function]

    Fixes: 271b2224d42f ("Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation")
    Fixes: f53335e3289f ("Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation")
    Reported-by: Arnd Bergmann
    Signed-off-by: Dexuan Cui
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Dexuan Cui
     

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
     

18 Sep, 2019

1 commit

  • Pull core timer updates from Thomas Gleixner:
    "Timers and timekeeping updates:

    - A large overhaul of the posix CPU timer code which is a preparation
    for moving the CPU timer expiry out into task work so it can be
    properly accounted on the task/process.

    An update to the bogus permission checks will come later during the
    merge window as feedback was not complete before heading of for
    travel.

    - Switch the timerqueue code to use cached rbtrees and get rid of the
    homebrewn caching of the leftmost node.

    - Consolidate hrtimer_init() + hrtimer_init_sleeper() calls into a
    single function

    - Implement the separation of hrtimers to be forced to expire in hard
    interrupt context even when PREEMPT_RT is enabled and mark the
    affected timers accordingly.

    - Implement a mechanism for hrtimers and the timer wheel to protect
    RT against priority inversion and live lock issues when a (hr)timer
    which should be canceled is currently executing the callback.
    Instead of infinitely spinning, the task which tries to cancel the
    timer blocks on a per cpu base expiry lock which is held and
    released by the (hr)timer expiry code.

    - Enable the Hyper-V TSC page based sched_clock for Hyper-V guests
    resulting in faster access to timekeeping functions.

    - Updates to various clocksource/clockevent drivers and their device
    tree bindings.

    - The usual small improvements all over the place"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (101 commits)
    posix-cpu-timers: Fix permission check regression
    posix-cpu-timers: Always clear head pointer on dequeue
    hrtimer: Add a missing bracket and hide `migration_base' on !SMP
    posix-cpu-timers: Make expiry_active check actually work correctly
    posix-timers: Unbreak CONFIG_POSIX_TIMERS=n build
    tick: Mark sched_timer to expire in hard interrupt context
    hrtimer: Add kernel doc annotation for HRTIMER_MODE_HARD
    x86/hyperv: Hide pv_ops access for CONFIG_PARAVIRT=n
    posix-cpu-timers: Utilize timerqueue for storage
    posix-cpu-timers: Move state tracking to struct posix_cputimers
    posix-cpu-timers: Deduplicate rlimit handling
    posix-cpu-timers: Remove pointless comparisons
    posix-cpu-timers: Get rid of 64bit divisions
    posix-cpu-timers: Consolidate timer expiry further
    posix-cpu-timers: Get rid of zero checks
    rlimit: Rewrite non-sensical RLIMIT_CPU comment
    posix-cpu-timers: Respect INFINITY for hard RTTIME limit
    posix-cpu-timers: Switch thread group sampling to array
    posix-cpu-timers: Restructure expiry array
    posix-cpu-timers: Remove cputime_expires
    ...

    Linus Torvalds
     

17 Sep, 2019

1 commit


07 Sep, 2019

8 commits

  • When the host re-offers the primary channels upon resume, the host only
    guarantees the Instance GUID doesn't change, so vmbus_bus_suspend()
    should invalidate channel->offermsg.child_relid and figure out the
    number of primary channels that need to be fixed up upon resume.

    Upon resume, vmbus_onoffer() finds the old channel structs, and maps
    the new offers to the old channels, and fixes up the old structs,
    and finally the resume callbacks of the VSC drivers will re-open
    the channels.

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

    Dexuan Cui
     
  • Before suspend, Linux must make sure all the hv_sock channels have been
    properly cleaned up, because a hv_sock connection can not persist across
    hibernation, and the user-space app must be properly notified of the
    state change of the connection.

    Before suspend, Linux also must make sure all the sub-channels have been
    destroyed, i.e. the related channel structs of the sub-channels must be
    properly removed, otherwise they would cause a conflict when the
    sub-channels are recreated upon resume.

    Add a counter to track such channels, and vmbus_bus_suspend() should wait
    for the counter to drop to zero.

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

    Dexuan Cui
     
  • Fake RESCIND_CHANNEL messages to clean up hv_sock channels by force for
    hibernation. There is no better method to clean up the channels since
    some of the channels may still be referenced by the userspace apps when
    hibernation is triggered: in this case, with this patch, the "rescind"
    fields of the channels are set, and the apps will thoroughly destroy
    the channels after hibernation.

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

    Dexuan Cui
     
  • Before Linux enters hibernation, it sends the CHANNELMSG_UNLOAD message to
    the host so all the offers are gone. After hibernation, Linux needs to
    re-negotiate with the host using the same vmbus protocol version (which
    was in use before hibernation), and ask the host to re-offer the vmbus
    devices.

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

    Dexuan Cui
     
  • When the VM resumes, the host re-sends the offers. We should not add the
    offers to the global vmbus_connection.chn_list again.

    This patch assumes the RELIDs of the channels don't change across
    hibernation. Actually this is not always true, especially in the case of
    NIC SR-IOV the VF vmbus device's RELID sometimes can change. A later patch
    will address this issue by mapping the new offers to the old channels and
    fixing up the old channels, if necessary.

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

    Dexuan Cui
     
  • The high-level VSC drivers will implement device-specific callbacks.

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

    Dexuan Cui
     
  • This is needed when we resume the old kernel from the "current" kernel.

    Note: when hv_synic_suspend() and hv_synic_resume() run, all the
    non-boot CPUs have been offlined, and interrupts are disabled on CPU0.

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

    Dexuan Cui
     
  • Break out synic enable and disable operations into separate
    hv_synic_disable_regs() and hv_synic_enable_regs() functions for use by a
    later patch to support hibernation.

    There is no functional change except the unnecessary check
    "if (sctrl.enable != 1) return -EFAULT;" which is removed, because when
    we're in hv_synic_cleanup(), we're absolutely sure sctrl.enable must be 1.

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

    Dexuan Cui
     

23 Aug, 2019

1 commit

  • There is no particular reason to not enable TSC page clocksource on
    32-bit. mul_u64_u64_shr() is available and despite the increased
    computational complexity (compared to 64bit) TSC page is still a huge win
    compared to MSR-based clocksource.

    In-kernel reads:
    MSR based clocksource: 3361 cycles
    TSC page clocksource: 49 cycles

    Reads from userspace (utilizing vDSO in case of TSC page):
    MSR based clocksource: 5664 cycles
    TSC page clocksource: 131 cycles

    Enabling TSC page on 32bits allows to get rid of CONFIG_HYPERV_TSCPAGE as
    it is now not any different from CONFIG_HYPERV_TIMER.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Michael Kelley
    Link: https://lkml.kernel.org/r/20190822083630.17059-1-vkuznets@redhat.com

    Vitaly Kuznetsov
     

21 Aug, 2019

1 commit

  • In the case of X86_PAE, unsigned long is u32, but the physical address type
    should be u64. Due to the bug here, the netvsc driver can not load
    successfully, and sometimes the VM can panic due to memory corruption (the
    hypervisor writes data to the wrong location).

    Fixes: 6ba34171bcbd ("Drivers: hv: vmbus: Remove use of slow_virt_to_phys()")
    Cc: stable@vger.kernel.org
    Cc: Michael Kelley
    Reported-and-tested-by: Juliana Rodrigueiro
    Signed-off-by: Dexuan Cui
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Dexuan Cui
     

20 Aug, 2019

1 commit

  • This field is no longer used after the commit
    63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code")
    , because it's replaced by the global variable
    "struct ms_hyperv_tsc_page *tsc_pg;" (now, the variable is in
    drivers/clocksource/hyperv_timer.c).

    Fixes: 63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code")
    Signed-off-by: Dexuan Cui
    Signed-off-by: Sasha Levin

    Dexuan Cui
     

18 Aug, 2019

1 commit

  • This patch corrects the SPDX License Identifier style
    in the trace header file related to Microsoft Hyper-V
    client drivers.
    For C header files Documentation/process/license-rules.rst
    mandates C-like comments (opposed to C source files where
    C++ style should be used)

    Changes made by using a script provided by Joe Perches here:
    https://lkml.org/lkml/2019/2/7/46

    Suggested-by: Joe Perches
    Signed-off-by: Nishad Kamdar
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Nishad Kamdar
     

31 Jul, 2019

2 commits


22 Jul, 2019

1 commit

  • Replace PAGE_SIZE with HV_HYP_PAGE_SIZE because the guest page size may not
    be 4096 on all architectures and Hyper-V always runs with a page size of
    4096.

    Signed-off-by: Maya Nakamura
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Michael Kelley
    Reviewed-by: Vitaly Kuznetsov
    Acked-by: Sasha Levin
    Link: https://lkml.kernel.org/r/0d9e80ecabcc950dc279fdd2e39bea4060123ba4.1562916939.git.m.maya.nakamura@gmail.com

    Maya Nakamura
     

19 Jul, 2019

1 commit

  • In the sysctl code the proc_dointvec_minmax() function is often used to
    validate the user supplied value between an allowed range. This
    function uses the extra1 and extra2 members from struct ctl_table as
    minimum and maximum allowed value.

    On sysctl handler declaration, in every source file there are some
    readonly variables containing just an integer which address is assigned
    to the extra1 and extra2 members, so the sysctl range is enforced.

    The special values 0, 1 and INT_MAX are very often used as range
    boundary, leading duplication of variables like zero=0, one=1,
    int_max=INT_MAX in different source files:

    $ git grep -E '\.extra[12].*&(zero|one|int_max)' |wc -l
    248

    Add a const int array containing the most commonly used values, some
    macros to refer more easily to the correct array member, and use them
    instead of creating a local one for every object file.

    This is the bloat-o-meter output comparing the old and new binary
    compiled with the default Fedora config:

    # scripts/bloat-o-meter -d vmlinux.o.old vmlinux.o
    add/remove: 2/2 grow/shrink: 0/2 up/down: 24/-188 (-164)
    Data old new delta
    sysctl_vals - 12 +12
    __kstrtab_sysctl_vals - 12 +12
    max 14 10 -4
    int_max 16 - -16
    one 68 - -68
    zero 128 28 -100
    Total: Before=20583249, After=20583085, chg -0.00%

    [mcroce@redhat.com: tipc: remove two unused variables]
    Link: http://lkml.kernel.org/r/20190530091952.4108-1-mcroce@redhat.com
    [akpm@linux-foundation.org: fix net/ipv6/sysctl_net_ipv6.c]
    [arnd@arndb.de: proc/sysctl: make firmware loader table conditional]
    Link: http://lkml.kernel.org/r/20190617130014.1713870-1-arnd@arndb.de
    [akpm@linux-foundation.org: fix fs/eventpoll.c]
    Link: http://lkml.kernel.org/r/20190430180111.10688-1-mcroce@redhat.com
    Signed-off-by: Matteo Croce
    Signed-off-by: Arnd Bergmann
    Acked-by: Kees Cook
    Reviewed-by: Aaron Tomlin
    Cc: Matthew Wilcox
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matteo Croce
     

13 Jul, 2019

1 commit


09 Jul, 2019

1 commit

  • Pull x86 platform updayes from Ingo Molnar:
    "Most of the commits add ACRN hypervisor guest support, plus two
    cleanups"

    * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/jailhouse: Mark jailhouse_x2apic_available() as __init
    x86/platform/geode: Drop includes
    x86/acrn: Use HYPERVISOR_CALLBACK_VECTOR for ACRN guest upcall vector
    x86: Add support for Linux guests on an ACRN hypervisor
    x86/Kconfig: Add new X86_HV_CALLBACK_VECTOR config symbol

    Linus Torvalds
     

03 Jul, 2019

2 commits

  • Continue consolidating Hyper-V clock and timer code into an ISA
    independent Hyper-V clocksource driver.

    Move the existing clocksource code under drivers/hv and arch/x86 to the new
    clocksource driver while separating out the ISA dependencies. Update
    Hyper-V initialization to call initialization and cleanup routines since
    the Hyper-V synthetic clock is not independently enumerated in ACPI.

    Update Hyper-V clocksource users in KVM and VDSO to get definitions from
    the new include file.

    No behavior is changed and no new functionality is added.

    Suggested-by: Marc Zyngier
    Signed-off-by: Michael Kelley
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Vitaly Kuznetsov
    Cc: "bp@alien8.de"
    Cc: "will.deacon@arm.com"
    Cc: "catalin.marinas@arm.com"
    Cc: "mark.rutland@arm.com"
    Cc: "linux-arm-kernel@lists.infradead.org"
    Cc: "gregkh@linuxfoundation.org"
    Cc: "linux-hyperv@vger.kernel.org"
    Cc: "olaf@aepfle.de"
    Cc: "apw@canonical.com"
    Cc: "jasowang@redhat.com"
    Cc: "marcelo.cerri@canonical.com"
    Cc: Sunil Muthuswamy
    Cc: KY Srinivasan
    Cc: "sashal@kernel.org"
    Cc: "vincenzo.frascino@arm.com"
    Cc: "linux-arch@vger.kernel.org"
    Cc: "linux-mips@vger.kernel.org"
    Cc: "linux-kselftest@vger.kernel.org"
    Cc: "arnd@arndb.de"
    Cc: "linux@armlinux.org.uk"
    Cc: "ralf@linux-mips.org"
    Cc: "paul.burton@mips.com"
    Cc: "daniel.lezcano@linaro.org"
    Cc: "salyzyn@android.com"
    Cc: "pcc@google.com"
    Cc: "shuah@kernel.org"
    Cc: "0x7f454c46@gmail.com"
    Cc: "linux@rasmusvillemoes.dk"
    Cc: "huw@codeweavers.com"
    Cc: "sfr@canb.auug.org.au"
    Cc: "pbonzini@redhat.com"
    Cc: "rkrcmar@redhat.com"
    Cc: "kvm@vger.kernel.org"
    Link: https://lkml.kernel.org/r/1561955054-1838-3-git-send-email-mikelley@microsoft.com

    Michael Kelley
     
  • Hyper-V clock/timer code and data structures are currently mixed
    in with other code in the ISA independent drivers/hv directory as
    well as the ISA dependent Hyper-V code under arch/x86.

    Consolidate this code and data structures into a Hyper-V clocksource driver
    to better follow the Linux model. In doing so, separate out the ISA
    dependent portions so the new clocksource driver works for x86 and for the
    in-process Hyper-V on ARM64 code.

    To start, move the existing clockevents code to create the new clocksource
    driver. Update the VMbus driver to call initialization and cleanup routines
    since the Hyper-V synthetic timers are not independently enumerated in
    ACPI.

    No behavior is changed and no new functionality is added.

    Suggested-by: Marc Zyngier
    Signed-off-by: Michael Kelley
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Vitaly Kuznetsov
    Cc: "bp@alien8.de"
    Cc: "will.deacon@arm.com"
    Cc: "catalin.marinas@arm.com"
    Cc: "mark.rutland@arm.com"
    Cc: "linux-arm-kernel@lists.infradead.org"
    Cc: "gregkh@linuxfoundation.org"
    Cc: "linux-hyperv@vger.kernel.org"
    Cc: "olaf@aepfle.de"
    Cc: "apw@canonical.com"
    Cc: "jasowang@redhat.com"
    Cc: "marcelo.cerri@canonical.com"
    Cc: Sunil Muthuswamy
    Cc: KY Srinivasan
    Cc: "sashal@kernel.org"
    Cc: "vincenzo.frascino@arm.com"
    Cc: "linux-arch@vger.kernel.org"
    Cc: "linux-mips@vger.kernel.org"
    Cc: "linux-kselftest@vger.kernel.org"
    Cc: "arnd@arndb.de"
    Cc: "linux@armlinux.org.uk"
    Cc: "ralf@linux-mips.org"
    Cc: "paul.burton@mips.com"
    Cc: "daniel.lezcano@linaro.org"
    Cc: "salyzyn@android.com"
    Cc: "pcc@google.com"
    Cc: "shuah@kernel.org"
    Cc: "0x7f454c46@gmail.com"
    Cc: "linux@rasmusvillemoes.dk"
    Cc: "huw@codeweavers.com"
    Cc: "sfr@canb.auug.org.au"
    Cc: "pbonzini@redhat.com"
    Cc: "rkrcmar@redhat.com"
    Cc: "kvm@vger.kernel.org"
    Link: https://lkml.kernel.org/r/1561955054-1838-2-git-send-email-mikelley@microsoft.com

    Michael Kelley
     

24 Jun, 2019

1 commit


12 Jun, 2019

1 commit

  • Add a special Kconfig symbol X86_HV_CALLBACK_VECTOR so that the guests
    using the hypervisor interrupt callback counter can select and thus
    enable that counter. Select it when xen or hyperv support is enabled. No
    functional changes.

    Signed-off-by: Zhao Yakui
    Signed-off-by: Borislav Petkov
    Reviewed-by: Borislav Petkov
    Reviewed-by: Thomas Gleixner
    Cc: Boris Ostrovsky
    Cc: Frederic Weisbecker
    Cc: Haiyang Zhang
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Juergen Gross
    Cc: "K. Y. Srinivasan"
    Cc: linux-hyperv@vger.kernel.org
    Cc: Nicolai Stange
    Cc: Paolo Bonzini
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Cc: Stefano Stabellini
    Cc: Stephen Hemminger
    Cc: Thomas Gleixner
    Cc: x86-ml
    Cc: xen-devel@lists.xenproject.org
    Link: https://lkml.kernel.org/r/1559108037-18813-2-git-send-email-yakui.zhao@intel.com

    Zhao Yakui
     

05 Jun, 2019

2 commits

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 59 temple place suite 330 boston ma 02111
    1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 33 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000435.254582722@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose good title or non infringement see
    the gnu general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 9 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141900.459653302@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

13 Apr, 2019

1 commit


11 Apr, 2019

3 commits

  • Fix a race condition that can result in a ring buffer pointer being set
    to null while a "_show" function is reading the ring buffer's data. This
    problem was discussed here: https://lkml.org/lkml/2018/10/18/779

    To fix the race condition, add a new mutex lock to the
    "hv_ring_buffer_info" struct. Add a new function,
    "hv_ringbuffer_pre_init()", where a channel's inbound and outbound
    ring_buffer_info mutex locks are initialized.

    Acquire/release the locks in the "hv_ringbuffer_cleanup()" function,
    which is where the ring buffer pointers are set to null.

    Acquire/release the locks in the four channel-level "_show" functions
    that access ring buffer data. Remove the "const" qualifier from the
    "vmbus_channel" parameter and the "rbi" variable of the channel-level
    "_show" functions so that the locks can be acquired/released in these
    functions.

    Acquire/release the locks in hv_ringbuffer_get_debuginfo(). Remove the
    "const" qualifier from the "hv_ring_buffer_info" parameter so that the
    locks can be acquired/released in this function.

    Signed-off-by: Kimberly Brown
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Kimberly Brown
     
  • Set "ring_info->priv_read_index" to 0. Now, all of ring_info's fields
    are explicitly set in this function. The memset() call is no longer
    necessary, so remove it.

    Signed-off-by: Kimberly Brown
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Kimberly Brown
     
  • The chan->state "if statement" was introduced in commit 6712cc9c2211
    ("vmbus: don't return values for uninitalized channels"). That commit
    states that the purpose of the chan->state "if statement" is to prevent
    returning garbage or causing a kernel OOPS when the channel ring buffer
    is not initialized. The changes in this patch provide the same
    protection.

    Refactor the chan->state “if statement” in vmbus_chan_attr_show():
    - Instead of checking the channel state in the "if statement", check
    whether the channel ring buffer pointer is NULL. Checking the
    ring buffer pointer makes this code consistent with
    hv_ringbuffer_get_debuginfo().

    - Move the "if statement" to the four "_show" functions that access a
    channel ring buffer. Only four of the channel-level "_show" functions
    access a ring buffer. The ring buffer pointer does not need to be
    checked before calling the other "_show" functions, and moving the
    ring buffer pointer "if statement" to the "_show" functions that
    access a ring buffer makes the purpose of the "if statement" clear.

    Signed-off-by: Kimberly Brown
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Kimberly Brown
     

21 Mar, 2019

1 commit

  • There are two methods for signaling the host: the monitor page mechanism
    and hypercalls. The monitor page mechanism is used by performance
    critical channels (storage, networking, etc.) because it provides
    improved throughput. However, latency is increased. Monitor pages are
    allocated to these channels.

    Monitor pages are not allocated to channels that do not use the monitor
    page mechanism. Therefore, these channels do not have a valid monitor id
    or valid monitor page data. In these cases, some of the "_show"
    functions return incorrect data. They return an invalid monitor id and
    data that is beyond the bounds of the hv_monitor_page array fields.

    The "channel->offermsg.monitor_allocated" value can be used to determine
    whether monitor pages have been allocated to a channel.

    Add "is_visible()" callback functions for the device-level and
    channel-level attribute groups. These functions will hide the monitor
    sysfs files when the monitor mechanism is not used.

    Remove ".default_attributes" from "vmbus_chan_attrs" and create a
    channel-level attribute group. These changes allow the new
    "is_visible()" callback function to be applied to the channel-level
    attributes.

    Call "sysfs_create_group()" in "vmbus_add_channel_kobj()" to create the
    channel's sysfs files. Add a new function,
    “vmbus_remove_channel_attr_group()”, and call it in "free_channel()" to
    remove the channel's sysfs files when the channel is closed.

    Signed-off-by: Kimberly Brown
    Reviewed-by: Greg Kroah-Hartman
    Reviewed-by: Michael Kelley
    Signed-off-by: Sasha Levin

    Kimberly Brown
     

07 Mar, 2019

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here is the big char/misc driver patch pull request for 5.1-rc1.

    The largest thing by far is the new habanalabs driver for their AI
    accelerator chip. For now it is in the drivers/misc directory but will
    probably move to a new directory soon along with other drivers of this
    type.

    Other than that, just the usual set of individual driver updates and
    fixes. There's an "odd" merge in here from the DRM tree that they
    asked me to do as the MEI driver is starting to interact with the i915
    driver, and it needed some coordination. All of those patches have
    been properly acked by the relevant subsystem maintainers.

    All of these have been in linux-next with no reported issues, most for
    quite some time"

    * tag 'char-misc-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (219 commits)
    habanalabs: adjust Kconfig to fix build errors
    habanalabs: use %px instead of %p in error print
    habanalabs: use do_div for 64-bit divisions
    intel_th: gth: Fix an off-by-one in output unassigning
    habanalabs: fix little-endiancpu conversion warnings
    habanalabs: use NULL to initialize array of pointers
    habanalabs: fix little-endiancpu conversion warnings
    habanalabs: soft-reset device if context-switch fails
    habanalabs: print pointer using %p
    habanalabs: fix memory leak with CBs with unaligned size
    habanalabs: return correct error code on MMU mapping failure
    habanalabs: add comments in uapi/misc/habanalabs.h
    habanalabs: extend QMAN0 job timeout
    habanalabs: set DMA0 completion to SOB 1007
    habanalabs: fix validation of WREG32 to DMA completion
    habanalabs: fix mmu cache registers init
    habanalabs: disable CPU access on timeouts
    habanalabs: add MMU DRAM default page mapping
    habanalabs: Dissociate RAZWI info from event types
    misc/habanalabs: adjust Kconfig to fix build errors
    ...

    Linus Torvalds
     

06 Mar, 2019

2 commits

  • Mark inflated and never onlined pages PG_offline, to tell the world that
    the content is stale and should not be dumped.

    Link: http://lkml.kernel.org/r/20181119101616.8901-6-david@redhat.com
    Signed-off-by: David Hildenbrand
    Acked-by: Pankaj gupta
    Cc: "K. Y. Srinivasan"
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Cc: Kairui Song
    Cc: Vitaly Kuznetsov
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: "Michael S. Tsirkin"
    Cc: Alexander Duyck
    Cc: Alexey Dobriyan
    Cc: Arnd Bergmann
    Cc: Baoquan He
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Christian Hansen
    Cc: Dave Young
    Cc: David Rientjes
    Cc: Greg Kroah-Hartman
    Cc: Jonathan Corbet
    Cc: Juergen Gross
    Cc: Julien Freche
    Cc: Kazuhito Hagio
    Cc: "Kirill A. Shutemov"
    Cc: Konstantin Khlebnikov
    Cc: Len Brown
    Cc: Lianbo Jiang
    Cc: Michal Hocko
    Cc: Mike Rapoport
    Cc: Miles Chen
    Cc: Nadav Amit
    Cc: Naoya Horiguchi
    Cc: Omar Sandoval
    Cc: Pavel Machek
    Cc: Pavel Tatashin
    Cc: Rafael J. Wysocki
    Cc: "Rafael J. Wysocki"
    Cc: Stefano Stabellini
    Cc: Stephen Rothwell
    Cc: Vlastimil Babka
    Cc: Xavier Deguillard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Hildenbrand
     
  • When freeing pages are done with higher order, time spent on coalescing
    pages by buddy allocator can be reduced. With section size of 256MB,
    hot add latency of a single section shows improvement from 50-60 ms to
    less than 1 ms, hence improving the hot add latency by 60 times. Modify
    external providers of online callback to align with the change.

    [arunks@codeaurora.org: v11]
    Link: http://lkml.kernel.org/r/1547792588-18032-1-git-send-email-arunks@codeaurora.org
    [akpm@linux-foundation.org: remove unused local, per Arun]
    [akpm@linux-foundation.org: avoid return of void-returning __free_pages_core(), per Oscar]
    [akpm@linux-foundation.org: fix it for mm-convert-totalram_pages-and-totalhigh_pages-variables-to-atomic.patch]
    [arunks@codeaurora.org: v8]
    Link: http://lkml.kernel.org/r/1547032395-24582-1-git-send-email-arunks@codeaurora.org
    [arunks@codeaurora.org: v9]
    Link: http://lkml.kernel.org/r/1547098543-26452-1-git-send-email-arunks@codeaurora.org
    Link: http://lkml.kernel.org/r/1538727006-5727-1-git-send-email-arunks@codeaurora.org
    Signed-off-by: Arun KS
    Reviewed-by: Andrew Morton
    Acked-by: Michal Hocko
    Reviewed-by: Oscar Salvador
    Reviewed-by: Alexander Duyck
    Cc: K. Y. Srinivasan
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Cc: Boris Ostrovsky
    Cc: Juergen Gross
    Cc: Dan Williams
    Cc: Vlastimil Babka
    Cc: Joonsoo Kim
    Cc: Greg Kroah-Hartman
    Cc: Mathieu Malaterre
    Cc: "Kirill A. Shutemov"
    Cc: Souptick Joarder
    Cc: Mel Gorman
    Cc: Aaron Lu
    Cc: Srivatsa Vaddagiri
    Cc: Vinayak Menon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun KS
     

01 Mar, 2019

1 commit

  • …hyperv/linux into char-misc-next

    Sasha writes:

    1. Exopsing counters for state changes of channel ring buffers; this is
    useful to investigate performance issues. By Kimberly Brown.

    2. Switching to the new generic UUID API, by Andy Shevchenko.

    * tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
    Drivers: hv: vmbus: Expose counters for interrupts and full conditions
    vmbus: Switch to use new generic UUID API

    Greg Kroah-Hartman
     

23 Feb, 2019

1 commit

  • Change the monitor_pages index in server_monitor_pending_show() to '0'.
    '0' is the correct monitor_pages index for the server. A comment for the
    monitor_pages field in the vmbus_connection struct definition indicates
    that the 1st page is for parent->child notifications. In addition, the
    server_monitor_latency_show() and server_monitor_conn_id_show()
    functions use monitor_pages index '0'.

    Signed-off-by: Kimberly Brown
    Acked-by: Stephen Hemminger
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Kimberly Brown