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

Re: [Xen-devel] [PATCH 5 of 9] x86/mm: Ensure maps used by nested hvm code cannot be paged out



 >>> On 29.11.11 at 21:21, Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1828,7 +1831,12 @@ static void *__hvm_map_guest_frame(unsig
>      if ( writable )
>          paging_mark_dirty(d, mfn);
>  
> -    return map_domain_page(mfn);
> +    pg = mfn_to_page(mfn);
> +    page_get_owner_and_reference(pg);

This can (at least theoretically) fail, and you must handle failure (or
explain in a comment why not).

Jan

> +
> +    map = map_domain_page(mfn);
> +    put_gfn(d, gfn);
> +    return map;
>  }
>  
>  void *hvm_map_guest_frame_rw(unsigned long gfn)



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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