tech-kern archive

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

Re: PCI: disable I/O or mem before probing BAR size



>>> I found that Xen doesn't allow changing memory-mapped PCI BARs if
>>> memory decode is enabled in the command register.
>> Is this permitted behaviour for a PCI device [...]?
> I think disabling access to whatever the BAR maps while fudging with
> it is a pretty good idea on its own.

On the one hand, yes, that's reasonable.

On the other, if anything else could possibly be poking at the device
while you're probing its mapping register to see how big it is, you've
got much worse problems already.

I'm not sure where I come down on this.  (I do, though, think it might
be a good idea to comment the code a little more; the only comment I
see in bouyer@'s original patch is a what/how comment, replicated for a
total of three instances, not a why comment, and I think a why comment
or two might not be amiss.)

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index