On Fri, 2009-03-06 at 20:50 +0800, Keir Fraser wrote:
> On 06/03/2009 09:21, "Qing He" <qing.he@xxxxxxxxx> wrote:
>
> >> Add the locks, making it correct. Then optimise later as necessary, using
> >> RCU or (perhaps easier) just smaller locks: Per MSI-X or per-pci-dev or
> >> whatever. Throwing in racey code condemns us to subtle races forever more.
> >
> > Ok, I'll make a patch to use the locks.
> >
> > Do you think it's ok to assume that guest has already free the device
> > when calling remove_pci_device on hotplugging?
>
> Do you mean deinitialised and unloaded the device driver?
Yes, the racey condition we just talked happens here. Consider
the following case, when remove_pci_device is called, the device
data structure is removed by the hypervisor. But there is no
guarauntee in the hypervisor that guest already has knowledge,
for example the guest may continue to access the device resources.
It's in this case msixtbl_{read,write} has a little racey condition.
I don't think this scenario is desirable, but does it happen in the
current logic?
Thanks,
Qing
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|