Files
acrn-hypervisor/hypervisor/include/arch/x86/asm/per_cpu.h
Jian Jun Chen 0e0f673458 hv: multi-arch: move stack_canary to per_cpu_arch
Stack canary implementation varies across architectures. x86 uses a
per-pCPU __stack_chk_guard while RISC-V uses a global variable shared
across all pCPUs. Move struct stack_canary from the common per_cpu
structure to per_cpu_arch to allow architecture-specific stack
protection implementations.

Tracked-On: #8834
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2025-10-29 17:45:44 +08:00

43 lines
956 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 STACK_PROTECTOR
struct stack_canary stk_canary;
#endif
#ifdef PROFILING_ON
struct profiling_info_wrapper profiling_info;
#endif
uint64_t tsc_suspend;
struct acrn_vcpu *whose_iwkey;
uint32_t kick_pcpu_mode;
uint32_t idle_mode;
} __aligned(PAGE_SIZE); /* per_cpu_region size aligned with PAGE_SIZE */
#endif