Tian, Kevin wrote:
From: John Byrne [mailto:john.l.byrne@xxxxxx]
Yes, Kevin made some changes in non-ia64 specific files. I think most
of
the changes are in ia64-specific code, but you'll need to review them.
I'll cover these unnecessary changes today, after you send out a working
patch.
My patch set will include a change the tools Makefile to not build
ioemu
for ia64. You don't have to accept that change if you don't want to.
The
only other change I have to xen-ia64-unstable is in the ia64-specific
version of grant_table.c.
You can "make XEN_NO_IOEMU=y". So this change is not required.
Yeah, but I have to remember to do it.
Here are my patches. I spoke too soon about being done. I think the
console driver has a problem in it. My system rebooted when I got to the
console login. I'm only online for about 1/2 hour more. Let me know if
you have the same problem or find a fix.
John
diff -Nar -U4 -x .hg -x '*~' xen-ia64-unstable.hg.k/tools/Rules.mk
xen-ia64-unstable.hg/tools/Rules.mk
--- xen-ia64-unstable.hg.k/tools/Rules.mk 2005-08-29 11:38:37.000000000
-0700
+++ xen-ia64-unstable.hg/tools/Rules.mk 2005-08-29 19:45:18.000000000 -0700
@@ -17,8 +17,12 @@
CFLAGS += -m64
LDFLAGS += -m64
endif
+ifeq ($(XEN_TARGET_ARCH),ia64)
+XEN_NO_IOEMU = true
+endif
+
X11_LDPATH = -L/usr/X11R6/$(LIBDIR)
%.opic: %.c
$(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
diff -Nar -U4 -x .hg -x '*~' xen-ia64-unstable.hg.k/xen/arch/ia64/grant_table.c
xen-ia64-unstable.hg/xen/arch/ia64/grant_table.c
--- xen-ia64-unstable.hg.k/xen/arch/ia64/grant_table.c 2005-08-31
17:57:35.173867136 -0700
+++ xen-ia64-unstable.hg/xen/arch/ia64/grant_table.c 2005-08-31
18:06:47.175813499 -0700
@@ -381,9 +381,13 @@
return -EFAULT; /* don't set status */
}
if ( (dev_hst_ro_flags & GNTMAP_host_map) &&
+#ifndef __ia64__
( (addr == 0) ||
+#else
+ (
+#endif
(!(dev_hst_ro_flags & GNTMAP_contains_pte) &&
unlikely(!__addr_ok(addr))) ) )
{
DPRINTK("Bad virtual address (%"PRIx64") or flags (%"PRIx16").\n",
diff -Nar -U4 -x .hg -x '*~' xen-ia64-unstable.hg.k/xen/include/asm-ia64/mm.h
xen-ia64-unstable.hg/xen/include/asm-ia64/mm.h
--- xen-ia64-unstable.hg.k/xen/include/asm-ia64/mm.h 2005-08-15
17:49:32.000000000 -0700
+++ xen-ia64-unstable.hg/xen/include/asm-ia64/mm.h 2005-08-24
19:06:11.000000000 -0700
@@ -33,8 +33,10 @@
* 2. Provide a PFN_ORDER() macro for accessing the order of a free page.
*/
#define PFN_ORDER(_pfn) ((_pfn)->u.free.order)
+#define PRtype_info "08x"
+
struct page
{
/* Each frame can be threaded onto a doubly-linked list. */
struct list_head list;
diff -Nar -U4 -x.hg xl.k/drivers/xen/blkback/blkback.c
xl/drivers/xen/blkback/blkback.c
--- xl.k/drivers/xen/blkback/blkback.c 2005-08-31 18:22:33.000000000 -0700
+++ xl/drivers/xen/blkback/blkback.c 2005-08-31 17:41:45.000000000 -0700
@@ -85,8 +85,13 @@
static u16 pending_grant_handles[MMAP_PAGES];
#define pending_handle(_idx, _i) \
(pending_grant_handles[((_idx) * BLKIF_MAX_SEGMENTS_PER_REQUEST) + (_i)])
#define BLKBACK_INVALID_HANDLE (0xFFFF)
+#ifdef __ia64__
+static void *pending_vaddrs[MMAP_PAGES];
+#define pending_vaddr(_idx, _i) \
+ (pending_vaddrs[((_idx) * BLKIF_MAX_SEGMENTS_PER_REQUEST) + (_i)])
+#endif
#ifdef CONFIG_XEN_BLKDEV_TAP_BE
/*
* If the tap driver is used, we may get pages belonging to either the tap
@@ -113,9 +118,9 @@
for ( i = 0; i < nr_pages; i++ )
{
if ( BLKBACK_INVALID_HANDLE != ( handle = pending_handle(idx, i) ) )
{
- unmap[i].host_addr = MMAP_VADDR(idx, i);
+ unmap[i].host_addr = (unsigned long)pending_vaddr(idx, i);
unmap[i].dev_bus_addr = 0;
unmap[i].handle = handle;
pending_handle(idx, i) = BLKBACK_INVALID_HANDLE;
invcount++;
@@ -390,8 +395,9 @@
#endif
pending_handle(pending_idx, i) = map[i].handle;
+ pending_vaddr(pending_idx, i) = gnttab_map_vaddr(map[i]);
}
for ( i = 0; i < nseg; i++ )
{
@@ -424,9 +430,9 @@
}
while ( (bio == NULL) ||
(bio_add_page(bio,
- virt_to_page(MMAP_VADDR(pending_idx, i)),
+ virt_to_page(pending_vaddr(pending_idx, i)),
seg[i].nsec << 9,
seg[i].buf & ~PAGE_MASK) == 0) )
{
bio = biolist[nbio++] = bio_alloc(GFP_KERNEL, nseg-i);
@@ -512,12 +518,9 @@
return 0;
blkif_interface_init();
-#ifdef __ia64__
- mmap_vstart = alloc_empty_foreign_map_page_range(MMAP_PAGES);
- mmap_vstart = __va(mmap_vstart);
-#else
+#ifndef __ia64__
page = balloon_alloc_empty_page_range(MMAP_PAGES);
BUG_ON(page == NULL);
mmap_vstart = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
#endif
diff -Nar -U4 -x.hg xl.k/drivers/xen/blkback/interface.c
xl/drivers/xen/blkback/interface.c
--- xl.k/drivers/xen/blkback/interface.c 2005-08-31 18:22:33.000000000
-0700
+++ xl/drivers/xen/blkback/interface.c 2005-08-31 15:35:15.000000000 -0700
@@ -45,13 +45,9 @@
}
blkif->shmem_ref = shared_page;
blkif->shmem_handle = op.handle;
-#ifndef __ia64__
- blkif->shmem_vaddr = localaddr;;
-#else
- blkif->shmem_vaddr = __va(op.dev_bus_addr);
-#endif
+ blkif->shmem_vaddr = (unsigned long)gnttab_map_vaddr(op);
return 0;
}
static void unmap_frontend_page(blkif_t *blkif)
@@ -69,17 +65,25 @@
struct vm_struct *vma;
blkif_sring_t *sring;
evtchn_op_t op = { .cmd = EVTCHNOP_bind_interdomain };
int err;
+ unsigned long addr;
BUG_ON(blkif->remote_evtchn);
+#ifdef __ia64__
+ addr = 0;
+#else
if ( (vma = get_vm_area(PAGE_SIZE, VM_IOREMAP)) == NULL )
return -ENOMEM;
+ addr = vma->addr;
+#endif
- err = map_frontend_page(blkif, (unsigned long)vma->addr, shared_page);
+ err = map_frontend_page(blkif, addr, shared_page);
if (err) {
+#ifndef __ia64__
vfree(vma->addr);
+#endif
return err;
}
op.u.bind_interdomain.dom1 = DOMID_SELF;
@@ -88,29 +92,27 @@
op.u.bind_interdomain.port2 = evtchn;
err = HYPERVISOR_event_channel_op(&op);
if (err) {
unmap_frontend_page(blkif);
+#ifndef __ia64__
vfree(vma->addr);
+#endif
return err;
}
blkif->evtchn = op.u.bind_interdomain.port1;
blkif->remote_evtchn = evtchn;
-#ifndef __ia64__
- sring = (blkif_sring_t *)vma->addr;
-#else
sring = (blkif_sring_t *)blkif->shmem_vaddr;
-#endif
SHARED_RING_INIT(sring);
BACK_RING_INIT(&blkif->blk_ring, sring, PAGE_SIZE);
bind_evtchn_to_irqhandler(blkif->evtchn, blkif_be_int, 0, "blkif-backend",
blkif);
blkif->status = CONNECTED;
blkif->shmem_frame = shared_page;
-#ifdef __ia64__
+#ifndef __ia64__
vfree(vma->addr);
#endif
return 0;
}
@@ -133,12 +135,11 @@
unbind_evtchn_from_irqhandler(blkif->evtchn, blkif);
if (blkif->blk_ring.sring) {
unmap_frontend_page(blkif);
-//#ifndef __ia64__
-//similar code removed in prev version, not sure if this is right
+#ifndef __ia64__
vfree(blkif->blk_ring.sring);
-//#endif
+#endif
blkif->blk_ring.sring = NULL;
}
kmem_cache_free(blkif_cachep, blkif);
diff -Nar -U4 -x.hg xl.k/drivers/xen/core/gnttab.c xl/drivers/xen/core/gnttab.c
--- xl.k/drivers/xen/core/gnttab.c 2005-08-31 18:22:33.000000000 -0700
+++ xl/drivers/xen/core/gnttab.c 2005-08-31 10:29:47.000000000 -0700
@@ -22,9 +22,9 @@
#include <asm/uaccess.h>
#include <asm-xen/xen_proc.h>
#include <asm-xen/linux-public/privcmd.h>
#include <asm-xen/gnttab.h>
-#include <asm-xen/synch_bitops.h>
+#include <asm-xen/asm/synch_bitops.h>
#if 1
#define ASSERT(_p) \
if ( !(_p) ) { printk(KERN_ALERT"Assertion '%s': line %d, file %s\n", \
diff -Nar -U4 -x.hg xl.k/drivers/xen/xenbus/xenbus_probe.c
xl/drivers/xen/xenbus/xenbus_probe.c
--- xl.k/drivers/xen/xenbus/xenbus_probe.c 2005-08-31 18:22:33.000000000
-0700
+++ xl/drivers/xen/xenbus/xenbus_probe.c 2005-08-31 15:34:12.000000000
-0700
@@ -487,9 +490,9 @@
}
/* backend/<type>/... or device/<type>/... */
p = strchr(node, '/') + 1;
- snprintf(type, BUS_ID_SIZE, "%.*s", strcspn(p, "/"), p);
+ snprintf(type, BUS_ID_SIZE, "%.*s", (int)strcspn(p, "/"), p);
type[BUS_ID_SIZE-1] = '\0';
rootlen = strsep_len(node, '/', bus->levels);
if (rootlen < 0)
diff -Nar -U4 -x.hg xl.k/include/asm-xen/gnttab.h xl/include/asm-xen/gnttab.h
--- xl.k/include/asm-xen/gnttab.h 2005-08-31 18:22:33.000000000 -0700
+++ xl/include/asm-xen/gnttab.h 2005-08-31 15:35:08.000000000 -0700
@@ -67,5 +67,11 @@
void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid,
unsigned long pfn);
+#ifdef __ia64__
+#define gnttab_map_vaddr(map) __va(map.dev_bus_addr)
+#else
+#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
+#endif
+
#endif /* __ASM_GNTTAB_H__ */
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|