HV: Added Initial support for SEP/SOCWATCH profiling

This patch adds support to sep/socwatch profiling
     Adds 2 new files include/arch/x86/profiling.h and arch/x86/profiling.c
     which contains most of the implementation for profiling,most of the functions
     in profiling.c have dummy implementation and will be implemented in next patches

     a. cpu.c, Initial profiling setup is done as part of bsp_boot_post
  and cpu_secondary_post flow
     b. vmcall.c, New ioctl is added for performing profiling related
  operations in vmcall_vmexit_handler
	ioctl - HC_PROFILING_OPS
        function - hcall_profiling_ops()
     c. common/hypercall.c, hcall_profiling_ops() implementation.
     d. hv_main.c, In vcpu_thread calling profiling related functions
  to save vm context
     e. acrn_hv_defs.h, list all the profiling command types

Tracked-On: projectacrn#1409
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Chinthapally, Manisha <manisha.chinthapally@intel.com>
This commit is contained in:
Chinthapally, Manisha
2018-10-22 12:29:21 -07:00
committed by wenlingz
parent 3010718d4a
commit 8ba333d275
14 changed files with 388 additions and 6 deletions

View File

@@ -485,6 +485,7 @@ static void bsp_boot_post(void)
init_iommu();
timer_init();
profiling_setup();
setup_notification();
setup_posted_intr_notification();
ptdev_init();
@@ -564,7 +565,7 @@ static void cpu_secondary_post(void)
interrupt_init(get_cpu_id());
timer_init();
profiling_setup();
/* Wait for boot processor to signal all secondary cores to continue */
wait_sync_change(&pcpu_sync, 0UL);

View File

@@ -173,6 +173,10 @@ int vmcall_vmexit_handler(struct vcpu *vcpu)
case HC_SETUP_HV_NPK_LOG:
ret = hcall_setup_hv_npk_log(vm, param1);
break;
case HC_PROFILING_OPS:
ret = hcall_profiling_ops(vm, param1, param2);
break;
#endif
case HC_WORLD_SWITCH:

View File

@@ -26,6 +26,7 @@ static struct static_mapping_table irq_static_mappings[NR_STATIC_MAPPINGS] = {
{TIMER_IRQ, VECTOR_TIMER},
{NOTIFY_IRQ, VECTOR_NOTIFY_VCPU},
{POSTED_INTR_NOTIFY_IRQ, VECTOR_POSTED_INTR},
{PMI_IRQ, VECTOR_PMI},
};
/*
@@ -96,7 +97,7 @@ uint32_t alloc_irq_vector(uint32_t irq)
}
desc = &irq_desc_array[irq];
if (desc->vector != VECTOR_INVALID) {
if (vector_to_irq[desc->vector] == irq) {
/* statically binded */
@@ -121,7 +122,7 @@ uint32_t alloc_irq_vector(uint32_t irq)
}
}
vr = (vr > VECTOR_DYNAMIC_END) ? VECTOR_INVALID : vr;
spinlock_irqrestore_release(&irq_alloc_spinlock, rflags);
}