diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-03-29 18:26:12 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-03-29 18:26:12 +0100 |
commit | c38176aa2ff7b89cd756932bfe00bf5695d91d26 (patch) | |
tree | 0953e56d4f9ab89ad22bf8ffc01dd735105c0d5c | |
parent | 939aae55f5ce35e32f0e6c2c2eb888e69d65fbeb (diff) | |
download | xen-c38176aa2ff7b89cd756932bfe00bf5695d91d26.tar.gz xen-c38176aa2ff7b89cd756932bfe00bf5695d91d26.tar.bz2 xen-c38176aa2ff7b89cd756932bfe00bf5695d91d26.zip |
xen: Rename remaining vcpu_flags as pause_flags.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | xen/arch/ia64/vmx/vlsapic.c | 4 | ||||
-rw-r--r-- | xen/arch/ia64/vmx/vmx_support.c | 4 | ||||
-rw-r--r-- | xen/arch/ia64/xen/domain.c | 4 | ||||
-rw-r--r-- | xen/arch/ia64/xen/fw_emul.c | 4 | ||||
-rw-r--r-- | xen/arch/ia64/xen/hypercall.c | 8 | ||||
-rw-r--r-- | xen/arch/powerpc/domain.c | 2 | ||||
-rw-r--r-- | xen/arch/powerpc/domain_build.c | 2 | ||||
-rw-r--r-- | xen/arch/x86/domain.c | 4 | ||||
-rw-r--r-- | xen/arch/x86/domain_build.c | 2 | ||||
-rw-r--r-- | xen/arch/x86/domctl.c | 2 | ||||
-rw-r--r-- | xen/arch/x86/hvm/hvm.c | 14 | ||||
-rw-r--r-- | xen/arch/x86/hvm/save.c | 2 | ||||
-rw-r--r-- | xen/arch/x86/hvm/vpt.c | 2 | ||||
-rw-r--r-- | xen/arch/x86/x86_32/asm-offsets.c | 1 | ||||
-rw-r--r-- | xen/arch/x86/x86_64/asm-offsets.c | 1 | ||||
-rw-r--r-- | xen/common/domain.c | 12 | ||||
-rw-r--r-- | xen/common/domctl.c | 10 | ||||
-rw-r--r-- | xen/common/event_channel.c | 4 | ||||
-rw-r--r-- | xen/common/keyhandler.c | 2 | ||||
-rw-r--r-- | xen/common/sched_credit.c | 2 | ||||
-rw-r--r-- | xen/common/schedule.c | 24 | ||||
-rw-r--r-- | xen/include/asm-ia64/event.h | 2 | ||||
-rw-r--r-- | xen/include/asm-powerpc/event.h | 2 | ||||
-rw-r--r-- | xen/include/asm-x86/event.h | 2 | ||||
-rw-r--r-- | xen/include/xen/event.h | 6 | ||||
-rw-r--r-- | xen/include/xen/sched.h | 29 |
26 files changed, 74 insertions, 77 deletions
diff --git a/xen/arch/ia64/vmx/vlsapic.c b/xen/arch/ia64/vmx/vlsapic.c index e64a08f6a8..b262a809c4 100644 --- a/xen/arch/ia64/vmx/vlsapic.c +++ b/xen/arch/ia64/vmx/vlsapic.c @@ -693,7 +693,7 @@ static void vlsapic_write_ipi(VCPU *vcpu, uint64_t addr, uint64_t value) panic_domain(NULL, "Unknown IPI cpu\n"); if (!targ->is_initialised || - test_bit(_VCPUF_down, &targ->vcpu_flags)) { + test_bit(_VPF_down, &targ->pause_flags)) { struct pt_regs *targ_regs = vcpu_regs(targ); struct vcpu_guest_context c; @@ -709,7 +709,7 @@ static void vlsapic_write_ipi(VCPU *vcpu, uint64_t addr, uint64_t value) targ_regs->cr_iip = d->arch.sal_data->boot_rdv_ip; targ_regs->r1 = d->arch.sal_data->boot_rdv_r1; - if (test_and_clear_bit(_VCPUF_down,&targ->vcpu_flags)) { + if (test_and_clear_bit(_VPF_down,&targ->pause_flags)) { vcpu_wake(targ); printk(XENLOG_DEBUG "arch_boot_vcpu: vcpu %d awaken %016lx!\n", targ->vcpu_id, targ_regs->cr_iip); diff --git a/xen/arch/ia64/vmx/vmx_support.c b/xen/arch/ia64/vmx/vmx_support.c index 3056500572..e71dd991d4 100644 --- a/xen/arch/ia64/vmx/vmx_support.c +++ b/xen/arch/ia64/vmx/vmx_support.c @@ -82,12 +82,12 @@ void vmx_send_assist_req(struct vcpu *v) p->state != STATE_IOREQ_INPROCESS) break; - set_bit(_VCPUF_blocked_in_xen, ¤t->vcpu_flags); + set_bit(_VPF_blocked_in_xen, ¤t->pause_flags); mb(); /* set blocked status /then/ re-evaluate condition */ if (p->state != STATE_IOREQ_READY && p->state != STATE_IOREQ_INPROCESS) { - clear_bit(_VCPUF_blocked_in_xen, ¤t->vcpu_flags); + clear_bit(_VPF_blocked_in_xen, ¤t->pause_flags); break; } diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c index d7d3e67aa6..3a1d94b13a 100644 --- a/xen/arch/ia64/xen/domain.c +++ b/xen/arch/ia64/xen/domain.c @@ -680,7 +680,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c) v->is_initialised = 1; /* Auto-online VCPU0 when it is initialised. */ if (v->vcpu_id == 0) - clear_bit(_VCPUF_down, &v->vcpu_flags); + clear_bit(_VPF_down, &v->pause_flags); } return 0; @@ -1191,7 +1191,7 @@ int construct_dom0(struct domain *d, printk("Dom0: 0x%lx\n", (u64)dom0); v->is_initialised = 1; - clear_bit(_VCPUF_down, &v->vcpu_flags); + clear_bit(_VPF_down, &v->pause_flags); /* Build firmware. Note: Linux kernel reserve memory used by start_info, so there is diff --git a/xen/arch/ia64/xen/fw_emul.c b/xen/arch/ia64/xen/fw_emul.c index bacbfae510..0cca1a4e35 100644 --- a/xen/arch/ia64/xen/fw_emul.c +++ b/xen/arch/ia64/xen/fw_emul.c @@ -374,7 +374,7 @@ sal_emulator (long index, unsigned long in1, unsigned long in2, printk("*** CALLED SAL_UPDATE_PAL. IGNORED...\n"); break; case SAL_XEN_SAL_RETURN: - if (!test_and_set_bit(_VCPUF_down, ¤t->vcpu_flags)) + if (!test_and_set_bit(_VPF_down, ¤t->pause_flags)) vcpu_sleep_nosync(current); break; case SN_SAL_GET_MASTER_NASID: @@ -725,7 +725,7 @@ xen_pal_emulator(unsigned long index, u64 in1, u64 in2, u64 in3) console_start_sync(); (*efi.reset_system)(EFI_RESET_SHUTDOWN,0,0,NULL); } else { - set_bit(_VCPUF_down, ¤t->vcpu_flags); + set_bit(_VPF_down, ¤t->pause_flags); vcpu_sleep_nosync(current); status = PAL_STATUS_SUCCESS; } diff --git a/xen/arch/ia64/xen/hypercall.c b/xen/arch/ia64/xen/hypercall.c index d3630ded83..e43a9ed5e9 100644 --- a/xen/arch/ia64/xen/hypercall.c +++ b/xen/arch/ia64/xen/hypercall.c @@ -82,7 +82,7 @@ fw_hypercall_ipi (struct pt_regs *regs) if (vector == XEN_SAL_BOOT_RENDEZ_VEC && (!targ->is_initialised - || test_bit(_VCPUF_down, &targ->vcpu_flags))) { + || test_bit(_VPF_down, &targ->pause_flags))) { /* First start: initialize vpcu. */ if (!targ->is_initialised) { @@ -102,8 +102,8 @@ fw_hypercall_ipi (struct pt_regs *regs) vcpu_regs (targ)->r1 = d->arch.sal_data->boot_rdv_r1; vcpu_regs (targ)->b0 = FW_HYPERCALL_SAL_RETURN_PADDR; - if (test_and_clear_bit(_VCPUF_down, - &targ->vcpu_flags)) { + if (test_and_clear_bit(_VPF_down, + &targ->pause_flags)) { vcpu_wake(targ); printk(XENLOG_INFO "arch_boot_vcpu: vcpu %d awaken\n", targ->vcpu_id); @@ -207,7 +207,7 @@ ia64_hypercall(struct pt_regs *regs) regs->r10 = x.r10; regs->r11 = x.r11; break; case FW_HYPERCALL_SAL_RETURN: - if ( !test_and_set_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( !test_and_set_bit(_VPF_down, &v->pause_flags) ) vcpu_sleep_nosync(v); break; case FW_HYPERCALL_EFI_CALL: diff --git a/xen/arch/powerpc/domain.c b/xen/arch/powerpc/domain.c index e8e3c7805f..3ac88013ed 100644 --- a/xen/arch/powerpc/domain.c +++ b/xen/arch/powerpc/domain.c @@ -173,7 +173,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c) v->is_initialised = 1; /* Auto-online VCPU0 when it is initialised. */ if ( v->vcpu_id == 0 ) - clear_bit(_VCPUF_down, &v->vcpu_flags); + clear_bit(_VPF_down, &v->pause_flags); } cpu_init_vcpu(v); diff --git a/xen/arch/powerpc/domain_build.c b/xen/arch/powerpc/domain_build.c index e8ee2b01dd..92e3c20217 100644 --- a/xen/arch/powerpc/domain_build.c +++ b/xen/arch/powerpc/domain_build.c @@ -274,7 +274,7 @@ int construct_dom0(struct domain *d, ofd_dom0_fixup(d, *ofh_tree + rma, cmdline, shared_info_addr); v->is_initialised = 1; - clear_bit(_VCPUF_down, &v->vcpu_flags); + clear_bit(_VPF_down, &v->pause_flags); rc = 0; diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 8da2287a75..af43de2328 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -706,9 +706,9 @@ int arch_set_info_guest( out: if ( flags & VGCF_online ) - clear_bit(_VCPUF_down, &v->vcpu_flags); + clear_bit(_VPF_down, &v->pause_flags); else - set_bit(_VCPUF_down, &v->vcpu_flags); + set_bit(_VPF_down, &v->pause_flags); return 0; #undef c } diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 6cecf6b56f..31bdd20708 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -902,7 +902,7 @@ int construct_dom0(struct domain *d, update_domain_wallclock_time(d); v->is_initialised = 1; - clear_bit(_VCPUF_down, &v->vcpu_flags); + clear_bit(_VPF_down, &v->pause_flags); /* * Initial register values: diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 9cf3825cd1..deb8c584d0 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -450,7 +450,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c) c(flags &= ~(VGCF_i387_valid|VGCF_in_kernel)); if ( v->fpu_initialised ) c(flags |= VGCF_i387_valid); - if ( !test_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( !test_bit(_VPF_down, &v->pause_flags) ) c(flags |= VGCF_online); if ( is_hvm_vcpu(v) ) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index f521dafe50..d01935de82 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -238,7 +238,7 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) { /* We don't need to save state for a vcpu that is down; the restore * code will leave it down if there is nothing saved. */ - if ( test_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( test_bit(_VPF_down, &v->pause_flags) ) continue; hvm_funcs.save_cpu_ctxt(v, &ctxt); @@ -269,7 +269,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) return -EINVAL; /* Auxiliary processors should be woken immediately. */ - if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( test_and_clear_bit(_VPF_down, &v->pause_flags) ) vcpu_wake(v); return 0; @@ -331,8 +331,8 @@ void hvm_vcpu_reset(struct vcpu *v) hvm_funcs.vcpu_initialise(v); - set_bit(_VCPUF_down, &v->vcpu_flags); - clear_bit(_VCPUF_blocked, &v->vcpu_flags); + set_bit(_VPF_down, &v->pause_flags); + clear_bit(_VPF_blocked, &v->pause_flags); v->fpu_initialised = 0; v->fpu_dirtied = 0; v->is_initialised = 0; @@ -350,13 +350,13 @@ static void hvm_vcpu_down(void) d->domain_id, v->vcpu_id); /* Doesn't halt us immediately, but we'll never return to guest context. */ - set_bit(_VCPUF_down, &v->vcpu_flags); + set_bit(_VPF_down, &v->pause_flags); vcpu_sleep_nosync(v); /* Any other VCPUs online? ... */ LOCK_BIGLOCK(d); for_each_vcpu ( d, v ) - if ( !test_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( !test_bit(_VPF_down, &v->pause_flags) ) online_count++; UNLOCK_BIGLOCK(d); @@ -734,7 +734,7 @@ int hvm_bringup_ap(int vcpuid, int trampoline_vector) goto out; } - if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( test_and_clear_bit(_VPF_down, &v->pause_flags) ) vcpu_wake(v); gdprintk(XENLOG_INFO, "AP %d bringup suceeded.\n", vcpuid); diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c index a19043c175..c66096c852 100644 --- a/xen/arch/x86/hvm/save.c +++ b/xen/arch/x86/hvm/save.c @@ -185,7 +185,7 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h) /* Down all the vcpus: we only re-enable the ones that had state saved. */ for_each_vcpu(d, v) - if ( test_and_set_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( test_and_set_bit(_VPF_down, &v->pause_flags) ) vcpu_sleep_nosync(v); while(1) { diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c index 626ad6ed44..9fc64d9b54 100644 --- a/xen/arch/x86/hvm/vpt.c +++ b/xen/arch/x86/hvm/vpt.c @@ -49,7 +49,7 @@ void pt_freeze_time(struct vcpu *v) struct list_head *list; struct periodic_time *pt; - if ( test_bit(_VCPUF_blocked, &v->vcpu_flags) ) + if ( test_bit(_VPF_blocked, &v->pause_flags) ) return; v->arch.hvm_vcpu.guest_time = hvm_get_guest_time(v); diff --git a/xen/arch/x86/x86_32/asm-offsets.c b/xen/arch/x86/x86_32/asm-offsets.c index 4405bdb749..d9f5c27369 100644 --- a/xen/arch/x86/x86_32/asm-offsets.c +++ b/xen/arch/x86/x86_32/asm-offsets.c @@ -66,7 +66,6 @@ void __dummy__(void) arch.guest_context.kernel_sp); OFFSET(VCPU_guest_context_flags, struct vcpu, arch.guest_context.flags); OFFSET(VCPU_arch_guest_fpu_ctxt, struct vcpu, arch.guest_context.fpu_ctxt); - OFFSET(VCPU_flags, struct vcpu, vcpu_flags); OFFSET(VCPU_nmi_addr, struct vcpu, nmi_addr); OFFSET(VCPU_nmi_pending, struct vcpu, nmi_pending); OFFSET(VCPU_nmi_masked, struct vcpu, nmi_masked); diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c index 2c152b1da7..e64ccd9d07 100644 --- a/xen/arch/x86/x86_64/asm-offsets.c +++ b/xen/arch/x86/x86_64/asm-offsets.c @@ -75,7 +75,6 @@ void __dummy__(void) OFFSET(VCPU_kernel_ss, struct vcpu, arch.guest_context.kernel_ss); OFFSET(VCPU_guest_context_flags, struct vcpu, arch.guest_context.flags); OFFSET(VCPU_arch_guest_fpu_ctxt, struct vcpu, arch.guest_context.fpu_ctxt); - OFFSET(VCPU_flags, struct vcpu, vcpu_flags); OFFSET(VCPU_nmi_addr, struct vcpu, nmi_addr); OFFSET(VCPU_nmi_pending, struct vcpu, nmi_pending); OFFSET(VCPU_nmi_masked, struct vcpu, nmi_masked); diff --git a/xen/common/domain.c b/xen/common/domain.c index 9f1648fed5..57d3c5a074 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -101,7 +101,7 @@ struct vcpu *alloc_vcpu( if ( !is_idle_domain(d) ) { - set_bit(_VCPUF_down, &v->vcpu_flags); + set_bit(_VPF_down, &v->pause_flags); v->vcpu_info = shared_info_addr(d, vcpu_info[vcpu_id]); } @@ -481,7 +481,7 @@ int vcpu_reset(struct vcpu *v) if ( rc != 0 ) goto out; - set_bit(_VCPUF_down, &v->vcpu_flags); + set_bit(_VPF_down, &v->pause_flags); v->fpu_initialised = 0; v->fpu_dirtied = 0; @@ -489,7 +489,7 @@ int vcpu_reset(struct vcpu *v) v->is_initialised = 0; v->nmi_pending = 0; v->nmi_masked = 0; - clear_bit(_VCPUF_blocked, &v->vcpu_flags); + clear_bit(_VPF_blocked, &v->pause_flags); out: UNLOCK_BIGLOCK(v->domain); @@ -537,18 +537,18 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg) if ( !v->is_initialised ) return -EINVAL; - if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( test_and_clear_bit(_VPF_down, &v->pause_flags) ) vcpu_wake(v); break; case VCPUOP_down: - if ( !test_and_set_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( !test_and_set_bit(_VPF_down, &v->pause_flags) ) vcpu_sleep_nosync(v); break; case VCPUOP_is_up: - rc = !test_bit(_VCPUF_down, &v->vcpu_flags); + rc = !test_bit(_VPF_down, &v->pause_flags); break; case VCPUOP_get_runstate_info: diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 5d7e5d7f90..01af47a008 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -101,9 +101,9 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info) vcpu_runstate_get(v, &runstate); cpu_time += runstate.time[RUNSTATE_running]; info->max_vcpu_id = v->vcpu_id; - if ( !test_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( !test_bit(_VPF_down, &v->pause_flags) ) { - if ( !(v->vcpu_flags & VCPUF_blocked) ) + if ( !(v->pause_flags & VPF_blocked) ) flags &= ~XEN_DOMINF_blocked; if ( v->is_running ) flags |= XEN_DOMINF_running; @@ -145,7 +145,7 @@ static unsigned int default_vcpu0_location(void) rcu_read_lock(&domlist_read_lock); for_each_domain ( d ) for_each_vcpu ( d, v ) - if ( !test_bit(_VCPUF_down, &v->vcpu_flags) ) + if ( !test_bit(_VPF_down, &v->pause_flags) ) cnt[v->processor]++; rcu_read_unlock(&domlist_read_lock); @@ -574,8 +574,8 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl) vcpu_runstate_get(v, &runstate); - op->u.getvcpuinfo.online = !test_bit(_VCPUF_down, &v->vcpu_flags); - op->u.getvcpuinfo.blocked = test_bit(_VCPUF_blocked, &v->vcpu_flags); + op->u.getvcpuinfo.online = !test_bit(_VPF_down, &v->pause_flags); + op->u.getvcpuinfo.blocked = test_bit(_VPF_blocked, &v->pause_flags); op->u.getvcpuinfo.running = v->is_running; op->u.getvcpuinfo.cpu_time = runstate.time[RUNSTATE_running]; op->u.getvcpuinfo.cpu = v->processor; diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 0db68de41a..c809c548b6 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -481,8 +481,8 @@ long evtchn_send(unsigned int lport) if ( rchn->consumer_is_xen ) { /* Xen consumers need notification only if they are blocked. */ - if ( test_and_clear_bit(_VCPUF_blocked_in_xen, - &rvcpu->vcpu_flags) ) + if ( test_and_clear_bit(_VPF_blocked_in_xen, + &rvcpu->pause_flags) ) vcpu_wake(rvcpu); } else diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 838c1222a4..07658e0de0 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -189,7 +189,7 @@ static void dump_domains(unsigned char key) "upcall_pend = %02x, upcall_mask = %02x ", v->vcpu_id, v->processor, v->is_running ? 'T':'F', - v->vcpu_flags, + v->pause_flags, vcpu_info(v, evtchn_upcall_pending), vcpu_info(v, evtchn_upcall_mask)); cpuset_print(tmpstr, sizeof(tmpstr), v->vcpu_dirty_cpumask); diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 6bc79cf0a4..152da1248e 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -565,7 +565,7 @@ csched_vcpu_acct(unsigned int cpu) { CSCHED_VCPU_STAT_CRANK(svc, migrate_r); CSCHED_STAT_CRANK(migrate_running); - set_bit(_VCPUF_migrating, ¤t->vcpu_flags); + set_bit(_VPF_migrating, ¤t->pause_flags); cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ); } } diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 93c15d151a..12b3dfd06c 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -190,7 +190,7 @@ void vcpu_wake(struct vcpu *v) vcpu_runstate_change(v, RUNSTATE_runnable, NOW()); SCHED_OP(wake, v); } - else if ( !test_bit(_VCPUF_blocked, &v->vcpu_flags) ) + else if ( !test_bit(_VPF_blocked, &v->pause_flags) ) { if ( v->runstate.state == RUNSTATE_blocked ) vcpu_runstate_change(v, RUNSTATE_offline, NOW()); @@ -214,7 +214,7 @@ static void vcpu_migrate(struct vcpu *v) * regions are strictly serialised. */ if ( v->is_running || - !test_and_clear_bit(_VCPUF_migrating, &v->vcpu_flags) ) + !test_and_clear_bit(_VPF_migrating, &v->pause_flags) ) { vcpu_schedule_unlock_irqrestore(v, flags); return; @@ -240,10 +240,10 @@ void vcpu_force_reschedule(struct vcpu *v) { vcpu_schedule_lock_irq(v); if ( v->is_running ) - set_bit(_VCPUF_migrating, &v->vcpu_flags); + set_bit(_VPF_migrating, &v->pause_flags); vcpu_schedule_unlock_irq(v); - if ( test_bit(_VCPUF_migrating, &v->vcpu_flags) ) + if ( test_bit(_VPF_migrating, &v->pause_flags) ) { vcpu_sleep_nosync(v); vcpu_migrate(v); @@ -265,11 +265,11 @@ int vcpu_set_affinity(struct vcpu *v, cpumask_t *affinity) v->cpu_affinity = *affinity; if ( !cpu_isset(v->processor, v->cpu_affinity) ) - set_bit(_VCPUF_migrating, &v->vcpu_flags); + set_bit(_VPF_migrating, &v->pause_flags); vcpu_schedule_unlock_irq(v); - if ( test_bit(_VCPUF_migrating, &v->vcpu_flags) ) + if ( test_bit(_VPF_migrating, &v->pause_flags) ) { vcpu_sleep_nosync(v); vcpu_migrate(v); @@ -284,12 +284,12 @@ static long do_block(void) struct vcpu *v = current; local_event_delivery_enable(); - set_bit(_VCPUF_blocked, &v->vcpu_flags); + set_bit(_VPF_blocked, &v->pause_flags); /* Check for events /after/ blocking: avoids wakeup waiting race. */ if ( local_events_need_delivery() ) { - clear_bit(_VCPUF_blocked, &v->vcpu_flags); + clear_bit(_VPF_blocked, &v->pause_flags); } else { @@ -315,7 +315,7 @@ static long do_poll(struct sched_poll *sched_poll) if ( !guest_handle_okay(sched_poll->ports, sched_poll->nr_ports) ) return -EFAULT; - set_bit(_VCPUF_blocked, &v->vcpu_flags); + set_bit(_VPF_blocked, &v->pause_flags); v->is_polling = 1; d->is_polling = 1; @@ -347,7 +347,7 @@ static long do_poll(struct sched_poll *sched_poll) out: v->is_polling = 0; - clear_bit(_VCPUF_blocked, &v->vcpu_flags); + clear_bit(_VPF_blocked, &v->pause_flags); return rc; } @@ -648,7 +648,7 @@ static void schedule(void) ASSERT(prev->runstate.state == RUNSTATE_running); vcpu_runstate_change( prev, - (test_bit(_VCPUF_blocked, &prev->vcpu_flags) ? RUNSTATE_blocked : + (test_bit(_VPF_blocked, &prev->pause_flags) ? RUNSTATE_blocked : (vcpu_runnable(prev) ? RUNSTATE_runnable : RUNSTATE_offline)), now); @@ -685,7 +685,7 @@ void context_saved(struct vcpu *prev) /* Check for migration request /after/ clearing running flag. */ smp_mb(); - if ( unlikely(test_bit(_VCPUF_migrating, &prev->vcpu_flags)) ) + if ( unlikely(test_bit(_VPF_migrating, &prev->pause_flags)) ) vcpu_migrate(prev); } diff --git a/xen/include/asm-ia64/event.h b/xen/include/asm-ia64/event.h index 92cdddac79..c99babd97e 100644 --- a/xen/include/asm-ia64/event.h +++ b/xen/include/asm-ia64/event.h @@ -15,7 +15,7 @@ static inline void vcpu_kick(struct vcpu *v) { /* - * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of + * NB1. 'pause_flags' and 'processor' must be checked /after/ update of * pending flag. These values may fluctuate (after all, we hold no * locks) but the key insight is that each change will cause * evtchn_upcall_pending to be polled. diff --git a/xen/include/asm-powerpc/event.h b/xen/include/asm-powerpc/event.h index 9f10ee98ba..5c6d287b3c 100644 --- a/xen/include/asm-powerpc/event.h +++ b/xen/include/asm-powerpc/event.h @@ -68,7 +68,7 @@ static inline int arch_virq_is_global(int virq) static inline void vcpu_kick(struct vcpu *v) { /* - * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of + * NB1. 'pause_flags' and 'processor' must be checked /after/ update of * pending flag. These values may fluctuate (after all, we hold no * locks) but the key insight is that each change will cause * evtchn_upcall_pending to be polled. diff --git a/xen/include/asm-x86/event.h b/xen/include/asm-x86/event.h index 922ede6fc6..09440bcc4a 100644 --- a/xen/include/asm-x86/event.h +++ b/xen/include/asm-x86/event.h @@ -15,7 +15,7 @@ static inline void vcpu_kick(struct vcpu *v) { /* - * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of + * NB1. 'pause_flags' and 'processor' must be checked /after/ update of * pending flag. These values may fluctuate (after all, we hold no * locks) but the key insight is that each change will cause * evtchn_upcall_pending to be polled. diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h index 39bb8031ca..10353e01e9 100644 --- a/xen/include/xen/event.h +++ b/xen/include/xen/event.h @@ -59,11 +59,11 @@ void notify_via_xen_event_channel(int lport); do { \ if ( condition ) \ break; \ - set_bit(_VCPUF_blocked_in_xen, ¤t->vcpu_flags); \ + set_bit(_VPF_blocked_in_xen, ¤t->pause_flags); \ mb(); /* set blocked status /then/ re-evaluate condition */ \ if ( condition ) \ { \ - clear_bit(_VCPUF_blocked_in_xen, ¤t->vcpu_flags); \ + clear_bit(_VPF_blocked_in_xen, ¤t->pause_flags); \ break; \ } \ raise_softirq(SCHEDULE_SOFTIRQ); \ @@ -72,7 +72,7 @@ void notify_via_xen_event_channel(int lport); #define prepare_wait_on_xen_event_channel(port) \ do { \ - set_bit(_VCPUF_blocked_in_xen, ¤t->vcpu_flags); \ + set_bit(_VPF_blocked_in_xen, ¤t->pause_flags); \ raise_softirq(SCHEDULE_SOFTIRQ); \ mb(); /* set blocked status /then/ caller does his work */ \ } while ( 0 ) diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 1484c34f68..20c0a8f9c9 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -115,8 +115,7 @@ struct vcpu /* Avoid NMI reentry by allowing NMIs to be masked for short periods. */ bool_t nmi_masked; - unsigned long vcpu_flags; - + unsigned long pause_flags; atomic_t pause_count; u16 virq_to_evtchn[NR_VIRQS]; @@ -434,26 +433,26 @@ extern struct domain *domain_list; (_v) = (_v)->next_in_list ) /* - * Per-VCPU flags (vcpu_flags). + * Per-VCPU pause flags. */ /* Domain is blocked waiting for an event. */ -#define _VCPUF_blocked 0 -#define VCPUF_blocked (1UL<<_VCPUF_blocked) +#define _VPF_blocked 0 +#define VPF_blocked (1UL<<_VPF_blocked) /* VCPU is offline. */ -#define _VCPUF_down 1 -#define VCPUF_down (1UL<<_VCPUF_down) +#define _VPF_down 1 +#define VPF_down (1UL<<_VPF_down) /* VCPU is blocked awaiting an event to be consumed by Xen. */ -#define _VCPUF_blocked_in_xen 2 -#define VCPUF_blocked_in_xen (1UL<<_VCPUF_blocked_in_xen) +#define _VPF_blocked_in_xen 2 +#define VPF_blocked_in_xen (1UL<<_VPF_blocked_in_xen) /* VCPU affinity has changed: migrating to a new CPU. */ -#define _VCPUF_migrating 3 -#define VCPUF_migrating (1UL<<_VCPUF_migrating) +#define _VPF_migrating 3 +#define VPF_migrating (1UL<<_VPF_migrating) static inline int vcpu_runnable(struct vcpu *v) { - return (!v->vcpu_flags && - !atomic_read(&v->pause_count) && - !atomic_read(&v->domain->pause_count)); + return !(v->pause_flags | + atomic_read(&v->pause_count) | + atomic_read(&v->domain->pause_count)); } void vcpu_pause(struct vcpu *v); @@ -472,7 +471,7 @@ void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate); static inline void vcpu_unblock(struct vcpu *v) { - if ( test_and_clear_bit(_VCPUF_blocked, &v->vcpu_flags) ) + if ( test_and_clear_bit(_VPF_blocked, &v->pause_flags) ) vcpu_wake(v); } |