iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: Baoquan He <bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [Patch v2 7/9] iommu/amd: copy old tables and do not update dev tables before driver init
Date: Fri, 27 Nov 2015 12:35:17 +0100	[thread overview]
Message-ID: <20151127113517.GF24300@8bytes.org> (raw)
In-Reply-To: <1446811851-20623-8-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Fri, Nov 06, 2015 at 08:10:49PM +0800, Baoquan He wrote:
> Signed-off-by: Baoquan He <bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Missing patch description.

> ---
>  drivers/iommu/amd_iommu.c      | 19 +++++------
>  drivers/iommu/amd_iommu_init.c | 71 ++++++++++++++++++++++++------------------
>  2 files changed, 49 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 48bcd83..90c6205 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -1992,14 +1992,15 @@ static void do_attach(struct iommu_dev_data *dev_data,
>  	/* Update data structures */
>  	dev_data->domain = domain;
>  	list_add(&dev_data->list, &domain->dev_list);
> -	set_dte_entry(dev_data->devid, domain, ats);
> +	if (!translation_pre_enabled()) {
> +		set_dte_entry(dev_data->devid, domain, ats);
> +		/* Flush the DTE entry */
> +		device_flush_dte(dev_data);
> +	}

Hmm, this patch adds a lot of special cases into the AMD IOMMU code to
make sure the domain is attached at driver init time.

Can we change the code to generally defer domain attachment to driver
init time? There is a set_dma_mask call-back in the dma-ops that can be
used for that.

This would limit the special cases to device table initialization and
iommu enable time.

> +	if ( !translation_pre_enabled()) {
> +		if (flags & ACPI_DEVFLAG_INITPASS)
> +			set_dev_entry_bit(devid, DEV_ENTRY_INIT_PASS);
> +		if (flags & ACPI_DEVFLAG_EXTINT)
> +			set_dev_entry_bit(devid, DEV_ENTRY_EINT_PASS);
> +		if (flags & ACPI_DEVFLAG_NMI)
> +			set_dev_entry_bit(devid, DEV_ENTRY_NMI_PASS);
> +		if (flags & ACPI_DEVFLAG_SYSMGT1)
> +			set_dev_entry_bit(devid, DEV_ENTRY_SYSMGT1);
> +		if (flags & ACPI_DEVFLAG_SYSMGT2)
> +			set_dev_entry_bit(devid, DEV_ENTRY_SYSMGT2);
> +		if (flags & ACPI_DEVFLAG_LINT0)
> +			set_dev_entry_bit(devid, DEV_ENTRY_LINT0_PASS);
> +		if (flags & ACPI_DEVFLAG_LINT1)
> +			set_dev_entry_bit(devid, DEV_ENTRY_LINT1_PASS);
> +
> +		amd_iommu_apply_erratum_63(devid);
> +	}

This bothers, will the flags still get set when translation is
pre-enabled?


	Joerg

  parent reply	other threads:[~2015-11-27 11:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06 12:10 [Patch v2 0/9] Fix AMD IOMMU faults in kdump kernel Baoquan He
     [not found] ` <1446811851-20623-1-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-06 12:10   ` [Patch v2 1/9] iommu/amd: Use standard bitmap operation to set bitmap Baoquan He
2015-11-06 12:10   ` [Patch v2 2/9] iommu/amd: Detect pre enabled translation Baoquan He
     [not found]     ` <1446811851-20623-3-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-27 11:03       ` Joerg Roedel
     [not found]         ` <20151127110312.GA24300-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-11-30 11:18           ` Baoquan He
2015-11-06 12:10   ` [Patch v2 3/9] iommu/amd: make several functions globally seen Baoquan He
     [not found]     ` <1446811851-20623-4-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-27 11:06       ` Joerg Roedel
     [not found]         ` <20151127110609.GB24300-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-11-30 11:31           ` Baoquan He
2015-11-06 12:10   ` [Patch v2 4/9] iommu/amd: add copy_irq_table function Baoquan He
     [not found]     ` <1446811851-20623-5-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-27 11:13       ` Joerg Roedel
     [not found]         ` <20151127111312.GC24300-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-11-30 11:49           ` Baoquan He
2015-11-06 12:10   ` [Patch v2 5/9] iommu/amd: Add function copy_dev_tables Baoquan He
     [not found]     ` <1446811851-20623-6-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-27 11:21       ` Joerg Roedel
     [not found]         ` <20151127112152.GD24300-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-11-30 11:59           ` Baoquan He
2015-11-06 12:10   ` [Patch v2 6/9] iommu/amd: Add functions copy_command_buffer/copy_event_buffer Baoquan He
     [not found]     ` <1446811851-20623-7-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-27 11:24       ` Joerg Roedel
     [not found]         ` <20151127112446.GE24300-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-11-30 12:02           ` Baoquan He
2015-11-06 12:10   ` [Patch v2 7/9] iommu/amd: copy old tables and do not update dev tables before driver init Baoquan He
     [not found]     ` <1446811851-20623-8-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-27 11:35       ` Joerg Roedel [this message]
     [not found]         ` <20151127113517.GF24300-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-11-30 12:13           ` Baoquan He
2015-12-13  1:19           ` Baoquan He
     [not found]             ` <20151213011929.GA2490-ejN7fcUYdH/by3iVrkZq2A@public.gmane.org>
2015-12-16 15:51               ` Joerg Roedel
2015-11-06 12:10   ` [Patch v2 8/9] iommu/amd: Do not update the information of domain to devtables before device " Baoquan He
2015-11-06 12:10   ` [Patch v2 9/9] iommu/amd: Clear the iommu pre enabled setting Baoquan He
2015-11-06 12:14   ` [Patch v2 0/9] Fix AMD IOMMU faults in kdump kernel Baoquan He
2015-11-18  6:14   ` Baoquan He
2015-11-27 11:38   ` Joerg Roedel
     [not found]     ` <20151127113816.GG24300-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-11-30 11:16       ` Baoquan He

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=20151127113517.GF24300@8bytes.org \
    --to=joro-zlv9swrftaidnm+yrofe0a@public.gmane.org \
    --cc=bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.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;
as well as URLs for NNTP newsgroup(s).