x86, hvm: APIC INIT handling can make use of existing hvm_vcpu_down()

helper function.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
Keir Fraser committed 2008-04-15 16:38:25 +01:00
1 parent 98892a5e57
commit 3719d0804f
3 files changed
+5 -8

No files matched your search

+3 -6
View File
@@ -688,14 +688,11 @@ void hvm_vcpu_destroy(struct vcpu *v)
/*free_xen_event_channel(v, v->arch.hvm_vcpu.xen_port);*/
}
static void hvm_vcpu_down(void)
void hvm_vcpu_down(struct vcpu *v)
{
struct vcpu *v = current;
struct domain *d = v->domain;
int online_count = 0;
gdprintk(XENLOG_INFO, "VCPU%d: going offline.\n", v->vcpu_id);
/* Doesn't halt us immediately, but we'll never return to guest context. */
set_bit(_VPF_down, &v->pause_flags);
vcpu_sleep_nosync(v);
@@ -710,7 +707,7 @@ static void hvm_vcpu_down(void)
/* ... Shut down the domain if not. */
if ( online_count == 0 )
{
gdprintk(XENLOG_INFO, "all CPUs offline -- powering off.\n");
gdprintk(XENLOG_INFO, "All CPUs offline -- powering off.\n");
domain_shutdown(d, SHUTDOWN_poweroff);
}
}
@@ -749,7 +746,7 @@ void hvm_hlt(unsigned long rflags)
* out of this.
*/
if ( unlikely(!(rflags & X86_EFLAGS_IF)) )
return hvm_vcpu_down();
return hvm_vcpu_down(current);
do_sched_op_compat(SCHEDOP_block, 0);
}
+1 -2
View File
@@ -291,8 +291,7 @@ static int vlapic_accept_init(struct vcpu *v)
return X86EMUL_OKAY;
/* Asynchronously take the VCPU down and schedule reset work. */
set_bit(_VPF_down, &v->pause_flags);
vcpu_sleep_nosync(v);
hvm_vcpu_down(v);
tasklet_schedule(&vcpu_vlapic(v)->init_tasklet);
return X86EMUL_RETRY;
}
+1
View File
@@ -138,6 +138,7 @@ void hvm_domain_destroy(struct domain *d);
int hvm_vcpu_initialise(struct vcpu *v);
void hvm_vcpu_destroy(struct vcpu *v);
void hvm_vcpu_down(struct vcpu *v);
void hvm_send_assist_req(struct vcpu *v);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.