为什么 lscpi 的输出与 BAR 不一致
why output of lscpi is inconsistent with respect to BAR
下面是我 lspci -xxxx -vvvv -nn
的输出
00:02.0 VGA compatible controller [0300]: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter [80ee:beef] (prog-if 00 [VGA controller])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 18
Region 0: Memory at e0000000 (32-bit, prefetchable) [size=64M]
Expansion ROM at <unassigned> [disabled]
Kernel driver in use: vboxvideo
00: ee 80 ef be 07 00 00 00 00 00 00 03 00 00 00 00
10: 08 00 00 e0 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 0b 01 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
具体想问一下以下几行:
Region 0: Memory at e0000000 (32-bit, prefetchable) [size=64M]
和
10: 08 00 00 e0 00 00 00 00 00 00 00 00 00 00 00 00
基于this (look at section 12.1.3),BAR0
的值应该是e0000008
而不是e0000000
,即最后一个字节应该是08
而不是00
,就像 Region 0
的描述中所说的那样。为什么会这样?我错过了什么?
低4位实际上不是地址的一部分。该特定位(值为 0x08 的位#3)是将该区域标记为可预取的位。请参阅 https://en.wikipedia.org/wiki/PCI_configuration_space#Bus_enumeration or http://wiki.osdev.org/PCI#Base_Address_Registers 或在网络上搜索 "PCI configuration space header"
下面是我 lspci -xxxx -vvvv -nn
00:02.0 VGA compatible controller [0300]: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter [80ee:beef] (prog-if 00 [VGA controller])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 18
Region 0: Memory at e0000000 (32-bit, prefetchable) [size=64M]
Expansion ROM at <unassigned> [disabled]
Kernel driver in use: vboxvideo
00: ee 80 ef be 07 00 00 00 00 00 00 03 00 00 00 00
10: 08 00 00 e0 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 0b 01 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
具体想问一下以下几行:
Region 0: Memory at e0000000 (32-bit, prefetchable) [size=64M]
和
10: 08 00 00 e0 00 00 00 00 00 00 00 00 00 00 00 00
基于this (look at section 12.1.3),BAR0
的值应该是e0000008
而不是e0000000
,即最后一个字节应该是08
而不是00
,就像 Region 0
的描述中所说的那样。为什么会这样?我错过了什么?
低4位实际上不是地址的一部分。该特定位(值为 0x08 的位#3)是将该区域标记为可预取的位。请参阅 https://en.wikipedia.org/wiki/PCI_configuration_space#Bus_enumeration or http://wiki.osdev.org/PCI#Base_Address_Registers 或在网络上搜索 "PCI configuration space header"