return rc;
}
+long pv_shim_cpu_up(void *data)
+{
+ struct vcpu *v = data;
+ long rc;
+
+ BUG_ON(smp_processor_id() != 0);
+
+ rc = cpu_up_helper((void *)(unsigned long)v->vcpu_id);
+ if ( rc )
+ return rc;
+
+ return vcpu_up(v);
+}
+
domid_t get_dom0_domid(void)
{
uint32_t eax, ebx, ecx, edx;
return rc;
}
+int vcpu_up(struct vcpu *v)
+{
+ bool wake = false;
+ int rc = 0;
+
+ domain_lock(v->domain);
+ if ( !v->is_initialised )
+ rc = -EINVAL;
+ else
+ wake = test_and_clear_bit(_VPF_down, &v->pause_flags);
+ domain_unlock(v->domain);
+ if ( wake )
+ vcpu_wake(v);
+
+ return rc;
+}
+
long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
{
struct domain *d = current->domain;
break;
- case VCPUOP_up: {
- bool_t wake = 0;
- domain_lock(d);
- if ( !v->is_initialised )
- rc = -EINVAL;
+ case VCPUOP_up:
+ if ( pv_shim && !cpu_online(v->vcpu_id) )
+ rc = continue_hypercall_on_cpu(0, pv_shim_cpu_up, v);
else
- wake = test_and_clear_bit(_VPF_down, &v->pause_flags);
- domain_unlock(d);
- if ( wake )
- vcpu_wake(v);
+ rc = vcpu_up(v);
+
break;
- }
case VCPUOP_down:
if ( !test_and_set_bit(_VPF_down, &v->pause_flags) )
vcpu_sleep_nosync(v);
+ if ( pv_shim && cpu_online(v->vcpu_id) )
+ rc = continue_hypercall_on_cpu(0, cpu_down_helper,
+ (void *)(unsigned long)v->vcpu_id);
+
break;
case VCPUOP_is_up:
void pv_shim_inject_evtchn(unsigned int port);
long pv_shim_grant_table_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop,
unsigned int count, bool compat);
+long pv_shim_cpu_up(void *data);
domid_t get_dom0_domid(void);
uint64_t pv_shim_mem(uint64_t rsvd);
ASSERT_UNREACHABLE();
return 0;
}
+static inline long pv_shim_cpu_up(void *data)
+{
+ ASSERT_UNREACHABLE();
+ return 0;
+}
static inline domid_t get_dom0_domid(void)
{
return 0;
struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
struct vcpu *alloc_dom0_vcpu0(struct domain *dom0);
int vcpu_reset(struct vcpu *);
+int vcpu_up(struct vcpu *v);
struct xen_domctl_getdomaininfo;
void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info);