ia64/xen-unstable

changeset 8108:36ab34f1c31e

Bundle vcpu_time and vcpu_info structures together into a single
structure that is 64 bytes on x86. This ensures that indexing into
the array is fast (power-of-two size) and that accesses are cache
friendly (cache line size is usually 32 or 64 bytes).

Rename vcpu_data to vcpu_info, vcpu_time to vcpu_info.time.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Nov 28 19:48:54 2005 +0100 (2005-11-28)
parents 85eef527ba74
children 444b968a3e09
files linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/xen_entry.S linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h linux-2.6-xen-sparse/include/asm-xen/evtchn.h tools/libxc/xc_linux_build.c tools/libxc/xc_linux_restore.c tools/libxc/xc_vmx_build.c xen/arch/ia64/vmx/vmx_hypercall.c xen/arch/ia64/xen/domain.c xen/arch/x86/domain.c xen/arch/x86/domain_build.c xen/arch/x86/setup.c xen/arch/x86/time.c xen/common/schedule.c xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/public/trace.h xen/include/public/xen.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c	Mon Nov 28 18:22:02 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c	Mon Nov 28 19:48:54 2005 +0100
     1.3 @@ -155,7 +155,7 @@ irqreturn_t evtchn_interrupt(int irq, vo
     1.4      unsigned int   l1i, l2i, port;
     1.5      irqreturn_t (*handler)(int, void *, struct pt_regs *);
     1.6      shared_info_t *s = HYPERVISOR_shared_info;
     1.7 -    vcpu_info_t   *vcpu_info = &s->vcpu_data[smp_processor_id()];
     1.8 +    vcpu_info_t   *vcpu_info = &s->vcpu_info[smp_processor_id()];
     1.9  
    1.10      vcpu_info->evtchn_upcall_mask = 1;
    1.11      vcpu_info->evtchn_upcall_pending = 0;
    1.12 @@ -203,7 +203,7 @@ int evtchn_irq = 0xe9;
    1.13  void __init evtchn_init(void)
    1.14  {
    1.15      shared_info_t *s = HYPERVISOR_shared_info;
    1.16 -    vcpu_info_t   *vcpu_info = &s->vcpu_data[smp_processor_id()];
    1.17 +    vcpu_info_t   *vcpu_info = &s->vcpu_info[smp_processor_id()];
    1.18  
    1.19  #if 0
    1.20      int ret;
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S	Mon Nov 28 18:22:02 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S	Mon Nov 28 19:48:54 2005 +0100
     2.3 @@ -81,7 +81,7 @@ VM_MASK		= 0x00020000
     2.4  #define evtchn_upcall_pending		/* 0 */
     2.5  #define evtchn_upcall_mask		1
     2.6  
     2.7 -#define sizeof_vcpu_shift		4
     2.8 +#define sizeof_vcpu_shift		6
     2.9  
    2.10  #ifdef CONFIG_SMP
    2.11  #define preempt_disable(reg)	incl TI_preempt_count(reg)
     3.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Mon Nov 28 18:22:02 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Mon Nov 28 19:48:54 2005 +0100
     3.3 @@ -204,7 +204,8 @@ static inline u64 scale_delta(u64 delta,
     3.4  void init_cpu_khz(void)
     3.5  {
     3.6  	u64 __cpu_khz = 1000000ULL << 32;
     3.7 -	struct vcpu_time_info *info = &HYPERVISOR_shared_info->vcpu_time[0];
     3.8 +	struct vcpu_time_info *info;
     3.9 +	info = &HYPERVISOR_shared_info->vcpu_info[0].time;
    3.10  	do_div(__cpu_khz, info->tsc_to_system_mul);
    3.11  	if ( info->tsc_shift < 0 )
    3.12  		cpu_khz = __cpu_khz << -info->tsc_shift;
    3.13 @@ -284,7 +285,7 @@ static void get_time_values_from_xen(voi
    3.14  	struct vcpu_time_info   *src;
    3.15  	struct shadow_time_info *dst;
    3.16  
    3.17 -	src = &s->vcpu_time[smp_processor_id()];
    3.18 +	src = &s->vcpu_info[smp_processor_id()].time;
    3.19  	dst = &per_cpu(shadow_time, smp_processor_id());
    3.20  
    3.21  	do {
    3.22 @@ -306,7 +307,7 @@ static inline int time_values_up_to_date
    3.23  	struct vcpu_time_info   *src;
    3.24  	struct shadow_time_info *dst;
    3.25  
    3.26 -	src = &HYPERVISOR_shared_info->vcpu_time[cpu]; 
    3.27 +	src = &HYPERVISOR_shared_info->vcpu_info[cpu].time;
    3.28  	dst = &per_cpu(shadow_time, cpu); 
    3.29  
    3.30  	return (dst->version == src->version);
     4.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c	Mon Nov 28 18:22:02 2005 +0000
     4.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c	Mon Nov 28 19:48:54 2005 +0100
     4.3 @@ -291,7 +291,7 @@ fastcall void do_page_fault(struct pt_re
     4.4  	int write;
     4.5  	siginfo_t info;
     4.6  
     4.7 -	address = HYPERVISOR_shared_info->vcpu_data[
     4.8 +	address = HYPERVISOR_shared_info->vcpu_info[
     4.9  		smp_processor_id()].arch.cr2;
    4.10  
    4.11  	/* Set the "privileged fault" bit to something sane. */
     5.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Mon Nov 28 18:22:02 2005 +0000
     5.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Mon Nov 28 19:48:54 2005 +0100
     5.3 @@ -154,7 +154,7 @@ asmlinkage void evtchn_do_upcall(struct 
     5.4  	unsigned int   l1i, l2i, port;
     5.5  	int            irq, cpu = smp_processor_id();
     5.6  	shared_info_t *s = HYPERVISOR_shared_info;
     5.7 -	vcpu_info_t   *vcpu_info = &s->vcpu_data[cpu];
     5.8 +	vcpu_info_t   *vcpu_info = &s->vcpu_info[cpu];
     5.9  
    5.10  	vcpu_info->evtchn_upcall_pending = 0;
    5.11  
     6.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/xen_entry.S	Mon Nov 28 18:22:02 2005 +0000
     6.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/xen_entry.S	Mon Nov 28 19:48:54 2005 +0100
     6.3 @@ -5,7 +5,7 @@
     6.4  #define evtchn_upcall_pending		0
     6.5  #define evtchn_upcall_mask		1
     6.6  
     6.7 -#define sizeof_vcpu_shift		5
     6.8 +#define sizeof_vcpu_shift		6
     6.9  
    6.10  #ifdef CONFIG_SMP
    6.11  //#define preempt_disable(reg)	incl threadinfo_preempt_count(reg)
     7.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c	Mon Nov 28 18:22:02 2005 +0000
     7.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c	Mon Nov 28 19:48:54 2005 +0100
     7.3 @@ -344,7 +344,7 @@ asmlinkage void do_page_fault(struct pt_
     7.4  #endif
     7.5  
     7.6  	/* get the address */
     7.7 -	address = HYPERVISOR_shared_info->vcpu_data[
     7.8 +	address = HYPERVISOR_shared_info->vcpu_info[
     7.9  		smp_processor_id()].arch.cr2;
    7.10  
    7.11  	if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
     8.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h	Mon Nov 28 18:22:02 2005 +0000
     8.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h	Mon Nov 28 19:48:54 2005 +0100
     8.3 @@ -501,7 +501,7 @@ unsigned long __set_mb_temp;            
     8.4  do {									\
     8.5  	vcpu_info_t *_vcpu;						\
     8.6  	preempt_disable();						\
     8.7 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
     8.8 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
     8.9  	_vcpu->evtchn_upcall_mask = 1;					\
    8.10  	preempt_enable_no_resched();					\
    8.11  	barrier();							\
    8.12 @@ -512,7 +512,7 @@ do {									\
    8.13  	vcpu_info_t *_vcpu;						\
    8.14  	barrier();							\
    8.15  	preempt_disable();						\
    8.16 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    8.17 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    8.18  	_vcpu->evtchn_upcall_mask = 0;					\
    8.19  	barrier(); /* unmask then check (avoid races) */		\
    8.20  	if ( unlikely(_vcpu->evtchn_upcall_pending) )			\
    8.21 @@ -524,7 +524,7 @@ do {									\
    8.22  do {									\
    8.23  	vcpu_info_t *_vcpu;						\
    8.24  	preempt_disable();						\
    8.25 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    8.26 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    8.27  	(x) = _vcpu->evtchn_upcall_mask;				\
    8.28  	preempt_enable();						\
    8.29  } while (0)
    8.30 @@ -534,7 +534,7 @@ do {									\
    8.31  	vcpu_info_t *_vcpu;						\
    8.32  	barrier();							\
    8.33  	preempt_disable();						\
    8.34 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    8.35 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    8.36  	if ((_vcpu->evtchn_upcall_mask = (x)) == 0) {			\
    8.37  		barrier(); /* unmask then check (avoid races) */	\
    8.38  		if ( unlikely(_vcpu->evtchn_upcall_pending) )		\
    8.39 @@ -550,7 +550,7 @@ do {									\
    8.40  do {									\
    8.41  	vcpu_info_t *_vcpu;						\
    8.42  	preempt_disable();						\
    8.43 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    8.44 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    8.45  	(x) = _vcpu->evtchn_upcall_mask;				\
    8.46  	_vcpu->evtchn_upcall_mask = 1;					\
    8.47  	preempt_enable_no_resched();					\
    8.48 @@ -568,7 +568,7 @@ do {									\
    8.49  ({	int ___x;							\
    8.50  	vcpu_info_t *_vcpu;						\
    8.51  	preempt_disable();						\
    8.52 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    8.53 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    8.54  	___x = (_vcpu->evtchn_upcall_mask != 0);			\
    8.55  	preempt_enable_no_resched();					\
    8.56  	___x; })
     9.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h	Mon Nov 28 18:22:02 2005 +0000
     9.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h	Mon Nov 28 19:48:54 2005 +0100
     9.3 @@ -325,7 +325,7 @@ static inline unsigned long __cmpxchg(vo
     9.4  do {									\
     9.5  	vcpu_info_t *_vcpu;						\
     9.6  	preempt_disable();						\
     9.7 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
     9.8 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
     9.9  	_vcpu->evtchn_upcall_mask = 1;					\
    9.10  	preempt_enable_no_resched();					\
    9.11  	barrier();							\
    9.12 @@ -336,7 +336,7 @@ do {									\
    9.13  	vcpu_info_t *_vcpu;						\
    9.14  	barrier();							\
    9.15  	preempt_disable();						\
    9.16 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    9.17 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    9.18  	_vcpu->evtchn_upcall_mask = 0;					\
    9.19  	barrier(); /* unmask then check (avoid races) */		\
    9.20  	if ( unlikely(_vcpu->evtchn_upcall_pending) )			\
    9.21 @@ -348,7 +348,7 @@ do {									\
    9.22  do {									\
    9.23  	vcpu_info_t *_vcpu;						\
    9.24  	preempt_disable();						\
    9.25 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    9.26 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    9.27  	(x) = _vcpu->evtchn_upcall_mask;				\
    9.28  	preempt_enable();						\
    9.29  } while (0)
    9.30 @@ -358,7 +358,7 @@ do {									\
    9.31  	vcpu_info_t *_vcpu;						\
    9.32  	barrier();							\
    9.33  	preempt_disable();						\
    9.34 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    9.35 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    9.36  	if ((_vcpu->evtchn_upcall_mask = (x)) == 0) {			\
    9.37  		barrier(); /* unmask then check (avoid races) */	\
    9.38  		if ( unlikely(_vcpu->evtchn_upcall_pending) )		\
    9.39 @@ -374,7 +374,7 @@ do {									\
    9.40  do {									\
    9.41  	vcpu_info_t *_vcpu;						\
    9.42  	preempt_disable();						\
    9.43 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    9.44 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    9.45  	(x) = _vcpu->evtchn_upcall_mask;				\
    9.46  	_vcpu->evtchn_upcall_mask = 1;					\
    9.47  	preempt_enable_no_resched();					\
    9.48 @@ -394,7 +394,7 @@ void cpu_idle_wait(void);
    9.49  ({	int ___x;							\
    9.50  	vcpu_info_t *_vcpu;						\
    9.51  	preempt_disable();						\
    9.52 -	_vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()];	\
    9.53 +	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
    9.54  	___x = (_vcpu->evtchn_upcall_mask != 0);			\
    9.55  	preempt_enable_no_resched();					\
    9.56  	___x; })
    10.1 --- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Mon Nov 28 18:22:02 2005 +0000
    10.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Mon Nov 28 19:48:54 2005 +0100
    10.3 @@ -102,7 +102,7 @@ static inline void mask_evtchn(int port)
    10.4  static inline void unmask_evtchn(int port)
    10.5  {
    10.6  	shared_info_t *s = HYPERVISOR_shared_info;
    10.7 -	vcpu_info_t *vcpu_info = &s->vcpu_data[smp_processor_id()];
    10.8 +	vcpu_info_t *vcpu_info = &s->vcpu_info[smp_processor_id()];
    10.9  
   10.10  	synch_clear_bit(port, &s->evtchn_mask[0]);
   10.11  
    11.1 --- a/tools/libxc/xc_linux_build.c	Mon Nov 28 18:22:02 2005 +0000
    11.2 +++ b/tools/libxc/xc_linux_build.c	Mon Nov 28 19:48:54 2005 +0100
    11.3 @@ -657,7 +657,7 @@ static int setup_guest(int xc_handle,
    11.4      memset(shared_info, 0, sizeof(shared_info_t));
    11.5      /* Mask all upcalls... */
    11.6      for ( i = 0; i < MAX_VIRT_CPUS; i++ )
    11.7 -        shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
    11.8 +        shared_info->vcpu_info[i].evtchn_upcall_mask = 1;
    11.9  
   11.10      munmap(shared_info, PAGE_SIZE);
   11.11  
    12.1 --- a/tools/libxc/xc_linux_restore.c	Mon Nov 28 18:22:02 2005 +0000
    12.2 +++ b/tools/libxc/xc_linux_restore.c	Mon Nov 28 19:48:54 2005 +0100
    12.3 @@ -671,7 +671,7 @@ int xc_linux_restore(int xc_handle, int 
    12.4      memset(&(shared_info->evtchn_pending[0]), 0,
    12.5             sizeof (shared_info->evtchn_pending));
    12.6      for ( i = 0; i < MAX_VIRT_CPUS; i++ )
    12.7 -        shared_info->vcpu_data[i].evtchn_pending_sel = 0;
    12.8 +        shared_info->vcpu_info[i].evtchn_pending_sel = 0;
    12.9  
   12.10      /* Copy saved contents of shared-info page. No checking needed. */
   12.11      page = xc_map_foreign_range(
    13.1 --- a/tools/libxc/xc_vmx_build.c	Mon Nov 28 18:22:02 2005 +0000
    13.2 +++ b/tools/libxc/xc_vmx_build.c	Mon Nov 28 19:48:54 2005 +0100
    13.3 @@ -524,7 +524,7 @@ static int setup_guest(int xc_handle,
    13.4      memset(shared_info, 0, sizeof(shared_info_t));
    13.5      /* Mask all upcalls... */
    13.6      for ( i = 0; i < MAX_VIRT_CPUS; i++ )
    13.7 -        shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
    13.8 +        shared_info->vcpu_info[i].evtchn_upcall_mask = 1;
    13.9  
   13.10      munmap(shared_info, PAGE_SIZE);
   13.11  
    14.1 --- a/xen/arch/ia64/vmx/vmx_hypercall.c	Mon Nov 28 18:22:02 2005 +0000
    14.2 +++ b/xen/arch/ia64/vmx/vmx_hypercall.c	Mon Nov 28 19:48:54 2005 +0100
    14.3 @@ -198,7 +198,7 @@ static int do_set_shared_page(VCPU *vcpu
    14.4      if (o_info) {
    14.5      	memcpy((void*)d->shared_info, (void*)o_info, PAGE_SIZE);
    14.6      	for_each_vcpu(d, v) {
    14.7 -	        v->vcpu_info = &d->shared_info->vcpu_data[v->vcpu_id];
    14.8 +	        v->vcpu_info = &d->shared_info->vcpu_info[v->vcpu_id];
    14.9      	}
   14.10      	/* If original page belongs to xen heap, then relinguish back
   14.11      	 * to xen heap. Or else, leave to domain itself to decide.
    15.1 --- a/xen/arch/ia64/xen/domain.c	Mon Nov 28 18:22:02 2005 +0000
    15.2 +++ b/xen/arch/ia64/xen/domain.c	Mon Nov 28 19:48:54 2005 +0100
    15.3 @@ -205,7 +205,7 @@ void arch_do_createdomain(struct vcpu *v
    15.4  	printf("arch_vcpu_info=%p\n", d->vcpu[0].arch.privregs);
    15.5  	memset(d->vcpu.arch.privregs, 0, PAGE_SIZE);
    15.6  #endif
    15.7 -	v->vcpu_info = &(d->shared_info->vcpu_data[0]);
    15.8 +	v->vcpu_info = &(d->shared_info->vcpu_info[0]);
    15.9  
   15.10  	d->max_pages = (128UL*1024*1024)/PAGE_SIZE; // 128MB default // FIXME
   15.11  
   15.12 @@ -867,7 +867,7 @@ int construct_dom0(struct domain *d,
   15.13  
   15.14  	/* Mask all upcalls... */
   15.15  	for ( i = 1; i < MAX_VIRT_CPUS; i++ )
   15.16 -	    d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
   15.17 +	    d->shared_info->vcpu_info[i].evtchn_upcall_mask = 1;
   15.18  
   15.19  #ifdef VALIDATE_VT 
   15.20  	/* Construct a frame-allocation list for the initial domain, since these
   15.21 @@ -997,7 +997,7 @@ int construct_domU(struct domain *d,
   15.22  
   15.23  	/* Mask all upcalls... */
   15.24  	for ( i = 0; i < MAX_VIRT_CPUS; i++ )
   15.25 -		d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
   15.26 +		d->shared_info->vcpu_info[i].evtchn_upcall_mask = 1;
   15.27  
   15.28  	/* Copy the OS image. */
   15.29  	printk("calling loaddomainelfimage(%p,%p)\n",d,image_start);
    16.1 --- a/xen/arch/x86/domain.c	Mon Nov 28 18:22:02 2005 +0000
    16.2 +++ b/xen/arch/x86/domain.c	Mon Nov 28 19:48:54 2005 +0100
    16.3 @@ -266,7 +266,7 @@ void arch_do_createdomain(struct vcpu *v
    16.4  
    16.5      d->shared_info = alloc_xenheap_page();
    16.6      memset(d->shared_info, 0, PAGE_SIZE);
    16.7 -    v->vcpu_info = &d->shared_info->vcpu_data[v->vcpu_id];
    16.8 +    v->vcpu_info = &d->shared_info->vcpu_info[v->vcpu_id];
    16.9      v->cpumap = CPUMAP_RUNANYWHERE;
   16.10      SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d);
   16.11  
    17.1 --- a/xen/arch/x86/domain_build.c	Mon Nov 28 18:22:02 2005 +0000
    17.2 +++ b/xen/arch/x86/domain_build.c	Mon Nov 28 19:48:54 2005 +0100
    17.3 @@ -597,7 +597,7 @@ int construct_dom0(struct domain *d,
    17.4  
    17.5      /* Mask all upcalls... */
    17.6      for ( i = 0; i < MAX_VIRT_CPUS; i++ )
    17.7 -        d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
    17.8 +        d->shared_info->vcpu_info[i].evtchn_upcall_mask = 1;
    17.9  
   17.10      for ( i = 1; i < num_online_cpus(); i++ )
   17.11          (void)alloc_vcpu(d, i, i);
    18.1 --- a/xen/arch/x86/setup.c	Mon Nov 28 18:22:02 2005 +0000
    18.2 +++ b/xen/arch/x86/setup.c	Mon Nov 28 19:48:54 2005 +0100
    18.3 @@ -432,7 +432,7 @@ void __init __start_xen(multiboot_info_t
    18.4  
    18.5      BUG_ON(sizeof(start_info_t) > PAGE_SIZE);
    18.6      BUG_ON(sizeof(shared_info_t) > PAGE_SIZE);
    18.7 -    BUG_ON(sizeof(vcpu_info_t) != (sizeof(unsigned long) * 4));
    18.8 +    BUG_ON(sizeof(vcpu_info_t) != 64);
    18.9  
   18.10      init_frametable();
   18.11  
    19.1 --- a/xen/arch/x86/time.c	Mon Nov 28 18:22:02 2005 +0000
    19.2 +++ b/xen/arch/x86/time.c	Mon Nov 28 19:48:54 2005 +0100
    19.3 @@ -683,8 +683,11 @@ static inline void version_update_end(u3
    19.4  
    19.5  static inline void __update_dom_time(struct vcpu *v)
    19.6  {
    19.7 -    struct cpu_time       *t = &cpu_time[smp_processor_id()];
    19.8 -    struct vcpu_time_info *u = &v->domain->shared_info->vcpu_time[v->vcpu_id];
    19.9 +    struct cpu_time       *t;
   19.10 +    struct vcpu_time_info *u;
   19.11 +
   19.12 +    t = &cpu_time[smp_processor_id()];
   19.13 +    u = &v->domain->shared_info->vcpu_info[v->vcpu_id].time;
   19.14  
   19.15      version_update_begin(&u->version);
   19.16  
   19.17 @@ -698,7 +701,7 @@ static inline void __update_dom_time(str
   19.18  
   19.19  void update_dom_time(struct vcpu *v)
   19.20  {
   19.21 -    if ( v->domain->shared_info->vcpu_time[v->vcpu_id].tsc_timestamp != 
   19.22 +    if ( v->domain->shared_info->vcpu_info[v->vcpu_id].time.tsc_timestamp != 
   19.23           cpu_time[smp_processor_id()].local_tsc_stamp )
   19.24          __update_dom_time(v);
   19.25  }
    20.1 --- a/xen/common/schedule.c	Mon Nov 28 18:22:02 2005 +0000
    20.2 +++ b/xen/common/schedule.c	Mon Nov 28 19:48:54 2005 +0100
    20.3 @@ -115,7 +115,7 @@ struct vcpu *alloc_vcpu(
    20.4  
    20.5      if ( vcpu_id != 0 )
    20.6      {
    20.7 -        v->vcpu_info = &d->shared_info->vcpu_data[vcpu_id];
    20.8 +        v->vcpu_info = &d->shared_info->vcpu_info[vcpu_id];
    20.9          d->vcpu[v->vcpu_id-1]->next_in_list = v;
   20.10          set_bit(_VCPUF_down, &v->vcpu_flags);
   20.11      }
    21.1 --- a/xen/include/public/arch-x86_32.h	Mon Nov 28 18:22:02 2005 +0000
    21.2 +++ b/xen/include/public/arch-x86_32.h	Mon Nov 28 19:48:54 2005 +0100
    21.3 @@ -134,7 +134,7 @@ typedef struct arch_shared_info {
    21.4  
    21.5  typedef struct {
    21.6      unsigned long cr2;
    21.7 -    unsigned long pad; /* sizeof(vcpu_info_t) == 16 */
    21.8 +    unsigned long pad[5]; /* sizeof(vcpu_info_t) == 64 */
    21.9  } arch_vcpu_info_t;
   21.10  
   21.11  #endif
    22.1 --- a/xen/include/public/arch-x86_64.h	Mon Nov 28 18:22:02 2005 +0000
    22.2 +++ b/xen/include/public/arch-x86_64.h	Mon Nov 28 19:48:54 2005 +0100
    22.3 @@ -203,7 +203,7 @@ typedef struct arch_shared_info {
    22.4  
    22.5  typedef struct {
    22.6      unsigned long cr2;
    22.7 -    unsigned long pad; /* sizeof(vcpu_info_t) == 32 */
    22.8 +    unsigned long pad; /* sizeof(vcpu_info_t) == 64 */
    22.9  } arch_vcpu_info_t;
   22.10  
   22.11  #endif /* !__ASSEMBLY__ */
    23.1 --- a/xen/include/public/trace.h	Mon Nov 28 18:22:02 2005 +0000
    23.2 +++ b/xen/include/public/trace.h	Mon Nov 28 19:48:54 2005 +0100
    23.3 @@ -72,8 +72,8 @@ struct t_rec {
    23.4   * field, indexes into an array of struct t_rec's.
    23.5   */
    23.6  struct t_buf {
    23.7 -    unsigned int  cons;      /* Next item to be consumed by control tools. */
    23.8 -    unsigned int  prod;      /* Next item to be produced by Xen.           */
    23.9 +    uint32_t cons;      /* Next item to be consumed by control tools. */
   23.10 +    uint32_t prod;      /* Next item to be produced by Xen.           */
   23.11      /* 'nr_recs' records follow immediately after the meta-data header.    */
   23.12  };
   23.13  
    24.1 --- a/xen/include/public/xen.h	Mon Nov 28 18:22:02 2005 +0000
    24.2 +++ b/xen/include/public/xen.h	Mon Nov 28 19:48:54 2005 +0100
    24.3 @@ -266,10 +266,31 @@ typedef struct
    24.4   */
    24.5  #define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
    24.6  
    24.7 -/*
    24.8 - * Per-VCPU information goes here. This will be cleaned up more when Xen 
    24.9 - * actually supports multi-VCPU guests.
   24.10 - */
   24.11 +typedef struct vcpu_time_info {
   24.12 +    /*
   24.13 +     * Updates to the following values are preceded and followed by an
   24.14 +     * increment of 'version'. The guest can therefore detect updates by
   24.15 +     * looking for changes to 'version'. If the least-significant bit of
   24.16 +     * the version number is set then an update is in progress and the guest
   24.17 +     * must wait to read a consistent set of values.
   24.18 +     * The correct way to interact with the version number is similar to
   24.19 +     * Linux's seqlock: see the implementations of read_seqbegin/read_seqretry.
   24.20 +     */
   24.21 +    uint32_t version;
   24.22 +    uint32_t pad0;
   24.23 +    uint64_t tsc_timestamp;   /* TSC at last update of time vals.  */
   24.24 +    uint64_t system_time;     /* Time, in nanosecs, since boot.    */
   24.25 +    /*
   24.26 +     * Current system time:
   24.27 +     *   system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul
   24.28 +     * CPU frequency (Hz):
   24.29 +     *   ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift
   24.30 +     */
   24.31 +    uint32_t tsc_to_system_mul;
   24.32 +    int8_t   tsc_shift;
   24.33 +    int8_t   pad1[3];
   24.34 +} vcpu_time_info_t; /* 32 bytes */
   24.35 +
   24.36  typedef struct vcpu_info {
   24.37      /*
   24.38       * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
   24.39 @@ -300,39 +321,15 @@ typedef struct vcpu_info {
   24.40      uint8_t evtchn_upcall_mask;
   24.41      unsigned long evtchn_pending_sel;
   24.42      arch_vcpu_info_t arch;
   24.43 -} vcpu_info_t;
   24.44 -
   24.45 -typedef struct vcpu_time_info {
   24.46 -    /*
   24.47 -     * Updates to the following values are preceded and followed by an
   24.48 -     * increment of 'version'. The guest can therefore detect updates by
   24.49 -     * looking for changes to 'version'. If the least-significant bit of
   24.50 -     * the version number is set then an update is in progress and the guest
   24.51 -     * must wait to read a consistent set of values.
   24.52 -     * The correct way to interact with the version number is similar to
   24.53 -     * Linux's seqlock: see the implementations of read_seqbegin/read_seqretry.
   24.54 -     */
   24.55 -    uint32_t version;
   24.56 -    uint64_t tsc_timestamp;   /* TSC at last update of time vals.  */
   24.57 -    uint64_t system_time;     /* Time, in nanosecs, since boot.    */
   24.58 -    /*
   24.59 -     * Current system time:
   24.60 -     *   system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul
   24.61 -     * CPU frequency (Hz):
   24.62 -     *   ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift
   24.63 -     */
   24.64 -    uint32_t tsc_to_system_mul;
   24.65 -    int8_t  tsc_shift;
   24.66 -} vcpu_time_info_t;
   24.67 +    vcpu_time_info_t time;
   24.68 +} vcpu_info_t; /* 64 bytes (x86) */
   24.69  
   24.70  /*
   24.71   * Xen/kernel shared data -- pointer provided in start_info.
   24.72   * NB. We expect that this struct is smaller than a page.
   24.73   */
   24.74  typedef struct shared_info {
   24.75 -    vcpu_info_t vcpu_data[MAX_VIRT_CPUS];
   24.76 -
   24.77 -    vcpu_time_info_t vcpu_time[MAX_VIRT_CPUS];
   24.78 +    vcpu_info_t vcpu_info[MAX_VIRT_CPUS];
   24.79  
   24.80      /*
   24.81       * A domain can create "event channels" on which it can send and receive