ia64/xen-unstable

changeset 1158:3a610b209872

bitkeeper revision 1.778 (404f5c24HB4-3O5d1LoEBPgmh5h6tg)

Makefile:
Create Xen interface symlink.
time.c, hypervisor-if.h, kernel.c:
Fix shared_info to make CPU TSC arch-dependent.
author kaf24@scramble.cl.cam.ac.uk
date Wed Mar 10 18:19:16 2004 +0000 (2004-03-10)
parents 0f65f19b396c
children 349fe7cfd516 687886732fd0
files extras/mini-os/kernel.c extras/mini-os/time.c xen/arch/i386/time.c xen/include/hypervisor-ifs/arch-i386/hypervisor-if.h xen/include/hypervisor-ifs/arch-x86_64/hypervisor-if.h xen/include/hypervisor-ifs/hypervisor-if.h xenolinux-2.4.25-sparse/arch/xeno/Makefile xenolinux-2.4.25-sparse/arch/xeno/kernel/time.c
line diff
     1.1 --- a/extras/mini-os/kernel.c	Wed Mar 10 17:13:25 2004 +0000
     1.2 +++ b/extras/mini-os/kernel.c	Wed Mar 10 18:19:16 2004 +0000
     1.3 @@ -109,8 +109,8 @@ void start_kernel(start_info_t *si)
     1.4          printk(" %lx", si->net_rings[i]);
     1.5      }; printk("\n");
     1.6      printk("  blk_ring:   0x%lx\n", si->blk_ring);
     1.7 +    printk("  dom_id:     %ld\n",  si->dom_id);
     1.8  #endif
     1.9 -    printk("  dom_id:     %ld\n",  si->dom_id);
    1.10      printk("  flags:      0x%lx\n", si->flags);
    1.11      printk("  cmd_line:   %s\n",  si->cmd_line ? (const char *)si->cmd_line : "NULL");
    1.12  
     2.1 --- a/extras/mini-os/time.c	Wed Mar 10 17:13:25 2004 +0000
     2.2 +++ b/extras/mini-os/time.c	Wed Mar 10 18:19:16 2004 +0000
     2.3 @@ -70,7 +70,7 @@ static void get_time_values_from_xen(voi
     2.4          rmb();
     2.5          shadow_tv.tv_sec    = HYPERVISOR_shared_info->wc_sec;
     2.6          shadow_tv.tv_usec   = HYPERVISOR_shared_info->wc_usec;
     2.7 -        shadow_tsc_stamp    = HYPERVISOR_shared_info->tsc_timestamp;
     2.8 +        shadow_tsc_stamp    = HYPERVISOR_shared_info->tsc_timestamp.tsc_bits;
     2.9          shadow_system_time  = HYPERVISOR_shared_info->system_time;
    2.10          rmb();
    2.11      }
    2.12 @@ -167,7 +167,7 @@ void init_time(void)
    2.13      __cpu_khz = HYPERVISOR_shared_info->cpu_freq;
    2.14      cpu_khz = (u32) (__cpu_khz/1000);
    2.15  
    2.16 -    rdtsc_bitshift = HYPERVISOR_shared_info->rdtsc_bitshift;
    2.17 +    rdtsc_bitshift = HYPERVISOR_shared_info->tsc_timestamp.tsc_bitshift;
    2.18      cpu_freq       = HYPERVISOR_shared_info->cpu_freq;
    2.19  
    2.20      scale = 1000000LL << (32 + rdtsc_bitshift);
     3.1 --- a/xen/arch/i386/time.c	Wed Mar 10 17:13:25 2004 +0000
     3.2 +++ b/xen/arch/i386/time.c	Wed Mar 10 18:19:16 2004 +0000
     3.3 @@ -280,12 +280,10 @@ void update_dom_time(shared_info_t *si)
     3.4      si->time_version1++;
     3.5      wmb();
     3.6  
     3.7 -    /* NB. These two values don't actually ever change. */
     3.8      si->cpu_freq       = cpu_freq;
     3.9 -    si->arch.rdtsc_bitshift = rdtsc_bitshift;
    3.10 -
    3.11 +    si->tsc_timestamp.tsc_bitshift = rdtsc_bitshift;
    3.12 +    si->tsc_timestamp.tsc_bits     = tsc_irq;
    3.13      si->system_time    = stime_irq;
    3.14 -    si->tsc_timestamp  = tsc_irq;
    3.15      si->wc_sec         = xtime.tv_sec;
    3.16      si->wc_usec        = xtime.tv_usec;
    3.17      si->wc_usec       += (jiffies - wall_jiffies) * (1000000 / HZ);
     4.1 --- a/xen/include/hypervisor-ifs/arch-i386/hypervisor-if.h	Wed Mar 10 17:13:25 2004 +0000
     4.2 +++ b/xen/include/hypervisor-ifs/arch-i386/hypervisor-if.h	Wed Mar 10 18:19:16 2004 +0000
     4.3 @@ -86,13 +86,10 @@ typedef struct
     4.4      unsigned long ss;
     4.5  } execution_context_t;
     4.6  
     4.7 -/*
     4.8 - * Shared info specific to the architecture in question
     4.9 - */
    4.10 -typedef struct arch_shared_info_st {
    4.11 -    unsigned int       rdtsc_bitshift;  /* tsc_timestamp uses N:N+31 of TSC. */
    4.12 -} arch_shared_info_t;
    4.13 -
    4.14 +typedef struct {
    4.15 +    unsigned long  tsc_bits;      /* 32 bits read from the CPU's TSC. */
    4.16 +    unsigned int   tsc_bitshift;  /* 'tsc_bits' uses N:N+31 of TSC.   */
    4.17 +} tsc_timestamp_t;
    4.18  
    4.19  /*
    4.20   * The following is all CPU context. Note that the i387_ctxt block is filled 
     5.1 --- a/xen/include/hypervisor-ifs/arch-x86_64/hypervisor-if.h	Wed Mar 10 17:13:25 2004 +0000
     5.2 +++ b/xen/include/hypervisor-ifs/arch-x86_64/hypervisor-if.h	Wed Mar 10 18:19:16 2004 +0000
     5.3 @@ -85,14 +85,10 @@ typedef struct
     5.4      unsigned long ss;
     5.5  } execution_context_t;
     5.6  
     5.7 -/*
     5.8 - * Xen/guestos shared data -- pointer provided in start_info.
     5.9 - * NB. We expect that this struct is smaller than a page.
    5.10 - */
    5.11 -typedef struct arch_shared_info_st {
    5.12 -    unsigned int       rdtsc_bitshift;  /* tsc_timestamp uses N:N+31 of TSC. */
    5.13 -} arch_shared_info_t;
    5.14 -
    5.15 +typedef struct {
    5.16 +    unsigned long  tsc_bits;      /* 32 bits read from the CPU's TSC. */
    5.17 +    unsigned int   tsc_bitshift;  /* 'tsc_bits' uses N:N+31 of TSC.   */
    5.18 +} tsc_timestamp_t;
    5.19  
    5.20  /*
    5.21   * The following is all CPU context. Note that the i387_ctxt block is filled 
     6.1 --- a/xen/include/hypervisor-ifs/hypervisor-if.h	Wed Mar 10 17:13:25 2004 +0000
     6.2 +++ b/xen/include/hypervisor-ifs/hypervisor-if.h	Wed Mar 10 18:19:16 2004 +0000
     6.3 @@ -209,7 +209,6 @@ typedef struct shared_info_st {
     6.4       * Time: The following abstractions are exposed: System Time, Clock Time,
     6.5       * Domain Virtual Time. Domains can access Cycle counter time directly.
     6.6       */
     6.7 -
     6.8      u64                cpu_freq;        /* CPU frequency (Hz).               */
     6.9  
    6.10      /*
    6.11 @@ -221,20 +220,17 @@ typedef struct shared_info_st {
    6.12       */
    6.13      unsigned long      time_version1;   /* A version number for info below.  */
    6.14      unsigned long      time_version2;   /* A version number for info below.  */
    6.15 -    unsigned long      tsc_timestamp;   /* TSC at last update of time vals.  */
    6.16 +    tsc_timestamp_t    tsc_timestamp;   /* TSC at last update of time vals.  */
    6.17      u64                system_time;     /* Time, in nanosecs, since boot.    */
    6.18      unsigned long      wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
    6.19      unsigned long      wc_usec;         /* Usecs 00:00:00 UTC, Jan 1, 1970.  */
    6.20 -    
    6.21 -    /* Domain Virtual Time */
    6.22 -    u64                domain_time;
    6.23 -	
    6.24 +    u64                domain_time;     /* Domain virtual time, in nanosecs. */
    6.25 +
    6.26      /*
    6.27       * Timeout values:
    6.28       * Allow a domain to specify a timeout value in system time and 
    6.29       * domain virtual time.
    6.30       */
    6.31 -
    6.32      u64                wall_timeout;
    6.33      u64                domain_timeout;
    6.34  
    6.35 @@ -247,7 +243,6 @@ typedef struct shared_info_st {
    6.36      net_idx_t net_idx[MAX_DOMAIN_VIFS];
    6.37  
    6.38      execution_context_t execution_context;
    6.39 -    arch_shared_info_t arch;
    6.40  
    6.41  } shared_info_t;
    6.42  
     7.1 --- a/xenolinux-2.4.25-sparse/arch/xeno/Makefile	Wed Mar 10 17:13:25 2004 +0000
     7.2 +++ b/xenolinux-2.4.25-sparse/arch/xeno/Makefile	Wed Mar 10 18:19:16 2004 +0000
     7.3 @@ -111,6 +111,9 @@ archclean:
     7.4  	@$(MAKEBOOT) clean
     7.5  
     7.6  archmrproper:
     7.7 +	rm -f include/asm-xeno/hypervisor-ifs/arch
     7.8  
     7.9  archdep:
    7.10 +	rm -f include/asm-xeno/hypervisor-ifs/arch
    7.11 +	( cd include/asm-xeno/hypervisor-ifs ; ln -sf arch-$(SUBARCH) arch)
    7.12  	@$(MAKEBOOT) dep
     8.1 --- a/xenolinux-2.4.25-sparse/arch/xeno/kernel/time.c	Wed Mar 10 17:13:25 2004 +0000
     8.2 +++ b/xenolinux-2.4.25-sparse/arch/xeno/kernel/time.c	Wed Mar 10 18:19:16 2004 +0000
     8.3 @@ -211,7 +211,7 @@ static void __get_time_values_from_xen(v
     8.4          rmb();
     8.5          shadow_tv.tv_sec    = HYPERVISOR_shared_info->wc_sec;
     8.6          shadow_tv.tv_usec   = HYPERVISOR_shared_info->wc_usec;
     8.7 -        shadow_tsc_stamp    = HYPERVISOR_shared_info->tsc_timestamp;
     8.8 +        shadow_tsc_stamp    = HYPERVISOR_shared_info->tsc_timestamp.tsc_bits;
     8.9          shadow_system_time  = HYPERVISOR_shared_info->system_time;
    8.10          rmb();
    8.11      }
    8.12 @@ -604,7 +604,7 @@ void __init time_init(void)
    8.13      xtime.tv_usec = HYPERVISOR_shared_info->wc_usec;
    8.14      processed_system_time = shadow_system_time;
    8.15  
    8.16 -    rdtsc_bitshift      = HYPERVISOR_shared_info->rdtsc_bitshift;
    8.17 +    rdtsc_bitshift      = HYPERVISOR_shared_info->tsc_timestamp.tsc_bitshift;
    8.18      cpu_freq            = HYPERVISOR_shared_info->cpu_freq;
    8.19  
    8.20      scale = 1000000LL << (32 + rdtsc_bitshift);