Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3251925rwl; Fri, 6 Jan 2023 18:55:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXvcJKZ9Aiv4IyEEfjlqsOHoEW/uEc5boa3GvC3qEQUi5MqKlDZ+yVRXcCsWb8I/4+Tmkjto X-Received: by 2002:a05:6a00:158e:b0:581:5be0:4e2a with SMTP id u14-20020a056a00158e00b005815be04e2amr54111886pfk.31.1673060122739; Fri, 06 Jan 2023 18:55:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673060122; cv=none; d=google.com; s=arc-20160816; b=ChW6MTULOkYAlsG6AcSZzbQTcBVjXJwcz+wPj1O6jHSq1o7tM+dli/cGIT6m/1msgX rV97PNwTR4+tC1qoVjn1WoloqLMhrlc1bNXofnONqVzJHf6+dkA3flPS+MGcV0iM9WZ0 ax5/r+FtJxOAeNqqI3/wGxj/b0uH6ndB2WfIIezA+VKOLwCtIGknJBAzyyIWnOmuPB79 r7wc2HGqGUqHQYRLrGIeRro+gkCKgF5mvBTJy6v1auSCgy1PPTZCi5mh38CVIaec3qn7 qxP1x1R1KPPMkm3g3/8BAgITqRg/HcciRPJ6BaSnWEj4+mx2BqighC372fH8j4drucEG 3ysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SlAdfJklsTW4bJw1AlUVVwopqRP7hBtF3UjHdvrU0fk=; b=vJrqcFsq0NdFf/bk0CCf/uW2EbVzGY7TsMucHYwJE1IuPb954ZDYEnelXXbd10Ojbn VwsNnuzadwEWEhDndEQgSAlRJR6CqmAyOQ8k5g46MJ6vwCBv+WJuf+YkFjDNmuAD/XDc 4LnUe6/gJ2lM18wt/0lIYHng88omtdqYR47v4NFObp6H9ct/OfH6rGmrMGLKm4Tojm7U H7Fc6uMz90cX++ta67pmh74LdGFbxTHgFQA2ed62ABnZpUrNMQDqdQTs4WMDgqkJbdFt PGCp5/UEITzxA+Ep8Wz4wJTb3EYKJB56gpm8x2XXzBB3bdMpRzGWeHB0ryJNiIPvRfrn 4TmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="F/JsXysu"; 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 a3-20020a056a000c8300b005833a93f0a1si3215667pfv.82.2023.01.06.18.55.14; Fri, 06 Jan 2023 18:55:22 -0800 (PST) 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="F/JsXysu"; 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 S235686AbjAGCox (ORCPT + 56 others); Fri, 6 Jan 2023 21:44:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjAGCov (ORCPT ); Fri, 6 Jan 2023 21:44:51 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAFD684BFC; Fri, 6 Jan 2023 18:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673059490; x=1704595490; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=G0fbwXW0MolWEJ1yoKtJ5qcnQjpT3neE3ClvtGEJC38=; b=F/JsXysuwQcxGX0ceSbWWtOqTBIIwouupnC+dOB8MmZH06RDqN0/q/Li 83vAJaCMsViV6LTqne0m6yoKjQQjuWbfW+iwLBen6v+nzIJXE5VCI89DY 4KDwaHoYyv3qF+Ezqo1TRdw98mwEyVdmuKIVdQ/Yb7fwHtyje8rJdOW4l O6SCFYh0fgIqcA5jLR+u8AWKF7LwBc0q1Nn4ceL0zpQRDNvPpO9rYnQV9 Qsf/lBQadyokMOMbwxLb7aFnd49QFDLERioVFLI+a64lZS8fc5ndvNAdn kBFf0wlJaRlxUYVp0k/9yrGkItwZMQnn0v2MltZN0IpjFyY6E/exi9XwN g==; X-IronPort-AV: E=McAfee;i="6500,9779,10582"; a="322678315" X-IronPort-AV: E=Sophos;i="5.96,307,1665471600"; d="scan'208";a="322678315" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2023 18:44:50 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10582"; a="901474463" X-IronPort-AV: E=Sophos;i="5.96,307,1665471600"; d="scan'208";a="901474463" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.254.209.158]) ([10.254.209.158]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2023 18:44:48 -0800 Message-ID: Date: Sat, 7 Jan 2023 10:44:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: =?UTF-8?Q?Re=3a_=5bregression=2c_bisected=2c_pci/iommu=5d_Bug=c2=a0?= =?UTF-8?Q?216865_-_Black_screen_when_amdgpu_started_during_6=2e2-rc1_boot_w?= =?UTF-8?Q?ith_AMD_IOMMU_enabled?= Content-Language: en-US To: Jason Gunthorpe , Vasant Hegde Cc: Matt Fagnani , Thorsten Leemhuis , Joerg Roedel , "iommu@lists.linux.dev" , LKML , "regressions@lists.linux.dev" , Linux PCI , Bjorn Helgaas References: <15d0f9ff-2a56-b3e9-5b45-e6b23300ae3b@leemhuis.info> <5aa0e698-f715-0481-36e5-46505024ebc1@bell.net> <157c4ca4-370a-5d7e-fe32-c64d934f6979@amd.com> <223ee6d6-70ea-1d53-8bc2-2d22201d8dde@bell.net> <6fff9d10-f77f-e55a-9020-8a1bd34cf508@amd.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 On 1/6/2023 10:14 PM, Jason Gunthorpe wrote: > On Thu, Jan 05, 2023 at 03:57:28PM +0530, Vasant Hegde wrote: >> Matt, >> >> On 1/5/2023 6:39 AM, Matt Fagnani wrote: >>> I built 6.2-rc2 with the patch applied. The same black screen problem happened >>> with 6.2-rc2 with the patch. I tried to use early kdump with 6.2-rc2 with the >>> patch twice by panicking the kernel with sysrq+alt+c after the black screen >>> happened. The system rebooted after about 10-20 seconds both times, but no kdump >>> and dmesg files were saved in /var/crash. I'm attaching the lspci -vvv output as >>> requested. >>> >> >> Thanks for testing. As mentioned earlier I was not expecting this patch to fix >> the black screen issue. It should fix kernel warnings and IOMMU page fault >> related call traces. By any chance do you have the kernel boot logs? >> >> >> @Baolu, >> Looking into lspci output, it doesn't list ACS feature for Graphics card. So >> with your fix it didn't enable PASID and hence it failed to boot. > > The ACS checks being done are feature of the path not the end point or > root port. > > If we are expecting ACS on the end port then it is just a bug in how > the test was written.. The test should be a NOP because there are no > switches in this topology. > > Looking at it, this seems to just be because pci_enable_pasid is > calling pci_acs_path_enabled wrong, the only other user is here: > > for (bus = pdev->bus; !pci_is_root_bus(bus); bus = bus->parent) { > if (!bus->self) > continue; > > if (pci_acs_path_enabled(bus->self, NULL, REQ_ACS_FLAGS)) > break; > > pdev = bus->self; > > group = iommu_group_get(&pdev->dev); > if (group) > return group; > } > > And notice it is calling it on pdev->bus not on pdev itself which > naturally excludes the end point from the ACS validation. > > So try something like: > > if (!pci_acs_path_enabled(pdev->bus->self, NULL, PCI_ACS_RR | PCI_ACS_UF)) > > (and probably need to check for null ?) Yeah! This really is a misuse of pci_acs_path_enabled(). But if @pdev is an endpoint of a multiple function device, perhaps we still need to check acs on it? -- Best regards, baolu