public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Joerg Roedel <jroedel@suse.de>
Cc: zhen-hual@hp.com, iommu@lists.linux-foundation.org,
	bhe@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present
Date: Thu, 11 Jun 2015 16:12:40 +0100	[thread overview]
Message-ID: <1434035560.3907.74.camel@infradead.org> (raw)
In-Reply-To: <1434033896.3907.61.camel@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 2529 bytes --]

On Thu, 2015-06-11 at 15:44 +0100, David Woodhouse wrote:
> It used to look like this
> ...
> Now it looks like this

That's not quite right; each root entry is for only *one* bus, and the
correct version looks more like this...

It used to look like this:

Root Table Address Register
       |
       V

Root Table (struct root_entry)     Context Table (struct context_entry)
------------------------------     ------------------------------------
0x00: CTX TBL for bus #0 --------->  CTX entry for 00:00.0 (bits 63-0)
0x08: unused                         CTX entry for 00:00.0 (bits 127-64)
0x10: CTX TBL for bus #1 ----.       CTX entry for 00:00.1 (bits 63-0)
...   ...                    |       ...
0xff8:unused                 |       CTX entry for 00:1f.7 (bits 127-64)
                             |
                             |
                             |     Context Table (struct context_entry)
                             |     ------------------------------------
0x00:                        ----->  CTX entry for 01:00.0 (bits 63-0)
0x00:                                CTX entry for 01:00.0 (bits 127-64)
0x08:                                CTX entry for 01:00.1 (bits 63-0)
...                                  ...
0xff8:                               CTX entry for 01:1f.7 (bits 127-64)


Now it looks like this, with each context entry taking twice the amount
of space:

Root Table Address Register
       |
       V

Root Table (struct root_entry)     Context Table (struct context_entry)
------------------------------     ------------------------------------
0x00: CTX TBL LO for bus #0 ------>  CTX entry for 00:00.0 (bits 63-0)
0x08: CTX TBL HI for bus #0 --.      CTX entry for 00:00.0 (bits 127-64)
0x10: CTX TBL LO for bus #1   |      CTX entry for 00:00.0 (bits 191-128)
...   ...                     |      ...
0xff8:CTX TBL HI for bus #FF  |      CTX entry for 00:0f.7 (bits 255-192)
                              |
                              |
                              |    Context Table (struct context_entry)
                              |    ------------------------------------
0x00:                         ---->  CTX entry for 00:10.0 (bits 63-0)
0x00:                                CTX entry for 00:10.0 (bits 127-64)
0x08:                                CTX entry for 00:10.0 (bits 191-128)
...                                  ...
0xff8:                               CTX entry for 00:1f.7 (bits 63-0)

-- 
dwmw2

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5691 bytes --]

  reply	other threads:[~2015-06-11 15:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 13:47 [PATCH 0/4] More cleanups and fixes for Intel VT-d Joerg Roedel
2015-06-11 13:47 ` [PATCH 1/4] iommu/vt-d: Remove iommu_attach_domain_with_id() Joerg Roedel
2015-06-11 13:47 ` [PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present Joerg Roedel
2015-06-11 14:07   ` David Woodhouse
2015-06-11 14:12     ` Joerg Roedel
2015-06-11 14:19       ` David Woodhouse
2015-06-11 14:25     ` Joerg Roedel
2015-06-11 14:44       ` David Woodhouse
2015-06-11 15:12         ` David Woodhouse [this message]
2015-06-11 14:51       ` Joerg Roedel
2015-06-11 13:47 ` [PATCH 3/4] iommu/vt-d: Remove unmap_device_dma() Joerg Roedel
2015-06-11 13:47 ` [PATCH 4/4] iommu/vt-d: Make sure si_domain is allocated for kdump kernel Joerg Roedel
2015-06-11 15:54 ` [PATCH 0/4] More cleanups and fixes for Intel VT-d David Woodhouse
2015-06-12  7:31   ` Joerg Roedel
2015-06-12 20:29   ` Joerg Roedel

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=1434035560.3907.74.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=bhe@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhen-hual@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