Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2532346pxb; Sun, 23 Jan 2022 07:39:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNgs4x5TL7Z/JO2q7krW1koPNovA47HzLn8PPkE36i/O66FyIssk/7HeFHndw8R39B7Zai X-Received: by 2002:a62:b607:0:b0:4bb:f708:174 with SMTP id j7-20020a62b607000000b004bbf7080174mr10587158pff.82.1642952379793; Sun, 23 Jan 2022 07:39:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642952379; cv=none; d=google.com; s=arc-20160816; b=jNsdfFR0ZuF2nDDwEsYWI3XID3AoueaXGfWT/D9d2jBmytINtFQLbbVxeif86QE2Q6 MBWN8cSmqxqA9Fax8dghtdN1rVmd57udvCGTWqAZ1BuvxPAPrjxR+mrdHw1PbScib9S/ JB0yjzhPTf6raATRbFBtKNhf9d4xCWcsPQaUo2gjzJsgQtpOuTlzIeqiy3IPlV1P7tSq QaTmOTFoS/D26ybIjSJzkiCEfAmRFj2uwJ/M9AXirrVEfWYhuRayg9X+oA4s5SG2+cz0 ebX/zkhcG63Zhxa6dzxijkOZtIacyxhi1mFiHZwh5axFRp7O4hJ3WYZpWlCyjFJTTWNn XNXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:references:dkim-signature:dkim-signature; bh=MsViZzLF8Kq6HOdr8iHnwG72oVaccjfy8JbG24/A8XM=; b=PLBQYV/8KHtmIvr/NeAyoGTCOSzMlgTAWOqH3nV1FKQ9rEZNvwuW/P7QD/dl4HNefX vbCVHhbxo8IQrN4M53AWr0t/Lc2HULepojAEHTbubjGBMEq2qSUcm+twCuncE8s2swhe bTQ7MKYRCWDx6PL4/wESBXKl2MFiJB1uq1dkkJ9pKOH5tZ0I+zUiQ3o2eVjtAc/1x7CT jjI5GxZa1zHnyNLCdzYiJePU0bEXym95tLFuwmbgajYUTtmO1SrBuAq4JpNhYo0UHnBY HsEfzWZLr00mVx2xpcvKURDz7SNnhLbZPm6fJEN5gvv8mCss/dr28Qu1cLZ9c0dY9xdu la6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@turner.link header.s=fm1 header.b=BaVO64CF; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=KFEkrIVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dmarc-none.turner.link Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si11902236plx.132.2022.01.23.07.39.28; Sun, 23 Jan 2022 07:39:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@turner.link header.s=fm1 header.b=BaVO64CF; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=KFEkrIVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dmarc-none.turner.link Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234942AbiAVViy (ORCPT + 99 others); Sat, 22 Jan 2022 16:38:54 -0500 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:60923 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230339AbiAVViw (ORCPT ); Sat, 22 Jan 2022 16:38:52 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id B31AA5802A6; Sat, 22 Jan 2022 16:38:51 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 22 Jan 2022 16:38:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=turner.link; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=MsViZzLF8Kq6HOdr8iHnwG72oVaccjfy8JbG24 /A8XM=; b=BaVO64CFNCl14UaN1iXZ5HD7QFcdTRYaBRpbTDciSr3gyP7ujk9Vmx B6MFRCT6GKfuvsr1QiJ1eMtFE6ZW/uNTPhsiZPKd3IY0ElAcB0ubjGQ7IEIymtQh n+1xCJy1RqQljRrRi1yK2mwhbu2P2Vb+1VCIRe2ROLWAgPrMffBYfTFyFIxX/oNw /uAfakYLKqROBYc/XHjL3PwjpignZkAao/QvG7DrQV6WpBTgJj0y0HdFbK/PjNOo oQiDUtXYZ/wmIaSShFoZ0AR078ztRtk7kGnKTYH3LsNlaqUFjgL9TzbWdfXDlHQf 4+3rMHNmnPmPwR9PQV5kyZdSm8pAcUOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=MsViZzLF8Kq6HOdr8 iHnwG72oVaccjfy8JbG24/A8XM=; b=KFEkrIVKNzlC5WO9zT68QI+pffxmYHKRl +TcDFrUZh+xL1dRc/ucNnZwGca1Y8k2XKK7IWMwvBAQurhqBlfjBAtJHX03pkC0h 3Qckz2ghniY4pisdXEjke+rB4D6PB6TX5rHFTlEgniQzN4UTrV0NDDJospwgetE7 2IVmniPay70zbZZxGotOff1f/NqNYNWBeVeO/wRqIgxzPVd/V0qTKq/eQWJjw5Vc Ilnakbupl0/9zqz3UneLsDrJu3rPi+BciK/ssHG+c3rgjInUNKHj0kAE/F4JkbbQ fQu3Z1QpA7n54ldPxk2wihngZVnCW8R71TGb8ndikvw5EWK1YRQEw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvddvgdduhedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhfhvffuffgjkfggtgesthdtredttddttdenucfhrhhomheplfgrmhgvshcu vfhurhhnvghruceolhhinhhugihkvghrnhgvlhdrfhhoshhssegumhgrrhgtqdhnohhnvg drthhurhhnvghrrdhlihhnkheqnecuggftrfgrthhtvghrnheptedvfeduheeiueefgffh vdetiedttdevhfeiteeuhfelveduvedttdffgffggfetnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheplhhinhhugihkvghrnhgvlhdrfhhoshhs segumhgrrhgtqdhnohhnvgdrthhurhhnvghrrdhlihhnkh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 22 Jan 2022 16:38:51 -0500 (EST) References: <87ee57c8fu.fsf@turner.link> <87a6ftk9qy.fsf@dmarc-none.turner.link> <87zgnp96a4.fsf@turner.link> <87czkk1pmt.fsf@dmarc-none.turner.link> From: James Turner To: "Lazar, Lijo" Cc: Alex Deucher , Thorsten Leemhuis , "Deucher, Alexander" , "regressions@lists.linux.dev" , "kvm@vger.kernel.org" , Greg KH , "Pan, Xinhui" , LKML , "amd-gfx@lists.freedesktop.org" , Alex Williamson , "Koenig, Christian" Subject: Re: [REGRESSION] Too-low frequency limit for AMD GPU PCI-passed-through to Windows VM Date: Sat, 22 Jan 2022 16:11:13 -0500 In-reply-to: Message-ID: <87sftfqwlx.fsf@dmarc-none.turner.link> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lijo, > Could you provide the pp_dpm_* values in sysfs with and without the > patch? Also, could you try forcing PCIE to gen3 (through pp_dpm_pcie) > if it's not in gen3 when the issue happens? AFAICT, I can't access those values while the AMD GPU PCI devices are bound to `vfio-pci`. However, I can at least access the link speed and width elsewhere in sysfs. So, I gathered what information I could for two different cases: - With the PCI devices bound to `vfio-pci`. With this configuration, I can start the VM, but the `pp_dpm_*` values are not available since the devices are bound to `vfio-pci` instead of `amdgpu`. - Without the PCI devices bound to `vfio-pci` (i.e. after removing the `vfio-pci.ids=...` kernel command line argument). With this configuration, I can access the `pp_dpm_*` values, since the PCI devices are bound to `amdgpu`. However, I cannot use the VM. If I try to start the VM, the display (both the external monitors attached to the AMD GPU and the built-in laptop display attached to the Intel iGPU) completely freezes. The output shown below was identical for both the good commit: f1688bd69ec4 ("drm/amd/amdgpu:save psp ring wptr to avoid attack") and the commit which introduced the issue: f9b7f3703ff9 ("drm/amdgpu/acpi: make ATPX/ATCS structures global (v2)") Note that the PCI link speed increased to 8.0 GT/s when the GPU was under heavy load for both versions, but the clock speeds of the GPU were different under load. (For the good commit, it was 1295 MHz; for the bad commit, it was 501 MHz.) # With the PCI devices bound to `vfio-pci` ## Before starting the VM % ls /sys/module/amdgpu/drivers/pci:amdgpu module bind new_id remove_id uevent unbind % find /sys/bus/pci/devices/0000:01:00.0/ -type f -name 'current_link*' -print -exec cat {} \; /sys/bus/pci/devices/0000:01:00.0/current_link_width 8 /sys/bus/pci/devices/0000:01:00.0/current_link_speed 8.0 GT/s PCIe ## While running the VM, before placing the AMD GPU under heavy load % find /sys/bus/pci/devices/0000:01:00.0/ -type f -name 'current_link*' -print -exec cat {} \; /sys/bus/pci/devices/0000:01:00.0/current_link_width 8 /sys/bus/pci/devices/0000:01:00.0/current_link_speed 2.5 GT/s PCIe ## While running the VM, with the AMD GPU under heavy load % find /sys/bus/pci/devices/0000:01:00.0/ -type f -name 'current_link*' -print -exec cat {} \; /sys/bus/pci/devices/0000:01:00.0/current_link_width 8 /sys/bus/pci/devices/0000:01:00.0/current_link_speed 8.0 GT/s PCIe ## While running the VM, after stopping the heavy load on the AMD GPU % find /sys/bus/pci/devices/0000:01:00.0/ -type f -name 'current_link*' -print -exec cat {} \; /sys/bus/pci/devices/0000:01:00.0/current_link_width 8 /sys/bus/pci/devices/0000:01:00.0/current_link_speed 2.5 GT/s PCIe ## After stopping the VM % find /sys/bus/pci/devices/0000:01:00.0/ -type f -name 'current_link*' -print -exec cat {} \; /sys/bus/pci/devices/0000:01:00.0/current_link_width 8 /sys/bus/pci/devices/0000:01:00.0/current_link_speed 2.5 GT/s PCIe # Without the PCI devices bound to `vfio-pci` % ls /sys/module/amdgpu/drivers/pci:amdgpu 0000:01:00.0 module bind new_id remove_id uevent unbind % for f in /sys/module/amdgpu/drivers/pci:amdgpu/*/pp_dpm_*; do echo "$f"; cat "$f"; echo; done /sys/module/amdgpu/drivers/pci:amdgpu/0000:01:00.0/pp_dpm_mclk 0: 300Mhz 1: 625Mhz 2: 1500Mhz * /sys/module/amdgpu/drivers/pci:amdgpu/0000:01:00.0/pp_dpm_pcie 0: 2.5GT/s, x8 1: 8.0GT/s, x16 * /sys/module/amdgpu/drivers/pci:amdgpu/0000:01:00.0/pp_dpm_sclk 0: 214Mhz 1: 501Mhz 2: 850Mhz 3: 1034Mhz 4: 1144Mhz 5: 1228Mhz 6: 1275Mhz 7: 1295Mhz * % find /sys/bus/pci/devices/0000:01:00.0/ -type f -name 'current_link*' -print -exec cat {} \; /sys/bus/pci/devices/0000:01:00.0/current_link_width 8 /sys/bus/pci/devices/0000:01:00.0/current_link_speed 8.0 GT/s PCIe James