From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 1/2] x86/domctl: cleanup Date: Mon, 13 Apr 2015 16:22:36 +0100 Message-ID: <552BDF3C.2010007@citrix.com> References: <1427902263-363-1-git-send-email-andrew.cooper3@citrix.com> <1427902263-363-2-git-send-email-andrew.cooper3@citrix.com> <552BEE88020000780007185B@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <552BEE88020000780007185B@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org On 13/04/15 15:27, Jan Beulich wrote: > >>> 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(). Oops - completely correct. I shall spin a v2. ~Andrew