> -----Original Message----- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: 19 March 2019 13:32 > To: Paul Durrant <paul.durr...@citrix.com> > Cc: Julien Grall <julien.gr...@arm.com>; Andrew Cooper > <andrew.coop...@citrix.com>; George Dunlap > <george.dun...@citrix.com>; Ian Jackson <ian.jack...@citrix.com>; Roger Pau > Monne > <roger....@citrix.com>; Wei Liu <wei.l...@citrix.com>; Stefano Stabellini > <sstabell...@kernel.org>; > xen-devel <xen-devel@lists.xenproject.org>; Konrad Rzeszutek Wilk > <konrad.w...@oracle.com>; Tim > (Xen.org) <t...@xen.org> > Subject: RE: [PATCH v9 10/11] viridian: add implementation of synthetic timers > > >>> On 19.03.19 at 13:47, <paul.durr...@citrix.com> wrote: > >> From: Jan Beulich [mailto:jbeul...@suse.com] > >> Sent: 19 March 2019 12:18 > >> > >> So perhaps a set > >> pending bit should result in the RDMSR handling to clear the enabled > >> bit in the returned value for a non-periodic timer? > > > > I get tied in knots every time I think about this and without waiting for a > > pending timer to stop when it is disabled I see no way of the race, but I > > think doing that would be prohibitively slow because windows seems to flip > > between single-shot and periodic timers on quite a frequent basis. > > I'm afraid I don't understand: Why a timer or any other complications. > All I'm thinking about is > > case HV_X64_MSR_STIMER0_CONFIG: > case HV_X64_MSR_STIMER1_CONFIG: > case HV_X64_MSR_STIMER2_CONFIG: > case HV_X64_MSR_STIMER3_CONFIG: > { > unsigned int stimerx = (idx - HV_X64_MSR_STIMER0_CONFIG) / 2; > const struct viridian_stimer *vs = > &array_access_nospec(vv->stimer, stimerx); > > if ( !(viridian_feature_mask(d) & HVMPV_stimer) ) > return X86EMUL_EXCEPTION; > > *val = vs->config.raw; > if ( !vs->config.periodic && test_bit(stimerx, vv->stimer_pending) ) > *val &= ~1; > break; > } > > or a suitable equivalent to avoid the literal 1, plus perhaps a > helpful comment.
Ok. That shouldn't hurt. I'll avoid the literal 1 as you suggest and test an equivalent. Paul > > Jan > _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel