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

Re: [Xen-devel] [PATCH v3 2/3] svm: iommu: Only call guest_iommu_init() after initialized HVM domain

>>> On 22.05.16 at 01:42, <suravee.suthikulpanit@xxxxxxx> wrote:
> From: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
> The guest_iommu_init() is currently called by the following code path:
>     arch/x86/domain.c: arch_domain_create()
>       ]- drivers/passthrough/iommu.c: iommu_domain_init()
>         |- drivers/passthrough/amd/pci_amd_iommu.c: amd_iommu_domain_init();
>           |- drivers/passthrough/amd/iommu_guest.c: guest_iommu_init()
> At this point, the hvm_domain_initialised() has not been called.
> So register_mmio_handler() in guest_iommu_init() silently fails.
> This patch moves the iommu_domain_init() to a later point after the
> hvm_domain_intialise() instead.

That's one possible approach, which I continue to be not really
happy with. guest_iommu_init() really is HVM-specific, so maybe
no longer calling it from amd_iommu_domain_init() would be the
better solution (instead calling it from hvm_domain_initialise()
would then seem to be the better option). Thoughts?

In any event is the choice of ...

> @@ -675,6 +675,9 @@ int arch_domain_create(struct domain *d, unsigned int 
> domcr_flags,
>      return 0;
> + fail_1:
> +    if ( has_hvm_container_domain(d) )
> +        hvm_domain_destroy(d);
>   fail:
>      d->is_dying = DOMDYING_dead;
>      psr_domain_free(d);

... the new label name sub-optimal. Please pick something more
descriptive, e.g. "iommu_fail", if the current approach is to be


Xen-devel mailing list



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