Re: [Xen-devel] [PATCH 1/3] xen/cpu: Distinguish "cpu already in that state" in cpu_{up, down}()

2019-04-03 Thread Jan Beulich
>>> On 02.04.19 at 21:57, wrote: > All methods of querying the online state of a CPU are racy without the hotplug > lock held, which can lead to a TOCTOU race trying to online or offline CPUs. > > Distinguish this case with -EEXIST rather than -EINVAL, so the caller can take > other actions if

[Xen-devel] [PATCH 1/3] xen/cpu: Distinguish "cpu already in that state" in cpu_{up, down}()

2019-04-02 Thread Andrew Cooper
All methods of querying the online state of a CPU are racy without the hotplug lock held, which can lead to a TOCTOU race trying to online or offline CPUs. Distinguish this case with -EEXIST rather than -EINVAL, so the caller can take other actions if necessary. While adjusting this, rework the