From: Arun Sharma <arun.sharma@intel.com>
To: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>,
Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: [PATCH] vmx-pit-reset2.patch
Date: Fri, 17 Jun 2005 13:32:34 -0700 [thread overview]
Message-ID: <20050617203234.GA24241@intel.com> (raw)
A VMX guest can reprogram the same PIT channel twice. We should not create
two ac_timers to handle this case.
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
--- trunk/xen/arch/x86/vmx_intercept.c (revision 1187)
+++ trunk/xen/arch/x86/vmx_intercept.c (working copy)
@@ -214,6 +214,14 @@ void vmx_hooks_assist(struct exec_domain
/* load init count*/
if (p->state == STATE_IORESP_HOOK) {
+ /* set up actimer, handle re-init */
+ if ( active_ac_timer(&(vpit->pit_timer)) ) {
+ VMX_DBG_LOG(DBG_LEVEL_1, "VMX_PIT: guest reset PIT with channel %lx!\n", (unsigned long) ((p->u.data >> 24) & 0x3) );
+ rem_ac_timer(&(vpit->pit_timer));
+ }
+ else
+ init_ac_timer(&vpit->pit_timer, pit_timer_fn, vpit, 0);
+
/* init count for this channel */
vpit->init_val = (p->u.data & 0xFFFF) ;
/* frequency(ms) of pit */
@@ -248,9 +256,7 @@ void vmx_hooks_assist(struct exec_domain
vpit->intr_bitmap = intr;
- /* set up the actimer */
- init_ac_timer(&vpit->pit_timer, pit_timer_fn, vpit, 0);
- pit_timer_fn(vpit); /* timer seed */
+ set_ac_timer(&vpit->pit_timer, NOW() + MILLISECS(vpit->period));
/*restore the state*/
p->state = STATE_IORESP_READY;
reply other threads:[~2005-06-17 20:32 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=20050617203234.GA24241@intel.com \
--to=arun.sharma@intel.com \
--cc=Ian.Pratt@cl.cam.ac.uk \
--cc=Keir.Fraser@cl.cam.ac.uk \
--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.