mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
HV:treewide:C99-friendly per_cpu implementation change the per_cpu method
The current implementation of per_cpu relies on several non-c99 features, and in additional involves arbitrary pointer arithmetic which is not MIS- RA C friendly. This patch introduces struct per_cpu_region which holds all the per_cpu variables. Allocation of per_cpu data regions and access to per_cpu vari- ables are greatly simplified, at the cost of making all per_cpu varaibl- es accessible in files. Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
This commit is contained in:
@@ -9,9 +9,6 @@
|
||||
|
||||
bool x2apic_enabled;
|
||||
|
||||
static DEFINE_CPU_DATA(uint64_t[64], vmexit_cnt);
|
||||
static DEFINE_CPU_DATA(uint64_t[64], vmexit_time);
|
||||
|
||||
static void run_vcpu_pre_work(struct vcpu *vcpu)
|
||||
{
|
||||
unsigned long *pending_pre_work = &vcpu->pending_pre_work;
|
||||
|
@@ -7,15 +7,6 @@
|
||||
#include <hypervisor.h>
|
||||
#include <schedule.h>
|
||||
|
||||
struct sched_context {
|
||||
spinlock_t runqueue_lock;
|
||||
struct list_head runqueue;
|
||||
unsigned long need_scheduled;
|
||||
struct vcpu *curr_vcpu;
|
||||
spinlock_t scheduler_lock;
|
||||
};
|
||||
|
||||
static DEFINE_CPU_DATA(struct sched_context, sched_ctx);
|
||||
static unsigned long pcpu_used_bitmap;
|
||||
|
||||
void init_scheduler(void)
|
||||
|
Reference in New Issue
Block a user