[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: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 19 Apr 2023 11:41:55 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=A15T0GhBZob4zDopz2ez9OET1z5EhIqj/3n3yuOhFkc=; b=GAThWiEUABvteL8V4DgpfrNv7CFeIegqbdfSq5XrwMjLjkxrKdaSI4BmLfdrdxbMY/th8PdhBhjztK44eTRo5IwuWkMPMxwPs0wpHgr7+ClN2D2eXZpxqk2t3ug2r4ye0EQB4vGN48Ee69V9CUP524DpvXK1YqBAHzhqLzGkezeCG1WDDACPOWdzjt7uJh/z/DERpK2OAT79YqmuAV2scJ1FIWptK43ySJK9sCFmCDmFTNOaOT5WI/xhYSQIOOrqUMJSWaX4li4Rc64spICSiG3JcUNxOXYV8QUrq8RFt43Tkk/WhNuHOcAJ+gh19/iI/R1vcAx+3LqI182Iswv5VA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jZYwLqpT5CDZKJZvDuwbJHUUBh7vS610tyZkM1KO2N9asaT0PcgpbAWohpoAouFcy3cpIKkj5GtdAl82v2tDx1TdUJMDvB0ZiYt96C3jPUCv0adqcPyZCU/dNg0k6wXxb29RnhbtCERspX/0d038smfEMdRqBWsySjepA1dANSLwgPOQEhQp2it2+6oDvbx7Of4jOdniEbj8SfvXK4iQH8qy84kHgi4+rR2qvX03F2otLFotxfaXihqB4LAXL8SZ7l0eUfRnYHJzIuzhQm1qZwrvnOcxdCbYSrbV6NGJYYP6k/STMR4maV7CgHXarEqA62dTG9gmDp2Cb9clPv2R0A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Henry Wang <Henry.Wang@xxxxxxx>, Community Manager <community.manager@xxxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 19 Apr 2023 09:42:21 +0000
  • Ironport-data: A9a23:0KKuwK9ww2vEFbpj+nBZDrUDBH+TJUtcMsCJ2f8bNWPcYEJGY0x3y DccXzyAM6mJa2b9fNpyO43gpk0B6pDSnN9kG1M6rns8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kI+1BjOkGlA5AdmOakb5AS2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkkU+ OxEKCAfaCy6uPutyrzlFeNRgdk8eZyD0IM34hmMzBn/JNN/GdXvZvuP4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWDilUpiNABM/KMEjCObd9SkUuC4 HrP4kzyAw0ANczZwj2Amp6prraXzX6iBtJOS9VU8NYzmlmzyEBMGScqSEm2rqi40HTjHMBmf hl8Fi0G6PJaGFaQZsnwWVi0rWCJujYYWsFMCKsq5QeV0K3W7g2FQG8eQVZpSNEgrt5wejUs2 XeAhdavDjtq2JWeTneY67GVsSL0PCETJGAPfwcUQA0d+d7hrYovyBXVQb5LEqS4k9n0EjHY2 C2RoW41gLB7pcwW06S2+3jXjjTqoYLGJiYu/RneVG+h6gJ/Zaamapau5Fyd6uxPRK6GSnGRs X5CnNKRhN3iFrmInS2JBekIQreg4q/dNCWG2AY3WZ486z6q5nivO5hK5y1zL1toNcBCfiL1Z EjUukVa45o70GaWUJKbqrmZU6wCpZUM3/y8PhwIRrKiuqRMSTI=
  • Ironport-hdrordr: A9a23:NCVxgKPJV/VDWcBcTgejsMiBIKoaSvp037BK7S1MoH1uA6ilfq WV9sjzuiWatN98Yh8dcLO7Scy9qBHnhP1ICOAqVN/PYOCBggqVxelZhrcKqAeQeREWmNQ86U 9hGZIOdeHYPBxBouvRpCODNL8bsb66GKLDv5aj85+6JzsaFJ2J7G1Ce3im+lUdfnghOXKgfq DsnPauoVCbCA0qhpTSPAh8YwDbzee7767bXQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Apr 18, 2023 at 05:12:07PM +0100, Andrew Cooper wrote:
> On 18/04/2023 5:02 pm, Roger Pau Monné wrote:
> > On Tue, Apr 18, 2023 at 04:54:49PM +0100, 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.
> > I agree, but didn't think it was necessary to get into debating
> > whether it's useful or not, since its introduction was bogus anyway.
> 
> Well - the reason to actually make a change is that (older) guests are
> really exploding on that BUG_ON() for reasons outside of their own control.
> 
> And the reason to fix it by ignoring VCPU_SSHOTTMR_future is because the
> entire concept is broken and should never have existed.
> 
> The ABI argument just adds to why the patch ought to have been rejected
> at the time.  But it was done, and the fact it has been like this for 16
> years means that the ABI shouldn't change further, even if it done in
> error in the first place.
> 
> >
> >> It can literally only be used to shoot yourself in the foot with, and
> >> more recent Linuxes have dropped their use of it.
> >>
> >> The structure needs to stay it's current shape, and while it's fine to
> >> hide the VCPU_SSHOTTMR_future behind an interface version macro, we do
> >> need to say that it is explicitly ignored.
> > Oh, I think I've dropped the comment I had added next to
> > VCPU_SSHOTTMR_future that contained /* Ignored. */ (just like for the whole
> > flags field).
> >
> > I can elaborate a bit on why VCPU_SSHOTTMR_future is not useful in the
> > commit log, and add that Ignored comment to the flag.
> 
> The important thing is to not actually change the size of the structure,
> and to change the commit message to explain the real reason why we need
> to make the change.

Why not revert back to the previous (smaller) size of the structure?

That would work for guests that have been built with Xen 3.0 headers.
Currently Xen does copy past the original (3.0) structure and likely
copy rubbish from the guest stack from those guests, that might
contain the VCPU_SSHOTTMR_future bit set and end up returning -ENOTIME
unexpectedly.

Overall I don't see the benefit of keeping the flags field, even if
technically it's been so long the ABI was broken that it doesn't
matter anymore.  But still keeping an empty flags field is kind of
useless, the more that removing it allows removing the compat code
handling for VCPUOP_set_singleshot_timer.

Thanks, Roger.



 


Rackspace

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