From 38ca8db19f9bd890d4f2f2ec00b35e38175592bf Mon Sep 17 00:00:00 2001 From: Mingqiang Chi Date: Tue, 3 Sep 2019 13:53:18 +0800 Subject: [PATCH] hv:tiny cleanup -- remove some unnecessary includes -- fix a typo -- remove unnecessary void before launch_vms Tracked-On: #1842 Signed-off-by: Mingqiang Chi --- hypervisor/acpi_parser/acpi_ext.c | 1 - hypervisor/arch/x86/cpu.c | 2 +- hypervisor/arch/x86/guest/vcpu.c | 4 ++-- hypervisor/arch/x86/init.c | 2 +- hypervisor/include/arch/x86/multiboot.h | 1 - hypervisor/include/arch/x86/security.h | 1 - hypervisor/include/dm/vacpi.h | 2 +- hypervisor/lib/stack_protector.c | 3 ++- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hypervisor/acpi_parser/acpi_ext.c b/hypervisor/acpi_parser/acpi_ext.c index 152b8183d..dccb90ca6 100644 --- a/hypervisor/acpi_parser/acpi_ext.c +++ b/hypervisor/acpi_parser/acpi_ext.c @@ -34,7 +34,6 @@ #include #include #include -#include /* Per ACPI spec: * There are two fundamental types of ACPI tables: diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index 7b0ed5480..b040388b6 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hypervisor/arch/x86/guest/vcpu.c b/hypervisor/arch/x86/guest/vcpu.c index b235872ba..b0b3b583e 100644 --- a/hypervisor/arch/x86/guest/vcpu.c +++ b/hypervisor/arch/x86/guest/vcpu.c @@ -30,7 +30,7 @@ struct stack_frame { uint64_t rbx; uint64_t rflag; uint64_t rip; - uint64_t maigc; + uint64_t magic; }; uint64_t vcpu_get_gpreg(const struct acrn_vcpu *vcpu, uint32_t reg) @@ -615,7 +615,7 @@ static uint64_t build_stack_frame(struct acrn_vcpu *vcpu) frame = (struct stack_frame *)stacktop; frame -= 1; - frame->maigc = SP_BOTTOM_MAGIC; + frame->magic = SP_BOTTOM_MAGIC; frame->rip = (uint64_t)run_sched_thread; /*return address*/ frame->rflag = 0UL; frame->rbx = 0UL; diff --git a/hypervisor/arch/x86/init.c b/hypervisor/arch/x86/init.c index 84be4dff4..03fa743c1 100644 --- a/hypervisor/arch/x86/init.c +++ b/hypervisor/arch/x86/init.c @@ -54,7 +54,7 @@ static void enter_guest_mode(uint16_t pcpu_id) { vmx_on(); - (void)launch_vms(pcpu_id); + launch_vms(pcpu_id); switch_to_idle(default_idle); diff --git a/hypervisor/include/arch/x86/multiboot.h b/hypervisor/include/arch/x86/multiboot.h index 4740ff675..b35e6501a 100644 --- a/hypervisor/include/arch/x86/multiboot.h +++ b/hypervisor/include/arch/x86/multiboot.h @@ -18,7 +18,6 @@ /* maximum lengt of the guest OS' command line parameter string */ #define MAX_BOOTARGS_SIZE 2048U -struct acrn_vm; struct multiboot_info { uint32_t mi_flags; diff --git a/hypervisor/include/arch/x86/security.h b/hypervisor/include/arch/x86/security.h index 5180b8eb0..4e93d60c7 100644 --- a/hypervisor/include/arch/x86/security.h +++ b/hypervisor/include/arch/x86/security.h @@ -28,7 +28,6 @@ struct stack_canary { uint8_t reserved[40]; uint64_t canary; }; -void __stack_chk_fail(void); void set_fs_base(void); #endif diff --git a/hypervisor/include/dm/vacpi.h b/hypervisor/include/dm/vacpi.h index 83247ff31..81efeb672 100644 --- a/hypervisor/include/dm/vacpi.h +++ b/hypervisor/include/dm/vacpi.h @@ -46,7 +46,7 @@ #define ACPI_ASL_COMPILER_ID "INTL" #define ACPI_ASL_COMPILER_VERSION 0x20190802U - +struct acrn_vm; struct acpi_table_info { struct acpi_table_rsdp rsdp; struct acpi_table_xsdt xsdt; diff --git a/hypervisor/lib/stack_protector.c b/hypervisor/lib/stack_protector.c index 4314f4a17..c72df6d81 100644 --- a/hypervisor/lib/stack_protector.c +++ b/hypervisor/lib/stack_protector.c @@ -4,7 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include -#include + +void __stack_chk_fail(void); void __stack_chk_fail(void) {