Skip to contentSkip to conversation

WARNING: amd_iommu. linux-4.4.1-rt6

DISCUSSION DIXLOR 3 participants 5 messages Feb 23, 2016 – Feb 27, 2016 IOMMU

lore
Share & tools
lore

DIXLOR

author
#0 lore raw
[    1.828887] iommu: Adding device 0000:00:14.5 to group 10
[    1.831805] ------------[ cut here ]------------
[    1.831814] WARNING: CPU: 0 PID: 1 at drivers/iommu/amd_iommu.c:1958 0xffffffff812d6449()
[    1.831817] Modules linked in:
[    1.831827] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W       4.4.1-rt6+ #5
[    1.831831] Hardware name: empty empty/S8225, BIOS 'V3.03   ' 11/01/2012
[    1.831835]  ffffffff815fd5cc ffffffff81224d47 0000000000000000 ffffffff81034e17
[    1.831847]  ffff8804231a5a00 ffff880422bb8420 ffff88042310e898 ffff880423934000
[    1.831858]  ffff880422bb8400 ffffffff812d6449 ffff880422b5e7f8 ffff880422b5e8e8
[    1.831868] Call Trace:
[    1.831873]  [<ffffffff81224d47>] ? 0xffffffff81224d47
[    1.831878]  [<ffffffff81034e17>] ? 0xffffffff81034e17
[    1.831883]  [<ffffffff812d6449>] ? 0xffffffff812d6449
[    1.831889]  [<ffffffff812d398c>] ? 0xffffffff812d398c
[    1.831894]  [<ffffffff812d40c2>] ? 0xffffffff812d40c2
[    1.831899]  [<ffffffff812d7313>] ? 0xffffffff812d7313
[    1.831904]  [<ffffffff812d3080>] ? 0xffffffff812d3080
[    1.831909]  [<ffffffff812d30a0>] ? 0xffffffff812d30a0
[    1.831913]  [<ffffffff8130fce7>] ? 0xffffffff8130fce7
[    1.831918]  [<ffffffff812d3bab>] ? 0xffffffff812d3bab
[    1.831923]  [<ffffffff8173b173>] ? 0xffffffff8173b173
[    1.831928]  [<ffffffff8171c2de>] ? 0xffffffff8171c2de
[    1.831933]  [<ffffffff8173b2be>] ? 0xffffffff8173b2be
[    1.831937]  [<ffffffff8173b339>] ? 0xffffffff8173b339
[    1.831942]  [<ffffffff8171c2ec>] ? 0xffffffff8171c2ec
[    1.831946]  [<ffffffff810003e2>] ? 0xffffffff810003e2
[    1.831952]  [<ffffffff81718e0d>] ? 0xffffffff81718e0d
[    1.831956]  [<ffffffff81504810>] ? 0xffffffff81504810
[    1.831961]  [<ffffffff81504815>] ? 0xffffffff81504815
[    1.831966]  [<ffffffff8150936f>] ? 0xffffffff8150936f
[    1.831971]  [<ffffffff81504810>] ? 0xffffffff81504810
[    1.831976] ---[ end trace 0000000000000010 ]---

---

Called from amd_iommu.c, __attach_device() from attach_device()

static int __attach_device(struct iommu_dev_data *dev_data,
struct protection_domain *domain)

{
        int ret;

        /*
         * Must be called with IRQs disabled. Warn here to detect early
         * when its not.
         */
        WARN_ON(!irqs_disabled());
        ^^^^^^^^^^^^^^^^^^^^^^^^^^  WARNING

...
}

static int attach_device(struct device *dev,
struct protection_domain *domain)
{
...

        }

        write_lock_irqsave(&amd_iommu_devtable_lock, flags);
        ret = __attach_device(dev_data, domain);
        write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);

...

#1 lore raw
Quoted 5 lines · * DIXLOR | 2016-02-23 03:34:37 [+0300]:
[    1.828887] iommu: Adding device 0000:00:14.5 to group 10
[    1.831805] ------------[ cut here ]------------
[    1.831814] WARNING: CPU: 0 PID: 1 at

drivers/iommu/amd_iommu.c:1958 0xffffffff812d6449()

please don't cut it in the middle

Quoted 9 lines
[    1.831817] Modules linked in:
[    1.831827] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W       4.4.1-rt6+ #5
[    1.831831] Hardware name: empty empty/S8225, BIOS 'V3.03   ' 11/01/2012
[    1.831835]  ffffffff815fd5cc ffffffff81224d47 0000000000000000 ffffffff81034e17
[    1.831847]  ffff8804231a5a00 ffff880422bb8420 ffff88042310e898 ffff880423934000
[    1.831858]  ffff880422bb8400 ffffffff812d6449 ffff880422b5e7f8 ffff880422b5e8e8
[    1.831868] Call Trace:
[    1.831873]  [<ffffffff81224d47>] ? 0xffffffff81224d47
[    1.831878]  [<ffffffff81034e17>] ? 0xffffffff81034e17

and provide a resolved stack strace.

Sebastian

#2 lore raw
In reply to DIXLOR
Quoted 8 lines · DIXLOR
[    1.828887] iommu: Adding device 0000:00:14.5 to group 10
[    1.831805] ------------[ cut here ]------------
[    1.831814] WARNING: CPU: 0 PID: 1 at drivers/iommu/amd_iommu.c:1958

0xffffffff812d6449()

static int __attach_device(struct iommu_dev_data *dev_data,
struct protection_domain *domain)

