Lines Matching refs:vpmu

293     struct vpmu_struct *vpmu = vcpu_vpmu(v);  in core2_vpmu_save()  local
298 if ( !vpmu_are_all_set(vpmu, VPMU_CONTEXT_SAVE | VPMU_CONTEXT_LOADED) ) in core2_vpmu_save()
304 if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && is_hvm_vcpu(v) && in core2_vpmu_save()
311 memcpy((void *)(&vpmu->xenpmu_data->pmu.c.intel) + regs_off, in core2_vpmu_save()
312 vpmu->context + regs_off, regs_sz); in core2_vpmu_save()
354 struct vpmu_struct *vpmu = vcpu_vpmu(v); in core2_vpmu_verify() local
360 uint64_t *priv_context = vpmu->priv_context; in core2_vpmu_verify()
393 if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) && in core2_vpmu_verify()
401 vpmu_set(vpmu, VPMU_RUNNING); in core2_vpmu_verify()
403 vpmu_reset(vpmu, VPMU_RUNNING); in core2_vpmu_verify()
412 struct vpmu_struct *vpmu = vcpu_vpmu(v); in core2_vpmu_load() local
414 if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) ) in core2_vpmu_load()
423 memcpy(vpmu->context + regs_off, in core2_vpmu_load()
424 (void *)&v->arch.vpmu.xenpmu_data->pmu.c.intel + regs_off, in core2_vpmu_load()
434 memset(vpmu->context + regs_off, 0, regs_sz); in core2_vpmu_load()
439 vpmu_set(vpmu, VPMU_CONTEXT_LOADED); in core2_vpmu_load()
448 struct vpmu_struct *vpmu = vcpu_vpmu(v); in core2_vpmu_alloc_resource() local
478 vpmu->context = core2_vpmu_cxt; in core2_vpmu_alloc_resource()
479 vpmu->priv_context = p; in core2_vpmu_alloc_resource()
484 ASSERT(vpmu->xenpmu_data); in core2_vpmu_alloc_resource()
485 memcpy(&vpmu->xenpmu_data->pmu.c.intel, core2_vpmu_cxt, regs_off); in core2_vpmu_alloc_resource()
488 vpmu_set(vpmu, VPMU_CONTEXT_ALLOCATED); in core2_vpmu_alloc_resource()
506 struct vpmu_struct *vpmu = vcpu_vpmu(current); in core2_vpmu_msr_common_check() local
511 if ( unlikely(!vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED)) && in core2_vpmu_msr_common_check()
516 if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) ) in core2_vpmu_msr_common_check()
519 vpmu_set(vpmu, VPMU_CONTEXT_LOADED); in core2_vpmu_msr_common_check()
533 struct vpmu_struct *vpmu = vcpu_vpmu(v); in core2_vpmu_do_wrmsr() local
549 vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) ) in core2_vpmu_do_wrmsr()
552 !vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) ) in core2_vpmu_do_wrmsr()
566 core2_vpmu_cxt = vpmu->context; in core2_vpmu_do_wrmsr()
567 enabled_cntrs = vpmu->priv_context; in core2_vpmu_do_wrmsr()
591 if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) ) in core2_vpmu_do_wrmsr()
711 vpmu_set(vpmu, VPMU_RUNNING); in core2_vpmu_do_wrmsr()
713 vpmu_reset(vpmu, VPMU_RUNNING); in core2_vpmu_do_wrmsr()
722 struct vpmu_struct *vpmu = vcpu_vpmu(v); in core2_vpmu_do_rdmsr() local
727 core2_vpmu_cxt = vpmu->context; in core2_vpmu_do_rdmsr()
749 if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) ) in core2_vpmu_do_rdmsr()
760 const struct vpmu_struct *vpmu = vcpu_vpmu(v); in core2_vpmu_dump() local
762 const struct xen_pmu_intel_ctxt *core2_vpmu_cxt = vpmu->context; in core2_vpmu_dump()
767 if ( !core2_vpmu_cxt || !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) ) in core2_vpmu_dump()
770 if ( !vpmu_is_set(vpmu, VPMU_RUNNING) ) in core2_vpmu_dump()
772 if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) ) in core2_vpmu_dump()
807 struct vpmu_struct *vpmu = vcpu_vpmu(v); in core2_vpmu_do_interrupt() local
808 struct xen_pmu_intel_ctxt *core2_vpmu_cxt = vpmu->context; in core2_vpmu_do_interrupt()
832 struct vpmu_struct *vpmu = vcpu_vpmu(v); in core2_vpmu_destroy() local
834 xfree(vpmu->context); in core2_vpmu_destroy()
835 vpmu->context = NULL; in core2_vpmu_destroy()
836 xfree(vpmu->priv_context); in core2_vpmu_destroy()
837 vpmu->priv_context = NULL; in core2_vpmu_destroy()
841 vpmu_clear(vpmu); in core2_vpmu_destroy()
856 struct vpmu_struct *vpmu = vcpu_vpmu(v); in vmx_vpmu_initialise() local
882 vpmu_set(vpmu, VPMU_CPU_HAS_DS); in vmx_vpmu_initialise()
887 vpmu_reset(vpmu, VPMU_CPU_HAS_DS); in vmx_vpmu_initialise()
894 vpmu_set(vpmu, VPMU_CPU_HAS_BTS); in vmx_vpmu_initialise()
918 vpmu->arch_vpmu_ops = &core2_vpmu_ops; in vmx_vpmu_initialise()