[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-4.17?] x86/paging: return -EINVAL for paging domctls for dying domains
- To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 9 Nov 2022 11:23:01 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jRECr6tP4wvvHgzeKlxFk/LOVO7VZVdSy/dOcaq8ppA=; b=BdIJPvtN1yTMZyhn8fQJMOOkL1np8iSzczhtZ6/QvUEWRSLc0wR2bWaMBGSfZ+9ocz9cY16HYR5SiZmeq74exyGxM2QV8lZ7XQDJ5GZwpcYAxjNwP7AUAf44XRoXZsHywMIl5zsmtT75PBEZEfJc2Ru7hhgzI+CaCIzJoaeQZDSTDgH4A+lBTlteXHLJ95ZL2OlwztZ1yBFaLADQlchH+XgHc0B11eUTp4psjWuDtwz4W7JPbuWBQSG5JWUgIv49LZxN+B/BLn2bGzHtv6j/Ro1JVpNC+9RpJ5aZtDW2ccmoqMM1MJ3PmIgbycZXOLYLIF8rjtedcHNbWVwcafNogw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fxy+AFpiaOYJen5ptxwOCCrnqSx2m/qZ2ZJpqgBTYRCsiu0O+OX9ajPqJ40c/JB+1wVMdqokfHItPcg7y6Wx2Ry8IUTGqkzemXxXCMBeo5uDAsMRKmqcDFtlCZEb+SYhZZui7zmTWAj+RH2aRti3G+LXcPgkBxuv39kZlH094MIYFK4bqrdzzML1bWpMFMfOaSPdzaDTMsb2nhEpYOvD9FsukCScNR64oGK6kqMr8zv230WSzL2F3nTJQLYyjIvoYZPZjgdHKU9+qIbDKxHZNHdkS1uglePU8eoCG916jR9+OI2pK9vH5b/Zr7GlcRM0PMTqbkPS5ybyFUpJcF6Ruw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Henry.Wang@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Edwin Török <edvin.torok@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 09 Nov 2022 10:23:16 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 09.11.2022 11:11, Roger Pau Monné wrote:
> On Wed, Nov 09, 2022 at 08:48:46AM +0100, Jan Beulich wrote:
>> Finally I'm not convinced of the usefulness of this dying check in the
>> first place: is_dying may become set immediately after the check was
>> done.
>
> While strictly true, this code is executed with the domain lock held,
> so while is_dying might change, domain_kill() won't make progress
> because of the barrier on the domain lock just after setting is_dying.
I guess I'm confused now: This code is called with the domctl lock
held, which - as said before - is a questionable thing, for serializing
things more than necessary as well as for holding this lock for
excessive periods of time. IOW I consider it wrong to depend on that
in paging_domctl() to synchronize against domain_kill(). Yet indeed that
should eliminate races at present.
Jan
|