[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [IA64] Steal time accounting for PV domain - hypervisor side
# HG changeset patch # User awilliam@xxxxxxxxxxxx # Date 1173298567 25200 # Node ID 4e367aa898956466747417bff637a681b8b58202 # Parent 9f8e996a678d5825462e2546aff6789064b3aed2 [IA64] Steal time accounting for PV domain - hypervisor side Signed-off-by: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx> --- xen/arch/ia64/linux-xen/entry.S | 2 - xen/arch/ia64/xen/domain.c | 43 +++++++++++++++++++++++++++++++++++++++ xen/include/asm-ia64/hypercall.h | 3 +- 3 files changed, 46 insertions(+), 2 deletions(-) diff -r 9f8e996a678d -r 4e367aa89895 xen/arch/ia64/linux-xen/entry.S --- a/xen/arch/ia64/linux-xen/entry.S Wed Mar 07 12:45:08 2007 -0700 +++ b/xen/arch/ia64/linux-xen/entry.S Wed Mar 07 13:16:07 2007 -0700 @@ -1509,7 +1509,7 @@ ia64_hypercall_table: data8 do_ni_hypercall /* do_vm_assist */ data8 do_ni_hypercall /* do_update_va_mapping_othe */ data8 do_ni_hypercall /* (x86 only) */ - data8 do_ni_hypercall /* do_vcpu_op */ + data8 do_vcpu_op /* do_vcpu_op */ data8 do_ni_hypercall /* (x86_64 only) */ /* 25 */ data8 do_ni_hypercall /* do_mmuext_op */ data8 do_ni_hypercall /* do_acm_op */ diff -r 9f8e996a678d -r 4e367aa89895 xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Wed Mar 07 12:45:08 2007 -0700 +++ b/xen/arch/ia64/xen/domain.c Wed Mar 07 13:16:07 2007 -0700 @@ -50,6 +50,7 @@ #include <xen/guest_access.h> #include <asm/tlb_track.h> #include <asm/perfmon.h> +#include <public/vcpu.h> unsigned long dom0_size = 512*1024*1024; @@ -262,6 +263,9 @@ void context_switch(struct vcpu *prev, s vcpu_info[current->vcpu_id].evtchn_upcall_mask; __ia64_per_cpu_var(current_psr_ic_addr) = (int *)(nd->arch.shared_info_va + XSI_PSR_IC_OFS); + /* steal time accounting */ + if (!guest_handle_is_null(runstate_guest(current))) + __copy_to_guest(runstate_guest(current), ¤t->runstate, 1); } else { /* When switching to idle domain, only need to disable vhpt * walker. Then all accesses happen within idle context will @@ -1257,6 +1261,45 @@ void sync_vcpu_execstate(struct vcpu *v) // FIXME SMP: Anything else needed here for SMP? } +/* This function is taken from xen/arch/x86/domain.c */ +long +arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg) +{ + long rc = 0; + + 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; + } + default: + rc = -ENOSYS; + break; + } + + return rc; +} + static void parse_dom0_mem(char *s) { dom0_size = parse_size_and_unit(s, NULL); diff -r 9f8e996a678d -r 4e367aa89895 xen/include/asm-ia64/hypercall.h --- a/xen/include/asm-ia64/hypercall.h Wed Mar 07 12:45:08 2007 -0700 +++ b/xen/include/asm-ia64/hypercall.h Wed Mar 07 13:16:07 2007 -0700 @@ -22,6 +22,7 @@ vmx_do_mmu_update( u64 *pdone, u64 foreigndom); -#define arch_do_vcpu_op(cmd, vcpu, arg) (-ENOSYS) +extern long +arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg); #endif /* __ASM_IA64_HYPERCALL_H__ */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |