Cui, Dexuan
2010-Jan-22 08:01 UTC
[Xen-devel] [PATCH] x86: check if desc->action is NULL when unbinding guest pirq
Before igb PF driver is unloaded, dom0 doesn''t unload igbvf driver automatically. When igb drver is unloaded, it invokes the PHYSDEVOP_manage_pci_remove hypercall to remove the VFs and xen frees the msi irqs by pci_cleanup_msi() -> ... -> dynamic_irq_cleanup() and sets the desc->action to NULL. igbvf driver knows the VF is disappearing via a hook ndo_stop() in dev_close() and tries to unbind the pirq and xen would crash as the desc->action is NULL now. The patch adds the checking for this. Thanks, -- Dexuan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2010-Jan-26 15:57 UTC
[Xen-devel] Re: [PATCH] x86: check if desc->action is NULL when unbinding guest pirq
On 22/01/2010 08:01, "Cui, Dexuan" <dexuan.cui@intel.com> wrote:> Before igb PF driver is unloaded, dom0 doesn''t unload igbvf driver > automatically. When igb drver is unloaded, it invokes the > PHYSDEVOP_manage_pci_remove hypercall to remove the VFs and xen frees the msi > irqs by pci_cleanup_msi() -> ... -> dynamic_irq_cleanup() and sets the > desc->action to NULL. > igbvf driver knows the VF is disappearing via a hook ndo_stop() in dev_close() > and tries to unbind the pirq and xen would crash as the desc->action > is NULL now. > The patch adds the checking for this.Although I checked this in as c/s 20844, I now wonder what the ''desc->status|IRQ_DISABLED'' is included for? (e.g., see below extract:) + if (unlikely((desc->status | IRQ_DISABLED) && (desc->action == NULL))) Looks pointless: should this just be ''if(desc->action==NULL)''? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Cui, Dexuan
2010-Jan-29 02:55 UTC
[Xen-devel] RE: [PATCH] x86: check if desc->action is NULL when unbinding guest pirq
Keir Fraser wrote:> On 22/01/2010 08:01, "Cui, Dexuan" <dexuan.cui@intel.com> wrote: > >> Before igb PF driver is unloaded, dom0 doesn''t unload igbvf driver >> automatically. When igb drver is unloaded, it invokes the >> PHYSDEVOP_manage_pci_remove hypercall to remove the VFs and xen >> frees the msi irqs by pci_cleanup_msi() -> ... -> >> dynamic_irq_cleanup() and sets the desc->action to NULL. igbvf >> driver knows the VF is disappearing via a hook ndo_stop() in >> dev_close() and tries to unbind the pirq and xen would crash as the >> desc->action >> is NULL now. >> The patch adds the checking for this. > > Although I checked this in as c/s 20844, I now wonder what the > ''desc->status|IRQ_DISABLED'' is included for? (e.g., see below > extract:) > > + if (unlikely((desc->status | IRQ_DISABLED) && (desc->action => NULL))) > > Looks pointless: should this just be ''if(desc->action==NULL)''?(Sorry for the late reply as I was out for several days.) Yes, I think so. Please improve it. :-) Thanks, -- Dexuan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel