From 843f7721f022069bee6f4131f681beafd123a008 Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Fri, 28 Sep 2018 10:44:33 +0800 Subject: [PATCH] hv: Change the struct cpu_gp_regs name to acrn_gp_regs We will define the hypercall to set acrn vcpu registers and move this struct to acrn_commmon.h for reference from hypercall parameter definition. Tracked-On: #1231 Signed-off-by: Yin Fengwei --- hypervisor/arch/x86/static_checks.c | 30 ++++++++++---------- hypervisor/bsp/uefi/uefi.c | 4 +-- hypervisor/include/arch/x86/cpu.h | 2 +- hypervisor/include/arch/x86/guest/gpr.h | 2 +- hypervisor/include/arch/x86/guest/vcpu.h | 2 +- hypervisor/include/arch/x86/guest/vm0_boot.h | 2 +- hypervisor/include/arch/x86/irq.h | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/hypervisor/arch/x86/static_checks.c b/hypervisor/arch/x86/static_checks.c index 8fd2b2491..aa1787f6c 100644 --- a/hypervisor/arch/x86/static_checks.c +++ b/hypervisor/arch/x86/static_checks.c @@ -30,21 +30,21 @@ CTASSERT(BOOT_CTX_CS_AR_OFFSET == offsetof(struct boot_ctx, cs_ar)); CTASSERT(BOOT_CTX_EFER_LOW_OFFSET == offsetof(struct boot_ctx, ia32_efer)); CTASSERT(BOOT_CTX_EFER_HIGH_OFFSET == offsetof(struct boot_ctx, ia32_efer) + 4); -CTASSERT(CPU_CONTEXT_OFFSET_RAX == offsetof(struct cpu_gp_regs, rax)); -CTASSERT(CPU_CONTEXT_OFFSET_RBX == offsetof(struct cpu_gp_regs, rbx)); -CTASSERT(CPU_CONTEXT_OFFSET_RCX == offsetof(struct cpu_gp_regs, rcx)); -CTASSERT(CPU_CONTEXT_OFFSET_RDX == offsetof(struct cpu_gp_regs, rdx)); -CTASSERT(CPU_CONTEXT_OFFSET_RBP == offsetof(struct cpu_gp_regs, rbp)); -CTASSERT(CPU_CONTEXT_OFFSET_RSI == offsetof(struct cpu_gp_regs, rsi)); -CTASSERT(CPU_CONTEXT_OFFSET_RDI == offsetof(struct cpu_gp_regs, rdi)); -CTASSERT(CPU_CONTEXT_OFFSET_R8 == offsetof(struct cpu_gp_regs, r8)); -CTASSERT(CPU_CONTEXT_OFFSET_R9 == offsetof(struct cpu_gp_regs, r9)); -CTASSERT(CPU_CONTEXT_OFFSET_R10 == offsetof(struct cpu_gp_regs, r10)); -CTASSERT(CPU_CONTEXT_OFFSET_R11 == offsetof(struct cpu_gp_regs, r11)); -CTASSERT(CPU_CONTEXT_OFFSET_R12 == offsetof(struct cpu_gp_regs, r12)); -CTASSERT(CPU_CONTEXT_OFFSET_R13 == offsetof(struct cpu_gp_regs, r13)); -CTASSERT(CPU_CONTEXT_OFFSET_R14 == offsetof(struct cpu_gp_regs, r14)); -CTASSERT(CPU_CONTEXT_OFFSET_R15 == offsetof(struct cpu_gp_regs, r15)); +CTASSERT(CPU_CONTEXT_OFFSET_RAX == offsetof(struct acrn_gp_regs, rax)); +CTASSERT(CPU_CONTEXT_OFFSET_RBX == offsetof(struct acrn_gp_regs, rbx)); +CTASSERT(CPU_CONTEXT_OFFSET_RCX == offsetof(struct acrn_gp_regs, rcx)); +CTASSERT(CPU_CONTEXT_OFFSET_RDX == offsetof(struct acrn_gp_regs, rdx)); +CTASSERT(CPU_CONTEXT_OFFSET_RBP == offsetof(struct acrn_gp_regs, rbp)); +CTASSERT(CPU_CONTEXT_OFFSET_RSI == offsetof(struct acrn_gp_regs, rsi)); +CTASSERT(CPU_CONTEXT_OFFSET_RDI == offsetof(struct acrn_gp_regs, rdi)); +CTASSERT(CPU_CONTEXT_OFFSET_R8 == offsetof(struct acrn_gp_regs, r8)); +CTASSERT(CPU_CONTEXT_OFFSET_R9 == offsetof(struct acrn_gp_regs, r9)); +CTASSERT(CPU_CONTEXT_OFFSET_R10 == offsetof(struct acrn_gp_regs, r10)); +CTASSERT(CPU_CONTEXT_OFFSET_R11 == offsetof(struct acrn_gp_regs, r11)); +CTASSERT(CPU_CONTEXT_OFFSET_R12 == offsetof(struct acrn_gp_regs, r12)); +CTASSERT(CPU_CONTEXT_OFFSET_R13 == offsetof(struct acrn_gp_regs, r13)); +CTASSERT(CPU_CONTEXT_OFFSET_R14 == offsetof(struct acrn_gp_regs, r14)); +CTASSERT(CPU_CONTEXT_OFFSET_R15 == offsetof(struct acrn_gp_regs, r15)); CTASSERT(CPU_CONTEXT_OFFSET_CR2 == offsetof(struct run_context, cr2)); CTASSERT(CPU_CONTEXT_OFFSET_IA32_SPEC_CTRL == offsetof(struct run_context, ia32_spec_ctrl)); diff --git a/hypervisor/bsp/uefi/uefi.c b/hypervisor/bsp/uefi/uefi.c index 4c64bf5c5..318dd080a 100644 --- a/hypervisor/bsp/uefi/uefi.c +++ b/hypervisor/bsp/uefi/uefi.c @@ -52,8 +52,8 @@ int uefi_sw_loader(struct vm *vm, struct vcpu *vcpu) vlapic_restore(vcpu_vlapic(vcpu), &uefi_lapic_regs); vcpu->entry_addr = (void *)efi_ctx->rip; - memcpy_s(&cur_context->guest_cpu_regs, sizeof(struct cpu_gp_regs), - &efi_ctx->gprs, sizeof(struct cpu_gp_regs)); + memcpy_s(&cur_context->guest_cpu_regs, sizeof(struct acrn_gp_regs), + &efi_ctx->gprs, sizeof(struct acrn_gp_regs)); /* defer irq enabling till vlapic is ready */ CPU_IRQ_ENABLE(); diff --git a/hypervisor/include/arch/x86/cpu.h b/hypervisor/include/arch/x86/cpu.h index c55c8fbf7..a44f252da 100644 --- a/hypervisor/include/arch/x86/cpu.h +++ b/hypervisor/include/arch/x86/cpu.h @@ -167,7 +167,7 @@ */ enum cpu_reg_name { /* General purpose register layout should align with - * struct cpu_gp_regs + * struct acrn_gp_regs */ CPU_REG_RAX, CPU_REG_RCX, diff --git a/hypervisor/include/arch/x86/guest/gpr.h b/hypervisor/include/arch/x86/guest/gpr.h index 53e60b1c3..735524c90 100644 --- a/hypervisor/include/arch/x86/guest/gpr.h +++ b/hypervisor/include/arch/x86/guest/gpr.h @@ -10,7 +10,7 @@ /* General-purpose register layout aligned with the general-purpose register idx * when vmexit, such as vmexit due to CR access, refer to SMD Vol.3C 27-6. */ -struct cpu_gp_regs { +struct acrn_gp_regs { uint64_t rax; uint64_t rcx; uint64_t rdx; diff --git a/hypervisor/include/arch/x86/guest/vcpu.h b/hypervisor/include/arch/x86/guest/vcpu.h index 387884401..c64a3a341 100644 --- a/hypervisor/include/arch/x86/guest/vcpu.h +++ b/hypervisor/include/arch/x86/guest/vcpu.h @@ -77,7 +77,7 @@ struct run_context { * in vmx_asm.S match */ union { - struct cpu_gp_regs regs; + struct acrn_gp_regs regs; uint64_t longs[NUM_GPRS]; } guest_cpu_regs; diff --git a/hypervisor/include/arch/x86/guest/vm0_boot.h b/hypervisor/include/arch/x86/guest/vm0_boot.h index b7e149be4..d3de909cf 100644 --- a/hypervisor/include/arch/x86/guest/vm0_boot.h +++ b/hypervisor/include/arch/x86/guest/vm0_boot.h @@ -69,7 +69,7 @@ struct boot_ctx { uint32_t cs_ar; uint64_t ia32_efer; #ifdef CONFIG_EFI_STUB - struct cpu_gp_regs gprs; + struct acrn_gp_regs gprs; uint64_t rip; uint64_t rflags; void *rsdp; diff --git a/hypervisor/include/arch/x86/irq.h b/hypervisor/include/arch/x86/irq.h index fb0ed2352..2ff20de6c 100644 --- a/hypervisor/include/arch/x86/irq.h +++ b/hypervisor/include/arch/x86/irq.h @@ -44,7 +44,7 @@ * Definition of the stack frame layout */ struct intr_excp_ctx { - struct cpu_gp_regs gp_regs; + struct acrn_gp_regs gp_regs; uint64_t vector; uint64_t error_code; uint64_t rip;