[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 5/6] x86/PCI: avoid re-evaluation of extended config space accessibility


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 29 Jan 2026 16:32:42 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VuIVjMsD8z/WTemF1vaO+4Tej9Jwy+LLlnwIfT0DoJg=; b=SczC2JXn6oBTQYBcqh0XDMGFGi1Oqo40AmRTZyXR0PyAHfqwqQOl8GIaGs2HBGuy/GANzxHe+XsKXa91+20KYE13tbQ4ZQE81tVSMeRHMBZbuYJ2+p2n463MuuCQaPUg4cMoZxu2v/zTPOvdodZrS+QrmjJoCgqp9QJyUruM4BLXeqh0ZGukAptVZ500ZwBCNMW251iUdGRi30uG3lDgzpLARyncBh/alJKGBx2PLf2k3avnlwEJG9VGMNDDvSnJmrES1Pj0fDGVGDFAH8tyLifPddRX0UcFLEP8I7T3pProxXOF6pqEv2zpMpjeITST0u6PjjZTuHEV8NNj0DlCTA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FfLMKSdz7+RoM5YCHz6Um8j3jcNZC3RGdTKubZiES/xYun7abeAmhXfG1a5PMzmfj/hNq0sOdQYGjkbnpsBckG8NkHFwVtcxgAgS2Ir9iDaaM+rdtt9Plxb3uT66izlnLgE2/F6rc6UnjwO51yMJlbxieCOJZHc57luSwQY0eDhOUrV/jz+ek36zP54kIkuMaDKFqyeooVcXfmMOgBg0d3YabB8i35L6DNNR/INzIYyHwzGWCKNyDPOxpjgtRDDPQ7+shw/A0G6fKRXIo3gC04NzpO+e1sReyuiy1qixSFI1VwPc+2AodRTjkvGZqFYtnZ8r1viInEzWEl4AAB7maQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Delivery-date: Thu, 29 Jan 2026 15:32:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Jan 29, 2026 at 02:10:01PM +0100, Jan Beulich wrote:
> When, during boot, we have already correctly determined availability of
> the MMCFG access method for a given bus range, there's then no need to
> invoke pci_check_extcfg() again for every of the devices. This in
> particular avoids ->ext_cfg to transiently indicate the wrong state.
> 
> Switch to using Xen style on lines being touched and immediately adjacent
> ones.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

One suggestion for a further addition below.

> ---
> v3: New.
> 
> --- a/xen/arch/x86/physdev.c
> +++ b/xen/arch/x86/physdev.c
> @@ -528,6 +528,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
>          if ( !ret )
>              ret = pci_segment_iterate(info.segment, physdev_check_pci_extcfg,
>                                        &info);
> +        else if ( ret > 0 ) /* Indication of "no change". */
> +            ret = 0;
>  
>          if ( !ret && has_vpci(currd) && (info.flags & 
> XEN_PCI_MMCFG_RESERVED) )

Maybe it doesn't need to be strictly done here, but now that
pci_mmcfg_reserved() signals whether the MMCFG was already registered,
could you also restrict the register_vpci_mmcfg_handler() call to ret
== 0?

That will also simplify the logic in register_vpci_mmcfg_handler()
since we no longer need to return 0 when the region is already
registered, returning -EEXIST should be fine if the caller is
adjusted.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.