From 1f123c33a52a7fd8fac998a7d4bdad55d6e689e9 Mon Sep 17 00:00:00 2001 From: "smh22@firebug.cl.cam.ac.uk" Date: Wed, 6 Jul 2005 15:36:57 +0000 Subject: [PATCH 1/2] Move xenstore page before page tables so that guest doesn't free it after boot Signed-off-by: Steven Hand --- tools/libxc/xc_linux_build.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index 838efe1913..03839eded8 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -129,16 +129,16 @@ static int setup_guest(int xc_handle, vinitrd_end = vinitrd_start + initrd_len; vphysmap_start = round_pgup(vinitrd_end); vphysmap_end = vphysmap_start + (nr_pages * sizeof(unsigned long)); - vpt_start = round_pgup(vphysmap_end); + vstoreinfo_start = round_pgup(vphysmap_end); + vstoreinfo_end = vstoreinfo_start + PAGE_SIZE; + vpt_start = vstoreinfo_end; + for ( nr_pt_pages = 2; ; nr_pt_pages++ ) { vpt_end = vpt_start + (nr_pt_pages * PAGE_SIZE); vstartinfo_start = vpt_end; vstartinfo_end = vstartinfo_start + PAGE_SIZE; - /* Place store shared page after startinfo. */ - vstoreinfo_start = vstartinfo_end; - vstoreinfo_end = vstartinfo_end + PAGE_SIZE; - vstack_start = vstoreinfo_end; + vstack_start = vstartinfo_end; vstack_end = vstack_start + PAGE_SIZE; v_end = (vstack_end + (1UL<<22)-1) & ~((1UL<<22)-1); if ( (v_end - vstack_end) < (512UL << 10) ) @@ -167,17 +167,17 @@ static int setup_guest(int xc_handle, " Loaded kernel: %p->%p\n" " Init. ramdisk: %p->%p\n" " Phys-Mach map: %p->%p\n" + " Store page: %p->%p\n" " Page tables: %p->%p\n" " Start info: %p->%p\n" - " Store page: %p->%p\n" " Boot stack: %p->%p\n" " TOTAL: %p->%p\n", _p(dsi.v_kernstart), _p(dsi.v_kernend), _p(vinitrd_start), _p(vinitrd_end), _p(vphysmap_start), _p(vphysmap_end), + _p(vstoreinfo_start), _p(vstoreinfo_end), _p(vpt_start), _p(vpt_end), _p(vstartinfo_start), _p(vstartinfo_end), - _p(vstoreinfo_start), _p(vstoreinfo_end), _p(vstack_start), _p(vstack_end), _p(dsi.v_start), _p(v_end)); printf(" ENTRY ADDRESS: %p\n", _p(dsi.v_kernentry)); From 2cd0526942eeb49c088438230d92b6c8c2542c5f Mon Sep 17 00:00:00 2001 From: "smh22@firebug.cl.cam.ac.uk" Date: Wed, 6 Jul 2005 16:50:57 +0000 Subject: [PATCH 2/2] Fix blkif 'grant-table-ification' Signed-off-by: Steven Hand --- linux-2.6.11-xen-sparse/drivers/xen/blkback/interface.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/linux-2.6.11-xen-sparse/drivers/xen/blkback/interface.c b/linux-2.6.11-xen-sparse/drivers/xen/blkback/interface.c index 4aaef6b116..aaa976c557 100644 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/interface.c +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/interface.c @@ -219,9 +219,7 @@ void blkif_connect(blkif_be_connect_t *connect) op.ref = ref; op.dom = domid; - if(unlikely(HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1))) { - BUG(); - } + BUG_ON( HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1) ); handle = op.handle; @@ -232,10 +230,6 @@ void blkif_connect(blkif_be_connect_t *connect) return; } - phys_to_machine_mapping[__pa(VMALLOC_VMADDR(vma->addr)) >> - PAGE_SHIFT] = - FOREIGN_FRAME(shmem_frame); - blkif->shmem_ref = ref; blkif->shmem_handle = handle; blkif->shmem_vaddr = VMALLOC_VMADDR(vma->addr);