From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 1/2] x86/domctl: cleanup Date: Mon, 13 Apr 2015 15:27:52 +0100 Message-ID: <552BEE88020000780007185B@mail.emea.novell.com> References: <1427902263-363-1-git-send-email-andrew.cooper3@citrix.com> <1427902263-363-2-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427902263-363-2-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 01.04.15 at 17:31, wrote: > case XEN_DOMCTL_gettscinfo: > - { > - xen_guest_tsc_info_t info; > - > - ret = -EINVAL; > - if ( d == current->domain ) /* no domain_pause() */ > - break; > - > - domain_pause(d); > - tsc_get_info(d, &info.tsc_mode, > - &info.elapsed_nsec, > - &info.gtsc_khz, > - &info.incarnation); > - if ( copy_to_guest(domctl->u.tsc_info.out_info, &info, 1) ) > - ret = -EFAULT; > + if ( d == currd ) /* no domain_pause() */ > + ret = -EINVAL; > else > - ret = 0; > - domain_unpause(d); > - } > - break; > + { > + xen_guest_tsc_info_t info; > + > + domain_pause(d); > + tsc_get_info(d, &info.tsc_mode, > + &info.elapsed_nsec, > + &info.gtsc_khz, > + &info.incarnation); > + domain_unpause(d); > + copyback = 1; If you want to use "copyback" here, you need to pass pointers into domctl->u.tsc_info.out_info to tsc_get_info(). Jan