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-reset.patch
Date: Wed, 25 May 2005 11:27:33 -0700 [thread overview]
Message-ID: <20050525182733.GA497@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 1122)
+++ trunk/xen/arch/x86/vmx_intercept.c (working copy)
@@ -217,6 +217,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));
+
/* init count for this channel */
vpit->init_val = (p->u.data & 0xFFFF) ;
/* frequency(ms) of pit */
@@ -251,12 +259,11 @@ void vmx_hooks_assist(struct exec_domain
vpit->intr_bitmap = intr;
- /* set up the actimer */
- init_ac_timer(&(vpit->pit_timer));
vpit->pit_timer.cpu = 0; /*FIXME: change for SMP */
vpit->pit_timer.data = (unsigned long)vpit;
vpit->pit_timer.function = pit_timer_fn;
- pit_timer_fn((unsigned long)vpit); /* timer seed */
+
+ add_ac_timer(&(vpit->pit_timer));
/*restore the state*/
p->state = STATE_IORESP_READY;
next reply other threads:[~2005-05-25 18:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-25 18:27 Arun Sharma [this message]
2005-05-25 21:20 ` [PATCH] vmx-pit-reset.patch Keir Fraser
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=20050525182733.GA497@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.