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

Re: [Xen-devel] [PATCH 2/2] x86/hvm: implicitly disable an ioreq server when it is destroyed



On 23/04/15 16:46, Paul Durrant wrote:
> Currently, unless a (non-default) ioreq server is explicitly disabled before
> being destroyed, its gmfns will not be placed back into the p2m but still
> released back into the ioreq_gmfn mask. This is somewhat counter-intuitive
> and easily remedied by this small patch.
>
> Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
> Cc: Keir Fraser <keir@xxxxxxx>
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

> ---
>  xen/arch/x86/hvm/hvm.c |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index f840175..3c62b80 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -972,6 +972,7 @@ static int hvm_ioreq_server_init(struct hvm_ioreq_server 
> *s, struct domain *d,
>  static void hvm_ioreq_server_deinit(struct hvm_ioreq_server *s,
>                                      bool_t is_default)
>  {
> +    ASSERT(!s->enabled);
>      hvm_ioreq_server_remove_all_vcpus(s);
>      hvm_ioreq_server_unmap_pages(s, is_default);
>      hvm_ioreq_server_free_rangesets(s, is_default);
> @@ -1074,6 +1075,8 @@ static int hvm_destroy_ioreq_server(struct domain *d, 
> ioservid_t id)
>  
>          domain_pause(d);
>  
> +        hvm_ioreq_server_disable(s, 0);
> +
>          list_del(&s->list_entry);
>          
>          hvm_ioreq_server_deinit(s, 0);
> @@ -1332,11 +1335,10 @@ static void hvm_destroy_all_ioreq_servers(struct 
> domain *d)
>      {
>          bool_t is_default = (s == d->arch.hvm_domain.default_ioreq_server);
>  
> +        hvm_ioreq_server_disable(s, is_default);
> +
>          if ( is_default )
> -        {
> -            hvm_ioreq_server_disable(s, 1);
>              d->arch.hvm_domain.default_ioreq_server = NULL;
> -        }
>  
>          list_del(&s->list_entry);
>          


_______________________________________________
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®.