diff options
Diffstat (limited to 'lib/libvfio-user.c')
-rw-r--r-- | lib/libvfio-user.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index dc13ea5..62efd30 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -1729,6 +1729,17 @@ vfu_realize_ctx(vfu_ctx_t *vfu_ctx) if (!(vfu_ctx->reg_info[i].flags & VFU_REGION_FLAG_MEM)) { vfu_ctx->pci.config_space->hdr.bars[i].io.region_type |= 0x1; } + if ((vfu_ctx->reg_info[i].flags & VFU_REGION_FLAG_64_BITS)) { + vfu_ctx->pci.config_space->hdr.bars[i].mem.locatable + = PCI_BASE_ADDRESS_MEM_TYPE_LOCATABLE_64; + } + if ((vfu_ctx->reg_info[i].flags & VFU_REGION_FLAG_PREFETCH)) { + vfu_ctx->pci.config_space->hdr.bars[i].mem.prefetchable = 1; + if (!(vfu_ctx->reg_info[i].flags & VFU_REGION_FLAG_64_BITS)) { + vfu_log(vfu_ctx, LOG_WARNING, + "Region %d has prefetchable flag set, but not 64bits flag", i); + } + } } if (vfu_ctx->irqs == NULL) { |