]> xenbits.xen.org Git - xenclient/ioemu.git/commit
passthrough: pt_bar_mapping etc.: use correct CMD for PCI BAR mapping etc.
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 5 May 2009 14:22:17 +0000 (15:22 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 5 May 2009 14:22:17 +0000 (15:22 +0100)
commit5d767b7b3fac52336f59e5b40d8befa6b1909937
tree00a7f0dc5d232f1147cfd0b6753ce58ae8fa0a6d
parentbe598c20435f39f2d71f4b3d8d0489dd9e3af4ba
passthrough: pt_bar_mapping etc.: use correct CMD for PCI BAR mapping etc.

dbb8aafa702b8b4f5568e08641d98471fd04e0f8 has a bug:
The virtual CMD value we get from reg_entry->data is not the proper
value because reg_entry->data only holds the emulated bits and the
PCI_COMMAND_IO/PCI_COMMAND_MEMORY bits are not in it.  Instead, we can
use pt_pci_read_config(&ptdev->dev, PCI_COMMAND, 2) to get the proper
value.

We should only update the mapping of the related BAR, NOT the mappings
of ALL BARs.

In pt_exp_rom_bar_reg_write(), we should also update the mapping. And
for PCI_ROM_SLOT, when the PCI_ROM_ADDRESS_ENABLE bit is 0, we should
not have the mapping.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
hw/pass-through.c