PCIe BAR空间的值是谁设置的?谁分配的,什么时间分配的?
Linux系统下PCIe总线、设备的枚举,资源的分配到底是哪里进行的?一直没搞太清楚,安装参考中的方法构建文件系统,编译内核,利用Qemu调试分析这个问题如下:
内核代码是5.15.0-107-generic, 工作环境是ubuntu 22.04 server OS。
Qemu虚拟机中的PCIe相关打印和对应函数如下
[ 1.510805] PCI host bridge to bus 0000:00 [ 1.511680] pci_bus 0000:00: root bus resource [bus 00-ff] [ 1.512317] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window] [ 1.512837] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window] [ 1.513208] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window] [ 1.513717] pci_bus 0000:00: root bus resource [mem 0x08000000-0xfebfffff window] [ 1.514096] pci_bus 0000:00: root bus resource [mem 0x100000000-0x17fffffff window] [ 1.517476] pci 0000:00:00.0: [8086:1237] type 00 class 0x060000 ###pci_setup_device函数中打印,如果设备支持extend capbility还会打印“enabling Extended Tags” [ 1.533713] pci 0000:00:01.0: [8086:7000] type 00 class 0x060100 [ 1.535804] pci 0000:00:01.1: [8086:7010] type 00 class 0x010180 [ 1.544586] pci 0000:00:01.1: reg 0x20: [io 0xc040-0xc04f] ###__pci_read_base函数中打印,这里打印了地址资源信息 [ 1.560891] pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7] [ 1.578515] pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io 0x03f6] [ 1.597623] pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177] [ 1.607952] pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io 0x0376] [ 1.658439] pci 0000:00:01.3: [8086:7113] type 00 class 0x068000 [ 1.824434] pci 0000:00:01.3: quirk: [io 0x0600-0x063f] claimed by PIIX4 ACPI [ 1.832974] pci 0000:00:01.3: quirk: [io 0x0700-0x070f] claimed by PIIX4 SMB [ 1.833937] pci 0000:00:01.3: quirk_piix4_acpi+0x0/0x170 took 11718 usecs [ 1.893098] pci 0000:00:02.0: [1234:1111] type 00 class 0x030000 [ 1.934991] pci 0000:00:02.0: reg 0x10: [mem 0xfd000000-0xfdffffff pref] [ 1.972973] pci 0000:00:02.0: reg 0x18: [mem 0xfebb0000-0xfebb0fff] [ 2.034454] pci 0000:00:02.0: reg 0x30: [mem 0xfeba0000-0xfebaffff pref] [ 2.063609] pci 0000:00:02.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff] [ 2.153403] pci 0000:00:03.0: [8086:100e] type 00 class 0x020000 [ 2.166942] pci 0000:00:03.0: reg 0x10: [mem 0xfeb80000-0xfeb9ffff] [ 2.197049] pci 0000:00:03.0: reg 0x14: [io 0xc000-0xc03f] [ 2.226955] pci 0000:00:03.0: reg 0x30: [mem 0xfeb00000-0xfeb7ffff pref] [ 2.360857] ACPI: PCI: Interrupt link LNKA configured for IRQ 10 [ 2.363395] ACPI: PCI: Interrupt link LNKB configured for IRQ 10 [ 2.365571] ACPI: PCI: Interrupt link LNKC configured for IRQ 11 [ 2.367503] ACPI: PCI: Interrupt link LNKD configured for IRQ 11 [ 2.368623] ACPI: PCI: Interrupt link LNKS configured for IRQ 9 [ 2.402194] iommu: Default domain type: Translated [ 2.402507] iommu: DMA domain TLB invalidation policy: lazy mode
调用栈如下,可见是内核扫描到设备的时候setup device的时候会read pci的config
具体细节需要分析__pci_read_base函数,通过gdb调测发现是函数__pci_read_base中下图所示的199行获取的,所以是内核从配置空间中读取的。那是谁在何时设置的呢?
对应如下部分的资源分配
[ 2.170373] PCI host bridge to bus 0000:00 [ 2.178378] pci_bus 0000:00: root bus resource [bus 00-ff] [ 2.189614] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window] [ 2.190759] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window] [ 2.191342] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window] [ 2.192250] pci_bus 0000:00: root bus resource [mem 0x08000000-0xfebfffff window] [ 2.192914] pci_bus 0000:00: root bus resource [mem 0x100000000-0x17fffffff window]
调用栈如下
#0 __request_resource (new=0xffff888005426880, root=0xffff888005436850) at kernel/resource.c:161 #1 request_resource_conflict (root=root@entry=0xffff888005436850, new=new@entry=0xffff888005426880) at kernel/resource.c:258 #2 0xffffffff816cb078 in pci_bus_insert_busn_res (b=b@entry=0xffff888005426800, bus=<optimized out>, bus_max=<optimized out>) at drivers/pci/probe.c:3127 #3 0xffffffff81d3a06a in pci_register_host_bridge (bridge=bridge@entry=0xffff888004f7b400) at drivers/pci/probe.c:1022 #4 0xffffffff816cb4c6 in pci_create_root_bus (parent=parent@entry=0x0 <fixed_percpu_data>, bus=bus@entry=0, ops=0xffffffff831e2ea0 <pci_root_ops>, sysdata=sysdata@entry=0xffff888004f9d4b8, resources=resources@entry=0xffff888004f9d498) at drivers/pci/probe.c:3066 #5 0xffffffff8173c958 in acpi_pci_root_create (root=root@entry=0xffff888004f9de80, ops=ops@entry=0xffffffff831e2960 <acpi_pci_root_ops>, info=info@entry=0xffff888004f9d480, sysdata=sysdata@entry=0xffff888004f9d4b8) at drivers/acpi/pci_root.c:895 #6 0xffffffff81ce66a9 in pci_acpi_scan_root (root=root@entry=0xffff888004f9de80) at arch/x86/pci/acpi.c:434 #7 0xffffffff81d46441 in acpi_pci_root_add (device=0xffff888004f60800, not_used=<optimized out>) at drivers/acpi/pci_root.c:597 #8 0xffffffff8173320d in acpi_scan_attach_handler (device=0xffff888004f60800) at drivers/acpi/scan.c:2138 #9 acpi_bus_attach (device=device@entry=0xffff888004f60800, first_pass=first_pass@entry=true) at drivers/acpi/scan.c:2186 #10 0xffffffff81733150 in acpi_bus_attach (device=device@entry=0xffff888004f61800, first_pass=first_pass@entry=true) at drivers/acpi/scan.c:2207 #11 0xffffffff81733150 in acpi_bus_attach (device=0xffff888004f63800, first_pass=first_pass@entry=true) at drivers/acpi/scan.c:2207 #12 0xffffffff817357ea in acpi_bus_scan (handle=handle@entry=0xffffffffffffffff) at drivers/acpi/scan.c:2379 #13 0xffffffff832f9a3a in acpi_scan_init () at drivers/acpi/scan.c:2554 #14 0xffffffff832f9710 in acpi_init () at drivers/acpi/bus.c:1353 #15 0xffffffff81003999 in do_one_initcall (fn=0xffffffff832f92b0 <acpi_init>) at init/main.c:1295 #16 0xffffffff8329becc in do_initcall_level (command_line=0xffff888004e74f00 "nokaslr", level=4) at init/main.c:1368 #17 do_initcalls () at init/main.c:1384 #18 do_basic_setup () at init/main.c:1403 #19 kernel_init_freeable () at init/main.c:1608 #20 0xffffffff81da3a3b in kernel_init (unused=<optimized out>) at init/main.c:1499 #21 0xffffffff81004c82 in ret_from_fork () at arch/x86/entry/entry_64.S:298 #22 0x0000000000000000 in ?? ()d
对于具体的如下设备
[ 2.309697] pci 0000:00:01.3: [8086:7113] type 00 class 0x068000 [ 2.312786] pci 0000:00:01.3: quirk: [io 0x0600-0x063f] claimed by PIIX4 ACPI [ 2.335864] pci 0000:00:01.3: quirk: [io 0x0700-0x070f] claimed by PIIX4 SMB
对应调用栈
(gdb) bt #0 __request_resource (new=0xffff888004d35700, root=0xffff888004feea40) at kernel/resource.c:161 #1 request_resource_conflict (root=0xffff888004feea40, new=new@entry=0xffff888004d35700) at kernel/resource.c:258 #2 0xffffffff816db5a6 in pci_claim_resource (dev=dev@entry=0xffff888004d35000, resource=resource@entry=13) at drivers/pci/setup-res.c:158 #3 0xffffffff816eea9e in quirk_io_region (dev=dev@entry=0xffff888004d35000, port=port@entry=64, size=size@entry=64, nr=nr@entry=13, name=name@entry=0xffffffff8263085f "PIIX4 ACPI") at drivers/pci/quirks.c:590 #4 0xffffffff816f191c in quirk_piix4_acpi (dev=0xffff888004d35000) at drivers/pci/quirks.c:734 #5 0xffffffff816efe34 in pci_do_fixups (end=0xffffffff82712cb0, f=0xffffffff82711e00, dev=0xffff888004d35000) at drivers/pci/quirks.c:76 #6 pci_fixup_device (pass=pass@entry=pci_fixup_header, dev=dev@entry=0xffff888004d35000) at drivers/pci/quirks.c:151 #7 0xffffffff816ca41f in pci_device_add (dev=dev@entry=0xffff888004d35000, bus=bus@entry=0xffff888005426800) at drivers/pci/probe.c:2563 #8 0xffffffff816ca9d1 in pci_scan_single_device (devfn=11, bus=0xffff888005426800) at drivers/pci/probe.c:2605 #9 pci_scan_single_device (bus=0xffff888005426800, devfn=11) at drivers/pci/probe.c:2591 #10 0xffffffff816caa89 in pci_scan_slot (bus=bus@entry=0xffff888005426800, devfn=devfn@entry=8) at drivers/pci/probe.c:2687 #11 0xffffffff816cbcda in pci_scan_child_bus_extend (bus=bus@entry=0xffff888005426800, available_buses=available_buses@entry=0) at drivers/pci/probe.c:2897 #12 0xffffffff816cbf90 in pci_scan_child_bus (bus=bus@entry=0xffff888005426800) at drivers/pci/probe.c:3025 #13 0xffffffff8173ca27 in acpi_pci_root_create (root=root@entry=0xffff888004f9de80, ops=ops@entry=0xffffffff831e2960 <acpi_pci_root_ops>, info=info@entry=0xffff888004f9d480, sysdata=sysdata@entry=0xffff888004f9d4b8) at drivers/acpi/pci_root.c:925 #14 0xffffffff81ce66a9 in pci_acpi_scan_root (root=root@entry=0xffff888004f9de80) at arch/x86/pci/acpi.c:434 #15 0xffffffff81d46441 in acpi_pci_root_add (device=0xffff888004f60800, not_used=<optimized out>) at drivers/acpi/pci_root.c:597 #16 0xffffffff8173320d in acpi_scan_attach_handler (device=0xffff888004f60800) at drivers/acpi/scan.c:2138 #17 acpi_bus_attach (device=device@entry=0xffff888004f60800, first_pass=first_pass@entry=true) at drivers/acpi/scan.c:2186 #18 0xffffffff81733150 in acpi_bus_attach (device=device@entry=0xffff888004f61800, first_pass=first_pass@entry=true) at drivers/acpi/scan.c:2207 #19 0xffffffff81733150 in acpi_bus_attach (device=0xffff888004f63800, first_pass=first_pass@entry=true) at drivers/acpi/scan.c:2207 #20 0xffffffff817357ea in acpi_bus_scan (handle=handle@entry=0xffffffffffffffff) at drivers/acpi/scan.c:2379 #21 0xffffffff832f9a3a in acpi_scan_init () at drivers/acpi/scan.c:2554 #22 0xffffffff832f9710 in acpi_init () at drivers/acpi/bus.c:1353 #23 0xffffffff81003999 in do_one_initcall (fn=0xffffffff832f92b0 <acpi_init>) at init/main.c:1295 #24 0xffffffff8329becc in do_initcall_level (command_line=0xffff888004e74f00 "nokaslr", level=4) at init/main.c:1368 #25 do_initcalls () at init/main.c:1384 #26 do_basic_setup () at init/main.c:1403 #27 kernel_init_freeable () at init/main.c:1608 #28 0xffffffff81da3a3b in kernel_init (unused=<optimized out>) at init/main.c:1499 #29 0xffffffff81004c82 in ret_from_fork () at arch/x86/entry/entry_64.S:298 #30 0x0000000000000000 in ?? () (gdb) c Continuing. Breakpoint 2, __request_resource (new=0xffff888004d35740, root=0xffff888004feea40) at kernel/resource.c:161 161 resource_size_t start = new->start; (gdb) bt #0 __request_resource (new=0xffff888004d35740, root=0xffff888004feea40) at kernel/resource.c:161 #1 request_resource_conflict (root=0xffff888004feea40, new=new@entry=0xffff888004d35740) at kernel/resource.c:258 #2 0xffffffff816db5a6 in pci_claim_resource (dev=dev@entry=0xffff888004d35000, resource=resource@entry=14) at drivers/pci/setup-res.c:158 #3 0xffffffff816eea9e in quirk_io_region (dev=dev@entry=0xffff888004d35000, port=port@entry=144, size=size@entry=16, nr=nr@entry=14, name=name@entry=0xffffffff8263086a "PIIX4 SMB") at drivers/pci/quirks.c:590 #4 0xffffffff816f193a in quirk_piix4_acpi (dev=0xffff888004d35000) at drivers/pci/quirks.c:735 #5 0xffffffff816efe34 in pci_do_fixups (end=0xffffffff82712cb0, f=0xffffffff82711e00, dev=0xffff888004d35000) at drivers/pci/quirks.c:76 #6 pci_fixup_device (pass=pass@entry=pci_fixup_header, dev=dev@entry=0xffff888004d35000) at drivers/pci/quirks.c:151 #7 0xffffffff816ca41f in pci_device_add (dev=dev@entry=0xffff888004d35000, bus=bus@entry=0xffff888005426800) at drivers/pci/probe.c:2563 #8 0xffffffff816ca9d1 in pci_scan_single_device (devfn=11, bus=0xffff888005426800) at drivers/pci/probe.c:2605 #9 pci_scan_single_device (bus=0xffff888005426800, devfn=11) at drivers/pci/probe.c:2591 #10 0xffffffff816caa89 in pci_scan_slot (bus=bus@entry=0xffff888005426800, devfn=devfn@entry=8) at drivers/pci/probe.c:2687 #11 0xffffffff816cbcda in pci_scan_child_bus_extend (bus=bus@entry=0xffff888005426800, available_buses=available_buses@entry=0) at drivers/pci/probe.c:2897 #12 0xffffffff816cbf90 in pci_scan_child_bus (bus=bus@entry=0xffff888005426800) at drivers/pci/probe.c:3025 #13 0xffffffff8173ca27 in acpi_pci_root_create (root=root@entry=0xffff888004f9de80, ops=ops@entry=0xffffffff831e2960 <acpi_pci_root_ops>, info=info@entry=0xffff888004f9d480, sysdata=sysdata@entry=0xffff888004f9d4b8) at drivers/acpi/pci_root.c:925 #14 0xffffffff81ce66a9 in pci_acpi_scan_root (root=root@entry=0xffff888004f9de80) at arch/x86/pci/acpi.c:434 #15 0xffffffff81d46441 in acpi_pci_root_add (device=0xffff888004f60800, not_used=<optimized out>) at drivers/acpi/pci_root.c:597 #16 0xffffffff8173320d in acpi_scan_attach_handler (device=0xffff888004f60800) at drivers/acpi/scan.c:2138 #17 acpi_bus_attach (device=device@entry=0xffff888004f60800, first_pass=first_pass@entry=true) at drivers/acpi/scan.c:2186 #18 0xffffffff81733150 in acpi_bus_attach (device=device@entry=0xffff888004f61800, first_pass=first_pass@entry=true) at drivers/acpi/scan.c:2207 #19 0xffffffff81733150 in acpi_bus_attach (device=0xffff888004f63800, first_pass=first_pass@entry=true) at drivers/acpi/scan.c:2207 #20 0xffffffff817357ea in acpi_bus_scan (handle=handle@entry=0xffffffffffffffff) at drivers/acpi/scan.c:2379 #21 0xffffffff832f9a3a in acpi_scan_init () at drivers/acpi/scan.c:2554 #22 0xffffffff832f9710 in acpi_init () at drivers/acpi/bus.c:1353 #23 0xffffffff81003999 in do_one_initcall (fn=0xffffffff832f92b0 <acpi_init>) at init/main.c:1295 #24 0xffffffff8329becc in do_initcall_level (command_line=0xffff888004e74f00 "nokaslr", level=4) at init/main.c:1368 #25 do_initcalls () at init/main.c:1384 #26 do_basic_setup () at init/main.c:1403 #27 kernel_init_freeable () at init/main.c:1608 #28 0xffffffff81da3a3b in kernel_init (unused=<optimized out>) at init/main.c:1499 #29 0xffffffff81004c82 in ret_from_fork () at arch/x86/entry/entry_64.S:298 #30 0x0000000000000000 in ?? ()
上述是Qemu虚拟机中的分析,如下是我的物理机器的打印,发现几处异常 “no space for xx failed to assign xx”
通过调查发现该打印对应“bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 83] add_size 200000 add_align 100000” (在函数pbus_size_mem中打印)
add_size 200000 对应__pci_bus_size_bridges函数中的additional_mmio_size = pci_hotplug_mmio_size 大小默认是2M,看样子是针对hotplug预留的mem大小,
进一步调查发现,Linux内核针对hotplug有预留资源(mem io bus),预留大小可以通过启动参数指定,通过cat /proc/cmdline查看,如果不指定,有个默认预留的大小,详见参考6。
这么看这个no space异常是针对hotplug的资源分配失败,为什么呢?根据参考7 猜测可能是UEFI中的实现问题,待确认。
[ 1.226786] pci 0000:82:00.0: bridge window [io 0x1000-0x0fff] to [bus 83] add_size 1000 [ 1.226791] pci 0000:82:00.0: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 83] add_size 200000 add_align 100000 ##__pci_bus_size_bridges--》pbus_size_mem函数中打印的, [ 1.226796] pci 0000:82:00.0: bridge window [mem 0x00100000-0x000fffff] to [bus 83] add_size 200000 add_align 100000 [ 1.226800] pci 0000:82:01.0: bridge window [io 0x1000-0x0fff] to [bus 84] add_size 1000 [ 1.226804] pci 0000:82:01.0: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 84] add_size 200000 add_align 100000 [ 1.226808] pci 0000:82:01.0: bridge window [mem 0x00100000-0x000fffff] to [bus 84] add_size 200000 add_align 100000 [ 1.226812] pci 0000:82:02.0: bridge window [io 0x1000-0x0fff] to [bus 85] add_size 1000 [ 1.226816] pci 0000:82:02.0: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 85] add_size 200000 add_align 100000 [ 1.226820] pci 0000:82:02.0: bridge window [mem 0x00100000-0x000fffff] to [bus 85] add_size 200000 add_align 100000 [ 1.226825] pci 0000:81:00.0: bridge window [io 0x1000-0x0fff] to [bus 82-85] add_size 3000 [ 1.226830] pci 0000:81:00.0: bridge window [mem 0x00100000-0x003fffff 64bit pref] to [bus 82-85] add_size 600000 add_align 100000 [ 1.226835] pci 0000:81:00.0: bridge window [mem 0x00100000-0x003fffff] to [bus 82-85] add_size 600000 add_align 100000 [ 1.226840] pci 0000:80:02.0: bridge window [io 0x1000-0x0fff] to [bus 81-85] add_size 3000 [ 1.226845] pci 0000:80:02.0: bridge window [mem 0x00100000-0x003fffff] to [bus 81-85] add_size 600000 add_align 100000 [ 1.226852] pci 0000:80:02.0: BAR 14: assigned [mem 0xc8000000-0xc88fffff] [ 1.226856] pci 0000:80:02.0: BAR 13: assigned [io 0x8000-0xafff] [ 1.226860] pci 0000:81:00.0: BAR 14: assigned [mem 0xc8000000-0xc88fffff] [ 1.226865] pci 0000:81:00.0: BAR 15: no space for [mem size 0x00900000 64bit pref] [ 1.226869] pci 0000:81:00.0: BAR 15: failed to assign [mem size 0x00900000 64bit pref] [ 1.226873] pci 0000:81:00.0: BAR 13: assigned [io 0x8000-0xafff] [ 1.226877] pci 0000:81:00.0: BAR 14: assigned [mem 0xc8000000-0xc82fffff] [ 1.226880] pci 0000:81:00.0: BAR 15: assigned [mem 0xc8300000-0xc85fffff 64bit pref] [ 1.226885] pci 0000:81:00.0: BAR 14: [mem 0xc8000000-0xc82fffff] (failed to expand by 0x600000) [ 1.226889] pci 0000:81:00.0: failed to add 600000 res[14]=[mem 0xc8000000-0xc82fffff] [ 1.226894] pci 0000:81:00.0: BAR 15: [mem 0xc8300000-0xc85fffff 64bit pref] (failed to expand by 0x600000) [ 1.226899] pci 0000:81:00.0: failed to add 600000 res[15]=[mem 0xc8300000-0xc85fffff 64bit pref] [ 1.226905] pci 0000:82:00.0: BAR 14: assigned [mem 0xc8000000-0xc81fffff] [ 1.226909] pci 0000:82:00.0: BAR 15: assigned [mem 0xc8300000-0xc84fffff 64bit pref] [ 1.226912] pci 0000:82:01.0: BAR 14: no space for [mem size 0x00200000] [ 1.226915] pci 0000:82:01.0: BAR 14: failed to assign [mem size 0x00200000] [ 1.226920] pci 0000:82:01.0: BAR 15: no space for [mem size 0x00200000 64bit pref] [ 1.226923] pci 0000:82:01.0: BAR 15: failed to assign [mem size 0x00200000 64bit pref] [ 1.226927] pci 0000:82:02.0: BAR 14: no space for [mem size 0x00200000] [ 1.226930] pci 0000:82:02.0: BAR 14: failed to assign [mem size 0x00200000] [ 1.226934] pci 0000:82:02.0: BAR 15: no space for [mem size 0x00200000 64bit pref] [ 1.226937] pci 0000:82:02.0: BAR 15: failed to assign [mem size 0x00200000 64bit pref] [ 1.226941] pci 0000:82:00.0: BAR 13: assigned [io 0x8000-0x8fff] [ 1.226944] pci 0000:82:01.0: BAR 13: assigned [io 0x9000-0x9fff] [ 1.226947] pci 0000:82:02.0: BAR 13: assigned [io 0xa000-0xafff] [ 1.226951] pci 0000:82:02.0: BAR 14: assigned [mem 0xc8000000-0xc81fffff] [ 1.226955] pci 0000:82:02.0: BAR 15: assigned [mem 0xc8300000-0xc84fffff 64bit pref] [ 1.226958] pci 0000:82:01.0: BAR 14: no space for [mem size 0x00200000] [ 1.226961] pci 0000:82:01.0: BAR 14: failed to assign [mem size 0x00200000] [ 1.226966] pci 0000:82:01.0: BAR 15: no space for [mem size 0x00200000 64bit pref] [ 1.226969] pci 0000:82:01.0: BAR 15: failed to assign [mem size 0x00200000 64bit pref] [ 1.226972] pci 0000:82:00.0: BAR 14: no space for [mem size 0x00200000] [ 1.226975] pci 0000:82:00.0: BAR 14: failed to assign [mem size 0x00200000] [ 1.226979] pci 0000:82:00.0: BAR 15: no space for [mem size 0x00200000 64bit pref] [ 1.226983] pci 0000:82:00.0: BAR 15: failed to assign [mem size 0x00200000 64bit pref] [ 1.226986] pci 0000:82:00.0: PCI bridge to [bus 83] [ 1.227002] pci 0000:82:00.0: bridge window [io 0x8000-0x8fff] [ 1.227492] pci 0000:82:01.0: PCI bridge to [bus 84] [ 1.227505] pci 0000:82:01.0: bridge window [io 0x9000-0x9fff] [ 1.227994] pci 0000:82:02.0: PCI bridge to [bus 85] [ 1.228008] pci 0000:82:02.0: bridge window [io 0xa000-0xafff] [ 1.228060] pci 0000:82:02.0: bridge window [mem 0xc8000000-0xc81fffff] [ 1.228231] pci 0000:82:02.0: bridge window [mem 0xc8300000-0xc84fffff 64bit pref]
参考:
1)Linux Device Driver Part IV. PCI Device | tcbbd的博客
2)使用 GDB + Qemu 调试 Linux 内核 | Head First eBPF
3)PCI设备的初始化_pci resource start-CSDN博客
4)Linux系统总线之PCI扫描流程_linux pcie扫描过程-CSDN博客
5)Linux PCIe hotplug arch analysis | Sherlock's blog (wangzhou.github.io)
7) 2001719 – fail to hotplug NIC with edk2 firmware (redhat.com)