All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] vlapic: Fix one_shot argument passed to create_period_time()
Date: Fri, 22 Jun 2007 19:39:43 +0900	[thread overview]
Message-ID: <467BA6EF.1090808@ab.jp.nec.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

Hi,

I've found a problem that the vlapic timer never runs in one-shot mode.
This is because the one_shot argument passed to create_period_time() is
incorrect. This patch fixes the problem and enables one-shot timer
to work properly.

Regards,
-------------------
Yosuke Iwamatsu
         NEC Corporation







[-- Attachment #2: vlapic_timer_one_shot.patch --]
[-- Type: text/plain, Size: 1596 bytes --]

# HG changeset patch
# User Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
# Date 1182507980 -32400
# Node ID 924bd2238560ec01f757e1eda1897c5327e1d997
# Parent  015d9abeacfb39c73c9aa488c2def2f66ab06e2b
vlapic: Fix one_shot argument passed to create_period_time()

vlapic_lvtt_period() returns '0' in one-shot mode and '131072(1<<17)'
in periodic mode. On the contrary, to create_periodic_time(), '1' should
be passed in one-shot mode and '0' should be passed in periodic mode.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>

diff -r 015d9abeacfb -r 924bd2238560 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Thu Jun 21 21:36:26 2007 +0100
+++ b/xen/arch/x86/hvm/vlapic.c	Fri Jun 22 19:26:20 2007 +0900
@@ -660,7 +660,8 @@ static void vlapic_write(struct vcpu *v,
 
         vlapic_set_reg(vlapic, APIC_TMICT, val);
         create_periodic_time(current, &vlapic->pt, period, vlapic->pt.irq,
-                             vlapic_lvtt_period(vlapic), NULL, vlapic);
+                             (vlapic_lvtt_period(vlapic) ? 0 : 1), NULL,
+                             vlapic);
 
         HVM_DBG_LOG(DBG_LEVEL_VLAPIC,
                     "bus cycle is %uns, "
@@ -819,7 +820,7 @@ static void lapic_rearm(struct vlapic *s
 
         s->pt.irq = lvtt & APIC_VECTOR_MASK;
         create_periodic_time(vlapic_vcpu(s), &s->pt, period, s->pt.irq,
-                             vlapic_lvtt_period(s), NULL, s);
+                             (vlapic_lvtt_period(s) ? 0 : 1), NULL, s);
 
         printk("lapic_load to rearm the actimer:"
                     "bus cycle is %uns, "


[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2007-06-22 10:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=467BA6EF.1090808@ab.jp.nec.com \
    --to=y-iwamatsu@ab.jp.nec.com \
    --cc=xen-devel@lists.xensource.com \
    /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.