Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8107975rwl; Tue, 10 Jan 2023 09:07:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXvYeEMjj2IyRgmGwqxDSYJuP8LzI8AWUmYJY/XABtTRAeKbTJkJVFe6+IaxcCllXO/Dp+c6 X-Received: by 2002:a17:906:b053:b0:7c1:1b89:1fe0 with SMTP id bj19-20020a170906b05300b007c11b891fe0mr55489341ejb.65.1673370471256; Tue, 10 Jan 2023 09:07:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673370471; cv=pass; d=google.com; s=arc-20160816; b=qYbj3ebLRh77/rf3CSD2fwT0Z5I9INcwm8Cz4Cl+oyAVz2LKpgVeHtPKz03bsvDrL9 1ZNXxeFRpUjYMb8vlgntji3Oox7Vurt+jA6tHg9dV+/wVMW12WjtPpVY/fNIvTESxapf 1PyaASTuQsrUD3bZ4ZJL+t/eo7AMrDRNi6IvDHoiwYr61BnwtFqVo6p/QtheEW/CT4Dx 24SHZoX1fZvp1krjUgmBB3+Icu9OBu9tUf97DsZBLeVSpJyRIyQ9BPKK9bZmoXDGMjif axt6Rx1cc3pNT5gDWS36dDlT9LhTd0D8Pgga9VxW1S3W51wYoPrTOi0dSP+CbBkaeic0 dpDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:references:cc:to:from:content-language:subject :user-agent:date:message-id:dkim-signature; bh=0UmDIc0mJ8d02puVT+VwovxQSSYhGPrEYO2ZQE6fxOY=; b=VUXtegoCI7x+qIcW3kbWLzMJSPImq/bjP5+oxNFFhlJBrTFrVHm9jDcerpLt1x4uaG YB7NHNM0ZNzbGCkFbV+HFtzpUY7CBMh6OvcNlITGT3ef+W/AbbZy7gwqzMQ5yXn8x0Ky na+JrYFEcjqvzA1aLuflwRLpQOTHaT6jF44Jfp2C+krc9caZtDftvHFbS6p7xHgen5hK wD/LI5MzquHP3bI3jX/m+JEgAnmMu9yK7lP3N2aexuMGDqs8tWhJG8FLsSsy+tlPftPJ oc0hhOIs5QZ/nRUwojOnAdA7ErBwM2uHIYfQIaRDU9GD2Gyh/xybUaRhxgYKOBffqBYR zJ8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="TTBr/PIY"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ft31-20020a170907801f00b007bfacfbd8b8si8778382ejc.140.2023.01.10.09.07.38; Tue, 10 Jan 2023 09:07:51 -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=@amd.com header.s=selector1 header.b="TTBr/PIY"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238265AbjAJQMp (ORCPT + 53 others); Tue, 10 Jan 2023 11:12:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238160AbjAJQMm (ORCPT ); Tue, 10 Jan 2023 11:12:42 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2089.outbound.protection.outlook.com [40.107.244.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A58EF564DA; Tue, 10 Jan 2023 08:12:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IloUwU8eFLUl0t/Y/Zf7XvQbroXbtxiXppGROXy8hbv7+Z08gFTwDCbIB5Wqn7BhtZq77wxNQqRCeQMjDNkzQ7GVTF9182tWXsMk3UvXE6huPSbhU8Cvx+G/gOQJn0wC1diPv4UbQsOGjIMvxoWERIlVzS+s9mSpa8uy4gsVuHqv9bW04OF0Urn2qqLLKKfU2mMRl6DWrMk1uXAqpWcjfk/0CIxJRcwSLuAKQtq/+3vyZoIFZ6rfX+MkeJqvOIYC4Tz4DMbD9ZSIkE52LjW85Xzz6/OQKGkfekj0HbTKD7gwh8uJTnGTu/5s54EdYWm5CZSzM54jDS++x+cb97j+xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0UmDIc0mJ8d02puVT+VwovxQSSYhGPrEYO2ZQE6fxOY=; b=kzdpHZzPLtd2D/ZSFanUcepTESjL5ospcgimDgq71e48Ch3jaYOO1oAG4Xrq5+OXK7Q6fkaKU2QjmvweuVuOHuOGJUtoqdd1h713t4wse2r/LjEKFDLvOkKarrCL2rLxjPdvKecuG76h2nRDE7P2/FZQhzvVrltEb7YRs7yRrYoG2hiOhMHxL2BpvOetv4Nw9NI4eBKGKQ/E5vvPlKDM/Hxs2lO4MY8/3DJ+X8caQ/9EJfPBSjt17xsbo5pV1jJRRGblYTVD22NI/7qa1Kq/kkVdt/7nG/DZ/sRe+/b6auxObGohPaANfCGm7oslnNiY74iPIwivU+fWMXKgQbVM5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0UmDIc0mJ8d02puVT+VwovxQSSYhGPrEYO2ZQE6fxOY=; b=TTBr/PIYuUK02C7cgobEd9lU8iLb6JVMfx2DDjVgi8/0tBywdpi6ZKhua+zZIuNdv6jBSzaHxf7XyYwc1o3L/y5YwHznIYYiiakMs/rpd+QlcQ3G/wHDRUTsOC/UqmDXR+bimtPQXqPrPCEY8IJgTNgU/f5AN85AzteKagkHYP4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DS7PR12MB6048.namprd12.prod.outlook.com (2603:10b6:8:9f::5) by DS0PR12MB7631.namprd12.prod.outlook.com (2603:10b6:8:11e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 16:12:39 +0000 Received: from DS7PR12MB6048.namprd12.prod.outlook.com ([fe80::4014:79ea:392b:b4f6]) by DS7PR12MB6048.namprd12.prod.outlook.com ([fe80::4014:79ea:392b:b4f6%4]) with mapi id 15.20.5986.018; Tue, 10 Jan 2023 16:12:39 +0000 Message-ID: Date: Tue, 10 Jan 2023 21:42:26 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.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 From: Vasant Hegde To: Matt Fagnani , Baolu Lu , Thorsten Leemhuis Cc: 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> <525730fd-5982-fea7-b6d5-2da69f225f04@amd.com> In-Reply-To: <525730fd-5982-fea7-b6d5-2da69f225f04@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0192.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:e8::17) To DS7PR12MB6048.namprd12.prod.outlook.com (2603:10b6:8:9f::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB6048:EE_|DS0PR12MB7631:EE_ X-MS-Office365-Filtering-Correlation-Id: 6991a81b-81b2-407f-2a15-08daf3257e6d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kPDG2Uuj0Ut9+hbB68CyAveoGaML3uGkRp5cOcJCREUbmGw0ghje+QAT7BmB18FSX5qS7+QGS7VSTaMhOtCXRvPLtMFf8EkdpkNMUlBvkUng2Xypw2PVu9oIQWHH4R3lvT1lP2mPmygWz+K8N/9RpwUl+9Edoq7caJUJkbX5B0K084nj7xTW3kb3IDJzeMKEDt/xyjdagnzh5Jn6C7ubpl51NiwZ8F2DAs3BcyM/aWJVi+nTy/Bo/HuczJ59IBBgmohZknw/pO3UnK2+Px5IxBBAc4RH4cMHtOrDsY2aPUkjKOB3mc5chQwkA4wKZUETdJKKzbcS+Wm10dTRU3A5KKNc3hwOdXAe89reOX+zAVtDRE3tpAVKsh7ziI/igELzW/ZH7plZ7rdP2ecFXi5AHKZ2odh8cll1uUNM56SIDPQ4zxjU0MNLSc/0zuXI425CDjDn/bFUbzHiuqtUIDKuGn8PIepmMNeTfYfEy8eBw02DIneVXKmIx3NfHKYGx+MOMtXDn3XRA7x/RNlzHlxsmDjvwOiOu1Qubr+6zojagKQKXGq5fw8fnGaeVxYq2qTAsNhzIt0eMhF8H+biSKt+OoApoRRusuTPCMZEtmxuXPwN5HEOmcMH4P0XieptJvh5o0vsLOTaQF0W7Zms25L+yVYXkvT7eTUwq5uRUSHPd9U4WeZkRxAJv5iI9cVfTn0I0z0HiC4tbeDjp0GBlzrOxNTU3Kps5moHzMdV6V3HJz4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB6048.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(396003)(39860400002)(366004)(136003)(451199015)(41300700001)(54906003)(316002)(110136005)(2616005)(66476007)(66556008)(4326008)(36756003)(66946007)(86362001)(31696002)(5660300002)(83380400001)(38100700002)(44832011)(8936002)(2906002)(66899015)(6506007)(53546011)(31686004)(6486002)(6512007)(6666004)(186003)(478600001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MEl1M1ZMdFFzbzA5WVQ1NmROM3lvcEtVOHdvSGhWeGdYZWJRc2xTb0hCenlu?= =?utf-8?B?QVlscWNheU4xTXhMbTZuNHNPSU5yUUtuSE9nMkVQY2JmOUNNdCtOYTBLNXBi?= =?utf-8?B?TXBiS2V4TnpHZjZNMllRbTJkdHVZak43a3BpRjZJbEVRQlcxRzhDa0haL0Zj?= =?utf-8?B?eFNkWmkzVXM2ejVGZlBJQXFJcDByVHg4TzNkU2VGdDBlVXB3cUdhO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QWEQvUHZjeEN1Sjh1cTVBOENlSllRNnZhVjNL?= =?utf-8?B?b1BmdXUwUFdIY2ovcnNzTVBSMy8xTmRlZU95ZnRjeUVCM0NTZ1h2TnJ1UklP?= =?utf-8?B?ZmVHcUdRK2hjNFRlWUc2ZHIwYnREaFFxSWNyd3kxRjBYSWhRVWpEVjJhbFRa?= =?utf-8?Q?jDIk7Xtcwn0I0tZe1wmV2+fa36vA+v8TLOs+FmIX97aQ?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6991a81b-81b2-407f-2a15-08daf3257e6d X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB6048.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 16:12:39.0375 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XCZ4wCnXVg2KQ0G0CyiYraIv6k3Cjf1XCsZPlM+HWVhOe5RN9YYQq4M/13jxUaFcfG5J4GiwF6imjgZGyeFFVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7631 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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/10/2023 9:38 PM, Vasant Hegde wrote: > Matt, > > > On 1/6/2023 12:58 PM, Matt Fagnani wrote: >> I booted 6.2-rc2 + patch with rd.driver.blacklist=amdgpu on the kernel command >> line to prevent amdgpu from being started while the initramfs was in use. The >> black screen problem happened later in the boot. I pressed sysrq+alt+s,u,b to do >> an emergency sync, remount read-only, and reboot. The journal for that boot was >> shown on the next boot. The two warnings which I previously reported weren't >> shown in the journal, but the same null pointer dereference which made amdgpu >> crash happened. I'm attaching the kernel log from the journal of that boot. >> > > Thanks for your effort to get boot log. This is helpful. > > Looking into the code further, > iommu_detach_group() didn't attach devices back to default_domain. ... because iommu_detach_group() expects new domain should be different from group->domain. -Vasant > So IOMMU > point of view device group was left in inconsistent state. This resulted in > IOMMU throwing page fault errors and amd IOMMU event handler code always assumes > that domain is setup properly. That resulted in below NULL pointer dereference > issue. > > Jan 06 02:07:52 kernel: BUG: kernel NULL pointer dereference, address: > 0000000000000058 > Jan 06 02:07:52 kernel: #PF: supervisor read access in kernel mode > Jan 06 02:07:53 kernel: #PF: error_code(0x0000) - not-present page > Jan 06 02:07:53 kernel: PGD 0 P4D 0 > Jan 06 02:07:53 kernel: Oops: 0000 [#1] PREEMPT SMP NOPTI > Jan 06 02:07:53 kernel: CPU: 2 PID: 56 Comm: irq/24-AMD-Vi Not tainted > 6.2.0-rc2+ #89 > Jan 06 02:07:53 kernel: Hardware name: HP HP Laptop 15-bw0xx/8332, BIOS F.52 > 12/03/2019 > Jan 06 02:07:53 kernel: RIP: 0010:report_iommu_fault+0x11/0x90 > > Ideally if domain attach fails (in this case its because pasid capability check > returned error) we should put devices back to original domain.. so that it can > continue without PASID capability. > > I have a patch to handle these error conditions (not the fix for original > issue). I will try to post it soon. > > -Vasant