public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "joro@8bytes.org" <joro@8bytes.org>
To: "Su, Friendy" <Friendy.Su@sony.com.cn>
Cc: "iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 1/1] iommu/amd: set iommu for early mapped ioapic/hpet
Date: Wed, 3 Sep 2014 17:05:38 +0200	[thread overview]
Message-ID: <20140903150538.GJ28786@8bytes.org> (raw)
In-Reply-To: <053191AD6E9023439BF3970DE870051856D1EF3AC4@APSHAXMS02.ap.sony.com>

On Mon, Sep 01, 2014 at 02:17:44PM +0800, Su, Friendy wrote:
> diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
> index 3783e0b..148ab61 100644
> --- a/drivers/iommu/amd_iommu_init.c
> +++ b/drivers/iommu/amd_iommu_init.c
> @@ -747,7 +747,7 @@ static int __init add_special_device(u8 type, u8 id, u16 devid, bool cmd_line)
>  	return 0;
>  }
>  
> -static int __init add_early_maps(void)
> +static int __init add_early_maps(struct amd_iommu *iommu)
>  {
>  	int i, ret;
>  
> @@ -758,6 +758,11 @@ static int __init add_early_maps(void)
>  					 early_ioapic_map[i].cmd_line);
>  		if (ret)
>  			return ret;
> +		/*
> +		 * early mapped ioapci overrides ACPI IVRS,
> +		 * they should be always controlled by iommu.
> +		 */
> +		set_iommu_for_device(iommu, early_ioapic_map[i].devid);
>  	}
>  
>  	for (i = 0; i < early_hpet_map_size; ++i) {
> @@ -767,6 +772,11 @@ static int __init add_early_maps(void)
>  					 early_hpet_map[i].cmd_line);
>  		if (ret)
>  			return ret;
> +		/*
> +		 * early mapped hpet overrides ACPI IVRS,
> +		 * they should be always controlled by iommu.
> +		 */
> +		set_iommu_for_device(iommu, early_hpet_map[i].devid);

This doesn't work on machines with multiple IOMMUs in it. Also the
problem only exists if there is no IVHD entry in the IVRS table for the
device containing IOAPIC and HPET.

But if this IVHD entry is not present we can't reliably know which IOMMU
is responsible for a given IOAPIC/HPET.


	Joerg


  reply	other threads:[~2014-09-03 15:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  6:17 [PATCH v1 1/1] iommu/amd: set iommu for early mapped ioapic/hpet Su, Friendy
2014-09-03 15:05 ` joro [this message]
2014-09-05 11:17   ` Su, Friendy

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=20140903150538.GJ28786@8bytes.org \
    --to=joro@8bytes.org \
    --cc=Friendy.Su@sony.com.cn \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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