[bisection] b0119e87083 iommu: Introduce new 'struct iommu_device' ==> boom

From: Mike Galbraith
Date: Tue Feb 21 2017 - 09:55:27 EST


4x18 box (berio) explodes as below after morning master pull. BIOS has
a couple issues, maybe one of them.. helps.

[ 30.796530] ima: No TPM chip found, activating TPM-bypass! (rc=-19)
[ 30.810709] evm: HMAC attrs: 0x1
[ 30.821200] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[ 30.839003] IP: device_del+0x6e/0x350
[ 30.847364] PGD 0
[ 30.847365]
[ 30.855639] Oops: 0000 [#1] SMP
[ 30.862858] Dumping ftrace buffer:
[ 30.870678] (ftrace buffer empty)
[ 30.878849] Modules linked in:
[ 30.885870] CPU: 39 PID: 1 Comm: swapper/0 Not tainted 4.10.0-default #144
[ 30.901334] Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS BRHSXSD1.86B.0056.R01.1409242327 09/24/2014
[ 30.924687] task: ffff88017cab2040 task.stack: ffffc90000038000
[ 30.938040] RIP: 0010:device_del+0x6e/0x350
[ 30.947532] RSP: 0000:ffffc9000003bd50 EFLAGS: 00010246
[ 30.959344] RAX: 0000000000000000 RBX: ffff8810fce66928 RCX: 000077ff80000000
[ 30.975381] RDX: ffff88017cab2040 RSI: 00000000000000ec RDI: ffffffff81a1300b
[ 30.991420] RBP: ffffc9000003bd90 R08: ffff8808fc9bcdb8 R09: 0000000000000000
[ 31.007459] R10: 0000000000000000 R11: ffffc9000003bc08 R12: ffff8810fce66928
[ 31.023497] R13: 0000000000000000 R14: 0000000000000000 R15: ffff8810fce669c8
[ 31.039536] FS: 0000000000000000(0000) GS:ffff88106f8c0000(0000) knlGS:0000000000000000
[ 31.057897] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 31.070867] CR2: 0000000000000008 CR3: 0000000001c09000 CR4: 00000000001406e0
[ 31.086890] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 31.102927] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 31.118967] Call Trace:
[ 31.124641] ? dmar_free_dev_scope+0x62/0x80
[ 31.134347] device_unregister+0x1a/0x60
[ 31.143284] iommu_device_sysfs_remove+0x12/0x20
[ 31.153755] dmar_free_drhd+0x40/0x120
[ 31.162311] dmar_free_unused_resources+0xad/0xc9
[ 31.172975] ? detect_intel_iommu+0xcf/0xcf
[ 31.182487] do_one_initcall+0x51/0x1b0
[ 31.191233] ? parse_args+0x27b/0x460
[ 31.199596] kernel_init_freeable+0x1a2/0x232
[ 31.209490] ? set_debug_rodata+0x12/0x12
[ 31.218619] ? rest_init+0x90/0x90
[ 31.226399] kernel_init+0xe/0x110
[ 31.234186] ret_from_fork+0x2c/0x40
[ 31.242351] Code: 00 00 00 48 81 c7 f0 00 00 00 e8 2e b1 bc ff 48 c7 c7 e0 69 d0 81 4d 8d bc 24 a0 00 00 00 e8 2a f4 1b 00 49 8b 84 24 a8 00 00 00 <48> 8b 48 08 49 39 c7 4c 8d 70 e0 48 8d 59 e0 75 08 eb 2a 49 89
[ 31.284763] RIP: device_del+0x6e/0x350 RSP: ffffc9000003bd50
[ 31.297536] CR2: 0000000000000008
[ 31.305148] ---[ end trace 617d26bc9a426981 ]---


b0119e870837dcd15a207b4701542ebac5d19b45 is the first bad commit
commit b0119e870837dcd15a207b4701542ebac5d19b45
Author: Joerg Roedel <jroedel@xxxxxxx>
Date: Wed Feb 1 13:23:08 2017 +0100

iommu: Introduce new 'struct iommu_device'

This struct represents one hardware iommu in the iommu core
code. For now it only has the iommu-ops associated with it,
but that will be extended soon.

The register/unregister interface is also added, as well as
making use of it in the Intel and AMD IOMMU drivers.

Signed-off-by: Joerg Roedel <jroedel@xxxxxxx>

:040000 040000 cb491d4d5bd25f1b65e6c93f7e67c8594901d6e1 84a5621c5e88961cf2385566c1c28eb5375c413f M drivers
:040000 040000 5a2f0b8b829b29ef80baf6ef7cf2ba4b9bf23bf7 89ecaf2419fe0e00500c23413149f1df7bcbd693 M include

git bisect start
# good: [c470abd4fde40ea6a0846a2beab642a578c0b8cd] Linux 4.10
git bisect good c470abd4fde40ea6a0846a2beab642a578c0b8cd
# bad: [2bfe01eff4307409b95859e860261d0907149b61] Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
git bisect bad 2bfe01eff4307409b95859e860261d0907149b61
# good: [828cad8ea05d194d8a9452e0793261c2024c23a2] Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
git bisect good 828cad8ea05d194d8a9452e0793261c2024c23a2
# bad: [f790bd9c8e826434ab6c326b225276ed0f73affe] Merge tag 'regulator-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
git bisect bad f790bd9c8e826434ab6c326b225276ed0f73affe
# good: [937b5b5ddd2f685b4962ec19502e641bb5741c12] Merge tag 'm68k-for-v4.11-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
git bisect good 937b5b5ddd2f685b4962ec19502e641bb5741c12
# bad: [27a67e0f983567574ef659520d930f82cf65125a] Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
git bisect bad 27a67e0f983567574ef659520d930f82cf65125a
# good: [2c9f1af528a4581e8ef8590108daa3c3df08dd5a] vfio/type1: Fix error return code in vfio_iommu_type1_attach_group()
git bisect good 2c9f1af528a4581e8ef8590108daa3c3df08dd5a
# bad: [ebb4949eb32ff500602f960525592fc4e614c5a7] Merge tag 'iommu-updates-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
git bisect bad ebb4949eb32ff500602f960525592fc4e614c5a7
# bad: [d0f6f5832603931b0a8da044fb9abe8289e201ee] iommu: Remove iommu_register_instance interface
git bisect bad d0f6f5832603931b0a8da044fb9abe8289e201ee
# bad: [39ab9555c24110671f8dc671311a26e5c985b592] iommu: Add sysfs bindings for struct iommu_device
git bisect bad 39ab9555c24110671f8dc671311a26e5c985b592
# good: [534766dfef999f7e7349bbd91cd19c1673792af3] iommu: Rename iommu_get_instance()
git bisect good 534766dfef999f7e7349bbd91cd19c1673792af3
# bad: [b0119e870837dcd15a207b4701542ebac5d19b45] iommu: Introduce new 'struct iommu_device'
git bisect bad b0119e870837dcd15a207b4701542ebac5d19b45
# good: [c09e22d5370739e16463c113525df51b5980b1d5] iommu: Rename struct iommu_device
git bisect good c09e22d5370739e16463c113525df51b5980b1d5
# first bad commit: [b0119e870837dcd15a207b4701542ebac5d19b45] iommu: Introduce new 'struct iommu_device'