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 E01ACC433F5 for ; Tue, 26 Oct 2021 09:24:32 +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 A86F160FD7 for ; Tue, 26 Oct 2021 09:24:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A86F160FD7 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 0D2AC6E418; Tue, 26 Oct 2021 09:24:32 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1DC7B6E418; Tue, 26 Oct 2021 09:24:31 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="216773052" X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="216773052" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 02:24:30 -0700 X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="723998081" 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:24:28 -0700 Message-ID: <36f3ea04-df18-acf9-eb46-5d30c5bde851@linux.intel.com> Date: Tue, 26 Oct 2021 11:24:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH 1/2] drm/i915/gtt: flush the scratch page 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Reviewed-by: Thomas Hellström > --- > 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); > } > > int setup_scratch_page(struct i915_address_space *vm)