Description of problem: Anolis OS 8.6 ANCK内核开启intel_iommu=on参数,启动时崩溃。 Version-Release number of selected component (if applicable): Anolis OS 8.6 anck 4.19.91-26.an8 How reproducible: Steps to Reproduce: 1.内核参数增加intel_iommu=on 2.reboot Actual results: 内核崩溃不断重启 Expected results: 正常启动 Additional info: 启动报错日志: [ 0.510411] SGX disabled by BIOS [ 1.959852] integrity: Unable to open file: /etc/keys/x509_ima.der (-2) [ 1.959855] integrity: Unable to open file: /etc/keys/x509_evm.der (-2) [ OK ] Started Show Plymouth Boot Screen. [ OK ] Reached target Paths. [ OK ] Started Forward Password Requests to Plymouth Directory Watch. [ 2.418199] kernel BUG at drivers/iommu/intel-iommu.c:1228! [ 2.423772] invalid opcode: 0000 [#1] SMP NOPTI [ 2.428294] CPU: 0 PID: 5 Comm: kworker/0:0 Tainted: G E 4.19.91-26.an8.x86_64 #1 [ 2.437052] Hardware name: Inspur NF5180M6/NF5180M6, BIOS 06.00.03 01/28/2022 [ 2.444171] Workqueue: events work_for_cpu_fn [ 2.448517] RIP: 0010:domain_unmap+0x3e/0xf0 [ 2.452776] Code: 00 8d 4c c0 1e 83 f9 40 41 0f 4f c8 83 e9 0c 83 f9 3f 7f 18 49 89 f0 49 d3 e8 4d 85 c0 75 5d 48 89 d3 48 d3 eb 48 85 db 74 02 <0f> 0b 48 39 d6 0f 87 8e 00 00 00 49 89 d4 48 8b 97 70 0a 00 00 6a [ 2.471479] RSP: 0018:ffffaa11401f3c98 EFLAGS: 00010206 [ 2.476694] RAX: 0000000000000000 RBX: 0000000007ffffff RCX: 0000000000000012 [ 2.483810] RDX: 00001fffffffffff RSI: 0000000000000000 RDI: ffff9ed2dae3d800 [ 2.490924] RBP: ffff9ed2dae3db08 R08: 0000000000000000 R09: ffffffff8b5ed792 [ 2.498041] R10: 0000000000000008 R11: dead000000000100 R12: ffff9ed2dae3db08 [ 2.505156] R13: 0000000000000202 R14: 00000000ffffffff R15: 0000000000001000 [ 2.512273] FS: 0000000000000000(0000) GS:ffff9ed2dfa00000(0000) knlGS:0000000000000000 [ 2.520340] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2.526070] CR2: 00007ff4cf423660 CR3: 0000000dab20a005 CR4: 0000000000770ef0 [ 2.533179] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 2.533181] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 2.533181] PKRU: 55555554 [ 2.533182] Call Trace: [ 2.533188] domain_exit.part.22+0x81/0xa0 [ 2.556621] find_or_alloc_domain.constprop.33+0x82/0x2d0 [ 2.556624] get_valid_domain_for_dev+0x36/0x100 [ 2.556626] __intel_map_single+0x4e/0x130 [ 2.556628] intel_alloc_coherent+0xa6/0x130 [ 2.556638] megasas_init_fw+0x3c3/0x1e90 [megaraid_sas] [ 2.556645] megasas_probe_one+0x160/0x620 [megaraid_sas] [ 2.556649] local_pci_probe+0x41/0x90 [ 2.556651] work_for_cpu_fn+0x16/0x20 [ 2.556654] process_one_work+0x18f/0x380 [ 2.556656] worker_thread+0x1c9/0x380 [ 2.556658] ? process_one_work+0x380/0x380 [ 2.556660] kthread+0x112/0x130 [ 2.556662] ? kthread_park+0x80/0x80 [ 2.556665] ret_from_fork+0x1f/0x40 [ 2.556668] Modules linked in: megaraid_sas(E+) i2c_core(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) fuse(E) [ 2.626248] ---[ end trace 6b2f8311d32d70cc ]--- [ 2.632220] libata version 3.00 loaded. [ 2.633925] dca service started, version 1.12.1 [ 2.637835] RIP: 0010:domain_unmap+0x3e/0xf0 [ 2.648716] Code: 00 8d 4c c0 1e 83 f9 40 41 0f 4f c8 83 e9 0c 83 f9 3f 7f 18 49 89 f0 49 d3 e8 4d 85 c0 75 5d 48 89 d3 48 d3 eb 48 85 db 74 02 <0f> 0b 48 39 d6 0f 87 8e 00 00 00 49 89 d4 48 8b 97 70 0a 00 00 6a [ 2.648717] RSP: 0018:ffffaa11401f3c98 EFLAGS: 00010206 [ 2.648723] RAX: 0000000000000000 RBX: 0000000007ffffff RCX: 0000000000000012 [ 2.648723] RDX: 00001fffffffffff RSI: 0000000000000000 RDI: ffff9ed2dae3d800 [ 2.648724] RBP: ffff9ed2dae3db08 R08: 0000000000000000 R09: ffffffff8b5ed792 [ 2.648725] R10: 0000000000000008 R11: dead000000000100 R12: ffff9ed2dae3db08 [ 2.648725] R13: 0000000000000202 R14: 00000000ffffffff R15: 0000000000001000 [ 2.648726] FS: 0000000000000000(0000) GS:ffff9ed2dfa00000(0000) knlGS:0000000000000000 [ 2.648727] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2.648728] CR2: 00007ff4cf423660 CR3: 0000000dab20a005 CR4: 0000000000770ef0 [ 2.648728] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 2.648729] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 2.648731] PKRU: 55555554 [ 2.746080] Kernel panic - not syncing: Fatal exception [ 2.747086] Kernel Offset: 0xa000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) [ 2.768511] Rebooting in 1 seconds.. [ 3.772138] ACPI MEMORY or I/O RESET_REG.
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/1647
The IOMMU driver calculates the guest addressability for a DMA request based on the value of the mgaw reported from the IOMMU. However, this is a fused value and as mentioned in the spec, the guest width should be calculated based on the minimum of supported adjusted guest address width (SAGAW) and MGAW. This is from specification: "Guest addressability for a given DMA request is limited to the minimum of the value reported through this field and the adjusted guest address width of the corresponding page-table structure. (Adjusted guest address widths supported by hardware are reported through the SAGAW field)." This issue happens when the value of the sagaw corresponds to a 48-bit agaw.
该问题已解决,patch已合入ANCK 4.19.