xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH, v3] x86/HVM: RTC periodic timer emulation adjustments
Date: Fri, 31 Aug 2012 17:50:31 +0100	[thread overview]
Message-ID: <CC66A9E7.3D875%keir.xen@gmail.com> (raw)
In-Reply-To: <5040FBEA0200007800097EE5@nat28.tlf.novell.com>

On 31/08/2012 17:01, "Jan Beulich" <JBeulich@suse.com> wrote:

> - don't call rtc_timer_update() on REG_A writes when the value didn't
>   change (doing the call always was reported to cause wall clock time
>   lagging with the JVM running on Windows)
> - don't call rtc_timer_update() on REG_B writes when RTC_PIE didn't
>   change
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

One comment below in-line.

> ---
> v3: Break out just this change from the previously submitted much
>     larger patch. The rest of that one is now planned to go in only
>     after 4.2.
> 
> --- a/xen/arch/x86/hvm/rtc.c
> +++ b/xen/arch/x86/hvm/rtc.c
> @@ -365,6 +365,7 @@ static int rtc_ioport_write(void *opaque
>  {
>      RTCState *s = opaque;
>      struct domain *d = vrtc_domain(s);
> +    uint32_t orig;
>  
>      spin_lock(&s->lock);
>  
> @@ -382,6 +383,7 @@ static int rtc_ioport_write(void *opaque
>          return 0;
>      }
>  
> +    orig = s->hw.cmos_data[s->hw.cmos_index];
>      switch ( s->hw.cmos_index )
>      {
>      case RTC_SECONDS_ALARM:
> @@ -405,9 +407,9 @@ static int rtc_ioport_write(void *opaque
>          break;
>      case RTC_REG_A:
>          /* UIP bit is read only */
> -        s->hw.cmos_data[RTC_REG_A] = (data & ~RTC_UIP) |
> -            (s->hw.cmos_data[RTC_REG_A] & RTC_UIP);
> -        rtc_timer_update(s);
> +        s->hw.cmos_data[RTC_REG_A] = (data & ~RTC_UIP) | (orig & RTC_UIP);
> +        if ( (data ^ orig) & (RTC_RATE_SELECT | RTC_DIV_CTL) )

Please change to 'if ( (data ^ orig) & ~RTC_UIP )'. It is shorter and
matches the style of the immediately preceding line.

Once you make this change:
Acked-by: Keir Fraser <keir@xen.org>

 -- Keir

> +            rtc_timer_update(s);
>          break;
>      case RTC_REG_B:
>          if ( data & RTC_SET )
> @@ -436,7 +438,8 @@ static int rtc_ioport_write(void *opaque
>                  hvm_isa_irq_assert(d, RTC_IRQ);
>              }
>          s->hw.cmos_data[RTC_REG_B] = data;
> -        rtc_timer_update(s);
> +        if ( (data ^ orig) & RTC_PIE )
> +            rtc_timer_update(s);
>          check_update_timer(s);
>          alarm_timer_update(s);
>          break;
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2012-08-31 16:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 16:01 [PATCH, v3] x86/HVM: RTC periodic timer emulation adjustments Jan Beulich
2012-08-31 16:50 ` Keir Fraser [this message]
2012-09-03  6:42   ` Jan Beulich

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=CC66A9E7.3D875%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).