public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Yijing Wang <wangyijing@huawei.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] iommu/vt-d: move up no_iommu and dmar_disabled check
Date: Fri, 4 Jul 2014 11:06:40 +0200	[thread overview]
Message-ID: <20140704090640.GS26537@8bytes.org> (raw)
In-Reply-To: <1400589472-8544-3-git-send-email-wangyijing@huawei.com>

On Tue, May 20, 2014 at 08:37:48PM +0800, Yijing Wang wrote:
> Move up the no_iommu and dmar_disabled check, avoid the
> useless initialization for dmar.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
>  drivers/iommu/intel-iommu.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index e020dcf..6b71608 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -3948,6 +3948,9 @@ int __init intel_iommu_init(void)
>  	/* VT-d is required for a TXT/tboot launch, so enforce that */
>  	force_on = tboot_force_iommu();
>  
> +	if (no_iommu || dmar_disabled)
> +		return ret;
> +
>  	if (iommu_init_mempool()) {
>  		if (force_on)
>  			panic("tboot: Failed to initialize iommu memory\n");
> @@ -3974,9 +3977,6 @@ int __init intel_iommu_init(void)
>  		goto out_free_dmar;
>  	}
>  
> -	if (no_iommu || dmar_disabled)
> -		goto out_free_dmar;
> -
>  	if (list_empty(&dmar_rmrr_units))
>  		printk(KERN_INFO "DMAR: No RMRR found\n");

This breaks the kexec case were the old kernel had VT-d enabled and the
new one disabled. In this case the new kernel might need to disable the
IOMMUs.


	Joerg



  reply	other threads:[~2014-07-04  9:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 12:37 [PATCH 0/6] trivial cleanup for iommu/vt-d Yijing Wang
2014-05-20 12:37 ` [PATCH 1/6] iommu/vt-d: Use list_for_each_safe() to simplify code Yijing Wang
2014-05-20 12:37 ` [PATCH 2/6] iommu/vt-d: move up no_iommu and dmar_disabled check Yijing Wang
2014-07-04  9:06   ` Joerg Roedel [this message]
2014-07-04  9:28     ` Yijing Wang
2014-05-20 12:37 ` [PATCH 3/6] iommu/vt-d: clear the redundant assignment in dmar_enable_qi Yijing Wang
2014-05-20 12:37 ` [PATCH 4/6] iommu/vt-d: clear the redundant assignment for domain->nid Yijing Wang
2014-05-20 12:37 ` [PATCH 5/6] iommu/vt-d: use inline function dma_pte_superpage instead of macros Yijing Wang
2014-05-20 12:37 ` [PATCH 6/6] iommu/vt-d: fix reference count in iommu_prepare_isa Yijing Wang
2014-06-18  0:56 ` [PATCH 0/6] trivial cleanup for iommu/vt-d Yijing Wang
2014-07-04  9:22 ` Joerg Roedel
2014-07-04  9:29   ` Yijing Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140704090640.GS26537@8bytes.org \
    --to=joro@8bytes.org \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangyijing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox