[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] vm_event: Fix regression caused by b701ccc8



On Fri, 2016-02-05 at 14:20 -0700, Tamas K Lengyel wrote:
> When xc_map_foreign_batch got deprecated reinitializing vm_event on a domain
> where an event listener was previously active broke as it relied on the flag
> XEN_DOMCTL_PFINFO_XTAB to indicate that the magic page is not in the physmap.
> Manually check the gpfn type, add it to the physmap if needed, and only then
> try to map it.
> 
> Signed-off-by: Tamas K Lengyel <tlengyel@xxxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Sorry for the breakage!

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
> Âtools/libxc/xc_vm_event.c | 21 ++++++++++-----------
> Â1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/libxc/xc_vm_event.c b/tools/libxc/xc_vm_event.c
> index 57abce0..443c73b 100644
> --- a/tools/libxc/xc_vm_event.c
> +++ b/tools/libxc/xc_vm_event.c
> @@ -72,11 +72,10 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t
> domain_id, int param,
> Â
> ÂÂÂÂÂring_pfn = pfn;
> ÂÂÂÂÂmmap_pfn = pfn;
> -ÂÂÂÂring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ |
> PROT_WRITE,
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ&mmap_pfn, 1);
> -ÂÂÂÂif ( !ring_page )
> +ÂÂÂÂrc1 = xc_get_pfn_type_batch(xch, domain_id, 1, &mmap_pfn);
> +ÂÂÂÂif ( rc1 || mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
> ÂÂÂÂÂ{
> -ÂÂÂÂÂÂÂÂ/* Map failed, populate ring page */
> +ÂÂÂÂÂÂÂÂ/* Page not in the physmap, try to populate it */
> ÂÂÂÂÂÂÂÂÂrc1 = xc_domain_populate_physmap_exact(xch, domain_id, 1, 0, 0,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ&ring_pfn);
> ÂÂÂÂÂÂÂÂÂif ( rc1 != 0 )
> @@ -84,15 +83,15 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t
> domain_id, int param,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂPERROR("Failed to populate ring pfn\n");
> ÂÂÂÂÂÂÂÂÂÂÂÂÂgoto out;
> ÂÂÂÂÂÂÂÂÂ}
> +ÂÂÂÂ}
> Â
> -ÂÂÂÂÂÂÂÂmmap_pfn = ring_pfn;
> -ÂÂÂÂÂÂÂÂring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ |
> PROT_WRITE,
> +ÂÂÂÂmmap_pfn = ring_pfn;
> +ÂÂÂÂring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ |
> PROT_WRITE,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ&mmap_pfn, 1);
> -ÂÂÂÂÂÂÂÂif ( !ring_page )
> -ÂÂÂÂÂÂÂÂ{
> -ÂÂÂÂÂÂÂÂÂÂÂÂPERROR("Could not map the ring page\n");
> -ÂÂÂÂÂÂÂÂÂÂÂÂgoto out;
> -ÂÂÂÂÂÂÂÂ}
> +ÂÂÂÂif ( !ring_page )
> +ÂÂÂÂ{
> +ÂÂÂÂÂÂÂÂPERROR("Could not map the ring page\n");
> +ÂÂÂÂÂÂÂÂgoto out;
> ÂÂÂÂÂ}
> Â
> ÂÂÂÂÂswitch ( param )
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.