Quoted 9 lines
{
        int ret;

        /*
         * Must be called with IRQs disabled. Warn here to detect early
         * when its not.
         */
        WARN_ON(!irqs_disabled());
        ^^^^^^^^^^^^^^^^^^^^^^^^^^  WARNING

The patch below fixes that.

Thanks,

tglx

8<--------------------------------

drivers/iommu/amd_iommu.c +3 -3
@@ -1952,10 +1952,10 @@ static int __attach_device(struct iommu_
 	int ret;
 
 	/*
-	 * Must be called with IRQs disabled. Warn here to detect early
-	 * when its not.
+	 * Must be called with IRQs disabled on a non RT kernel. Warn here to
+	 * detect early when its not.
 	 */
-	WARN_ON(!irqs_disabled());
+	WARN_ON_NORT(!irqs_disabled());
 
 	/* lock domain */
 	spin_lock(&domain->lock);
#3 lore raw

drivers/iommu/amd_iommu.c static int __attach_device(struct iommu_ · line 1958

Quoted 13 lines · Thomas Gleixner
drivers/iommu/amd_iommu.c +3 -3
@@ -1952,10 +1952,10 @@ static int __attach_device(struct iommu_
 	int ret;
 
 	/*
-	 * Must be called with IRQs disabled. Warn here to detect early
-	 * when its not.
+	 * Must be called with IRQs disabled on a non RT kernel. Warn here to
+	 * detect early when its not.
 	 */
-	WARN_ON(!irqs_disabled());
+	WARN_ON_NORT(!irqs_disabled());

That wants to be

+ WARN_ON_NONRT(!irqs_disabled());

of course.

-ENOTAWAKEYET

author
#4 lore raw

Yet another WARN

[    2.667483] WARNING: CPU: 6 PID: 1 at drivers/iommu/amd_iommu.c:2124 0xffffffff812cd85a()
[    2.667484] Modules linked in:
[    2.667488] CPU: 6 PID: 1 Comm: swapper/0 Tainted: G U          4.4.2-plx+ #6
[    2.667489] Hardware name: empty empty/S8225, BIOS 'V3.03   ' 11/01/2012
[    2.667490]  ffffffff815efa4c ffffffff8121e0d6 0000000000000000 ffffffff81033fef
[    2.667492]  ffff880422992180 ffff8804230e0098 ffff8804229c0800 ffff880423934000
[    2.667493]  ffff880422a0c000 ffffffff812cd85a ffff880422992180 ffff8804230e0098
[    2.667495] Call Trace:
[    2.667497]  [<ffffffff8121e0d6>] ? 0xffffffff8121e0d6
[    2.667498]  [<ffffffff81033fef>] ? 0xffffffff81033fef
[    2.667499]  [<ffffffff812cd85a>] ? 0xffffffff812cd85a
[    2.667500]  [<ffffffff812cd886>] ? 0xffffffff812cd886
[    2.667500]  [<ffffffff812cd9a7>] ? 0xffffffff812cd9a7
[    2.667501]  [<ffffffff814fa559>] ? 0xffffffff814fa559
[    2.667502]  [<ffffffff812cb3aa>] ? 0xffffffff812cb3aa
[    2.667502]  [<ffffffff812cb9da>] ? 0xffffffff812cb9da
[    2.667503]  [<ffffffff812ceaa3>] ? 0xffffffff812ceaa3
[    2.667504]  [<ffffffff812ca7e8>] ? 0xffffffff812ca7e8
[    2.667504]  [<ffffffff812ca808>] ? 0xffffffff812ca808
[    2.667505]  [<ffffffff81306adf>] ? 0xffffffff81306adf
[    2.667506]  [<ffffffff812cb33a>] ? 0xffffffff812cb33a
[    2.667507]  [<ffffffff8172b08a>] ? 0xffffffff8172b08a
[    2.667507]  [<ffffffff8170c281>] ? 0xffffffff8170c281
[    2.667508]  [<ffffffff8172b1d5>] ? 0xffffffff8172b1d5
[    2.667509]  [<ffffffff8172b250>] ? 0xffffffff8172b250
[    2.667509]  [<ffffffff8170c28f>] ? 0xffffffff8170c28f
[    2.667510]  [<ffffffff810003df>] ? 0xffffffff810003df
[    2.667511]  [<ffffffff81708e04>] ? 0xffffffff81708e04
[    2.667511]  [<ffffffff814f62c8>] ? 0xffffffff814f62c8
[    2.667512]  [<ffffffff814f62cd>] ? 0xffffffff814f62cd
[    2.667513]  [<ffffffff814facef>] ? 0xffffffff814facef
[    2.667513]  [<ffffffff814f62c8>] ? 0xffffffff814f62c8
[    2.667514] ---[ end trace 0000000000000001 ]---

27.02.2016 12:58, Thomas Gleixner пишет:

Quoted 22 lines · Thomas Gleixner

drivers/iommu/amd_iommu.c static int __attach_device(struct iommu_ · line 1958

Quoted 13 lines
drivers/iommu/amd_iommu.c +3 -3
@@ -1952,10 +1952,10 @@ static int __attach_device(struct iommu_
  	int ret;
 
  	/*
-	 * Must be called with IRQs disabled. Warn here to detect early
-	 * when its not.
+	 * Must be called with IRQs disabled on a non RT kernel. Warn here to
+	 * detect early when its not.
  	 */
-	WARN_ON(!irqs_disabled());
+	WARN_ON_NORT(!irqs_disabled());

That wants to be

(quoted diff) +1 -0
+	WARN_ON_NONRT(!irqs_disabled());

of course.

-ENOTAWAKEYET