Here is the work around patch. I was able to boot dom0 with this patch.
The right fix is to modify memory_exchange() to be aware of
ia64 page reference count convention, and convince x86 developper.
Since It may take a while, I sent this work around patch.
On Thu, Mar 01, 2007 at 07:29:58PM +0900, Isaku Yamahata wrote:
> On Thu, Mar 01, 2007 at 11:59:27AM +0900, Isaku Yamahata wrote:
> > On Wed, Feb 28, 2007 at 04:55:27PM -0700, Alex Williamson wrote:
> >
> > > Current xen-unstable.hg tip has a problem booting dom0 that I'd like
> > > your opinion on. We're failing the check in steal_page() that ensures
> > > that count_info is 2 when called with the MEMF_no_refcount flag. In
> > > fact, it seems that steal_page() is now getting called for pages that
> > > have a count_info of 1 or 2. Are we being overly paranoid with this
> > > check, or is this an indication of a deeper problem? The change seems
> > > to have been introduced by the recent memory allocator changes which
> > > removed the bit width restrictions. Thanks,
> >
> > By the coarse code check, I couldn't find the case that count_info = 1
> > with MEMF_no_refcount can occur.
> > The reference count semantics seems to have been changed in a subtle way.
> > I'll try to reproduce it and take a deeper look into it.
>
> I found the root cause.
> In fact XENMEM_exchange(memory_exchange()) has been broken on ia64.
> Especially when memory_exchange() failed, page->count_info
> is left in broken state (= PGC_allocated | 1).
> The next time XENMEM_exchange hypercall is called, the message is printed out.
> Probably we have to revise memory_exchange() in common code and
> convince x86 developers.
>
> So the temporal work around might be necessary.
> The trigger is c/s 13366:ed73ff8440d8 in xen-unstable.hg.
> swiotlb_init_with_default_size() was changed to pass
> dma address bits which causes XENMEM_exchange fail.
> The easy temporal work around is to modify swiotlb_init_with_default_size().
> --
> yamahata
>
> _______________________________________________
> Xen-ia64-devel mailing list
> [email protected]
> http://lists.xensource.com/xen-ia64-devel
>
--
yamahata
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1173065415 -32400
# Node ID daca4d71d826dbb2935221e1dc20fced7a8f0cc6
# Parent ed197d92c895ec846ba694da89e90097eaef2701
xen/ia64 bug work around.
the c/s 13366:ed73ff8440d8 of xen-unstable.hg revealed that
XENMEM_exchange has been broken on Xen/ia64.
This is work around for it until the right fix.
PATCHNAME: xen_ia64_xenmem_exchange_bug_work_around
Signed-off-by: Isaku Yamahata <[EMAIL PROTECTED]>
diff -r ed197d92c895 -r daca4d71d826 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Thu Mar 01 12:43:40 2007 +0900
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Mon Mar 05 12:30:15 2007 +0900
@@ -205,6 +205,17 @@ static void contiguous_bitmap_clear(
#define MAX_CONTIG_ORDER 7
static unsigned long discontig_frames[1<<MAX_CONTIG_ORDER];
+/* Width of DMA addresses. 30 bits is a b44 limitation. */
+#define DEFAULT_DMA_BITS 30
+static unsigned int xen_ia64_dma_bits = DEFAULT_DMA_BITS;
+static int __init
+setup_dma_bits(char *str)
+{
+ xen_ia64_dma_bits = simple_strtoul(str, NULL, 0);
+ return 0;
+}
+__setup("xen_ia64_dma_bits=", setup_dma_bits);
+
/* Ensure multi-page extents are contiguous in machine memory. */
int
__xen_create_contiguous_region(unsigned long vstart,
@@ -233,6 +244,15 @@ __xen_create_contiguous_region(unsigned
},
.nr_exchanged = 0
};
+
+ /*
+ * XXX xen/ia64 vmm bug work around
+ * the c/s 13366:ed73ff8440d8 of xen-unstable.hg revealed that
+ * XENMEM_exchange has been broken on Xen/ia64.
+ * This is work around for it until the right fix.
+ */
+ if (address_bits < xen_ia64_dma_bits)
+ return -ENOSYS;
if (unlikely(order > MAX_CONTIG_ORDER))
return -ENOMEM;
_______________________________________________
Xen-ia64-devel mailing list
[email protected]
http://lists.xensource.com/xen-ia64-devel