diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index 0f29586f9..2b4a43a37 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -330,7 +330,7 @@ static uint64_t get_random_value(void) static void set_fs_base(void) { - struct stack_canary *psc = &get_cpu_var(stack_canary); + struct stack_canary *psc = &get_cpu_var(stk_canary); psc->canary = get_random_value(); msr_write(MSR_IA32_FS_BASE, (uint64_t)psc); diff --git a/hypervisor/arch/x86/ept.c b/hypervisor/arch/x86/ept.c index 20b28a875..35591d633 100644 --- a/hypervisor/arch/x86/ept.c +++ b/hypervisor/arch/x86/ept.c @@ -50,7 +50,7 @@ static void free_ept_mem(void *pml4_addr) void *pte_addr; uint32_t pml4_index; uint32_t pdpt_index; - uint32_t pde_index; + uint32_t pde_idx; if (pml4_addr == NULL) { ASSERT(false, "EPTP is NULL"); @@ -74,10 +74,10 @@ static void free_ept_mem(void *pml4_addr) continue; } - for (pde_index = 0U; pde_index < IA32E_NUM_ENTRIES; - pde_index++) { + for (pde_idx = 0U; pde_idx < IA32E_NUM_ENTRIES; + pde_idx++) { /* Walk from the PD table to the page table */ - pte_addr = HPA2HVA(find_next_table(pde_index, + pte_addr = HPA2HVA(find_next_table(pde_idx, pde_addr)); /* Free page table entry table */ diff --git a/hypervisor/arch/x86/guest/instr_emul.c b/hypervisor/arch/x86/guest/instr_emul.c index 38ad53737..4f1d4ed08 100644 --- a/hypervisor/arch/x86/guest/instr_emul.c +++ b/hypervisor/arch/x86/guest/instr_emul.c @@ -714,7 +714,7 @@ emulate_movs(struct vcpu *vcpu, __unused uint64_t gpa, struct instr_emul_vie *vi } } - seg = (vie->segment_override != 0U) ? (vie->segment_register) : CPU_REG_DS; + seg = (vie->seg_override != 0U) ? (vie->segment_register) : CPU_REG_DS; error = get_gla(vcpu, vie, paging, opsize, vie->addrsize, PROT_READ, seg, CPU_REG_RSI, &srcaddr, &fault); if ((error != 0) || (fault != 0)) { @@ -1791,7 +1791,7 @@ decode_prefixes(struct instr_emul_vie *vie, enum vm_cpu_mode cpu_mode, bool cs_d } else if (x == 0xF2U) { vie->repnz_present = 1U; } else if (segment_override(x, &vie->segment_register)) { - vie->segment_override = 1U; + vie->seg_override = 1U; } else { break; } diff --git a/hypervisor/arch/x86/guest/instr_emul_wrapper.h b/hypervisor/arch/x86/guest/instr_emul_wrapper.h index 0c9e376a4..82ff32e69 100644 --- a/hypervisor/arch/x86/guest/instr_emul_wrapper.h +++ b/hypervisor/arch/x86/guest/instr_emul_wrapper.h @@ -163,7 +163,7 @@ struct instr_emul_vie { repnz_present:1, /* REPNE/REPNZ prefix */ opsize_override:1, /* Operand size override */ addrsize_override:1, /* Address size override */ - segment_override:1; /* Segment override */ + seg_override:1; /* Segment override */ uint8_t mod:2, /* ModRM byte */ reg:4, diff --git a/hypervisor/arch/x86/guest/vioapic.c b/hypervisor/arch/x86/guest/vioapic.c index 58a6a6fbe..383ad557a 100644 --- a/hypervisor/arch/x86/guest/vioapic.c +++ b/hypervisor/arch/x86/guest/vioapic.c @@ -347,11 +347,11 @@ vioapic_write(struct vioapic *vioapic, uint32_t addr, uint32_t data) /* mask -> umask */ if ((last.full & IOAPIC_RTE_INTMASK) != 0UL && ((new.full & IOAPIC_RTE_INTMASK) == 0UL)) { - if ((vioapic->vm->vpic_wire_mode == + if ((vioapic->vm->wire_mode == VPIC_WIRE_NULL) || - (vioapic->vm->vpic_wire_mode == + (vioapic->vm->wire_mode == VPIC_WIRE_INTR)) { - vioapic->vm->vpic_wire_mode = + vioapic->vm->wire_mode = VPIC_WIRE_IOAPIC; dev_dbg(ACRN_DBG_IOAPIC, "vpic wire mode -> IOAPIC"); @@ -362,9 +362,9 @@ vioapic_write(struct vioapic *vioapic, uint32_t addr, uint32_t data) /* unmask -> mask */ } else if (((last.full & IOAPIC_RTE_INTMASK) == 0UL) && (new.full & IOAPIC_RTE_INTMASK) != 0UL) { - if (vioapic->vm->vpic_wire_mode == + if (vioapic->vm->wire_mode == VPIC_WIRE_IOAPIC) { - vioapic->vm->vpic_wire_mode = + vioapic->vm->wire_mode = VPIC_WIRE_INTR; dev_dbg(ACRN_DBG_IOAPIC, "vpic wire mode -> INTR"); diff --git a/hypervisor/arch/x86/guest/vlapic.c b/hypervisor/arch/x86/guest/vlapic.c index 7c7918fd3..aac1aa3cf 100644 --- a/hypervisor/arch/x86/guest/vlapic.c +++ b/hypervisor/arch/x86/guest/vlapic.c @@ -611,9 +611,9 @@ vlapic_lvt_write_handler(struct acrn_vlapic *vlapic, uint32_t offset) /* mask -> unmask: may from every vlapic in the vm */ if (((last & APIC_LVT_M) != 0U) && ((val & APIC_LVT_M) == 0U)) { - if (vlapic->vm->vpic_wire_mode == VPIC_WIRE_INTR || - vlapic->vm->vpic_wire_mode == VPIC_WIRE_NULL) { - vlapic->vm->vpic_wire_mode = VPIC_WIRE_LAPIC; + if (vlapic->vm->wire_mode == VPIC_WIRE_INTR || + vlapic->vm->wire_mode == VPIC_WIRE_NULL) { + vlapic->vm->wire_mode = VPIC_WIRE_LAPIC; dev_dbg(ACRN_DBG_LAPIC, "vpic wire mode -> LAPIC"); } else { @@ -622,8 +622,8 @@ vlapic_lvt_write_handler(struct acrn_vlapic *vlapic, uint32_t offset) } /* unmask -> mask: only from the vlapic LINT0-ExtINT enabled */ } else if (((last & APIC_LVT_M) == 0U) && ((val & APIC_LVT_M) != 0U)) { - if (vlapic->vm->vpic_wire_mode == VPIC_WIRE_LAPIC) { - vlapic->vm->vpic_wire_mode = VPIC_WIRE_NULL; + if (vlapic->vm->wire_mode == VPIC_WIRE_LAPIC) { + vlapic->vm->wire_mode = VPIC_WIRE_NULL; dev_dbg(ACRN_DBG_LAPIC, "vpic wire mode -> NULL"); } @@ -1279,8 +1279,8 @@ vlapic_svr_write_handler(struct acrn_vlapic *vlapic) vlapic_mask_lvts(vlapic); /* the only one enabled LINT0-ExtINT vlapic disabled */ - if (vlapic->vm->vpic_wire_mode == VPIC_WIRE_NULL) { - vlapic->vm->vpic_wire_mode = VPIC_WIRE_INTR; + if (vlapic->vm->wire_mode == VPIC_WIRE_NULL) { + vlapic->vm->wire_mode = VPIC_WIRE_INTR; dev_dbg(ACRN_DBG_LAPIC, "vpic wire mode -> INTR"); } diff --git a/hypervisor/arch/x86/guest/vm.c b/hypervisor/arch/x86/guest/vm.c index a065d097a..f93593cee 100644 --- a/hypervisor/arch/x86/guest/vm.c +++ b/hypervisor/arch/x86/guest/vm.c @@ -177,7 +177,7 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm) vm->vpic = vpic_init(vm); /* vpic wire_mode default is INTR */ - vm->vpic_wire_mode = VPIC_WIRE_INTR; + vm->wire_mode = VPIC_WIRE_INTR; /* Allocate full emulated vIOAPIC instance */ vm->arch_vm.virt_ioapic = vioapic_init(vm); diff --git a/hypervisor/arch/x86/guest/vpic.c b/hypervisor/arch/x86/guest/vpic.c index 2244a0a51..2c6a84e02 100644 --- a/hypervisor/arch/x86/guest/vpic.c +++ b/hypervisor/arch/x86/guest/vpic.c @@ -231,7 +231,7 @@ static void vpic_notify_intr(struct acrn_vpic *vpic) * interrupt. */ i8259->intr_raised = true; - if (vpic->vm->vpic_wire_mode == VPIC_WIRE_INTR) { + if (vpic->vm->wire_mode == VPIC_WIRE_INTR) { struct vcpu *vcpu = vcpu_from_vid(vpic->vm, 0U); ASSERT(vcpu != NULL, "vm%d, vcpu0", vpic->vm->attr.id); diff --git a/hypervisor/arch/x86/pm.c b/hypervisor/arch/x86/pm.c index 2eb36c57a..c072fd274 100644 --- a/hypervisor/arch/x86/pm.c +++ b/hypervisor/arch/x86/pm.c @@ -13,7 +13,7 @@ uint8_t host_enter_s3_success = 1U; void restore_msrs(void) { #ifdef STACK_PROTECTOR - struct stack_canary *psc = &get_cpu_var(stack_canary); + struct stack_canary *psc = &get_cpu_var(stk_canary); msr_write(MSR_IA32_FS_BASE, (uint64_t)psc); #endif diff --git a/hypervisor/include/arch/x86/guest/vm.h b/hypervisor/include/arch/x86/guest/vm.h index 858a8f223..d3f0cab07 100644 --- a/hypervisor/include/arch/x86/guest/vm.h +++ b/hypervisor/include/arch/x86/guest/vm.h @@ -134,7 +134,7 @@ struct vm { enum vm_state state; /* VM state */ void *vuart; /* Virtual UART */ struct acrn_vpic *vpic; /* Virtual PIC */ - enum vpic_wire_mode vpic_wire_mode; + enum vpic_wire_mode wire_mode; struct iommu_domain *iommu; /* iommu domain of this VM */ struct list_head list; /* list of VM */ spinlock_t spinlock; /* Spin-lock used to protect VM modifications */ diff --git a/hypervisor/include/arch/x86/per_cpu.h b/hypervisor/include/arch/x86/per_cpu.h index 516c6a667..db34babac 100644 --- a/hypervisor/include/arch/x86/per_cpu.h +++ b/hypervisor/include/arch/x86/per_cpu.h @@ -31,7 +31,7 @@ struct per_cpu_region { void *vcpu; void *ever_run_vcpu; #ifdef STACK_PROTECTOR - struct stack_canary stack_canary; + struct stack_canary stk_canary; #endif struct per_cpu_timers cpu_timers; struct sched_context sched_ctx;