diff --git a/hw/pass-through.c b/hw/pass-through.c index 6b08441..9c43b82 100644 --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -1863,7 +1863,13 @@ static uint32_t pt_bar_reg_init(struct pt_dev *ptdev, ptdev->bases[index].bar_flag = pt_bar_reg_parse(ptdev, reg); if (ptdev->bases[index].bar_flag == PT_BAR_FLAG_UNUSED) reg_field = PT_INVALID_REG; - + else if (ptdev->bases[index].bar_flag == PT_BAR_FLAG_MEM) + { + reg_field = (*((uint32_t*)(ptdev->dev.config + real_offset))) + & PCI_BASE_ADDRESS_MEM_MASK; + PT_LOG("Use real BAR value for initial value of emulated BAR" + "(index[%d], value[%04x]).\n", index, reg_field); + } return reg_field; }