vpci: shrink critical section in vpci_{read/write}
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 3 Feb 2022 12:12:21 +0000 (13:12 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 3 Feb 2022 12:12:21 +0000 (13:12 +0100)
commitd055114f6db3e4bd57b6d832a03445f0f9c598bc
tree855ebf02ea384c80c38a64b9159272177df43f41
parentb17e0ec72eded037297f34a233655aad23f64711
vpci: shrink critical section in vpci_{read/write}

Shrink critical section in vpci_{read/write} as racing calls to
vpci_{read,write}_hw() shouldn't be a problem. Those are just wrappers
around pci_conf_{read,write} functions, and the required locking (in
case of using the IO ports) is already taken care in pci_conf_{read,write}.

Please note, that we anyways split 64bit writes into two 32bit ones
without taking the lock for the whole duration of the access, so it is
possible to see a partially updated state as a result of a 64bit write:
the PCI(e) specification don't seem to specify whether the ECAM is allowed
to split memory transactions into multiple Configuration Requests and
whether those could then interleave with requests from a different CPU.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/vpci/vpci.c