hvm_set_nonreg_state(cd_vcpu, &nrs);
}
+static int copy_guest_area(struct guest_area *cd_area,
+ const struct guest_area *d_area,
+ struct vcpu *cd_vcpu,
+ const struct domain *d)
+{
+ unsigned int offset;
+
+ /* Check if no area to map, or already mapped. */
+ if ( !d_area->pg || cd_area->pg )
+ return 0;
+
+ offset = PAGE_OFFSET(d_area->map);
+ return map_guest_area(cd_vcpu, gfn_to_gaddr(
+ mfn_to_gfn(d, page_to_mfn(d_area->pg))) +
+ offset,
+ PAGE_SIZE - offset, cd_area, NULL);
+}
+
static int copy_vpmu(struct vcpu *d_vcpu, struct vcpu *cd_vcpu)
{
struct vpmu_struct *d_vpmu = vcpu_vpmu(d_vcpu);
return ret;
}
+ /* Same for the (physically registered) runstate and time info areas. */
+ ret = copy_guest_area(&cd_vcpu->runstate_guest_area,
+ &d_vcpu->runstate_guest_area, cd_vcpu, d);
+ if ( ret )
+ return ret;
+ ret = copy_guest_area(&cd_vcpu->arch.time_guest_area,
+ &d_vcpu->arch.time_guest_area, cd_vcpu, d);
+ if ( ret )
+ return ret;
+
ret = copy_vpmu(d_vcpu, cd_vcpu);
if ( ret )
return ret;
state:
if ( reset_state )
+ {
rc = copy_settings(d, pd);
+ if ( rc == -ERESTART )
+ /*
+ * Translate to -EAGAIN, see TODO comment at top of function about
+ * hypercall continuations.
+ */
+ rc = -EAGAIN;
+ }
domain_unpause(d);
put_page_and_type(mfn_to_page(mfn));
}
+int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size,
+ struct guest_area *area,
+ void (*populate)(void *dst, struct vcpu *v))
+{
+ return -EOPNOTSUPP;
+}
+
/*
* This is only intended to be used for domain cleanup (or more generally only
* with at least the respective vCPU, if it's not the current one, reliably