From c20d095a6332f5d8b024f21cde2f5789bad45a33 Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Wed, 23 Jan 2019 15:52:37 +0800 Subject: [PATCH] HV: refine sos_vm config header The sos_vm config under arch/x86/configs/$(CONFIG_BOARD) folder should be customer specific configuration, leave it back to customer. When hypervisor start building, it will check whether BOARD specific sos_vm.h exist in configs/$(CONFIG_BOARD) folder. If exist, then include this header; if not, then include default sos_vm config header under configs/default folder. Tracked-On: #2291 Signed-off-by: Victor Sun Acked-by: Eddie Dong --- hypervisor/Makefile | 9 +++++++++ hypervisor/arch/x86/configs/apl-mrb/sos_vm.h | 17 ----------------- hypervisor/arch/x86/configs/apl-nuc | 1 - .../arch/x86/configs/{up2 => default}/sos_vm.h | 7 ++----- hypervisor/arch/x86/configs/dnv-cb2/sos_vm.h | 17 ----------------- hypervisor/arch/x86/configs/nuc6cayh/sos_vm.h | 16 ---------------- hypervisor/arch/x86/configs/sharing_config.c | 2 +- hypervisor/include/arch/x86/guest/vm.h | 3 +-- 8 files changed, 13 insertions(+), 59 deletions(-) delete mode 100644 hypervisor/arch/x86/configs/apl-mrb/sos_vm.h delete mode 120000 hypervisor/arch/x86/configs/apl-nuc rename hypervisor/arch/x86/configs/{up2 => default}/sos_vm.h (53%) delete mode 100644 hypervisor/arch/x86/configs/dnv-cb2/sos_vm.h delete mode 100644 hypervisor/arch/x86/configs/nuc6cayh/sos_vm.h diff --git a/hypervisor/Makefile b/hypervisor/Makefile index 18a7a60df..061beb098 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -109,7 +109,16 @@ INCLUDE_PATH += include/dm INCLUDE_PATH += bsp/include INCLUDE_PATH += boot/include INCLUDE_PATH += $(HV_OBJDIR)/include + +BOARD_CONFIG_PATH := arch/x86/configs/$(CONFIG_BOARD) +BOARD_SOS_VM_CONFIG := $(BOARD_CONFIG_PATH)/sos_vm.h +ifeq ($(CONFIG_PARTITION_MODE),y) INCLUDE_PATH += arch/x86/configs/$(CONFIG_BOARD) +else ifeq (, $(wildcard $(BOARD_SOS_VM_CONFIG))) +INCLUDE_PATH += arch/x86/configs/default +else +INCLUDE_PATH += arch/x86/configs/$(CONFIG_BOARD) +endif CC ?= gcc AS ?= as diff --git a/hypervisor/arch/x86/configs/apl-mrb/sos_vm.h b/hypervisor/arch/x86/configs/apl-mrb/sos_vm.h deleted file mode 100644 index 7d0ca0ebe..000000000 --- a/hypervisor/arch/x86/configs/apl-mrb/sos_vm.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (C) 2018 Intel Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef SOS_VM_CONFIG_H -#define SOS_VM_CONFIG_H - -#define SOS_VM_CONFIG_NAME "ACRN SOS VM for APL-MRB" -#define SOS_VM_CONFIG_MEM_SIZE 0x200000000UL -#define SOS_VM_CONFIG_PCPU_BITMAP (PLUG_CPU(0) | PLUG_CPU(1) | PLUG_CPU(2) | PLUG_CPU(3)) -#define SOS_VM_CONFIG_GUEST_FLAGS IO_COMPLETION_POLLING - -#define SOS_VM_CONFIG_OS_NAME "ClearLinux 26600" - -#endif /* SOS_VM_CONFIG_H */ diff --git a/hypervisor/arch/x86/configs/apl-nuc b/hypervisor/arch/x86/configs/apl-nuc deleted file mode 120000 index 92a6acd0b..000000000 --- a/hypervisor/arch/x86/configs/apl-nuc +++ /dev/null @@ -1 +0,0 @@ -nuc6cayh \ No newline at end of file diff --git a/hypervisor/arch/x86/configs/up2/sos_vm.h b/hypervisor/arch/x86/configs/default/sos_vm.h similarity index 53% rename from hypervisor/arch/x86/configs/up2/sos_vm.h rename to hypervisor/arch/x86/configs/default/sos_vm.h index 79cbb48a8..763fc1ae1 100644 --- a/hypervisor/arch/x86/configs/up2/sos_vm.h +++ b/hypervisor/arch/x86/configs/default/sos_vm.h @@ -3,15 +3,12 @@ * * SPDX-License-Identifier: BSD-3-Clause */ - #ifndef SOS_VM_CONFIG_H #define SOS_VM_CONFIG_H -#define SOS_VM_CONFIG_NAME "ACRN SOS VM for APL-UP2" -#define SOS_VM_CONFIG_MEM_SIZE 0x200000000UL -#define SOS_VM_CONFIG_PCPU_BITMAP (PLUG_CPU(0) | PLUG_CPU(1)) +#define SOS_VM_CONFIG_NAME "ACRN SOS VM" #define SOS_VM_CONFIG_GUEST_FLAGS IO_COMPLETION_POLLING -#define SOS_VM_CONFIG_OS_NAME "ClearLinux 26600" +#define SOS_VM_CONFIG_OS_NAME "ACRN Service OS" #endif /* SOS_VM_CONFIG_H */ diff --git a/hypervisor/arch/x86/configs/dnv-cb2/sos_vm.h b/hypervisor/arch/x86/configs/dnv-cb2/sos_vm.h deleted file mode 100644 index 7cf41f09a..000000000 --- a/hypervisor/arch/x86/configs/dnv-cb2/sos_vm.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (C) 2018 Intel Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef SOS_VM_CONFIG_H -#define SOS_VM_CONFIG_H - -#define SOS_VM_CONFIG_NAME "ACRN SOS VM for DNV-CB2" -#define SOS_VM_CONFIG_MEM_SIZE 0x400000000UL -#define SOS_VM_CONFIG_PCPU_BITMAP (PLUG_CPU(0) | PLUG_CPU(1) | PLUG_CPU(2) | PLUG_CPU(3) \ - | PLUG_CPU(4) | PLUG_CPU(5) | PLUG_CPU(6) | PLUG_CPU(7)) -#define SOS_VM_CONFIG_GUEST_FLAGS IO_COMPLETION_POLLING - -#define SOS_VM_CONFIG_OS_NAME "ClearLinux 26600" - -#endif /* SOS_VM_CONFIG_H */ diff --git a/hypervisor/arch/x86/configs/nuc6cayh/sos_vm.h b/hypervisor/arch/x86/configs/nuc6cayh/sos_vm.h deleted file mode 100644 index 19d8c06c3..000000000 --- a/hypervisor/arch/x86/configs/nuc6cayh/sos_vm.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2018 Intel Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef SOS_VM_CONFIG_H -#define SOS_VM_CONFIG_H - -#define SOS_VM_CONFIG_NAME "ACRN SOS VM for APL-NUC" -#define SOS_VM_CONFIG_MEM_SIZE 0x400000000UL -#define SOS_VM_CONFIG_PCPU_BITMAP (PLUG_CPU(0) | PLUG_CPU(1) | PLUG_CPU(2) | PLUG_CPU(3)) -#define SOS_VM_CONFIG_GUEST_FLAGS IO_COMPLETION_POLLING - -#define SOS_VM_CONFIG_OS_NAME "ClearLinux 26600" - -#endif /* SOS_VM_CONFIG_H */ diff --git a/hypervisor/arch/x86/configs/sharing_config.c b/hypervisor/arch/x86/configs/sharing_config.c index 6c0a50500..8816a1cce 100644 --- a/hypervisor/arch/x86/configs/sharing_config.c +++ b/hypervisor/arch/x86/configs/sharing_config.c @@ -14,7 +14,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] __aligned(PAGE_SIZE) = { .guest_flags = SOS_VM_CONFIG_GUEST_FLAGS, .memory = { .start_hpa = 0x0UL, - .size = SOS_VM_CONFIG_MEM_SIZE, + .size = CONFIG_SOS_RAM_SIZE, }, .os_config = { .name = SOS_VM_CONFIG_OS_NAME, diff --git a/hypervisor/include/arch/x86/guest/vm.h b/hypervisor/include/arch/x86/guest/vm.h index 074524d10..1e6ad9528 100644 --- a/hypervisor/include/arch/x86/guest/vm.h +++ b/hypervisor/include/arch/x86/guest/vm.h @@ -180,8 +180,7 @@ enum acrn_vm_type { UNDEFINED_VM = 0, PRE_LAUNCHED_VM, SOS_VM, - NORMAL_VM, - /* PRIVILEGE_VM, */ + NORMAL_VM /* Post-launched VM */ }; struct acrn_vm_mem_config {