From 11afec76d1643d26281616dba71c07eb77b59547 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 23 Jun 2020 14:44:00 -0700 Subject: [PATCH] boards: qemu_x86_64: enable icount for CONFIG_MP_NUM_CPUS=1 QEMU icount does not work correctly when more than 1 CPU is used, but works fine with only 1 CPU enabled. So we can enable icount on qemu_x86_64 when CONFIG_MP_NUM_CPUS=1. Sanitycheck goes from ~158 seconds to ~113 seconds on my dev machine. Signed-off-by: Daniel Leung --- boards/x86/qemu_x86/board.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/x86/qemu_x86/board.cmake b/boards/x86/qemu_x86/board.cmake index 25c7bbca2c8..4cc857912dd 100644 --- a/boards/x86/qemu_x86/board.cmake +++ b/boards/x86/qemu_x86/board.cmake @@ -9,6 +9,10 @@ endif() if(CONFIG_X86_64) set(QEMU_binary_suffix x86_64) set(QEMU_CPU_TYPE_${ARCH} qemu64,+x2apic) + if("${CONFIG_MP_NUM_CPUS}" STREQUAL "1") + # icount works with 1 CPU so we can enable it here. + list(APPEND QEMU_EXTRA_FLAGS -icount shift=5,align=off,sleep=off -rtc clock=vm) + endif() else() set(QEMU_CPU_TYPE_${ARCH} qemu32,+nx,+pae) if(CONFIG_QEMU_ICOUNT)