All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
To: Tim Deegan <tim@xen.org>
Cc: George.Dunlap@eu.citrix.com, Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Time Skewing on Windows XP
Date: Thu, 14 Mar 2013 15:23:24 -0500	[thread overview]
Message-ID: <514231BC.301@amd.com> (raw)
In-Reply-To: <20130314170834.GF5174@ocelot.phlegethon.org>

So far, this patch allows me to get the correct timing on the XP.

Suravee

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index c1e09d8..a85af5c 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -76,6 +76,15 @@ void rtc_periodic_interrupt(void *opaque)
      spin_unlock(&s->lock);
  }

+static void rtc_periodic_cb(struct vcpu *v, void *opaque)
+{
+    RTCState *s = opaque;
+
+    spin_lock(&s->lock);
+    s->hw.cmos_data[RTC_REG_C] |= RTC_PF | RTC_IRQF;
+    spin_unlock(&s->lock);
+}
+
  /* Enable/configure/disable the periodic timer based on the RTC_PIE and
   * RTC_RATE_SELECT settings */
  static void rtc_timer_update(RTCState *s)
@@ -98,7 +107,7 @@ static void rtc_timer_update(RTCState *s)
          {
              period = 1 << (period_code - 1); /* period in 32 Khz cycles */
              period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
-            create_periodic_time(v, &s->pt, period, period, RTC_IRQ, 
NULL, s);
+            create_periodic_time(v, &s->pt, period, period, RTC_IRQ, 
rtc_periodic_cb, s);
              break;
          }
          /* fall through */
@@ -619,7 +628,6 @@ static uint32_t rtc_ioport_read(RTCState *s, 
uint32_t addr)
          s->hw.cmos_data[RTC_REG_C] = 0x00;
          check_update_timer(s);
          alarm_timer_update(s);
-        rtc_timer_update(s);
          break;
      default:
          ret = s->hw.cmos_data[s->hw.cmos_index];
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 46d3ec6..9c1dbfb 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -259,8 +259,6 @@ int pt_update_irq(struct vcpu *v)

      if ( is_lapic )
          vlapic_set_irq(vcpu_vlapic(v), irq, 0);
-    else if ( irq == RTC_IRQ && pt_priv )
-        rtc_periodic_interrupt(pt_priv);
      else
      {
          hvm_isa_irq_deassert(v->domain, irq);

  reply	other threads:[~2013-03-14 20:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12  4:40 Time Skewing on Windows XP Suravee Suthikulpanit
2013-03-12  5:00 ` Steven Haigh
2013-03-12  8:03 ` Jan Beulich
2013-03-14 15:16   ` Suravee Suthikulanit
2013-03-14 16:06     ` Jan Beulich
2013-03-14 16:21       ` Suravee Suthikulanit
2013-03-14 16:34         ` Jan Beulich
2013-03-14 16:38           ` Suravee Suthikulanit
2013-03-14 17:03             ` Jan Beulich
2013-03-14 16:30       ` Tim Deegan
2013-03-14 16:43         ` Jan Beulich
2013-03-14 17:08           ` Tim Deegan
2013-03-14 20:23             ` Suravee Suthikulanit [this message]
2013-03-15  8:23               ` Jan Beulich
2013-03-21 12:33                 ` Tim Deegan
2013-03-21 17:05                   ` Jan Beulich
2013-03-14 16:24     ` Tim Deegan
2013-03-14 16:28       ` Jan Beulich
2013-03-12  9:13 ` Paul Durrant
2013-03-12 15:55   ` Suravee Suthikulanit
2013-03-12 16:13     ` Boris Ostrovsky
2013-03-12 18:25     ` Suravee Suthikulanit

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=514231BC.301@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=tim@xen.org \
    --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 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.