From patchwork Mon Jan 16 19:23:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cengiz Can X-Patchwork-Id: 1727231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=u+utDy0N; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NwhnM5Dcwz23fT for ; Tue, 17 Jan 2023 06:25:27 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pHV6e-0000pt-3W; Mon, 16 Jan 2023 19:25:20 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pHV6c-0000pB-PH for kernel-team@lists.ubuntu.com; Mon, 16 Jan 2023 19:25:18 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 2CAB23F328 for ; Mon, 16 Jan 2023 19:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1673897118; bh=6CH1pm7OYEUNt81cVQPKBzs/ECCZaRt6hP+EnlyZ2gw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u+utDy0NZQabk/07BeSGZbjYD67YyrsKNQVCX4ckEgMKHfrKxYokgAg/uRUr9Bn1P EhxiZ4qyzCdBQ+HmduKGz9IsnqfZmvihDUbhO3YJP7BPbs5oLm2726mgg81ZX63w92 zzoW6vV4iJHfs9cOSiRWoXaK+WKHWDgXtaC8i6ivn9geBjTNb5MRL8zxpXGRCUi3wI Wl7JopHbu2N2KlPtVaMPbSedLyxFwLbMD/NF4NPlI1krn6av63XKq0VIXK+cBkddH9 5AI96X3iBn1z8umyI3IYizYi/6IbynbHV3uSyUCmiSP7nqp/VHfmlnCIlhqjmawsPS LC4v9r5Zotg2g== Received: by mail-ej1-f72.google.com with SMTP id nb4-20020a1709071c8400b0084d4712780bso16570891ejc.18 for ; Mon, 16 Jan 2023 11:25:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6CH1pm7OYEUNt81cVQPKBzs/ECCZaRt6hP+EnlyZ2gw=; b=4zyQN9YUQ1SPZcS1Knm4iC8J3Ffe9rGzStae0FRml1XpPf1CYj6pChAN8qN2BSkezK +8/kVWrcNgFvKkpWzcoHqX1U1g/kadwi7X/GveQaEJ8DKz/lkdOeXpcQON/6Z0ZrChcP p/SGHtOvFP03tuxHoytpc6f7R24I7R3vcXkCZJmnxj0aPmf00677kCbLaqYV7b67cxvl 5uD8zqjocavxUNW254Lsk3HuMrhlGW+cB44sjBgS8piyUY2tPaMqInuIyv16GTyFtduz LeynqCEzdJlZhvnYXv9dBk9G4DJfHLAL1KwlVPVMcM1/ebl/y+N/FkH+8XGhjQdZj2ai 23Yg== X-Gm-Message-State: AFqh2ko3+6jhknlCxfREO6Gg5EkihgbUNw8eOZ7FruwdMN4x5IJU2xS3 j0WGKbPK0mmOUZNLhseNX4QE5RSsbtXV3c/ayzXGjxKqT1wDkHigoRlmVp8LHPG/iVVfmMf+W8G u5TLPR+TwcE58EjNQuGeinv02iEW0+LHObcUB9XNuAQ== X-Received: by 2002:a17:907:20f6:b0:84d:21b2:735a with SMTP id rh22-20020a17090720f600b0084d21b2735amr124675ejb.54.1673897117676; Mon, 16 Jan 2023 11:25:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXu6R41gzUtBqiDUdwpQZ5+o9pJw/pbHnOdEDKsk4TtQq+RrMendAjVXaXi1gwTn6pMl+cUjJA== X-Received: by 2002:a17:907:20f6:b0:84d:21b2:735a with SMTP id rh22-20020a17090720f600b0084d21b2735amr124665ejb.54.1673897117431; Mon, 16 Jan 2023 11:25:17 -0800 (PST) Received: from localhost ([176.234.90.170]) by smtp.gmail.com with ESMTPSA id l18-20020a1709060cd200b0084c723a626csm12066553ejh.209.2023.01.16.11.25.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 11:25:17 -0800 (PST) From: Cengiz Can To: kernel-team@lists.ubuntu.com Subject: [SRU Focal 1/1] drm/i915: fix TLB invalidation for Gen12 video and compute engines Date: Mon, 16 Jan 2023 22:23:54 +0300 Message-Id: <20230116192349.89358-5-cengiz.can@canonical.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230116192349.89358-1-cengiz.can@canonical.com> References: <20230116192349.89358-1-cengiz.can@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Andrzej Hajda commit 04aa64375f48a5d430b5550d9271f8428883e550 upstream. In case of Gen12 video and compute engines, TLB_INV registers are masked - to modify one bit, corresponding bit in upper half of the register must be enabled, otherwise nothing happens. CVE: CVE-2022-4139 Suggested-by: Chris Wilson Signed-off-by: Andrzej Hajda Acked-by: Daniel Vetter Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman CVE-2022-4139 (cherry picked from commit 3659e33c1e4f8cfc62c6c15aca5d797010c277a4 linux-5.4.y) Signed-off-by: Cengiz Can --- drivers/gpu/drm/i915/gt/intel_gt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c index f6d7f5d307d7..b1ba08e3e101 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt.c +++ b/drivers/gpu/drm/i915/gt/intel_gt.c @@ -348,6 +348,10 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt) if (!i915_mmio_reg_offset(rb.reg)) continue; + if (INTEL_GEN(i915) == 12 && (engine->class == VIDEO_DECODE_CLASS || + engine->class == VIDEO_ENHANCEMENT_CLASS)) + rb.bit = _MASKED_BIT_ENABLE(rb.bit); + intel_uncore_write_fw(uncore, rb.reg, rb.bit); }