From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8780BC433EF for ; Tue, 26 Oct 2021 09:37:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B84F60F21 for ; Tue, 26 Oct 2021 09:37:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3B84F60F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FA396E419; Tue, 26 Oct 2021 09:37:02 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D2436E419; Tue, 26 Oct 2021 09:37:01 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="229810678" X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="229810678" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 02:37:00 -0700 X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="724032000" Received: from fnygreen-mobl1.ger.corp.intel.com (HELO [10.249.254.182]) ([10.249.254.182]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 02:36:59 -0700 Message-ID: <62fb3cf4-12a6-12bf-9849-442b5c906f35@linux.intel.com> Date: Tue, 26 Oct 2021 11:36:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Content-Language: en-US To: Matthew Auld , intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, Chris Wilson , Ramalingam C References: <20211022164847.2632366-1-matthew.auld@intel.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= In-Reply-To: <20211022164847.2632366-1-matthew.auld@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH 1/2] drm/i915/gtt: flush the scratch page X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 10/22/21 18:48, Matthew Auld wrote: > The scratch page is directly visible in the users address space, and > while this is forced as CACHE_LLC, by the kernel, we still have to > contend with things like "Bypass-LLC" MOCS. So just flush no matter > what. > > Signed-off-by: Matthew Auld > Cc: Thomas Hellström > Cc: Chris Wilson > Cc: Ramalingam C > --- > drivers/gpu/drm/i915/gt/intel_gtt.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c b/drivers/gpu/drm/i915/gt/intel_gtt.c > index 67d14afa6623..b6c088423319 100644 > --- a/drivers/gpu/drm/i915/gt/intel_gtt.c > +++ b/drivers/gpu/drm/i915/gt/intel_gtt.c > @@ -273,6 +273,7 @@ static void poison_scratch_page(struct drm_i915_gem_object *scratch) > val = POISON_FREE; > > memset(vaddr, val, scratch->base.size); > + clflush_cache_range(vaddr, scratch->base.size); Actually, we should probably use drm_clflush_virt_range() here? /Thomas > } > > int setup_scratch_page(struct i915_address_space *vm)