All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cihula, Joseph" <joseph.cihula@intel.com>
To: Jan Beulich <jbeulich@novell.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: "Cui, Dexuan" <dexuan.cui@intel.com>,
	"Wang, Shane" <shane.wang@intel.com>,
	"Jiang, Yunhong" <yunhong.jiang@intel.com>,
	"Yang, Xiaowei" <xiaowei.yang@intel.com>,
	"Ke, Liping" <liping.ke@intel.com>, "Li, Xin" <xin.li@intel.com>
Subject: RE: RE: [RFC] fix xen_in_range()
Date: Fri, 24 Apr 2009 16:29:40 -0700	[thread overview]
Message-ID: <4F65016F6CB04E49BFFA15D4F7B798D998969D62@orsmsx506.amr.corp.intel.com> (raw)
In-Reply-To: <49F180A8.76EA.0078.0@novell.com>

> From: Jan Beulich [mailto:jbeulich@novell.com]
> Sent: Friday, April 24, 2009 12:05 AM
>
> >>> "Cihula, Joseph" <joseph.cihula@intel.com> 24.04.09 03:26 >>>
> >> From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
> >> Sent: Thursday, April 23, 2009 12:25 AM
> >>
> >> On 23/04/2009 00:53, "Cihula, Joseph" <joseph.cihula@intel.com> wrote:
> >>
> >> > Unfortunately, the frametable is only contiguous in the virtual address space,
> >> > so one can't simply take __pa() of its start and end.  And since it is quite
> >> > large, iterating through each page to gets its phys addr adds a perceptible
> >> > delay when that check has to be done for each page of physical memory (as is
> >> > the case in the only caller, the VT-d routine that maps memory for dom0).  But
> >> > it also appears that we can't convert the phys addr arguments into their virt
> >> > addrs to compare with the contiguous frametable range because they will
> >> > convert to the DIRECTMAP va's instead.
> >>
> >> The frametable is allocated in aligned 2MB chunks. So you can check at that
> >> granularity rather than 4kB.
> >
> >That made it just a single iteration on a 2GB system, but what fn should be used
> >to convert the va to pa?  __pa() isn't converting this correctly.
>
> I'm afraid you'll have to either create one, or you'll have to consult the page
> tables. Also, how can this be a single iteration on a 2Gb system? struct
> page_info is 32 bytes, so I'd expect the frame table to be 16Mb in size (i.e.
> eight iterations).

It's actually 8 (I cut off my trace early before).

I don't think that it is worth the effort of walking the page tables just to exclude the frametable from the VT-d tables, since there are other memory regions (xenheap, etc.) that we're not excluding.  But if there is a binlist of things to do when someone gets time, I'd suggest adding this to it.

Joe

> Also, after suggesting to use gb-pages when possible here I realized that
> it's probably a latent bug to map more space than was allocated - if the
> non-allocated-but-mapped pages happen to later get allocated to a domain,
> that domain may change the cacheability attributes of any of these pages,
> resulting in aliasing issues. I'll put together a patch for this, but it'll be a
> couple of days until I'll be able to do so.
>
> Jan

      parent reply	other threads:[~2009-04-24 23:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22 23:53 [RFC] fix xen_in_range() Cihula, Joseph
2009-04-23  7:25 ` Keir Fraser
2009-04-23  7:58   ` Jan Beulich
2009-04-24  1:26   ` Cihula, Joseph
2009-04-24  7:04     ` Jan Beulich
2009-04-24  7:16       ` Keir Fraser
2009-04-24 23:14         ` Qing He
2009-04-24 23:20         ` [PATCH] iommu: fix unused percpu in xen_in_range() Qing He
2009-04-24 23:29       ` Cihula, Joseph [this message]

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=4F65016F6CB04E49BFFA15D4F7B798D998969D62@orsmsx506.amr.corp.intel.com \
    --to=joseph.cihula@intel.com \
    --cc=dexuan.cui@intel.com \
    --cc=jbeulich@novell.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=liping.ke@intel.com \
    --cc=shane.wang@intel.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xiaowei.yang@intel.com \
    --cc=xin.li@intel.com \
    --cc=yunhong.jiang@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.