Skip to content

Commit cfe8637

Browse files
KaigeFuwenlingz
authored andcommitted
HV: Kconfig: Remove CPU_UP_TIMEOUT
This patch remove the over design CPU_UP_TIMEOUT and use CPU_UP_TIMEOUT and CPU_DOWN_TIMEOUT instead. Tracked-On: #2991 Signed-off-by: Kaige Fu <kaige.fu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 565f3c7 commit cfe8637

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

hypervisor/arch/x86/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,6 @@ config LOG_DESTINATION
107107
are 3 destinations available. Bit 0 represents the serial console, bit
108108
1 the SOS ACRN log and bit 2 NPK log. Effective only in debug builds.
109109

110-
config CPU_UP_TIMEOUT
111-
int "Timeout in ms when bringing up secondary CPUs"
112-
range 100 200
113-
default 100
114-
help
115-
A 32-bit integer specifying the timeout in millisecond when waiting
116-
for secondary CPUs to start up.
117-
118110
choice
119111
prompt "Serial IO type"
120112
depends on !RELEASE

hypervisor/arch/x86/cpu.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#include <cat.h>
2828
#include <firmware.h>
2929

30+
#define CPU_UP_TIMEOUT 100U /* millisecond */
31+
#define CPU_DOWN_TIMEOUT 100U /* millisecond */
32+
3033
struct per_cpu_region per_cpu_data[CONFIG_MAX_PCPU_NUM] __aligned(PAGE_SIZE);
3134
static uint16_t phys_cpu_num = 0U;
3235
static uint64_t pcpu_sync = 0UL;
@@ -273,7 +276,7 @@ static void start_cpu(uint16_t pcpu_id)
273276
/* Wait until the pcpu with pcpu_id is running and set the active bitmap or
274277
* configured time-out has expired
275278
*/
276-
timeout = (uint32_t)CONFIG_CPU_UP_TIMEOUT * 1000U;
279+
timeout = CPU_UP_TIMEOUT * 1000U;
277280
while (!is_pcpu_active(pcpu_id) && (timeout != 0U)) {
278281
/* Delay 10us */
279282
udelay(10U);
@@ -317,7 +320,6 @@ void stop_cpus(void)
317320
uint16_t pcpu_id, expected_up;
318321
uint32_t timeout;
319322

320-
timeout = (uint32_t)CONFIG_CPU_UP_TIMEOUT * 1000U;
321323
for (pcpu_id = 0U; pcpu_id < phys_cpu_num; pcpu_id++) {
322324
if (get_cpu_id() == pcpu_id) { /* avoid offline itself */
323325
continue;
@@ -327,6 +329,7 @@ void stop_cpus(void)
327329
}
328330

329331
expected_up = 1U;
332+
timeout = CPU_DOWN_TIMEOUT * 1000U;
330333
while ((atomic_load16(&up_count) != expected_up) && (timeout != 0U)) {
331334
/* Delay 10us */
332335
udelay(10U);

0 commit comments

Comments
 (0)