rangeset_remove_range() uses inclusive ranges, and hence the end of the range should be calculated using PFN_DOWN(), not PFN_UP().
Fixes: 4acab25a9300 ('x86/vpci: fix handling of BAR overlaps with non-hole regions') Signed-off-by: Roger Pau Monné <roger....@citrix.com> --- xen/arch/x86/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/pci.c b/xen/arch/x86/pci.c index afaf9fe1c053..26bb7f6a3c3a 100644 --- a/xen/arch/x86/pci.c +++ b/xen/arch/x86/pci.c @@ -131,7 +131,7 @@ int pci_sanitize_bar_memory(struct rangeset *r) continue; rc = rangeset_remove_range(r, PFN_DOWN(entry->addr), - PFN_UP(entry->addr + entry->size - 1)); + PFN_DOWN(entry->addr + entry->size - 1)); if ( rc ) return rc; } -- 2.49.0