Files
acrn-hypervisor/hypervisor/include/arch/x86/asm/per_cpu.h
hangliu1 41f04b4e7a HV: abstract percpu structure from x86 arch
Move x86 architecture dependent per cpu data into a
seperate structure and embeded it in per_cpu_region.
caller could access architecture dependent member by
using prefix 'arch.'.

v2->v3:
move whose_iwkey, profiling_info and tsc_suspend to x86
v1->v2:
rebased on latest repo

Tracked-On: #8801
Signed-off-by: hangliu1 <hang1.liu@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Reviewed-by: Liu, Yifan1 <yifan1.liu@intel.com>
Reviewed-by: Chen, Jian Jun<jian.jun.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2025-09-19 15:04:55 +08:00

38 lines
846 B
C

/*
* Copyright (C) 2018-2022 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef PER_CPU_X86_H
#define PER_CPU_X86_H
#include <types.h>
#include <asm/page.h>
#include <profiling.h>
#include <asm/gdt.h>
#include <asm/security.h>
#include <asm/vm_config.h>
struct per_cpu_arch {
/* vmxon_region MUST be 4KB-aligned */
uint8_t vmxon_region[PAGE_SIZE];
void *vmcs_run;
struct host_gdt gdt;
struct tss_64 tss;
uint8_t mc_stack[CONFIG_STACK_SIZE] __aligned(16);
uint8_t df_stack[CONFIG_STACK_SIZE] __aligned(16);
uint8_t sf_stack[CONFIG_STACK_SIZE] __aligned(16);
uint32_t lapic_id;
uint32_t lapic_ldr;
#ifdef PROFILING_ON
struct profiling_info_wrapper profiling_info;
#endif
uint64_t tsc_suspend;
struct acrn_vcpu *whose_iwkey;
} __aligned(PAGE_SIZE); /* per_cpu_region size aligned with PAGE_SIZE */
#endif