Hello Viresh
[Sorry for the possible format issues]
On Wed, Feb 1, 2023 at 11:04 AM Oleksandr Tyshchenko olekstysh@gmail.com wrote:
Hello Viresh
[Sorry for the possible format issues]
On Mon, Jan 30, 2023 at 12:10 PM Viresh Kumar viresh.kumar@linaro.org wrote:
On 30-01-23, 14:21, Viresh Kumar wrote:
I tried to hack it up, to keep backend in Dom0 only and create the iommu nodes unconditionally and the guest kernel is crashing in drivers/iommu/iommu.c:332
iommu_dev = ops->probe_device(dev);
I think your driver broke in v6.0 ?
commit 57365a04c921 ("iommu: Move bus setup to IOMMU device registration")
Interesting, thank you for the information. Last time I have checked against:
https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git/log/?h=for-linus... which doesn't seem to have that commit yet...
Anyway, I will try to get to it, but I am sure when exactly, I hope it will be next week.
I managed to get to my environment, rebase on the latest Linux and re-check. Can confirm, the issue is present. The following diff fixes it for me (I am not 100% sure whether it is a proper fix, but we will see during upstreaming it):
diff --git a/drivers/xen/grant-dma-iommu.c b/drivers/xen/grant-dma-iommu.c index 16b8bc0c0b33..91abb2521187 100644 --- a/drivers/xen/grant-dma-iommu.c +++ b/drivers/xen/grant-dma-iommu.c @@ -16,8 +16,15 @@ struct grant_dma_iommu_device { struct iommu_device iommu; };
-/* Nothing is really needed here */ -static const struct iommu_ops grant_dma_iommu_ops; +static struct iommu_device *grant_dma_iommu_probe_device(struct device *dev) +{ + return ERR_PTR(-ENODEV); +} + +/* At least a dummy probe_device callback is needed here */ +static const struct iommu_ops grant_dma_iommu_ops = { + .probe_device = grant_dma_iommu_probe_device, +};
static const struct of_device_id grant_dma_iommu_of_match[] = { { .compatible = "xen,grant-dma" }, (END)
I am planning to create a proper patch and send it to the mailing list in a few days.
-- viresh
-- Regards,
Oleksandr Tyshchenko