Repost: Fix for local migration and balloon-allocated pages
The attached patch
- enables migration of a domain to the local machine - some timing issues needed to be resolved by executing certain code early/later
- removes usage of the physical to machine array such that balloon- allocated pages can be deallocated
xen-unstable.hg/linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c +9 -8
@@ -22,7 +22,6 @@ LIST_HEAD(tpmif_list);static tpmif_t *alloc_tpmif (domid_t domid,long int instance) { -struct page *page;tpmif_t *tpmif; tpmif =kmem_cache_alloc (tpmif_cachep,GFP_KERNEL );
@@ -35,9 +34,10 @@ static tpmif_t *alloc_tpmif(domid_t domi tpmif->tpm_instance = instance;atomic_set (&tpmif->refcnt,1 ); - page =balloon_alloc_empty_page_range (TPMIF_TX_RING_SIZE ); -BUG_ON (page ==NULL ); - tpmif->mmap_vstart = (unsigned long )pfn_to_kaddr (page_to_pfn (page)); + tpmif->pagerange =balloon_alloc_empty_page_range (TPMIF_TX_RING_SIZE ); +BUG_ON (tpmif->pagerange ==NULL ); + tpmif->mmap_vstart = (unsigned long )pfn_to_kaddr ( +page_to_pfn (tpmif->pagerange));list_add (&tpmif->tpmif_list, &tpmif_list); num_frontends++;
@@ -49,6 +49,7 @@ static void free_tpmif(tpmif_t * tpmif) { num_frontends--;list_del (&tpmif->tpmif_list); +balloon_dealloc_empty_page_range (tpmif->pagerange,TPMIF_TX_RING_SIZE );kmem_cache_free (tpmif_cachep, tpmif); }
@@ -115,11 +116,11 @@ int tpmif_map(tpmif_t *tpmif, unsigned l .cmd = EVTCHNOP_bind_interdomain, .u.bind_interdomain.remote_dom = tpmif->domid, .u.bind_interdomain.remote_port = evtchn, - }; + }; -if (tpmif->irq) { -return 0 ; - } +if (tpmif->irq) { +return 0 ; + }if ((tpmif->tx_area =alloc_vm_area (PAGE_SIZE )) ==NULL )return -ENOMEM ;
xen-unstable.hg/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c +15 -28
70 lines not on this page · raw message
xen-unstable.hg/linux-2.6-xen-sparse/drivers/xen/tpmback/common.h +1 -0
@@ -49,6 +49,7 @@ typedef struct tpmif_st {grant_handle_t shmem_handle;grant_ref_t shmem_ref; +struct page *pagerange; } tpmif_t;void tpmif_disconnect_complete (tpmif_t * tpmif);
xen-unstable.hg/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c +0 -3
@@ -293,9 +293,6 @@ int _packet_write(struct packet *pak,DPRINTK (" Grant table operation failure !\n" );return 0 ; } -set_phys_to_machine (__pa (MMAP_VADDR (tpmif, i)) >>PAGE_SHIFT , -FOREIGN_FRAME (map_op. - dev_bus_addr >>PAGE_SHIFT )); tocopy =MIN (size - offset,PAGE_SIZE );
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 7 lines · Stefan Berger
The attached patch
- enables migration of a domain to the local machine - some timing issues needed to be resolved by executing certain code early/later
- removes usage of the physical to machine array such that balloon- allocated pages can be deallocatedSigned-off-by Stefan Berger <[email protected]>
I already applied half this patch to our staging tree. Unfortunately it then got stuck because our regression tests have been failing and so hasn't made it to the public tree yet. That should be fixed now, and there should be a flurry of changesets going into the public tree in a couple of hours (up to changeset 9705, most likely). When that happens, please resync the p2m parts of the patch and resend.
Thanks,
Keir