From patchwork Mon Jan 4 08:00:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Yan X-Patchwork-Id: 562259 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 5410D1402ED for ; Mon, 4 Jan 2016 19:01:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=P2CJUtfd; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 68DF44B853; Mon, 4 Jan 2016 09:01:37 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X-FpIzwU_M5i; Mon, 4 Jan 2016 09:01:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4B7204B7FC; Mon, 4 Jan 2016 09:01:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 414E04B82D for ; Mon, 4 Jan 2016 09:01:13 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MHI5TLdRhbOc for ; Mon, 4 Jan 2016 09:01:13 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by theia.denx.de (Postfix) with ESMTPS id 2DEB44B7E4 for ; Mon, 4 Jan 2016 09:01:06 +0100 (CET) Received: by mail-pf0-f170.google.com with SMTP id e65so145560891pfe.1 for ; Mon, 04 Jan 2016 00:01:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=STxMRu8jBacaPk1iyZmrV1NcLo+UNAmNaoHTgZOPf24=; b=P2CJUtfdwCIX0aLqj5N1Hn2FXOvENMCHqXgNF1Q8sx3GKWxelw0pxLyqJvCrH3zwjG 8EzjHNb/McCtMJ21fefCPSn303ANp/QHgwLBP+iXjuLI4E6Z8I/+/LAqdmlVZRNrTypv cbFN3V3Bij3IS7DDgI+AAr9cY2KXIbQl18hqtTArKjE2jK8BauVGIRI/ury/LR9x9/XT 5JAmx6oKe0uzwCQ6fDeadPKiGrQb27rYnPAk6EH/ufFe2RKwQTSbQgIZe9JrDD/COshl 21FW2drelhCHXMjCgHlF4CXlukuGQA7pTdbYHqX+hgpfslfsF3f48YW9LvBXMwbCizSq rJwA== X-Received: by 10.98.14.151 with SMTP id 23mr57049614pfo.154.1451894465068; Mon, 04 Jan 2016 00:01:05 -0800 (PST) Received: from pa-dbc1131.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id p17sm89768592pfi.54.2016.01.04.00.01.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Jan 2016 00:01:04 -0800 (PST) From: Miao Yan To: u-boot@lists.denx.de, sjg@chromium.org, bmeng.cn@gmail.com Date: Mon, 4 Jan 2016 00:00:52 -0800 Message-Id: <1451894455-39387-6-git-send-email-yanmiaobest@gmail.com> X-Mailer: git-send-email 2.6.3.444.gfd13a2e In-Reply-To: <1451894455-39387-1-git-send-email-yanmiaobest@gmail.com> References: <1451894455-39387-1-git-send-email-yanmiaobest@gmail.com> Subject: [U-Boot] [PATCH v5 5/8] x86: use actual CPU number for allocating memory X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Use actual CPU number, instead of maximum cpu configured, to allocate stack memory in 'load_sipi_vector' Signed-off-by: Miao Yan Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/cpu/mp_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/cpu/mp_init.c b/arch/x86/cpu/mp_init.c index 2f34317..2a3ce48 100644 --- a/arch/x86/cpu/mp_init.c +++ b/arch/x86/cpu/mp_init.c @@ -210,7 +210,7 @@ static int save_bsp_msrs(char *start, int size) return msr_count; } -static int load_sipi_vector(atomic_t **ap_countp) +static int load_sipi_vector(atomic_t **ap_countp, int num_cpus) { struct sipi_params_16bit *params16; struct sipi_params *params; @@ -239,7 +239,7 @@ static int load_sipi_vector(atomic_t **ap_countp) params->idt_ptr = (uint32_t)x86_get_idt(); params->stack_size = CONFIG_AP_STACK_SIZE; - size = params->stack_size * CONFIG_MAX_CPUS; + size = params->stack_size * num_cpus; stack = memalign(size, 4096); if (!stack) return -ENOMEM; @@ -483,7 +483,7 @@ int mp_init(struct mp_params *p) mp_info.records = p->flight_plan; /* Load the SIPI vector */ - ret = load_sipi_vector(&ap_count); + ret = load_sipi_vector(&ap_count, num_cpus); if (ap_count == NULL) return -1;