x86/PVH: PHYSDEVOP_pci_mmcfg_reserved should not blindly register a region
authorJan Beulich <jbeulich@suse.com>
Thu, 14 May 2020 05:53:55 +0000 (07:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 14 May 2020 05:53:55 +0000 (07:53 +0200)
The op has a "is reserved" flag, and hence registration shouldn't
happen unilaterally.

Fixes: eb3dd90e4089 ("x86/physdev: enable PHYSDEVOP_pci_mmcfg_reserved for PVH Dom0")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/physdev.c

index 3a3c15890b03c913df30f4aaaf4c9e765563c909..23465bcd00e1b88b13aed06a4c6eae0a7a464654 100644 (file)
@@ -556,7 +556,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         ret = pci_mmcfg_reserved(info.address, info.segment,
                                  info.start_bus, info.end_bus, info.flags);
-        if ( !ret && has_vpci(currd) )
+        if ( !ret && has_vpci(currd) && (info.flags & XEN_PCI_MMCFG_RESERVED) )
         {
             /*
              * For HVM (PVH) domains try to add the newly found MMCFG to the