Re: [PATCH] uio/gen-pci: don't enable interrupts in ISR

From: Michael S. Tsirkin
Date: Tue Aug 09 2011 - 08:01:50 EST


On Tue, Aug 09, 2011 at 01:43:46PM +0200, Sebastian Andrzej Siewior wrote:
> Michael S. Tsirkin wrote:
> >>It seems to me that you could drop this "user block" thing
> >>since you never change anything outside of this command register and it
> >>does not stop the race.
> >
> >I don't think so: if we did, we would lose userspace modifications to
> >other bits such as io enable, and there's no way to guess what their
> >values should be.
>
> How so?
>
> Sebastian

Let's assume we start with e.g. io enable bit cleared.


user kernel
read config |
set io enable |
| interrupt
| read + set interrupt mask
write config back |
write



We end up with io enable bit cleared. Locking around rmw
that we have fixes this race.

--
MST
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/