Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp960865rwr; Wed, 26 Apr 2023 08:25:15 -0700 (PDT) X-Google-Smtp-Source: AKy350ZpLBQ675pGerBfZiBpwYNoFccYeQqgdCxUwwMnhRUwt93H53s3AMQiuqmei4DidYG5WMRr X-Received: by 2002:a05:6a00:1911:b0:63b:599b:a2e6 with SMTP id y17-20020a056a00191100b0063b599ba2e6mr30085569pfi.27.1682522715042; Wed, 26 Apr 2023 08:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682522715; cv=none; d=google.com; s=arc-20160816; b=COuu02fD0dubVQaXBgL4aH7PKBCxH7i2DmU/fYhOk3HTYFDyH7sV7BRgBNu4Un5AXM ZONI1m2xO9OjfWHJITVNTMZUYPNXgLsSCu8Eeoq28rvQiJ+Fui/mp7Ek6RVKJsHSh1ix ssCmOGKnHQIX8gsjVIAPS5CJGHgiG86AYkpeGB04aEnrIBZBb3VGOCNIYHyykMfpLENV qxf7CgpIxrnLAKGMCBGnyXN7CJZuEAgCpAT2euL5xA+f7PszgWOCqYO3YqBlNUPa3P5f XV7681hsKLELKd2/nEHJgR12dpCEwOKvIwgWXQucbohm6z0AjvrH8TK5Jpd7unxinsm9 5HSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=p++dDTxOEkUyvQrVnGIXGcfdW3i4CYRyEfqHk/mo9Pc=; b=MmVL1Sedfvymm9yDD6ru21IzTHB8Q0lvmVnYGQW7Dl4W3kJ45ljUzndRegSh9QAzdG Yo91Elw+STwXCZ9t610E7/si2kquNvwBQvxx0+0xhQ2PNR13poMGgVxNtvfj/zrzHmBD BGWrv/hgXwYWsJF5kT7fP7wHDWIa/lnDQBerp6ElJfR4JmPyBbX4VW2ppXZVYkZr0BS2 bTc1BlyEWqZkuEnOP5amwtAefHeSmZkwVxiyRveQrd/SY5WUTaxIRjr+9iHj8FDeazsW A13MOxN8irBGEX7z6dkeJKzqapDrhh1S3GJTAMH6T4UQvHEN3ml5UNqDk79pwxcAxFlN igVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=avLRtPcj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020aa79468000000b0063b7b02424fsi16701125pfq.250.2023.04.26.08.25.00; Wed, 26 Apr 2023 08:25:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=avLRtPcj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241285AbjDZPPA (ORCPT + 99 others); Wed, 26 Apr 2023 11:15:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241310AbjDZPOv (ORCPT ); Wed, 26 Apr 2023 11:14:51 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90898100 for ; Wed, 26 Apr 2023 08:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682522090; x=1714058090; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to; bh=a3rq7E5TI8RGgUZf3JtgYbiTIUGic08SWRrQO5vrU5I=; b=avLRtPcjoX7KlbPB+Y+0yAe72IsUuU9MxoyTHeT89IaZpBzsXF/Est8u pmvNJVFyo05IN187TPqbdpHJ5ZeXAXiL9R4MOlAm/5lX1GkCNVDc0ssNQ HwP1pFua5m4ipDdOsmE+64A7BuD3Uylt/0YjI3OmNVc27jf3cAYvGgAtH DgbA3X0N2mEYkBz7xY6VktjYaoxKTIUGrvPngt1wGWMP3HKIzhJ2/rxrt XIB6eghvwUBKopzpSA4jjdN+nge/cnmbMqRkLmVHpXG7OmrYeoW+A+IiG oSCSJqWm7GXk1k9n0fPQB4m2VJT7uxReJ9YVVs7T9yMmZXypZUJXQ+1ij A==; X-IronPort-AV: E=McAfee;i="6600,9927,10692"; a="412444681" X-IronPort-AV: E=Sophos;i="5.99,228,1677571200"; d="scan'208";a="412444681" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2023 08:14:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10692"; a="671366449" X-IronPort-AV: E=Sophos;i="5.99,228,1677571200"; d="scan'208";a="671366449" Received: from lab-ah.igk.intel.com ([10.102.138.202]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2023 08:14:32 -0700 From: Andrzej Hajda Date: Wed, 26 Apr 2023 17:14:11 +0200 Subject: [PATCH v7 2/2] drm/i915: Use correct huge page manager for MTL MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230425-hugepage-migrate-v7-2-fa6605a986c9@intel.com> References: <20230425-hugepage-migrate-v7-0-fa6605a986c9@intel.com> In-Reply-To: <20230425-hugepage-migrate-v7-0-fa6605a986c9@intel.com> To: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jonathan Cavitt , Andrzej Hajda , Matthew Auld X-Mailer: b4 0.11.1 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Cavitt MTL currently uses gen8_ppgtt_insert_huge when managing huge pages. This is because MTL reports as not supporting 64K pages, or more accurately, the system that reports whether a platform has 64K pages reports false for MTL. This is only half correct, as the 64K page support reporting system only cares about 64K page support for LMEM, which MTL doesn't have. MTL should be using xehpsdv_ppgtt_insert_huge. However, simply changing over to using that manager doesn't resolve the issue because MTL is expecting the virtual address space for the page table to be flushed after initialization, so we must also add a flush statement there. Signed-off-by: Jonathan Cavitt Reviewed-by: Matthew Auld Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c index 4daaa6f5566888..9c571185395f49 100644 --- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c @@ -570,6 +570,7 @@ xehpsdv_ppgtt_insert_huge(struct i915_address_space *vm, } } while (rem >= page_size && index < max); + drm_clflush_virt_range(vaddr, PAGE_SIZE); vma_res->page_sizes_gtt |= page_size; } while (iter->sg && sg_dma_len(iter->sg)); } @@ -707,7 +708,7 @@ static void gen8_ppgtt_insert(struct i915_address_space *vm, struct sgt_dma iter = sgt_dma(vma_res); if (vma_res->bi.page_sizes.sg > I915_GTT_PAGE_SIZE) { - if (HAS_64K_PAGES(vm->i915)) + if (GRAPHICS_VER_FULL(vm->i915) >= IP_VER(12, 50)) xehpsdv_ppgtt_insert_huge(vm, vma_res, &iter, cache_level, flags); else gen8_ppgtt_insert_huge(vm, vma_res, &iter, cache_level, flags); -- 2.34.1