[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Bundle vcpu_time and vcpu_info structures together into a single
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 36ab34f1c31e2843496a80ea8e815d799ba5cc89 # Parent 85eef527ba7432f0e6de9eac1902e3487f31b43b 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@xxxxxxxxxxxxx> diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c Mon Nov 28 18:48:54 2005 @@ -155,7 +155,7 @@ unsigned int l1i, l2i, port; irqreturn_t (*handler)(int, void *, struct pt_regs *); shared_info_t *s = HYPERVISOR_shared_info; - vcpu_info_t *vcpu_info = &s->vcpu_data[smp_processor_id()]; + vcpu_info_t *vcpu_info = &s->vcpu_info[smp_processor_id()]; vcpu_info->evtchn_upcall_mask = 1; vcpu_info->evtchn_upcall_pending = 0; @@ -203,7 +203,7 @@ void __init evtchn_init(void) { shared_info_t *s = HYPERVISOR_shared_info; - vcpu_info_t *vcpu_info = &s->vcpu_data[smp_processor_id()]; + vcpu_info_t *vcpu_info = &s->vcpu_info[smp_processor_id()]; #if 0 int ret; diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S Mon Nov 28 18:48:54 2005 @@ -81,7 +81,7 @@ #define evtchn_upcall_pending /* 0 */ #define evtchn_upcall_mask 1 -#define sizeof_vcpu_shift 4 +#define sizeof_vcpu_shift 6 #ifdef CONFIG_SMP #define preempt_disable(reg) incl TI_preempt_count(reg) diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c Mon Nov 28 18:48:54 2005 @@ -204,7 +204,8 @@ void init_cpu_khz(void) { u64 __cpu_khz = 1000000ULL << 32; - struct vcpu_time_info *info = &HYPERVISOR_shared_info->vcpu_time[0]; + struct vcpu_time_info *info; + info = &HYPERVISOR_shared_info->vcpu_info[0].time; do_div(__cpu_khz, info->tsc_to_system_mul); if ( info->tsc_shift < 0 ) cpu_khz = __cpu_khz << -info->tsc_shift; @@ -284,7 +285,7 @@ struct vcpu_time_info *src; struct shadow_time_info *dst; - src = &s->vcpu_time[smp_processor_id()]; + src = &s->vcpu_info[smp_processor_id()].time; dst = &per_cpu(shadow_time, smp_processor_id()); do { @@ -306,7 +307,7 @@ struct vcpu_time_info *src; struct shadow_time_info *dst; - src = &HYPERVISOR_shared_info->vcpu_time[cpu]; + src = &HYPERVISOR_shared_info->vcpu_info[cpu].time; dst = &per_cpu(shadow_time, cpu); return (dst->version == src->version); diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c Mon Nov 28 18:48:54 2005 @@ -291,7 +291,7 @@ int write; siginfo_t info; - address = HYPERVISOR_shared_info->vcpu_data[ + address = HYPERVISOR_shared_info->vcpu_info[ smp_processor_id()].arch.cr2; /* Set the "privileged fault" bit to something sane. */ diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c Mon Nov 28 18:48:54 2005 @@ -154,7 +154,7 @@ unsigned int l1i, l2i, port; int irq, cpu = smp_processor_id(); shared_info_t *s = HYPERVISOR_shared_info; - vcpu_info_t *vcpu_info = &s->vcpu_data[cpu]; + vcpu_info_t *vcpu_info = &s->vcpu_info[cpu]; vcpu_info->evtchn_upcall_pending = 0; diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/arch/xen/x86_64/kernel/xen_entry.S --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/xen_entry.S Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/xen_entry.S Mon Nov 28 18:48:54 2005 @@ -5,7 +5,7 @@ #define evtchn_upcall_pending 0 #define evtchn_upcall_mask 1 -#define sizeof_vcpu_shift 5 +#define sizeof_vcpu_shift 6 #ifdef CONFIG_SMP //#define preempt_disable(reg) incl threadinfo_preempt_count(reg) diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c --- a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c Mon Nov 28 18:48:54 2005 @@ -344,7 +344,7 @@ #endif /* get the address */ - address = HYPERVISOR_shared_info->vcpu_data[ + address = HYPERVISOR_shared_info->vcpu_info[ smp_processor_id()].arch.cr2; if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14, diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h Mon Nov 28 18:48:54 2005 @@ -501,7 +501,7 @@ do { \ vcpu_info_t *_vcpu; \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 1; \ preempt_enable_no_resched(); \ barrier(); \ @@ -512,7 +512,7 @@ vcpu_info_t *_vcpu; \ barrier(); \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 0; \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ @@ -524,7 +524,7 @@ do { \ vcpu_info_t *_vcpu; \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ (x) = _vcpu->evtchn_upcall_mask; \ preempt_enable(); \ } while (0) @@ -534,7 +534,7 @@ vcpu_info_t *_vcpu; \ barrier(); \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ if ((_vcpu->evtchn_upcall_mask = (x)) == 0) { \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ @@ -550,7 +550,7 @@ do { \ vcpu_info_t *_vcpu; \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ (x) = _vcpu->evtchn_upcall_mask; \ _vcpu->evtchn_upcall_mask = 1; \ preempt_enable_no_resched(); \ @@ -568,7 +568,7 @@ ({ int ___x; \ vcpu_info_t *_vcpu; \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ ___x = (_vcpu->evtchn_upcall_mask != 0); \ preempt_enable_no_resched(); \ ___x; }) diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h Mon Nov 28 18:48:54 2005 @@ -325,7 +325,7 @@ do { \ vcpu_info_t *_vcpu; \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 1; \ preempt_enable_no_resched(); \ barrier(); \ @@ -336,7 +336,7 @@ vcpu_info_t *_vcpu; \ barrier(); \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 0; \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ @@ -348,7 +348,7 @@ do { \ vcpu_info_t *_vcpu; \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ (x) = _vcpu->evtchn_upcall_mask; \ preempt_enable(); \ } while (0) @@ -358,7 +358,7 @@ vcpu_info_t *_vcpu; \ barrier(); \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ if ((_vcpu->evtchn_upcall_mask = (x)) == 0) { \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ @@ -374,7 +374,7 @@ do { \ vcpu_info_t *_vcpu; \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ (x) = _vcpu->evtchn_upcall_mask; \ _vcpu->evtchn_upcall_mask = 1; \ preempt_enable_no_resched(); \ @@ -394,7 +394,7 @@ ({ int ___x; \ vcpu_info_t *_vcpu; \ preempt_disable(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ ___x = (_vcpu->evtchn_upcall_mask != 0); \ preempt_enable_no_resched(); \ ___x; }) diff -r 85eef527ba74 -r 36ab34f1c31e linux-2.6-xen-sparse/include/asm-xen/evtchn.h --- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h Mon Nov 28 18:22:02 2005 +++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h Mon Nov 28 18:48:54 2005 @@ -102,7 +102,7 @@ static inline void unmask_evtchn(int port) { shared_info_t *s = HYPERVISOR_shared_info; - vcpu_info_t *vcpu_info = &s->vcpu_data[smp_processor_id()]; + vcpu_info_t *vcpu_info = &s->vcpu_info[smp_processor_id()]; synch_clear_bit(port, &s->evtchn_mask[0]); diff -r 85eef527ba74 -r 36ab34f1c31e tools/libxc/xc_linux_build.c --- a/tools/libxc/xc_linux_build.c Mon Nov 28 18:22:02 2005 +++ b/tools/libxc/xc_linux_build.c Mon Nov 28 18:48:54 2005 @@ -657,7 +657,7 @@ memset(shared_info, 0, sizeof(shared_info_t)); /* Mask all upcalls... */ for ( i = 0; i < MAX_VIRT_CPUS; i++ ) - shared_info->vcpu_data[i].evtchn_upcall_mask = 1; + shared_info->vcpu_info[i].evtchn_upcall_mask = 1; munmap(shared_info, PAGE_SIZE); diff -r 85eef527ba74 -r 36ab34f1c31e tools/libxc/xc_linux_restore.c --- a/tools/libxc/xc_linux_restore.c Mon Nov 28 18:22:02 2005 +++ b/tools/libxc/xc_linux_restore.c Mon Nov 28 18:48:54 2005 @@ -671,7 +671,7 @@ memset(&(shared_info->evtchn_pending[0]), 0, sizeof (shared_info->evtchn_pending)); for ( i = 0; i < MAX_VIRT_CPUS; i++ ) - shared_info->vcpu_data[i].evtchn_pending_sel = 0; + shared_info->vcpu_info[i].evtchn_pending_sel = 0; /* Copy saved contents of shared-info page. No checking needed. */ page = xc_map_foreign_range( diff -r 85eef527ba74 -r 36ab34f1c31e tools/libxc/xc_vmx_build.c --- a/tools/libxc/xc_vmx_build.c Mon Nov 28 18:22:02 2005 +++ b/tools/libxc/xc_vmx_build.c Mon Nov 28 18:48:54 2005 @@ -524,7 +524,7 @@ memset(shared_info, 0, sizeof(shared_info_t)); /* Mask all upcalls... */ for ( i = 0; i < MAX_VIRT_CPUS; i++ ) - shared_info->vcpu_data[i].evtchn_upcall_mask = 1; + shared_info->vcpu_info[i].evtchn_upcall_mask = 1; munmap(shared_info, PAGE_SIZE); diff -r 85eef527ba74 -r 36ab34f1c31e xen/arch/ia64/vmx/vmx_hypercall.c --- a/xen/arch/ia64/vmx/vmx_hypercall.c Mon Nov 28 18:22:02 2005 +++ b/xen/arch/ia64/vmx/vmx_hypercall.c Mon Nov 28 18:48:54 2005 @@ -198,7 +198,7 @@ if (o_info) { memcpy((void*)d->shared_info, (void*)o_info, PAGE_SIZE); for_each_vcpu(d, v) { - v->vcpu_info = &d->shared_info->vcpu_data[v->vcpu_id]; + v->vcpu_info = &d->shared_info->vcpu_info[v->vcpu_id]; } /* If original page belongs to xen heap, then relinguish back * to xen heap. Or else, leave to domain itself to decide. diff -r 85eef527ba74 -r 36ab34f1c31e xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Mon Nov 28 18:22:02 2005 +++ b/xen/arch/ia64/xen/domain.c Mon Nov 28 18:48:54 2005 @@ -205,7 +205,7 @@ printf("arch_vcpu_info=%p\n", d->vcpu[0].arch.privregs); memset(d->vcpu.arch.privregs, 0, PAGE_SIZE); #endif - v->vcpu_info = &(d->shared_info->vcpu_data[0]); + v->vcpu_info = &(d->shared_info->vcpu_info[0]); d->max_pages = (128UL*1024*1024)/PAGE_SIZE; // 128MB default // FIXME @@ -867,7 +867,7 @@ /* Mask all upcalls... */ for ( i = 1; i < MAX_VIRT_CPUS; i++ ) - d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1; + d->shared_info->vcpu_info[i].evtchn_upcall_mask = 1; #ifdef VALIDATE_VT /* Construct a frame-allocation list for the initial domain, since these @@ -997,7 +997,7 @@ /* Mask all upcalls... */ for ( i = 0; i < MAX_VIRT_CPUS; i++ ) - d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1; + d->shared_info->vcpu_info[i].evtchn_upcall_mask = 1; /* Copy the OS image. */ printk("calling loaddomainelfimage(%p,%p)\n",d,image_start); diff -r 85eef527ba74 -r 36ab34f1c31e xen/arch/x86/domain.c --- a/xen/arch/x86/domain.c Mon Nov 28 18:22:02 2005 +++ b/xen/arch/x86/domain.c Mon Nov 28 18:48:54 2005 @@ -266,7 +266,7 @@ d->shared_info = alloc_xenheap_page(); memset(d->shared_info, 0, PAGE_SIZE); - v->vcpu_info = &d->shared_info->vcpu_data[v->vcpu_id]; + v->vcpu_info = &d->shared_info->vcpu_info[v->vcpu_id]; v->cpumap = CPUMAP_RUNANYWHERE; SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d); diff -r 85eef527ba74 -r 36ab34f1c31e xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Mon Nov 28 18:22:02 2005 +++ b/xen/arch/x86/domain_build.c Mon Nov 28 18:48:54 2005 @@ -597,7 +597,7 @@ /* Mask all upcalls... */ for ( i = 0; i < MAX_VIRT_CPUS; i++ ) - d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1; + d->shared_info->vcpu_info[i].evtchn_upcall_mask = 1; for ( i = 1; i < num_online_cpus(); i++ ) (void)alloc_vcpu(d, i, i); diff -r 85eef527ba74 -r 36ab34f1c31e xen/arch/x86/setup.c --- a/xen/arch/x86/setup.c Mon Nov 28 18:22:02 2005 +++ b/xen/arch/x86/setup.c Mon Nov 28 18:48:54 2005 @@ -432,7 +432,7 @@ BUG_ON(sizeof(start_info_t) > PAGE_SIZE); BUG_ON(sizeof(shared_info_t) > PAGE_SIZE); - BUG_ON(sizeof(vcpu_info_t) != (sizeof(unsigned long) * 4)); + BUG_ON(sizeof(vcpu_info_t) != 64); init_frametable(); diff -r 85eef527ba74 -r 36ab34f1c31e xen/arch/x86/time.c --- a/xen/arch/x86/time.c Mon Nov 28 18:22:02 2005 +++ b/xen/arch/x86/time.c Mon Nov 28 18:48:54 2005 @@ -683,8 +683,11 @@ static inline void __update_dom_time(struct vcpu *v) { - struct cpu_time *t = &cpu_time[smp_processor_id()]; - struct vcpu_time_info *u = &v->domain->shared_info->vcpu_time[v->vcpu_id]; + struct cpu_time *t; + struct vcpu_time_info *u; + + t = &cpu_time[smp_processor_id()]; + u = &v->domain->shared_info->vcpu_info[v->vcpu_id].time; version_update_begin(&u->version); @@ -698,7 +701,7 @@ void update_dom_time(struct vcpu *v) { - if ( v->domain->shared_info->vcpu_time[v->vcpu_id].tsc_timestamp != + if ( v->domain->shared_info->vcpu_info[v->vcpu_id].time.tsc_timestamp != cpu_time[smp_processor_id()].local_tsc_stamp ) __update_dom_time(v); } diff -r 85eef527ba74 -r 36ab34f1c31e xen/common/schedule.c --- a/xen/common/schedule.c Mon Nov 28 18:22:02 2005 +++ b/xen/common/schedule.c Mon Nov 28 18:48:54 2005 @@ -115,7 +115,7 @@ if ( vcpu_id != 0 ) { - v->vcpu_info = &d->shared_info->vcpu_data[vcpu_id]; + v->vcpu_info = &d->shared_info->vcpu_info[vcpu_id]; d->vcpu[v->vcpu_id-1]->next_in_list = v; set_bit(_VCPUF_down, &v->vcpu_flags); } diff -r 85eef527ba74 -r 36ab34f1c31e xen/include/public/arch-x86_32.h --- a/xen/include/public/arch-x86_32.h Mon Nov 28 18:22:02 2005 +++ b/xen/include/public/arch-x86_32.h Mon Nov 28 18:48:54 2005 @@ -134,7 +134,7 @@ typedef struct { unsigned long cr2; - unsigned long pad; /* sizeof(vcpu_info_t) == 16 */ + unsigned long pad[5]; /* sizeof(vcpu_info_t) == 64 */ } arch_vcpu_info_t; #endif diff -r 85eef527ba74 -r 36ab34f1c31e xen/include/public/arch-x86_64.h --- a/xen/include/public/arch-x86_64.h Mon Nov 28 18:22:02 2005 +++ b/xen/include/public/arch-x86_64.h Mon Nov 28 18:48:54 2005 @@ -203,7 +203,7 @@ typedef struct { unsigned long cr2; - unsigned long pad; /* sizeof(vcpu_info_t) == 32 */ + unsigned long pad; /* sizeof(vcpu_info_t) == 64 */ } arch_vcpu_info_t; #endif /* !__ASSEMBLY__ */ diff -r 85eef527ba74 -r 36ab34f1c31e xen/include/public/trace.h --- a/xen/include/public/trace.h Mon Nov 28 18:22:02 2005 +++ b/xen/include/public/trace.h Mon Nov 28 18:48:54 2005 @@ -72,8 +72,8 @@ * field, indexes into an array of struct t_rec's. */ struct t_buf { - unsigned int cons; /* Next item to be consumed by control tools. */ - unsigned int prod; /* Next item to be produced by Xen. */ + uint32_t cons; /* Next item to be consumed by control tools. */ + uint32_t prod; /* Next item to be produced by Xen. */ /* 'nr_recs' records follow immediately after the meta-data header. */ }; diff -r 85eef527ba74 -r 36ab34f1c31e xen/include/public/xen.h --- a/xen/include/public/xen.h Mon Nov 28 18:22:02 2005 +++ b/xen/include/public/xen.h Mon Nov 28 18:48:54 2005 @@ -266,10 +266,31 @@ */ #define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64) -/* - * Per-VCPU information goes here. This will be cleaned up more when Xen - * actually supports multi-VCPU guests. - */ +typedef struct vcpu_time_info { + /* + * Updates to the following values are preceded and followed by an + * increment of 'version'. The guest can therefore detect updates by + * looking for changes to 'version'. If the least-significant bit of + * the version number is set then an update is in progress and the guest + * must wait to read a consistent set of values. + * The correct way to interact with the version number is similar to + * Linux's seqlock: see the implementations of read_seqbegin/read_seqretry. + */ + uint32_t version; + uint32_t pad0; + uint64_t tsc_timestamp; /* TSC at last update of time vals. */ + uint64_t system_time; /* Time, in nanosecs, since boot. */ + /* + * Current system time: + * system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul + * CPU frequency (Hz): + * ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift + */ + uint32_t tsc_to_system_mul; + int8_t tsc_shift; + int8_t pad1[3]; +} vcpu_time_info_t; /* 32 bytes */ + typedef struct vcpu_info { /* * 'evtchn_upcall_pending' is written non-zero by Xen to indicate @@ -300,39 +321,15 @@ uint8_t evtchn_upcall_mask; unsigned long evtchn_pending_sel; arch_vcpu_info_t arch; -} vcpu_info_t; - -typedef struct vcpu_time_info { - /* - * Updates to the following values are preceded and followed by an - * increment of 'version'. The guest can therefore detect updates by - * looking for changes to 'version'. If the least-significant bit of - * the version number is set then an update is in progress and the guest - * must wait to read a consistent set of values. - * The correct way to interact with the version number is similar to - * Linux's seqlock: see the implementations of read_seqbegin/read_seqretry. - */ - uint32_t version; - uint64_t tsc_timestamp; /* TSC at last update of time vals. */ - uint64_t system_time; /* Time, in nanosecs, since boot. */ - /* - * Current system time: - * system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul - * CPU frequency (Hz): - * ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift - */ - uint32_t tsc_to_system_mul; - int8_t tsc_shift; -} vcpu_time_info_t; + vcpu_time_info_t time; +} vcpu_info_t; /* 64 bytes (x86) */ /* * Xen/kernel shared data -- pointer provided in start_info. * NB. We expect that this struct is smaller than a page. */ typedef struct shared_info { - vcpu_info_t vcpu_data[MAX_VIRT_CPUS]; - - vcpu_time_info_t vcpu_time[MAX_VIRT_CPUS]; + vcpu_info_t vcpu_info[MAX_VIRT_CPUS]; /* * A domain can create "event channels" on which it can send and receive _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |