diff --git a/hypervisor/Makefile b/hypervisor/Makefile index fc19bb8c4..4a6569d0b 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -211,8 +211,12 @@ HW_C_SRCS += arch/x86/cat.c HW_C_SRCS += arch/x86/sgx.c HW_C_SRCS += common/softirq.c HW_C_SRCS += common/schedule.c +ifeq ($(CONFIG_SCHED_NOOP),y) HW_C_SRCS += common/sched_noop.c +endif +ifeq ($(CONFIG_SCHED_IORR),y) HW_C_SRCS += common/sched_iorr.c +endif HW_C_SRCS += hw/pci.c HW_C_SRCS += arch/x86/configs/vm_config.c HW_C_SRCS += arch/x86/configs/$(CONFIG_BOARD)/board.c diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index e5d93322a..d311302d4 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -37,6 +37,27 @@ config HYBRID endchoice +choice + prompt "ACRN Scheduler" + default SCHED_NOOP + help + Select the CPU scheduler to be used by the hypervisor + +config SCHED_NOOP + bool "NOOP scheduler" + help + The NOOP (No-Operation) scheduler means there is a strict 1 to 1 mapping + between vCPUs and pCPUs. + +config SCHED_IORR + bool "IORR scheduler" + help + IORR (IO sensitive Round Robin) scheduler supports multipule vCPUs running on + on one pCPU, and they will be scheduled by a IO sensitive round robin policy. + +endchoice + + config BOARD string "Target board" help diff --git a/hypervisor/common/schedule.c b/hypervisor/common/schedule.c index d9dc619fc..2f0cd1540 100644 --- a/hypervisor/common/schedule.c +++ b/hypervisor/common/schedule.c @@ -73,7 +73,12 @@ void init_sched(uint16_t pcpu_id) ctl->flags = 0UL; ctl->curr_obj = NULL; ctl->pcpu_id = pcpu_id; +#ifdef CONFIG_SCHED_NOOP ctl->scheduler = &sched_noop; +#endif +#ifdef CONFIG_SCHED_IORR + ctl->scheduler = &sched_iorr; +#endif if (ctl->scheduler->init != NULL) { ctl->scheduler->init(ctl); }