Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2173243iof; Tue, 7 Jun 2022 22:09:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTtNRdnf1qU0fT4Q5xiA8NQ7WbWs9OmpwVORCg17hVFfsm1VJFcKwjsooejBc9zgzTxRA8 X-Received: by 2002:a17:902:d4cf:b0:167:735a:e7a1 with SMTP id o15-20020a170902d4cf00b00167735ae7a1mr16200754plg.161.1654664971063; Tue, 07 Jun 2022 22:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664971; cv=none; d=google.com; s=arc-20160816; b=jgF1dw/Ro0i6BNcY/O/0nNrgyp+RKSDHl+/RysSsIqIxfGvvatbPpaodSCwLvCVWug zV+cF+gzlspiE2PKMzGleTxX8DprLtRFPTEnCV3FM9KKBhFpiosbrdoUzARlq4GBdAeg pIiEVldXfeaw/ns6e3uXH9qBHDlI58zZVvwLdcnTVJfFdjsWKTGF3uRTJFUFT6Pyi9Fd JW6oEDLI89+aM5+PIne6D8CnexL8b3DDQZiEkN/EHLshF6dn+JClpmqnzNmLGrX42DbB 44+ZFjtddrYgNyfT5lNMkGNfzEX+9K0A7pVYFTY7alusLJv8TWfi2r+MheYdBNfw1v/2 b6mw== 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=vh7jDil8v1Ro27QSW7WHqf35tiqDigD2jpyAIYTtkac=; b=q8I1z/OZCzI9rml33b8nKPNFrl1yihJU5bRcYtGiEnaUAtQmLbcBV3xqpuszieZDYb j8t96sreFgVwvV3EXTSP3z3Te/SSMVfjbdx5D374UNMy9yTTcuYf9K0MaLA9RPraaly1 oSkOm1jhqbeYlkaVR1zFiCh+mbz1MhsGKuAdlwcc4JgDVWjlx4nQ0PTtSKw2gggeMPuB gQnPJI8xQyfipuhUHGdROTXVfhvONQpoU553XlpR4BnG/WPXvALyuCWld3d1MafvcqlS p9vU8FoKd1ZKH5K8OSPsIYQWCAE7tp1LQr5S+3WZ4ln8g40WBkDShOLID9uedyLaNnq8 51PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=izRvNDWc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 11-20020a630d4b000000b003fd2602496esi19770978pgn.256.2022.06.07.22.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:09:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=izRvNDWc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E4B1327CD6B; Tue, 7 Jun 2022 21:40:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347470AbiFGWgf (ORCPT + 99 others); Tue, 7 Jun 2022 18:36:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378643AbiFGVX4 (ORCPT ); Tue, 7 Jun 2022 17:23:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E06C0227376; Tue, 7 Jun 2022 12:00:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7265261787; Tue, 7 Jun 2022 19:00:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83B07C385A2; Tue, 7 Jun 2022 19:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628442; bh=TIJngYH102qEmFZnYblf7kWBift6Ih/yHXSL/OiT3Aw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=izRvNDWc/lqgIR7r8xPDgDeLGD5UuMasr1FmydNExX1gOu3Gn5EPUYF0JZgUMNHbo tZxw9h6ehLY0kzFayx/K2fZoSaaauOBNIDdo9jutRcJys5aLzSIKkRnK8ixee95pb4 FiR8BZlBvVRipgLdJ0fwKPNe01xEsWaD0+FWGLec= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yongqiang Sun , Alex Deucher , Sasha Levin Subject: [PATCH 5.18 291/879] drm/amd/amdgpu: Only reserve vram for firmware with vega9 MS_HYPERV host. Date: Tue, 7 Jun 2022 18:56:49 +0200 Message-Id: <20220607165011.294913080@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Yongqiang Sun [ Upstream commit 49aa98ca30cd186ab33fc5802066e2024d3bfa39 ] driver loading failed on VEGA10 SRIOV VF with linux host due to a wide range of stolen reserved vram. Since VEGA10 SRIOV VF need to reserve vram for firmware with windows Hyper_V host specifically, check hypervisor type to only reserve memory for it, and the range of the reserved vram can be limited to between 5M-7M area. Fixes: faad5ccac1eaae ("drm/amdgpu: Add stolen reserved memory for MI25 SRIOV.") Signed-off-by: Yongqiang Sun Acked-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c index a66a0881a934..3e9582c245bb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c @@ -25,6 +25,7 @@ */ #include +#include #include "amdgpu.h" #include "amdgpu_gmc.h" @@ -647,11 +648,11 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev) case CHIP_VEGA10: adev->mman.keep_stolen_vga_memory = true; /* - * VEGA10 SRIOV VF needs some firmware reserved area. + * VEGA10 SRIOV VF with MS_HYPERV host needs some firmware reserved area. */ - if (amdgpu_sriov_vf(adev)) { - adev->mman.stolen_reserved_offset = 0x100000; - adev->mman.stolen_reserved_size = 0x600000; + if (amdgpu_sriov_vf(adev) && hypervisor_is_type(X86_HYPER_MS_HYPERV)) { + adev->mman.stolen_reserved_offset = 0x500000; + adev->mman.stolen_reserved_size = 0x200000; } break; case CHIP_RAVEN: -- 2.35.1