direct-io.hg

changeset 8395:1283d309a603

Avoid div-by-zero crash if vmx guest specifies bogus timer
divisor.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Dec 18 20:29:43 2005 +0100 (2005-12-18)
parents 381cafbbc3d2
children 3d1c7be170a7
files xen/arch/x86/vmx_intercept.c
line diff
     1.1 --- a/xen/arch/x86/vmx_intercept.c	Sun Dec 18 20:27:42 2005 +0100
     1.2 +++ b/xen/arch/x86/vmx_intercept.c	Sun Dec 18 20:29:43 2005 +0100
     1.3 @@ -203,6 +203,12 @@ static void pit_cal_count(struct vmx_vir
     1.4      u64 nsec_delta = (unsigned int)((NOW() - vpit->inject_point));
     1.5      if (nsec_delta > vpit->period)
     1.6          VMX_DBG_LOG(DBG_LEVEL_1, "VMX_PIT:long time has passed from last injection!");
     1.7 +    if(vpit->init_val == 0)
     1.8 +    {
     1.9 +        printk("PIT init value == 0!\n");
    1.10 +        domain_crash_synchronous();
    1.11 +    }
    1.12 +
    1.13      vpit->count = vpit->init_val - ((nsec_delta * PIT_FREQ / 1000000000ULL) % vpit->init_val );
    1.14  }
    1.15