All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: yang.z.zhang@intel.com,
	xen-devel <xen-devel@lists.xenproject.org>,
	kevin.tian@intel.com, ufimtseva@gmail.com,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: Shared page tables between ETP and IOMMU issue
Date: Thu, 26 Feb 2015 20:34:21 +0100	[thread overview]
Message-ID: <54EF753D.9060809@citrix.com> (raw)
In-Reply-To: <20150226192829.GA30038@x230.dumpdata.com>

El 26/02/15 a les 20.28, Konrad Rzeszutek Wilk ha escrit:
> On Thu, Feb 26, 2015 at 07:02:22PM +0100, Roger Pau Monné wrote:
>> El 26/02/15 a les 17.43, Jan Beulich ha escrit:
>>>>>> On 26.02.15 at 17:29, <roger.pau@citrix.com> wrote:
>>>> OK, I will try to take a look. All those faults come from physical
>>>> memory ranges that are supposed to be usable, and in fact the CPU seems
>>>> to be able to read/write from them without problems, or else the guest
>>>> would have crashed much more early. Regarding sharing the page tables
>>>> between EPT and the IOMMU, is there some bit that needs to be set in the
>>>> ept entry in order to mark a page as available by the IOMMU?
>>>
>>> Bits 0 and 1 (read and write) are shared between VT-d and EPT
>>> (as is bit 7 - see struct dma_pte and ept_entry_t).
>>
>> I've added some debug prints at the end of construct_dom0 to print the 
>> MFN of a RAM page (using get_gfn_query_unlocked) and the VTd entry 
>> (using print_vtd_entries):
>>
>> (XEN) print_vtd_entries: iommu ffff8302197c3a40 dev 0000:00:1f.2 gmfn 43e0
>> (XEN)     root_entry = ffff8302197c0000
>> (XEN)     root_entry[0] = 140144001
>> (XEN)     context = ffff830140144000
>> (XEN)     context[fa] = 2_140148001
>> (XEN)     l4 = ffff830140148000
>> (XEN)     l4_index = 0
>> (XEN)     l4[0] = 140147003
>> (XEN)     l3 = ffff830140147000
>> (XEN)     l3_index = 0
>> (XEN)     l3[0] = 140146003
>> (XEN)     l2 = ffff830140146000
>> (XEN)     l2_index = 21
>> (XEN)     l2[21] = 0
>> (XEN)     l2[21] not present
>> (XEN) GFN: 0x43e0 MFN: 0x1401e3 type: 0
>>
>> This is before Dom0 has been started, so I think there's something 
>> wrong in the way we build the page tables, because AFAICT the VTd 
>> code is not able to resolve the GFN, but the EPT code is.
> 
> This looks like what Elena was hitting (how we parsed E820_RSV or
> MMIO ranges). Are those GPFNs  special? 

No, they are regular RAM (p2m_ram_rw). I think Elena's problem was due
to missing RMRR regions in the ACPI tables. On the other hand this is
the IOMMU failing to provide translations for RAM regions. It seems like
it's caused by sharing the page tables between EPT and the IOMMUs.

Roger.

  reply	other threads:[~2015-02-26 19:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 15:45 Shared page tables between ETP and IOMMU issue Roger Pau Monné
2015-02-26 15:57 ` Jan Beulich
2015-02-26 16:29   ` Roger Pau Monné
2015-02-26 16:43     ` Jan Beulich
2015-02-26 18:02       ` Roger Pau Monné
2015-02-26 19:28         ` Konrad Rzeszutek Wilk
2015-02-26 19:34           ` Roger Pau Monné [this message]
2015-02-26 19:31         ` Roger Pau Monné
2015-02-26 22:17           ` Elena Ufimtseva
2015-02-27  8:16         ` Jan Beulich

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=54EF753D.9060809@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=kevin.tian@intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=ufimtseva@gmail.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yang.z.zhang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.