Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1409906rwr; Wed, 26 Apr 2023 14:50:23 -0700 (PDT) X-Google-Smtp-Source: AKy350YTg3a/Thzhd1gZoiq/zm7QHrN9C982eKbFRYm0ks+LhOPawq8q6EW0bYJmRCGoEoqsc75b X-Received: by 2002:a17:902:9b95:b0:1a5:2a50:e177 with SMTP id y21-20020a1709029b9500b001a52a50e177mr21686319plp.55.1682545823280; Wed, 26 Apr 2023 14:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682545823; cv=none; d=google.com; s=arc-20160816; b=FBUmJidkSdPWcQAnGO7ti7BJEyjnN3luHeSvB2DtuUbFuU0SVZMcXIbl/2ho7jRyfx AvJWYTCF5uOv1tJ4Fn69o9dcyY42Xrjwz7kyhwlPAXv3mMggtBoxip1YMHUla+v++zvr PY7Tc2nILIxRBKHK00g8/IWN0qghwI4/VtZZDo0+2OHRS34zJ7GqJeVpW4jIFBvve+p/ XG8XLQU9k6IqeBOilukNgFOViVts5eoiCmLde4tG0g4o2uKILGcDaoKY/bSAJw8/JsXS 9rS20UrvpcdPi8soyP+TpbAVdkE67Prk6YFw+0ngKc3U/aHzWzgmn+5oz1AQjkH4/qYi 3VhA== 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=T3unkm9rHsQ81uDoFreyAWbEI7QdFDEY2IBvenjhBog=; b=AcAjOdwOpg4PvueQIq1R9njbmgrGmH1I2oMHH44sfpPQL9GtawujIHBbGhf3Dg/CGv rtJgzLZ/jtUfO/BCU3ikYzPyHvlSaLa2ctL/ixnktJ0X0Qg8IfCRHxn/YEj7Hr/xHr3H Fn92bcw/IDHCqq/GTVOaO4My76nxI1FqxpAPSQ6we4sVQ5cS3CcZ5ChSKldpePz6/lkC 3d17b7AywYAvHKFZoDCRBxuflawErXRSvrFIEdWcTY7WiYFLQfv0mWGde85lWsEAsJPd +DDQVHvWNMdasAI0k80zP8OsaEXrWA4mAy8ivc+1lhrGspz/QVTYjKlyr8/8KsaRlyaM ZFYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TsjlQHYe; 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 ld15-20020a170902facf00b0019e8c3cd415si15936518plb.260.2023.04.26.14.50.10; Wed, 26 Apr 2023 14:50:23 -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=TsjlQHYe; 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 S240052AbjDZV3s (ORCPT + 99 others); Wed, 26 Apr 2023 17:29:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239999AbjDZV3d (ORCPT ); Wed, 26 Apr 2023 17:29:33 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AF543A9C for ; Wed, 26 Apr 2023 14:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682544572; x=1714080572; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to; bh=HQr3QuWfqr8HjkBvQXdQGVL0T9pRPRkx4Ddqy9aDMLw=; b=TsjlQHYeYt983WcttMSx1EvHnNVS2NkUVf5Da789Q8XaKXW2Q0Epz0TM DxteRu5d6TkodH5jJ2pyYOzVz/BqiogoYphXpLwyDkKvs04AX0SWqd1t2 eDLFiDOuxKV10/H2RnrpbgwkG0RzEP+ZoYRH3vZtH5/iqmp6EmdQoxbQN fHTCVoDVtyM3JfWKv5JXkUT6JGpXo2joF43HjKeY2F20hzS7OTneMkjtD Cd/RN9J6nREF8p7258Gc+Y98e8weLiarFQ6oXOFqmnF2b4doFRO7OsAM+ dwVhs3R/FAm3WOJlfakWvKw/Ip9Rj904trEc8xMh7QDXIyK7+me7/wmpu g==; X-IronPort-AV: E=McAfee;i="6600,9927,10692"; a="344691051" X-IronPort-AV: E=Sophos;i="5.99,229,1677571200"; d="scan'208";a="344691051" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2023 14:29:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10692"; a="805679888" X-IronPort-AV: E=Sophos;i="5.99,229,1677571200"; d="scan'208";a="805679888" Received: from lab-ah.igk.intel.com ([10.102.138.202]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2023 14:29:30 -0700 From: Andrzej Hajda Date: Wed, 26 Apr 2023 23:28:49 +0200 Subject: [PATCH v8 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-v8-2-7868d54eaa27@intel.com> References: <20230425-hugepage-migrate-v8-0-7868d54eaa27@intel.com> In-Reply-To: <20230425-hugepage-migrate-v8-0-7868d54eaa27@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, 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