All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Paul Durrant <paul.durrant@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Tim Deegan <tim@xen.org>,
	george.dunlap@citrix.com, Julien Grall <julien.grall@arm.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <Ian.Jackson@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH v9 10/11] viridian: add implementation of synthetic timers
Date: Tue, 19 Mar 2019 07:32:28 -0600	[thread overview]
Message-ID: <5C90EF6C0200007800220476@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <22207b1c797348289442efcf6af882b5@AMSPEX02CL02.citrite.net>

>>> On 19.03.19 at 13:47, <Paul.Durrant@citrix.com> wrote:
>> From: Jan Beulich [mailto:JBeulich@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.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-03-19 13:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19  9:21 [PATCH v9 00/11] viridian: implement more enlightenments Paul Durrant
2019-03-19  9:21 ` [PATCH v9 01/11] viridian: add init hooks Paul Durrant
2019-03-19  9:21 ` [PATCH v9 02/11] viridian: separately allocate domain and vcpu structures Paul Durrant
2019-03-19  9:21 ` [PATCH v9 03/11] viridian: use stack variables for viridian_vcpu and viridian_domain Paul Durrant
2019-03-19  9:21 ` [PATCH v9 04/11] viridian: make 'fields' struct anonymous Paul Durrant
2019-03-19  9:21 ` [PATCH v9 05/11] viridian: extend init/deinit hooks into synic and time modules Paul Durrant
2019-03-19  9:21 ` [PATCH v9 06/11] viridian: add missing context save helpers " Paul Durrant
2019-03-19  9:21 ` [PATCH v9 07/11] viridian: use viridian_map/unmap_guest_page() for reference tsc page Paul Durrant
2019-03-19  9:21 ` [PATCH v9 08/11] viridian: stop directly calling viridian_time_ref_count_freeze/thaw() Paul Durrant
2019-03-19  9:21 ` [PATCH v9 09/11] viridian: add implementation of synthetic interrupt MSRs Paul Durrant
2019-03-19  9:21 ` [PATCH v9 10/11] viridian: add implementation of synthetic timers Paul Durrant
2019-03-19 12:18   ` Jan Beulich
2019-03-19 12:47     ` Paul Durrant
2019-03-19 13:16       ` Paul Durrant
2019-03-19 13:32       ` Jan Beulich [this message]
2019-03-19 13:45         ` Paul Durrant
2019-03-19  9:21 ` [PATCH v9 11/11] viridian: add implementation of the HvSendSyntheticClusterIpi hypercall Paul Durrant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5C90EF6C0200007800220476@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=paul.durrant@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.