1. 13 11月, 2019 15 次提交
    • I
      drm/i915/gen8+: Add RC6 CTX corruption WA · 255ed515
      Imre Deak 提交于
      commit 7e34f4e4aad3fd34c02b294a3cf2321adf5b4438 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 gem/gt split (Mika)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      255ed515
    • U
      drm/i915: Lower RM timeout to avoid DSI hard hangs · 011b7173
      Uma Shankar 提交于
      commit 1d85a299c4db57c55e0229615132c964d17aa765 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: NUma Shankar <uma.shankar@intel.com>
      Reviewed-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      011b7173
    • J
      drm/i915/cmdparser: Ignore Length operands during command matching · a7bda639
      Jon Bloomfield 提交于
      commit 926abff21a8f29ef159a3ac893b05c6e50e043c3 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: NJon Bloomfield <jon.bloomfield@intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a7bda639
    • J
      drm/i915/cmdparser: Add support for backward jumps · 6e53c71a
      Jon Bloomfield 提交于
      commit f8c08d8faee5567803c8c533865296ca30286bbf upstream.
      
      To keep things manageable, the pre-gen9 cmdparser does not
      attempt to track any form of nested BB_START's. This did not
      prevent usermode from using nested starts, or even chained
      batches because the cmdparser is not strictly enforced pre gen9.
      
      Instead, the existence of a nested BB_START would cause the batch
      to be emitted in insecure mode, and any privileged capabilities
      would not be available.
      
      For Gen9, the cmdparser becomes mandatory (for BCS at least), and
      so not providing any form of nested BB_START support becomes
      overly restrictive. Any such batch will simply not run.
      
      We make heavy use of backward jumps in igt, and it is much easier
      to add support for this restricted subset of nested jumps, than to
      rewrite the whole of our test suite to avoid them.
      
      Add the required logic to support limited backward jumps, to
      instructions that have already been validated by the parser.
      
      Note that it's not sufficient to simply approve any BB_START
      that jumps backwards in the buffer because this would allow an
      attacker to embed a rogue instruction sequence within the
      operand words of a harmless instruction (say LRI) and jump to
      that.
      
      We introduce a bit array to track every instr offset successfully
      validated, and test the target of BB_START against this. If the
      target offset hits, it is re-written to the same offset in the
      shadow buffer and the BB_START cmd is allowed.
      
      Note: This patch deliberately ignores checkpatch issues in the
      cmdtables, in order to match the style of the surrounding code.
      We'll correct the entire file in one go in a later patch.
      
      v2: set dispatch secure late (Mika)
      v3: rebase (Mika)
      v4: Clear whitelist on each parse
      Minor review updates (Chris)
      v5: Correct backward jump batching
      v6: fix compilation error due to struct eb shuffle (Mika)
      
      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: NJon Bloomfield <jon.bloomfield@intel.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e53c71a
    • J
      drm/i915/cmdparser: Use explicit goto for error paths · f27bc2b5
      Jon Bloomfield 提交于
      commit 0546a29cd884fb8184731c79ab008927ca8859d0 upstream.
      
      In the next patch we will be adding a second valid
      termination condition which will require a small
      amount of refactoring to share logic with the BB_END
      case.
      
      Refactor all error conditions to jump to a dedicated
      exit path, with 'break' reserved only for a successful
      parse.
      
      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: NJon Bloomfield <jon.bloomfield@intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f27bc2b5
    • J
      drm/i915: Add gen9 BCS cmdparsing · cdd77c6b
      Jon Bloomfield 提交于
      commit 0f2f39758341df70202ae1c42d5a1e4ee392b6d3 upstream.
      
      For gen9 we enable cmdparsing on the BCS ring, specifically
      to catch inadvertent accesses to sensitive registers
      
      Unlike gen7/hsw, we use the parser only to block certain
      registers. We can rely on h/w to block restricted commands,
      so the command tables only provide enough info to allow the
      parser to delineate each command, and identify commands that
      access registers.
      
      Note: This patch deliberately ignores checkpatch issues in
      favour of matching the style of the surrounding code. We'll
      correct the entire file in one go in a later patch.
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      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: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cdd77c6b
    • J
      drm/i915: Allow parsing of unsized batches · fea688c5
      Jon Bloomfield 提交于
      commit 435e8fc059dbe0eec823a75c22da2972390ba9e0 upstream.
      
      In "drm/i915: Add support for mandatory cmdparsing" we introduced the
      concept of mandatory parsing. This allows the cmdparser to be invoked
      even when user passes batch_len=0 to the execbuf ioctl's.
      
      However, the cmdparser needs to know the extents of the buffer being
      scanned. Refactor the code to ensure the cmdparser uses the actual
      object size, instead of the incoming length, if user passes 0.
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      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>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fea688c5
    • J
      drm/i915: Support ro ppgtt mapped cmdparser shadow buffers · 7ce726b6
      Jon Bloomfield 提交于
      commit 4f7af1948abcb18b4772fe1bcd84d7d27d96258c upstream.
      
      For Gen7, the original cmdparser motive was to permit limited
      use of register read/write instructions in unprivileged BB's.
      This worked by copying the user supplied bb to a kmd owned
      bb, and running it in secure mode, from the ggtt, only if
      the scanner finds no unsafe commands or registers.
      
      For Gen8+ we can't use this same technique because running bb's
      from the ggtt also disables access to ppgtt space. But we also
      do not actually require 'secure' execution since we are only
      trying to reduce the available command/register set. Instead we
      will copy the user buffer to a kmd owned read-only bb in ppgtt,
      and run in the usual non-secure mode.
      
      Note that ro pages are only supported by ppgtt (not ggtt), but
      luckily that's exactly what we need.
      
      Add the required paths to map the shadow buffer to ppgtt ro for Gen8+
      
      v2: IS_GEN7/IS_GEN (Mika)
      v3: rebase
      v4: rebase
      v5: rebase
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      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: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7ce726b6
    • J
      drm/i915: Add support for mandatory cmdparsing · fc3510fe
      Jon Bloomfield 提交于
      commit 311a50e76a33d1e029563c24b2ff6db0c02b5afe upstream.
      
      The existing cmdparser for gen7 can be bypassed by specifying
      batch_len=0 in the execbuf call. This is safe because bypassing
      simply reduces the cmd-set available.
      
      In a later patch we will introduce cmdparsing for gen9, as a
      security measure, which must be strictly enforced since without
      it we are vulnerable to DoS attacks.
      
      Introduce the concept of 'required' cmd parsing that cannot be
      bypassed by submitting zero-length bb's.
      
      v2: rebase (Mika)
      v2: rebase (Mika)
      v3: fix conflict on engine flags (Mika)
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      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: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fc3510fe
    • J
      drm/i915: Remove Master tables from cmdparser · fba4207c
      Jon Bloomfield 提交于
      commit 66d8aba1cd6db34af10de465c0d52af679288cb6 upstream.
      
      The previous patch has killed support for secure batches
      on gen6+, and hence the cmdparsers master tables are
      now dead code. Remove them.
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      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>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fba4207c
    • J
      drm/i915: Disable Secure Batches for gen6+ · f1ff7708
      Jon Bloomfield 提交于
      commit 44157641d448cbc0c4b73c5231d2b911f0cb0427 upstream.
      
      Retroactively stop reporting support for secure batches
      through the api for gen6+ so that older binaries trigger
      the fallback path instead.
      
      Older binaries use secure batches pre gen6 to access resources
      that are not available to normal usermode processes. However,
      all known userspace explicitly checks for HAS_SECURE_BATCHES
      before relying on the secure batch feature.
      
      Since there are no known binaries relying on this for newer gens
      we can kill secure batches from gen6, via I915_PARAM_HAS_SECURE_BATCHES.
      
      v2: rebase (Mika)
      v3: rebase (Mika)
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      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: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f1ff7708
    • J
      drm/i915: Rename gen7 cmdparser tables · b4b1abdc
      Jon Bloomfield 提交于
      commit 0a2f661b6c21815a7fa60e30babe975fee8e73c6 upstream.
      
      We're about to introduce some new tables for later gens, and the
      current naming for the gen7 tables will no longer make sense.
      
      v2: rebase
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      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: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b4b1abdc
    • M
      drm/amd/display: Passive DP->HDMI dongle detection fix · 99d5f18c
      Michael Strauss 提交于
      [ Upstream commit bc2fde42e2418808dbfc04de1a6da91d7d31cf1a ]
      
      [WHY]
      i2c_read is called to differentiate passive DP->HDMI and DP->DVI-D dongles
      The call is expected to fail in DVI-D case but pass in HDMI case
      Some HDMI dongles have a chance to fail as well, causing misdetection as DVI-D
      
      [HOW]
      Retry i2c_read to ensure failed result is valid
      Signed-off-by: NMichael Strauss <michael.strauss@amd.com>
      Reviewed-by: NTony Cheng <Tony.Cheng@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      99d5f18c
    • A
      drm/amdgpu: If amdgpu_ib_schedule fails return back the error. · e5edbf9c
      Andrey Grodzovsky 提交于
      [ Upstream commit 57c0f58e9f562089de5f0b60da103677d232374c ]
      
      Use ERR_PTR to return back the error happened during amdgpu_ib_schedule.
      Signed-off-by: NAndrey Grodzovsky <andrey.grodzovsky@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e5edbf9c
    • A
      drm/radeon: fix si_enable_smc_cac() failed issue · e3fdd0c1
      Alex Deucher 提交于
      commit 2c409ba81be25516afe05ae27a4a15da01740b01 upstream.
      
      Need to set the dte flag on this asic.
      
      Port the fix from amdgpu:
      5cb818b8 ("drm/amd/amdgpu: fix si_enable_smc_cac() failed issue")
      Reviewed-by: NYong Zhao <yong.zhao@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e3fdd0c1
  2. 10 11月, 2019 1 次提交
  3. 06 11月, 2019 4 次提交
  4. 29 10月, 2019 4 次提交
  5. 12 10月, 2019 7 次提交
  6. 08 10月, 2019 9 次提交