Message ID | 20231202012556.2012281-17-volodymyr_babchuk@epam.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | PCI devices passthrough on Arm, part 3 | expand |
On 02.12.2023 02:27, Volodymyr Babchuk wrote: > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -695,6 +695,9 @@ struct domain *domain_create(domid_t domid, > radix_tree_init(&d->pirq_tree); > } > > + if ( !is_idle_domain(d) ) > + d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex); > + > if ( (err = arch_domain_create(d, config, flags)) != 0 ) > goto fail; > init_status |= INIT_arch; > @@ -711,7 +714,6 @@ struct domain *domain_create(domid_t domid, > watchdog_domain_init(d); > init_status |= INIT_watchdog; > > - d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex); > d->irq_caps = rangeset_new(d, "Interrupts", 0); > if ( !d->iomem_caps || !d->irq_caps ) > goto fail; I'm pretty sure I asked before why I/O mem caps' init would be moved, but IRQ caps' would remain where it is. Jan
On 12/4/23 03:29, Jan Beulich wrote: > On 02.12.2023 02:27, Volodymyr Babchuk wrote: >> --- a/xen/common/domain.c >> +++ b/xen/common/domain.c >> @@ -695,6 +695,9 @@ struct domain *domain_create(domid_t domid, >> radix_tree_init(&d->pirq_tree); >> } >> >> + if ( !is_idle_domain(d) ) >> + d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex); >> + >> if ( (err = arch_domain_create(d, config, flags)) != 0 ) >> goto fail; >> init_status |= INIT_arch; >> @@ -711,7 +714,6 @@ struct domain *domain_create(domid_t domid, >> watchdog_domain_init(d); >> init_status |= INIT_watchdog; >> >> - d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex); >> d->irq_caps = rangeset_new(d, "Interrupts", 0); >> if ( !d->iomem_caps || !d->irq_caps ) >> goto fail; > > I'm pretty sure I asked before why I/O mem caps' init would be moved, but > IRQ caps' would remain where it is. You did. Sorry about that, I made the change locally but forgot to propagate it to Volodymyr. I will reply here with the updated patch. > > Jan
diff --git a/xen/arch/arm/vpci.c b/xen/arch/arm/vpci.c index 348ba0fbc8..b6ef440f17 100644 --- a/xen/arch/arm/vpci.c +++ b/xen/arch/arm/vpci.c @@ -2,6 +2,7 @@ /* * xen/arch/arm/vpci.c */ +#include <xen/iocap.h> #include <xen/sched.h> #include <xen/vpci.h> @@ -115,8 +116,16 @@ int domain_vpci_init(struct domain *d) return ret; } else + { register_mmio_handler(d, &vpci_mmio_handler, GUEST_VPCI_ECAM_BASE, GUEST_VPCI_ECAM_SIZE, NULL); + iomem_permit_access(d, paddr_to_pfn(GUEST_VPCI_MEM_ADDR), + paddr_to_pfn(GUEST_VPCI_MEM_ADDR + + GUEST_VPCI_MEM_SIZE - 1)); + iomem_permit_access(d, paddr_to_pfn(GUEST_VPCI_PREFETCH_MEM_ADDR), + paddr_to_pfn(GUEST_VPCI_PREFETCH_MEM_ADDR + + GUEST_VPCI_PREFETCH_MEM_SIZE - 1)); + } return 0; } diff --git a/xen/common/domain.c b/xen/common/domain.c index 9b8902daa3..dccd272533 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -695,6 +695,9 @@ struct domain *domain_create(domid_t domid, radix_tree_init(&d->pirq_tree); } + if ( !is_idle_domain(d) ) + d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex); + if ( (err = arch_domain_create(d, config, flags)) != 0 ) goto fail; init_status |= INIT_arch; @@ -711,7 +714,6 @@ struct domain *domain_create(domid_t domid, watchdog_domain_init(d); init_status |= INIT_watchdog; - d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex); d->irq_caps = rangeset_new(d, "Interrupts", 0); if ( !d->iomem_caps || !d->irq_caps ) goto fail;