Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbdGYN4U (ORCPT ); Tue, 25 Jul 2017 09:56:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46390 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751897AbdGYN4T (ORCPT ); Tue, 25 Jul 2017 09:56:19 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3E0616E78F Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=asavkov@redhat.com Date: Tue, 25 Jul 2017 15:56:18 +0200 From: Artem Savkov To: Joerg Roedel , Thomas Gleixner Cc: iommu@lists.linux-foundation.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: amd-iommu/x2apic: sleeping function called from invalid context Message-ID: <20170725135618.hev4vj7w24gm3a5q@shodan.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: NeoMutt/20161126 (1.7.1) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Jul 2017 13:56:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2238 Lines: 47 Hi, Commit 1c3c5ea "sched/core: Enable might_sleep() and smp_processor_id() checks early" seem to have uncovered an issue with amd-iommu/x2apic. Starting with that commit the following warning started to show up on AMD systems during boot: [ 0.140480] smpboot: Max logical packages: 6 [ 0.160000] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:747 [ 0.160000] in_atomic(): 0, irqs_disabled(): 1, pid: 1, name: swapper/0 [ 0.160000] no locks held by swapper/0/1. [ 0.160000] irq event stamp: 304 [ 0.160000] hardirqs last enabled at (303): [] _raw_spin_unlock_irqrestore+0x36/0x60 [ 0.160000] hardirqs last disabled at (304): [] enable_IR_x2apic+0x79/0x196 [ 0.160000] softirqs last enabled at (36): [] __do_softirq+0x35f/0x4ec [ 0.160000] softirqs last disabled at (31): [] irq_exit+0x105/0x120 [ 0.160000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc2.1.el7a.test.x86_64.debug #1 [ 0.160000] Hardware name: PowerEdge C6145 /040N24, BIOS 3.5.0 10/28/2014 [ 0.160000] Call Trace: [ 0.160000] dump_stack+0x85/0xca [ 0.160000] ___might_sleep+0x22a/0x260 [ 0.160000] __might_sleep+0x4a/0x80 [ 0.160000] __mutex_lock+0x58/0x960 [ 0.160000] ? iommu_completion_wait.part.17+0xb5/0x160 [ 0.160000] ? register_syscore_ops+0x1d/0x70 [ 0.160000] ? iommu_flush_all_caches+0x120/0x150 [ 0.160000] mutex_lock_nested+0x1b/0x20 [ 0.160000] register_syscore_ops+0x1d/0x70 [ 0.160000] state_next+0x119/0x910 [ 0.160000] iommu_go_to_state+0x29/0x30 [ 0.160000] amd_iommu_enable+0x13/0x23 [ 0.160000] irq_remapping_enable+0x1b/0x39 [ 0.160000] enable_IR_x2apic+0x91/0x196 [ 0.160000] default_setup_apic_routing+0x16/0x6e [ 0.160000] native_smp_prepare_cpus+0x257/0x2d5 [ 0.160000] kernel_init_freeable+0x131/0x2a7 [ 0.160000] ? kernel_init+0xe/0x104 [ 0.160000] ? _raw_spin_unlock_irq+0x2c/0x40 [ 0.160000] ? rest_init+0xe0/0xe0 [ 0.160000] kernel_init+0xe/0x104 [ 0.160000] ret_from_fork+0x2a/0x40 [ 0.160010] Switched APIC routing to physical flat. -- Regards, Artem