From 6fca30d812e0df9d6428bff9c50f623fa1dd0e18 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 6 Aug 2008 10:55:38 +0100 Subject: [PATCH] pass-through: Fix I/O BAR mapping problem Check BAR type indicator to avoid I/O BAR being mistaken as 64-bit = memory BAR. Signed-off-by: Yu Zhao --- hw/pass-through.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/pass-through.c b/hw/pass-through.c index 7b462344..6d5686fc 100644 --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -1511,7 +1511,9 @@ static int pt_bar_reg_parse( /* check 64bit BAR */ index = pt_bar_offset_to_index(reg->offset); if ((index > 0) && (index < PCI_ROM_SLOT) && - (d->config[bar_64] & PCI_BASE_ADDRESS_MEM_TYPE_64)) + ((d->config[bar_64] & (PCI_BASE_ADDRESS_SPACE | + PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == + (PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64))) { region = &ptdev->bases[index-1]; if (region->bar_flag != PT_BAR_FLAG_UPPER) -- 2.39.5