Skip to content

Commit 5d013ed

Browse files
ZideChen0lijinxia
authored andcommitted
hv: vpci: revert the temporary workaround of handling I/O port CF9
Revert the temporary workaround of calling allow_guest_pio_access() to reset the I/O bitmap for CF9. For CONFIG_ADDR register, only intercept I/O port CF8 to achieve these: - In SOS, I/O bitmap for port CF9 is not set. - In UOS or in partition mode, I/O requests to CF9/CFA/CFB won't be handled by pci_cfgaddr_io_read/write() any more. Tracked-On: #1815 Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent fe9a340 commit 5d013ed

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

hypervisor/dm/vpci/vpci.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void vpci_init(struct acrn_vm *vm)
105105
struct vm_io_range pci_cfgaddr_range = {
106106
.flags = IO_ATTR_RW,
107107
.base = PCI_CONFIG_ADDR,
108-
.len = 4U
108+
.len = 1U
109109
};
110110

111111
struct vm_io_range pci_cfgdata_range = {
@@ -123,18 +123,17 @@ void vpci_init(struct acrn_vm *vm)
123123
#endif
124124

125125
if ((vpci->ops->init != NULL) && (vpci->ops->init(vm) == 0)) {
126+
/*
127+
* SOS: intercep port CF8 only.
128+
* UOS or partition mode: register handler for CF8 only and I/O requests to CF9/CFA/CFB are
129+
* not handled by vpci.
130+
*/
126131
register_io_emulation_handler(vm, PCI_CFGADDR_PIO_IDX, &pci_cfgaddr_range,
127132
pci_cfgaddr_io_read, pci_cfgaddr_io_write);
128133

134+
/* Intercept and handle I/O ports CFC -- CFF */
129135
register_io_emulation_handler(vm, PCI_CFGDATA_PIO_IDX, &pci_cfgdata_range,
130136
pci_cfgdata_io_read, pci_cfgdata_io_write);
131-
132-
/* This is a tmp solution to avoid sos reboot failure, it need pass-thru IO port CF9 for Reset Control
133-
* register.
134-
*/
135-
if (is_vm0(vm)) {
136-
allow_guest_pio_access(vm, (uint16_t)0xCF9U, 1U);
137-
}
138137
}
139138
}
140139

0 commit comments

Comments
 (0)