Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2267942pxb; Mon, 11 Jan 2021 05:37:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0t+T4wGF8IQIEE4kAGAlbcVaCg22YJ4JfokAp5G4H/60eOTfkNwg1mMcW8YLeja64NxST X-Received: by 2002:a17:906:73d8:: with SMTP id n24mr10604628ejl.14.1610372219907; Mon, 11 Jan 2021 05:36:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610372219; cv=none; d=google.com; s=arc-20160816; b=fdhE+lbKsKImRY3MHhlzMsvehIfILTCRcH+6C47pCj4/ykHQJ8nifdmcldHs2ubNU3 UTremE6Mlg2q1HpeGN2GCHeOwdiYR2vB978fNFR/SYqUNpUftYfPFW5jIJ4lVskmYvsR 28FnRhqZD7JQeN1lsDsq1f5OTCsR249yRTpLifRjuq0r2wlEzMKnE3UddJxFUzStX0/e TobARYUmQlj9MPm6ZI85rGTQQPBtz3MFCOe5qpS1286jNpUL2sfVdUWQbte9Gx5yPNYy 3jtAYnZHKCj3SxKEqV5Mv2lAjUpzUPIptlzAfcSaDL0NpPoE7SO/d7D8gThTCSlhw4Uk j/4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nrtzBIX4L5Ci/ZLfM2jGfjOw+oBK/jLnJ7GOUprJCFk=; b=pDXnaQ+JMcHiAwHBfjs3WYi3lwPCYrqJ1yFA40GDkLh9G6DnYYKh1IxjslYab8pmX+ 1ZO4j9frAD4V7zEpyb33TqRk6k5/SJ9+vMxDzkxR2HICtXu+5JTXvX6v09ltCdBIdO1r YLEhrRxR0Dir+no+z1qOb9JbYj7oyn1FCT/5AgaJ5OG34OYpVdUCJsH8ijem085iL8qK bkdzXMGJTRqE3XsvxvoBtDeo9v3pRgo+nwkwfPqFApaSZsCjxpIjqq2pi+TrSg6UNDMP 4cNrZT0N+aYaF7b7hmov/saNzxl/dRTRpf5qQ5s3fpj+zCaGS5mqrmxNaxRuMKr1pMtA hBAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MQJ6rzVI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b21si6433753ejk.520.2021.01.11.05.36.35; Mon, 11 Jan 2021 05:36:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MQJ6rzVI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732137AbhAKNOh (ORCPT + 99 others); Mon, 11 Jan 2021 08:14:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:60360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731877AbhAKNNX (ORCPT ); Mon, 11 Jan 2021 08:13:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A1F422B49; Mon, 11 Jan 2021 13:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370762; bh=ZGs3UEZL5g3cIwQdpC4iOJhgacp1piMgr86kLlOwMx0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MQJ6rzVIEDSxQzWHNENyr3AEUg7VRsNpkZcf7C34DqjHD00aBYEGTR85SNeFEfvj+ WM5lDkHUUl9ea5verxymjjRPseQCxp3KCV9sRyll+/j7Tcv0Yw4Pk0gvu4DZ5KR6w9 qLG73QgCzxZuWGBuNdpJRMDQUQfjD8TTXr1spVrw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Auld , Chris Wilson , Jani Nikula Subject: [PATCH 5.4 86/92] drm/i915: clear the gpu reloc batch Date: Mon, 11 Jan 2021 14:02:30 +0100 Message-Id: <20210111130043.303143630@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130039.165470698@linuxfoundation.org> References: <20210111130039.165470698@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Auld commit 641382e9b44fba81a0778e1914ee35b8471121f9 upstream. The reloc batch is short lived but can exist in the user visible ppGTT, and since it's backed by an internal object, which lacks page clearing, we should take care to clear it upfront. Signed-off-by: Matthew Auld Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20201224151358.401345-2-matthew.auld@intel.com Cc: stable@vger.kernel.org (cherry picked from commit 26ebc511e799f621357982ccc37a7987a56a00f4) Signed-off-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -936,7 +936,7 @@ static void reloc_gpu_flush(struct reloc GEM_BUG_ON(cache->rq_size >= obj->base.size / sizeof(u32)); cache->rq_cmd[cache->rq_size] = MI_BATCH_BUFFER_END; - __i915_gem_object_flush_map(obj, 0, sizeof(u32) * (cache->rq_size + 1)); + i915_gem_object_flush_map(obj); i915_gem_object_unpin_map(obj); intel_gt_chipset_flush(cache->rq->engine->gt); @@ -1163,6 +1163,8 @@ static int __reloc_gpu_alloc(struct i915 goto out_pool; } + memset32(cmd, 0, pool->obj->base.size / sizeof(u32)); + batch = i915_vma_instance(pool->obj, vma->vm, NULL); if (IS_ERR(batch)) { err = PTR_ERR(batch);