direct-io.hg

changeset 5647:6f462a11a08e

Register the portio handler only once.
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jul 01 21:25:45 2005 +0000 (2005-07-01)
parents 82390e707bb9
children 2b6c1a809807
files xen/arch/x86/vmx_intercept.c
line diff
     1.1 --- a/xen/arch/x86/vmx_intercept.c	Fri Jul 01 21:25:19 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx_intercept.c	Fri Jul 01 21:25:45 2005 +0000
     1.3 @@ -216,7 +216,7 @@ void vmx_hooks_assist(struct vcpu *d)
     1.4      shared_iopage_t *sp = get_sp(d->domain);
     1.5      u64 *intr = &(sp->sp_global.pic_intr[0]);
     1.6      struct vmx_virpit_t *vpit = &(d->domain->arch.vmx_platform.vmx_pit);
     1.7 -    int rw_mode;
     1.8 +    int rw_mode, reinit = 0;
     1.9  
    1.10      /* load init count*/
    1.11      if (p->state == STATE_IORESP_HOOK) { 
    1.12 @@ -224,6 +224,7 @@ void vmx_hooks_assist(struct vcpu *d)
    1.13          if ( active_ac_timer(&(vpit->pit_timer)) ) {
    1.14              VMX_DBG_LOG(DBG_LEVEL_1, "VMX_PIT: guest reset PIT with channel %lx!\n", (unsigned long) ((p->u.data >> 24) & 0x3) );
    1.15              rem_ac_timer(&(vpit->pit_timer));
    1.16 +            reinit = 1;
    1.17          }
    1.18          else
    1.19              init_ac_timer(&vpit->pit_timer, pit_timer_fn, vpit, 0);
    1.20 @@ -268,7 +269,8 @@ void vmx_hooks_assist(struct vcpu *d)
    1.21          p->state = STATE_IORESP_READY;
    1.22  
    1.23  	/* register handler to intercept the PIT io when vm_exit */
    1.24 -	register_portio_handler(0x40, 4, intercept_pit_io); 
    1.25 +        if (!reinit)
    1.26 +	    register_portio_handler(0x40, 4, intercept_pit_io); 
    1.27      }
    1.28  
    1.29  }