From: Ian Campbell Subject: Re: [PATCH 1/2] xen: move VCPUOP_register_runstate_memory_area to common code Date: Thu, 2 May 2013 09:05:17 +0100 Message-ID: <1367481917.21869.14.camel@zakaz.uk.xensource.com> References: <1367436748-10352-1-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1367436748-10352-1-git-send-email-stefano.stabellini@eu.citrix.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: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org On Wed, 2013-05-01 at 20:32 +0100, Stefano Stabellini wrote: > Signed-off-by: Stefano Stabellini Needs x86 and/or core acks, but lacks suitable CCs. Added. > --- > xen/arch/x86/domain.c | 28 ---------------------------- > xen/common/domain.c | 28 ++++++++++++++++++++++++++++ > 2 files changed, 28 insertions(+), 28 deletions(-) > > diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c > index d1b6c64..87dcb73 100644 > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -960,34 +960,6 @@ arch_do_vcpu_op( > > switch ( cmd ) > { > - case VCPUOP_register_runstate_memory_area: > - { > - struct vcpu_register_runstate_memory_area area; > - struct vcpu_runstate_info runstate; > - > - rc = -EFAULT; > - if ( copy_from_guest(&area, arg, 1) ) > - break; > - > - if ( !guest_handle_okay(area.addr.h, 1) ) > - break; > - > - rc = 0; > - runstate_guest(v) = area.addr.h; > - > - if ( v == current ) > - { > - __copy_to_guest(runstate_guest(v), &v->runstate, 1); > - } > - else > - { > - vcpu_runstate_get(v, &runstate); > - __copy_to_guest(runstate_guest(v), &runstate, 1); > - } > - > - break; > - } > - > /* > * XXX Disable for 4.0.0: __update_vcpu_system_time() writes to the given > * virtual address even when running in another domain's address space. > diff --git a/xen/common/domain.c b/xen/common/domain.c > index d21909f..0752dd2 100644 > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -1126,6 +1126,34 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg) > break; > } > > + case VCPUOP_register_runstate_memory_area: > + { > + struct vcpu_register_runstate_memory_area area; > + struct vcpu_runstate_info runstate; > + > + rc = -EFAULT; > + if ( copy_from_guest(&area, arg, 1) ) > + break; > + > + if ( !guest_handle_okay(area.addr.h, 1) ) > + break; > + > + rc = 0; > + runstate_guest(v) = area.addr.h; > + > + if ( v == current ) > + { > + __copy_to_guest(runstate_guest(v), &v->runstate, 1); > + } > + else > + { > + vcpu_runstate_get(v, &runstate); > + __copy_to_guest(runstate_guest(v), &runstate, 1); > + } > + > + break; > + } > + > #ifdef VCPU_TRAP_NMI > case VCPUOP_send_nmi: > if ( !guest_handle_is_null(arg) )