Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1621740 > unrolled thread

Re: [PATCH] iommu/vt-d: Make sure IOMMUs are off when intel_iommu=off

Started byBaoquan He <bhe@redhat.com>
First post2017-04-12 03:50 +0200
Last post2017-04-13 01:00 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] iommu/vt-d: Make sure IOMMUs are off when intel_iommu=off Baoquan He <bhe@redhat.com> - 2017-04-12 03:50 +0200
    Re: [PATCH] iommu/vt-d: Make sure IOMMUs are off when intel_iommu=off Joerg Roedel <joro@8bytes.org> - 2017-04-13 00:00 +0200
      Re: [PATCH] iommu/vt-d: Make sure IOMMUs are off when intel_iommu=off Baoquan He <bhe@redhat.com> - 2017-04-13 01:00 +0200

#1621740 — Re: [PATCH] iommu/vt-d: Make sure IOMMUs are off when intel_iommu=off

FromBaoquan He <bhe@redhat.com>
Date2017-04-12 03:50 +0200
SubjectRe: [PATCH] iommu/vt-d: Make sure IOMMUs are off when intel_iommu=off
Message-ID<tvfzX-6vh-5@gated-at.bofh.it>
Hi Joerg,

Do you plan to merge this one as urgent?

There's bug created about this issue on rhel, it would be great if it
can be put in next or merged so that we can back port it.

Thanks
Baoquan

On 03/29/17 at 05:00pm, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> When booting into a kexec kernel with intel_iommu=off, and
> the previous kernel had intel_iommu=on, the IOMMU hardware
> is still enabled and gets not disabled by the new kernel.
> 
> This causes the boot to fail because DMA is blocked by the
> hardware. Disable the IOMMUs when we find it enabled in the
> kexec kernel and boot with intel_iommu=off.
> 
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>  drivers/iommu/intel-iommu.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index d412a31..1662288 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -4730,6 +4730,15 @@ static int intel_iommu_cpu_dead(unsigned int cpu)
>  	return 0;
>  }
>  
> +static void intel_disable_iommus(void)
> +{
> +	struct intel_iommu *iommu = NULL;
> +	struct dmar_drhd_unit *drhd;
> +
> +	for_each_iommu(iommu, drhd)
> +		iommu_disable_translation(iommu);
> +}
> +
>  static inline struct intel_iommu *dev_to_intel_iommu(struct device *dev)
>  {
>  	return container_of(dev, struct intel_iommu, iommu.dev);
> @@ -4840,8 +4849,15 @@ int __init intel_iommu_init(void)
>  		goto out_free_dmar;
>  	}
>  
> -	if (no_iommu || dmar_disabled)
> +	if (no_iommu || dmar_disabled) {
> +		/*
> +		 * Make sure the IOMMUs are switched off, even when we
> +		 * boot into a kexec kernel and the previous kernel left
> +		 * them enabled
> +		 */
> +		intel_disable_iommus();
>  		goto out_free_dmar;
> +	}
>  
>  	if (list_empty(&dmar_rmrr_units))
>  		pr_info("No RMRR found\n");
> -- 
> 1.9.1
> 
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu

[toc] | [next] | [standalone]


#1622578

FromJoerg Roedel <joro@8bytes.org>
Date2017-04-13 00:00 +0200
Message-ID<tvysV-1QL-13@gated-at.bofh.it>
In reply to#1621740
Hi Baoquan,

On Wed, Apr 12, 2017 at 09:40:56AM +0800, Baoquan He wrote:
> Do you plan to merge this one as urgent?
> 
> There's bug created about this issue on rhel, it would be great if it
> can be put in next or merged so that we can back port it.

No, I am not sending this for v4.11, because this issue existed forever
and is no regression. I queued it for v4.12 and the commit-id in the
iommu-tree will be the same as upstream, if you need that for your
backport.


	Joerg

[toc] | [prev] | [next] | [standalone]


#1622601

FromBaoquan He <bhe@redhat.com>
Date2017-04-13 01:00 +0200
Message-ID<tvzoZ-2tN-7@gated-at.bofh.it>
In reply to#1622578
On 04/12/17 at 11:54pm, Joerg Roedel wrote:
> Hi Baoquan,
> 
> On Wed, Apr 12, 2017 at 09:40:56AM +0800, Baoquan He wrote:
> > Do you plan to merge this one as urgent?
> > 
> > There's bug created about this issue on rhel, it would be great if it
> > can be put in next or merged so that we can back port it.
> 
> No, I am not sending this for v4.11, because this issue existed forever
> and is no regression. I queued it for v4.12 and the commit-id in the
> iommu-tree will be the same as upstream, if you need that for your
> backport.

Yeah, agree. The commit-id should be enough. Thanks a lot!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web