|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH] Allow guest to register a secondary vcpu_time_in
>>> Jeremy Fitzhardinge <jeremy@xxxxxxxx> 06.10.09 02:10 >>>
>-void update_vcpu_system_time(struct vcpu *v)
>+static void update_guest_time_info(struct vcpu *v, struct vcpu_time_info *u)
>+{
>+ struct vcpu_time_info info;
>+ u32 version;
>+
>+ if ( guest_handle_is_null(v->time_info_guest) )
>+ return;
>+
>+ if ( __copy_from_guest(&info, v->time_info_guest, 1) )
>+ return;
I'd suggest using __copy_field_from_guest() here to get just the
version member, after copying *u into info.
>+
>+ /*
>+ * Update the guest copy of the time info. We need to make sure
>+ * we update the guest's version of the version number rather than
>+ * use a verbtim copy of the master one, because the guest may
>+ * update the version for its own purposes.
>+ */
>+ version = info.version;
>+ info = *u;
>+ info.version = (version + 2) & ~1;
>+
>+ __copy_to_guest(v->time_info_guest, &info, 1);
>+}
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|