mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-04 02:14:45 +00:00
hv: replace CPU_PAGE_SIZE with PAGE_SIZE
replace CPU_PAGE_SIZE with PAGE_SIZE These two MACROs are duplicated and PAGE_SIZE is a more reasonable name. Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
#ifndef APICREG_H
|
||||
#define APICREG_H
|
||||
|
||||
#include <page.h>
|
||||
|
||||
/*
|
||||
* Local && I/O APIC definitions.
|
||||
*/
|
||||
@@ -76,7 +78,7 @@ struct lapic_regs { /*OFFSET(Hex)*/
|
||||
|
||||
/*roundup sizeof current struct to 4KB*/
|
||||
struct lapic_reg rsv5[192]; /*400 -- FF0*/
|
||||
} __aligned(CPU_PAGE_SIZE);
|
||||
} __aligned(PAGE_SIZE);
|
||||
|
||||
enum LAPIC_REGISTERS {
|
||||
LAPIC_ID = 0x2,
|
||||
|
@@ -40,7 +40,6 @@
|
||||
|
||||
/* Define page size */
|
||||
#define CPU_PAGE_SHIFT 12U
|
||||
#define CPU_PAGE_SIZE 0x1000U
|
||||
#define CPU_PAGE_MASK 0xFFFFFFFFFFFFF000UL
|
||||
|
||||
#define MMU_PTE_PAGE_SHIFT CPU_PAGE_SHIFT
|
||||
|
@@ -195,7 +195,7 @@ struct msr_store_area {
|
||||
|
||||
struct acrn_vcpu_arch {
|
||||
/* vmcs region for this vcpu, MUST be 4KB-aligned */
|
||||
uint8_t vmcs[CPU_PAGE_SIZE];
|
||||
uint8_t vmcs[PAGE_SIZE];
|
||||
/* per vcpu lapic */
|
||||
struct acrn_vlapic vlapic;
|
||||
int cur_context;
|
||||
@@ -233,7 +233,7 @@ struct acrn_vcpu_arch {
|
||||
|
||||
/* List of MSRS to be stored and loaded on VM exits or VM entries */
|
||||
struct msr_store_area msr_area;
|
||||
} __aligned(CPU_PAGE_SIZE);
|
||||
} __aligned(PAGE_SIZE);
|
||||
|
||||
struct acrn_vm;
|
||||
struct acrn_vcpu {
|
||||
@@ -264,7 +264,7 @@ struct acrn_vcpu {
|
||||
#endif /* CONFIG_MTRR_ENABLED */
|
||||
uint64_t reg_cached;
|
||||
uint64_t reg_updated;
|
||||
} __aligned(CPU_PAGE_SIZE);
|
||||
} __aligned(PAGE_SIZE);
|
||||
|
||||
struct vcpu_dump {
|
||||
struct acrn_vcpu *vcpu;
|
||||
|
@@ -30,6 +30,8 @@
|
||||
#ifndef VLAPIC_H
|
||||
#define VLAPIC_H
|
||||
|
||||
#include <page.h>
|
||||
|
||||
|
||||
/**
|
||||
* @file vlapic.h
|
||||
@@ -104,7 +106,7 @@ struct acrn_vlapic {
|
||||
*/
|
||||
uint32_t svr_last;
|
||||
uint32_t lvt_last[VLAPIC_MAXLVT_INDEX + 1];
|
||||
} __aligned(CPU_PAGE_SIZE);
|
||||
} __aligned(PAGE_SIZE);
|
||||
|
||||
|
||||
/* APIC write handlers */
|
||||
|
@@ -26,7 +26,7 @@ struct vm_hw_info {
|
||||
struct acrn_vcpu vcpu_array[CONFIG_MAX_VCPUS_PER_VM];
|
||||
uint16_t created_vcpus; /* Number of created vcpus */
|
||||
uint64_t gpa_lowtop; /* top lowmem gpa of this VM */
|
||||
} __aligned(CPU_PAGE_SIZE);
|
||||
} __aligned(PAGE_SIZE);
|
||||
|
||||
struct sw_linux {
|
||||
void *ramdisk_src_addr; /* HVA */
|
||||
@@ -88,9 +88,9 @@ enum vm_state {
|
||||
|
||||
struct vm_arch {
|
||||
/* I/O bitmaps A and B for this VM, MUST be 4-Kbyte aligned */
|
||||
uint8_t io_bitmap[CPU_PAGE_SIZE*2];
|
||||
uint8_t io_bitmap[PAGE_SIZE*2];
|
||||
/* MSR bitmap region for this VM, MUST be 4-Kbyte aligned */
|
||||
uint8_t msr_bitmap[CPU_PAGE_SIZE];
|
||||
uint8_t msr_bitmap[PAGE_SIZE];
|
||||
|
||||
uint64_t guest_init_pml4;/* Guest init pml4 */
|
||||
/* EPT hierarchy for Normal World */
|
||||
@@ -108,7 +108,7 @@ struct vm_arch {
|
||||
struct vm_io_handler_desc emul_pio[EMUL_PIO_IDX_MAX];
|
||||
|
||||
/* reference to virtual platform to come here (as needed) */
|
||||
} __aligned(CPU_PAGE_SIZE);
|
||||
} __aligned(PAGE_SIZE);
|
||||
|
||||
|
||||
#define CPUID_CHECK_SUBLEAF (1U << 0U)
|
||||
@@ -160,7 +160,7 @@ struct acrn_vm {
|
||||
spinlock_t softirq_dev_lock;
|
||||
struct list_head softirq_dev_entry_list;
|
||||
uint64_t intr_inject_delay_delta; /* delay of intr injection */
|
||||
} __aligned(CPU_PAGE_SIZE);
|
||||
} __aligned(PAGE_SIZE);
|
||||
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
struct vpci_vdev_array {
|
||||
|
@@ -55,7 +55,7 @@
|
||||
|
||||
static inline uint64_t round_page_up(uint64_t addr)
|
||||
{
|
||||
return (((addr + (uint64_t)CPU_PAGE_SIZE) - 1UL) & CPU_PAGE_MASK);
|
||||
return (((addr + (uint64_t)PAGE_SIZE) - 1UL) & CPU_PAGE_MASK);
|
||||
}
|
||||
|
||||
static inline uint64_t round_page_down(uint64_t addr)
|
||||
|
@@ -28,6 +28,8 @@
|
||||
#define TRUSTY_PGTABLE_PAGE_NUM(size) \
|
||||
(TRUSTY_PML4_PAGE_NUM(size) + TRUSTY_PDPT_PAGE_NUM(size) + TRUSTY_PD_PAGE_NUM(size) + TRUSTY_PT_PAGE_NUM(size))
|
||||
|
||||
struct acrn_vm;
|
||||
|
||||
struct page {
|
||||
uint8_t contents[PAGE_SIZE];
|
||||
} __aligned(PAGE_SIZE);
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
||||
struct per_cpu_region {
|
||||
/* vmxon_region MUST be 4KB-aligned */
|
||||
uint8_t vmxon_region[CPU_PAGE_SIZE];
|
||||
uint8_t vmxon_region[PAGE_SIZE];
|
||||
#ifdef HV_DEBUG
|
||||
uint64_t *sbuf[ACRN_SBUF_ID_MAX];
|
||||
char logbuf[LOG_MESSAGE_MAX_SIZE];
|
||||
@@ -51,7 +51,7 @@ struct per_cpu_region {
|
||||
#ifdef PROFILING_ON
|
||||
struct profiling_info_wrapper profiling_info;
|
||||
#endif
|
||||
} __aligned(CPU_PAGE_SIZE); /* per_cpu_region size aligned with CPU_PAGE_SIZE */
|
||||
} __aligned(PAGE_SIZE); /* per_cpu_region size aligned with PAGE_SIZE */
|
||||
|
||||
extern struct per_cpu_region per_cpu_data[];
|
||||
extern uint16_t phys_cpu_num;
|
||||
|
Reference in New Issue
Block a user