1. 25 Nov, 2019 3 commits
  2. 16 Nov, 2019 32 commits
  3. 12 Nov, 2019 5 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.9.201 · 9829ecfd
      Greg Kroah-Hartman authored
      9829ecfd
    • Ben Hutchings's avatar
      drm/i915/cmdparser: Fix jump whitelist clearing · 139bb57b
      Ben Hutchings authored
      commit ea0b163b upstream.
      
      When a jump_whitelist bitmap is reused, it needs to be cleared.
      Currently this is done with memset() and the size calculation assumes
      bitmaps are made of 32-bit words, not longs.  So on 64-bit
      architectures, only the first half of the bitmap is cleared.
      
      If some whitelist bits are carried over between successive batches
      submitted on the same context, this will presumably allow embedding
      the rogue instructions that we're trying to reject.
      
      Use bitmap_zero() instead, which gets the calculation right.
      
      Fixes: f8c08d8f ("drm/i915/cmdparser: Add support for backward jumps")
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarJon Bloomfield <jon.bloomfield@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      139bb57b
    • Imre Deak's avatar
      drm/i915/gen8+: Add RC6 CTX corruption WA · 00194ecf
      Imre Deak authored
      commit 7e34f4e4 upstream.
      
      In some circumstances the RC6 context can get corrupted. We can detect
      this and take the required action, that is disable RC6 and runtime PM.
      The HW recovers from the corrupted state after a system suspend/resume
      cycle, so detect the recovery and re-enable RC6 and runtime PM.
      
      v2: rebase (Mika)
      v3:
      - Move intel_suspend_gt_powersave() to the end of the GEM suspend
        sequence.
      - Add commit message.
      v4:
      - Rebased on intel_uncore_forcewake_put(i915->uncore, ...) API
        change.
      v5:
      - Rebased on latest upstream gt_pm refactoring.
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      00194ecf
    • Uma Shankar's avatar
      drm/i915: Lower RM timeout to avoid DSI hard hangs · ebd6ded1
      Uma Shankar authored
      commit 1d85a299 upstream.
      
      In BXT/APL, device 2 MMIO reads from MIPI controller requires its PLL
      to be turned ON. When MIPI PLL is turned off (MIPI Display is not
      active or connected), and someone (host or GT engine) tries to read
      MIPI registers, it causes hard hang. This is a hardware restriction
      or limitation.
      
      Driver by itself doesn't read MIPI registers when MIPI display is off.
      But any userspace application can submit unprivileged batch buffer for
      execution. In that batch buffer there can be mmio reads. And these
      reads are allowed even for unprivileged applications. If these
      register reads are for MIPI DSI controller and MIPI display is not
      active during that time, then the MMIO read operation causes system
      hard hang and only way to recover is hard reboot. A genuine
      process/application won't submit batch buffer like this and doesn't
      cause any issue. But on a compromised system, a malign userspace
      process/app can generate such batch buffer and can trigger system
      hard hang (denial of service attack).
      
      The fix is to lower the internal MMIO timeout value to an optimum
      value of 950us as recommended by hardware team. If the timeout is
      beyond 1ms (which will hit for any value we choose if MMIO READ on a
      DSI specific register is performed without PLL ON), it causes the
      system hang. But if the timeout value is lower than it will be below
      the threshold (even if timeout happens) and system will not get into
      a hung state. This will avoid a system hang without losing any
      programming or GT interrupts, taking the worst case of lowest CDCLK
      frequency and early DC5 abort into account.
      Signed-off-by: default avatarUma Shankar <uma.shankar@intel.com>
      Reviewed-by: default avatarJon Bloomfield <jon.bloomfield@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ebd6ded1
    • Jon Bloomfield's avatar
      drm/i915/cmdparser: Ignore Length operands during command matching · bd671d06
      Jon Bloomfield authored
      commit 926abff2 upstream.
      
      Some of the gen instruction macros (e.g. MI_DISPLAY_FLIP) have the
      length directly encoded in them. Since these are used directly in
      the tables, the Length becomes part of the comparison used for
      matching during parsing. Thus, if the cmd being parsed has a
      different length to that in the table, it is not matched and the
      cmd is accepted via the default variable length path.
      
      Fix by masking out everything except the Opcode in the cmd tables
      
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Signed-off-by: default avatarJon Bloomfield <jon.bloomfield@intel.com>
      Reviewed-by: default avatarChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bd671d06