We found when do S3 resume, some older kernel(such as rh5.1)
cmd register might be restored before BAR registers, Since
pt_bar_mapping is done when writing cmd register, it will cause
mapping incorrect address.
It's the root_cause of when doing RH5.1 HVM S3, assigned e1000e
network card fails to resume back. (set pci_power_mgmt=1 in guest
config file, let PM support device enter D3 hot state during guest S3)
we should call pt_bar_mapping in pt_bar_reg_write to avoid this problem
for supporting older kernels.
Signed-off-by: Liping Ke <Liping.Ke@intel.com>
Signed-off-by: Yu Zhao<yu.zhao@intel.com>
Acked-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
throughable_mask = ~bar_emu_mask & valid_mask;
*value = PT_MERGE_VALUE(*value, dev_value, throughable_mask);
+ /* After BAR reg update, we need to remap BAR*/
+ reg_grp_entry = pt_find_reg_grp(ptdev, PCI_COMMAND);
+ if (reg_grp_entry)
+ {
+ reg_entry = pt_find_reg(reg_grp_entry, PCI_COMMAND);
+ if (reg_entry)
+ pt_bar_mapping(ptdev, reg_entry->data & PCI_COMMAND_IO,
+ reg_entry->data & PCI_COMMAND_MEMORY);
+ }
return 0;
}