Re: Failure to shutdown/reboot with intel_iommu=on
From: Uwe Kleine-König
Date: Mon May 11 2020 - 16:17:05 EST
Hello again,
On Mon, May 11, 2020 at 09:59:31PM +0200, Uwe Kleine-König wrote:
> On 5/9/20 3:58 AM, Lu Baolu wrote:
> > Hi Uwe,
> >
> > Have you tried commenting out intel_disable_iommus() in
> > intel_iommu_shutdowan()?
> >
> > diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> > index 0182cff2c7ac..532e62600f95 100644
> > --- a/drivers/iommu/intel-iommu.c
> > +++ b/drivers/iommu/intel-iommu.c
> > @@ -4928,8 +4928,10 @@ void intel_iommu_shutdown(void)
> > for_each_iommu(iommu, drhd)
> > iommu_disable_protect_mem_regions(iommu);
> >
> > +#if 0
> > /* Make sure the IOMMUs are switched off */
> > intel_disable_iommus();
> > +#endif
> >
> > up_write(&dmar_global_lock);
> > }
>
> I just tested that and it didn't help. The machine still hangs with the
> same symptoms as reported before.
I patched the file a bit differently:
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index ef0a5246700e..b76acae6a6ac 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4922,16 +4922,24 @@ void intel_iommu_shutdown(void)
if (no_iommu || dmar_disabled)
return;
+ pr_warn("%s:%d\n", __func__, __LINE__);
down_write(&dmar_global_lock);
+ pr_warn("%s:%d\n", __func__, __LINE__);
/* Disable PMRs explicitly here. */
- for_each_iommu(iommu, drhd)
+ for_each_iommu(iommu, drhd) {
+ pr_warn("%s:%d\n", __func__, __LINE__);
iommu_disable_protect_mem_regions(iommu);
+ pr_warn("%s:%d\n", __func__, __LINE__);
+ }
+ pr_warn("%s:%d\n", __func__, __LINE__);
/* Make sure the IOMMUs are switched off */
intel_disable_iommus();
+ pr_warn("%s:%d\n", __func__, __LINE__);
up_write(&dmar_global_lock);
+ pr_warn("%s:%d\n", __func__, __LINE__);
}
static inline struct intel_iommu *dev_to_intel_iommu(struct device *dev)
and the output shows that the for_each_iommu loop runs twice and the
last pr_warn is reached, too. So the hang doesn't occur in
intel_iommu_shutdown() but later.
I don't know enough about x86 and iommus to judge what that means or
even if this was a useful test.
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature