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

Re: [Xen-devel] [PATCH 25/25] argo: implement the get_config op to query notification config



>>> On 01.12.18 at 02:33, <christopher.w.clark@xxxxxxxxx> wrote:
> --- a/xen/common/argo.c
> +++ b/xen/common/argo.c
> @@ -1656,6 +1656,46 @@ argo_sendv(struct domain *src_d, const argo_addr_t 
> *src_addr,
>      return ( ret < 0 ) ? ret : len;
>  }
>  
> +static void
> +argo_get_config(struct domain *d, argo_get_config_t *get_config)
> +{
> +    unsigned int method = argo_signal_method(d);
> +
> +    get_config->signal_method = method;
> +
> +    switch ( method )
> +    {
> +        case ARGO_SIGNAL_METHOD_EVTCHN:
> +        {
> +            read_lock(&argo_lock);
> +            read_lock(&d->argo->lock);
> +
> +            get_config->signal.evtchn = d->argo->evtchn_port;
> +
> +            read_unlock(&d->argo->lock);
> +            read_unlock(&argo_lock);
> +
> +            argo_dprintk("signal for dom:%d evtchn %u\n", d->domain_id,
> +                         get_config->signal.evtchn);
> +
> +            break;
> +        }
> +        case ARGO_SIGNAL_METHOD_VIRQ:
> +        {
> +            get_config->signal.virq = VIRQ_ARGO;
> +
> +            argo_dprintk("signal for dom:%d virq %u\n", d->domain_id,
> +                         get_config->signal.virq);
> +            break;
> +        }
> +        default:
> +        {
> +            BUG();
> +            break;
> +        }

There are quite a few stray braces here.

> +typedef struct argo_get_config
> +{
> +    uint32_t signal_method;
> +    union
> +    {
> +        evtchn_port_t evtchn;
> +        uint32_t virq;
> +    } signal;
> +    uint32_t reserved;

Judging from the description, did you perhaps mean to put
uint32_t reserved[2] inside the union?

Then again "get_config" sounds much more generic than just
obtaining the notification method.

> @@ -244,6 +257,21 @@ struct argo_ring_message_header
>   */
>  #define ARGO_MESSAGE_OP_notify              4
>  
> +/*
> + * ARGO_MESSAGE_OP_get_config
> + *
> + * Queries Xen for argo configuration values.
> + *
> + * Used by a guest to obtain the signal method in use for Argo notifications
> + * and the event channel port or isa irq in use.

ISA IRQ? It's a vIRQ that you have as alternative to bare
event-channel signaling.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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