|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v4 3/5] vpci: allow queueing of mapping operations
On 15.10.2026 16:08, Mykyta Poturai wrote:
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -24,6 +24,11 @@
>
> #ifdef __XEN__
>
> +void vpci_vcpu_init(struct vcpu *v)
> +{
> + INIT_LIST_HEAD(&v->vpci.task_queue);
> +}
If there's more that's going to be added to this function, having it out-of-
line is fine. If it stays like that, it can be inline (and then there won't
be a need for a separate stub).
> --- a/xen/include/xen/vpci.h
> +++ b/xen/include/xen/vpci.h
> @@ -19,6 +19,8 @@
> */
> #define VPCI_MAX_VIRT_DEV (PCI_SLOT(~0) + 1)
>
> +void vpci_vcpu_init(struct vcpu *v);
> +
> /* Assign vPCI to device by adding handlers. */
> int __must_check vpci_assign_device(struct pci_dev *pdev);
>
> @@ -54,7 +56,6 @@ struct vpci {
> uint64_t guest_addr;
> uint64_t size;
> uint64_t resizable_sizes;
> - struct rangeset *mem;
> enum {
> VPCI_BAR_EMPTY,
> VPCI_BAR_IO,
> @@ -152,14 +153,24 @@ struct vpci {
> #endif
> };
>
> -struct vpci_vcpu {
> +#ifdef __XEN__
> +struct vpci_map_task {
> /* Per-vcpu structure to store state while {un}mapping of PCI BARs. */
> - const struct pci_dev *pdev;
> + struct list_head next;
> + struct vpci_bar_map {
> + uint64_t addr;
> + uint64_t guest_addr;
> + struct rangeset *mem;
> + } bars[ARRAY_SIZE(((struct vpci_header *)NULL)->bars)];
> uint16_t cmd;
> bool rom_only : 1;
> + const struct pci_dev *pdev;
> +};
As this struct isn't used anywhere in the header itself, it can likely move
to vPCI's private.h.
Jan
> +struct vpci_vcpu {
> + struct list_head task_queue;
> };
>
> -#ifdef __XEN__
> void vpci_dump_msi(void);
>
> /* Arch-specific vPCI MSI helpers. */
> @@ -204,6 +215,8 @@ bool vpci_ecam_read(pci_sbdf_t sbdf, unsigned int reg,
> unsigned int len,
> #else /* !CONFIG_HAS_VPCI */
> struct vpci_vcpu {};
>
> +static inline void vpci_vcpu_init(struct vcpu *v) { }
> +
> static inline int vpci_reinit_ext_capabilities(struct pci_dev *pdev)
> {
> return 0;
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |