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

Re: [Xen-devel] [PATCH V3 25/29] x86/vmsi: Hook delivering remapping format msi to guest



On Thu, Sep 21, 2017 at 11:02:06PM -0400, Lan Tianyu wrote:
> diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
> index 6196334..349a8cf 100644
> --- a/xen/drivers/passthrough/io.c
> +++ b/xen/drivers/passthrough/io.c
> @@ -942,21 +942,20 @@ static void __msi_pirq_eoi(struct hvm_pirq_dpci 
> *pirq_dpci)
>  static int _hvm_dpci_msi_eoi(struct domain *d,
>                               struct hvm_pirq_dpci *pirq_dpci, void *arg)
>  {
> -    int vector = (long)arg;
> +    uint8_t vector, dlm, vector_target = (long)arg;

Since you are changing this, please cast to (uint8_t) instead.

> +    uint32_t dest;
> +    bool dm;

Why are you moving dest, dm, dlm and vector here?

>  
> -    if ( (pirq_dpci->flags & HVM_IRQ_DPCI_MACH_MSI) &&
> -         (pirq_dpci->gmsi.legacy.gvec == vector) )
> +    if ( pirq_dpci->flags & HVM_IRQ_DPCI_MACH_MSI )
>      {
> -        unsigned int dest = MASK_EXTR(pirq_dpci->gmsi.legacy.gflags,
> -                                      XEN_DOMCTL_VMSI_X86_DEST_ID_MASK);
> -        bool dest_mode = pirq_dpci->gmsi.legacy.gflags &
> -                         XEN_DOMCTL_VMSI_X86_DM_MASK;

AFAICT their scope is limited to this if.

> +        if ( pirq_dpci_2_msi_attr(d, pirq_dpci, &vector, &dest, &dm, &dlm) )
> +            return 0;
>  
> -        if ( vlapic_match_dest(vcpu_vlapic(current), NULL, 0, dest,
> -                               dest_mode) )
> +        if ( vector == vector_target &&
> +             vlapic_match_dest(vcpu_vlapic(current), NULL, 0, dest, dm) )
>          {
> -            __msi_pirq_eoi(pirq_dpci);
> -            return 1;
> +                __msi_pirq_eoi(pirq_dpci);
> +                return 1;
>          }
>      }
>  
> -- 
> 1.8.3.1
> 

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