[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v8 10/11] viridian: add implementation of synthetic timers
- To: 'Jan Beulich' <JBeulich@xxxxxxxx>
- From: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
- Date: Mon, 18 Mar 2019 16:26:05 +0000
- Accept-language: en-GB, en-US
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wei.liu2@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, "Tim \(Xen.org\)" <tim@xxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Delivery-date: Mon, 18 Mar 2019 16:26:13 +0000
- Ironport-data: A9a23:aNrYG6x16W7/gBrIVY56t4n5zX1Z45wBZkZajvbM1gqbGUtJgyEMeI pgqWmOkdXIVZFwyLcU6pjk1AdOpT31gBtuCvAycMS/KLNoikhDvht+kjnpgTx3/mmxQ3Xaid Ly2PiXiE8FtLP9syoS3sLT8kOc9lc2I3PZrc9+Do7wcXf9eol7bJEjPdKWF3CLnlWMFLcfV2 A3nDrldebx6Xp4HkVbjzUz2pI6C1VJ7n6Dk0YjJLHuGLnZIHSS8UngVGzqdZhC5m1GJqdODa 8j04Q6al1rCs23iY8NNEyWV5sUHyF5A2lPwFBtIRPPY1UPV6viY/j+MGR+d1ON2Lo0V2a86j SBDJ0VrtHSm0UoxEGJ2+smehyloBlayvaafwYOYt++ZkeFG1z3zvmJkdqsbd0197QGzoVyT2 0UitcjiXleOPsoAeCqF6zr6KEfVTgPq4hedOrsjwPNoK4AgS9I8ko88c1J0lbNc0Rnr5/P20 ADT+J7fSKW/x+3iY6oPgcxgee7J5akT6c1I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fbBSu4VLb1kWpN3HPjvWV+VfkpN2bHHbcwzHj48rLV2JfAdK byoT/ETBU6W2/S2O/eAqx/Fi1UkpCU/8YZfK+z3OIyoj1QKW38xEswYJ8kMoJ60cPQxplaPf EpqxbBQjLZ64H5sTkE5R0tqTP0EhLqZoTDGOaQmvQFeEg0h38snp5zl9UWAJSkivPjCdSS8k sOOdFew6VvG3VMVQjPoVnSvqg15Uv+IMV6syP0Dl//Hk3Vc6xeRhgt6vt1Hb/o+HRKGmltNn j+hitf/dpje1kcWTAeVAHXAhYulwo45m2FGEBsjM55BWbXCAxp7J9T/c5kiz3UTnSlx2xdUg uouRiQbbPmmix0uxAITCLfnwBGDVeO7MXXaRj3RgGOYqRBITB3iIDHczpIBC5QzSbBTYoMuu soCemPoQkFMvVlC/20v8TuQsUnh3c0KDyMUE4ypMuHiQ1Dn/XKneZRY9gJ20O1cZwNPmacp9 WiD8c=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHU3X2WVMvWAzv7yUWT06FGctY0sqYRYLYAgAATJKCAABN4MP//+oUAgAARHMA=
- Thread-topic: [Xen-devel] [PATCH v8 10/11] viridian: add implementation of synthetic timers
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: 18 March 2019 16:23
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
> Cc: Julien Grall <julien.grall@xxxxxxx>; Andrew Cooper
> <Andrew.Cooper3@xxxxxxxxxx>; George Dunlap
> <George.Dunlap@xxxxxxxxxx>; Ian Jackson <Ian.Jackson@xxxxxxxxxx>; Roger Pau
> Monne
> <roger.pau@xxxxxxxxxx>; Wei Liu <wei.liu2@xxxxxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>;
> xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>; Konrad Rzeszutek Wilk
> <konrad.wilk@xxxxxxxxxx>; Tim
> (Xen.org) <tim@xxxxxxx>
> Subject: Re: [Xen-devel] [PATCH v8 10/11] viridian: add implementation of
> synthetic timers
>
> >>> On 18.03.19 at 16:46, <Paul.Durrant@xxxxxxxxxx> wrote:
> >> > > + {
> >> > > + expiration = vs->count;
> >> > > + if ( expiration - now <= 0 )
> >> > > + {
> >> > > + vs->expiration = expiration;
> >> > > + stimer_expire(vs);
> >> >
> >> > Aren't you introducing a risk for races by calling the timer function
> >> > directly from here? start_timer(), after all, gets called from quite a
> >> > few places.
> >>
> >> In practice I don't think there should be any problematic race, but I'll
> >> check again.
> >
> > I think the 'periodic' name might be confusing things... The Xen timers are
> > all single-shot, it's just that start_stimer() is re-called after a
> > successful poll if the viridian timer is configured to be periodic. So I
> > don't think there is case where the underlying Xen timer could actually be
> > running when we enter start_stimer().
>
> One of the callers of the function is the WRMSR handler. Why would
> it be guaranteed that the timer isn't active when such a WRMSR
> occurs?
It's not guaranteed on entry, but the WRMSR handler always calls stop_stimer()
before calling start_stimer() which AFAICT should guarantee the timer is not
running when start_stimer() is called.
Paul
> Of course, this alone is not enough for there to be a problem,
> as we're fine as long as the guest can only harm itself. But I don't
> think it goes without saying that there's no issue here; having looked
> a 2nd time just now, I think I agree though that there's no risk for our
> own health here.
>
> Jan
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|