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

Re: [PATCH] xen/vcpu: remove vcpu_set_singleshot_timer flags field


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 19 Apr 2023 09:07:41 +0200
  • 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=r35Rb35zAHx8L0l0T4lYDIXwIFCBnnjs+xh5DuqE/4w=; b=Nzz4Pjy9sap1ZMsr0EMEt/NQWiJAjVsXm9nQoFUbz8kZb9kPTJJsNjWHSRmVhjari+Uxf+PQxlZrKV6Xd76I2TiJD8wvpWl8VkSb+In6Ab5o9Wc6oeh2Zkufe8Lf+m++Z3HnmF2wRieaIomxPGGF0FFdgisAxyKvt5hhL47VKEMJ76hxmYleYGLEqIyvZvwHKAznIPoe8xYsSfVEDxfrnIgSXP2kZK1553evbapgUO8q5lFfwBM0TeQvboLj9EZeayK1jg9m+af/gafrjOS3lJnMYgoTfvDEiOualOdot8OppBd2zLaBEkTOZpOHczlAiIUu8ACRUjpojyNjuZYQIw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=htQTAAA10KK5xflJ7o6kU8iqdMhFeJoRH6OjcqdDkOWkVq+FzkhzfFFs87Vv+4w4hENKTDfrSQmZ1OCp8qpZdPQ2fnbgovyhEo0zQJwy8Xk0oirCb+XnYBBtG+9+E1laP186tZ219nYE9Jn5HVaee9QGKcpCd/N+fxyzljdrKsKMATQaOp9hSDkb1JY7+Jlp53lNRpaLvkPr0XPD8dgs2gIZJc4sA/1ofAwAbV0cavDBNnW87f5N8wz5cA/ZuLhjQECdFmExDZUQjy0Q76sPdvs1SzmmtSYnGd7fsaY+l04DYt/R63RYrH5jPUW1Ir0BMz06wbBCGJ2UH4L+KxNQLA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Henry Wang <Henry.Wang@xxxxxxx>, Community Manager <community.manager@xxxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 19 Apr 2023 07:08:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.04.2023 17:54, Andrew Cooper wrote:
> On 18/04/2023 4:42 pm, Roger Pau Monne wrote:
>> The addition of the flags field in the vcpu_set_singleshot_timer in
>> 505ef3ea8687 is an ABI breakage, as the size of the structure is
>> increased.
>>
>> Remove such field addition and drop the implementation of the
>> VCPU_SSHOTTMR_future flag.  If a timer provides an expired timeout
>> value just inject the timer interrupt.
>>
>> Bump the Xen interface version, and keep the flags field and
>> VCPU_SSHOTTMR_future available for guests using the old interface.
>>
>> Note the removal of the field from the vcpu_set_singleshot_timer
>> struct allows removing the compat translation of the struct.
>>
>> Fixes: 505ef3ea8687 ('Add flags field to VCPUOP_set_singlsehot_timer.')
>> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> While everything said is true, this isn't the reason to to get rid of
> VCPU_SSHOTTMR_future
> 
> It 505ef3ea8687 does appear to have been an ABI break, that's
> incidental.  It dates from 2007 so whatever we have now is the de-facto
> ABI, whether we like it or not.
> 
> The reason to delete this is because it is a monumentality and entirely
> stupid idea which should have been rejected outright at the time, and
> the only guest we can find which uses it also BUG_ON()'s in response to
> -ETIME.

The instance in Linux (up to 4.6) that I could find was

        BUG_ON(ret != 0 && ret != -ETIME);

i.e. not really dying when getting back -ETIME. (And if there really was
a BUG_ON(ret) somewhere despite setting the flag, it would be a bug there,
not something to "fix" in Xen.) I'm afraid I also disagree on "stupid
idea" as well as ...

> It can literally only be used to shoot yourself in the foot with, and
> more recent Linuxes have dropped their use of it.

... this: If used correctly, it can avoid injection of a pointless event.
Clearly the Linux change dropping use of the flag indicates that its use
wasn't correct (anymore?), likely because of not properly dealing with
-ETIME up the call stack. I'm willing to trust Jeremy / Keir that at the
time of its introduction such a problem didn't exist.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.