[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/4] PCI: determine whether a device has extended config space
- To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
- Date: Fri, 23 Jan 2026 17:24:31 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- 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=ylhPBn0aGTmRvTfH0JHtAIj7AzMi3dvEcsyCPPWGOwk=; b=O5Lkv7WM7ddamwJgqfqKc/xaTFyDCwc9LZAtVbu2Bpo8cls3coo/wJ7G7pFAGqbXVG6+tOD3j4Bb8hCcWlIrXnnflYafREL7bKIEM5XeGfh1GlOeQMi465Vu2BL1KRleUwwK2Cppwesi2Wp2P8vldGatC8CPuQpr/Cyb/oD3llUgRFpTZtI2lHEAaXwq9otnppu7SqxQ952s9x7JoylmOyNouW9cdNTZSJ8XyJk3D/80RKRMv2O9R2/h2fzBQfAQfgDODs6vxz3Myt4QlqYPIR+GO3HSVBIs5X4aq85vGAVG19d5fuwV63F9tL7XR/zrvNBdoWm2f8VsLLID0CA3SQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xpqGgvEzl3sjIy1DxzOMYiAt6cg3peEnlss+v/zyvI1knSs2NNM6VQyKJh0u8GTtnJJd03bsfK2LLfdmwyJAe6dYxhHH6rUh0FsetQlx6VryHoVWqlUan3g54J7grPzIXWLSvWfNZrcIUpgFiAKBqWvP9iQcwwE9+BBXJdPv2XK3NwcL1g+W6JvKoKupBbgYfvgvIBhdtI5UZgCW0sxbrn1Tf+JHbqsrWv8k0H4sjyfEdjbeP1sw1G+ZXmwdBCkVyhHz9RnSInQqQWM/nItJkZM5emuz9jz87MCjQh6TSrjxttTm1cpFNj0kfAPClJIVrq65RGmmJV/hQl5IhkgUVg==
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Fri, 23 Jan 2026 22:25:06 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 1/19/26 09:46, Jan Beulich wrote:
> Legacy PCI devices don't have any extended config space. Reading any part
> thereof may return all ones or other arbitrary data, e.g. in some cases
> base config space contents repeatedly.
>
> Logic follows Linux 6.19-rc's pci_cfg_space_size(), albeit leveraging our
> determination of device type; in particular some comments are taken
> verbatim from there.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
> ---
> Should we skip re-evaluation when pci_mmcfg_arch_enable() takes its early
> exit path?
I don't have a strong opinion here, though I'm leaning toward it's OK as is.
>
> The warning near the bottom of pci_check_extcfg() may be issued multiple
> times for a single device now. Should we try to avoid that?
If I'm reading Linux drivers/xen/pci.c correctly, my understanding is that dom0
will only invoke PHYSDEVOP_pci_mmcfg_reserved once per mmcfg segment, so in
practice it's unlikely to spam. In other words, I think it's OK as is.
>
> Note that no vPCI adjustments are done here, but they're going to be
> needed: Whatever requires extended capabilities will need re-
> evaluating / newly establishing / tearing down in case an invocation of
> PHYSDEVOP_pci_mmcfg_reserved alters global state.
Agreed. The current patch is prerequisite for this work. Hm, perhaps we could
create a gitlab ticket for it?
|