direct-io.hg

changeset 14325:83756471416f

xen: Debug 'q' key prints per-vcpu periodic timer info.
Do not enable periodic timer by default for HVM guests.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Mar 09 19:34:52 2007 +0000 (2007-03-09)
parents 188bab059272
children cedf9e4ac6ff
files xen/arch/x86/domain.c xen/common/domain.c xen/common/keyhandler.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Fri Mar 09 19:33:43 2007 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Fri Mar 09 19:34:52 2007 +0000
     1.3 @@ -350,6 +350,9 @@ int vcpu_initialise(struct vcpu *v)
     1.4      }
     1.5      else
     1.6      {
     1.7 +        /* PV guests by default have a 100Hz ticker. */
     1.8 +        v->periodic_period = MILLISECS(10);
     1.9 +
    1.10          /* PV guests get an emulated PIT too for video BIOSes to use. */
    1.11          if ( !is_idle_domain(d) && (v->vcpu_id == 0) )
    1.12              pit_init(v, cpu_khz);
     2.1 --- a/xen/common/domain.c	Fri Mar 09 19:33:43 2007 +0000
     2.2 +++ b/xen/common/domain.c	Fri Mar 09 19:34:52 2007 +0000
     2.3 @@ -102,9 +102,6 @@ struct vcpu *alloc_vcpu(
     2.4      v->runstate.state = is_idle_vcpu(v) ? RUNSTATE_running : RUNSTATE_offline;
     2.5      v->runstate.state_entry_time = NOW();
     2.6  
     2.7 -    /* VCPUs by default have a 100Hz ticker. */
     2.8 -    v->periodic_period = MILLISECS(10);
     2.9 -
    2.10      if ( (vcpu_id != 0) && !is_idle_domain(d) )
    2.11          set_bit(_VCPUF_down, &v->vcpu_flags);
    2.12  
     3.1 --- a/xen/common/keyhandler.c	Fri Mar 09 19:33:43 2007 +0000
     3.2 +++ b/xen/common/keyhandler.c	Fri Mar 09 19:34:52 2007 +0000
     3.3 @@ -135,12 +135,25 @@ static void cpuset_print(char *set, int 
     3.4      *set++ = '\0';
     3.5  }
     3.6  
     3.7 +static void periodic_timer_print(char *str, int size, uint64_t period)
     3.8 +{
     3.9 +    if ( period == 0 )
    3.10 +    {
    3.11 +        strlcpy(str, "No periodic timer", size);
    3.12 +        return;
    3.13 +    }
    3.14 +
    3.15 +    snprintf(str, size,
    3.16 +             "%u Hz periodic timer (period %u ms)",
    3.17 +             1000000000/(int)period, (int)period/1000000);
    3.18 +}
    3.19 +
    3.20  static void dump_domains(unsigned char key)
    3.21  {
    3.22      struct domain *d;
    3.23      struct vcpu   *v;
    3.24      s_time_t       now = NOW();
    3.25 -    char           cpuset[100];
    3.26 +    char           tmpstr[100];
    3.27  
    3.28      printk("'%c' pressed -> dumping domain info (now=0x%X:%08X)\n", key,
    3.29             (u32)(now>>32), (u32)now);
    3.30 @@ -150,11 +163,11 @@ static void dump_domains(unsigned char k
    3.31      for_each_domain ( d )
    3.32      {
    3.33          printk("General information for domain %u:\n", d->domain_id);
    3.34 -        cpuset_print(cpuset, sizeof(cpuset), d->domain_dirty_cpumask);
    3.35 +        cpuset_print(tmpstr, sizeof(tmpstr), d->domain_dirty_cpumask);
    3.36          printk("    flags=%lx refcnt=%d nr_pages=%d xenheap_pages=%d "
    3.37                 "dirty_cpus=%s\n",
    3.38                 d->domain_flags, atomic_read(&d->refcnt),
    3.39 -               d->tot_pages, d->xenheap_pages, cpuset);
    3.40 +               d->tot_pages, d->xenheap_pages, tmpstr);
    3.41          printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
    3.42                 "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
    3.43                 d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],
    3.44 @@ -179,18 +192,21 @@ static void dump_domains(unsigned char k
    3.45                     v->vcpu_flags,
    3.46                     vcpu_info(v, evtchn_upcall_pending),
    3.47                     vcpu_info(v, evtchn_upcall_mask));
    3.48 -            cpuset_print(cpuset, sizeof(cpuset), v->vcpu_dirty_cpumask);
    3.49 -            printk("dirty_cpus=%s ", cpuset);
    3.50 -            cpuset_print(cpuset, sizeof(cpuset), v->cpu_affinity);
    3.51 -            printk("cpu_affinity=%s\n", cpuset);
    3.52 +            cpuset_print(tmpstr, sizeof(tmpstr), v->vcpu_dirty_cpumask);
    3.53 +            printk("dirty_cpus=%s ", tmpstr);
    3.54 +            cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_affinity);
    3.55 +            printk("cpu_affinity=%s\n", tmpstr);
    3.56              arch_dump_vcpu_info(v);
    3.57 +            periodic_timer_print(tmpstr, sizeof(tmpstr), v->periodic_period);
    3.58 +            printk("    %s\n", tmpstr);
    3.59              printk("    Notifying guest (virq %d, port %d, stat %d/%d/%d)\n",
    3.60                     VIRQ_DEBUG, v->virq_to_evtchn[VIRQ_DEBUG],
    3.61                     test_bit(v->virq_to_evtchn[VIRQ_DEBUG], 
    3.62                              shared_info_addr(d, evtchn_pending)),
    3.63                     test_bit(v->virq_to_evtchn[VIRQ_DEBUG], 
    3.64                              shared_info_addr(d, evtchn_mask)),
    3.65 -                   test_bit(v->virq_to_evtchn[VIRQ_DEBUG]/BITS_PER_GUEST_LONG(d),
    3.66 +                   test_bit(v->virq_to_evtchn[VIRQ_DEBUG] /
    3.67 +                            BITS_PER_GUEST_LONG(d),
    3.68                              vcpu_info_addr(v, evtchn_pending_sel)));
    3.69              send_guest_vcpu_virq(v, VIRQ_DEBUG);
    3.70          }