acrn-hypervisor/hypervisor/include
Zhao Yakui 296b649ae9 ACRN/HV: emulated pcicfg uses the aligned offset to fix the unaligned pci_cfg access
When the SOS kernel/pre-launched OS access the 0xCF8/0xCFC, it will cause
the vm-exit and then the hypervisor tries to emulate the PCI_cfg access.
0xCF8 write:  The bdf/reg is captured. cache_reg = value & (0xFF);
0xCFC-0xCFF read/write: offset = address - 0xCFC. Then cached_reg + offset is
used as the offset to access the pci_cfg.

If the aligned reg is passed in 0xCF8 register, it can work well. But when
the unaligned reg is passed in 0xCF8 register, the cached_reg + offset will cause
that the incorrect pci_cfg offset is accessed. For example:
   The cached_reg = 0x02(Device_ID offset) based on the value passed from 0xCF8
   offset = 2 based on 0xCFC-0xCFF address.
   Then cached_reg + offset is used as the offset(PCI_CMD_REG)

In fact the unaligned reg can work well on the real HW.

So the cached_reg should be aligned to handle the unaligned reg passed in
0xCF8 reg.

Tracked-On: #3249
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-06-13 10:28:17 +08:00
..
arch/x86 HV: introduce relative vm id for hcall api 2019-06-12 11:00:40 +08:00
common hv: Remove unused variable in ptirq_msi_info 2019-05-31 12:31:52 +08:00
debug xHV: remove unused function is_dbg_uart_enabled 2019-05-22 16:36:03 +08:00
dm HV:Modularize vpic code to remove usage of acrn_vm 2019-06-13 09:54:52 +08:00
hw ACRN/HV: emulated pcicfg uses the aligned offset to fix the unaligned pci_cfg access 2019-06-13 10:28:17 +08:00
lib hv:move several files related X86 for lib 2019-05-13 10:12:20 +08:00
public DM/HV: Increase VM name len 2019-05-27 12:13:51 +08:00