linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Bill Sumner <bill.sumner@hp.com>
Cc: dwmw2@infradead.org, indou.takao@jp.fujitsu.com, bhe@redhat.com,
	iommu@lists.linux-foundation.org, kexec@lists.infradead.org,
	alex.williamson@redhat.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, ddutile@redhat.com,
	ishii.hironobu@jp.fujitsu.com, bhelgaas@google.com,
	doug.hatch@hp.com, zhenhua@hp.com
Subject: Re: [PATCHv3 3/6] Crashdump-Accepting-Active-IOMMU-Domain-Interfaces
Date: Tue, 4 Mar 2014 15:59:15 +0100	[thread overview]
Message-ID: <20140304145911.GD2799@8bytes.org> (raw)
In-Reply-To: <1389391652-52422-4-git-send-email-bill.sumner@hp.com>

On Fri, Jan 10, 2014 at 03:07:29PM -0700, Bill Sumner wrote:
> +context_get_entry(struct context_entry *context_addr,
> +			struct intel_iommu *iommu, u32 bus, int devfn)
> +{
> +	unsigned long long q;		/* quadword scratch */
> +	struct root_entry *root_phys;	/* Phys adr (root table entry) */
> +	struct root_entry  root_temp;	/* Local copy of root_entry */
> +	struct context_entry *context_phys;	/* Phys adr */
> +
> +	if (pr_dbg.domain_get)
> +		pr_debug("ENTER %s B:D:F=%2.2x:%2.2x:%1.1x &context_entry:0x%llx &intel_iommu:0x%llx\n",
> +			__func__, bus, devfn>>3, devfn&7,
> +			(u64)context_addr, (u64)iommu);
> +
> +	if (bus > 255)				/* Sanity check */
> +		return -5;
> +	if (devfn > 255 || devfn < 0)		/* Sanity check */
> +		return -6;
> +
> +	q = readq(iommu->reg + DMAR_RTADDR_REG);
> +	pr_debug("IOMMU %d: DMAR_RTADDR_REG:0x%16.16llx\n", iommu->seq_id, q);
> +	if (!q)
> +		return -1;
> +
> +	root_phys = (struct root_entry *) q;	/* Adr(base of vector) */
> +	root_phys += bus;			/* Adr(entry we want) */
> +
> +	oldcopy(&root_temp, root_phys, sizeof(root_temp));
> +
> +	pr_debug("root_temp.val:0x%llx .rsvd1:0x%llx root_phys:0x%llx\n",
> +		root_temp.val, root_temp.rsvd1, (u64)root_phys);
> +
> +	if (!root_present(&root_temp))
> +		return -2;
> +
> +	pr_debug("B:D:F=%2.2x:%2.2x:%1.1x root_temp.val: %llx .rsvd1: %llx\n",
> +		bus, devfn >> 3, devfn & 7, root_temp.val, root_temp.rsvd1);
> +
> +	if (root_temp.rsvd1)			/* If (root_entry is bad) */
> +		return -3;
> +
> +	context_phys = get_context_phys_from_root(&root_temp);
> +	if (!context_phys)
> +		return -4;

What do all these magic return values mean? 



  reply	other threads:[~2014-03-04 14:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10 22:07 [PATCHv3 0/6] Crashdump Accepting Active IOMMU Bill Sumner
2014-01-10 22:07 ` [PATCHv3 1/6] Crashdump-Accepting-Active-IOMMU-Flags-and-Prototype Bill Sumner
2014-01-10 22:07 ` [PATCHv3 2/6] Crashdump-Accepting-Active-IOMMU-Utility-functions Bill Sumner
2014-01-10 22:07 ` [PATCHv3 3/6] Crashdump-Accepting-Active-IOMMU-Domain-Interfaces Bill Sumner
2014-03-04 14:59   ` Joerg Roedel [this message]
2014-03-10 19:23     ` Sumner, William
2014-01-10 22:07 ` [PATCHv3 4/6] Crashdump-Accepting-Active-IOMMU-Copy-Translations Bill Sumner
2014-01-10 22:07 ` [PATCHv3 5/6] Crashdump-Accepting-Active-IOMMU-Debug-Print-IOMMU Bill Sumner
2014-01-10 22:07 ` [PATCHv3 6/6] Crashdump-Accepting-Active-IOMMU-Call-From-Mainline Bill Sumner
2014-01-25  2:44 ` [PATCHv3 0/6] Crashdump Accepting Active IOMMU Baoquan He
2014-03-04 15:06 ` Joerg Roedel
2014-03-10 19:10   ` Sumner, William
2014-03-10 21:43 ` Vivek Goyal
2014-04-07 20:43 ` Don Dutile
2014-04-08 16:14   ` David Woodhouse
2014-04-08 18:42     ` Don Dutile
2014-04-25 18:11   ` Sumner, William

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=20140304145911.GD2799@8bytes.org \
    --to=joro@8bytes.org \
    --cc=alex.williamson@redhat.com \
    --cc=bhe@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=bill.sumner@hp.com \
    --cc=ddutile@redhat.com \
    --cc=doug.hatch@hp.com \
    --cc=dwmw2@infradead.org \
    --cc=indou.takao@jp.fujitsu.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=ishii.hironobu@jp.fujitsu.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=zhenhua@hp.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;
as well as URLs for NNTP newsgroup(s).