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

Re: [Xen-devel] [PATCH v7 11/12] x86/hvm/ioreq: defer mapping gfns until they are actually requsted



>>> On 18.09.17 at 17:31, <paul.durrant@xxxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/ioreq.c
> +++ b/xen/arch/x86/hvm/ioreq.c
> @@ -354,6 +354,9 @@ static void hvm_update_ioreq_evtchn(struct 
> hvm_ioreq_server *s,
>      }
>  }
>  
> +#define HANDLE_BUFIOREQ(s) \
> +    (s->bufioreq_handling != HVM_IOREQSRV_BUFIOREQ_OFF)

(s)

> @@ -762,11 +755,20 @@ int hvm_get_ioreq_server_info(struct domain *d, 
> ioservid_t id,
>      if ( IS_DEFAULT(s) )
>          goto out;
>  
> +    if ( ioreq_gfn || bufioreq_gfn )

This conditional together with ...

> +    {
> +        rc = hvm_ioreq_server_map_pages(s);
> +        if ( rc )
> +            goto out;
> +    }
> +
>      *ioreq_gfn = gfn_x(s->ioreq.gfn);

... this unconditional dereference is suspicious.

> --- a/xen/include/asm-x86/hvm/domain.h
> +++ b/xen/include/asm-x86/hvm/domain.h
> @@ -68,8 +68,8 @@ struct hvm_ioreq_server {
>      spinlock_t             bufioreq_lock;
>      evtchn_port_t          bufioreq_evtchn;
>      struct rangeset        *range[NR_IO_RANGE_TYPES];
> +    int                    bufioreq_handling;

Does this need to be plain int (i.e. signed and 32 bits wide)?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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