Skip to content
  • Sean Christopherson's avatar
    mm/mmu_notifiers: ensure range_end() is paired with range_start() · c2655835
    Sean Christopherson authored
    If one or more notifiers fails .invalidate_range_start(), invoke
    .invalidate_range_end() for "all" notifiers.  If there are multiple
    notifiers, those that did not fail are expecting _start() and _end() to
    be paired, e.g.  KVM's mmu_notifier_count would become imbalanced.
    Disallow notifiers that can fail _start() from implementing _end() so
    that it's unnecessary to either track which notifiers rejected _start(),
    or had already succeeded prior to a failed _start().
    
    Note, the existing behavior of calling _start() on all notifiers even
    after a previous notifier failed _start() was an unintented "feature".
    Make it canon now that the behavior is depended on for correctness.
    
    As of today, the bug is likely benign:
    
      1. The only caller of the non-blocking notifier is OOM kill.
      2. The only notifiers that can fail _start() are the i915 and Nouveau
         drivers.
      3. The only notifiers that utilize _end() are the SGI UV GRU driver
         and KVM.
      ...
    c2655835