All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cihula, Joseph" <joseph.cihula@intel.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Keir Fraser <keir.fraser@eu.citrix.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: [RFC] fix xen_in_range()
Date: Wed, 22 Apr 2009 16:53:37 -0700	[thread overview]
Message-ID: <4F65016F6CB04E49BFFA15D4F7B798D9988CF1A3@orsmsx506.amr.corp.intel.com> (raw)

The frametable check in xen_in_range() incorrectly compares virtual addresses to physical addresses (i.e. the parameters).

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.

So while I would prefer to find a way to keep the check against the frametable, I don't see any obvious way to do so.  So this RFC is to see if there are any ideas for how the test could be re-written.

If not, then the below patch should be applied to remove the frametable check altogether.

Signed-off-by:  Joseph Cihula <joseph.cihula@intel.com>

diff -r 655dc3bc1d8e xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Thu Apr 16 11:54:06 2009 +0100
+++ b/xen/arch/x86/setup.c      Wed Apr 22 15:23:46 2009 -0700
@@ -1119,7 +1119,7 @@ int xen_in_range(paddr_t start, paddr_t
     int i;
     static struct {
         paddr_t s, e;
-    } xen_regions[5];
+    } xen_regions[4];

     /* initialize first time */
     if ( !xen_regions[0].s )
@@ -1140,10 +1140,6 @@ int xen_in_range(paddr_t start, paddr_t
         /* bss + boot allocator bitmap */
         xen_regions[3].s = __pa(&__bss_start);
         xen_regions[3].e = allocator_bitmap_end;
-        /* frametable */
-        xen_regions[4].s = (unsigned long)frame_table;
-        xen_regions[4].e = (unsigned long)frame_table +
-                           PFN_UP(max_page * sizeof(*frame_table));
     }

     for ( i = 0; i < ARRAY_SIZE(xen_regions); i++ )

             reply	other threads:[~2009-04-22 23:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22 23:53 Cihula, Joseph [this message]
2009-04-23  7:25 ` [RFC] fix xen_in_range() 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       ` RE: [RFC] fix xen_in_range() Cihula, Joseph

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=4F65016F6CB04E49BFFA15D4F7B798D9988CF1A3@orsmsx506.amr.corp.intel.com \
    --to=joseph.cihula@intel.com \
    --cc=dexuan.cui@intel.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.